eve 0.21.1 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/src/channel/adapter.d.ts +3 -7
  3. package/dist/src/compiler/manifest.d.ts +16 -26
  4. package/dist/src/compiler/manifest.js +1 -1
  5. package/dist/src/compiler/normalize-agent-config.js +1 -1
  6. package/dist/src/compiler/normalize-hook.d.ts +2 -2
  7. package/dist/src/compiler/normalize-instructions.d.ts +3 -3
  8. package/dist/src/compiler/normalize-instructions.js +1 -1
  9. package/dist/src/compiler/normalize-skill.js +1 -1
  10. package/dist/src/compiler/normalize-tool.d.ts +2 -2
  11. package/dist/src/context/container.d.ts +2 -0
  12. package/dist/src/context/dynamic-model-lifecycle.d.ts +19 -0
  13. package/dist/src/context/dynamic-model-lifecycle.js +1 -0
  14. package/dist/src/context/keys.d.ts +13 -1
  15. package/dist/src/context/keys.js +1 -1
  16. package/dist/src/discover/manifest.d.ts +8 -0
  17. package/dist/src/evals/cli/eval.js +2 -2
  18. package/dist/src/evals/reporters/index.d.ts +1 -0
  19. package/dist/src/evals/reporters/index.js +1 -1
  20. package/dist/src/evals/runner/reporters/console.d.ts +10 -11
  21. package/dist/src/evals/runner/reporters/console.js +1 -1
  22. package/dist/src/execution/node-step.js +1 -1
  23. package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +2 -2
  24. package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +2 -2
  25. package/dist/src/execution/session.js +2 -2
  26. package/dist/src/execution/workflow-steps.js +1 -1
  27. package/dist/src/harness/emission.d.ts +1 -0
  28. package/dist/src/harness/emission.js +1 -1
  29. package/dist/src/harness/input-extraction.d.ts +1 -0
  30. package/dist/src/harness/input-extraction.js +1 -1
  31. package/dist/src/harness/input-requests.js +1 -1
  32. package/dist/src/harness/step-hooks.d.ts +4 -1
  33. package/dist/src/harness/step-hooks.js +1 -1
  34. package/dist/src/harness/tool-call-input-errors.d.ts +8 -0
  35. package/dist/src/harness/tool-call-input-errors.js +1 -0
  36. package/dist/src/harness/tool-loop.js +1 -1
  37. package/dist/src/harness/types.d.ts +9 -0
  38. package/dist/src/internal/application/package.js +1 -1
  39. package/dist/src/internal/authored-definition/core.js +1 -1
  40. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  41. package/dist/src/internal/nitro/host/types.d.ts +2 -2
  42. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +2 -2
  43. package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.d.ts +4 -4
  44. package/dist/src/internal/runtime-model.d.ts +1 -1
  45. package/dist/src/protocol/message.d.ts +1 -0
  46. package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +1 -1
  47. package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
  48. package/dist/src/public/channels/discord/discordChannel.d.ts +2 -2
  49. package/dist/src/public/channels/discord/discordChannel.js +1 -1
  50. package/dist/src/public/channels/eve.d.ts +1 -1
  51. package/dist/src/public/channels/eve.js +1 -1
  52. package/dist/src/public/channels/github/dispatch.d.ts +1 -1
  53. package/dist/src/public/channels/github/githubChannel.d.ts +2 -2
  54. package/dist/src/public/channels/github/githubChannel.js +1 -1
  55. package/dist/src/public/channels/index.d.ts +2 -2
  56. package/dist/src/public/channels/index.js +1 -1
  57. package/dist/src/public/channels/linear/linearChannel.d.ts +1 -1
  58. package/dist/src/public/channels/linear/linearChannel.js +1 -1
  59. package/dist/src/public/channels/slack/interactions.d.ts +1 -1
  60. package/dist/src/public/channels/slack/slackChannel.d.ts +2 -2
  61. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  62. package/dist/src/public/channels/teams/teamsChannel.d.ts +2 -2
  63. package/dist/src/public/channels/teams/teamsChannel.js +1 -1
  64. package/dist/src/public/channels/telegram/telegramChannel.d.ts +2 -2
  65. package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
  66. package/dist/src/public/channels/twilio/twilioChannel.d.ts +2 -2
  67. package/dist/src/public/channels/twilio/twilioChannel.js +1 -1
  68. package/dist/src/public/definitions/agent.d.ts +1 -1
  69. package/dist/src/public/definitions/channel.d.ts +99 -0
  70. package/dist/src/public/definitions/channel.js +1 -1
  71. package/dist/src/public/definitions/hook.d.ts +3 -10
  72. package/dist/src/public/definitions/instructions.d.ts +2 -18
  73. package/dist/src/public/definitions/schedule.d.ts +4 -17
  74. package/dist/src/public/definitions/tool.d.ts +10 -4
  75. package/dist/src/public/definitions/tool.js +1 -1
  76. package/dist/src/public/hooks/index.d.ts +1 -1
  77. package/dist/src/public/hooks/index.js +1 -1
  78. package/dist/src/public/index.d.ts +2 -0
  79. package/dist/src/public/index.js +1 -1
  80. package/dist/src/public/sandbox/backends/default.d.ts +2 -2
  81. package/dist/src/public/sandbox/backends/microsandbox.d.ts +2 -2
  82. package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +1 -1
  83. package/dist/src/public/sandbox/microsandbox.d.ts +1 -1
  84. package/dist/src/runtime/agent/bootstrap.d.ts +8 -0
  85. package/dist/src/runtime/agent/bootstrap.js +1 -1
  86. package/dist/src/runtime/agent/resolve-model.d.ts +16 -1
  87. package/dist/src/runtime/agent/resolve-model.js +1 -1
  88. package/dist/src/runtime/hooks/registry.d.ts +2 -1
  89. package/dist/src/runtime/prompt/compose.d.ts +2 -2
  90. package/dist/src/runtime/resolve-agent.js +1 -1
  91. package/dist/src/runtime/schedules/register.d.ts +2 -2
  92. package/dist/src/runtime/schedules/resolve-schedule.d.ts +4 -4
  93. package/dist/src/runtime/types.d.ts +7 -4
  94. package/dist/src/setup/scaffold/create/project.js +1 -1
  95. package/dist/src/shared/agent-definition.d.ts +30 -7
  96. package/dist/src/shared/agent-definition.js +1 -1
  97. package/dist/src/shared/channel-definition.d.ts +92 -0
  98. package/dist/src/shared/channel-definition.js +1 -0
  99. package/dist/src/shared/dynamic-tool-definition.d.ts +18 -8
  100. package/dist/src/shared/dynamic-tool-definition.js +1 -1
  101. package/dist/src/shared/hook-definition.d.ts +36 -0
  102. package/dist/src/shared/hook-definition.js +1 -0
  103. package/dist/src/shared/instructions-definition.d.ts +26 -0
  104. package/dist/src/shared/instructions-definition.js +1 -0
  105. package/dist/src/shared/schedule-definition.d.ts +34 -0
  106. package/dist/src/shared/schedule-definition.js +1 -0
  107. package/dist/src/source-change/apply-model-name.js +1 -1
  108. package/docs/agent-config.md +44 -0
  109. package/docs/guides/dynamic-capabilities.md +18 -2
  110. package/package.json +1 -1
  111. package/dist/src/public/definitions/defineChannel.d.ts +0 -157
  112. package/dist/src/public/definitions/defineChannel.js +0 -1
@@ -1,6 +1,18 @@
1
+ import { CHANNEL_SENTINEL } from "#channel/compiled-channel.js";
2
+ import { type ChannelCorsOptions } from "#channel/cors.js";
3
+ import type { TypedReceiveTarget } from "#channel/receive-target.js";
4
+ import type { RouteDefinition, SendFn } from "#channel/routes.js";
5
+ import type { Session } from "#channel/session.js";
1
6
  import type { DeliverInput, GetEventStreamOptions, RunHandle, RunInput } from "#channel/types.js";
2
7
  import type { HandleMessageStreamEvent } from "#protocol/message.js";
8
+ import type { SessionContext } from "#public/definitions/callback-context.js";
9
+ import type { GenericChannelDefinition, GenericReceiveInput } from "#shared/channel-definition.js";
10
+ declare const CHANNEL_METADATA_TYPE: unique symbol;
3
11
  export type { GetEventStreamOptions } from "#channel/types.js";
12
+ export type { Session, SessionHandle } from "#channel/session.js";
13
+ export type { ChannelCors, ChannelCorsOptions } from "#channel/cors.js";
14
+ export { GET, POST, PUT, PATCH, DELETE, WS } from "#channel/routes.js";
15
+ export type { HttpRouteDefinition, RouteDefinition, RouteHandlerArgs, SendFn, SendOptions, SendPayload, GetSessionFn, WebSocketMessage, WebSocketPeer, WebSocketRouteDefinition, WebSocketRouteHandler, WebSocketRouteHooks, WebSocketUpgradeRequest, WebSocketUpgradeResult, } from "#channel/routes.js";
4
16
  /**
5
17
  * HTTP method a route handles. Defaults to `"POST"` — almost every route
6
18
  * is a webhook. Override only when authoring a non-webhook route such as a
@@ -124,3 +136,90 @@ export declare function disableRoute(): DisabledRouteSentinel;
124
136
  * produced by {@link disableRoute}.
125
137
  */
126
138
  export declare function isDisabledRouteSentinel(value: unknown): value is DisabledRouteSentinel;
139
+ type EventData<T extends HandleMessageStreamEvent["type"]> = Extract<HandleMessageStreamEvent, {
140
+ type: T;
141
+ }> extends {
142
+ data: infer D;
143
+ } ? D : undefined;
144
+ /**
145
+ * Session operations on the `channel` argument of every channel event handler.
146
+ */
147
+ export interface ChannelSessionOps {
148
+ readonly continuationToken: string;
149
+ setContinuationToken(token: string): void;
150
+ }
151
+ /**
152
+ * Channel context passed to event handlers: `TCtx` intersected with
153
+ * {@link ChannelSessionOps}.
154
+ */
155
+ export type ChannelContext<TCtx> = TCtx & ChannelSessionOps;
156
+ type ChannelEventHandler<T extends HandleMessageStreamEvent["type"], TCtx> = (data: EventData<T>, channel: ChannelContext<TCtx>, ctx: SessionContext) => void | Promise<void>;
157
+ type ChannelSessionFailedHandler<TCtx> = (data: EventData<"session.failed">, channel: ChannelContext<TCtx>) => void | Promise<void>;
158
+ /**
159
+ * Optional handlers keyed by session lifecycle event name. Each handler receives
160
+ * the event `data`, the {@link ChannelContext}, and a {@link SessionContext}
161
+ * `ctx`. The `session.failed` handler is the exception: it receives only `data`
162
+ * and the channel context, with no `ctx`.
163
+ */
164
+ export interface ChannelEvents<TCtx = void> {
165
+ readonly "turn.started"?: ChannelEventHandler<"turn.started", TCtx>;
166
+ readonly "actions.requested"?: ChannelEventHandler<"actions.requested", TCtx>;
167
+ readonly "action.result"?: ChannelEventHandler<"action.result", TCtx>;
168
+ readonly "message.completed"?: ChannelEventHandler<"message.completed", TCtx>;
169
+ readonly "message.appended"?: ChannelEventHandler<"message.appended", TCtx>;
170
+ readonly "reasoning.appended"?: ChannelEventHandler<"reasoning.appended", TCtx>;
171
+ readonly "reasoning.completed"?: ChannelEventHandler<"reasoning.completed", TCtx>;
172
+ readonly "input.requested"?: ChannelEventHandler<"input.requested", TCtx>;
173
+ readonly "turn.failed"?: ChannelEventHandler<"turn.failed", TCtx>;
174
+ readonly "turn.completed"?: ChannelEventHandler<"turn.completed", TCtx>;
175
+ readonly "session.failed"?: ChannelSessionFailedHandler<TCtx>;
176
+ readonly "session.completed"?: ChannelEventHandler<"session.completed", TCtx>;
177
+ readonly "session.waiting"?: ChannelEventHandler<"session.waiting", TCtx>;
178
+ readonly "authorization.required"?: ChannelEventHandler<"authorization.required", TCtx>;
179
+ readonly "authorization.completed"?: ChannelEventHandler<"authorization.completed", TCtx>;
180
+ }
181
+ /**
182
+ * Input passed to a channel's `receive` callback when another channel or
183
+ * schedule proactively routes a message to it.
184
+ */
185
+ export type ReceiveInput<TReceiveTarget = Record<string, unknown>> = GenericReceiveInput<TReceiveTarget>;
186
+ /**
187
+ * The object passed to {@link defineChannel}. `routes` is required; `state`
188
+ * seeds durable adapter state, `context` builds the per-step `channel` argument
189
+ * for `events` and `deliver`, `events` handle session lifecycle, `receive`
190
+ * accepts cross-channel handoffs, `fetchFile` stages remote file URLs, and
191
+ * `metadata` projects observability data.
192
+ *
193
+ * Generics: `TState` (adapter state), `TCtx` (context factory return type),
194
+ * `TReceiveTarget` (cross-channel target shape), `TMetadata` (instrumentation
195
+ * projection).
196
+ */
197
+ export type ChannelDefinition<TState = undefined, TCtx = void, TReceiveTarget = Record<string, unknown>, TMetadata extends Record<string, unknown> = Record<string, unknown>> = GenericChannelDefinition<ChannelEvents<TCtx>, TState, TCtx, TReceiveTarget, TMetadata>;
198
+ /**
199
+ * Opaque channel value produced by {@link defineChannel} and exported from
200
+ * `agent/channels/<name>.ts`. Exposes the channel's routes, an optional
201
+ * `receive` hook, and (via a phantom property) its metadata shape. Unlike
202
+ * {@link ChannelDefinition} it has no `TCtx` parameter: the context type is
203
+ * internal to the definition.
204
+ */
205
+ export interface Channel<TState = undefined, TReceiveTarget = Record<string, unknown>, TMetadata extends Record<string, unknown> = Record<string, unknown>> extends TypedReceiveTarget<TReceiveTarget> {
206
+ readonly __kind: typeof CHANNEL_SENTINEL;
207
+ readonly [CHANNEL_METADATA_TYPE]?: TMetadata;
208
+ readonly routes: readonly RouteDefinition<TState>[];
209
+ readonly cors?: ChannelCorsOptions;
210
+ readonly receive?: (input: ReceiveInput<TReceiveTarget>, args: {
211
+ send: SendFn<TState>;
212
+ }) => Promise<Session>;
213
+ }
214
+ /**
215
+ * Extracts the metadata projection type (`TMetadata`) from a {@link Channel}.
216
+ * Resolves to `Record<string, unknown>` when the value is not a Channel.
217
+ */
218
+ export type InferChannelMetadata<TChannel> = TChannel extends Channel<any, any, infer TMetadata> ? TMetadata : Record<string, unknown>;
219
+ /**
220
+ * Builds a {@link Channel} from a {@link ChannelDefinition}. Returns a value
221
+ * placed at `agent/channels/<name>.ts`; the file path supplies the channel name
222
+ * (do not add a `name` field). `TCtx` (the context factory's return type) is
223
+ * internal to the definition and is not part of the returned Channel signature.
224
+ */
225
+ export declare function defineChannel<TState = undefined, TCtx = void, TReceiveTarget = Record<string, unknown>, TMetadata extends Record<string, unknown> = Record<string, unknown>>(definition: ChannelDefinition<TState, TCtx, TReceiveTarget, TMetadata>): Channel<TState, TReceiveTarget, TMetadata>;
@@ -1 +1 @@
1
- const DISABLED_ROUTE_SENTINEL_KIND=`eve:disabled-channel`;function disableRoute(){return{kind:DISABLED_ROUTE_SENTINEL_KIND}}function isDisabledRouteSentinel(e){return typeof e==`object`&&!!e&&e.kind===DISABLED_ROUTE_SENTINEL_KIND}export{disableRoute,isDisabledRouteSentinel};
1
+ import{CHANNEL_SENTINEL}from"#channel/compiled-channel.js";import{defaultDeliverResult}from"#channel/adapter.js";import{buildCallbackContext}from"#context/build-callback-context.js";import{normalizeChannelCors}from"#channel/cors.js";import{HTTP_ADAPTER_KIND}from"#channel/http.js";import{DELETE,GET,PATCH,POST,PUT,WS}from"#channel/routes.js";const DISABLED_ROUTE_SENTINEL_KIND=`eve:disabled-channel`;function disableRoute(){return{kind:DISABLED_ROUTE_SENTINEL_KIND}}function isDisabledRouteSentinel(e){return typeof e==`object`&&!!e&&e.kind===DISABLED_ROUTE_SENTINEL_KIND}function defineChannel(t){let n=buildAdapter(t),i=normalizeChannelCors(t.cors);return{__kind:CHANNEL_SENTINEL,routes:t.routes,adapter:n,cors:i,receive:t.receive}}function buildAdapter(e){let r=e.state!=null,a=e.context!=null,o=e.fetchFile!==void 0,s=e.metadata,c=r||a||s!==void 0,l={},u=!1,d=[`turn.started`,`actions.requested`,`action.result`,`message.completed`,`message.appended`,`reasoning.appended`,`reasoning.completed`,`input.requested`,`turn.failed`,`turn.completed`,`session.failed`,`session.completed`,`session.waiting`,`authorization.required`,`authorization.completed`],f=e.events;for(let e of d){let t=f?.[e];t&&(u=!0,l[e]=(r,i)=>{let a={...i,continuationToken:i.session?.continuationToken??``,setContinuationToken:e=>i.session?.setContinuationToken(e)};return e===`session.failed`?t(r,a):t(r,a,buildCallbackContext())})}return!c&&!u&&!o?{kind:e.kindHint??HTTP_ADAPTER_KIND}:{kind:e.kindHint??`defineChannel`,state:r?{...e.state}:{},fetchFile:e.fetchFile,instrumentation:s===void 0?void 0:{metadata(e){return s(e)}},createAdapterContext(t){let n=t.state,r=t.session;return{...a?e.context(n,r):{},state:n,ctx:t.ctx,session:r}},deliver(e){return defaultDeliverResult(e)},...l}}export{DELETE,GET,PATCH,POST,PUT,WS,defineChannel,disableRoute,isDisabledRouteSentinel};
@@ -1,6 +1,7 @@
1
1
  import type { HandleMessageStreamEvent } from "../../protocol/message.js";
2
2
  import type { SessionContext } from "./callback-context.js";
3
3
  import type { ExactDefinition } from "./exact.js";
4
+ import type { GenericHookDefinition, GenericStreamEventHooks } from "#shared/hook-definition.js";
4
5
  /**
5
6
  * Every hook handler receives this context.
6
7
  *
@@ -31,13 +32,7 @@ export type StreamEventHook<TEvent> = (event: TEvent, ctx: HookContext) => void
31
32
  * `*` matches every accepted runtime stream event and runs after the
32
33
  * typed handler for that event (if any).
33
34
  */
34
- export type StreamEventHooks = {
35
- readonly "*"?: StreamEventHook<HandleMessageStreamEvent>;
36
- } & {
37
- readonly [K in HandleMessageStreamEvent["type"]]?: StreamEventHook<Extract<HandleMessageStreamEvent, {
38
- type: K;
39
- }>>;
40
- };
35
+ export type StreamEventHooks = GenericStreamEventHooks<HandleMessageStreamEvent, HookContext>;
41
36
  /**
42
37
  * Public hook definition authored in `agent/hooks/*.ts`.
43
38
  *
@@ -47,9 +42,7 @@ export type StreamEventHooks = {
47
42
  * contribute runtime model messages, use `defineDynamic` +
48
43
  * `defineInstructions` in `agent/instructions/`.
49
44
  */
50
- export interface HookDefinition {
51
- readonly events?: StreamEventHooks;
52
- }
45
+ export type HookDefinition = GenericHookDefinition<HandleMessageStreamEvent, HookContext>;
53
46
  /**
54
47
  * Identity-with-types helper. Returns the passed definition unchanged
55
48
  * (identity at runtime) while preserving literal inference and rejecting
@@ -1,22 +1,6 @@
1
1
  import type { ExactDefinition } from "#public/definitions/exact.js";
2
- /**
3
- * Public definition for an instructions prompt authored in markdown or
4
- * TypeScript.
5
- *
6
- * Authored at the agent root as either `instructions.md` or
7
- * `instructions.{ts,cts,mts,js,cjs,mjs}`, or inside the
8
- * `agent/instructions/` directory for multi-file setups. Module-backed
9
- * static instructions execute once at build time. The compiler captures
10
- * the resulting markdown into the compiled manifest.
11
- *
12
- * When used inside a `defineDynamic` handler, the runtime lowers the
13
- * returned markdown to `{ role: "system", content: markdown }`.
14
- * Instructions produce system messages only. Use channel `context` for
15
- * user-role messages.
16
- */
17
- export interface InstructionsDefinition {
18
- readonly markdown: string;
19
- }
2
+ import type { PublicInstructionsDefinition } from "#shared/instructions-definition.js";
3
+ export type InstructionsDefinition = Readonly<PublicInstructionsDefinition>;
20
4
  /**
21
5
  * Defines an instructions prompt in TypeScript from a `{ markdown }`
22
6
  * definition.
@@ -1,6 +1,7 @@
1
1
  import type { CrossChannelReceiveFn } from "#channel/cross-channel-receive.js";
2
2
  import type { SessionAuthContext } from "#channel/types.js";
3
3
  import type { ExactDefinition } from "#public/definitions/exact.js";
4
+ import type { GenericScheduleDefinition, GenericScheduleRunHandler, GenericScheduleDefinitionFields } from "#shared/schedule-definition.js";
4
5
  export type { InferReceiveTarget, TypedReceiveTarget } from "#channel/receive-target.js";
5
6
  /**
6
7
  * Arguments passed to a schedule's `run` handler. A tight subset of a route
@@ -31,13 +32,7 @@ export interface ScheduleHandlerArgs {
31
32
  * schedule's cron fires. It receives {@link ScheduleHandlerArgs} (`receive`,
32
33
  * `waitUntil`, `appAuth`) and may return synchronously or as a promise.
33
34
  */
34
- export type ScheduleRunHandler = (args: ScheduleHandlerArgs) => Promise<void> | void;
35
- /** Constraint shape that bounds the authored keys accepted by {@link defineSchedule}. */
36
- interface ScheduleDefinitionFields {
37
- readonly cron: string;
38
- readonly markdown?: string;
39
- readonly run?: ScheduleRunHandler;
40
- }
35
+ export type ScheduleRunHandler = GenericScheduleRunHandler<ScheduleHandlerArgs>;
41
36
  /**
42
37
  * Public definition for a schedule authored in TypeScript. Provide a required
43
38
  * `cron` expression plus exactly one of `markdown` or `run`:
@@ -51,15 +46,7 @@ interface ScheduleDefinitionFields {
51
46
  * Identity is derived from the file path under `agent/schedules/`; authored
52
47
  * definitions do not carry a `name` field.
53
48
  */
54
- export type ScheduleDefinition = {
55
- readonly cron: string;
56
- readonly markdown: string;
57
- readonly run?: never;
58
- } | {
59
- readonly cron: string;
60
- readonly markdown?: never;
61
- readonly run: ScheduleRunHandler;
62
- };
49
+ export type ScheduleDefinition = GenericScheduleDefinition<ScheduleHandlerArgs>;
63
50
  /**
64
51
  * Defines a schedule in TypeScript. Export as the default from
65
52
  * `agent/schedules/<name>.ts`. Pass a `cron` expression plus exactly one of
@@ -93,4 +80,4 @@ export type ScheduleDefinition = {
93
80
  * });
94
81
  * ```
95
82
  */
96
- export declare function defineSchedule<TSchedule extends ScheduleDefinition>(definition: ExactDefinition<TSchedule, ScheduleDefinitionFields>): TSchedule;
83
+ export declare function defineSchedule<TSchedule extends ScheduleDefinition>(definition: ExactDefinition<TSchedule, GenericScheduleDefinitionFields<ScheduleHandlerArgs>>): TSchedule;
@@ -4,8 +4,10 @@ import type { SessionContext } from "#public/definitions/callback-context.js";
4
4
  import type { Approval } from "#public/definitions/approval.js";
5
5
  import type { JsonObject } from "#shared/json.js";
6
6
  import type { AuthorizationDefinition, ConnectionAuthorizationContext, NonInteractiveAuthorizationDefinition, TokenResult } from "#runtime/connections/types.js";
7
- import { type DynamicEvents, type DynamicSentinel } from "#shared/dynamic-tool-definition.js";
7
+ import { type DynamicEvents, type DynamicEventsWithFallback, type DynamicSentinel } from "#shared/dynamic-tool-definition.js";
8
8
  type ApprovalContextInput<TInput> = unknown extends TInput ? Record<string, unknown> : TInput;
9
+ type DynamicEventMapHandler<TEvents extends DynamicEvents> = Extract<NonNullable<TEvents[keyof TEvents]>, (...args: never[]) => unknown>;
10
+ type DynamicEventMapResult<TEvents extends DynamicEvents> = Awaited<ReturnType<DynamicEventMapHandler<TEvents>>>;
9
11
  export type { ToolModelOutput } from "#shared/tool-definition.js";
10
12
  /**
11
13
  * Authorization provider passed to {@link ToolContext.getToken} or
@@ -191,9 +193,13 @@ export declare function defineTool<TInput = unknown, TOutput = unknown>(definiti
191
193
  * whose name matches an authored one overrides it; two dynamic resolvers
192
194
  * emitting the same name is an error.
193
195
  */
194
- export declare function defineDynamic(definition: {
195
- readonly events: DynamicEvents;
196
- }): DynamicSentinel;
196
+ export declare function defineDynamic<const TEvents extends DynamicEvents>(definition: {
197
+ readonly events: TEvents;
198
+ }): DynamicSentinel<DynamicEventMapResult<TEvents>>;
199
+ export declare function defineDynamic<const TEvents extends DynamicEventsWithFallback, TFallback = unknown>(definition: {
200
+ readonly fallback: TFallback;
201
+ readonly events: TEvents;
202
+ }): DynamicSentinel<Exclude<DynamicEventMapResult<TEvents>, undefined>, TFallback>;
197
203
  /**
198
204
  * Marker discriminator written into every {@link DisabledToolSentinel}.
199
205
  */
@@ -1 +1 @@
1
- import{DYNAMIC_SENTINEL_KIND,TOOL_BRAND}from"#shared/dynamic-tool-definition.js";import{stampDefinitionKey}from"#public/tool-result-narrowing.js";function defineTool(e){if(e.auth!==void 0)throw Error(`defineTool: The "auth" field is no longer supported. Pass auth providers inline to ctx.getToken(provider) or ctx.requireAuth(provider).`);return Object.assign(e,{[TOOL_BRAND]:!0}),stampDefinitionKey(e,`tool:${e.description}`),e}function defineDynamic(t){let n={kind:DYNAMIC_SENTINEL_KIND,events:t.events};return stampDefinitionKey(n,`dynamic:${Object.keys(t.events).join(`,`)}`),n}const DISABLED_TOOL_SENTINEL_KIND=`eve:disabled-tool`;function disableTool(){return{kind:DISABLED_TOOL_SENTINEL_KIND}}function isDisabledToolSentinel(e){return typeof e==`object`&&!!e&&e.kind===DISABLED_TOOL_SENTINEL_KIND}const ENABLE_WORKFLOW_TOOL_SENTINEL_KIND=`eve:enable-workflow-tool`,ExperimentalWorkflow=Object.freeze({kind:ENABLE_WORKFLOW_TOOL_SENTINEL_KIND});function isEnableWorkflowToolSentinel(e){return typeof e==`object`&&!!e&&e.kind===ENABLE_WORKFLOW_TOOL_SENTINEL_KIND}export{ExperimentalWorkflow,defineDynamic,defineTool,disableTool,isDisabledToolSentinel,isEnableWorkflowToolSentinel};
1
+ import{DYNAMIC_SENTINEL_KIND,TOOL_BRAND}from"#shared/dynamic-tool-definition.js";import{stampDefinitionKey}from"#public/tool-result-narrowing.js";function defineTool(e){if(e.auth!==void 0)throw Error(`defineTool: The "auth" field is no longer supported. Pass auth providers inline to ctx.getToken(provider) or ctx.requireAuth(provider).`);return Object.assign(e,{[TOOL_BRAND]:!0}),stampDefinitionKey(e,`tool:${e.description}`),e}function defineDynamic(t){let n={kind:DYNAMIC_SENTINEL_KIND,events:t.events,...Object.hasOwn(t,`fallback`)?{fallback:t.fallback}:{}};return stampDefinitionKey(n,`dynamic:${Object.keys(t.events).join(`,`)}`),n}const DISABLED_TOOL_SENTINEL_KIND=`eve:disabled-tool`;function disableTool(){return{kind:DISABLED_TOOL_SENTINEL_KIND}}function isDisabledToolSentinel(e){return typeof e==`object`&&!!e&&e.kind===DISABLED_TOOL_SENTINEL_KIND}const ENABLE_WORKFLOW_TOOL_SENTINEL_KIND=`eve:enable-workflow-tool`,ExperimentalWorkflow=Object.freeze({kind:ENABLE_WORKFLOW_TOOL_SENTINEL_KIND});function isEnableWorkflowToolSentinel(e){return typeof e==`object`&&!!e&&e.kind===ENABLE_WORKFLOW_TOOL_SENTINEL_KIND}export{ExperimentalWorkflow,defineDynamic,defineTool,disableTool,isDisabledToolSentinel,isEnableWorkflowToolSentinel};
@@ -5,4 +5,4 @@
5
5
  * See {@link defineHook} for the authoring shape and
6
6
  * {@link HookContext} for the runtime context every handler receives.
7
7
  */
8
- export { type HookContext, type HookDefinition, type StreamEventHook, type StreamEventHooks, defineHook, } from "../definitions/hook.js";
8
+ export { type HookContext, type HookDefinition, type StreamEventHook, type StreamEventHooks, defineHook, } from "#public/definitions/hook.js";
@@ -1 +1 @@
1
- import{defineHook}from"../definitions/hook.js";export{defineHook};
1
+ import{defineHook}from"#public/definitions/hook.js";export{defineHook};
@@ -2,4 +2,6 @@
2
2
  * Core agent authoring helpers for `agent/agent.ts`.
3
3
  */
4
4
  export { type AgentCompactionDefinition, type AgentDefinition, type AgentExperimentalDefinition, type AgentLimitsDefinition, type AgentModelDefinition, type AgentModelOptionsDefinition, type AgentReasoningDefinition, type AgentWorkflowDefinition, type AgentWorkflowWorldDefinition, defineAgent, } from "#public/definitions/agent.js";
5
+ export { defineDynamic } from "#public/definitions/tool.js";
6
+ export type { DynamicResolveContext, DynamicSentinel } from "#shared/dynamic-tool-definition.js";
5
7
  export { type RemoteAgentDefinition, type RemoteAgentDefinitionInput, defineRemoteAgent, } from "#public/definitions/remote-agent.js";
@@ -1 +1 @@
1
- import{defineAgent}from"#public/definitions/agent.js";import{defineRemoteAgent}from"#public/definitions/remote-agent.js";export{defineAgent,defineRemoteAgent};
1
+ import{defineDynamic}from"#public/definitions/tool.js";import{defineAgent}from"#public/definitions/agent.js";import{defineRemoteAgent}from"#public/definitions/remote-agent.js";export{defineAgent,defineDynamic,defineRemoteAgent};
@@ -1,7 +1,7 @@
1
1
  import type { SandboxBackend } from "#public/definitions/sandbox-backend.js";
2
2
  import type { DockerSandboxCreateOptions } from "#public/sandbox/docker-sandbox.js";
3
3
  import type { JustBashSandboxCreateOptions } from "#public/sandbox/just-bash-sandbox.js";
4
- import type { MicrosandboxCreateOptions } from "#public/sandbox/microsandbox-sandbox.js";
4
+ import type { MicrosandboxSandboxCreateOptions } from "#public/sandbox/microsandbox-sandbox.js";
5
5
  import type { VercelSandboxCreateOptions } from "#public/sandbox/vercel-sandbox.js";
6
6
  /**
7
7
  * Input to {@link defaultSandbox}: a separate options bag per inner
@@ -11,7 +11,7 @@ import type { VercelSandboxCreateOptions } from "#public/sandbox/vercel-sandbox.
11
11
  export interface DefaultSandboxOptions {
12
12
  readonly docker?: DockerSandboxCreateOptions;
13
13
  readonly justBash?: JustBashSandboxCreateOptions;
14
- readonly microsandbox?: MicrosandboxCreateOptions;
14
+ readonly microsandbox?: MicrosandboxSandboxCreateOptions;
15
15
  readonly vercel?: VercelSandboxCreateOptions;
16
16
  }
17
17
  /**
@@ -1,5 +1,5 @@
1
1
  import type { SandboxBackend } from "#public/definitions/sandbox-backend.js";
2
- import type { MicrosandboxBootstrapUseOptions, MicrosandboxCreateOptions, MicrosandboxSessionUseOptions } from "#public/sandbox/microsandbox-sandbox.js";
2
+ import type { MicrosandboxBootstrapUseOptions, MicrosandboxSandboxCreateOptions, MicrosandboxSessionUseOptions } from "#public/sandbox/microsandbox-sandbox.js";
3
3
  /**
4
4
  * Constructs the microsandbox sandbox backend: lightweight local VMs
5
5
  * via [microsandbox](https://www.npmjs.com/package/microsandbox) with
@@ -14,4 +14,4 @@ import type { MicrosandboxBootstrapUseOptions, MicrosandboxCreateOptions, Micros
14
14
  * Configuring this backend pins it unconditionally — when you want
15
15
  * fallback behavior, use `defaultBackend()` instead.
16
16
  */
17
- export declare function microsandbox(opts?: MicrosandboxCreateOptions): SandboxBackend<MicrosandboxBootstrapUseOptions, MicrosandboxSessionUseOptions>;
17
+ export declare function microsandbox(opts?: MicrosandboxSandboxCreateOptions): SandboxBackend<MicrosandboxBootstrapUseOptions, MicrosandboxSessionUseOptions>;
@@ -8,7 +8,7 @@ import type { SandboxNetworkPolicy } from "#shared/sandbox-network-policy.js";
8
8
  * stay stable while the underlying runtime evolves. Supported hosts:
9
9
  * macOS on Apple Silicon, or Linux (glibc) with KVM enabled.
10
10
  */
11
- export interface MicrosandboxCreateOptions {
11
+ export interface MicrosandboxSandboxCreateOptions {
12
12
  /**
13
13
  * OCI image used as the base runtime. eve prepares this image with
14
14
  * Bash, the framework workspace, and the sandbox user before authored
@@ -1,2 +1,2 @@
1
1
  export { microsandbox } from "#public/sandbox/backends/microsandbox.js";
2
- export type { MicrosandboxBootstrapUseOptions, MicrosandboxCreateOptions, MicrosandboxSessionUseOptions, } from "#public/sandbox/microsandbox-sandbox.js";
2
+ export type { MicrosandboxBootstrapUseOptions, MicrosandboxSandboxCreateOptions, MicrosandboxSessionUseOptions, } from "#public/sandbox/microsandbox-sandbox.js";
@@ -2,6 +2,7 @@ import type { PreparedRuntimeTool } from "#runtime/sessions/turn.js";
2
2
  import type { ResolvedAgent } from "#runtime/types.js";
3
3
  import type { WorkspaceRuntimeSpec } from "#runtime/workspace/types.js";
4
4
  import type { InternalAgentModelDefinition } from "#shared/agent-definition.js";
5
+ import type { ModuleSourceRef } from "#shared/source-ref.js";
5
6
  import type { AvailableSkillDescription } from "#execution/skills/instructions.js";
6
7
  /**
7
8
  * Fixed internal model reference used only by the framework-owned bootstrap
@@ -12,6 +13,12 @@ export declare const BOOTSTRAP_RUNTIME_MODEL_ID = "eve-bootstrap-model";
12
13
  * Runtime-owned model identifier prepared for one harness turn.
13
14
  */
14
15
  export type RuntimeModelReference = Readonly<InternalAgentModelDefinition>;
16
+ /**
17
+ * Runtime-owned reference to a dynamic model resolver authored in `agent.ts`.
18
+ */
19
+ export type RuntimeDynamicModelReference = Readonly<ModuleSourceRef & {
20
+ readonly eventNames: readonly string[];
21
+ }>;
15
22
  /**
16
23
  * Minimal runtime-owned agent shape prepared for one harness turn.
17
24
  */
@@ -25,6 +32,7 @@ export interface RuntimeTurnAgent {
25
32
  * When omitted, the harness uses the active turn model for compaction.
26
33
  */
27
34
  readonly compactionModel?: RuntimeModelReference;
35
+ readonly dynamicModel?: RuntimeDynamicModelReference;
28
36
  readonly model: RuntimeModelReference;
29
37
  readonly nodeId?: string;
30
38
  readonly outputSchema?: ResolvedAgent["config"]["outputSchema"];
@@ -1 +1 @@
1
- import{composeRuntimeBasePrompt}from"#runtime/prompt/compose.js";const BOOTSTRAP_RUNTIME_MODEL_ID=`eve-bootstrap-model`,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT=`You are the eve bootstrap agent. Be concise, stay grounded in the current conversation, and do not assume tools are available unless the runtime provides them.`;function createResolvedRuntimeTurnAgent(t){let n=t.agent;return{availableSkills:n.skills.map(e=>({description:e.description,name:e.name})),id:n.config.name,instructions:composeRuntimeBasePrompt({connections:n.connections,instructions:n.instructions,toolsAvailable:t.tools.length>0,workspaceSpec:n.workspaceSpec}),compactionModel:n.config.compaction?.model,model:n.config.model,nodeId:t.nodeId,outputSchema:n.config.outputSchema,reasoning:n.config.reasoning,tools:[...t.tools],workspaceSpec:n.workspaceSpec}}export{BOOTSTRAP_RUNTIME_MODEL_ID,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT,createResolvedRuntimeTurnAgent};
1
+ import{composeRuntimeBasePrompt}from"#runtime/prompt/compose.js";const BOOTSTRAP_RUNTIME_MODEL_ID=`eve-bootstrap-model`,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT=`You are the eve bootstrap agent. Be concise, stay grounded in the current conversation, and do not assume tools are available unless the runtime provides them.`;function createResolvedRuntimeTurnAgent(t){let n=t.agent;return{availableSkills:n.skills.map(e=>({description:e.description,name:e.name})),id:n.config.name,instructions:composeRuntimeBasePrompt({connections:n.connections,instructions:n.instructions,toolsAvailable:t.tools.length>0,workspaceSpec:n.workspaceSpec}),compactionModel:n.config.compaction?.model,dynamicModel:n.config.dynamicModel,model:n.config.model,nodeId:t.nodeId,outputSchema:n.config.outputSchema,reasoning:n.config.reasoning,tools:[...t.tools],workspaceSpec:n.workspaceSpec}}export{BOOTSTRAP_RUNTIME_MODEL_ID,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT,createResolvedRuntimeTurnAgent};
@@ -1,14 +1,29 @@
1
1
  import type { LanguageModel } from "ai";
2
2
  import type { CompiledModuleMap } from "#compiler/module-map.js";
3
- import type { RuntimeModelReference } from "#runtime/agent/bootstrap.js";
3
+ import type { RuntimeDynamicModelReference, RuntimeModelReference } from "#runtime/agent/bootstrap.js";
4
4
  import { shouldMockAuthoredRuntimeModels } from "#runtime/agent/mock-model-adapter.js";
5
+ import { type PublicAgentDynamicModelDefinition, type PublicAgentDynamicModelResult } from "#shared/agent-definition.js";
5
6
  export { shouldMockAuthoredRuntimeModels };
6
7
  /** Loaded compiled-module scope used to resolve source-backed runtime models. */
7
8
  export interface RuntimeModelResolutionScope {
8
9
  readonly moduleMap: CompiledModuleMap;
9
10
  readonly nodeId: string | undefined;
10
11
  }
12
+ export interface ResolvedRuntimeModelSelection {
13
+ /** Live provider instance; absent for string selections, which resolve through the reference so mock/bootstrap adapters keep precedence. */
14
+ readonly model?: LanguageModel;
15
+ readonly reference: RuntimeModelReference;
16
+ }
11
17
  /**
12
18
  * Resolves one runtime model reference into the active language model.
13
19
  */
14
20
  export declare function resolveRuntimeModelReference(reference: RuntimeModelReference, scope?: RuntimeModelResolutionScope): Promise<LanguageModel>;
21
+ export declare function loadDynamicRuntimeModelDefinition(input: {
22
+ readonly dynamicModel: RuntimeDynamicModelReference;
23
+ readonly scope: RuntimeModelResolutionScope;
24
+ }): Promise<PublicAgentDynamicModelDefinition>;
25
+ export declare function normalizeDynamicRuntimeModelResult(input: {
26
+ readonly fallback: RuntimeModelReference;
27
+ readonly result: NonNullable<PublicAgentDynamicModelResult>;
28
+ }): ResolvedRuntimeModelSelection;
29
+ export declare function isRuntimeLanguageModel(value: unknown): value is LanguageModel;
@@ -1 +1 @@
1
- import{normalizeAgentDefinition}from"#internal/authored-definition/core.js";import{loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{resolveBootstrapRuntimeModel}from"#runtime/agent/bootstrap-model.js";import{resolveMockAuthoredRuntimeModel,shouldMockAuthoredRuntimeModels}from"#runtime/agent/mock-model-adapter.js";async function resolveRuntimeModelReference(e,t){let i=resolveBootstrapRuntimeModel(e);if(i!==null)return i;let a=resolveMockAuthoredRuntimeModel(e);return a===null?isSourceBackedRuntimeModelReference(e)?await loadSourceBackedRuntimeModelReference(e,t):e.id:a}async function loadSourceBackedRuntimeModelReference(n,r){if(r===void 0)throw Error(`Expected a compiled module-map scope to resolve the authored runtime model "${n.id}".`);let i=normalizeAgentDefinition(await loadResolvedModuleExport({definition:n.source,kindLabel:`runtime model "${n.id}"`,moduleMap:r.moduleMap,nodeId:r.nodeId}),`Expected the authored agent config export "${n.source.exportName??`default`}" from "${n.source.logicalPath}" to match the public eve shape.`).model;if(i===void 0)throw Error(`Expected the authored agent config export "${n.source.exportName??`default`}" from "${n.source.logicalPath}" to provide a runtime model.`);return i}function isSourceBackedRuntimeModelReference(e){return e.source!==void 0}export{resolveRuntimeModelReference,shouldMockAuthoredRuntimeModels};
1
+ import{normalizeAgentDefinition}from"#internal/authored-definition/core.js";import{formatLanguageModelGatewayId}from"#internal/runtime-model.js";import{parseJsonObject}from"#shared/json.js";import{isDynamicModelDefinition}from"#shared/agent-definition.js";import{loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{resolveBootstrapRuntimeModel}from"#runtime/agent/bootstrap-model.js";import{resolveMockAuthoredRuntimeModel,shouldMockAuthoredRuntimeModels}from"#runtime/agent/mock-model-adapter.js";async function resolveRuntimeModelReference(e,t){let n=resolveBootstrapRuntimeModel(e);if(n!==null)return n;let r=resolveMockAuthoredRuntimeModel(e);return r===null?isSourceBackedRuntimeModelReference(e)?await loadSourceBackedRuntimeModelReference(e,t):e.id:r}async function loadSourceBackedRuntimeModelReference(t,n){if(n===void 0)throw Error(`Expected a compiled module-map scope to resolve the authored runtime model "${t.id}".`);let a=normalizeAgentDefinition(await loadResolvedModuleExport({definition:t.source,kindLabel:`runtime model "${t.id}"`,moduleMap:n.moduleMap,nodeId:n.nodeId}),`Expected the authored agent config export "${t.source.exportName??`default`}" from "${t.source.logicalPath}" to match the public eve shape.`).model;if(a===void 0)throw Error(`Expected the authored agent config export "${t.source.exportName??`default`}" from "${t.source.logicalPath}" to provide a runtime model.`);return isDynamicModelDefinition(a)?a.fallback:a}function isSourceBackedRuntimeModelReference(e){return e.source!==void 0}async function loadDynamicRuntimeModelDefinition(t){let n=normalizeAgentDefinition(await loadResolvedModuleExport({definition:t.dynamicModel,kindLabel:`dynamic runtime model`,moduleMap:t.scope.moduleMap,nodeId:t.scope.nodeId}),`Expected the authored agent config export "${t.dynamicModel.exportName??`default`}" from "${t.dynamicModel.logicalPath}" to match the public eve shape.`).model;if(!isDynamicModelDefinition(n))throw Error(`Expected the authored agent config export "${t.dynamicModel.exportName??`default`}" from "${t.dynamicModel.logicalPath}" to provide a dynamic model definition.`);return n}function normalizeDynamicRuntimeModelResult(e){let n=normalizeDynamicModelSelection(e.result);validateDynamicModelSelection(n);let r=n.modelOptions?.providerOptions===void 0?e.fallback.providerOptions:parseProviderOptionsRecord(n.modelOptions.providerOptions),i=n.modelContextWindowTokens;return typeof n.model==`string`?{reference:{id:formatLanguageModelGatewayId(n.model),contextWindowTokens:i,providerOptions:r}}:(validateRuntimeLanguageModel(n.model),{model:n.model,reference:{id:formatLanguageModelGatewayId(n.model),contextWindowTokens:i,providerOptions:r}})}const DYNAMIC_MODEL_SELECTION_KEYS=new Set([`model`,`modelContextWindowTokens`,`modelOptions`]);function validateDynamicModelSelection(e){let t=Object.keys(e).filter(e=>!DYNAMIC_MODEL_SELECTION_KEYS.has(e));if(t.length>0)throw Error(`Dynamic model resolver returned a selection with unknown key(s): ${t.join(`, `)}. Expected { model, modelContextWindowTokens?, modelOptions? }.`);let n=e.modelContextWindowTokens;if(n!==void 0&&(!Number.isInteger(n)||n<=0))throw Error(`Dynamic model resolver returned an invalid modelContextWindowTokens value. Expected a positive integer.`)}function normalizeDynamicModelSelection(e){return isModelSelectionDefinition(e)?e:{model:e}}function isModelSelectionDefinition(e){return typeof e==`object`&&!!e&&`model`in e&&!isRuntimeLanguageModel(e)}function validateRuntimeLanguageModel(e){if(!isRuntimeLanguageModel(e))throw Error(`Dynamic model resolver returned an invalid model. Return an AI Gateway model id string, an AI SDK language model, or { model, modelContextWindowTokens?, modelOptions? }.`)}function isRuntimeLanguageModel(e){if(typeof e!=`object`||!e)return!1;let t=e;return(t.specificationVersion===`v2`||t.specificationVersion===`v3`||t.specificationVersion===`v4`)&&typeof t.provider==`string`&&typeof t.modelId==`string`&&typeof t.doGenerate==`function`&&typeof t.doStream==`function`}function parseProviderOptionsRecord(e){if(e===void 0)return;let t={};for(let[r,i]of Object.entries(e))t[r]=parseJsonObject(i);return t}export{isRuntimeLanguageModel,loadDynamicRuntimeModelDefinition,normalizeDynamicRuntimeModelResult,resolveRuntimeModelReference,shouldMockAuthoredRuntimeModels};
@@ -1,3 +1,4 @@
1
+ import type { HandleMessageStreamEvent } from "#protocol/message.js";
1
2
  import type { StreamEventHook } from "../../public/definitions/hook.js";
2
3
  import type { ResolvedHookDefinition } from "../types.js";
3
4
  /**
@@ -8,7 +9,7 @@ import type { ResolvedHookDefinition } from "../types.js";
8
9
  */
9
10
  interface RuntimeStreamEventHookEntry {
10
11
  readonly slug: string;
11
- readonly handler: StreamEventHook<unknown>;
12
+ readonly handler: StreamEventHook<HandleMessageStreamEvent>;
12
13
  readonly eventType: string;
13
14
  }
14
15
  /**
@@ -1,4 +1,4 @@
1
- import type { ResolvedConnectionDefinition, ResolvedInstructions, ResolvedSkillDefinition } from "#runtime/types.js";
1
+ import type { ResolvedConnectionDefinition, ResolvedInstructionsDefinition, ResolvedSkillDefinition } from "#runtime/types.js";
2
2
  import type { WorkspaceRuntimeSpec } from "#runtime/workspace/types.js";
3
3
  /**
4
4
  * Input for composing the base authored instructions prompt for one
@@ -6,7 +6,7 @@ import type { WorkspaceRuntimeSpec } from "#runtime/workspace/types.js";
6
6
  */
7
7
  interface ComposeRuntimeBasePromptInput {
8
8
  connections?: readonly ResolvedConnectionDefinition[];
9
- instructions?: ResolvedInstructions;
9
+ instructions?: ResolvedInstructionsDefinition;
10
10
  skills?: readonly ResolvedSkillDefinition[];
11
11
  toolsAvailable?: boolean;
12
12
  workspaceSpec?: WorkspaceRuntimeSpec;
@@ -1 +1 @@
1
- import{ResolveAgentError,createResolvedModuleSourceRef}from"#runtime/resolve-helpers.js";import{resolveChannelDefinition}from"#runtime/resolve-channel.js";import{resolveConnectionDefinition}from"#runtime/resolve-connection.js";import{resolveHookDefinition}from"#runtime/resolve-hook.js";import{resolveSandboxDefinition}from"#runtime/resolve-sandbox.js";import{resolveDynamicInstructionsDefinition}from"#runtime/resolve-dynamic-instructions.js";import{resolveDynamicSkillDefinition}from"#runtime/resolve-dynamic-skill.js";import{resolveDynamicToolDefinition}from"#runtime/resolve-dynamic-tool.js";import{resolveToolDefinition}from"#runtime/resolve-tool.js";async function resolveAgent(e){let t=e.manifest.skills.map(e=>({...e,metadata:e.metadata===void 0?void 0:{...e.metadata}})),r=[],i=[];for(let t of e.manifest.channels){if(t.kind===`disabled`){i.push(t.name);continue}r.push(await resolveChannelDefinition(t,e.moduleMap,e.nodeId))}let a=await Promise.all(e.manifest.tools.map(t=>resolveToolDefinition(t,e.moduleMap,e.nodeId))),o=await Promise.all((e.manifest.dynamicInstructions??[]).map(t=>resolveDynamicInstructionsDefinition(t,e.moduleMap,e.nodeId))),s=await Promise.all((e.manifest.dynamicSkills??[]).map(t=>resolveDynamicSkillDefinition(t,e.moduleMap,e.nodeId))),c=await Promise.all(e.manifest.dynamicTools.map(t=>resolveDynamicToolDefinition(t,e.moduleMap,e.nodeId))),l=await Promise.all(e.manifest.hooks.map(t=>resolveHookDefinition(t,e.moduleMap,e.nodeId))),u=await Promise.all(e.manifest.connections.map(t=>resolveConnectionDefinition(t,e.moduleMap,e.nodeId))),d=e.manifest.sandbox===null?null:await resolveSandboxDefinition(e.manifest.sandbox,e.moduleMap,e.nodeId),f=createResolvedInstructions(e.manifest.instructions),p=e.manifest.workspaceResourceRoot,m={channels:r,config:createResolvedAgentConfig(e.manifest),connections:u,disabledFrameworkChannels:i,disabledFrameworkTools:[...e.manifest.disabledFrameworkTools],workflowEnabled:e.manifest.workflowEnabled,dynamicInstructionsResolvers:o,dynamicSkillResolvers:s,dynamicToolResolvers:c,hooks:l,metadata:{agentRoot:e.manifest.agentRoot,appRoot:e.manifest.appRoot,diagnosticsSummary:e.manifest.diagnosticsSummary},sandbox:d,workspaceResourceRoot:p,skills:t,tools:a,workspaceSpec:{rootEntries:[...p.rootEntries]}};return f===void 0?m:{...m,instructions:f}}function createResolvedInstructions(e){if(e!==void 0)return{name:e.name,logicalPath:e.logicalPath,markdown:e.markdown,sourceId:e.sourceId,sourceKind:e.sourceKind}}function createResolvedAgentConfig(e){let n={model:e.config.model.source===void 0?{id:e.config.model.id,contextWindowTokens:e.config.model.contextWindowTokens,providerOptions:e.config.model.providerOptions}:{contextWindowTokens:e.config.model.contextWindowTokens,id:e.config.model.id,providerOptions:e.config.model.providerOptions,source:{exportName:e.config.model.source.exportName,sourceKind:`module`,logicalPath:e.config.model.source.logicalPath,sourceId:e.config.model.source.sourceId}},name:e.config.name};if(e.config.compaction!==void 0){let t={};e.config.compaction.model!==void 0&&(t.model=e.config.compaction.model.source===void 0?{contextWindowTokens:e.config.compaction.model.contextWindowTokens,id:e.config.compaction.model.id,providerOptions:e.config.compaction.model.providerOptions}:{contextWindowTokens:e.config.compaction.model.contextWindowTokens,id:e.config.compaction.model.id,providerOptions:e.config.compaction.model.providerOptions,source:{exportName:e.config.compaction.model.source.exportName,sourceKind:`module`,logicalPath:e.config.compaction.model.source.logicalPath,sourceId:e.config.compaction.model.source.sourceId}}),e.config.compaction.thresholdPercent!==void 0&&(t.thresholdPercent=e.config.compaction.thresholdPercent),n.compaction=t}return e.config.experimental!==void 0&&(n.experimental={workflow:e.config.experimental.workflow===void 0?void 0:{world:e.config.experimental.workflow.world}}),e.config.outputSchema!==void 0&&(n.outputSchema=e.config.outputSchema),e.config.reasoning!==void 0&&(n.reasoning=e.config.reasoning),e.config.source!==void 0&&(n.source=createResolvedModuleSourceRef(e.config.source)),e.config.limits!==void 0&&(n.limits={maxSubagentDepth:e.config.limits.maxSubagentDepth,maxSubagents:e.config.limits.maxSubagents,maxInputTokensPerSession:e.config.limits.maxInputTokensPerSession,maxOutputTokensPerSession:e.config.limits.maxOutputTokensPerSession}),n}export{ResolveAgentError,resolveAgent};
1
+ import{ResolveAgentError,createResolvedModuleSourceRef}from"#runtime/resolve-helpers.js";import{resolveChannelDefinition}from"#runtime/resolve-channel.js";import{resolveConnectionDefinition}from"#runtime/resolve-connection.js";import{resolveHookDefinition}from"#runtime/resolve-hook.js";import{resolveSandboxDefinition}from"#runtime/resolve-sandbox.js";import{resolveDynamicInstructionsDefinition}from"#runtime/resolve-dynamic-instructions.js";import{resolveDynamicSkillDefinition}from"#runtime/resolve-dynamic-skill.js";import{resolveDynamicToolDefinition}from"#runtime/resolve-dynamic-tool.js";import{resolveToolDefinition}from"#runtime/resolve-tool.js";async function resolveAgent(e){let t=e.manifest.skills.map(e=>({...e,metadata:e.metadata===void 0?void 0:{...e.metadata}})),r=[],i=[];for(let t of e.manifest.channels){if(t.kind===`disabled`){i.push(t.name);continue}r.push(await resolveChannelDefinition(t,e.moduleMap,e.nodeId))}let a=await Promise.all(e.manifest.tools.map(t=>resolveToolDefinition(t,e.moduleMap,e.nodeId))),o=await Promise.all((e.manifest.dynamicInstructions??[]).map(t=>resolveDynamicInstructionsDefinition(t,e.moduleMap,e.nodeId))),s=await Promise.all((e.manifest.dynamicSkills??[]).map(t=>resolveDynamicSkillDefinition(t,e.moduleMap,e.nodeId))),c=await Promise.all(e.manifest.dynamicTools.map(t=>resolveDynamicToolDefinition(t,e.moduleMap,e.nodeId))),l=await Promise.all(e.manifest.hooks.map(t=>resolveHookDefinition(t,e.moduleMap,e.nodeId))),u=await Promise.all(e.manifest.connections.map(t=>resolveConnectionDefinition(t,e.moduleMap,e.nodeId))),d=e.manifest.sandbox===null?null:await resolveSandboxDefinition(e.manifest.sandbox,e.moduleMap,e.nodeId),f=createResolvedInstructionsDefinition(e.manifest.instructions),p=e.manifest.workspaceResourceRoot,m={channels:r,config:createResolvedAgentConfig(e.manifest),connections:u,disabledFrameworkChannels:i,disabledFrameworkTools:[...e.manifest.disabledFrameworkTools],workflowEnabled:e.manifest.workflowEnabled,dynamicInstructionsResolvers:o,dynamicSkillResolvers:s,dynamicToolResolvers:c,hooks:l,metadata:{agentRoot:e.manifest.agentRoot,appRoot:e.manifest.appRoot,diagnosticsSummary:e.manifest.diagnosticsSummary},sandbox:d,workspaceResourceRoot:p,skills:t,tools:a,workspaceSpec:{rootEntries:[...p.rootEntries]}};return f===void 0?m:{...m,instructions:f}}function createResolvedInstructionsDefinition(e){if(e!==void 0)return{name:e.name,logicalPath:e.logicalPath,markdown:e.markdown,sourceId:e.sourceId,sourceKind:e.sourceKind}}function createResolvedAgentConfig(e){let n={model:e.config.model.source===void 0?{id:e.config.model.id,contextWindowTokens:e.config.model.contextWindowTokens,providerOptions:e.config.model.providerOptions}:{contextWindowTokens:e.config.model.contextWindowTokens,id:e.config.model.id,providerOptions:e.config.model.providerOptions,source:{exportName:e.config.model.source.exportName,sourceKind:`module`,logicalPath:e.config.model.source.logicalPath,sourceId:e.config.model.source.sourceId}},name:e.config.name};if(e.config.compaction!==void 0){let t={};e.config.compaction.model!==void 0&&(t.model=e.config.compaction.model.source===void 0?{contextWindowTokens:e.config.compaction.model.contextWindowTokens,id:e.config.compaction.model.id,providerOptions:e.config.compaction.model.providerOptions}:{contextWindowTokens:e.config.compaction.model.contextWindowTokens,id:e.config.compaction.model.id,providerOptions:e.config.compaction.model.providerOptions,source:{exportName:e.config.compaction.model.source.exportName,sourceKind:`module`,logicalPath:e.config.compaction.model.source.logicalPath,sourceId:e.config.compaction.model.source.sourceId}}),e.config.compaction.thresholdPercent!==void 0&&(t.thresholdPercent=e.config.compaction.thresholdPercent),n.compaction=t}return e.config.dynamicModel!==void 0&&(n.dynamicModel={...createResolvedModuleSourceRef(e.config.dynamicModel),eventNames:[...e.config.dynamicModel.eventNames]}),e.config.experimental!==void 0&&(n.experimental={workflow:e.config.experimental.workflow===void 0?void 0:{world:e.config.experimental.workflow.world}}),e.config.outputSchema!==void 0&&(n.outputSchema=e.config.outputSchema),e.config.reasoning!==void 0&&(n.reasoning=e.config.reasoning),e.config.source!==void 0&&(n.source=createResolvedModuleSourceRef(e.config.source)),e.config.limits!==void 0&&(n.limits={maxSubagentDepth:e.config.limits.maxSubagentDepth,maxSubagents:e.config.limits.maxSubagents,maxInputTokensPerSession:e.config.limits.maxInputTokensPerSession,maxOutputTokensPerSession:e.config.limits.maxOutputTokensPerSession}),n}export{ResolveAgentError,resolveAgent};
@@ -1,4 +1,4 @@
1
- import type { ResolvedSchedule } from "#runtime/types.js";
1
+ import type { ResolvedScheduleDefinition } from "#runtime/types.js";
2
2
  /**
3
3
  * Stable Nitro task-name prefix for framework-owned authored schedules.
4
4
  */
@@ -32,4 +32,4 @@ export declare class ScheduleRegistrationError extends Error {
32
32
  * Creates stable registration inputs for Nitro's task and cron surfaces from
33
33
  * resolved authored schedules.
34
34
  */
35
- export declare function createScheduleRegistrations(schedules: readonly ResolvedSchedule[]): ScheduleRegistration[];
35
+ export declare function createScheduleRegistrations(schedules: readonly ResolvedScheduleDefinition[]): ScheduleRegistration[];
@@ -1,6 +1,6 @@
1
1
  import type { CompiledAgentManifest } from "#compiler/manifest.js";
2
2
  import type { RuntimeCompiledArtifactsSource } from "#runtime/compiled-artifacts-source.js";
3
- import type { ResolvedSchedule } from "#runtime/types.js";
3
+ import type { ResolvedScheduleDefinition } from "#runtime/types.js";
4
4
  /**
5
5
  * Input for resolving authored schedules from the compiled manifest.
6
6
  */
@@ -17,15 +17,15 @@ interface LoadResolvedCompiledSchedulesInput {
17
17
  /**
18
18
  * Resolves runtime-owned schedules from the compiled manifest.
19
19
  */
20
- export declare function resolveSchedules(input: ResolveSchedulesInput): Promise<ResolvedSchedule[]>;
20
+ export declare function resolveSchedules(input: ResolveSchedulesInput): Promise<ResolvedScheduleDefinition[]>;
21
21
  /**
22
22
  * Loads the compiled manifest, then resolves authored schedules into
23
23
  * runtime-owned schedule models.
24
24
  */
25
- export declare function loadResolvedCompiledSchedules(input: LoadResolvedCompiledSchedulesInput): Promise<ResolvedSchedule[]>;
25
+ export declare function loadResolvedCompiledSchedules(input: LoadResolvedCompiledSchedulesInput): Promise<ResolvedScheduleDefinition[]>;
26
26
  /**
27
27
  * Loads and resolves one compiled authored schedule from its registered Nitro
28
28
  * task name.
29
29
  */
30
- export declare function loadResolvedCompiledScheduleByTaskName(taskName: string, input: LoadResolvedCompiledSchedulesInput): Promise<ResolvedSchedule>;
30
+ export declare function loadResolvedCompiledScheduleByTaskName(taskName: string, input: LoadResolvedCompiledSchedulesInput): Promise<ResolvedScheduleDefinition>;
31
31
  export {};
@@ -4,6 +4,7 @@ import type { CompiledChannel } from "#channel/compiled-channel.js";
4
4
  import type { NormalizedChannelCorsOptions } from "#channel/cors.js";
5
5
  import type { HeadersValue } from "#client/types.js";
6
6
  import type { DiscoverDiagnosticsSummary } from "#discover/diagnostics.js";
7
+ import type { HandleMessageStreamEvent } from "#protocol/message.js";
7
8
  import type { ChannelRouteMethod, RouteContext } from "#public/definitions/channel.js";
8
9
  import type { RouteHandler, WebSocketRouteHandler } from "#channel/routes.js";
9
10
  import type { OutboundAuthFn } from "#public/agents/auth.js";
@@ -20,6 +21,7 @@ import type { Node } from "#shared/node.js";
20
21
  import type { SourceRef, ModuleSourceRef, SkillPackageSourceRef, MarkdownSourceRef } from "#shared/source-ref.js";
21
22
  import type { NamedSkillDefinition } from "#shared/skill-definition.js";
22
23
  import type { InternalAgentDefinition } from "#shared/agent-definition.js";
24
+ import type { RuntimeDynamicModelReference } from "#runtime/agent/bootstrap.js";
23
25
  import type { InternalToolDefinitionWithExecuteFn } from "#shared/tool-definition.js";
24
26
  import type { SandboxBackend } from "#shared/sandbox-backend.js";
25
27
  import type { SandboxBootstrapContext, SandboxSessionContext } from "#shared/sandbox-definition.js";
@@ -35,7 +37,7 @@ export type ResolvedModuleSourceRef = Readonly<ModuleSourceRef>;
35
37
  * the resulting markdown is captured here. Runtime never re-evaluates
36
38
  * the module.
37
39
  */
38
- export type ResolvedInstructions = Readonly<SourceRef & {
40
+ export type ResolvedInstructionsDefinition = Readonly<SourceRef & {
39
41
  name: string;
40
42
  markdown: string;
41
43
  } & (Omit<MarkdownSourceRef<undefined>, "definition"> | ModuleSourceRef)>;
@@ -55,7 +57,7 @@ export type ResolvedSkillDefinition = Readonly<NamedSkillDefinition & (Omit<Mark
55
57
  * a {@link ScheduleHandlerArgs}-shaped argument; for the markdown form
56
58
  * the dispatcher synthesizes a channel-less SCHEDULE_ADAPTER run.
57
59
  */
58
- export type ResolvedSchedule = Readonly<SourceRef & {
60
+ export type ResolvedScheduleDefinition = Readonly<SourceRef & {
59
61
  readonly cron: string;
60
62
  readonly name: string;
61
63
  readonly markdown?: string;
@@ -177,7 +179,7 @@ export interface ResolvedHookDefinition extends ResolvedModuleSourceRef {
177
179
  * wildcard if declared. Unknown keys are accepted at resolve time
178
180
  * and ignored at dispatch time.
179
181
  */
180
- readonly events: Readonly<Record<string, StreamEventHook<unknown>>>;
182
+ readonly events: Readonly<Record<string, StreamEventHook<HandleMessageStreamEvent>>>;
181
183
  }
182
184
  /**
183
185
  * Runtime-owned authored channel definition resolved from the compiled
@@ -257,6 +259,7 @@ export type ResolvedRuntimeDelegationNode = ResolvedRuntimeRemoteAgentNode | Res
257
259
  * Runtime-owned additive agent configuration resolved from `agent.ts`.
258
260
  */
259
261
  export type ResolvedAgentDefinition = Readonly<Omit<InternalAgentDefinition, "build" | "source"> & {
262
+ dynamicModel?: RuntimeDynamicModelReference;
260
263
  source?: Readonly<NonNullable<InternalAgentDefinition["source"]>>;
261
264
  }>;
262
265
  /**
@@ -334,7 +337,7 @@ export interface ResolvedAgent {
334
337
  * `instructions.{ts,...}`, or `undefined` when the agent does not
335
338
  * declare one.
336
339
  */
337
- readonly instructions?: ResolvedInstructions;
340
+ readonly instructions?: ResolvedInstructionsDefinition;
338
341
  /**
339
342
  * Authored sandbox override for this agent, when one exists. `null`
340
343
  * means the agent uses the framework default sandbox unchanged.
@@ -1,4 +1,4 @@
1
- import{pinnedNodeEngineMajor}from"../../node-engine.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{WEB_APP_TEMPLATE_FILES}from"./web-template.js";import{basename,join,resolve}from"node:path";import{mkdir,readdir,stat}from"node:fs/promises";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,ALLOWED_CREATE_IN_PLACE_ENTRIES=new Set([`.DS_Store`,`.git`,`.gitkeep`,`.hg`]),DEFAULT_AI_PACKAGE_VERSION=`^7.0.0`,DEFAULT_CONNECT_PACKAGE_VERSION=`0.2.2`,DEFAULT_ZOD_PACKAGE_VERSION=`4.4.3`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.21.1`,nodeEngine:`>=24`};function resolveEvePackageContract(e=DEFAULT_EVE_PACKAGE_CONTRACT){return{version:resolveVersionToken(`evePackage.version`,e.version),nodeEngine:resolveVersionToken(`evePackage.nodeEngine`,e.nodeEngine)}}function modelProviderSlug(e){let t=(e.split(`/`)[0]??``).replaceAll(/[^A-Za-z0-9._-]/gu,``);return t.length>0?t:`anthropic`}function byokProviderEnvVar(e){let t=modelProviderSlug(e).toUpperCase().replaceAll(/[^A-Z0-9]/gu,`_`);return`${/^[0-9]/.test(t)?`_`:``}${t}_API_KEY`}function agentTemplateFiles(e){return{"agent/agent.ts":BASE_AGENT_TEMPLATE.replaceAll(`__EVE_INIT_MODEL__`,e),"agent/channels/eve.ts":WEB_APP_TEMPLATE_FILES[`agent/channels/eve.ts`],"agent/instructions.md":AGENT_INSTRUCTIONS_TEMPLATE}}function renderTemplate(e,t){return e.replaceAll(`__EVE_INIT_APP_NAME__`,t.appName).replaceAll(`__EVE_INIT_MODEL__`,t.model).replaceAll(`__EVE_INIT_BYOK_PROVIDER__`,modelProviderSlug(t.model)).replaceAll(`__EVE_INIT_BYOK_ENV_VAR__`,byokProviderEnvVar(t.model)).replaceAll(`__EVE_INIT_PACKAGE_VERSION__`,formatEveDependencySpecifier(t.eveVersion)).replaceAll(`__EVE_INIT_AI_SDK_VERSION__`,t.aiPackageVersion).replaceAll(`__EVE_INIT_CONNECT_VERSION__`,t.connectPackageVersion).replaceAll(`__EVE_INIT_ZOD_VERSION__`,t.zodPackageVersion).replaceAll(`__EVE_INIT_TYPESCRIPT_VERSION__`,t.typescriptPackageVersion).replaceAll(`__EVE_INIT_TYPES_NODE_VERSION__`,t.nodeTypesVersion).replaceAll(`__EVE_INIT_NODE_ENGINE__`,t.nodeEngine)}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}const BASE_AGENT_TEMPLATE=`import { defineAgent } from "eve";
1
+ import{pinnedNodeEngineMajor}from"../../node-engine.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{WEB_APP_TEMPLATE_FILES}from"./web-template.js";import{basename,join,resolve}from"node:path";import{mkdir,readdir,stat}from"node:fs/promises";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,ALLOWED_CREATE_IN_PLACE_ENTRIES=new Set([`.DS_Store`,`.git`,`.gitkeep`,`.hg`]),DEFAULT_AI_PACKAGE_VERSION=`^7.0.0`,DEFAULT_CONNECT_PACKAGE_VERSION=`0.2.2`,DEFAULT_ZOD_PACKAGE_VERSION=`4.4.3`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.22.0`,nodeEngine:`>=24`};function resolveEvePackageContract(e=DEFAULT_EVE_PACKAGE_CONTRACT){return{version:resolveVersionToken(`evePackage.version`,e.version),nodeEngine:resolveVersionToken(`evePackage.nodeEngine`,e.nodeEngine)}}function modelProviderSlug(e){let t=(e.split(`/`)[0]??``).replaceAll(/[^A-Za-z0-9._-]/gu,``);return t.length>0?t:`anthropic`}function byokProviderEnvVar(e){let t=modelProviderSlug(e).toUpperCase().replaceAll(/[^A-Z0-9]/gu,`_`);return`${/^[0-9]/.test(t)?`_`:``}${t}_API_KEY`}function agentTemplateFiles(e){return{"agent/agent.ts":BASE_AGENT_TEMPLATE.replaceAll(`__EVE_INIT_MODEL__`,e),"agent/channels/eve.ts":WEB_APP_TEMPLATE_FILES[`agent/channels/eve.ts`],"agent/instructions.md":AGENT_INSTRUCTIONS_TEMPLATE}}function renderTemplate(e,t){return e.replaceAll(`__EVE_INIT_APP_NAME__`,t.appName).replaceAll(`__EVE_INIT_MODEL__`,t.model).replaceAll(`__EVE_INIT_BYOK_PROVIDER__`,modelProviderSlug(t.model)).replaceAll(`__EVE_INIT_BYOK_ENV_VAR__`,byokProviderEnvVar(t.model)).replaceAll(`__EVE_INIT_PACKAGE_VERSION__`,formatEveDependencySpecifier(t.eveVersion)).replaceAll(`__EVE_INIT_AI_SDK_VERSION__`,t.aiPackageVersion).replaceAll(`__EVE_INIT_CONNECT_VERSION__`,t.connectPackageVersion).replaceAll(`__EVE_INIT_ZOD_VERSION__`,t.zodPackageVersion).replaceAll(`__EVE_INIT_TYPESCRIPT_VERSION__`,t.typescriptPackageVersion).replaceAll(`__EVE_INIT_TYPES_NODE_VERSION__`,t.nodeTypesVersion).replaceAll(`__EVE_INIT_NODE_ENGINE__`,t.nodeEngine)}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}const BASE_AGENT_TEMPLATE=`import { defineAgent } from "eve";
2
2
 
3
3
  export default defineAgent({
4
4
  model: "__EVE_INIT_MODEL__",