import { z } from "#compiled/zod/index.js"; import { type DiscoverDiagnosticsSummary } from "#discover/diagnostics.js"; import { type CompiledDynamicSubagentDefinition, type CompiledRemoteAgentNode } from "#compiler/remote-agent-node.js"; import type { ChannelRouteMethod } from "#public/definitions/channel.js"; import type { NormalizedChannelCorsOptions } from "#channel/cors.js"; import type { InternalInstructionsDefinition } from "#shared/instructions-definition.js"; import type { Node } from "#shared/node.js"; import type { MarkdownSourceRef, ModuleSourceRef, SkillPackageSourceRef } from "#shared/source-ref.js"; import type { NamedSkillDefinition } from "#shared/skill-definition.js"; import type { InternalAgentDefinition, InternalAgentModelDefinition, InternalAgentCompactionDefinition, ModelRouting } from "#shared/agent-definition.js"; import type { InternalToolDefinition } from "#shared/tool-definition.js"; import type { WebSearchProvider } from "#shared/web-search.js"; /** * Stable manifest kind emitted by the compiler for runtime loading. */ export declare const COMPILED_AGENT_MANIFEST_KIND = "eve-agent-compiled-manifest"; /** * Stable node id used by compiled artifacts for the root authored agent. */ export declare const ROOT_COMPILED_AGENT_NODE_ID = "__root__"; /** * Current compiled manifest schema version. */ export declare const COMPILED_AGENT_MANIFEST_VERSION = 39; /** * Compiled channel entry preserved in the compiled manifest. */ export type CompiledChannelEntry = CompiledChannelDefinition | DisabledCompiledChannelEntry; /** * Active compiled channel entry — backed by an authored `Channel` module. */ export interface CompiledChannelDefinition { readonly kind: "channel"; readonly name: string; readonly logicalPath: string; readonly method: ChannelRouteMethod; readonly urlPath: string; readonly sourceId: string; readonly sourceKind: "module"; readonly exportName?: string; /** * Stable identifier of the `ChannelAdapter.kind` returned by the authored * route, captured at compile time. Examples: `"slack"`, `"http"`. Authors * may override the default kind on their adapter, so this field is the * adapter's reported value verbatim. Consumers (eg. dashboard surfaces) * normalize it for display via {@link normalizeChannelKindForDisplay}. * * Omitted when the route does not register an adapter. */ readonly adapterKind?: string; /** * Serializable CORS options to apply to this channel route. Omitted when the * channel leaves CORS untouched. */ readonly cors?: NormalizedChannelCorsOptions; } /** * Disabled compiled channel entry — marker that an authored file at this * slug exported `disableRoute()` to remove the matching framework default. */ interface DisabledCompiledChannelEntry { readonly kind: "disabled"; readonly name: string; readonly logicalPath: string; } /** * Serializable runtime model reference preserved in the compiled manifest. * * Carries {@link ModelRouting} — decided at compile time from the authored model * value — so consumers (the dev server's `/eve/v1/info`, the TUI) can tell how * the model is reached without re-resolving it. Runtime model resolution uses * the routing-free {@link InternalAgentModelDefinition}; routing is a * compiled-output concern only. */ export type CompiledRuntimeModelReference = InternalAgentModelDefinition & { routing: ModelRouting; }; /** * Dynamic model resolver source preserved in the compiled manifest; the * compiled `config.model` remains the fallback model. */ export type CompiledDynamicModelDefinition = ModuleSourceRef & { readonly eventNames: readonly string[]; }; /** * Normalized authored compaction configuration preserved in the compiled * manifest. */ type CompiledAgentCompactionDefinition = Omit & { model?: CompiledRuntimeModelReference; }; /** * Normalized additive agent configuration preserved in the compiled manifest. */ export type CompiledAgentDefinition = Omit & { model: CompiledRuntimeModelReference; compaction?: CompiledAgentCompactionDefinition; dynamicModel?: CompiledDynamicModelDefinition; }; /** * Normalized authored instructions prompt preserved in the compiled * manifest. */ export type CompiledInstructionsDefinition = InternalInstructionsDefinition & (Omit, "definition"> | Omit); /** * Normalized authored skill preserved in the compiled manifest. */ export type CompiledSkillDefinition = NamedSkillDefinition & (Omit, "definition"> | ModuleSourceRef | SkillPackageSourceRef); /** * Normalized authored schedule preserved in the compiled manifest. */ export type CompiledScheduleDefinition = z.infer; /** * Normalized authored sandbox metadata preserved in the compiled manifest. */ export type CompiledSandboxDefinition = z.infer; /** * Compiled sandbox workspace folder preserved in the compiled manifest. * * Corresponds to the `agent/sandbox/workspace/` directory discovered on * disk. Mounted into the live sandbox cwd at session bootstrap. */ type CompiledSandboxWorkspace = z.infer; /** * Byte-free descriptor for the compiled workspace resource tree owned by one * graph node. */ export type CompiledWorkspaceResourceRoot = z.infer; /** * Normalized authored connection metadata preserved in the compiled manifest. */ export type CompiledConnectionDefinition = z.infer; /** * Normalized authored tool metadata preserved in the compiled manifest. */ export type CompiledToolDefinition = InternalToolDefinition & ModuleSourceRef; /** * Serializable configuration for the experimental framework `Workflow` tool. */ export interface CompiledWorkflowToolDefinition { readonly maxSubagents?: number; } /** * Compiled dynamic tool resolver entry. The resolver function lives in the * compiled module map; the manifest entry carries only the metadata needed * to load and invoke it at runtime. */ export interface CompiledDynamicToolDefinition extends ModuleSourceRef { readonly slug: string; readonly eventNames: readonly string[]; /** * Mount namespace when this resolver comes from an extension. The runtime * prefixes the names of tools the resolver produces (`forecast` → * `crm__forecast`) so extension-produced tools are namespaced like every * other extension contribution. Absent for consumer-authored resolvers. */ readonly extensionNamespace?: string; } /** * Compiled dynamic skill resolver entry. Mirrors * {@link CompiledDynamicToolDefinition} — the resolver produces skill * packages at runtime rather than tool definitions. */ export interface CompiledDynamicSkillDefinition extends ModuleSourceRef { readonly slug: string; readonly eventNames: readonly string[]; /** * Mount namespace when this resolver comes from an extension. Names of skills * a map resolver produces are prefixed with `${extensionNamespace}__`. */ readonly extensionNamespace?: string; } /** * Compiled dynamic instructions resolver entry. The resolver produces * {@link ModelMessage[]} at runtime rather than static markdown. */ export interface CompiledDynamicInstructionsDefinition extends ModuleSourceRef { readonly slug: string; readonly eventNames: readonly string[]; } /** * Normalized authored hook entry preserved in the compiled manifest. * * Hook event handlers are arbitrary functions — there is no static * shape the compiler can validate beyond the source ref. Per-handler * resolution happens at runtime via {@link resolveHookDefinition}. */ export interface CompiledHookDefinition extends ModuleSourceRef { /** * Path-relative slug used for diagnostics and ordering. Derived from * the authored file's logical path * (eg. `agent/hooks/auth/guard.ts` → `"auth/guard"`). */ readonly slug: string; } /** * Non-recursive compiled authored agent payload shared by the root agent and * every flattened subagent node. */ export type CompiledAgentNodeManifest = z.infer; export type CompiledSubagentNode = Readonly; export type { CompiledRemoteAgentNode } from "#compiler/remote-agent-node.js"; /** * Parent-child edge connecting two compiled agent nodes. */ export interface CompiledSubagentEdge { readonly childNodeId: string; readonly parentNodeId: string; } /** * Versioned compiled manifest emitted by the compiler and loaded by runtime. */ export type CompiledAgentManifest = z.infer; declare const compiledScheduleDefinitionSchema: z.ZodObject<{ cron: z.ZodString; hasRun: z.ZodBoolean; name: z.ZodString; logicalPath: z.ZodString; markdown: z.ZodOptional; sourceId: z.ZodString; sourceKind: z.ZodUnion, z.ZodLiteral<"module">]>; }, z.core.$strict>; declare const compiledSandboxDefinitionSchema: z.ZodObject<{ backendName: z.ZodOptional; description: z.ZodOptional; exportName: z.ZodOptional; logicalPath: z.ZodString; revalidationKey: z.ZodOptional; sourceHash: z.ZodString; sourceId: z.ZodString; sourceKind: z.ZodLiteral<"module">; }, z.core.$strict>; declare const compiledSandboxWorkspaceSchema: z.ZodObject<{ logicalPath: z.ZodString; rootEntries: z.ZodReadonly>; sourceId: z.ZodString; sourcePath: z.ZodString; }, z.core.$strict>; declare const compiledWorkspaceResourceRootSchema: z.ZodObject<{ contentHash: z.ZodOptional; logicalPath: z.ZodString; rootEntries: z.ZodReadonly>; }, z.core.$strict>; declare const compiledConnectionDefinitionSchema: z.ZodObject<{ connectionName: z.ZodString; description: z.ZodString; exportName: z.ZodOptional; logicalPath: z.ZodString; protocol: z.ZodDefault>; sourceId: z.ZodString; sourceKind: z.ZodLiteral<"module">; url: z.ZodString; vercelConnect: z.ZodOptional>; }, z.core.$strict>; /** * Zod schema for one non-recursive compiled authored agent payload. */ declare const compiledAgentNodeManifestSchema: z.ZodObject<{ agentRoot: z.ZodString; appRoot: z.ZodString; channels: z.ZodArray>>; config: z.ZodType>; connections: z.ZodArray; logicalPath: z.ZodString; protocol: z.ZodDefault>; sourceId: z.ZodString; sourceKind: z.ZodLiteral<"module">; url: z.ZodString; vercelConnect: z.ZodOptional>; }, z.core.$strict>>; diagnosticsSummary: z.ZodObject<{ errors: z.ZodNumber; warnings: z.ZodNumber; }, z.core.$strict>; disabledFrameworkTools: z.ZodReadonly>; workflowTool: z.ZodOptional>>; webSearchProvider: z.ZodOptional>; dynamicInstructions: z.ZodDefault>>>; dynamicSkills: z.ZodDefault>>>; dynamicTools: z.ZodDefault>>>; extensionMounts: z.ZodDefault>>>; hooks: z.ZodArray>>; sandbox: z.ZodNullable; description: z.ZodOptional; exportName: z.ZodOptional; logicalPath: z.ZodString; revalidationKey: z.ZodOptional; sourceHash: z.ZodString; sourceId: z.ZodString; sourceKind: z.ZodLiteral<"module">; }, z.core.$strict>>; sandboxWorkspaces: z.ZodArray>; sourceId: z.ZodString; sourcePath: z.ZodString; }, z.core.$strict>>; schedules: z.ZodArray; sourceId: z.ZodString; sourceKind: z.ZodUnion, z.ZodLiteral<"module">]>; }, z.core.$strict>>; remoteAgents: z.ZodArray, unknown, z.core.$ZodTypeInternals, unknown>>>; skills: z.ZodReadonly>>>; instructions: z.ZodOptional>>; tools: z.ZodArray; inputSchema: z.ZodNullable>>; logicalPath: z.ZodString; name: z.ZodString; outputSchema: z.ZodOptional>>; sourceId: z.ZodString; sourceKind: z.ZodLiteral<"module">; }, z.core.$strict>>; workspaceResourceRoot: z.ZodObject<{ contentHash: z.ZodOptional; logicalPath: z.ZodString; rootEntries: z.ZodReadonly>; }, z.core.$strict>; }, z.core.$strict>; /** * One mounted extension recorded on a compiled agent manifest. The runtime * evaluates {@link mountLogicalPath} at module-map load so the mount's factory * call binds the extension's config before any tool runs. */ export interface CompiledExtensionMount { /** Mount-derived namespace that prefixes the extension's tool/skill names. */ readonly namespace: string; readonly packageName: string; /** * Package-derived namespace that scopes the extension's durable state keys and * config binding. Distinct from {@link namespace}: state stays keyed to the * package so a consumer renaming the mount file cannot orphan persisted state. */ readonly packageNamespace: string; /** * Absolute path to the extension's source root on disk. The extension-scope * bundler plugin treats any module under this root as extension-owned and * rewrites its `eve/context`/`eve/extension` imports to bake in the namespace. */ readonly sourceRoot: string; readonly mountSourceId: string; readonly mountLogicalPath: string; } /** * Zod schema for the versioned compiled manifest emitted by the compiler. */ export declare const compiledAgentManifestSchema: z.ZodObject<{ agentRoot: z.ZodString; appRoot: z.ZodString; extensionMounts: z.ZodDefault>>>; channels: z.ZodArray>>; config: z.ZodType>; connections: z.ZodArray; logicalPath: z.ZodString; protocol: z.ZodDefault>; sourceId: z.ZodString; sourceKind: z.ZodLiteral<"module">; url: z.ZodString; vercelConnect: z.ZodOptional>; }, z.core.$strict>>; diagnosticsSummary: z.ZodObject<{ errors: z.ZodNumber; warnings: z.ZodNumber; }, z.core.$strict>; disabledFrameworkTools: z.ZodReadonly>; workflowTool: z.ZodOptional>>; webSearchProvider: z.ZodOptional>; dynamicInstructions: z.ZodDefault>>>; dynamicSkills: z.ZodDefault>>>; dynamicTools: z.ZodDefault>>>; hooks: z.ZodArray>>; kind: z.ZodLiteral<"eve-agent-compiled-manifest">; remoteAgents: z.ZodArray, unknown, z.core.$ZodTypeInternals, unknown>>>; sandbox: z.ZodNullable; description: z.ZodOptional; exportName: z.ZodOptional; logicalPath: z.ZodString; revalidationKey: z.ZodOptional; sourceHash: z.ZodString; sourceId: z.ZodString; sourceKind: z.ZodLiteral<"module">; }, z.core.$strict>>; sandboxWorkspaces: z.ZodArray>; sourceId: z.ZodString; sourcePath: z.ZodString; }, z.core.$strict>>; schedules: z.ZodArray; sourceId: z.ZodString; sourceKind: z.ZodUnion, z.ZodLiteral<"module">]>; }, z.core.$strict>>; skills: z.ZodReadonly>>>; subagentEdges: z.ZodArray>>; subagents: z.ZodArray>>; instructions: z.ZodOptional>>; tools: z.ZodArray; inputSchema: z.ZodNullable>>; logicalPath: z.ZodString; name: z.ZodString; outputSchema: z.ZodOptional>>; sourceId: z.ZodString; sourceKind: z.ZodLiteral<"module">; }, z.core.$strict>>; version: z.ZodLiteral<39>; workspaceResourceRoot: z.ZodObject<{ contentHash: z.ZodOptional; logicalPath: z.ZodString; rootEntries: z.ZodReadonly>; }, z.core.$strict>; }, z.core.$strict>; /** * Creates a compiled authored agent payload with stable defaults. */ export declare function createCompiledAgentNodeManifest(input: { readonly agentRoot: string; readonly appRoot: string; readonly channels?: readonly CompiledChannelEntry[]; readonly config: CompiledAgentDefinition; readonly connections?: readonly CompiledConnectionDefinition[]; readonly diagnosticsSummary?: DiscoverDiagnosticsSummary; readonly disabledFrameworkTools?: readonly string[]; readonly workflowTool?: CompiledWorkflowToolDefinition; readonly webSearchProvider?: WebSearchProvider; readonly dynamicInstructions?: readonly CompiledDynamicInstructionsDefinition[]; readonly dynamicSkills?: readonly CompiledDynamicSkillDefinition[]; readonly dynamicTools?: readonly CompiledDynamicToolDefinition[]; readonly extensionMounts?: readonly CompiledExtensionMount[]; readonly hooks?: readonly CompiledHookDefinition[]; readonly remoteAgents?: readonly CompiledRemoteAgentNode[]; readonly sandbox?: CompiledSandboxDefinition | null; readonly sandboxWorkspaces?: readonly CompiledSandboxWorkspace[]; readonly schedules?: readonly CompiledScheduleDefinition[]; readonly skills?: readonly CompiledSkillDefinition[]; readonly instructions?: CompiledInstructionsDefinition; readonly tools?: readonly CompiledToolDefinition[]; readonly workspaceResourceRoot?: CompiledWorkspaceResourceRoot; }): CompiledAgentNodeManifest; /** * Computes the sorted `rootEntries` advertised by the workspace resource * tree for one graph node. * * Shared by the synthetic manifest factory (used in tests and the * in-memory compile path) and by `materializeWorkspaceResources` so both * paths emit identical descriptors. */ export declare function deriveResourceRootEntries(input: { readonly sandboxWorkspaces?: readonly CompiledSandboxWorkspace[]; readonly skills?: readonly CompiledSkillDefinition[]; }): readonly string[]; /** * Creates one stable compiled subagent node id from the parent node id and the * source entry discovered in that parent package. */ export declare function createCompiledSubagentNodeId(parentNodeId: string, sourceId: string): string; /** * Creates a compiled manifest with stable defaults. */ export declare function createCompiledAgentManifest(input: { readonly agentRoot: string; readonly appRoot: string; readonly channels?: readonly CompiledChannelEntry[]; readonly config: CompiledAgentDefinition; readonly connections?: readonly CompiledConnectionDefinition[]; readonly diagnosticsSummary?: DiscoverDiagnosticsSummary; readonly disabledFrameworkTools?: readonly string[]; readonly workflowTool?: CompiledWorkflowToolDefinition; readonly webSearchProvider?: WebSearchProvider; readonly dynamicSkills?: readonly CompiledDynamicSkillDefinition[]; readonly dynamicTools?: readonly CompiledDynamicToolDefinition[]; readonly hooks?: readonly CompiledHookDefinition[]; readonly remoteAgents?: readonly CompiledRemoteAgentNode[]; readonly sandbox?: CompiledSandboxDefinition | null; readonly sandboxWorkspaces?: readonly CompiledSandboxWorkspace[]; readonly schedules?: readonly CompiledScheduleDefinition[]; readonly skills?: readonly CompiledSkillDefinition[]; readonly subagentEdges?: readonly CompiledSubagentEdge[]; readonly subagents?: readonly CompiledSubagentNode[]; readonly instructions?: CompiledInstructionsDefinition; readonly tools?: readonly CompiledToolDefinition[]; readonly extensionMounts?: readonly CompiledExtensionMount[]; }): CompiledAgentManifest;