@codemation/core 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/{CostCatalogContract-DD7fQ4FF.d.cts → CostCatalogContract-Dxq1BTyi.d.cts} +2 -2
- package/dist/{EngineRuntimeRegistration.types-DTV5_7Jw.d.cts → EngineRuntimeRegistration.types-CqcTWexS.d.cts} +3 -3
- package/dist/{EngineRuntimeRegistration.types-Dl92Hdoi.d.ts → EngineRuntimeRegistration.types-Cr75cSfL.d.ts} +2 -2
- package/dist/{InMemoryRunDataFactory-qMiYjhCK.d.cts → InMemoryRunDataFactory-Csy2evr_.d.cts} +5 -2
- package/dist/{ItemsInputNormalizer-Div-fb6a.cjs → ItemsInputNormalizer-57EdA1ad.cjs} +2 -2
- package/dist/{ItemsInputNormalizer-Div-fb6a.cjs.map → ItemsInputNormalizer-57EdA1ad.cjs.map} +1 -1
- package/dist/{ItemsInputNormalizer-C09a7iFP.d.ts → ItemsInputNormalizer-BWtlwdVI.d.ts} +2 -2
- package/dist/{ItemsInputNormalizer-BhuxvZh5.js → ItemsInputNormalizer-BkSvmfAW.js} +2 -2
- package/dist/{ItemsInputNormalizer-BhuxvZh5.js.map → ItemsInputNormalizer-BkSvmfAW.js.map} +1 -1
- package/dist/{ItemsInputNormalizer-DLaD6rTl.d.cts → ItemsInputNormalizer-pLrWwUAP.d.cts} +3 -3
- package/dist/{RunIntentService-CWMMrAP4.d.cts → RunIntentService-BitgkKaT.d.cts} +2 -2
- package/dist/{RunIntentService-BOSGwmqn.d.ts → RunIntentService-DYpqfu6D.d.ts} +2 -2
- package/dist/{agentMcpTypes-DUmniLOY.d.cts → agentMcpTypes-DGIwk6Ue.d.cts} +20 -2
- package/dist/bootstrap/index.cjs +3 -3
- package/dist/bootstrap/index.d.cts +5 -5
- package/dist/bootstrap/index.d.ts +5 -5
- package/dist/bootstrap/index.js +3 -3
- package/dist/{bootstrap-D460dCgS.cjs → bootstrap-BEu1fJBM.cjs} +3 -3
- package/dist/{bootstrap-D460dCgS.cjs.map → bootstrap-BEu1fJBM.cjs.map} +1 -1
- package/dist/{bootstrap-CKTMMNmL.js → bootstrap-CSeInbj1.js} +3 -3
- package/dist/{bootstrap-CKTMMNmL.js.map → bootstrap-CSeInbj1.js.map} +1 -1
- package/dist/browser.cjs +3 -2
- package/dist/browser.d.cts +4 -4
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +3 -3
- package/dist/contracts.d.cts +5 -5
- package/dist/contracts.d.ts +2 -2
- package/dist/{di-tO6R7VJV.cjs → di-C-2ep8NZ.cjs} +9 -1
- package/dist/di-C-2ep8NZ.cjs.map +1 -0
- package/dist/{di-DdsgWfVy.js → di-D9Mv3kF3.js} +4 -2
- package/dist/di-D9Mv3kF3.js.map +1 -0
- package/dist/{executionPersistenceContracts-DenJJK2T.d.cts → executionPersistenceContracts-CN9d7AnL.d.cts} +2 -2
- package/dist/{index-BZDhEQ6W.d.ts → index-CqZeNGAp.d.ts} +71 -5
- package/dist/{index-CSKKuK60.d.ts → index-rllWL4r-.d.ts} +20 -2
- package/dist/index.cjs +23 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +71 -8
- package/dist/index.d.ts +5 -5
- package/dist/index.js +22 -4
- package/dist/index.js.map +1 -1
- package/dist/{params-DqRvku2h.d.cts → params-DRUr0F5v.d.cts} +2 -2
- package/dist/{runtime-BPZgnZ9G.js → runtime-6-U2Cou5.js} +81 -4
- package/dist/runtime-6-U2Cou5.js.map +1 -0
- package/dist/{runtime-CyW9c9XM.cjs → runtime-DjYXgOo0.cjs} +81 -4
- package/dist/runtime-DjYXgOo0.cjs.map +1 -0
- package/dist/testing.cjs +3 -3
- package/dist/testing.d.cts +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +3 -3
- package/package.json +1 -1
- package/src/binaries/DefaultExecutionBinaryServiceFactory.ts +27 -2
- package/src/binaries/DefaultNodeBinaryAttachmentServiceFactory.ts +14 -0
- package/src/binaries/boundedReadBinary.types.ts +90 -0
- package/src/contracts/runtimeTypes.ts +19 -0
- package/src/contracts/workspaceFileTypes.ts +73 -0
- package/src/index.ts +2 -0
- package/dist/di-DdsgWfVy.js.map +0 -1
- package/dist/di-tO6R7VJV.cjs.map +0 -1
- package/dist/runtime-BPZgnZ9G.js.map +0 -1
- package/dist/runtime-CyW9c9XM.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"di-D9Mv3kF3.js","names":["out: unknown[]","out","exprArgs: ItemExprArgs","name: string","node: TNodeConfig","AgentConnectionNodeCollector: AgentConnectionNodeCollectorApi","collected: AgentConnectionNodeDescriptor[]","bindingKey: CredentialBindingKey","acceptedTypes: ReadonlyArray<CredentialTypeId>","request: Readonly<{\n decisionSchema: ZodType<TDecision>;\n timeout: Duration;\n onTimeout: \"halt\" | \"auto-accept\";\n subject: HumanTaskSubject;\n metadata?: Readonly<Record<string, import(\"./workflowTypes\").JsonValue>>;\n deliver: (handle: HumanTaskHandle) => Promise<TDelivery>;\n }>","max: string | undefined"],"sources":["../src/workflow/definition/ConnectionNodeIdFactory.ts","../src/contracts/itemExpr.ts","../src/ai/AgentConfigInspectorFactory.ts","../src/ai/NodeBackedToolConfig.ts","../src/ai/AgentConnectionNodeCollector.ts","../src/workflow/definition/NodeIterationIdFactory.ts","../src/contracts/credentialTypes.ts","../src/contracts/runtimeTypes.ts","../src/contracts/runFinishedAtFactory.ts","../src/contracts/workflowTypes.ts","../src/di/CoreTokens.ts"],"sourcesContent":["import type { NodeId } from \"../../types\";\n\n/**\n * Deterministic ids for workflow connection-owned child nodes (LLM slot, tools, etc.).\n * These are stable across loads.\n */\nexport class ConnectionNodeIdFactory {\n static readonly connectionSegment = \"__conn__\" as const;\n\n static languageModelConnectionNodeId(parentNodeId: NodeId): NodeId {\n return `${parentNodeId}${this.connectionSegment}llm`;\n }\n\n static toolConnectionNodeId(parentNodeId: NodeId, toolName: string): NodeId {\n const normalized = this.normalizeToolName(toolName);\n return `${parentNodeId}${this.connectionSegment}tool${this.connectionSegment}${normalized}`;\n }\n\n static mcpConnectionNodeId(parentNodeId: NodeId, serverId: string): NodeId {\n return `${parentNodeId}${this.connectionSegment}mcp${this.connectionSegment}${serverId}`;\n }\n\n static isMcpConnectionNodeId(nodeId: NodeId): boolean {\n return nodeId.includes(`${this.connectionSegment}mcp${this.connectionSegment}`);\n }\n\n static parseMcpConnectionNodeId(nodeId: NodeId): Readonly<{ parentNodeId: NodeId; serverId: string }> | undefined {\n if (!this.isMcpConnectionNodeId(nodeId)) {\n return undefined;\n }\n const marker = `${this.connectionSegment}mcp${this.connectionSegment}`;\n const idx = nodeId.lastIndexOf(marker);\n if (idx < 0) {\n return undefined;\n }\n const parentNodeId = nodeId.slice(0, idx);\n const serverId = nodeId.slice(idx + marker.length);\n if (!parentNodeId || !serverId) {\n return undefined;\n }\n return { parentNodeId, serverId };\n }\n\n static isLanguageModelConnectionNodeId(nodeId: NodeId): boolean {\n return nodeId.endsWith(`${this.connectionSegment}llm`);\n }\n\n static isToolConnectionNodeId(nodeId: NodeId): boolean {\n return nodeId.includes(`${this.connectionSegment}tool${this.connectionSegment}`);\n }\n\n static parseLanguageModelConnectionNodeId(nodeId: NodeId): Readonly<{ parentNodeId: NodeId }> | undefined {\n if (!this.isLanguageModelConnectionNodeId(nodeId)) {\n return undefined;\n }\n const suffix = `${this.connectionSegment}llm`;\n const parentNodeId = nodeId.slice(0, -suffix.length);\n return parentNodeId ? { parentNodeId } : undefined;\n }\n\n static parseToolConnectionNodeId(\n nodeId: NodeId,\n ): Readonly<{ parentNodeId: NodeId; normalizedToolName: string }> | undefined {\n if (!this.isToolConnectionNodeId(nodeId)) {\n return undefined;\n }\n const marker = `${this.connectionSegment}tool${this.connectionSegment}`;\n const idx = nodeId.lastIndexOf(marker);\n if (idx < 0) {\n return undefined;\n }\n const parentNodeId = nodeId.slice(0, idx);\n const normalizedToolName = nodeId.slice(idx + marker.length);\n if (!parentNodeId || !normalizedToolName) {\n return undefined;\n }\n return { parentNodeId, normalizedToolName };\n }\n\n /** True when `nodeId` is a connection-owned child of `parentNodeId` (LLM or tool slot). */\n static isConnectionOwnedDescendantOf(parentNodeId: NodeId, nodeId: NodeId): boolean {\n return nodeId.startsWith(`${parentNodeId}${this.connectionSegment}`);\n }\n\n /** Normalizes a tool display name to a stable id segment. */\n static normalizeToolName(toolName: string): string {\n return (\n toolName\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"_\")\n .replace(/^_+|_+$/g, \"\") || \"tool\"\n );\n }\n}\n","import type { NodeExecutionContext } from \"./runtimeTypes\";\nimport type { Item, Items, NodeActivationId, NodeId, RunDataSnapshot, RunId, WorkflowId } from \"./workflowTypes\";\n\nconst ITEM_EXPR_BRAND = Symbol.for(\"codemation.itemExpr\");\n\nexport type ItemExprResolvedContext = Readonly<{\n runId: RunId;\n workflowId: WorkflowId;\n nodeId: NodeId;\n activationId: NodeActivationId;\n data: RunDataSnapshot;\n}>;\n\n/**\n * Context aligned with former {@link ItemInputMapperContext} — use **`data`** to read any completed upstream node.\n */\nexport type ItemExprContext = ItemExprResolvedContext;\n\nexport type ItemExprArgs<TItemJson = unknown> = Readonly<{\n item: Item<TItemJson>;\n itemIndex: number;\n items: Items<TItemJson>;\n ctx: ItemExprContext;\n}>;\n\nexport type ItemExprCallback<T, TItemJson = unknown> = (args: ItemExprArgs<TItemJson>) => T | Promise<T>;\n\nexport type ItemExpr<T, TItemJson = unknown> = Readonly<{\n readonly [ITEM_EXPR_BRAND]: true;\n readonly fn: ItemExprCallback<T, TItemJson>;\n}>;\n\nexport function itemExpr<T, TItemJson = unknown>(fn: ItemExprCallback<T, TItemJson>): ItemExpr<T, TItemJson> {\n return { [ITEM_EXPR_BRAND]: true, fn };\n}\n\nexport function isItemExpr<T, TItemJson = unknown>(value: unknown): value is ItemExpr<T, TItemJson> {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n const v = value as Record<PropertyKey, unknown>;\n if (v[ITEM_EXPR_BRAND] === true) {\n return true;\n }\n // Support snapshot-hydrated itemExpr wrappers where the symbol brand was lost but the callback survived.\n // Workflow snapshot hydration currently restores function-valued fields (like `fn`) but may drop symbol-keyed brands.\n // We treat the minimal `{ fn: Function }` shape as an itemExpr wrapper to keep runnable configs working.\n const keys = Object.keys(v);\n if (keys.length === 1 && keys[0] === \"fn\" && typeof (v as { fn?: unknown }).fn === \"function\") {\n return true;\n }\n for (const sym of Object.getOwnPropertySymbols(v)) {\n if (sym.description === \"codemation.itemExpr\" && v[sym] === true) {\n return true;\n }\n }\n return false;\n}\n\nfunction containsItemExprInUnknown(value: unknown, seen: WeakSet<object> = new WeakSet()): boolean {\n if (isItemExpr(value)) {\n return true;\n }\n if (value === null || typeof value !== \"object\") {\n return false;\n }\n if (seen.has(value as object)) {\n return false;\n }\n seen.add(value as object);\n if (Array.isArray(value)) {\n return value.some((entry) => containsItemExprInUnknown(entry, seen));\n }\n for (const entry of Object.values(value as Record<string, unknown>)) {\n if (containsItemExprInUnknown(entry, seen)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Deep-resolves {@link itemExpr} leaves. Returns a new graph (does not mutate the original config object).\n */\nexport async function resolveItemExprsInUnknown(\n value: unknown,\n args: ItemExprArgs,\n seen: WeakSet<object> = new WeakSet(),\n): Promise<unknown> {\n if (isItemExpr(value)) {\n return await Promise.resolve(value.fn(args));\n }\n if (value === null || typeof value !== \"object\") {\n return value;\n }\n if (seen.has(value as object)) {\n return value;\n }\n seen.add(value as object);\n if (Array.isArray(value)) {\n const out: unknown[] = [];\n for (let i = 0; i < value.length; i++) {\n out.push(await resolveItemExprsInUnknown(value[i], args, seen));\n }\n return out;\n }\n const rec = value as Record<string, unknown>;\n const entries = Object.entries(rec);\n const proto = Object.getPrototypeOf(value);\n if (proto !== Object.prototype && proto !== null && entries.length === 0) {\n return value;\n }\n const out = Object.create(proto) as Record<string, unknown>;\n for (const [k, v] of entries) {\n out[k] = await resolveItemExprsInUnknown(v, args, seen);\n }\n return out;\n}\n\n/**\n * Clones runnable config (best-effort) so per-item {@link itemExpr} resolution never mutates shared instances.\n */\nexport async function resolveItemExprsForExecution(\n config: unknown,\n nodeCtx: NodeExecutionContext,\n item: Item,\n itemIndex: number,\n items: Items,\n): Promise<unknown | undefined> {\n const exprArgs: ItemExprArgs = {\n item,\n itemIndex,\n items,\n ctx: {\n runId: nodeCtx.runId,\n workflowId: nodeCtx.workflowId,\n nodeId: nodeCtx.nodeId,\n activationId: nodeCtx.activationId,\n data: nodeCtx.data,\n },\n };\n if (!containsItemExprInUnknown(config)) {\n return undefined;\n }\n return await resolveItemExprsInUnknown(config, exprArgs);\n}\n","import type { NodeConfigBase } from \"../types\";\nimport { isItemExpr } from \"../contracts/itemExpr\";\nimport type { AgentNodeConfig } from \"./AiHost\";\n\nexport class AgentConfigInspector {\n static isAgentNodeConfig(config: NodeConfigBase | undefined): config is AgentNodeConfig<any, any> {\n if (!config) return false;\n const candidate = config as Partial<AgentNodeConfig<any, any>>;\n return !!candidate.chatModel && this.hasCompatibleMessageConfiguration(candidate);\n }\n\n private static hasCompatibleMessageConfiguration(candidate: Partial<AgentNodeConfig<any, any>>): boolean {\n const messages = candidate.messages;\n if (messages === undefined || messages === null) {\n return false;\n }\n if (Array.isArray(messages)) {\n return messages.length > 0;\n }\n if (typeof messages === \"object\") {\n if (isItemExpr(messages)) {\n return true;\n }\n const o = messages as { prompt?: unknown; buildMessages?: unknown };\n return (Array.isArray(o.prompt) && o.prompt.length > 0) || typeof o.buildMessages === \"function\";\n }\n return false;\n }\n}\n","import type { CredentialRequirement } from \"../contracts/credentialTypes\";\nimport type { TypeToken } from \"../di\";\nimport type { Item, NodeOutputs, RunnableNodeConfig, RunnableNodeInputJson } from \"../types\";\nimport type { input as ZodInput, output as ZodOutput } from \"zod\";\nimport type {\n AgentCanvasPresentation,\n NodeBackedToolConfigOptions,\n NodeBackedToolInputMapper,\n NodeBackedToolInputMapperArgs,\n NodeBackedToolOutputMapper,\n NodeBackedToolOutputMapperArgs,\n ToolConfig,\n ZodSchemaAny,\n} from \"./AiHost\";\n\nexport class NodeBackedToolConfig<\n TNodeConfig extends RunnableNodeConfig<any, any>,\n TInputSchema extends ZodSchemaAny,\n TOutputSchema extends ZodSchemaAny,\n> implements ToolConfig {\n readonly type: TypeToken<unknown>;\n readonly toolKind = \"nodeBacked\" as const;\n readonly description?: string;\n readonly presentation?: AgentCanvasPresentation;\n private readonly inputSchemaValue: TInputSchema;\n private readonly outputSchemaValue: TOutputSchema;\n private readonly mapInputValue?: NodeBackedToolInputMapper<TNodeConfig, ZodInput<TInputSchema>>;\n private readonly mapOutputValue?: NodeBackedToolOutputMapper<\n TNodeConfig,\n ZodInput<TInputSchema>,\n ZodOutput<TOutputSchema>\n >;\n\n constructor(\n public readonly name: string,\n public readonly node: TNodeConfig,\n options: NodeBackedToolConfigOptions<TNodeConfig, TInputSchema, TOutputSchema>,\n ) {\n this.type = node.type;\n this.description = options.description;\n this.presentation = options.presentation;\n this.inputSchemaValue = options.inputSchema;\n this.outputSchemaValue = options.outputSchema;\n this.mapInputValue = options.mapInput;\n this.mapOutputValue = options.mapOutput;\n }\n\n getCredentialRequirements(): ReadonlyArray<CredentialRequirement> {\n return this.node.getCredentialRequirements?.() ?? [];\n }\n\n getInputSchema(): TInputSchema {\n return this.inputSchemaValue;\n }\n\n getOutputSchema(): TOutputSchema {\n return this.outputSchemaValue;\n }\n\n toNodeItem(\n args: NodeBackedToolInputMapperArgs<TNodeConfig, ZodInput<TInputSchema>>,\n ): Item<RunnableNodeInputJson<TNodeConfig>> {\n const mapped = this.mapInputValue?.(args) ?? (args.input as RunnableNodeInputJson<TNodeConfig>);\n if (this.isItem(mapped)) {\n return mapped;\n }\n return { json: mapped };\n }\n\n toToolOutput(args: NodeBackedToolOutputMapperArgs<TNodeConfig, ZodInput<TInputSchema>>): ZodOutput<TOutputSchema> {\n const raw = this.mapOutputValue?.(args) ?? this.readDefaultToolOutput(args.outputs);\n return this.outputSchemaValue.parse(raw) as ZodOutput<TOutputSchema>;\n }\n\n private readDefaultToolOutput(outputs: NodeOutputs): unknown {\n const firstMainItem = outputs.main?.[0];\n if (!firstMainItem) {\n throw new Error(`Node-backed tool \"${this.name}\" did not produce a main output item.`);\n }\n return firstMainItem.json;\n }\n\n private isItem(value: unknown): value is Item {\n return typeof value === \"object\" && value !== null && \"json\" in value;\n }\n}\n","import type { CredentialRequirement } from \"../contracts/credentialTypes\";\nimport type { McpServerDeclaration } from \"../contracts/mcpTypes\";\nimport type { NodeConfigBase, NodeConnectionName, NodeId } from \"../types\";\nimport { ConnectionNodeIdFactory } from \"../workflow/definition/ConnectionNodeIdFactory\";\nimport { AgentConfigInspector } from \"./AgentConfigInspectorFactory\";\nimport type { AgentNodeConfig, ToolConfig } from \"./AiHost\";\nimport { NodeBackedToolConfig } from \"./NodeBackedToolConfig\";\n\nexport type AgentConnectionNodeRole = \"languageModel\" | \"tool\" | \"nestedAgent\";\n\nexport type AgentConnectionCredentialSource = Readonly<{\n getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;\n}>;\n\nexport type AgentConnectionNodeDescriptor = Readonly<{\n nodeId: NodeId;\n parentNodeId: NodeId;\n connectionName: NodeConnectionName;\n role: AgentConnectionNodeRole;\n name: string;\n typeName: string;\n icon?: string;\n credentialSource: AgentConnectionCredentialSource;\n}>;\n\nexport type McpServerResolver = (id: string) => McpServerDeclaration | undefined;\n\ntype AgentConnectionNodeCollectorApi = Readonly<{\n collect(\n parentNodeId: NodeId,\n agentConfig: AgentNodeConfig<any, any>,\n mcpServerResolver?: McpServerResolver,\n ): ReadonlyArray<AgentConnectionNodeDescriptor>;\n}>;\n\nexport const AgentConnectionNodeCollector: AgentConnectionNodeCollectorApi = new (class {\n collect(\n parentNodeId: NodeId,\n agentConfig: AgentNodeConfig<any, any>,\n mcpServerResolver?: McpServerResolver,\n ): ReadonlyArray<AgentConnectionNodeDescriptor> {\n const collected: AgentConnectionNodeDescriptor[] = [];\n this.collectInto(parentNodeId, agentConfig, collected, mcpServerResolver);\n return collected;\n }\n\n private collectInto(\n parentNodeId: NodeId,\n agentConfig: AgentNodeConfig<any, any>,\n collected: AgentConnectionNodeDescriptor[],\n mcpServerResolver?: McpServerResolver,\n ): void {\n collected.push({\n nodeId: ConnectionNodeIdFactory.languageModelConnectionNodeId(parentNodeId),\n parentNodeId,\n connectionName: \"llm\",\n role: \"languageModel\",\n name: agentConfig.chatModel.presentation?.label ?? agentConfig.chatModel.name,\n typeName: agentConfig.chatModel.name,\n icon: agentConfig.chatModel.presentation?.icon,\n credentialSource: agentConfig.chatModel,\n });\n\n for (const tool of agentConfig.tools ?? []) {\n const toolNodeId = ConnectionNodeIdFactory.toolConnectionNodeId(parentNodeId, tool.name);\n const isNestedAgent = this.isNodeBackedAgentTool(tool);\n collected.push({\n nodeId: toolNodeId,\n parentNodeId,\n connectionName: \"tools\",\n role: isNestedAgent ? \"nestedAgent\" : \"tool\",\n name: tool.presentation?.label ?? tool.name,\n typeName: tool.name,\n icon: tool.presentation?.icon,\n credentialSource: tool,\n });\n this.collectNestedAgentTools(toolNodeId, tool, collected, mcpServerResolver);\n }\n\n if (mcpServerResolver) {\n const mcpServers = (agentConfig as unknown as { mcpServers?: ReadonlyArray<string> }).mcpServers;\n for (const serverId of mcpServers ?? []) {\n const decl = mcpServerResolver(serverId);\n if (!decl) {\n continue;\n }\n const acceptedTypes = decl.acceptedCredentialTypes ?? [];\n collected.push({\n nodeId: ConnectionNodeIdFactory.mcpConnectionNodeId(parentNodeId, serverId),\n parentNodeId,\n connectionName: \"tools\",\n role: \"tool\",\n name: decl.displayName,\n typeName: \"MCP server\",\n icon: \"lucide:plug\",\n credentialSource: {\n getCredentialRequirements: () => [\n {\n slotKey: \"credential\",\n label: decl.displayName,\n acceptedTypes,\n },\n ],\n },\n });\n }\n }\n }\n\n private collectNestedAgentTools(\n toolNodeId: NodeId,\n tool: ToolConfig,\n collected: AgentConnectionNodeDescriptor[],\n mcpServerResolver?: McpServerResolver,\n ): void {\n if (!this.isNodeBackedAgentTool(tool)) {\n return;\n }\n const innerAgent =\n tool instanceof NodeBackedToolConfig ? tool.node : (tool as unknown as { node: AgentNodeConfig<any, any> }).node;\n this.collectInto(toolNodeId, innerAgent, collected, mcpServerResolver);\n }\n\n /**\n * After JSON round-trip (persisted snapshots), tools are plain objects — `instanceof NodeBackedToolConfig` fails.\n * Detect node-backed tools structurally via {@link NodeBackedToolConfig#toolKind}.\n */\n private isNodeBackedAgentTool(tool: ToolConfig): boolean {\n if (tool instanceof NodeBackedToolConfig) {\n return AgentConfigInspector.isAgentNodeConfig(tool.node);\n }\n if (!tool || typeof tool !== \"object\") {\n return false;\n }\n const t = tool as unknown as Record<string, unknown>;\n if (t.toolKind !== \"nodeBacked\") {\n return false;\n }\n return AgentConfigInspector.isAgentNodeConfig(t.node as NodeConfigBase);\n }\n})();\n","import type { NodeId } from \"../../types\";\n\n/**\n * Unique ids for one per-item iteration of a runnable node's execute loop.\n *\n * Activations are per-batch (one scheduled execution of a node, possibly with N items).\n * Iterations refine that to one identifier per item-index inside the batch loop, so per-item\n * connection invocations and telemetry can be grouped without time-window heuristics.\n *\n * Uses Web Crypto's `randomUUID` (Node 19+ and all modern browsers) so this module is safe\n * to include in the browser entry. Importing `node:crypto` here previously leaked into the\n * canvas client bundle through `browser.ts` and OOM'd consumers' Turbopack builds.\n */\nexport class NodeIterationIdFactory {\n static create(): string {\n return `iter_${globalThis.crypto.randomUUID()}`;\n }\n\n /** Deterministic id for tests when a stable sequence is needed. */\n static createForTest(seed: string, sequence: number): string {\n return `iter_${seed}_${sequence}`;\n }\n\n /** Deterministic id derived from a connection node id (for sub-agent / tool-call scopes). */\n static createForConnection(connectionNodeId: NodeId, sequence: number): string {\n return `iter_${connectionNodeId}_${sequence}`;\n }\n}\n","import type { NodeId, WorkflowId } from \"./baseTypes\";\n\nexport type CredentialTypeId = string;\nexport type CredentialInstanceId = string;\n\nexport type CredentialMaterialSourceKind = \"db\" | \"env\" | \"code\";\nexport type CredentialSetupStatus = \"draft\" | \"ready\";\nexport type CredentialHealthStatus = \"unknown\" | \"healthy\" | \"failing\";\n\nexport type CredentialFieldSchema = Readonly<{\n key: string;\n label: string;\n type: \"string\" | \"password\" | \"textarea\" | \"json\" | \"boolean\";\n required?: true;\n order?: number;\n /**\n * Where this field appears in the credential dialog. Use `\"advanced\"` for optional or\n * power-user fields; they render inside a collapsible section (see `CredentialTypeDefinition.advancedSection`).\n * Defaults to `\"default\"` when omitted.\n */\n visibility?: \"default\" | \"advanced\";\n placeholder?: string;\n helpText?: string;\n /** When set, host resolves this field from process.env at runtime; env wins over stored values. */\n envVarName?: string;\n /**\n * When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI\n * pattern or documentation URL). Do not use for secret values.\n */\n copyValue?: string;\n /** Accessible label for the copy control (default: Copy). */\n copyButtonLabel?: string;\n}>;\n\nexport type CredentialRequirement = Readonly<{\n slotKey: string;\n label: string;\n acceptedTypes: ReadonlyArray<CredentialTypeId>;\n optional?: true;\n helpText?: string;\n helpUrl?: string;\n}>;\n\nexport type CredentialBindingKey = Readonly<{\n workflowId: WorkflowId;\n nodeId: NodeId;\n slotKey: string;\n}>;\n\nexport type CredentialBinding = Readonly<{\n key: CredentialBindingKey;\n instanceId: CredentialInstanceId;\n updatedAt: string;\n}>;\n\nexport type CredentialHealth = Readonly<{\n status: CredentialHealthStatus;\n message?: string;\n testedAt?: string;\n expiresAt?: string;\n details?: Readonly<Record<string, unknown>>;\n}>;\n\nexport type OAuth2ProviderFromPublicConfig = Readonly<{\n authorizeUrlFieldKey: string;\n tokenUrlFieldKey: string;\n userInfoUrlFieldKey?: string;\n}>;\n\nexport type CredentialOAuth2ScopesFromPublicConfig = Readonly<{\n presetFieldKey: string;\n presetScopes: Readonly<Record<string, ReadonlyArray<string>>>;\n customPresetKey?: string;\n customScopesFieldKey?: string;\n}>;\n\nexport type CredentialOAuth2AuthDefinition = Readonly<\n | {\n kind: \"oauth2\";\n providerId: string;\n scopes: ReadonlyArray<string>;\n scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;\n clientIdFieldKey?: string;\n clientSecretFieldKey?: string;\n }\n | {\n kind: \"oauth2\";\n providerFromPublicConfig: OAuth2ProviderFromPublicConfig;\n scopes: ReadonlyArray<string>;\n scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;\n clientIdFieldKey?: string;\n clientSecretFieldKey?: string;\n }\n | {\n kind: \"oauth2\";\n /**\n * Free-form provider identifier for telemetry, DB rows, and Better Auth provider naming.\n * Not used for any registry lookup — URLs come from {@link authorizeUrl} / {@link tokenUrl}.\n */\n providerId: string;\n /**\n * Authorization endpoint. May contain `{publicFieldKey}` placeholders that the runtime\n * substitutes from the credential's resolved public config (URL-encoded).\n * Example: `https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize`\n */\n authorizeUrl: string;\n /** Token endpoint. Same templating rules as {@link authorizeUrl}. */\n tokenUrl: string;\n /** Optional userinfo endpoint. Same templating rules as {@link authorizeUrl}. */\n userInfoUrl?: string;\n scopes: ReadonlyArray<string>;\n scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;\n clientIdFieldKey?: string;\n clientSecretFieldKey?: string;\n }\n>;\n\nexport type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;\n\nexport type CredentialAdvancedSectionPresentation = Readonly<{\n /** Collapsible section title (default: \"Advanced\"). */\n title?: string;\n /** Optional short helper text shown inside the section (above the fields). */\n description?: string;\n /** When true, the advanced section starts expanded. Default: false (collapsed). */\n defaultOpen?: boolean;\n}>;\n\nexport type CredentialTypeDefinition = Readonly<{\n typeId: CredentialTypeId;\n displayName: string;\n description?: string;\n publicFields?: ReadonlyArray<CredentialFieldSchema>;\n secretFields?: ReadonlyArray<CredentialFieldSchema>;\n /**\n * Optional labels for the collapsible block that contains every field with `visibility: \"advanced\"`.\n * If omitted, the UI still shows that block with defaults (title \"Advanced\", collapsed).\n */\n advancedSection?: CredentialAdvancedSectionPresentation;\n supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;\n auth?: CredentialAuthDefinition;\n}>;\n\n/**\n * JSON-shaped credential field bag (public config, resolved secret material, etc.).\n */\nexport type CredentialJsonRecord = Readonly<Record<string, unknown>>;\n\n/**\n * Persisted credential instance with typed `publicConfig`.\n * Hosts may specialize `secretRef` with a stricter union while remaining\n * assignable here for session/test callbacks.\n */\nexport type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{\n instanceId: CredentialInstanceId;\n typeId: CredentialTypeId;\n displayName: string;\n sourceKind: CredentialMaterialSourceKind;\n publicConfig: TPublicConfig;\n secretRef: CredentialJsonRecord;\n tags: ReadonlyArray<string>;\n setupStatus: CredentialSetupStatus;\n createdAt: string;\n updatedAt: string;\n /**\n * Pointer to where the credential material bytes live. For OSS / standalone\n * rows this is `{source: \"local\", ref: instanceId}` and the bytes co-locate\n * with the row in the workspace DB. For managed-mode rows this is\n * `{source: \"control-plane\", ref: <cp_id>}` and the bytes live at CP.\n *\n * The seam is read through `CredentialMaterialProvider`. See\n * `docs/design/credentials-oauth-unification.md` (\"Material provider seam\").\n */\n material: Readonly<{ source: \"local\" | \"control-plane\"; ref: string }>;\n}>;\n\n/**\n * Arguments passed to `CredentialType.createSession` and `CredentialType.test`.\n * Declare `TPublicConfig` / `TMaterial` on `CredentialType` so implementations are checked\n * against your credential shapes (similar to `NodeExecutionContext.config` for nodes).\n */\nexport type CredentialSessionFactoryArgs<\n TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord,\n TMaterial extends CredentialJsonRecord = CredentialJsonRecord,\n> = Readonly<{\n instance: CredentialInstanceRecord<TPublicConfig>;\n material: TMaterial;\n publicConfig: TPublicConfig;\n}>;\n\nexport type CredentialSessionFactory<\n TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord,\n TMaterial extends CredentialJsonRecord = CredentialJsonRecord,\n TSession = unknown,\n> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<TSession>;\n\nexport type CredentialHealthTester<\n TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord,\n TMaterial extends CredentialJsonRecord = CredentialJsonRecord,\n> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<CredentialHealth>;\n\n/**\n * Full credential type implementation: `definition` (UI/schema), `createSession`, and `test`.\n * Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.\n */\nexport type CredentialType<\n TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord,\n TMaterial extends CredentialJsonRecord = CredentialJsonRecord,\n TSession = unknown,\n> = Readonly<{\n definition: CredentialTypeDefinition;\n createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;\n test: CredentialHealthTester<TPublicConfig, TMaterial>;\n}>;\n\n/**\n * Credential type with unspecified generics — used for `CodemationConfig.credentialTypes`, the host registry,\n * and anywhere a concrete `CredentialType<YourPublic, YourMaterial, YourSession>` is placed in a heterogeneous list.\n * Using `any` here avoids unsafe `as` casts while keeping typed `satisfies CredentialType<…>` definitions.\n */\nexport type AnyCredentialType = CredentialType<any, any, unknown>;\n\nexport interface CredentialSessionService {\n getSession<TSession = unknown>(\n args: Readonly<{\n workflowId: WorkflowId;\n nodeId: NodeId;\n slotKey: string;\n }>,\n ): Promise<TSession>;\n}\n\nexport interface CredentialTypeRegistry {\n listTypes(): ReadonlyArray<CredentialTypeDefinition>;\n getType(typeId: CredentialTypeId): CredentialTypeDefinition | undefined;\n}\n\nexport class CredentialUnboundError extends Error {\n constructor(\n public readonly bindingKey: CredentialBindingKey,\n public readonly acceptedTypes: ReadonlyArray<CredentialTypeId> = [],\n ) {\n super(CredentialUnboundError.createMessage(bindingKey, acceptedTypes));\n this.name = \"CredentialUnboundError\";\n }\n\n private static createMessage(\n bindingKey: CredentialBindingKey,\n acceptedTypes: ReadonlyArray<CredentialTypeId>,\n ): string {\n const acceptedTypesSuffix =\n acceptedTypes.length > 0 ? ` Accepted credential types: ${acceptedTypes.join(\", \")}.` : \"\";\n return `Credential slot \"${bindingKey.slotKey}\" is not bound for workflow ${bindingKey.workflowId} node ${bindingKey.nodeId}.${acceptedTypesSuffix}`;\n }\n}\n","import type { ReadableStream as BinaryReadableStream } from \"node:stream/web\";\nimport type { TypeToken } from \"../di\";\nimport type { RunEventBus } from \"../events/runEvents\";\nimport type { CredentialSessionService } from \"./credentialTypes\";\nimport type { CollectionsContext } from \"./collectionTypes\";\nimport type { ExecutionTelemetry, ExecutionTelemetryFactory, NodeExecutionTelemetry } from \"./telemetryTypes\";\nimport type {\n ConnectionInvocationAppendArgs,\n ConnectionInvocationId,\n NodeInputsByPort,\n PersistedWorkflowSnapshot,\n PersistedWorkflowTokenRegistryLike,\n RunExecutionOptions,\n RunResult,\n RunTestContext,\n WorkflowExecutionRepository,\n} from \"./runTypes\";\nimport type { WorkflowActivationPolicy } from \"./workflowActivationPolicy\";\nimport type { TriggerInstanceId, WebhookTriggerMatcher } from \"./webhookTypes\";\nimport type { ZodType } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// HITL primitives\n// ---------------------------------------------------------------------------\n\n/** Opaque unique identifier for a single HumanTask instance. */\nexport type HumanTaskId = string;\n\n/**\n * Duration string — ISO 8601 duration (\"PT24H\") or shorthand (\"24h\").\n * Parsed by the timeout job; stored as-is in the suspension record.\n */\nexport type Duration = string;\n\n/**\n * Minimal handle handed to the `deliver` callback so it can route to the correct\n * inbox channel.\n */\nexport interface HumanTaskHandle {\n readonly taskId: HumanTaskId;\n readonly runId: string;\n readonly nodeId: string;\n readonly expiresAt: Date;\n /** TODO: real signed URL; placeholder empty string for now. */\n readonly resumeUrl: string;\n /**\n * Arbitrary JSON metadata copied from `SuspensionRequest.request.metadata` at suspension time.\n * Used by the agent runtime to round-trip the `agentCheckpoint` back to the\n * resumed node via `ctx.resumeContext.task.metadata`.\n */\n readonly metadata?: Readonly<Record<string, import(\"./workflowTypes\").JsonValue>>;\n}\n\n/** Human-readable description surface shown to the reviewer. */\nexport interface HumanTaskSubject {\n readonly title: string;\n readonly summary: string;\n readonly attributes?: import(\"./workflowTypes\").JsonValue;\n}\n\n/** Identity of the person who made a decision on the task. */\nexport interface HumanTaskActor {\n readonly actorId: string;\n readonly displayName?: string;\n}\n\n/**\n * Resume context injected into `NodeExecutionContext` when the engine re-activates\n * a previously suspended node. `defineHumanApprovalNode` wraps this with parsed\n * `TDecision`; at the engine layer `decision.value` is `unknown`.\n */\nexport interface ResumeContext {\n readonly decision:\n | Readonly<{ kind: \"decided\"; value: unknown; actor: HumanTaskActor; decidedAt: Date }>\n | Readonly<{ kind: \"timed_out\"; at: Date }>\n | Readonly<{ kind: \"auto_accepted\"; at: Date }>;\n readonly delivery: import(\"./workflowTypes\").JsonValue;\n readonly task: HumanTaskHandle;\n}\n\n/**\n * Thrown by a node's `execute()` to request durable suspension of the current item.\n * The engine catches this, persists the suspension entry, calls `deliver`, and\n * continues to the next item (per-item semantics).\n *\n * @example\n * ```ts\n * throw new SuspensionRequest({\n * decisionSchema: z.object({ approved: z.boolean() }),\n * timeout: \"PT24H\",\n * onTimeout: \"halt\",\n * subject: { title: \"Approve invoice\", summary: \"Invoice #1234 needs approval\" },\n * deliver: async (handle) => {\n * await notifySlack(handle);\n * return { channel: \"slack\", ts: \"...\" };\n * },\n * });\n * ```\n */\nexport class SuspensionRequest<\n TDecision = unknown,\n TDelivery extends import(\"./workflowTypes\").JsonValue = import(\"./workflowTypes\").JsonValue,\n> extends Error {\n constructor(\n readonly request: Readonly<{\n decisionSchema: ZodType<TDecision>;\n timeout: Duration;\n onTimeout: \"halt\" | \"auto-accept\";\n subject: HumanTaskSubject;\n metadata?: Readonly<Record<string, import(\"./workflowTypes\").JsonValue>>;\n deliver: (handle: HumanTaskHandle) => Promise<TDelivery>;\n }>,\n ) {\n // Extending Error so wrappers like InProcessRetryRunner preserve identity\n // (`instanceof SuspensionRequest`) instead of coercing via String(thrown).\n super(`SuspensionRequest(${request.subject?.title ?? \"untitled\"})`);\n this.name = \"SuspensionRequest\";\n }\n}\n\nimport type {\n ActivationIdFactory,\n BinaryAttachment,\n Item,\n Items,\n JsonValue,\n NodeActivationId,\n NodeConfigBase,\n NodeId,\n NodeIterationId,\n NodeOutputs,\n RunnableNodeConfig,\n OutputPortKey,\n ParentExecutionRef,\n PersistedRunPolicySnapshot,\n RunDataFactory,\n RunDataSnapshot,\n RunId,\n RunIdFactory,\n TriggerNodeConfig,\n TriggerNodeSetupState,\n WorkflowDefinition,\n WorkflowId,\n WorkflowPolicyRuntimeDefaults,\n} from \"./workflowTypes\";\n\nexport interface WorkflowRunnerService {\n runById(args: {\n workflowId: WorkflowId;\n startAt?: NodeId;\n items: Items;\n parent?: ParentExecutionRef;\n }): Promise<RunResult>;\n}\n\nexport interface WorkflowRunnerResolver {\n resolve(): WorkflowRunnerService | undefined;\n}\n\nexport interface WorkflowRepository {\n list(): ReadonlyArray<WorkflowDefinition>;\n get(workflowId: WorkflowId): WorkflowDefinition | undefined;\n}\n\nexport interface LiveWorkflowRepository extends WorkflowRepository {\n setWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;\n}\n\nexport interface NodeResolver {\n resolve<T>(token: TypeToken<T>): T;\n}\n\nexport interface NodeExecutionStatePublisher {\n markQueued(args: { nodeId: NodeId; activationId?: NodeActivationId; inputsByPort?: NodeInputsByPort }): Promise<void>;\n markRunning(args: {\n nodeId: NodeId;\n activationId?: NodeActivationId;\n inputsByPort?: NodeInputsByPort;\n }): Promise<void>;\n markCompleted(args: {\n nodeId: NodeId;\n activationId?: NodeActivationId;\n inputsByPort?: NodeInputsByPort;\n outputs?: NodeOutputs;\n }): Promise<void>;\n markFailed(args: {\n nodeId: NodeId;\n activationId?: NodeActivationId;\n inputsByPort?: NodeInputsByPort;\n error: Error;\n }): Promise<void>;\n appendConnectionInvocation(args: ConnectionInvocationAppendArgs): Promise<void>;\n /**\n * Annotates the current snapshot for `nodeId` with the id of the child run spawned by a\n * SubWorkflow invocation. Called from `SubWorkflowNode.execute` after `runById` resolves.\n * The engine's subsequent `markCompleted` call preserves the value via `previous.childRunId`.\n */\n setChildRunId?(args: { nodeId: NodeId; childRunId: RunId }): Promise<void>;\n}\n\nexport type BinaryBody = BinaryReadableStream<Uint8Array> | AsyncIterable<Uint8Array> | Uint8Array | ArrayBuffer;\n\nexport interface BinaryStorageWriteRequest {\n storageKey: string;\n body: BinaryBody;\n}\n\nexport interface BinaryStorageWriteResult {\n storageKey: string;\n size: number;\n sha256?: string;\n}\n\nexport interface BinaryStorageReadResult {\n body: BinaryReadableStream<Uint8Array>;\n size?: number;\n}\n\nexport interface BinaryStorageStatResult {\n exists: boolean;\n size?: number;\n}\n\nexport interface BinaryStorage {\n readonly driverName: string;\n write(args: BinaryStorageWriteRequest): Promise<BinaryStorageWriteResult>;\n openReadStream(storageKey: string): Promise<BinaryStorageReadResult | undefined>;\n stat(storageKey: string): Promise<BinaryStorageStatResult>;\n delete(storageKey: string): Promise<void>;\n /** Deletes multiple objects in bulk. Keys are batched internally. */\n deleteMany(storageKeys: ReadonlyArray<string>): Promise<void>;\n /** Lists all keys sharing a common prefix. Returns keys in arbitrary order. */\n listByPrefix(prefix: string): Promise<ReadonlyArray<string>>;\n}\n\nexport interface BinaryAttachmentCreateRequest {\n name: string;\n body: BinaryBody;\n mimeType: string;\n filename?: string;\n previewKind?: BinaryAttachment[\"previewKind\"];\n}\n\nexport interface NodeBinaryAttachmentService extends ExecutionBinaryService {\n attach(args: BinaryAttachmentCreateRequest): Promise<BinaryAttachment>;\n withAttachment<TJson>(item: Item<TJson>, name: string, attachment: BinaryAttachment): Item<TJson>;\n}\n\n/** Default maximum bytes read into memory by the bounded helpers (50 MiB). */\nexport const BINARY_DEFAULT_MAX_BYTES = 50 * 1024 * 1024;\n\nexport interface ExecutionBinaryService {\n forNode(args: { nodeId: NodeId; activationId: NodeActivationId }): NodeBinaryAttachmentService;\n openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;\n /**\n * Reads all bytes from the attachment into a contiguous `Uint8Array`.\n * Checks `attachment.size` against `maxBytes` *before* any allocation; throws a bounded-read\n * error when exceeded (no OOM). Throws if the stream is unavailable or the byte count mismatches.\n */\n getBytes(attachment: BinaryAttachment, maxBytes?: number): Promise<Uint8Array>;\n /**\n * Reads the attachment and decodes the bytes as UTF-8 text.\n * Subject to the same bounded-read safety as `getBytes`.\n */\n getText(attachment: BinaryAttachment, maxBytes?: number): Promise<string>;\n /**\n * Reads the attachment, decodes as UTF-8 text, and parses as JSON.\n * Throws a clear error on invalid JSON. Subject to the same bounded-read safety.\n */\n getJson<T = unknown>(attachment: BinaryAttachment, maxBytes?: number): Promise<T>;\n}\n\nexport interface ExecutionContext {\n runId: RunId;\n workflowId: WorkflowId;\n parent?: ParentExecutionRef;\n /** This run's subworkflow depth (0 = root). */\n subworkflowDepth: number;\n /** Effective activation budget cap for this run (after policy merge). */\n engineMaxNodeActivations: number;\n /** Effective subworkflow nesting cap for this run (after policy merge). */\n engineMaxSubworkflowDepth: number;\n now: () => Date;\n data: RunDataSnapshot;\n nodeState?: NodeExecutionStatePublisher;\n telemetry: ExecutionTelemetry;\n binary: ExecutionBinaryService;\n getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;\n /** Per-item iteration id, set by {@link NodeExecutor} on the ctx passed into runnable `execute`. */\n iterationId?: NodeIterationId;\n /** Item index (0-based) within the current activation's batch; set alongside {@link iterationId}. */\n itemIndex?: number;\n /** When set, this ctx is executing inside a sub-agent triggered by the named parent invocation. */\n parentInvocationId?: ConnectionInvocationId;\n /**\n * Present iff the run was started by a TestSuiteOrchestrator. The {@link IsTestRunNode}\n * branches on this; assertion-emitting nodes use it to decide whether to record results.\n */\n testContext?: RunTestContext;\n /**\n * Collections registered in the codemation config, keyed by collection name.\n */\n readonly collections?: CollectionsContext;\n /**\n * Resolve a DI token from the host container.\n * Allows nodes to reach host-side services (e.g. `InboxChannelResolverToken`)\n * without importing host code. Wired by `DefaultExecutionContextFactory`; throws\n * a clear error when no resolver is configured (e.g. in unit tests that don't\n * set up the full container).\n */\n resolve<T>(token: TypeToken<T>): T;\n}\n\nexport interface ExecutionContextFactory {\n create(args: {\n runId: RunId;\n workflowId: WorkflowId;\n parent?: ParentExecutionRef;\n policySnapshot?: PersistedRunPolicySnapshot;\n subworkflowDepth: number;\n engineMaxNodeActivations: number;\n engineMaxSubworkflowDepth: number;\n data: RunDataSnapshot;\n nodeState?: NodeExecutionStatePublisher;\n telemetry?: ExecutionTelemetry;\n getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;\n testContext?: RunTestContext;\n }): ExecutionContext;\n}\n\nexport interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase> extends ExecutionContext {\n nodeId: NodeId;\n activationId: NodeActivationId;\n config: TConfig;\n telemetry: NodeExecutionTelemetry;\n binary: NodeBinaryAttachmentService;\n /**\n * Present when this node activation is a HITL resume.\n * The node checks `ctx.resumeContext !== undefined` and takes the resume branch.\n */\n resumeContext?: ResumeContext;\n}\n\nexport interface PollingTriggerHandle {\n /**\n * Start the polling loop. The runtime registers its own cleanup handle so callers do not need to\n * call {@link TriggerSetupContext.registerCleanup} for the loop.\n * @returns The state returned by the first cycle (or `undefined` when the overlap guard fired).\n */\n start<TState, TItem>(args: {\n intervalMs: number;\n seedState?: TState;\n runCycle: (cycleCtx: {\n previousState: TState | undefined;\n signal: AbortSignal;\n }) => Promise<{ items: Items<TItem>; nextState: TState }>;\n }): Promise<TState | undefined>;\n /** Convenience dedup-window helper. */\n readonly dedup: import(\"../triggers/polling/PollingTriggerDedupWindow\").PollingTriggerDedupWindow;\n}\n\nexport interface TriggerSetupContext<\n TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>,\n TSetupState extends JsonValue | undefined = TriggerNodeSetupState<TConfig>,\n> extends ExecutionContext {\n trigger: TriggerInstanceId;\n config: TConfig;\n previousState: TSetupState;\n registerCleanup(cleanup: TriggerCleanupHandle): void;\n emit(items: Items): Promise<void>;\n /** Generic polling-trigger surface. Pre-binds trigger id, emit, and registerCleanup. */\n readonly polling: PollingTriggerHandle;\n}\n\nexport interface TriggerTestItemsContext<\n TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>,\n TSetupState extends JsonValue | undefined = TriggerNodeSetupState<TConfig>,\n> extends ExecutionContext {\n trigger: TriggerInstanceId;\n nodeId: NodeId;\n config: TConfig;\n previousState: TSetupState;\n}\n\n/**\n * Trigger setup state is intentionally engine-owned so future ownership and\n * leader-election metadata can be coordinated centrally rather than pushed into\n * package-level setup code.\n */\n\nexport interface PersistedTriggerSetupState<TState extends JsonValue | undefined = JsonValue | undefined> {\n trigger: TriggerInstanceId;\n updatedAt: string;\n state: TState;\n}\n\nexport interface TriggerSetupStateRepository {\n load(trigger: TriggerInstanceId): Promise<PersistedTriggerSetupState | undefined>;\n save(state: PersistedTriggerSetupState): Promise<void>;\n delete(trigger: TriggerInstanceId): Promise<void>;\n}\n\nexport interface TriggerCleanupHandle {\n stop(): Promise<void> | void;\n}\n\nexport interface EngineHost {\n credentialSessions: CredentialSessionService;\n workflows?: WorkflowRunnerService;\n}\n\n/**\n * Per-item runnable node: return JSON, an array to fan-out on `main`, an explicit `Item`, or {@link emitPorts}\n * for multi-port emission. Engine applies `inputSchema.parse(item.json)` and passes the result as `args.input`\n * (wire `item.json` is unchanged). Transform helpers may opt into binary preservation, while routers and\n * pass-through nodes should return explicit items when they need to preserve full item state.\n */\nexport interface RunnableNodeExecuteArgs<\n TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>,\n TInputJson = unknown,\n> {\n readonly input: TInputJson;\n readonly item: Item;\n readonly itemIndex: number;\n readonly items: Items;\n readonly ctx: NodeExecutionContext<TConfig>;\n}\n\nexport interface RunnableNode<\n TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>,\n TInputJson = unknown,\n _TOutputJson = unknown,\n> {\n readonly kind: \"node\";\n /**\n * Declared output ports (e.g. `[\"main\"]`).\n *\n * Prefer describing dynamic router ports (Switch) and fixed multi-ports (If true/false)\n * via {@link NodeConfigBase.declaredOutputPorts}. Engine defaults to `[\"main\"]` when omitted.\n */\n readonly outputPorts?: ReadonlyArray<OutputPortKey>;\n /** When omitted, engine uses {@link RunnableNodeConfig.inputSchema} or `z.unknown()`. */\n readonly inputSchema?: ZodType<TInputJson>;\n execute(args: RunnableNodeExecuteArgs<TConfig, TInputJson>): Promise<unknown> | unknown;\n}\n\n/** @deprecated Use {@link RunnableNode} */\nexport type ItemNode<\n TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>,\n TInputJson = unknown,\n TOutputJson = unknown,\n> = RunnableNode<TConfig, TInputJson, TOutputJson>;\n\nexport interface MultiInputNode<TConfig extends NodeConfigBase = NodeConfigBase> {\n kind: \"node\";\n /**\n * Declared output ports (typically `[\"main\"]`).\n *\n * Prefer describing ports for authoring/canvas via {@link NodeConfigBase.declaredOutputPorts}.\n * Engine defaults to `[\"main\"]` when omitted.\n */\n outputPorts?: ReadonlyArray<OutputPortKey>;\n executeMulti(inputsByPort: NodeInputsByPort, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;\n}\n\nexport type TriggerSetupStateFor<TConfig extends TriggerNodeConfig<any, any>> = TriggerNodeSetupState<TConfig>;\n\nexport interface TriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> {\n kind: \"trigger\";\n outputPorts: readonly [\"main\"];\n setup(ctx: TriggerSetupContext<TConfig>): Promise<TriggerSetupStateFor<TConfig>>;\n execute(items: Items, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;\n}\n\nexport interface TestableTriggerNode<\n TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>,\n> extends TriggerNode<TConfig> {\n getTestItems(ctx: TriggerTestItemsContext<TConfig>): Promise<Items>;\n}\n\nexport type ExecutableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> =\n TriggerNode<TConfig>;\n\nexport interface NodeExecutionRequest {\n runId: RunId;\n activationId: NodeActivationId;\n workflowId: WorkflowId;\n nodeId: NodeId;\n input: Items;\n parent?: ParentExecutionRef;\n queue?: string;\n executionOptions?: RunExecutionOptions;\n}\n\nexport interface NodeExecutionScheduler {\n enqueue(request: NodeExecutionRequest): Promise<{ receiptId: string }>;\n cancel?(receiptId: string): Promise<void>;\n}\n\nexport interface NodeExecutionRequestHandler {\n handleNodeExecutionRequest(request: NodeExecutionRequest): Promise<void>;\n}\n\nexport type NodeActivationRequestBase = Readonly<{\n runId: RunId;\n activationId: NodeActivationId;\n workflowId: WorkflowId;\n nodeId: NodeId;\n parent?: ParentExecutionRef;\n executionOptions?: RunExecutionOptions;\n batchId?: string;\n ctx: NodeExecutionContext;\n}>;\n\nexport type NodeActivationRequest =\n | (NodeActivationRequestBase &\n Readonly<{\n kind: \"single\";\n input: Items;\n }>)\n | (NodeActivationRequestBase &\n Readonly<{\n kind: \"multi\";\n inputsByPort: NodeInputsByPort;\n }>);\n\nexport interface NodeActivationReceipt {\n receiptId: string;\n mode?: \"local\" | \"worker\";\n queue?: string;\n}\n\nexport interface PreparedNodeActivationDispatch {\n readonly receipt: NodeActivationReceipt;\n dispatch(): Promise<void>;\n}\n\nexport interface NodeActivationContinuation {\n markNodeRunning(args: {\n runId: RunId;\n activationId: NodeActivationId;\n nodeId: NodeId;\n inputsByPort: NodeInputsByPort;\n }): Promise<void>;\n resumeFromNodeResult(args: {\n runId: RunId;\n activationId: NodeActivationId;\n nodeId: NodeId;\n outputs: NodeOutputs;\n }): Promise<RunResult>;\n resumeFromNodeError(args: {\n runId: RunId;\n activationId: NodeActivationId;\n nodeId: NodeId;\n error: Error;\n }): Promise<RunResult>;\n}\n\nexport interface NodeActivationScheduler {\n setContinuation?(continuation: NodeActivationContinuation): void;\n prepareDispatch(request: NodeActivationRequest): Promise<PreparedNodeActivationDispatch>;\n cancel?(receiptId: string): Promise<void>;\n}\n\nexport interface WorkflowNodeInstanceFactory {\n createNodes(workflow: WorkflowDefinition): ReadonlyMap<NodeId, unknown>;\n createByType(type: TypeToken<unknown>): unknown;\n}\n\nexport interface NodeExecutor {\n execute(request: NodeActivationRequest): Promise<NodeOutputs>;\n}\n\nexport interface WorkflowSnapshotFactory {\n create(workflow: WorkflowDefinition): PersistedWorkflowSnapshot;\n}\n\nexport interface WorkflowSnapshotResolver {\n resolve(args: {\n workflowId: WorkflowId;\n workflowSnapshot?: PersistedWorkflowSnapshot;\n }): WorkflowDefinition | undefined;\n}\n\n/** Optional host wiring for trigger lifecycle logs (boot skip + activation sync). */\nexport interface TriggerRuntimeDiagnostics {\n info(message: string): void;\n warn(message: string): void;\n}\n\nexport interface EngineDeps {\n credentialSessions: CredentialSessionService;\n liveWorkflowRepository: LiveWorkflowRepository;\n workflowRepository: WorkflowRepository;\n /** When {@link AllWorkflowsActiveWorkflowActivationPolicy}, all workflows behave as active (tests). */\n workflowActivationPolicy: WorkflowActivationPolicy;\n nodeResolver: NodeResolver;\n triggerSetupStateRepository: TriggerSetupStateRepository;\n webhookTriggerMatcher: WebhookTriggerMatcher;\n runIdFactory: RunIdFactory;\n activationIdFactory: ActivationIdFactory;\n workflowExecutionRepository: WorkflowExecutionRepository;\n activationScheduler: NodeActivationScheduler;\n runDataFactory: RunDataFactory;\n executionContextFactory: ExecutionContextFactory;\n executionTelemetryFactory?: ExecutionTelemetryFactory;\n nodeExecutor: NodeExecutor;\n eventBus?: RunEventBus;\n tokenRegistry: PersistedWorkflowTokenRegistryLike;\n workflowNodeInstanceFactory: WorkflowNodeInstanceFactory;\n /** Defaults for prune/storage snapshot when workflow omits explicit policy fields. */\n workflowPolicyRuntimeDefaults?: WorkflowPolicyRuntimeDefaults;\n /** When set, logs inactive-workflow skips at boot and trigger start/stop on activation changes. */\n triggerRuntimeDiagnostics?: TriggerRuntimeDiagnostics;\n /** When set, the polling-trigger runtime uses this logger for cycle info/debug/error. */\n pollingTriggerLogger?: import(\"../triggers/polling/PollingTriggerLogger\").PollingTriggerLogger;\n}\n","import type { PersistedRunState } from \"./runTypes\";\n\ntype RunFinishedAtSource = Pick<PersistedRunState, \"status\" | \"nodeSnapshotsByNodeId\" | \"finishedAt\">;\n\n/** Derives workflow end time from persisted run root or node snapshots for run listings. */\nexport class RunFinishedAtFactory {\n static resolveIso(state: RunFinishedAtSource): string | undefined {\n if (state.finishedAt && state.status !== \"running\" && state.status !== \"pending\") {\n return state.finishedAt;\n }\n if (state.status === \"running\" || state.status === \"pending\") {\n return undefined;\n }\n let max: string | undefined;\n for (const snap of Object.values(state.nodeSnapshotsByNodeId)) {\n if (snap?.finishedAt && (!max || snap.finishedAt > max)) {\n max = snap.finishedAt;\n }\n }\n return max;\n }\n}\n","import type { ZodType } from \"zod\";\n\nimport type { TypeToken } from \"../di\";\nimport type { CredentialRequirement } from \"./credentialTypes\";\nimport type { RetryPolicySpec } from \"./retryPolicySpec.types\";\nimport type { InputPortKey, NodeConnectionName, NodeId, OutputPortKey, WorkflowId } from \"./baseTypes\";\n\nexport type {\n InputPortKey,\n NodeConnectionName,\n NodeId,\n OutputPortKey,\n PersistedTokenId,\n WorkflowId,\n} from \"./baseTypes\";\n\nexport type NodeIdRef<TJson = unknown> = NodeId & Readonly<{ __codemationNodeJson?: TJson }>;\n\nexport type NodeKind = \"trigger\" | \"node\";\nexport type JsonPrimitive = string | number | boolean | null;\nexport interface JsonObject {\n readonly [key: string]: JsonValue;\n}\nexport type JsonValue = JsonPrimitive | JsonObject | JsonArray;\nexport type JsonArray = ReadonlyArray<JsonValue>;\n/** JSON value that is not a top-level array (nested arrays inside objects are allowed). */\nexport type JsonNonArray = JsonPrimitive | JsonObject;\n\nexport interface Edge {\n from: { nodeId: NodeId; output: OutputPortKey };\n to: { nodeId: NodeId; input: InputPortKey };\n}\n\n/**\n * Named connection from a parent node to child nodes that exist in {@link WorkflowDefinition.nodes}\n * but are not traversed by the main execution graph. Parents are commonly executable nodes, but may\n * also be connection-owned nodes for recursive agent attachments.\n */\nexport interface WorkflowNodeConnection {\n readonly parentNodeId: NodeId;\n readonly connectionName: NodeConnectionName;\n readonly childNodeIds: ReadonlyArray<NodeId>;\n}\n\nexport interface WorkflowDefinition {\n id: WorkflowId;\n name: string;\n nodes: NodeDefinition[];\n edges: Edge[];\n /**\n * Optional metadata: which nodes are connection-owned children (e.g. AI agent `llm` / `tools` slots).\n * When omitted, all nodes in {@link nodes} are treated as executable for topology.\n */\n readonly connections?: ReadonlyArray<WorkflowNodeConnection>;\n /** Directory + file-stem path under a workflow discovery root (for UI grouping only). */\n discoveryPathSegments?: readonly string[];\n /** Retention for run JSON and binaries (seconds). Host/env may supply defaults when omitted. */\n readonly prunePolicy?: WorkflowPrunePolicySpec;\n /** Whether to keep run data after completion. Host/env may supply defaults when omitted. */\n readonly storagePolicy?: WorkflowStoragePolicySpec;\n /** Invoked after a node fails permanently (retries exhausted) and node error handler did not recover. */\n readonly workflowErrorHandler?: WorkflowErrorHandlerSpec;\n}\n\nexport interface WorkflowGraph {\n next(nodeId: NodeId, output: OutputPortKey): ReadonlyArray<Readonly<{ nodeId: NodeId; input: InputPortKey }>>;\n}\n\nexport interface WorkflowGraphFactory {\n create(def: WorkflowDefinition): WorkflowGraph;\n}\n\nexport interface NodeConfigBase {\n readonly kind: NodeKind;\n readonly type: TypeToken<unknown>;\n readonly name?: string;\n readonly id?: NodeId;\n readonly icon?: string;\n readonly execution?: Readonly<{ hint?: \"local\" | \"worker\"; queue?: string }>;\n /** In-process execute retries (runnable nodes). Triggers typically omit this. */\n readonly retryPolicy?: RetryPolicySpec;\n /** Recover from execute failures; return outputs to continue, or rethrow to fail the node. */\n readonly nodeErrorHandler?: NodeErrorHandlerSpec;\n /**\n * When true, edges carrying zero items on an output port still schedule single-input downstream nodes.\n * Decided from the **source** node that produced the (empty) output. Default (false/undefined): empty\n * main batches skip downstream execution and propagate the empty path.\n */\n readonly continueWhenEmptyOutput?: boolean;\n /**\n * Declared I/O port names for canvas authoring (unioned with ports inferred from edges).\n * Use for dynamic routers (Switch) and future error ports.\n */\n readonly declaredOutputPorts?: ReadonlyArray<OutputPortKey>;\n readonly declaredInputPorts?: ReadonlyArray<InputPortKey>;\n getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;\n /**\n * Marker: this node emits {@link import(\"./assertionTypes\").AssertionResult}-shaped items on its\n * `main` port. The TestSuiteOrchestrator (and host-side TestAssertionPersister) listen for\n * `nodeCompleted` events from nodes with this flag set, and persist their output items as\n * TestAssertion records (only when the run carries a `testContext`). Set on assertion node\n * configs (e.g. `AssertionNodeConfig`, `StringEqualsAssertionNodeConfig`).\n */\n readonly emitsAssertions?: true;\n /**\n * Static configuration summary surfaced in the workflow inspector — the design-time\n * \"what does this node do\" panel that renders before any run telemetry exists.\n *\n * Return 2–6 short label/value pairs derived from this config (method + url for an HTTP\n * call, model + tool list for an agent, schedule + timezone for a cron trigger, etc.).\n * Values are truncated by the UI; aim for one line each. Return `undefined` to opt out\n * — the inspector hides the section when no rows are produced.\n *\n * Implement on the config class instance so the function can read sibling config fields.\n * `defineNode({ inspectorSummary })` plumbs through to this.\n */\n inspectorSummary?(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;\n}\n\n/**\n * One row of a node's static configuration summary. See {@link NodeConfigBase.inspectorSummary}.\n */\nexport interface NodeInspectorSummaryRow {\n readonly label: string;\n readonly value: string;\n}\n\nexport declare const runnableNodeInputType: unique symbol;\nexport declare const runnableNodeOutputType: unique symbol;\nexport declare const triggerNodeOutputType: unique symbol;\n\n/**\n * Runnable node: **`TInputJson`** is what **`inputSchema`** validates on **`item.json`** (the wire payload).\n * **`TOutputJson`** is emitted `item.json` on outputs.\n */\nexport interface RunnableNodeConfig<TInputJson = unknown, TOutputJson = unknown> extends NodeConfigBase {\n readonly kind: \"node\";\n readonly [runnableNodeInputType]?: TInputJson;\n readonly [runnableNodeOutputType]?: TOutputJson;\n /**\n * Optional Zod input contract for {@link RunnableNode} when not set on the node class.\n * Resolution order: node instance `inputSchema`, then config `inputSchema`, then `z.unknown()`.\n */\n readonly inputSchema?: ZodType<TInputJson>;\n /**\n * When an activation receives **zero** input items, the engine normally runs `execute` zero times.\n * Set to **`runOnce`** to run `execute` once with an empty `items` batch (and a synthetic wire item for schema parsing).\n * Used by batch-style callback nodes (built-in `Callback`) so `callback([], ctx)` still runs.\n */\n readonly emptyBatchExecution?: \"skip\" | \"runOnce\";\n}\n\nexport declare const triggerNodeSetupStateType: unique symbol;\n\nexport interface TriggerNodeConfig<\n TOutputJson = unknown,\n TSetupState extends JsonValue | undefined = undefined,\n> extends NodeConfigBase {\n readonly kind: \"trigger\";\n readonly [triggerNodeOutputType]?: TOutputJson;\n readonly [triggerNodeSetupStateType]?: TSetupState;\n /**\n * Distinguishes triggers driven by the live activation policy (webhooks, cron, polling) from\n * triggers driven only by the {@link TestSuiteOrchestrator}. `WorkflowActivation` skips\n * `\"test\"` triggers; the orchestrator skips `\"live\"` triggers. Defaults to `\"live\"` when omitted.\n */\n readonly triggerKind?: \"live\" | \"test\";\n}\n\nexport type RunnableNodeInputJson<TConfig extends RunnableNodeConfig<any, any>> =\n TConfig extends RunnableNodeConfig<infer TInputJson, any> ? TInputJson : never;\n\nexport type RunnableNodeOutputJson<TConfig extends RunnableNodeConfig<any, any>> =\n TConfig extends RunnableNodeConfig<any, infer TOutputJson> ? TOutputJson : never;\n\nexport type TriggerNodeOutputJson<TConfig extends TriggerNodeConfig<any, any>> =\n TConfig extends TriggerNodeConfig<infer TOutputJson, any> ? TOutputJson : never;\n\nexport type TriggerNodeSetupState<TConfig extends TriggerNodeConfig<any, any>> =\n TConfig extends TriggerNodeConfig<any, infer TSetupState> ? TSetupState : never;\n\nexport interface NodeDefinition {\n id: NodeId;\n kind: NodeKind;\n type: TypeToken<unknown>;\n name?: string;\n config: NodeConfigBase;\n}\n\nexport interface NodeRef {\n id: NodeId;\n kind: NodeKind;\n name?: string;\n}\n\nexport function nodeRef<TJson>(nodeId: NodeId): NodeIdRef<TJson> {\n return nodeId as NodeIdRef<TJson>;\n}\n\nexport type PairedItemRef = Readonly<{ nodeId: NodeId; output: OutputPortKey; itemIndex: number }>;\n\nexport type BinaryPreviewKind = \"image\" | \"audio\" | \"video\" | \"download\";\n\nexport type BinaryAttachment = Readonly<{\n id: string;\n storageKey: string;\n mimeType: string;\n size: number;\n storageDriver: string;\n previewKind: BinaryPreviewKind;\n createdAt: string;\n runId: RunId;\n workflowId: WorkflowId;\n nodeId: NodeId;\n activationId: NodeActivationId;\n filename?: string;\n sha256?: string;\n}>;\n\nexport type ItemBinary = Readonly<Record<string, BinaryAttachment>>;\n\nexport type Item<TJson = unknown> = Readonly<{\n json: TJson;\n binary?: ItemBinary;\n meta?: Readonly<Record<string, unknown>>;\n paired?: ReadonlyArray<PairedItemRef>;\n}>;\n\nexport type Items<TJson = unknown> = ReadonlyArray<Item<TJson>>;\n\nexport type NodeOutputs = Partial<Record<OutputPortKey, Items>>;\n\nexport type RunId = string;\nexport type NodeActivationId = string;\n/**\n * One per-item iteration of a runnable node's execute loop. Refines `NodeActivationId` for\n * per-item connection invocations and telemetry. Undefined when the executing node is a batch\n * node or trigger that does not iterate items.\n */\nexport type NodeIterationId = string;\n\nexport interface ParentExecutionRef {\n runId: RunId;\n workflowId: WorkflowId;\n nodeId: NodeId;\n /** Subworkflow depth of the **spawning** run (0 = root). Passed when starting a child run. */\n subworkflowDepth?: number;\n /** Effective max node activations from the parent run (propagated to child policy merge). */\n engineMaxNodeActivations?: number;\n /** Effective max subworkflow depth from the parent run (propagated to child policy merge). */\n engineMaxSubworkflowDepth?: number;\n /**\n * Test-suite linkage inherited by the child subworkflow run. Set by whichever node\n * spawns the subworkflow when its own `ctx.testContext` is present, so assertions\n * emitted inside a subworkflow land under the correct parent test case.\n */\n testContext?: import(\"./runTypes\").RunTestContext;\n}\n\nexport interface RunDataSnapshot {\n getOutputs(nodeId: NodeId): NodeOutputs | undefined;\n getOutputItems<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, output?: OutputPortKey): Items<TJson>;\n getOutputItem<TJson = unknown>(\n nodeId: NodeId | NodeIdRef<TJson>,\n itemIndex: number,\n output?: OutputPortKey,\n ): Item<TJson> | undefined;\n}\n\nexport interface MutableRunData extends RunDataSnapshot {\n setOutputs(nodeId: NodeId, outputs: NodeOutputs): void;\n dump(): Record<NodeId, NodeOutputs>;\n}\n\nexport interface RunDataFactory {\n create(initial?: Record<NodeId, NodeOutputs>): MutableRunData;\n}\n\nexport interface RunIdFactory {\n makeRunId(): RunId;\n}\n\nexport interface ActivationIdFactory {\n makeActivationId(): NodeActivationId;\n}\n\nexport type UpstreamRefPlaceholder = `$${number}`;\nexport const branchRef = (index: number) => `$${index}` as UpstreamRefPlaceholder;\n\nexport type ExecutionMode = \"local\" | \"worker\";\n\nexport interface NodeSchedulerDecision {\n mode: ExecutionMode;\n queue?: string;\n}\n\nexport interface NodeOffloadPolicy {\n decide(args: { workflowId: WorkflowId; nodeId: NodeId; config: NodeConfigBase }): NodeSchedulerDecision;\n}\n\n/** Whether to persist run execution data after the workflow finishes. */\nexport type WorkflowStoragePolicyMode = \"ALL\" | \"SUCCESS\" | \"ERROR\" | \"NEVER\";\n\nexport type WorkflowStoragePolicySpec = WorkflowStoragePolicyMode | TypeToken<WorkflowStoragePolicyResolver>;\n\nexport interface WorkflowStoragePolicyResolver {\n shouldPersist(args: WorkflowStoragePolicyDecisionArgs): boolean | Promise<boolean>;\n}\n\nexport interface WorkflowStoragePolicyDecisionArgs {\n readonly runId: RunId;\n readonly workflowId: WorkflowId;\n readonly workflow: WorkflowDefinition;\n readonly finalStatus: \"completed\" | \"failed\";\n readonly startedAt: string;\n readonly finishedAt: string;\n}\n\nexport interface WorkflowPrunePolicySpec {\n readonly runDataRetentionSeconds?: number;\n readonly binaryRetentionSeconds?: number;\n readonly telemetrySpanRetentionSeconds?: number;\n readonly telemetryArtifactRetentionSeconds?: number;\n readonly telemetryMetricRetentionSeconds?: number;\n}\n\nexport interface PersistedRunPolicySnapshot {\n readonly retentionSeconds?: number;\n readonly binaryRetentionSeconds?: number;\n readonly telemetrySpanRetentionSeconds?: number;\n readonly telemetryArtifactRetentionSeconds?: number;\n readonly telemetryMetricRetentionSeconds?: number;\n readonly storagePolicy: WorkflowStoragePolicyMode;\n}\n\nexport interface WorkflowErrorHandler {\n onError(ctx: WorkflowErrorContext): void | Promise<void>;\n}\n\nexport interface WorkflowErrorContext {\n readonly runId: RunId;\n readonly workflowId: WorkflowId;\n readonly workflow: WorkflowDefinition;\n readonly failedNodeId: NodeId;\n readonly error: Error;\n readonly startedAt: string;\n readonly finishedAt: string;\n}\n\nexport type WorkflowErrorHandlerSpec = TypeToken<WorkflowErrorHandler> | WorkflowErrorHandler;\n\nexport interface NodeErrorHandlerArgs<TConfig extends NodeConfigBase = NodeConfigBase> {\n readonly kind: \"single\" | \"multi\";\n readonly items: Items;\n readonly inputsByPort: Readonly<Record<InputPortKey, Items>> | undefined;\n readonly ctx: import(\"./runtimeTypes\").NodeExecutionContext<TConfig>;\n readonly error: Error;\n}\n\nexport interface NodeErrorHandler {\n handle<TConfig extends NodeConfigBase>(args: NodeErrorHandlerArgs<TConfig>): Promise<NodeOutputs>;\n}\n\nexport type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;\n\n/** Runtime defaults when workflow omits prune/storage fields (typically from host env). */\nexport interface WorkflowPolicyRuntimeDefaults {\n readonly retentionSeconds?: number;\n readonly binaryRetentionSeconds?: number;\n readonly telemetrySpanRetentionSeconds?: number;\n readonly telemetryArtifactRetentionSeconds?: number;\n readonly telemetryMetricRetentionSeconds?: number;\n readonly storagePolicy?: WorkflowStoragePolicyMode;\n}\n","import type { TypeToken } from \"./index\";\nimport type { RunEventBus } from \"../events/runEvents\";\nimport type { EngineExecutionLimitsPolicy } from \"../policies/executionLimits/EngineExecutionLimitsPolicy\";\nimport type { AgentMcpIntegration } from \"../contracts/agentMcpTypes\";\nimport type {\n ActivationIdFactory,\n BinaryStorage,\n CredentialSessionService,\n CredentialTypeRegistry,\n ExecutionContextFactory,\n LiveWorkflowRepository,\n NodeActivationScheduler,\n NodeResolver,\n PersistedWorkflowTokenRegistryLike,\n RunDataFactory,\n RunIdFactory,\n TriggerSetupStateRepository,\n WorkflowExecutionRepository,\n WorkflowNodeInstanceFactory,\n WorkflowActivationPolicy,\n WorkflowRepository,\n WorkflowRunnerService,\n} from \"../types\";\n\nexport const CoreTokens = {\n PersistedWorkflowTokenRegistry: Symbol.for(\n \"codemation.core.PersistedWorkflowTokenRegistry\",\n ) as TypeToken<PersistedWorkflowTokenRegistryLike>,\n CredentialSessionService: Symbol.for(\n \"codemation.core.CredentialSessionService\",\n ) as TypeToken<CredentialSessionService>,\n CredentialTypeRegistry: Symbol.for(\"codemation.core.CredentialTypeRegistry\") as TypeToken<CredentialTypeRegistry>,\n WorkflowRunnerService: Symbol.for(\"codemation.core.WorkflowRunnerService\") as TypeToken<WorkflowRunnerService>,\n LiveWorkflowRepository: Symbol.for(\"codemation.core.LiveWorkflowRepository\") as TypeToken<LiveWorkflowRepository>,\n WorkflowRepository: Symbol.for(\"codemation.core.WorkflowRepository\") as TypeToken<WorkflowRepository>,\n NodeResolver: Symbol.for(\"codemation.core.NodeResolver\") as TypeToken<NodeResolver>,\n WorkflowNodeInstanceFactory: Symbol.for(\n \"codemation.core.WorkflowNodeInstanceFactory\",\n ) as TypeToken<WorkflowNodeInstanceFactory>,\n RunIdFactory: Symbol.for(\"codemation.core.RunIdFactory\") as TypeToken<RunIdFactory>,\n ActivationIdFactory: Symbol.for(\"codemation.core.ActivationIdFactory\") as TypeToken<ActivationIdFactory>,\n WorkflowExecutionRepository: Symbol.for(\n \"codemation.core.WorkflowExecutionRepository\",\n ) as TypeToken<WorkflowExecutionRepository>,\n TriggerSetupStateRepository: Symbol.for(\n \"codemation.core.TriggerSetupStateRepository\",\n ) as TypeToken<TriggerSetupStateRepository>,\n NodeActivationScheduler: Symbol.for(\"codemation.core.NodeActivationScheduler\") as TypeToken<NodeActivationScheduler>,\n RunDataFactory: Symbol.for(\"codemation.core.RunDataFactory\") as TypeToken<RunDataFactory>,\n ExecutionContextFactory: Symbol.for(\"codemation.core.ExecutionContextFactory\") as TypeToken<ExecutionContextFactory>,\n RunEventBus: Symbol.for(\"codemation.core.RunEventBus\") as TypeToken<RunEventBus>,\n BinaryStorage: Symbol.for(\"codemation.core.BinaryStorage\") as TypeToken<BinaryStorage>,\n WebhookBasePath: Symbol.for(\"codemation.core.WebhookBasePath\") as TypeToken<string>,\n /** Engine execution limits (defaults + optional host overrides). Consumers may bind a custom instance to override. */\n EngineExecutionLimitsPolicy: Symbol.for(\n \"codemation.core.EngineExecutionLimitsPolicy\",\n ) as TypeToken<EngineExecutionLimitsPolicy>,\n WorkflowActivationPolicy: Symbol.for(\n \"codemation.core.WorkflowActivationPolicy\",\n ) as TypeToken<WorkflowActivationPolicy>,\n /**\n * Optional. When registered, AIAgentNode uses it to resolve mcpServers bindings,\n * validate scopes, open pool connections, and prepare the MCP ToolSet map.\n * Not registered in the default core bootstrap — the host provides the implementation.\n */\n AgentMcpIntegration: Symbol.for(\"codemation.core.AgentMcpIntegration\") as TypeToken<AgentMcpIntegration>,\n} as const;\n"],"mappings":";;;;;;;;AAMA,IAAa,0BAAb,MAAqC;CACnC,OAAgB,oBAAoB;CAEpC,OAAO,8BAA8B,cAA8B;AACjE,SAAO,GAAG,eAAe,KAAK,kBAAkB;;CAGlD,OAAO,qBAAqB,cAAsB,UAA0B;EAC1E,MAAM,aAAa,KAAK,kBAAkB,SAAS;AACnD,SAAO,GAAG,eAAe,KAAK,kBAAkB,MAAM,KAAK,oBAAoB;;CAGjF,OAAO,oBAAoB,cAAsB,UAA0B;AACzE,SAAO,GAAG,eAAe,KAAK,kBAAkB,KAAK,KAAK,oBAAoB;;CAGhF,OAAO,sBAAsB,QAAyB;AACpD,SAAO,OAAO,SAAS,GAAG,KAAK,kBAAkB,KAAK,KAAK,oBAAoB;;CAGjF,OAA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,CAC3D,KAAI,MAAM,eAAe,CAAC,OAAO,KAAK,aAAa,KACjD,OAAM,KAAK;AAGf,SAAO;;;;;;ACgLX,SAAgB,QAAe,QAAkC;AAC/D,QAAO;;AA2FT,MAAa,aAAa,UAAkB,IAAI;;;;ACvQhD,MAAa,aAAa;CACxB,gCAAgC,OAAO,IACrC,iDACD;CACD,0BAA0B,OAAO,IAC/B,2CACD;CACD,wBAAwB,OAAO,IAAI,yCAAyC;CAC5E,uBAAuB,OAAO,IAAI,wCAAwC;CAC1E,wBAAwB,OAAO,IAAI,yCAAyC;CAC5E,oBAAoB,OAAO,IAAI,qCAAqC;CACpE,cAAc,OAAO,IAAI,+BAA+B;CACxD,6BAA6B,OAAO,IAClC,8CACD;CACD,cAAc,OAAO,IAAI,+BAA+B;CACxD,qBAAqB,OAAO,IAAI,sCAAsC;CACtE,6BAA6B,OAAO,IAClC,8CACD;CACD,6BAA6B,OAAO,IAClC,8CACD;CACD,yBAAyB,OAAO,IAAI,0CAA0C;CAC9E,gBAAgB,OAAO,IAAI,iCAAiC;CAC5D,yBAAyB,OAAO,IAAI,0CAA0C;CAC9E,aAAa,OAAO,IAAI,8BAA8B;CACtD,eAAe,OAAO,IAAI,gCAAgC;CAC1D,iBAAiB,OAAO,IAAI,kCAAkC;CAE9D,6BAA6B,OAAO,IAClC,8CACD;CACD,0BAA0B,OAAO,IAC/B,2CACD;CAMD,qBAAqB,OAAO,IAAI,sCAAsC;CACvE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as JsonValue, F as RunStatus,
|
|
1
|
+
import { At as JsonValue, F as RunStatus, Mt as NodeActivationId, S as PersistedWorkflowSnapshot, Xi as WorkflowId, Zt as RunId, _ as PersistedMutableRunState, f as NodeExecutionStatus, n as AgentMcpToolMap, qi as NodeId, t as AgentMcpIntegration, u as NodeExecutionError } from "./agentMcpTypes-DGIwk6Ue.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/contracts/AgentBindError.d.ts
|
|
4
4
|
|
|
@@ -272,4 +272,4 @@ interface WorkflowDetailSelectionState {
|
|
|
272
272
|
}
|
|
273
273
|
//#endregion
|
|
274
274
|
export { deriveAssertionPassed as C, DEFAULT_ASSERTION_PASS_THRESHOLD as S, AgentBindError as T, WorkItemStatus as _, ExecutionPayloadPolicyFields as a, AssertionResult as b, PersistedExecutionInstanceRecord as c, PersistedRunWorkItemRecord as d, RunIterationDto as f, WorkItemId as g, SlotExecutionStateDto as h, ExecutionInstanceId as i, PersistedRunSlotProjectionRecord as l, RunSlotProjectionState as m, ConnectionInvocationKind as n, PayloadStorageKind as o, RunRevision as p, ExecutionInstanceDto as r, PersistedExecutionInstanceKind as s, BatchId as t, PersistedRunWorkItemKind as u, WorkflowDetailSelectionState as v, NoOpAgentMcpIntegration as w, AssertionResultProvenance as x, WorkflowRunDetailDto as y };
|
|
275
|
-
//# sourceMappingURL=executionPersistenceContracts-
|
|
275
|
+
//# sourceMappingURL=executionPersistenceContracts-CN9d7AnL.d.cts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $
|
|
2
|
-
import { i as WorkflowSnapshotCodec, u as Engine } from "./RunIntentService-
|
|
3
|
-
import { B as ZodSchemaAny, K as CallableToolConfig, q as CallableToolConfigOptions } from "./ItemsInputNormalizer-
|
|
1
|
+
import { $t as PersistedRunState, A as DefinedNodeCredentialAccessors, Ai as NodeActivationContinuation, Ar as RunId, Bi as NodeExecutionStatePublisher, Ci as HumanTaskActor, Do as OutputPortKey, Dr as PersistedRunPolicySnapshot, Ei as HumanTaskSubject, Eo as NodeId, Er as ParentExecutionRef, Fi as NodeBinaryAttachmentService, Fr as TriggerNodeConfig, Gi as PreparedNodeActivationDispatch, Gn as RunEventSubscription, Ha as CostTrackingTelemetry, Hi as NodeResolver, Ii as NodeExecutionContext, Ja as CollectionsContext, Jn as TestSuiteRunId, Ka as CostTrackingUsageRecord, Kn as TestCaseRunStatus, Li as NodeExecutionRequest, M as DefinedNodeCredentialBindings, Mi as NodeActivationRequest, Mr as RunnableNodeConfig, O as DefinedNode, Oa as TelemetryScope, On as TypeToken, Or as RunDataFactory, Pi as NodeActivationScheduler, Qn as BinaryAttachment, Qt as PersistedRunSchedulingState, Rt as ConnectionInvocationId, Si as ExecutionContextFactory, So as PollingTriggerLogger, Sr as NodeOutputs, Un as RunEvent, Vn as EngineExecutionLimitsPolicy, Vt as EngineRunCounters, Wa as CostTrackingTelemetryFactory, Wn as RunEventBus, Wt as NodeExecutionSnapshot, Yi as SuspensionRequest, Zn as ActivationIdFactory, _i as EngineDeps, _n as RunTestContext, aa as WorkflowRepository, ba as ExecutionTelemetryFactory, bi as ExecutionBinaryService, bn as WorkflowExecutionPruneRepository, cn as RunExecutionOptions, da as TriggerInstanceId, di as BinaryStorage, dr as NodeActivationId, eo as CredentialFieldSchema, er as Edge, fi as BinaryStorageReadResult, fn as RunResult, fo as CredentialSessionFactoryArgs, fr as NodeConfigBase, ga as WebhookTriggerRoutingDiagnostics, gn as RunSummary, go as CredentialTypeDefinition, hi as BinaryStorageWriteResult, ho as CredentialType, ht as CostCatalogEntry, ia as WorkflowNodeInstanceFactory, ir as Items, ja as TelemetrySpanScope, ko as WorkflowId, kr as RunDataSnapshot, lr as JsonValue, ma as WebhookTriggerMatcher, mt as CostCatalog, na as TriggerSetupStateRepository, nn as PersistedWorkflowSnapshotNode, nr as Item, oo as CredentialJsonRecord, pa as WebhookInvocationMatch, pi as BinaryStorageStatResult, po as CredentialSessionService, pr as NodeDefinition, qn as TestSuiteRunStatus, ra as TriggerTestItemsContext, si as RetryPolicySpec, to as CredentialHealth, tr as ExecutionMode, ua as HttpMethod, ui as BinaryBody, un as RunPruneCandidate, uo as CredentialRequirement, ur as MutableRunData, va as WorkflowActivationPolicy, vr as NodeInspectorSummaryRow, wi as HumanTaskHandle, wr as NodeSchedulerDecision, xi as ExecutionContext, xn as WorkflowExecutionRepository, xr as NodeOffloadPolicy, ya as ExecutionTelemetry, yn as WorkflowExecutionListingRepository, zi as NodeExecutionScheduler, zr as WorkflowDefinition, zt as ConnectionInvocationRecord } from "./index-rllWL4r-.js";
|
|
2
|
+
import { i as WorkflowSnapshotCodec, u as Engine } from "./RunIntentService-DYpqfu6D.js";
|
|
3
|
+
import { B as ZodSchemaAny, K as CallableToolConfig, q as CallableToolConfigOptions } from "./ItemsInputNormalizer-BWtlwdVI.js";
|
|
4
4
|
import { ZodType, z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/orchestration/AbortControllerFactory.d.ts
|
|
@@ -559,6 +559,9 @@ declare class DefaultExecutionBinaryService implements ExecutionBinaryService {
|
|
|
559
559
|
activationId: NodeActivationId;
|
|
560
560
|
}): NodeBinaryAttachmentService;
|
|
561
561
|
openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
|
|
562
|
+
getBytes(attachment: BinaryAttachment, maxBytes?: number): Promise<Uint8Array>;
|
|
563
|
+
getText(attachment: BinaryAttachment, maxBytes?: number): Promise<string>;
|
|
564
|
+
getJson<T = unknown>(attachment: BinaryAttachment, maxBytes?: number): Promise<T>;
|
|
562
565
|
}
|
|
563
566
|
//#endregion
|
|
564
567
|
//#region src/execution/ChildExecutionScopeFactory.d.ts
|
|
@@ -1144,6 +1147,69 @@ declare class ManagedMaterialFetchError extends Error {
|
|
|
1144
1147
|
constructor(status: number, providerErrorBody: string, message?: string);
|
|
1145
1148
|
}
|
|
1146
1149
|
//#endregion
|
|
1150
|
+
//#region src/contracts/workspaceFileTypes.d.ts
|
|
1151
|
+
/**
|
|
1152
|
+
* Metadata returned for a workspace file object.
|
|
1153
|
+
* Filename and contentType come from the S3 object's custom metadata
|
|
1154
|
+
* (stamped by the control plane at upload time — story 03).
|
|
1155
|
+
* The local-fs driver reads them from a companion .meta.json sidecar.
|
|
1156
|
+
*/
|
|
1157
|
+
interface WorkspaceFileMetadata {
|
|
1158
|
+
/** Storage key: `<workspaceId>/files/<fileId>` */
|
|
1159
|
+
readonly key: string;
|
|
1160
|
+
/** Last path segment of the storage key. */
|
|
1161
|
+
readonly fileId: string;
|
|
1162
|
+
/** Original filename as stamped by the CP at upload time. Empty string if not yet stamped (pre-story-03). */
|
|
1163
|
+
readonly filename: string;
|
|
1164
|
+
readonly contentType: string;
|
|
1165
|
+
readonly size: number;
|
|
1166
|
+
readonly lastModified: Date;
|
|
1167
|
+
}
|
|
1168
|
+
/**
|
|
1169
|
+
* Read-only, workspace-scoped port for accessing the shared workspace file pool.
|
|
1170
|
+
* Implemented in `@codemation/host`; nodes reach it via `ctx.resolve(WorkspaceFileStorageToken)`.
|
|
1171
|
+
*
|
|
1172
|
+
* Key scheme: `<workspaceId>/files/<fileId>` — but nodes never construct raw keys.
|
|
1173
|
+
* Use the workspace-level helpers (`listFiles`, `getFileByName`, `getFileById`) instead.
|
|
1174
|
+
*
|
|
1175
|
+
* This adapter is SEPARATE from the run-scoped BinaryStorage — do not confuse the two.
|
|
1176
|
+
*/
|
|
1177
|
+
interface IWorkspaceFileStorage {
|
|
1178
|
+
/**
|
|
1179
|
+
* Lists all files in this workspace, sorted newest-first by lastModified.
|
|
1180
|
+
* Optional case-insensitive substring filter on filename.
|
|
1181
|
+
*/
|
|
1182
|
+
listFiles(filenameFilter?: string): Promise<ReadonlyArray<WorkspaceFileMetadata>>;
|
|
1183
|
+
/**
|
|
1184
|
+
* Returns metadata for the newest file with the given filename in this workspace.
|
|
1185
|
+
* @throws WorkspaceFileNotFoundError when no file with that name exists.
|
|
1186
|
+
*/
|
|
1187
|
+
getFileByName(filename: string): Promise<WorkspaceFileMetadata>;
|
|
1188
|
+
/**
|
|
1189
|
+
* Returns metadata for the file with the given fileId in this workspace.
|
|
1190
|
+
* @throws WorkspaceFileNotFoundError when no file with that id exists.
|
|
1191
|
+
*/
|
|
1192
|
+
getFileById(fileId: string): Promise<WorkspaceFileMetadata>;
|
|
1193
|
+
/**
|
|
1194
|
+
* Returns a non-buffered stream of the stored object's bytes.
|
|
1195
|
+
* Accepts a full storage key or a fileId (prefixes as needed).
|
|
1196
|
+
* @throws WorkspaceFileNotFoundError when the key does not exist.
|
|
1197
|
+
*/
|
|
1198
|
+
getStream(key: string): Promise<ReadableStream<Uint8Array>>;
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* Error thrown when a requested workspace file key does not exist.
|
|
1202
|
+
*/
|
|
1203
|
+
declare class WorkspaceFileNotFoundError extends Error {
|
|
1204
|
+
readonly key: string;
|
|
1205
|
+
constructor(key: string);
|
|
1206
|
+
}
|
|
1207
|
+
/**
|
|
1208
|
+
* DI token for the workspace-scoped file storage adapter.
|
|
1209
|
+
* Registered by `@codemation/host`; resolved by workspace-file nodes via `ctx.resolve(...)`.
|
|
1210
|
+
*/
|
|
1211
|
+
declare const WorkspaceFileStorageToken: TypeToken<IWorkspaceFileStorage | undefined>;
|
|
1212
|
+
//#endregion
|
|
1147
1213
|
//#region src/orchestration/TestSuiteRunIdFactory.d.ts
|
|
1148
1214
|
/**
|
|
1149
1215
|
* Mints unique TestSuiteRun identifiers. Separated from {@link import("../types").RunIdFactory}
|
|
@@ -1212,5 +1278,5 @@ declare class TestSuiteOrchestrator {
|
|
|
1212
1278
|
private publish;
|
|
1213
1279
|
}
|
|
1214
1280
|
//#endregion
|
|
1215
|
-
export {
|
|
1216
|
-
//# sourceMappingURL=index-
|
|
1281
|
+
export { ChildExecutionScopeFactory as $, HumanTaskStore as $t, WorkflowRepositoryWebhookTriggerMatcher as A, DefinedCollection as At, InlineDrivingScheduler as B, InboxChannelResolverToken as Bt, WorkflowEdgePortValidator as C, definePollingTrigger as Ct, PollingRunCycleResult as D, CollectionFieldDefinition as Dt, PollingRunCycleArgs as E, CollectionDefinition as Et, InMemoryRunDataFactory as F, defineCredential as Ft, NodeOutputNormalizer as G, LocalInboxChannelToken as Gt, StaticCostCatalog as H, InboxDelivery as Ht, InMemoryBinaryStorage as I, DefinedNodeRegistry as It, InProcessRetryRunner as J, HitlTimeoutJobSchedulerSeam as Jt, RunnableOutputBehaviorResolver as K, HitlResumeTokenSignerSeam as Kt, LocalOnlyScheduler as L, ControlPlaneInboxChannelToken as Lt, EngineFactory as M, defineCollection as Mt, RunSummaryMapper as N, callableTool as Nt, PollingTriggerRuntime as O, CollectionIndexDefinition as Ot, InMemoryWorkflowExecutionRepository as P, DefineCredentialOptions as Pt, AsyncSleeper as Q, HumanTaskStatus as Qt, HintOnlyOffloadPolicy as R, InboxChannel as Rt, OAuthMaterial as S, DefinedPollingTriggerConfig as St, WorkflowEdgePortValidationResult as T, CollectionColumnBuilder as Tt, NodeInstanceFactory as U, InboxOnDecisionArgs as Ut, ConfigDrivenOffloadPolicy as V, InboxDeliverArgs as Vt, NodeExecutor as W, InboxOnTimeoutArgs as Wt, DefaultExecutionContextFactory as X, HitlWorkspaceIdToken as Xt, CatalogBackedCostTrackingTelemetryFactory as Y, HitlTimeoutJobSchedulerToken as Yt, DefaultAsyncSleeper as Z, HumanTaskRecord as Zt, MaterialBundle as _, DefinePollingTriggerOptions as _t, TestSuiteRunResult as a, AbortControllerFactory as an, tool as at, OAuthFlowStartArgs as b, DefinePollingTriggerTestItemsContext as bt, WorkspaceFileMetadata as c, PersistedRuntimeTypeMetadataStore as ct, ManagedMaterialFetchError as d, PersistedRuntimeTypeKind as dt, HumanTaskStoreToken as en, DefaultExecutionBinaryService as et, ManagedCredentialMaterialWriteError as f, PersistedRuntimeTypeMetadata as ft, IllegalMaterialSourceError as g, DefinePollingTriggerExecuteContext as gt, CredentialMaterialRef as h, ConnectionInvocationEventPublisher as ht, TestSuiteOrchestratorEngine as i, CredentialResolverFactory as in, node as it, EngineCompositionDeps as j, c as jt, PollingTriggerStartArgs as k, DefineCollectionOptions as kt, WorkspaceFileNotFoundError as l, InjectableRuntimeDecoratorComposer as lt, CredentialMaterialProvider as m, InMemoryRunEventBus as mt, TestSuiteCaseOutcome as n, SystemClock as nn, chatModel as nt, TestSuiteRunIdFactory as o, StackTraceCallSitePathResolver as ot, CallerContext as p, EventPublishingWorkflowExecutionRepository as pt, ItemExprResolver as q, HitlResumeTokenSignerToken as qt, TestSuiteOrchestrator as r, NodeEventPublisher as rn, getPersistedRuntimeTypeMetadata as rt, IWorkspaceFileStorage as s, PersistedRuntimeTypeNameResolver as st, RunTestSuiteArgs as t, Clock as tn, UnavailableBinaryStorage as tt, WorkspaceFileStorageToken as u, PersistedRuntimeTypeDecoratorOptions as ut, OAuthFlowCallbackArgs as v, DefinePollingTriggerPollContext as vt, WorkflowEdgePortError as w, DefinedCollectionRegistry as wt, OAuthFlowStartResult as x, DefinedPollingTrigger as xt, OAuthFlowExecutor as y, DefinePollingTriggerPollResult as yt, DefaultDrivingScheduler as z, InboxChannelResolverSeam as zt };
|
|
1282
|
+
//# sourceMappingURL=index-CqZeNGAp.d.ts.map
|
|
@@ -785,12 +785,30 @@ interface NodeBinaryAttachmentService extends ExecutionBinaryService {
|
|
|
785
785
|
attach(args: BinaryAttachmentCreateRequest): Promise<BinaryAttachment>;
|
|
786
786
|
withAttachment<TJson>(item: Item<TJson>, name: string, attachment: BinaryAttachment): Item<TJson>;
|
|
787
787
|
}
|
|
788
|
+
/** Default maximum bytes read into memory by the bounded helpers (50 MiB). */
|
|
789
|
+
declare const BINARY_DEFAULT_MAX_BYTES: number;
|
|
788
790
|
interface ExecutionBinaryService {
|
|
789
791
|
forNode(args: {
|
|
790
792
|
nodeId: NodeId;
|
|
791
793
|
activationId: NodeActivationId;
|
|
792
794
|
}): NodeBinaryAttachmentService;
|
|
793
795
|
openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
|
|
796
|
+
/**
|
|
797
|
+
* Reads all bytes from the attachment into a contiguous `Uint8Array`.
|
|
798
|
+
* Checks `attachment.size` against `maxBytes` *before* any allocation; throws a bounded-read
|
|
799
|
+
* error when exceeded (no OOM). Throws if the stream is unavailable or the byte count mismatches.
|
|
800
|
+
*/
|
|
801
|
+
getBytes(attachment: BinaryAttachment, maxBytes?: number): Promise<Uint8Array>;
|
|
802
|
+
/**
|
|
803
|
+
* Reads the attachment and decodes the bytes as UTF-8 text.
|
|
804
|
+
* Subject to the same bounded-read safety as `getBytes`.
|
|
805
|
+
*/
|
|
806
|
+
getText(attachment: BinaryAttachment, maxBytes?: number): Promise<string>;
|
|
807
|
+
/**
|
|
808
|
+
* Reads the attachment, decodes as UTF-8 text, and parses as JSON.
|
|
809
|
+
* Throws a clear error on invalid JSON. Subject to the same bounded-read safety.
|
|
810
|
+
*/
|
|
811
|
+
getJson<T = unknown>(attachment: BinaryAttachment, maxBytes?: number): Promise<T>;
|
|
794
812
|
}
|
|
795
813
|
interface ExecutionContext {
|
|
796
814
|
runId: RunId;
|
|
@@ -2990,5 +3008,5 @@ declare class DefaultWorkflowGraphFactory implements WorkflowGraphFactory {
|
|
|
2990
3008
|
create(def: WorkflowDefinition): WorkflowGraph;
|
|
2991
3009
|
}
|
|
2992
3010
|
//#endregion
|
|
2993
|
-
export { ExecutionPayloadPolicyFields as $,
|
|
2994
|
-
//# sourceMappingURL=index-
|
|
3011
|
+
export { ExecutionPayloadPolicyFields as $, CredentialBindingKey as $a, TriggerRuntimeDiagnostics as $i, BinaryPreviewKind as $n, nodeRef as $r, PersistedRunState as $t, DefinedNodeCredentialAccessors as A, TelemetrySpanEventRecord as Aa, NodeActivationContinuation as Ai, delay as An, RunId as Ar, DEFAULT_ASSERTION_PASS_THRESHOLD as At, RetryPolicy as B, CostTrackingComponent as Ba, NodeExecutionStatePublisher as Bi, ENGINE_EXECUTION_LIMITS_DEFAULTS as Bn, WorkflowErrorContext as Br, CurrentStateExecutionRequest as Bt, defineHumanApprovalNode as C, TelemetryArtifactReference as Ca, HumanTaskActor as Ci, DependencyContainer$1 as Cn, PollingTriggerDedupWindow as Co, NodeRef as Cr, ItemExprResolvedContext as Ct, DefineNodeOptions as D, TelemetryMetricRecord as Da, ItemNode as Di, RegistrationOptions as Dn, OutputPortKey as Do, PersistedRunPolicySnapshot as Dr, resolveItemExprsInUnknown as Dt, DefineNodeExecuteArgs as E, TelemetryChildSpanStart as Ea, HumanTaskSubject as Ei, Lifecycle as En, NodeId as Eo, ParentExecutionRef as Er, resolveItemExprsForExecution as Et, defineNode as F, NoOpExecutionTelemetryFactory as Fa, NodeBinaryAttachmentService as Fi, instancePerContainerCachingFactory as Fn, TriggerNodeConfig as Fr, AgentMcpToolMap as Ft, isPortsEmission as G, CostTrackingTelemetryMetricNames as Ga, PreparedNodeActivationDispatch as Gi, RunEventSubscription as Gn, WorkflowNodeConnection as Gr, NodeExecutionStatus as Gt, getOriginIndexFromItem as H, CostTrackingTelemetry as Ha, NodeResolver as Hi, EngineExecutionLimitsPolicyConfig as Hn, WorkflowErrorHandlerSpec as Hr, ExecutionFrontierPlan as Ht, RunFinishedAtFactory as I, NoOpExecutionTelemetry as Ia, NodeExecutionContext as Ii, predicateAwareClassFactory as In, TriggerNodeOutputJson as Ir, NeedsReconsentEvent as It, McpServerTransport as J, CollectionsContext as Ja, RunnableNodeExecuteArgs as Ji, TestSuiteRunId as Jn, WorkflowStoragePolicyDecisionArgs as Jr, PendingResumeEntry as Jt, isUnbrandedPortsEmissionShape as K, CostTrackingUsageRecord as Ka, ResumeContext as Ki, TestCaseRunStatus as Kn, WorkflowPolicyRuntimeDefaults as Kr, NodeInputsByPort as Kt, NoOpCostTrackingTelemetryFactory as L, NoOpNodeExecutionTelemetry as La, NodeExecutionRequest as Li, registry as Ln, TriggerNodeSetupState as Lr, ConnectionInvocationAppendArgs as Lt, DefinedNodeCredentialBindings as M, CodemationTelemetryMetricNames as Ma, NodeActivationRequest as Mi, injectAll as Mn, RunnableNodeConfig as Mr, NoOpAgentMcpIntegration as Mt, DefinedNodeRunContext as N, GenAiTelemetryAttributeNames as Na, NodeActivationRequestBase as Ni, injectable as Nn, RunnableNodeInputJson as Nr, AgentBindError as Nt, DefinedNode as O, TelemetryScope as Oa, LiveWorkflowRepository as Oi, TypeToken as On, PersistedTokenId as Oo, RunDataFactory as Or, AssertionResult as Ot, defineBatchNode as P, CodemationTelemetryAttributeNames as Pa, NodeActivationScheduler as Pi, instanceCachingFactory as Pn, RunnableNodeOutputJson as Pr, AgentMcpIntegration as Pt, ExecutionInstanceId as Q, CredentialBinding as Qa, TriggerNode as Qi, BinaryAttachment as Qn, branchRef as Qr, PersistedRunSchedulingState as Qt, NoOpCostTrackingTelemetry as R, NoOpTelemetrySpanScope as Ra, NodeExecutionRequestHandler as Ri, singleton as Rn, UpstreamRefPlaceholder as Rr, ConnectionInvocationId as Rt, HumanApprovalOutputJson as S, TelemetryArtifactAttachment as Sa, ExecutionContextFactory as Si, Container as Sn, PollingTriggerLogger as So, NodeOutputs as Sr, ItemExprContext as St, DefineBatchNodeOptions as T, TelemetryAttributes as Ta, HumanTaskId as Ti, InjectionToken$1 as Tn, NodeConnectionName as To, PairedItemRef as Tr, itemExpr as Tt, PortsEmission as U, CostTrackingTelemetryAttributeNames as Ua, PersistedTriggerSetupState as Ui, RunEvent as Un, WorkflowGraph as Ur, NodeExecutionError as Ut, NoRetryPolicy as V, CostTrackingPriceQuote as Va, NodeExecutor as Vi, EngineExecutionLimitsPolicy as Vn, WorkflowErrorHandler as Vr, EngineRunCounters as Vt, emitPorts as W, CostTrackingTelemetryFactory as Wa, PollingTriggerHandle as Wi, RunEventBus as Wn, WorkflowGraphFactory as Wr, NodeExecutionSnapshot as Wt, ConnectionInvocationKind as X, CredentialAdvancedSectionPresentation as Xa, TestableTriggerNode as Xi, TestTriggerSetupContext as Xn, WorkflowStoragePolicyResolver as Xr, PersistedMutableRunState as Xt, BatchId as Y, AnyCredentialType as Ya, SuspensionRequest as Yi, TestTriggerNodeConfig as Yn, WorkflowStoragePolicyMode as Yr, PersistedMutableNodeState as Yt, ExecutionInstanceDto as Z, CredentialAuthDefinition as Za, TriggerCleanupHandle as Zi, ActivationIdFactory as Zn, WorkflowStoragePolicySpec as Zr, PersistedRunControlState as Zt, BranchStepsArg as _, AllWorkflowsActiveWorkflowActivationPolicy as _a, EngineDeps as _i, RunTestContext as _n, CredentialTypeId as _o, NodeIdRef as _r, Param as _t, ConnectionNodeIdFactory as a, WorkflowRepository as aa, FixedRetryPolicySpec as ai, RunCompletionNotifier as an, CredentialInstanceRecord as ao, JsonArray as ar, PersistedRunWorkItemRecord as at, DefinedHumanApprovalNode as b, ExecutionTelemetryFactory as ba, ExecutionBinaryService as bi, WorkflowExecutionPruneRepository as bn, OAuth2ProviderFromPublicConfig as bo, NodeKind as br, ItemExprArgs as bt, WorkflowDefinitionError as c, WorkflowSnapshotFactory as ca, BINARY_DEFAULT_MAX_BYTES as ci, RunExecutionOptions as cn, CredentialOAuth2AuthDefinition as co, JsonPrimitive as cr, RunSlotProjectionState as ct, WhenBuilder as d, TriggerInstanceId as da, BinaryStorage as di, RunQueueEntry as dn, CredentialSessionFactory as do, NodeActivationId as dr, WorkItemStatus as dt, TriggerSetupContext as ea, runnableNodeInputType as ei, PersistedSuspensionEntry as en, CredentialFieldSchema as eo, Edge as er, PayloadStorageKind as et, AnyRunnableNodeConfig as f, WebhookControlSignal as fa, BinaryStorageReadResult as fi, RunResult as fn, CredentialSessionFactoryArgs as fo, NodeConfigBase as fr, WorkflowDetailSelectionState as ft, BranchOutputGuard as g, WebhookTriggerRoutingDiagnostics as ga, Duration as gi, RunSummary as gn, CredentialTypeDefinition as go, NodeErrorHandlerSpec as gr, Expr as gt, BranchMoreArgs as h, WebhookTriggerResolution as ha, BinaryStorageWriteResult as hi, RunStopCondition as hn, CredentialType as ho, NodeErrorHandlerArgs as hr, CostCatalogEntry as ht, NodeIterationIdFactory as i, WorkflowNodeInstanceFactory as ia, ExponentialRetryPolicySpec as ii, PinnedNodeOutputsByPort as in, CredentialInstanceId as io, Items as ir, PersistedRunWorkItemKind as it, DefinedNodeCredentialBinding as j, TelemetrySpanScope as ja, NodeActivationReceipt as ji, inject as jn, RunIdFactory as jr, deriveAssertionPassed as jt, DefinedNodeConfigInput as k, TelemetrySpanEnd as ka, MultiInputNode as ki, container$1 as kn, WorkflowId as ko, RunDataSnapshot as kr, AssertionResultProvenance as kt, WorkflowBuilder as l, WorkflowSnapshotResolver as la, BinaryAttachmentCreateRequest as li, RunHaltReason as ln, CredentialOAuth2ScopesFromPublicConfig as lo, JsonValue as lr, SlotExecutionStateDto as lt, BooleanWhenOverloads as m, WebhookTriggerMatcher as ma, BinaryStorageWriteRequest as mi, RunStatus as mn, CredentialSetupStatus as mo, NodeErrorHandler as mr, CostCatalog as mt, WorkflowExecutableNodeClassifierFactory as n, TriggerSetupStateRepository as na, triggerNodeOutputType as ni, PersistedWorkflowSnapshotNode as nn, CredentialHealthStatus as no, Item as nr, PersistedExecutionInstanceRecord as nt, ConnectionInvocationIdFactory as o, WorkflowRunnerResolver as oa, NoneRetryPolicySpec as oi, RunCurrentState as on, CredentialJsonRecord as oo, JsonNonArray as or, RunIterationDto as ot, AnyTriggerNodeConfig as p, WebhookInvocationMatch as pa, BinaryStorageStatResult as pi, RunStateResetRequest as pn, CredentialSessionService as po, NodeDefinition as pr, WorkflowRunDetailDto as pt, McpServerDeclaration as q, CollectionStore as qa, RunnableNode as qi, TestSuiteRunStatus as qn, WorkflowPrunePolicySpec as qr, PendingNodeExecution as qt, WorkflowExecutableNodeClassifier as r, TriggerTestItemsContext as ra, triggerNodeSetupStateType as ri, PersistedWorkflowTokenRegistryLike as rn, CredentialHealthTester as ro, ItemBinary as rr, PersistedRunSlotProjectionRecord as rt, NodeIdSlugifier as s, WorkflowRunnerService as sa, RetryPolicySpec as si, RunEventPublisherDeps as sn, CredentialMaterialSourceKind as so, JsonObject as sr, RunRevision as st, DefaultWorkflowGraphFactory as t, TriggerSetupStateFor as ta, runnableNodeOutputType as ti, PersistedWorkflowSnapshot as tn, CredentialHealth as to, ExecutionMode as tr, PersistedExecutionInstanceKind as tt, ChainCursor as u, HttpMethod as ua, BinaryBody as ui, RunPruneCandidate as un, CredentialRequirement as uo, MutableRunData as ur, WorkItemId as ut, StepSequenceOutput as v, WorkflowActivationPolicy as va, EngineHost as vi, WebhookRunResult as vn, CredentialTypeRegistry as vo, NodeInspectorSummaryRow as vr, ParamDeep as vt, isHumanApprovalNode as w, TelemetryAttributePrimitive as wa, HumanTaskHandle as wi, Disposable as wn, InputPortKey as wo, NodeSchedulerDecision as wr, isItemExpr as wt, HumanApprovalDecisionResult as x, NodeExecutionTelemetry as xa, ExecutionContext as xi, WorkflowExecutionRepository as xn, NoOpPollingTriggerLogger as xo, NodeOffloadPolicy as xr, ItemExprCallback as xt, ValidStepSequence as y, ExecutionTelemetry as ya, ExecutableTriggerNode as yi, WorkflowExecutionListingRepository as yn, CredentialUnboundError as yo, NodeIterationId as yr, ItemExpr as yt, ExpRetryPolicy as z, NoOpTelemetryArtifactReference as za, NodeExecutionScheduler as zi, CoreTokens as zn, WorkflowDefinition as zr, ConnectionInvocationRecord as zt };
|
|
3012
|
+
//# sourceMappingURL=index-rllWL4r-.d.ts.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_di = require('./di-
|
|
2
|
-
const require_ItemsInputNormalizer = require('./ItemsInputNormalizer-
|
|
1
|
+
const require_di = require('./di-C-2ep8NZ.cjs');
|
|
2
|
+
const require_ItemsInputNormalizer = require('./ItemsInputNormalizer-57EdA1ad.cjs');
|
|
3
3
|
const require_contracts = require('./contracts-CK0x6w_G.cjs');
|
|
4
|
-
const require_runtime = require('./runtime-
|
|
4
|
+
const require_runtime = require('./runtime-DjYXgOo0.cjs');
|
|
5
5
|
const require_InMemoryRunEventBusRegistry = require('./InMemoryRunEventBusRegistry-Sa86VxuV.cjs');
|
|
6
6
|
let zod = require("zod");
|
|
7
7
|
zod = require_di.__toESM(zod);
|
|
@@ -704,6 +704,24 @@ var ManagedMaterialFetchError = class extends Error {
|
|
|
704
704
|
}
|
|
705
705
|
};
|
|
706
706
|
|
|
707
|
+
//#endregion
|
|
708
|
+
//#region src/contracts/workspaceFileTypes.ts
|
|
709
|
+
/**
|
|
710
|
+
* Error thrown when a requested workspace file key does not exist.
|
|
711
|
+
*/
|
|
712
|
+
var WorkspaceFileNotFoundError = class extends Error {
|
|
713
|
+
constructor(key) {
|
|
714
|
+
super(`Workspace file not found: ${key}`);
|
|
715
|
+
this.key = key;
|
|
716
|
+
this.name = "WorkspaceFileNotFoundError";
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
/**
|
|
720
|
+
* DI token for the workspace-scoped file storage adapter.
|
|
721
|
+
* Registered by `@codemation/host`; resolved by workspace-file nodes via `ctx.resolve(...)`.
|
|
722
|
+
*/
|
|
723
|
+
const WorkspaceFileStorageToken = Symbol.for("codemation.core.WorkspaceFileStorage");
|
|
724
|
+
|
|
707
725
|
//#endregion
|
|
708
726
|
exports.AgentBindError = require_contracts.AgentBindError;
|
|
709
727
|
exports.AgentConfigInspector = require_di.AgentConfigInspector;
|
|
@@ -795,6 +813,8 @@ exports.WorkflowDefinitionError = require_runtime.WorkflowDefinitionError;
|
|
|
795
813
|
exports.WorkflowEdgePortValidator = WorkflowEdgePortValidator;
|
|
796
814
|
exports.WorkflowExecutableNodeClassifier = require_runtime.WorkflowExecutableNodeClassifier;
|
|
797
815
|
exports.WorkflowExecutableNodeClassifierFactory = require_runtime.WorkflowExecutableNodeClassifierFactory;
|
|
816
|
+
exports.WorkspaceFileNotFoundError = WorkspaceFileNotFoundError;
|
|
817
|
+
exports.WorkspaceFileStorageToken = WorkspaceFileStorageToken;
|
|
798
818
|
exports.branchRef = require_di.branchRef;
|
|
799
819
|
exports.c = c;
|
|
800
820
|
exports.callableTool = callableTool;
|