eve 0.81.1 → 0.82.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 (285) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/src/channel/channel-address.d.ts +21 -2
  3. package/dist/src/channel/channel-address.js +1 -1
  4. package/dist/src/channel/channel-operations.d.ts +32 -1
  5. package/dist/src/channel/channel-operations.js +1 -1
  6. package/dist/src/channel/delivery-idempotency.d.ts +4 -0
  7. package/dist/src/channel/delivery-idempotency.js +1 -0
  8. package/dist/src/channel/routes.d.ts +6 -0
  9. package/dist/src/channel/session.d.ts +5 -0
  10. package/dist/src/channel/session.js +1 -1
  11. package/dist/src/channel/types.d.ts +14 -11
  12. package/dist/src/chunks/{use-eve-agent-Bp6nbhfV.js → use-eve-agent-DTu78IAF.js} +36 -0
  13. package/dist/src/chunks/{use-eve-agent-DLkjJIm3.js → use-eve-agent-DlznYwQk.js} +36 -0
  14. package/dist/src/cli/dev/command-options.d.ts +1 -0
  15. package/dist/src/cli/dev/diagnostic-dump.js +1 -1
  16. package/dist/src/cli/run.d.ts +1 -0
  17. package/dist/src/cli/run.js +1 -1
  18. package/dist/src/client/index.d.ts +1 -1
  19. package/dist/src/client/message-reducer-types.d.ts +7 -3
  20. package/dist/src/client/message-reducer.js +1 -1
  21. package/dist/src/client/transcript-reducer.d.ts +6 -3
  22. package/dist/src/client/transcript-reducer.js +1 -1
  23. package/dist/src/compiled/.vendor-stamp.json +1 -1
  24. package/dist/src/compiler/extension-compatibility.d.ts +19 -18
  25. package/dist/src/compiler/extension-compatibility.js +1 -1
  26. package/dist/src/compiler/load-binding-namespace.d.ts +2 -0
  27. package/dist/src/compiler/load-binding-namespace.js +1 -1
  28. package/dist/src/compiler/manifest.js +1 -1
  29. package/dist/src/compiler/module-lifecycle.d.ts +1 -1
  30. package/dist/src/compiler/module-lifecycle.js +1 -1
  31. package/dist/src/compiler/module-map.js +1 -1
  32. package/dist/src/compiler/normalize-agent-config.js +1 -1
  33. package/dist/src/compiler/normalize-manifest.js +1 -1
  34. package/dist/src/compiler/project-sources.d.ts +6 -0
  35. package/dist/src/compiler/project-sources.js +1 -1
  36. package/dist/src/context/keys.d.ts +2 -0
  37. package/dist/src/context/keys.js +1 -1
  38. package/dist/src/evals/cli/eval-state-directory.d.ts +7 -0
  39. package/dist/src/evals/cli/eval-state-directory.js +1 -0
  40. package/dist/src/evals/cli/eval.js +2 -2
  41. package/dist/src/eve-channel/index.js +1 -1
  42. package/dist/src/eve-channel/support.d.ts +2 -0
  43. package/dist/src/eve-channel/support.js +1 -1
  44. package/dist/src/eve-channel/types.d.ts +7 -0
  45. package/dist/src/execution/agent-sessions/context.d.ts +2 -13
  46. package/dist/src/execution/agent-sessions/context.js +1 -1
  47. package/dist/src/execution/agent-sessions/runtime-overrides.d.ts +5 -0
  48. package/dist/src/execution/agent-sessions/runtime-overrides.js +1 -0
  49. package/dist/src/execution/agent-sessions/session.d.ts +2 -2
  50. package/dist/src/execution/agent-sessions/session.js +1 -1
  51. package/dist/src/execution/agent-sessions/steps.d.ts +2 -0
  52. package/dist/src/execution/agent-sessions/steps.js +1 -1
  53. package/dist/src/execution/coordination-dispatch-shared.d.ts +5 -5
  54. package/dist/src/execution/coordination-dispatch-step.d.ts +17 -2
  55. package/dist/src/execution/coordination-dispatch-step.js +1 -1
  56. package/dist/src/execution/create-session-step.d.ts +5 -2
  57. package/dist/src/execution/create-session-step.js +1 -1
  58. package/dist/src/execution/deliver-payloads.js +1 -1
  59. package/dist/src/execution/durable-session-store.d.ts +0 -1
  60. package/dist/src/execution/dynamic-connection-recovery.js +1 -1
  61. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  62. package/dist/src/execution/effective-agent-config.d.ts +8 -2
  63. package/dist/src/execution/effective-agent-config.js +1 -1
  64. package/dist/src/execution/install-workflow-deployment-id.d.ts +3 -0
  65. package/dist/src/execution/install-workflow-deployment-id.js +1 -0
  66. package/dist/src/execution/legacy-session/turn-workflow.js +1 -1
  67. package/dist/src/execution/node-step.d.ts +1 -0
  68. package/dist/src/execution/node-step.js +1 -1
  69. package/dist/src/execution/runtime-context.d.ts +2 -0
  70. package/dist/src/execution/runtime-context.js +1 -1
  71. package/dist/src/execution/session/active-turn.js +1 -1
  72. package/dist/src/execution/session/admission.js +1 -1
  73. package/dist/src/execution/session/checkpoint-migrations.js +1 -1
  74. package/dist/src/execution/session/entry-input.d.ts +1 -3
  75. package/dist/src/execution/session/entry.js +1 -1
  76. package/dist/src/execution/session/finalization.js +1 -1
  77. package/dist/src/execution/session/handoff.d.ts +6 -9
  78. package/dist/src/execution/session/handoff.js +1 -1
  79. package/dist/src/execution/session/input-queue.d.ts +5 -1
  80. package/dist/src/execution/session/input-queue.js +1 -1
  81. package/dist/src/execution/session/pending-history.d.ts +5 -0
  82. package/dist/src/execution/session/pending-history.js +1 -0
  83. package/dist/src/execution/session/pending-turn-state.js +1 -1
  84. package/dist/src/execution/session/program.d.ts +1 -1
  85. package/dist/src/execution/session/program.js +1 -1
  86. package/dist/src/execution/session/timeout-control.d.ts +18 -4
  87. package/dist/src/execution/session/timeout-control.js +1 -1
  88. package/dist/src/execution/session/timeout.d.ts +1 -2
  89. package/dist/src/execution/session/timeout.js +1 -1
  90. package/dist/src/execution/session/turn-event-handler.js +1 -1
  91. package/dist/src/execution/session/turn-step-result.js +1 -1
  92. package/dist/src/execution/session/turn-step.js +1 -1
  93. package/dist/src/execution/session/turn-waiting-step.js +1 -1
  94. package/dist/src/execution/session/turn.js +1 -1
  95. package/dist/src/execution/session-inbox/protocol.js +1 -1
  96. package/dist/src/execution/session.d.ts +0 -12
  97. package/dist/src/execution/session.js +2 -2
  98. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  99. package/dist/src/execution/tasks/model-step.js +1 -1
  100. package/dist/src/execution/tasks/start.d.ts +4 -4
  101. package/dist/src/execution/tasks/start.js +1 -1
  102. package/dist/src/execution/tasks/steps.js +1 -1
  103. package/dist/src/execution/terminate-child-sessions-step.js +1 -1
  104. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  105. package/dist/src/execution/tools/workflow/body.d.ts +2 -2
  106. package/dist/src/execution/workflow-runtime.d.ts +5 -1
  107. package/dist/src/execution/workflow-runtime.js +1 -1
  108. package/dist/src/harness/hitl/approvals.js +1 -1
  109. package/dist/src/harness/hitl/budget-request.d.ts +12 -6
  110. package/dist/src/harness/hitl/budget-request.js +1 -1
  111. package/dist/src/harness/hitl/budget.d.ts +7 -1
  112. package/dist/src/harness/hitl/budget.js +1 -1
  113. package/dist/src/harness/hitl/coordinator.js +1 -1
  114. package/dist/src/harness/hitl/delivery.d.ts +1 -1
  115. package/dist/src/harness/hitl/delivery.js +1 -1
  116. package/dist/src/harness/hitl/index.js +1 -1
  117. package/dist/src/harness/hitl/intake.d.ts +2 -2
  118. package/dist/src/harness/hitl/intake.js +1 -1
  119. package/dist/src/harness/messages.d.ts +5 -0
  120. package/dist/src/harness/messages.js +1 -1
  121. package/dist/src/harness/model-call/call.d.ts +2 -2
  122. package/dist/src/harness/model-call/request.d.ts +2 -2
  123. package/dist/src/harness/session-machine/transitions.d.ts +3 -1
  124. package/dist/src/harness/session-machine/transitions.js +1 -1
  125. package/dist/src/harness/step/context.d.ts +3 -0
  126. package/dist/src/harness/step/context.js +1 -1
  127. package/dist/src/harness/step/intake.d.ts +5 -2
  128. package/dist/src/harness/step/intake.js +1 -1
  129. package/dist/src/harness/tool-loop.js +1 -1
  130. package/dist/src/harness/turn-tag-state.d.ts +7 -26
  131. package/dist/src/harness/turn-tag-state.js +1 -1
  132. package/dist/src/harness/types.d.ts +10 -25
  133. package/dist/src/internal/application/build-profile.d.ts +3 -0
  134. package/dist/src/internal/application/build-profile.js +1 -1
  135. package/dist/src/internal/application/compiled-artifacts.js +2 -2
  136. package/dist/src/internal/application/dev-environment.d.ts +13 -0
  137. package/dist/src/internal/application/dev-environment.js +1 -1
  138. package/dist/src/internal/application/stamped-package-version.js +1 -1
  139. package/dist/src/internal/authored-definition/core.js +1 -1
  140. package/dist/src/internal/authored-module-build-options.d.ts +7 -0
  141. package/dist/src/internal/authored-module-build-options.js +1 -0
  142. package/dist/src/internal/authored-module-graph.d.ts +13 -0
  143. package/dist/src/internal/authored-module-graph.js +1 -0
  144. package/dist/src/internal/authored-module-loader.d.ts +22 -1
  145. package/dist/src/internal/authored-module-loader.js +1 -3
  146. package/dist/src/internal/authored-module.d.ts +7 -0
  147. package/dist/src/internal/authored-module.js +1 -1
  148. package/dist/src/internal/authored-package-boundary.js +1 -1
  149. package/dist/src/internal/bundler/nitro-rolldown.d.ts +5 -1
  150. package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
  151. package/dist/src/internal/development-programmatic-source-loader.d.ts +1 -0
  152. package/dist/src/internal/development-programmatic-source-loader.js +1 -1
  153. package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
  154. package/dist/src/internal/nitro/dev-runtime-generation-metadata.js +1 -1
  155. package/dist/src/internal/nitro/host/build-application.js +1 -1
  156. package/dist/src/internal/nitro/host/build-deployment-id.d.ts +8 -0
  157. package/dist/src/internal/nitro/host/build-deployment-id.js +1 -0
  158. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  159. package/dist/src/internal/nitro/host/dev-server-state.js +1 -1
  160. package/dist/src/internal/nitro/host/skill-server-assets.js +1 -1
  161. package/dist/src/internal/nitro/host/stage-build-deployment-id.d.ts +2 -0
  162. package/dist/src/internal/nitro/host/stage-build-deployment-id.js +1 -0
  163. package/dist/src/internal/nitro/host/start-production-server.d.ts +1 -0
  164. package/dist/src/internal/nitro/host/start-production-server.js +3 -3
  165. package/dist/src/internal/nitro/routes/schedule-task.d.ts +3 -0
  166. package/dist/src/internal/nitro/routes/schedule-task.js +1 -1
  167. package/dist/src/internal/programmatic-source-loader.d.ts +1 -0
  168. package/dist/src/internal/programmatic-source-loader.js +1 -1
  169. package/dist/src/internal/schedules/disabled.d.ts +2 -0
  170. package/dist/src/internal/schedules/disabled.js +1 -0
  171. package/dist/src/internal/workflow/development-world-server.js +1 -1
  172. package/dist/src/internal/workflow/local-world-data-directory.d.ts +2 -1
  173. package/dist/src/internal/workflow/local-world-data-directory.js +1 -1
  174. package/dist/src/internal/workflow-bundle/builder.js +1 -1
  175. package/dist/src/protocol/message.d.ts +27 -1
  176. package/dist/src/protocol/message.js +2 -2
  177. package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +13 -0
  178. package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
  179. package/dist/src/public/channels/chat-sdk/fetch-message.d.ts +10 -0
  180. package/dist/src/public/channels/chat-sdk/fetch-message.js +1 -0
  181. package/dist/src/public/channels/chat-sdk/index.d.ts +1 -1
  182. package/dist/src/public/channels/chat-sdk/reply-context.d.ts +15 -0
  183. package/dist/src/public/channels/chat-sdk/reply-context.js +2 -0
  184. package/dist/src/public/channels/discord/discordChannel.d.ts +3 -0
  185. package/dist/src/public/channels/discord/discordChannel.js +1 -1
  186. package/dist/src/public/channels/github/dispatch.js +1 -1
  187. package/dist/src/public/channels/github/githubChannel.d.ts +3 -0
  188. package/dist/src/public/channels/imessage-tapbacks.d.ts +74 -0
  189. package/dist/src/public/channels/imessage-tapbacks.js +1 -0
  190. package/dist/src/public/channels/index.d.ts +2 -1
  191. package/dist/src/public/channels/index.js +1 -1
  192. package/dist/src/public/channels/linear/linearChannel.d.ts +3 -0
  193. package/dist/src/public/channels/linear/linearChannel.js +1 -1
  194. package/dist/src/public/channels/linq/inboundContent.d.ts +7 -0
  195. package/dist/src/public/channels/linq/inboundContent.js +1 -1
  196. package/dist/src/public/channels/linq/index.d.ts +1 -0
  197. package/dist/src/public/channels/linq/index.js +1 -1
  198. package/dist/src/public/channels/linq/linqChannel.d.ts +17 -1
  199. package/dist/src/public/channels/linq/linqChannel.js +1 -1
  200. package/dist/src/public/channels/photon/inboundContent.d.ts +7 -0
  201. package/dist/src/public/channels/photon/inboundContent.js +2 -1
  202. package/dist/src/public/channels/photon/index.d.ts +1 -0
  203. package/dist/src/public/channels/photon/index.js +1 -1
  204. package/dist/src/public/channels/photon/photonIMessageChannel.d.ts +17 -1
  205. package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
  206. package/dist/src/public/channels/slack/api.d.ts +6 -0
  207. package/dist/src/public/channels/slack/api.js +1 -1
  208. package/dist/src/public/channels/slack/model-context.d.ts +7 -0
  209. package/dist/src/public/channels/slack/model-context.js +1 -1
  210. package/dist/src/public/channels/slack/reply-delivery.d.ts +5 -0
  211. package/dist/src/public/channels/slack/reply-delivery.js +1 -1
  212. package/dist/src/public/channels/slack/slackChannel.d.ts +17 -3
  213. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  214. package/dist/src/public/channels/teams/teamsChannel.d.ts +3 -0
  215. package/dist/src/public/channels/teams/teamsChannel.js +1 -1
  216. package/dist/src/public/channels/telegram/telegramChannel.d.ts +3 -0
  217. package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
  218. package/dist/src/public/definitions/agent.d.ts +1 -1
  219. package/dist/src/public/definitions/channel.d.ts +2 -2
  220. package/dist/src/public/definitions/channel.js +1 -1
  221. package/dist/src/public/definitions/hook.d.ts +1 -0
  222. package/dist/src/public/index.d.ts +1 -1
  223. package/dist/src/public/tools/index.d.ts +1 -1
  224. package/dist/src/runtime/agent/resolve-model.d.ts +4 -0
  225. package/dist/src/runtime/agent/resolve-model.js +1 -1
  226. package/dist/src/runtime/resolve-agent.js +1 -1
  227. package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
  228. package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +2 -1
  229. package/dist/src/runtime/subagents/dynamic-agent-config.js +1 -1
  230. package/dist/src/runtime/types.d.ts +3 -2
  231. package/dist/src/setup/scaffold/create/project.js +1 -1
  232. package/dist/src/shared/agent-definition.d.ts +31 -42
  233. package/dist/src/shared/session-history.d.ts +22 -0
  234. package/dist/src/shared/session-history.js +1 -0
  235. package/dist/src/subagents/tool.d.ts +1 -3
  236. package/dist/src/subagents/tool.js +1 -1
  237. package/dist/src/svelte/index.js +1 -1
  238. package/dist/src/svelte/use-eve-agent.js +1 -1
  239. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  240. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  241. package/dist/src/tools/workflow-definition.d.ts +14 -1
  242. package/dist/src/tracing/eve/conversation-context.d.ts +4 -1
  243. package/dist/src/tracing/eve/conversation-context.js +1 -1
  244. package/dist/src/tracing/eve/invoke-tool-span.js +1 -1
  245. package/dist/src/tracing/eve/operation-input.d.ts +0 -5
  246. package/dist/src/tracing/eve/operation-input.js +1 -1
  247. package/dist/src/tracing/eve/otel-registration.js +1 -1
  248. package/dist/src/tracing/eve/session.d.ts +3 -2
  249. package/dist/src/tracing/eve/session.js +1 -1
  250. package/dist/src/vue/index.js +1 -1
  251. package/dist/src/vue/use-eve-agent.js +1 -1
  252. package/docs/agent-config.md +86 -65
  253. package/docs/channels/chat-sdk.mdx +6 -1
  254. package/docs/channels/custom.mdx +38 -6
  255. package/docs/channels/eve.mdx +46 -0
  256. package/docs/channels/linq.mdx +51 -0
  257. package/docs/channels/photon.mdx +64 -0
  258. package/docs/channels/slack.mdx +4 -2
  259. package/docs/concepts/built-in-tools.md +1 -1
  260. package/docs/concepts/execution-model-and-durability.mdx +12 -5
  261. package/docs/concepts/sessions-runs-and-streaming.md +9 -8
  262. package/docs/connections/overview.mdx +1 -1
  263. package/docs/experimental/dynamic-schedules.mdx +186 -0
  264. package/docs/experimental/meta.json +4 -0
  265. package/docs/guides/client/streaming.mdx +1 -0
  266. package/docs/guides/deployment/self-hosting.md +3 -0
  267. package/docs/guides/hooks.md +21 -1
  268. package/docs/memory/overview.mdx +2 -1
  269. package/docs/patterns/dynamic-scheduling.md +3 -1
  270. package/docs/reference/cli.md +14 -7
  271. package/docs/schedules.mdx +2 -0
  272. package/docs/subagents/index.mdx +2 -0
  273. package/docs/tools/overview.mdx +2 -1
  274. package/docs/tools/tasks-upgrade.md +12 -7
  275. package/docs/tools/tasks.md +10 -6
  276. package/docs/tools/workflows.mdx +36 -5
  277. package/docs/tutorial/connect-a-warehouse.mdx +1 -1
  278. package/docs/tutorial/run-analysis.mdx +1 -1
  279. package/package.json +1 -1
  280. package/dist/src/execution/run-session-limits.d.ts +0 -12
  281. package/dist/src/execution/run-session-limits.js +0 -1
  282. package/dist/src/harness/session-usage-limits.d.ts +0 -49
  283. package/dist/src/harness/session-usage-limits.js +0 -1
  284. package/dist/src/subagents/token-budget.d.ts +0 -15
  285. package/dist/src/subagents/token-budget.js +0 -1
@@ -1,5 +1,8 @@
1
1
  import type { EveAgentReducer } from "#client/reducer.js";
2
- /** One user message or completed assistant message in a {@link TranscriptData}. */
2
+ /**
3
+ * One user message or completed assistant message in a {@link TranscriptData}.
4
+ * Matches the shape `history` accepts, so a transcript can seed another session.
5
+ */
3
6
  export interface TranscriptMessage {
4
7
  readonly role: "assistant" | "user";
5
8
  readonly text: string;
@@ -19,8 +22,8 @@ export interface TranscriptReducerOptions {
19
22
  }
20
23
  /**
21
24
  * Creates a reducer that projects a session's stream into its text
22
- * conversation: user message text and completed assistant text, oldest
23
- * first.
25
+ * conversation: history added with `history.imported`, user message text,
26
+ * and completed assistant text, oldest first.
24
27
  *
25
28
  * Reasoning, tool calls and results, attachments, approvals, and assistant
26
29
  * output that never completed are left out. A `context.cleared` event, or a
@@ -1,2 +1,2 @@
1
- function transcriptReducer(e={}){let{maxMessages:t}=e;if(t!==void 0&&(!Number.isSafeInteger(t)||t<=0))throw TypeError(`transcriptReducer: "maxMessages" must be a positive integer; received ${String(t)}.`);let append=(e,n)=>{if(n.text.trim().length===0)return e;let r=[...e.messages,n];return{messages:t===void 0||r.length<=t?r:r.slice(-t)}};return{initial:()=>({messages:[]}),reduce(e,t){switch(t.type){case`message.received`:return append(e,{role:`user`,text:receivedText(t)});case`message.completed`:return append(e,{role:`assistant`,text:t.data.message});case`context.cleared`:return e.messages.length===0?e:{messages:[]};case`session.failed`:return t.data.code===`session_stranded`&&t.data.details?.trigger===`reset`&&e.messages.length>0?{messages:[]}:e;default:return e}}}}function receivedText(e){let{message:t,parts:n}=e.data;return n===void 0?t:n.flatMap(e=>e.type===`text`?[e.text]:[]).join(`
1
+ function transcriptReducer(e={}){let{maxMessages:t}=e;if(t!==void 0&&(!Number.isSafeInteger(t)||t<=0))throw TypeError(`transcriptReducer: "maxMessages" must be a positive integer; received ${String(t)}.`);let append=(e,n)=>{if(n.text.trim().length===0)return e;let r=[...e.messages,n];return{messages:t===void 0||r.length<=t?r:r.slice(-t)}};return{initial:()=>({messages:[]}),reduce(e,t){switch(t.type){case`history.imported`:return t.data.messages.reduce((e,{role:t,text:n})=>append(e,{role:t,text:n}),e);case`message.received`:return append(e,{role:`user`,text:receivedText(t)});case`message.completed`:return append(e,{role:`assistant`,text:t.data.message});case`context.cleared`:return e.messages.length===0?e:{messages:[]};case`session.failed`:return t.data.code===`session_stranded`&&t.data.details?.trigger===`reset`&&e.messages.length>0?{messages:[]}:e;default:return e}}}}function receivedText(e){let{message:t,parts:n}=e.data;return n===void 0?t:n.flatMap(e=>e.type===`text`?[e.text]:[]).join(`
2
2
  `)}export{transcriptReducer};
@@ -61,7 +61,7 @@
61
61
  "zod": "4.5.4",
62
62
  "zod-validation-error": "5.0.0"
63
63
  },
64
- "scriptHash": "ec188bdd3997976a304da1fe9805dde1e5cb5eeaa480ea31665a1ae38d6e4908",
64
+ "scriptHash": "3e8b9660dd391f91af88d32dfb7f66c4e4b2bf9752d0a9dd7c67dbabb84f5a91",
65
65
  "toolVersions": {
66
66
  "rolldown": "1.2.9",
67
67
  "typescript": "7.0.2"
@@ -11,8 +11,8 @@ declare const EXTENSION_CAPABILITY_CONTRACTS: {
11
11
  readonly dropped: {};
12
12
  };
13
13
  readonly tool: {
14
- readonly current: 93;
15
- readonly supported: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 29, 30, 31, 32, 34, 35, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93];
14
+ readonly current: 96;
15
+ readonly supported: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 29, 30, 31, 32, 34, 35, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96];
16
16
  readonly dropped: {
17
17
  readonly 14: "TaskExec.delegated was removed; migrate to workflow-backed background tools";
18
18
  readonly 15: "TaskExec replaces stageEffect with send";
@@ -75,8 +75,8 @@ declare const EXTENSION_CAPABILITY_CONTRACTS: {
75
75
  };
76
76
  };
77
77
  readonly dynamicTool: {
78
- readonly current: 87;
79
- readonly supported: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 31, 32, 33, 52, 54, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87];
78
+ readonly current: 88;
79
+ readonly supported: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 31, 32, 33, 52, 54, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88];
80
80
  readonly dropped: {
81
81
  readonly 21: "Message and reasoning append events now expose deltas instead of cumulative snapshots.";
82
82
  readonly 23: "TaskExec.delegated was removed; migrate to workflow-backed background tools";
@@ -116,8 +116,8 @@ declare const EXTENSION_CAPABILITY_CONTRACTS: {
116
116
  };
117
117
  };
118
118
  readonly channel: {
119
- readonly current: 62;
120
- readonly supported: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 29, 31, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62];
119
+ readonly current: 64;
120
+ readonly supported: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 29, 31, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64];
121
121
  readonly dropped: {
122
122
  readonly 12: "Message and reasoning append events now expose deltas instead of cumulative snapshots.";
123
123
  readonly 19: "Continuation rekey was removed; channel extensions must use additive continuation.alias instead.";
@@ -139,8 +139,8 @@ declare const EXTENSION_CAPABILITY_CONTRACTS: {
139
139
  };
140
140
  };
141
141
  readonly schedule: {
142
- readonly current: 34;
143
- readonly supported: readonly [1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34];
142
+ readonly current: 36;
143
+ readonly supported: readonly [1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36];
144
144
  readonly dropped: {
145
145
  readonly 5: "Message and reasoning append events now expose deltas instead of cumulative snapshots.";
146
146
  readonly 16: 'Background task delivery was removed: sends no longer accept taskDeliveryPolicy and message.completed always carries text. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.';
@@ -148,8 +148,8 @@ declare const EXTENSION_CAPABILITY_CONTRACTS: {
148
148
  };
149
149
  };
150
150
  readonly subagent: {
151
- readonly current: 39;
152
- readonly supported: readonly [3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39];
151
+ readonly current: 41;
152
+ readonly supported: readonly [3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41];
153
153
  readonly dropped: {
154
154
  readonly 1: "Persistent subagent sessions are now the default and the experimental opt-in was removed";
155
155
  readonly 2: "Persistent subagent sessions are now the default and the experimental opt-in was removed";
@@ -159,11 +159,12 @@ declare const EXTENSION_CAPABILITY_CONTRACTS: {
159
159
  readonly 20: "Run mode was removed and agent definitions no longer declare outputSchema; sessions always park, ConversationContext no longer carries mode, and structured output is requested per turn.";
160
160
  readonly 21: 'Background task execution was removed: subagent results no longer carry backgroundTask, message.completed always carries text, and experimental.tasks is gone. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.';
161
161
  readonly 22: "Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event stream events were removed; agent calls report task.started, task.settled, and agent.started.";
162
+ readonly 40: "limits.sessionUsage replaces the numeric per-session token and cost limits";
162
163
  };
163
164
  };
164
165
  readonly connection: {
165
- readonly current: 51;
166
- readonly supported: readonly [1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 26, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51];
166
+ readonly current: 53;
167
+ readonly supported: readonly [1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 26, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53];
167
168
  readonly dropped: {
168
169
  readonly 9: "Dynamic connection resolvers no longer receive conversation or channel continuation data";
169
170
  readonly 10: "Message and reasoning append events now expose deltas instead of cumulative snapshots.";
@@ -178,8 +179,8 @@ declare const EXTENSION_CAPABILITY_CONTRACTS: {
178
179
  };
179
180
  };
180
181
  readonly hook: {
181
- readonly current: 47;
182
- readonly supported: readonly [20, 21, 22, 23, 25, 27, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47];
182
+ readonly current: 48;
183
+ readonly supported: readonly [20, 21, 22, 23, 25, 27, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48];
183
184
  readonly dropped: {
184
185
  readonly 1: "Model identity moved from session.started runtime metadata to step.started call attribution.";
185
186
  readonly 2: "Model identity moved from session.started runtime metadata to step.started call attribution.";
@@ -214,8 +215,8 @@ declare const EXTENSION_CAPABILITY_CONTRACTS: {
214
215
  readonly dropped: {};
215
216
  };
216
217
  readonly dynamicSkill: {
217
- readonly current: 39;
218
- readonly supported: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39];
218
+ readonly current: 40;
219
+ readonly supported: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40];
219
220
  readonly dropped: {
220
221
  readonly 13: "Message and reasoning append events now expose deltas instead of cumulative snapshots.";
221
222
  readonly 22: "Run mode was removed; sessions always park and ConversationContext no longer carries mode.";
@@ -229,8 +230,8 @@ declare const EXTENSION_CAPABILITY_CONTRACTS: {
229
230
  readonly dropped: {};
230
231
  };
231
232
  readonly dynamicInstructions: {
232
- readonly current: 40;
233
- readonly supported: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40];
233
+ readonly current: 41;
234
+ readonly supported: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41];
234
235
  readonly dropped: {
235
236
  readonly 14: "Message and reasoning append events now expose deltas instead of cumulative snapshots.";
236
237
  readonly 23: "Run mode was removed; sessions always park and ConversationContext no longer carries mode.";
@@ -1 +1 @@
1
- import{readFile,writeFile}from"node:fs/promises";import{z}from"#compiled/zod/index.js";import{join}from"node:path";import{formatValidationError}from"#runtime/validation.js";const EXTENSION_COMPATIBILITY_MANIFEST_KIND=`eve-extension`,EXTENSION_COMPATIBILITY_MANIFEST_FORMAT_VERSION=2,EXTENSION_COMPATIBILITY_MANIFEST_FILENAME=`_manifest.json`,EXTENSION_CAPABILITY_CONTRACTS={extension:{current:1,supported:[1],dropped:{}},tool:{current:93,supported:[1,2,3,4,5,6,7,8,9,10,11,12,13,29,30,31,32,34,35,76,77,78,80,81,82,84,85,86,87,88,89,90,91,92,93],dropped:{14:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,15:`TaskExec replaces stageEffect with send`,16:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,17:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,18:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,19:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,20:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,21:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,22:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,23:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,24:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,25:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,26:`Background tools now use task yield descriptors`,27:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,28:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,33:`ctx.agent now accepts the subagent name as its first argument, derives invocation identity internally, and infers structured output types`,36:`experimental_workflow and eve/tools/workflow were removed; migrate to the workflow factory from eve/tools/workflow`,37:`experimental_workflow and eve/tools/workflow were removed; migrate to the workflow factory from eve/tools/workflow`,38:`experimental_workflow and eve/tools/workflow were removed; migrate to the workflow factory from eve/tools/workflow`,39:`experimental_workflow and eve/tools/workflow were removed; migrate to the workflow factory from eve/tools/workflow`,40:`runWorkflowProgram was made internal; use the workflow factory from eve/tools/workflow`,41:`workflow no longer accepts agents and its options argument is optional; use workflow() or workflow({ maxSubagents })`,42:`Legacy session history migration was removed; user-role messages require current provenance kinds.`,43:`Legacy session history migration was removed; user-role messages require current provenance kinds.`,44:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,45:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,46:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,47:`eve/experimental/evaluate was removed; import decide from eve/ai`,48:`eve/experimental/evaluate was removed; import decide from eve/ai`,49:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,50:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,51:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,52:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,53:`Sandbox sessions no longer expose core identity and mutable networking is provider-specific.`,54:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,55:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,56:`SandboxSession no longer exposes setNetworkPolicy; pass the configured environment to ctx.getSandbox(environment) to access network policy capabilities`,57:`agentRouter() no longer accepts a model-facing outputSchema; structured subagent output is requested only through ctx.agent().`,58:`Workflow tools no longer accept execution or return background task receipts; every call blocks until it settles.`,59:`Workflow tools no longer accept execution or return background task receipts, and every call blocks until it settles. ctx.ask() no longer accepts dismissible and reports a withdrawn request as cancelled, workflow tool contexts carry interruptSignal, and ctx.agent(name) returns a session handle whose send() delivers a message and whose result() resolves the turn; ctx.agent(name, { message, agentId }) and AgentInput were removed. A ctx.ask() question parks the open turn with turn.waiting instead of ending it.`,60:`Workflow tools define exactly one of execute(input, ctx), task(input, ctx), or serve(receive, ctx): a task() call returns a receipt and runs as a task, a serve() call reaches a resumable task through receive() and its model input gains taskId, and stream events gained task.started and task.settled. Agent tools are serve() tools with taskId in place of agentId, and the subagent.* stream events were removed. ctx.interruptSignal and WorkflowTaskContext were removed: a steering message aborts the abortSignal of an execute call the turn waits on.`,61:`Approval response policies now run for Cancel as well as Approve; a policy written for Approve only could reject every Cancel.`,62:`Approval response policies now run for Cancel as well as Approve; a policy written for Approve only could reject every Cancel.`,63:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,64:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,65:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,66:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,67:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,68:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,69:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,70:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,71:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,72:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,73:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,74:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,75:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,79:`Sandbox provider handle hooks were renamed to onSandboxStop and onSandboxDelete.`,83:`webSearch provider "openai" was replaced by "native" before it shipped in a release`}},dynamicTool:{current:87,supported:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,31,32,33,52,54,60,61,62,63,64,65,66,67,68,69,70,72,73,75,76,77,78,79,80,81,82,83,84,85,86,87],dropped:{21:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,23:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,24:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,25:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,26:`Background tools now use task yield descriptors`,27:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,28:`Background dynamic tools were removed; use a static defineWorkflowTool for durable background work.`,29:`Background dynamic tools were removed; use a static defineWorkflowTool for durable background work.`,30:`Background dynamic tools were removed; use a static defineWorkflowTool for durable background work.`,34:`Legacy session history migration was removed; user-role messages require current provenance kinds.`,35:`workflowMaxSubagents was removed with experimental_workflow; configure generated-program limits with the workflow factory`,36:`workflowMaxSubagents was removed with experimental_workflow; configure generated-program limits with the workflow factory`,37:`workflowMaxSubagents was removed with experimental_workflow; configure generated-program limits with the workflow factory`,38:`workflowMaxSubagents was removed with experimental_workflow; configure generated-program limits with the workflow factory`,39:`Legacy session history migration was removed; user-role messages require current provenance kinds.`,40:`Legacy session history migration was removed; user-role messages require current provenance kinds.`,41:`Background dynamic tools were removed; use a static defineWorkflowTool for durable background work.`,42:`autoModel and eve/experimental/evaluate were removed; import auto from eve/models`,43:`autoModel and eve/experimental/evaluate were removed; import auto from eve/models`,44:`autoModel and eve/experimental/evaluate were removed; import auto from eve/models`,45:`autoModel and eve/experimental/evaluate were removed; import auto from eve/models`,46:`autoModel and eve/experimental/evaluate were removed; import auto from eve/models`,47:`autoModel and eve/experimental/evaluate were removed; import auto from eve/models`,48:`Background dynamic tools were removed; use a static defineWorkflowTool for durable background work.`,49:`Background dynamic tools were removed; use a static defineWorkflowTool for durable background work.`,50:`Background dynamic tools were removed; use a static defineWorkflowTool for durable background work.`,51:`Sandbox sessions no longer expose core identity and mutable networking is provider-specific.`,53:`SandboxSession no longer exposes setNetworkPolicy; pass the configured environment to ctx.getSandbox(environment) to access network policy capabilities`,55:`Run mode was removed; sessions always park and ConversationContext no longer carries mode.`,56:`Background task execution was removed: subagent results no longer carry backgroundTask and message.completed always carries text. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,57:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event stream events were removed; agent calls report task.started, task.settled, and agent.started.`,58:`Approval response policies now run for Cancel as well as Approve; a policy written for Approve only could reject every Cancel.`,59:`Approval response policies now run for Cancel as well as Approve; a policy written for Approve only could reject every Cancel.`,71:`AI SDK evaluation models became decision models; auto() accepts decision models only`,74:`Sandbox provider handle hooks were renamed to onSandboxStop and onSandboxDelete.`}},channel:{current:62,supported:[1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,29,31,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62],dropped:{12:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,19:`Continuation rekey was removed; channel extensions must use additive continuation.alias instead.`,20:`Continuation rekey was removed; channel extensions must use additive continuation.alias instead.`,21:`Continuation rekey was removed; channel extensions must use additive continuation.alias instead.`,22:`Continuation rekey was removed; channel extensions must use additive continuation.alias instead.`,23:`Task views no longer expose executor bindings; background work is owned by workflow runs.`,24:`Task views no longer expose executor bindings; background work is owned by workflow runs.`,25:`Task views no longer expose executor bindings; background work is owned by workflow runs.`,26:`Task views no longer expose executor bindings; background work is owned by workflow runs.`,27:`Sandbox sessions no longer expose core identity and mutable networking is provider-specific.`,28:`Sandbox sessions no longer expose core identity and mutable networking is provider-specific.`,30:`SandboxSession no longer exposes setNetworkPolicy; pass the configured environment to ctx.getSandbox(environment) to access network policy capabilities`,32:`Run mode and caller-supplied output schemas were removed from channel operations; sessions always park, and send options, audience inputs, and ConversationContext no longer carry mode, while from().send() and from().respond() no longer accept outputSchema.`,33:`Background task delivery was removed: sends no longer accept taskDeliveryPolicy and message.completed always carries text.`,34:`Background task delivery was removed: sends no longer accept taskDeliveryPolicy and message.completed always carries text. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,35:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event stream events were removed; agent calls report task.started, task.settled, and agent.started.`,53:`Sandbox provider handle hooks were renamed to onSandboxStop and onSandboxDelete.`}},schedule:{current:34,supported:[1,2,3,4,6,7,8,9,10,11,12,13,14,15,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],dropped:{5:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,16:`Background task delivery was removed: sends no longer accept taskDeliveryPolicy and message.completed always carries text. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,17:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event stream events were removed; agent calls report task.started, task.settled, and agent.started.`}},subagent:{current:39,supported:[3,4,6,7,8,9,10,11,12,13,14,15,16,19,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],dropped:{1:`Persistent subagent sessions are now the default and the experimental opt-in was removed`,2:`Persistent subagent sessions are now the default and the experimental opt-in was removed`,5:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,17:`Removed experimental.instrumentationProviders; instrumentation is now always enabled for root agents.`,18:`Removed experimental.instrumentationProviders; instrumentation is now always enabled for root agents.`,20:`Run mode was removed and agent definitions no longer declare outputSchema; sessions always park, ConversationContext no longer carries mode, and structured output is requested per turn.`,21:`Background task execution was removed: subagent results no longer carry backgroundTask, message.completed always carries text, and experimental.tasks is gone. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,22:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event stream events were removed; agent calls report task.started, task.settled, and agent.started.`}},connection:{current:51,supported:[1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18,19,20,21,22,24,26,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51],dropped:{9:`Dynamic connection resolvers no longer receive conversation or channel continuation data`,10:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,23:`Sandbox sessions no longer expose core identity and mutable networking is provider-specific.`,25:`SandboxSession no longer exposes setNetworkPolicy; pass the configured environment to ctx.getSandbox(environment) to access network policy capabilities`,27:`Run mode was removed; sessions always park and ConversationContext no longer carries mode.`,28:`Background task execution was removed: subagent results no longer carry backgroundTask and message.completed always carries text. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,29:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event stream events were removed; agent calls report task.started, task.settled, and agent.started.`,30:`Approval response policies now run for Cancel as well as Approve; a policy written for Approve only could reject every Cancel.`,31:`Approval response policies now run for Cancel as well as Approve; a policy written for Approve only could reject every Cancel.`,42:`Sandbox provider handle hooks were renamed to onSandboxStop and onSandboxDelete.`}},hook:{current:47,supported:[20,21,22,23,25,27,31,32,33,34,35,36,37,38,39,41,42,43,44,45,46,47],dropped:{1:`Model identity moved from session.started runtime metadata to step.started call attribution.`,2:`Model identity moved from session.started runtime metadata to step.started call attribution.`,3:`Model identity moved from session.started runtime metadata to step.started call attribution.`,4:`Model identity moved from session.started runtime metadata to step.started call attribution.`,5:`Model identity moved from session.started runtime metadata to step.started call attribution.`,6:`Model identity moved from session.started runtime metadata to step.started call attribution.`,7:`Model identity moved from session.started runtime metadata to step.started call attribution.`,8:`Model identity moved from session.started runtime metadata to step.started call attribution.`,9:`Model identity moved from session.started runtime metadata to step.started call attribution.`,10:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,11:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,12:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,13:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,14:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,15:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,16:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,17:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,18:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,19:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,24:`Sandbox sessions no longer expose core identity and mutable networking is provider-specific.`,26:`SandboxSession no longer exposes setNetworkPolicy; pass the configured environment to ctx.getSandbox(environment) to access network policy capabilities`,28:`Background task execution was removed: subagent results no longer carry backgroundTask and message.completed always carries text.`,29:`Background task execution was removed: subagent results no longer carry backgroundTask and message.completed always carries text. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,30:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,40:`Sandbox provider handle hooks were renamed to onSandboxStop and onSandboxDelete.`}},skill:{current:3,supported:[1,2,3],dropped:{}},dynamicSkill:{current:39,supported:[1,2,3,4,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],dropped:{13:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,22:`Run mode was removed; sessions always park and ConversationContext no longer carries mode.`,23:`Background task execution was removed: subagent results no longer carry backgroundTask and message.completed always carries text. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,24:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event stream events were removed; agent calls report task.started, task.settled, and agent.started.`}},instructions:{current:2,supported:[1,2],dropped:{}},dynamicInstructions:{current:40,supported:[1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],dropped:{14:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,23:`Run mode was removed; sessions always park and ConversationContext no longer carries mode.`,24:`Background task execution was removed: subagent results no longer carry backgroundTask and message.completed always carries text. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,25:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event stream events were removed; agent calls report task.started, task.settled, and agent.started.`}},config:{current:1,supported:[1],dropped:{}},state:{current:13,supported:[1,2,3,4,5,7,9,10,12,13],dropped:{6:`Sandbox sessions no longer expose core identity and mutable networking is provider-specific.`,8:`SandboxSession no longer exposes setNetworkPolicy; pass the configured environment to ctx.getSandbox(environment) to access network policy capabilities`,11:`Sandbox provider handle hooks were renamed to onSandboxStop and onSandboxDelete.`}}},EXTENSION_CAPABILITY_VERSIONS=Object.fromEntries(Object.entries(EXTENSION_CAPABILITY_CONTRACTS).map(([e,t])=>[e,t.current])),EXTENSION_CAPABILITY_SUPPORT=Object.keys(EXTENSION_CAPABILITY_CONTRACTS).reduce((e,t)=>(e[t]=EXTENSION_CAPABILITY_CONTRACTS[t].supported,e),{}),extensionCompatibilityManifestV1Schema=z.object({kind:z.literal(EXTENSION_COMPATIBILITY_MANIFEST_KIND),formatVersion:z.literal(1),builtWithEve:z.string().min(1),requires:z.record(z.string(),z.number().int().positive())}).strict(),extensionCompatibilityManifestV2Schema=extensionCompatibilityManifestV1Schema.extend({formatVersion:z.literal(2),build:z.object({externalDependencies:z.array(z.string().min(1)).readonly()}).strict().optional()}),extensionCompatibilityManifestSchema=z.union([extensionCompatibilityManifestV1Schema,extensionCompatibilityManifestV2Schema]);function serializeExtensionCompatibilityManifest(e){return`${JSON.stringify(e,null,2)}\n`}function parseExtensionCompatibilityManifest(e,t){let n;try{n=JSON.parse(e)}catch(e){throw Error(`Extension compatibility manifest "${t}" is not valid JSON: ${e instanceof Error?e.message:String(e)}`)}let r=extensionCompatibilityManifestSchema.safeParse(n);if(!r.success)throw Error(`Extension compatibility manifest "${t}" is invalid. ${formatValidationError(r.error)}`);return r.data}async function readExtensionCompatibilityManifest(e){return parseExtensionCompatibilityManifest(await readFile(e,`utf8`),e)}async function writeExtensionCompatibilityManifest(e,t){await writeFile(join(e,EXTENSION_COMPATIBILITY_MANIFEST_FILENAME),serializeExtensionCompatibilityManifest(t),`utf8`)}function findUnsupportedExtensionCapabilities(e,t=EXTENSION_CAPABILITY_SUPPORT){return Object.entries(e.requires).flatMap(([e,n])=>{let r=Object.hasOwn(t,e)?t[e]??[]:[];return r.includes(n)?[]:[{capability:e,requiredVersion:n,supportedVersions:r}]}).sort((e,t)=>e.capability.localeCompare(t.capability))}export{EXTENSION_CAPABILITY_SUPPORT,EXTENSION_CAPABILITY_VERSIONS,EXTENSION_COMPATIBILITY_MANIFEST_FILENAME,EXTENSION_COMPATIBILITY_MANIFEST_FORMAT_VERSION,EXTENSION_COMPATIBILITY_MANIFEST_KIND,findUnsupportedExtensionCapabilities,parseExtensionCompatibilityManifest,readExtensionCompatibilityManifest,serializeExtensionCompatibilityManifest,writeExtensionCompatibilityManifest};
1
+ import{readFile,writeFile}from"node:fs/promises";import{z}from"#compiled/zod/index.js";import{join}from"node:path";import{formatValidationError}from"#runtime/validation.js";const EXTENSION_COMPATIBILITY_MANIFEST_KIND=`eve-extension`,EXTENSION_COMPATIBILITY_MANIFEST_FORMAT_VERSION=2,EXTENSION_COMPATIBILITY_MANIFEST_FILENAME=`_manifest.json`,EXTENSION_CAPABILITY_CONTRACTS={extension:{current:1,supported:[1],dropped:{}},tool:{current:96,supported:[1,2,3,4,5,6,7,8,9,10,11,12,13,29,30,31,32,34,35,76,77,78,80,81,82,84,85,86,87,88,89,90,91,92,93,94,95,96],dropped:{14:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,15:`TaskExec replaces stageEffect with send`,16:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,17:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,18:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,19:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,20:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,21:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,22:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,23:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,24:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,25:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,26:`Background tools now use task yield descriptors`,27:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,28:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,33:`ctx.agent now accepts the subagent name as its first argument, derives invocation identity internally, and infers structured output types`,36:`experimental_workflow and eve/tools/workflow were removed; migrate to the workflow factory from eve/tools/workflow`,37:`experimental_workflow and eve/tools/workflow were removed; migrate to the workflow factory from eve/tools/workflow`,38:`experimental_workflow and eve/tools/workflow were removed; migrate to the workflow factory from eve/tools/workflow`,39:`experimental_workflow and eve/tools/workflow were removed; migrate to the workflow factory from eve/tools/workflow`,40:`runWorkflowProgram was made internal; use the workflow factory from eve/tools/workflow`,41:`workflow no longer accepts agents and its options argument is optional; use workflow() or workflow({ maxSubagents })`,42:`Legacy session history migration was removed; user-role messages require current provenance kinds.`,43:`Legacy session history migration was removed; user-role messages require current provenance kinds.`,44:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,45:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,46:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,47:`eve/experimental/evaluate was removed; import decide from eve/ai`,48:`eve/experimental/evaluate was removed; import decide from eve/ai`,49:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,50:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,51:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,52:`Background defineTool and TaskExec were removed; use defineWorkflowTool for durable background work.`,53:`Sandbox sessions no longer expose core identity and mutable networking is provider-specific.`,54:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,55:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,56:`SandboxSession no longer exposes setNetworkPolicy; pass the configured environment to ctx.getSandbox(environment) to access network policy capabilities`,57:`agentRouter() no longer accepts a model-facing outputSchema; structured subagent output is requested only through ctx.agent().`,58:`Workflow tools no longer accept execution or return background task receipts; every call blocks until it settles.`,59:`Workflow tools no longer accept execution or return background task receipts, and every call blocks until it settles. ctx.ask() no longer accepts dismissible and reports a withdrawn request as cancelled, workflow tool contexts carry interruptSignal, and ctx.agent(name) returns a session handle whose send() delivers a message and whose result() resolves the turn; ctx.agent(name, { message, agentId }) and AgentInput were removed. A ctx.ask() question parks the open turn with turn.waiting instead of ending it.`,60:`Workflow tools define exactly one of execute(input, ctx), task(input, ctx), or serve(receive, ctx): a task() call returns a receipt and runs as a task, a serve() call reaches a resumable task through receive() and its model input gains taskId, and stream events gained task.started and task.settled. Agent tools are serve() tools with taskId in place of agentId, and the subagent.* stream events were removed. ctx.interruptSignal and WorkflowTaskContext were removed: a steering message aborts the abortSignal of an execute call the turn waits on.`,61:`Approval response policies now run for Cancel as well as Approve; a policy written for Approve only could reject every Cancel.`,62:`Approval response policies now run for Cancel as well as Approve; a policy written for Approve only could reject every Cancel.`,63:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,64:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,65:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,66:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,67:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,68:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,69:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,70:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,71:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,72:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,73:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,74:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,75:`eve/ai evaluate was renamed to decide and AI SDK evaluation models became decision models; import decide from eve/ai`,79:`Sandbox provider handle hooks were renamed to onSandboxStop and onSandboxDelete.`,83:`webSearch provider "openai" was replaced by "native" before it shipped in a release`}},dynamicTool:{current:88,supported:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,31,32,33,52,54,60,61,62,63,64,65,66,67,68,69,70,72,73,75,76,77,78,79,80,81,82,83,84,85,86,87,88],dropped:{21:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,23:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,24:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,25:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,26:`Background tools now use task yield descriptors`,27:`TaskExec.delegated was removed; migrate to workflow-backed background tools`,28:`Background dynamic tools were removed; use a static defineWorkflowTool for durable background work.`,29:`Background dynamic tools were removed; use a static defineWorkflowTool for durable background work.`,30:`Background dynamic tools were removed; use a static defineWorkflowTool for durable background work.`,34:`Legacy session history migration was removed; user-role messages require current provenance kinds.`,35:`workflowMaxSubagents was removed with experimental_workflow; configure generated-program limits with the workflow factory`,36:`workflowMaxSubagents was removed with experimental_workflow; configure generated-program limits with the workflow factory`,37:`workflowMaxSubagents was removed with experimental_workflow; configure generated-program limits with the workflow factory`,38:`workflowMaxSubagents was removed with experimental_workflow; configure generated-program limits with the workflow factory`,39:`Legacy session history migration was removed; user-role messages require current provenance kinds.`,40:`Legacy session history migration was removed; user-role messages require current provenance kinds.`,41:`Background dynamic tools were removed; use a static defineWorkflowTool for durable background work.`,42:`autoModel and eve/experimental/evaluate were removed; import auto from eve/models`,43:`autoModel and eve/experimental/evaluate were removed; import auto from eve/models`,44:`autoModel and eve/experimental/evaluate were removed; import auto from eve/models`,45:`autoModel and eve/experimental/evaluate were removed; import auto from eve/models`,46:`autoModel and eve/experimental/evaluate were removed; import auto from eve/models`,47:`autoModel and eve/experimental/evaluate were removed; import auto from eve/models`,48:`Background dynamic tools were removed; use a static defineWorkflowTool for durable background work.`,49:`Background dynamic tools were removed; use a static defineWorkflowTool for durable background work.`,50:`Background dynamic tools were removed; use a static defineWorkflowTool for durable background work.`,51:`Sandbox sessions no longer expose core identity and mutable networking is provider-specific.`,53:`SandboxSession no longer exposes setNetworkPolicy; pass the configured environment to ctx.getSandbox(environment) to access network policy capabilities`,55:`Run mode was removed; sessions always park and ConversationContext no longer carries mode.`,56:`Background task execution was removed: subagent results no longer carry backgroundTask and message.completed always carries text. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,57:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event stream events were removed; agent calls report task.started, task.settled, and agent.started.`,58:`Approval response policies now run for Cancel as well as Approve; a policy written for Approve only could reject every Cancel.`,59:`Approval response policies now run for Cancel as well as Approve; a policy written for Approve only could reject every Cancel.`,71:`AI SDK evaluation models became decision models; auto() accepts decision models only`,74:`Sandbox provider handle hooks were renamed to onSandboxStop and onSandboxDelete.`}},channel:{current:64,supported:[1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,29,31,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64],dropped:{12:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,19:`Continuation rekey was removed; channel extensions must use additive continuation.alias instead.`,20:`Continuation rekey was removed; channel extensions must use additive continuation.alias instead.`,21:`Continuation rekey was removed; channel extensions must use additive continuation.alias instead.`,22:`Continuation rekey was removed; channel extensions must use additive continuation.alias instead.`,23:`Task views no longer expose executor bindings; background work is owned by workflow runs.`,24:`Task views no longer expose executor bindings; background work is owned by workflow runs.`,25:`Task views no longer expose executor bindings; background work is owned by workflow runs.`,26:`Task views no longer expose executor bindings; background work is owned by workflow runs.`,27:`Sandbox sessions no longer expose core identity and mutable networking is provider-specific.`,28:`Sandbox sessions no longer expose core identity and mutable networking is provider-specific.`,30:`SandboxSession no longer exposes setNetworkPolicy; pass the configured environment to ctx.getSandbox(environment) to access network policy capabilities`,32:`Run mode and caller-supplied output schemas were removed from channel operations; sessions always park, and send options, audience inputs, and ConversationContext no longer carry mode, while from().send() and from().respond() no longer accept outputSchema.`,33:`Background task delivery was removed: sends no longer accept taskDeliveryPolicy and message.completed always carries text.`,34:`Background task delivery was removed: sends no longer accept taskDeliveryPolicy and message.completed always carries text. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,35:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event stream events were removed; agent calls report task.started, task.settled, and agent.started.`,53:`Sandbox provider handle hooks were renamed to onSandboxStop and onSandboxDelete.`}},schedule:{current:36,supported:[1,2,3,4,6,7,8,9,10,11,12,13,14,15,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],dropped:{5:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,16:`Background task delivery was removed: sends no longer accept taskDeliveryPolicy and message.completed always carries text. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,17:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event stream events were removed; agent calls report task.started, task.settled, and agent.started.`}},subagent:{current:41,supported:[3,4,6,7,8,9,10,11,12,13,14,15,16,19,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,41],dropped:{1:`Persistent subagent sessions are now the default and the experimental opt-in was removed`,2:`Persistent subagent sessions are now the default and the experimental opt-in was removed`,5:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,17:`Removed experimental.instrumentationProviders; instrumentation is now always enabled for root agents.`,18:`Removed experimental.instrumentationProviders; instrumentation is now always enabled for root agents.`,20:`Run mode was removed and agent definitions no longer declare outputSchema; sessions always park, ConversationContext no longer carries mode, and structured output is requested per turn.`,21:`Background task execution was removed: subagent results no longer carry backgroundTask, message.completed always carries text, and experimental.tasks is gone. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,22:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event stream events were removed; agent calls report task.started, task.settled, and agent.started.`,40:`limits.sessionUsage replaces the numeric per-session token and cost limits`}},connection:{current:53,supported:[1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18,19,20,21,22,24,26,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53],dropped:{9:`Dynamic connection resolvers no longer receive conversation or channel continuation data`,10:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,23:`Sandbox sessions no longer expose core identity and mutable networking is provider-specific.`,25:`SandboxSession no longer exposes setNetworkPolicy; pass the configured environment to ctx.getSandbox(environment) to access network policy capabilities`,27:`Run mode was removed; sessions always park and ConversationContext no longer carries mode.`,28:`Background task execution was removed: subagent results no longer carry backgroundTask and message.completed always carries text. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,29:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event stream events were removed; agent calls report task.started, task.settled, and agent.started.`,30:`Approval response policies now run for Cancel as well as Approve; a policy written for Approve only could reject every Cancel.`,31:`Approval response policies now run for Cancel as well as Approve; a policy written for Approve only could reject every Cancel.`,42:`Sandbox provider handle hooks were renamed to onSandboxStop and onSandboxDelete.`}},hook:{current:48,supported:[20,21,22,23,25,27,31,32,33,34,35,36,37,38,39,41,42,43,44,45,46,47,48],dropped:{1:`Model identity moved from session.started runtime metadata to step.started call attribution.`,2:`Model identity moved from session.started runtime metadata to step.started call attribution.`,3:`Model identity moved from session.started runtime metadata to step.started call attribution.`,4:`Model identity moved from session.started runtime metadata to step.started call attribution.`,5:`Model identity moved from session.started runtime metadata to step.started call attribution.`,6:`Model identity moved from session.started runtime metadata to step.started call attribution.`,7:`Model identity moved from session.started runtime metadata to step.started call attribution.`,8:`Model identity moved from session.started runtime metadata to step.started call attribution.`,9:`Model identity moved from session.started runtime metadata to step.started call attribution.`,10:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,11:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,12:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,13:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,14:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,15:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,16:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,17:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,18:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,19:`The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,24:`Sandbox sessions no longer expose core identity and mutable networking is provider-specific.`,26:`SandboxSession no longer exposes setNetworkPolicy; pass the configured environment to ctx.getSandbox(environment) to access network policy capabilities`,28:`Background task execution was removed: subagent results no longer carry backgroundTask and message.completed always carries text.`,29:`Background task execution was removed: subagent results no longer carry backgroundTask and message.completed always carries text. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,30:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event hook events were removed; subscribe to task.started, task.settled, and agent.started.`,40:`Sandbox provider handle hooks were renamed to onSandboxStop and onSandboxDelete.`}},skill:{current:3,supported:[1,2,3],dropped:{}},dynamicSkill:{current:40,supported:[1,2,3,4,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],dropped:{13:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,22:`Run mode was removed; sessions always park and ConversationContext no longer carries mode.`,23:`Background task execution was removed: subagent results no longer carry backgroundTask and message.completed always carries text. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,24:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event stream events were removed; agent calls report task.started, task.settled, and agent.started.`}},instructions:{current:2,supported:[1,2],dropped:{}},dynamicInstructions:{current:41,supported:[1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],dropped:{14:`Message and reasoning append events now expose deltas instead of cumulative snapshots.`,23:`Run mode was removed; sessions always park and ConversationContext no longer carries mode.`,24:`Background task execution was removed: subagent results no longer carry backgroundTask and message.completed always carries text. input.resolved reports outcome "cancelled" when a workflow tool withdraws a ctx.ask() request, and stream events gained agent.started, published when a workflow run opens a ctx.agent session, and turn.waiting, which parks the open turn instead of emitting turn.completed and session.waiting.`,25:`Stream events gained task.started and task.settled, and input.requested, authorization events, and agent.started carry the taskId of the task they come from. The subagent.called, subagent.completed, subagent.started, and subagent.event stream events were removed; agent calls report task.started, task.settled, and agent.started.`}},config:{current:1,supported:[1],dropped:{}},state:{current:13,supported:[1,2,3,4,5,7,9,10,12,13],dropped:{6:`Sandbox sessions no longer expose core identity and mutable networking is provider-specific.`,8:`SandboxSession no longer exposes setNetworkPolicy; pass the configured environment to ctx.getSandbox(environment) to access network policy capabilities`,11:`Sandbox provider handle hooks were renamed to onSandboxStop and onSandboxDelete.`}}},EXTENSION_CAPABILITY_VERSIONS=Object.fromEntries(Object.entries(EXTENSION_CAPABILITY_CONTRACTS).map(([e,t])=>[e,t.current])),EXTENSION_CAPABILITY_SUPPORT=Object.keys(EXTENSION_CAPABILITY_CONTRACTS).reduce((e,t)=>(e[t]=EXTENSION_CAPABILITY_CONTRACTS[t].supported,e),{}),extensionCompatibilityManifestV1Schema=z.object({kind:z.literal(EXTENSION_COMPATIBILITY_MANIFEST_KIND),formatVersion:z.literal(1),builtWithEve:z.string().min(1),requires:z.record(z.string(),z.number().int().positive())}).strict(),extensionCompatibilityManifestV2Schema=extensionCompatibilityManifestV1Schema.extend({formatVersion:z.literal(2),build:z.object({externalDependencies:z.array(z.string().min(1)).readonly()}).strict().optional()}),extensionCompatibilityManifestSchema=z.union([extensionCompatibilityManifestV1Schema,extensionCompatibilityManifestV2Schema]);function serializeExtensionCompatibilityManifest(e){return`${JSON.stringify(e,null,2)}\n`}function parseExtensionCompatibilityManifest(e,t){let n;try{n=JSON.parse(e)}catch(e){throw Error(`Extension compatibility manifest "${t}" is not valid JSON: ${e instanceof Error?e.message:String(e)}`)}let r=extensionCompatibilityManifestSchema.safeParse(n);if(!r.success)throw Error(`Extension compatibility manifest "${t}" is invalid. ${formatValidationError(r.error)}`);return r.data}async function readExtensionCompatibilityManifest(e){return parseExtensionCompatibilityManifest(await readFile(e,`utf8`),e)}async function writeExtensionCompatibilityManifest(e,t){await writeFile(join(e,EXTENSION_COMPATIBILITY_MANIFEST_FILENAME),serializeExtensionCompatibilityManifest(t),`utf8`)}function findUnsupportedExtensionCapabilities(e,t=EXTENSION_CAPABILITY_SUPPORT){return Object.entries(e.requires).flatMap(([e,n])=>{let r=Object.hasOwn(t,e)?t[e]??[]:[];return r.includes(n)?[]:[{capability:e,requiredVersion:n,supportedVersions:r}]}).sort((e,t)=>e.capability.localeCompare(t.capability))}export{EXTENSION_CAPABILITY_SUPPORT,EXTENSION_CAPABILITY_VERSIONS,EXTENSION_COMPATIBILITY_MANIFEST_FILENAME,EXTENSION_COMPATIBILITY_MANIFEST_FORMAT_VERSION,EXTENSION_COMPATIBILITY_MANIFEST_KIND,findUnsupportedExtensionCapabilities,parseExtensionCompatibilityManifest,readExtensionCompatibilityManifest,serializeExtensionCompatibilityManifest,writeExtensionCompatibilityManifest};
@@ -1,5 +1,6 @@
1
1
  import { type AgentModuleBinding, type AgentSourceRegistry, type ProgrammaticModuleNamespace } from "#compiler/source-graph.js";
2
2
  import { type AuthoredModuleLoadOptions } from "#internal/authored-module-loader.js";
3
+ import type { AuthoredModuleGraph } from "#internal/authored-module-graph.js";
3
4
  export type CompiledBindingNamespaceLoader = (sourceId: string) => Promise<ProgrammaticModuleNamespace>;
4
5
  export interface ExtensionCompileMount {
5
6
  readonly mountId: string;
@@ -13,6 +14,7 @@ export declare function createCompiledBindingNamespaceLoader(input: {
13
14
  */
14
15
  readonly appRoot: string | undefined;
15
16
  readonly bindings?: Readonly<Record<string, AgentModuleBinding>>;
17
+ readonly graph?: AuthoredModuleGraph;
16
18
  readonly mounts?: ReadonlyMap<string, ExtensionCompileMount>;
17
19
  readonly evaluationId?: string;
18
20
  readonly mountSourceId?: (binding: AgentModuleBinding) => string | undefined;
@@ -1 +1 @@
1
- import{loadProgrammaticModuleNamespace,memoizeModuleNamespaceFactories}from"#compiler/source-graph.js";import{loadAuthoredModuleNamespace}from"#internal/authored-module-loader.js";function ancestorMountEntries(e,t){return[...e.values()].filter(e=>e.entry!==void 0&&t.startsWith(`${e.mountId}/`)).sort((e,t)=>e.mountId.length-t.mountId.length).map(e=>({...e.entry,mountId:e.mountId}))}function createCompiledBindingNamespaceLoader(e){if(e.bindings===void 0&&e.resolveBinding===void 0)throw Error(`Compiled binding namespace loader requires a binding source.`);let t=new Map,load=(n,r=new Set)=>{if(r.has(n))throw Error(`Compiled binding dependency cycle includes "${n}".`);let i=t.get(n);if(i!==void 0)return i;let a=e.resolveBinding?.(n)??e.bindings?.[n];if(a===void 0)throw Error(`Compiled binding dependency "${n}" is missing.`);e.onLoad?.(n);let o=new Set(r).add(n),s=e.mountSourceId?.(a),c=(async()=>(s!==void 0&&s!==n&&await load(s,o),await loadCompiledBindingNamespace({appRoot:e.appRoot,binding:a,loadDependency:e=>load(e,o),registries:e.registries,mounts:e.mounts,evaluationId:e.evaluationId})))().then(memoizeModuleNamespaceFactories);return t.set(n,c),c};return load}async function loadCompiledBindingNamespace(e){if(e.binding.backing.kind===`filesystem`){let t=e.binding.owner.kind===`extension`?e.binding.owner.mountId:void 0,n=t===void 0?void 0:e.mounts?.get(t);if(t!==void 0&&e.mounts!==void 0&&n===void 0)throw Error(`Missing mount "${t}" for extension contribution.`);let r=t===void 0?void 0:{mountId:t,evaluationId:e.evaluationId,entry:n?.entry,ancestors:e.mounts===void 0?void 0:ancestorMountEntries(e.mounts,t)};return await loadAuthoredModuleNamespace(e.binding.backing.sourcePath,{appRoot:e.binding.owner.kind===`application`?e.appRoot:void 0,externalDependencies:e.binding.backing.externalDependencies,extension:r})}let t=Object.fromEntries(await Promise.all(Object.entries(e.binding.backing.dependencies??{}).map(async([t,n])=>[t,await e.loadDependency(n)])));return await loadProgrammaticModuleNamespace({backing:e.binding.backing,dependencyNamespaces:t,registries:e.registries})}function resolveExtensionBindingMountId(e){return e.owner.kind===`extension`?e.owner.mountId:void 0}export{createCompiledBindingNamespaceLoader,resolveExtensionBindingMountId};
1
+ import{loadProgrammaticModuleNamespace,memoizeModuleNamespaceFactories}from"#compiler/source-graph.js";import{loadAuthoredModuleNamespace}from"#internal/authored-module-loader.js";function ancestorMountEntries(e,t){return[...e.values()].filter(e=>e.entry!==void 0&&t.startsWith(`${e.mountId}/`)).sort((e,t)=>e.mountId.length-t.mountId.length).map(e=>({...e.entry,mountId:e.mountId}))}function createCompiledBindingNamespaceLoader(e){if(e.bindings===void 0&&e.resolveBinding===void 0)throw Error(`Compiled binding namespace loader requires a binding source.`);let t=new Map,load=(n,r=new Set)=>{if(r.has(n))throw Error(`Compiled binding dependency cycle includes "${n}".`);let i=t.get(n);if(i!==void 0)return i;let a=e.resolveBinding?.(n)??e.bindings?.[n];if(a===void 0)throw Error(`Compiled binding dependency "${n}" is missing.`);e.onLoad?.(n);let o=new Set(r).add(n),s=e.mountSourceId?.(a),c=(async()=>(s!==void 0&&s!==n&&await load(s,o),await loadCompiledBindingNamespace({appRoot:e.appRoot,binding:a,graph:e.graph,loadDependency:e=>load(e,o),registries:e.registries,mounts:e.mounts,evaluationId:e.evaluationId})))().then(memoizeModuleNamespaceFactories);return t.set(n,c),c};return load}async function loadCompiledBindingNamespace(e){if(e.binding.backing.kind===`filesystem`){let t=e.binding.owner.kind===`extension`?e.binding.owner.mountId:void 0,n=t===void 0?void 0:e.mounts?.get(t);if(t!==void 0&&e.mounts!==void 0&&n===void 0)throw Error(`Missing mount "${t}" for extension contribution.`);let r=t===void 0?void 0:{mountId:t,evaluationId:e.evaluationId,entry:n?.entry,ancestors:e.mounts===void 0?void 0:ancestorMountEntries(e.mounts,t)};return await loadAuthoredModuleNamespace(e.binding.backing.sourcePath,{appRoot:e.binding.owner.kind===`application`?e.appRoot:void 0,externalDependencies:e.binding.backing.externalDependencies,extension:r,graph:e.graph})}let t=Object.fromEntries(await Promise.all(Object.entries(e.binding.backing.dependencies??{}).map(async([t,n])=>[t,await e.loadDependency(n)])));return await loadProgrammaticModuleNamespace({backing:e.binding.backing,dependencyNamespaces:t,registries:e.registries})}function resolveExtensionBindingMountId(e){return e.owner.kind===`extension`?e.owner.mountId:void 0}export{createCompiledBindingNamespaceLoader,resolveExtensionBindingMountId};
@@ -1 +1 @@
1
- import{z}from"#compiled/zod/index.js";import{mountIdSchema}from"#shared/extension-mount.js";import{discoverDiagnosticsSummarySchema}from"#discover/diagnostics.js";import{compiledRemoteAgentNodeSchema}from"#compiler/remote-agent-node.js";import{jsonObjectSchema}from"#shared/json-schemas.js";import{WEB_SEARCH_FALLBACK_PROVIDERS,WEB_SEARCH_PROVIDERS}from"#shared/web-search.js";import{AGENT_WORKFLOW_RETENTION_VALUES,ANTHROPIC_PROMPT_CACHE_TTLS}from"#shared/agent-definition.js";import{validateCompiledAgentManifest,validateCompiledAgentResources}from"#compiler/validate-artifact.js";const COMPILED_AGENT_MANIFEST_KIND=`eve-agent-compiled-manifest`,ROOT_COMPILED_AGENT_NODE_ID=`__root__`,COMPILED_AGENT_MANIFEST_VERSION=54,agentSourceOwnerSchema=z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`application`)}).strict(),z.object({feature:z.string().min(1),kind:z.literal(`framework`)}).strict(),z.object({kind:z.literal(`extension`),mountId:mountIdSchema,namespace:z.string().min(1),packageName:z.string().min(1)}).strict()]),moduleSourceRefSchema=z.object({exportName:z.string().optional(),sourceKind:z.literal(`module`),logicalPath:z.string(),sourceId:z.string()}).strict(),filesystemModuleBackingSchema=z.object({externalDependencies:z.array(z.string()).readonly(),extensionScope:z.object({namespace:z.string(),sourceRoot:z.string()}).strict().optional(),mountId:z.string().optional(),kind:z.literal(`filesystem`),sourcePath:z.string()}).strict(),programmaticModuleBackingSchema=z.object({dependencies:z.record(z.string(),z.string()).readonly().optional(),kind:z.literal(`programmatic`),mountId:z.string().optional(),moduleId:z.string(),parameters:jsonObjectSchema.optional(),registryId:z.string(),revision:z.string(),semanticRevision:z.string().optional()}).strict(),resourceSourceBackingSchema=z.object({kind:z.literal(`resource`),sourcePath:z.string()}).strict(),agentModuleBackingSchema=z.discriminatedUnion(`kind`,[filesystemModuleBackingSchema,programmaticModuleBackingSchema]),compiledModuleBindingSchema=z.object({backing:agentModuleBackingSchema,logicalPath:z.string(),owner:agentSourceOwnerSchema,usage:z.object({compile:z.boolean(),runtimeEntry:z.boolean()}).strict()}).strict(),agentSourceDescriptorSchema=z.object({backing:z.discriminatedUnion(`kind`,[filesystemModuleBackingSchema,programmaticModuleBackingSchema,resourceSourceBackingSchema]),form:z.enum([`derived`,`direct`]),layer:z.enum([`framework-default`,`extension-package`,`extension-override`,`application`]),logicalPath:z.string(),owner:agentSourceOwnerSchema,sourceId:z.string()}).strict(),agentSourceCompositionSchema=z.object({entries:z.array(z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`shadowed`),source:agentSourceDescriptorSchema,winnerSourceId:z.string()}).strict(),z.object({kind:z.literal(`disabled`),source:agentSourceDescriptorSchema}).strict()])).readonly()}).strict(),compiledDynamicModelDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),sourceKind:z.literal(`module`),logicalPath:z.string(),sourceId:z.string()}).strict(),channelMethodSchema=z.union([z.literal(`GET`),z.literal(`HEAD`),z.literal(`POST`),z.literal(`PUT`),z.literal(`PATCH`),z.literal(`DELETE`),z.literal(`OPTIONS`),z.literal(`WEBSOCKET`)]),compiledChannelCorsSchema=z.object({origin:z.union([z.literal(`*`),z.literal(`null`),z.array(z.string())]).optional(),methods:z.union([z.literal(`*`),z.array(z.string())]).optional(),allowHeaders:z.union([z.literal(`*`),z.array(z.string())]).optional(),exposeHeaders:z.union([z.literal(`*`),z.array(z.string())]).optional(),credentials:z.boolean().optional(),maxAge:z.union([z.string(),z.literal(!1)]).optional(),preflight:z.object({statusCode:z.number().int().min(100).max(599).optional()}).strict().optional()}).strict(),compiledVercelConnectMetadataSchema=z.object({connector:z.string(),requirement:z.object({method:z.string().optional(),reference:z.string(),service:z.string(),subjectTypes:z.array(z.enum([`app`,`user`])).readonly()}).strict().optional()}).strict(),compiledChannelDefinitionSchema=z.object({kind:z.literal(`channel`),name:z.string(),logicalPath:z.string(),method:channelMethodSchema,urlPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),exportName:z.string().optional(),adapterKind:z.string().optional(),cors:compiledChannelCorsSchema.optional(),manifest:jsonObjectSchema.optional(),vercelConnect:compiledVercelConnectMetadataSchema.optional()}).strict(),compiledChannelPreflightDefinitionSchema=z.object({cors:compiledChannelCorsSchema,method:z.literal(`OPTIONS`),sourceIds:z.array(z.string()).readonly(),urlPath:z.string()}).strict(),compiledShadowedChannelRouteSchema=z.object({method:channelMethodSchema,source:agentSourceDescriptorSchema,urlPath:z.string(),winnerSourceId:z.string()}).strict(),compiledChannelRoutePlanSchema=z.object({effective:z.array(compiledChannelDefinitionSchema).readonly(),preflight:z.array(compiledChannelPreflightDefinitionSchema).readonly(),shadowed:z.array(compiledShadowedChannelRouteSchema).readonly()}).strict(),modelRoutingSchema=z.union([z.object({kind:z.literal(`gateway`),target:z.string(),byok:z.string().optional()}).strict(),z.object({kind:z.literal(`external`),provider:z.string()}).strict()]),compiledRuntimeModelReferenceSchema=z.object({contextWindowTokens:z.number().int().positive().optional(),id:z.string(),maxOutputTokens:z.number().int().positive().optional(),source:moduleSourceRefSchema.optional(),promptCache:z.object({anthropic:z.object({ttl:z.literal(ANTHROPIC_PROMPT_CACHE_TTLS).optional()}).strict().optional()}).strict().optional(),providerOptions:z.record(z.string(),jsonObjectSchema).optional(),routing:modelRoutingSchema}).strict(),compiledAgentBuildDefinitionSchema=z.object({externalDependencies:z.array(z.string()).optional()}).strict(),compiledAgentWorkflowWorldDefinitionSchema=z.string(),compiledAgentWorkflowDefinitionSchema=z.object({modelCallsPerStep:z.number().int().positive().optional(),retention:z.literal(AGENT_WORKFLOW_RETENTION_VALUES).optional(),world:compiledAgentWorkflowWorldDefinitionSchema.optional()}).strict(),compiledAgentCompactionDefinitionSchema=z.object({model:compiledRuntimeModelReferenceSchema.optional(),thresholdPercent:z.number().finite().min(0).max(1).optional()}).strict(),sessionTokenLimitSchema=z.union([z.number().int().positive(),z.literal(!1)]),sessionTokenCostLimitSchema=z.union([z.number().finite().positive(),z.literal(!1)]),sessionTimeoutSchema=z.union([z.number().int().positive(),z.literal(!1)]),compiledAgentLimitsDefinitionSchema=z.object({maxInputTokensPerSession:sessionTokenLimitSchema.optional(),maxOutputTokensPerSession:sessionTokenLimitSchema.optional(),maxTokenCostUsdPerSession:sessionTokenCostLimitSchema.optional(),sessionTimeoutMs:sessionTimeoutSchema.optional()}).strict(),compiledAgentConfigBaseFields={build:compiledAgentBuildDefinitionSchema.optional(),compaction:compiledAgentCompactionDefinitionSchema.optional(),defaultTools:z.boolean().optional(),description:z.string().optional(),experimental:z.object({workflow:compiledAgentWorkflowDefinitionSchema.optional()}).strict().optional(),name:z.string(),reasoning:z.enum([`provider-default`,`none`,`minimal`,`low`,`medium`,`high`,`xhigh`]).optional(),source:moduleSourceRefSchema,tool:z.union([z.boolean(),z.literal(`deferred`)]).optional(),limits:compiledAgentLimitsDefinitionSchema.optional()},compiledAgentConfigSchema=z.union([z.object({...compiledAgentConfigBaseFields,model:compiledRuntimeModelReferenceSchema}).strict(),z.object({...compiledAgentConfigBaseFields,dynamicModel:compiledDynamicModelDefinitionSchema}).strict()]),compiledInstructionsBaseFields={content:z.string(),name:z.string(),logicalPath:z.string(),role:z.enum([`system`,`user`]),sourceId:z.string()},compiledInstructionsSchema=z.discriminatedUnion(`sourceKind`,[z.object({...compiledInstructionsBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`markdown`)}).strict(),z.object({...compiledInstructionsBaseFields,sourceKind:z.literal(`module`)}).strict()]),compiledSkillBaseFields={name:z.string(),deferred:z.boolean().optional(),description:z.string(),license:z.string().optional(),markdown:z.string(),metadata:z.record(z.string(),z.string()).optional(),sourceId:z.string(),logicalPath:z.string()},compiledSkillSourceSchema=z.discriminatedUnion(`sourceKind`,[z.object({...compiledSkillBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`markdown`)}).strict(),z.object({...compiledSkillBaseFields,sourceKind:z.literal(`module`),exportName:z.string().optional()}).strict(),z.object({...compiledSkillBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`skill-package`),skillId:z.string(),skillFilePath:z.string(),rootPath:z.string(),assetsPath:z.string().optional(),referencesPath:z.string().optional(),scriptsPath:z.string().optional()}).strict()]),compiledScheduleBaseFields={cron:z.string(),hasRun:z.boolean(),name:z.string(),logicalPath:z.string(),markdown:z.string().optional(),sourceId:z.string()},compiledScheduleDefinitionSchema=z.discriminatedUnion(`sourceKind`,[z.object({...compiledScheduleBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`markdown`)}).strict(),z.object({...compiledScheduleBaseFields,sourceKind:z.literal(`module`)}).strict()]),compiledScheduleCollectionDefinitionSchema=z.object({description:z.string().optional(),logicalPath:z.string(),name:z.string(),providerKind:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),tools:z.union([z.boolean(),z.literal(`deferred`)]).optional()}).strict(),compiledSandboxDefinitionSchema=z.object({providerName:z.string().optional(),environmentExportName:z.string().optional(),inheritsParent:z.boolean().optional(),exportName:z.string().optional(),logicalPath:z.string(),revisionHash:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledSandboxWorkspaceSchema=z.object({logicalPath:z.string(),rootEntries:z.array(z.string()).readonly(),sourceId:z.string(),sourcePath:z.string()}).strict(),compiledWorkspaceResourceRootSchema=z.object({contentHash:z.string().optional(),logicalPath:z.string(),rootEntries:z.array(z.string()).readonly()}).strict(),compiledConnectionDefinitionSchema=z.object({experimental_events:z.literal(!0).optional(),connectionName:z.string(),description:z.string(),exportName:z.string().optional(),logicalPath:z.string(),protocol:z.enum([`mcp`,`openapi`]).default(`mcp`),sourceId:z.string(),sourceKind:z.literal(`module`),url:z.string(),vercelConnect:compiledVercelConnectMetadataSchema.optional()}).strict(),compiledDynamicConnectionDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),extensionNamespace:z.string().optional(),logicalPath:z.string(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledToolBehaviorSchema=z.object({availability:z.array(z.literal(`root-session`)).readonly(),handling:z.discriminatedUnion(`kind`,[z.object({action:z.literal(`self-agent`),kind:z.literal(`dispatch`)}).strict(),z.object({fallback:z.enum(WEB_SEARCH_FALLBACK_PROVIDERS).optional(),kind:z.literal(`provider-tool`),provider:z.enum(WEB_SEARCH_PROVIDERS)}).strict(),z.object({entryPoint:z.enum([`execute`,`task`,`serve`]),kind:z.literal(`workflow-tool`),workflowId:z.string()}).strict()]).optional(),shape:z.object({suspend:z.enum([`none`,`workflow`])}).strict().optional()}).strict(),compiledToolDefinitionSchema=z.object({availableInSubagents:z.boolean().optional(),behavior:compiledToolBehaviorSchema.optional(),deferred:z.boolean().optional(),description:z.string(),exportName:z.string().optional(),hasExecute:z.boolean(),hasModelOutputProjection:z.boolean(),inputSchema:jsonObjectSchema.nullable(),logicalPath:z.string(),modelInputSchema:jsonObjectSchema.optional(),name:z.string(),outputSchema:jsonObjectSchema.optional(),requiresApproval:z.boolean(),sourceId:z.string(),sourceKind:z.literal(`module`),workflowProgram:z.object({maxSubagents:z.number().int().positive()}).strict().optional()}).strict(),compiledDynamicToolDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),extensionNamespace:z.string().optional(),logicalPath:z.string(),rebindMissingCallbacks:z.boolean().optional(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledMemoryDefinitionSchema=z.object({description:z.string().optional(),exportName:z.string().optional(),logicalPath:z.string(),slot:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),visibility:z.enum([`scope`,`session`])}).strict(),compiledDynamicSkillDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),extensionNamespace:z.string().optional(),logicalPath:z.string(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledDynamicInstructionsDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),logicalPath:z.string(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledHookDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),logicalPath:z.string(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledExtensionMountSchema=z.object({externalDependencies:z.array(z.string()).readonly(),namespace:z.string(),packageName:z.string(),specifier:z.string(),mountId:mountIdSchema,sourceRoot:z.string(),mountSourceId:z.string(),mountSourcePath:z.string(),mountLogicalPath:z.string(),programmaticImport:z.object({specifier:z.string(),entryPath:z.string(),config:jsonObjectSchema}).strict().optional()}).strict(),compiledAgentResourceFields={agentRoot:z.string(),appRoot:z.string(),bindings:z.record(z.string(),compiledModuleBindingSchema),channelRoutes:compiledChannelRoutePlanSchema,connections:z.array(compiledConnectionDefinitionSchema),dynamicConnections:z.array(compiledDynamicConnectionDefinitionSchema).default([]),diagnosticsSummary:discoverDiagnosticsSummarySchema,sourceComposition:agentSourceCompositionSchema,dynamicInstructions:z.array(compiledDynamicInstructionsDefinitionSchema).default([]),dynamicSkills:z.array(compiledDynamicSkillDefinitionSchema).default([]),dynamicTools:z.array(compiledDynamicToolDefinitionSchema).default([]),extensionMounts:z.array(compiledExtensionMountSchema).default([]),hooks:z.array(compiledHookDefinitionSchema),memories:z.array(compiledMemoryDefinitionSchema).default([]),sandbox:compiledSandboxDefinitionSchema,sandboxWorkspaces:z.array(compiledSandboxWorkspaceSchema),schedules:z.array(compiledScheduleDefinitionSchema),scheduleCollections:z.array(compiledScheduleCollectionDefinitionSchema).default([]),remoteAgents:z.array(compiledRemoteAgentNodeSchema),skills:z.array(compiledSkillSourceSchema).readonly(),instructions:z.array(compiledInstructionsSchema).readonly().default([]),tools:z.array(compiledToolDefinitionSchema),workspaceResourceRoot:compiledWorkspaceResourceRootSchema},compiledAgentResourcesSchema=z.object(compiledAgentResourceFields).strict(),compiledAgentNodeManifestSchema=z.object({...compiledAgentResourceFields,config:compiledAgentConfigSchema}).strict(),compiledSubagentNodeBaseFields={backing:resourceSourceBackingSchema,entryPath:z.string(),logicalPath:z.string(),name:z.string(),nodeId:z.string(),owner:agentSourceOwnerSchema,parentNodeId:z.string(),rootPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),exportName:z.string().optional()},compiledDynamicSubagentDefinitionSchema=z.object({build:compiledAgentBuildDefinitionSchema.optional(),eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),logicalPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledSubagentNodeSchema=z.union([z.object({...compiledSubagentNodeBaseFields,agent:compiledAgentNodeManifestSchema,description:z.string()}).strict(),z.object({...compiledSubagentNodeBaseFields,agent:compiledAgentResourcesSchema,configResolver:compiledDynamicSubagentDefinitionSchema}).strict()]),compiledAgentManifestSchema=z.object({agentRoot:z.string(),appRoot:z.string(),bindings:z.record(z.string(),compiledModuleBindingSchema),extensionMounts:z.array(compiledExtensionMountSchema).default([]),channelRoutes:compiledChannelRoutePlanSchema,config:compiledAgentConfigSchema,connections:z.array(compiledConnectionDefinitionSchema),dynamicConnections:z.array(compiledDynamicConnectionDefinitionSchema).default([]),diagnosticsSummary:discoverDiagnosticsSummarySchema,sourceComposition:agentSourceCompositionSchema,dynamicInstructions:z.array(compiledDynamicInstructionsDefinitionSchema).default([]),dynamicSkills:z.array(compiledDynamicSkillDefinitionSchema).default([]),dynamicTools:z.array(compiledDynamicToolDefinitionSchema).default([]),hooks:z.array(compiledHookDefinitionSchema),memories:z.array(compiledMemoryDefinitionSchema).default([]),kind:z.literal(COMPILED_AGENT_MANIFEST_KIND),remoteAgents:z.array(compiledRemoteAgentNodeSchema),sandbox:compiledSandboxDefinitionSchema,sandboxWorkspaces:z.array(compiledSandboxWorkspaceSchema),schedules:z.array(compiledScheduleDefinitionSchema),scheduleCollections:z.array(compiledScheduleCollectionDefinitionSchema).default([]),skills:z.array(compiledSkillSourceSchema).readonly(),subagents:z.array(compiledSubagentNodeSchema),instructions:z.array(compiledInstructionsSchema).readonly().default([]),tools:z.array(compiledToolDefinitionSchema),version:z.literal(54),workspaceResourceRoot:compiledWorkspaceResourceRootSchema}).strict();function createCompiledAgentResources(e){return{agentRoot:e.agentRoot,appRoot:e.appRoot,bindings:{...e.bindings},channelRoutes:{effective:[...e.channelRoutes.effective],preflight:[...e.channelRoutes.preflight],shadowed:[...e.channelRoutes.shadowed]},connections:[...e.connections??[]],dynamicConnections:[...e.dynamicConnections??[]],diagnosticsSummary:e.diagnosticsSummary??{errors:0,warnings:0},sourceComposition:{entries:[...e.sourceComposition.entries]},dynamicInstructions:[...e.dynamicInstructions??[]],dynamicSkills:[...e.dynamicSkills??[]],dynamicTools:[...e.dynamicTools??[]],extensionMounts:[...e.extensionMounts??[]],hooks:[...e.hooks??[]],memories:[...e.memories??[]],instructions:[...e.instructions??[]],remoteAgents:[...e.remoteAgents??[]],sandbox:e.sandbox,sandboxWorkspaces:[...e.sandboxWorkspaces??[]],schedules:[...e.schedules??[]],scheduleCollections:[...e.scheduleCollections??[]],skills:[...e.skills??[]],tools:[...e.tools??[]],workspaceResourceRoot:e.workspaceResourceRoot??{logicalPath:``,rootEntries:deriveResourceRootEntries({sandboxWorkspaces:e.sandboxWorkspaces,skills:e.skills})}}}function createCompiledAgentNodeManifest(e){let t={...createCompiledAgentResources(e),config:cloneCompiledAgentDefinition(e.config)};return validateCompiledAgentResources(t,{allowUnknownResourceWinners:!0}),t}function cloneCompiledAgentDefinition(e){let t={build:e.build===void 0?void 0:{externalDependencies:e.build.externalDependencies===void 0?void 0:[...e.build.externalDependencies]},compaction:{model:e.compaction?.model===void 0?void 0:cloneCompiledRuntimeModelReference(e.compaction.model),thresholdPercent:e.compaction?.thresholdPercent},defaultTools:e.defaultTools,description:e.description,experimental:e.experimental===void 0?void 0:{workflow:e.experimental.workflow===void 0?void 0:{modelCallsPerStep:e.experimental.workflow.modelCallsPerStep,retention:e.experimental.workflow.retention,world:e.experimental.workflow.world}},name:e.name,reasoning:e.reasoning,limits:e.limits===void 0?void 0:{maxInputTokensPerSession:e.limits.maxInputTokensPerSession,maxOutputTokensPerSession:e.limits.maxOutputTokensPerSession,maxTokenCostUsdPerSession:e.limits.maxTokenCostUsdPerSession,sessionTimeoutMs:e.limits.sessionTimeoutMs},source:{...e.source},tool:e.tool};return e.dynamicModel===void 0?{...t,model:cloneCompiledRuntimeModelReference(e.model)}:{...t,dynamicModel:{...e.dynamicModel}}}function deriveResourceRootEntries(e){let t=new Set;for(let n of e.sandboxWorkspaces??[])for(let e of n.rootEntries)t.add(e);return[...t].sort((e,t)=>e.localeCompare(t))}function createCompiledSubagentNodeId(e,t){return e===`__root__`?t:`${e}::${t}`}function createCompiledAgentManifest(e){let t={...createCompiledAgentNodeManifest(e),kind:COMPILED_AGENT_MANIFEST_KIND,extensionMounts:[...e.extensionMounts??[]],subagents:[...e.subagents??[]],version:54};return validateCompiledAgentManifest(t),t}function cloneCompiledRuntimeModelReference(e){let t={id:e.id,routing:cloneModelRouting(e.routing)};return e.contextWindowTokens!==void 0&&(t.contextWindowTokens=e.contextWindowTokens),e.maxOutputTokens!==void 0&&(t.maxOutputTokens=e.maxOutputTokens),e.providerOptions!==void 0&&(t.providerOptions={...e.providerOptions}),e.promptCache!==void 0&&(t.promptCache=structuredClone(e.promptCache)),e.source!==void 0&&(t.source={...e.source}),t}function cloneModelRouting(e){return e.kind===`external`?{kind:`external`,provider:e.provider}:e.byok===void 0?{kind:`gateway`,target:e.target}:{kind:`gateway`,target:e.target,byok:e.byok}}export{COMPILED_AGENT_MANIFEST_KIND,COMPILED_AGENT_MANIFEST_VERSION,ROOT_COMPILED_AGENT_NODE_ID,compiledAgentManifestSchema,createCompiledAgentManifest,createCompiledAgentNodeManifest,createCompiledAgentResources,createCompiledSubagentNodeId,deriveResourceRootEntries};
1
+ import{z}from"#compiled/zod/index.js";import{mountIdSchema}from"#shared/extension-mount.js";import{discoverDiagnosticsSummarySchema}from"#discover/diagnostics.js";import{compiledRemoteAgentNodeSchema}from"#compiler/remote-agent-node.js";import{jsonObjectSchema}from"#shared/json-schemas.js";import{WEB_SEARCH_FALLBACK_PROVIDERS,WEB_SEARCH_PROVIDERS}from"#shared/web-search.js";import{AGENT_WORKFLOW_RETENTION_VALUES,ANTHROPIC_PROMPT_CACHE_TTLS}from"#shared/agent-definition.js";import{validateCompiledAgentManifest,validateCompiledAgentResources}from"#compiler/validate-artifact.js";const COMPILED_AGENT_MANIFEST_KIND=`eve-agent-compiled-manifest`,ROOT_COMPILED_AGENT_NODE_ID=`__root__`,COMPILED_AGENT_MANIFEST_VERSION=54,agentSourceOwnerSchema=z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`application`)}).strict(),z.object({feature:z.string().min(1),kind:z.literal(`framework`)}).strict(),z.object({kind:z.literal(`extension`),mountId:mountIdSchema,namespace:z.string().min(1),packageName:z.string().min(1)}).strict()]),moduleSourceRefSchema=z.object({exportName:z.string().optional(),sourceKind:z.literal(`module`),logicalPath:z.string(),sourceId:z.string()}).strict(),filesystemModuleBackingSchema=z.object({externalDependencies:z.array(z.string()).readonly(),extensionScope:z.object({namespace:z.string(),sourceRoot:z.string()}).strict().optional(),mountId:z.string().optional(),kind:z.literal(`filesystem`),sourcePath:z.string()}).strict(),programmaticModuleBackingSchema=z.object({dependencies:z.record(z.string(),z.string()).readonly().optional(),kind:z.literal(`programmatic`),mountId:z.string().optional(),moduleId:z.string(),parameters:jsonObjectSchema.optional(),registryId:z.string(),revision:z.string(),semanticRevision:z.string().optional()}).strict(),resourceSourceBackingSchema=z.object({kind:z.literal(`resource`),sourcePath:z.string()}).strict(),agentModuleBackingSchema=z.discriminatedUnion(`kind`,[filesystemModuleBackingSchema,programmaticModuleBackingSchema]),compiledModuleBindingSchema=z.object({backing:agentModuleBackingSchema,logicalPath:z.string(),owner:agentSourceOwnerSchema,usage:z.object({compile:z.boolean(),runtimeEntry:z.boolean()}).strict()}).strict(),agentSourceDescriptorSchema=z.object({backing:z.discriminatedUnion(`kind`,[filesystemModuleBackingSchema,programmaticModuleBackingSchema,resourceSourceBackingSchema]),form:z.enum([`derived`,`direct`]),layer:z.enum([`framework-default`,`extension-package`,`extension-override`,`application`]),logicalPath:z.string(),owner:agentSourceOwnerSchema,sourceId:z.string()}).strict(),agentSourceCompositionSchema=z.object({entries:z.array(z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`shadowed`),source:agentSourceDescriptorSchema,winnerSourceId:z.string()}).strict(),z.object({kind:z.literal(`disabled`),source:agentSourceDescriptorSchema}).strict()])).readonly()}).strict(),compiledDynamicModelDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),sourceKind:z.literal(`module`),logicalPath:z.string(),sourceId:z.string()}).strict(),channelMethodSchema=z.union([z.literal(`GET`),z.literal(`HEAD`),z.literal(`POST`),z.literal(`PUT`),z.literal(`PATCH`),z.literal(`DELETE`),z.literal(`OPTIONS`),z.literal(`WEBSOCKET`)]),compiledChannelCorsSchema=z.object({origin:z.union([z.literal(`*`),z.literal(`null`),z.array(z.string())]).optional(),methods:z.union([z.literal(`*`),z.array(z.string())]).optional(),allowHeaders:z.union([z.literal(`*`),z.array(z.string())]).optional(),exposeHeaders:z.union([z.literal(`*`),z.array(z.string())]).optional(),credentials:z.boolean().optional(),maxAge:z.union([z.string(),z.literal(!1)]).optional(),preflight:z.object({statusCode:z.number().int().min(100).max(599).optional()}).strict().optional()}).strict(),compiledVercelConnectMetadataSchema=z.object({connector:z.string(),requirement:z.object({method:z.string().optional(),reference:z.string(),service:z.string(),subjectTypes:z.array(z.enum([`app`,`user`])).readonly()}).strict().optional()}).strict(),compiledChannelDefinitionSchema=z.object({kind:z.literal(`channel`),name:z.string(),logicalPath:z.string(),method:channelMethodSchema,urlPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),exportName:z.string().optional(),adapterKind:z.string().optional(),cors:compiledChannelCorsSchema.optional(),manifest:jsonObjectSchema.optional(),vercelConnect:compiledVercelConnectMetadataSchema.optional()}).strict(),compiledChannelPreflightDefinitionSchema=z.object({cors:compiledChannelCorsSchema,method:z.literal(`OPTIONS`),sourceIds:z.array(z.string()).readonly(),urlPath:z.string()}).strict(),compiledShadowedChannelRouteSchema=z.object({method:channelMethodSchema,source:agentSourceDescriptorSchema,urlPath:z.string(),winnerSourceId:z.string()}).strict(),compiledChannelRoutePlanSchema=z.object({effective:z.array(compiledChannelDefinitionSchema).readonly(),preflight:z.array(compiledChannelPreflightDefinitionSchema).readonly(),shadowed:z.array(compiledShadowedChannelRouteSchema).readonly()}).strict(),modelRoutingSchema=z.union([z.object({kind:z.literal(`gateway`),target:z.string(),byok:z.string().optional()}).strict(),z.object({kind:z.literal(`external`),provider:z.string()}).strict()]),compiledRuntimeModelReferenceSchema=z.object({contextWindowTokens:z.number().int().positive().optional(),id:z.string(),maxOutputTokens:z.number().int().positive().optional(),source:moduleSourceRefSchema.optional(),promptCache:z.object({anthropic:z.object({ttl:z.literal(ANTHROPIC_PROMPT_CACHE_TTLS).optional()}).strict().optional()}).strict().optional(),providerOptions:z.record(z.string(),jsonObjectSchema).optional(),routing:modelRoutingSchema}).strict(),compiledAgentBuildDefinitionSchema=z.object({externalDependencies:z.array(z.string()).optional()}).strict(),compiledAgentWorkflowWorldDefinitionSchema=z.string(),compiledAgentWorkflowDefinitionSchema=z.object({modelCallsPerStep:z.number().int().positive().optional(),retention:z.literal(AGENT_WORKFLOW_RETENTION_VALUES).optional(),world:compiledAgentWorkflowWorldDefinitionSchema.optional()}).strict(),compiledAgentCompactionDefinitionSchema=z.object({model:compiledRuntimeModelReferenceSchema.optional(),thresholdPercent:z.number().finite().min(0).max(1).optional()}).strict(),sessionTimeoutSchema=z.union([z.number().int().positive(),z.literal(!1)]),compiledAgentLimitsDefinitionSchema=z.object({sessionTimeoutMs:sessionTimeoutSchema.optional(),sessionUsage:z.literal(!0).optional()}).strict(),compiledAgentConfigBaseFields={build:compiledAgentBuildDefinitionSchema.optional(),compaction:compiledAgentCompactionDefinitionSchema.optional(),defaultTools:z.boolean().optional(),description:z.string().optional(),experimental:z.object({workflow:compiledAgentWorkflowDefinitionSchema.optional()}).strict().optional(),name:z.string(),reasoning:z.enum([`provider-default`,`none`,`minimal`,`low`,`medium`,`high`,`xhigh`]).optional(),source:moduleSourceRefSchema,tool:z.union([z.boolean(),z.literal(`deferred`)]).optional(),limits:compiledAgentLimitsDefinitionSchema.optional()},compiledAgentConfigSchema=z.union([z.object({...compiledAgentConfigBaseFields,model:compiledRuntimeModelReferenceSchema}).strict(),z.object({...compiledAgentConfigBaseFields,dynamicModel:compiledDynamicModelDefinitionSchema}).strict()]),compiledInstructionsBaseFields={content:z.string(),name:z.string(),logicalPath:z.string(),role:z.enum([`system`,`user`]),sourceId:z.string()},compiledInstructionsSchema=z.discriminatedUnion(`sourceKind`,[z.object({...compiledInstructionsBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`markdown`)}).strict(),z.object({...compiledInstructionsBaseFields,sourceKind:z.literal(`module`)}).strict()]),compiledSkillBaseFields={name:z.string(),deferred:z.boolean().optional(),description:z.string(),license:z.string().optional(),markdown:z.string(),metadata:z.record(z.string(),z.string()).optional(),sourceId:z.string(),logicalPath:z.string()},compiledSkillSourceSchema=z.discriminatedUnion(`sourceKind`,[z.object({...compiledSkillBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`markdown`)}).strict(),z.object({...compiledSkillBaseFields,sourceKind:z.literal(`module`),exportName:z.string().optional()}).strict(),z.object({...compiledSkillBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`skill-package`),skillId:z.string(),skillFilePath:z.string(),rootPath:z.string(),assetsPath:z.string().optional(),referencesPath:z.string().optional(),scriptsPath:z.string().optional()}).strict()]),compiledScheduleBaseFields={cron:z.string(),hasRun:z.boolean(),name:z.string(),logicalPath:z.string(),markdown:z.string().optional(),sourceId:z.string()},compiledScheduleDefinitionSchema=z.discriminatedUnion(`sourceKind`,[z.object({...compiledScheduleBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`markdown`)}).strict(),z.object({...compiledScheduleBaseFields,sourceKind:z.literal(`module`)}).strict()]),compiledScheduleCollectionDefinitionSchema=z.object({description:z.string().optional(),logicalPath:z.string(),name:z.string(),providerKind:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),tools:z.union([z.boolean(),z.literal(`deferred`)]).optional()}).strict(),compiledSandboxDefinitionSchema=z.object({providerName:z.string().optional(),environmentExportName:z.string().optional(),inheritsParent:z.boolean().optional(),exportName:z.string().optional(),logicalPath:z.string(),revisionHash:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledSandboxWorkspaceSchema=z.object({logicalPath:z.string(),rootEntries:z.array(z.string()).readonly(),sourceId:z.string(),sourcePath:z.string()}).strict(),compiledWorkspaceResourceRootSchema=z.object({contentHash:z.string().optional(),logicalPath:z.string(),rootEntries:z.array(z.string()).readonly()}).strict(),compiledConnectionDefinitionSchema=z.object({experimental_events:z.literal(!0).optional(),connectionName:z.string(),description:z.string(),exportName:z.string().optional(),logicalPath:z.string(),protocol:z.enum([`mcp`,`openapi`]).default(`mcp`),sourceId:z.string(),sourceKind:z.literal(`module`),url:z.string(),vercelConnect:compiledVercelConnectMetadataSchema.optional()}).strict(),compiledDynamicConnectionDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),extensionNamespace:z.string().optional(),logicalPath:z.string(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledToolBehaviorSchema=z.object({availability:z.array(z.literal(`root-session`)).readonly(),handling:z.discriminatedUnion(`kind`,[z.object({action:z.literal(`self-agent`),kind:z.literal(`dispatch`)}).strict(),z.object({fallback:z.enum(WEB_SEARCH_FALLBACK_PROVIDERS).optional(),kind:z.literal(`provider-tool`),provider:z.enum(WEB_SEARCH_PROVIDERS)}).strict(),z.object({entryPoint:z.enum([`execute`,`task`,`serve`]),kind:z.literal(`workflow-tool`),workflowId:z.string()}).strict()]).optional(),shape:z.object({suspend:z.enum([`none`,`workflow`])}).strict().optional()}).strict(),compiledToolDefinitionSchema=z.object({availableInSubagents:z.boolean().optional(),behavior:compiledToolBehaviorSchema.optional(),deferred:z.boolean().optional(),description:z.string(),exportName:z.string().optional(),hasExecute:z.boolean(),hasModelOutputProjection:z.boolean(),inputSchema:jsonObjectSchema.nullable(),logicalPath:z.string(),modelInputSchema:jsonObjectSchema.optional(),name:z.string(),outputSchema:jsonObjectSchema.optional(),requiresApproval:z.boolean(),sourceId:z.string(),sourceKind:z.literal(`module`),workflowProgram:z.object({maxSubagents:z.number().int().positive()}).strict().optional()}).strict(),compiledDynamicToolDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),extensionNamespace:z.string().optional(),logicalPath:z.string(),rebindMissingCallbacks:z.boolean().optional(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledMemoryDefinitionSchema=z.object({description:z.string().optional(),exportName:z.string().optional(),logicalPath:z.string(),slot:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),visibility:z.enum([`scope`,`session`])}).strict(),compiledDynamicSkillDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),extensionNamespace:z.string().optional(),logicalPath:z.string(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledDynamicInstructionsDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),logicalPath:z.string(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledHookDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),logicalPath:z.string(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledExtensionMountSchema=z.object({externalDependencies:z.array(z.string()).readonly(),namespace:z.string(),packageName:z.string(),specifier:z.string(),mountId:mountIdSchema,sourceRoot:z.string(),mountSourceId:z.string(),mountSourcePath:z.string(),mountLogicalPath:z.string(),programmaticImport:z.object({specifier:z.string(),entryPath:z.string(),config:jsonObjectSchema}).strict().optional()}).strict(),compiledAgentResourceFields={agentRoot:z.string(),appRoot:z.string(),bindings:z.record(z.string(),compiledModuleBindingSchema),channelRoutes:compiledChannelRoutePlanSchema,connections:z.array(compiledConnectionDefinitionSchema),dynamicConnections:z.array(compiledDynamicConnectionDefinitionSchema).default([]),diagnosticsSummary:discoverDiagnosticsSummarySchema,sourceComposition:agentSourceCompositionSchema,dynamicInstructions:z.array(compiledDynamicInstructionsDefinitionSchema).default([]),dynamicSkills:z.array(compiledDynamicSkillDefinitionSchema).default([]),dynamicTools:z.array(compiledDynamicToolDefinitionSchema).default([]),extensionMounts:z.array(compiledExtensionMountSchema).default([]),hooks:z.array(compiledHookDefinitionSchema),memories:z.array(compiledMemoryDefinitionSchema).default([]),sandbox:compiledSandboxDefinitionSchema,sandboxWorkspaces:z.array(compiledSandboxWorkspaceSchema),schedules:z.array(compiledScheduleDefinitionSchema),scheduleCollections:z.array(compiledScheduleCollectionDefinitionSchema).default([]),remoteAgents:z.array(compiledRemoteAgentNodeSchema),skills:z.array(compiledSkillSourceSchema).readonly(),instructions:z.array(compiledInstructionsSchema).readonly().default([]),tools:z.array(compiledToolDefinitionSchema),workspaceResourceRoot:compiledWorkspaceResourceRootSchema},compiledAgentResourcesSchema=z.object(compiledAgentResourceFields).strict(),compiledAgentNodeManifestSchema=z.object({...compiledAgentResourceFields,config:compiledAgentConfigSchema}).strict(),compiledSubagentNodeBaseFields={backing:resourceSourceBackingSchema,entryPath:z.string(),logicalPath:z.string(),name:z.string(),nodeId:z.string(),owner:agentSourceOwnerSchema,parentNodeId:z.string(),rootPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),exportName:z.string().optional()},compiledDynamicSubagentDefinitionSchema=z.object({build:compiledAgentBuildDefinitionSchema.optional(),eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),logicalPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledSubagentNodeSchema=z.union([z.object({...compiledSubagentNodeBaseFields,agent:compiledAgentNodeManifestSchema,description:z.string()}).strict(),z.object({...compiledSubagentNodeBaseFields,agent:compiledAgentResourcesSchema,configResolver:compiledDynamicSubagentDefinitionSchema}).strict()]),compiledAgentManifestSchema=z.object({agentRoot:z.string(),appRoot:z.string(),bindings:z.record(z.string(),compiledModuleBindingSchema),extensionMounts:z.array(compiledExtensionMountSchema).default([]),channelRoutes:compiledChannelRoutePlanSchema,config:compiledAgentConfigSchema,connections:z.array(compiledConnectionDefinitionSchema),dynamicConnections:z.array(compiledDynamicConnectionDefinitionSchema).default([]),diagnosticsSummary:discoverDiagnosticsSummarySchema,sourceComposition:agentSourceCompositionSchema,dynamicInstructions:z.array(compiledDynamicInstructionsDefinitionSchema).default([]),dynamicSkills:z.array(compiledDynamicSkillDefinitionSchema).default([]),dynamicTools:z.array(compiledDynamicToolDefinitionSchema).default([]),hooks:z.array(compiledHookDefinitionSchema),memories:z.array(compiledMemoryDefinitionSchema).default([]),kind:z.literal(COMPILED_AGENT_MANIFEST_KIND),remoteAgents:z.array(compiledRemoteAgentNodeSchema),sandbox:compiledSandboxDefinitionSchema,sandboxWorkspaces:z.array(compiledSandboxWorkspaceSchema),schedules:z.array(compiledScheduleDefinitionSchema),scheduleCollections:z.array(compiledScheduleCollectionDefinitionSchema).default([]),skills:z.array(compiledSkillSourceSchema).readonly(),subagents:z.array(compiledSubagentNodeSchema),instructions:z.array(compiledInstructionsSchema).readonly().default([]),tools:z.array(compiledToolDefinitionSchema),version:z.literal(54),workspaceResourceRoot:compiledWorkspaceResourceRootSchema}).strict();function createCompiledAgentResources(e){return{agentRoot:e.agentRoot,appRoot:e.appRoot,bindings:{...e.bindings},channelRoutes:{effective:[...e.channelRoutes.effective],preflight:[...e.channelRoutes.preflight],shadowed:[...e.channelRoutes.shadowed]},connections:[...e.connections??[]],dynamicConnections:[...e.dynamicConnections??[]],diagnosticsSummary:e.diagnosticsSummary??{errors:0,warnings:0},sourceComposition:{entries:[...e.sourceComposition.entries]},dynamicInstructions:[...e.dynamicInstructions??[]],dynamicSkills:[...e.dynamicSkills??[]],dynamicTools:[...e.dynamicTools??[]],extensionMounts:[...e.extensionMounts??[]],hooks:[...e.hooks??[]],memories:[...e.memories??[]],instructions:[...e.instructions??[]],remoteAgents:[...e.remoteAgents??[]],sandbox:e.sandbox,sandboxWorkspaces:[...e.sandboxWorkspaces??[]],schedules:[...e.schedules??[]],scheduleCollections:[...e.scheduleCollections??[]],skills:[...e.skills??[]],tools:[...e.tools??[]],workspaceResourceRoot:e.workspaceResourceRoot??{logicalPath:``,rootEntries:deriveResourceRootEntries({sandboxWorkspaces:e.sandboxWorkspaces,skills:e.skills})}}}function createCompiledAgentNodeManifest(e){let t={...createCompiledAgentResources(e),config:cloneCompiledAgentDefinition(e.config)};return validateCompiledAgentResources(t,{allowUnknownResourceWinners:!0}),t}function cloneCompiledAgentDefinition(e){let t={build:e.build===void 0?void 0:{externalDependencies:e.build.externalDependencies===void 0?void 0:[...e.build.externalDependencies]},compaction:{model:e.compaction?.model===void 0?void 0:cloneCompiledRuntimeModelReference(e.compaction.model),thresholdPercent:e.compaction?.thresholdPercent},defaultTools:e.defaultTools,description:e.description,experimental:e.experimental===void 0?void 0:{workflow:e.experimental.workflow===void 0?void 0:{modelCallsPerStep:e.experimental.workflow.modelCallsPerStep,retention:e.experimental.workflow.retention,world:e.experimental.workflow.world}},name:e.name,reasoning:e.reasoning,limits:e.limits===void 0?void 0:{sessionTimeoutMs:e.limits.sessionTimeoutMs,sessionUsage:e.limits.sessionUsage},source:{...e.source},tool:e.tool};return e.dynamicModel===void 0?{...t,model:cloneCompiledRuntimeModelReference(e.model)}:{...t,dynamicModel:{...e.dynamicModel}}}function deriveResourceRootEntries(e){let t=new Set;for(let n of e.sandboxWorkspaces??[])for(let e of n.rootEntries)t.add(e);return[...t].sort((e,t)=>e.localeCompare(t))}function createCompiledSubagentNodeId(e,t){return e===`__root__`?t:`${e}::${t}`}function createCompiledAgentManifest(e){let t={...createCompiledAgentNodeManifest(e),kind:COMPILED_AGENT_MANIFEST_KIND,extensionMounts:[...e.extensionMounts??[]],subagents:[...e.subagents??[]],version:54};return validateCompiledAgentManifest(t),t}function cloneCompiledRuntimeModelReference(e){let t={id:e.id,routing:cloneModelRouting(e.routing)};return e.contextWindowTokens!==void 0&&(t.contextWindowTokens=e.contextWindowTokens),e.maxOutputTokens!==void 0&&(t.maxOutputTokens=e.maxOutputTokens),e.providerOptions!==void 0&&(t.providerOptions={...e.providerOptions}),e.promptCache!==void 0&&(t.promptCache=structuredClone(e.promptCache)),e.source!==void 0&&(t.source={...e.source}),t}function cloneModelRouting(e){return e.kind===`external`?{kind:`external`,provider:e.provider}:e.byok===void 0?{kind:`gateway`,target:e.target}:{kind:`gateway`,target:e.target,byok:e.byok}}export{COMPILED_AGENT_MANIFEST_KIND,COMPILED_AGENT_MANIFEST_VERSION,ROOT_COMPILED_AGENT_NODE_ID,compiledAgentManifestSchema,createCompiledAgentManifest,createCompiledAgentNodeManifest,createCompiledAgentResources,createCompiledSubagentNodeId,deriveResourceRootEntries};
@@ -5,7 +5,7 @@ import { createCompiledBindingNamespaceLoader, type CompiledBindingNamespaceLoad
5
5
  export declare class NodeModuleEvaluationContext {
6
6
  #private;
7
7
  readonly loadNamespace: CompiledBindingNamespaceLoader;
8
- constructor(registries: readonly AgentSourceRegistry[], mountSourceId?: (binding: AgentModuleBinding) => string | undefined, mounts?: Parameters<typeof createCompiledBindingNamespaceLoader>[0]["mounts"], evaluationId?: string, appRoot?: string);
8
+ constructor(registries: readonly AgentSourceRegistry[], mountSourceId?: (binding: AgentModuleBinding) => string | undefined, mounts?: Parameters<typeof createCompiledBindingNamespaceLoader>[0]["mounts"], evaluationId?: string, appRoot?: string, graph?: Parameters<typeof createCompiledBindingNamespaceLoader>[0]["graph"]);
9
9
  setBindings(bindings: Readonly<Record<string, AgentModuleBinding>>): void;
10
10
  requireRuntimeEntry(sourceId: string): void;
11
11
  finalizeBindings(): Record<string, CompiledModuleBinding>;
@@ -1 +1 @@
1
- import{createCompiledBindingNamespaceLoader}from"#compiler/load-binding-namespace.js";var NodeModuleEvaluationContext=class{#e={};#t=new NodeModuleLifecycle;loadNamespace;constructor(e,t,n,r,i){this.loadNamespace=createCompiledBindingNamespaceLoader({appRoot:i,mountSourceId:t,mounts:n,evaluationId:r,onLoad:e=>this.#t.recordCompileLoad(e),registries:e,resolveBinding:e=>this.#e[e]})}setBindings(e){this.#e=e}requireRuntimeEntry(e){this.#t.requireRuntimeEntry(e)}finalizeBindings(){return this.#t.finalize(this.#e)}};function markConfigRuntimeEntries(e,t){let n=[e.dynamicModel,e.model?.source,e.compaction?.model?.source];for(let e of n)e!==void 0&&t.requireRuntimeEntry(e.sourceId)}var NodeModuleLifecycle=class{#e=new Set;#t=new Set;recordCompileLoad(e){this.#e.add(e)}requireRuntimeEntry(e){this.#t.add(e)}finalize(e){let t=collectRuntimeEntryClosure(e,this.#t),n={};for(let[r,i]of Object.entries(e)){let e={compile:this.#e.has(r),runtimeEntry:t.has(r)};if(!e.compile&&!e.runtimeEntry)throw Error(`Selected module binding "${r}" has no compile or runtime usage.`);n[r]=Object.freeze({...i,usage:Object.freeze(e)})}return n}};function collectRuntimeEntryClosure(e,t){let n=new Set,r=new Set,visit=t=>{if(n.has(t))return;if(r.has(t))throw Error(`Compiled module dependency cycle includes "${t}".`);let i=e[t];if(i===void 0)throw Error(`Runtime module entry "${t}" has no selected binding.`);if(r.add(t),i.backing.kind===`programmatic`)for(let e of Object.values(i.backing.dependencies??{}))visit(e);r.delete(t),n.add(t)};for(let e of t)visit(e);return n}export{NodeModuleEvaluationContext,markConfigRuntimeEntries};
1
+ import{createCompiledBindingNamespaceLoader}from"#compiler/load-binding-namespace.js";var NodeModuleEvaluationContext=class{#e={};#t=new NodeModuleLifecycle;loadNamespace;constructor(e,t,n,r,i,a){this.loadNamespace=createCompiledBindingNamespaceLoader({appRoot:i,graph:a,mountSourceId:t,mounts:n,evaluationId:r,onLoad:e=>this.#t.recordCompileLoad(e),registries:e,resolveBinding:e=>this.#e[e]})}setBindings(e){this.#e=e}requireRuntimeEntry(e){this.#t.requireRuntimeEntry(e)}finalizeBindings(){return this.#t.finalize(this.#e)}};function markConfigRuntimeEntries(e,t){let n=[e.dynamicModel,e.model?.source,e.compaction?.model?.source,e.limits?.sessionUsage===!0?e.source:void 0];for(let e of n)e!==void 0&&t.requireRuntimeEntry(e.sourceId)}var NodeModuleLifecycle=class{#e=new Set;#t=new Set;recordCompileLoad(e){this.#e.add(e)}requireRuntimeEntry(e){this.#t.add(e)}finalize(e){let t=collectRuntimeEntryClosure(e,this.#t),n={};for(let[r,i]of Object.entries(e)){let e={compile:this.#e.has(r),runtimeEntry:t.has(r)};if(!e.compile&&!e.runtimeEntry)throw Error(`Selected module binding "${r}" has no compile or runtime usage.`);n[r]=Object.freeze({...i,usage:Object.freeze(e)})}return n}};function collectRuntimeEntryClosure(e,t){let n=new Set,r=new Set,visit=t=>{if(n.has(t))return;if(r.has(t))throw Error(`Compiled module dependency cycle includes "${t}".`);let i=e[t];if(i===void 0)throw Error(`Runtime module entry "${t}" has no selected binding.`);if(r.add(t),i.backing.kind===`programmatic`)for(let e of Object.values(i.backing.dependencies??{}))visit(e);r.delete(t),n.add(t)};for(let e of t)visit(e);return n}export{NodeModuleEvaluationContext,markConfigRuntimeEntries};
@@ -1,4 +1,4 @@
1
- import{z}from"#compiled/zod/index.js";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import"#compiler/source-graph.js";import{createCompiledBindingNamespaceLoader,resolveExtensionBindingMountId}from"#compiler/load-binding-namespace.js";import{bindingMountId}from"#compiler/extension-mount-bindings.js";import{normalizeEsmImportSpecifier}from"#internal/application/import-specifier.js";const compiledModuleNodeScopeSchema=z.object({modules:z.record(z.string(),z.object({}).passthrough())}).strict(),compiledModuleMapSchema=z.object({nodes:z.record(z.string(),compiledModuleNodeScopeSchema)}).strict();function createCompiledModuleMapSource(e){let t=dirnameFilesystemPath(e.moduleMapPath),n=e.importSpecifierStyle??`relative`,r=0,i=!1,a=collectBoundNodeScopes(e.manifest).map(e=>{let a=new Map(e.mounts.map(e=>[e.mountSourceId,e])),o=new Map(e.mounts.map(e=>[e.mountId,e.mountSourceId])),s=new Map(e.modules.map(e=>[e.sourceId,`module_${r++}`]));return{modules:orderBoundModules(e.modules,e=>o.get(bindingMountId(e)??``)).map(({binding:e,sourceId:r})=>{let o=s.get(r);if(e.backing.kind===`filesystem`){let i=createImportSpecifier({fromDirectory:t,importSpecifierStyle:n,targetPath:e.backing.sourcePath})+(bindingMountId(e)===void 0?``:`?eve-mount=${encodeURIComponent(bindingMountId(e))}`),s=bindingMountId(e)!==void 0&&!a.has(r);return{bindingName:o,importSpecifier:s?void 0:i,initializer:`memoizeModuleNamespaceFactories(${s?`await import(${JSON.stringify(i)})`:`imported_${o}`})`,sourceId:r}}let c=a.get(r);if(c?.programmaticImport!==void 0){let e=`${c.programmaticImport.specifier}?eve-mount=${encodeURIComponent(c.mountId)}`;return{bindingName:o,initializer:`memoizeModuleNamespaceFactories({ default: (await import(${JSON.stringify(e)})).default(${JSON.stringify(c.programmaticImport.config)}) })`,sourceId:r}}return i=!0,{bindingName:o,initializer:`await loadProgrammaticModule(${JSON.stringify(e.backing)}, ${renderProgrammaticDependencies(e.backing.dependencies,s)})`,sourceId:r}}),nodeId:e.nodeId}}),o=a.flatMap(e=>e.modules),s=o.flatMap(e=>e.importSpecifier===void 0?[]:[`import * as imported_${e.bindingName} from ${JSON.stringify(e.importSpecifier)};`]),c=o.flatMap(e=>e.initializer===void 0?[]:[`const ${e.bindingName} = ${e.initializer};`]);return[`// Generated by eve. Do not edit by hand.`,...i||o.length>0?[`import { loadFrameworkProgrammaticModule as loadProgrammaticModule, memoizeModuleNamespaceFactories } from ${JSON.stringify(normalizeEsmImportSpecifier(e.programmaticLoaderImportSpecifier??`eve/internal/programmatic-source-loader`))};`]:[],...s,...i||o.length>0?[``]:[],...c,...c.length>0?[``]:[],`export const moduleMap = ${renderModuleMap(a)};`,``,`export default moduleMap;`,``].join(`
1
+ import{z}from"#compiled/zod/index.js";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import"#compiler/source-graph.js";import{createCompiledBindingNamespaceLoader,resolveExtensionBindingMountId}from"#compiler/load-binding-namespace.js";import{bindingMountId}from"#compiler/extension-mount-bindings.js";import{normalizeEsmImportSpecifier}from"#internal/application/import-specifier.js";const compiledModuleNodeScopeSchema=z.object({modules:z.record(z.string(),z.object({}).passthrough())}).strict(),compiledModuleMapSchema=z.object({nodes:z.record(z.string(),compiledModuleNodeScopeSchema)}).strict();function createCompiledModuleMapSource(e){let t=dirnameFilesystemPath(e.moduleMapPath),n=e.importSpecifierStyle??`relative`,r=0,i=!1,a=collectBoundNodeScopes(e.manifest).map(e=>{let a=new Map(e.mounts.map(e=>[e.mountSourceId,e])),o=new Map(e.mounts.map(e=>[e.mountId,e.mountSourceId])),s=new Map(e.modules.map(e=>[e.sourceId,`module_${r++}`]));return{modules:orderBoundModules(e.modules,e=>o.get(bindingMountId(e)??``)).map(({binding:e,sourceId:r})=>{let o=s.get(r);if(e.backing.kind===`filesystem`){let i=createImportSpecifier({fromDirectory:t,importSpecifierStyle:n,targetPath:e.backing.sourcePath})+(bindingMountId(e)===void 0?``:`?eve-mount=${encodeURIComponent(bindingMountId(e))}`),s=bindingMountId(e)!==void 0&&!a.has(r);return{bindingName:o,importSpecifier:s?void 0:i,initializer:`memoizeModuleNamespaceFactories(interopAuthoredModuleNamespace(${s?`await import(${JSON.stringify(i)})`:`imported_${o}`}))`,sourceId:r}}let c=a.get(r);if(c?.programmaticImport!==void 0){let e=`${c.programmaticImport.specifier}?eve-mount=${encodeURIComponent(c.mountId)}`;return{bindingName:o,initializer:`memoizeModuleNamespaceFactories({ default: (await import(${JSON.stringify(e)})).default(${JSON.stringify(c.programmaticImport.config)}) })`,sourceId:r}}return i=!0,{bindingName:o,initializer:`await loadProgrammaticModule(${JSON.stringify(e.backing)}, ${renderProgrammaticDependencies(e.backing.dependencies,s)})`,sourceId:r}}),nodeId:e.nodeId}}),o=a.flatMap(e=>e.modules),s=o.flatMap(e=>e.importSpecifier===void 0?[]:[`import * as imported_${e.bindingName} from ${JSON.stringify(e.importSpecifier)};`]),c=o.flatMap(e=>e.initializer===void 0?[]:[`const ${e.bindingName} = ${e.initializer};`]);return[`// Generated by eve. Do not edit by hand.`,...i||o.length>0?[`import { interopAuthoredModuleNamespace, loadFrameworkProgrammaticModule as loadProgrammaticModule, memoizeModuleNamespaceFactories } from ${JSON.stringify(normalizeEsmImportSpecifier(e.programmaticLoaderImportSpecifier??`eve/internal/programmatic-source-loader`))};`]:[],...s,...i||o.length>0?[``]:[],...c,...c.length>0?[``]:[],`export const moduleMap = ${renderModuleMap(a)};`,``,`export default moduleMap;`,``].join(`
2
2
  `)}async function createProgrammaticCompiledModuleMap(e,t){let n={};for(let r of collectBoundNodeScopes(e)){let i={},a=Object.fromEntries(r.modules.map(({binding:e,sourceId:t})=>[t,e])),o=new Map(r.mounts.map(e=>[e.mountId,e.mountSourceId])),s=createCompiledBindingNamespaceLoader({appRoot:e.appRoot,bindings:a,registries:t,mountSourceId:e=>o.get(bindingMountId(e)??``)});for(let{sourceId:e}of r.modules)i[e]=await s(e);n[r.nodeId]={modules:i}}return{nodes:n}}function collectRuntimeModuleBindingsForManifest(e){let t=new Map(Object.entries(e.bindings).filter(([,e])=>e.usage.runtimeEntry));for(let n of e.remoteAgents)if(n.binding.usage.runtimeEntry){if(t.has(n.sourceId))throw Error(`Remote agent binding "${n.sourceId}" collides with a node binding.`);t.set(n.sourceId,n.binding)}return orderBoundModules([...t].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({binding:t,sourceId:e})))}function orderBoundModules(e,t){let n=new Map(e.map(e=>[e.sourceId,e])),r=[],i=new Set,a=new Set,visit=e=>{if(a.has(e.sourceId))return;if(i.has(e.sourceId))throw Error(`Compiled module dependency cycle includes "${e.sourceId}".`);i.add(e.sourceId);let o=t?.(e.binding);if(o!==void 0&&o!==e.sourceId){let e=n.get(o);e!==void 0&&visit(e)}if(e.binding.backing.kind===`programmatic`)for(let t of Object.values(e.binding.backing.dependencies??{})){let r=n.get(t);if(r===void 0)throw Error(`Programmatic binding "${e.sourceId}" depends on missing binding "${t}".`);visit(r)}i.delete(e.sourceId),a.add(e.sourceId),r.push(e)};for(let t of e)visit(t);return r}function renderProgrammaticDependencies(e,t){let n=Object.entries(e??{});return n.length===0?`Object.freeze({})`:`Object.freeze({ ${n.map(([e,n])=>`${JSON.stringify(e)}: ${t.get(n)}`).join(`, `)} })`}function collectBoundNodeScopes(e){return[{modules:collectRuntimeModuleBindingsForManifest(e),mounts:e.extensionMounts,nodeId:ROOT_COMPILED_AGENT_NODE_ID},...[...e.subagents].sort((e,t)=>e.nodeId.localeCompare(t.nodeId)).map(e=>({modules:collectRuntimeModuleBindingsForManifest(e.agent),mounts:e.agent.extensionMounts,nodeId:e.nodeId}))]}function renderModuleMap(e){return renderFrozenObject([{key:`nodes`,value:renderFrozenObject(e.map(e=>({key:e.nodeId,value:renderFrozenObject([{key:`modules`,value:renderFrozenObject(e.modules.map(e=>({key:e.sourceId,value:e.bindingName})))}],3)})))}],0)}function renderFrozenObject(e,t=1){if(e.length===0)return`Object.freeze({})`;let n=` `.repeat(t),r=` `.repeat(t+1);return[`Object.freeze({`,e.map(e=>`${r}${JSON.stringify(e.key)}: ${e.value.replaceAll(`
3
3
  `,`\n${r}`)}`).join(`,
4
4
  `),`${n}})`].join(`
@@ -1 +1 @@
1
- import{isAbsolute,relative,resolve}from"node:path";import{normalizeLogicalPath}from"#discover/filesystem.js";import{toErrorMessage}from"#shared/errors.js";import{parseJsonObject}from"#shared/json.js";import{isDynamicModelDefinition}from"#shared/agent-definition.js";import{createCompiledBindingNamespaceLoader}from"#compiler/load-binding-namespace.js";import{normalizeAgentDefinition}from"#internal/authored-definition/core.js";import{formatLanguageModelGatewayId}from"#internal/runtime-model.js";import{classifyModelRouting}from"#internal/classify-model-routing.js";import{isMockModel}from"#internal/mock-model-identity.js";import{isChatGptModelRouting}from"#shared/chatgpt-model.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";async function compileAgentConfig(e,t,n){let r=n.source,i=formatAgentConfigModulePath(e,r,n.binding),a=normalizeAgentDefinition(Object.hasOwn(n,`definition`)?n.definition:await loadModuleBackedDefinition({binding:n.binding,displayPath:i,kind:`agent config`,loadNamespace:createCompiledBindingNamespaceLoader({appRoot:e.appRoot,bindings:{[r.sourceId]:n.binding},registries:t.registries}),source:r}),`Expected the agent config export "${r.exportName??`default`}" from "${i}" to match the public eve shape.`),o=isDynamicModelDefinition(a.model)?a.model:void 0,s=o===void 0?await normalizeAuthoredModelReference({modelCatalog:t.modelCatalog,purpose:`the primary compaction trigger model`,contextWindowTokens:a.modelContextWindowTokens,promptCache:a.modelOptions?.promptCache,providerOptions:a.modelOptions?.providerOptions,source:r,sourcePath:i,value:a.model}):void 0,c={},l={compaction:c,name:e.agentId,source:{...r}};a.defaultTools!==void 0&&(l.defaultTools=a.defaultTools),a.description!==void 0&&(l.description=a.description);let u;o!==void 0&&(u={eventNames:Object.keys(o.events),exportName:r.exportName,sourceKind:`module`,logicalPath:r.logicalPath,sourceId:r.sourceId});let d=normalizeExperimentalDefinition(a.experimental);if(d!==void 0&&(l.experimental=d),a.build!==void 0&&(l.build={externalDependencies:a.build.externalDependencies===void 0?void 0:[...a.build.externalDependencies]}),a.reasoning!==void 0&&(l.reasoning=a.reasoning),a.tool!==void 0&&(l.tool=a.tool),a.limits!==void 0&&(l.limits={maxInputTokensPerSession:a.limits.maxInputTokensPerSession,maxOutputTokensPerSession:a.limits.maxOutputTokensPerSession,maxTokenCostUsdPerSession:a.limits.maxTokenCostUsdPerSession,sessionTimeoutMs:a.limits.sessionTimeoutMs}),a.compaction?.model!==void 0&&(c.model=await normalizeAuthoredModelReference({modelCatalog:t.modelCatalog,purpose:`the compaction summary model`,contextWindowTokens:a.compaction.modelContextWindowTokens,providerOptions:a.modelOptions?.providerOptions,source:r,sourcePath:i,value:a.compaction.model})),a.compaction?.thresholdPercent!==void 0&&(c.thresholdPercent=a.compaction.thresholdPercent),u!==void 0)return{...l,dynamicModel:u};if(s===void 0)throw Error(`Expected a static agent model to compile to a concrete model reference.`);return{...l,model:s}}function normalizeExperimentalDefinition(e){if(e===void 0)return;let t={};return e.workflow!==void 0&&(t.workflow={modelCallsPerStep:e.workflow.modelCallsPerStep,retention:e.workflow.retention,world:e.workflow.world}),t}async function normalizeAuthoredModelReference(e){if(typeof e.value==`string`){let t=classifyModelRouting(e.value,e.providerOptions);return rejectGatewayPromptCache(e,t),await withCompiledRuntimeModelLimits({id:formatLanguageModelGatewayId(e.value),providerOptions:parseProviderOptionsRecord(e.providerOptions),routing:t},e)}let t=e.source;if(t===void 0)throw Error(`Expected ${e.purpose} to provide a valid AI SDK language model reference.`);let n=e.value,r=n.specificationVersion;if(r!==`v2`&&r!==`v3`&&r!==`v4`||typeof n.provider!=`string`||typeof n.modelId!=`string`||typeof n.doGenerate!=`function`||typeof n.doStream!=`function`)throw Error(`Expected the authored agent config export "${t.exportName??`default`}" from "${e.sourcePath??t.logicalPath}" to provide a valid AI SDK language model.`);let i=classifyModelRouting(n,e.providerOptions);rejectGatewayPromptCache(e,i);let a={id:formatLanguageModelGatewayId(n),source:{exportName:t.exportName,sourceKind:`module`,logicalPath:t.logicalPath,sourceId:t.sourceId},providerOptions:parseProviderOptionsRecord(e.providerOptions),routing:i};if(e.promptCache!==void 0&&(a.promptCache=e.promptCache),e.contextWindowTokens===void 0){if(isChatGptModelRouting(a.routing))return{...a,contextWindowTokens:2e5};if(isMockModel(n))return{...a,contextWindowTokens:1e6};try{let t=await e.modelCatalog.getByProviderModelId(n.provider,n.modelId);if(t)return{...a,id:t.slug,contextWindowTokens:t.limits.contextWindowTokens,maxOutputTokens:t.limits.maxOutputTokens}}catch{}}return await withCompiledRuntimeModelLimits(a,e)}function rejectGatewayPromptCache(e,t){if(e.promptCache!==void 0&&t.kind===`gateway`)throw Error(`${e.sourcePath??`agent.ts`}: modelOptions.promptCache applies only to models eve calls directly, but "${formatLanguageModelGatewayId(e.value)}" routes through AI Gateway, which manages its own prompt caching. Remove promptCache, or configure Gateway caching with providerOptions.gateway.caching.`)}function formatAgentConfigModulePath(e,t,n){return n.backing.kind===`programmatic`?t.logicalPath:normalizeLogicalPath(relative(resolveTopLevelAgentRoot(e),n.backing.sourcePath))}function resolveTopLevelAgentRoot(e){let t=resolve(e.appRoot),n=resolve(t,`agent`);return isPathInsideOrEqual(n,resolve(e.agentRoot))?n:t}function isPathInsideOrEqual(e,t){let n=relative(e,t);return n===``||!n.startsWith(`..`)&&!isAbsolute(n)}async function withCompiledRuntimeModelLimits(e,t){if(t.contextWindowTokens!==void 0)return{...e,contextWindowTokens:t.contextWindowTokens};let n;try{n=await t.modelCatalog.getModelLimits(e.id)}catch(n){throw Error(`Failed to load AI Gateway model metadata for ${t.purpose} "${e.id}". ${toErrorMessage(n)}`)}if(n===null)throw Error(`Cannot compile agent compaction because ${t.purpose} "${e.id}" does not have known AI Gateway context window metadata.`);return{...e,contextWindowTokens:n.contextWindowTokens,maxOutputTokens:n.maxOutputTokens}}function parseProviderOptionsRecord(e){if(e===void 0)return;let t={};for(let[n,r]of Object.entries(e))t[n]=parseJsonObject(r);return t}export{compileAgentConfig};
1
+ import{isAbsolute,relative,resolve}from"node:path";import{normalizeLogicalPath}from"#discover/filesystem.js";import{toErrorMessage}from"#shared/errors.js";import{parseJsonObject}from"#shared/json.js";import{isDynamicModelDefinition}from"#shared/agent-definition.js";import{createCompiledBindingNamespaceLoader}from"#compiler/load-binding-namespace.js";import{normalizeAgentDefinition}from"#internal/authored-definition/core.js";import{formatLanguageModelGatewayId}from"#internal/runtime-model.js";import{classifyModelRouting}from"#internal/classify-model-routing.js";import{isMockModel}from"#internal/mock-model-identity.js";import{isChatGptModelRouting}from"#shared/chatgpt-model.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";async function compileAgentConfig(e,t,n){let r=n.source,i=formatAgentConfigModulePath(e,r,n.binding),a=normalizeAgentDefinition(Object.hasOwn(n,`definition`)?n.definition:await loadModuleBackedDefinition({binding:n.binding,displayPath:i,kind:`agent config`,loadNamespace:createCompiledBindingNamespaceLoader({appRoot:e.appRoot,bindings:{[r.sourceId]:n.binding},registries:t.registries}),source:r}),`Expected the agent config export "${r.exportName??`default`}" from "${i}" to match the public eve shape.`),o=isDynamicModelDefinition(a.model)?a.model:void 0,s=o===void 0?await normalizeAuthoredModelReference({modelCatalog:t.modelCatalog,purpose:`the primary compaction trigger model`,contextWindowTokens:a.modelContextWindowTokens,promptCache:a.modelOptions?.promptCache,providerOptions:a.modelOptions?.providerOptions,source:r,sourcePath:i,value:a.model}):void 0,c={},l={compaction:c,name:e.agentId,source:{...r}};a.defaultTools!==void 0&&(l.defaultTools=a.defaultTools),a.description!==void 0&&(l.description=a.description);let u;o!==void 0&&(u={eventNames:Object.keys(o.events),exportName:r.exportName,sourceKind:`module`,logicalPath:r.logicalPath,sourceId:r.sourceId});let d=normalizeExperimentalDefinition(a.experimental);if(d!==void 0&&(l.experimental=d),a.build!==void 0&&(l.build={externalDependencies:a.build.externalDependencies===void 0?void 0:[...a.build.externalDependencies]}),a.reasoning!==void 0&&(l.reasoning=a.reasoning),a.tool!==void 0&&(l.tool=a.tool),a.limits!==void 0&&(l.limits={sessionTimeoutMs:a.limits.sessionTimeoutMs,sessionUsage:a.limits.sessionUsage!==void 0||void 0}),a.compaction?.model!==void 0&&(c.model=await normalizeAuthoredModelReference({modelCatalog:t.modelCatalog,purpose:`the compaction summary model`,contextWindowTokens:a.compaction.modelContextWindowTokens,providerOptions:a.modelOptions?.providerOptions,source:r,sourcePath:i,value:a.compaction.model})),a.compaction?.thresholdPercent!==void 0&&(c.thresholdPercent=a.compaction.thresholdPercent),u!==void 0)return{...l,dynamicModel:u};if(s===void 0)throw Error(`Expected a static agent model to compile to a concrete model reference.`);return{...l,model:s}}function normalizeExperimentalDefinition(e){if(e===void 0)return;let t={};return e.workflow!==void 0&&(t.workflow={modelCallsPerStep:e.workflow.modelCallsPerStep,retention:e.workflow.retention,world:e.workflow.world}),t}async function normalizeAuthoredModelReference(e){if(typeof e.value==`string`){let t=classifyModelRouting(e.value,e.providerOptions);return rejectGatewayPromptCache(e,t),await withCompiledRuntimeModelLimits({id:formatLanguageModelGatewayId(e.value),providerOptions:parseProviderOptionsRecord(e.providerOptions),routing:t},e)}let t=e.source;if(t===void 0)throw Error(`Expected ${e.purpose} to provide a valid AI SDK language model reference.`);let n=e.value,r=n.specificationVersion;if(r!==`v2`&&r!==`v3`&&r!==`v4`||typeof n.provider!=`string`||typeof n.modelId!=`string`||typeof n.doGenerate!=`function`||typeof n.doStream!=`function`)throw Error(`Expected the authored agent config export "${t.exportName??`default`}" from "${e.sourcePath??t.logicalPath}" to provide a valid AI SDK language model.`);let i=classifyModelRouting(n,e.providerOptions);rejectGatewayPromptCache(e,i);let a={id:formatLanguageModelGatewayId(n),source:{exportName:t.exportName,sourceKind:`module`,logicalPath:t.logicalPath,sourceId:t.sourceId},providerOptions:parseProviderOptionsRecord(e.providerOptions),routing:i};if(e.promptCache!==void 0&&(a.promptCache=e.promptCache),e.contextWindowTokens===void 0){if(isChatGptModelRouting(a.routing))return{...a,contextWindowTokens:2e5};if(isMockModel(n))return{...a,contextWindowTokens:1e6};try{let t=await e.modelCatalog.getByProviderModelId(n.provider,n.modelId);if(t)return{...a,id:t.slug,contextWindowTokens:t.limits.contextWindowTokens,maxOutputTokens:t.limits.maxOutputTokens}}catch{}}return await withCompiledRuntimeModelLimits(a,e)}function rejectGatewayPromptCache(e,t){if(e.promptCache!==void 0&&t.kind===`gateway`)throw Error(`${e.sourcePath??`agent.ts`}: modelOptions.promptCache applies only to models eve calls directly, but "${formatLanguageModelGatewayId(e.value)}" routes through AI Gateway, which manages its own prompt caching. Remove promptCache, or configure Gateway caching with providerOptions.gateway.caching.`)}function formatAgentConfigModulePath(e,t,n){return n.backing.kind===`programmatic`?t.logicalPath:normalizeLogicalPath(relative(resolveTopLevelAgentRoot(e),n.backing.sourcePath))}function resolveTopLevelAgentRoot(e){let t=resolve(e.appRoot),n=resolve(t,`agent`);return isPathInsideOrEqual(n,resolve(e.agentRoot))?n:t}function isPathInsideOrEqual(e,t){let n=relative(e,t);return n===``||!n.startsWith(`..`)&&!isAbsolute(n)}async function withCompiledRuntimeModelLimits(e,t){if(t.contextWindowTokens!==void 0)return{...e,contextWindowTokens:t.contextWindowTokens};let n;try{n=await t.modelCatalog.getModelLimits(e.id)}catch(n){throw Error(`Failed to load AI Gateway model metadata for ${t.purpose} "${e.id}". ${toErrorMessage(n)}`)}if(n===null)throw Error(`Cannot compile agent compaction because ${t.purpose} "${e.id}" does not have known AI Gateway context window metadata.`);return{...e,contextWindowTokens:n.contextWindowTokens,maxOutputTokens:n.maxOutputTokens}}function parseProviderOptionsRecord(e){if(e===void 0)return;let t={};for(let[n,r]of Object.entries(e))t[n]=parseJsonObject(r);return t}export{compileAgentConfig};
@@ -1 +1 @@
1
- import{randomUUID}from"node:crypto";import{noDevelopmentExtensions,prepareDevelopmentExtensions}from"#compiler/development-extensions.js";import{ROOT_COMPILED_AGENT_NODE_ID,createCompiledAgentManifest,createCompiledAgentNodeManifest,createCompiledAgentResources,createCompiledSubagentNodeId}from"#compiler/manifest.js";import{summarizeCompilerDiagnostics}from"#compiler/diagnostics.js";import{composeAgentModuleCandidates,createAgentModuleBinding,createProgrammaticModuleCandidates,disableComposedCandidate,isAgentModuleCandidate}from"#compiler/source-graph.js";import{compileMemoryDefinition}from"#compiler/normalize-memory.js";import{frameworkAgentSourceRegistry}from"#framework/sources/registry.js";import{bindingMountId}from"#compiler/extension-mount-bindings.js";import{assertApplicationOverlayCanApplyToAllNodes,assertNonExtensionSpecialTool,assertRootOnlyConfig,assertUniqueBy,assertUniqueRegistryIds,collectSelectedSourceIds,compileChannelRoutes,compileExtensionMounts,createCompiledRemoteAgent,createExtensionCompileMounts,expectSubagentDescription,loadSelectedNodeConfig,mergeExternalDependencies,withDiagnosticsSummary,withExtensionNamespace}from"#compiler/normalize-manifest-helpers.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{assertRemoteAgentDefinitionHasNoLocalPackageEntries,normalizeSubagentConfig}from"#compiler/normalize-subagent.js";import{NodeModuleEvaluationContext,markConfigRuntimeEntries}from"#compiler/module-lifecycle.js";import{assertStaticConnectionOwnership}from"#compiler/connection-ownership.js";import{createCompiledRuntimeModelCatalogLoader}from"#compiler/model-catalog.js";import{compileAgentConfig}from"#compiler/normalize-agent-config.js";import{compileChannelDefinition}from"#compiler/normalize-channel.js";import{compileConnectionDefinition}from"#compiler/normalize-connection.js";import{applyAgentToolPolicy,applyDefaultToolPolicy,canDisableToolWithoutSelectedSource}from"#compiler/default-tool-policy.js";import{resolveWorkspaceSubagentDefinition}from"#compiler/resolve-workspace-subagent.js";import{workspaceSubagentName}from"#public/definitions/workspace-agent.js";import{compileHookEntry}from"#compiler/normalize-hook.js";import{compileInstructionsEntry}from"#compiler/normalize-instructions.js";import{createMemoryWrapperCandidates}from"#compiler/memory-wrapper-candidates.js";import{compileSandboxDefinition}from"#compiler/normalize-sandbox.js";import{compileScheduleDefinition}from"#compiler/normalize-schedule.js";import{compileScheduleCollectionDefinition}from"#compiler/normalize-schedule-collection.js";import{isScheduleCollectionDefinition}from"#shared/schedule-collection-definition.js";import{createScheduleCollectionWrapperCandidates}from"#compiler/schedule-collection-wrapper-candidates.js";import{assertSkillNameAvailable,compileSkillSource}from"#compiler/normalize-skill.js";import{compileToolEntry}from"#compiler/normalize-tool.js";import{finalizeNodeSourceState}from"#compiler/node-source-state.js";import{projectAgentSources,projectSelectedSources}from"#compiler/project-sources.js";async function compileAgentManifest(e,t={}){let n=[frameworkAgentSourceRegistry,...t.sourceRegistries??[]];assertUniqueRegistryIds(n);let r={modelCatalog:createCompiledRuntimeModelCatalogLoader(e.appRoot),registries:n},i=t.diagnostics??[],a=await prepareDevelopmentExtensions({diagnostics:i,manifest:e,nodeId:ROOT_COMPILED_AGENT_NODE_ID,selection:t.developmentExtensions??noDevelopmentExtensions()}),o=await new AgentGraphCompiler(r,n,i).compileStaticNode({developmentExtensionCandidates:a.candidates,inheritedExternalDependencies:[],isRoot:!0,layer:`application`,manifest:a.manifest,nodeId:ROOT_COMPILED_AGENT_NODE_ID,nodePath:``,owner:{kind:`application`}}),s=summarizeCompilerDiagnostics(i),c=withDiagnosticsSummary(o.descendants,s);return createCompiledAgentManifest({...o.manifest,diagnosticsSummary:s,subagents:c})}var AgentGraphCompiler=class{context;registries;diagnostics;mounts=new Map;evaluationId=randomUUID();constructor(e,t,n){this.context=e,this.registries=t,this.diagnostics=n}async compileStaticNode(e){let t=await this.createPhaseOneNodeSourceState(e,e.inheritedExternalDependencies),n=await compileAgentConfig(e.manifest,this.context,{binding:t.selectedConfig.binding,definition:t.selectedConfig.definition,source:t.selectedConfig.source});assertRootOnlyConfig(n,e.isRoot,e.manifest.agentId),applyAgentToolPolicy(t,n),applyDefaultToolPolicy(t,n);let r=mergeExternalDependencies(e.inheritedExternalDependencies,n.build?.externalDependencies,e.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));r.length>0&&(n={...n,build:{...n.build,externalDependencies:r}});let i=finalizeNodeSourceState(t,r);markConfigRuntimeEntries(n,i.evaluation);let a=await this.compileResources(e,i),o=await this.compileChildren(e,i,r),s=createCompiledAgentNodeManifest({...a,config:n,remoteAgents:o.remoteAgents});return{descendants:o.nodes,manifest:s}}async compileChildren(e,t,n){let r=[],i=[],a=collectSelectedSourceIds(t.composed),o=t.projected.subagents.filter(e=>a.has(e.candidate.sourceId));for(let t of o){let a=t.source,o=createCompiledSubagentNodeId(e.nodeId,a.sourceId),s={extensionScope:t.extensionScope??e.extensionScope,mountId:t.mountId,inheritedExternalDependencies:n,isRoot:!1,layer:t.candidate.layer,manifest:a.manifest,nodeId:o,nodePath:t.nodePath,owner:t.owner,parentNodeId:e.nodeId},c=await this.createPhaseOneNodeSourceState(s,n),l=normalizeSubagentConfig(c.selectedConfig.definition,`Expected the subagent config export "${c.selectedConfig.source.exportName??`default`}" from "${a.entryPath}" to match the public eve shape.`);if(l.kind===`remote`){let n=workspaceSubagentName(c.selectedConfig.definition),r=n===void 0?l:await resolveWorkspaceSubagentDefinition({definition:l,name:n,registries:this.registries,source:a});assertRemoteAgentDefinitionHasNoLocalPackageEntries(a);let s=c.selectedConfig.source.sourceId;c.evaluation.setBindings({[s]:c.selectedConfig.binding}),c.evaluation.requireRuntimeEntry(s);let u=c.evaluation.finalizeBindings()[s];if(u===void 0)throw Error(`Remote subagent "${o}" has no finalized config binding.`);i.push(createCompiledRemoteAgent({binding:u,definition:r,nodeId:o,owner:t.owner,parentNodeId:e.nodeId,source:a,sourceRef:c.selectedConfig.source}));continue}let u,d;l.kind===`local`?(u=await compileAgentConfig(a.manifest,this.context,{binding:c.selectedConfig.binding,definition:l.definition,source:c.selectedConfig.source}),assertRootOnlyConfig(u,!1,a.manifest.agentId),applyAgentToolPolicy(c,u),applyDefaultToolPolicy(c,u)):d=l.build?.externalDependencies;let f=mergeExternalDependencies(n,u?.build?.externalDependencies,d,a.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));u!==void 0&&f.length>0&&(u={...u,build:{...u.build,externalDependencies:f}});let p=finalizeNodeSourceState(c,f);u===void 0?p.evaluation.requireRuntimeEntry(c.selectedConfig.source.sourceId):markConfigRuntimeEntries(u,p.evaluation);let m=await this.compileResources(s,p),h=await this.compileChildren(s,p,f),g={backing:t.candidate.backing,entryPath:a.entryPath,logicalPath:a.logicalPath,name:a.subagentId,nodeId:o,owner:t.owner,parentNodeId:e.nodeId,rootPath:a.rootPath,sourceId:a.sourceId,sourceKind:`module`},_;_=u===void 0?{...g,agent:createCompiledAgentResources({...m,remoteAgents:h.remoteAgents}),configResolver:{build:l.kind===`dynamic`?l.build:void 0,eventNames:l.kind===`dynamic`?l.eventNames:[],exportName:c.selectedConfig.source.exportName,logicalPath:c.selectedConfig.source.logicalPath,sourceId:c.selectedConfig.source.sourceId,sourceKind:`module`}}:{...g,agent:createCompiledAgentNodeManifest({...m,config:u,remoteAgents:h.remoteAgents}),description:expectSubagentDescription(u,a)},r.push(_,...h.nodes)}return{nodes:r,remoteAgents:i}}composeNodeSources(e,t){let n=projectAgentSources({externalDependencies:t,extensionScope:e.extensionScope,mountId:e.mountId,layer:e.layer,manifest:e.manifest,nodeId:e.nodeId,nodePath:e.nodePath,owner:e.owner}),r=[],i=[];for(let t of this.registries){let n=t===frameworkAgentSourceRegistry;for(let a of t.registrations){if(a.applyTo===`root`&&!e.isRoot)continue;!n&&a.applyTo===`all-local-nodes`&&assertApplicationOverlayCanApplyToAllNodes(a.source.modules.map(e=>e.logicalPath));let t=createProgrammaticModuleCandidates({layer:n?`framework-default`:`application`,nodeId:e.nodeId,owner:n?{feature:a.source.id,kind:`framework`}:{kind:`application`},registration:a});(n?r:i).push(...t)}}let a=[...r,...e.developmentExtensionCandidates??[],...n.candidates,...createMemoryWrapperCandidates([...n.candidates,...i]),...createScheduleCollectionWrapperCandidates([...n.candidates,...i],e.manifest.agentId),...i],o=composeAgentModuleCandidates(a),s=projectSelectedSources({candidates:o.selected.values(),resources:n.resources});return{composed:o,orderedCandidates:a,projected:n,sourcesBySourceId:new Map(s.map(e=>[e.candidate.sourceId,e])),subagentsBySourceId:new Map(n.subagents.map(e=>[e.candidate.sourceId,e]))}}async createPhaseOneNodeSourceState(e,t){let n=this.composeNodeSources(e,t),{mounts:r,sourceIds:i}=createExtensionCompileMounts(e.manifest,e.nodePath);for(let[e,t]of r)this.mounts.set(e,t);let a=new NodeModuleEvaluationContext(this.registries,e=>i.get(bindingMountId(e)??``),this.mounts,this.evaluationId,e.manifest.appRoot);return a.setBindings(Object.fromEntries([...n.composed.selected.values()].filter(isAgentModuleCandidate).map(e=>[e.sourceId,createAgentModuleBinding(e)]))),{evaluation:a,graph:n,selectedConfig:await loadSelectedNodeConfig(n,a)}}async compileResources(e,t){let n=[],r=[],i=[],a=[],o=[],s=[],c=[],l=[],u=[],d=[],f=[],p=[],m=[],h,g=collectSelectedSourceIds(t.composed),_=t.evaluation.loadNamespace;for(let v of t.orderedCandidates){if(!g.has(v.sourceId))continue;let y=t.sourcesBySourceId.get(v.sourceId);if(y===void 0)continue;let b=t.bindings[v.sourceId],x={binding:b,loadNamespace:_,owner:v.owner};switch(y.kind){case`config`:case`extension`:break;case`channel`:{let n=await compileChannelDefinition(e.manifest.agentRoot,y.source,{binding:b,loadNamespace:_});n.kind===`disabled`?(t.composed=disableComposedCandidate({candidate:v,composed:t.composed}),delete t.bindings[v.sourceId],g.delete(v.sourceId)):m.push(...n.definitions);break}case`connection`:{let n=await compileConnectionDefinition(e.manifest.agentRoot,y.source,{binding:b,loadNamespace:_});if(n.kind===`connection`){if(n.definition.experimental_events===!0&&e.nodeId!==ROOT_COMPILED_AGENT_NODE_ID)throw Error(`experimental_events currently requires a root-agent connection.`);c.push(n.definition)}else l.push(withExtensionNamespace(n.definition,v.owner));t.evaluation.requireRuntimeEntry(v.sourceId);break}case`hook`:d.push(await compileHookEntry(y.source,{binding:b,loadNamespace:_})),t.evaluation.requireRuntimeEntry(v.sourceId);break;case`instructions`:{let n=await compileInstructionsEntry(e.manifest.agentRoot,y.source,x);n.kind===`instructions`?o.push(n.definition):(s.push(n.definition),t.evaluation.requireRuntimeEntry(v.sourceId));break}case`memory`:u.push(await compileMemoryDefinition(y.source,{binding:b,loadNamespace:_})),t.evaluation.requireRuntimeEntry(v.sourceId);break;case`sandbox`:h=await compileSandboxDefinition(e.manifest.agentRoot,y.source,{binding:b,loadNamespace:_}),h.inheritsParent||t.evaluation.requireRuntimeEntry(v.sourceId);break;case`schedule`:{let n=y.source.sourceKind===`module`?await loadModuleBackedDefinition({binding:b,loadNamespace:_,kind:`schedule`,source:y.source}):y.source.definition;if(isScheduleCollectionDefinition(n)){p.push(compileScheduleCollectionDefinition(y.source,n)),t.evaluation.requireRuntimeEntry(v.sourceId);break}let r=compileScheduleDefinition(e.manifest.agentRoot,y.source,n,x.owner);f.push(r),r.sourceKind===`module`&&r.hasRun&&t.evaluation.requireRuntimeEntry(v.sourceId);break}case`skill`:{let n=await compileSkillSource(e.manifest.agentRoot,y.source,x);n.kind===`skill`?(assertSkillNameAvailable(n.definition),i.push(n.definition)):(a.push(withExtensionNamespace(n.definition,v.owner)),t.evaluation.requireRuntimeEntry(v.sourceId));break}case`tool`:{let i=await compileToolEntry(e.manifest.agentRoot,y.source,{binding:b,loadNamespace:_});i.kind===`disabled`?(t.composed=disableComposedCandidate({allowUnmatched:canDisableToolWithoutSelectedSource(t,i.name),candidate:v,composed:t.composed}),delete t.bindings[v.sourceId],g.delete(v.sourceId)):i.kind===`tool`?(n.push(i.definition),i.definition.hasExecute&&t.evaluation.requireRuntimeEntry(v.sourceId)):i.kind===`dynamic-tool`?(r.push(withExtensionNamespace(i.definition,v.owner)),t.evaluation.requireRuntimeEntry(v.sourceId)):(assertNonExtensionSpecialTool(v,`Web search`),n.push(i.definition));break}}}if(h===void 0)throw Error(`Agent node "${e.nodeId}" has no selected sandbox source.`);assertUniqueBy(n,e=>e.name,`tool name`),assertUniqueBy(r,e=>e.slug,`dynamic tool slug`),assertUniqueBy(c,e=>e.connectionName,`connection name`),assertUniqueBy(l,e=>e.slug,`dynamic connection slug`),assertUniqueBy(i,e=>e.name,`skill name`),assertStaticConnectionOwnership({connectionNames:c.map(e=>e.connectionName),subagentNames:t.projected.subagents.filter(e=>g.has(e.candidate.sourceId)).map(e=>e.source.subagentId),toolNames:n.map(e=>e.name)});let v=compileChannelRoutes(t,m,this.diagnostics,e.nodeId),y=compileExtensionMounts(e.manifest,t.composed,e.nodePath);for(let e of y)t.evaluation.requireRuntimeEntry(e.mountSourceId);let b=t.evaluation.finalizeBindings();return createCompiledAgentResources({agentRoot:e.manifest.agentRoot,appRoot:e.manifest.appRoot,bindings:b,channelRoutes:v,connections:c,diagnosticsSummary:summarizeCompilerDiagnostics(this.diagnostics),dynamicConnections:l,dynamicInstructions:s,dynamicSkills:a,dynamicTools:r,extensionMounts:y,hooks:d,memories:u,instructions:o,sandbox:h,sandboxWorkspaces:e.manifest.sandboxWorkspaces.map(e=>({logicalPath:e.logicalPath,rootEntries:[...e.rootEntries],sourceId:e.sourceId,sourcePath:e.sourcePath})),schedules:f,scheduleCollections:p,skills:i,sourceComposition:t.composed.composition,tools:n})}};export{compileAgentManifest};
1
+ import{randomUUID}from"node:crypto";import{noDevelopmentExtensions,prepareDevelopmentExtensions}from"#compiler/development-extensions.js";import{ROOT_COMPILED_AGENT_NODE_ID,createCompiledAgentManifest,createCompiledAgentNodeManifest,createCompiledAgentResources,createCompiledSubagentNodeId}from"#compiler/manifest.js";import{summarizeCompilerDiagnostics}from"#compiler/diagnostics.js";import{composeAgentModuleCandidates,createAgentModuleBinding,createProgrammaticModuleCandidates,disableComposedCandidate,isAgentModuleCandidate}from"#compiler/source-graph.js";import{compileMemoryDefinition}from"#compiler/normalize-memory.js";import{frameworkAgentSourceRegistry}from"#framework/sources/registry.js";import{bindingMountId}from"#compiler/extension-mount-bindings.js";import{assertApplicationOverlayCanApplyToAllNodes,assertNonExtensionSpecialTool,assertRootOnlyConfig,assertUniqueBy,assertUniqueRegistryIds,collectSelectedSourceIds,compileChannelRoutes,compileExtensionMounts,createCompiledRemoteAgent,createExtensionCompileMounts,expectSubagentDescription,loadSelectedNodeConfig,mergeExternalDependencies,withDiagnosticsSummary,withExtensionNamespace}from"#compiler/normalize-manifest-helpers.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{assertRemoteAgentDefinitionHasNoLocalPackageEntries,normalizeSubagentConfig}from"#compiler/normalize-subagent.js";import{NodeModuleEvaluationContext,markConfigRuntimeEntries}from"#compiler/module-lifecycle.js";import{assertStaticConnectionOwnership}from"#compiler/connection-ownership.js";import{createAuthoredModuleGraph}from"#internal/authored-module-graph.js";import{createCompiledRuntimeModelCatalogLoader}from"#compiler/model-catalog.js";import{compileAgentConfig}from"#compiler/normalize-agent-config.js";import{compileChannelDefinition}from"#compiler/normalize-channel.js";import{compileConnectionDefinition}from"#compiler/normalize-connection.js";import{applyAgentToolPolicy,applyDefaultToolPolicy,canDisableToolWithoutSelectedSource}from"#compiler/default-tool-policy.js";import{resolveWorkspaceSubagentDefinition}from"#compiler/resolve-workspace-subagent.js";import{workspaceSubagentName}from"#public/definitions/workspace-agent.js";import{compileHookEntry}from"#compiler/normalize-hook.js";import{compileInstructionsEntry}from"#compiler/normalize-instructions.js";import{createMemoryWrapperCandidates}from"#compiler/memory-wrapper-candidates.js";import{compileSandboxDefinition}from"#compiler/normalize-sandbox.js";import{compileScheduleDefinition}from"#compiler/normalize-schedule.js";import{compileScheduleCollectionDefinition}from"#compiler/normalize-schedule-collection.js";import{isScheduleCollectionDefinition}from"#shared/schedule-collection-definition.js";import{createScheduleCollectionWrapperCandidates}from"#compiler/schedule-collection-wrapper-candidates.js";import{assertSkillNameAvailable,compileSkillSource}from"#compiler/normalize-skill.js";import{compileToolEntry}from"#compiler/normalize-tool.js";import{finalizeNodeSourceState}from"#compiler/node-source-state.js";import{listApplicationModulePaths,projectAgentSources,projectSelectedSources}from"#compiler/project-sources.js";async function compileAgentManifest(e,t={}){let n=[frameworkAgentSourceRegistry,...t.sourceRegistries??[]];assertUniqueRegistryIds(n);let r={modelCatalog:createCompiledRuntimeModelCatalogLoader(e.appRoot),registries:n},i=t.diagnostics??[],a=await prepareDevelopmentExtensions({diagnostics:i,manifest:e,nodeId:ROOT_COMPILED_AGENT_NODE_ID,selection:t.developmentExtensions??noDevelopmentExtensions()}),o=await new AgentGraphCompiler(r,n,i,createAuthoredModuleGraph(listApplicationModulePaths(a.manifest),{appRoot:e.appRoot})).compileStaticNode({developmentExtensionCandidates:a.candidates,inheritedExternalDependencies:[],isRoot:!0,layer:`application`,manifest:a.manifest,nodeId:ROOT_COMPILED_AGENT_NODE_ID,nodePath:``,owner:{kind:`application`}}),s=summarizeCompilerDiagnostics(i),c=withDiagnosticsSummary(o.descendants,s);return createCompiledAgentManifest({...o.manifest,diagnosticsSummary:s,subagents:c})}var AgentGraphCompiler=class{context;registries;diagnostics;mounts=new Map;evaluationId=randomUUID();moduleGraph;constructor(e,t,n,r){this.context=e,this.registries=t,this.diagnostics=n,this.moduleGraph=r}async compileStaticNode(e){let t=await this.createPhaseOneNodeSourceState(e,e.inheritedExternalDependencies),n=await compileAgentConfig(e.manifest,this.context,{binding:t.selectedConfig.binding,definition:t.selectedConfig.definition,source:t.selectedConfig.source});assertRootOnlyConfig(n,e.isRoot,e.manifest.agentId),applyAgentToolPolicy(t,n),applyDefaultToolPolicy(t,n);let r=mergeExternalDependencies(e.inheritedExternalDependencies,n.build?.externalDependencies,e.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));r.length>0&&(n={...n,build:{...n.build,externalDependencies:r}});let i=finalizeNodeSourceState(t,r);markConfigRuntimeEntries(n,i.evaluation);let a=await this.compileResources(e,i),o=await this.compileChildren(e,i,r),s=createCompiledAgentNodeManifest({...a,config:n,remoteAgents:o.remoteAgents});return{descendants:o.nodes,manifest:s}}async compileChildren(e,t,n){let r=[],i=[],a=collectSelectedSourceIds(t.composed),o=t.projected.subagents.filter(e=>a.has(e.candidate.sourceId));for(let t of o){let a=t.source,o=createCompiledSubagentNodeId(e.nodeId,a.sourceId),s={extensionScope:t.extensionScope??e.extensionScope,mountId:t.mountId,inheritedExternalDependencies:n,isRoot:!1,layer:t.candidate.layer,manifest:a.manifest,nodeId:o,nodePath:t.nodePath,owner:t.owner,parentNodeId:e.nodeId},c=await this.createPhaseOneNodeSourceState(s,n),l=normalizeSubagentConfig(c.selectedConfig.definition,`Expected the subagent config export "${c.selectedConfig.source.exportName??`default`}" from "${a.entryPath}" to match the public eve shape.`);if(l.kind===`remote`){let n=workspaceSubagentName(c.selectedConfig.definition),r=n===void 0?l:await resolveWorkspaceSubagentDefinition({definition:l,name:n,registries:this.registries,source:a});assertRemoteAgentDefinitionHasNoLocalPackageEntries(a);let s=c.selectedConfig.source.sourceId;c.evaluation.setBindings({[s]:c.selectedConfig.binding}),c.evaluation.requireRuntimeEntry(s);let u=c.evaluation.finalizeBindings()[s];if(u===void 0)throw Error(`Remote subagent "${o}" has no finalized config binding.`);i.push(createCompiledRemoteAgent({binding:u,definition:r,nodeId:o,owner:t.owner,parentNodeId:e.nodeId,source:a,sourceRef:c.selectedConfig.source}));continue}let u,d;l.kind===`local`?(u=await compileAgentConfig(a.manifest,this.context,{binding:c.selectedConfig.binding,definition:l.definition,source:c.selectedConfig.source}),assertRootOnlyConfig(u,!1,a.manifest.agentId),applyAgentToolPolicy(c,u),applyDefaultToolPolicy(c,u)):d=l.build?.externalDependencies;let f=mergeExternalDependencies(n,u?.build?.externalDependencies,d,a.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));u!==void 0&&f.length>0&&(u={...u,build:{...u.build,externalDependencies:f}});let p=finalizeNodeSourceState(c,f);u===void 0?p.evaluation.requireRuntimeEntry(c.selectedConfig.source.sourceId):markConfigRuntimeEntries(u,p.evaluation);let m=await this.compileResources(s,p),h=await this.compileChildren(s,p,f),g={backing:t.candidate.backing,entryPath:a.entryPath,logicalPath:a.logicalPath,name:a.subagentId,nodeId:o,owner:t.owner,parentNodeId:e.nodeId,rootPath:a.rootPath,sourceId:a.sourceId,sourceKind:`module`},_;_=u===void 0?{...g,agent:createCompiledAgentResources({...m,remoteAgents:h.remoteAgents}),configResolver:{build:l.kind===`dynamic`?l.build:void 0,eventNames:l.kind===`dynamic`?l.eventNames:[],exportName:c.selectedConfig.source.exportName,logicalPath:c.selectedConfig.source.logicalPath,sourceId:c.selectedConfig.source.sourceId,sourceKind:`module`}}:{...g,agent:createCompiledAgentNodeManifest({...m,config:u,remoteAgents:h.remoteAgents}),description:expectSubagentDescription(u,a)},r.push(_,...h.nodes)}return{nodes:r,remoteAgents:i}}composeNodeSources(e,t){let n=projectAgentSources({externalDependencies:t,extensionScope:e.extensionScope,mountId:e.mountId,layer:e.layer,manifest:e.manifest,nodeId:e.nodeId,nodePath:e.nodePath,owner:e.owner}),r=[],i=[];for(let t of this.registries){let n=t===frameworkAgentSourceRegistry;for(let a of t.registrations){if(a.applyTo===`root`&&!e.isRoot)continue;!n&&a.applyTo===`all-local-nodes`&&assertApplicationOverlayCanApplyToAllNodes(a.source.modules.map(e=>e.logicalPath));let t=createProgrammaticModuleCandidates({layer:n?`framework-default`:`application`,nodeId:e.nodeId,owner:n?{feature:a.source.id,kind:`framework`}:{kind:`application`},registration:a});(n?r:i).push(...t)}}let a=[...r,...e.developmentExtensionCandidates??[],...n.candidates,...createMemoryWrapperCandidates([...n.candidates,...i]),...createScheduleCollectionWrapperCandidates([...n.candidates,...i],e.manifest.agentId),...i],o=composeAgentModuleCandidates(a),s=projectSelectedSources({candidates:o.selected.values(),resources:n.resources});return{composed:o,orderedCandidates:a,projected:n,sourcesBySourceId:new Map(s.map(e=>[e.candidate.sourceId,e])),subagentsBySourceId:new Map(n.subagents.map(e=>[e.candidate.sourceId,e]))}}async createPhaseOneNodeSourceState(e,t){let n=this.composeNodeSources(e,t),{mounts:r,sourceIds:i}=createExtensionCompileMounts(e.manifest,e.nodePath);for(let[e,t]of r)this.mounts.set(e,t);let a=new NodeModuleEvaluationContext(this.registries,e=>i.get(bindingMountId(e)??``),this.mounts,this.evaluationId,e.manifest.appRoot,this.moduleGraph);return a.setBindings(Object.fromEntries([...n.composed.selected.values()].filter(isAgentModuleCandidate).map(e=>[e.sourceId,createAgentModuleBinding(e)]))),{evaluation:a,graph:n,selectedConfig:await loadSelectedNodeConfig(n,a)}}async compileResources(e,t){let n=[],r=[],i=[],a=[],o=[],s=[],c=[],l=[],u=[],d=[],f=[],p=[],m=[],h,g=collectSelectedSourceIds(t.composed),_=t.evaluation.loadNamespace;for(let v of t.orderedCandidates){if(!g.has(v.sourceId))continue;let y=t.sourcesBySourceId.get(v.sourceId);if(y===void 0)continue;let b=t.bindings[v.sourceId],x={binding:b,loadNamespace:_,owner:v.owner};switch(y.kind){case`config`:case`extension`:break;case`channel`:{let n=await compileChannelDefinition(e.manifest.agentRoot,y.source,{binding:b,loadNamespace:_});n.kind===`disabled`?(t.composed=disableComposedCandidate({candidate:v,composed:t.composed}),delete t.bindings[v.sourceId],g.delete(v.sourceId)):m.push(...n.definitions);break}case`connection`:{let n=await compileConnectionDefinition(e.manifest.agentRoot,y.source,{binding:b,loadNamespace:_});if(n.kind===`connection`){if(n.definition.experimental_events===!0&&e.nodeId!==ROOT_COMPILED_AGENT_NODE_ID)throw Error(`experimental_events currently requires a root-agent connection.`);c.push(n.definition)}else l.push(withExtensionNamespace(n.definition,v.owner));t.evaluation.requireRuntimeEntry(v.sourceId);break}case`hook`:d.push(await compileHookEntry(y.source,{binding:b,loadNamespace:_})),t.evaluation.requireRuntimeEntry(v.sourceId);break;case`instructions`:{let n=await compileInstructionsEntry(e.manifest.agentRoot,y.source,x);n.kind===`instructions`?o.push(n.definition):(s.push(n.definition),t.evaluation.requireRuntimeEntry(v.sourceId));break}case`memory`:u.push(await compileMemoryDefinition(y.source,{binding:b,loadNamespace:_})),t.evaluation.requireRuntimeEntry(v.sourceId);break;case`sandbox`:h=await compileSandboxDefinition(e.manifest.agentRoot,y.source,{binding:b,loadNamespace:_}),h.inheritsParent||t.evaluation.requireRuntimeEntry(v.sourceId);break;case`schedule`:{let n=y.source.sourceKind===`module`?await loadModuleBackedDefinition({binding:b,loadNamespace:_,kind:`schedule`,source:y.source}):y.source.definition;if(isScheduleCollectionDefinition(n)){p.push(compileScheduleCollectionDefinition(y.source,n)),t.evaluation.requireRuntimeEntry(v.sourceId);break}let r=compileScheduleDefinition(e.manifest.agentRoot,y.source,n,x.owner);f.push(r),r.sourceKind===`module`&&r.hasRun&&t.evaluation.requireRuntimeEntry(v.sourceId);break}case`skill`:{let n=await compileSkillSource(e.manifest.agentRoot,y.source,x);n.kind===`skill`?(assertSkillNameAvailable(n.definition),i.push(n.definition)):(a.push(withExtensionNamespace(n.definition,v.owner)),t.evaluation.requireRuntimeEntry(v.sourceId));break}case`tool`:{let i=await compileToolEntry(e.manifest.agentRoot,y.source,{binding:b,loadNamespace:_});i.kind===`disabled`?(t.composed=disableComposedCandidate({allowUnmatched:canDisableToolWithoutSelectedSource(t,i.name),candidate:v,composed:t.composed}),delete t.bindings[v.sourceId],g.delete(v.sourceId)):i.kind===`tool`?(n.push(i.definition),i.definition.hasExecute&&t.evaluation.requireRuntimeEntry(v.sourceId)):i.kind===`dynamic-tool`?(r.push(withExtensionNamespace(i.definition,v.owner)),t.evaluation.requireRuntimeEntry(v.sourceId)):(assertNonExtensionSpecialTool(v,`Web search`),n.push(i.definition));break}}}if(h===void 0)throw Error(`Agent node "${e.nodeId}" has no selected sandbox source.`);assertUniqueBy(n,e=>e.name,`tool name`),assertUniqueBy(r,e=>e.slug,`dynamic tool slug`),assertUniqueBy(c,e=>e.connectionName,`connection name`),assertUniqueBy(l,e=>e.slug,`dynamic connection slug`),assertUniqueBy(i,e=>e.name,`skill name`),assertStaticConnectionOwnership({connectionNames:c.map(e=>e.connectionName),subagentNames:t.projected.subagents.filter(e=>g.has(e.candidate.sourceId)).map(e=>e.source.subagentId),toolNames:n.map(e=>e.name)});let v=compileChannelRoutes(t,m,this.diagnostics,e.nodeId),y=compileExtensionMounts(e.manifest,t.composed,e.nodePath);for(let e of y)t.evaluation.requireRuntimeEntry(e.mountSourceId);let b=t.evaluation.finalizeBindings();return createCompiledAgentResources({agentRoot:e.manifest.agentRoot,appRoot:e.manifest.appRoot,bindings:b,channelRoutes:v,connections:c,diagnosticsSummary:summarizeCompilerDiagnostics(this.diagnostics),dynamicConnections:l,dynamicInstructions:s,dynamicSkills:a,dynamicTools:r,extensionMounts:y,hooks:d,memories:u,instructions:o,sandbox:h,sandboxWorkspaces:e.manifest.sandboxWorkspaces.map(e=>({logicalPath:e.logicalPath,rootEntries:[...e.rootEntries],sourceId:e.sourceId,sourcePath:e.sourcePath})),schedules:f,scheduleCollections:p,skills:i,sourceComposition:t.composed.composition,tools:n})}};export{compileAgentManifest};
@@ -53,6 +53,12 @@ export declare function projectAgentSources(input: {
53
53
  readonly owner?: AgentSourceOwner;
54
54
  readonly mountId?: string;
55
55
  }): ProjectedAgentSources;
56
+ /**
57
+ * Lists the application module files a compile may evaluate, across local
58
+ * subagents, so they can be bundled as one shared graph. Extension mounts load
59
+ * with their own scope and are left out.
60
+ */
61
+ export declare function listApplicationModulePaths(manifest: AgentSourceManifest): string[];
56
62
  export declare function projectSelectedSources(input: {
57
63
  readonly candidates: Iterable<AgentSourceCandidate>;
58
64
  readonly resources: readonly ProjectedResourceSource[];