eve 0.21.1 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/src/channel/adapter.d.ts +3 -7
- package/dist/src/channel/types.d.ts +18 -1
- package/dist/src/compiler/manifest.d.ts +16 -26
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-hook.d.ts +2 -2
- package/dist/src/compiler/normalize-instructions.d.ts +3 -3
- package/dist/src/compiler/normalize-instructions.js +1 -1
- package/dist/src/compiler/normalize-skill.js +1 -1
- package/dist/src/compiler/normalize-tool.d.ts +2 -2
- package/dist/src/context/container.d.ts +2 -0
- package/dist/src/context/dynamic-model-lifecycle.d.ts +19 -0
- package/dist/src/context/dynamic-model-lifecycle.js +1 -0
- package/dist/src/context/keys.d.ts +13 -1
- package/dist/src/context/keys.js +1 -1
- package/dist/src/discover/manifest.d.ts +8 -0
- package/dist/src/evals/cli/eval.js +2 -2
- package/dist/src/evals/reporters/index.d.ts +1 -0
- package/dist/src/evals/reporters/index.js +1 -1
- package/dist/src/evals/runner/reporters/console.d.ts +10 -11
- package/dist/src/evals/runner/reporters/console.js +1 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/reconcile-session-continuation-token.d.ts +4 -0
- package/dist/src/execution/reconcile-session-continuation-token.js +1 -0
- package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +2 -2
- package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +2 -2
- package/dist/src/execution/sandbox/bindings/vercel-credentials.js +1 -1
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/session.js +2 -2
- package/dist/src/execution/subagent-adapter.js +1 -1
- package/dist/src/execution/subagent-event-proxy-step.d.ts +23 -0
- package/dist/src/execution/subagent-event-proxy-step.js +1 -0
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/workflow-steps.d.ts +1 -22
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/emission.d.ts +1 -0
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/input-extraction.d.ts +1 -0
- package/dist/src/harness/input-extraction.js +1 -1
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/step-hooks.d.ts +4 -1
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-call-input-errors.d.ts +8 -0
- package/dist/src/harness/tool-call-input-errors.js +1 -0
- package/dist/src/harness/tool-loop.js +1 -1
- package/dist/src/harness/types.d.ts +9 -0
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/nitro/host/types.d.ts +2 -2
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +2 -2
- package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.d.ts +4 -4
- package/dist/src/internal/runtime-model.d.ts +1 -1
- package/dist/src/protocol/message.d.ts +1 -0
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +1 -1
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
- package/dist/src/public/channels/discord/discordChannel.d.ts +2 -2
- package/dist/src/public/channels/discord/discordChannel.js +1 -1
- package/dist/src/public/channels/eve.d.ts +1 -1
- package/dist/src/public/channels/eve.js +1 -1
- package/dist/src/public/channels/github/dispatch.d.ts +1 -1
- package/dist/src/public/channels/github/githubChannel.d.ts +2 -2
- package/dist/src/public/channels/github/githubChannel.js +1 -1
- package/dist/src/public/channels/index.d.ts +2 -2
- package/dist/src/public/channels/index.js +1 -1
- package/dist/src/public/channels/linear/linearChannel.d.ts +1 -1
- package/dist/src/public/channels/linear/linearChannel.js +1 -1
- package/dist/src/public/channels/slack/hitl.d.ts +3 -2
- package/dist/src/public/channels/slack/hitl.js +3 -3
- package/dist/src/public/channels/slack/index.d.ts +1 -1
- package/dist/src/public/channels/slack/index.js +1 -1
- package/dist/src/public/channels/slack/interactions.d.ts +1 -1
- package/dist/src/public/channels/slack/interactions.js +1 -1
- package/dist/src/public/channels/slack/limits.d.ts +18 -0
- package/dist/src/public/channels/slack/limits.js +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +2 -2
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/teams/teamsChannel.d.ts +2 -2
- package/dist/src/public/channels/teams/teamsChannel.js +1 -1
- package/dist/src/public/channels/telegram/telegramChannel.d.ts +2 -2
- package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
- package/dist/src/public/channels/twilio/twilioChannel.d.ts +2 -2
- package/dist/src/public/channels/twilio/twilioChannel.js +1 -1
- package/dist/src/public/definitions/agent.d.ts +1 -1
- package/dist/src/public/definitions/channel.d.ts +99 -0
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/definitions/hook.d.ts +3 -10
- package/dist/src/public/definitions/instructions.d.ts +2 -18
- package/dist/src/public/definitions/schedule.d.ts +4 -17
- package/dist/src/public/definitions/tool.d.ts +10 -4
- package/dist/src/public/definitions/tool.js +1 -1
- package/dist/src/public/hooks/index.d.ts +1 -1
- package/dist/src/public/hooks/index.js +1 -1
- package/dist/src/public/index.d.ts +2 -0
- package/dist/src/public/index.js +1 -1
- package/dist/src/public/sandbox/backends/default.d.ts +2 -2
- package/dist/src/public/sandbox/backends/microsandbox.d.ts +2 -2
- package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +1 -1
- package/dist/src/public/sandbox/microsandbox.d.ts +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +8 -0
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/resolve-model.d.ts +16 -1
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/hooks/registry.d.ts +2 -1
- package/dist/src/runtime/prompt/compose.d.ts +2 -2
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/sandbox/keys.d.ts +4 -0
- package/dist/src/runtime/sandbox/keys.js +1 -1
- package/dist/src/runtime/sandbox/template-plan.d.ts +0 -2
- package/dist/src/runtime/schedules/register.d.ts +2 -2
- package/dist/src/runtime/schedules/resolve-schedule.d.ts +4 -4
- package/dist/src/runtime/types.d.ts +7 -4
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +30 -7
- package/dist/src/shared/agent-definition.js +1 -1
- package/dist/src/shared/channel-definition.d.ts +92 -0
- package/dist/src/shared/channel-definition.js +1 -0
- package/dist/src/shared/dynamic-tool-definition.d.ts +18 -8
- package/dist/src/shared/dynamic-tool-definition.js +1 -1
- package/dist/src/shared/hook-definition.d.ts +36 -0
- package/dist/src/shared/hook-definition.js +1 -0
- package/dist/src/shared/instructions-definition.d.ts +26 -0
- package/dist/src/shared/instructions-definition.js +1 -0
- package/dist/src/shared/schedule-definition.d.ts +34 -0
- package/dist/src/shared/schedule-definition.js +1 -0
- package/dist/src/shared/vercel-project.d.ts +25 -0
- package/dist/src/shared/vercel-project.js +1 -0
- package/dist/src/source-change/apply-model-name.js +1 -1
- package/docs/agent-config.md +44 -0
- package/docs/channels/slack.mdx +27 -0
- package/docs/connections/overview.mdx +2 -0
- package/docs/guides/dynamic-capabilities.md +18 -2
- package/docs/sandbox.mdx +3 -1
- package/docs/subagents.mdx +1 -1
- package/package.json +1 -1
- package/dist/src/public/definitions/defineChannel.d.ts +0 -157
- package/dist/src/public/definitions/defineChannel.js +0 -1
|
@@ -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";
|
package/dist/src/public/index.js
CHANGED
|
@@ -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 {
|
|
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?:
|
|
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,
|
|
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?:
|
|
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
|
|
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,
|
|
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
|
|
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<
|
|
12
|
+
readonly handler: StreamEventHook<HandleMessageStreamEvent>;
|
|
12
13
|
readonly eventType: string;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResolvedConnectionDefinition,
|
|
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?:
|
|
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=
|
|
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};
|
|
@@ -14,6 +14,10 @@ interface CreateRuntimeSandboxKeysInput {
|
|
|
14
14
|
/**
|
|
15
15
|
* Creates the stable runtime template and session keys for one sandbox
|
|
16
16
|
* definition under the current artifact source and backend.
|
|
17
|
+
*
|
|
18
|
+
* Both keys derive from one {@link RuntimeSandboxKeyParts} value, so the
|
|
19
|
+
* coupling holds by construction: the session key rotates exactly when
|
|
20
|
+
* the template content rotates.
|
|
17
21
|
*/
|
|
18
22
|
export declare function createRuntimeSandboxKeys(input: CreateRuntimeSandboxKeysInput): Promise<{
|
|
19
23
|
readonly sessionKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{realpath}from"node:fs/promises";import{createHash}from"node:crypto";import{getRuntimeCompiledArtifactsCacheKey,getRuntimeCompiledArtifactsSandboxAppRoot}from"#runtime/compiled-artifacts-source.js";import{loadCompileMetadata}from"#runtime/loaders/compile-metadata.js";async function createRuntimeSandboxKeys(e){return{sessionKey:
|
|
1
|
+
import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{realpath}from"node:fs/promises";import{createHash}from"node:crypto";import{resolveVercelProjectIdFromEnvironment}from"#shared/vercel-project.js";import{getRuntimeCompiledArtifactsCacheKey,getRuntimeCompiledArtifactsSandboxAppRoot}from"#runtime/compiled-artifacts-source.js";import{loadCompileMetadata}from"#runtime/loaders/compile-metadata.js";async function createRuntimeSandboxKeys(e){let t=await deriveRuntimeSandboxKeyParts(e);return{sessionKey:buildRuntimeSandboxSessionKey(e,t),templateKey:buildRuntimeSandboxTemplateKey(e,t)}}async function createRuntimeSandboxTemplateKey(e){return buildRuntimeSandboxTemplateKey(e,await deriveRuntimeSandboxKeyParts(e))}async function deriveRuntimeSandboxKeyParts(e){let t=await loadCompileMetadataForKeys(e.compiledArtifactsSource);return{metadata:t,scope:await resolveRuntimeSandboxScope(e),versionHash:e.templatePlan.kind===`none`?null:resolveRuntimeSandboxVersionHash({compiledArtifactsSource:e.compiledArtifactsSource,metadata:t,nodeId:e.nodeId,sourceId:e.sourceId,templatePlan:e.templatePlan})}}function buildRuntimeSandboxTemplateKey(e,t){if(t.versionHash===null)return null;let n=createStableHash(`${resolvePackageVersionForTemplateKey(t.metadata)}:7:${t.versionHash}`).slice(0,20);return sanitizeRuntimeSandboxKey(`eve-sbx-tpl-${e.backendName}-${t.scope}-${n}`)}function buildRuntimeSandboxSessionKey(e,t){let n=createStableHash(`7:${t.versionHash??`none`}`).slice(0,12),r=sanitizeRuntimeSandboxKey(e.nodeId);return sanitizeRuntimeSandboxKey(`eve-sbx-ses-${e.backendName}-${t.scope}-${n}-${e.sessionId}-${r}`)}function resolvePackageVersionForTemplateKey(t){return t?.generator.version??resolveInstalledPackageInfo().version}async function loadCompileMetadataForKeys(e){try{return await loadCompileMetadata({compiledArtifactsSource:e})}catch{return null}}async function resolveRuntimeSandboxScope(e){if(e.backendName===`vercel`){let e=resolveVercelProjectIdFromEnvironment();if(e!==void 0)return createStableHash(`vercel-project:${e}`).slice(0,16)}let n=getRuntimeCompiledArtifactsSandboxAppRoot(e.compiledArtifactsSource);return n===void 0?createStableHash(getRuntimeCompiledArtifactsCacheKey(e.compiledArtifactsSource)).slice(0,16):createStableHash(await realpath(n)).slice(0,16)}function resolveRuntimeSandboxVersionHash(e){let t=e.templatePlan.contentHash??resolveSourceGraphHash(e.metadata,e.compiledArtifactsSource);return e.templatePlan.kind===`bootstrap`?createStableHash(`bootstrap:${e.templatePlan.revalidationKey??``}:${e.templatePlan.sourceHash}:${t}:${e.nodeId}:${e.sourceId}`):createStableHash(`workspace-content:${t}:${e.nodeId}:${e.sourceId}`)}function resolveSourceGraphHash(e,t){return e?.discovery.sourceGraphHash??getRuntimeCompiledArtifactsCacheKey(t)}function createStableHash(e){return createHash(`sha256`).update(e).digest(`hex`)}function sanitizeRuntimeSandboxKey(e){return e.replaceAll(/[^a-zA-Z0-9._-]+/g,`-`).slice(0,120)}export{createRuntimeSandboxKeys,createRuntimeSandboxTemplateKey};
|
|
@@ -14,8 +14,6 @@ export type RuntimeSandboxTemplatePlan = {
|
|
|
14
14
|
readonly kind: "bootstrap";
|
|
15
15
|
readonly revalidationKey?: string;
|
|
16
16
|
readonly sourceHash: string;
|
|
17
|
-
} | {
|
|
18
|
-
readonly kind: "source-graph";
|
|
19
17
|
};
|
|
20
18
|
/**
|
|
21
19
|
* Chooses the template strategy for one resolved sandbox definition.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
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
|
|
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 {
|
|
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<
|
|
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<
|
|
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<
|
|
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
|
|
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
|
|
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<
|
|
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?:
|
|
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.
|
|
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.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";
|
|
2
2
|
|
|
3
3
|
export default defineAgent({
|
|
4
4
|
model: "__EVE_INIT_MODEL__",
|
|
@@ -2,6 +2,7 @@ import type { CallSettings, LanguageModel } from "ai";
|
|
|
2
2
|
import type { StandardJSONSchemaV1 } from "#compiled/@standard-schema/spec/index.js";
|
|
3
3
|
import type { JsonObject } from "#shared/json.js";
|
|
4
4
|
import type { ModuleSourceRef } from "#shared/source-ref.js";
|
|
5
|
+
import { type DynamicResolveContext, type DynamicSentinel } from "#shared/dynamic-tool-definition.js";
|
|
5
6
|
/**
|
|
6
7
|
* Optional overrides that eve forwards to the AI SDK model runtime call for
|
|
7
8
|
* this model.
|
|
@@ -46,11 +47,32 @@ export type InternalAgentModelDefinition = {
|
|
|
46
47
|
providerOptions?: Record<string, JsonObject>;
|
|
47
48
|
};
|
|
48
49
|
/**
|
|
49
|
-
*
|
|
50
|
-
* `LanguageModel`
|
|
51
|
-
* model call), not an eve-authored definition object.
|
|
50
|
+
* A concrete model handle: an AI Gateway model id string or an AI SDK
|
|
51
|
+
* `LanguageModel` instance.
|
|
52
52
|
*/
|
|
53
|
-
export type
|
|
53
|
+
export type PublicAgentStaticModelDefinition = string | LanguageModel;
|
|
54
|
+
/** Context passed to dynamic model event handlers; the shared dynamic resolver context. */
|
|
55
|
+
export type AgentModelResolveContext = DynamicResolveContext;
|
|
56
|
+
export interface PublicAgentModelSelectionDefinition {
|
|
57
|
+
readonly model: PublicAgentStaticModelDefinition;
|
|
58
|
+
/** Context window of the selected model, in tokens; never inherited from the fallback. */
|
|
59
|
+
readonly modelContextWindowTokens?: number;
|
|
60
|
+
/** Provider options for the selected model; defaults to the agent-level `modelOptions`. */
|
|
61
|
+
readonly modelOptions?: AgentModelOptionsDefinition;
|
|
62
|
+
}
|
|
63
|
+
export type PublicAgentDynamicModelResult = PublicAgentStaticModelDefinition | PublicAgentModelSelectionDefinition | null;
|
|
64
|
+
export type AgentModelResolver = (event: unknown, ctx: AgentModelResolveContext) => PublicAgentDynamicModelResult | Promise<PublicAgentDynamicModelResult>;
|
|
65
|
+
export type PublicAgentDynamicModelDefinition = DynamicSentinel<PublicAgentDynamicModelResult, PublicAgentStaticModelDefinition>;
|
|
66
|
+
export interface PublicAgentDynamicModelDefinitionInput {
|
|
67
|
+
/** Compiled static model: build-time metadata and the active model when no scope is set. */
|
|
68
|
+
readonly fallback: PublicAgentStaticModelDefinition;
|
|
69
|
+
readonly events: DynamicSentinel<PublicAgentDynamicModelResult>["events"];
|
|
70
|
+
}
|
|
71
|
+
export declare function isDynamicModelDefinition(value: unknown): value is PublicAgentDynamicModelDefinition;
|
|
72
|
+
/**
|
|
73
|
+
* The model handle you assign to an agent's `model` field.
|
|
74
|
+
*/
|
|
75
|
+
export type PublicAgentModelDefinition = PublicAgentStaticModelDefinition | PublicAgentDynamicModelDefinition;
|
|
54
76
|
export interface InternalAgentCompactionDefinition {
|
|
55
77
|
/**
|
|
56
78
|
* Optional model used only for generating compaction summaries.
|
|
@@ -85,7 +107,7 @@ export interface PublicAgentCompactionDefinition {
|
|
|
85
107
|
*
|
|
86
108
|
* When omitted, eve uses the active turn model for the summary call.
|
|
87
109
|
*/
|
|
88
|
-
readonly model?:
|
|
110
|
+
readonly model?: PublicAgentStaticModelDefinition;
|
|
89
111
|
/**
|
|
90
112
|
* Fraction of the primary model context window that triggers compaction.
|
|
91
113
|
*
|
|
@@ -239,8 +261,9 @@ export type PublicAgentDefinition = {
|
|
|
239
261
|
*/
|
|
240
262
|
readonly experimental?: AgentExperimentalDefinition;
|
|
241
263
|
/**
|
|
242
|
-
* Language model used for agent turns. Accepts an AI Gateway model ID
|
|
243
|
-
*
|
|
264
|
+
* Language model used for agent turns. Accepts an AI Gateway model ID, any AI
|
|
265
|
+
* SDK-compatible language model, or `defineDynamic({ fallback, events })` for
|
|
266
|
+
* scoped dynamic model selection.
|
|
244
267
|
*/
|
|
245
268
|
readonly model: PublicAgentModelDefinition;
|
|
246
269
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{};
|
|
1
|
+
import{isDynamicSentinel}from"#shared/dynamic-tool-definition.js";function isDynamicModelDefinition(e){return isDynamicSentinel(e)&&`fallback`in e}export{isDynamicModelDefinition};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type ChannelCors } from "#channel/cors.js";
|
|
2
|
+
import type { RouteDefinition, SendFn } from "#channel/routes.js";
|
|
3
|
+
import type { Session, SessionHandle } from "#channel/session.js";
|
|
4
|
+
import type { SessionAuthContext } from "#channel/types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Enriched return shape from a channel's {@link ChannelAdapter.fetchFile}
|
|
7
|
+
* function. Return a bare {@link Buffer} when only bytes are known, or
|
|
8
|
+
* this record when the fetch discovers a more accurate `mediaType` or
|
|
9
|
+
* `filename` (e.g. from an HTTP `Content-Type` header).
|
|
10
|
+
*
|
|
11
|
+
* When fields are provided, staging prefers them over the values the
|
|
12
|
+
* channel populated at ingestion time.
|
|
13
|
+
*/
|
|
14
|
+
export interface FetchFileResult {
|
|
15
|
+
readonly bytes: Buffer;
|
|
16
|
+
readonly mediaType?: string;
|
|
17
|
+
readonly filename?: string;
|
|
18
|
+
}
|
|
19
|
+
export type FetchFileFunction = (url: string) => Promise<Buffer | FetchFileResult | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Input passed to a channel's `receive` callback when another channel or
|
|
22
|
+
* schedule proactively routes a message to it.
|
|
23
|
+
*/
|
|
24
|
+
export interface GenericReceiveInput<TReceiveTarget = Record<string, unknown>> {
|
|
25
|
+
readonly message: string;
|
|
26
|
+
readonly target: Readonly<TReceiveTarget>;
|
|
27
|
+
readonly auth: SessionAuthContext | null;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The object passed to {@link defineChannel}. `routes` is required; `state`
|
|
31
|
+
* seeds durable adapter state, `context` builds the per-step `channel` argument
|
|
32
|
+
* for `events` and `deliver`, `events` handle session lifecycle, `receive`
|
|
33
|
+
* accepts cross-channel handoffs, `fetchFile` stages remote file URLs, and
|
|
34
|
+
* `metadata` projects observability data.
|
|
35
|
+
*
|
|
36
|
+
* Generics: `TState` (adapter state), `TCtx` (context factory return type),
|
|
37
|
+
* `TReceiveTarget` (cross-channel target shape), `TMetadata` (instrumentation
|
|
38
|
+
* projection).
|
|
39
|
+
*/
|
|
40
|
+
export interface GenericChannelDefinition<TEvents, TState = undefined, TCtx = void, TReceiveTarget = Record<string, unknown>, TMetadata extends Record<string, unknown> = Record<string, unknown>> {
|
|
41
|
+
readonly state?: TState;
|
|
42
|
+
/**
|
|
43
|
+
* CORS policy for this channel's HTTP routes. `true` enables H3/Nitro's
|
|
44
|
+
* permissive defaults (`origin`, methods, request headers, and exposed
|
|
45
|
+
* headers all `"*"`); `false` or omission leaves CORS untouched. Pass an
|
|
46
|
+
* object for a serializable subset of H3/Nitro CORS options.
|
|
47
|
+
*/
|
|
48
|
+
readonly cors?: ChannelCors;
|
|
49
|
+
/**
|
|
50
|
+
* Builds the per-step channel context handed to `events` and `deliver`.
|
|
51
|
+
* Receives the live {@link SessionHandle}, so a factory can close over it to
|
|
52
|
+
* register late-bound callbacks. eve writes state mutations made inside the
|
|
53
|
+
* returned context back through `adapter.state`.
|
|
54
|
+
*
|
|
55
|
+
* Return the channel-owned context (thread handles, API clients, etc.). The
|
|
56
|
+
* framework passes it as the `channel` argument to event handlers (with
|
|
57
|
+
* {@link ChannelSessionOps} injected) and passes {@link SessionContext} as a
|
|
58
|
+
* separate `ctx` argument.
|
|
59
|
+
*/
|
|
60
|
+
context?(state: NonNullable<TState>, session: SessionHandle): TCtx;
|
|
61
|
+
readonly routes: readonly RouteDefinition<TState>[];
|
|
62
|
+
receive?(input: GenericReceiveInput<TReceiveTarget>, args: {
|
|
63
|
+
send: SendFn<TState>;
|
|
64
|
+
}): Promise<Session>;
|
|
65
|
+
readonly events?: TEvents;
|
|
66
|
+
/**
|
|
67
|
+
* Fetches bytes for a `URL` object encountered on a `FilePart.data` by the
|
|
68
|
+
* staging pipeline. Return `null` to pass the URL through to the model
|
|
69
|
+
* provider unchanged, or bytes / {@link FetchFileResult} to stage the file to
|
|
70
|
+
* the sandbox.
|
|
71
|
+
*/
|
|
72
|
+
readonly fetchFile?: FetchFileFunction;
|
|
73
|
+
/**
|
|
74
|
+
* Channel-owned metadata exposed to instrumentation callbacks. This is the
|
|
75
|
+
* channel's public observability surface, not a dump of durable adapter state,
|
|
76
|
+
* so keep it small. Return an object of JSON primitives, arrays, and plain
|
|
77
|
+
* objects: eve omits `undefined` properties and drops projections containing
|
|
78
|
+
* values such as `Date` or `Map`.
|
|
79
|
+
*/
|
|
80
|
+
readonly metadata?: (state: NonNullable<TState>) => TMetadata;
|
|
81
|
+
/**
|
|
82
|
+
* Identifier of the adapter family this channel belongs to. Set by
|
|
83
|
+
* higher-level wrappers (e.g. `slackChannel` passes `"slack"`) so downstream
|
|
84
|
+
* consumers can render typed channel chips instead of bucketing everything
|
|
85
|
+
* under "unknown".
|
|
86
|
+
*
|
|
87
|
+
* Authors calling `defineChannel` directly do not need to set this; the
|
|
88
|
+
* framework defaults to `"http"` for stateless channels and `"defineChannel"`
|
|
89
|
+
* for stateful ones.
|
|
90
|
+
*/
|
|
91
|
+
readonly kindHint?: string;
|
|
92
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"#channel/cors.js";export{};
|
|
@@ -107,22 +107,32 @@ export type DynamicToolEvents = {
|
|
|
107
107
|
* the slot directory (tools/ vs skills/) determines the required return,
|
|
108
108
|
* validated at runtime by the respective resolver.
|
|
109
109
|
*/
|
|
110
|
-
export type DynamicEvents = {
|
|
111
|
-
readonly [K in DynamicToolEventName]?: (event: unknown, ctx: DynamicResolveContext) =>
|
|
110
|
+
export type DynamicEvents<TResult = unknown> = {
|
|
111
|
+
readonly [K in DynamicToolEventName]?: (event: unknown, ctx: DynamicResolveContext) => TResult | Promise<TResult>;
|
|
112
|
+
};
|
|
113
|
+
export type DynamicEventsWithFallback<TResult = unknown> = {
|
|
114
|
+
readonly [K in DynamicToolEventName]?: (event: unknown, ctx: DynamicResolveContext) => Exclude<TResult, undefined> | Promise<Exclude<TResult, undefined>>;
|
|
112
115
|
};
|
|
113
116
|
/**
|
|
114
117
|
* Marker discriminator for a `defineDynamic({ events })` export.
|
|
115
118
|
*/
|
|
116
119
|
export declare const DYNAMIC_SENTINEL_KIND: "eve:dynamic";
|
|
117
120
|
/**
|
|
118
|
-
* Return value of `defineDynamic`: the runtime shape of a
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
+
* Return value of `defineDynamic`: the runtime shape of a dynamic export,
|
|
122
|
+
* stamped with a sentinel kind the compiler/normalizer detects. `TFallback`
|
|
123
|
+
* is `never` except for dynamic agent models, the only slot with a fallback.
|
|
121
124
|
*/
|
|
122
|
-
export
|
|
125
|
+
export type DynamicSentinel<TResult = unknown, TFallback = never> = {
|
|
123
126
|
readonly kind: typeof DYNAMIC_SENTINEL_KIND;
|
|
124
|
-
readonly events: DynamicEvents
|
|
125
|
-
}
|
|
127
|
+
readonly events: DynamicEvents<TResult>;
|
|
128
|
+
} & ([TFallback] extends [never] ? object : {
|
|
129
|
+
readonly fallback: TFallback;
|
|
130
|
+
});
|
|
131
|
+
/**
|
|
132
|
+
* Throws when a dynamic sentinel outside the agent `model` slot carries a
|
|
133
|
+
* `fallback` — anywhere else it would be silently dead configuration.
|
|
134
|
+
*/
|
|
135
|
+
export declare function rejectDynamicSentinelFallback(sentinel: DynamicSentinel, message: string): void;
|
|
126
136
|
export declare function isDynamicSentinel(value: unknown): value is DynamicSentinel;
|
|
127
137
|
/**
|
|
128
138
|
* Symbol-based brand stamped by `defineTool` on every entry. Invisible
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const ALLOWED_DYNAMIC_TOOL_EVENTS=new Set([`session.started`,`turn.started`,`step.started`]),ALLOWED_DYNAMIC_INSTRUCTION_EVENTS=new Set([`session.started`,`turn.started`]),ALLOWED_DYNAMIC_SKILL_EVENTS=new Set([`session.started`,`turn.started`]),DYNAMIC_SENTINEL_KIND=`eve:dynamic`;function isDynamicSentinel(e){return typeof e==`object`&&!!e&&e.kind===`eve:dynamic`}const TOOL_BRAND=Symbol.for(`eve:tool-brand`);function isBrandedToolEntry(e){return typeof e==`object`&&!!e&&e[TOOL_BRAND]===!0}const INSTRUCTIONS_BRAND=Symbol.for(`eve:instructions-brand`);function isBrandedInstructionsEntry(e){return typeof e==`object`&&!!e&&e[INSTRUCTIONS_BRAND]===!0}const SKILL_BRAND=Symbol.for(`eve:skill-brand`);function isBrandedSkillEntry(e){return typeof e==`object`&&!!e&&e[SKILL_BRAND]===!0}export{ALLOWED_DYNAMIC_INSTRUCTION_EVENTS,ALLOWED_DYNAMIC_SKILL_EVENTS,ALLOWED_DYNAMIC_TOOL_EVENTS,DYNAMIC_SENTINEL_KIND,INSTRUCTIONS_BRAND,SKILL_BRAND,TOOL_BRAND,isBrandedInstructionsEntry,isBrandedSkillEntry,isBrandedToolEntry,isDynamicSentinel};
|
|
1
|
+
const ALLOWED_DYNAMIC_TOOL_EVENTS=new Set([`session.started`,`turn.started`,`step.started`]),ALLOWED_DYNAMIC_INSTRUCTION_EVENTS=new Set([`session.started`,`turn.started`]),ALLOWED_DYNAMIC_SKILL_EVENTS=new Set([`session.started`,`turn.started`]),DYNAMIC_SENTINEL_KIND=`eve:dynamic`;function rejectDynamicSentinelFallback(e,t){if(`fallback`in e)throw Error(`${t} "fallback" is only supported on a dynamic agent model (the "model" field in agent.ts). For dynamic tools, skills, and instructions, author a static entry as the default or return null.`)}function isDynamicSentinel(e){return typeof e==`object`&&!!e&&e.kind===`eve:dynamic`}const TOOL_BRAND=Symbol.for(`eve:tool-brand`);function isBrandedToolEntry(e){return typeof e==`object`&&!!e&&e[TOOL_BRAND]===!0}const INSTRUCTIONS_BRAND=Symbol.for(`eve:instructions-brand`);function isBrandedInstructionsEntry(e){return typeof e==`object`&&!!e&&e[INSTRUCTIONS_BRAND]===!0}const SKILL_BRAND=Symbol.for(`eve:skill-brand`);function isBrandedSkillEntry(e){return typeof e==`object`&&!!e&&e[SKILL_BRAND]===!0}export{ALLOWED_DYNAMIC_INSTRUCTION_EVENTS,ALLOWED_DYNAMIC_SKILL_EVENTS,ALLOWED_DYNAMIC_TOOL_EVENTS,DYNAMIC_SENTINEL_KIND,INSTRUCTIONS_BRAND,SKILL_BRAND,TOOL_BRAND,isBrandedInstructionsEntry,isBrandedSkillEntry,isBrandedToolEntry,isDynamicSentinel,rejectDynamicSentinelFallback};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
type BaseEvent = {
|
|
2
|
+
type: string;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Side-effect-only handler for one accepted runtime stream event.
|
|
6
|
+
*
|
|
7
|
+
* `TEvent` is one variant of the runtime stream-event union.
|
|
8
|
+
* {@link GenericStreamEventHooks} infers `TEvent` from the event key.
|
|
9
|
+
*/
|
|
10
|
+
export type GenericStreamEventHook<TEvent extends BaseEvent, TContext> = (event: TEvent, ctx: TContext) => void | Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Map of stream-event subscribers an authored hook file may declare.
|
|
13
|
+
*
|
|
14
|
+
* `*` matches every accepted runtime stream event and runs after the
|
|
15
|
+
* typed handler for that event (if any).
|
|
16
|
+
*/
|
|
17
|
+
export type GenericStreamEventHooks<TEvent extends BaseEvent, TContext> = {
|
|
18
|
+
readonly "*"?: GenericStreamEventHook<TEvent, TContext>;
|
|
19
|
+
} & {
|
|
20
|
+
readonly [K in TEvent["type"]]?: GenericStreamEventHook<Extract<TEvent, {
|
|
21
|
+
type: K;
|
|
22
|
+
}>, TContext>;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Public hook definition authored in `agent/hooks/*.ts`.
|
|
26
|
+
*
|
|
27
|
+
* Hook files declare stream-event subscribers (under `events:`) that
|
|
28
|
+
* fire after eve has accepted and durably recorded each event.
|
|
29
|
+
* Handlers are observe-only: they cannot inject model context. To
|
|
30
|
+
* contribute runtime model messages, use `defineDynamic` +
|
|
31
|
+
* `defineInstructions` in `agent/instructions/`.
|
|
32
|
+
*/
|
|
33
|
+
export interface GenericHookDefinition<TEvent extends BaseEvent, TContext> {
|
|
34
|
+
readonly events?: GenericStreamEventHooks<TEvent, TContext>;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|