|
1 | 1 | # @openrouter/agent |
2 | 2 |
|
| 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 | + |
3 | 41 | ## 0.4.0 |
4 | 42 |
|
5 | 43 | ### Minor Changes |
|
0 commit comments