Releases: OpenRouterTeam/typescript-agent
0.7.1
What's Changed
- fix(agent): update OutputInputImage re-export for SDK compat and persist user input by @Cybourgeoisie in #48
- chore(agent): bump version to 0.7.1 by @Cybourgeoisie in #50
New Contributors
- @Cybourgeoisie made their first contribution in #48
Full Changelog: https://github.com/OpenRouterTeam/typescript-agent/compare/@openrouter/agent@0.7.0...0.7.1
@openrouter/agent@0.7.1
@openrouter/agent
0.7.0
Minor Changes
- Add
allowFinalResponseoption tocallModel, sibling ofstopWhen. When the agent loop is halted bystopWhenwhile the last model response still contains tool calls, the pending tool calls are executed (so they have matching outputs) and one more model request is made with no tools so the loop ends with a natural-language summary instead of an unfinished tool call. Passing a string instead oftrueadditionally appends that string as a finalusermessage (e.g.allowFinalResponse: 'Please summarize what you found.'). The full accumulated input array and the originalinstructionsare sent.
0.6.0
Minor Changes
- #42
8e71f06Thanks @mattapperson! - Remove implicit 5-step cap incallModel. WhenstopWhenis omitted, the tool-execution loop now runs until the model produces a turn with no tool calls instead of stopping at 5 steps. Pass an explicitstopWhen(e.g.stepCountIs(n),maxCost(...),maxTokensUsed(...)) to bound iterations.
0.5.0
Minor Changes
-
Add human-in-the-loop (HITL) tool type, a new
ClientToolvariant that sits
between regularexecutetools andmanualtools. HITL tools define two
async hooks:onToolCalled(input, context)runs when the model invokes the tool.
Return a value to feed the model directly (like a regularexecutetool),
or returnnullto pause the conversation so the caller can supply the
output later — the same flow used by manual tools.onResponseReceived(rawResult, context)runs on the next turn when an
incomingfunction_call_outputmatches a prior call of this tool. It lets
the caller transform or validate the raw response before it reaches the
model. Throwing surfaces as a tool error to the model.
HITL tools require an
outputSchema, which is used to validate both the
onToolCalledreturn value (when non-null) and caller-supplied responses
(after anyonResponseReceivedtransform, or as-is when no hook is defined).New
ConversationStatusvalue'awaiting_hitl'is emitted when one or more
HITL tools returnnullfromonToolCalled, signaling that the caller
should resume with outputs for the paused calls.New public exports:
- Types:
HITLTool,HITLToolFunction - Guards:
isHITLTool,isAutoResolvableTool(true for execute / generator
/ HITL tools — i.e. anything that can resolve within a turn)
isManualToolnow returnsfalsefor HITL tools, so existing manual-tool
branches continue to behave correctly.
Patch Changes
- #34
61aca10Thanks @w0nche0l! - Detect streamed Responses API results by readable stream behavior instead of constructor names or unsupported adapters.
0.4.0
Minor Changes
-
#30
e4e3ed5Thanks @mattapperson! - AddserverTool()factory for OpenRouter's server-executed tools (web search,openrouter:datetime, image generation, MCP, file search, code interpreter, and future SDK additions). Server tools can be mixed with clienttool()s in thecallModel({ tools })array; OpenRouter runs them and their output items flow through the unifiedModelResult.allToolExecutionRounds[].toolResultslist.getItemsStream()yields server-tool output items (e.g.web_search_call,openrouter:datetime) alongside clientfunction_call/function_call_outputitems. The yielded union is narrowed from theTToolspassed tocallModel, so consumers only see item types that are reachable for their tool set.StepResult.serverToolResultsexposes provider-side tool invocations tostopWhenconditions (the existingtoolResultsfield remains client-tool-only).- New public exports:
serverTool,isServerTool,isClientTool, and the typesServerTool,ServerToolConfig,ServerToolType,ServerToolResultItem,ClientTool,ToolResultItem.
Patch Changes
- #25
ec94de8Thanks @jakobcastro! - Bump @openrouter/sdk from 0.11.2 to 0.12.12, which addsxhighandmaxto theVerbosityenum forTextExtendedConfig
0.3.3
Patch Changes
-
#27
ef15761Thanks @mattapperson! - Fixhooksconstructor option silently no-oping when a plain hook object (e.g.{ beforeRequest: ... }) was passed: the underlying SDK only honorshookswhen it is anSDKHooksinstance, and the previous wrapper forwarded the plain object unchanged.new OpenRouter({ hooks })now accepts any of:- an
SDKHooksinstance (used as-is), - a single hook object (
BeforeRequestHook,AfterSuccessHook, etc.), or - an array of hook objects.
Shorthand inputs are normalized into an
SDKHooksinstance before handoff. Hook types (BeforeRequestHook,BeforeRequestContext,AfterSuccessHook,SDKHooks, etc.) are now re-exported from the package entry point. - an
0.3.1
Patch Changes
-
#22
ab5a75cThanks @mattapperson! - Fix type exports and add pre-push hooks- Add
NewDeveloperMessageItemtype export for manually added developer messages - Fix
FieldOrAsyncFunctiontype import path in async-params module - Add
.npmignoreto exclude development files from published package - Add husky pre-push hooks for lint and typecheck validation
- Add
0.3.0
Minor Changes
- #19
2b23076Thanks @mattapperson! - Re-export SDK model types and add clean item type aliases so consumers don't need to depend on@openrouter/sdkdirectly.
Patch Changes
- #20
f0d2d72Thanks @mattapperson! - Re-exportEasyInputMessageContentInputImage,OutputInputImage, andOpenAIResponsesToolChoiceUnionfrom@openrouter/sdk/modelsso consumers can use these types without a direct SDK dependency.
0.2.0
Minor Changes
- Re-export SDK model types (
ResponsesRequest,OutputMessage,FunctionCallItem, etc.) from@openrouter/sdk/modelsso consumers don't need a direct dependency on@openrouter/sdk. - Add clean item type aliases (
Item,UserMessageItem,AssistantMessageItem,FunctionResultItem, etc.) via new@openrouter/agentexports. - Add
OpenRouterwrapper class that extendsOpenRouterCorefor a simplified API (@openrouter/agent/openrouter).
Patch Changes
- Replace ESLint with Biome for linting and formatting.
- Add CI auto-release workflow on push to main.
- Correct item type aliases to match SDK runtime types.
0.1.2
Patch Changes
- #13
93a88a8Thanks @mattapperson! - fix: export OpenRouter class from package entry point
0.1.1
Patch Changes
- #4
546b07dThanks @robert-j-y! - Fix type errors in test mocks, add null→undefined sanitization in applyNextTurnParamsToRequest, and release-gate publishing via workflow_dispatch
@openrouter/agent@0.7.0
Minor Changes
- Add
allowFinalResponseoption tocallModel, sibling ofstopWhen. When the agent loop is halted bystopWhenwhile the last model response still contains tool calls, the pending tool calls are executed (so they have matching outputs) and one more model request is made with no tools so the loop ends with a natural-language summary instead of an unfinished tool call. Passing a string instead oftrueadditionally appends that string as a finalusermessage (e.g.allowFinalResponse: 'Please summarize what you found.'). The full accumulated input array and the originalinstructionsare sent.
@openrouter/agent@0.6.0
Minor Changes
- #42
8e71f06Thanks @mattapperson! - Remove implicit 5-step cap incallModel. WhenstopWhenis omitted, the tool-execution loop now runs until the model produces a turn with no tool calls instead of stopping at 5 steps. Pass an explicitstopWhen(e.g.stepCountIs(n),maxCost(...),maxTokensUsed(...)) to bound iterations.
@openrouter/agent@0.5.0
Minor Changes
-
Add human-in-the-loop (HITL) tool type, a new
ClientToolvariant that sits
between regularexecutetools andmanualtools. HITL tools define two
async hooks:onToolCalled(input, context)runs when the model invokes the tool.
Return a value to feed the model directly (like a regularexecutetool),
or returnnullto pause the conversation so the caller can supply the
output later — the same flow used by manual tools.onResponseReceived(rawResult, context)runs on the next turn when an
incomingfunction_call_outputmatches a prior call of this tool. It lets
the caller transform or validate the raw response before it reaches the
model. Throwing surfaces as a tool error to the model.
HITL tools require an
outputSchema, which is used to validate both the
onToolCalledreturn value (when non-null) and caller-supplied responses
(after anyonResponseReceivedtransform, or as-is when no hook is defined).New
ConversationStatusvalue'awaiting_hitl'is emitted when one or more
HITL tools returnnullfromonToolCalled, signaling that the caller
should resume with outputs for the paused calls.New public exports:
- Types:
HITLTool,HITLToolFunction - Guards:
isHITLTool,isAutoResolvableTool(true for execute / generator
/ HITL tools — i.e. anything that can resolve within a turn)
isManualToolnow returnsfalsefor HITL tools, so existing manual-tool
branches continue to behave correctly.