Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .changeset/bright-tools-wire-schema.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/drop-preliminary-results.md

This file was deleted.

28 changes: 0 additions & 28 deletions .changeset/from-chat-messages-tool-calls.md

This file was deleted.

13 changes: 0 additions & 13 deletions .changeset/tidy-agents-smile.md

This file was deleted.

19 changes: 0 additions & 19 deletions .changeset/truncated-tool-calls-guard.md

This file was deleted.

86 changes: 86 additions & 0 deletions packages/agent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,91 @@
# @openrouter/agent

## 1.0.0

### Major Changes

- [#110](https://github.com/OpenRouterTeam/typescript-agent/pull/110) [`9766f31`](https://github.com/OpenRouterTeam/typescript-agent/commit/9766f31ec2390cd294ca47dd81d0122941c0d586) Thanks [@LukasParke](https://github.com/LukasParke)! - Stop accumulating generator-tool `preliminaryResults` arrays. Yields are still broadcast live; the terminal `tool.result` event and `ToolExecutionResult` no longer carry the full yield history.

### Minor Changes

- [#118](https://github.com/OpenRouterTeam/typescript-agent/pull/118) [`4dce84e`](https://github.com/OpenRouterTeam/typescript-agent/commit/4dce84e4393ec36745875512d6ad1fcd8b38e502) Thanks [@sambarnes](https://github.com/sambarnes)! - Allow manual tools to provide a caller-owned JSON Schema for wire serialization.

```ts
import { tool } from "@openrouter/agent";
import { z } from "zod";

const confirmTool = tool({
name: "confirm_action",
inputSchema: z.object({ action: z.string() }),
wireInputSchema: {
type: "object",
properties: {
action: { type: "string" },
},
required: ["action"],
},
execute: false,
});
```

- [#93](https://github.com/OpenRouterTeam/typescript-agent/pull/93) [`dacf4d1`](https://github.com/OpenRouterTeam/typescript-agent/commit/dacf4d166a8ece1c2aff77727e2db1da5417391b) Thanks [@LukasParke](https://github.com/LukasParke)! - Fix `fromChatMessages` dropping assistant tool calls and give both message converters precise array return types that work with `callModel`, `Item[]`, and the SDK's `InputsUnion`.

Assistant `toolCalls` now become `function_call` items, preserving their already-serialized `arguments`. A message containing both text and tool calls emits both items; an empty assistant message is omitted only when tool calls replace it.

```ts
import {
callModel,
fromChatMessages,
type ChatMessages,
type Item,
} from "@openrouter/agent";

const messages: ChatMessages[] = [
{
role: "assistant",
content: null,
toolCalls: [
{
id: "call_1",
type: "function",
function: { name: "get_weather", arguments: '{"city":"Austin"}' },
},
],
},
];

const input: Item[] = fromChatMessages(messages);
const result = callModel(client, { model: "openai/gpt-4o-mini", input });
```

### Patch Changes

- [#120](https://github.com/OpenRouterTeam/typescript-agent/pull/120) [`ddab365`](https://github.com/OpenRouterTeam/typescript-agent/commit/ddab3652a47edf5ebaa842447864a3dc91b812e5) Thanks [@LukasParke](https://github.com/LukasParke)! - Identify Agent SDK requests with an Agent SDK user-agent suffix that includes the package version.

```ts
import { OpenRouter } from "@openrouter/agent";

const client = new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY });
// Requests use the Agent SDK user agent by default.
// Pass userAgent to override the default identification.
```

- [#125](https://github.com/OpenRouterTeam/typescript-agent/pull/125) [`ddd60df`](https://github.com/OpenRouterTeam/typescript-agent/commit/ddd60dffab8018363dc42ad20ebf2d57e33c2809) Thanks [@w0nche0l](https://github.com/w0nche0l)! - Do not execute tool calls from a response truncated at `max_output_tokens`. A turn that hits the token budget mid-tool-call now finalizes with `status: 'incomplete'` instead of running the cut-off call (and re-requesting on the same exhausted budget).

```ts
import { callModel } from "@openrouter/agent";

const result = callModel(client, {
model: "anthropic/claude-sonnet-4.5",
maxOutputTokens: 512, // budget exhausted mid tool call
tools: [myTool],
});
const response = await result.getResponse();
// response.status === 'incomplete'
// response.incompleteDetails.reason === 'max_output_tokens'
// The cut-off call is NOT executed; raise the budget and re-request.
```

## 0.11.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openrouter/agent",
"version": "0.11.0",
"version": "1.0.0",
"author": "OpenRouter",
"description": "Agent toolkit for building AI applications with OpenRouter — tool orchestration, streaming, multi-turn conversations, and format compatibility.",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/mcp/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// Run `pnpm --filter @openrouter/agent gen:version` after bumping the version.

/** This package's version, self-reported to MCP servers as `clientInfo`. */
export const PACKAGE_VERSION = '0.11.0';
export const PACKAGE_VERSION = '1.0.0';
7 changes: 7 additions & 0 deletions packages/mcp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openrouter/mcp

## 1.1.2

### Patch Changes

- Updated dependencies [[`4dce84e`](https://github.com/OpenRouterTeam/typescript-agent/commit/4dce84e4393ec36745875512d6ad1fcd8b38e502), [`9766f31`](https://github.com/OpenRouterTeam/typescript-agent/commit/9766f31ec2390cd294ca47dd81d0122941c0d586), [`dacf4d1`](https://github.com/OpenRouterTeam/typescript-agent/commit/dacf4d166a8ece1c2aff77727e2db1da5417391b), [`ddab365`](https://github.com/OpenRouterTeam/typescript-agent/commit/ddab3652a47edf5ebaa842447864a3dc91b812e5), [`ddd60df`](https://github.com/OpenRouterTeam/typescript-agent/commit/ddd60dffab8018363dc42ad20ebf2d57e33c2809)]:
- @openrouter/agent@1.0.0

## 1.1.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openrouter/mcp",
"version": "1.1.1",
"version": "1.1.2",
"engines": {
"node": ">=20"
},
Expand Down
Loading