eve 0.58.1 → 0.59.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/src/approval/definition.d.ts +2 -0
  3. package/dist/src/channel/session.d.ts +2 -0
  4. package/dist/src/channel/session.js +1 -1
  5. package/dist/src/channel/types.d.ts +8 -1
  6. package/dist/src/chunks/{use-eve-agent-X0asmJg-.js → use-eve-agent-Dmc6sX4d.js} +558 -233
  7. package/dist/src/chunks/{use-eve-agent-CxWcZCsU.js → use-eve-agent-jSR8P4nK.js} +565 -235
  8. package/dist/src/cli/dev/tui/runner.d.ts +4 -0
  9. package/dist/src/cli/dev/tui/runner.js +1 -1
  10. package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
  11. package/dist/src/client/eve-agent-projection.d.ts +10 -0
  12. package/dist/src/client/eve-agent-projection.js +1 -0
  13. package/dist/src/client/eve-agent-store-helpers.d.ts +6 -2
  14. package/dist/src/client/eve-agent-store-helpers.js +2 -2
  15. package/dist/src/client/eve-agent-store-state.d.ts +54 -1
  16. package/dist/src/client/eve-agent-store.d.ts +12 -82
  17. package/dist/src/client/eve-agent-store.js +1 -1
  18. package/dist/src/client/index.d.ts +2 -2
  19. package/dist/src/client/index.js +1 -1
  20. package/dist/src/client/message-response.d.ts +5 -1
  21. package/dist/src/client/message-response.js +1 -1
  22. package/dist/src/client/ndjson.d.ts +1 -0
  23. package/dist/src/client/ndjson.js +2 -2
  24. package/dist/src/client/open-stream.d.ts +4 -1
  25. package/dist/src/client/open-stream.js +1 -1
  26. package/dist/src/client/session-event-stream.d.ts +30 -0
  27. package/dist/src/client/session-event-stream.js +1 -0
  28. package/dist/src/client/session-utils.d.ts +2 -1
  29. package/dist/src/client/session-utils.js +1 -1
  30. package/dist/src/client/session.d.ts +14 -1
  31. package/dist/src/client/session.js +1 -1
  32. package/dist/src/client/sessions.d.ts +8 -2
  33. package/dist/src/client/sessions.js +1 -1
  34. package/dist/src/client/types.d.ts +7 -0
  35. package/dist/src/compiled/.vendor-stamp.json +2 -3
  36. package/dist/src/compiled/@vercel/sandbox/api-client/api-client.d.ts +88 -1
  37. package/dist/src/compiled/@vercel/sandbox/api-client/index.d.ts +1 -1
  38. package/dist/src/compiled/@vercel/sandbox/api-client/validators.d.ts +41 -1
  39. package/dist/src/compiled/@vercel/sandbox/constants.d.ts +3 -3
  40. package/dist/src/compiled/@vercel/{sandbox-drives → sandbox}/drive.d.ts +13 -2
  41. package/dist/src/compiled/@vercel/sandbox/index.d.ts +3 -2
  42. package/dist/src/compiled/@vercel/sandbox/index.js +15 -9
  43. package/dist/src/compiled/@vercel/sandbox/sandbox.d.ts +40 -5
  44. package/dist/src/compiled/_chunks/node/auth-DDrvYko5.js +2 -0
  45. package/dist/src/compiled/_chunks/node/version-C__MqbLM.js +1 -0
  46. package/dist/src/compiler/default-tool-policy.d.ts +3 -1
  47. package/dist/src/compiler/default-tool-policy.js +1 -1
  48. package/dist/src/compiler/extension-compatibility.d.ts +16 -16
  49. package/dist/src/compiler/extension-compatibility.js +1 -1
  50. package/dist/src/compiler/manifest.d.ts +8 -2
  51. package/dist/src/compiler/manifest.js +1 -1
  52. package/dist/src/compiler/normalize-agent-config.js +1 -1
  53. package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
  54. package/dist/src/compiler/normalize-manifest.js +1 -1
  55. package/dist/src/compiler/normalize-subagent.d.ts +1 -0
  56. package/dist/src/compiler/normalize-subagent.js +1 -1
  57. package/dist/src/compiler/remote-agent-node.d.ts +1 -0
  58. package/dist/src/compiler/remote-agent-node.js +1 -1
  59. package/dist/src/compiler/source-graph.d.ts +1 -0
  60. package/dist/src/compiler/source-graph.js +1 -1
  61. package/dist/src/context/build-dynamic-tools.js +1 -1
  62. package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
  63. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  64. package/dist/src/context/memory-tools.js +1 -1
  65. package/dist/src/evals/context.d.ts +1 -1
  66. package/dist/src/evals/context.js +1 -1
  67. package/dist/src/evals/define-eval.d.ts +1 -1
  68. package/dist/src/evals/define-eval.js +1 -1
  69. package/dist/src/evals/index.js +1 -1
  70. package/dist/src/evals/judge.d.ts +1 -1
  71. package/dist/src/evals/runner/execute-task.d.ts +1 -1
  72. package/dist/src/evals/runner/execute-task.js +1 -1
  73. package/dist/src/evals/session-manager.d.ts +27 -0
  74. package/dist/src/evals/session-manager.js +1 -0
  75. package/dist/src/evals/session.d.ts +8 -28
  76. package/dist/src/evals/session.js +2 -1
  77. package/dist/src/evals/target.d.ts +1 -1
  78. package/dist/src/evals/target.js +1 -1
  79. package/dist/src/evals/types.d.ts +19 -15
  80. package/dist/src/eve-channel/create-request.d.ts +24 -0
  81. package/dist/src/eve-channel/create-request.js +1 -0
  82. package/dist/src/eve-channel/index.js +1 -1
  83. package/dist/src/eve-channel/request.d.ts +3 -12
  84. package/dist/src/eve-channel/request.js +2 -2
  85. package/dist/src/eve-channel/types.d.ts +4 -2
  86. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  87. package/dist/src/execution/legacy-session/turn-workflow.js +1 -1
  88. package/dist/src/execution/runtime-context.js +1 -1
  89. package/dist/src/execution/sandbox/bindings/vercel-lifecycle.d.ts +3 -3
  90. package/dist/src/execution/sandbox/bindings/vercel-lifecycle.js +1 -1
  91. package/dist/src/execution/sandbox/bindings/vercel-sdk-types.d.ts +1 -4
  92. package/dist/src/execution/sandbox/bindings/vercel.d.ts +1 -2
  93. package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
  94. package/dist/src/execution/session/entry.js +1 -1
  95. package/dist/src/execution/session/handoff-steps.js +1 -1
  96. package/dist/src/execution/session/program.d.ts +2 -0
  97. package/dist/src/execution/session/program.js +1 -1
  98. package/dist/src/execution/session/turn-step.js +1 -1
  99. package/dist/src/execution/session/turn.js +1 -1
  100. package/dist/src/execution/session-inbox/protocol.js +1 -1
  101. package/dist/src/execution/tools/connection-search.js +1 -1
  102. package/dist/src/execution/tools/sleep-workflow.js +1 -1
  103. package/dist/src/execution/workflow-runtime.js +1 -1
  104. package/dist/src/experimental/evaluate/auto-model.js +2 -2
  105. package/dist/src/experimental/evaluate/evaluate.d.ts +7 -0
  106. package/dist/src/experimental/evaluate/evaluate.js +1 -0
  107. package/dist/src/framework/sources/registry.js +1 -1
  108. package/dist/src/harness/compaction.d.ts +3 -3
  109. package/dist/src/harness/compaction.js +1 -1
  110. package/dist/src/harness/request-envelope.d.ts +11 -0
  111. package/dist/src/harness/request-envelope.js +1 -0
  112. package/dist/src/harness/tool-loop.js +2 -2
  113. package/dist/src/harness/tools.d.ts +1 -1
  114. package/dist/src/harness/tools.js +1 -1
  115. package/dist/src/instrumentation/prepare-trace-context.d.ts +2 -1
  116. package/dist/src/instrumentation/prepare-trace-context.js +1 -1
  117. package/dist/src/internal/application/package.js +1 -1
  118. package/dist/src/internal/authored-definition/core.js +1 -1
  119. package/dist/src/internal/authored-module-loader.d.ts +4 -1
  120. package/dist/src/internal/authored-module-loader.js +1 -1
  121. package/dist/src/internal/bundler/nitro-rolldown.d.ts +2 -0
  122. package/dist/src/internal/nitro/host/build-extension.js +1 -1
  123. package/dist/src/internal/nitro/host/extension-capability-requirements.d.ts +1 -0
  124. package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
  125. package/dist/src/internal/nitro/host/extension-distribution.d.ts +1 -1
  126. package/dist/src/internal/nitro/host/extension-distribution.js +1 -1
  127. package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +1 -1
  128. package/dist/src/public/definitions/connections/mcp.d.ts +1 -0
  129. package/dist/src/public/definitions/connections/openapi.d.ts +1 -0
  130. package/dist/src/public/definitions/remote-agent.d.ts +5 -0
  131. package/dist/src/public/definitions/workspace-agent.d.ts +5 -0
  132. package/dist/src/public/definitions/workspace-agent.js +1 -1
  133. package/dist/src/public/experimental/evaluate/index.d.ts +1 -0
  134. package/dist/src/public/experimental/evaluate/index.js +1 -1
  135. package/dist/src/public/sandbox/vercel-sandbox.d.ts +1 -1
  136. package/dist/src/public/sandbox/vercel.d.ts +1 -1
  137. package/dist/src/public/sandbox/vercel.js +1 -1
  138. package/dist/src/public/tools/approval/index.d.ts +2 -1
  139. package/dist/src/public/tools/approval/index.js +1 -1
  140. package/dist/src/public/tools/index.d.ts +1 -0
  141. package/dist/src/public/tools/index.js +1 -1
  142. package/dist/src/react/use-eve-agent.d.ts +4 -0
  143. package/dist/src/react/use-eve-agent.js +1 -1
  144. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  145. package/dist/src/runtime/resolve-agent.js +1 -1
  146. package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +1 -0
  147. package/dist/src/runtime/subagents/dynamic-agent-config.js +1 -1
  148. package/dist/src/runtime/subagents/dynamic-remote-agent-config.d.ts +1 -0
  149. package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
  150. package/dist/src/runtime/subagents/registry.d.ts +5 -2
  151. package/dist/src/runtime/subagents/registry.js +1 -1
  152. package/dist/src/runtime/types.d.ts +2 -0
  153. package/dist/src/setup/scaffold/create/project.js +1 -1
  154. package/dist/src/shared/agent-definition.d.ts +9 -0
  155. package/dist/src/subagents/handle-dispatch.js +1 -1
  156. package/dist/src/svelte/index.js +1 -1
  157. package/dist/src/svelte/use-eve-agent.d.ts +4 -0
  158. package/dist/src/svelte/use-eve-agent.js +1 -1
  159. package/dist/src/tools/approval/policies.d.ts +18 -0
  160. package/dist/src/tools/approval/policies.js +1 -1
  161. package/dist/src/tools/definition.d.ts +6 -3
  162. package/dist/src/tools/definition.js +1 -1
  163. package/dist/src/tools/durable-callbacks.d.ts +8 -2
  164. package/dist/src/tools/durable-callbacks.js +1 -1
  165. package/dist/src/tools/durable-schema.d.ts +16 -0
  166. package/dist/src/tools/durable-schema.js +1 -0
  167. package/dist/src/vue/index.js +1 -1
  168. package/dist/src/vue/use-eve-agent.d.ts +4 -0
  169. package/dist/src/vue/use-eve-agent.js +1 -1
  170. package/docs/agent-config.md +1 -0
  171. package/docs/channels/eve.mdx +20 -10
  172. package/docs/concepts/context-control.md +4 -0
  173. package/docs/concepts/sessions-runs-and-streaming.md +18 -3
  174. package/docs/connections/mcp.mdx +2 -2
  175. package/docs/connections/overview.mdx +1 -1
  176. package/docs/evals/assertions.mdx +6 -6
  177. package/docs/evals/cases.mdx +59 -23
  178. package/docs/evals/judge.mdx +10 -8
  179. package/docs/evals/overview.mdx +6 -6
  180. package/docs/evals/reporters.mdx +1 -1
  181. package/docs/evals/targets.mdx +5 -0
  182. package/docs/guides/client/messages.mdx +5 -5
  183. package/docs/guides/client/overview.mdx +15 -1
  184. package/docs/guides/dynamic-capabilities.md +22 -0
  185. package/docs/guides/evaluate.md +78 -3
  186. package/docs/guides/frontend/overview.mdx +54 -5
  187. package/docs/guides/frontend/use-eve-agent-svelte.mdx +13 -8
  188. package/docs/guides/frontend/use-eve-agent-vue.mdx +13 -8
  189. package/docs/guides/remote-agents.md +2 -1
  190. package/docs/reference/typescript-api.md +38 -37
  191. package/docs/subagents/index.mdx +25 -8
  192. package/docs/tools/human-in-the-loop.md +27 -5
  193. package/docs/tools/overview.mdx +2 -2
  194. package/docs/tools/workflows.mdx +2 -3
  195. package/package.json +2 -3
  196. package/dist/src/compiled/@vercel/sandbox-drives/LICENSE +0 -201
  197. package/dist/src/compiled/@vercel/sandbox-drives/_async-retry.d.ts +0 -8
  198. package/dist/src/compiled/@vercel/sandbox-drives/_workflow-serde.d.ts +0 -5
  199. package/dist/src/compiled/@vercel/sandbox-drives/api-client/api-client.d.ts +0 -1815
  200. package/dist/src/compiled/@vercel/sandbox-drives/api-client/api-error.d.ts +0 -29
  201. package/dist/src/compiled/@vercel/sandbox-drives/api-client/base-client.d.ts +0 -39
  202. package/dist/src/compiled/@vercel/sandbox-drives/api-client/file-writer.d.ts +0 -66
  203. package/dist/src/compiled/@vercel/sandbox-drives/api-client/index.d.ts +0 -2
  204. package/dist/src/compiled/@vercel/sandbox-drives/api-client/validators.d.ts +0 -932
  205. package/dist/src/compiled/@vercel/sandbox-drives/api-client/with-retry.d.ts +0 -10
  206. package/dist/src/compiled/@vercel/sandbox-drives/auth/error.d.ts +0 -15
  207. package/dist/src/compiled/@vercel/sandbox-drives/auth/file.d.ts +0 -18
  208. package/dist/src/compiled/@vercel/sandbox-drives/auth/index.d.ts +0 -6
  209. package/dist/src/compiled/@vercel/sandbox-drives/auth/oauth.d.ts +0 -111
  210. package/dist/src/compiled/@vercel/sandbox-drives/auth/poll-for-token.d.ts +0 -28
  211. package/dist/src/compiled/@vercel/sandbox-drives/auth/project.d.ts +0 -40
  212. package/dist/src/compiled/@vercel/sandbox-drives/command.d.ts +0 -292
  213. package/dist/src/compiled/@vercel/sandbox-drives/constants.d.ts +0 -15
  214. package/dist/src/compiled/@vercel/sandbox-drives/execution-context.d.ts +0 -116
  215. package/dist/src/compiled/@vercel/sandbox-drives/filesystem.d.ts +0 -258
  216. package/dist/src/compiled/@vercel/sandbox-drives/index.d.ts +0 -14
  217. package/dist/src/compiled/@vercel/sandbox-drives/index.js +0 -9
  218. package/dist/src/compiled/@vercel/sandbox-drives/network-policy.d.ts +0 -169
  219. package/dist/src/compiled/@vercel/sandbox-drives/proxy.d.ts +0 -55
  220. package/dist/src/compiled/@vercel/sandbox-drives/sandbox-user.d.ts +0 -211
  221. package/dist/src/compiled/@vercel/sandbox-drives/sandbox.d.ts +0 -1287
  222. package/dist/src/compiled/@vercel/sandbox-drives/session.d.ts +0 -435
  223. package/dist/src/compiled/@vercel/sandbox-drives/snapshot.d.ts +0 -238
  224. package/dist/src/compiled/@vercel/sandbox-drives/utils/get-credentials.d.ts +0 -21
  225. package/dist/src/compiled/@vercel/sandbox-drives/utils/paginator.d.ts +0 -16
  226. package/dist/src/compiled/@vercel/sandbox-drives/utils/resolveSignal.d.ts +0 -15
  227. package/dist/src/compiled/@vercel/sandbox-drives/utils/sandbox-snapshot.d.ts +0 -11
  228. package/dist/src/compiled/@vercel/sandbox-drives/utils/types.d.ts +0 -11
  229. package/dist/src/compiled/_chunks/node/auth-8aQozzfi.js +0 -2
  230. package/dist/src/compiled/_chunks/node/auth-Bvv0xGTY.js +0 -2
  231. package/dist/src/compiled/_chunks/node/esm-Fqlolk7e.js +0 -7
  232. package/dist/src/compiled/_chunks/node/version-BC6t2Txc.js +0 -1
  233. package/dist/src/compiled/_chunks/node/version-DSQqVZ5T.js +0 -1
  234. package/dist/src/compiled/_chunks/node/xdg-app-paths-F-QHrdza.js +0 -1
@@ -19,7 +19,7 @@ export default defineEval({
19
19
 
20
20
  ## The graders
21
21
 
22
- The judges live under `t.judge.autoevals`. The namespace names the [Braintrust autoevals](https://github.com/braintrustdata/autoevals) grader family, so the factuality and closedQA semantics are autoevals', not eve-invented. Each grader scores `t.reply` by default and is soft by default (tracked, no gate):
22
+ The judges live under `t.judge.autoevals`. The namespace names the [Braintrust autoevals](https://github.com/braintrustdata/autoevals) grader family, so the factuality and closedQA semantics are autoevals', not eve-invented. Each grader scores the most recently settled turn’s assistant message by default and is soft by default (tracked, no gate):
23
23
 
24
24
  | Grader | Grades |
25
25
  | ---------------------------------------- | -------------------------------------------------------------------------------------- |
@@ -28,6 +28,8 @@ The judges live under `t.judge.autoevals`. The namespace names the [Braintrust a
28
28
  | `t.judge.autoevals.closedQA(criteria)` | Whether the reply satisfies a free-form yes/no criterion (no expected answer to match) |
29
29
  | `t.judge.autoevals.sql(expected)` | Semantic equivalence of two SQL statements |
30
30
 
31
+ Judges receive the latest message text from the session whose turn most recently settled as the input prompt. Approval responses and stream reads preserve that prompt. For multipart messages, including `session.sendFile()`, the prompt contains the text parts.
32
+
31
33
  A failed `closedQA` assertion prints the input and judge explanation:
32
34
 
33
35
  ```text
@@ -40,7 +42,7 @@ A failed `closedQA` assertion prints the input and judge explanation:
40
42
 
41
43
  The reference or criteria is the positional argument. An options object follows:
42
44
 
43
- - `on` is the value to grade, defaulting to `t.reply`. Pass an intermediate draft or parsed value to grade it instead.
45
+ - `on` is the value to grade, defaulting to the most recently settled turn’s assistant message. Pass an intermediate draft or parsed value to grade it instead.
44
46
  - `model` and `modelOptions` are a per-call judge override (see below).
45
47
 
46
48
  ```ts
@@ -48,20 +50,20 @@ const draft = await t.send("Draft the welcome email.");
48
50
  t.judge.autoevals.closedQA("professional tone", { on: draft.message }).atLeast(0.6);
49
51
  ```
50
52
 
51
- For a multi-turn eval, pass `t.transcript` to grade the primary session's complete observed conversation instead of only its final reply:
53
+ For a multi-turn eval, pass `session.transcript` to grade a session's complete observed conversation instead of only its final reply:
52
54
 
53
55
  ```ts
54
- await t.send("My favorite word is marigold. Remember it.");
55
- await t.send("What is my favorite word?");
56
+ const { session } = await t.send("My favorite word is marigold. Remember it.");
57
+ await session.send("What is my favorite word?");
56
58
 
57
59
  t.judge.autoevals
58
60
  .closedQA("The assistant remembers the user's favorite word across turns", {
59
- on: t.transcript,
61
+ on: session.transcript,
60
62
  })
61
63
  .atLeast(0.8);
62
64
  ```
63
65
 
64
- `t.transcript` contains the session's user and assistant messages in turn order. It excludes reasoning, tool calls, and tool results. See [Multi-turn evals](./cases#multi-turn-evals) for the transcript format and independent sessions.
66
+ `session.transcript` contains the session's user and assistant messages in turn order. It excludes reasoning, tool calls, and tool results. See [Multi-turn evals](./cases#multi-turn-evals) for the transcript format and independent sessions.
65
67
 
66
68
  ## Soft scoring and thresholds
67
69
 
@@ -91,7 +93,7 @@ The judge model is resolved once when the runner builds `t`. It is **never** the
91
93
  import { defineEvalConfig } from "eve/evals";
92
94
 
93
95
  export default defineEvalConfig({
94
- judge: { model: "openai/gpt-5.4-mini" }, // the default judge for every eval in this tree
96
+ judge: { model: "openai/gpt-5.6-luna" }, // the default judge for every eval in this tree
95
97
  });
96
98
  ```
97
99
 
@@ -32,10 +32,10 @@ import { includes } from "eve/evals/expect";
32
32
  export default defineEval({
33
33
  description: "Basic message and tool-usage coverage for the weather agent.",
34
34
  async test(t) {
35
- await t.send("What is the weather in Brooklyn?");
35
+ const turn = await t.send("What is the weather in Brooklyn?");
36
36
  t.succeeded();
37
37
  t.calledTool("get_weather");
38
- t.check(t.reply, includes("Sunny"));
38
+ t.check(turn.message, includes("Sunny"));
39
39
  },
40
40
  });
41
41
  ```
@@ -51,7 +51,7 @@ import { defineEvalConfig } from "eve/evals";
51
51
  import { Braintrust } from "eve/evals/reporters";
52
52
 
53
53
  export default defineEvalConfig({
54
- judge: { model: "openai/gpt-5.4-mini" },
54
+ judge: { model: "openai/gpt-5.6-luna" },
55
55
  reporters: [Braintrust({ projectName: "my-agent" })],
56
56
  });
57
57
  ```
@@ -100,7 +100,7 @@ model: mockModel({
100
100
 
101
101
  `t` is both the driver and the assertion surface. There are no separate `input`, `run`, `checks`, or `scores` fields. You write ordinary control flow, sending turns and asserting inline.
102
102
 
103
- - **Drive** the agent: `t.send(...)`, `t.start(...)`, `t.cancel()`, `t.respond(...)`, `t.respondAll(...)`, `t.sendFile(...)`, `t.requireInputRequest(...)`, `t.newSession()`. Live turns returned by `start()` can wait for typed mid-turn events before cancellation or settlement. Read what came back with `t.reply` (the last assistant message), `t.transcript` (the primary session's user and assistant messages), `t.sessionId`, and `t.events`. See [Cases](./cases).
103
+ - **Drive** the agent: `t.session()` creates an empty session; `t.send(...)` creates a session with its first message and returns a turn. Continue through `turn.session.send(...)`. Session handles also expose `start`, `cancel`, `respond`, `respondAll`, `sendFile`, and `requireInputRequest`. Read output from `turn.message`, and conversation state from `turn.session`. See [Cases](./cases).
104
104
  - **Assert** with three surfaces, covered next.
105
105
 
106
106
  ## Three assertion surfaces
@@ -108,8 +108,8 @@ model: mockModel({
108
108
  Each surface matches a genuinely different kind of judgment:
109
109
 
110
110
  - **Scoped methods** read the final whole run on `t`, snapshot one independent session when invoked there, or inspect one immutable `EveEvalTurn`. See [Assertions](./assertions).
111
- - **`t.check(value, assertion)`** grades an explicit value with a deterministic builder from `eve/evals/expect`, such as `t.check(t.reply, includes("sunny"))`. Grade `t.reply`, an intermediate draft, parsed JSON, or anything else. See [Assertions](./assertions).
112
- - **`t.judge.autoevals.*`** is the LLM-as-judge surface, like `t.judge.autoevals.closedQA("cites a source")`. It grades `t.reply` by default; pass `{ on: t.transcript }` to grade a multi-turn conversation. The judge uses the configured judge model, never the agent under test. See [Judge](./judge).
111
+ - **`t.check(value, assertion)`** grades an explicit value with a deterministic builder from `eve/evals/expect`, such as `t.check(turn.message, includes("sunny"))`. Grade `turn.message`, an intermediate draft, parsed JSON, or anything else. See [Assertions](./assertions).
112
+ - **`t.judge.autoevals.*`** is the LLM-as-judge surface, like `t.judge.autoevals.closedQA("cites a source")`. It grades the most recently settled turn’s assistant message by default; pass `{ on: turn.session.transcript }` to grade a multi-turn conversation. The judge uses the configured judge model, never the agent under test. See [Judge](./judge).
113
113
 
114
114
  ## Gate vs soft
115
115
 
@@ -18,7 +18,7 @@ import { defineEvalConfig } from "eve/evals";
18
18
  import { Braintrust } from "eve/evals/reporters";
19
19
 
20
20
  export default defineEvalConfig({
21
- judge: { model: "openai/gpt-5.4-mini" },
21
+ judge: { model: "openai/gpt-5.6-luna" },
22
22
  reporters: [Braintrust({ projectName: "weather-agent" })],
23
23
  });
24
24
  ```
@@ -29,6 +29,11 @@ export default defineEval({
29
29
 
30
30
  Sessions attached this way are full `EveEvalSession`s: you can keep driving them and assert directly on that session (`session.succeeded()`, `session.calledTool(...)`). Aggregate assertions on `t` continue to read the whole run, including every attached session.
31
31
 
32
+ For session creation and message delivery, use the [drive API](./cases#the-drive-api).
33
+ `t.session()` creates a session without a first message; call `session.send()` or `session.start()`
34
+ on the returned handle to use it. `t.send()` creates a new session with its first message.
35
+ These helpers handle the session protocol, retries, and event collection for the eval.
36
+
32
37
  ## Authentication
33
38
 
34
39
  Local targets send no auth: `eve eval` owns the dev server it boots. For a remote `--url`, eve gets the expected Vercel owner and project from `VERCEL_ORG_ID` and `VERCEL_PROJECT_ID` when both are set. Otherwise it reads `.vercel/project.json`. Eve then asks Vercel to resolve the exact HTTPS origin and sends ambient credentials only when the project IDs match. An arbitrary URL remains anonymous.
@@ -36,11 +36,11 @@ console.log(result.status, result.message);
36
36
 
37
37
  When the stream includes `session.failed`, the turn returns `status: "failed"` rather than throwing. Transport and route errors throw `ClientError`.
38
38
 
39
- `session.send()` retries `409 session_not_active` three times when a durable run has been accepted
40
- but its command inbox is still starting. The retries wait 250 ms, 500 ms, and 1 second. Other
41
- errors, `session.respond()`, control methods, and raw HTTP requests do not use this retry. An unknown
42
- session still throws `ClientError` immediately, while a terminal session throws after the final
43
- attempt. The client never creates a replacement session.
39
+ `session.send()` retries `409 session_not_ready` with bounded exponential backoff for up to 20
40
+ seconds when a durable run has been accepted but its command inbox is still starting. The caller's
41
+ abort signal cancels the wait. Other errors, `session.respond()`, control methods, and raw HTTP
42
+ requests do not use this retry. An unknown
43
+ or terminal session throws `ClientError` immediately with `session_not_active`. The client never creates a replacement session.
44
44
 
45
45
  ## Send a full turn payload
46
46
 
@@ -113,7 +113,21 @@ Per-request headers override client-level values with the same name. For example
113
113
 
114
114
  ## Sessions
115
115
 
116
- For an ID-addressed session, create it explicitly with the first message:
116
+ Create and park an ID-addressed conversation before its first turn when you can start session work
117
+ while the user is still composing:
118
+
119
+ ```ts
120
+ const { session } = await client.sessions.create();
121
+
122
+ const response = await session.send("Summarize account A.");
123
+ await response.result();
124
+ ```
125
+
126
+ The create promise resolves when the server accepts the durable workflow. It does not open the
127
+ event stream or wait for initialization; an early `session.send()` uses the
128
+ same bounded startup retries as other follow-ups.
129
+
130
+ To create the session and start its first turn in one request, include the message:
117
131
 
118
132
  ```ts
119
133
  const { session, response } = await client.sessions.create({ message: "Summarize account A." });
@@ -265,6 +265,12 @@ Write callback properties as inline function expressions, arrows, method shortha
265
265
 
266
266
  Closure values must be JSON-serializable. Plain objects, arrays, strings, finite numbers, booleans, and `null` are supported; `undefined` object properties are omitted. Functions, class instances, `Date`, `Map`, symbols, non-finite numbers, and cyclic values fail resolution with the tool name and callback phase instead of being serialized lossily.
267
267
 
268
+ Dynamic tools preserve authored input and output validation, including Zod refinements and transformations. JSON Schema describes the tool to the model; the authored validator checks its input and output. eve transforms inline `inputSchema` and `outputSchema` expressions into schema factories and snapshots the JSON-serializable values they capture, just as it does for callbacks.
269
+
270
+ Write schemas inline in `defineTool()`, or reference a stable module-level schema. A schema stored in a resolver-local variable is a non-serializable capture; inline its construction instead. Schema factories must be synchronous and deterministic for their captured values. Keep external reads in the resolver and capture the resulting JSON data. Imported functions and module-level values remain live code, so they must not hide per-session state.
271
+
272
+ Schema factories use the same session, scope, resolver entry, and recovery rules as the tool's callbacks. A recovered factory receives its original captures, even if re-running the resolver produces different values. If a required factory is missing, validation fails explicitly; eve does not substitute its JSON Schema description.
273
+
268
274
  Call expressions such as `execute: makeExecutor()` are not transformed. Put the callback body directly in `defineTool()` inside an authored module; eve rejects a dynamic tool if a callback lacks durable metadata.
269
275
 
270
276
  ### Create dynamic tools in a package
@@ -298,6 +304,22 @@ export function createSearchTool(baseUrl: string) {
298
304
 
299
305
  Wrap every callback property with the helper. This includes labels, approval policies, `approvalKey`, `execute`, and `toModelOutput`.
300
306
 
307
+ For live schemas created in a provider package, use `defineDurableSchema` from `eve/tools`. Put the schema's per-tool values in `closure` and construct the schema in `schema`. Plain JSON Schema objects need no helper.
308
+
309
+ ```ts
310
+ import { defineDurableSchema } from "eve/tools";
311
+ import { z } from "zod";
312
+
313
+ export function amountSchema(limit: number) {
314
+ return defineDurableSchema({
315
+ closure: { limit },
316
+ schema: ({ limit }) => z.object({ amount: z.number().refine((amount) => amount <= limit) }),
317
+ });
318
+ }
319
+ ```
320
+
321
+ Pass the result as `inputSchema` or `outputSchema` in `defineTool()`. Rebuild existing extensions with the current `eve extension build` to generate schema factories. A live dynamic schema without a durable factory is rejected at resolution with instructions to inline its construction or use `defineDurableSchema`.
322
+
301
323
  `closure` is the callback's only durable snapshot. Store the identifiers and configuration needed to reproduce the call there. Reconstruct clients or look up live runtime state when the callback runs. The callback may call stable imported functions, but it must not capture runtime objects outside `closure`. Those values disappear on a cold start.
302
324
 
303
325
  eve-provided factories, including [memory provider tools](../memory), use the same durable callback mechanism.
@@ -1,12 +1,13 @@
1
1
  ---
2
2
  title: Automatic Model Selection
3
- description: "Choose an agent model from the current request with an AI SDK evaluation model."
3
+ description: "Choose agent models automatically or evaluate typed questions in your tools and application code."
4
4
  ---
5
5
 
6
6
  Use `autoModel` to choose an agent model from an allowlist before inference begins.
7
7
  It uses the [AI SDK evaluation API](https://ai-sdk.dev/docs/ai-sdk-core/evaluation),
8
8
  so the evaluator can be a Vercel AI Gateway model ID or an evaluation model from
9
- an installed provider.
9
+ an installed provider. Use `evaluate` from the same entrypoint to ask typed
10
+ questions in your own tools or application code.
10
11
 
11
12
  `eve/experimental/evaluate` is experimental. Its API can change between eve
12
13
  releases, and the AI SDK evaluation model specification can change in patch
@@ -37,7 +38,8 @@ does not add a TypeSafe credential or transport layer. During `eve dev`, a
37
38
  Gateway evaluator uses the same connection selected through `/login` as Gateway
38
39
  language models. A configured AI SDK default provider still owns string model
39
40
  resolution during development. The TUI footer displays `dynamic model` when the
40
- agent uses `autoModel`.
41
+ agent uses `autoModel`, then adds the resolved model for the current turn, such as
42
+ `dynamic model · openai/gpt-5.6-luna`.
41
43
 
42
44
  ## Use a provider directly
43
45
 
@@ -102,6 +104,79 @@ Supported reasoning values are `"provider-default"`, `"none"`, `"minimal"`,
102
104
  `"low"`, `"medium"`, `"high"`, and `"xhigh"`. An omitted value inherits the
103
105
  agent's reasoning setting.
104
106
 
107
+ ## Evaluate inside a tool
108
+
109
+ Use `evaluate` to ask choice, score, or boolean questions about the state you pass to it.
110
+ It defaults to `typesafe-ai/jev` and uses the same authentication as `autoModel`,
111
+ including the Gateway connection selected through `/login` during `eve dev`.
112
+ Pass `model` to use another evaluation model ID or a provider instance. A configured
113
+ AI SDK default provider takes precedence over the local Gateway connection.
114
+
115
+ ```ts title="agent/tools/classify-request.ts"
116
+ import { evaluate } from "eve/experimental/evaluate";
117
+ import { defineTool } from "eve/tools";
118
+ import { z } from "zod";
119
+
120
+ export default defineTool({
121
+ description: "Choose the team that can help with a customer request.",
122
+ inputSchema: z.object({ request: z.string().min(1).max(8000) }),
123
+ async execute({ request }, ctx) {
124
+ const result = await evaluate({
125
+ state: { request },
126
+ questions: {
127
+ team: {
128
+ type: "choice",
129
+ instructions: "Select the team best suited to handle the request.",
130
+ criteria: {
131
+ billing: "Invoices, payments, and refunds",
132
+ support: "Product questions and troubleshooting",
133
+ },
134
+ },
135
+ },
136
+ abortSignal: ctx.abortSignal,
137
+ });
138
+ return { team: result.answers.team.choice };
139
+ },
140
+ });
141
+ ```
142
+
143
+ The choice above is typed as `"billing" | "support"`. Each question appears under
144
+ its authored key in `result.answers`. Results also include token usage, warnings,
145
+ provider metadata, and response metadata.
146
+
147
+ `evaluate` accepts AI SDK evaluation options, including `maxRetries`, `headers`,
148
+ and `providerOptions`. Pass an `abortSignal` to cancel the request. Input and
149
+ answer validation, retries, and provider errors follow AI SDK semantics.
150
+
151
+ You can also call `evaluate` outside a tool; it does not require an active eve
152
+ session. Each call performs its own evaluation. `autoModel` uses this function
153
+ and adds the per-turn routing behavior described below.
154
+
155
+ ## Evaluate tool approvals
156
+
157
+ Use `auto({ model? })` when an evaluation model should decide whether a
158
+ tool call can run automatically or needs human approval. It accepts the same
159
+ AI SDK evaluation model strings and provider instances described above and
160
+ defaults to `typesafe-ai/jev`:
161
+
162
+ ```ts title="agent/tools/deploy.ts"
163
+ import { defineTool } from "eve/tools";
164
+ import { auto } from "eve/tools/approval";
165
+ import { z } from "zod";
166
+
167
+ export default defineTool({
168
+ description: "Deploy an application.",
169
+ inputSchema: z.object({ environment: z.string() }),
170
+ approval: auto({ model: "typesafe-ai/jev" }), // Uses AI SDK string-model resolution
171
+ execute: ({ environment }) => deploy(environment),
172
+ });
173
+ ```
174
+
175
+ The evaluation model reviews the tool name and input for dangerous effects. A
176
+ caution, failed review, or incomplete input requires human approval. See
177
+ [Human-in-the-loop approvals](/docs/human-in-the-loop#approvals) for classifier
178
+ options and data handling.
179
+
105
180
  ## Runtime behavior
106
181
 
107
182
  `autoModel` evaluates at the first `step.started` event, after the incoming prompt
@@ -74,9 +74,10 @@ export function Chat() {
74
74
  | --------- | ----------------------------------------------------------------------------------------- |
75
75
  | `data` | Projected UI state from the reducer. Defaults to `{ messages }`. |
76
76
  | `status` | `"ready"`, `"resuming"`, `"submitted"`, `"streaming"`, or `"error"`. Drives the composer. |
77
- | `error` | The last `Error` thrown, if any. |
77
+ | `error` | The latest session creation, stream, resume, or turn failure. |
78
78
  | `events` | Raw eve stream events for this session. |
79
79
  | `session` | Serializable fixed session cursor (`sessionId`, `streamIndex`). |
80
+ | `prewarm` | Create the durable session without starting a turn. |
80
81
  | `send` | Send text or a multi-part message, with per-turn options. |
81
82
  | `respond` | Answer pending HITL input requests, with per-turn options. |
82
83
  | `resume` | Replay an attached session and follow its in-flight turn. |
@@ -85,6 +86,50 @@ export function Chat() {
85
86
 
86
87
  Most chat UIs only need `data.messages` and `status`. Drop down to `events` when you need the authoritative wire events directly, for example to persist an audit log or build a custom projection.
87
88
 
89
+ Pass `prewarm: true` to start a workflow when the chat mounts and after each reset:
90
+
91
+ ```tsx
92
+ import { useEveAgent } from "eve/react";
93
+
94
+ export function Chat() {
95
+ const agent = useEveAgent({ prewarm: true });
96
+
97
+ return <button onClick={agent.reset}>New chat</button>;
98
+ }
99
+ ```
100
+
101
+ Prewarming defaults to `false`: the first send creates the session. Enable it when your
102
+ application's auth, headers, and any chat-record binding are ready at mount. Applications
103
+ that prepare those in the submit handler should keep the default.
104
+
105
+ Prewarming starts the workflow and establishes its inbox, then parks before session hooks,
106
+ dynamic definitions, or sandbox setup run. The first message passes through the channel's
107
+ `onMessage` hook and supplies the identity and context for initialization and `turn_0`.
108
+
109
+ The explicit `prewarm()` method resolves on `202 Accepted`, as does `client.sessions.create()`.
110
+ It does not wait for an initialization event; concurrent calls share the same create request.
111
+ The composer stays `"ready"`, meaning it can accept input, and prewarming does not run
112
+ `prepareSend`. A concurrent `send()` waits only for acceptance, then posts the message.
113
+ If the inbox is still starting, the client retries `409 session_not_ready` with bounded
114
+ exponential backoff for up to 20 seconds. The caller's abort signal cancels the wait. Stream
115
+ events are not a prerequisite for sending.
116
+
117
+ A failed create sets `error` and calls `onError` when no send is waiting. A waiting send can
118
+ fall back to creating a session with its message. After creation succeeds, initialization
119
+ failures arrive on the stream during the first turn. The configured session timeout starts
120
+ at creation, so an unused prewarmed session can expire before its first message.
121
+
122
+ The hook keeps consuming one session stream across turns and idle periods. Replies,
123
+ authorization updates, and turns started elsewhere all update the same projection. A turn settling
124
+ does not close the connection. The transport reconnects from its cursor after a disconnect or the
125
+ server's renewable 60-second lease; lease renewal does not start a turn or clear UI state.
126
+ Unmounting or resetting closes the local stream without cancelling the old durable session.
127
+
128
+ `reset()` reuses the hook instance and clears the conversation. With `prewarm: true`, it
129
+ immediately prepares the next owned session; otherwise, the next send creates it. An explicitly supplied
130
+ `session` remains externally owned and is never replaced by prewarming or reset. Use
131
+ `initialSession` with `resume: true` to restore a saved chat.
132
+
88
133
  `data.messages` are eve-owned `EveMessage[]`. Common text, reasoning, file, and dynamic-tool parts follow the [AI SDK `UIMessage`](https://ai-sdk.dev/docs/reference/ai-sdk-core/ui-message) rendering convention, but the types are not interchangeable. eve also exposes authorization and HITL metadata, and a file part's URL can be absent. Adapt those parts before passing messages to an API typed as `UIMessage[]`.
89
134
 
90
135
  When the root agent delegates, its stream emits `subagent.called` with the child's `childSessionId`, then `subagent.completed` after admission with a working task receipt. Later task notifications wake the parent with completion, failure, or cancellation. Detailed child progress lives on the child session's stream instead of being flattened into the root `data.messages`. Use the lower-level [TypeScript client](../client/overview#sessions) to attach to that ID when your UI needs live subagent activity. See [What the parent sees](../../subagents#what-the-parent-sees) for the complete contract.
@@ -227,9 +272,9 @@ const agent = useEveAgent({
227
272
  The hook accepts these lifecycle callbacks:
228
273
 
229
274
  - `onEvent(event)`: fires for each eve stream event as it arrives.
230
- - `onError(error)`: fires with the last `Error` when a turn fails.
275
+ - `onError(error)`: fires when session creation, streaming, resume, or a turn fails. A failed prewarm reports here when no send is waiting to retry creation.
231
276
  - `onFinish(snapshot)`: fires with the final `{ data, status, session, ... }` snapshot once a turn settles.
232
- - `onSessionChange(session)`: fires when the session cursor advances. Persist it to resume across reloads.
277
+ - `onSessionChange(session)`: fires when a session is created, its cursor advances, or reset clears it. Persist the session state to resume across reloads.
233
278
 
234
279
  ```tsx
235
280
  const agent = useEveAgent({
@@ -306,9 +351,9 @@ then save a final snapshot in `onFinish`.
306
351
 
307
352
  `initialEvents` must be an ordered prefix of the same session's stream, but its endpoint does not have to line up exactly with where the stream resumes. When the event count matches `initialSession.streamIndex`, catch-up continues from that cursor. A partial or overlapping saved log falls back to index `0`. Every event carries a stable [`meta.id`](/docs/concepts/sessions-runs-and-streaming#the-event-envelope), and the store drops any event whose id it has already applied, so an overlapping replay renders once and `onEvent` only fires for events your UI has not seen.
308
353
 
309
- For multiple chat threads, keep one saved event log and session cursor per thread. `agent`, `host`, `reducer`, `session`, `initialEvents`, `initialSession`, `auth`, `headers`, `optimistic`, and `resume` are read when the hook creates its store, so remount the chat component when switching threads, for example with `key={chat.id}`.
354
+ For multiple chat threads, keep one saved event log and session cursor per thread. `agent`, `host`, `reducer`, `session`, `initialEvents`, `initialSession`, `auth`, `headers`, `optimistic`, `prewarm`, and `resume` are read when the hook creates its store, so remount the chat component when switching threads, for example with `key={chat.id}`.
310
355
 
311
- Pass `resume: true` with `initialSession` to rebuild the projection from the durable stream after mount. While `status` is `"resuming"`, render hydrated `data` but disable message and HITL submission; do not present cancellation or active-turn progress controls. If catch-up finds an in-flight turn, `status` changes to `"streaming"` before the binding follows it to a boundary. A settled tail changes directly to `"ready"` after a bounded catch-up check, without waiting for the live stream idle timeout. If that check finds a newly started turn or pending authorization, eve keeps following it. A terminal session failure changes to `"error"`.
356
+ Pass `resume: true` with `initialSession` to rebuild the projection from the durable stream after mount. While `status` is `"resuming"`, render hydrated `data` but disable message and HITL submission; do not present cancellation or active-turn progress controls. If catch-up finds an in-flight turn, `status` changes to `"streaming"` before the binding follows it to a boundary. The stream reports its initial durable tail so catch-up can finish without closing the connection or waiting for an idle timeout. A settled tail changes directly to `"ready"`; a newer turn or pending authorization remains `"streaming"`. The connection stays open to receive later events. A terminal session failure changes to `"error"`.
312
357
 
313
358
  ```tsx
314
359
  const agent = useEveAgent({
@@ -332,6 +377,10 @@ const agent = useEveAgent({
332
377
  });
333
378
  ```
334
379
 
380
+ Headers supplied to `send()` apply to that turn request and become the credentials used by the
381
+ continuous session stream on its next reconnect. A later send replaces them with that turn's
382
+ headers.
383
+
335
384
  When a framework integration mounts multiple named agents, pass `agent` instead of `host`:
336
385
 
337
386
  ```tsx
@@ -45,14 +45,14 @@ Call the binding once for a conversation and read its reactive getters directly.
45
45
 
46
46
  The state fields are reactive getters; the commands are ordinary methods:
47
47
 
48
- | Property | Svelte shape |
49
- | ---------------------------------------------- | --------------------------------- |
50
- | `data` | `TData` |
51
- | `status` | `UseEveAgentStatus` |
52
- | `error` | `Error \| undefined` |
53
- | `events` | `readonly MessageStreamEvent[]` |
54
- | `session` | `ClientSessionState \| undefined` |
55
- | `send`, `respond`, `resume`, `cancel`, `reset` | Methods |
48
+ | Property | Svelte shape |
49
+ | --------------------------------------------------------- | --------------------------------- |
50
+ | `data` | `TData` |
51
+ | `status` | `UseEveAgentStatus` |
52
+ | `error` | `Error \| undefined` |
53
+ | `events` | `readonly MessageStreamEvent[]` |
54
+ | `session` | `ClientSessionState \| undefined` |
55
+ | `send`, `respond`, `prewarm`, `resume`, `cancel`, `reset` | Methods |
56
56
 
57
57
  Read the getters directly in templates, `$derived`, or `$effect`. The [shared returned-state reference](./overview#returned-state) describes what each value and command does.
58
58
 
@@ -107,6 +107,11 @@ See [Human-in-the-loop prompts](./overview#human-in-the-loop-prompts) for reques
107
107
 
108
108
  ## Cancel, reset, and resume
109
109
 
110
+ Pass `prewarm: true` to prepare an owned workflow on mount and after reset. It defaults
111
+ to `false`, so the first send creates the session. The binding waits for create acceptance,
112
+ retries while the inbox starts, and keeps the session stream open across turns. See [Prewarming and returned state](./overview#returned-state) for creation, failure, and
113
+ connection behavior.
114
+
110
115
  Call `agent.cancel()` to stop the durable server-side turn while the binding remains attached through settlement. Destroying the component only disconnects its local stream; it does not cancel server execution. Call `agent.reset()` to clear local state and start a new session. Pass `initialSession`, `initialEvents`, and `resume: true` to restore a saved conversation and follow an in-flight turn. During bounded catch-up, `agent.status` is `"resuming"`; keep the hydrated conversation visible, disable submission, and wait for `"ready"`, `"error"`, or `"streaming"`. Use `agent.resume()` directly when restoration is controlled imperatively. See [Resumable sessions](./overview#resumable-sessions) for the persistence contract and [Sending and streaming](./overview#sending-and-streaming) for cancellation behavior.
111
116
 
112
117
  ## Custom host and credentials
@@ -44,14 +44,14 @@ async function handleSubmit() {
44
44
 
45
45
  The state fields are computed refs; the commands are ordinary methods:
46
46
 
47
- | Property | Vue shape |
48
- | ---------------------------------------------- | ---------------------------------------------- |
49
- | `data` | `ComputedRef<TData>` |
50
- | `status` | `ComputedRef<UseEveAgentStatus>` |
51
- | `error` | `ComputedRef<Error \| undefined>` |
52
- | `events` | `ComputedRef<readonly MessageStreamEvent[]>` |
53
- | `session` | `ComputedRef<ClientSessionState \| undefined>` |
54
- | `send`, `respond`, `resume`, `cancel`, `reset` | Methods |
47
+ | Property | Vue shape |
48
+ | --------------------------------------------------------- | ---------------------------------------------- |
49
+ | `data` | `ComputedRef<TData>` |
50
+ | `status` | `ComputedRef<UseEveAgentStatus>` |
51
+ | `error` | `ComputedRef<Error \| undefined>` |
52
+ | `events` | `ComputedRef<readonly MessageStreamEvent[]>` |
53
+ | `session` | `ComputedRef<ClientSessionState \| undefined>` |
54
+ | `send`, `respond`, `prewarm`, `resume`, `cancel`, `reset` | Methods |
55
55
 
56
56
  Destructuring preserves reactivity because each state value remains a ref. Read refs with `.value` in `<script>` and without `.value` in a template. The [shared returned-state reference](./overview#returned-state) describes what each value and command does.
57
57
 
@@ -109,6 +109,11 @@ See [Human-in-the-loop prompts](./overview#human-in-the-loop-prompts) for reques
109
109
 
110
110
  ## Cancel, reset, and resume
111
111
 
112
+ Pass `prewarm: true` to prepare an owned workflow on mount and after reset. It defaults
113
+ to `false`, so the first send creates the session. The binding waits for create acceptance,
114
+ retries while the inbox starts, and keeps the session stream open across turns. See [Prewarming and returned state](./overview#returned-state) for creation, failure, and
115
+ connection behavior.
116
+
112
117
  Call `cancel()` to stop the durable server-side turn while the composable remains attached through settlement. Disposing the component only disconnects its local stream; it does not cancel server execution. Call `reset()` to clear local state and start a new session. Pass `initialSession`, `initialEvents`, and `resume: true` to restore a saved conversation and follow an in-flight turn. During bounded catch-up, `status.value` is `"resuming"`; keep the hydrated conversation visible, disable submission, and wait for `"ready"`, `"error"`, or `"streaming"`. Use `resume()` directly when restoration is controlled imperatively. See [Resumable sessions](./overview#resumable-sessions) for the persistence contract and [Sending and streaming](./overview#sending-and-streaming) for cancellation behavior.
113
118
 
114
119
  ## Custom host and credentials
@@ -29,6 +29,7 @@ export default defineRemoteAgent({
29
29
  | `headers` | `HeadersValue` | No | none | Static or lazily resolved request headers. |
30
30
  | `path` | `string` | No | `/eve/v1/session` | Route appended to `url` for the create-session request. |
31
31
  | `outputSchema` | `StandardSchema \| JSON Schema` | No | none | Structured return type for the first turn of each fresh remote session. A continuation may provide its own per-call schema. |
32
+ | `tool` | `boolean` | No | `true` | Expose the remote agent as a tool to the parent model. Set `false` to allow only `ctx.agent()` calls from authored workflow tools. |
32
33
 
33
34
  ## Dynamic remote agents
34
35
 
@@ -80,7 +81,7 @@ The function may be async and must return a non-empty string. `auth` and `header
80
81
 
81
82
  ## Calling a remote agent
82
83
 
83
- To the model, a remote agent is another subagent tool. You call it the same way you call a local subagent, with a `message` and an optional `outputSchema`. The message must carry the full task, including any context the remote agent needs, because it never receives the parent's conversation history.
84
+ By default, a remote agent is another subagent tool to the model. The model calls it the same way it calls a local subagent, with a `message` and an optional `outputSchema`. Set `tool: false` when an authored workflow tool should be the only model-facing routing surface; the workflow can still call the remote agent by its path-derived name through `ctx.agent()`. The message must carry the full task, including any context the remote agent needs, because it never receives the parent's conversation history.
84
85
 
85
86
  To require structured output, set an `outputSchema` on the agent definition for fresh delegations or on an individual call for that turn. The structured value arrives in the task's completion notification, and the remote child remains available for follow-up messages. See [Subagents](../subagents) for continuation behavior.
86
87