eve 0.79.2 → 0.80.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.
- package/CHANGELOG.md +21 -0
- package/dist/src/compiled/.vendor-stamp.json +6 -6
- package/dist/src/compiled/@chat-adapter/slack/api.d.ts +6 -0
- package/dist/src/compiled/@chat-adapter/slack/api.js +1 -1
- package/dist/src/compiled/@chat-adapter/slack/blocks.js +1 -1
- package/dist/src/compiled/@chat-adapter/slack/format.js +1 -1
- package/dist/src/compiled/@chat-adapter/slack/index.d.ts +14 -8
- package/dist/src/compiled/@chat-adapter/slack/index.js +33 -32
- package/dist/src/compiled/@chat-adapter/twilio/index.d.ts +37 -1
- package/dist/src/compiled/@chat-adapter/twilio/index.js +2 -2
- package/dist/src/compiled/@linqapp/chat-sdk-adapter/index.js +1 -1
- package/dist/src/compiled/@photon-ai/chat-adapter-imessage/index.js +1 -1
- package/dist/src/compiled/@vercel/connect/index.js +5 -5
- package/dist/src/compiled/@vercel/connect/token.d.ts +11 -1
- package/dist/src/compiled/_chunks/node/chunk-NBSLXVG3-Bt7pDfyn.js +12 -0
- package/dist/src/compiled/_chunks/node/dist-BKsV21Vu.js +6 -0
- package/dist/src/compiled/_chunks/node/dist-CO_n_hUa.js +98 -0
- package/dist/src/compiled/chat/index.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +6 -6
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +8 -4
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-connection.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/context/schedule-collection-tools.js +1 -1
- package/dist/src/execution/catalog/connection-auth.d.ts +4 -2
- package/dist/src/execution/catalog/connection-auth.js +1 -1
- package/dist/src/execution/catalog/connection-entry.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/session/entry.js +1 -1
- package/dist/src/execution/session-event-stream.js +1 -1
- package/dist/src/execution/stable-workflow-names.d.ts +2 -0
- package/dist/src/execution/stable-workflow-names.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/web-fetch/execute.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +6 -0
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/extensions/git/extension/extension.d.ts +3 -1
- package/dist/src/extensions/git/extension/extension.js +1 -1
- package/dist/src/extensions/git/extension/lib/gh-tool.js +1 -1
- package/dist/src/extensions/git/extension/lib/github-shell.d.ts +14 -0
- package/dist/src/extensions/git/extension/lib/github-shell.js +1 -1
- package/dist/src/harness/model-call/call.js +1 -1
- package/dist/src/harness/model-call/errors.d.ts +2 -2
- package/dist/src/harness/model-call/recovery.d.ts +2 -3
- package/dist/src/instrumentation/session-init.d.ts +2 -1
- package/dist/src/instrumentation/session-init.js +1 -1
- package/dist/src/internal/application/stamped-package-version.js +1 -1
- package/dist/src/internal/authored-definition/connection.js +1 -1
- package/dist/src/internal/authored-definition/schedule-collection.js +1 -1
- package/dist/src/internal/nitro/host/application-route-registry.d.ts +7 -2
- package/dist/src/internal/nitro/host/application-route-registry.js +1 -1
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +1 -1
- package/dist/src/internal/nitro/routes/channel-request-instrumentation.d.ts +3 -1
- package/dist/src/internal/nitro/routes/channel-request-instrumentation.js +1 -1
- package/dist/src/internal/nitro/routes/connection-events.d.ts +5 -0
- package/dist/src/internal/nitro/routes/connection-events.js +1 -0
- package/dist/src/internal/workflow-bundle/builder.js +1 -1
- package/dist/src/internal/workflow-bundle/dynamic-tool-ast-references.js +1 -1
- package/dist/src/public/channels/slack/blocks.js +2 -2
- package/dist/src/public/connections/index.d.ts +1 -0
- package/dist/src/public/definitions/connections/events.d.ts +43 -0
- package/dist/src/public/definitions/connections/events.js +1 -0
- package/dist/src/public/definitions/connections/mcp.d.ts +3 -0
- package/dist/src/public/schedules/subscription.d.ts +4 -3
- package/dist/src/runtime/connections/events/actions.d.ts +17 -0
- package/dist/src/runtime/connections/events/actions.js +1 -0
- package/dist/src/runtime/connections/events/delivery.d.ts +10 -0
- package/dist/src/runtime/connections/events/delivery.js +1 -0
- package/dist/src/runtime/connections/events/dispatch-step.d.ts +20 -0
- package/dist/src/runtime/connections/events/dispatch-step.js +1 -0
- package/dist/src/runtime/connections/events/lifecycle-step.d.ts +42 -0
- package/dist/src/runtime/connections/events/lifecycle-step.js +1 -0
- package/dist/src/runtime/connections/events/owner.d.ts +38 -0
- package/dist/src/runtime/connections/events/owner.js +1 -0
- package/dist/src/runtime/connections/events/path.d.ts +4 -0
- package/dist/src/runtime/connections/events/path.js +1 -0
- package/dist/src/runtime/connections/events/state.d.ts +37 -0
- package/dist/src/runtime/connections/events/state.js +1 -0
- package/dist/src/runtime/connections/events/workflow.d.ts +28 -0
- package/dist/src/runtime/connections/events/workflow.js +1 -0
- package/dist/src/runtime/connections/mcp-client.d.ts +4 -2
- package/dist/src/runtime/connections/mcp-client.js +1 -1
- package/dist/src/runtime/connections/openapi-client.js +1 -1
- package/dist/src/runtime/connections/scoped-authorization.js +1 -1
- package/dist/src/runtime/resolve-connection.js +1 -1
- package/dist/src/runtime/schedules/collection-client.d.ts +0 -2
- package/dist/src/runtime/schedules/collection-client.js +1 -1
- package/dist/src/runtime/types.d.ts +11 -0
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +2 -2
- package/dist/src/setup/scaffold/update/channels.js +1 -1
- package/dist/src/setup/scaffold/update/connections.js +2 -2
- package/dist/src/setup/scaffold/version-tokens.d.ts +1 -1
- package/dist/src/setup/scaffold/version-tokens.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +12 -4
- package/dist/src/shared/connection-events.d.ts +84 -0
- package/dist/src/shared/connection-events.js +1 -0
- package/dist/src/shared/connection-types.d.ts +10 -0
- package/dist/src/shared/validate-authorization.js +1 -1
- package/dist/src/tools/provided/ask-question-workflow.js +1 -1
- package/dist/src/tools/provided/no-reply.d.ts +5 -0
- package/dist/src/tools/provided/sleep-workflow.js +1 -1
- package/dist/src/tracing/eve/connection-events.d.ts +25 -0
- package/dist/src/tracing/eve/connection-events.js +1 -0
- package/dist/src/tracing/eve/install-instrumentation-runtime.js +1 -1
- package/dist/src/tracing/eve/mcp.d.ts +1 -0
- package/dist/src/tracing/eve/mcp.js +1 -1
- package/dist/src/tracing/eve/otel-declaration.d.ts +5 -0
- package/docs/agent-config.md +38 -13
- package/docs/code-extension.mdx +28 -0
- package/docs/concepts/built-in-tools.md +2 -0
- package/docs/connections/mcp.mdx +105 -0
- package/docs/guides/instrumentation/otel.mdx +10 -0
- package/docs/sandbox/vercel.mdx +46 -0
- package/package.json +7 -7
- package/dist/src/compiled/_chunks/node/chunk-6QHBXN7B-gl4n6nmi.js +0 -12
- package/dist/src/compiled/_chunks/node/dist-DYDVZ-FS.js +0 -98
- package/dist/src/compiled/_chunks/node/dist-iEFkK9qw.js +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,A as t,At as n,B as r,C as i,Ct as a,D as o,Dt as s,E as c,Et as l,F as u,Ft as d,G as f,H as p,I as m,It as h,J as g,K as _,L as v,Lt as y,M as b,Mt as x,N as S,Nt as C,O as w,Ot as T,P as E,Pt as D,Q as O,R as k,Rt as A,S as j,St as M,T as N,Tt as P,U as F,V as I,W as L,X as R,Y as z,Z as B,_ as V,_t as H,a as U,at as W,b as G,bt as K,c as q,ct as J,d as Y,dt as X,et as Z,f as Q,ft as $,g as ee,gt as te,h as ne,ht as re,i as ie,it as ae,j as oe,jt as se,k as ce,kt as le,l as ue,lt as de,m as fe,mt as pe,n as me,nt as he,o as ge,ot as _e,p as ve,pt as ye,q as be,r as xe,rt as Se,s as Ce,st as we,t as Te,tt as Ee,u as De,ut as Oe,v as ke,vt as Ae,w as je,wt as Me,x as Ne,xt as Pe,y as Fe,yt as Ie,z as Le,zt as Re}from"../_chunks/node/dist-
|
|
1
|
+
import{$ as e,A as t,At as n,B as r,C as i,Ct as a,D as o,Dt as s,E as c,Et as l,F as u,Ft as d,G as f,H as p,I as m,It as h,J as g,K as _,L as v,Lt as y,M as b,Mt as x,N as S,Nt as C,O as w,Ot as T,P as E,Pt as D,Q as O,R as k,Rt as A,S as j,St as M,T as N,Tt as P,U as F,V as I,W as L,X as R,Y as z,Z as B,_ as V,_t as H,a as U,at as W,b as G,bt as K,c as q,ct as J,d as Y,dt as X,et as Z,f as Q,ft as $,g as ee,gt as te,h as ne,ht as re,i as ie,it as ae,j as oe,jt as se,k as ce,kt as le,l as ue,lt as de,m as fe,mt as pe,n as me,nt as he,o as ge,ot as _e,p as ve,pt as ye,q as be,r as xe,rt as Se,s as Ce,st as we,t as Te,tt as Ee,u as De,ut as Oe,v as ke,vt as Ae,w as je,wt as Me,x as Ne,xt as Pe,y as Fe,yt as Ie,z as Le,zt as Re}from"../_chunks/node/dist-CO_n_hUa.js";export{Te as Actions,W as BaseFormatConverter,me as Button,xe as Card,ie as CardLink,U as CardText,f as ChannelImpl,ge as Chart,Ce as Chat,_ as ChatError,be as ConsoleLogger,q as DEFAULT_EMOJI_MAP,ue as DateInput,De as Divider,Y as EmojiResolver,Q as ExternalSelect,ve as Field,fe as Fields,ne as HistoryApiImpl,ee as Image,V as LinkButton,g as LockError,z as Message,ke as MessageHistoryCache,Fe as Modal,R as NotImplementedError,G as NumberInput,Ne as Plan,j as RadioSelect,B as RateLimitError,i as Section,je as Select,N as SelectOption,O as StreamingMarkdownRenderer,c as StreamingPlan,e as THREAD_STATE_TTL_MS,o as Table,w as TextInput,ce as ThreadHistoryCache,Z as ThreadImpl,_e as blockquote,t as cardChildToFallbackText,we as chartElementToFallbackText,J as codeBlock,oe as convertEmojiPlaceholders,b as createEmoji,S as defaultEmojiResolver,Ee as deriveChannelId,E as emoji,de as emphasis,he as fromFullStream,u as fromReactElement,m as fromReactModalElement,v as getEmoji,Oe as getNodeChildren,X as getNodeValue,$ as inlineCode,ye as isBlockquoteNode,k as isCardElement,pe as isCodeNode,re as isDeleteNode,te as isEmphasisNode,H as isInlineCodeNode,Le as isJSX,Ae as isLinkNode,Ie as isListItemNode,K as isListNode,r as isModalElement,Pe as isParagraphNode,Se as isPostableObject,M as isStrongNode,a as isTableCellNode,Me as isTableNode,P as isTableRowNode,l as isTextNode,s as link,T as markdownToPlainText,le as paragraph,n as parseMarkdown,ae as reviver,se as root,x as strikethrough,C as stringifyMarkdown,D as strong,d as tableElementToAscii,h as tableToAscii,y as text,L as toAiMessages,I as toCardElement,p as toModalElement,A as toPlainText,F as toPromptEntries,Re as walkAst};
|
|
@@ -11,8 +11,8 @@ declare const EXTENSION_CAPABILITY_CONTRACTS: {
|
|
|
11
11
|
readonly dropped: {};
|
|
12
12
|
};
|
|
13
13
|
readonly tool: {
|
|
14
|
-
readonly current:
|
|
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];
|
|
14
|
+
readonly current: 92;
|
|
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];
|
|
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:
|
|
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];
|
|
78
|
+
readonly current: 86;
|
|
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];
|
|
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";
|
|
@@ -162,8 +162,8 @@ declare const EXTENSION_CAPABILITY_CONTRACTS: {
|
|
|
162
162
|
};
|
|
163
163
|
};
|
|
164
164
|
readonly connection: {
|
|
165
|
-
readonly current:
|
|
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];
|
|
165
|
+
readonly current: 50;
|
|
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];
|
|
167
167
|
readonly dropped: {
|
|
168
168
|
readonly 9: "Dynamic connection resolvers no longer receive conversation or channel continuation data";
|
|
169
169
|
readonly 10: "Message and reasoning append events now expose deltas instead of cumulative snapshots.";
|
|
@@ -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:91,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],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:85,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],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:61,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],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:33,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],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:38,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],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:49,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],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:46,supported:[20,21,22,23,25,27,31,32,33,34,35,36,37,38,39,41,42,43,44,45,46],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:38,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],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:39,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],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:92,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],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:86,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],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:61,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],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:33,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],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:38,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],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:50,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],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:46,supported:[20,21,22,23,25,27,31,32,33,34,35,36,37,38,39,41,42,43,44,45,46],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:38,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],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:39,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],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};
|
|
@@ -291,7 +291,7 @@ declare const compiledScheduleCollectionDefinitionSchema: z.ZodObject<{
|
|
|
291
291
|
providerKind: z.ZodString;
|
|
292
292
|
sourceId: z.ZodString;
|
|
293
293
|
sourceKind: z.ZodLiteral<"module">;
|
|
294
|
-
tools: z.ZodOptional<z.ZodBoolean
|
|
294
|
+
tools: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"deferred">]>>;
|
|
295
295
|
}, z.core.$strict>;
|
|
296
296
|
declare const compiledSandboxDefinitionSchema: z.ZodObject<{
|
|
297
297
|
providerName: z.ZodOptional<z.ZodString>;
|
|
@@ -315,6 +315,7 @@ declare const compiledWorkspaceResourceRootSchema: z.ZodObject<{
|
|
|
315
315
|
rootEntries: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
316
316
|
}, z.core.$strict>;
|
|
317
317
|
declare const compiledConnectionDefinitionSchema: z.ZodObject<{
|
|
318
|
+
experimental_events: z.ZodOptional<z.ZodLiteral<true>>;
|
|
318
319
|
connectionName: z.ZodString;
|
|
319
320
|
description: z.ZodString;
|
|
320
321
|
exportName: z.ZodOptional<z.ZodString>;
|
|
@@ -345,6 +346,7 @@ declare const compiledAgentResourcesSchema: z.ZodObject<{
|
|
|
345
346
|
bindings: z.ZodRecord<z.ZodString, z.ZodType<CompiledModuleBinding, unknown, z.core.$ZodTypeInternals<CompiledModuleBinding, unknown>>>;
|
|
346
347
|
channelRoutes: z.ZodType<CompiledChannelRoutePlan, unknown, z.core.$ZodTypeInternals<CompiledChannelRoutePlan, unknown>>;
|
|
347
348
|
connections: z.ZodArray<z.ZodObject<{
|
|
349
|
+
experimental_events: z.ZodOptional<z.ZodLiteral<true>>;
|
|
348
350
|
connectionName: z.ZodString;
|
|
349
351
|
description: z.ZodString;
|
|
350
352
|
exportName: z.ZodOptional<z.ZodString>;
|
|
@@ -422,7 +424,7 @@ declare const compiledAgentResourcesSchema: z.ZodObject<{
|
|
|
422
424
|
providerKind: z.ZodString;
|
|
423
425
|
sourceId: z.ZodString;
|
|
424
426
|
sourceKind: z.ZodLiteral<"module">;
|
|
425
|
-
tools: z.ZodOptional<z.ZodBoolean
|
|
427
|
+
tools: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"deferred">]>>;
|
|
426
428
|
}, z.core.$strict>>>;
|
|
427
429
|
remoteAgents: z.ZodArray<z.ZodType<Readonly<ModuleSourceRef & Node & {
|
|
428
430
|
description: string;
|
|
@@ -489,6 +491,7 @@ declare const compiledAgentNodeManifestSchema: z.ZodObject<{
|
|
|
489
491
|
bindings: z.ZodRecord<z.ZodString, z.ZodType<CompiledModuleBinding, unknown, z.core.$ZodTypeInternals<CompiledModuleBinding, unknown>>>;
|
|
490
492
|
channelRoutes: z.ZodType<CompiledChannelRoutePlan, unknown, z.core.$ZodTypeInternals<CompiledChannelRoutePlan, unknown>>;
|
|
491
493
|
connections: z.ZodArray<z.ZodObject<{
|
|
494
|
+
experimental_events: z.ZodOptional<z.ZodLiteral<true>>;
|
|
492
495
|
connectionName: z.ZodString;
|
|
493
496
|
description: z.ZodString;
|
|
494
497
|
exportName: z.ZodOptional<z.ZodString>;
|
|
@@ -566,7 +569,7 @@ declare const compiledAgentNodeManifestSchema: z.ZodObject<{
|
|
|
566
569
|
providerKind: z.ZodString;
|
|
567
570
|
sourceId: z.ZodString;
|
|
568
571
|
sourceKind: z.ZodLiteral<"module">;
|
|
569
|
-
tools: z.ZodOptional<z.ZodBoolean
|
|
572
|
+
tools: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"deferred">]>>;
|
|
570
573
|
}, z.core.$strict>>>;
|
|
571
574
|
remoteAgents: z.ZodArray<z.ZodType<Readonly<ModuleSourceRef & Node & {
|
|
572
575
|
description: string;
|
|
@@ -665,6 +668,7 @@ export declare const compiledAgentManifestSchema: z.ZodObject<{
|
|
|
665
668
|
channelRoutes: z.ZodType<CompiledChannelRoutePlan, unknown, z.core.$ZodTypeInternals<CompiledChannelRoutePlan, unknown>>;
|
|
666
669
|
config: z.ZodType<CompiledAgentDefinition, unknown, z.core.$ZodTypeInternals<CompiledAgentDefinition, unknown>>;
|
|
667
670
|
connections: z.ZodArray<z.ZodObject<{
|
|
671
|
+
experimental_events: z.ZodOptional<z.ZodLiteral<true>>;
|
|
668
672
|
connectionName: z.ZodString;
|
|
669
673
|
description: z.ZodString;
|
|
670
674
|
exportName: z.ZodOptional<z.ZodString>;
|
|
@@ -773,7 +777,7 @@ export declare const compiledAgentManifestSchema: z.ZodObject<{
|
|
|
773
777
|
providerKind: z.ZodString;
|
|
774
778
|
sourceId: z.ZodString;
|
|
775
779
|
sourceKind: z.ZodLiteral<"module">;
|
|
776
|
-
tools: z.ZodOptional<z.ZodBoolean
|
|
780
|
+
tools: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"deferred">]>>;
|
|
777
781
|
}, z.core.$strict>>>;
|
|
778
782
|
skills: z.ZodReadonly<z.ZodArray<z.ZodType<CompiledSkillDefinition, unknown, z.core.$ZodTypeInternals<CompiledSkillDefinition, unknown>>>>;
|
|
779
783
|
subagents: z.ZodArray<z.ZodType<CompiledSubagentNode, unknown, z.core.$ZodTypeInternals<CompiledSubagentNode, unknown>>>;
|
|
@@ -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.boolean().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({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(),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 +1 @@
|
|
|
1
|
-
import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{extractVercelConnectMetadata}from"#shared/vercel-connect-metadata.js";import{eveNamespaceReservation}from"#protocol/runtime-tools.js";import{normalizeMcpClientConnectionDefinition,normalizeOpenApiConnectionDefinition}from"#internal/authored-definition/connection.js";import{readConnectionProtocol}from"#public/definitions/connections/protocol.js";import{ALLOWED_DYNAMIC_CONNECTION_EVENTS,assertResolverOnlyDynamicSentinel,isDynamicSentinel}from"#dynamic/definition.js";async function compileConnectionDefinition(e,t,n){let r=await loadModuleBackedDefinition({binding:n.binding,kind:`connection`,loadNamespace:n.loadNamespace,source:t}),i=`Expected the connection export "${t.exportName??`default`}" from "${t.logicalPath}" to match the public eve shape.`;if(isDynamicSentinel(r)){assertResolverOnlyDynamicSentinel(r,i);let e=Object.keys(r.events),n=e.find(e=>!ALLOWED_DYNAMIC_CONNECTION_EVENTS.has(e));if(n!==void 0)throw Error(`${i} Dynamic connections support only "session.started" and "turn.started" handlers. Unsupported event: "${n}".`);return{kind:`dynamic-connection`,definition:{eventNames:e,exportName:t.exportName,logicalPath:t.logicalPath,slug:t.connectionName,sourceId:t.sourceId,sourceKind:`module`}}}let a=eveNamespaceReservation(t.connectionName);if(a!==void 0)throw Error(`Connection "${t.logicalPath}" uses the reserved name "${t.connectionName}". Rename its path; ${a}.`);let o=readConnectionProtocol(r),s={connectionName:t.connectionName,exportName:t.exportName,logicalPath:t.logicalPath,sourceId:t.sourceId,sourceKind:`module`},c,l;if(o===`openapi`){let e=normalizeOpenApiConnectionDefinition(r,i);c={...s,description:e.description,protocol:`openapi`,url:e.baseUrl??``},l=e.auth}else{let e=normalizeMcpClientConnectionDefinition(r,i);c={...s,description:e.description,protocol:`mcp
|
|
1
|
+
import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{extractVercelConnectMetadata}from"#shared/vercel-connect-metadata.js";import{eveNamespaceReservation}from"#protocol/runtime-tools.js";import{normalizeMcpClientConnectionDefinition,normalizeOpenApiConnectionDefinition}from"#internal/authored-definition/connection.js";import{readConnectionProtocol}from"#public/definitions/connections/protocol.js";import{ALLOWED_DYNAMIC_CONNECTION_EVENTS,assertResolverOnlyDynamicSentinel,isDynamicSentinel}from"#dynamic/definition.js";async function compileConnectionDefinition(e,t,n){let r=await loadModuleBackedDefinition({binding:n.binding,kind:`connection`,loadNamespace:n.loadNamespace,source:t}),i=`Expected the connection export "${t.exportName??`default`}" from "${t.logicalPath}" to match the public eve shape.`;if(isDynamicSentinel(r)){assertResolverOnlyDynamicSentinel(r,i);let e=Object.keys(r.events),n=e.find(e=>!ALLOWED_DYNAMIC_CONNECTION_EVENTS.has(e));if(n!==void 0)throw Error(`${i} Dynamic connections support only "session.started" and "turn.started" handlers. Unsupported event: "${n}".`);return{kind:`dynamic-connection`,definition:{eventNames:e,exportName:t.exportName,logicalPath:t.logicalPath,slug:t.connectionName,sourceId:t.sourceId,sourceKind:`module`}}}let a=eveNamespaceReservation(t.connectionName);if(a!==void 0)throw Error(`Connection "${t.logicalPath}" uses the reserved name "${t.connectionName}". Rename its path; ${a}.`);let o=readConnectionProtocol(r),s={connectionName:t.connectionName,exportName:t.exportName,logicalPath:t.logicalPath,sourceId:t.sourceId,sourceKind:`module`},c,l;if(o===`openapi`){let e=normalizeOpenApiConnectionDefinition(r,i);c={...s,description:e.description,protocol:`openapi`,url:e.baseUrl??``},l=e.auth}else{let e=normalizeMcpClientConnectionDefinition(r,i);c={...s,description:e.description,protocol:`mcp`,...e.experimental_events===void 0?{}:{experimental_events:!0},url:e.url},l=e.auth}let u=extractVercelConnectMetadata(typeof l!=`object`||!l?void 0:l.vercelConnect);return u!==void 0&&(c.vercelConnect=u),{definition:c,kind:`connection`}}export{compileConnectionDefinition};
|
|
@@ -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:_});n.kind===`connection`?c.push(n.definition):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{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 +1 @@
|
|
|
1
|
-
import{z}from"#compiled/zod/index.js";import{
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{loadContext}from"#context/container.js";import{scheduleDisplayName}from"#runtime/schedules/record.js";import{isDeepStrictEqual}from"node:util";import{parseJsonObject}from"#shared/json.js";import{defineDynamic}from"#dynamic/definition.js";import{scheduleCollectionToolPrefix}from"#shared/schedule-collection-tools.js";import{readDurableDynamicToolCallbacks,stampDurableDynamicToolCallbacks}from"#tools/durable-callbacks.js";import{ContextKey}from"#context/key.js";import{markDynamicCallbackRebind}from"#internal/dynamic-tool-rebind.js";import{isApprovalRecheck}from"#harness/approval-recheck.js";import{bindScheduleCollection,schedules}from"#public/experimental/schedules/client.js";import{MAX_SCHEDULE_DELAY_MINUTES}from"#runtime/schedules/validation.js";import{always}from"#tools/approval/policies.js";import{defineTool}from"#tools/definition.js";const PreparedWritesKey=new ContextKey(`eve.schedulePreparedWrites`),nameSchema=z.string().min(1).max(256).regex(/^[0-9A-Za-z][0-9A-Za-z._-]*$/).describe(`Readable display label; it may repeat. Creation returns a unique management name.`),nameInput=z.object({name:z.string().min(1).max(256).describe(`Exact unique management name returned by create/get/list, not the display label.`)}).strict(),timezoneSchema=z.string().describe(`IANA timezone; omission means UTC. Delays need no timezone.`),expressionSchema=z.discriminatedUnion(`type`,[z.object({type:z.literal(`cron`),cron:z.string().describe(`Five-field cron: minute hour day-of-month month day-of-week.`),timezone:timezoneSchema.optional(),jitter:z.number().int().min(1).max(15).optional()}).strict(),z.object({type:z.literal(`single`),at:z.string().describe(`Local YYYY-MM-DDTHH:mm, without offset or fractions.`),timezone:timezoneSchema.optional()}).strict(),z.object({type:z.literal(`delay`),minutes:z.number().int().min(1).max(MAX_SCHEDULE_DELAY_MINUTES)}).strict()]),timingGuidance=`For relative requests use expression { type: 'delay', minutes: 1 }; eve resolves timing after approval and rounds up to minute precision (up to 59 seconds later). Do not guess the clock or ask for a timezone for delays.`;function createScheduleCollectionToolDynamicDefinition(e,t){let bind=()=>bindScheduleCollection(e);return markDynamicCallbackRebind(defineDynamic({events:{"turn.started":async()=>{if(e.tool===!1)return null;let n=`${scheduleCollectionToolPrefix(t.collection)}__`,keyFor=(e,t)=>`${n}${e}:${t}`,r=z.object({name:nameSchema,expression:expressionSchema,payload:e.inputSchema}).strict(),i=r.partial({expression:!0,payload:!0}).extend({name:nameInput.shape.name}).refine(e=>e.expression!==void 0||e.payload!==void 0,{message:`Schedule update requires an expression or replacement payload.`}),a=writeApproval(e.approval?.create??always(),e=>keyFor(`create`,e),async e=>(await bind()).prepareCreate(await r.parseAsync(e)),e=>e.envelope.payload),o=writeApproval(e.approval?.update??always(),e=>keyFor(`update`,e),async e=>{let{name:t,expression:n,payload:r}=await i.parseAsync(e),a=await bind();return n===void 0?a.prepareUpdate(t,{payload:r}):a.prepareUpdate(t,{expression:n,payload:r})},e=>e.envelope?.payload),define=(t,n,r,i,a)=>{let o=defineTool({deferred:e.tool===`deferred`,description:`${e.description?`${e.description}\n\n`:``}${n}`,inputSchema:r,approval:a,label:{start:e=>e.name?`${t}: ${scheduleDisplayName(e.name)}`:t},execute:i});return stampCallbacks(o),o};return{[`${n}create`]:define(`Create schedule`,`Create future work, not an immediate action. The display name may repeat; use the returned unique name for management. ${timingGuidance} Preparation validates the destination before approval; a changed prepared payload requires fresh approval.`,r,async(t,n)=>{let r=keyFor(`create`,n.callId),i=loadContext().get(PreparedWritesKey)?.[r];if(i===void 0||!(`displayName`in i))throw Error(`Schedule creation has no prepared approval snapshot. Request creation again.`);let a=await(await bindScheduleCollection(e)).create(t,i),o={...loadContext().get(PreparedWritesKey)};return delete o[r],loadContext().set(PreparedWritesKey,o),a},a),[`${n}update`]:define(`Update schedule`,`Replace timing and/or the complete payload of an existing schedule. A payload replacement prepares new work and makes the updating caller its creator; timing-only updates preserve ownership. State and dispatch target are unchanged. Already started work is not cancelled. ${timingGuidance}`,i,async({name:t,...n},r)=>{let i=keyFor(`update`,r.callId),a=loadContext().get(PreparedWritesKey)?.[i];if(a===void 0||!(`name`in a))throw Error(`Schedule update has no prepared approval snapshot. Request update again.`);let o=await(await bindScheduleCollection(e)).update(t,n,a),s={...loadContext().get(PreparedWritesKey)};return delete s[i],loadContext().set(PreparedWritesKey,s),o},o),[`${n}get`]:define(`Read schedule`,`Read timing/state; stored payload is not returned.`,nameInput,async({name:t})=>await(await schedules(e)).get(t),e.approval?.get),[`${n}list`]:define(`List schedules`,`List identity, timing/state, and timestamps; payload is not returned.`,z.object({cursor:z.string().optional(),limit:z.number().int().min(1).max(100).optional()}).strict(),async t=>await(await schedules(e)).list(t),e.approval?.list),[`${n}enable`]:define(`Enable schedule`,`Enable future occurrences.`,nameInput,async({name:t})=>await(await schedules(e)).enable(t),e.approval?.enable??always()),[`${n}disable`]:define(`Disable schedule`,`Disable future occurrences; already started work is not cancelled.`,nameInput,async({name:t})=>await(await schedules(e)).disable(t),e.approval?.disable??always()),[`${n}invoke`]:define(`Run schedule`,`Enqueue an extra occurrence as the stored creator; acceptance is not execution success.`,nameInput,async({name:t})=>(await(await schedules(e)).invoke(t),{accepted:!0}),e.approval?.invoke??always()),[`${n}delete`]:define(`Delete schedule`,`Delete a schedule; already started work is not cancelled.`,nameInput,async({name:t})=>({deleted:await(await schedules(e)).delete(t)}),e.approval?.delete??always())}}}}))}function writeApproval(e,t,n,r){let i={request:async i=>{try{let a=await n(i.toolInput),o=t(i.callId),s=loadContext().get(PreparedWritesKey)??{};if(isApprovalRecheck(i)){if(s[o]===void 0||!isDeepStrictEqual(s[o],a))return{type:`denied`,reason:`The prepared schedule changed or its approval expired. Request a new approval.`}}else{let e={...Object.fromEntries(Object.entries(s).filter(([e])=>e!==o).slice(-31)),[o]:a};for(;Buffer.byteLength(JSON.stringify(e))>524288;)delete e[Object.keys(e)[0]];loadContext().set(PreparedWritesKey,e)}let c=r(a),l={...i,toolInput:{...i.toolInput,payload:c},payload:c};return typeof e==`function`?await e(l):await e.request(l)}catch(e){return{type:`denied`,reason:e instanceof Error?e.message:`Schedule preparation failed.`}}}};return typeof e!=`function`&&e.response!==void 0&&(i.response=async n=>{let i=loadContext().get(PreparedWritesKey)?.[t(n.request.callId)];if(i===void 0)return{status:`rejected`,reason:`The prepared schedule approval expired. Request approval again.`};let a=r(i);return await e.response({...n,request:{...n.request,toolInput:{...n.request.toolInput,payload:a}},payload:a})}),i}function stampCallbacks(e){let t=parseJsonObject({}),n={...readDurableDynamicToolCallbacks(e),execute:{callback:async(t,n,r)=>await e.execute(n,r),closure:t},inputSchema:{callback:()=>e.inputSchema,closure:t},label:{start:{callback:(t,n)=>e.label.start(n),closure:t}}};if(e.approval!==void 0){let r=e.approval;n.approvalRequest={callback:async(e,t)=>typeof r==`function`?await r(t):await r.request(t),closure:t},typeof r!=`function`&&r.response!==void 0&&(n.approvalResponse={callback:async(e,t)=>await r.response(t),closure:t})}stampDurableDynamicToolCallbacks(e,n)}export{createScheduleCollectionToolDynamicDefinition};
|
|
@@ -34,8 +34,10 @@ export declare function listConnectionTools(connection: ResolvedConnectionDefini
|
|
|
34
34
|
* {@link LISTING_TIMEOUT_MS}, so one hung server can't stall a step. Clients
|
|
35
35
|
* share one in-flight listing and take no signal, so this stops waiting rather
|
|
36
36
|
* than cancelling: a late result fills only that client's cache, and the race
|
|
37
|
-
* handles a late rejection.
|
|
37
|
+
* handles a late rejection. Event discovery runs under the same deadline.
|
|
38
|
+
* The connection's `tools` filter applies to everything listed, remote tools
|
|
39
|
+
* and eve's event actions alike, and a call only runs a listed tool.
|
|
38
40
|
*/
|
|
39
|
-
export declare function listToolMetadata(
|
|
41
|
+
export declare function listToolMetadata(connection: Pick<ResolvedConnectionDefinition, "connectionName" | "tools">, client: ConnectionClient): Promise<readonly ConnectionToolMetadata[]>;
|
|
40
42
|
/** Why a connection's tools could not be listed, for a failure other than a needed sign-in. */
|
|
41
43
|
export declare function listingFailureMessage(connectionName: string, error: unknown): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createLogger}from"#internal/logging.js";import{toErrorMessage}from"#shared/errors.js";import{CALL_TOOL_NAME}from"#protocol/catalog-tools.js";import{isConnectionAuthorizationFailedError,isConnectionAuthorizationRequiredError}from"#connections/errors.js";import{getAuthorizationResults}from"#harness/authorization.js";import{resolveConnectionAuthorization}from"#runtime/connections/resolve-authorization.js";import{createAuthorizationExecution}from"#runtime/connections/scoped-authorization.js";import{supportsInteractiveAuthorization}from"#shared/connection-types.js";const log=createLogger(`framework.catalog-connections`);async function completeConnectionSignIn(e,t){assertPendingSignInInstance(t);let n=await interactiveAuthorization(t),r=createAuthorizationExecution();n!==void 0&&await r.complete(n);let i=e.getClient(t.connectionName);return n!==void 0&&r.isJustAuthorized(n)&&await i.close(),{auth:r,client:i,scoped:n}}async function listConnectionTools(e,{auth:t,client:n,scoped:r}){let i=e.connectionName;try{return{tools:await listToolMetadata(
|
|
1
|
+
import{createLogger}from"#internal/logging.js";import{toErrorMessage}from"#shared/errors.js";import{CALL_TOOL_NAME}from"#protocol/catalog-tools.js";import{isConnectionAuthorizationFailedError,isConnectionAuthorizationRequiredError}from"#connections/errors.js";import{getAuthorizationResults}from"#harness/authorization.js";import{passesToolFilter}from"#runtime/connections/mcp-client.js";import{resolveConnectionAuthorization}from"#runtime/connections/resolve-authorization.js";import{createAuthorizationExecution}from"#runtime/connections/scoped-authorization.js";import{supportsInteractiveAuthorization}from"#shared/connection-types.js";const log=createLogger(`framework.catalog-connections`);async function completeConnectionSignIn(e,t){assertPendingSignInInstance(t);let n=await interactiveAuthorization(t),r=createAuthorizationExecution();n!==void 0&&await r.complete(n);let i=e.getClient(t.connectionName);return n!==void 0&&r.isJustAuthorized(n)&&await i.close(),{auth:r,client:i,scoped:n}}async function listConnectionTools(e,{auth:t,client:n,scoped:r}){let i=e.connectionName;try{return{tools:await listToolMetadata(e,n)}}catch(e){return isConnectionAuthorizationRequiredError(e)?r===void 0?{failure:`"${i}" requires authorization and cannot start interactive sign-in.`}:t.isJustAuthorized(r)?{failure:`Authorization failed for "${i}": the service rejected the token immediately after authorization.`}:{authorization:r,error:e}:(log.warn(`failed to load connection tools`,{connection:i,error:e}),{failure:listingFailureMessage(i,e)})}}const LISTING_TIMEOUT_MS=1e4;var ListingTimeoutError=class extends Error{};async function listToolMetadata(e,t){let{connectionName:n}=e,r,i=new Promise((e,t)=>{r=setTimeout(()=>{t(new ListingTimeoutError(`"${n}" did not list its tools within ${LISTING_TIMEOUT_MS/1e3}s. Try again later.`))},LISTING_TIMEOUT_MS)});try{return(await listConnectionMetadata(n,t,i)).filter(t=>passesToolFilter(t.name,e.tools))}finally{clearTimeout(r)}}async function listConnectionMetadata(e,t,n){let r=Promise.race([t.getToolMetadata(),n]),i=t.eventActions;if(i===void 0)return r;let[a,o]=await Promise.allSettled([r,listEventActions(e,i,n)]);for(let e of[a,o])if(e.status===`rejected`&&isConnectionAuthorizationRequiredError(e.reason))throw e.reason;let s=o.status===`fulfilled`?o.value:[];if(a.status===`rejected`){if(s.length>0)return s;throw a.reason}let c=a.value;if(c.some(e=>i.ownsName(e.name)))throw Error(`Remote tool names conflict with eve's event action namespace.`);return[...c,...s]}async function listEventActions(e,t,n){try{return await Promise.race([t.metadata(),n])}catch(n){if(isConnectionAuthorizationRequiredError(n))throw n;return log.warn(`failed to discover connection events`,{connection:e,error:n}),t.recoveryMetadata()}}function listingFailureMessage(e,t){return t instanceof ListingTimeoutError?t.message:isConnectionAuthorizationFailedError(t)?`Authorization failed for "${e}": ${t.message}`:`Failed to load tools for "${e}": ${toErrorMessage(t)}`}async function interactiveAuthorization(e){let t=await resolveConnectionAuthorization(e);if(t!==void 0&&supportsInteractiveAuthorization(t))return{scope:e.connectionName,instanceId:e.instanceId,connection:{url:e.url??``},authorization:t}}function assertPendingSignInInstance(e){for(let t of getAuthorizationResults())if(t.name===e.connectionName&&t.instanceId!==void 0&&t.instanceId!==e.instanceId)throw Error(`Authorization for "${t.name}" cannot complete because its resolved connection changed while sign-in was pending. Sign in again with ${CALL_TOOL_NAME}({ name: "${t.name}" }).`)}export{completeConnectionSignIn,listConnectionTools,listToolMetadata,listingFailureMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{completeConnectionSignIn,listConnectionTools,listToolMetadata,listingFailureMessage}from"./connection-auth.js";import{closestNames}from"./rank.js";import{connectionToolSignature}from"./signatures.js";import{isObject}from"#shared/guards.js";import{loadContext}from"#context/container.js";import{displayProperName,displayTitle}from"#shared/display-name.js";import{SEARCH_TOOL_NAME}from"#protocol/catalog-tools.js";import{defineJsonSchema,refineJsonSchema}from"#tools/schema.js";import{connectionToolName}from"#connections/ownership.js";import{ContextKey}from"#context/key.js";import{resolveApprovalPolicy}from"#approval/definition.js";import{isApprovalRecheck,markApprovalRecheck}from"#harness/approval-recheck.js";import{isConnectionAuthorizationRequiredError}from"#connections/errors.js";import{connectionToolModelOutput,toConnectionToolResult}from"#runtime/connections/tool-result.js";const CONNECTION_CHANGED_MESSAGE=`The connection for this tool call changed or is unavailable. Request a new tool call and approval.`,ConnectionApprovalPinsKey=new ContextKey(`eve.connectionApprovalPins`);function instanceKey(e){return e.instanceId??``}function connectionEntry(e,t,n){let r=`${displayProperName(t.connectionName)}: ${displayTitle(n)}`;return{approval:connectionApproval(e,t,n),deferred:!0,description:``,execute:(r,i)=>callConnectionTool(e,t,n,r,i),inputSchema:refineJsonSchema({},r=>checkInput(e,t,n,r)),label:{start:()=>r},name:connectionToolName(t.connectionName,n),toModelOutput:connectionToolModelOutput}}function connectionSignInEntry(e,t){let n=displayProperName(t.connectionName),r=`Sign in to use the ${n} tools`;return{deferred:!0,description:t.description===``?`${r}.`:`${r}: ${t.description}`,execute:()=>connect(e,t),inputSchema:defineJsonSchema({type:`object`,properties:{},additionalProperties:!1}),label:{start:()=>`Sign in to ${n}`},name:t.connectionName}}async function connect(e,t){let n=await completeConnectionSignIn(e,t),r=await listConnectionTools(t,n);if(`failure`in r)throw Error(r.failure);if(`authorization`in r)return await n.auth.handleError(r.error,r.authorization);let i=displayProperName(t.connectionName),a=`${SEARCH_TOOL_NAME}({ query: "${t.connectionName}__" })`;return n.scoped!==void 0&&n.auth.isJustAuthorized(n.scoped)?`Signed in to ${i}. Find the ${i} tools with ${a}.`:`The ${i} tools are available. Find them with ${a}.`}async function callConnectionTool(e,t,n,r,i){releaseApprovalPin(i.toolCallId,t);let a=await completeConnectionSignIn(e,t),{auth:o,client:s,scoped:c}=a,l=await listConnectionTools(t,a);if(`failure`in l)throw Error(l.failure);if(`authorization`in l)return await o.handleError(l.error,l.authorization);let u=await checkCall(t,l.tools,n,r);if(`issues`in
|
|
1
|
+
import{completeConnectionSignIn,listConnectionTools,listToolMetadata,listingFailureMessage}from"./connection-auth.js";import{closestNames}from"./rank.js";import{connectionToolSignature}from"./signatures.js";import{isObject}from"#shared/guards.js";import{loadContext}from"#context/container.js";import{displayProperName,displayTitle}from"#shared/display-name.js";import{SEARCH_TOOL_NAME}from"#protocol/catalog-tools.js";import{defineJsonSchema,refineJsonSchema}from"#tools/schema.js";import{connectionToolName}from"#connections/ownership.js";import{ContextKey}from"#context/key.js";import{resolveApprovalPolicy}from"#approval/definition.js";import{isApprovalRecheck,markApprovalRecheck}from"#harness/approval-recheck.js";import{isConnectionAuthorizationRequiredError}from"#connections/errors.js";import{connectionToolModelOutput,toConnectionToolResult}from"#runtime/connections/tool-result.js";const CONNECTION_CHANGED_MESSAGE=`The connection for this tool call changed or is unavailable. Request a new tool call and approval.`,ConnectionApprovalPinsKey=new ContextKey(`eve.connectionApprovalPins`);function instanceKey(e){return e.instanceId??``}function connectionEntry(e,t,n){let r=`${displayProperName(t.connectionName)}: ${displayTitle(n)}`;return{approval:connectionApproval(e,t,n),deferred:!0,description:``,execute:(r,i)=>callConnectionTool(e,t,n,r,i),inputSchema:refineJsonSchema({},r=>checkInput(e,t,n,r)),label:{start:()=>r},name:connectionToolName(t.connectionName,n),toModelOutput:connectionToolModelOutput}}function connectionSignInEntry(e,t){let n=displayProperName(t.connectionName),r=`Sign in to use the ${n} tools`;return{deferred:!0,description:t.description===``?`${r}.`:`${r}: ${t.description}`,execute:()=>connect(e,t),inputSchema:defineJsonSchema({type:`object`,properties:{},additionalProperties:!1}),label:{start:()=>`Sign in to ${n}`},name:t.connectionName}}async function connect(e,t){let n=await completeConnectionSignIn(e,t),r=await listConnectionTools(t,n);if(`failure`in r)throw Error(r.failure);if(`authorization`in r)return await n.auth.handleError(r.error,r.authorization);let i=displayProperName(t.connectionName),a=`${SEARCH_TOOL_NAME}({ query: "${t.connectionName}__" })`;return n.scoped!==void 0&&n.auth.isJustAuthorized(n.scoped)?`Signed in to ${i}. Find the ${i} tools with ${a}.`:`The ${i} tools are available. Find them with ${a}.`}async function callConnectionTool(e,t,n,r,i){releaseApprovalPin(i.toolCallId,t);let a=await completeConnectionSignIn(e,t),{auth:o,client:s,scoped:c}=a,l=await listConnectionTools(t,a);if(`failure`in l)throw Error(l.failure);if(`authorization`in l)return await o.handleError(l.error,l.authorization);let u=s.eventActions?.ownsName(n)===!0,d=await checkCall(t,l.tools,n,r,!u);if(`issues`in d)throw Error(issuesMessage(d.issues));let{input:f,tool:p}=d,m;try{if(u)return await s.eventActions.execute(p.name,f,{abortSignal:i.abortSignal,callId:i.toolCallId});m=await s.executeTool(p.name,f,{abortSignal:i.abortSignal,callId:i.toolCallId})}catch(e){if(isConnectionAuthorizationRequiredError(e))return await o.handleError(e,c);throw e}let h=toConnectionToolResult(t.protocol,p,m);if(!h.ok)throw Error(h.error);return h.value}async function checkInput(e,t,n,r){let i=e.getClient(t.connectionName),a;try{a=await listToolMetadata(t,i)}catch(e){return isConnectionAuthorizationRequiredError(e)?{value:r}:{issues:[{message:listingFailureMessage(t.connectionName,e)}]}}let o=await checkCall(t,a,n,r,i.eventActions?.ownsName(n)!==!0);return`issues`in o?{issues:o.issues}:{value:o.input}}async function checkCall(e,t,n,r,i=!0){let a=t.find(e=>e.name===n);if(a===void 0)return{issues:[{message:unknownToolMessage(e,n,t)}]};let o=i?e.toolCall?.providedArguments??{}:{},s=Object.fromEntries(Object.entries(isObject(r)?r:{}).filter(([e])=>!Object.hasOwn(o,e))),c=await defineJsonSchema(a.inputSchema)[`~standard`].validate(s);return c.issues===void 0?{input:c.value,tool:a}:{issues:[...c.issues,{message:`Signature: ${connectionToolSignature(e,a)}`}]}}function issuesMessage(e){return e.map(({message:e,path:t=[]})=>{let n=t.map(e=>String(typeof e==`object`?e.key:e)).join(`.`);return n.length>0?`${n}: ${e}`:e}).join(` `)}function unknownToolMessage(e,t,n){let{connectionName:r}=e,i=closestNames(t,n).map(e=>connectionToolName(r,e));return`Connection "${r}" has no tool named "${t}".${i.length>0?` Closest tools: ${i.join(`, `)}.`:` Find its tools with ${SEARCH_TOOL_NAME}({ query: "${r}__" }).`}`}function connectionApproval(e,t,n){let{approval:r}=t;if(r===void 0)return;let i=resolveApprovalPolicy(r),request=async r=>requestApproval(t,i,withToolAnnotations(r,await toolAnnotations(e,t,n))),a=typeof r==`function`?void 0:r.response;return a===void 0?request:{request,response:e=>authorizeApprovalResponse(t,a,e)}}async function requestApproval(e,t,n){isApprovalRecheck(n)&&!matchesApprovalPin(n.callId,e)&&markApprovalPinChanged(n.callId);let r=await t(n);return!isApprovalRecheck(n)&&parksForApproval(r)&&pinApprovedInstance(n.callId,e),r}async function toolAnnotations(e,t,n){try{return(await listToolMetadata(t,e.getClient(t.connectionName))).find(e=>e.name===n)?.annotations}catch{return}}function withToolAnnotations(e,t){if(t===void 0)return e;let n={...e,toolAnnotations:t};return isApprovalRecheck(e)?markApprovalRecheck(n):n}function parksForApproval(e){return e===!0||e===`user-approval`||typeof e==`object`&&e.type===`user-approval`}async function authorizeApprovalResponse(e,t,n){return matchesApprovalPin(n.request.callId,e)?await t(n):{reason:CONNECTION_CHANGED_MESSAGE,status:`rejected`}}function pinApprovedInstance(e,t){let n=loadContext();n.get(ConnectionApprovalPinsKey)?.[e]===void 0&&n.set(ConnectionApprovalPinsKey,(n={})=>Object.fromEntries([...Object.entries(n).slice(-49),[e,instanceKey(t)]]))}function matchesApprovalPin(e,t){let n=loadContext().get(ConnectionApprovalPinsKey)?.[e];return n!==void 0&&n===instanceKey(t)}function markApprovalPinChanged(e){loadContext().set(ConnectionApprovalPinsKey,(t={})=>({...t,[e]:`\0changed`}))}function releaseApprovalPin(e,t){let n=loadContext(),r=n.get(ConnectionApprovalPinsKey);if(r?.[e]===void 0)return;let{[e]:i,...a}=r;if(n.set(ConnectionApprovalPinsKey,a),i!==instanceKey(t))throw Error(CONNECTION_CHANGED_MESSAGE)}export{connectionEntry,connectionSignInEntry};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{runJsProgram}from"#execution/dynamic-workflow/workflow.js";async function runWorkflowProgramTask(e,t){"use workflow";return runJsProgram(e.js,t,{maxSubagents:e.maxSubagents??0})}runWorkflowProgramTask.workflowId=`workflow//eve@0.
|
|
1
|
+
import{runJsProgram}from"#execution/dynamic-workflow/workflow.js";async function runWorkflowProgramTask(e,t){"use workflow";return runJsProgram(e.js,t,{maxSubagents:e.maxSubagents??0})}runWorkflowProgramTask.workflowId=`workflow//eve@0.80.0//runWorkflowProgramTask`;export{runWorkflowProgramTask};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{attachClientContext,readClientContext}from"#internal/client-context.js";import{SESSION_INBOX_CONTEXT_KEY,sessionCommandHookToken}from"#execution/session-inbox/address.js";import{readSerializedSessionSchedule}from"#context/session-schedule.js";import{getWorkflowMetadata,getWritable}from"#compiled/@workflow/core/index.js";import{isHookConflictError}from"#execution/hook-ownership.js";import{DEFAULT_SESSION_TIMEOUT_MS,sessionTimeoutDeadline}from"#execution/session/timeout.js";import{sessionHookTokens}from"#execution/session/hook-tokens.js";import{createSessionInbox}from"#execution/session-inbox/inbox.js";import{failSession,runPreparedSession}from"#execution/session/program.js";import{createSessionTimeoutControl}from"#execution/session/timeout-control.js";import{recordSessionOwnerStep,signalSessionOwnerActivationStep,stopUntrackedChildSessionsStep,validateSessionCheckpointStep}from"#execution/session/handoff-steps.js";import{hasDelegatedSessionContext}from"#execution/delegated-session-context.js";import{readChannelRequestId,readRootSessionId}from"#execution/eve-workflow-attributes.js";import{createTurnControl}from"#execution/session/turn-control.js";import{resolveInitialTurnCallerStep}from"#subagents/parent-notification.js";import{normalizeSerializableError}from"#execution/workflow-errors.js";import{createSessionStep}from"#execution/create-session-step.js";import{settleContinuationConflictStep}from"#execution/continuation-conflict-step.js";import{migrateSessionCheckpoint}from"#execution/session/checkpoint-migrations.js";async function workflowEntry(e){"use workflow";let t=e.kind===`initial`?await bootInitialOwner(e,getWorkflowMetadata().workflowRunId):await bootHandoffOwner(e);return t===void 0?{output:``}:{output:(await runPreparedSession(t.session,t.inbox)).output}}function stampSessionIdentity(e,t){return{...e,"eve.sessionId":t,[SESSION_INBOX_CONTEXT_KEY]:{sessionId:t}}}async function prepareInitialOwner(e,t){let[n,r]=await Promise.allSettled([e.claimSessionHook(sessionCommandHookToken(t.sessionId)),t.continuationToken===``?Promise.resolve():e.claimSessionHook(t.continuationToken)]);if(n.status===`rejected`)throw n.reason;if(r.status===`rejected`){if(isHookConflictError(r.reason))return{kind:`alias-conflict`};throw r.reason}let i=createTurnControl(),a=t.deadline===void 0?void 0:createSessionTimeoutControl({deadline:t.deadline,sessionId:t.sessionId}),o={kind:`owned`,timeoutControl:a,turnControl:i,async dispose(){i.dispose(),await a?.dispose()}};return a?.start().catch(()=>{}),o}function unwrapSettled(e){if(e.status===`rejected`)throw e.reason;return e.value}async function disposeInitialBoot(e,t){let[n,r]=await Promise.allSettled([t?.dispose(),e.dispose()]);if(n.status===`rejected`)throw n.reason;if(r.status===`rejected`)throw r.reason}async function bootInitialOwner(e,t){let n=stampSessionIdentity(e.serializedContext,t),r=getWritable(),i=createSessionInbox(t),
|
|
1
|
+
import{attachClientContext,readClientContext}from"#internal/client-context.js";import{SESSION_INBOX_CONTEXT_KEY,sessionCommandHookToken}from"#execution/session-inbox/address.js";import{readSerializedSessionSchedule}from"#context/session-schedule.js";import{getWorkflowMetadata,getWritable}from"#compiled/@workflow/core/index.js";import{isHookConflictError}from"#execution/hook-ownership.js";import{DEFAULT_SESSION_TIMEOUT_MS,sessionTimeoutDeadline}from"#execution/session/timeout.js";import{sessionHookTokens}from"#execution/session/hook-tokens.js";import{createSessionInbox}from"#execution/session-inbox/inbox.js";import{failSession,runPreparedSession}from"#execution/session/program.js";import{createSessionTimeoutControl}from"#execution/session/timeout-control.js";import{recordSessionOwnerStep,signalSessionOwnerActivationStep,stopUntrackedChildSessionsStep,validateSessionCheckpointStep}from"#execution/session/handoff-steps.js";import{hasDelegatedSessionContext}from"#execution/delegated-session-context.js";import{readChannelRequestId,readRootSessionId}from"#execution/eve-workflow-attributes.js";import{createTurnControl}from"#execution/session/turn-control.js";import{resolveInitialTurnCallerStep}from"#subagents/parent-notification.js";import{normalizeSerializableError}from"#execution/workflow-errors.js";import{createSessionStep}from"#execution/create-session-step.js";import{settleContinuationConflictStep}from"#execution/continuation-conflict-step.js";import{migrateSessionCheckpoint}from"#execution/session/checkpoint-migrations.js";async function workflowEntry(e){"use workflow";let t=e.kind===`initial`?await bootInitialOwner(e,getWorkflowMetadata().workflowRunId):await bootHandoffOwner(e);return t===void 0?{output:``}:{output:(await runPreparedSession(t.session,t.inbox)).output}}function stampSessionIdentity(e,t){return{...e,"eve.sessionId":t,[SESSION_INBOX_CONTEXT_KEY]:{sessionId:t}}}async function prepareInitialOwner(e,t){let[n,r]=await Promise.allSettled([e.claimSessionHook(sessionCommandHookToken(t.sessionId)),t.continuationToken===``?Promise.resolve():e.claimSessionHook(t.continuationToken)]);if(n.status===`rejected`)throw n.reason;if(r.status===`rejected`){if(isHookConflictError(r.reason))return{kind:`alias-conflict`};throw r.reason}let i=createTurnControl(),a=t.deadline===void 0?void 0:createSessionTimeoutControl({deadline:t.deadline,sessionId:t.sessionId}),o={kind:`owned`,timeoutControl:a,turnControl:i,async dispose(){i.dispose(),await a?.dispose()}};return a?.start().catch(()=>{}),o}function unwrapSettled(e){if(e.status===`rejected`)throw e.reason;return e.value}async function disposeInitialBoot(e,t){let[n,r]=await Promise.allSettled([t?.dispose(),e.dispose()]);if(n.status===`rejected`)throw n.reason;if(r.status===`rejected`)throw r.reason}async function bootInitialOwner(e,t){let n=stampSessionIdentity(e.serializedContext,t),r=getWritable(),i=createSessionInbox(t),a=e.sessionTimeoutMs??DEFAULT_SESSION_TIMEOUT_MS,o=sessionTimeoutDeadline(a,Date.now()),s=n[`eve.continuationToken`]||``,c=n[`eve.bundle`],l;try{let u=createSessionStep({compiledArtifactsSource:c.source,continuationToken:s,dynamicSubagentAgentConfig:n[`eve.dynamicSubagentAgentConfig`],inheritedLimits:e.limits,nodeId:c.nodeId,outputSchema:e.input.outputSchema,rootSessionId:readRootSessionId(n),sessionId:t}),d=prepareInitialOwner(i,{continuationToken:s,deadline:o,sessionId:t}),f=hasDelegatedSessionContext(n)?resolveInitialTurnCallerStep({serializedContext:n}):Promise.resolve(void 0),[p,m,h]=await Promise.allSettled([u,d,f]);m.status===`fulfilled`&&m.value.kind===`owned`&&(l=m.value);let g=unwrapSettled(p),_=unwrapSettled(m);if(_.kind===`alias-conflict`){e.continuationConflictCommand!==void 0&&await settleContinuationConflictStep({command:e.continuationConflictCommand,continuationToken:s}),await disposeInitialBoot(i,l);return}return{inbox:i,session:{anchor:{kind:`self`},caller:unwrapSettled(h),capabilities:n[`eve.capabilities`],deploymentId:e.ownerDeploymentId,history:g.history,start:e.input.message===void 0?{kind:`first-message`}:{input:createInitialDelivery(e,n),kind:`turn`},initialTurnControl:_.turnControl,retention:e.retention,serializedContext:n,sessionId:t,sessionState:g.state,sessionTimeoutControl:_.timeoutControl,sessionTimeoutMs:a,sessionTimeoutDeadline:o,sessionWritable:r}}}catch(e){return await disposeInitialBoot(i,l),await failSession({error:e,serializedContext:n,sessionId:t,sessionState:void 0,sessionWritable:r})}}async function bootHandoffOwner(e){let{sessionId:t}=e,n=createSessionInbox(t),r,i,a;try{let o=migrateSessionCheckpoint(e.checkpoint),s=await validateSessionCheckpointStep({migration:o,sessionId:t});if(o.kind===`incompatible`||s.kind===`incompatible`){let t=await n.release();await signalSessionOwnerActivationStep({activation:{kind:`incompatible`,payloads:t,reason:`checkpoint-version`},token:e.activationToken});return}({checkpoint:r,childRunIdsToStop:i}=o),a=stampSessionIdentity(r.serializedContext,t),await recordSessionOwnerStep({sessionId:t}),await n.claimSessionHooks(sessionHookTokens({serializedContext:a,sessionState:r.sessionState})),await signalSessionOwnerActivationStep({activation:{kind:`active`},token:e.activationToken})}catch(t){let r=await n.release();await signalSessionOwnerActivationStep({activation:{error:normalizeSerializableError(t),kind:`failed`,payloads:r},token:e.activationToken});return}i.length>0&&await stopUntrackedChildSessionsStep({runIds:i,sessionId:t});let o=e.reason===`compaction`?e.sessionTimeoutDeadline:sessionTimeoutDeadline(r.sessionTimeoutMs,Date.now()),s=o===void 0?void 0:createSessionTimeoutControl({deadline:o,sessionId:t});return{inbox:n,session:{anchor:{kind:`successor`},caller:e.delivery?.caller,capabilities:r.capabilities,deploymentId:e.ownerDeploymentId,history:r.history,start:e.delivery===void 0?{kind:`parked`}:{input:e.delivery,kind:`turn`},retention:r.retention,serializedContext:a,sessionId:t,sessionState:r.sessionState,sessionTimeoutControl:s,sessionTimeoutMs:r.sessionTimeoutMs,sessionTimeoutDeadline:o,sessionWritable:e.sessionWritable}}}function createInitialDelivery(e,t){if(e.input.message!==void 0)return{schedule:readSerializedSessionSchedule(t),deliveryMetadata:t[`eve.channelDelivery`]===void 0?void 0:[{...t[`eve.channelDelivery`],payloadIndex:0}],kind:`deliver`,payloads:[attachClientContext({message:e.input.message,context:e.input.context,outputSchema:e.input.outputSchema,state:e.input.state},readClientContext(e.input))],requestId:readChannelRequestId(t)}}workflowEntry.workflowId=`workflow//eve//workflowEntry`;export{bootInitialOwner,workflowEntry};
|