eve 0.37.0 → 0.37.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 (215) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/src/channel/routes.d.ts +13 -3
  3. package/dist/src/channel/routes.js +1 -1
  4. package/dist/src/channel/session-callback.js +1 -1
  5. package/dist/src/channel/session.d.ts +2 -1
  6. package/dist/src/channel/session.js +1 -1
  7. package/dist/src/channel/types.d.ts +41 -0
  8. package/dist/src/chunks/{use-eve-agent-CnppTEFk.js → use-eve-agent-Bi5fRxcZ.js} +9 -1
  9. package/dist/src/chunks/{use-eve-agent-COmP-H8R.js → use-eve-agent-DbKUBhl-.js} +9 -1
  10. package/dist/src/cli/commands/init-git.js +1 -1
  11. package/dist/src/cli/commands/init-recovery.d.ts +3 -0
  12. package/dist/src/cli/commands/init-recovery.js +3 -0
  13. package/dist/src/cli/commands/init-target.d.ts +21 -0
  14. package/dist/src/cli/commands/init-target.js +1 -0
  15. package/dist/src/cli/commands/init.js +1 -1
  16. package/dist/src/cli/dev/tui/runner.d.ts +8 -0
  17. package/dist/src/cli/dev/tui/runner.js +1 -1
  18. package/dist/src/cli/dev/tui/subagent-pump.d.ts +27 -22
  19. package/dist/src/cli/dev/tui/subagent-pump.js +1 -1
  20. package/dist/src/cli/dev/tui/terminal-renderer.d.ts +16 -0
  21. package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
  22. package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
  23. package/dist/src/client/open-stream.d.ts +2 -0
  24. package/dist/src/client/open-stream.js +1 -1
  25. package/dist/src/client/session.js +1 -1
  26. package/dist/src/compiled/.vendor-stamp.json +2 -1
  27. package/dist/src/compiled/@modelcontextprotocol/server/LICENSE +216 -0
  28. package/dist/src/compiled/@modelcontextprotocol/server/index.d.ts +98 -0
  29. package/dist/src/compiled/@modelcontextprotocol/server/index.js +80 -0
  30. package/dist/src/compiler/extension-compatibility.d.ts +10 -10
  31. package/dist/src/compiler/extension-compatibility.js +1 -1
  32. package/dist/src/compiler/manifest.js +1 -1
  33. package/dist/src/compiler/normalize-agent-config.js +1 -1
  34. package/dist/src/compiler/normalize-manifest.js +1 -1
  35. package/dist/src/compiler/normalize-subagent.d.ts +1 -1
  36. package/dist/src/compiler/normalize-subagent.js +1 -1
  37. package/dist/src/context/serialized-dynamic-model-selection.d.ts +2 -0
  38. package/dist/src/context/serialized-dynamic-model-selection.js +1 -0
  39. package/dist/src/execution/agent-handle-dispatch.d.ts +15 -1
  40. package/dist/src/execution/agent-handle-dispatch.js +1 -1
  41. package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
  42. package/dist/src/execution/delegated-parent-notification.d.ts +17 -0
  43. package/dist/src/execution/delegated-parent-notification.js +1 -1
  44. package/dist/src/execution/deliver-payloads.js +1 -1
  45. package/dist/src/execution/dispatch-runtime-actions-shared.d.ts +155 -0
  46. package/dist/src/execution/dispatch-runtime-actions-shared.js +1 -0
  47. package/dist/src/execution/dispatch-runtime-actions-step.d.ts +18 -14
  48. package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
  49. package/dist/src/execution/dispatch-workflow-runtime-actions-step.d.ts +7 -2
  50. package/dist/src/execution/dispatch-workflow-runtime-actions-step.js +1 -1
  51. package/dist/src/execution/effective-output-schema.d.ts +21 -0
  52. package/dist/src/execution/effective-output-schema.js +1 -0
  53. package/dist/src/execution/eve-workflow-attributes.d.ts +2 -0
  54. package/dist/src/execution/node-step.js +1 -1
  55. package/dist/src/execution/parked-delivery-wait.d.ts +8 -12
  56. package/dist/src/execution/parked-delivery-wait.js +1 -1
  57. package/dist/src/execution/{route-proxied-deliver-step.d.ts → proxied-deliver-step.d.ts} +7 -4
  58. package/dist/src/execution/proxied-deliver-step.js +1 -0
  59. package/dist/src/execution/remote-agent-dispatch.d.ts +32 -0
  60. package/dist/src/execution/remote-agent-dispatch.js +1 -1
  61. package/dist/src/execution/remote-agent-route-url.d.ts +2 -0
  62. package/dist/src/execution/remote-agent-route-url.js +1 -0
  63. package/dist/src/execution/route-child-delivery.d.ts +2 -1
  64. package/dist/src/execution/route-child-delivery.js +1 -1
  65. package/dist/src/execution/session-callback-step.d.ts +11 -0
  66. package/dist/src/execution/session-callback-step.js +1 -1
  67. package/dist/src/execution/session-command-wire.js +1 -1
  68. package/dist/src/execution/session-state-cursor.d.ts +25 -0
  69. package/dist/src/execution/session-state-cursor.js +1 -0
  70. package/dist/src/execution/settle-cancelled-turn-step.d.ts +2 -0
  71. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  72. package/dist/src/execution/subagent-event-proxy-step.d.ts +15 -0
  73. package/dist/src/execution/subagent-event-proxy-step.js +1 -1
  74. package/dist/src/execution/subagent-hitl-proxy.d.ts +14 -7
  75. package/dist/src/execution/subagent-hitl-proxy.js +1 -1
  76. package/dist/src/execution/subagent-start-local.d.ts +29 -0
  77. package/dist/src/execution/subagent-start-local.js +1 -0
  78. package/dist/src/execution/subagent-start-remote.d.ts +23 -0
  79. package/dist/src/execution/subagent-start-remote.js +1 -0
  80. package/dist/src/execution/task-event-callback.d.ts +13 -0
  81. package/dist/src/execution/task-event-callback.js +1 -0
  82. package/dist/src/execution/task-input-capability.d.ts +4 -0
  83. package/dist/src/execution/task-input-capability.js +1 -0
  84. package/dist/src/execution/tasks/child/steps.d.ts +46 -0
  85. package/dist/src/execution/tasks/child/steps.js +1 -0
  86. package/dist/src/execution/tasks/child/workflow.d.ts +31 -0
  87. package/dist/src/execution/tasks/child/workflow.js +1 -0
  88. package/dist/src/execution/tasks/parent/agent-identity.d.ts +13 -0
  89. package/dist/src/execution/tasks/parent/agent-identity.js +1 -0
  90. package/dist/src/execution/tasks/parent/agent-views.d.ts +6 -0
  91. package/dist/src/execution/tasks/parent/agent-views.js +1 -0
  92. package/dist/src/execution/tasks/parent/continuation-dispatch.d.ts +37 -0
  93. package/dist/src/execution/tasks/parent/continuation-dispatch.js +1 -0
  94. package/dist/src/execution/tasks/parent/control-shared.d.ts +36 -0
  95. package/dist/src/execution/tasks/parent/control-shared.js +1 -0
  96. package/dist/src/execution/tasks/parent/delegate.d.ts +70 -0
  97. package/dist/src/execution/tasks/parent/delegate.js +1 -0
  98. package/dist/src/execution/tasks/parent/dispatch-task-step.d.ts +19 -0
  99. package/dist/src/execution/tasks/parent/dispatch-task-step.js +1 -0
  100. package/dist/src/execution/tasks/parent/dispatch.d.ts +33 -0
  101. package/dist/src/execution/tasks/parent/dispatch.js +1 -0
  102. package/dist/src/execution/tasks/parent/hitl-proxy-steps.d.ts +29 -0
  103. package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -0
  104. package/dist/src/execution/tasks/parent/run-parent.d.ts +72 -0
  105. package/dist/src/execution/tasks/parent/run-parent.js +1 -0
  106. package/dist/src/execution/tasks/parent/send.d.ts +25 -0
  107. package/dist/src/execution/tasks/parent/send.js +1 -0
  108. package/dist/src/execution/tasks/workflow-target.d.ts +2 -0
  109. package/dist/src/execution/tasks/workflow-target.js +1 -0
  110. package/dist/src/execution/terminate-child-sessions-step.d.ts +1 -0
  111. package/dist/src/execution/terminate-child-sessions-step.js +1 -1
  112. package/dist/src/execution/turn-control-receiver.d.ts +10 -0
  113. package/dist/src/execution/turn-control-receiver.js +1 -1
  114. package/dist/src/execution/turn-dispatch.d.ts +2 -0
  115. package/dist/src/execution/turn-dispatch.js +1 -1
  116. package/dist/src/execution/turn-execution-cursor.d.ts +2 -8
  117. package/dist/src/execution/turn-execution-cursor.js +1 -1
  118. package/dist/src/execution/turn-workflow.js +1 -1
  119. package/dist/src/execution/workflow-callback-url.d.ts +5 -0
  120. package/dist/src/execution/workflow-callback-url.js +1 -1
  121. package/dist/src/execution/workflow-entry.js +1 -1
  122. package/dist/src/execution/workflow-runtime.d.ts +9 -0
  123. package/dist/src/execution/workflow-runtime.js +1 -1
  124. package/dist/src/execution/workflow-steps.d.ts +7 -21
  125. package/dist/src/execution/workflow-steps.js +1 -1
  126. package/dist/src/harness/advertised-tools.js +1 -1
  127. package/dist/src/harness/authorization.js +1 -1
  128. package/dist/src/harness/execute-tool.d.ts +7 -0
  129. package/dist/src/harness/handles/prompt.d.ts +12 -0
  130. package/dist/src/harness/handles/prompt.js +2 -1
  131. package/dist/src/harness/handles/query.js +1 -1
  132. package/dist/src/harness/handles/store.d.ts +9 -2
  133. package/dist/src/harness/handles/store.js +1 -1
  134. package/dist/src/harness/handles/transitions.d.ts +10 -1
  135. package/dist/src/harness/handles/transitions.js +1 -1
  136. package/dist/src/harness/proxy-input-requests.d.ts +21 -4
  137. package/dist/src/harness/proxy-input-requests.js +1 -1
  138. package/dist/src/harness/runtime-actions.d.ts +2 -0
  139. package/dist/src/harness/runtime-actions.js +1 -1
  140. package/dist/src/harness/session-limit-enforcement.js +1 -1
  141. package/dist/src/harness/tool-loop.js +2 -2
  142. package/dist/src/harness/workflow-runtime-action-state.js +1 -1
  143. package/dist/src/internal/application/package.js +1 -1
  144. package/dist/src/internal/authored-definition/core.js +1 -1
  145. package/dist/src/internal/invocation/agent-invocation.d.ts +54 -0
  146. package/dist/src/internal/invocation/agent-invocation.js +1 -0
  147. package/dist/src/internal/invocation/attributes.d.ts +2 -0
  148. package/dist/src/internal/invocation/attributes.js +1 -0
  149. package/dist/src/internal/invocation/metadata.d.ts +9 -0
  150. package/dist/src/internal/invocation/metadata.js +1 -0
  151. package/dist/src/internal/invocation/workflow-execution.d.ts +32 -0
  152. package/dist/src/internal/invocation/workflow-execution.js +1 -0
  153. package/dist/src/internal/mcp/http-security.d.ts +12 -0
  154. package/dist/src/internal/mcp/http-security.js +1 -0
  155. package/dist/src/internal/mcp/protected-resource.d.ts +9 -0
  156. package/dist/src/internal/mcp/protected-resource.js +1 -0
  157. package/dist/src/internal/mcp/streamable-http-server.d.ts +51 -0
  158. package/dist/src/internal/mcp/streamable-http-server.js +1 -0
  159. package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
  160. package/dist/src/internal/nitro/routes/channel-route-context.d.ts +14 -0
  161. package/dist/src/internal/nitro/routes/channel-route-context.js +1 -1
  162. package/dist/src/internal/nitro/routes/runtime-stack.d.ts +2 -0
  163. package/dist/src/internal/nitro/routes/runtime-stack.js +1 -1
  164. package/dist/src/internal/vercel-agent-summary.d.ts +1 -1
  165. package/dist/src/protocol/message.d.ts +28 -0
  166. package/dist/src/protocol/message.js +2 -2
  167. package/dist/src/protocol/routes.d.ts +14 -0
  168. package/dist/src/protocol/routes.js +1 -1
  169. package/dist/src/public/channels/auth.d.ts +36 -0
  170. package/dist/src/public/channels/auth.js +1 -1
  171. package/dist/src/public/channels/eve.js +1 -1
  172. package/dist/src/public/channels/mcp.d.ts +19 -0
  173. package/dist/src/public/channels/mcp.js +1 -0
  174. package/dist/src/public/definitions/channel.d.ts +2 -2
  175. package/dist/src/public/definitions/channel.js +1 -1
  176. package/dist/src/react/use-eve-agent.js +1 -1
  177. package/dist/src/runtime/actions/types.d.ts +9 -0
  178. package/dist/src/runtime/actions/types.js +1 -1
  179. package/dist/src/runtime/agent/bootstrap.js +1 -1
  180. package/dist/src/runtime/connections/authorization-complete-page.js +70 -28
  181. package/dist/src/runtime/framework-channels/index.js +1 -1
  182. package/dist/src/runtime/framework-tools/index.js +1 -1
  183. package/dist/src/runtime/framework-tools/tasks.d.ts +95 -0
  184. package/dist/src/runtime/framework-tools/tasks.js +1 -0
  185. package/dist/src/runtime/prompt/compose.d.ts +1 -0
  186. package/dist/src/runtime/prompt/compose.js +1 -1
  187. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  188. package/dist/src/runtime/resolve-agent.js +1 -1
  189. package/dist/src/runtime/session-callback-route.js +1 -1
  190. package/dist/src/runtime/task-input-response-route.d.ts +5 -0
  191. package/dist/src/runtime/task-input-response-route.js +1 -0
  192. package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
  193. package/dist/src/setup/scaffold/create/project.js +1 -1
  194. package/dist/src/shared/agent-definition.d.ts +7 -0
  195. package/dist/src/svelte/index.js +1 -1
  196. package/dist/src/svelte/use-eve-agent.js +1 -1
  197. package/dist/src/tasks/json.d.ts +88 -0
  198. package/dist/src/tasks/json.js +1 -0
  199. package/dist/src/tasks/session-index.d.ts +48 -0
  200. package/dist/src/tasks/session-index.js +1 -0
  201. package/dist/src/tasks/task-id.d.ts +34 -0
  202. package/dist/src/tasks/task-id.js +1 -0
  203. package/dist/src/tasks/transitions.d.ts +23 -0
  204. package/dist/src/tasks/transitions.js +1 -0
  205. package/dist/src/tasks/types.d.ts +295 -0
  206. package/dist/src/tasks/types.js +1 -0
  207. package/dist/src/tasks/wire.d.ts +26 -0
  208. package/dist/src/tasks/wire.js +1 -0
  209. package/dist/src/vue/index.js +1 -1
  210. package/dist/src/vue/use-eve-agent.js +1 -1
  211. package/docs/channels/eve.mdx +14 -0
  212. package/docs/guides/client/streaming.mdx +1 -1
  213. package/docs/tools/human-in-the-loop.md +3 -1
  214. package/package.json +7 -1
  215. package/dist/src/execution/route-proxied-deliver-step.js +0 -1
@@ -0,0 +1,295 @@
1
+ import type { JsonValue } from "#shared/json.js";
2
+ import type { SubagentAuthorizationEvent } from "#channel/types.js";
3
+ /**
4
+ * Task lifecycle contract for `experimental.tasks`.
5
+ *
6
+ * A task is one durable unit of delegated work owned by a parent session.
7
+ * The durable task run is the single writer for lifecycle transitions
8
+ * (see `#execution/tasks/child/workflow.js`); every other path submits
9
+ * commands and reads views. This module is dependency-free on
10
+ * purpose: it is bundled into workflow bodies, which reject Node.js
11
+ * builtins and heavyweight validators.
12
+ */
13
+ /**
14
+ * Task lifecycle status.
15
+ *
16
+ * `completed`, `failed`, and `cancelled` are terminal and final.
17
+ * `input_required` is not terminal but is ready for parent action; the
18
+ * child must wake its parent rather than deadlock while waiting for input.
19
+ */
20
+ export type TaskStatus = "working" | "input_required" | "completed" | "failed" | "cancelled";
21
+ /**
22
+ * Immutable identity of the delegated work behind a task.
23
+ *
24
+ * `agentId` is parent-controlled and exists before the child acknowledges its
25
+ * private address, so the durable task can bind to persistent identity before
26
+ * the dispatch side effect runs.
27
+ */
28
+ export interface TaskMetadata {
29
+ /** Stable model-visible identity of the persistent child session. */
30
+ readonly agentId: string;
31
+ readonly kind: "subagent";
32
+ readonly mode: "local" | "remote";
33
+ /** Authored subagent name the parent dispatched. */
34
+ readonly name: string;
35
+ }
36
+ /** Private executor state retained for cancellation and address reconciliation. */
37
+ export interface TaskExecutorState {
38
+ readonly childSessionId?: string;
39
+ readonly childTurnId?: string;
40
+ readonly lifecycle?: "parked" | "terminal";
41
+ }
42
+ /**
43
+ * Terminal task output. Failure is the state (`failed`); the `error`
44
+ * output is its consequence — a `failed` task always carries one.
45
+ * This intentionally diverges from MCP, which reserves `failed` for
46
+ * protocol-level errors.
47
+ */
48
+ export type TaskOutput = {
49
+ readonly type: "result";
50
+ readonly data: JsonValue;
51
+ } | {
52
+ readonly type: "error";
53
+ readonly data: JsonValue;
54
+ };
55
+ /**
56
+ * One outstanding request forwarded from a blocked child. Carried
57
+ * opaquely: the task layer routes the batch, the input contract owns
58
+ * its shape.
59
+ */
60
+ export type TaskInputRequest = JsonValue;
61
+ /**
62
+ * Provider token usage a child turn reported. Structural on purpose: it
63
+ * mirrors `TokenUsage` (#shared/token-usage.js) without importing its
64
+ * zod-backed module into a workflow-bundled file.
65
+ */
66
+ export interface TaskUsage {
67
+ readonly cacheReadTokens: number;
68
+ readonly cacheWriteTokens: number;
69
+ readonly inputTokens: number;
70
+ readonly outputTokens: number;
71
+ }
72
+ /**
73
+ * Validates one wire-carried usage value into {@link TaskUsage}.
74
+ * Anything malformed is dropped rather than rejected: retention is
75
+ * best-effort and must never fail a lifecycle transition.
76
+ */
77
+ export declare function readTaskUsage(value: unknown): TaskUsage | undefined;
78
+ /**
79
+ * One human answer to an outstanding request. Structural on purpose: it
80
+ * mirrors the input contract's `InputResponse` without importing its
81
+ * zod-backed module into a workflow-bundled file.
82
+ */
83
+ export interface TaskInputResponse {
84
+ readonly optionId?: string;
85
+ readonly requestId: string;
86
+ readonly text?: string;
87
+ }
88
+ /** Stable task blocker id shared by one authorization attempt's events. */
89
+ export declare function taskAuthorizationRequestId(event: SubagentAuthorizationEvent): string;
90
+ /** Reads the `requestId` of one opaque outstanding request. */
91
+ export declare function readTaskInputRequestId(request: TaskInputRequest): string | undefined;
92
+ /** Fields shared by every durable task view. */
93
+ interface TaskViewBase {
94
+ readonly taskId: string;
95
+ readonly metadata: TaskMetadata;
96
+ /** Private executor state; deliberately excluded from model-visible JSON. */
97
+ readonly executor?: TaskExecutorState;
98
+ /**
99
+ * Provider usage the child reported at settlement; present when the
100
+ * terminal command carried it. Retained for later accounting only —
101
+ * budgets stay best-effort until a reservation model lands — and
102
+ * deliberately excluded from model-visible task views (tasks/json.ts).
103
+ */
104
+ readonly usage?: TaskUsage;
105
+ }
106
+ /**
107
+ * Full durable task view discriminated by lifecycle status.
108
+ *
109
+ * The task run appends one per accepted command; readers always observe a
110
+ * complete view, never a delta. A view never contains routing credentials,
111
+ * continuation tokens, or authorization capabilities.
112
+ *
113
+ * Completed and failed tasks carry their corresponding output, cancelled
114
+ * tasks carry no output, and only input-required tasks carry requests.
115
+ */
116
+ export type TaskView = TaskViewBase & ({
117
+ readonly status: "working";
118
+ readonly inputRequests?: never;
119
+ readonly lastOutput?: never;
120
+ } | {
121
+ readonly status: "input_required";
122
+ readonly inputRequests: readonly TaskInputRequest[];
123
+ readonly lastOutput?: never;
124
+ } | {
125
+ readonly status: "completed";
126
+ readonly inputRequests?: never;
127
+ readonly lastOutput: Extract<TaskOutput, {
128
+ type: "result";
129
+ }>;
130
+ } | {
131
+ readonly status: "failed";
132
+ readonly inputRequests?: never;
133
+ readonly lastOutput: Extract<TaskOutput, {
134
+ type: "error";
135
+ }>;
136
+ } | {
137
+ readonly status: "cancelled";
138
+ readonly inputRequests?: never;
139
+ readonly lastOutput?: never;
140
+ });
141
+ /** Commands accepted by the durable task run's transition function. */
142
+ export type TaskCommand = {
143
+ readonly kind: "complete";
144
+ readonly data: JsonValue;
145
+ readonly lifecycle?: "parked" | "terminal";
146
+ readonly usage?: TaskUsage;
147
+ } | {
148
+ readonly kind: "fail";
149
+ readonly data: JsonValue;
150
+ readonly lifecycle?: "parked" | "terminal";
151
+ readonly usage?: TaskUsage;
152
+ }
153
+ /** Terminal dispatch rejection for a task that was never indexed by its parent. */
154
+ | {
155
+ readonly kind: "reject-dispatch";
156
+ readonly data: JsonValue;
157
+ readonly lifecycle?: never;
158
+ readonly usage?: never;
159
+ } | {
160
+ readonly kind: "cancel";
161
+ readonly lifecycle?: "parked" | "terminal";
162
+ readonly usage?: TaskUsage;
163
+ }
164
+ /** Retains a late executor settlement without changing task terminal status. */
165
+ | {
166
+ readonly kind: "settle-executor";
167
+ readonly usage?: TaskUsage;
168
+ } | {
169
+ readonly kind: "require-authorization";
170
+ readonly requestId: string;
171
+ } | {
172
+ readonly kind: "require-input";
173
+ readonly inputRequests: readonly TaskInputRequest[];
174
+ } | {
175
+ readonly kind: "ready";
176
+ }
177
+ /**
178
+ * Clears the listed requests from the outstanding batch. Bound to
179
+ * ids rather than unbound like the former `resume`, so an answer can
180
+ * only ever release the batch it was written against.
181
+ */
182
+ | {
183
+ readonly kind: "answered";
184
+ readonly requestIds: readonly string[];
185
+ } | {
186
+ readonly kind: "start-turn";
187
+ readonly childSessionId: string;
188
+ readonly childTurnId: string;
189
+ readonly taskId: string;
190
+ };
191
+ /** Hook payload envelope commanding a durable task run. */
192
+ export interface TaskCommandHookPayload {
193
+ readonly kind: "task-command";
194
+ readonly command: TaskCommand;
195
+ }
196
+ /**
197
+ * Structural shapes of the child wire payloads a task run consumes.
198
+ *
199
+ * These mirror the existing parent-notification contracts (the local
200
+ * `notifyDelegatedParentStep`, the subagent adapter's HITL forwarding,
201
+ * and the remote callback route) without importing their zod-backed
202
+ * modules: this file is bundled into workflow bodies. The wire itself
203
+ * is unchanged — delegated dispatch only points it at the task run's
204
+ * hook instead of the parent turn's inbox.
205
+ */
206
+ export interface TaskInboundChildResult {
207
+ readonly kind: "runtime-action-result";
208
+ readonly results: readonly {
209
+ readonly isError?: boolean;
210
+ readonly outcome?: {
211
+ readonly kind: "parked" | "terminal";
212
+ readonly result: {
213
+ readonly kind: "succeeded";
214
+ readonly output: JsonValue;
215
+ } | {
216
+ readonly error: JsonValue;
217
+ readonly kind: "failed";
218
+ } | {
219
+ readonly kind: "cancelled";
220
+ };
221
+ /**
222
+ * Provider usage this turn added. Retained on the terminal task
223
+ * view ({@link TaskView.usage}); folding it into parent
224
+ * budgets is deferred until a reservation model lands.
225
+ */
226
+ readonly usageDelta?: unknown;
227
+ };
228
+ readonly output: JsonValue;
229
+ }[];
230
+ }
231
+ /**
232
+ * Arrives when the delegated child emits `input.requested`. After dispatch is
233
+ * acknowledged, the task run exposes the batch in an `input_required`
234
+ * view and forwards the request to the parent session.
235
+ */
236
+ export interface TaskInboundInputRequest {
237
+ readonly callId: string;
238
+ readonly childContinuationToken: string;
239
+ readonly childSessionId: string;
240
+ readonly kind: "subagent-input-request";
241
+ readonly event: {
242
+ readonly requests: readonly TaskInputRequest[];
243
+ readonly sequence: number;
244
+ readonly stepIndex: number;
245
+ readonly turnId: string;
246
+ };
247
+ readonly subagentName: string;
248
+ }
249
+ /**
250
+ * Arrives when a delegated child turn starts and its session and turn ids are
251
+ * known. The task run records those ids for executor addressing; this payload
252
+ * does not itself make the task ready or wake the parent.
253
+ */
254
+ export interface TaskInboundTurnStarted {
255
+ readonly childSessionId: string;
256
+ readonly childTurnId: string;
257
+ readonly kind: "turn-started";
258
+ readonly taskId: string;
259
+ }
260
+ /**
261
+ * Arrives when the delegated child emits `authorization.required` or
262
+ * `authorization.completed`. The former exposes an authorization blocker in
263
+ * the task view; the latter clears it. The event is forwarded separately
264
+ * to the parent and is never copied into the view.
265
+ */
266
+ export interface TaskInboundAuthorizationEvent {
267
+ readonly callId: string;
268
+ readonly childSessionId: string;
269
+ readonly kind: "authorization-event";
270
+ readonly event: SubagentAuthorizationEvent;
271
+ readonly subagentName: string;
272
+ }
273
+ /**
274
+ * Human answers routed to the task run rather than straight to the
275
+ * child. The run owns both the delivery and the state change, so the
276
+ * batch it clears is exactly the batch it forwarded — the parent can no
277
+ * longer unblock the child while the run still believes it is blocked.
278
+ */
279
+ export interface TaskInboundAnswerInput {
280
+ readonly auth?: unknown;
281
+ readonly childContinuationToken: string;
282
+ readonly childResponseUrl?: string;
283
+ readonly inputResponses: readonly TaskInputResponse[];
284
+ readonly kind: "input-response";
285
+ readonly taskId: string;
286
+ }
287
+ /** Everything a task run's inbound continuation hook may receive. */
288
+ export type TaskRunInboundPayload = TaskCommandHookPayload | TaskInboundChildResult | TaskInboundInputRequest | TaskInboundTurnStarted | TaskInboundAuthorizationEvent | TaskInboundAnswerInput;
289
+ /** Namespaced run stream carrying appended `TaskView` records. */
290
+ export declare const TASK_VIEW_STREAM_NAMESPACE = "eve.task";
291
+ /** True when the status can never change again. */
292
+ export declare function isTerminalTaskStatus(status: TaskStatus): boolean;
293
+ /** True when a transition into this status should wake the parent. */
294
+ export declare function isReadyTaskStatus(status: TaskStatus): boolean;
295
+ export {};
@@ -0,0 +1 @@
1
+ function readTaskUsage(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=readUsageAxis(e,`cacheReadTokens`),n=readUsageAxis(e,`cacheWriteTokens`),r=readUsageAxis(e,`inputTokens`),i=readUsageAxis(e,`outputTokens`);if(!(t===void 0||n===void 0||r===void 0||i===void 0))return{cacheReadTokens:t,cacheWriteTokens:n,inputTokens:r,outputTokens:i}}function readUsageAxis(e,t){let n=Reflect.get(e,t);return typeof n==`number`&&Number.isFinite(n)&&n>=0?n:void 0}const TASK_AUTHORIZATION_REQUEST_ID_PREFIX=`task:authorization`;function taskAuthorizationRequestId(t){return t.type===`approval.candidate`||t.type===`approval.settled`?`${TASK_AUTHORIZATION_REQUEST_ID_PREFIX}:${t.data.requestId}`:`${TASK_AUTHORIZATION_REQUEST_ID_PREFIX}:${t.data.attemptId??t.data.name}`}function readTaskInputRequestId(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=Reflect.get(e,`requestId`);return typeof t==`string`?t:void 0}const TASK_VIEW_STREAM_NAMESPACE=`eve.task`;function isTerminalTaskStatus(e){return e===`completed`||e===`failed`||e===`cancelled`}function isReadyTaskStatus(e){return e===`input_required`||isTerminalTaskStatus(e)}export{TASK_VIEW_STREAM_NAMESPACE,isReadyTaskStatus,isTerminalTaskStatus,readTaskInputRequestId,readTaskUsage,taskAuthorizationRequestId};
@@ -0,0 +1,26 @@
1
+ import type { TaskCommand, TaskRunInboundPayload } from "#tasks/types.js";
2
+ /**
3
+ * Translates one inbound hook payload into a lifecycle command.
4
+ *
5
+ * The child wire is unchanged by `experimental.tasks`; delegated
6
+ * dispatch hands children the task run's hook token, so the payloads
7
+ * that used to resume the parent turn arrive here instead:
8
+ *
9
+ * - a settled child turn (local notification or remote callback)
10
+ * carries an explicit outcome — its result status decides
11
+ * `complete`, `fail`, or `cancel`;
12
+ * - a forwarded HITL batch marks the task `input_required` with the
13
+ * outstanding requests;
14
+ * - `authorization.required` also blocks the task (the child cannot
15
+ * proceed without the parent's user) under a reserved request id, and
16
+ * `authorization.completed` clears exactly that id. Authorization
17
+ * payloads never enter the view — only the fact that the child is
18
+ * blocked does.
19
+ *
20
+ * `input-response` is deliberately absent: the run must forward the
21
+ * answers to the child before it may record them, so it builds that
22
+ * command itself rather than translating one here.
23
+ *
24
+ * Returns `undefined` for unrecognized payloads, which the run ignores.
25
+ */
26
+ export declare function translateTaskInboundPayload(payload: TaskRunInboundPayload): TaskCommand | undefined;
@@ -0,0 +1 @@
1
+ import{readTaskUsage,taskAuthorizationRequestId}from"#tasks/types.js";function translateTaskInboundPayload(n){switch(n.kind){case`task-command`:return n.command;case`runtime-action-result`:{let t=n.results[0];if(t===void 0)return;if(t.outcome!==void 0){let n=readTaskUsage(t.outcome.usageDelta);switch(t.outcome.result.kind){case`succeeded`:return withUsage({data:t.output,kind:`complete`,lifecycle:t.outcome.kind},n);case`failed`:return withUsage({data:t.output,kind:`fail`,lifecycle:t.outcome.kind},n);case`cancelled`:return withUsage({kind:`cancel`,lifecycle:t.outcome.kind},n)}}return}case`subagent-input-request`:return{inputRequests:n.event.requests,kind:`require-input`};case`turn-started`:return{childSessionId:n.childSessionId,childTurnId:n.childTurnId,kind:`start-turn`,taskId:n.taskId};case`authorization-event`:{let e=taskAuthorizationRequestId(n.event);return n.event.type===`authorization.required`?{kind:`require-authorization`,requestId:e}:{kind:`answered`,requestIds:[e]}}default:return}}function withUsage(e,t){return t===void 0?e:{...e,usage:t}}export{translateTaskInboundPayload};
@@ -1,3 +1,3 @@
1
- import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-CnppTEFk.js";
1
+ import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-Bi5fRxcZ.js";
2
2
 
3
3
  export { defaultMessageReducer, useEveAgent };
@@ -1,3 +1,3 @@
1
- import { t as useEveAgent } from "../chunks/use-eve-agent-CnppTEFk.js";
1
+ import { t as useEveAgent } from "../chunks/use-eve-agent-Bi5fRxcZ.js";
2
2
 
3
3
  export { useEveAgent };
@@ -45,6 +45,20 @@ curl -X POST https://<deployment>/eve/v1/session \
45
45
  # {"ok":true,"sessionId":"wrun_A","status":"accepted"}
46
46
  ```
47
47
 
48
+ Authenticated callers that may retry a create request can pass their own `operationId` for
49
+ create-once semantics. The same operation under the same authenticated principal returns the
50
+ active session it already created instead of dispatching the input again. The first accepted
51
+ payload wins; retries with different input still return that first session. Anonymous callers
52
+ cannot use `operationId`, and operation ownership expires when the session is no longer resumable.
53
+
54
+ ```bash
55
+ curl -X POST https://<deployment>/eve/v1/session \
56
+ -H "Authorization: Bearer <token>" \
57
+ -H "Content-Type: application/json" \
58
+ -d '{"message":"What is the weather in Paris?","operationId":"order-4213-research"}'
59
+ # {"ok":true,"sessionId":"wrun_A","status":"accepted"} — retries return the same sessionId
60
+ ```
61
+
48
62
  The first request requires `message`. A follow-up request accepts exactly one of
49
63
  `message` or `inputResponses`; use the latter to answer a pending HITL request:
50
64
 
@@ -126,7 +126,7 @@ If you support refresh while an authorization prompt is pending, keep the sessio
126
126
 
127
127
  ## Reconnection
128
128
 
129
- HTTP connections can end before a run does. The client reconnects from the number of events already consumed, so long turns continue without replaying events. It stops at a turn boundary, when aborted, or when the stream can no longer make progress.
129
+ HTTP connections can end before a run does. The client reconnects from the number of events already consumed, so long turns continue without replaying events. By default, a turn response keeps reconnecting until it reaches a turn boundary or is aborted, including while the turn is paused for authorization. A manually opened `session.stream()` eventually stops after repeated empty streams when it can no longer make progress.
130
130
 
131
131
  If your consumer persists events, key on `event.meta.id`. It is stable across reconnects and rewinds, so an overlapping replay is safe to ingest twice. See [the event envelope](../../concepts/sessions-runs-and-streaming#the-event-envelope).
132
132
 
@@ -109,7 +109,9 @@ semantics.
109
109
 
110
110
  The run picks back up exactly where it parked. Because the pause is durable, nothing is held in memory while it waits — the process can restart and the parked turn survives.
111
111
 
112
- For approval requests, unrelated follow-up text does not deny the tool call — and it does not wait behind it either. The message runs as an ordinary turn while the approval stays pending and answerable; a later structured answer still resolves the original tool call. Text that exactly matches an option (like `approve`) still resolves the request directly.
112
+ When a background subagent requests input, eve emits the same `input.requested` event on its parent session. Answering through that parent session routes the response directly to the blocked child without invoking the parent model.
113
+
114
+ For approval requests, unrelated follow-up text does not deny the tool call. eve keeps the approval pending and holds that text until the approval is answered, then replays it as the next message in the session.
113
115
 
114
116
  See [Sessions, runs & streaming](/docs/concepts/sessions-runs-and-streaming) for the full event and resume contract that this builds on.
115
117
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eve",
3
- "version": "0.37.0",
3
+ "version": "0.37.1",
4
4
  "private": false,
5
5
  "description": "Filesystem-first framework for durable backend AI agents that run anywhere.",
6
6
  "keywords": [
@@ -231,6 +231,11 @@
231
231
  "import": "./dist/src/public/channels/auth.js",
232
232
  "default": "./dist/src/public/channels/auth.js"
233
233
  },
234
+ "./channels/mcp": {
235
+ "types": "./dist/src/public/channels/mcp.d.ts",
236
+ "import": "./dist/src/public/channels/mcp.js",
237
+ "default": "./dist/src/public/channels/mcp.js"
238
+ },
234
239
  "./channels/slack": {
235
240
  "types": "./dist/src/public/channels/slack/index.d.ts",
236
241
  "import": "./dist/src/public/channels/slack/index.js",
@@ -310,6 +315,7 @@
310
315
  "@chat-adapter/state-memory": "4.34.0",
311
316
  "@chat-adapter/twilio": "4.34.0",
312
317
  "@clack/core": "1.3.1",
318
+ "@modelcontextprotocol/server": "2.0.0",
313
319
  "@nuxt/kit": "^4.0.0",
314
320
  "@opentelemetry/context-async-hooks": "2.6.1",
315
321
  "@opentelemetry/core": "2.6.1",
@@ -1 +0,0 @@
1
- import{readDurableSession,replaceDurableSessionSnapshot}from"#execution/durable-session-store.js";import{resumeHook}from"#internal/workflow/runtime.js";import{retireProxyInputRequests}from"#harness/proxy-input-requests.js";import{coalesceDeliverPayloads}from"#execution/deliver-payloads.js";import{routeDeliverPayload}from"#execution/subagent-hitl-proxy.js";async function routeProxiedDeliverStep(o){"use step";let s=await readDurableSession(o.sessionState),c=!(`delivery`in o),l=`delivery`in o?o.delivery:{auth:o.auth,kind:`deliver`,payloads:[o.payload]},u=new Map((l.deliveryMetadata??[]).map(e=>[e.payloadIndex,e])),d=[],f=[],p=new Map,m;for(let[e,t]of l.payloads.entries()){let n=routeDeliverPayload({payload:t,state:s.state});m??=n.parentAction;let r=u.get(e);if(n.forSelf!==void 0){let e=d.length;d.push(n.forSelf),r!==void 0&&f.push({...r,payloadIndex:e})}for(let[e,t]of n.forChildren.entries()){let i=p.get(t.childContinuationToken)??{metadata:[],payloads:[],retireRequestIds:[]},a=i.payloads.length;i.payloads.push(t.payload),i.retireRequestIds.push(...t.retireRequestIds),r!==void 0&&n.forSelf===void 0&&e===0&&i.metadata.push({...r,payloadIndex:a}),p.set(t.childContinuationToken,i)}}for(let[e,t]of p)await resumeHook(e,{auth:l.auth,caller:l.caller,deliveryMetadata:t.metadata.length===0?void 0:t.metadata,kind:`deliver`,payloads:t.payloads,requestId:l.requestId,payload:coalesceDeliverPayloads(t.payloads)}),s=retireProxyInputRequests(s,t.retireRequestIds);let h=p.size===0?o.sessionState:replaceDurableSessionSnapshot({session:s,state:o.sessionState});return m===void 0?{kind:`continue`,remainder:d.length===0?void 0:c?coalesceDeliverPayloads(d):{...l,deliveryMetadata:f.length===0?void 0:f,payloads:d},sessionState:h}:{...m,sessionState:h}}export{routeProxiedDeliverStep};