eve 0.85.0 → 0.87.0

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 (290) hide show
  1. package/CHANGELOG.md +34 -3073
  2. package/README.md +7 -4
  3. package/dist/src/acp/adapter.d.ts +2 -26
  4. package/dist/src/acp/adapter.js +1 -1
  5. package/dist/src/acp/server.d.ts +0 -3
  6. package/dist/src/ai/decision-adapter.d.ts +5 -3
  7. package/dist/src/ai/decision-adapter.js +1 -1
  8. package/dist/src/ai/decision-types.d.ts +4 -3
  9. package/dist/src/channel/adapter.d.ts +0 -14
  10. package/dist/src/channel/auth/definitions.d.ts +0 -4
  11. package/dist/src/channel/channel-address.d.ts +1 -1
  12. package/dist/src/channel/channel-address.js +1 -1
  13. package/dist/src/channel/channel-operations.d.ts +2 -2
  14. package/dist/src/channel/channel-operations.js +1 -1
  15. package/dist/src/channel/prompt-queue.d.ts +0 -2
  16. package/dist/src/channel/session-not-active-error.d.ts +10 -5
  17. package/dist/src/channel/session-not-active-error.js +1 -1
  18. package/dist/src/channel/session-stranded-error.d.ts +1 -1
  19. package/dist/src/channel/session.d.ts +3 -4
  20. package/dist/src/channel/session.js +1 -1
  21. package/dist/src/channel/types.d.ts +5 -14
  22. package/dist/src/chunks/{use-eve-agent-B2jCfcnG.js → use-eve-agent-BExXjBv6.js} +82 -72
  23. package/dist/src/chunks/{use-eve-agent-DCLFi26P.js → use-eve-agent-C0KHCyb9.js} +82 -72
  24. package/dist/src/cli/commands/agent-prompt/collect-intent.md +2 -1
  25. package/dist/src/cli/commands/agent-prompt/scaffold.md +1 -2
  26. package/dist/src/cli/dev/command-options.d.ts +4 -4
  27. package/dist/src/cli/dev/command.js +1 -1
  28. package/dist/src/cli/dev/tui/runner.d.ts +1 -1
  29. package/dist/src/cli/dev/tui/runner.js +2 -2
  30. package/dist/src/cli/dev/tui/test/fake-eve-server.js +1 -1
  31. package/dist/src/cli/dev/tui/tool-format.d.ts +2 -2
  32. package/dist/src/cli/dev/ui-options.d.ts +4 -4
  33. package/dist/src/cli/dev/ui-options.js +1 -1
  34. package/dist/src/cli/run.js +1 -1
  35. package/dist/src/client/agent-info-error.d.ts +4 -1
  36. package/dist/src/client/agent-info-error.js +1 -1
  37. package/dist/src/client/agent-session.d.ts +1 -4
  38. package/dist/src/client/agent-session.js +1 -1
  39. package/dist/src/client/agent-stream-follower.js +1 -1
  40. package/dist/src/client/client-error.d.ts +13 -4
  41. package/dist/src/client/client-error.js +1 -1
  42. package/dist/src/client/delivery.d.ts +2 -17
  43. package/dist/src/client/health-response-error.d.ts +4 -1
  44. package/dist/src/client/health-response-error.js +1 -1
  45. package/dist/src/client/index.d.ts +5 -3
  46. package/dist/src/client/index.js +1 -1
  47. package/dist/src/client/open-stream.d.ts +7 -12
  48. package/dist/src/client/open-stream.js +1 -1
  49. package/dist/src/client/session-controls.d.ts +2 -2
  50. package/dist/src/client/session-controls.js +1 -1
  51. package/dist/src/client/session-event-stream.d.ts +2 -2
  52. package/dist/src/client/session-event-stream.js +1 -1
  53. package/dist/src/client/session-store.d.ts +2 -6
  54. package/dist/src/client/session-store.js +1 -1
  55. package/dist/src/client/session.d.ts +4 -13
  56. package/dist/src/client/session.js +1 -1
  57. package/dist/src/client/sessions.d.ts +3 -6
  58. package/dist/src/client/types.d.ts +23 -32
  59. package/dist/src/compiled/.vendor-stamp.json +4 -4
  60. package/dist/src/compiled/@vercel/agent-runs/LICENSE +202 -0
  61. package/dist/src/compiled/@vercel/schedules/index.d.ts +45 -6
  62. package/dist/src/compiled/@vercel/schedules/index.js +2 -2
  63. package/dist/src/compiler/manifest.js +1 -1
  64. package/dist/src/compiler/normalize-agent-config.js +1 -1
  65. package/dist/src/compiler/normalize-connection.d.ts +1 -1
  66. package/dist/src/compiler/normalize-connection.js +1 -1
  67. package/dist/src/compiler/normalize-instructions.js +1 -1
  68. package/dist/src/compiler/normalize-skill.js +1 -1
  69. package/dist/src/compiler/resolve-workspace-subagent.js +1 -1
  70. package/dist/src/context/memory-tools.d.ts +9 -5
  71. package/dist/src/discover/sandbox.js +1 -1
  72. package/dist/src/dynamic/definition.d.ts +11 -5
  73. package/dist/src/dynamic/definition.js +1 -1
  74. package/dist/src/evals/mock-model.d.ts +1 -1
  75. package/dist/src/evals/session-manager.d.ts +0 -2
  76. package/dist/src/evals/session.d.ts +1 -11
  77. package/dist/src/evals/session.js +1 -1
  78. package/dist/src/eve-channel/index.js +1 -1
  79. package/dist/src/eve-channel/support.js +1 -1
  80. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  81. package/dist/src/execution/effective-agent-config.js +1 -1
  82. package/dist/src/execution/proxied-deliver-step.js +1 -1
  83. package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +1 -2
  84. package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
  85. package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
  86. package/dist/src/execution/session/active-turn.js +1 -1
  87. package/dist/src/execution/session/answer-caller.d.ts +9 -5
  88. package/dist/src/execution/session/answer-caller.js +1 -1
  89. package/dist/src/execution/session/principal.d.ts +8 -0
  90. package/dist/src/execution/session/principal.js +1 -1
  91. package/dist/src/execution/session/program.js +1 -1
  92. package/dist/src/execution/session/turn-step.js +1 -1
  93. package/dist/src/execution/session/turn.js +1 -1
  94. package/dist/src/execution/session-callback-request.js +1 -1
  95. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  96. package/dist/src/harness/attachment-staging.d.ts +2 -2
  97. package/dist/src/harness/attachment-staging.js +1 -1
  98. package/dist/src/instrumentation/ai-sdk-telemetry.d.ts +0 -2
  99. package/dist/src/instrumentation/providers.d.ts +1 -38
  100. package/dist/src/instrumentation/providers.js +1 -1
  101. package/dist/src/instrumentation/setup-context.d.ts +1 -7
  102. package/dist/src/internal/application/package.d.ts +1 -0
  103. package/dist/src/internal/application/package.js +1 -1
  104. package/dist/src/internal/application/stamped-package-version.js +1 -1
  105. package/dist/src/internal/authored-definition/core.js +1 -1
  106. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  107. package/dist/src/internal/classify-model-routing.d.ts +2 -3
  108. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  109. package/dist/src/internal/nitro/routes/schedule-collection-consumer.js +1 -1
  110. package/dist/src/internal/runtime-model.d.ts +9 -4
  111. package/dist/src/internal/runtime-model.js +1 -1
  112. package/dist/src/internal/workflow-bundle/authored-workflow-directives.js +1 -1
  113. package/dist/src/internal/workflow-bundle/builder-support.d.ts +1 -1
  114. package/dist/src/internal/workflow-bundle/builder-support.js +1 -1
  115. package/dist/src/internal/workflow-bundle/workflow-transformer.js +1 -1
  116. package/dist/src/models/auto.js +1 -1
  117. package/dist/src/protocol/delivery.d.ts +1 -0
  118. package/dist/src/protocol/reset-session.d.ts +0 -2
  119. package/dist/src/protocol/routes.d.ts +9 -2
  120. package/dist/src/protocol/routes.js +1 -1
  121. package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +1 -22
  122. package/dist/src/public/channels/discord/discordChannel.d.ts +3 -12
  123. package/dist/src/public/channels/discord/gateway/{index.d.ts → relay.d.ts} +2 -2
  124. package/dist/src/public/channels/discord/gateway/relay.js +1 -0
  125. package/dist/src/public/channels/discord/messages.d.ts +4 -4
  126. package/dist/src/public/channels/github/state.d.ts +0 -2
  127. package/dist/src/public/channels/index.d.ts +1 -2
  128. package/dist/src/public/channels/index.js +1 -1
  129. package/dist/src/public/channels/linear/index.d.ts +1 -1
  130. package/dist/src/public/channels/linear/index.js +1 -1
  131. package/dist/src/public/channels/linear/linearChannel.d.ts +0 -5
  132. package/dist/src/public/channels/linq/index.d.ts +1 -1
  133. package/dist/src/public/channels/linq/linqChannel.d.ts +7 -5
  134. package/dist/src/public/channels/photon/index.d.ts +1 -1
  135. package/dist/src/public/channels/photon/photonIMessageChannel.d.ts +15 -4
  136. package/dist/src/public/channels/slack/api.d.ts +1 -1
  137. package/dist/src/public/channels/slack/api.js +1 -1
  138. package/dist/src/public/channels/slack/blocks.d.ts +1 -1
  139. package/dist/src/public/channels/slack/blocks.js +2 -2
  140. package/dist/src/public/channels/slack/cards.d.ts +2 -297
  141. package/dist/src/public/channels/slack/cards.js +1 -1
  142. package/dist/src/public/channels/slack/index.d.ts +2 -2
  143. package/dist/src/public/channels/slack/index.js +1 -1
  144. package/dist/src/public/channels/slack/session-operations.d.ts +2 -2
  145. package/dist/src/public/channels/slack/session-operations.js +1 -1
  146. package/dist/src/public/channels/slack/slackChannel.d.ts +11 -72
  147. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  148. package/dist/src/public/channels/teams/teamsChannel.d.ts +4 -3
  149. package/dist/src/public/channels/telegram/hitl.d.ts +2 -9
  150. package/dist/src/public/channels/telegram/index.d.ts +1 -1
  151. package/dist/src/public/channels/telegram/telegramChannel.d.ts +0 -2
  152. package/dist/src/public/channels/twilio/twilioChannel.d.ts +0 -2
  153. package/dist/src/public/channels/undelivered-reply.d.ts +0 -5
  154. package/dist/src/public/definitions/agent.d.ts +15 -7
  155. package/dist/src/public/definitions/agent.js +1 -1
  156. package/dist/src/public/definitions/channel.d.ts +7 -5
  157. package/dist/src/public/definitions/channel.js +1 -1
  158. package/dist/src/public/definitions/connections/protocol.d.ts +1 -7
  159. package/dist/src/public/definitions/connections/protocol.js +1 -1
  160. package/dist/src/public/experimental/channels/discord/gateway.d.ts +1 -0
  161. package/dist/src/public/experimental/channels/discord/gateway.js +1 -0
  162. package/dist/src/public/experimental/sandbox/just-bash.d.ts +1 -0
  163. package/dist/src/public/experimental/sandbox/just-bash.js +1 -0
  164. package/dist/src/public/experimental/workspace/index.d.ts +1 -0
  165. package/dist/src/public/experimental/workspace/index.js +1 -0
  166. package/dist/src/public/index.d.ts +2 -2
  167. package/dist/src/public/index.js +1 -1
  168. package/dist/src/public/instrumentation/otel.d.ts +1 -1
  169. package/dist/src/public/instrumentation/provider.d.ts +1 -1
  170. package/dist/src/public/instrumentation/provider.js +1 -1
  171. package/dist/src/public/memory/file/backend.d.ts +1 -1
  172. package/dist/src/public/memory/file/backends/in-memory.js +1 -1
  173. package/dist/src/public/memory/file/backends/vercel-blob.js +1 -1
  174. package/dist/src/public/memory/file/provider.js +1 -1
  175. package/dist/src/public/memory/index.d.ts +3 -11
  176. package/dist/src/public/models/anthropic/index.d.ts +1 -1
  177. package/dist/src/public/models/index.d.ts +1 -0
  178. package/dist/src/public/models/openai/index.d.ts +2 -2
  179. package/dist/src/public/next/index.d.ts +2 -2
  180. package/dist/src/public/sandbox/just-bash-sandbox.d.ts +27 -20
  181. package/dist/src/public/sandbox/just-bash.d.ts +0 -1
  182. package/dist/src/public/schedules/providers/vercel.d.ts +2 -0
  183. package/dist/src/public/schedules/providers/vercel.js +1 -1
  184. package/dist/src/public/sessions/index.d.ts +1 -0
  185. package/dist/src/public/sessions/index.js +1 -1
  186. package/dist/src/public/tools/index.d.ts +1 -1
  187. package/dist/src/public/tools/index.js +1 -1
  188. package/dist/src/public/workflow/api.d.ts +25 -0
  189. package/dist/src/public/workflow/api.js +1 -0
  190. package/dist/src/public/workflow/index.d.ts +76 -0
  191. package/dist/src/public/workflow/index.js +1 -0
  192. package/dist/src/public/workflow-modules.d.ts +2 -17
  193. package/dist/src/react/use-eve-agent.d.ts +3 -2
  194. package/dist/src/react/use-eve-agent.js +1 -1
  195. package/dist/src/reactions/kinds/model.js +1 -1
  196. package/dist/src/runtime/agent/resolve-model.js +1 -1
  197. package/dist/src/runtime/resolve-agent.js +1 -1
  198. package/dist/src/runtime/resolve-dynamic.js +1 -1
  199. package/dist/src/runtime/subagents/dynamic-agent-config.js +1 -1
  200. package/dist/src/runtime/subagents/workflow.js +1 -1
  201. package/dist/src/sandbox/providers/default.js +1 -1
  202. package/dist/src/self-modification/extension/subagents/agent/agent.d.ts +2 -2
  203. package/dist/src/self-modification/sandbox.js +1 -1
  204. package/dist/src/setup/integrations/discord/daemon.js +2 -2
  205. package/dist/src/setup/scaffold/create/project.js +2 -2
  206. package/dist/src/setup/scaffold/create/web-template.d.ts +2 -2
  207. package/dist/src/setup/scaffold/create/web-template.js +2 -2
  208. package/dist/src/setup/verified-remote-agent.d.ts +1 -3
  209. package/dist/src/shared/agent-definition.d.ts +18 -9
  210. package/dist/src/shared/eve-error.d.ts +22 -0
  211. package/dist/src/shared/eve-error.js +1 -0
  212. package/dist/src/shared/session.d.ts +2 -2
  213. package/dist/src/shared/token-usage.d.ts +7 -1
  214. package/dist/src/svelte/index.js +1 -1
  215. package/dist/src/svelte/use-eve-agent.d.ts +2 -1
  216. package/dist/src/svelte/use-eve-agent.js +1 -1
  217. package/dist/src/tools/definition.d.ts +7 -5
  218. package/dist/src/tools/definition.js +1 -1
  219. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  220. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  221. package/dist/src/tracing/eve/batch-span-processor.d.ts +1 -1
  222. package/dist/src/tracing/eve/content-span-processor.d.ts +1 -19
  223. package/dist/src/tracing/eve/otel-configuration.d.ts +6 -0
  224. package/dist/src/tracing/eve/otel-declaration.d.ts +6 -19
  225. package/dist/src/tracing/eve/span-export-policy.d.ts +0 -2
  226. package/dist/src/tracing/local/instrumentation-runtime.d.ts +0 -3
  227. package/dist/src/tracing/local/traces.d.ts +0 -13
  228. package/dist/src/vue/index.js +1 -1
  229. package/dist/src/vue/use-eve-agent.d.ts +3 -2
  230. package/dist/src/vue/use-eve-agent.js +1 -1
  231. package/docs/agent-config.md +15 -11
  232. package/docs/channels/custom.mdx +26 -10
  233. package/docs/channels/discord.mdx +10 -10
  234. package/docs/channels/eve.mdx +15 -13
  235. package/docs/channels/linear.mdx +11 -0
  236. package/docs/channels/linq.mdx +5 -1
  237. package/docs/channels/photon.mdx +6 -1
  238. package/docs/channels/slack.mdx +73 -14
  239. package/docs/channels/telegram.mdx +6 -0
  240. package/docs/code-extension.mdx +25 -0
  241. package/docs/concepts/default-harness.md +2 -2
  242. package/docs/concepts/execution-model-and-durability.mdx +11 -11
  243. package/docs/concepts/project-structure.mdx +1 -1
  244. package/docs/concepts/security-model.md +6 -2
  245. package/docs/concepts/sessions-runs-and-streaming.md +23 -10
  246. package/docs/concepts/upgrade-to-v27-events.md +70 -1
  247. package/docs/connections/overview.mdx +4 -0
  248. package/docs/evals/reporters.mdx +21 -0
  249. package/docs/extensions.md +12 -0
  250. package/docs/getting-started.mdx +6 -0
  251. package/docs/guides/auth-and-route-protection.md +2 -1
  252. package/docs/guides/client/continuations.mdx +12 -10
  253. package/docs/guides/client/messages.mdx +24 -1
  254. package/docs/guides/client/overview.mdx +8 -6
  255. package/docs/guides/client/streaming.mdx +25 -7
  256. package/docs/guides/decide.md +3 -3
  257. package/docs/guides/deployment/self-hosting.md +1 -1
  258. package/docs/guides/deployment/vercel.mdx +1 -1
  259. package/docs/guides/dev-tui.md +2 -2
  260. package/docs/guides/frontend/meta.json +1 -0
  261. package/docs/guides/frontend/nextjs.mdx +329 -121
  262. package/docs/guides/frontend/overview.mdx +115 -335
  263. package/docs/guides/frontend/tanstack.mdx +1 -1
  264. package/docs/guides/frontend/use-eve-agent-svelte.mdx +18 -16
  265. package/docs/guides/frontend/use-eve-agent-vue.mdx +18 -16
  266. package/docs/guides/frontend/use-eve-agent.mdx +385 -0
  267. package/docs/guides/hooks.md +1 -1
  268. package/docs/guides/instrumentation/otel.mdx +3 -1
  269. package/docs/guides/prepare-for-1-0.md +255 -0
  270. package/docs/guides/remote-agents.md +26 -22
  271. package/docs/guides/self-modification.md +6 -0
  272. package/docs/instructions.mdx +1 -1
  273. package/docs/memory/custom-provider.md +1 -1
  274. package/docs/memory/file.md +11 -2
  275. package/docs/meta.json +1 -0
  276. package/docs/reference/agent-files.md +17 -17
  277. package/docs/reference/cli.md +15 -11
  278. package/docs/reference/typescript-api.md +46 -20
  279. package/docs/sandbox/custom-providers.mdx +2 -0
  280. package/docs/sandbox/default.mdx +6 -6
  281. package/docs/sandbox/index.mdx +6 -6
  282. package/docs/sandbox/just-bash.mdx +30 -21
  283. package/docs/subagents/index.mdx +4 -4
  284. package/docs/tools/human-in-the-loop.md +1 -1
  285. package/docs/tools/workflows.mdx +52 -8
  286. package/docs/tutorial/first-agent.mdx +1 -1
  287. package/package.json +46 -27
  288. package/dist/src/public/channels/discord/gateway/index.js +0 -1
  289. package/dist/src/self-modification/agent.d.ts +0 -12
  290. package/dist/src/self-modification/agent.js +0 -1
@@ -8,7 +8,7 @@ export interface VerifiedRemoteAgentInspection {
8
8
  /** Verified Vercel scope to retain when reconnecting to the same deployment. */
9
9
  readonly vercelScope?: string;
10
10
  }
11
- /** @internal Dependencies for testing verified remote inspection. */
11
+ /** Dependencies for testing verified remote inspection. */
12
12
  export interface InspectVerifiedRemoteAgentDeps {
13
13
  readonly createClient: (options: ClientOptions) => Pick<Client, "info">;
14
14
  readonly resolveVerifiedRemoteDevelopmentClient: (input: Parameters<typeof resolveVerifiedRemoteDevelopmentClient>[0]) => Promise<VerifiedRemoteDevelopmentClient>;
@@ -26,6 +26,4 @@ export declare function inspectVerifiedRemoteAgent(input: {
26
26
  readonly workspaceRoot: string;
27
27
  readonly prompter?: Prompter;
28
28
  readonly signal?: AbortSignal;
29
- /** @internal Test seam. */
30
- readonly deps?: Partial<InspectVerifiedRemoteAgentDeps>;
31
29
  }): Promise<VerifiedRemoteAgentInspection>;
@@ -1,4 +1,3 @@
1
- import type { LanguageModel } from "ai";
2
1
  import type { JsonObject } from "#shared/json.js";
3
2
  import type { ModuleSourceRef } from "#shared/source-ref.js";
4
3
  import type { TokenUsage } from "#shared/token-usage.js";
@@ -75,10 +74,20 @@ export type InternalAgentModelDefinition = {
75
74
  promptCache?: AgentPromptCacheDefinition;
76
75
  };
77
76
  /**
78
- * A concrete model handle: an AI Gateway model id string or an AI SDK
79
- * `LanguageModel` instance.
77
+ * A language model instance eve calls directly, such as one returned by `anthropic()` or
78
+ * `openai()` from `eve/models/*`, or by an AI SDK provider. Any AI SDK language model
79
+ * (specification `v2`, `v3`, or `v4`) is assignable. eve invokes `doGenerate` and `doStream`
80
+ * itself, so their call options and results stay opaque here.
80
81
  */
81
- export type PublicAgentStaticModelDefinition = string | LanguageModel;
82
+ export interface EveLanguageModel {
83
+ readonly specificationVersion: "v2" | "v3" | "v4";
84
+ readonly provider: string;
85
+ readonly modelId: string;
86
+ doGenerate(options: never): PromiseLike<unknown>;
87
+ doStream(options: never): PromiseLike<unknown>;
88
+ }
89
+ /** A concrete model handle: an AI Gateway model id string or an {@link EveLanguageModel}. */
90
+ export type PublicAgentStaticModelDefinition = string | EveLanguageModel;
82
91
  export interface PublicAgentModelSelectionDefinition {
83
92
  readonly model: PublicAgentStaticModelDefinition;
84
93
  /** Override the agent reasoning effort for this selection; omitted values inherit it. */
@@ -116,7 +125,7 @@ export interface InternalAgentCompactionDefinition {
116
125
  }
117
126
  /**
118
127
  * Configures conversation compaction: when the model context window fills past
119
- * `thresholdPercent`, eve summarizes earlier turns to reclaim space. Every
128
+ * `threshold`, eve summarizes earlier turns to reclaim space. Every
120
129
  * field is optional; omit the block to use eve's defaults.
121
130
  */
122
131
  export interface PublicAgentCompactionDefinition {
@@ -140,7 +149,7 @@ export interface PublicAgentCompactionDefinition {
140
149
  *
141
150
  * eve defaults to `0.9` when this is omitted.
142
151
  */
143
- readonly thresholdPercent?: number;
152
+ readonly threshold?: number;
144
153
  }
145
154
  /**
146
155
  * Configures framework-owned runtime limits for this agent's runs.
@@ -164,11 +173,11 @@ export interface AgentLimitsDefinition {
164
173
  * or fails it when nobody can answer. Approving starts a new window.
165
174
  *
166
175
  * Subagent sessions without their own `sessionUsage` use the root agent's.
167
- * Set `sessionUsage: () => false` to leave sessions uncapped.
176
+ * Set `sessionUsage: false` to leave sessions uncapped.
168
177
  *
169
178
  * @default ({ window }) => window.inputTokens - window.cacheReadTokens >= 40_000_000
170
179
  */
171
- readonly sessionUsage?: SessionUsageLimit;
180
+ readonly sessionUsage?: SessionUsageLimit | false;
172
181
  }
173
182
  /**
174
183
  * Usage limit check for one session. `inputTokens` includes cache reads and
@@ -310,7 +319,7 @@ export type InternalAgentDefinition = {
310
319
  */
311
320
  export interface CompiledAgentLimitsDefinition {
312
321
  readonly sessionTimeoutMs?: number | false;
313
- readonly sessionUsage?: true;
322
+ readonly sessionUsage?: boolean;
314
323
  }
315
324
  /**
316
325
  * Shared public definition for an agent.
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Base class of errors eve throws to callers. Every eve error has a stable snake_case `code`.
3
+ *
4
+ * Narrow with the static `is()` of the class you expect, such as `ClientError.is(error)`.
5
+ * Unlike `instanceof`, it recognizes errors created by another copy of eve, for example when a
6
+ * framework bundles eve separately from your application code.
7
+ */
8
+ export declare class EveError extends Error {
9
+ /**
10
+ * Stable class name that `is()` matches and the instance `name` reports. Minifiers rename
11
+ * constructors, so every subclass must declare its own; the constructor throws otherwise.
12
+ */
13
+ static readonly errorName: string;
14
+ /** Stable snake_case error code. */
15
+ readonly code: string;
16
+ constructor(code: string, message: string, options?: ErrorOptions);
17
+ /** Whether `error` is an eve error of this class or a subclass, from any copy of eve. */
18
+ static is<T extends EveError>(this: {
19
+ readonly errorName: string;
20
+ readonly prototype: T;
21
+ }, error: unknown): error is T;
22
+ }
@@ -0,0 +1 @@
1
+ const LINEAGE=Symbol.for(`eve.error.lineage`);var EveError=class EveError extends Error{static errorName=`EveError`;code;constructor(e,t,n){if(super(t,n),new.target!==EveError&&!Object.hasOwn(new.target,`errorName`))throw TypeError(`${new.target.name} must declare its own static errorName.`);this.name=new.target.errorName,this.code=e;let r=[new.target.errorName];for(let e=new.target;e!==EveError;)e=Object.getPrototypeOf(e),r.push(e.errorName);Object.defineProperty(this,LINEAGE,{value:Object.freeze(r)})}static is(e){if(typeof e!=`object`||!e)return!1;let t=Reflect.get(e,LINEAGE);return Array.isArray(t)&&t.includes(this.errorName)}};export{EveError};
@@ -1,5 +1,5 @@
1
1
  import type { SessionStreamEvent } from "#protocol/session-event.js";
2
- import type { StreamReconnectPolicy } from "#client/types.js";
2
+ import type { ReconnectOptions } from "#client/types.js";
3
3
  /** Options common to session readers on the client and server. */
4
4
  export interface SessionStreamOptions {
5
5
  /**
@@ -13,7 +13,7 @@ export interface SessionStreamOptions {
13
13
  /** Stops the read and releases its stream reader. */
14
14
  readonly signal?: AbortSignal;
15
15
  /** Client-only reconnection policy; server-side readers do not reconnect. */
16
- readonly streamReconnectPolicy?: StreamReconnectPolicy;
16
+ readonly reconnect?: false | ReconnectOptions;
17
17
  }
18
18
  /** A read-only session handle. Attaching it performs no I/O and grants no command authority. */
19
19
  export interface SessionReader {
@@ -1,6 +1,12 @@
1
1
  import { z } from "#compiled/zod/index.js";
2
2
  /** Provider-reported token usage and optional model token cost totals. */
3
- export type TokenUsage = z.infer<typeof tokenUsageWithCostSchema>;
3
+ export interface TokenUsage {
4
+ cacheReadTokens: number;
5
+ cacheWriteTokens: number;
6
+ inputTokens: number;
7
+ outputTokens: number;
8
+ costUsd?: number | undefined;
9
+ }
4
10
  /** Current schema for provider-reported token usage and model token cost. */
5
11
  export declare const tokenUsageWithCostSchema: z.ZodObject<{
6
12
  cacheReadTokens: z.ZodNumber;
@@ -1,3 +1,3 @@
1
- import { n as signInEnding, t as useEveAgent } from "../chunks/use-eve-agent-DCLFi26P.js";
1
+ import { n as signInEnding, t as useEveAgent } from "../chunks/use-eve-agent-C0KHCyb9.js";
2
2
 
3
3
  export { signInEnding, useEveAgent };
@@ -55,7 +55,8 @@ export interface UseEveAgentReturn {
55
55
  readonly prewarm: () => Promise<void>;
56
56
  /** Clear all state and start a new session. */
57
57
  readonly newSession: () => void;
58
- readonly reset: () => Promise<Delivery>;
58
+ /** Retires the server-side session; call newSession() to prepare a fresh conversation. */
59
+ readonly end: () => Promise<Delivery>;
59
60
  readonly clear: () => Promise<Delivery>;
60
61
  readonly compact: () => Promise<Delivery>;
61
62
  /** Submits a message and resolves on acceptance, not execution. */
@@ -1,3 +1,3 @@
1
- import { t as useEveAgent } from "../chunks/use-eve-agent-DCLFi26P.js";
1
+ import { t as useEveAgent } from "../chunks/use-eve-agent-C0KHCyb9.js";
2
2
 
3
3
  export { useEveAgent };
@@ -12,7 +12,7 @@ import type { TokenResult } from "#shared/connection-types.js";
12
12
  import type { ToolAuthOptions, ToolAuthProvider } from "#tools/auth.js";
13
13
  import type { InteractionRequest } from "#protocol/session-events/families/interaction.js";
14
14
  import type { ToolModelOutput } from "#tools/model-output.js";
15
- type ApprovalContextInput<TInput> = unknown extends TInput ? Record<string, unknown> : TInput;
15
+ type ApprovalContextInput<TInput> = 0 extends 1 & TInput ? TInput : unknown extends TInput ? Record<string, unknown> : TInput;
16
16
  export type { ToolAuthDefinition, ToolAuthOptions, ToolAuthProvider } from "#tools/auth.js";
17
17
  export type { ToolModelOutput, ToolModelOutputPart } from "#tools/model-output.js";
18
18
  export type ToolExecuteOptions = Omit<ToolExecutionOptions<unknown>, "context"> & {
@@ -330,17 +330,19 @@ export declare function stampToolDefinition<T extends {
330
330
  readonly toModelOutput?: (...args: never[]) => unknown;
331
331
  }>(definition: T, definer: "defineTool" | "defineWorkflowTool"): T;
332
332
  /**
333
- * Marker discriminator written into every {@link DisabledToolSentinel}.
333
+ * Cross-instance brand on a {@link DisabledToolSentinel}. `Symbol.for` lets the compiler's module
334
+ * copy and the author's import share the key; keeping it unexported makes the sentinel opaque, so
335
+ * only {@link disableTool} produces one.
334
336
  */
335
- declare const DISABLED_TOOL_SENTINEL_KIND = "eve:disabled-tool";
337
+ declare const DISABLED_TOOL: unique symbol;
336
338
  /**
337
- * Marker value returned from {@link disableTool}. Export this as the default
339
+ * Opaque value returned from {@link disableTool}. Export this as the default
338
340
  * export of a file in `agent/tools/` to remove the model tool whose name
339
341
  * matches the file's slug, including framework defaults and derived subagent
340
342
  * tools.
341
343
  */
342
344
  export interface DisabledToolSentinel {
343
- readonly kind: typeof DISABLED_TOOL_SENTINEL_KIND;
345
+ readonly [DISABLED_TOOL]: true;
344
346
  }
345
347
  /**
346
348
  * Returns a sentinel that disables the model tool whose name matches the
@@ -1 +1 @@
1
- import{TOOL_BRAND}from"#tools/dynamic.js";import{stampDefinitionKey}from"#internal/authored-definition/source-identity.js";function defineTool(e){return stampToolDefinition(e,`defineTool`)}function stampToolDefinition(e,t){if(e.auth!==void 0)throw Error(`${t}: The "auth" field is no longer supported. Pass auth providers inline to ctx.getToken(provider) or ctx.requireAuth(provider).`);if(`approvalKey`in e)throw Error(`${t}: approvalKey is no longer supported. Use an approval policy for input-dependent decisions.`);return Object.assign(e,{[TOOL_BRAND]:!0}),stampDefinitionKey(e,`tool:${e.description}`),e}const DISABLED_TOOL_SENTINEL_KIND=`eve:disabled-tool`;function disableTool(){return{kind:DISABLED_TOOL_SENTINEL_KIND}}function isDisabledToolSentinel(e){return typeof e==`object`&&!!e&&e.kind===DISABLED_TOOL_SENTINEL_KIND}export{defineTool,disableTool,isDisabledToolSentinel,stampToolDefinition};
1
+ import{TOOL_BRAND}from"#tools/dynamic.js";import{stampDefinitionKey}from"#internal/authored-definition/source-identity.js";function defineTool(e){return stampToolDefinition(e,`defineTool`)}function stampToolDefinition(e,t){if(e.auth!==void 0)throw Error(`${t}: The "auth" field is no longer supported. Pass auth providers inline to ctx.getToken(provider) or ctx.requireAuth(provider).`);if(`approvalKey`in e)throw Error(`${t}: approvalKey is no longer supported. Use an approval policy for input-dependent decisions.`);return Object.assign(e,{[TOOL_BRAND]:!0}),stampDefinitionKey(e,`tool:${e.description}`),e}const DISABLED_TOOL=Symbol.for(`eve.disabled-tool`);function disableTool(){return{[DISABLED_TOOL]:!0}}function isDisabledToolSentinel(e){return typeof e==`object`&&!!e&&Reflect.get(e,DISABLED_TOOL)===!0}export{defineTool,disableTool,isDisabledToolSentinel,stampToolDefinition};
@@ -1 +1 @@
1
- async function executeAskQuestionTool(e,t){"use workflow";return toAskQuestionOutput(await t.ask(toAskQuestionRequest(e)))}function toAskQuestionRequest(e){let t=e.options?.map(e=>({description:e.description,id:e.label,label:e.label}));return{allowFreeform:!0,display:t===void 0?`text`:`select`,prompt:e.question,...t!==void 0&&{options:t}}}function toAskQuestionOutput(e){switch(e.status){case`answered`:return{answer:e.optionId??e.text??``,status:`answered`};case`cancelled`:return{interrupted:!0};case`unavailable`:return{status:`unavailable`}}}executeAskQuestionTool.workflowId=`workflow//eve@0.85.0//executeAskQuestionTool`;export{executeAskQuestionTool,toAskQuestionOutput,toAskQuestionRequest};
1
+ async function executeAskQuestionTool(e,t){"use workflow";return toAskQuestionOutput(await t.ask(toAskQuestionRequest(e)))}function toAskQuestionRequest(e){let t=e.options?.map(e=>({description:e.description,id:e.label,label:e.label}));return{allowFreeform:!0,display:t===void 0?`text`:`select`,prompt:e.question,...t!==void 0&&{options:t}}}function toAskQuestionOutput(e){switch(e.status){case`answered`:return{answer:e.optionId??e.text??``,status:`answered`};case`cancelled`:return{interrupted:!0};case`unavailable`:return{status:`unavailable`}}}executeAskQuestionTool.workflowId=`workflow//eve@0.87.0//executeAskQuestionTool`;export{executeAskQuestionTool,toAskQuestionOutput,toAskQuestionRequest};
@@ -1 +1 @@
1
- import{sleep}from"#compiled/@workflow/core/index.js";async function executeSleepTool(e,t){"use workflow";if(t.abortSignal.aborted)return{interrupted:!0};let n=new Promise(e=>t.abortSignal.addEventListener(`abort`,()=>e(`interrupted`),{once:!0})),r=sleep(Math.ceil(e.seconds*1e3)).then(()=>`elapsed`);return await Promise.race([r,n])===`elapsed`?{waitedSeconds:e.seconds}:{interrupted:!0}}executeSleepTool.workflowId=`workflow//eve@0.85.0//executeSleepTool`;export{executeSleepTool};
1
+ import{sleep}from"#compiled/@workflow/core/index.js";async function executeSleepTool(e,t){"use workflow";if(t.abortSignal.aborted)return{interrupted:!0};let n=new Promise(e=>t.abortSignal.addEventListener(`abort`,()=>e(`interrupted`),{once:!0})),r=sleep(Math.ceil(e.seconds*1e3)).then(()=>`elapsed`);return await Promise.race([r,n])===`elapsed`?{waitedSeconds:e.seconds}:{interrupted:!0}}executeSleepTool.workflowId=`workflow//eve@0.87.0//executeSleepTool`;export{executeSleepTool};
@@ -1,5 +1,5 @@
1
1
  import type { SpanExporter, SpanProcessor } from "./otel-configuration.js";
2
- /** @internal — exposed for tests; authors get the defaults. */
2
+ /** Exposed for tests; authors get the defaults. */
3
3
  interface BatchSpanProcessorOptions {
4
4
  readonly diagnostic?: (message: string, details: {
5
5
  error?: unknown;
@@ -1,19 +1 @@
1
- import type { SpanProcessor } from "#compiled/@vercel/otel/index.js";
2
- import { type SpanExportPolicy } from "#tracing/eve/span-export-policy.js";
3
- /**
4
- * Puts one destination's content policy in front of it.
5
- *
6
- * Accepted traces carry content before they reach destination policies. This
7
- * cannot strip an attribute in place: the span object is shared with every
8
- * processor in the pipeline, and editing it would strip the attribute
9
- * everywhere. So it gives the destination a facade whose attributes omit what
10
- * its policy redacted.
11
- *
12
- * One facade follows the original from start through end. This preserves the
13
- * object identity stateful processors key on without ever exposing the original
14
- * span or its attribute map. Methods stay bound to the original, so private SDK
15
- * state remains reachable without eve knowing that SDK's concrete span shape.
16
- *
17
- * @internal
18
- */
19
- export declare function contentFilteringProcessor(downstream: SpanProcessor, exportPolicy?: SpanExportPolicy | readonly SpanExportPolicy[]): SpanProcessor;
1
+ export {};
@@ -1,9 +1,15 @@
1
+ /**
2
+ * A `SpanProcessor`. Structural for the same reason the exporter is: the
3
+ * instance comes from whichever `@opentelemetry/*` build the app installed, and
4
+ * the host only ever hands it spans.
5
+ */
1
6
  export interface SpanProcessor {
2
7
  forceFlush(): Promise<void>;
3
8
  onEnd(span: unknown): void;
4
9
  onStart(span: unknown, parentContext: unknown): void;
5
10
  shutdown(): Promise<void>;
6
11
  }
12
+ /** A {@link SpanProcessor}, or `"auto"` for the processor `@vercel/otel` resolves for you. */
7
13
  export type SpanProcessorOrName = SpanProcessor | "auto";
8
14
  export interface IdGenerator {
9
15
  generateSpanId(): string;
@@ -138,14 +138,9 @@ export declare function otel(options?: OtelOptions): OtelDeclaration;
138
138
  * this destination, and nothing beneath the policy sees what it removes.
139
139
  */
140
140
  export declare function otelIntegration(options?: OtelIntegrationOptions): OtelIntegration;
141
- /** @internal Local and Agent Runs destination declaration. */
142
- export declare function managedOtelIntegration(options?: OtelIntegrationOptions): OtelIntegration;
143
- /** Vercel Agent Runs through the hosted request-context transport. @internal */
144
- export declare function agentRunsIntegration(options?: ManagedTraceOptions): OtelIntegration;
145
141
  export declare function isOtelDeclaration(value: unknown): value is OtelDeclaration;
146
142
  export declare function isOtelIntegration(value: unknown): value is OtelIntegration;
147
- /** The one pipeline a process can register. @internal */
148
- /** What the harness reads at turn time, as opposed to at registration. @internal */
143
+ /** What the harness reads at turn time, as opposed to at registration. */
149
144
  export interface OtelHarnessSettings {
150
145
  readonly functionId?: string;
151
146
  readonly traceChannelRequests: boolean;
@@ -155,9 +150,12 @@ export interface OtelHarnessSettings {
155
150
  /** Whether AI SDK spans include model and tool outputs. */
156
151
  readonly recordOutputs: boolean;
157
152
  }
158
- /** @internal */
153
+ /**
154
+ * A tracing destination's `runtimeContext` for one model attempt; `undefined` adds nothing.
155
+ * Later destinations win on key collisions.
156
+ */
159
157
  export type RuntimeContextResolver = (input: InstrumentationModelStartedInput) => JsonObject | undefined;
160
- /** @internal */
158
+ /** The one pipeline a process can register. */
161
159
  export interface CollectedOtel {
162
160
  /**
163
161
  * Whether anything declared OpenTelemetry. False means eve should leave the
@@ -168,14 +166,3 @@ export interface CollectedOtel {
168
166
  readonly runtimeContextResolvers: readonly RuntimeContextResolver[];
169
167
  readonly settings: OtelHarnessSettings;
170
168
  }
171
- /**
172
- * Folds the declared values into the one pipeline a process can register.
173
- *
174
- * Destinations concatenate in declaration order. The singletons cannot: two
175
- * `otel()` values is a boot error rather than a silent win for whichever eve
176
- * happened to visit first. With one declaration per file that collision needs
177
- * two files both exporting `otel()`, which is the only way to reach it.
178
- *
179
- * @internal
180
- */
181
- export declare function collectOtelPipeline(values: readonly unknown[]): CollectedOtel;
@@ -30,5 +30,3 @@ export interface SpanExportPolicy {
30
30
  readonly value: unknown;
31
31
  }) => SpanAttributeDecision;
32
32
  }
33
- /** @internal */
34
- export declare function normalizeSpanExportPolicies(policy: SpanExportPolicy | readonly SpanExportPolicy[] | undefined): readonly SpanExportPolicy[];
@@ -1,7 +1,4 @@
1
1
  import { type InstrumentationRuntime } from "#instrumentation/runtime.js";
2
- import { type TraceCapturePolicy } from "#tracing/eve/otel-declaration.js";
3
- /** Zero-config local tracing admits every session in the development worker. @internal */
4
- export declare const localTracePolicy: TraceCapturePolicy;
5
2
  /** Installs the zero-config local OTel runtime once in an `eve dev` worker. */
6
3
  export declare function installLocalInstrumentationRuntime(input: {
7
4
  readonly appRoot: string;
@@ -1,5 +1,4 @@
1
1
  import type { SpanProcessor } from "#compiled/@vercel/otel/index.js";
2
- import { type SpanExportPolicy } from "#tracing/eve/span-export-policy.js";
3
2
  /**
4
3
  * The local spool, as a span processor.
5
4
  *
@@ -13,16 +12,6 @@ export interface LocalTracesProcessor extends SpanProcessor {
13
12
  */
14
13
  releaseConversation(conversationId: string): Promise<boolean>;
15
14
  }
16
- /**
17
- * Reports whether a processor tracks which conversation owns which trace, so
18
- * eve can tell it when that conversation is done.
19
- *
20
- * Anything standing between eve and the spool has to answer for the spool, so
21
- * this is the check a wrapper uses to decide whether it must forward the call.
22
- *
23
- * @internal
24
- */
25
- export declare function hasConversationRelease(processor: SpanProcessor): processor is LocalTracesProcessor;
26
15
  /**
27
16
  * Writes the OTLP/JSON spool under `.eve/traces/v1`.
28
17
  *
@@ -36,5 +25,3 @@ export declare function hasConversationRelease(processor: SpanProcessor): proces
36
25
  export declare function createLocalTracesProcessor(input?: {
37
26
  readonly appRoot?: string;
38
27
  }): LocalTracesProcessor;
39
- /** Applies the local content environment override before authored policies. @internal */
40
- export declare function resolveLocalTracesExportPolicy(exportPolicy?: SpanExportPolicy | readonly SpanExportPolicy[]): SpanExportPolicy | readonly SpanExportPolicy[] | undefined;
@@ -1,3 +1,3 @@
1
- import { n as signInEnding, t as useEveAgent } from "../chunks/use-eve-agent-B2jCfcnG.js";
1
+ import { n as signInEnding, t as useEveAgent } from "../chunks/use-eve-agent-BExXjBv6.js";
2
2
 
3
3
  export { signInEnding, useEveAgent };
@@ -53,7 +53,8 @@ export interface UseEveAgentReturn {
53
53
  readonly prewarm: () => Promise<void>;
54
54
  /** Clear all state and start a new session. */
55
55
  readonly newSession: () => void;
56
- readonly reset: () => Promise<Delivery>;
56
+ /** Retires the server-side session; call newSession() to prepare a fresh conversation. */
57
+ readonly end: () => Promise<Delivery>;
57
58
  readonly clear: () => Promise<Delivery>;
58
59
  readonly compact: () => Promise<Delivery>;
59
60
  /** Submits a message and resolves on acceptance, not execution. */
@@ -137,7 +138,7 @@ export interface UseEveAgentOptions extends SessionStoreCallbacks {
137
138
  *
138
139
  * Returns reactive refs for the conversation (`messages`, `agents`, `view`) and for `error`,
139
140
  * `events`, `session`, and `status`, plus `prewarm`, `send`, `respond`, `resume`, `cancel`,
140
- * `newSession`, and `reset`. Configuration is read once on store creation;
141
+ * `newSession`, and `end`. Configuration is read once on store creation;
141
142
  * remount to change it. On scope dispose, the in-flight request is detached and
142
143
  * the store unsubscribed.
143
144
  */
@@ -1,3 +1,3 @@
1
- import { t as useEveAgent } from "../chunks/use-eve-agent-B2jCfcnG.js";
1
+ import { t as useEveAgent } from "../chunks/use-eve-agent-BExXjBv6.js";
2
2
 
3
3
  export { useEveAgent };
@@ -24,9 +24,11 @@ dev TUI with `/model anthropic/claude-opus-5.5`.
24
24
  The root `agent.ts` can be omitted when no runtime config is needed. eve then selects its default `agent.ts` source at the same slot, configured with `openai/gpt-6-luna-fast` and `reasoning: "high"`; authoring the file replaces that source.
25
25
  When `agent.ts` is present, `model` is required.
26
26
 
27
- A config that selects a static Gateway model is compile-only. A config that contains a dynamic model or a direct-provider `LanguageModel` remains a runtime entry because eve must resolve that authored value while the agent runs. See [Authored module lifecycle](./reference/typescript-api#authored-module-lifecycle).
27
+ An `agent.ts` that configures a local agent, root or subagent, must export the value `defineAgent` returns, and a dynamic subagent resolver that selects a local agent must return one. The compiler rejects a plain object export with `Export defineAgent({...}) from "<path>".`
28
28
 
29
- `model` accepts a gateway model id string, which routes through the [Vercel AI Gateway](https://vercel.com/docs/ai-gateway). To call a provider directly and configure the model in code, pass a provider-authored `LanguageModel`.
29
+ A config that selects a static Gateway model is compile-only. A config that contains a dynamic model or a direct-provider model instance remains a runtime entry because eve must resolve that authored value while the agent runs. See [Authored module lifecycle](./reference/typescript-api#authored-module-lifecycle).
30
+
31
+ `model` accepts a gateway model id string, which routes through the [Vercel AI Gateway](https://vercel.com/docs/ai-gateway). To call a provider directly and configure the model in code, pass a model instance. eve types it as `EveLanguageModel` (exported from `eve` and `eve/models`), which every AI SDK language model satisfies.
30
32
 
31
33
  Use eve's helpers for direct OpenAI or Anthropic access without installing another provider package:
32
34
 
@@ -43,9 +45,9 @@ export default defineAgent({
43
45
 
44
46
  For a local ChatGPT subscription, use `chatgpt()` from `eve/models/openai` and sign in with `/login`. It defaults to `gpt-6-luna-fast` and cannot run in a deployment.
45
47
 
46
- `/login` can switch a static Gateway string to an eve helper and manage its import. `/model` changes the selected model and settings immediately. Custom provider SDK calls and dynamic expressions retain their authored behavior and require manual source edits. You can still install an AI SDK provider package and pass its `LanguageModel` when you need provider-specific configuration.
48
+ `/login` can switch a static Gateway string to an eve helper and manage its import. `/model` changes the selected model and settings immediately. Custom provider SDK calls and dynamic expressions retain their authored behavior and require manual source edits. You can still install an AI SDK provider package and pass its language model when you need provider-specific configuration.
47
49
 
48
- Model use is subject to the terms, data-processing commitments, retention behavior, and available controls of the selected provider and routing path. Review the [AI Gateway model catalog](https://vercel.com/ai-gateway/models) for gateway-routed models, and review the provider's terms when you configure a direct `LanguageModel`.
50
+ Model use is subject to the terms, data-processing commitments, retention behavior, and available controls of the selected provider and routing path. Review the [AI Gateway model catalog](https://vercel.com/ai-gateway/models) for gateway-routed models, and review the provider's terms when you configure a direct model instance.
49
51
 
50
52
  For every OpenAI or Anthropic model call, eve fills the provider's end-user
51
53
  safety identifier from the active turn's
@@ -166,7 +168,7 @@ export default defineAgent({
166
168
  });
167
169
  ```
168
170
 
169
- The function returns a Gateway model ID, an AI SDK `LanguageModel`, or a selection object. See
171
+ The function returns a Gateway model ID, a model instance such as an AI SDK language model, or a selection object. See
170
172
  [Dynamic capabilities](./guides/dynamic-capabilities) for the context and memo rules.
171
173
 
172
174
  - **When it changes.** eve evaluates before each ordinary model call. A memo keyed by
@@ -235,13 +237,13 @@ Gateway models; use `providerOptions.gateway.caching` instead.
235
237
 
236
238
  ## Compaction
237
239
 
238
- Compaction summarizes older turns as you approach the context window. It's on by default, so you only tune when it kicks in. eve adds the estimated fixed checkpoint-prompt envelope to the trigger count, so compaction starts sooner than the conversation-only estimate. Lower `thresholdPercent` to compact sooner:
240
+ Compaction summarizes older turns as you approach the context window. It's on by default, so you only tune when it kicks in. eve adds the estimated fixed checkpoint-prompt envelope to the trigger count, so compaction starts sooner than the conversation-only estimate. Lower `compaction.threshold` (a fraction from 0 to 1) to compact sooner:
239
241
 
240
242
  ```ts title="agent/agent.ts"
241
243
  export default defineAgent({
242
244
  model: "anthropic/claude-opus-5.5",
243
245
  compaction: {
244
- thresholdPercent: 0.75, // default 0.9
246
+ threshold: 0.75, // default 0.9
245
247
  },
246
248
  });
247
249
  ```
@@ -282,8 +284,9 @@ disable the timeout. Session expiration follows
282
284
  [run-data retention](#run-data-retention); a zero-retention session loses its
283
285
  stored payloads when it ends.
284
286
 
285
- `sessionUsage` gets two usage records with `inputTokens`, `outputTokens`,
286
- `cacheReadTokens`, `cacheWriteTokens`, and `costUsd`: `total` is everything
287
+ `sessionUsage` gets two `TokenUsage` records (exported from `eve`) with
288
+ `inputTokens`, `outputTokens`, `cacheReadTokens`, `cacheWriteTokens`, and
289
+ `costUsd`: `total` is everything
287
290
  the session has spent, and `window` is what it spent since the last approved
288
291
  continuation. `inputTokens` includes cache reads and writes. Subtract
289
292
  `cacheReadTokens` to count only new input; cache reads are the history a
@@ -325,8 +328,8 @@ export default defineAgent({
325
328
  });
326
329
  ```
327
330
 
328
- Set `sessionUsage: () => false` to leave sessions uncapped; `sessionUsage:
329
- false` is not accepted. eve calls `sessionUsage` before each model call once
331
+ Set `sessionUsage: false` to leave sessions uncapped. A callback that always
332
+ returns `false` has the same effect. eve calls a configured callback before each model call once
330
333
  the window has usage. The model call that crosses a limit is allowed to finish
331
334
  because exact usage arrives after the call completes. Before the next model
332
335
  call, eve pauses the turn (`turn.paused`) and sends a deterministic
@@ -466,6 +469,7 @@ when the session starts; destination export filters and lifecycle-provider
466
469
  policies do not change it.
467
470
 
468
471
  Set `experimental.workflow.retention` explicitly to override this behavior.
472
+ This override is experimental and has no compatibility promise.
469
473
  Use `0` to request deletion regardless of the tracing policy, or `"default"` to
470
474
  keep run data for the World's default period regardless of the tracing policy:
471
475
 
@@ -27,7 +27,7 @@ export default defineChannel({
27
27
  const source = from(params.threadId);
28
28
 
29
29
  if (body.message === "/new") {
30
- return Response.json(await source.reset({ reason: "User requested /new" }));
30
+ return Response.json(await source.end({ reason: "User requested /new" }));
31
31
  }
32
32
 
33
33
  const delivery = await source.send(body.message, { auth: null });
@@ -82,7 +82,7 @@ A route's `path` is its app URL; the channel filename does not prefix it. The ro
82
82
 
83
83
  Each route receives these operation surfaces:
84
84
 
85
- - `from(address)` binds `send`, `respond`, `cancel`, `compact`, `clear`, and `reset` to a channel-local continuation address.
85
+ - `from(address)` binds `send`, `respond`, `cancel`, `compact`, `clear`, and `end` to a channel-local continuation address.
86
86
  - `resolveSession(address)` snapshots the session currently owning a channel-local continuation address.
87
87
  - `attachSession(sessionId)` creates an I/O-free handle pinned to one durable session ID.
88
88
  - `to(channel, target).send(message, options)` hands work to another authored channel.
@@ -128,7 +128,7 @@ await source.respond(answers, { auth });
128
128
  await source.cancel({ turnId });
129
129
  await source.compact();
130
130
  await source.clear();
131
- await source.reset({ reason: "Start over" });
131
+ await source.end({ reason: "Start over" });
132
132
 
133
133
  const currentSession = await resolveSession(threadId);
134
134
  ```
@@ -157,7 +157,7 @@ await session.respond(answers, { auth });
157
157
  await session.cancel({ turnId });
158
158
  await session.compact();
159
159
  await session.clear();
160
- await session.reset({ reason: "Retire this session" });
160
+ await session.end({ reason: "Retire this session" });
161
161
  for await (const event of session.stream({ startIndex: 12 })) render(event);
162
162
  ```
163
163
 
@@ -169,7 +169,7 @@ For a stranded session, `Session.send()`, `Session.respond()`, and a following
169
169
  read through `Session.stream()` throw `SessionStrandedError` from `eve/channels` and deliver nothing.
170
170
  `stream({ follow: false })` still reads the recorded history up to the current tail without
171
171
  changing the session. `error.owner.eveVersion` names the eve release that built the session when it recorded one. Call
172
- `reset()` to end the stranded session, then start a new one:
172
+ `end()` to retire the stranded session, then start a new one:
173
173
 
174
174
  ```ts
175
175
  import { SessionStrandedError } from "eve/channels";
@@ -178,7 +178,7 @@ try {
178
178
  await attachSession(sessionId).send(text, { auth });
179
179
  } catch (error) {
180
180
  if (!SessionStrandedError.is(error)) throw error;
181
- await attachSession(sessionId).reset({ reason: "Session was stranded by an upgrade" });
181
+ await attachSession(sessionId).end({ reason: "Session was stranded by an upgrade" });
182
182
  }
183
183
  ```
184
184
 
@@ -325,12 +325,12 @@ Keep each route's `method` and `path` unless you mean to move the endpoint.
325
325
  `kind: "compaction"`.
326
326
  - `clear` removes model-message history in place. It preserves the system prompt,
327
327
  skills, tools, durable state, limits, address ownership, and session sandbox.
328
- - `reset` terminally retires the current session. A later address `send()` creates
328
+ - `end` terminally retires the current session. A later address `send()` creates
329
329
  a fresh session; a fixed `Session` handle remains pinned to the retired ID.
330
330
 
331
331
  Control operations never create a session. Unknown or inactive targets throw
332
332
  `SessionNotActiveError`; an accepted no-op cancellation settles with `outcome: "ignored"`. Authenticate and deduplicate command webhooks before
333
- calling `reset`, because a delayed duplicate can retire a newer address owner.
333
+ calling `end`, because a delayed duplicate can retire a newer address owner.
334
334
 
335
335
  ## CORS
336
336
 
@@ -536,11 +536,27 @@ slackContinuationToken({ channelId: "C0123ABC", threadTs: "1800000000.001234" })
536
536
  twilioContinuationToken({ from: "+15551234567", to: "+15557654321" }); // "+15551234567:+15557654321"
537
537
  ```
538
538
 
539
+ Built-in channels export token builders from their own `eve/channels/<platform>` entry:
540
+
541
+ | Builder | Address fields |
542
+ | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
543
+ | `slackContinuationToken` | `channelId`, `threadTs` |
544
+ | `slackCodeChannelContinuationToken` | `channelId` (positional argument) |
545
+ | `twilioContinuationToken` | `from`, optional `to` |
546
+ | `githubContinuationToken` | `repositoryId`, `conversationKind`, and the matching `issueNumber`, `pullRequestNumber`, or `reviewThreadRootCommentId` |
547
+ | `discordContinuationToken` | `channelId`, optional `conversationId` |
548
+ | `teamsContinuationToken` | `conversationId`, optional `tenantId` and `replyToActivityId` |
549
+ | `telegramContinuationToken` | `chatId`, optional `messageThreadId` and `conversationId` |
550
+ | `linearContinuationToken` | `agentSessionId` |
551
+
552
+ Pass the resulting channel-local token to that channel's `from(...)` helper.
553
+ Tokens are routing addresses, not credentials or substitutes for authorization.
554
+
539
555
  Custom channels write their own function that joins the identity fields. The framework derives nothing for you; the channel owns its token format.
540
556
 
541
557
  When another identity should address a session, add it with `channel.continuation?.alias(rawToken)`. The runtime preserves the current channel namespace and exposes the new token as `channel.continuation.token` for later handlers.
542
558
 
543
- Aliasing adds an address to the current session. Earlier addresses continue to resolve to the same session and accept the same payloads. `reset` terminally retires the current session and makes all its addresses available to later `send()` calls. `cancel` stops only the active turn and leaves the session, history, and continuation-token ownership intact.
559
+ Aliasing adds an address to the current session. Earlier addresses continue to resolve to the same session and accept the same payloads. `end` terminally retires the current session and makes all its addresses available to later `send()` calls. `cancel` stops only the active turn and leaves the session, history, and continuation-token ownership intact.
544
560
 
545
561
  The `context(state, channel)` config option builds the per-step context read as `ctx.channel`
546
562
  in event handlers. Its second argument is `ChannelContext` from `eve/channels`: live
@@ -575,7 +591,7 @@ defineChannel<{ ref: string | null }>({
575
591
  });
576
592
  ```
577
593
 
578
- At the next workflow boundary, the runtime adds the new address to the session's merged inbox. If another active session already owns the new token, the aliasing session fails instead of taking it over. Every address claimed by the session remains active until the session ends or resets. Sessions with continuation addresses remain on their current deployment until Workflow supports atomic ownership transfer.
594
+ At the next workflow boundary, the runtime adds the new address to the session's merged inbox. If another active session already owns the new token, the aliasing session fails instead of taking it over. Every address claimed by the session remains active until the session ends. Sessions with continuation addresses remain on their current deployment until Workflow supports atomic ownership transfer.
579
595
 
580
596
  Tokens must be nonempty. A session supports up to 256 addresses, including its stable inbox; repeating an existing alias does not consume another address.
581
597