@codemation/core 0.13.2 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/dist/{CostCatalogContract-Dxq1BTyi.d.cts → CostCatalogContract-B9aYIqJu.d.cts} +2 -2
  3. package/dist/{EngineRuntimeRegistration.types-CqcTWexS.d.cts → EngineRuntimeRegistration.types-BYAmGMdS.d.cts} +3 -3
  4. package/dist/{EngineRuntimeRegistration.types-Cr75cSfL.d.ts → EngineRuntimeRegistration.types-CVLI8DsJ.d.ts} +2 -2
  5. package/dist/{InMemoryRunDataFactory-Csy2evr_.d.cts → InMemoryRunDataFactory-C3rIszrW.d.cts} +4 -2
  6. package/dist/{ItemsInputNormalizer-BbQTSEkZ.cjs → ItemsInputNormalizer-B9SdLG24.cjs} +2 -2
  7. package/dist/{ItemsInputNormalizer-BbQTSEkZ.cjs.map → ItemsInputNormalizer-B9SdLG24.cjs.map} +1 -1
  8. package/dist/{ItemsInputNormalizer-CSZGMgl3.js → ItemsInputNormalizer-CZEODg94.js} +2 -2
  9. package/dist/{ItemsInputNormalizer-CSZGMgl3.js.map → ItemsInputNormalizer-CZEODg94.js.map} +1 -1
  10. package/dist/{ItemsInputNormalizer-BYljnXU0.d.ts → ItemsInputNormalizer-DoOawd9R.d.ts} +2 -2
  11. package/dist/{ItemsInputNormalizer-Bi8m-Ijs.d.cts → ItemsInputNormalizer-UCpn7luX.d.cts} +3 -3
  12. package/dist/{RunIntentService-BitgkKaT.d.cts → RunIntentService-0f3ICjAz.d.cts} +2 -2
  13. package/dist/{RunIntentService-DYpqfu6D.d.ts → RunIntentService-Dx_HHxDX.d.ts} +2 -2
  14. package/dist/{agentMcpTypes-DGIwk6Ue.d.cts → agentMcpTypes-B11B3Hd-.d.cts} +8 -1
  15. package/dist/bootstrap/index.cjs +3 -3
  16. package/dist/bootstrap/index.d.cts +5 -5
  17. package/dist/bootstrap/index.d.ts +5 -5
  18. package/dist/bootstrap/index.js +3 -3
  19. package/dist/{bootstrap-DIv-vloi.cjs → bootstrap-Be0LB0nh.cjs} +3 -3
  20. package/dist/{bootstrap-DIv-vloi.cjs.map → bootstrap-Be0LB0nh.cjs.map} +1 -1
  21. package/dist/{bootstrap-Bkd-Nfbn.js → bootstrap-pSQdsMfa.js} +3 -3
  22. package/dist/{bootstrap-Bkd-Nfbn.js.map → bootstrap-pSQdsMfa.js.map} +1 -1
  23. package/dist/browser.cjs +2 -2
  24. package/dist/browser.d.cts +3 -3
  25. package/dist/browser.d.ts +2 -2
  26. package/dist/browser.js +2 -2
  27. package/dist/contracts.d.cts +4 -4
  28. package/dist/contracts.d.ts +1 -1
  29. package/dist/{di-tom0pM2h.js → di-CEV6wTc4.js} +4 -5
  30. package/dist/di-CEV6wTc4.js.map +1 -0
  31. package/dist/{di-LP2qSHkY.cjs → di-DhwtDRgs.cjs} +4 -5
  32. package/dist/di-DhwtDRgs.cjs.map +1 -0
  33. package/dist/{executionPersistenceContracts-CN9d7AnL.d.cts → executionPersistenceContracts-CX9Ql8N1.d.cts} +2 -2
  34. package/dist/{index-rllWL4r-.d.ts → index-CbJdbIHe.d.ts} +93 -6
  35. package/dist/{index-BSQ2LoIh.d.ts → index-uPnD9EE6.d.ts} +51 -11
  36. package/dist/index.cjs +20 -7
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +135 -16
  39. package/dist/index.d.ts +5 -5
  40. package/dist/index.js +19 -8
  41. package/dist/index.js.map +1 -1
  42. package/dist/{params-DRUr0F5v.d.cts → params-Dwl10Ws9.d.cts} +3 -4
  43. package/dist/{runtime-CWPdvJpC.js → runtime-CSunvf7A.js} +112 -15
  44. package/dist/runtime-CSunvf7A.js.map +1 -0
  45. package/dist/{runtime-_VdHwGkJ.cjs → runtime-n2tqRwaf.cjs} +117 -14
  46. package/dist/runtime-n2tqRwaf.cjs.map +1 -0
  47. package/dist/testing.cjs +3 -3
  48. package/dist/testing.d.cts +3 -3
  49. package/dist/testing.d.ts +3 -3
  50. package/dist/testing.js +3 -3
  51. package/package.json +1 -1
  52. package/src/authoring/defineNode.types.ts +18 -7
  53. package/src/authoring/definePollingTrigger.types.ts +20 -5
  54. package/src/authoring/index.ts +1 -0
  55. package/src/authoring/nodeBaseOptions.types.ts +18 -0
  56. package/src/contracts/itemExpr.ts +15 -11
  57. package/src/contracts/workflowTypes.ts +7 -0
  58. package/src/contracts/workspaceFileTypes.ts +42 -2
  59. package/src/execution/NodeOutputNormalizer.ts +8 -1
  60. package/src/execution/RunnableOutputBehaviorResolver.ts +12 -0
  61. package/src/index.ts +10 -2
  62. package/src/workflow/dsl/ChainCursorResolver.ts +13 -0
  63. package/src/workflow/dsl/WhenBuilder.ts +66 -2
  64. package/src/workflow/dsl/workflowBuilderTypes.ts +29 -0
  65. package/src/workflowSnapshots/WorkflowSnapshotCodec.ts +1 -0
  66. package/dist/di-LP2qSHkY.cjs.map +0 -1
  67. package/dist/di-tom0pM2h.js.map +0 -1
  68. package/dist/runtime-CWPdvJpC.js.map +0 -1
  69. package/dist/runtime-_VdHwGkJ.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"di-DhwtDRgs.cjs","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\n// Structural string-literal brand (NOT a `unique symbol`): independently-bundled copies of\n// `ItemExpr` across node packages must be STRUCTURALLY identical to stay cross-assignable. A\n// `unique symbol` makes each bundled copy a nominally-distinct type, which breaks passing an\n// `itemExpr()` into a node-config field whose package resolved a different (duplicated) copy of\n// core. A plain string-literal property is identical across copies and also survives JSON.\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 __codemationItemExpr: \"codemation.itemExpr\";\n readonly fn: ItemExprCallback<T, TItemJson>;\n}>;\n\nexport function itemExpr<T, TItemJson = unknown>(fn: ItemExprCallback<T, TItemJson>): ItemExpr<T, TItemJson> {\n return { __codemationItemExpr: \"codemation.itemExpr\", 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 // Current structural brand (a plain string property; survives JSON serialization).\n if (v[\"__codemationItemExpr\"] === \"codemation.itemExpr\" && typeof v[\"fn\"] === \"function\") {\n return true;\n }\n // Legacy: the old `Symbol.for(\"codemation.itemExpr\")` brand (configs from an older core build).\n for (const sym of Object.getOwnPropertySymbols(v)) {\n if (sym.description === \"codemation.itemExpr\" && v[sym] === true) {\n return true;\n }\n }\n // Snapshot-hydrated wrappers where the brand was dropped but the callback survived.\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 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 readonly onRejected?: \"halt\" | \"return\";\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.onRejected = options.onRejected;\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 /**\n * Plain-language, non-technical explanation of what this node does, surfaced in the workflow\n * inspector / node properties sidebar. A first-class config option every authorable node accepts\n * directly (alongside `id`), so it flows into the persisted config the mappers read. Distinct from\n * {@link inspectorSummary} (config-derived label/value rows).\n */\n readonly description?: 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":"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"}
@@ -1,4 +1,4 @@
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";
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-B11B3Hd-.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-CN9d7AnL.d.cts.map
275
+ //# sourceMappingURL=executionPersistenceContracts-CX9Ql8N1.d.cts.map
@@ -1199,6 +1199,13 @@ interface NodeConfigBase {
1199
1199
  readonly name?: string;
1200
1200
  readonly id?: NodeId;
1201
1201
  readonly icon?: string;
1202
+ /**
1203
+ * Plain-language, non-technical explanation of what this node does, surfaced in the workflow
1204
+ * inspector / node properties sidebar. A first-class config option every authorable node accepts
1205
+ * directly (alongside `id`), so it flows into the persisted config the mappers read. Distinct from
1206
+ * {@link inspectorSummary} (config-derived label/value rows).
1207
+ */
1208
+ readonly description?: string;
1202
1209
  readonly execution?: Readonly<{
1203
1210
  hint?: "local" | "worker";
1204
1211
  queue?: string;
@@ -2222,7 +2229,6 @@ interface AssertionResultProvenance {
2222
2229
  }
2223
2230
  //#endregion
2224
2231
  //#region src/contracts/itemExpr.d.ts
2225
- declare const ITEM_EXPR_BRAND: unique symbol;
2226
2232
  type ItemExprResolvedContext = Readonly<{
2227
2233
  runId: RunId;
2228
2234
  workflowId: WorkflowId;
@@ -2242,7 +2248,7 @@ type ItemExprArgs<TItemJson = unknown> = Readonly<{
2242
2248
  }>;
2243
2249
  type ItemExprCallback<T, TItemJson = unknown> = (args: ItemExprArgs<TItemJson>) => T | Promise<T>;
2244
2250
  type ItemExpr<T, TItemJson = unknown> = Readonly<{
2245
- readonly [ITEM_EXPR_BRAND]: true;
2251
+ readonly __codemationItemExpr: "codemation.itemExpr";
2246
2252
  readonly fn: ItemExprCallback<T, TItemJson>;
2247
2253
  }>;
2248
2254
  declare function itemExpr<T, TItemJson = unknown>(fn: ItemExprCallback<T, TItemJson>): ItemExpr<T, TItemJson>;
@@ -2564,6 +2570,26 @@ declare class RunFinishedAtFactory {
2564
2570
  static resolveIso(state: RunFinishedAtSource): string | undefined;
2565
2571
  }
2566
2572
  //#endregion
2573
+ //#region src/authoring/nodeBaseOptions.types.d.ts
2574
+ /**
2575
+ * Core-local copy of the per-instance authoring options every `define*` factory's `create(...)`
2576
+ * accepts in its trailing argument: a stable `id` plus a plain-language `description` (the
2577
+ * non-technical "what does this step do" line surfaced in the node sidebar).
2578
+ *
2579
+ * `description` is a first-class option — passed inline exactly like `id` — and is threaded onto
2580
+ * the config instance as an OWN ENUMERABLE field so it flows into the persisted workflow snapshot
2581
+ * (`WorkflowSnapshotCodec` serializes via `JSON.parse(JSON.stringify(config))`, which only captures
2582
+ * own enumerable properties — never a getter).
2583
+ *
2584
+ * `@codemation/core-nodes` declares an identical `NodeBaseOptions` for its bare-id built-in nodes;
2585
+ * core keeps its own copy because core must not depend on `@codemation/core-nodes` (dependency
2586
+ * direction). The two types are structurally identical by design.
2587
+ */
2588
+ interface NodeBaseOptions {
2589
+ readonly id?: string;
2590
+ readonly description?: string;
2591
+ }
2592
+ //#endregion
2567
2593
  //#region src/authoring/defineNode.types.d.ts
2568
2594
  type MaybePromise<TValue> = TValue | Promise<TValue>;
2569
2595
  type ResolvableCredentialType = AnyCredentialType | CredentialTypeId;
@@ -2604,7 +2630,7 @@ interface DefinedNode<TKey$1 extends string, TConfig extends CredentialJsonRecor
2604
2630
  readonly key: TKey$1;
2605
2631
  readonly title: string;
2606
2632
  readonly description?: string;
2607
- create<TConfigItemJson = TInputJson$1>(config: DefinedNodeConfigInput<TConfig, TConfigItemJson>, name?: string, id?: string): RunnableNodeConfig<TInputJson$1, TOutputJson$1>;
2633
+ create<TConfigItemJson = TInputJson$1>(config: DefinedNodeConfigInput<TConfig, TConfigItemJson>, name?: string, idOrOptions?: string | NodeBaseOptions): RunnableNodeConfig<TInputJson$1, TOutputJson$1>;
2608
2634
  register(context: {
2609
2635
  registerNode<TValue>(token: TypeToken<TValue>, implementation?: TypeToken<TValue>): void;
2610
2636
  }): void;
@@ -2803,6 +2829,31 @@ declare function defineHumanApprovalNode<TKey$1 extends string, TConfig extends
2803
2829
  }): DefinedHumanApprovalNode<TKey$1, TConfig, TInputJson$1, TBindings>;
2804
2830
  //#endregion
2805
2831
  //#region src/workflow/dsl/workflowBuilderTypes.d.ts
2832
+ /**
2833
+ * Flags a node's config so its output is MERGED onto `item.json` (shallow, output-wins) instead of
2834
+ * replacing it — the config-level twin of {@link ChainCursor.thenMerge}.
2835
+ *
2836
+ * Unlike `.thenMerge` (a cursor method that only works on the trunk), `mergeForward` operates on a
2837
+ * bare config, so it is usable in ANY position — including inside a `.when({ true: [...] })` branch
2838
+ * arm, where the steps are a flat array of configs (not a cursor). Wrap a payload-REPLACING node
2839
+ * (e.g. an extractor) in `mergeForward(node.create(...))` so prior fields survive into the next step.
2840
+ *
2841
+ * The OUTPUT type becomes `TIn & TOut` (the intersection), mirroring `.thenMerge`'s return type at
2842
+ * the config level — so the next step in the branch array sees both the prior fields and the node's
2843
+ * output. The INPUT type stays `TIn` (the node still receives the pre-merge item).
2844
+ *
2845
+ * @example
2846
+ * ```ts
2847
+ * workflow
2848
+ * .trigger(...)
2849
+ * .when({
2850
+ * true: [mergeForward(extractor.create(...))], // output merges onto item.json; { a } survives
2851
+ * false: [...],
2852
+ * })
2853
+ * .build();
2854
+ * ```
2855
+ */
2856
+ declare function mergeForward<TIn, TOut>(config: RunnableNodeConfig<TIn, TOut>): RunnableNodeConfig<TIn, TIn & TOut>;
2806
2857
  type AnyRunnableNodeConfig = RunnableNodeConfig<any, any>;
2807
2858
  type AnyTriggerNodeConfig = TriggerNodeConfig<any>;
2808
2859
  type ValidStepSequence<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps extends readonly [] ? readonly [] : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<TCurrentJson, infer TNextJson> ? TRest extends ReadonlyArray<AnyRunnableNodeConfig> ? readonly [TFirst, ...ValidStepSequence<TNextJson, TRest>] : never : never : TSteps;
@@ -2817,14 +2868,44 @@ type BooleanWhenOverloads<TCurrentJson, TReturn> = {
2817
2868
  };
2818
2869
  //#endregion
2819
2870
  //#region src/workflow/dsl/WhenBuilder.d.ts
2871
+ /** Structurally identical to ChainCursorResolver's (unexported) ChainCursorEndpoint. */
2872
+ type WhenEndpoint = Readonly<{
2873
+ node: NodeRef;
2874
+ output: OutputPortKey;
2875
+ inputPortHint?: InputPortKey;
2876
+ }>;
2820
2877
  declare class WhenBuilder<TCurrentJson> {
2821
2878
  private readonly wf;
2822
2879
  private readonly from;
2823
2880
  private readonly branchPort;
2824
- constructor(wf: WorkflowBuilder, from: NodeRef, branchPort: OutputPortKey);
2881
+ /** Tails of arms added by earlier `.when(...)` calls in this chain. */
2882
+ private readonly priorEndpoints;
2883
+ /** Tail endpoint of the arm this builder added (set by addBranch). */
2884
+ private armEndpoint;
2885
+ constructor(wf: WorkflowBuilder, from: NodeRef, branchPort: OutputPortKey, /** Tails of arms added by earlier `.when(...)` calls in this chain. */
2886
+ priorEndpoints?: ReadonlyArray<WhenEndpoint>);
2825
2887
  addBranch<TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(steps: TSteps & ValidStepSequence<TCurrentJson, TSteps>): this;
2826
2888
  readonly when: BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>>;
2889
+ /**
2890
+ * Continue the trunk after a boolean `.when(...)` branch chain, auto-merging EVERY branch
2891
+ * tail accumulated across the chain into the next node — the same fan-in the object form
2892
+ * produces. Typed as `ChainCursor<TCurrentJson>` (the pre-branch item type): boolean arms
2893
+ * carry no output guard so the merged item type is underdetermined — use the object form
2894
+ * `.when({ true: [...], false: [...] })` when you need a precise merged type inline.
2895
+ */
2896
+ then<TOutputJson$1, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson$1>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
2897
+ /**
2898
+ * Chainable human-approval step after a boolean `.when(...)` branch chain — merges every
2899
+ * branch tail into the approval node. Mirrors `ChainCursor.humanApproval`.
2900
+ */
2901
+ humanApproval<TKey$1 extends string, TConfig extends Record<string, unknown>, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(node: DefinedHumanApprovalNode<TKey$1, TConfig, TCurrentJson & Record<string, unknown>, TBindings>, config: TConfig, metadata?: {
2902
+ name?: string;
2903
+ nodeId?: string;
2904
+ }): ChainCursor<HumanApprovalOutputJson<TCurrentJson & Record<string, unknown>>>;
2827
2905
  build(): WorkflowDefinition;
2906
+ /** Endpoints of every arm added so far in this chain (prior arms + this one). */
2907
+ private get accumulatedEndpoints();
2908
+ private toCursor;
2828
2909
  }
2829
2910
  //#endregion
2830
2911
  //#region src/workflow/dsl/ChainCursorResolver.d.ts
@@ -2844,6 +2925,12 @@ declare class ChainCursor<TCurrentJson> {
2844
2925
  private readonly endpoints;
2845
2926
  constructor(wf: WorkflowBuilder, endpoints: ReadonlyArray<ChainCursorEndpoint>);
2846
2927
  then<TOutputJson$1, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson$1>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
2928
+ /**
2929
+ * Append a step whose output is MERGED onto `item.json` (shallow, output-wins) instead of
2930
+ * replacing it — so earlier fields (e.g. trigger metadata) survive a transform/OCR/extraction
2931
+ * node. Use for any node in a pipeline where you need data from before it.
2932
+ */
2933
+ thenMerge<TOutputJson$1, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson$1>>(config: TConfig): ChainCursor<TCurrentJson & RunnableNodeOutputJson<TConfig>>;
2847
2934
  thenIntoInputHints<TOutputJson$1, TConfig extends RunnableNodeConfig<any, TOutputJson$1>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
2848
2935
  readonly when: ChainCursorWhenOverloads<TCurrentJson>;
2849
2936
  route<TNextJson$1>(branches: Readonly<Record<OutputPortKey, (branch: ChainCursor<TCurrentJson>) => ChainCursor<TNextJson$1> | undefined>>): ChainCursor<TNextJson$1>;
@@ -3008,5 +3095,5 @@ declare class DefaultWorkflowGraphFactory implements WorkflowGraphFactory {
3008
3095
  create(def: WorkflowDefinition): WorkflowGraph;
3009
3096
  }
3010
3097
  //#endregion
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
3098
+ export { ExecutionInstanceDto as $, CredentialAuthDefinition as $a, TriggerCleanupHandle as $i, ActivationIdFactory as $n, WorkflowStoragePolicySpec as $r, PersistedRunControlState as $t, DefinedNodeConfigInput as A, TelemetryScope as Aa, LiveWorkflowRepository as Ai, TypeToken as An, PersistedTokenId as Ao, RunDataFactory as Ar, AssertionResult as At, NoOpCostTrackingTelemetry as B, NoOpTelemetrySpanScope as Ba, NodeExecutionRequestHandler as Bi, singleton as Bn, UpstreamRefPlaceholder as Br, ConnectionInvocationId as Bt, HumanApprovalOutputJson as C, NodeExecutionTelemetry as Ca, ExecutionContext as Ci, WorkflowExecutionRepository as Cn, NoOpPollingTriggerLogger as Co, NodeOffloadPolicy as Cr, ItemExprCallback as Ct, DefineNodeExecuteArgs as D, TelemetryAttributes as Da, HumanTaskId as Di, InjectionToken$1 as Dn, NodeConnectionName as Do, PairedItemRef as Dr, itemExpr as Dt, DefineBatchNodeOptions as E, TelemetryAttributePrimitive as Ea, HumanTaskHandle as Ei, Disposable as En, InputPortKey as Eo, NodeSchedulerDecision as Er, isItemExpr as Et, defineBatchNode as F, GenAiTelemetryAttributeNames as Fa, NodeActivationRequestBase as Fi, injectable as Fn, RunnableNodeInputJson as Fr, AgentBindError as Ft, PortsEmission as G, CostTrackingTelemetryAttributeNames as Ga, PersistedTriggerSetupState as Gi, RunEvent as Gn, WorkflowGraph as Gr, NodeExecutionError as Gt, RetryPolicy as H, CostTrackingComponent as Ha, NodeExecutionStatePublisher as Hi, ENGINE_EXECUTION_LIMITS_DEFAULTS as Hn, WorkflowErrorContext as Hr, CurrentStateExecutionRequest as Ht, defineNode as I, CodemationTelemetryAttributeNames as Ia, NodeActivationScheduler as Ii, instanceCachingFactory as In, RunnableNodeOutputJson as Ir, AgentMcpIntegration as It, isUnbrandedPortsEmissionShape as J, CostTrackingUsageRecord as Ja, ResumeContext as Ji, TestCaseRunStatus as Jn, WorkflowPolicyRuntimeDefaults as Jr, NodeInputsByPort as Jt, emitPorts as K, CostTrackingTelemetryFactory as Ka, PollingTriggerHandle as Ki, RunEventBus as Kn, WorkflowGraphFactory as Kr, NodeExecutionSnapshot as Kt, NodeBaseOptions as L, NoOpExecutionTelemetryFactory as La, NodeBinaryAttachmentService as Li, instancePerContainerCachingFactory as Ln, TriggerNodeConfig as Lr, AgentMcpToolMap as Lt, DefinedNodeCredentialBinding as M, TelemetrySpanEventRecord as Ma, NodeActivationContinuation as Mi, delay as Mn, RunId as Mr, DEFAULT_ASSERTION_PASS_THRESHOLD as Mt, DefinedNodeCredentialBindings as N, TelemetrySpanScope as Na, NodeActivationReceipt as Ni, inject as Nn, RunIdFactory as Nr, deriveAssertionPassed as Nt, DefineNodeOptions as O, TelemetryChildSpanStart as Oa, HumanTaskSubject as Oi, Lifecycle as On, NodeId as Oo, ParentExecutionRef as Or, resolveItemExprsForExecution as Ot, DefinedNodeRunContext as P, CodemationTelemetryMetricNames as Pa, NodeActivationRequest as Pi, injectAll as Pn, RunnableNodeConfig as Pr, NoOpAgentMcpIntegration as Pt, ConnectionInvocationKind as Q, CredentialAdvancedSectionPresentation as Qa, TestableTriggerNode as Qi, TestTriggerSetupContext as Qn, WorkflowStoragePolicyResolver as Qr, PersistedMutableRunState as Qt, RunFinishedAtFactory as R, NoOpExecutionTelemetry as Ra, NodeExecutionContext as Ri, predicateAwareClassFactory as Rn, TriggerNodeOutputJson as Rr, NeedsReconsentEvent as Rt, HumanApprovalDecisionResult as S, ExecutionTelemetryFactory as Sa, ExecutionBinaryService as Si, WorkflowExecutionPruneRepository as Sn, OAuth2ProviderFromPublicConfig as So, NodeKind as Sr, ItemExprArgs as St, isHumanApprovalNode as T, TelemetryArtifactReference as Ta, HumanTaskActor as Ti, DependencyContainer$1 as Tn, PollingTriggerDedupWindow as To, NodeRef as Tr, ItemExprResolvedContext as Tt, NoRetryPolicy as U, CostTrackingPriceQuote as Ua, NodeExecutor as Ui, EngineExecutionLimitsPolicy as Un, WorkflowErrorHandler as Ur, EngineRunCounters as Ut, ExpRetryPolicy as V, NoOpTelemetryArtifactReference as Va, NodeExecutionScheduler as Vi, CoreTokens as Vn, WorkflowDefinition as Vr, ConnectionInvocationRecord as Vt, getOriginIndexFromItem as W, CostTrackingTelemetry as Wa, NodeResolver as Wi, EngineExecutionLimitsPolicyConfig as Wn, WorkflowErrorHandlerSpec as Wr, ExecutionFrontierPlan as Wt, McpServerTransport as X, CollectionsContext as Xa, RunnableNodeExecuteArgs as Xi, TestSuiteRunId as Xn, WorkflowStoragePolicyDecisionArgs as Xr, PendingResumeEntry as Xt, McpServerDeclaration as Y, CollectionStore as Ya, RunnableNode as Yi, TestSuiteRunStatus as Yn, WorkflowPrunePolicySpec as Yr, PendingNodeExecution as Yt, BatchId as Z, AnyCredentialType as Za, SuspensionRequest as Zi, TestTriggerNodeConfig as Zn, WorkflowStoragePolicyMode as Zr, PersistedMutableNodeState as Zt, BranchStepsArg as _, WebhookTriggerResolution as _a, BinaryStorageWriteResult as _i, RunStopCondition as _n, CredentialType as _o, NodeErrorHandlerArgs as _r, CostCatalogEntry as _t, ConnectionNodeIdFactory as a, TriggerTestItemsContext as aa, triggerNodeSetupStateType as ai, PersistedWorkflowTokenRegistryLike as an, CredentialHealthTester as ao, ItemBinary as ar, PersistedRunSlotProjectionRecord as at, mergeForward as b, WorkflowActivationPolicy as ba, EngineHost as bi, WebhookRunResult as bn, CredentialTypeRegistry as bo, NodeInspectorSummaryRow as br, ParamDeep as bt, WorkflowDefinitionError as c, WorkflowRunnerResolver as ca, NoneRetryPolicySpec as ci, RunCurrentState as cn, CredentialJsonRecord as co, JsonNonArray as cr, RunIterationDto as ct, WhenBuilder as d, WorkflowSnapshotResolver as da, BinaryAttachmentCreateRequest as di, RunHaltReason as dn, CredentialOAuth2ScopesFromPublicConfig as do, JsonValue as dr, SlotExecutionStateDto as dt, TriggerNode as ea, branchRef as ei, PersistedRunSchedulingState as en, CredentialBinding as eo, BinaryAttachment as er, ExecutionInstanceId as et, AnyRunnableNodeConfig as f, HttpMethod as fa, BinaryBody as fi, RunPruneCandidate as fn, CredentialRequirement as fo, MutableRunData as fr, WorkItemId as ft, BranchOutputGuard as g, WebhookTriggerMatcher as ga, BinaryStorageWriteRequest as gi, RunStatus as gn, CredentialSetupStatus as go, NodeErrorHandler as gr, CostCatalog as gt, BranchMoreArgs as h, WebhookInvocationMatch as ha, BinaryStorageStatResult as hi, RunStateResetRequest as hn, CredentialSessionService as ho, NodeDefinition as hr, WorkflowRunDetailDto as ht, NodeIterationIdFactory as i, TriggerSetupStateRepository as ia, triggerNodeOutputType as ii, PersistedWorkflowSnapshotNode as in, CredentialHealthStatus as io, Item as ir, PersistedExecutionInstanceRecord as it, DefinedNodeCredentialAccessors as j, TelemetrySpanEnd as ja, MultiInputNode as ji, container$1 as jn, WorkflowId as jo, RunDataSnapshot as jr, AssertionResultProvenance as jt, DefinedNode as k, TelemetryMetricRecord as ka, ItemNode as ki, RegistrationOptions as kn, OutputPortKey as ko, PersistedRunPolicySnapshot as kr, resolveItemExprsInUnknown as kt, WorkflowBuilder as l, WorkflowRunnerService as la, RetryPolicySpec as li, RunEventPublisherDeps as ln, CredentialMaterialSourceKind as lo, JsonObject as lr, RunRevision as lt, BooleanWhenOverloads as m, WebhookControlSignal as ma, BinaryStorageReadResult as mi, RunResult as mn, CredentialSessionFactoryArgs as mo, NodeConfigBase as mr, WorkflowDetailSelectionState as mt, WorkflowExecutableNodeClassifierFactory as n, TriggerSetupContext as na, runnableNodeInputType as ni, PersistedSuspensionEntry as nn, CredentialFieldSchema as no, Edge as nr, PayloadStorageKind as nt, ConnectionInvocationIdFactory as o, WorkflowNodeInstanceFactory as oa, ExponentialRetryPolicySpec as oi, PinnedNodeOutputsByPort as on, CredentialInstanceId as oo, Items as or, PersistedRunWorkItemKind as ot, AnyTriggerNodeConfig as p, TriggerInstanceId as pa, BinaryStorage as pi, RunQueueEntry as pn, CredentialSessionFactory as po, NodeActivationId as pr, WorkItemStatus as pt, isPortsEmission as q, CostTrackingTelemetryMetricNames as qa, PreparedNodeActivationDispatch as qi, RunEventSubscription as qn, WorkflowNodeConnection as qr, NodeExecutionStatus as qt, WorkflowExecutableNodeClassifier as r, TriggerSetupStateFor as ra, runnableNodeOutputType as ri, PersistedWorkflowSnapshot as rn, CredentialHealth as ro, ExecutionMode as rr, PersistedExecutionInstanceKind as rt, NodeIdSlugifier as s, WorkflowRepository as sa, FixedRetryPolicySpec as si, RunCompletionNotifier as sn, CredentialInstanceRecord as so, JsonArray as sr, PersistedRunWorkItemRecord as st, DefaultWorkflowGraphFactory as t, TriggerRuntimeDiagnostics as ta, nodeRef as ti, PersistedRunState as tn, CredentialBindingKey as to, BinaryPreviewKind as tr, ExecutionPayloadPolicyFields as tt, ChainCursor as u, WorkflowSnapshotFactory as ua, BINARY_DEFAULT_MAX_BYTES as ui, RunExecutionOptions as un, CredentialOAuth2AuthDefinition as uo, JsonPrimitive as ur, RunSlotProjectionState as ut, StepSequenceOutput as v, WebhookTriggerRoutingDiagnostics as va, Duration as vi, RunSummary as vn, CredentialTypeDefinition as vo, NodeErrorHandlerSpec as vr, Expr as vt, defineHumanApprovalNode as w, TelemetryArtifactAttachment as wa, ExecutionContextFactory as wi, Container as wn, PollingTriggerLogger as wo, NodeOutputs as wr, ItemExprContext as wt, DefinedHumanApprovalNode as x, ExecutionTelemetry as xa, ExecutableTriggerNode as xi, WorkflowExecutionListingRepository as xn, CredentialUnboundError as xo, NodeIterationId as xr, ItemExpr as xt, ValidStepSequence as y, AllWorkflowsActiveWorkflowActivationPolicy as ya, EngineDeps as yi, RunTestContext as yn, CredentialTypeId as yo, NodeIdRef as yr, Param as yt, NoOpCostTrackingTelemetryFactory as z, NoOpNodeExecutionTelemetry as za, NodeExecutionRequest as zi, registry as zn, TriggerNodeSetupState as zr, ConnectionInvocationAppendArgs as zt };
3099
+ //# sourceMappingURL=index-CbJdbIHe.d.ts.map
@@ -1,6 +1,6 @@
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-BYljnXU0.js";
1
+ import { $n as ActivationIdFactory, Aa as TelemetryScope, An as TypeToken, Ar as RunDataFactory, Bt as ConnectionInvocationId, Ci as ExecutionContext, Cn as WorkflowExecutionRepository, Cr as NodeOffloadPolicy, Ei as HumanTaskHandle, Er as NodeSchedulerDecision, Gn as RunEvent, Hi as NodeExecutionStatePublisher, Ii as NodeActivationScheduler, Ja as CostTrackingUsageRecord, Jn as TestCaseRunStatus, Ka as CostTrackingTelemetryFactory, Kn as RunEventBus, Kt as NodeExecutionSnapshot, L as NodeBaseOptions, Li as NodeBinaryAttachmentService, Lr as TriggerNodeConfig, Mi as NodeActivationContinuation, Mr as RunId, N as DefinedNodeCredentialBindings, Na as TelemetrySpanScope, Oi as HumanTaskSubject, Oo as NodeId, Or as ParentExecutionRef, Pi as NodeActivationRequest, Pr as RunnableNodeConfig, Ri as NodeExecutionContext, Sa as ExecutionTelemetryFactory, Si as ExecutionBinaryService, Sn as WorkflowExecutionPruneRepository, Ti as HumanTaskActor, Un as EngineExecutionLimitsPolicy, Ut as EngineRunCounters, Vi as NodeExecutionScheduler, Vr as WorkflowDefinition, Vt as ConnectionInvocationRecord, Wa as CostTrackingTelemetry, Wi as NodeResolver, Xa as CollectionsContext, Xn as TestSuiteRunId, Yn as TestSuiteRunStatus, Zi as SuspensionRequest, _i as BinaryStorageWriteResult, _o as CredentialType, _t as CostCatalogEntry, aa as TriggerTestItemsContext, ba as WorkflowActivationPolicy, br as NodeInspectorSummaryRow, co as CredentialJsonRecord, dr as JsonValue, en as PersistedRunSchedulingState, er as BinaryAttachment, fa as HttpMethod, fi as BinaryBody, fn as RunPruneCandidate, fo as CredentialRequirement, fr as MutableRunData, ga as WebhookTriggerMatcher, gt as CostCatalog, ha as WebhookInvocationMatch, hi as BinaryStorageStatResult, ho as CredentialSessionService, hr as NodeDefinition, ia as TriggerSetupStateRepository, in as PersistedWorkflowSnapshotNode, ir as Item, j as DefinedNodeCredentialAccessors, jo as WorkflowId, jr as RunDataSnapshot, k as DefinedNode, ko as OutputPortKey, kr as PersistedRunPolicySnapshot, li as RetryPolicySpec, mi as BinaryStorageReadResult, mn as RunResult, mo as CredentialSessionFactoryArgs, mr as NodeConfigBase, no as CredentialFieldSchema, nr as Edge, oa as WorkflowNodeInstanceFactory, or as Items, pa as TriggerInstanceId, pi as BinaryStorage, pr as NodeActivationId, qi as PreparedNodeActivationDispatch, qn as RunEventSubscription, ro as CredentialHealth, rr as ExecutionMode, sa as WorkflowRepository, tn as PersistedRunState, un as RunExecutionOptions, va as WebhookTriggerRoutingDiagnostics, vn as RunSummary, vo as CredentialTypeDefinition, wi as ExecutionContextFactory, wo as PollingTriggerLogger, wr as NodeOutputs, xa as ExecutionTelemetry, xn as WorkflowExecutionListingRepository, yi as EngineDeps, yn as RunTestContext, zi as NodeExecutionRequest } from "./index-CbJdbIHe.js";
2
+ import { i as WorkflowSnapshotCodec, u as Engine } from "./RunIntentService-Dx_HHxDX.js";
3
+ import { B as ZodSchemaAny, K as CallableToolConfig, q as CallableToolConfigOptions } from "./ItemsInputNormalizer-DoOawd9R.js";
4
4
  import { ZodType, z } from "zod";
5
5
 
6
6
  //#region src/orchestration/AbortControllerFactory.d.ts
@@ -367,9 +367,10 @@ interface DefinedPollingTrigger<TKey extends string, TConfig$1 extends Credentia
367
367
  * Create the trigger config for use in workflow definitions.
368
368
  * @param cfg - User-facing trigger configuration.
369
369
  * @param name - Display name (defaults to `title`).
370
- * @param id - Optional stable node id.
370
+ * @param idOrOptions - Optional stable node id, or `{ id?, description? }` authoring options
371
+ * (a bare string id still works — back-compat).
371
372
  */
372
- create(cfg: TConfig$1, name?: string, id?: string): DefinedPollingTriggerConfig<TConfig$1, TItemJson>;
373
+ create(cfg: TConfig$1, name?: string, idOrOptions?: string | NodeBaseOptions): DefinedPollingTriggerConfig<TConfig$1, TItemJson>;
373
374
  /**
374
375
  * Test seam: call `poll` directly without starting the runtime.
375
376
  * Returns `{ items, nextState }` just like the real runtime receives.
@@ -392,12 +393,13 @@ declare class DefinedPollingTriggerConfig<TConfig$1 extends CredentialJsonRecord
392
393
  readonly name: string;
393
394
  readonly cfg: TConfig$1;
394
395
  private readonly credentialRequirements;
395
- readonly id?: string | undefined;
396
396
  private readonly inspectorSummaryFn?;
397
397
  readonly kind: "trigger";
398
398
  readonly type: TypeToken<unknown>;
399
399
  readonly icon: string | undefined;
400
- constructor(name: string, cfg: TConfig$1, typeToken: TypeToken<unknown>, icon: string | undefined, credentialRequirements: ReadonlyArray<CredentialRequirement>, id?: string | undefined, inspectorSummaryFn?: ((args: Readonly<{
400
+ readonly id?: string;
401
+ readonly description?: string;
402
+ constructor(name: string, cfg: TConfig$1, typeToken: TypeToken<unknown>, icon: string | undefined, credentialRequirements: ReadonlyArray<CredentialRequirement>, idOrOptions?: string | NodeBaseOptions, inspectorSummaryFn?: ((args: Readonly<{
401
403
  config: TConfig$1;
402
404
  }>) => ReadonlyArray<NodeInspectorSummaryRow> | undefined) | undefined);
403
405
  getCredentialRequirements(): ReadonlyArray<CredentialRequirement>;
@@ -659,10 +661,12 @@ declare class ItemExprResolver {
659
661
  //#region src/execution/RunnableOutputBehaviorResolver.d.ts
660
662
  type RunnableOutputBehavior = Readonly<{
661
663
  keepBinaries: boolean;
664
+ mergeJson: boolean;
662
665
  }>;
663
666
  declare class RunnableOutputBehaviorResolver {
664
667
  resolve(config: RunnableNodeConfig): RunnableOutputBehavior;
665
668
  private isKeepBinariesEnabled;
669
+ private isMergeJsonEnabled;
666
670
  }
667
671
  //#endregion
668
672
  //#region src/execution/NodeOutputNormalizer.d.ts
@@ -676,6 +680,7 @@ declare class NodeOutputNormalizer {
676
680
  private emitPortsToOutputs;
677
681
  private normalizePortPayload;
678
682
  private isItemLike;
683
+ private isPlainJsonObject;
679
684
  private applyOutput;
680
685
  }
681
686
  //#endregion
@@ -1177,11 +1182,11 @@ interface WorkspaceFileMetadata {
1177
1182
  readonly lastModified: Date;
1178
1183
  }
1179
1184
  /**
1180
- * Read-only, workspace-scoped port for accessing the shared workspace file pool.
1185
+ * Workspace-scoped port for accessing the shared workspace file pool.
1181
1186
  * Implemented in `@codemation/host`; nodes reach it via `ctx.resolve(WorkspaceFileStorageToken)`.
1182
1187
  *
1183
1188
  * Key scheme: `<workspaceId>/files/<fileId>` — but nodes never construct raw keys.
1184
- * Use the workspace-level helpers (`listFiles`, `getFileByName`, `getFileById`) instead.
1189
+ * Use the workspace-level helpers (`listFiles`, `getFileByName`, `getFileById`, `writeFile`) instead.
1185
1190
  *
1186
1191
  * This adapter is SEPARATE from the run-scoped BinaryStorage — do not confuse the two.
1187
1192
  */
@@ -1207,6 +1212,24 @@ interface IWorkspaceFileStorage {
1207
1212
  * @throws WorkspaceFileNotFoundError when the key does not exist.
1208
1213
  */
1209
1214
  getStream(key: string): Promise<ReadableStream<Uint8Array>>;
1215
+ /**
1216
+ * Writes a file into the workspace's shared file pool.
1217
+ *
1218
+ * Generates a new fileId internally; the caller never constructs a raw key.
1219
+ * Stamps the filename into object metadata so read-side adapters can resolve
1220
+ * files by name without querying a registry.
1221
+ *
1222
+ * Returns the stored file's metadata (fileId, key, filename, contentType, size,
1223
+ * lastModified). Callers that need concierge visibility must also register a
1224
+ * WorkspaceFile row on the CP side via the HMAC-paired
1225
+ * `POST /internal/workspace-files/register` endpoint — see the host-side
1226
+ * `WorkspaceFileRegistrarClient`.
1227
+ *
1228
+ * @param filename Original filename; stored in object metadata.
1229
+ * @param body Bytes to write (contiguous — required for presigned PUT Content-Length).
1230
+ * @param contentType MIME type.
1231
+ */
1232
+ writeFile(filename: string, body: Uint8Array, contentType: string): Promise<WorkspaceFileMetadata>;
1210
1233
  }
1211
1234
  /**
1212
1235
  * Error thrown when a requested workspace file key does not exist.
@@ -1215,11 +1238,28 @@ declare class WorkspaceFileNotFoundError extends Error {
1215
1238
  readonly key: string;
1216
1239
  constructor(key: string);
1217
1240
  }
1241
+ /**
1242
+ * Port for registering a workflow-written file in the CP's WorkspaceFile table.
1243
+ * Optional: only wired when the host is paired with a control plane.
1244
+ * Implemented by `WorkspaceFileRegistrarClient` in `@codemation/host`.
1245
+ * Nodes call this after `writeFile` so the concierge can see the file via
1246
+ * `list_files` / `get_file`.
1247
+ */
1248
+ interface IWorkspaceFileRegistrar {
1249
+ register(meta: WorkspaceFileMetadata): Promise<void>;
1250
+ }
1218
1251
  /**
1219
1252
  * DI token for the workspace-scoped file storage adapter.
1220
1253
  * Registered by `@codemation/host`; resolved by workspace-file nodes via `ctx.resolve(...)`.
1221
1254
  */
1222
1255
  declare const WorkspaceFileStorageToken: TypeToken<IWorkspaceFileStorage | undefined>;
1256
+ /**
1257
+ * DI token for the optional CP registry hook.
1258
+ * Present only when the host is paired (managed mode). Standalone / local-fs
1259
+ * deployments leave this undefined — workflow-written files will be in S3/local
1260
+ * but will not appear in the concierge's list_files.
1261
+ */
1262
+ declare const WorkspaceFileRegistrarToken: TypeToken<IWorkspaceFileRegistrar | undefined>;
1223
1263
  //#endregion
1224
1264
  //#region src/orchestration/TestSuiteRunIdFactory.d.ts
1225
1265
  /**
@@ -1289,5 +1329,5 @@ declare class TestSuiteOrchestrator {
1289
1329
  private publish;
1290
1330
  }
1291
1331
  //#endregion
1292
- 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 };
1293
- //# sourceMappingURL=index-BSQ2LoIh.d.ts.map
1332
+ export { DefaultAsyncSleeper as $, HumanTaskRecord as $t, PollingTriggerRuntime as A, CollectionIndexDefinition as At, HintOnlyOffloadPolicy as B, InboxChannel as Bt, OAuthFlowStartResult as C, DefinedPollingTrigger as Ct, WorkflowEdgePortValidationResult as D, CollectionColumnBuilder as Dt, WorkflowEdgePortError as E, DefinedCollectionRegistry as Et, RunSummaryMapper as F, callableTool as Ft, NodeInstanceFactory as G, InboxOnDecisionArgs as Gt, InlineDrivingScheduler as H, InboxChannelResolverToken as Ht, InMemoryWorkflowExecutionRepository as I, DefineCredentialOptions as It, RunnableOutputBehaviorResolver as J, HitlResumeTokenSignerSeam as Jt, NodeExecutor as K, InboxOnTimeoutArgs as Kt, InMemoryRunDataFactory as L, defineCredential as Lt, WorkflowRepositoryWebhookTriggerMatcher as M, DefinedCollection as Mt, EngineCompositionDeps as N, c as Nt, PollingRunCycleArgs as O, CollectionDefinition as Ot, EngineFactory as P, defineCollection as Pt, DefaultExecutionContextFactory as Q, HitlWorkspaceIdToken as Qt, InMemoryBinaryStorage as R, DefinedNodeRegistry as Rt, OAuthFlowStartArgs as S, DefinePollingTriggerTestItemsContext as St, WorkflowEdgePortValidator as T, definePollingTrigger as Tt, ConfigDrivenOffloadPolicy as U, InboxDeliverArgs as Ut, DefaultDrivingScheduler as V, InboxChannelResolverSeam as Vt, StaticCostCatalog as W, InboxDelivery as Wt, InProcessRetryRunner as X, HitlTimeoutJobSchedulerSeam as Xt, ItemExprResolver as Y, HitlResumeTokenSignerToken as Yt, CatalogBackedCostTrackingTelemetryFactory as Z, HitlTimeoutJobSchedulerToken as Zt, CredentialMaterialRef as _, ConnectionInvocationEventPublisher as _t, TestSuiteRunResult as a, NodeEventPublisher as an, getPersistedRuntimeTypeMetadata as at, OAuthFlowCallbackArgs as b, DefinePollingTriggerPollContext as bt, IWorkspaceFileStorage as c, StackTraceCallSitePathResolver as ct, WorkspaceFileRegistrarToken as d, InjectableRuntimeDecoratorComposer as dt, HumanTaskStatus as en, AsyncSleeper as et, WorkspaceFileStorageToken as f, PersistedRuntimeTypeDecoratorOptions as ft, CredentialMaterialProvider as g, InMemoryRunEventBus as gt, CallerContext as h, EventPublishingWorkflowExecutionRepository as ht, TestSuiteOrchestratorEngine as i, SystemClock as in, chatModel as it, PollingTriggerStartArgs as j, DefineCollectionOptions as jt, PollingRunCycleResult as k, CollectionFieldDefinition as kt, WorkspaceFileMetadata as l, PersistedRuntimeTypeNameResolver as lt, ManagedCredentialMaterialWriteError as m, PersistedRuntimeTypeMetadata as mt, TestSuiteCaseOutcome as n, HumanTaskStoreToken as nn, DefaultExecutionBinaryService as nt, TestSuiteRunIdFactory as o, CredentialResolverFactory as on, node as ot, ManagedMaterialFetchError as p, PersistedRuntimeTypeKind as pt, NodeOutputNormalizer as q, LocalInboxChannelToken as qt, TestSuiteOrchestrator as r, Clock as rn, UnavailableBinaryStorage as rt, IWorkspaceFileRegistrar as s, AbortControllerFactory as sn, tool as st, RunTestSuiteArgs as t, HumanTaskStore as tn, ChildExecutionScopeFactory as tt, WorkspaceFileNotFoundError as u, PersistedRuntimeTypeMetadataStore as ut, IllegalMaterialSourceError as v, DefinePollingTriggerExecuteContext as vt, OAuthMaterial as w, DefinedPollingTriggerConfig as wt, OAuthFlowExecutor as x, DefinePollingTriggerPollResult as xt, MaterialBundle as y, DefinePollingTriggerOptions as yt, LocalOnlyScheduler as z, ControlPlaneInboxChannelToken as zt };
1333
+ //# sourceMappingURL=index-uPnD9EE6.d.ts.map