@codemation/core 0.11.1 → 0.12.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 (89) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{CostCatalogContract-DZgcUBE4.d.cts → CostCatalogContract-DD7fQ4FF.d.cts} +2 -2
  3. package/dist/{EngineRuntimeRegistration.types-Cggm5GVY.d.cts → EngineRuntimeRegistration.types-DTV5_7Jw.d.cts} +3 -3
  4. package/dist/{EngineRuntimeRegistration.types-BQbS9_gs.d.ts → EngineRuntimeRegistration.types-Dl92Hdoi.d.ts} +2 -2
  5. package/dist/InMemoryRunDataFactory-qMiYjhCK.d.cts +202 -0
  6. package/dist/{ItemsInputNormalizer-D-MH8MBs.js → ItemsInputNormalizer-BhuxvZh5.js} +2 -2
  7. package/dist/{ItemsInputNormalizer-D-MH8MBs.js.map → ItemsInputNormalizer-BhuxvZh5.js.map} +1 -1
  8. package/dist/{ItemsInputNormalizer-_Mfcd3YU.d.ts → ItemsInputNormalizer-C09a7iFP.d.ts} +2 -2
  9. package/dist/{ItemsInputNormalizer-C_dpn76M.d.cts → ItemsInputNormalizer-DLaD6rTl.d.cts} +3 -3
  10. package/dist/{ItemsInputNormalizer-CwdOhSAK.cjs → ItemsInputNormalizer-Div-fb6a.cjs} +2 -2
  11. package/dist/{ItemsInputNormalizer-CwdOhSAK.cjs.map → ItemsInputNormalizer-Div-fb6a.cjs.map} +1 -1
  12. package/dist/{RunIntentService-BVur7x9n.d.ts → RunIntentService-BOSGwmqn.d.ts} +18 -4
  13. package/dist/{RunIntentService-CEF-sFfI.d.cts → RunIntentService-CWMMrAP4.d.cts} +18 -4
  14. package/dist/{agentMcpTypes-ZiNbNsEi.d.cts → agentMcpTypes-DUmniLOY.d.cts} +183 -4
  15. package/dist/bootstrap/index.cjs +3 -3
  16. package/dist/bootstrap/index.d.cts +63 -7
  17. package/dist/bootstrap/index.d.ts +5 -5
  18. package/dist/bootstrap/index.js +3 -3
  19. package/dist/{bootstrap-D_Yyi0wL.js → bootstrap-CKTMMNmL.js} +173 -4
  20. package/dist/bootstrap-CKTMMNmL.js.map +1 -0
  21. package/dist/{bootstrap-BxuTFTLB.cjs → bootstrap-D460dCgS.cjs} +175 -4
  22. package/dist/bootstrap-D460dCgS.cjs.map +1 -0
  23. package/dist/browser.cjs +3 -2
  24. package/dist/browser.d.cts +4 -4
  25. package/dist/browser.d.ts +3 -3
  26. package/dist/browser.js +3 -3
  27. package/dist/contracts.d.cts +5 -5
  28. package/dist/contracts.d.ts +2 -2
  29. package/dist/{di-0Wop7z1y.js → di-DdsgWfVy.js} +31 -2
  30. package/dist/di-DdsgWfVy.js.map +1 -0
  31. package/dist/{di-BlEKdoZS.cjs → di-tO6R7VJV.cjs} +36 -1
  32. package/dist/di-tO6R7VJV.cjs.map +1 -0
  33. package/dist/{executionPersistenceContracts-BgZMRsTa.d.cts → executionPersistenceContracts-DenJJK2T.d.cts} +2 -2
  34. package/dist/{index-62Ba9f7D.d.ts → index-BZDhEQ6W.d.ts} +277 -101
  35. package/dist/{index-zWGtEhrf.d.ts → index-CSKKuK60.d.ts} +441 -5
  36. package/dist/index.cjs +71 -161
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +395 -97
  39. package/dist/index.d.ts +5 -5
  40. package/dist/index.js +56 -159
  41. package/dist/index.js.map +1 -1
  42. package/dist/{params-B5SENSzZ.d.cts → params-DqRvku2h.d.cts} +2 -2
  43. package/dist/{runtime-cxmUkk0l.js → runtime-BPZgnZ9G.js} +611 -16
  44. package/dist/runtime-BPZgnZ9G.js.map +1 -0
  45. package/dist/{runtime-DBzq5YBi.cjs → runtime-CyW9c9XM.cjs} +670 -15
  46. package/dist/runtime-CyW9c9XM.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/defineHumanApprovalNode.types.ts +379 -0
  53. package/src/authoring/index.ts +6 -0
  54. package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +29 -0
  55. package/src/contracts/CodemationTelemetryAttributeNames.ts +10 -0
  56. package/src/contracts/credentialTypes.ts +10 -0
  57. package/src/contracts/hitlSeamTypes.ts +34 -0
  58. package/src/contracts/humanTaskStoreTypes.ts +48 -0
  59. package/src/contracts/inboxChannelTypes.ts +58 -0
  60. package/src/contracts/index.ts +3 -0
  61. package/src/contracts/runTypes.ts +61 -3
  62. package/src/contracts/runtimeTypes.ts +112 -0
  63. package/src/credentials/CredentialMaterialProvider.types.ts +61 -0
  64. package/src/credentials/ManagedCredentialMaterialWriteError.ts +14 -0
  65. package/src/credentials/ManagedMaterialFetchError.ts +16 -0
  66. package/src/execution/ActivationEnqueueService.ts +16 -0
  67. package/src/execution/DefaultExecutionContextFactory.ts +11 -0
  68. package/src/execution/NodeExecutionSnapshotFactory.ts +7 -1
  69. package/src/execution/NodeExecutor.ts +60 -1
  70. package/src/execution/NodeExecutorFactory.ts +12 -2
  71. package/src/execution/NodeSuspensionHandler.ts +220 -0
  72. package/src/execution/PersistedRunStateTerminalBuilder.ts +5 -2
  73. package/src/execution/RunStateSemantics.ts +5 -0
  74. package/src/execution/RunSuspendedError.ts +21 -0
  75. package/src/index.ts +40 -0
  76. package/src/orchestration/Engine.ts +12 -2
  77. package/src/orchestration/EngineWaiters.ts +1 -1
  78. package/src/orchestration/NodeExecutionRequestHandlerService.ts +25 -2
  79. package/src/orchestration/RunContinuationService.ts +226 -2
  80. package/src/orchestration/TestSuiteOrchestrator.ts +5 -4
  81. package/src/runtime/RunIntentService.ts +3 -0
  82. package/src/workflow/dsl/ChainCursorResolver.ts +36 -0
  83. package/dist/InMemoryRunDataFactory-C7YItvHG.d.cts +0 -123
  84. package/dist/bootstrap-BxuTFTLB.cjs.map +0 -1
  85. package/dist/bootstrap-D_Yyi0wL.js.map +0 -1
  86. package/dist/di-0Wop7z1y.js.map +0 -1
  87. package/dist/di-BlEKdoZS.cjs.map +0 -1
  88. package/dist/runtime-DBzq5YBi.cjs.map +0 -1
  89. package/dist/runtime-cxmUkk0l.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,10 +1,10 @@
1
- import { $ as instancePerContainerCachingFactory, $n as NodeExecutor, $r as CostTrackingTelemetryAttributeNames, $t as TriggerNodeConfig, A as RunResult, Ai as OAuth2ProviderFromPublicConfig, An as BinaryStorageStatResult, Ar as ExecutionTelemetryFactory, At as NodeConfigBase, B as Container, Bn as LiveWorkflowRepository, Br as TelemetrySpanEventRecord, Bt as NodeOutputs, C as PinnedNodeOutputsByPort, Ci as CredentialSessionService, Cn as FixedRetryPolicySpec, Cr as WebhookInvocationMatch, Ct as JsonArray, D as RunExecutionOptions, Di as CredentialTypeId, Dn as BinaryBody, Dr as AllWorkflowsActiveWorkflowActivationPolicy, Dt as JsonValue, E as RunEventPublisherDeps, Ei as CredentialTypeDefinition, En as BinaryAttachmentCreateRequest, Er as WebhookTriggerRoutingDiagnostics, Et as JsonPrimitive, F as RunTestContext, Fi as NodeConnectionName, Fn as ExecutableTriggerNode, Fr as TelemetryAttributes, Ft as NodeIdRef, G as RegistrationOptions, Gn as NodeActivationRequestBase, Gr as NoOpExecutionTelemetryFactory, Gt as PersistedRunPolicySnapshot, H as Disposable, Hn as NodeActivationContinuation, Hr as CodemationTelemetryMetricNames, Ht as NodeSchedulerDecision, I as WebhookRunResult, Ii as NodeId, In as ExecutionBinaryService, Ir as TelemetryChildSpanStart, It as NodeInspectorSummaryRow, J as delay, Jn as NodeExecutionContext, Jr as NoOpTelemetrySpanScope, Jt as RunId, K as TypeToken, Kn as NodeActivationScheduler, Kr as NoOpExecutionTelemetry, Kt as RunDataFactory, L as WorkflowExecutionListingRepository, Li as OutputPortKey, Ln as ExecutionContext, Lr as TelemetryMetricRecord, Lt as NodeIterationId, M as RunStatus, Mi as PollingTriggerLogger, Mn as BinaryStorageWriteResult, Mr as TelemetryArtifactAttachment, Mt as NodeErrorHandler, N as RunStopCondition, Ni as PollingTriggerDedupWindow, Nn as EngineDeps, Nr as TelemetryArtifactReference, Nt as NodeErrorHandlerArgs, O as RunPruneCandidate, Oi as CredentialTypeRegistry, On as BinaryStorage, Or as WorkflowActivationPolicy, Ot as MutableRunData, P as RunSummary, Pi as InputPortKey, Pn as EngineHost, Pr as TelemetryAttributePrimitive, Pt as NodeErrorHandlerSpec, Q as instanceCachingFactory, Qn as NodeExecutionStatePublisher, Qr as CostTrackingTelemetry, Qt as RunnableNodeOutputJson, R as WorkflowExecutionPruneRepository, Ri as PersistedTokenId, Rn as ExecutionContextFactory, Rr as TelemetryScope, Rt as NodeKind, S as PersistedWorkflowTokenRegistryLike, Si as CredentialSessionFactoryArgs, Sn as ExponentialRetryPolicySpec, Sr as WebhookControlSignal, St as Items, T as RunCurrentState, Ti as CredentialType, Tn as RetryPolicySpec, Tr as WebhookTriggerResolution, Tt as JsonObject, U as InjectionToken, Un as NodeActivationReceipt, Ur as GenAiTelemetryAttributeNames, Ut as PairedItemRef, V as DependencyContainer, Vn as MultiInputNode, Vr as TelemetrySpanScope, Vt as NodeRef, W as Lifecycle, Wn as NodeActivationRequest, Wr as CodemationTelemetryAttributeNames, Wt as ParentExecutionRef, X as injectAll, Xn as NodeExecutionRequestHandler, Xr as CostTrackingComponent, Xt as RunnableNodeConfig, Y as inject, Yn as NodeExecutionRequest, Yr as NoOpTelemetryArtifactReference, Yt as RunIdFactory, Z as injectable, Zn as NodeExecutionScheduler, Zr as CostTrackingPriceQuote, Zt as RunnableNodeInputJson, _ as PersistedRunControlState, _i as CredentialMaterialSourceKind, _n as nodeRef, _r as WorkflowRunnerService, _t as BinaryPreviewKind, a as ConnectionInvocationId, ai as AnyCredentialType, an as WorkflowErrorHandler, ar as RunnableNodeExecuteArgs, at as EngineExecutionLimitsPolicy, b as PersistedWorkflowSnapshot, bi as CredentialRequirement, bn as triggerNodeOutputType, br as HttpMethod, bt as Item, c as EngineRunCounters, ci as CredentialBinding, cn as WorkflowGraphFactory, cr as TriggerNode, ct as RunEventBus, d as NodeExecutionSnapshot, di as CredentialHealth, dn as WorkflowPrunePolicySpec, dr as TriggerSetupStateFor, dt as TestSuiteRunStatus, ei as CostTrackingTelemetryFactory, en as TriggerNodeOutputJson, er as NodeResolver, et as predicateAwareClassFactory, f as NodeExecutionStatus, fi as CredentialHealthStatus, fn as WorkflowStoragePolicyDecisionArgs, fr as TriggerSetupStateRepository, ft as TestSuiteRunId, g as PersistedMutableRunState, gi as CredentialJsonRecord, gn as branchRef, gr as WorkflowRunnerResolver, gt as BinaryAttachment, h as PersistedMutableNodeState, hi as CredentialInstanceRecord, hn as WorkflowStoragePolicySpec, hr as WorkflowRepository, ht as ActivationIdFactory, i as ConnectionInvocationAppendArgs, ii as CollectionsContext, in as WorkflowErrorContext, ir as RunnableNode, j as RunStateResetRequest, ji as NoOpPollingTriggerLogger, jn as BinaryStorageWriteRequest, jr as NodeExecutionTelemetry, jt as NodeDefinition, k as RunQueueEntry, ki as CredentialUnboundError, kn as BinaryStorageReadResult, kr as ExecutionTelemetry, kt as NodeActivationId, l as ExecutionFrontierPlan, li as CredentialBindingKey, ln as WorkflowNodeConnection, lr as TriggerRuntimeDiagnostics, lt as RunEventSubscription, m as PendingNodeExecution, mi as CredentialInstanceId, mn as WorkflowStoragePolicyResolver, mr as WorkflowNodeInstanceFactory, mt as TestTriggerSetupContext, n as AgentMcpToolMap, ni as CostTrackingUsageRecord, nn as UpstreamRefPlaceholder, nr as PollingTriggerHandle, nt as singleton, o as ConnectionInvocationRecord, oi as CredentialAdvancedSectionPresentation, on as WorkflowErrorHandlerSpec, or as TestableTriggerNode, ot as EngineExecutionLimitsPolicyConfig, p as NodeInputsByPort, pi as CredentialHealthTester, pn as WorkflowStoragePolicyMode, pr as TriggerTestItemsContext, pt as TestTriggerNodeConfig, q as container, qn as NodeBinaryAttachmentService, qr as NoOpNodeExecutionTelemetry, qt as RunDataSnapshot, r as NeedsReconsentEvent, ri as CollectionStore, rn as WorkflowDefinition, rr as PreparedNodeActivationDispatch, rt as CoreTokens, s as CurrentStateExecutionRequest, si as CredentialAuthDefinition, sn as WorkflowGraph, sr as TriggerCleanupHandle, st as RunEvent, t as AgentMcpIntegration, ti as CostTrackingTelemetryMetricNames, tn as TriggerNodeSetupState, tr as PersistedTriggerSetupState, tt as registry, u as NodeExecutionError, ui as CredentialFieldSchema, un as WorkflowPolicyRuntimeDefaults, ur as TriggerSetupContext, ut as TestCaseRunStatus, v as PersistedRunSchedulingState, vi as CredentialOAuth2AuthDefinition, vn as runnableNodeInputType, vr as WorkflowSnapshotFactory, vt as Edge, w as RunCompletionNotifier, wi as CredentialSetupStatus, wn as NoneRetryPolicySpec, wr as WebhookTriggerMatcher, wt as JsonNonArray, x as PersistedWorkflowSnapshotNode, xi as CredentialSessionFactory, xn as triggerNodeSetupStateType, xr as TriggerInstanceId, xt as ItemBinary, y as PersistedRunState, yi as CredentialOAuth2ScopesFromPublicConfig, yn as runnableNodeOutputType, yr as WorkflowSnapshotResolver, yt as ExecutionMode, z as WorkflowExecutionRepository, zi as WorkflowId, zn as ItemNode, zr as TelemetrySpanEnd, zt as NodeOffloadPolicy } from "./agentMcpTypes-ZiNbNsEi.cjs";
2
- import { C as deriveAssertionPassed, S as DEFAULT_ASSERTION_PASS_THRESHOLD, T as AgentBindError, _ as WorkItemStatus, a as ExecutionPayloadPolicyFields, b as AssertionResult, c as PersistedExecutionInstanceRecord, d as PersistedRunWorkItemRecord, f as RunIterationDto, g as WorkItemId, h as SlotExecutionStateDto, i as ExecutionInstanceId, l as PersistedRunSlotProjectionRecord, m as RunSlotProjectionState, n as ConnectionInvocationKind, o as PayloadStorageKind, p as RunRevision, r as ExecutionInstanceDto, s as PersistedExecutionInstanceKind, t as BatchId, u as PersistedRunWorkItemKind, v as WorkflowDetailSelectionState, w as NoOpAgentMcpIntegration, x as AssertionResultProvenance, y as WorkflowRunDetailDto } from "./executionPersistenceContracts-BgZMRsTa.cjs";
3
- import { a as ItemExprArgs, c as ItemExprResolvedContext, d as resolveItemExprsForExecution, f as resolveItemExprsInUnknown, i as ItemExpr, l as isItemExpr, n as Param, o as ItemExprCallback, r as ParamDeep, s as ItemExprContext, t as Expr, u as itemExpr } from "./params-B5SENSzZ.cjs";
4
- import { n as CostCatalogEntry, t as CostCatalog } from "./CostCatalogContract-DZgcUBE4.cjs";
5
- import { $ as McpServerDeclaration, A as ChatModelFactory, B as ZodSchemaAny, C as AgentToolDefinition, D as ChatLanguageModel, E as AgentTurnLimitBehavior, F as NodeBackedToolOutputMapperArgs, G as CallableToolFactory, H as AgentMessageConfigNormalizer, I as StructuredOutputOptions, J as CallableToolExecuteHandler, K as CallableToolConfig, L as Tool, M as NodeBackedToolInputMapper, N as NodeBackedToolInputMapperArgs, O as ChatLanguageModelCallOptions, P as NodeBackedToolOutputMapper, Q as RunFinishedAtFactory, R as ToolConfig, S as AgentToolCallPlanner, T as AgentToolToken, U as AgentToolFactory, V as AgentConfigInspector, W as CallableToolKindToken, X as NodeIterationIdFactory, Y as NodeBackedToolConfig, Z as ConnectionNodeIdFactory, _ as AgentMessageTemplateContent, a as AgentConnectionNodeRole, b as AgentTool, c as AgentCanvasPresentation, d as AgentMessageBuildArgs, et as McpServerTransport, f as AgentMessageConfig, g as AgentMessageTemplate, h as AgentMessageRole, i as AgentConnectionNodeDescriptor, j as NodeBackedToolConfigOptions, k as ChatModelConfig, l as AgentGuardrailConfig, m as AgentMessageLine, n as AgentConnectionCredentialSource, o as McpServerResolver, p as AgentMessageDto, q as CallableToolConfigOptions, r as AgentConnectionNodeCollector, s as AgentAttachmentRole, t as ItemsInputNormalizer, u as AgentGuardrailDefaults, v as AgentModelInvocationOptions, w as AgentToolExecuteArgs, x as AgentToolCall, y as AgentNodeConfig, z as ToolExecuteArgs } from "./ItemsInputNormalizer-C_dpn76M.cjs";
6
- import { n as InMemoryLiveWorkflowRepository, t as RunIntentService } from "./RunIntentService-CEF-sFfI.cjs";
7
- import { a as ItemExprResolver, c as DefaultAsyncSleeper, d as UnavailableBinaryStorage, f as CredentialResolverFactory, i as RunnableOutputBehaviorResolver, n as InMemoryBinaryStorage, o as InProcessRetryRunner, r as RunnableOutputBehavior, s as DefaultExecutionContextFactory, t as InMemoryRunDataFactory, u as DefaultExecutionBinaryService } from "./InMemoryRunDataFactory-C7YItvHG.cjs";
1
+ import { $ as injectAll, $n as NodeActivationRequestBase, $r as GenAiTelemetryAttributeNames, $t as RunnableNodeConfig, A as RunHaltReason, Ai as CredentialRequirement, An as BinaryBody, Ar as HttpMethod, At as JsonValue, B as WorkflowExecutionListingRepository, Bi as OAuth2ProviderFromPublicConfig, Bn as ExecutionBinaryService, Br as ExecutionTelemetryFactory, Bt as NodeIterationId, C as PersistedWorkflowSnapshotNode, Ci as CredentialHealthTester, Cn as triggerNodeOutputType, Cr as TriggerTestItemsContext, Ct as Item, D as RunCurrentState, Di as CredentialMaterialSourceKind, Dn as NoneRetryPolicySpec, Dr as WorkflowRunnerService, Dt as JsonNonArray, E as RunCompletionNotifier, Ei as CredentialJsonRecord, En as FixedRetryPolicySpec, Er as WorkflowRunnerResolver, Et as JsonArray, F as RunStatus, Fi as CredentialType, Fn as BinaryStorageWriteResult, Fr as WebhookTriggerResolution, Ft as NodeErrorHandler, G as Disposable, Gi as NodeConnectionName, Gn as HumanTaskId, Gr as TelemetryAttributes, Gt as NodeSchedulerDecision, H as WorkflowExecutionRepository, Hi as PollingTriggerLogger, Hn as ExecutionContextFactory, Hr as TelemetryArtifactAttachment, Ht as NodeOffloadPolicy, I as RunStopCondition, Ii as CredentialTypeDefinition, In as Duration, Ir as WebhookTriggerRoutingDiagnostics, It as NodeErrorHandlerArgs, J as RegistrationOptions, Ji as PersistedTokenId, Jn as LiveWorkflowRepository, Jr as TelemetryScope, Jt as PersistedRunPolicySnapshot, K as InjectionToken, Ki as NodeId, Kn as HumanTaskSubject, Kr as TelemetryChildSpanStart, Kt as PairedItemRef, L as RunSummary, Li as CredentialTypeId, Ln as EngineDeps, Lr as AllWorkflowsActiveWorkflowActivationPolicy, Lt as NodeErrorHandlerSpec, M as RunQueueEntry, Mi as CredentialSessionFactoryArgs, Mn as BinaryStorageReadResult, Mr as WebhookControlSignal, Mt as NodeActivationId, N as RunResult, Ni as CredentialSessionService, Nn as BinaryStorageStatResult, Nr as WebhookInvocationMatch, Nt as NodeConfigBase, O as RunEventPublisherDeps, Oi as CredentialOAuth2AuthDefinition, On as RetryPolicySpec, Or as WorkflowSnapshotFactory, Ot as JsonObject, P as RunStateResetRequest, Pi as CredentialSetupStatus, Pn as BinaryStorageWriteRequest, Pr as WebhookTriggerMatcher, Pt as NodeDefinition, Q as inject, Qn as NodeActivationRequest, Qr as CodemationTelemetryMetricNames, Qt as RunIdFactory, R as RunTestContext, Ri as CredentialTypeRegistry, Rn as EngineHost, Rr as WorkflowActivationPolicy, Rt as NodeIdRef, S as PersistedWorkflowSnapshot, Si as CredentialHealthStatus, Sn as runnableNodeOutputType, Sr as TriggerSetupStateRepository, St as ExecutionMode, T as PinnedNodeOutputsByPort, Ti as CredentialInstanceRecord, Tn as ExponentialRetryPolicySpec, Tr as WorkflowRepository, Tt as Items, U as Container, Ui as PollingTriggerDedupWindow, Un as HumanTaskActor, Ur as TelemetryArtifactReference, Ut as NodeOutputs, V as WorkflowExecutionPruneRepository, Vi as NoOpPollingTriggerLogger, Vn as ExecutionContext, Vr as NodeExecutionTelemetry, Vt as NodeKind, W as DependencyContainer, Wi as InputPortKey, Wn as HumanTaskHandle, Wr as TelemetryAttributePrimitive, Wt as NodeRef, X as container, Xn as NodeActivationContinuation, Xr as TelemetrySpanEventRecord, Xt as RunDataSnapshot, Y as TypeToken, Yi as WorkflowId, Yn as MultiInputNode, Yr as TelemetrySpanEnd, Yt as RunDataFactory, Z as delay, Zn as NodeActivationReceipt, Zr as TelemetrySpanScope, Zt as RunId, _ as PersistedMutableRunState, _i as CredentialAuthDefinition, _n as WorkflowStoragePolicyResolver, _r as TriggerCleanupHandle, _t as TestTriggerSetupContext, a as ConnectionInvocationId, ai as NoOpTelemetryArtifactReference, an as UpstreamRefPlaceholder, ar as NodeExecutionScheduler, at as singleton, b as PersistedRunState, bi as CredentialFieldSchema, bn as nodeRef, br as TriggerSetupContext, bt as BinaryPreviewKind, c as EngineRunCounters, ci as CostTrackingTelemetry, cn as WorkflowErrorHandler, cr as NodeResolver, ct as EngineExecutionLimitsPolicy, d as NodeExecutionSnapshot, di as CostTrackingTelemetryMetricNames, dn as WorkflowGraphFactory, dr as PreparedNodeActivationDispatch, dt as RunEventBus, ei as CodemationTelemetryAttributeNames, en as RunnableNodeInputJson, er as NodeActivationScheduler, et as injectable, f as NodeExecutionStatus, fi as CostTrackingUsageRecord, fn as WorkflowNodeConnection, fr as ResumeContext, ft as RunEventSubscription, g as PersistedMutableNodeState, gi as CredentialAdvancedSectionPresentation, gn as WorkflowStoragePolicyMode, gr as TestableTriggerNode, gt as TestTriggerNodeConfig, h as PendingResumeEntry, hi as AnyCredentialType, hn as WorkflowStoragePolicyDecisionArgs, hr as SuspensionRequest, ht as TestSuiteRunId, i as ConnectionInvocationAppendArgs, ii as NoOpTelemetrySpanScope, in as TriggerNodeSetupState, ir as NodeExecutionRequestHandler, it as registry, j as RunPruneCandidate, ji as CredentialSessionFactory, jn as BinaryStorage, jr as TriggerInstanceId, jt as MutableRunData, k as RunExecutionOptions, ki as CredentialOAuth2ScopesFromPublicConfig, kn as BinaryAttachmentCreateRequest, kr as WorkflowSnapshotResolver, kt as JsonPrimitive, l as ExecutionFrontierPlan, li as CostTrackingTelemetryAttributeNames, ln as WorkflowErrorHandlerSpec, lr as PersistedTriggerSetupState, lt as EngineExecutionLimitsPolicyConfig, m as PendingNodeExecution, mi as CollectionsContext, mn as WorkflowPrunePolicySpec, mr as RunnableNodeExecuteArgs, mt as TestSuiteRunStatus, n as AgentMcpToolMap, ni as NoOpExecutionTelemetry, nn as TriggerNodeConfig, nr as NodeExecutionContext, nt as instancePerContainerCachingFactory, o as ConnectionInvocationRecord, oi as CostTrackingComponent, on as WorkflowDefinition, or as NodeExecutionStatePublisher, ot as CoreTokens, p as NodeInputsByPort, pi as CollectionStore, pn as WorkflowPolicyRuntimeDefaults, pr as RunnableNode, pt as TestCaseRunStatus, q as Lifecycle, qi as OutputPortKey, qn as ItemNode, qr as TelemetryMetricRecord, qt as ParentExecutionRef, r as NeedsReconsentEvent, ri as NoOpNodeExecutionTelemetry, rn as TriggerNodeOutputJson, rr as NodeExecutionRequest, rt as predicateAwareClassFactory, s as CurrentStateExecutionRequest, si as CostTrackingPriceQuote, sn as WorkflowErrorContext, sr as NodeExecutor, t as AgentMcpIntegration, ti as NoOpExecutionTelemetryFactory, tn as RunnableNodeOutputJson, tr as NodeBinaryAttachmentService, tt as instanceCachingFactory, u as NodeExecutionError, ui as CostTrackingTelemetryFactory, un as WorkflowGraph, ur as PollingTriggerHandle, ut as RunEvent, v as PersistedRunControlState, vi as CredentialBinding, vn as WorkflowStoragePolicySpec, vr as TriggerNode, vt as ActivationIdFactory, w as PersistedWorkflowTokenRegistryLike, wi as CredentialInstanceId, wn as triggerNodeSetupStateType, wr as WorkflowNodeInstanceFactory, wt as ItemBinary, x as PersistedSuspensionEntry, xi as CredentialHealth, xn as runnableNodeInputType, xr as TriggerSetupStateFor, xt as Edge, y as PersistedRunSchedulingState, yi as CredentialBindingKey, yn as branchRef, yr as TriggerRuntimeDiagnostics, yt as BinaryAttachment, z as WebhookRunResult, zi as CredentialUnboundError, zn as ExecutableTriggerNode, zr as ExecutionTelemetry, zt as NodeInspectorSummaryRow } from "./agentMcpTypes-DUmniLOY.cjs";
2
+ import { C as deriveAssertionPassed, S as DEFAULT_ASSERTION_PASS_THRESHOLD, T as AgentBindError, _ as WorkItemStatus, a as ExecutionPayloadPolicyFields, b as AssertionResult, c as PersistedExecutionInstanceRecord, d as PersistedRunWorkItemRecord, f as RunIterationDto, g as WorkItemId, h as SlotExecutionStateDto, i as ExecutionInstanceId, l as PersistedRunSlotProjectionRecord, m as RunSlotProjectionState, n as ConnectionInvocationKind, o as PayloadStorageKind, p as RunRevision, r as ExecutionInstanceDto, s as PersistedExecutionInstanceKind, t as BatchId, u as PersistedRunWorkItemKind, v as WorkflowDetailSelectionState, w as NoOpAgentMcpIntegration, x as AssertionResultProvenance, y as WorkflowRunDetailDto } from "./executionPersistenceContracts-DenJJK2T.cjs";
3
+ import { a as ItemExprArgs, c as ItemExprResolvedContext, d as resolveItemExprsForExecution, f as resolveItemExprsInUnknown, i as ItemExpr, l as isItemExpr, n as Param, o as ItemExprCallback, r as ParamDeep, s as ItemExprContext, t as Expr, u as itemExpr } from "./params-DqRvku2h.cjs";
4
+ import { n as CostCatalogEntry, t as CostCatalog } from "./CostCatalogContract-DD7fQ4FF.cjs";
5
+ import { $ as McpServerDeclaration, A as ChatModelFactory, B as ZodSchemaAny, C as AgentToolDefinition, D as ChatLanguageModel, E as AgentTurnLimitBehavior, F as NodeBackedToolOutputMapperArgs, G as CallableToolFactory, H as AgentMessageConfigNormalizer, I as StructuredOutputOptions, J as CallableToolExecuteHandler, K as CallableToolConfig, L as Tool, M as NodeBackedToolInputMapper, N as NodeBackedToolInputMapperArgs, O as ChatLanguageModelCallOptions, P as NodeBackedToolOutputMapper, Q as RunFinishedAtFactory, R as ToolConfig, S as AgentToolCallPlanner, T as AgentToolToken, U as AgentToolFactory, V as AgentConfigInspector, W as CallableToolKindToken, X as NodeIterationIdFactory, Y as NodeBackedToolConfig, Z as ConnectionNodeIdFactory, _ as AgentMessageTemplateContent, a as AgentConnectionNodeRole, b as AgentTool, c as AgentCanvasPresentation, d as AgentMessageBuildArgs, et as McpServerTransport, f as AgentMessageConfig, g as AgentMessageTemplate, h as AgentMessageRole, i as AgentConnectionNodeDescriptor, j as NodeBackedToolConfigOptions, k as ChatModelConfig, l as AgentGuardrailConfig, m as AgentMessageLine, n as AgentConnectionCredentialSource, o as McpServerResolver, p as AgentMessageDto, q as CallableToolConfigOptions, r as AgentConnectionNodeCollector, s as AgentAttachmentRole, t as ItemsInputNormalizer, u as AgentGuardrailDefaults, v as AgentModelInvocationOptions, w as AgentToolExecuteArgs, x as AgentToolCall, y as AgentNodeConfig, z as ToolExecuteArgs } from "./ItemsInputNormalizer-DLaD6rTl.cjs";
6
+ import { n as InMemoryLiveWorkflowRepository, t as RunIntentService } from "./RunIntentService-CWMMrAP4.cjs";
7
+ import { _ as HumanTaskRecord, a as ItemExprResolver, b as HumanTaskStoreToken, c as DefaultAsyncSleeper, d as UnavailableBinaryStorage, f as HitlResumeTokenSignerSeam, g as HitlWorkspaceIdToken, h as HitlTimeoutJobSchedulerToken, i as RunnableOutputBehaviorResolver, m as HitlTimeoutJobSchedulerSeam, n as InMemoryBinaryStorage, o as InProcessRetryRunner, p as HitlResumeTokenSignerToken, r as RunnableOutputBehavior, s as DefaultExecutionContextFactory, t as InMemoryRunDataFactory, u as DefaultExecutionBinaryService, v as HumanTaskStatus, x as CredentialResolverFactory, y as HumanTaskStore } from "./InMemoryRunDataFactory-qMiYjhCK.cjs";
8
8
  import { ZodType, z } from "zod";
9
9
 
10
10
  //#region src/contracts/emitPorts.d.ts
@@ -66,6 +66,244 @@ declare class NoOpCostTrackingTelemetryFactory implements CostTrackingTelemetryF
66
66
  }>): CostTrackingTelemetry;
67
67
  }
68
68
  //#endregion
69
+ //#region src/authoring/defineNode.types.d.ts
70
+ type MaybePromise$2<TValue> = TValue | Promise<TValue>;
71
+ type ResolvableCredentialType = AnyCredentialType | CredentialTypeId;
72
+ type SessionForCredentialType<TCredential extends ResolvableCredentialType> = TCredential extends AnyCredentialType ? Awaited<ReturnType<TCredential["createSession"]>> : unknown;
73
+ type DefinedNodeCredentialBinding = ResolvableCredentialType | Readonly<{
74
+ readonly type: ResolvableCredentialType | ReadonlyArray<ResolvableCredentialType>;
75
+ readonly label?: string;
76
+ readonly optional?: true;
77
+ readonly helpText?: string;
78
+ readonly helpUrl?: string;
79
+ }>;
80
+ type DefinedNodeCredentialBindings = Readonly<Record<string, DefinedNodeCredentialBinding>>;
81
+ type SessionForBinding<TBinding extends DefinedNodeCredentialBinding> = TBinding extends Readonly<{
82
+ type: infer TType;
83
+ }> ? TType extends ReadonlyArray<infer TEntry> ? SessionForCredentialType<TEntry & ResolvableCredentialType> : SessionForCredentialType<TType & ResolvableCredentialType> : SessionForCredentialType<TBinding & ResolvableCredentialType>;
84
+ type DefinedNodeCredentialAccessors<TBindings extends DefinedNodeCredentialBindings | undefined> = TBindings extends DefinedNodeCredentialBindings ? Readonly<{ [TKey in keyof TBindings]: () => Promise<SessionForBinding<TBindings[TKey]>> }> : Readonly<Record<string, never>>;
85
+ interface DefinedNodeRunContext<TConfig$1 extends CredentialJsonRecord, TBindings extends DefinedNodeCredentialBindings | undefined> {
86
+ readonly config: TConfig$1;
87
+ readonly credentials: DefinedNodeCredentialAccessors<TBindings>;
88
+ readonly execution: NodeExecutionContext<RunnableNodeConfig<TConfig$1, unknown>>;
89
+ }
90
+ /**
91
+ * Arguments for {@link defineNode} `execute` (engine `ctx` matches {@link RunnableNode.execute};
92
+ * the second callback parameter adds {@link DefinedNodeRunContext} for credential accessors).
93
+ */
94
+ type DefineNodeExecuteArgs<TConfig$1 extends CredentialJsonRecord, TInputJson> = Readonly<{
95
+ input: TInputJson;
96
+ item: Item;
97
+ itemIndex: number;
98
+ items: Items;
99
+ ctx: NodeExecutionContext<RunnableNodeConfig<TInputJson, unknown> & Readonly<{
100
+ config: TConfig$1;
101
+ }>>;
102
+ }>;
103
+ type DefinedNodeConfigInput<TConfigResolved extends CredentialJsonRecord, TItemJson> = ParamDeep<TConfigResolved, TItemJson>;
104
+ interface DefinedNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, _TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
105
+ readonly kind: "defined-node";
106
+ readonly key: TKey$1;
107
+ readonly title: string;
108
+ readonly description?: string;
109
+ create<TConfigItemJson = TInputJson>(config: DefinedNodeConfigInput<TConfig$1, TConfigItemJson>, name?: string, id?: string): RunnableNodeConfig<TInputJson, TOutputJson>;
110
+ register(context: {
111
+ registerNode<TValue>(token: TypeToken<TValue>, implementation?: TypeToken<TValue>): void;
112
+ }): void;
113
+ }
114
+ /**
115
+ * Plugin / DSL-friendly node: per-item `execute` with optional {@link RunnableNodeConfig.inputSchema}.
116
+ */
117
+ interface DefineNodeOptions<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
118
+ readonly key: TKey$1;
119
+ readonly title: string;
120
+ readonly description?: string;
121
+ /**
122
+ * Canvas icon for this node (same contract as `NodeConfigBase.icon` on runnable configs).
123
+ * The Next host resolves Lucide (`lucide:…`), built-in SVGs (`builtin:…`), Simple Icons (`si:…`), and image URLs (`https:`, `data:`, `/…`).
124
+ */
125
+ readonly icon?: string;
126
+ /** Default values / form hints for **static** node configuration (credentials, retry, IDs), not per-item payload. */
127
+ readonly input?: Readonly<Record<keyof TConfig$1 & string, unknown>>;
128
+ readonly configSchema?: z.ZodType<TConfig$1>;
129
+ readonly credentials?: TBindings;
130
+ /**
131
+ * Validates **`input`** (engine also accepts `inputSchema` on the node class).
132
+ */
133
+ readonly inputSchema?: ZodType<TInputJson>;
134
+ /** Preserve inbound `item.binary` when `execute` returns plain JSON or item-shaped results without `binary`. */
135
+ readonly keepBinaries?: boolean;
136
+ /**
137
+ * Static configuration summary surfaced in the workflow inspector — see
138
+ * {@link import("../contracts/workflowTypes").NodeConfigBase.inspectorSummary}.
139
+ *
140
+ * Receives the static config; returns 2–6 short label/value pairs (or `undefined` to skip).
141
+ */
142
+ readonly inspectorSummary?: (args: Readonly<{
143
+ config: TConfig$1;
144
+ }>) => ReadonlyArray<NodeInspectorSummaryRow> | undefined;
145
+ execute(args: DefineNodeExecuteArgs<TConfig$1, TInputJson>, context: DefinedNodeRunContext<TConfig$1, TBindings>): MaybePromise$2<TOutputJson>;
146
+ }
147
+ /**
148
+ * Batch-oriented defined node: `run` receives all item JSON once (last item in activation); emits one output per input row.
149
+ */
150
+ interface DefineBatchNodeOptions<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
151
+ readonly key: TKey$1;
152
+ readonly title: string;
153
+ readonly description?: string;
154
+ readonly icon?: string;
155
+ readonly input?: Readonly<Record<keyof TConfig$1 & string, unknown>>;
156
+ readonly configSchema?: z.ZodType<TConfig$1>;
157
+ readonly credentials?: TBindings;
158
+ readonly inspectorSummary?: (args: Readonly<{
159
+ config: TConfig$1;
160
+ }>) => ReadonlyArray<NodeInspectorSummaryRow> | undefined;
161
+ run(items: ReadonlyArray<TInputJson>, context: DefinedNodeRunContext<TConfig$1, TBindings>): MaybePromise$2<ReadonlyArray<TOutputJson>>;
162
+ }
163
+ declare function defineNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(options: DefineNodeOptions<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>): DefinedNode<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>;
164
+ declare function defineBatchNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(options: DefineBatchNodeOptions<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>): DefinedNode<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>;
165
+ //#endregion
166
+ //#region src/authoring/defineHumanApprovalNode.types.d.ts
167
+ /**
168
+ * Decision shape merged into `item.json` after a HITL approval task resolves.
169
+ *
170
+ * - `"approved"` / `"rejected"` — from a human decision (uses `approvedPredicate`).
171
+ * - `"timed-out"` — timeout fired with `onTimeout: "halt"`.
172
+ * - `"auto-accepted"` — timeout fired with `onTimeout: "auto-accept"`.
173
+ */
174
+ interface HumanApprovalDecisionResult {
175
+ readonly status: "approved" | "rejected" | "timed-out" | "auto-accepted";
176
+ /** Identity of the person who decided; absent for automated outcomes. */
177
+ readonly actor?: HumanTaskActor;
178
+ /** ISO 8601 timestamp of the decision. */
179
+ readonly decidedAt?: Date;
180
+ /** Optional free-text note from the reviewer. */
181
+ readonly note?: string;
182
+ /**
183
+ * Full raw decision payload (only present for `"approved"` / `"rejected"`).
184
+ * Shape is determined by the channel's `decisionSchema`.
185
+ */
186
+ readonly payload?: Record<string, unknown>;
187
+ }
188
+ /**
189
+ * Output item shape emitted by a `defineHumanApprovalNode`-based node.
190
+ * Original `item.json` fields are preserved and `decision` is merged in.
191
+ * If the input `item.json` already contained a `decision` key it is **overwritten**.
192
+ */
193
+ type HumanApprovalOutputJson<TInputJson extends Record<string, unknown>> = TInputJson & {
194
+ readonly decision: HumanApprovalDecisionResult;
195
+ };
196
+ /**
197
+ * Extends {@link DefinedNode} with the `humanApprovalToolBehavior` metadata marker.
198
+ * Story 10 reads this field when attaching the node as an agent tool.
199
+ */
200
+ interface DefinedHumanApprovalNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson extends Record<string, unknown>, TBindings extends DefinedNodeCredentialBindings | undefined = undefined> extends DefinedNode<TKey$1, TConfig$1, TInputJson, HumanApprovalOutputJson<TInputJson>, TBindings> {
201
+ /**
202
+ * Behavior hint consumed by the agent runtime (story 10) when this node is attached as a tool.
203
+ * `"return"` (default) — return the rejection to the agent as a tool result.
204
+ * `"halt"` — halt the agent run on rejection.
205
+ *
206
+ * Standalone DSL usage ignores this field.
207
+ */
208
+ readonly humanApprovalToolBehavior: {
209
+ onRejected: "return" | "halt";
210
+ };
211
+ }
212
+ /**
213
+ * Returns `true` when `node` was created by {@link defineHumanApprovalNode}.
214
+ * Uses the `humanApprovalToolBehavior` typed field as the discriminant.
215
+ */
216
+ declare function isHumanApprovalNode(node: unknown): node is DefinedHumanApprovalNode<string, Record<string, unknown>, Record<string, unknown>, undefined>;
217
+ /**
218
+ * Authoring helper that compiles a HITL approval channel down to a regular
219
+ * {@link defineNode}-backed node with `SuspensionRequest` semantics.
220
+ *
221
+ * **Fast-forward decision semantics:**
222
+ * - On the first `execute` call (no `ctx.resumeContext`): throws a `SuspensionRequest`
223
+ * that calls the author's `deliver`. The engine persists the suspension and continues.
224
+ * - On resume (`ctx.resumeContext` set): calls `onDecision`/`onTimeout` as appropriate,
225
+ * merges a `decision` key into `item.json`, and returns an item with the original
226
+ * `binary` map passed by reference (no copy).
227
+ *
228
+ * **Output shape per item:**
229
+ * ```ts
230
+ * // Input: { json: { invoiceId: 42 }, binary?: {...} }
231
+ * // Output: { json: { invoiceId: 42, decision: { status: "approved", actor, decidedAt } }, binary: <unchanged> }
232
+ * ```
233
+ * If `item.json` already has a `decision` key it is **overwritten**. Namespace as
234
+ * needed if your schema reserves that key for another purpose.
235
+ *
236
+ * **Predicate persistence:**
237
+ * The `approvedPredicate` function is NOT serialized to the suspension record (except
238
+ * as an audit-only string via `toString()`). On resume, the workflow definition is
239
+ * reloaded from code at process start and the predicate closure is rebuilt naturally.
240
+ * If a deploy ships a changed predicate between suspend and resume, the *new* predicate
241
+ * runs — document this in your runbook when the predicate carries business logic that
242
+ * may change across deploys.
243
+ *
244
+ * @example
245
+ * ```ts
246
+ * export const slackApprovalNode = defineHumanApprovalNode({
247
+ * key: "my-plugin.slackApproval",
248
+ * title: "Slack Approval",
249
+ * channel: "slack",
250
+ * configSchema: z.object({ channel: z.string(), message: z.string() }),
251
+ * decisionSchema: z.object({ approved: z.boolean(), note: z.string().optional() }),
252
+ *
253
+ * async deliver({ task, config, item }, ctx) {
254
+ * const ts = await postSlackMessage(config.channel, `Approve? <${task.resumeUrl}>`);
255
+ * return { channel: config.channel, ts };
256
+ * },
257
+ *
258
+ * async onDecision({ decision, actor, delivery }, ctx) {
259
+ * await updateSlackMessage(delivery.channel, delivery.ts, decision.approved ? "✅" : "❌");
260
+ * },
261
+ * });
262
+ * ```
263
+ */
264
+ declare function defineHumanApprovalNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson extends Record<string, unknown>, TDecision extends Record<string, unknown>, TDelivery extends JsonValue, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(opts: {
265
+ key: TKey$1;
266
+ title: string;
267
+ description?: string;
268
+ icon?: string;
269
+ channel: string;
270
+ configSchema: ZodType<TConfig$1>;
271
+ inputSchema?: ZodType<TInputJson>;
272
+ decisionSchema: ZodType<TDecision>;
273
+ credentials?: TBindings;
274
+ /**
275
+ * Custom predicate that decides whether a decision counts as "approved".
276
+ * When omitted, the helper checks if `decisionSchema` is a Zod object with an
277
+ * `approved: boolean` field; if so it uses `decision.approved === true`.
278
+ * If neither holds, `defineHumanApprovalNode` throws at **definition time** (not runtime).
279
+ */
280
+ approvedPredicate?: (decision: TDecision) => boolean;
281
+ /** Default suspension timeout. Defaults to `"24h"`. */
282
+ defaultTimeout?: Duration;
283
+ /** What to do when the task times out. Defaults to `"halt"`. */
284
+ defaultOnTimeout?: "halt" | "auto-accept";
285
+ inspectorSummary?: (config: TConfig$1) => ReadonlyArray<NodeInspectorSummaryRow> | undefined;
286
+ deliver: (args: {
287
+ task: HumanTaskHandle;
288
+ config: TConfig$1;
289
+ input: TInputJson;
290
+ item: Item;
291
+ }, ctx: ExecutionContext) => Promise<TDelivery>;
292
+ onDecision?: (args: {
293
+ decision: TDecision;
294
+ actor: HumanTaskActor;
295
+ task: HumanTaskHandle;
296
+ delivery: TDelivery;
297
+ item: Item;
298
+ }, ctx: ExecutionContext) => Promise<void>;
299
+ onTimeout?: (args: {
300
+ task: HumanTaskHandle;
301
+ delivery: TDelivery;
302
+ item: Item;
303
+ policy: "halt" | "auto-accept";
304
+ }, ctx: ExecutionContext) => Promise<void>;
305
+ }): DefinedHumanApprovalNode<TKey$1, TConfig$1, TInputJson, TBindings>;
306
+ //#endregion
69
307
  //#region src/workflow/dsl/workflowBuilderTypes.d.ts
70
308
  type AnyRunnableNodeConfig = RunnableNodeConfig<any, any>;
71
309
  type AnyTriggerNodeConfig = TriggerNodeConfig<any>;
@@ -111,6 +349,25 @@ declare class ChainCursor<TCurrentJson> {
111
349
  thenIntoInputHints<TOutputJson, TConfig$1 extends RunnableNodeConfig<any, TOutputJson>>(config: TConfig$1): ChainCursor<RunnableNodeOutputJson<TConfig$1>>;
112
350
  readonly when: ChainCursorWhenOverloads<TCurrentJson>;
113
351
  route<TNextJson$1>(branches: Readonly<Record<OutputPortKey, (branch: ChainCursor<TCurrentJson>) => ChainCursor<TNextJson$1> | undefined>>): ChainCursor<TNextJson$1>;
352
+ /**
353
+ * Chainable shorthand for `.then(node.create(config, metadata?.name, metadata?.nodeId))`.
354
+ *
355
+ * Signals to readers that this step suspends the run and waits for a human decision.
356
+ * Throws at workflow-build time if `node` was not created via `defineHumanApprovalNode`.
357
+ *
358
+ * @example
359
+ * ```ts
360
+ * workflow
361
+ * .trigger(...)
362
+ * .humanApproval(inboxApproval, { title: "Approve?", body: "...", priority: "normal" })
363
+ * .then(nextStep.create(...))
364
+ * .build();
365
+ * ```
366
+ */
367
+ humanApproval<TKey$1 extends string, TConfig$1 extends Record<string, unknown>, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(node: DefinedHumanApprovalNode<TKey$1, TConfig$1, TCurrentJson & Record<string, unknown>, TBindings>, config: TConfig$1, metadata?: {
368
+ name?: string;
369
+ nodeId?: string;
370
+ }): ChainCursor<HumanApprovalOutputJson<TCurrentJson & Record<string, unknown>>>;
114
371
  build(): WorkflowDefinition;
115
372
  private resolveSharedInputPortHint;
116
373
  }
@@ -220,102 +477,58 @@ declare class SystemClock implements Clock {
220
477
  now(): Date;
221
478
  }
222
479
  //#endregion
223
- //#region src/authoring/defineNode.types.d.ts
224
- type MaybePromise$2<TValue> = TValue | Promise<TValue>;
225
- type ResolvableCredentialType = AnyCredentialType | CredentialTypeId;
226
- type SessionForCredentialType<TCredential extends ResolvableCredentialType> = TCredential extends AnyCredentialType ? Awaited<ReturnType<TCredential["createSession"]>> : unknown;
227
- type DefinedNodeCredentialBinding = ResolvableCredentialType | Readonly<{
228
- readonly type: ResolvableCredentialType | ReadonlyArray<ResolvableCredentialType>;
229
- readonly label?: string;
230
- readonly optional?: true;
231
- readonly helpText?: string;
232
- readonly helpUrl?: string;
233
- }>;
234
- type DefinedNodeCredentialBindings = Readonly<Record<string, DefinedNodeCredentialBinding>>;
235
- type SessionForBinding<TBinding extends DefinedNodeCredentialBinding> = TBinding extends Readonly<{
236
- type: infer TType;
237
- }> ? TType extends ReadonlyArray<infer TEntry> ? SessionForCredentialType<TEntry & ResolvableCredentialType> : SessionForCredentialType<TType & ResolvableCredentialType> : SessionForCredentialType<TBinding & ResolvableCredentialType>;
238
- type DefinedNodeCredentialAccessors<TBindings extends DefinedNodeCredentialBindings | undefined> = TBindings extends DefinedNodeCredentialBindings ? Readonly<{ [TKey in keyof TBindings]: () => Promise<SessionForBinding<TBindings[TKey]>> }> : Readonly<Record<string, never>>;
239
- interface DefinedNodeRunContext<TConfig$1 extends CredentialJsonRecord, TBindings extends DefinedNodeCredentialBindings | undefined> {
240
- readonly config: TConfig$1;
241
- readonly credentials: DefinedNodeCredentialAccessors<TBindings>;
242
- readonly execution: NodeExecutionContext<RunnableNodeConfig<TConfig$1, unknown>>;
243
- }
480
+ //#region src/contracts/inboxChannelTypes.d.ts
244
481
  /**
245
- * Arguments for {@link defineNode} `execute` (engine `ctx` matches {@link RunnableNode.execute};
246
- * the second callback parameter adds {@link DefinedNodeRunContext} for credential accessors).
482
+ * A single inbox delivery channel.
483
+ * Implementations: `LocalInboxChannel`, `ControlPlaneInboxChannel`.
247
484
  */
248
- type DefineNodeExecuteArgs<TConfig$1 extends CredentialJsonRecord, TInputJson> = Readonly<{
249
- input: TInputJson;
485
+ interface InboxChannel {
486
+ readonly kind: "local" | "control-plane-inbox";
487
+ deliver(args: InboxDeliverArgs): Promise<InboxDelivery>;
488
+ updateOnDecision?(args: InboxOnDecisionArgs): Promise<void>;
489
+ updateOnTimeout?(args: InboxOnTimeoutArgs): Promise<void>;
490
+ }
491
+ type InboxDeliverArgs = Readonly<{
492
+ task: HumanTaskHandle;
493
+ subject: HumanTaskSubject;
494
+ priority: "low" | "normal" | "high";
250
495
  item: Item;
251
- itemIndex: number;
252
- items: Items;
253
- ctx: NodeExecutionContext<RunnableNodeConfig<TInputJson, unknown> & Readonly<{
254
- config: TConfig$1;
255
- }>>;
496
+ /** Present in managed mode (from `PairingConfig.workspaceId`). */
497
+ workspaceId?: string;
498
+ }>;
499
+ type InboxDelivery = {
500
+ kind: "local";
501
+ inboxItemId: string;
502
+ } | {
503
+ kind: "cp";
504
+ inboxItemId: string;
505
+ workspaceId: string;
506
+ };
507
+ type InboxOnDecisionArgs = Readonly<{
508
+ delivery: InboxDelivery;
509
+ decision: {
510
+ approved: boolean;
511
+ note?: string;
512
+ };
513
+ actor: HumanTaskActor;
514
+ }>;
515
+ type InboxOnTimeoutArgs = Readonly<{
516
+ delivery: InboxDelivery;
517
+ policy: "halt" | "auto-accept";
256
518
  }>;
257
- type DefinedNodeConfigInput<TConfigResolved extends CredentialJsonRecord, TItemJson> = ParamDeep<TConfigResolved, TItemJson>;
258
- interface DefinedNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, _TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
259
- readonly kind: "defined-node";
260
- readonly key: TKey$1;
261
- readonly title: string;
262
- readonly description?: string;
263
- create<TConfigItemJson = TInputJson>(config: DefinedNodeConfigInput<TConfig$1, TConfigItemJson>, name?: string, id?: string): RunnableNodeConfig<TInputJson, TOutputJson>;
264
- register(context: {
265
- registerNode<TValue>(token: TypeToken<TValue>, implementation?: TypeToken<TValue>): void;
266
- }): void;
267
- }
268
- /**
269
- * Plugin / DSL-friendly node: per-item `execute` with optional {@link RunnableNodeConfig.inputSchema}.
270
- */
271
- interface DefineNodeOptions<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
272
- readonly key: TKey$1;
273
- readonly title: string;
274
- readonly description?: string;
275
- /**
276
- * Canvas icon for this node (same contract as `NodeConfigBase.icon` on runnable configs).
277
- * The Next host resolves Lucide (`lucide:…`), built-in SVGs (`builtin:…`), Simple Icons (`si:…`), and image URLs (`https:`, `data:`, `/…`).
278
- */
279
- readonly icon?: string;
280
- /** Default values / form hints for **static** node configuration (credentials, retry, IDs), not per-item payload. */
281
- readonly input?: Readonly<Record<keyof TConfig$1 & string, unknown>>;
282
- readonly configSchema?: z.ZodType<TConfig$1>;
283
- readonly credentials?: TBindings;
284
- /**
285
- * Validates **`input`** (engine also accepts `inputSchema` on the node class).
286
- */
287
- readonly inputSchema?: ZodType<TInputJson>;
288
- /** Preserve inbound `item.binary` when `execute` returns plain JSON or item-shaped results without `binary`. */
289
- readonly keepBinaries?: boolean;
290
- /**
291
- * Static configuration summary surfaced in the workflow inspector — see
292
- * {@link import("../contracts/workflowTypes").NodeConfigBase.inspectorSummary}.
293
- *
294
- * Receives the static config; returns 2–6 short label/value pairs (or `undefined` to skip).
295
- */
296
- readonly inspectorSummary?: (args: Readonly<{
297
- config: TConfig$1;
298
- }>) => ReadonlyArray<NodeInspectorSummaryRow> | undefined;
299
- execute(args: DefineNodeExecuteArgs<TConfig$1, TInputJson>, context: DefinedNodeRunContext<TConfig$1, TBindings>): MaybePromise$2<TOutputJson>;
300
- }
301
519
  /**
302
- * Batch-oriented defined node: `run` receives all item JSON once (last item in activation); emits one output per input row.
520
+ * Resolves the correct `InboxChannel` for the current deployment mode
521
+ * (local dev vs. managed/CP). Implemented in `@codemation/host`.
303
522
  */
304
- interface DefineBatchNodeOptions<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
305
- readonly key: TKey$1;
306
- readonly title: string;
307
- readonly description?: string;
308
- readonly icon?: string;
309
- readonly input?: Readonly<Record<keyof TConfig$1 & string, unknown>>;
310
- readonly configSchema?: z.ZodType<TConfig$1>;
311
- readonly credentials?: TBindings;
312
- readonly inspectorSummary?: (args: Readonly<{
313
- config: TConfig$1;
314
- }>) => ReadonlyArray<NodeInspectorSummaryRow> | undefined;
315
- run(items: ReadonlyArray<TInputJson>, context: DefinedNodeRunContext<TConfig$1, TBindings>): MaybePromise$2<ReadonlyArray<TOutputJson>>;
523
+ interface InboxChannelResolverSeam {
524
+ resolve(): {
525
+ channel: InboxChannel;
526
+ workspaceId?: string;
527
+ };
316
528
  }
317
- declare function defineNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(options: DefineNodeOptions<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>): DefinedNode<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>;
318
- declare function defineBatchNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(options: DefineBatchNodeOptions<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>): DefinedNode<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>;
529
+ declare const InboxChannelResolverToken: TypeToken<InboxChannelResolverSeam | undefined>;
530
+ declare const LocalInboxChannelToken: TypeToken<InboxChannel | undefined>;
531
+ declare const ControlPlaneInboxChannelToken: TypeToken<InboxChannel | undefined>;
319
532
  //#endregion
320
533
  //#region src/authoring/DefinedNodeRegistry.d.ts
321
534
  declare class DefinedNodeRegistry {
@@ -835,5 +1048,90 @@ interface OAuthFlowExecutor {
835
1048
  }): Promise<OAuthMaterial>;
836
1049
  }
837
1050
  //#endregion
838
- export { ActivationIdFactory, AgentAttachmentRole, AgentBindError, AgentCanvasPresentation, AgentConfigInspector, type AgentConnectionCredentialSource, AgentConnectionNodeCollector, type AgentConnectionNodeDescriptor, type AgentConnectionNodeRole, AgentGuardrailConfig, AgentGuardrailDefaults, AgentMcpIntegration, AgentMcpToolMap, AgentMessageBuildArgs, AgentMessageConfig, AgentMessageConfigNormalizer, AgentMessageDto, AgentMessageLine, AgentMessageRole, AgentMessageTemplate, AgentMessageTemplateContent, AgentModelInvocationOptions, AgentNodeConfig, AgentTool, AgentToolCall, AgentToolCallPlanner, AgentToolDefinition, AgentToolExecuteArgs, AgentToolFactory, AgentToolToken, AgentTurnLimitBehavior, AllWorkflowsActiveWorkflowActivationPolicy, AnyCredentialType, AnyRunnableNodeConfig, AnyTriggerNodeConfig, AssertionResult, AssertionResultProvenance, BatchId, BinaryAttachment, BinaryAttachmentCreateRequest, BinaryBody, BinaryPreviewKind, BinaryStorage, BinaryStorageReadResult, BinaryStorageStatResult, BinaryStorageWriteRequest, BinaryStorageWriteResult, BooleanWhenOverloads, BranchMoreArgs, BranchOutputGuard, BranchStepsArg, CallableToolConfig, CallableToolConfigOptions, CallableToolExecuteHandler, CallableToolFactory, CallableToolKindToken, ChainCursor, ChatLanguageModel, ChatLanguageModelCallOptions, ChatModelConfig, ChatModelFactory, ChildExecutionScopeFactory, type Clock, CodemationTelemetryAttributeNames, CodemationTelemetryMetricNames, CollectionColumnBuilder, CollectionDefinition, CollectionFieldDefinition, CollectionIndexDefinition, CollectionStore, CollectionsContext, ConnectionInvocationAppendArgs, ConnectionInvocationEventPublisher, ConnectionInvocationId, ConnectionInvocationIdFactory, ConnectionInvocationKind, ConnectionInvocationRecord, ConnectionNodeIdFactory, Container, CoreTokens, CostCatalog, CostCatalogEntry, CostTrackingComponent, CostTrackingPriceQuote, CostTrackingTelemetry, CostTrackingTelemetryAttributeNames, CostTrackingTelemetryFactory, CostTrackingTelemetryMetricNames, CostTrackingUsageRecord, CredentialAdvancedSectionPresentation, CredentialAuthDefinition, CredentialBinding, CredentialBindingKey, CredentialFieldSchema, CredentialHealth, CredentialHealthStatus, CredentialHealthTester, CredentialInstanceId, CredentialInstanceRecord, CredentialJsonRecord, CredentialMaterialSourceKind, CredentialOAuth2AuthDefinition, CredentialOAuth2ScopesFromPublicConfig, CredentialRequirement, CredentialResolverFactory, CredentialSessionFactory, CredentialSessionFactoryArgs, CredentialSessionService, CredentialSetupStatus, CredentialType, CredentialTypeDefinition, CredentialTypeId, CredentialTypeRegistry, CredentialUnboundError, CurrentStateExecutionRequest, DEFAULT_ASSERTION_PASS_THRESHOLD, DefaultAsyncSleeper, DefaultExecutionBinaryService, DefaultExecutionContextFactory, DefaultWorkflowGraphFactory, DefineBatchNodeOptions, DefineCollectionOptions, DefineCredentialOptions, DefineNodeExecuteArgs, DefineNodeOptions, DefinePollingTriggerExecuteContext, DefinePollingTriggerOptions, DefinePollingTriggerPollContext, DefinePollingTriggerPollResult, DefinePollingTriggerTestItemsContext, DefinedCollection, DefinedCollectionRegistry, DefinedNode, DefinedNodeConfigInput, DefinedNodeCredentialAccessors, DefinedNodeCredentialBinding, DefinedNodeCredentialBindings, DefinedNodeRegistry, DefinedNodeRunContext, DefinedPollingTrigger, DefinedPollingTriggerConfig, DependencyContainer, Disposable, Edge, EngineDeps, EngineExecutionLimitsPolicy, type EngineExecutionLimitsPolicyConfig, EngineHost, EngineRunCounters, EventPublishingWorkflowExecutionRepository, ExecutableTriggerNode, ExecutionBinaryService, ExecutionContext, ExecutionContextFactory, ExecutionFrontierPlan, ExecutionInstanceDto, ExecutionInstanceId, ExecutionMode, ExecutionPayloadPolicyFields, ExecutionTelemetry, ExecutionTelemetryFactory, ExpRetryPolicy, ExponentialRetryPolicySpec, Expr, FixedRetryPolicySpec, GenAiTelemetryAttributeNames, HttpMethod, InMemoryBinaryStorage, InMemoryLiveWorkflowRepository, InMemoryRunDataFactory, InMemoryRunEventBus, InProcessRetryRunner, InjectableRuntimeDecoratorComposer, InjectionToken, InputPortKey, Item, ItemBinary, ItemExpr, ItemExprArgs, ItemExprCallback, ItemExprContext, ItemExprResolvedContext, ItemExprResolver, ItemNode, Items, ItemsInputNormalizer, JsonArray, JsonNonArray, JsonObject, JsonPrimitive, JsonValue, Lifecycle, LiveWorkflowRepository, McpServerDeclaration, type McpServerResolver, McpServerTransport, MultiInputNode, MutableRunData, NeedsReconsentEvent, NoOpAgentMcpIntegration, NoOpCostTrackingTelemetry, NoOpCostTrackingTelemetryFactory, NoOpExecutionTelemetry, NoOpExecutionTelemetryFactory, NoOpNodeExecutionTelemetry, NoOpPollingTriggerLogger, NoOpTelemetryArtifactReference, NoOpTelemetrySpanScope, NoRetryPolicy, NodeActivationContinuation, NodeActivationId, NodeActivationReceipt, NodeActivationRequest, NodeActivationRequestBase, NodeActivationScheduler, NodeBackedToolConfig, NodeBackedToolConfigOptions, NodeBackedToolInputMapper, NodeBackedToolInputMapperArgs, NodeBackedToolOutputMapper, NodeBackedToolOutputMapperArgs, NodeBinaryAttachmentService, NodeConfigBase, NodeConnectionName, NodeDefinition, NodeErrorHandler, NodeErrorHandlerArgs, NodeErrorHandlerSpec, NodeEventPublisher, NodeExecutionContext, NodeExecutionError, NodeExecutionRequest, NodeExecutionRequestHandler, NodeExecutionScheduler, NodeExecutionSnapshot, NodeExecutionStatePublisher, NodeExecutionStatus, NodeExecutionTelemetry, NodeExecutor, NodeId, NodeIdRef, NodeIdSlugifier, NodeInputsByPort, NodeInspectorSummaryRow, NodeIterationId, NodeIterationIdFactory, NodeKind, NodeOffloadPolicy, NodeOutputNormalizer, NodeOutputs, NodeRef, NodeResolver, NodeSchedulerDecision, NoneRetryPolicySpec, OAuth2ProviderFromPublicConfig, type OAuthFlowCallbackArgs, type OAuthFlowExecutor, type OAuthFlowStartArgs, type OAuthFlowStartResult, type OAuthMaterial, OutputPortKey, PairedItemRef, Param, ParamDeep, ParentExecutionRef, PayloadStorageKind, PendingNodeExecution, PersistedExecutionInstanceKind, PersistedExecutionInstanceRecord, PersistedMutableNodeState, PersistedMutableRunState, PersistedRunControlState, PersistedRunPolicySnapshot, PersistedRunSchedulingState, PersistedRunSlotProjectionRecord, PersistedRunState, PersistedRunWorkItemKind, PersistedRunWorkItemRecord, type PersistedRuntimeTypeDecoratorOptions, type PersistedRuntimeTypeKind, type PersistedRuntimeTypeMetadata, PersistedRuntimeTypeMetadataStore, PersistedRuntimeTypeNameResolver, PersistedTokenId, PersistedTriggerSetupState, PersistedWorkflowSnapshot, PersistedWorkflowSnapshotNode, PersistedWorkflowTokenRegistryLike, PinnedNodeOutputsByPort, type PollingRunCycleArgs, type PollingRunCycleResult, PollingTriggerDedupWindow, PollingTriggerHandle, type PollingTriggerLogger, PollingTriggerRuntime, type PollingTriggerStartArgs, PortsEmission, PreparedNodeActivationDispatch, RegistrationOptions, RetryPolicy, RetryPolicySpec, RunCompletionNotifier, RunCurrentState, RunDataFactory, RunDataSnapshot, RunEvent, RunEventBus, RunEventPublisherDeps, RunEventSubscription, RunExecutionOptions, RunFinishedAtFactory, RunId, RunIdFactory, RunIntentService, RunIterationDto, RunPruneCandidate, RunQueueEntry, RunResult, RunRevision, RunSlotProjectionState, RunStateResetRequest, RunStatus, RunStopCondition, RunSummary, RunTestContext, RunnableNode, RunnableNodeConfig, RunnableNodeExecuteArgs, RunnableNodeInputJson, RunnableNodeOutputJson, RunnableOutputBehaviorResolver, SlotExecutionStateDto, StackTraceCallSitePathResolver, StepSequenceOutput, StructuredOutputOptions, SystemClock, TelemetryArtifactAttachment, TelemetryArtifactReference, TelemetryAttributePrimitive, TelemetryAttributes, TelemetryChildSpanStart, TelemetryMetricRecord, TelemetryScope, TelemetrySpanEnd, TelemetrySpanEventRecord, TelemetrySpanScope, TestCaseRunStatus, TestSuiteRunId, TestSuiteRunStatus, TestTriggerNodeConfig, TestTriggerSetupContext, TestableTriggerNode, Tool, ToolConfig, ToolExecuteArgs, TriggerCleanupHandle, TriggerInstanceId, TriggerNode, TriggerNodeConfig, TriggerNodeOutputJson, TriggerNodeSetupState, TriggerRuntimeDiagnostics, TriggerSetupContext, TriggerSetupStateFor, TriggerSetupStateRepository, TriggerTestItemsContext, TypeToken, UnavailableBinaryStorage, UpstreamRefPlaceholder, ValidStepSequence, WebhookControlSignal, WebhookInvocationMatch, WebhookRunResult, WebhookTriggerMatcher, WebhookTriggerResolution, WebhookTriggerRoutingDiagnostics, WhenBuilder, WorkItemId, WorkItemStatus, WorkflowActivationPolicy, WorkflowBuilder, WorkflowDefinition, WorkflowDefinitionError, WorkflowDetailSelectionState, type WorkflowEdgePortError, type WorkflowEdgePortValidationResult, WorkflowEdgePortValidator, WorkflowErrorContext, WorkflowErrorHandler, WorkflowErrorHandlerSpec, WorkflowExecutableNodeClassifier, WorkflowExecutableNodeClassifierFactory, WorkflowExecutionListingRepository, WorkflowExecutionPruneRepository, WorkflowExecutionRepository, WorkflowGraph, WorkflowGraphFactory, WorkflowId, WorkflowNodeConnection, WorkflowNodeInstanceFactory, WorkflowPolicyRuntimeDefaults, WorkflowPrunePolicySpec, WorkflowRepository, WorkflowRunDetailDto, WorkflowRunnerResolver, WorkflowRunnerService, WorkflowSnapshotFactory, WorkflowSnapshotResolver, WorkflowStoragePolicyDecisionArgs, WorkflowStoragePolicyMode, WorkflowStoragePolicyResolver, WorkflowStoragePolicySpec, ZodSchemaAny, branchRef, c, callableTool, chatModel, container, defineBatchNode, defineCollection, defineCredential, defineNode, definePollingTrigger, delay, deriveAssertionPassed, emitPorts, getOriginIndexFromItem, getPersistedRuntimeTypeMetadata, inject, injectAll, injectable, instanceCachingFactory, instancePerContainerCachingFactory, isItemExpr, isPortsEmission, isUnbrandedPortsEmissionShape, itemExpr, node, nodeRef, predicateAwareClassFactory, registry, resolveItemExprsForExecution, resolveItemExprsInUnknown, runnableNodeInputType, runnableNodeOutputType, singleton, tool, triggerNodeOutputType, triggerNodeSetupStateType };
1051
+ //#region src/credentials/CredentialMaterialProvider.types.d.ts
1052
+ /**
1053
+ * Material provider seam — see `docs/design/credentials-oauth-unification.md`,
1054
+ * "Material provider seam" section. Sits beside the workspace's
1055
+ * `CredentialStore`; persistence of the row stays at the store, persistence of
1056
+ * the bytes goes through this provider so they can live at the control plane
1057
+ * in managed mode.
1058
+ */
1059
+ /**
1060
+ * Pointer to material bytes. For local rows `ref` is the workspace instance id
1061
+ * and the bytes co-locate with the row (existing `CredentialOAuth2Material` /
1062
+ * `CredentialSecretMaterial` tables). For control-plane rows `ref` is the
1063
+ * CP-side credential id; the workspace stores only the pointer.
1064
+ */
1065
+ type CredentialMaterialRef = Readonly<{
1066
+ source: "local" | "control-plane";
1067
+ id: string;
1068
+ }>;
1069
+ /**
1070
+ * Decrypted material bytes returned by a provider. Shape matches
1071
+ * `OAuthMaterial` — every supported credential type today is OAuth-shaped.
1072
+ */
1073
+ type MaterialBundle = OAuthMaterial;
1074
+ /**
1075
+ * Caller context recorded by the CP material endpoint per fetch (D5 in the
1076
+ * `credentials-vault` sprint README). The local provider accepts but ignores
1077
+ * it; standalone mode has no audit log.
1078
+ */
1079
+ type CallerContext = Readonly<{
1080
+ workspaceId: string;
1081
+ caller: Readonly<{
1082
+ kind: "workflow-node";
1083
+ workflowId: string;
1084
+ nodeId: string;
1085
+ }> | Readonly<{
1086
+ kind: "concierge";
1087
+ chatId: string;
1088
+ }> | Readonly<{
1089
+ kind: "research-agent";
1090
+ chatId: string;
1091
+ }> | Readonly<{
1092
+ kind: "manual";
1093
+ userId: string;
1094
+ }>;
1095
+ reason?: string;
1096
+ }>;
1097
+ interface CredentialMaterialProvider {
1098
+ getMaterial(ref: CredentialMaterialRef, context: CallerContext): Promise<MaterialBundle>;
1099
+ setMaterial(ref: CredentialMaterialRef, material: MaterialBundle): Promise<void>;
1100
+ }
1101
+ /**
1102
+ * Thrown by a provider when asked to operate on a `ref.source` it does not
1103
+ * handle (e.g. the local provider being asked to read `control-plane` bytes).
1104
+ * Exported so `instanceof`-checks work across the workspace boundary.
1105
+ */
1106
+ declare class IllegalMaterialSourceError extends Error {
1107
+ readonly source: CredentialMaterialRef["source"];
1108
+ readonly providerName: string;
1109
+ constructor(source: CredentialMaterialRef["source"], providerName: string);
1110
+ }
1111
+ //#endregion
1112
+ //#region src/credentials/ManagedCredentialMaterialWriteError.d.ts
1113
+ /**
1114
+ * Thrown by managed-mode providers when `setMaterial` is called. Managed
1115
+ * credential bytes are owned by the control plane; the workspace must not
1116
+ * mutate them. See `docs/design/credentials-oauth-unification.md` and
1117
+ * `planning/sprints/credentials-vault/02-controlplane-material-provider.md`.
1118
+ */
1119
+ declare class ManagedCredentialMaterialWriteError extends Error {
1120
+ constructor(message?: string);
1121
+ }
1122
+ //#endregion
1123
+ //#region src/credentials/ManagedMaterialFetchError.d.ts
1124
+ /**
1125
+ * Thrown by `ControlPlaneCredentialMaterialProvider` when the control-plane
1126
+ * material endpoint returns a non-2xx response or a malformed body. Exposes
1127
+ * the HTTP status and the raw error body so call sites can surface actionable
1128
+ * detail without parsing strings.
1129
+ */
1130
+ declare class ManagedMaterialFetchError extends Error {
1131
+ readonly status: number;
1132
+ readonly providerErrorBody: string;
1133
+ constructor(status: number, providerErrorBody: string, message?: string);
1134
+ }
1135
+ //#endregion
1136
+ export { ActivationIdFactory, AgentAttachmentRole, AgentBindError, AgentCanvasPresentation, AgentConfigInspector, type AgentConnectionCredentialSource, AgentConnectionNodeCollector, type AgentConnectionNodeDescriptor, type AgentConnectionNodeRole, AgentGuardrailConfig, AgentGuardrailDefaults, AgentMcpIntegration, AgentMcpToolMap, AgentMessageBuildArgs, AgentMessageConfig, AgentMessageConfigNormalizer, AgentMessageDto, AgentMessageLine, AgentMessageRole, AgentMessageTemplate, AgentMessageTemplateContent, AgentModelInvocationOptions, AgentNodeConfig, AgentTool, AgentToolCall, AgentToolCallPlanner, AgentToolDefinition, AgentToolExecuteArgs, AgentToolFactory, AgentToolToken, AgentTurnLimitBehavior, AllWorkflowsActiveWorkflowActivationPolicy, AnyCredentialType, AnyRunnableNodeConfig, AnyTriggerNodeConfig, AssertionResult, AssertionResultProvenance, BatchId, BinaryAttachment, BinaryAttachmentCreateRequest, BinaryBody, BinaryPreviewKind, BinaryStorage, BinaryStorageReadResult, BinaryStorageStatResult, BinaryStorageWriteRequest, BinaryStorageWriteResult, BooleanWhenOverloads, BranchMoreArgs, BranchOutputGuard, BranchStepsArg, CallableToolConfig, CallableToolConfigOptions, CallableToolExecuteHandler, CallableToolFactory, CallableToolKindToken, type CallerContext, ChainCursor, ChatLanguageModel, ChatLanguageModelCallOptions, ChatModelConfig, ChatModelFactory, ChildExecutionScopeFactory, type Clock, CodemationTelemetryAttributeNames, CodemationTelemetryMetricNames, CollectionColumnBuilder, CollectionDefinition, CollectionFieldDefinition, CollectionIndexDefinition, CollectionStore, CollectionsContext, ConnectionInvocationAppendArgs, ConnectionInvocationEventPublisher, ConnectionInvocationId, ConnectionInvocationIdFactory, ConnectionInvocationKind, ConnectionInvocationRecord, ConnectionNodeIdFactory, Container, ControlPlaneInboxChannelToken, CoreTokens, CostCatalog, CostCatalogEntry, CostTrackingComponent, CostTrackingPriceQuote, CostTrackingTelemetry, CostTrackingTelemetryAttributeNames, CostTrackingTelemetryFactory, CostTrackingTelemetryMetricNames, CostTrackingUsageRecord, CredentialAdvancedSectionPresentation, CredentialAuthDefinition, CredentialBinding, CredentialBindingKey, CredentialFieldSchema, CredentialHealth, CredentialHealthStatus, CredentialHealthTester, CredentialInstanceId, CredentialInstanceRecord, CredentialJsonRecord, type CredentialMaterialProvider, type CredentialMaterialRef, CredentialMaterialSourceKind, CredentialOAuth2AuthDefinition, CredentialOAuth2ScopesFromPublicConfig, CredentialRequirement, CredentialResolverFactory, CredentialSessionFactory, CredentialSessionFactoryArgs, CredentialSessionService, CredentialSetupStatus, CredentialType, CredentialTypeDefinition, CredentialTypeId, CredentialTypeRegistry, CredentialUnboundError, CurrentStateExecutionRequest, DEFAULT_ASSERTION_PASS_THRESHOLD, DefaultAsyncSleeper, DefaultExecutionBinaryService, DefaultExecutionContextFactory, DefaultWorkflowGraphFactory, DefineBatchNodeOptions, DefineCollectionOptions, DefineCredentialOptions, DefineNodeExecuteArgs, DefineNodeOptions, DefinePollingTriggerExecuteContext, DefinePollingTriggerOptions, DefinePollingTriggerPollContext, DefinePollingTriggerPollResult, DefinePollingTriggerTestItemsContext, DefinedCollection, DefinedCollectionRegistry, DefinedHumanApprovalNode, DefinedNode, DefinedNodeConfigInput, DefinedNodeCredentialAccessors, DefinedNodeCredentialBinding, DefinedNodeCredentialBindings, DefinedNodeRegistry, DefinedNodeRunContext, DefinedPollingTrigger, DefinedPollingTriggerConfig, DependencyContainer, Disposable, type Duration, Edge, EngineDeps, EngineExecutionLimitsPolicy, type EngineExecutionLimitsPolicyConfig, EngineHost, EngineRunCounters, EventPublishingWorkflowExecutionRepository, ExecutableTriggerNode, ExecutionBinaryService, ExecutionContext, ExecutionContextFactory, ExecutionFrontierPlan, ExecutionInstanceDto, ExecutionInstanceId, ExecutionMode, ExecutionPayloadPolicyFields, ExecutionTelemetry, ExecutionTelemetryFactory, ExpRetryPolicy, ExponentialRetryPolicySpec, Expr, FixedRetryPolicySpec, GenAiTelemetryAttributeNames, type HitlResumeTokenSignerSeam, HitlResumeTokenSignerToken, type HitlTimeoutJobSchedulerSeam, HitlTimeoutJobSchedulerToken, HitlWorkspaceIdToken, HttpMethod, HumanApprovalDecisionResult, HumanApprovalOutputJson, type HumanTaskActor, type HumanTaskHandle, type HumanTaskId, type HumanTaskRecord, type HumanTaskStatus, type HumanTaskStore, HumanTaskStoreToken, type HumanTaskSubject, IllegalMaterialSourceError, InMemoryBinaryStorage, InMemoryLiveWorkflowRepository, InMemoryRunDataFactory, InMemoryRunEventBus, InProcessRetryRunner, type InboxChannel, type InboxChannelResolverSeam, InboxChannelResolverToken, type InboxDeliverArgs, type InboxDelivery, type InboxOnDecisionArgs, type InboxOnTimeoutArgs, InjectableRuntimeDecoratorComposer, InjectionToken, InputPortKey, Item, ItemBinary, ItemExpr, ItemExprArgs, ItemExprCallback, ItemExprContext, ItemExprResolvedContext, ItemExprResolver, ItemNode, Items, ItemsInputNormalizer, JsonArray, JsonNonArray, JsonObject, JsonPrimitive, JsonValue, Lifecycle, LiveWorkflowRepository, LocalInboxChannelToken, ManagedCredentialMaterialWriteError, ManagedMaterialFetchError, type MaterialBundle, McpServerDeclaration, type McpServerResolver, McpServerTransport, MultiInputNode, MutableRunData, NeedsReconsentEvent, NoOpAgentMcpIntegration, NoOpCostTrackingTelemetry, NoOpCostTrackingTelemetryFactory, NoOpExecutionTelemetry, NoOpExecutionTelemetryFactory, NoOpNodeExecutionTelemetry, NoOpPollingTriggerLogger, NoOpTelemetryArtifactReference, NoOpTelemetrySpanScope, NoRetryPolicy, NodeActivationContinuation, NodeActivationId, NodeActivationReceipt, NodeActivationRequest, NodeActivationRequestBase, NodeActivationScheduler, NodeBackedToolConfig, NodeBackedToolConfigOptions, NodeBackedToolInputMapper, NodeBackedToolInputMapperArgs, NodeBackedToolOutputMapper, NodeBackedToolOutputMapperArgs, NodeBinaryAttachmentService, NodeConfigBase, NodeConnectionName, NodeDefinition, NodeErrorHandler, NodeErrorHandlerArgs, NodeErrorHandlerSpec, NodeEventPublisher, NodeExecutionContext, NodeExecutionError, NodeExecutionRequest, NodeExecutionRequestHandler, NodeExecutionScheduler, NodeExecutionSnapshot, NodeExecutionStatePublisher, NodeExecutionStatus, NodeExecutionTelemetry, NodeExecutor, NodeId, NodeIdRef, NodeIdSlugifier, NodeInputsByPort, NodeInspectorSummaryRow, NodeIterationId, NodeIterationIdFactory, NodeKind, NodeOffloadPolicy, NodeOutputNormalizer, NodeOutputs, NodeRef, NodeResolver, NodeSchedulerDecision, NoneRetryPolicySpec, OAuth2ProviderFromPublicConfig, type OAuthFlowCallbackArgs, type OAuthFlowExecutor, type OAuthFlowStartArgs, type OAuthFlowStartResult, type OAuthMaterial, OutputPortKey, PairedItemRef, Param, ParamDeep, ParentExecutionRef, PayloadStorageKind, PendingNodeExecution, type PendingResumeEntry, PersistedExecutionInstanceKind, PersistedExecutionInstanceRecord, PersistedMutableNodeState, PersistedMutableRunState, PersistedRunControlState, PersistedRunPolicySnapshot, PersistedRunSchedulingState, PersistedRunSlotProjectionRecord, PersistedRunState, PersistedRunWorkItemKind, PersistedRunWorkItemRecord, type PersistedRuntimeTypeDecoratorOptions, type PersistedRuntimeTypeKind, type PersistedRuntimeTypeMetadata, PersistedRuntimeTypeMetadataStore, PersistedRuntimeTypeNameResolver, type PersistedSuspensionEntry, PersistedTokenId, PersistedTriggerSetupState, PersistedWorkflowSnapshot, PersistedWorkflowSnapshotNode, PersistedWorkflowTokenRegistryLike, PinnedNodeOutputsByPort, type PollingRunCycleArgs, type PollingRunCycleResult, PollingTriggerDedupWindow, PollingTriggerHandle, type PollingTriggerLogger, PollingTriggerRuntime, type PollingTriggerStartArgs, PortsEmission, PreparedNodeActivationDispatch, RegistrationOptions, type ResumeContext, RetryPolicy, RetryPolicySpec, RunCompletionNotifier, RunCurrentState, RunDataFactory, RunDataSnapshot, RunEvent, RunEventBus, RunEventPublisherDeps, RunEventSubscription, RunExecutionOptions, RunFinishedAtFactory, type RunHaltReason, RunId, RunIdFactory, RunIntentService, RunIterationDto, RunPruneCandidate, RunQueueEntry, RunResult, RunRevision, RunSlotProjectionState, RunStateResetRequest, RunStatus, RunStopCondition, RunSummary, RunTestContext, RunnableNode, RunnableNodeConfig, RunnableNodeExecuteArgs, RunnableNodeInputJson, RunnableNodeOutputJson, RunnableOutputBehaviorResolver, SlotExecutionStateDto, StackTraceCallSitePathResolver, StepSequenceOutput, StructuredOutputOptions, SuspensionRequest, SystemClock, TelemetryArtifactAttachment, TelemetryArtifactReference, TelemetryAttributePrimitive, TelemetryAttributes, TelemetryChildSpanStart, TelemetryMetricRecord, TelemetryScope, TelemetrySpanEnd, TelemetrySpanEventRecord, TelemetrySpanScope, TestCaseRunStatus, TestSuiteRunId, TestSuiteRunStatus, TestTriggerNodeConfig, TestTriggerSetupContext, TestableTriggerNode, Tool, ToolConfig, ToolExecuteArgs, TriggerCleanupHandle, TriggerInstanceId, TriggerNode, TriggerNodeConfig, TriggerNodeOutputJson, TriggerNodeSetupState, TriggerRuntimeDiagnostics, TriggerSetupContext, TriggerSetupStateFor, TriggerSetupStateRepository, TriggerTestItemsContext, TypeToken, UnavailableBinaryStorage, UpstreamRefPlaceholder, ValidStepSequence, WebhookControlSignal, WebhookInvocationMatch, WebhookRunResult, WebhookTriggerMatcher, WebhookTriggerResolution, WebhookTriggerRoutingDiagnostics, WhenBuilder, WorkItemId, WorkItemStatus, WorkflowActivationPolicy, WorkflowBuilder, WorkflowDefinition, WorkflowDefinitionError, WorkflowDetailSelectionState, type WorkflowEdgePortError, type WorkflowEdgePortValidationResult, WorkflowEdgePortValidator, WorkflowErrorContext, WorkflowErrorHandler, WorkflowErrorHandlerSpec, WorkflowExecutableNodeClassifier, WorkflowExecutableNodeClassifierFactory, WorkflowExecutionListingRepository, WorkflowExecutionPruneRepository, WorkflowExecutionRepository, WorkflowGraph, WorkflowGraphFactory, WorkflowId, WorkflowNodeConnection, WorkflowNodeInstanceFactory, WorkflowPolicyRuntimeDefaults, WorkflowPrunePolicySpec, WorkflowRepository, WorkflowRunDetailDto, WorkflowRunnerResolver, WorkflowRunnerService, WorkflowSnapshotFactory, WorkflowSnapshotResolver, WorkflowStoragePolicyDecisionArgs, WorkflowStoragePolicyMode, WorkflowStoragePolicyResolver, WorkflowStoragePolicySpec, ZodSchemaAny, branchRef, c, callableTool, chatModel, container, defineBatchNode, defineCollection, defineCredential, defineHumanApprovalNode, defineNode, definePollingTrigger, delay, deriveAssertionPassed, emitPorts, getOriginIndexFromItem, getPersistedRuntimeTypeMetadata, inject, injectAll, injectable, instanceCachingFactory, instancePerContainerCachingFactory, isHumanApprovalNode, isItemExpr, isPortsEmission, isUnbrandedPortsEmissionShape, itemExpr, node, nodeRef, predicateAwareClassFactory, registry, resolveItemExprsForExecution, resolveItemExprsInUnknown, runnableNodeInputType, runnableNodeOutputType, singleton, tool, triggerNodeOutputType, triggerNodeSetupStateType };
839
1137
  //# sourceMappingURL=index.d.cts.map