import { z } from "#compiled/zod/index.js"; import { type DiscoverDiagnosticsSummary } from "#discover/diagnostics.js"; import { type CompiledRemoteAgentNode } from "#compiler/remote-agent-node.js"; import type { ChannelRouteMethod } from "#public/definitions/channel.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"; /** * 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 = 30; /** * 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; } /** * 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; }; /** * 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; }; /** * Normalized authored instructions prompt preserved in the compiled * manifest. */ export type CompiledInstructions = z.infer; /** * 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; /** * 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[]; } /** * 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[]; } /** * 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; /** * Flattened compiled subagent node emitted by the compiler. `name` and * `description` are copied from `agent.config` for fast registry lookup. */ 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 compiledInstructionsSchema: z.ZodObject<{ name: z.ZodString; logicalPath: z.ZodString; markdown: z.ZodString; sourceId: z.ZodString; sourceKind: z.ZodUnion, z.ZodLiteral<"module">]>; }, z.core.$strict>; 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>; workflowEnabled: z.ZodDefault; dynamicInstructions: z.ZodDefault>>>; dynamicSkills: z.ZodDefault>>>; dynamicTools: 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, z.ZodLiteral<"module">]>; }, z.core.$strict>>; 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>; /** * Zod schema for the versioned compiled manifest emitted by the compiler. */ export declare const compiledAgentManifestSchema: 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>; workflowEnabled: z.ZodDefault; 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, unknown, z.core.$ZodTypeInternals, unknown>>>; instructions: z.ZodOptional, z.ZodLiteral<"module">]>; }, z.core.$strict>>; 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<30>; 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 workflowEnabled?: boolean; readonly dynamicInstructions?: readonly CompiledDynamicInstructionsDefinition[]; 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 instructions?: CompiledInstructions; 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 workflowEnabled?: boolean; 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?: CompiledInstructions; readonly tools?: readonly CompiledToolDefinition[]; }): CompiledAgentManifest;