Skip to content

Commit 3e5ef28

Browse files
authored
Merge pull request #40 from OpenRouterTeam/changeset/hitl-tools-release
chore(release): @openrouter/agent 0.5.0 (HITL tools)
2 parents c649c9c + 4cb0c3b commit 3e5ef28

3 files changed

Lines changed: 39 additions & 6 deletions

File tree

.changeset/curvy-streams-watch.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/agent/CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
11
# @openrouter/agent
22

3+
## 0.5.0
4+
5+
### Minor Changes
6+
7+
- Add human-in-the-loop (HITL) tool type, a new `ClientTool` variant that sits
8+
between regular `execute` tools and `manual` tools. HITL tools define two
9+
async hooks:
10+
11+
- `onToolCalled(input, context)` runs when the model invokes the tool.
12+
Return a value to feed the model directly (like a regular `execute` tool),
13+
or return `null` to pause the conversation so the caller can supply the
14+
output later — the same flow used by manual tools.
15+
- `onResponseReceived(rawResult, context)` runs on the next turn when an
16+
incoming `function_call_output` matches a prior call of this tool. It lets
17+
the caller transform or validate the raw response before it reaches the
18+
model. Throwing surfaces as a tool error to the model.
19+
20+
HITL tools require an `outputSchema`, which is used to validate both the
21+
`onToolCalled` return value (when non-null) and caller-supplied responses
22+
(after any `onResponseReceived` transform, or as-is when no hook is defined).
23+
24+
New `ConversationStatus` value `'awaiting_hitl'` is emitted when one or more
25+
HITL tools return `null` from `onToolCalled`, signaling that the caller
26+
should resume with outputs for the paused calls.
27+
28+
New public exports:
29+
30+
- Types: `HITLTool`, `HITLToolFunction`
31+
- Guards: `isHITLTool`, `isAutoResolvableTool` (true for execute / generator
32+
/ HITL tools — i.e. anything that can resolve within a turn)
33+
34+
`isManualTool` now returns `false` for HITL tools, so existing manual-tool
35+
branches continue to behave correctly.
36+
37+
### Patch Changes
38+
39+
- [#34](https://github.com/OpenRouterTeam/typescript-agent/pull/34) [`61aca10`](https://github.com/OpenRouterTeam/typescript-agent/commit/61aca10fd9434fe69fbe1e069e4b1858613a7da7) Thanks [@w0nche0l](https://github.com/w0nche0l)! - Detect streamed Responses API results by readable stream behavior instead of constructor names or unsupported adapters.
40+
341
## 0.4.0
442

543
### Minor Changes

packages/agent/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openrouter/agent",
3-
"version": "0.4.0",
3+
"version": "0.5.0",
44
"author": "OpenRouter",
55
"description": "Agent toolkit for building AI applications with OpenRouter — tool orchestration, streaming, multi-turn conversations, and format compatibility.",
66
"keywords": [

0 commit comments

Comments
 (0)