@ablehi/server-contract 0.2.5 → 0.2.6

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.
@@ -1,4 +1,4 @@
1
- declare const SERVER_CONTRACT_VERSION = "0.2.5";
1
+ declare const SERVER_CONTRACT_VERSION = "0.2.6";
2
2
  type ServerContractVersion = typeof SERVER_CONTRACT_VERSION;
3
3
 
4
4
  declare const FLOW_IR_SCHEMA_VERSION = "flow.ir.v1";
package/dist/edge.d.ts CHANGED
@@ -1 +1 @@
1
- export { A as AblehiEnvelope, d as AblehiFailure, e as AblehiSuccess, f as ActionNode, B as BooleanExpression, g as Collection, h as CompleteFlowRunWaitBody, i as CompleteFlowRunWaitData, m as ContractParseResult, n as CreateHumanInputRequestBody, D as DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES, o as DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES, p as DEPLOYMENT_HANDSHAKE_ROUTE, q as DeploymentHandshakeData, r as DeploymentHandshakeRequestBody, s as DeploymentHandshakeResponse, E as EGRESS_GRANT_AUDIT_ROUTE_SUBPATH, t as EGRESS_GRANT_CONSUME_ROUTE_SUBPATH, u as EGRESS_GRANT_SCOPE_KINDS, v as EVENT_WAIT_ROUTE_SUBPATH, w as EXECUTION_CONTEXT_ROUTE_SUBPATH, x as EgressGrant, y as EgressGrantAuditBody, z as EgressGrantBodyParseResult, G as EgressGrantConsumeBody, H as EgressGrantFileRuntime, I as EgressGrantScopeKind, K as ExecutionBinding, L as ExecutionBindingConnection, N as ExecutionContextCompiled, O as ExecutionContextData, P as FILE_ACCESS_ROUTE_SUBPATH, Q as FILE_COMPLETE_ROUTE_SUBPATH, R as FILE_CONTENT_ROUTE_SUBPATH, S as FILE_STAT_ROUTE_SUBPATH, U as FILE_UPLOAD_SESSION_ROUTE_SUBPATH, V as FLOW_INTERPRETER_CONTRACT_VERSION, W as FLOW_IR_SCHEMA_VERSION, X as FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH, Y as FLOW_RUN_RESULT_ROUTE_SUBPATH, Z as FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, a1 as FileRefData, a2 as FileRuntimeLimits, a3 as FileRuntimeScope, a4 as FileRuntimeScopeKind, a5 as FileUploadSessionData, a6 as FlowActionGrantBody, c as FlowCompositionSpec, a7 as FlowDefinition, a8 as FlowExecutionContextFileRuntime, a9 as FlowInterpreterContractVersion, aa as FlowIrValidationCode, ab as FlowIrValidationIssue, a as FlowIrValidationResult, F as FlowNode, ac as FlowRunResultData, ad as FlowRunResultRequestBody, ae as FlowRuntimeCredentialBody, af as HANDLER_BUNDLES_ROUTE_SUBPATH, ag as HANDSHAKE_CAPABILITY_MISSING, ah as HANDSHAKE_CONTRACT_VERSION_MISMATCH, ai as HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH, aj as HANDSHAKE_REQUEST_INVALID, ak as HANDSHAKE_SECRET_MISMATCH, al as HANDSHAKE_SECRET_UNCONFIGURED, am as HUMAN_INPUTS_ROUTE_SUBPATH, an as HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH, ao as HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH, ap as HUMAN_INPUT_REQUEST_ROUTE_SUBPATH, aq as HUMAN_INPUT_RESOLVED_EVENT_PREFIX, ar as HandlerBundle, as as HandlerBundleModule, at as HandlerBundlesData, au as HandlerBundlesParseResult, av as HumanChoiceInput, aw as HumanFormField, ax as HumanFormInput, ay as HumanInputActor, az as HumanInputChoice, aA as HumanInputDelivery, aB as HumanInputDeliveryAction, aC as HumanInputNode, aD as HumanInputOutput, aE as HumanInputPrompt, aF as HumanInputRequestView, aG as HumanInputResolvedEvent, aH as HumanInputResponse, aI as HumanInputSpec, aJ as HumanTextInput, aK as INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX, aL as INTERNAL_FILES_ROUTE_PREFIX, aM as INTERNAL_FLOW_RUNS_ROUTE_PREFIX, aN as INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX, aO as INTERNAL_INSTALLATIONS_ROUTE_PREFIX, aP as INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX, aQ as INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX, aR as INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX, aS as IntegrationTriggerBinding, aT as InternalFileAccessData, aU as InternalFileAccessIntent, aV as JsonArray, b as JsonObject, J as JsonValue, aW as ManualTriggerBinding, M as Mapping, aX as NodeCommon, aY as Operand, aZ as POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH, a_ as POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH, a$ as POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH, b0 as POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, b1 as POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH, b2 as PackagePollingTriggerRuntimeDescriptor, b3 as PackageWebhookTriggerRuntimeDescriptor, b4 as ParsedFlowRunResultBody, b5 as PartiallyRenderedHumanInputDelivery, b6 as PartiallyRenderedMapping, b7 as PartiallyRenderedTemplatePart, b8 as PartiallyRenderedValue, b9 as PollingPublishBody, ba as PollingPublishEvent, bb as PollingRuntimeCredentialBody, bc as PollingTriggerContext, bd as PollingTriggerGrantBody, be as PresignedFileUrlData, bf as PublishPollingTickEventResult, bg as PublishPollingTickEventsData, bh as RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS, bi as RegisterFlowRunWaitBody, bj as RegisterFlowRunWaitData, bk as RenderedFlowComposition, bl as RenderedHumanInputPrompt, bm as RuntimeCredentialSession, bn as RuntimeCredentialSessionNetwork, bo as RuntimeCredentialSessionScopeKind, bp as RuntimeNetwork, bq as RuntimeNetworkModel, br as SERVER_CONTRACT_VERSION, bs as STEP_RESULT_ROUTE_SUBPATH, bt as ScheduleTriggerBinding, bu as ServerContractVersion, bv as SingleToolGrantBody, bw as SleepNode, bx as StepRecordBody, by as StepRecordBodyParseResult, bz as StepRecordData, bA as StepRecordResult, bB as TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH, bC as TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH, bD as TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, bE as TextExpression, bF as ToolHandlerBundlesData, T as TriggerBinding, bG as TriggerConnectionInfo, bH as TriggerHandlerBundlesData, bI as TriggerHandlerModule, bJ as ValueExpression, bK as WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH, bL as WEBHOOK_PROTOCOL_ADAPTER_MODULE, bM as WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH, bN as WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH, bO as WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH, bP as WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH, bQ as WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH, bR as WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH, bS as WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, bT as WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION, bU as WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION, bW as WaitEventNode, bX as WebhookDelivery, bY as WebhookProtocolAdapterBundleData, bZ as WebhookProtocolAdapterModule, b_ as WebhookPublishEvent, b$ as WebhookPublishEventsBody, c0 as WebhookPublishEventsData, c1 as WebhookRearmBody, c2 as WebhookRearmData, c3 as WebhookRuntimeCredentialBody, c4 as WebhookTriggerGrantBody, c5 as WebhookTriggerVerificationMethod, c6 as WebhookWatcherContext, c7 as WfpUserRuntimeManifest, c8 as contractParseFail, c9 as contractParseOk, ca as deploymentHandshakeProbePayload, cb as deploymentHandshakeResponseProofPayload, cc as egressGrantAuditPath, cd as egressGrantConsumePath, ce as eventWaitPath, cf as executionContextPath, cg as flowRunEgressGrantPath, ch as flowRunResultPath, ci as flowRunRuntimeCredentialPath, cj as flowScriptProtocolAdapterModuleName, ck as handlerBundlesPath, cl as humanInputAcknowledgePath, cm as humanInputExpirePath, cn as humanInputRequestPath, co as humanInputResolvedEventType, cp as humanInputsPath, cq as internalFileAccessPath, cr as internalFileCompletePath, cs as internalFileContentPath, ct as internalFileStatPath, cu as internalFileUploadSessionPath, cv as internalFilesPath, cw as isJsonRecord, cx as isValidRequestDigest, cy as parseCompleteFlowRunWaitBody, cC as parseCreateHumanInputBody, cD as parseEgressGrantAuditBody, cE as parseEgressGrantConsumeBody, cF as parseEgressGrantConsumeData, cG as parseEgressGrantData, cH as parseExecutionContextData, cK as parseFileRefData, cL as parseFileRuntimeLimits, cM as parseFileUploadSessionData, cN as parseFlowActionGrantBody, cO as parseFlowRunResultBody, cP as parseFlowRunResultData, cQ as parseFlowRuntimeCredentialBody, cR as parseHandlerBundle, cS as parseHandlerBundlesData, cT as parseHumanInputAcknowledgeData, cU as parseHumanInputCreateData, cV as parseHumanInputRequestViewData, cW as parseInternalFileAccessData, cX as parsePollingPublishBody, cY as parsePollingRuntimeCredentialBody, cZ as parsePollingTriggerContext, c_ as parsePollingTriggerGrantBody, c$ as parsePublishPollingTickEventsData, d0 as parseRegisterFlowRunWaitBody, d1 as parseRegisterFlowRunWaitData, d2 as parseRuntimeCredentialSessionCredential, d3 as parseRuntimeNetwork, d4 as parseSingleToolGrantBody, d5 as parseSingleToolRuntimeCredentialBody, d6 as parseStepRecordBody, d7 as parseStepRecordData, d8 as parseToolHandlerBundlesData, d9 as parseTriggerHandlerBundlesData, da as parseWebhookDelivery, db as parseWebhookPublishEventsBody, dc as parseWebhookRearmBody, dd as parseWebhookRuntimeCredentialBody, de as parseWebhookTriggerGrantBody, df as parseWebhookWatcherContext, dg as pollingTriggerContextPath, dh as pollingTriggerEgressGrantPath, di as pollingTriggerHandlerBundlesPath, dj as pollingTriggerRuntimeCredentialPath, dk as pollingTriggerTickEventsPath, dl as requestHasMultipartFileParts, dm as stepResultPath, dn as toolHandlerBundlesPath, dp as toolInvocationEgressGrantPath, dq as toolInvocationRuntimeCredentialPath, dr as webhookProtocolAdapterBundlePath, ds as webhookTriggerContextPath, dt as webhookTriggerDeliveryPath, du as webhookTriggerEgressGrantPath, dv as webhookTriggerEventsPath, dw as webhookTriggerHandlerBundlesPath, dx as webhookTriggerRearmPath, dy as webhookTriggerRuntimeCredentialPath, dz as wfpUserRuntimeManifestPath } from './edge-CLcEbZfb.js';
1
+ export { A as AblehiEnvelope, d as AblehiFailure, e as AblehiSuccess, f as ActionNode, B as BooleanExpression, g as Collection, h as CompleteFlowRunWaitBody, i as CompleteFlowRunWaitData, m as ContractParseResult, n as CreateHumanInputRequestBody, D as DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES, o as DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES, p as DEPLOYMENT_HANDSHAKE_ROUTE, q as DeploymentHandshakeData, r as DeploymentHandshakeRequestBody, s as DeploymentHandshakeResponse, E as EGRESS_GRANT_AUDIT_ROUTE_SUBPATH, t as EGRESS_GRANT_CONSUME_ROUTE_SUBPATH, u as EGRESS_GRANT_SCOPE_KINDS, v as EVENT_WAIT_ROUTE_SUBPATH, w as EXECUTION_CONTEXT_ROUTE_SUBPATH, x as EgressGrant, y as EgressGrantAuditBody, z as EgressGrantBodyParseResult, G as EgressGrantConsumeBody, H as EgressGrantFileRuntime, I as EgressGrantScopeKind, K as ExecutionBinding, L as ExecutionBindingConnection, N as ExecutionContextCompiled, O as ExecutionContextData, P as FILE_ACCESS_ROUTE_SUBPATH, Q as FILE_COMPLETE_ROUTE_SUBPATH, R as FILE_CONTENT_ROUTE_SUBPATH, S as FILE_STAT_ROUTE_SUBPATH, U as FILE_UPLOAD_SESSION_ROUTE_SUBPATH, V as FLOW_INTERPRETER_CONTRACT_VERSION, W as FLOW_IR_SCHEMA_VERSION, X as FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH, Y as FLOW_RUN_RESULT_ROUTE_SUBPATH, Z as FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, a0 as FileMetadataData, a1 as FileRefData, a2 as FileRuntimeLimits, a3 as FileRuntimeScope, a4 as FileRuntimeScopeKind, a5 as FileUploadSessionData, a6 as FlowActionGrantBody, c as FlowCompositionSpec, a7 as FlowDefinition, a8 as FlowExecutionContextFileRuntime, a9 as FlowInterpreterContractVersion, aa as FlowIrValidationCode, ab as FlowIrValidationIssue, a as FlowIrValidationResult, F as FlowNode, ac as FlowRunResultData, ad as FlowRunResultRequestBody, ae as FlowRuntimeCredentialBody, af as HANDLER_BUNDLES_ROUTE_SUBPATH, ag as HANDSHAKE_CAPABILITY_MISSING, ah as HANDSHAKE_CONTRACT_VERSION_MISMATCH, ai as HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH, aj as HANDSHAKE_REQUEST_INVALID, ak as HANDSHAKE_SECRET_MISMATCH, al as HANDSHAKE_SECRET_UNCONFIGURED, am as HUMAN_INPUTS_ROUTE_SUBPATH, an as HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH, ao as HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH, ap as HUMAN_INPUT_REQUEST_ROUTE_SUBPATH, aq as HUMAN_INPUT_RESOLVED_EVENT_PREFIX, ar as HandlerBundle, as as HandlerBundleModule, at as HandlerBundlesData, au as HandlerBundlesParseResult, av as HumanChoiceInput, aw as HumanFormField, ax as HumanFormInput, ay as HumanInputActor, az as HumanInputChoice, aA as HumanInputDelivery, aB as HumanInputDeliveryAction, aC as HumanInputNode, aD as HumanInputOutput, aE as HumanInputPrompt, aF as HumanInputRequestView, aG as HumanInputResolvedEvent, aH as HumanInputResponse, aI as HumanInputSpec, aJ as HumanTextInput, aK as INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX, aL as INTERNAL_FILES_ROUTE_PREFIX, aM as INTERNAL_FLOW_RUNS_ROUTE_PREFIX, aN as INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX, aO as INTERNAL_INSTALLATIONS_ROUTE_PREFIX, aP as INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX, aQ as INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX, aR as INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX, aS as IntegrationTriggerBinding, aT as InternalFileAccessData, aU as InternalFileAccessIntent, aV as JsonArray, b as JsonObject, J as JsonValue, aW as ManualTriggerBinding, M as Mapping, aX as NodeCommon, aY as Operand, aZ as POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH, a_ as POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH, a$ as POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH, b0 as POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, b1 as POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH, b2 as PackagePollingTriggerRuntimeDescriptor, b3 as PackageWebhookTriggerRuntimeDescriptor, b4 as ParsedFlowRunResultBody, b5 as PartiallyRenderedHumanInputDelivery, b6 as PartiallyRenderedMapping, b7 as PartiallyRenderedTemplatePart, b8 as PartiallyRenderedValue, b9 as PollingPublishBody, ba as PollingPublishEvent, bb as PollingRuntimeCredentialBody, bc as PollingTriggerContext, bd as PollingTriggerGrantBody, be as PresignedFileUrlData, bf as PublishPollingTickEventResult, bg as PublishPollingTickEventsData, bh as RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS, bi as RegisterFlowRunWaitBody, bj as RegisterFlowRunWaitData, bk as RenderedFlowComposition, bl as RenderedHumanInputPrompt, bm as RuntimeCredentialSession, bn as RuntimeCredentialSessionNetwork, bo as RuntimeCredentialSessionScopeKind, bp as RuntimeNetwork, bq as RuntimeNetworkModel, br as SERVER_CONTRACT_VERSION, bs as STEP_RESULT_ROUTE_SUBPATH, bt as ScheduleTriggerBinding, bu as ServerContractVersion, bv as SingleToolGrantBody, bw as SleepNode, bx as StepRecordBody, by as StepRecordBodyParseResult, bz as StepRecordData, bA as StepRecordResult, bB as TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH, bC as TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH, bD as TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, bE as TextExpression, bF as ToolHandlerBundlesData, T as TriggerBinding, bG as TriggerConnectionInfo, bH as TriggerHandlerBundlesData, bI as TriggerHandlerModule, bJ as ValueExpression, bK as WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH, bL as WEBHOOK_PROTOCOL_ADAPTER_MODULE, bM as WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH, bN as WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH, bO as WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH, bP as WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH, bQ as WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH, bR as WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH, bS as WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, bT as WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION, bU as WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION, bW as WaitEventNode, bX as WebhookDelivery, bY as WebhookProtocolAdapterBundleData, bZ as WebhookProtocolAdapterModule, b_ as WebhookPublishEvent, b$ as WebhookPublishEventsBody, c0 as WebhookPublishEventsData, c1 as WebhookRearmBody, c2 as WebhookRearmData, c3 as WebhookRuntimeCredentialBody, c4 as WebhookTriggerGrantBody, c5 as WebhookTriggerVerificationMethod, c6 as WebhookWatcherContext, c7 as WfpUserRuntimeManifest, c8 as contractParseFail, c9 as contractParseOk, ca as deploymentHandshakeProbePayload, cb as deploymentHandshakeResponseProofPayload, cc as egressGrantAuditPath, cd as egressGrantConsumePath, ce as eventWaitPath, cf as executionContextPath, cg as flowRunEgressGrantPath, ch as flowRunResultPath, ci as flowRunRuntimeCredentialPath, cj as flowScriptProtocolAdapterModuleName, ck as handlerBundlesPath, cl as humanInputAcknowledgePath, cm as humanInputExpirePath, cn as humanInputRequestPath, co as humanInputResolvedEventType, cp as humanInputsPath, cq as internalFileAccessPath, cr as internalFileCompletePath, cs as internalFileContentPath, ct as internalFileStatPath, cu as internalFileUploadSessionPath, cv as internalFilesPath, cw as isJsonRecord, cx as isValidRequestDigest, cy as parseCompleteFlowRunWaitBody, cC as parseCreateHumanInputBody, cD as parseEgressGrantAuditBody, cE as parseEgressGrantConsumeBody, cF as parseEgressGrantConsumeData, cG as parseEgressGrantData, cH as parseExecutionContextData, cJ as parseFileMetadataData, cK as parseFileRefData, cL as parseFileRuntimeLimits, cM as parseFileUploadSessionData, cN as parseFlowActionGrantBody, cO as parseFlowRunResultBody, cP as parseFlowRunResultData, cQ as parseFlowRuntimeCredentialBody, cR as parseHandlerBundle, cS as parseHandlerBundlesData, cT as parseHumanInputAcknowledgeData, cU as parseHumanInputCreateData, cV as parseHumanInputRequestViewData, cW as parseInternalFileAccessData, cX as parsePollingPublishBody, cY as parsePollingRuntimeCredentialBody, cZ as parsePollingTriggerContext, c_ as parsePollingTriggerGrantBody, c$ as parsePublishPollingTickEventsData, d0 as parseRegisterFlowRunWaitBody, d1 as parseRegisterFlowRunWaitData, d2 as parseRuntimeCredentialSessionCredential, d3 as parseRuntimeNetwork, d4 as parseSingleToolGrantBody, d5 as parseSingleToolRuntimeCredentialBody, d6 as parseStepRecordBody, d7 as parseStepRecordData, d8 as parseToolHandlerBundlesData, d9 as parseTriggerHandlerBundlesData, da as parseWebhookDelivery, db as parseWebhookPublishEventsBody, dc as parseWebhookRearmBody, dd as parseWebhookRuntimeCredentialBody, de as parseWebhookTriggerGrantBody, df as parseWebhookWatcherContext, dg as pollingTriggerContextPath, dh as pollingTriggerEgressGrantPath, di as pollingTriggerHandlerBundlesPath, dj as pollingTriggerRuntimeCredentialPath, dk as pollingTriggerTickEventsPath, dl as requestHasMultipartFileParts, dm as stepResultPath, dn as toolHandlerBundlesPath, dp as toolInvocationEgressGrantPath, dq as toolInvocationRuntimeCredentialPath, dr as webhookProtocolAdapterBundlePath, ds as webhookTriggerContextPath, dt as webhookTriggerDeliveryPath, du as webhookTriggerEgressGrantPath, dv as webhookTriggerEventsPath, dw as webhookTriggerHandlerBundlesPath, dx as webhookTriggerRearmPath, dy as webhookTriggerRuntimeCredentialPath, dz as wfpUserRuntimeManifestPath } from './edge-DNtGw1Sl.js';
package/dist/edge.js CHANGED
@@ -1 +1 @@
1
- var ee="0.2.5";var Ke="flow.ir.v1";var te="flow.interp.v2";function a(e){return{ok:!0,value:e}}function r(e){return{ok:!1,reason:e}}function i(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function I(e){if(!i(e)||typeof e.kind!="string")return r("context state scope surface shape is invalid");switch(e.kind){case"webhook-trigger":return ne(e);case"polling-trigger":return re(e);case"flow-action":return oe(e);default:return r("context state scope kind is invalid")}}function ne(e){let t=D(e,["kind","workspaceId","triggerInstanceId"]);return t!==void 0?r(`webhook trigger scope does not accept "${t}"`):e.kind!=="webhook-trigger"||!R(e.workspaceId)||!R(e.triggerInstanceId)?r("webhook trigger state scope is invalid"):a({kind:"webhook-trigger",workspaceId:e.workspaceId,triggerInstanceId:e.triggerInstanceId})}function re(e){let t=D(e,["kind","workspaceId","pollingInstanceId"]);return t!==void 0?r(`polling trigger scope does not accept "${t}"`):e.kind!=="polling-trigger"||!R(e.workspaceId)||!R(e.pollingInstanceId)?r("polling trigger state scope is invalid"):a({kind:"polling-trigger",workspaceId:e.workspaceId,pollingInstanceId:e.pollingInstanceId})}function oe(e){let t=D(e,["kind","workspaceId","flowId","nodeId","connectionId"]);if(t!==void 0)return r(`flow action scope does not accept "${t}"`);let n=e.connectionId;return e.kind!=="flow-action"||!R(e.workspaceId)||!R(e.flowId)||!R(e.nodeId)||n!==null&&!R(n)?r("flow action state scope is invalid"):a({kind:"flow-action",workspaceId:e.workspaceId,flowId:e.flowId,nodeId:e.nodeId,connectionId:n})}function R(e){return typeof e=="string"&&e.length>0}function D(e,t){return Object.keys(e).find(n=>!t.includes(n))}var f="/internal/flow-runs",ze="/:flowRunId/execution-context";function Qe(e){return`${f}/${encodeURIComponent(e)}/execution-context`}function ie(e){return!i(e)||!U(e.fileMaxBytes)||!U(e.fileReadMaxBytes)||!U(e.inlineMultipartBytesMax)?r("file runtime limits must carry three positive integer bounds"):a({fileMaxBytes:e.fileMaxBytes,fileReadMaxBytes:e.fileReadMaxBytes,inlineMultipartBytesMax:e.inlineMultipartBytesMax})}function Ze(e){if(!i(e))return r("execution context must be a JSON object");let t=e.compiled;if(typeof e.flowRunId!="string"||typeof e.workspaceId!="string"||!i(e.input)||!i(t)||typeof t.irSchemaVersion!="string"||typeof t.interpreterContractVersion!="string"||typeof t.compiledArtifactId!="string"||!i(t.ir)||!Array.isArray(t.ir.nodes)||!ae(e.executionBindings))return r("execution context surface shape is invalid");let n=se(e.fileRuntime);return n.ok?a({...e,fileRuntime:n.value}):r(n.reason)}function se(e){if(e===null)return a(null);if(!i(e))return r("fileRuntime must be null or an object");let t=ie(e.limits);return t.ok?a({limits:t.value}):r(t.reason)}function ae(e){return Array.isArray(e)?e.every(t=>{if(!i(t))return!1;let n=t.connection,o=I(t.stateScope);return typeof t.nodeId=="string"&&typeof t.toolRef=="string"&&i(t.toolDescriptor)&&i(t.integrationDescriptor)&&i(n)&&typeof n.installationId=="string"&&typeof n.connectionRef=="string"&&typeof n.connectionId=="string"&&typeof n.authType=="string"&&o.ok}):!1}function U(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var rt="/:flowRunId/steps/:nodeId/result",ot="/:flowRunId/result",it="/:flowRunId/event-waits/:nodeId";function st(e,t){return`${f}/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}/result`}function at(e){return`${f}/${encodeURIComponent(e)}/result`}function ut(e,t){return`${f}/${encodeURIComponent(e)}/event-waits/${encodeURIComponent(t)}`}function ct(e){if(!i(e))return{ok:!1,kind:"validation",reason:"step record body must be a JSON object"};let t=y(e,["attempt","result","durationMs"]);if(t!==void 0)return{ok:!1,kind:"validation",reason:`step record does not accept the "${t}" field`};let n=e.attempt;if(typeof n!="number"||!Number.isInteger(n)||n<=0)return{ok:!1,kind:"validation",reason:"attempt must be a positive integer"};let o=ue(e.result);if(!o.ok)return o;let s={attempt:n,result:o.value};if(e.durationMs!==void 0){let u=e.durationMs;if(typeof u!="number"||!Number.isFinite(u)||u<0)return{ok:!1,kind:"validation",reason:"durationMs must be a non-negative number"};s.durationMs=u}return{ok:!0,value:s}}function ue(e){if(!i(e))return{ok:!1,kind:"step_result_invalid",reason:"result must be a JSON object"};let t=e.status;if(t==="succeeded"){let n=y(e,["status","output"]);return n!==void 0?{ok:!1,kind:"validation",reason:`step record result does not accept the "${n}" field`}:"output"in e?{ok:!0,value:{status:"succeeded",output:e.output}}:{ok:!1,kind:"step_result_invalid",reason:"a succeeded result must carry output"}}if(t==="failed"){let n=y(e,["status","errorCode","issues"]);if(n!==void 0)return{ok:!1,kind:"validation",reason:`step record result does not accept the "${n}" field`};let o=e.errorCode;if(typeof o!="string"||o.length===0)return{ok:!1,kind:"step_result_invalid",reason:"a failed result must carry a non-empty errorCode"};let s={status:"failed",errorCode:o};return e.issues!==void 0&&(s.issues=e.issues),{ok:!0,value:s}}return{ok:!1,kind:"step_result_invalid",reason:'result status must be "succeeded" or "failed"'}}function dt(e){return!i(e)||typeof e.flowRunId!="string"||typeof e.nodeId!="string"||e.recorded!=="succeeded"&&e.recorded!=="failed"?r("step record data surface shape is invalid"):a({flowRunId:e.flowRunId,nodeId:e.nodeId,recorded:e.recorded})}function pt(e){if(!i(e))return r("result body must be a JSON object");let t=y(e,["status","output","error","composition"]);if(t!==void 0)return r(`result does not accept the "${t}" field`);let n=e.status;if(n!=="succeeded"&&n!=="failed")return r('result status must be "succeeded" or "failed"');let o={status:n};if(e.output!==void 0&&(o.output=e.output),e.error!==void 0){let s=e.error;if(!i(s))return r("result error must be a JSON object");let u=y(s,["code","message"]);if(u!==void 0)return r(`result error does not accept the "${u}" field`);if(typeof s.code!="string"||typeof s.message!="string")return r("result error must carry string code and message");o.error={code:s.code,message:s.message}}if(e.composition!==void 0){if(n!=="succeeded")return r("composition is only allowed on a succeeded result");o.composition=e.composition}return a(o)}function lt(e){return i(e)?a(e):r("flow run result data must be a JSON object")}var ce=/^[A-Za-z0-9_-]{1,100}$/;function gt(e){if(!i(e))return r("register body must be a JSON object");let t=y(e,["eventType","correlationKey"]);if(t!==void 0)return r(`register wait does not accept the "${t}" field`);let n=G(e.eventType);if(!n.ok)return r(n.reason);let o=e.correlationKey;return typeof o!="string"||o.length===0?r("correlationKey must be a non-empty string"):a({eventType:n.value,correlationKey:o})}function ft(e){if(!i(e))return r("complete body must be a JSON object");let t=y(e,["eventType","correlationKey","outcome","eventId"]);if(t!==void 0)return r(`complete wait does not accept the "${t}" field`);let n=e.outcome;if(n!=="received"&&n!=="timed_out")return r('outcome must be "received" or "timed_out"');let o=G(e.eventType);if(!o.ok)return r(o.reason);let s=e.correlationKey;if(typeof s!="string"||s.length===0)return r("correlationKey must be a non-empty string");let u={eventType:o.value,correlationKey:s,outcome:n};if(e.eventId!==void 0){if(typeof e.eventId!="string"||e.eventId.length===0)return r("eventId must be a non-empty string");u.eventId=e.eventId}return a(u)}function Rt(e){return!i(e)||e.registered!==!0?r("register wait data surface shape is invalid"):a({registered:!0})}function G(e){return typeof e!="string"||e.length===0?r("eventType must be a non-empty string"):ce.test(e)?a(e):r("eventType must match ^[A-Za-z0-9_-]{1,100}$")}function y(e,t){return Object.keys(e).find(n=>!t.includes(n))}var de="/internal/flow-versions",yt="/:flowVersionId/handler-bundles",H="/internal/installations",It="/:installationId/handler-bundles";function kt(e,t){return`${de}/${encodeURIComponent(e)}/handler-bundles?compiledArtifactId=${encodeURIComponent(t)}`}function _t(e){return`${H}/${encodeURIComponent(e.installationId)}/handler-bundles?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var pe=new Set(["managed_only","managed_plus_unmanaged_sdk"]);function A(e){if(!k(e))return B("runtimeNetwork must be a JSON object");let t=e.networkModel;return typeof t!="string"||!pe.has(t)?B("runtimeNetwork.networkModel is unknown"):!K(e.apiHosts)||!K(e.authHosts)||typeof e.httpsOnly!="boolean"?B("runtimeNetwork host/https fields are invalid"):{ok:!0,value:{networkModel:t,apiHosts:e.apiHosts,authHosts:e.authHosts,httpsOnly:e.httpsOnly}}}function Et(e){if(!k(e)||typeof e.flowVersionId!="string"||typeof e.compiledArtifactId!="string"||!Array.isArray(e.bundles))return x("handler bundles data surface shape is invalid");let t=q(e.bundles);return t.ok?{ok:!0,value:{flowVersionId:e.flowVersionId,compiledArtifactId:e.compiledArtifactId,bundles:t.value}}:t}function xt(e){if(!k(e)||typeof e.installationId!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.bundles))return x("tool handler bundles data surface shape is invalid");let t=q(e.bundles);return t.ok?{ok:!0,value:{installationId:e.installationId,artifactDigest:e.artifactDigest,bundles:t.value}}:t}function q(e){let t=[];for(let n of e){let o=le(n);if(!o.ok)return o;t.push(o.value)}return{ok:!0,value:t}}function le(e){if(!k(e)||typeof e.toolRef!="string"||e.kind!=="handler"&&e.kind!=="request")return x("handler bundle entry shape is invalid");if(e.kind==="request"){if(e.module!==void 0)return x("a request bundle must not carry a module");let o=A(e.runtimeNetwork);return o.ok?{ok:!0,value:{toolRef:e.toolRef,kind:"request",runtimeNetwork:o.value}}:o}let t=e.module;if(!k(t)||typeof t.entry!="string"||t.entry.length===0||!ge(t.files))return x("a handler bundle must carry a { entry, files } module");let n=A(e.runtimeNetwork);return n.ok?{ok:!0,value:{toolRef:e.toolRef,kind:"handler",module:{entry:t.entry,files:t.files},runtimeNetwork:n.value}}:n}function x(e){return{ok:!1,kind:"shape",reason:e}}function B(e){return{ok:!1,kind:"runtime_network",reason:e}}function k(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function K(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function ge(e){return k(e)&&Object.values(e).every(t=>typeof t=="string")}var T="/internal/webhook-trigger-instances",At="/:triggerInstanceId/context",Ct="/:triggerInstanceId/handler-bundles",Nt="/:triggerInstanceId/deliveries/:deliveryId",bt="/:triggerInstanceId/events",Ot="/:triggerInstanceId/rearm",w=e=>`${T}/${encodeURIComponent(e)}`;function vt(e,t){return`${w(e)}/context?artifactDigest=${encodeURIComponent(t)}`}function Dt(e,t){return`${w(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function Ut(e,t){return`${w(e)}/deliveries/${encodeURIComponent(t)}`}function Bt(e){return`${w(e)}/events`}function Ht(e){return`${w(e)}/rearm`}var Ft="/:installationId/webhook-protocol-adapter-bundle";function $t(e){return`${H}/${encodeURIComponent(e.installationId)}/webhook-protocol-adapter-bundle?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var Lt="modules/webhook/protocol-adapter.js";function Mt(e){return`modules/webhook/protocol-adapter-${e}.js`}function Gt(e){let t=i(e)?I(e.stateScope):r("webhook watcher context state scope is invalid");return!i(e)||typeof e.artifactDigest!="string"||typeof e.triggerRef!="string"||typeof e.triggerName!="string"||typeof e.integrationRef!="string"||!i(e.inputs)||e.connection!==null&&!fe(e.connection)||!Re(e.runtime)||!t.ok||t.value.kind!=="webhook-trigger"?r("webhook watcher context surface shape is invalid"):a(e)}function fe(e){return i(e)&&typeof e.connectionId=="string"&&typeof e.connectionRef=="string"&&typeof e.integrationRef=="string"&&typeof e.authType=="string"}function Re(e){if(!i(e)||e.type!=="webhook"||typeof e.trigger_ref!="string")return!1;let t=e.webhook;return i(t)&&typeof t.event_handler_module=="string"&&typeof t.enable_handler_module=="string"&&typeof t.disable_handler_module=="string"}function Kt(e){if(!i(e)||typeof e.deliveryId!="string"||typeof e.receivedAt!="string"||!i(e.request))return r("webhook delivery surface shape is invalid");let t=e.request;return t.method!=="POST"||!i(t.headers)||typeof t.rawBody!="string"?r("webhook delivery request shape is invalid"):a(e)}function qt(e){if(!i(e)||typeof e.triggerRef!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.modules)||!e.modules.every(me))return{ok:!1,kind:"shape",reason:"trigger handler bundles data surface shape is invalid"};let t=A(e.runtimeNetwork);return t.ok?{ok:!0,value:{triggerRef:e.triggerRef,artifactDigest:e.artifactDigest,modules:e.modules,runtimeNetwork:t.value}}:t}function me(e){return i(e)&&typeof e.specifier=="string"&&e.specifier.length>0&&typeof e.source=="string"}function Wt(e){if(!i(e))return r("publish events body must be a JSON object");let t=F(e,["deliveryId","events"]);if(t!==void 0)return r(`publish events does not accept the "${t}" field`);let n=e.deliveryId;if(typeof n!="string"||n.length===0)return r("deliveryId must be a non-empty string");let o=e.events;if(!Array.isArray(o))return r("events must be an array");let s=[];for(let u of o){let c=ye(u);if(!c.ok)return c;s.push(c.value)}return a({deliveryId:n,events:s})}function ye(e){if(!i(e))return r("each event must be a JSON object");let t=F(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return r(`event does not accept the "${t}" field`);let n=e.eventId;if(typeof n!="string"||n.length===0)return r("eventId must be a non-empty string");let o=e.occurredAt;if(typeof o!="string"||o.length===0)return r("occurredAt must be a non-empty string");if(!i(e.payload))return r("event payload must be a JSON object");let s={eventId:n,occurredAt:o,payload:e.payload};if(e.dedupeKey!==void 0){if(typeof e.dedupeKey!="string"||e.dedupeKey.length===0)return r("dedupeKey must be a non-empty string");s.dedupeKey=e.dedupeKey}return a(s)}function Vt(e){if(!i(e))return r("rearm body must be a JSON object");let t=F(e,["expectedWatcherInstanceId"]);if(t!==void 0)return r(`rearm does not accept the "${t}" field`);let n=e.expectedWatcherInstanceId;return typeof n!="string"||n.length===0?r("expectedWatcherInstanceId must be a non-empty string"):a({expectedWatcherInstanceId:n})}function F(e,t){return Object.keys(e).find(n=>!t.includes(n))}var h="/internal/polling-trigger-instances",Yt="/:pollingInstanceId/context",zt="/:pollingInstanceId/handler-bundles",Qt="/:pollingInstanceId/ticks/:tickId/events",$=e=>`${h}/${encodeURIComponent(e)}`;function Zt(e,t,n){return`${$(e)}/context?artifactDigest=${encodeURIComponent(t)}&tickId=${encodeURIComponent(n)}`}function en(e,t){return`${$(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function tn(e,t){return`${$(e)}/ticks/${encodeURIComponent(t)}/events`}function nn(e){let t=i(e)?I(e.stateScope):r("polling trigger context state scope is invalid");return!i(e)||typeof e.artifactDigest!="string"||typeof e.triggerRef!="string"||typeof e.triggerName!="string"||typeof e.integrationRef!="string"||!i(e.inputs)||e.connection!==null&&!Ie(e.connection)||!ke(e.runtime)||!t.ok||t.value.kind!=="polling-trigger"||!_e(e.tick)||!Ee(e.limits)?r("polling trigger context surface shape is invalid"):a(e)}function Ie(e){return i(e)&&typeof e.connectionId=="string"&&typeof e.connectionRef=="string"&&typeof e.integrationRef=="string"&&typeof e.authType=="string"}function ke(e){if(!i(e)||e.type!=="polling"||typeof e.trigger_id!="string"||typeof e.trigger_ref!="string")return!1;let t=e.polling;if(!i(t)||typeof t.run_handler_module!="string")return!1;let n=t.schedule;if(!i(n)||n.type!=="interval"||typeof n.every_seconds!="number")return!1;let o=t.dedup;return i(o)&&(o.strategy==="cursor"||o.strategy==="hash"||o.strategy==="id_field")}function _e(e){return i(e)&&typeof e.tickId=="string"&&typeof e.scheduledAt=="string"&&typeof e.attempt=="number"}function Ee(e){return i(e)&&typeof e.maxEventsPerTick=="number"}function rn(e){if(!i(e))return r("publish body must be a JSON object");let t=W(e,["events","nextCursor"]);if(t!==void 0)return r(`publish does not accept the "${t}" field`);let n=e.events;if(!Array.isArray(n))return r("events must be an array");let o=[];for(let u of n){let c=xe(u);if(!c.ok)return c;o.push(c.value)}let s={events:o};if("nextCursor"in e){let u=e.nextCursor;if(u!==null&&typeof u!="string")return r("nextCursor must be a string, null, or omitted");s.nextCursor=u}return a(s)}function xe(e){if(!i(e))return r("each event must be a JSON object");let t=W(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return r(`event does not accept the "${t}" field`);if(typeof e.eventId!="string"||e.eventId.length===0)return r("event eventId must be a non-empty string");if(!i(e.payload))return r("event payload must be a JSON object");let n={eventId:e.eventId,payload:e.payload};if(e.occurredAt!==void 0){if(typeof e.occurredAt!="string"||e.occurredAt.length===0)return r("event occurredAt must be a non-empty string");n.occurredAt=e.occurredAt}if(e.dedupeKey!==void 0){if(typeof e.dedupeKey!="string"||e.dedupeKey.length===0)return r("event dedupeKey must be a non-empty string");n.dedupeKey=e.dedupeKey}return a(n)}function on(e){return!i(e)||typeof e.tickId!="string"||typeof e.cursorUpdated!="boolean"||!Array.isArray(e.results)||!e.results.every(Te)?r("publish polling tick events data surface shape is invalid"):a(e)}function Te(e){return i(e)&&typeof e.eventId=="string"&&typeof e.dedupeKey=="string"&&typeof e.duplicate=="boolean"&&(e.flowRunId===null||typeof e.flowRunId=="string")}function W(e,t){return Object.keys(e).find(n=>!t.includes(n))}var V="/internal/egress-grants",L="/internal/tool-invocations",pn="/:flowRunId/egress-grant",ln="/:invocationId/egress-grant",gn="/:pollingInstanceId/egress-grant",fn="/:triggerInstanceId/egress-grant",Rn="/:grantId/consume",mn="/:grantId/audit",yn=e=>`${f}/${encodeURIComponent(e)}/egress-grant`,In=e=>`${L}/${encodeURIComponent(e)}/egress-grant`,kn=e=>`${h}/${encodeURIComponent(e)}/egress-grant`,_n=e=>`${T}/${encodeURIComponent(e)}/egress-grant`,En=e=>`${V}/${encodeURIComponent(e)}/consume`,xn=e=>`${V}/${encodeURIComponent(e)}/audit`,we=["flow_action","single_tool","polling_trigger","webhook_trigger"],he=/^[A-Za-z0-9][A-Za-z0-9:_+/=.-]{15,1023}$/;function P(e){return typeof e=="string"&&he.test(e)}function Pe(e){if(!i(e)||e.body_type!=="multipart")return!1;let t=e.body;if(!i(t))return!1;let n=t.parts;return Array.isArray(n)?n.some(o=>i(o)?o.kind==="file"&&typeof o.file_id=="string"&&o.file_id.length>0:!1):!1}function d(e){return{ok:!1,kind:"shape",reason:e}}function S(){return{ok:!1,kind:"request_digest",reason:"request digest is missing or malformed"}}function N(e,t){if(!i(e))return{ok:!1,reason:"grant request body must be a JSON object"};for(let n of Object.keys(e))if(!t.includes(n))return{ok:!1,reason:`grant request does not accept the "${n}" field`};return{ok:!0,record:e}}function b(e){if(!i(e))return"request must be a JSON object"}function Tn(e){let t=N(e,["nodeId","request","requestDigest"]);if(!t.ok)return d(t.reason);let n=t.record.nodeId;if(typeof n!="string"||n.length===0)return d("nodeId is required");let o=b(t.record.request);if(o!==void 0)return d(o);let s=t.record.requestDigest;return P(s)?{ok:!0,value:{nodeId:n,requestDigest:s,requestHasMultipartFiles:Pe(t.record.request)}}:S()}function wn(e){let t=N(e,["request","requestDigest"]);if(!t.ok)return d(t.reason);let n=b(t.record.request);if(n!==void 0)return d(n);let o=t.record.requestDigest;return P(o)?{ok:!0,value:{requestDigest:o}}:S()}function hn(e){let t=N(e,["tickId","request","requestDigest"]);if(!t.ok)return d(t.reason);let n=t.record.tickId;if(typeof n!="string"||n.length===0)return d("tickId is required");let o=b(t.record.request);if(o!==void 0)return d(o);let s=t.record.requestDigest;return P(s)?{ok:!0,value:{tickId:n,requestDigest:s}}:S()}function Pn(e){let t=N(e,["phase","lifecycle","request","requestDigest"]);if(!t.ok)return d(t.reason);let n=t.record.phase;if(n!=="lifecycle"&&n!=="handler")return d('phase must be "lifecycle" or "handler"');let o=t.record.lifecycle,s;if(o!==void 0){if(o!=="enable"&&o!=="disable"&&o!=="renew")return d('lifecycle must be "enable", "disable", or "renew"');s=o}if(n==="lifecycle"&&s===void 0)return d("lifecycle is required for the lifecycle phase");let u=b(t.record.request);if(u!==void 0)return d(u);let c=t.record.requestDigest;return P(c)?{ok:!0,value:{phase:n,...s!==void 0?{lifecycle:s}:{},requestDigest:c}}:S()}function j(e){return we.includes(e)?e:void 0}var Se=["scopeKind","scopeId","requestDigest"];function Sn(e){if(!i(e))return d("consume body must be a JSON object");for(let s of Object.keys(e))if(!Se.includes(s))return d(`consume does not accept the "${s}" field`);let t=j(e.scopeKind);if(t===void 0)return d("scopeKind is invalid");let n=e.scopeId;if(typeof n!="string"||n.length===0)return d("scopeId is required");let o=e.requestDigest;return P(o)?{ok:!0,value:{scopeKind:t,scopeId:n,requestDigest:o}}:S()}var Ae=["scopeKind","scopeId","providerHost","status","durationMs","requestBytes","responseBytes","errorCode"];function C(e,t){return typeof e!="number"||!Number.isInteger(e)||e<0?{ok:!1,reason:`${t} must be a non-negative integer`}:{ok:!0,value:e}}function An(e){if(!i(e))return d("audit body must be a JSON object");for(let l of Object.keys(e))if(!Ae.includes(l))return d(`audit does not accept the "${l}" field`);let t=j(e.scopeKind);if(t===void 0)return d("scopeKind is invalid");let n=e.scopeId;if(typeof n!="string"||n.length===0)return d("scopeId is required");let o=e.providerHost;if(typeof o!="string"||o.length===0)return d("providerHost is required");let s=C(e.durationMs,"durationMs");if(!s.ok)return d(s.reason);let u;if(e.status!==void 0){let l=C(e.status,"status");if(!l.ok)return d(l.reason);u=l.value}let c;if(e.requestBytes!==void 0){let l=C(e.requestBytes,"requestBytes");if(!l.ok)return d(l.reason);c=l.value}let p;if(e.responseBytes!==void 0){let l=C(e.responseBytes,"responseBytes");if(!l.ok)return d(l.reason);p=l.value}let v;if(e.errorCode!==void 0){let l=e.errorCode;if(typeof l!="string"||l.length===0)return d("errorCode must be a non-empty string");v=l}return{ok:!0,value:{scopeKind:t,scopeId:n,providerHost:o,...u!==void 0?{status:u}:{},durationMs:s.value,...c!==void 0?{requestBytes:c}:{},...p!==void 0?{responseBytes:p}:{},...v!==void 0?{errorCode:v}:{}}}}function Cn(e){return!i(e)||!i(e.grant)?r("egress grant envelope must carry a grant object"):a(e.grant)}function Nn(e){return!i(e)||e.consumed!==!0?r("egress grant consume data must carry consumed:true"):a({consumed:!0})}var Hn="/:flowRunId/runtime-credential",Fn="/:invocationId/runtime-credential",$n="/:pollingInstanceId/runtime-credential",Ln="/:triggerInstanceId/runtime-credential",Mn=e=>`${f}/${encodeURIComponent(e)}/runtime-credential`,Gn=e=>`${L}/${encodeURIComponent(e)}/runtime-credential`,Kn=e=>`${h}/${encodeURIComponent(e)}/runtime-credential`,qn=e=>`${T}/${encodeURIComponent(e)}/runtime-credential`,Wn=["flow_action","tool_invoke","polling_trigger","webhook_trigger"];function O(e,t){if(!i(e))return{ok:!1,reason:"runtime credential request body must be a JSON object"};for(let n of Object.keys(e))if(!t.includes(n))return{ok:!1,reason:`runtime credential request does not accept the "${n}" field`};return{ok:!0,record:e}}function Vn(e){let t=O(e,["nodeId"]);if(!t.ok)return r(t.reason);let n=t.record.nodeId;return typeof n!="string"||n.length===0?r("nodeId is required"):a({nodeId:n})}function jn(e){let t=O(e??{},[]);return t.ok?a(null):r(t.reason)}function Jn(e){let t=O(e,["tickId"]);if(!t.ok)return r(t.reason);let n=t.record.tickId;return typeof n!="string"||n.length===0?r("tickId is required"):a({tickId:n})}function Xn(e){let t=O(e,["executionKind","deliveryId","lifecycleOperation"]);if(!t.ok)return r(t.reason);let n=t.record.executionKind;if(n!=="event_handler"&&n!=="lifecycle")return r('executionKind must be "event_handler" or "lifecycle"');let o,s=t.record.deliveryId;if(s!==void 0){if(typeof s!="string"||s.length===0)return r("deliveryId must be a non-empty string");o=s}let u,c=t.record.lifecycleOperation;if(c!==void 0){if(c!=="enable"&&c!=="disable"&&c!=="renew")return r('lifecycleOperation must be "enable", "disable", or "renew"');u=c}return n==="lifecycle"&&u===void 0?r("lifecycleOperation is required for the lifecycle execution kind"):a({executionKind:n,...o!==void 0?{deliveryId:o}:{},...u!==void 0?{lifecycleOperation:u}:{}})}function Yn(e){return!i(e)||typeof e.sessionId!="string"||typeof e.connectionId!="string"||!i(e.credential)?r("runtime credential session must carry sessionId, connectionId and a credential object"):a(e.credential)}function M(e){return!i(e)||typeof e.file_id!="string"||typeof e.name!="string"||typeof e.size_bytes!="number"||typeof e.created_at!="string"||typeof e.expires_at!="string"||e.mime_type!==void 0&&typeof e.mime_type!="string"||e.sha256!==void 0&&typeof e.sha256!="string"||e.source!==void 0&&typeof e.source!="string"?r("file ref data does not match the AIS file-ref shape"):a(e)}function J(e){return!i(e)||e.method!=="GET"&&e.method!=="PUT"||typeof e.url!="string"||typeof e.expires_at!="string"||!be(e.headers)?r("presigned file URL data is invalid"):a(e)}function Ce(e){if(!i(e))return r("file upload session data is invalid");let t=M(e.file);if(!t.ok)return r(t.reason);let n=J(e.upload);return n.ok?a({file:t.value,upload:n.value}):r(n.reason)}function X(e){if(!i(e)||!Ne(e.intent))return r("file access data is invalid");let t=M(e.file);if(!t.ok)return r(t.reason);let n=J(e.access);return n.ok?a({file:t.value,access:n.value,intent:e.intent}):r(n.reason)}function Ne(e){return e==="preview"||e==="download"||e==="text"}function be(e){return i(e)?Object.values(e).every(t=>typeof t=="string"):!1}var _="/internal/files",nr="/upload-session",rr="/:fileId/complete",or="/:fileId/access",ir="/:fileId/stat",sr="/:fileId/content",ar=()=>_,ur=()=>`${_}/upload-session`,cr=e=>`${_}/${encodeURIComponent(e)}/complete`,dr=(e,t)=>`${_}/${encodeURIComponent(e)}/access?intent=${encodeURIComponent(t)}`,Y=e=>`?scope_kind=${encodeURIComponent(e.scopeKind)}&scope_id=${encodeURIComponent(e.scopeId)}`,pr=(e,t)=>`${_}/${encodeURIComponent(e)}/stat${Y(t)}`,lr=(e,t)=>`${_}/${encodeURIComponent(e)}/content${Y(t)}`;function gr(e){if(!i(e))return r("internal file access data is invalid");if(e.intent==="runtime_read"||e.intent==="provider_multipart"){let t=X({...e,intent:"preview"});return t.ok?a({file:t.value.file,access:t.value.access,intent:e.intent}):r(t.reason)}return r("internal file access intent is invalid")}var yr="/:flowRunId/human-inputs",Ir="/:flowRunId/human-inputs/:requestId",kr="/:flowRunId/human-inputs/:requestId/expire",_r="/:flowRunId/human-inputs/:requestId/acknowledge",Oe=e=>`${f}/${encodeURIComponent(e)}/human-inputs`,z=(e,t)=>`${Oe(e)}/${encodeURIComponent(t)}`,Er=(e,t)=>`${z(e,t)}/expire`,xr=(e,t)=>`${z(e,t)}/acknowledge`,ve="human_input_resolved";function Tr(e){return`${ve}_${e}`}function g(e){return{ok:!1,reason:e}}function m(e,t){return i(e)?{ok:!0,value:e}:g(`${t} must be an object`)}function E(e,t){return typeof e!="string"||e.length===0?g(`${t} must be a non-empty string`):{ok:!0,value:e}}var De=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})$/;function Ue(e,t){return typeof e!="string"||!De.test(e)||Number.isNaN(Date.parse(e))?g(`${t} must be an ISO-8601 timestamp`):{ok:!0,value:e}}function Be(e){let t=m(e,"renderedPrompt");if(!t.ok)return t;let n=E(t.value.title,"renderedPrompt.title");if(!n.ok)return n;let o={title:n.value};if(t.value.body!==void 0){if(typeof t.value.body!="string")return g("renderedPrompt.body must be a string");o.body=t.value.body}if(t.value.format!==void 0){if(t.value.format!=="plain"&&t.value.format!=="markdown")return g("renderedPrompt.format is invalid");o.format=t.value.format}return{ok:!0,value:o}}function He(e){let t=m(e,"input");if(!t.ok)return t;let n=t.value.kind;if(n==="choice"){if(!Array.isArray(t.value.choices))return g("input.choices must be an array")}else if(n!=="text")if(n==="form"){if(!Array.isArray(t.value.fields))return g("input.fields must be an array")}else return g("input.kind is invalid");return{ok:!0,value:t.value}}function Fe(e){if(e==null)return{ok:!0,value:void 0};let t=m(e,"partiallyRenderedDelivery");if(!t.ok)return t;let n=t.value.actions;if(n===void 0)return{ok:!0,value:{}};if(!Array.isArray(n))return g("partiallyRenderedDelivery.actions must be an array");let o=[];for(let s of n){let u=m(s,"delivery action");if(!u.ok)return u;let c=E(u.value.id,"delivery action id");if(!c.ok)return c;let p=Q(u.value.inputs,`delivery action '${c.value}' inputs`);if(!p.ok)return p;o.push({id:c.value,inputs:p.value})}return{ok:!0,value:{actions:o}}}function Q(e,t){let n=m(e,t);if(!n.ok)return n;let o={};for(let[s,u]of Object.entries(n.value)){let c=Z(u,`${t}.${s}`);if(!c.ok)return c;o[s]=c.value}return{ok:!0,value:o}}function Z(e,t){let n=m(e,t);if(!n.ok)return n;switch(n.value.kind){case"literal":return{ok:!0,value:{kind:"literal",value:n.value.value}};case"human_input_ref":{let s=E(n.value.path,`${t}.path`);return s.ok?{ok:!0,value:{kind:"human_input_ref",path:s.value}}:s}case"array":{if(!Array.isArray(n.value.items))return g(`${t}.items must be an array`);let s=[];for(let[u,c]of n.value.items.entries()){let p=Z(c,`${t}[${u}]`);if(!p.ok)return p;s.push(p.value)}return{ok:!0,value:{kind:"array",items:s}}}case"object":{let s=Q(n.value.entries,`${t}.entries`);return s.ok?{ok:!0,value:{kind:"object",entries:s.value}}:s}case"template":{if(!Array.isArray(n.value.parts))return g(`${t}.parts must be an array`);let s=[];for(let[u,c]of n.value.parts.entries()){let p=$e(c,`${t}.parts[${u}]`);if(!p.ok)return p;s.push(p.value)}return{ok:!0,value:{kind:"template",parts:s}}}default:return g(`${t}.kind is invalid`)}}function $e(e,t){let n=m(e,t);if(!n.ok)return n;let o=n.value.kind;if(o==="literal")return typeof n.value.value!="string"?g(`${t}.value must be a string`):{ok:!0,value:{kind:"literal",value:n.value.value}};if(o==="human_input_ref"){let s=E(n.value.path,`${t}.path`);return s.ok?{ok:!0,value:{kind:"human_input_ref",path:s.value}}:s}return g(`${t}.kind is invalid`)}function wr(e){let t=m(e,"request body");if(!t.ok)return r(t.reason);let n=E(t.value.nodeId,"nodeId");if(!n.ok)return r(n.reason);let o=Be(t.value.renderedPrompt);if(!o.ok)return r(o.reason);let s=He(t.value.input);if(!s.ok)return r(s.reason);let u=E(t.value.timeout,"timeout");if(!u.ok)return r(u.reason);let c=Ue(t.value.expiresAt,"expiresAt");if(!c.ok)return r(c.reason);let p=Fe(t.value.partiallyRenderedDelivery);return p.ok?a({nodeId:n.value,renderedPrompt:o.value,input:s.value,timeout:u.value,expiresAt:c.value,...p.value!==void 0?{partiallyRenderedDelivery:p.value}:{}}):r(p.reason)}function Le(e){return!i(e)||typeof e.id!="string"||e.id.length===0||typeof e.nodeId!="string"||typeof e.status!="string"||!(e.output===null||i(e.output))?r("human input request view must carry id, nodeId, status and output"):a(e)}function hr(e){if(!i(e)||typeof e.created!="boolean")return r("human input create data must carry created:boolean");let t=Le(e.request);return t.ok?a({created:e.created,request:t.value}):t}function Pr(e){return!i(e)||e.acknowledged!==!0?r("human input acknowledge data must carry acknowledged:true"):a({acknowledged:!0})}var Ar="ablehi-wfp-user-runtime-manifest/v1",Cr="unknown";function Nr(e){return e.endsWith(".js")?`${e.slice(0,-3)}.manifest.json`:`${e}.manifest.json`}var Or="/internal/deployment-handshake",Me=["start","terminate","send-event","start-webhook-watcher","run-polling-tick","invoke-tool","invoke-trigger-handler","invoke-webhook-protocol-adapter","deployment-handshake"],vr=Me,Dr="HANDSHAKE_REQUEST_INVALID",Ur="HANDSHAKE_SECRET_UNCONFIGURED",Br="HANDSHAKE_SECRET_MISMATCH",Hr="HANDSHAKE_CONTRACT_VERSION_MISMATCH",Fr="HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH",$r="HANDSHAKE_CAPABILITY_MISSING";function Lr(e){return[e.nonce,e.timestamp,e.contractVersion,e.dispatchNamespace].map(n=>`${n.length}:${n}`).join(".")}function Mr(e){return["response",e.nonce,e.contractVersion,e.dispatchNamespace,...e.capabilities].map(n=>`${n.length}:${n}`).join(".")}export{Me as DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES,vr as DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES,Or as DEPLOYMENT_HANDSHAKE_ROUTE,mn as EGRESS_GRANT_AUDIT_ROUTE_SUBPATH,Rn as EGRESS_GRANT_CONSUME_ROUTE_SUBPATH,we as EGRESS_GRANT_SCOPE_KINDS,it as EVENT_WAIT_ROUTE_SUBPATH,ze as EXECUTION_CONTEXT_ROUTE_SUBPATH,or as FILE_ACCESS_ROUTE_SUBPATH,rr as FILE_COMPLETE_ROUTE_SUBPATH,sr as FILE_CONTENT_ROUTE_SUBPATH,ir as FILE_STAT_ROUTE_SUBPATH,nr as FILE_UPLOAD_SESSION_ROUTE_SUBPATH,te as FLOW_INTERPRETER_CONTRACT_VERSION,Ke as FLOW_IR_SCHEMA_VERSION,pn as FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH,ot as FLOW_RUN_RESULT_ROUTE_SUBPATH,Hn as FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,yt as HANDLER_BUNDLES_ROUTE_SUBPATH,$r as HANDSHAKE_CAPABILITY_MISSING,Hr as HANDSHAKE_CONTRACT_VERSION_MISMATCH,Fr as HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH,Dr as HANDSHAKE_REQUEST_INVALID,Br as HANDSHAKE_SECRET_MISMATCH,Ur as HANDSHAKE_SECRET_UNCONFIGURED,yr as HUMAN_INPUTS_ROUTE_SUBPATH,_r as HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH,kr as HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH,Ir as HUMAN_INPUT_REQUEST_ROUTE_SUBPATH,ve as HUMAN_INPUT_RESOLVED_EVENT_PREFIX,V as INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX,_ as INTERNAL_FILES_ROUTE_PREFIX,f as INTERNAL_FLOW_RUNS_ROUTE_PREFIX,de as INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX,H as INTERNAL_INSTALLATIONS_ROUTE_PREFIX,h as INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX,L as INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX,T as INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX,Yt as POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH,gn as POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,zt as POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,$n as POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Qt as POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH,Wn as RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS,ee as SERVER_CONTRACT_VERSION,rt as STEP_RESULT_ROUTE_SUBPATH,It as TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH,ln as TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH,Fn as TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Ft as WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH,Lt as WEBHOOK_PROTOCOL_ADAPTER_MODULE,At as WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH,Nt as WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH,fn as WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,bt as WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH,Ct as WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,Ot as WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH,Ln as WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Ar as WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION,Cr as WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION,r as contractParseFail,a as contractParseOk,Lr as deploymentHandshakeProbePayload,Mr as deploymentHandshakeResponseProofPayload,xn as egressGrantAuditPath,En as egressGrantConsumePath,ut as eventWaitPath,Qe as executionContextPath,yn as flowRunEgressGrantPath,at as flowRunResultPath,Mn as flowRunRuntimeCredentialPath,Mt as flowScriptProtocolAdapterModuleName,kt as handlerBundlesPath,xr as humanInputAcknowledgePath,Er as humanInputExpirePath,z as humanInputRequestPath,Tr as humanInputResolvedEventType,Oe as humanInputsPath,dr as internalFileAccessPath,cr as internalFileCompletePath,lr as internalFileContentPath,pr as internalFileStatPath,ur as internalFileUploadSessionPath,ar as internalFilesPath,i as isJsonRecord,P as isValidRequestDigest,ft as parseCompleteFlowRunWaitBody,wr as parseCreateHumanInputBody,An as parseEgressGrantAuditBody,Sn as parseEgressGrantConsumeBody,Nn as parseEgressGrantConsumeData,Cn as parseEgressGrantData,Ze as parseExecutionContextData,M as parseFileRefData,ie as parseFileRuntimeLimits,Ce as parseFileUploadSessionData,Tn as parseFlowActionGrantBody,pt as parseFlowRunResultBody,lt as parseFlowRunResultData,Vn as parseFlowRuntimeCredentialBody,le as parseHandlerBundle,Et as parseHandlerBundlesData,Pr as parseHumanInputAcknowledgeData,hr as parseHumanInputCreateData,Le as parseHumanInputRequestViewData,gr as parseInternalFileAccessData,rn as parsePollingPublishBody,Jn as parsePollingRuntimeCredentialBody,nn as parsePollingTriggerContext,hn as parsePollingTriggerGrantBody,on as parsePublishPollingTickEventsData,gt as parseRegisterFlowRunWaitBody,Rt as parseRegisterFlowRunWaitData,Yn as parseRuntimeCredentialSessionCredential,A as parseRuntimeNetwork,wn as parseSingleToolGrantBody,jn as parseSingleToolRuntimeCredentialBody,ct as parseStepRecordBody,dt as parseStepRecordData,xt as parseToolHandlerBundlesData,qt as parseTriggerHandlerBundlesData,Kt as parseWebhookDelivery,Wt as parseWebhookPublishEventsBody,Vt as parseWebhookRearmBody,Xn as parseWebhookRuntimeCredentialBody,Pn as parseWebhookTriggerGrantBody,Gt as parseWebhookWatcherContext,Zt as pollingTriggerContextPath,kn as pollingTriggerEgressGrantPath,en as pollingTriggerHandlerBundlesPath,Kn as pollingTriggerRuntimeCredentialPath,tn as pollingTriggerTickEventsPath,Pe as requestHasMultipartFileParts,st as stepResultPath,_t as toolHandlerBundlesPath,In as toolInvocationEgressGrantPath,Gn as toolInvocationRuntimeCredentialPath,$t as webhookProtocolAdapterBundlePath,vt as webhookTriggerContextPath,Ut as webhookTriggerDeliveryPath,_n as webhookTriggerEgressGrantPath,Bt as webhookTriggerEventsPath,Dt as webhookTriggerHandlerBundlesPath,Ht as webhookTriggerRearmPath,qn as webhookTriggerRuntimeCredentialPath,Nr as wfpUserRuntimeManifestPath};
1
+ var ee="0.2.6";var qe="flow.ir.v1";var te="flow.interp.v2";function a(e){return{ok:!0,value:e}}function r(e){return{ok:!1,reason:e}}function i(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function I(e){if(!i(e)||typeof e.kind!="string")return r("context state scope surface shape is invalid");switch(e.kind){case"webhook-trigger":return ne(e);case"polling-trigger":return re(e);case"flow-action":return oe(e);default:return r("context state scope kind is invalid")}}function ne(e){let t=U(e,["kind","workspaceId","triggerInstanceId"]);return t!==void 0?r(`webhook trigger scope does not accept "${t}"`):e.kind!=="webhook-trigger"||!R(e.workspaceId)||!R(e.triggerInstanceId)?r("webhook trigger state scope is invalid"):a({kind:"webhook-trigger",workspaceId:e.workspaceId,triggerInstanceId:e.triggerInstanceId})}function re(e){let t=U(e,["kind","workspaceId","pollingInstanceId"]);return t!==void 0?r(`polling trigger scope does not accept "${t}"`):e.kind!=="polling-trigger"||!R(e.workspaceId)||!R(e.pollingInstanceId)?r("polling trigger state scope is invalid"):a({kind:"polling-trigger",workspaceId:e.workspaceId,pollingInstanceId:e.pollingInstanceId})}function oe(e){let t=U(e,["kind","workspaceId","flowId","nodeId","connectionId"]);if(t!==void 0)return r(`flow action scope does not accept "${t}"`);let n=e.connectionId;return e.kind!=="flow-action"||!R(e.workspaceId)||!R(e.flowId)||!R(e.nodeId)||n!==null&&!R(n)?r("flow action state scope is invalid"):a({kind:"flow-action",workspaceId:e.workspaceId,flowId:e.flowId,nodeId:e.nodeId,connectionId:n})}function R(e){return typeof e=="string"&&e.length>0}function U(e,t){return Object.keys(e).find(n=>!t.includes(n))}var f="/internal/flow-runs",Qe="/:flowRunId/execution-context";function Ze(e){return`${f}/${encodeURIComponent(e)}/execution-context`}function ie(e){return!i(e)||!B(e.fileMaxBytes)||!B(e.fileReadMaxBytes)||!B(e.inlineMultipartBytesMax)?r("file runtime limits must carry three positive integer bounds"):a({fileMaxBytes:e.fileMaxBytes,fileReadMaxBytes:e.fileReadMaxBytes,inlineMultipartBytesMax:e.inlineMultipartBytesMax})}function et(e){if(!i(e))return r("execution context must be a JSON object");let t=e.compiled;if(typeof e.flowRunId!="string"||typeof e.workspaceId!="string"||!i(e.input)||!i(t)||typeof t.irSchemaVersion!="string"||typeof t.interpreterContractVersion!="string"||typeof t.compiledArtifactId!="string"||!i(t.ir)||!Array.isArray(t.ir.nodes)||!ae(e.executionBindings))return r("execution context surface shape is invalid");let n=se(e.fileRuntime);return n.ok?a({...e,fileRuntime:n.value}):r(n.reason)}function se(e){if(e===null)return a(null);if(!i(e))return r("fileRuntime must be null or an object");let t=ie(e.limits);return t.ok?a({limits:t.value}):r(t.reason)}function ae(e){return Array.isArray(e)?e.every(t=>{if(!i(t))return!1;let n=t.connection,o=I(t.stateScope);return typeof t.nodeId=="string"&&typeof t.toolRef=="string"&&i(t.toolDescriptor)&&i(t.integrationDescriptor)&&i(n)&&typeof n.installationId=="string"&&typeof n.connectionRef=="string"&&typeof n.connectionId=="string"&&typeof n.authType=="string"&&o.ok}):!1}function B(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var ot="/:flowRunId/steps/:nodeId/result",it="/:flowRunId/result",st="/:flowRunId/event-waits/:nodeId";function at(e,t){return`${f}/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}/result`}function ut(e){return`${f}/${encodeURIComponent(e)}/result`}function ct(e,t){return`${f}/${encodeURIComponent(e)}/event-waits/${encodeURIComponent(t)}`}function dt(e){if(!i(e))return{ok:!1,kind:"validation",reason:"step record body must be a JSON object"};let t=y(e,["attempt","result","durationMs"]);if(t!==void 0)return{ok:!1,kind:"validation",reason:`step record does not accept the "${t}" field`};let n=e.attempt;if(typeof n!="number"||!Number.isInteger(n)||n<=0)return{ok:!1,kind:"validation",reason:"attempt must be a positive integer"};let o=ue(e.result);if(!o.ok)return o;let s={attempt:n,result:o.value};if(e.durationMs!==void 0){let u=e.durationMs;if(typeof u!="number"||!Number.isFinite(u)||u<0)return{ok:!1,kind:"validation",reason:"durationMs must be a non-negative number"};s.durationMs=u}return{ok:!0,value:s}}function ue(e){if(!i(e))return{ok:!1,kind:"step_result_invalid",reason:"result must be a JSON object"};let t=e.status;if(t==="succeeded"){let n=y(e,["status","output"]);return n!==void 0?{ok:!1,kind:"validation",reason:`step record result does not accept the "${n}" field`}:"output"in e?{ok:!0,value:{status:"succeeded",output:e.output}}:{ok:!1,kind:"step_result_invalid",reason:"a succeeded result must carry output"}}if(t==="failed"){let n=y(e,["status","errorCode","issues"]);if(n!==void 0)return{ok:!1,kind:"validation",reason:`step record result does not accept the "${n}" field`};let o=e.errorCode;if(typeof o!="string"||o.length===0)return{ok:!1,kind:"step_result_invalid",reason:"a failed result must carry a non-empty errorCode"};let s={status:"failed",errorCode:o};return e.issues!==void 0&&(s.issues=e.issues),{ok:!0,value:s}}return{ok:!1,kind:"step_result_invalid",reason:'result status must be "succeeded" or "failed"'}}function pt(e){return!i(e)||typeof e.flowRunId!="string"||typeof e.nodeId!="string"||e.recorded!=="succeeded"&&e.recorded!=="failed"?r("step record data surface shape is invalid"):a({flowRunId:e.flowRunId,nodeId:e.nodeId,recorded:e.recorded})}function lt(e){if(!i(e))return r("result body must be a JSON object");let t=y(e,["status","output","error","composition"]);if(t!==void 0)return r(`result does not accept the "${t}" field`);let n=e.status;if(n!=="succeeded"&&n!=="failed")return r('result status must be "succeeded" or "failed"');let o={status:n};if(e.output!==void 0&&(o.output=e.output),e.error!==void 0){let s=e.error;if(!i(s))return r("result error must be a JSON object");let u=y(s,["code","message"]);if(u!==void 0)return r(`result error does not accept the "${u}" field`);if(typeof s.code!="string"||typeof s.message!="string")return r("result error must carry string code and message");o.error={code:s.code,message:s.message}}if(e.composition!==void 0){if(n!=="succeeded")return r("composition is only allowed on a succeeded result");o.composition=e.composition}return a(o)}function gt(e){return i(e)?a(e):r("flow run result data must be a JSON object")}var ce=/^[A-Za-z0-9_-]{1,100}$/;function ft(e){if(!i(e))return r("register body must be a JSON object");let t=y(e,["eventType","correlationKey"]);if(t!==void 0)return r(`register wait does not accept the "${t}" field`);let n=G(e.eventType);if(!n.ok)return r(n.reason);let o=e.correlationKey;return typeof o!="string"||o.length===0?r("correlationKey must be a non-empty string"):a({eventType:n.value,correlationKey:o})}function Rt(e){if(!i(e))return r("complete body must be a JSON object");let t=y(e,["eventType","correlationKey","outcome","eventId"]);if(t!==void 0)return r(`complete wait does not accept the "${t}" field`);let n=e.outcome;if(n!=="received"&&n!=="timed_out")return r('outcome must be "received" or "timed_out"');let o=G(e.eventType);if(!o.ok)return r(o.reason);let s=e.correlationKey;if(typeof s!="string"||s.length===0)return r("correlationKey must be a non-empty string");let u={eventType:o.value,correlationKey:s,outcome:n};if(e.eventId!==void 0){if(typeof e.eventId!="string"||e.eventId.length===0)return r("eventId must be a non-empty string");u.eventId=e.eventId}return a(u)}function mt(e){return!i(e)||e.registered!==!0?r("register wait data surface shape is invalid"):a({registered:!0})}function G(e){return typeof e!="string"||e.length===0?r("eventType must be a non-empty string"):ce.test(e)?a(e):r("eventType must match ^[A-Za-z0-9_-]{1,100}$")}function y(e,t){return Object.keys(e).find(n=>!t.includes(n))}var de="/internal/flow-versions",It="/:flowVersionId/handler-bundles",F="/internal/installations",kt="/:installationId/handler-bundles";function _t(e,t){return`${de}/${encodeURIComponent(e)}/handler-bundles?compiledArtifactId=${encodeURIComponent(t)}`}function Et(e){return`${F}/${encodeURIComponent(e.installationId)}/handler-bundles?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var pe=new Set(["managed_only","managed_plus_unmanaged_sdk"]);function A(e){if(!k(e))return H("runtimeNetwork must be a JSON object");let t=e.networkModel;return typeof t!="string"||!pe.has(t)?H("runtimeNetwork.networkModel is unknown"):!K(e.apiHosts)||!K(e.authHosts)||typeof e.httpsOnly!="boolean"?H("runtimeNetwork host/https fields are invalid"):{ok:!0,value:{networkModel:t,apiHosts:e.apiHosts,authHosts:e.authHosts,httpsOnly:e.httpsOnly}}}function xt(e){if(!k(e)||typeof e.flowVersionId!="string"||typeof e.compiledArtifactId!="string"||!Array.isArray(e.bundles))return x("handler bundles data surface shape is invalid");let t=q(e.bundles);return t.ok?{ok:!0,value:{flowVersionId:e.flowVersionId,compiledArtifactId:e.compiledArtifactId,bundles:t.value}}:t}function Tt(e){if(!k(e)||typeof e.installationId!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.bundles))return x("tool handler bundles data surface shape is invalid");let t=q(e.bundles);return t.ok?{ok:!0,value:{installationId:e.installationId,artifactDigest:e.artifactDigest,bundles:t.value}}:t}function q(e){let t=[];for(let n of e){let o=le(n);if(!o.ok)return o;t.push(o.value)}return{ok:!0,value:t}}function le(e){if(!k(e)||typeof e.toolRef!="string"||e.kind!=="handler"&&e.kind!=="request")return x("handler bundle entry shape is invalid");if(e.kind==="request"){if(e.module!==void 0)return x("a request bundle must not carry a module");let o=A(e.runtimeNetwork);return o.ok?{ok:!0,value:{toolRef:e.toolRef,kind:"request",runtimeNetwork:o.value}}:o}let t=e.module;if(!k(t)||typeof t.entry!="string"||t.entry.length===0||!ge(t.files))return x("a handler bundle must carry a { entry, files } module");let n=A(e.runtimeNetwork);return n.ok?{ok:!0,value:{toolRef:e.toolRef,kind:"handler",module:{entry:t.entry,files:t.files},runtimeNetwork:n.value}}:n}function x(e){return{ok:!1,kind:"shape",reason:e}}function H(e){return{ok:!1,kind:"runtime_network",reason:e}}function k(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function K(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function ge(e){return k(e)&&Object.values(e).every(t=>typeof t=="string")}var T="/internal/webhook-trigger-instances",Ct="/:triggerInstanceId/context",Nt="/:triggerInstanceId/handler-bundles",bt="/:triggerInstanceId/deliveries/:deliveryId",Ot="/:triggerInstanceId/events",vt="/:triggerInstanceId/rearm",w=e=>`${T}/${encodeURIComponent(e)}`;function Dt(e,t){return`${w(e)}/context?artifactDigest=${encodeURIComponent(t)}`}function Ut(e,t){return`${w(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function Bt(e,t){return`${w(e)}/deliveries/${encodeURIComponent(t)}`}function Ht(e){return`${w(e)}/events`}function Ft(e){return`${w(e)}/rearm`}var Mt="/:installationId/webhook-protocol-adapter-bundle";function $t(e){return`${F}/${encodeURIComponent(e.installationId)}/webhook-protocol-adapter-bundle?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var Lt="modules/webhook/protocol-adapter.js";function Gt(e){return`modules/webhook/protocol-adapter-${e}.js`}function Kt(e){let t=i(e)?I(e.stateScope):r("webhook watcher context state scope is invalid");return!i(e)||typeof e.artifactDigest!="string"||typeof e.triggerRef!="string"||typeof e.triggerName!="string"||typeof e.integrationRef!="string"||!i(e.inputs)||e.connection!==null&&!fe(e.connection)||!Re(e.runtime)||!t.ok||t.value.kind!=="webhook-trigger"?r("webhook watcher context surface shape is invalid"):a(e)}function fe(e){return i(e)&&typeof e.connectionId=="string"&&typeof e.connectionRef=="string"&&typeof e.integrationRef=="string"&&typeof e.authType=="string"}function Re(e){if(!i(e)||e.type!=="webhook"||typeof e.trigger_ref!="string")return!1;let t=e.webhook;return i(t)&&typeof t.event_handler_module=="string"&&typeof t.enable_handler_module=="string"&&typeof t.disable_handler_module=="string"}function qt(e){if(!i(e)||typeof e.deliveryId!="string"||typeof e.receivedAt!="string"||!i(e.request))return r("webhook delivery surface shape is invalid");let t=e.request;return t.method!=="POST"||!i(t.headers)||typeof t.rawBody!="string"?r("webhook delivery request shape is invalid"):a(e)}function Wt(e){if(!i(e)||typeof e.triggerRef!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.modules)||!e.modules.every(me))return{ok:!1,kind:"shape",reason:"trigger handler bundles data surface shape is invalid"};let t=A(e.runtimeNetwork);return t.ok?{ok:!0,value:{triggerRef:e.triggerRef,artifactDigest:e.artifactDigest,modules:e.modules,runtimeNetwork:t.value}}:t}function me(e){return i(e)&&typeof e.specifier=="string"&&e.specifier.length>0&&typeof e.source=="string"}function Vt(e){if(!i(e))return r("publish events body must be a JSON object");let t=M(e,["deliveryId","events"]);if(t!==void 0)return r(`publish events does not accept the "${t}" field`);let n=e.deliveryId;if(typeof n!="string"||n.length===0)return r("deliveryId must be a non-empty string");let o=e.events;if(!Array.isArray(o))return r("events must be an array");let s=[];for(let u of o){let c=ye(u);if(!c.ok)return c;s.push(c.value)}return a({deliveryId:n,events:s})}function ye(e){if(!i(e))return r("each event must be a JSON object");let t=M(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return r(`event does not accept the "${t}" field`);let n=e.eventId;if(typeof n!="string"||n.length===0)return r("eventId must be a non-empty string");let o=e.occurredAt;if(typeof o!="string"||o.length===0)return r("occurredAt must be a non-empty string");if(!i(e.payload))return r("event payload must be a JSON object");let s={eventId:n,occurredAt:o,payload:e.payload};if(e.dedupeKey!==void 0){if(typeof e.dedupeKey!="string"||e.dedupeKey.length===0)return r("dedupeKey must be a non-empty string");s.dedupeKey=e.dedupeKey}return a(s)}function jt(e){if(!i(e))return r("rearm body must be a JSON object");let t=M(e,["expectedWatcherInstanceId"]);if(t!==void 0)return r(`rearm does not accept the "${t}" field`);let n=e.expectedWatcherInstanceId;return typeof n!="string"||n.length===0?r("expectedWatcherInstanceId must be a non-empty string"):a({expectedWatcherInstanceId:n})}function M(e,t){return Object.keys(e).find(n=>!t.includes(n))}var h="/internal/polling-trigger-instances",zt="/:pollingInstanceId/context",Qt="/:pollingInstanceId/handler-bundles",Zt="/:pollingInstanceId/ticks/:tickId/events",$=e=>`${h}/${encodeURIComponent(e)}`;function en(e,t,n){return`${$(e)}/context?artifactDigest=${encodeURIComponent(t)}&tickId=${encodeURIComponent(n)}`}function tn(e,t){return`${$(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function nn(e,t){return`${$(e)}/ticks/${encodeURIComponent(t)}/events`}function rn(e){let t=i(e)?I(e.stateScope):r("polling trigger context state scope is invalid");return!i(e)||typeof e.artifactDigest!="string"||typeof e.triggerRef!="string"||typeof e.triggerName!="string"||typeof e.integrationRef!="string"||!i(e.inputs)||e.connection!==null&&!Ie(e.connection)||!ke(e.runtime)||!t.ok||t.value.kind!=="polling-trigger"||!_e(e.tick)||!Ee(e.limits)?r("polling trigger context surface shape is invalid"):a(e)}function Ie(e){return i(e)&&typeof e.connectionId=="string"&&typeof e.connectionRef=="string"&&typeof e.integrationRef=="string"&&typeof e.authType=="string"}function ke(e){if(!i(e)||e.type!=="polling"||typeof e.trigger_id!="string"||typeof e.trigger_ref!="string")return!1;let t=e.polling;if(!i(t)||typeof t.run_handler_module!="string")return!1;let n=t.schedule;if(!i(n)||n.type!=="interval"||typeof n.every_seconds!="number")return!1;let o=t.dedup;return i(o)&&(o.strategy==="cursor"||o.strategy==="hash"||o.strategy==="id_field")}function _e(e){return i(e)&&typeof e.tickId=="string"&&typeof e.scheduledAt=="string"&&typeof e.attempt=="number"}function Ee(e){return i(e)&&typeof e.maxEventsPerTick=="number"}function on(e){if(!i(e))return r("publish body must be a JSON object");let t=W(e,["events","nextCursor"]);if(t!==void 0)return r(`publish does not accept the "${t}" field`);let n=e.events;if(!Array.isArray(n))return r("events must be an array");let o=[];for(let u of n){let c=xe(u);if(!c.ok)return c;o.push(c.value)}let s={events:o};if("nextCursor"in e){let u=e.nextCursor;if(u!==null&&typeof u!="string")return r("nextCursor must be a string, null, or omitted");s.nextCursor=u}return a(s)}function xe(e){if(!i(e))return r("each event must be a JSON object");let t=W(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return r(`event does not accept the "${t}" field`);if(typeof e.eventId!="string"||e.eventId.length===0)return r("event eventId must be a non-empty string");if(!i(e.payload))return r("event payload must be a JSON object");let n={eventId:e.eventId,payload:e.payload};if(e.occurredAt!==void 0){if(typeof e.occurredAt!="string"||e.occurredAt.length===0)return r("event occurredAt must be a non-empty string");n.occurredAt=e.occurredAt}if(e.dedupeKey!==void 0){if(typeof e.dedupeKey!="string"||e.dedupeKey.length===0)return r("event dedupeKey must be a non-empty string");n.dedupeKey=e.dedupeKey}return a(n)}function sn(e){return!i(e)||typeof e.tickId!="string"||typeof e.cursorUpdated!="boolean"||!Array.isArray(e.results)||!e.results.every(Te)?r("publish polling tick events data surface shape is invalid"):a(e)}function Te(e){return i(e)&&typeof e.eventId=="string"&&typeof e.dedupeKey=="string"&&typeof e.duplicate=="boolean"&&(e.flowRunId===null||typeof e.flowRunId=="string")}function W(e,t){return Object.keys(e).find(n=>!t.includes(n))}var V="/internal/egress-grants",L="/internal/tool-invocations",ln="/:flowRunId/egress-grant",gn="/:invocationId/egress-grant",fn="/:pollingInstanceId/egress-grant",Rn="/:triggerInstanceId/egress-grant",mn="/:grantId/consume",yn="/:grantId/audit",In=e=>`${f}/${encodeURIComponent(e)}/egress-grant`,kn=e=>`${L}/${encodeURIComponent(e)}/egress-grant`,_n=e=>`${h}/${encodeURIComponent(e)}/egress-grant`,En=e=>`${T}/${encodeURIComponent(e)}/egress-grant`,xn=e=>`${V}/${encodeURIComponent(e)}/consume`,Tn=e=>`${V}/${encodeURIComponent(e)}/audit`,we=["flow_action","single_tool","polling_trigger","webhook_trigger"],he=/^[A-Za-z0-9][A-Za-z0-9:_+/=.-]{15,1023}$/;function P(e){return typeof e=="string"&&he.test(e)}function Pe(e){if(!i(e)||e.body_type!=="multipart")return!1;let t=e.body;if(!i(t))return!1;let n=t.parts;return Array.isArray(n)?n.some(o=>i(o)?o.kind==="file"&&typeof o.file_id=="string"&&o.file_id.length>0:!1):!1}function d(e){return{ok:!1,kind:"shape",reason:e}}function S(){return{ok:!1,kind:"request_digest",reason:"request digest is missing or malformed"}}function N(e,t){if(!i(e))return{ok:!1,reason:"grant request body must be a JSON object"};for(let n of Object.keys(e))if(!t.includes(n))return{ok:!1,reason:`grant request does not accept the "${n}" field`};return{ok:!0,record:e}}function b(e){if(!i(e))return"request must be a JSON object"}function wn(e){let t=N(e,["nodeId","request","requestDigest"]);if(!t.ok)return d(t.reason);let n=t.record.nodeId;if(typeof n!="string"||n.length===0)return d("nodeId is required");let o=b(t.record.request);if(o!==void 0)return d(o);let s=t.record.requestDigest;return P(s)?{ok:!0,value:{nodeId:n,requestDigest:s,requestHasMultipartFiles:Pe(t.record.request)}}:S()}function hn(e){let t=N(e,["request","requestDigest"]);if(!t.ok)return d(t.reason);let n=b(t.record.request);if(n!==void 0)return d(n);let o=t.record.requestDigest;return P(o)?{ok:!0,value:{requestDigest:o}}:S()}function Pn(e){let t=N(e,["tickId","request","requestDigest"]);if(!t.ok)return d(t.reason);let n=t.record.tickId;if(typeof n!="string"||n.length===0)return d("tickId is required");let o=b(t.record.request);if(o!==void 0)return d(o);let s=t.record.requestDigest;return P(s)?{ok:!0,value:{tickId:n,requestDigest:s}}:S()}function Sn(e){let t=N(e,["phase","lifecycle","request","requestDigest"]);if(!t.ok)return d(t.reason);let n=t.record.phase;if(n!=="lifecycle"&&n!=="handler")return d('phase must be "lifecycle" or "handler"');let o=t.record.lifecycle,s;if(o!==void 0){if(o!=="enable"&&o!=="disable"&&o!=="renew")return d('lifecycle must be "enable", "disable", or "renew"');s=o}if(n==="lifecycle"&&s===void 0)return d("lifecycle is required for the lifecycle phase");let u=b(t.record.request);if(u!==void 0)return d(u);let c=t.record.requestDigest;return P(c)?{ok:!0,value:{phase:n,...s!==void 0?{lifecycle:s}:{},requestDigest:c}}:S()}function j(e){return we.includes(e)?e:void 0}var Se=["scopeKind","scopeId","requestDigest"];function An(e){if(!i(e))return d("consume body must be a JSON object");for(let s of Object.keys(e))if(!Se.includes(s))return d(`consume does not accept the "${s}" field`);let t=j(e.scopeKind);if(t===void 0)return d("scopeKind is invalid");let n=e.scopeId;if(typeof n!="string"||n.length===0)return d("scopeId is required");let o=e.requestDigest;return P(o)?{ok:!0,value:{scopeKind:t,scopeId:n,requestDigest:o}}:S()}var Ae=["scopeKind","scopeId","providerHost","status","durationMs","requestBytes","responseBytes","errorCode"];function C(e,t){return typeof e!="number"||!Number.isInteger(e)||e<0?{ok:!1,reason:`${t} must be a non-negative integer`}:{ok:!0,value:e}}function Cn(e){if(!i(e))return d("audit body must be a JSON object");for(let l of Object.keys(e))if(!Ae.includes(l))return d(`audit does not accept the "${l}" field`);let t=j(e.scopeKind);if(t===void 0)return d("scopeKind is invalid");let n=e.scopeId;if(typeof n!="string"||n.length===0)return d("scopeId is required");let o=e.providerHost;if(typeof o!="string"||o.length===0)return d("providerHost is required");let s=C(e.durationMs,"durationMs");if(!s.ok)return d(s.reason);let u;if(e.status!==void 0){let l=C(e.status,"status");if(!l.ok)return d(l.reason);u=l.value}let c;if(e.requestBytes!==void 0){let l=C(e.requestBytes,"requestBytes");if(!l.ok)return d(l.reason);c=l.value}let p;if(e.responseBytes!==void 0){let l=C(e.responseBytes,"responseBytes");if(!l.ok)return d(l.reason);p=l.value}let D;if(e.errorCode!==void 0){let l=e.errorCode;if(typeof l!="string"||l.length===0)return d("errorCode must be a non-empty string");D=l}return{ok:!0,value:{scopeKind:t,scopeId:n,providerHost:o,...u!==void 0?{status:u}:{},durationMs:s.value,...c!==void 0?{requestBytes:c}:{},...p!==void 0?{responseBytes:p}:{},...D!==void 0?{errorCode:D}:{}}}}function Nn(e){return!i(e)||!i(e.grant)?r("egress grant envelope must carry a grant object"):a(e.grant)}function bn(e){return!i(e)||e.consumed!==!0?r("egress grant consume data must carry consumed:true"):a({consumed:!0})}var Fn="/:flowRunId/runtime-credential",Mn="/:invocationId/runtime-credential",$n="/:pollingInstanceId/runtime-credential",Ln="/:triggerInstanceId/runtime-credential",Gn=e=>`${f}/${encodeURIComponent(e)}/runtime-credential`,Kn=e=>`${L}/${encodeURIComponent(e)}/runtime-credential`,qn=e=>`${h}/${encodeURIComponent(e)}/runtime-credential`,Wn=e=>`${T}/${encodeURIComponent(e)}/runtime-credential`,Vn=["flow_action","tool_invoke","polling_trigger","webhook_trigger"];function O(e,t){if(!i(e))return{ok:!1,reason:"runtime credential request body must be a JSON object"};for(let n of Object.keys(e))if(!t.includes(n))return{ok:!1,reason:`runtime credential request does not accept the "${n}" field`};return{ok:!0,record:e}}function jn(e){let t=O(e,["nodeId"]);if(!t.ok)return r(t.reason);let n=t.record.nodeId;return typeof n!="string"||n.length===0?r("nodeId is required"):a({nodeId:n})}function Jn(e){let t=O(e??{},[]);return t.ok?a(null):r(t.reason)}function Xn(e){let t=O(e,["tickId"]);if(!t.ok)return r(t.reason);let n=t.record.tickId;return typeof n!="string"||n.length===0?r("tickId is required"):a({tickId:n})}function Yn(e){let t=O(e,["executionKind","deliveryId","lifecycleOperation"]);if(!t.ok)return r(t.reason);let n=t.record.executionKind;if(n!=="event_handler"&&n!=="lifecycle")return r('executionKind must be "event_handler" or "lifecycle"');let o,s=t.record.deliveryId;if(s!==void 0){if(typeof s!="string"||s.length===0)return r("deliveryId must be a non-empty string");o=s}let u,c=t.record.lifecycleOperation;if(c!==void 0){if(c!=="enable"&&c!=="disable"&&c!=="renew")return r('lifecycleOperation must be "enable", "disable", or "renew"');u=c}return n==="lifecycle"&&u===void 0?r("lifecycleOperation is required for the lifecycle execution kind"):a({executionKind:n,...o!==void 0?{deliveryId:o}:{},...u!==void 0?{lifecycleOperation:u}:{}})}function zn(e){return!i(e)||typeof e.sessionId!="string"||typeof e.connectionId!="string"||!i(e.credential)?r("runtime credential session must carry sessionId, connectionId and a credential object"):a(e.credential)}function v(e){return!i(e)||typeof e.file_id!="string"||typeof e.name!="string"||typeof e.size_bytes!="number"||typeof e.created_at!="string"||typeof e.expires_at!="string"||e.mime_type!==void 0&&typeof e.mime_type!="string"||e.sha256!==void 0&&typeof e.sha256!="string"||e.source!==void 0&&typeof e.source!="string"?r("file ref data does not match the AIS file-ref shape"):a(e)}function J(e){return!i(e)||e.method!=="GET"&&e.method!=="PUT"||typeof e.url!="string"||typeof e.expires_at!="string"||!Oe(e.headers)?r("presigned file URL data is invalid"):a(e)}function Ce(e){if(!i(e))return r("file upload session data is invalid");let t=v(e.file);if(!t.ok)return r(t.reason);let n=J(e.upload);return n.ok?a({file:t.value,upload:n.value}):r(n.reason)}function Ne(e){if(!i(e))return r("file metadata data is invalid");let t=v(e.file);return t.ok?a({file:t.value}):r(t.reason)}function X(e){if(!i(e)||!be(e.intent))return r("file access data is invalid");let t=v(e.file);if(!t.ok)return r(t.reason);let n=J(e.access);return n.ok?a({file:t.value,access:n.value,intent:e.intent}):r(n.reason)}function be(e){return e==="preview"||e==="download"||e==="text"}function Oe(e){return i(e)?Object.values(e).every(t=>typeof t=="string"):!1}var _="/internal/files",rr="/upload-session",or="/:fileId/complete",ir="/:fileId/access",sr="/:fileId/stat",ar="/:fileId/content",ur=()=>_,cr=()=>`${_}/upload-session`,dr=e=>`${_}/${encodeURIComponent(e)}/complete`,pr=(e,t)=>`${_}/${encodeURIComponent(e)}/access?intent=${encodeURIComponent(t)}`,Y=e=>`?scope_kind=${encodeURIComponent(e.scopeKind)}&scope_id=${encodeURIComponent(e.scopeId)}`,lr=(e,t)=>`${_}/${encodeURIComponent(e)}/stat${Y(t)}`,gr=(e,t)=>`${_}/${encodeURIComponent(e)}/content${Y(t)}`;function fr(e){if(!i(e))return r("internal file access data is invalid");if(e.intent==="runtime_read"||e.intent==="provider_multipart"){let t=X({...e,intent:"preview"});return t.ok?a({file:t.value.file,access:t.value.access,intent:e.intent}):r(t.reason)}return r("internal file access intent is invalid")}var Ir="/:flowRunId/human-inputs",kr="/:flowRunId/human-inputs/:requestId",_r="/:flowRunId/human-inputs/:requestId/expire",Er="/:flowRunId/human-inputs/:requestId/acknowledge",ve=e=>`${f}/${encodeURIComponent(e)}/human-inputs`,z=(e,t)=>`${ve(e)}/${encodeURIComponent(t)}`,xr=(e,t)=>`${z(e,t)}/expire`,Tr=(e,t)=>`${z(e,t)}/acknowledge`,De="human_input_resolved";function wr(e){return`${De}_${e}`}function g(e){return{ok:!1,reason:e}}function m(e,t){return i(e)?{ok:!0,value:e}:g(`${t} must be an object`)}function E(e,t){return typeof e!="string"||e.length===0?g(`${t} must be a non-empty string`):{ok:!0,value:e}}var Ue=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})$/;function Be(e,t){return typeof e!="string"||!Ue.test(e)||Number.isNaN(Date.parse(e))?g(`${t} must be an ISO-8601 timestamp`):{ok:!0,value:e}}function He(e){let t=m(e,"renderedPrompt");if(!t.ok)return t;let n=E(t.value.title,"renderedPrompt.title");if(!n.ok)return n;let o={title:n.value};if(t.value.body!==void 0){if(typeof t.value.body!="string")return g("renderedPrompt.body must be a string");o.body=t.value.body}if(t.value.format!==void 0){if(t.value.format!=="plain"&&t.value.format!=="markdown")return g("renderedPrompt.format is invalid");o.format=t.value.format}return{ok:!0,value:o}}function Fe(e){let t=m(e,"input");if(!t.ok)return t;let n=t.value.kind;if(n==="choice"){if(!Array.isArray(t.value.choices))return g("input.choices must be an array")}else if(n!=="text")if(n==="form"){if(!Array.isArray(t.value.fields))return g("input.fields must be an array")}else return g("input.kind is invalid");return{ok:!0,value:t.value}}function Me(e){if(e==null)return{ok:!0,value:void 0};let t=m(e,"partiallyRenderedDelivery");if(!t.ok)return t;let n=t.value.actions;if(n===void 0)return{ok:!0,value:{}};if(!Array.isArray(n))return g("partiallyRenderedDelivery.actions must be an array");let o=[];for(let s of n){let u=m(s,"delivery action");if(!u.ok)return u;let c=E(u.value.id,"delivery action id");if(!c.ok)return c;let p=Q(u.value.inputs,`delivery action '${c.value}' inputs`);if(!p.ok)return p;o.push({id:c.value,inputs:p.value})}return{ok:!0,value:{actions:o}}}function Q(e,t){let n=m(e,t);if(!n.ok)return n;let o={};for(let[s,u]of Object.entries(n.value)){let c=Z(u,`${t}.${s}`);if(!c.ok)return c;o[s]=c.value}return{ok:!0,value:o}}function Z(e,t){let n=m(e,t);if(!n.ok)return n;switch(n.value.kind){case"literal":return{ok:!0,value:{kind:"literal",value:n.value.value}};case"human_input_ref":{let s=E(n.value.path,`${t}.path`);return s.ok?{ok:!0,value:{kind:"human_input_ref",path:s.value}}:s}case"array":{if(!Array.isArray(n.value.items))return g(`${t}.items must be an array`);let s=[];for(let[u,c]of n.value.items.entries()){let p=Z(c,`${t}[${u}]`);if(!p.ok)return p;s.push(p.value)}return{ok:!0,value:{kind:"array",items:s}}}case"object":{let s=Q(n.value.entries,`${t}.entries`);return s.ok?{ok:!0,value:{kind:"object",entries:s.value}}:s}case"template":{if(!Array.isArray(n.value.parts))return g(`${t}.parts must be an array`);let s=[];for(let[u,c]of n.value.parts.entries()){let p=$e(c,`${t}.parts[${u}]`);if(!p.ok)return p;s.push(p.value)}return{ok:!0,value:{kind:"template",parts:s}}}default:return g(`${t}.kind is invalid`)}}function $e(e,t){let n=m(e,t);if(!n.ok)return n;let o=n.value.kind;if(o==="literal")return typeof n.value.value!="string"?g(`${t}.value must be a string`):{ok:!0,value:{kind:"literal",value:n.value.value}};if(o==="human_input_ref"){let s=E(n.value.path,`${t}.path`);return s.ok?{ok:!0,value:{kind:"human_input_ref",path:s.value}}:s}return g(`${t}.kind is invalid`)}function hr(e){let t=m(e,"request body");if(!t.ok)return r(t.reason);let n=E(t.value.nodeId,"nodeId");if(!n.ok)return r(n.reason);let o=He(t.value.renderedPrompt);if(!o.ok)return r(o.reason);let s=Fe(t.value.input);if(!s.ok)return r(s.reason);let u=E(t.value.timeout,"timeout");if(!u.ok)return r(u.reason);let c=Be(t.value.expiresAt,"expiresAt");if(!c.ok)return r(c.reason);let p=Me(t.value.partiallyRenderedDelivery);return p.ok?a({nodeId:n.value,renderedPrompt:o.value,input:s.value,timeout:u.value,expiresAt:c.value,...p.value!==void 0?{partiallyRenderedDelivery:p.value}:{}}):r(p.reason)}function Le(e){return!i(e)||typeof e.id!="string"||e.id.length===0||typeof e.nodeId!="string"||typeof e.status!="string"||!(e.output===null||i(e.output))?r("human input request view must carry id, nodeId, status and output"):a(e)}function Pr(e){if(!i(e)||typeof e.created!="boolean")return r("human input create data must carry created:boolean");let t=Le(e.request);return t.ok?a({created:e.created,request:t.value}):t}function Sr(e){return!i(e)||e.acknowledged!==!0?r("human input acknowledge data must carry acknowledged:true"):a({acknowledged:!0})}var Cr="ablehi-wfp-user-runtime-manifest/v1",Nr="unknown";function br(e){return e.endsWith(".js")?`${e.slice(0,-3)}.manifest.json`:`${e}.manifest.json`}var vr="/internal/deployment-handshake",Ge=["start","terminate","send-event","start-webhook-watcher","run-polling-tick","invoke-tool","invoke-trigger-handler","invoke-webhook-protocol-adapter","deployment-handshake"],Dr=Ge,Ur="HANDSHAKE_REQUEST_INVALID",Br="HANDSHAKE_SECRET_UNCONFIGURED",Hr="HANDSHAKE_SECRET_MISMATCH",Fr="HANDSHAKE_CONTRACT_VERSION_MISMATCH",Mr="HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH",$r="HANDSHAKE_CAPABILITY_MISSING";function Lr(e){return[e.nonce,e.timestamp,e.contractVersion,e.dispatchNamespace].map(n=>`${n.length}:${n}`).join(".")}function Gr(e){return["response",e.nonce,e.contractVersion,e.dispatchNamespace,...e.capabilities].map(n=>`${n.length}:${n}`).join(".")}export{Ge as DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES,Dr as DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES,vr as DEPLOYMENT_HANDSHAKE_ROUTE,yn as EGRESS_GRANT_AUDIT_ROUTE_SUBPATH,mn as EGRESS_GRANT_CONSUME_ROUTE_SUBPATH,we as EGRESS_GRANT_SCOPE_KINDS,st as EVENT_WAIT_ROUTE_SUBPATH,Qe as EXECUTION_CONTEXT_ROUTE_SUBPATH,ir as FILE_ACCESS_ROUTE_SUBPATH,or as FILE_COMPLETE_ROUTE_SUBPATH,ar as FILE_CONTENT_ROUTE_SUBPATH,sr as FILE_STAT_ROUTE_SUBPATH,rr as FILE_UPLOAD_SESSION_ROUTE_SUBPATH,te as FLOW_INTERPRETER_CONTRACT_VERSION,qe as FLOW_IR_SCHEMA_VERSION,ln as FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH,it as FLOW_RUN_RESULT_ROUTE_SUBPATH,Fn as FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,It as HANDLER_BUNDLES_ROUTE_SUBPATH,$r as HANDSHAKE_CAPABILITY_MISSING,Fr as HANDSHAKE_CONTRACT_VERSION_MISMATCH,Mr as HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH,Ur as HANDSHAKE_REQUEST_INVALID,Hr as HANDSHAKE_SECRET_MISMATCH,Br as HANDSHAKE_SECRET_UNCONFIGURED,Ir as HUMAN_INPUTS_ROUTE_SUBPATH,Er as HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH,_r as HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH,kr as HUMAN_INPUT_REQUEST_ROUTE_SUBPATH,De as HUMAN_INPUT_RESOLVED_EVENT_PREFIX,V as INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX,_ as INTERNAL_FILES_ROUTE_PREFIX,f as INTERNAL_FLOW_RUNS_ROUTE_PREFIX,de as INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX,F as INTERNAL_INSTALLATIONS_ROUTE_PREFIX,h as INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX,L as INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX,T as INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX,zt as POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH,fn as POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,Qt as POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,$n as POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Zt as POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH,Vn as RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS,ee as SERVER_CONTRACT_VERSION,ot as STEP_RESULT_ROUTE_SUBPATH,kt as TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH,gn as TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH,Mn as TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Mt as WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH,Lt as WEBHOOK_PROTOCOL_ADAPTER_MODULE,Ct as WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH,bt as WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH,Rn as WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,Ot as WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH,Nt as WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,vt as WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH,Ln as WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Cr as WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION,Nr as WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION,r as contractParseFail,a as contractParseOk,Lr as deploymentHandshakeProbePayload,Gr as deploymentHandshakeResponseProofPayload,Tn as egressGrantAuditPath,xn as egressGrantConsumePath,ct as eventWaitPath,Ze as executionContextPath,In as flowRunEgressGrantPath,ut as flowRunResultPath,Gn as flowRunRuntimeCredentialPath,Gt as flowScriptProtocolAdapterModuleName,_t as handlerBundlesPath,Tr as humanInputAcknowledgePath,xr as humanInputExpirePath,z as humanInputRequestPath,wr as humanInputResolvedEventType,ve as humanInputsPath,pr as internalFileAccessPath,dr as internalFileCompletePath,gr as internalFileContentPath,lr as internalFileStatPath,cr as internalFileUploadSessionPath,ur as internalFilesPath,i as isJsonRecord,P as isValidRequestDigest,Rt as parseCompleteFlowRunWaitBody,hr as parseCreateHumanInputBody,Cn as parseEgressGrantAuditBody,An as parseEgressGrantConsumeBody,bn as parseEgressGrantConsumeData,Nn as parseEgressGrantData,et as parseExecutionContextData,Ne as parseFileMetadataData,v as parseFileRefData,ie as parseFileRuntimeLimits,Ce as parseFileUploadSessionData,wn as parseFlowActionGrantBody,lt as parseFlowRunResultBody,gt as parseFlowRunResultData,jn as parseFlowRuntimeCredentialBody,le as parseHandlerBundle,xt as parseHandlerBundlesData,Sr as parseHumanInputAcknowledgeData,Pr as parseHumanInputCreateData,Le as parseHumanInputRequestViewData,fr as parseInternalFileAccessData,on as parsePollingPublishBody,Xn as parsePollingRuntimeCredentialBody,rn as parsePollingTriggerContext,Pn as parsePollingTriggerGrantBody,sn as parsePublishPollingTickEventsData,ft as parseRegisterFlowRunWaitBody,mt as parseRegisterFlowRunWaitData,zn as parseRuntimeCredentialSessionCredential,A as parseRuntimeNetwork,hn as parseSingleToolGrantBody,Jn as parseSingleToolRuntimeCredentialBody,dt as parseStepRecordBody,pt as parseStepRecordData,Tt as parseToolHandlerBundlesData,Wt as parseTriggerHandlerBundlesData,qt as parseWebhookDelivery,Vt as parseWebhookPublishEventsBody,jt as parseWebhookRearmBody,Yn as parseWebhookRuntimeCredentialBody,Sn as parseWebhookTriggerGrantBody,Kt as parseWebhookWatcherContext,en as pollingTriggerContextPath,_n as pollingTriggerEgressGrantPath,tn as pollingTriggerHandlerBundlesPath,qn as pollingTriggerRuntimeCredentialPath,nn as pollingTriggerTickEventsPath,Pe as requestHasMultipartFileParts,at as stepResultPath,Et as toolHandlerBundlesPath,kn as toolInvocationEgressGrantPath,Kn as toolInvocationRuntimeCredentialPath,$t as webhookProtocolAdapterBundlePath,Dt as webhookTriggerContextPath,Bt as webhookTriggerDeliveryPath,En as webhookTriggerEgressGrantPath,Ht as webhookTriggerEventsPath,Ut as webhookTriggerHandlerBundlesPath,Ft as webhookTriggerRearmPath,Wn as webhookTriggerRuntimeCredentialPath,br as wfpUserRuntimeManifestPath};
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { J as JsonValue, F as FlowNode, a as FlowIrValidationResult, b as JsonObject, c as FlowCompositionSpec, M as Mapping, T as TriggerBinding } from './edge-CLcEbZfb.js';
2
- export { A as AblehiEnvelope, d as AblehiFailure, e as AblehiSuccess, f as ActionNode, B as BooleanExpression, C as CONTEXT_STATE_CLEANUP_ROUTE_PATH, g as Collection, h as CompleteFlowRunWaitBody, i as CompleteFlowRunWaitData, j as ContextStateCleanupRequestBody, k as ContextStateCleanupResponseData, l as ContextStateScope, m as ContractParseResult, n as CreateHumanInputRequestBody, D as DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES, o as DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES, p as DEPLOYMENT_HANDSHAKE_ROUTE, q as DeploymentHandshakeData, r as DeploymentHandshakeRequestBody, s as DeploymentHandshakeResponse, E as EGRESS_GRANT_AUDIT_ROUTE_SUBPATH, t as EGRESS_GRANT_CONSUME_ROUTE_SUBPATH, u as EGRESS_GRANT_SCOPE_KINDS, v as EVENT_WAIT_ROUTE_SUBPATH, w as EXECUTION_CONTEXT_ROUTE_SUBPATH, x as EgressGrant, y as EgressGrantAuditBody, z as EgressGrantBodyParseResult, G as EgressGrantConsumeBody, H as EgressGrantFileRuntime, I as EgressGrantScopeKind, K as ExecutionBinding, L as ExecutionBindingConnection, N as ExecutionContextCompiled, O as ExecutionContextData, P as FILE_ACCESS_ROUTE_SUBPATH, Q as FILE_COMPLETE_ROUTE_SUBPATH, R as FILE_CONTENT_ROUTE_SUBPATH, S as FILE_STAT_ROUTE_SUBPATH, U as FILE_UPLOAD_SESSION_ROUTE_SUBPATH, V as FLOW_INTERPRETER_CONTRACT_VERSION, W as FLOW_IR_SCHEMA_VERSION, X as FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH, Y as FLOW_RUN_RESULT_ROUTE_SUBPATH, Z as FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, _ as FileAccessData, $ as FileAccessIntent, a0 as FileMetadataData, a1 as FileRefData, a2 as FileRuntimeLimits, a3 as FileRuntimeScope, a4 as FileRuntimeScopeKind, a5 as FileUploadSessionData, a6 as FlowActionGrantBody, a7 as FlowDefinition, a8 as FlowExecutionContextFileRuntime, a9 as FlowInterpreterContractVersion, aa as FlowIrValidationCode, ab as FlowIrValidationIssue, ac as FlowRunResultData, ad as FlowRunResultRequestBody, ae as FlowRuntimeCredentialBody, af as HANDLER_BUNDLES_ROUTE_SUBPATH, ag as HANDSHAKE_CAPABILITY_MISSING, ah as HANDSHAKE_CONTRACT_VERSION_MISMATCH, ai as HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH, aj as HANDSHAKE_REQUEST_INVALID, ak as HANDSHAKE_SECRET_MISMATCH, al as HANDSHAKE_SECRET_UNCONFIGURED, am as HUMAN_INPUTS_ROUTE_SUBPATH, an as HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH, ao as HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH, ap as HUMAN_INPUT_REQUEST_ROUTE_SUBPATH, aq as HUMAN_INPUT_RESOLVED_EVENT_PREFIX, ar as HandlerBundle, as as HandlerBundleModule, at as HandlerBundlesData, au as HandlerBundlesParseResult, av as HumanChoiceInput, aw as HumanFormField, ax as HumanFormInput, ay as HumanInputActor, az as HumanInputChoice, aA as HumanInputDelivery, aB as HumanInputDeliveryAction, aC as HumanInputNode, aD as HumanInputOutput, aE as HumanInputPrompt, aF as HumanInputRequestView, aG as HumanInputResolvedEvent, aH as HumanInputResponse, aI as HumanInputSpec, aJ as HumanTextInput, aK as INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX, aL as INTERNAL_FILES_ROUTE_PREFIX, aM as INTERNAL_FLOW_RUNS_ROUTE_PREFIX, aN as INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX, aO as INTERNAL_INSTALLATIONS_ROUTE_PREFIX, aP as INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX, aQ as INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX, aR as INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX, aS as IntegrationTriggerBinding, aT as InternalFileAccessData, aU as InternalFileAccessIntent, aV as JsonArray, aW as ManualTriggerBinding, aX as NodeCommon, aY as Operand, aZ as POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH, a_ as POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH, a$ as POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH, b0 as POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, b1 as POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH, b2 as PackagePollingTriggerRuntimeDescriptor, b3 as PackageWebhookTriggerRuntimeDescriptor, b4 as ParsedFlowRunResultBody, b5 as PartiallyRenderedHumanInputDelivery, b6 as PartiallyRenderedMapping, b7 as PartiallyRenderedTemplatePart, b8 as PartiallyRenderedValue, b9 as PollingPublishBody, ba as PollingPublishEvent, bb as PollingRuntimeCredentialBody, bc as PollingTriggerContext, bd as PollingTriggerGrantBody, be as PresignedFileUrlData, bf as PublishPollingTickEventResult, bg as PublishPollingTickEventsData, bh as RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS, bi as RegisterFlowRunWaitBody, bj as RegisterFlowRunWaitData, bk as RenderedFlowComposition, bl as RenderedHumanInputPrompt, bm as RuntimeCredentialSession, bn as RuntimeCredentialSessionNetwork, bo as RuntimeCredentialSessionScopeKind, bp as RuntimeNetwork, bq as RuntimeNetworkModel, br as SERVER_CONTRACT_VERSION, bs as STEP_RESULT_ROUTE_SUBPATH, bt as ScheduleTriggerBinding, bu as ServerContractVersion, bv as SingleToolGrantBody, bw as SleepNode, bx as StepRecordBody, by as StepRecordBodyParseResult, bz as StepRecordData, bA as StepRecordResult, bB as TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH, bC as TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH, bD as TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, bE as TextExpression, bF as ToolHandlerBundlesData, bG as TriggerConnectionInfo, bH as TriggerHandlerBundlesData, bI as TriggerHandlerModule, bJ as ValueExpression, bK as WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH, bL as WEBHOOK_PROTOCOL_ADAPTER_MODULE, bM as WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH, bN as WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH, bO as WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH, bP as WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH, bQ as WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH, bR as WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH, bS as WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, bT as WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION, bU as WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION, bV as WORKSPACE_FILES_ROUTE_PREFIX, bW as WaitEventNode, bX as WebhookDelivery, bY as WebhookProtocolAdapterBundleData, bZ as WebhookProtocolAdapterModule, b_ as WebhookPublishEvent, b$ as WebhookPublishEventsBody, c0 as WebhookPublishEventsData, c1 as WebhookRearmBody, c2 as WebhookRearmData, c3 as WebhookRuntimeCredentialBody, c4 as WebhookTriggerGrantBody, c5 as WebhookTriggerVerificationMethod, c6 as WebhookWatcherContext, c7 as WfpUserRuntimeManifest, c8 as contractParseFail, c9 as contractParseOk, ca as deploymentHandshakeProbePayload, cb as deploymentHandshakeResponseProofPayload, cc as egressGrantAuditPath, cd as egressGrantConsumePath, ce as eventWaitPath, cf as executionContextPath, cg as flowRunEgressGrantPath, ch as flowRunResultPath, ci as flowRunRuntimeCredentialPath, cj as flowScriptProtocolAdapterModuleName, ck as handlerBundlesPath, cl as humanInputAcknowledgePath, cm as humanInputExpirePath, cn as humanInputRequestPath, co as humanInputResolvedEventType, cp as humanInputsPath, cq as internalFileAccessPath, cr as internalFileCompletePath, cs as internalFileContentPath, ct as internalFileStatPath, cu as internalFileUploadSessionPath, cv as internalFilesPath, cw as isJsonRecord, cx as isValidRequestDigest, cy as parseCompleteFlowRunWaitBody, cz as parseContextStateCleanupRequestBody, cA as parseContextStateCleanupResponseData, cB as parseContextStateScope, cC as parseCreateHumanInputBody, cD as parseEgressGrantAuditBody, cE as parseEgressGrantConsumeBody, cF as parseEgressGrantConsumeData, cG as parseEgressGrantData, cH as parseExecutionContextData, cI as parseFileAccessData, cJ as parseFileMetadataData, cK as parseFileRefData, cL as parseFileRuntimeLimits, cM as parseFileUploadSessionData, cN as parseFlowActionGrantBody, cO as parseFlowRunResultBody, cP as parseFlowRunResultData, cQ as parseFlowRuntimeCredentialBody, cR as parseHandlerBundle, cS as parseHandlerBundlesData, cT as parseHumanInputAcknowledgeData, cU as parseHumanInputCreateData, cV as parseHumanInputRequestViewData, cW as parseInternalFileAccessData, cX as parsePollingPublishBody, cY as parsePollingRuntimeCredentialBody, cZ as parsePollingTriggerContext, c_ as parsePollingTriggerGrantBody, c$ as parsePublishPollingTickEventsData, d0 as parseRegisterFlowRunWaitBody, d1 as parseRegisterFlowRunWaitData, d2 as parseRuntimeCredentialSessionCredential, d3 as parseRuntimeNetwork, d4 as parseSingleToolGrantBody, d5 as parseSingleToolRuntimeCredentialBody, d6 as parseStepRecordBody, d7 as parseStepRecordData, d8 as parseToolHandlerBundlesData, d9 as parseTriggerHandlerBundlesData, da as parseWebhookDelivery, db as parseWebhookPublishEventsBody, dc as parseWebhookRearmBody, dd as parseWebhookRuntimeCredentialBody, de as parseWebhookTriggerGrantBody, df as parseWebhookWatcherContext, dg as pollingTriggerContextPath, dh as pollingTriggerEgressGrantPath, di as pollingTriggerHandlerBundlesPath, dj as pollingTriggerRuntimeCredentialPath, dk as pollingTriggerTickEventsPath, dl as requestHasMultipartFileParts, dm as stepResultPath, dn as toolHandlerBundlesPath, dp as toolInvocationEgressGrantPath, dq as toolInvocationRuntimeCredentialPath, dr as webhookProtocolAdapterBundlePath, ds as webhookTriggerContextPath, dt as webhookTriggerDeliveryPath, du as webhookTriggerEgressGrantPath, dv as webhookTriggerEventsPath, dw as webhookTriggerHandlerBundlesPath, dx as webhookTriggerRearmPath, dy as webhookTriggerRuntimeCredentialPath, dz as wfpUserRuntimeManifestPath, dA as workspaceFileAccessPath, dB as workspaceFileCompletePath, dC as workspaceFileMetadataPath, dD as workspaceFileUploadSessionPath } from './edge-CLcEbZfb.js';
1
+ import { J as JsonValue, F as FlowNode, a as FlowIrValidationResult, b as JsonObject, c as FlowCompositionSpec, M as Mapping, T as TriggerBinding } from './edge-DNtGw1Sl.js';
2
+ export { A as AblehiEnvelope, d as AblehiFailure, e as AblehiSuccess, f as ActionNode, B as BooleanExpression, C as CONTEXT_STATE_CLEANUP_ROUTE_PATH, g as Collection, h as CompleteFlowRunWaitBody, i as CompleteFlowRunWaitData, j as ContextStateCleanupRequestBody, k as ContextStateCleanupResponseData, l as ContextStateScope, m as ContractParseResult, n as CreateHumanInputRequestBody, D as DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES, o as DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES, p as DEPLOYMENT_HANDSHAKE_ROUTE, q as DeploymentHandshakeData, r as DeploymentHandshakeRequestBody, s as DeploymentHandshakeResponse, E as EGRESS_GRANT_AUDIT_ROUTE_SUBPATH, t as EGRESS_GRANT_CONSUME_ROUTE_SUBPATH, u as EGRESS_GRANT_SCOPE_KINDS, v as EVENT_WAIT_ROUTE_SUBPATH, w as EXECUTION_CONTEXT_ROUTE_SUBPATH, x as EgressGrant, y as EgressGrantAuditBody, z as EgressGrantBodyParseResult, G as EgressGrantConsumeBody, H as EgressGrantFileRuntime, I as EgressGrantScopeKind, K as ExecutionBinding, L as ExecutionBindingConnection, N as ExecutionContextCompiled, O as ExecutionContextData, P as FILE_ACCESS_ROUTE_SUBPATH, Q as FILE_COMPLETE_ROUTE_SUBPATH, R as FILE_CONTENT_ROUTE_SUBPATH, S as FILE_STAT_ROUTE_SUBPATH, U as FILE_UPLOAD_SESSION_ROUTE_SUBPATH, V as FLOW_INTERPRETER_CONTRACT_VERSION, W as FLOW_IR_SCHEMA_VERSION, X as FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH, Y as FLOW_RUN_RESULT_ROUTE_SUBPATH, Z as FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, _ as FileAccessData, $ as FileAccessIntent, a0 as FileMetadataData, a1 as FileRefData, a2 as FileRuntimeLimits, a3 as FileRuntimeScope, a4 as FileRuntimeScopeKind, a5 as FileUploadSessionData, a6 as FlowActionGrantBody, a7 as FlowDefinition, a8 as FlowExecutionContextFileRuntime, a9 as FlowInterpreterContractVersion, aa as FlowIrValidationCode, ab as FlowIrValidationIssue, ac as FlowRunResultData, ad as FlowRunResultRequestBody, ae as FlowRuntimeCredentialBody, af as HANDLER_BUNDLES_ROUTE_SUBPATH, ag as HANDSHAKE_CAPABILITY_MISSING, ah as HANDSHAKE_CONTRACT_VERSION_MISMATCH, ai as HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH, aj as HANDSHAKE_REQUEST_INVALID, ak as HANDSHAKE_SECRET_MISMATCH, al as HANDSHAKE_SECRET_UNCONFIGURED, am as HUMAN_INPUTS_ROUTE_SUBPATH, an as HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH, ao as HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH, ap as HUMAN_INPUT_REQUEST_ROUTE_SUBPATH, aq as HUMAN_INPUT_RESOLVED_EVENT_PREFIX, ar as HandlerBundle, as as HandlerBundleModule, at as HandlerBundlesData, au as HandlerBundlesParseResult, av as HumanChoiceInput, aw as HumanFormField, ax as HumanFormInput, ay as HumanInputActor, az as HumanInputChoice, aA as HumanInputDelivery, aB as HumanInputDeliveryAction, aC as HumanInputNode, aD as HumanInputOutput, aE as HumanInputPrompt, aF as HumanInputRequestView, aG as HumanInputResolvedEvent, aH as HumanInputResponse, aI as HumanInputSpec, aJ as HumanTextInput, aK as INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX, aL as INTERNAL_FILES_ROUTE_PREFIX, aM as INTERNAL_FLOW_RUNS_ROUTE_PREFIX, aN as INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX, aO as INTERNAL_INSTALLATIONS_ROUTE_PREFIX, aP as INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX, aQ as INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX, aR as INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX, aS as IntegrationTriggerBinding, aT as InternalFileAccessData, aU as InternalFileAccessIntent, aV as JsonArray, aW as ManualTriggerBinding, aX as NodeCommon, aY as Operand, aZ as POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH, a_ as POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH, a$ as POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH, b0 as POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, b1 as POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH, b2 as PackagePollingTriggerRuntimeDescriptor, b3 as PackageWebhookTriggerRuntimeDescriptor, b4 as ParsedFlowRunResultBody, b5 as PartiallyRenderedHumanInputDelivery, b6 as PartiallyRenderedMapping, b7 as PartiallyRenderedTemplatePart, b8 as PartiallyRenderedValue, b9 as PollingPublishBody, ba as PollingPublishEvent, bb as PollingRuntimeCredentialBody, bc as PollingTriggerContext, bd as PollingTriggerGrantBody, be as PresignedFileUrlData, bf as PublishPollingTickEventResult, bg as PublishPollingTickEventsData, bh as RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS, bi as RegisterFlowRunWaitBody, bj as RegisterFlowRunWaitData, bk as RenderedFlowComposition, bl as RenderedHumanInputPrompt, bm as RuntimeCredentialSession, bn as RuntimeCredentialSessionNetwork, bo as RuntimeCredentialSessionScopeKind, bp as RuntimeNetwork, bq as RuntimeNetworkModel, br as SERVER_CONTRACT_VERSION, bs as STEP_RESULT_ROUTE_SUBPATH, bt as ScheduleTriggerBinding, bu as ServerContractVersion, bv as SingleToolGrantBody, bw as SleepNode, bx as StepRecordBody, by as StepRecordBodyParseResult, bz as StepRecordData, bA as StepRecordResult, bB as TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH, bC as TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH, bD as TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, bE as TextExpression, bF as ToolHandlerBundlesData, bG as TriggerConnectionInfo, bH as TriggerHandlerBundlesData, bI as TriggerHandlerModule, bJ as ValueExpression, bK as WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH, bL as WEBHOOK_PROTOCOL_ADAPTER_MODULE, bM as WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH, bN as WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH, bO as WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH, bP as WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH, bQ as WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH, bR as WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH, bS as WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, bT as WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION, bU as WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION, bV as WORKSPACE_FILES_ROUTE_PREFIX, bW as WaitEventNode, bX as WebhookDelivery, bY as WebhookProtocolAdapterBundleData, bZ as WebhookProtocolAdapterModule, b_ as WebhookPublishEvent, b$ as WebhookPublishEventsBody, c0 as WebhookPublishEventsData, c1 as WebhookRearmBody, c2 as WebhookRearmData, c3 as WebhookRuntimeCredentialBody, c4 as WebhookTriggerGrantBody, c5 as WebhookTriggerVerificationMethod, c6 as WebhookWatcherContext, c7 as WfpUserRuntimeManifest, c8 as contractParseFail, c9 as contractParseOk, ca as deploymentHandshakeProbePayload, cb as deploymentHandshakeResponseProofPayload, cc as egressGrantAuditPath, cd as egressGrantConsumePath, ce as eventWaitPath, cf as executionContextPath, cg as flowRunEgressGrantPath, ch as flowRunResultPath, ci as flowRunRuntimeCredentialPath, cj as flowScriptProtocolAdapterModuleName, ck as handlerBundlesPath, cl as humanInputAcknowledgePath, cm as humanInputExpirePath, cn as humanInputRequestPath, co as humanInputResolvedEventType, cp as humanInputsPath, cq as internalFileAccessPath, cr as internalFileCompletePath, cs as internalFileContentPath, ct as internalFileStatPath, cu as internalFileUploadSessionPath, cv as internalFilesPath, cw as isJsonRecord, cx as isValidRequestDigest, cy as parseCompleteFlowRunWaitBody, cz as parseContextStateCleanupRequestBody, cA as parseContextStateCleanupResponseData, cB as parseContextStateScope, cC as parseCreateHumanInputBody, cD as parseEgressGrantAuditBody, cE as parseEgressGrantConsumeBody, cF as parseEgressGrantConsumeData, cG as parseEgressGrantData, cH as parseExecutionContextData, cI as parseFileAccessData, cJ as parseFileMetadataData, cK as parseFileRefData, cL as parseFileRuntimeLimits, cM as parseFileUploadSessionData, cN as parseFlowActionGrantBody, cO as parseFlowRunResultBody, cP as parseFlowRunResultData, cQ as parseFlowRuntimeCredentialBody, cR as parseHandlerBundle, cS as parseHandlerBundlesData, cT as parseHumanInputAcknowledgeData, cU as parseHumanInputCreateData, cV as parseHumanInputRequestViewData, cW as parseInternalFileAccessData, cX as parsePollingPublishBody, cY as parsePollingRuntimeCredentialBody, cZ as parsePollingTriggerContext, c_ as parsePollingTriggerGrantBody, c$ as parsePublishPollingTickEventsData, d0 as parseRegisterFlowRunWaitBody, d1 as parseRegisterFlowRunWaitData, d2 as parseRuntimeCredentialSessionCredential, d3 as parseRuntimeNetwork, d4 as parseSingleToolGrantBody, d5 as parseSingleToolRuntimeCredentialBody, d6 as parseStepRecordBody, d7 as parseStepRecordData, d8 as parseToolHandlerBundlesData, d9 as parseTriggerHandlerBundlesData, da as parseWebhookDelivery, db as parseWebhookPublishEventsBody, dc as parseWebhookRearmBody, dd as parseWebhookRuntimeCredentialBody, de as parseWebhookTriggerGrantBody, df as parseWebhookWatcherContext, dg as pollingTriggerContextPath, dh as pollingTriggerEgressGrantPath, di as pollingTriggerHandlerBundlesPath, dj as pollingTriggerRuntimeCredentialPath, dk as pollingTriggerTickEventsPath, dl as requestHasMultipartFileParts, dm as stepResultPath, dn as toolHandlerBundlesPath, dp as toolInvocationEgressGrantPath, dq as toolInvocationRuntimeCredentialPath, dr as webhookProtocolAdapterBundlePath, ds as webhookTriggerContextPath, dt as webhookTriggerDeliveryPath, du as webhookTriggerEgressGrantPath, dv as webhookTriggerEventsPath, dw as webhookTriggerHandlerBundlesPath, dx as webhookTriggerRearmPath, dy as webhookTriggerRuntimeCredentialPath, dz as wfpUserRuntimeManifestPath, dA as workspaceFileAccessPath, dB as workspaceFileCompletePath, dC as workspaceFileMetadataPath, dD as workspaceFileUploadSessionPath } from './edge-DNtGw1Sl.js';
3
3
 
4
4
  declare const PLATFORM_ACCESS_PERMISSION = "platform.access";
5
5
  declare const PLATFORM_API_KEY_MANAGE_PERMISSION = "platform.api_key.manage";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var de="0.2.5";var wt="flow.ir.v1";var ge="flow.interp.v2";function a(e){return{ok:!0,value:e}}function r(e){return{ok:!1,reason:e}}function i(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Pt="/cleanup-state-scopes";function _(e){if(!i(e)||typeof e.kind!="string")return r("context state scope surface shape is invalid");switch(e.kind){case"webhook-trigger":return fe(e);case"polling-trigger":return me(e);case"flow-action":return Re(e);default:return r("context state scope kind is invalid")}}function Ot(e){if(!i(e))return r("cleanup request body must be a JSON object");let t=D(e,["scopes"]);if(t!==void 0)return r(`cleanup request does not accept the "${t}" field`);if(!Array.isArray(e.scopes))return r("cleanup request scopes must be an array");let n=[];for(let o of e.scopes){let s=_(o);if(!s.ok)return s;n.push(s.value)}return a({scopes:n})}function Nt(e){return!i(e)||typeof e.deleted!="number"||!Number.isSafeInteger(e.deleted)||e.deleted<0?r("cleanup response data surface shape is invalid"):a({deleted:e.deleted})}function fe(e){let t=D(e,["kind","workspaceId","triggerInstanceId"]);return t!==void 0?r(`webhook trigger scope does not accept "${t}"`):e.kind!=="webhook-trigger"||!m(e.workspaceId)||!m(e.triggerInstanceId)?r("webhook trigger state scope is invalid"):a({kind:"webhook-trigger",workspaceId:e.workspaceId,triggerInstanceId:e.triggerInstanceId})}function me(e){let t=D(e,["kind","workspaceId","pollingInstanceId"]);return t!==void 0?r(`polling trigger scope does not accept "${t}"`):e.kind!=="polling-trigger"||!m(e.workspaceId)||!m(e.pollingInstanceId)?r("polling trigger state scope is invalid"):a({kind:"polling-trigger",workspaceId:e.workspaceId,pollingInstanceId:e.pollingInstanceId})}function Re(e){let t=D(e,["kind","workspaceId","flowId","nodeId","connectionId"]);if(t!==void 0)return r(`flow action scope does not accept "${t}"`);let n=e.connectionId;return e.kind!=="flow-action"||!m(e.workspaceId)||!m(e.flowId)||!m(e.nodeId)||n!==null&&!m(n)?r("flow action state scope is invalid"):a({kind:"flow-action",workspaceId:e.workspaceId,flowId:e.flowId,nodeId:e.nodeId,connectionId:n})}function m(e){return typeof e=="string"&&e.length>0}function D(e,t){return Object.keys(e).find(n=>!t.includes(n))}var f="/internal/flow-runs",Ft="/:flowRunId/execution-context";function vt(e){return`${f}/${encodeURIComponent(e)}/execution-context`}function _e(e){return!i(e)||!M(e.fileMaxBytes)||!M(e.fileReadMaxBytes)||!M(e.inlineMultipartBytesMax)?r("file runtime limits must carry three positive integer bounds"):a({fileMaxBytes:e.fileMaxBytes,fileReadMaxBytes:e.fileReadMaxBytes,inlineMultipartBytesMax:e.inlineMultipartBytesMax})}function Ut(e){if(!i(e))return r("execution context must be a JSON object");let t=e.compiled;if(typeof e.flowRunId!="string"||typeof e.workspaceId!="string"||!i(e.input)||!i(t)||typeof t.irSchemaVersion!="string"||typeof t.interpreterContractVersion!="string"||typeof t.compiledArtifactId!="string"||!i(t.ir)||!Array.isArray(t.ir.nodes)||!ye(e.executionBindings))return r("execution context surface shape is invalid");let n=Ie(e.fileRuntime);return n.ok?a({...e,fileRuntime:n.value}):r(n.reason)}function Ie(e){if(e===null)return a(null);if(!i(e))return r("fileRuntime must be null or an object");let t=_e(e.limits);return t.ok?a({limits:t.value}):r(t.reason)}function ye(e){return Array.isArray(e)?e.every(t=>{if(!i(t))return!1;let n=t.connection,o=_(t.stateScope);return typeof t.nodeId=="string"&&typeof t.toolRef=="string"&&i(t.toolDescriptor)&&i(t.integrationDescriptor)&&i(n)&&typeof n.installationId=="string"&&typeof n.connectionRef=="string"&&typeof n.connectionId=="string"&&typeof n.authType=="string"&&o.ok}):!1}function M(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var Ht="/:flowRunId/steps/:nodeId/result",Mt="/:flowRunId/result",$t="/:flowRunId/event-waits/:nodeId";function Kt(e,t){return`${f}/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}/result`}function Wt(e){return`${f}/${encodeURIComponent(e)}/result`}function Vt(e,t){return`${f}/${encodeURIComponent(e)}/event-waits/${encodeURIComponent(t)}`}function qt(e){if(!i(e))return{ok:!1,kind:"validation",reason:"step record body must be a JSON object"};let t=I(e,["attempt","result","durationMs"]);if(t!==void 0)return{ok:!1,kind:"validation",reason:`step record does not accept the "${t}" field`};let n=e.attempt;if(typeof n!="number"||!Number.isInteger(n)||n<=0)return{ok:!1,kind:"validation",reason:"attempt must be a positive integer"};let o=Te(e.result);if(!o.ok)return o;let s={attempt:n,result:o.value};if(e.durationMs!==void 0){let p=e.durationMs;if(typeof p!="number"||!Number.isFinite(p)||p<0)return{ok:!1,kind:"validation",reason:"durationMs must be a non-negative number"};s.durationMs=p}return{ok:!0,value:s}}function Te(e){if(!i(e))return{ok:!1,kind:"step_result_invalid",reason:"result must be a JSON object"};let t=e.status;if(t==="succeeded"){let n=I(e,["status","output"]);return n!==void 0?{ok:!1,kind:"validation",reason:`step record result does not accept the "${n}" field`}:"output"in e?{ok:!0,value:{status:"succeeded",output:e.output}}:{ok:!1,kind:"step_result_invalid",reason:"a succeeded result must carry output"}}if(t==="failed"){let n=I(e,["status","errorCode","issues"]);if(n!==void 0)return{ok:!1,kind:"validation",reason:`step record result does not accept the "${n}" field`};let o=e.errorCode;if(typeof o!="string"||o.length===0)return{ok:!1,kind:"step_result_invalid",reason:"a failed result must carry a non-empty errorCode"};let s={status:"failed",errorCode:o};return e.issues!==void 0&&(s.issues=e.issues),{ok:!0,value:s}}return{ok:!1,kind:"step_result_invalid",reason:'result status must be "succeeded" or "failed"'}}function jt(e){return!i(e)||typeof e.flowRunId!="string"||typeof e.nodeId!="string"||e.recorded!=="succeeded"&&e.recorded!=="failed"?r("step record data surface shape is invalid"):a({flowRunId:e.flowRunId,nodeId:e.nodeId,recorded:e.recorded})}function Jt(e){if(!i(e))return r("result body must be a JSON object");let t=I(e,["status","output","error","composition"]);if(t!==void 0)return r(`result does not accept the "${t}" field`);let n=e.status;if(n!=="succeeded"&&n!=="failed")return r('result status must be "succeeded" or "failed"');let o={status:n};if(e.output!==void 0&&(o.output=e.output),e.error!==void 0){let s=e.error;if(!i(s))return r("result error must be a JSON object");let p=I(s,["code","message"]);if(p!==void 0)return r(`result error does not accept the "${p}" field`);if(typeof s.code!="string"||typeof s.message!="string")return r("result error must carry string code and message");o.error={code:s.code,message:s.message}}if(e.composition!==void 0){if(n!=="succeeded")return r("composition is only allowed on a succeeded result");o.composition=e.composition}return a(o)}function Xt(e){return i(e)?a(e):r("flow run result data must be a JSON object")}var xe=/^[A-Za-z0-9_-]{1,100}$/;function Yt(e){if(!i(e))return r("register body must be a JSON object");let t=I(e,["eventType","correlationKey"]);if(t!==void 0)return r(`register wait does not accept the "${t}" field`);let n=z(e.eventType);if(!n.ok)return r(n.reason);let o=e.correlationKey;return typeof o!="string"||o.length===0?r("correlationKey must be a non-empty string"):a({eventType:n.value,correlationKey:o})}function zt(e){if(!i(e))return r("complete body must be a JSON object");let t=I(e,["eventType","correlationKey","outcome","eventId"]);if(t!==void 0)return r(`complete wait does not accept the "${t}" field`);let n=e.outcome;if(n!=="received"&&n!=="timed_out")return r('outcome must be "received" or "timed_out"');let o=z(e.eventType);if(!o.ok)return r(o.reason);let s=e.correlationKey;if(typeof s!="string"||s.length===0)return r("correlationKey must be a non-empty string");let p={eventType:o.value,correlationKey:s,outcome:n};if(e.eventId!==void 0){if(typeof e.eventId!="string"||e.eventId.length===0)return r("eventId must be a non-empty string");p.eventId=e.eventId}return a(p)}function Qt(e){return!i(e)||e.registered!==!0?r("register wait data surface shape is invalid"):a({registered:!0})}function z(e){return typeof e!="string"||e.length===0?r("eventType must be a non-empty string"):xe.test(e)?a(e):r("eventType must match ^[A-Za-z0-9_-]{1,100}$")}function I(e,t){return Object.keys(e).find(n=>!t.includes(n))}var Ee="/internal/flow-versions",en="/:flowVersionId/handler-bundles",K="/internal/installations",tn="/:installationId/handler-bundles";function nn(e,t){return`${Ee}/${encodeURIComponent(e)}/handler-bundles?compiledArtifactId=${encodeURIComponent(t)}`}function rn(e){return`${K}/${encodeURIComponent(e.installationId)}/handler-bundles?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var we=new Set(["managed_only","managed_plus_unmanaged_sdk"]);function C(e){if(!y(e))return $("runtimeNetwork must be a JSON object");let t=e.networkModel;return typeof t!="string"||!we.has(t)?$("runtimeNetwork.networkModel is unknown"):!Q(e.apiHosts)||!Q(e.authHosts)||typeof e.httpsOnly!="boolean"?$("runtimeNetwork host/https fields are invalid"):{ok:!0,value:{networkModel:t,apiHosts:e.apiHosts,authHosts:e.authHosts,httpsOnly:e.httpsOnly}}}function on(e){if(!y(e)||typeof e.flowVersionId!="string"||typeof e.compiledArtifactId!="string"||!Array.isArray(e.bundles))return k("handler bundles data surface shape is invalid");let t=Z(e.bundles);return t.ok?{ok:!0,value:{flowVersionId:e.flowVersionId,compiledArtifactId:e.compiledArtifactId,bundles:t.value}}:t}function sn(e){if(!y(e)||typeof e.installationId!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.bundles))return k("tool handler bundles data surface shape is invalid");let t=Z(e.bundles);return t.ok?{ok:!0,value:{installationId:e.installationId,artifactDigest:e.artifactDigest,bundles:t.value}}:t}function Z(e){let t=[];for(let n of e){let o=Ae(n);if(!o.ok)return o;t.push(o.value)}return{ok:!0,value:t}}function Ae(e){if(!y(e)||typeof e.toolRef!="string"||e.kind!=="handler"&&e.kind!=="request")return k("handler bundle entry shape is invalid");if(e.kind==="request"){if(e.module!==void 0)return k("a request bundle must not carry a module");let o=C(e.runtimeNetwork);return o.ok?{ok:!0,value:{toolRef:e.toolRef,kind:"request",runtimeNetwork:o.value}}:o}let t=e.module;if(!y(t)||typeof t.entry!="string"||t.entry.length===0||!ke(t.files))return k("a handler bundle must carry a { entry, files } module");let n=C(e.runtimeNetwork);return n.ok?{ok:!0,value:{toolRef:e.toolRef,kind:"handler",module:{entry:t.entry,files:t.files},runtimeNetwork:n.value}}:n}function k(e){return{ok:!1,kind:"shape",reason:e}}function $(e){return{ok:!1,kind:"runtime_network",reason:e}}function y(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Q(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function ke(e){return y(e)&&Object.values(e).every(t=>typeof t=="string")}var S="/internal/webhook-trigger-instances",dn="/:triggerInstanceId/context",gn="/:triggerInstanceId/handler-bundles",fn="/:triggerInstanceId/deliveries/:deliveryId",mn="/:triggerInstanceId/events",Rn="/:triggerInstanceId/rearm",h=e=>`${S}/${encodeURIComponent(e)}`;function _n(e,t){return`${h(e)}/context?artifactDigest=${encodeURIComponent(t)}`}function In(e,t){return`${h(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function yn(e,t){return`${h(e)}/deliveries/${encodeURIComponent(t)}`}function Tn(e){return`${h(e)}/events`}function xn(e){return`${h(e)}/rearm`}var En="/:installationId/webhook-protocol-adapter-bundle";function wn(e){return`${K}/${encodeURIComponent(e.installationId)}/webhook-protocol-adapter-bundle?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var An="modules/webhook/protocol-adapter.js";function kn(e){return`modules/webhook/protocol-adapter-${e}.js`}function Sn(e){let t=i(e)?_(e.stateScope):r("webhook watcher context state scope is invalid");return!i(e)||typeof e.artifactDigest!="string"||typeof e.triggerRef!="string"||typeof e.triggerName!="string"||typeof e.integrationRef!="string"||!i(e.inputs)||e.connection!==null&&!Se(e.connection)||!he(e.runtime)||!t.ok||t.value.kind!=="webhook-trigger"?r("webhook watcher context surface shape is invalid"):a(e)}function Se(e){return i(e)&&typeof e.connectionId=="string"&&typeof e.connectionRef=="string"&&typeof e.integrationRef=="string"&&typeof e.authType=="string"}function he(e){if(!i(e)||e.type!=="webhook"||typeof e.trigger_ref!="string")return!1;let t=e.webhook;return i(t)&&typeof t.event_handler_module=="string"&&typeof t.enable_handler_module=="string"&&typeof t.disable_handler_module=="string"}function hn(e){if(!i(e)||typeof e.deliveryId!="string"||typeof e.receivedAt!="string"||!i(e.request))return r("webhook delivery surface shape is invalid");let t=e.request;return t.method!=="POST"||!i(t.headers)||typeof t.rawBody!="string"?r("webhook delivery request shape is invalid"):a(e)}function Pn(e){if(!i(e)||typeof e.triggerRef!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.modules)||!e.modules.every(Pe))return{ok:!1,kind:"shape",reason:"trigger handler bundles data surface shape is invalid"};let t=C(e.runtimeNetwork);return t.ok?{ok:!0,value:{triggerRef:e.triggerRef,artifactDigest:e.artifactDigest,modules:e.modules,runtimeNetwork:t.value}}:t}function Pe(e){return i(e)&&typeof e.specifier=="string"&&e.specifier.length>0&&typeof e.source=="string"}function On(e){if(!i(e))return r("publish events body must be a JSON object");let t=W(e,["deliveryId","events"]);if(t!==void 0)return r(`publish events does not accept the "${t}" field`);let n=e.deliveryId;if(typeof n!="string"||n.length===0)return r("deliveryId must be a non-empty string");let o=e.events;if(!Array.isArray(o))return r("events must be an array");let s=[];for(let p of o){let l=Oe(p);if(!l.ok)return l;s.push(l.value)}return a({deliveryId:n,events:s})}function Oe(e){if(!i(e))return r("each event must be a JSON object");let t=W(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return r(`event does not accept the "${t}" field`);let n=e.eventId;if(typeof n!="string"||n.length===0)return r("eventId must be a non-empty string");let o=e.occurredAt;if(typeof o!="string"||o.length===0)return r("occurredAt must be a non-empty string");if(!i(e.payload))return r("event payload must be a JSON object");let s={eventId:n,occurredAt:o,payload:e.payload};if(e.dedupeKey!==void 0){if(typeof e.dedupeKey!="string"||e.dedupeKey.length===0)return r("dedupeKey must be a non-empty string");s.dedupeKey=e.dedupeKey}return a(s)}function Nn(e){if(!i(e))return r("rearm body must be a JSON object");let t=W(e,["expectedWatcherInstanceId"]);if(t!==void 0)return r(`rearm does not accept the "${t}" field`);let n=e.expectedWatcherInstanceId;return typeof n!="string"||n.length===0?r("expectedWatcherInstanceId must be a non-empty string"):a({expectedWatcherInstanceId:n})}function W(e,t){return Object.keys(e).find(n=>!t.includes(n))}var P="/internal/polling-trigger-instances",Fn="/:pollingInstanceId/context",vn="/:pollingInstanceId/handler-bundles",Un="/:pollingInstanceId/ticks/:tickId/events",V=e=>`${P}/${encodeURIComponent(e)}`;function Ln(e,t,n){return`${V(e)}/context?artifactDigest=${encodeURIComponent(t)}&tickId=${encodeURIComponent(n)}`}function Bn(e,t){return`${V(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function Gn(e,t){return`${V(e)}/ticks/${encodeURIComponent(t)}/events`}function Hn(e){let t=i(e)?_(e.stateScope):r("polling trigger context state scope is invalid");return!i(e)||typeof e.artifactDigest!="string"||typeof e.triggerRef!="string"||typeof e.triggerName!="string"||typeof e.integrationRef!="string"||!i(e.inputs)||e.connection!==null&&!Ne(e.connection)||!De(e.runtime)||!t.ok||t.value.kind!=="polling-trigger"||!Ce(e.tick)||!be(e.limits)?r("polling trigger context surface shape is invalid"):a(e)}function Ne(e){return i(e)&&typeof e.connectionId=="string"&&typeof e.connectionRef=="string"&&typeof e.integrationRef=="string"&&typeof e.authType=="string"}function De(e){if(!i(e)||e.type!=="polling"||typeof e.trigger_id!="string"||typeof e.trigger_ref!="string")return!1;let t=e.polling;if(!i(t)||typeof t.run_handler_module!="string")return!1;let n=t.schedule;if(!i(n)||n.type!=="interval"||typeof n.every_seconds!="number")return!1;let o=t.dedup;return i(o)&&(o.strategy==="cursor"||o.strategy==="hash"||o.strategy==="id_field")}function Ce(e){return i(e)&&typeof e.tickId=="string"&&typeof e.scheduledAt=="string"&&typeof e.attempt=="number"}function be(e){return i(e)&&typeof e.maxEventsPerTick=="number"}function Mn(e){if(!i(e))return r("publish body must be a JSON object");let t=ee(e,["events","nextCursor"]);if(t!==void 0)return r(`publish does not accept the "${t}" field`);let n=e.events;if(!Array.isArray(n))return r("events must be an array");let o=[];for(let p of n){let l=Fe(p);if(!l.ok)return l;o.push(l.value)}let s={events:o};if("nextCursor"in e){let p=e.nextCursor;if(p!==null&&typeof p!="string")return r("nextCursor must be a string, null, or omitted");s.nextCursor=p}return a(s)}function Fe(e){if(!i(e))return r("each event must be a JSON object");let t=ee(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return r(`event does not accept the "${t}" field`);if(typeof e.eventId!="string"||e.eventId.length===0)return r("event eventId must be a non-empty string");if(!i(e.payload))return r("event payload must be a JSON object");let n={eventId:e.eventId,payload:e.payload};if(e.occurredAt!==void 0){if(typeof e.occurredAt!="string"||e.occurredAt.length===0)return r("event occurredAt must be a non-empty string");n.occurredAt=e.occurredAt}if(e.dedupeKey!==void 0){if(typeof e.dedupeKey!="string"||e.dedupeKey.length===0)return r("event dedupeKey must be a non-empty string");n.dedupeKey=e.dedupeKey}return a(n)}function $n(e){return!i(e)||typeof e.tickId!="string"||typeof e.cursorUpdated!="boolean"||!Array.isArray(e.results)||!e.results.every(ve)?r("publish polling tick events data surface shape is invalid"):a(e)}function ve(e){return i(e)&&typeof e.eventId=="string"&&typeof e.dedupeKey=="string"&&typeof e.duplicate=="boolean"&&(e.flowRunId===null||typeof e.flowRunId=="string")}function ee(e,t){return Object.keys(e).find(n=>!t.includes(n))}var te="/internal/egress-grants",q="/internal/tool-invocations",Jn="/:flowRunId/egress-grant",Xn="/:invocationId/egress-grant",Yn="/:pollingInstanceId/egress-grant",zn="/:triggerInstanceId/egress-grant",Qn="/:grantId/consume",Zn="/:grantId/audit",er=e=>`${f}/${encodeURIComponent(e)}/egress-grant`,tr=e=>`${q}/${encodeURIComponent(e)}/egress-grant`,nr=e=>`${P}/${encodeURIComponent(e)}/egress-grant`,rr=e=>`${S}/${encodeURIComponent(e)}/egress-grant`,or=e=>`${te}/${encodeURIComponent(e)}/consume`,ir=e=>`${te}/${encodeURIComponent(e)}/audit`,Ue=["flow_action","single_tool","polling_trigger","webhook_trigger"],Le=/^[A-Za-z0-9][A-Za-z0-9:_+/=.-]{15,1023}$/;function O(e){return typeof e=="string"&&Le.test(e)}function Be(e){if(!i(e)||e.body_type!=="multipart")return!1;let t=e.body;if(!i(t))return!1;let n=t.parts;return Array.isArray(n)?n.some(o=>i(o)?o.kind==="file"&&typeof o.file_id=="string"&&o.file_id.length>0:!1):!1}function u(e){return{ok:!1,kind:"shape",reason:e}}function N(){return{ok:!1,kind:"request_digest",reason:"request digest is missing or malformed"}}function F(e,t){if(!i(e))return{ok:!1,reason:"grant request body must be a JSON object"};for(let n of Object.keys(e))if(!t.includes(n))return{ok:!1,reason:`grant request does not accept the "${n}" field`};return{ok:!0,record:e}}function v(e){if(!i(e))return"request must be a JSON object"}function sr(e){let t=F(e,["nodeId","request","requestDigest"]);if(!t.ok)return u(t.reason);let n=t.record.nodeId;if(typeof n!="string"||n.length===0)return u("nodeId is required");let o=v(t.record.request);if(o!==void 0)return u(o);let s=t.record.requestDigest;return O(s)?{ok:!0,value:{nodeId:n,requestDigest:s,requestHasMultipartFiles:Be(t.record.request)}}:N()}function ar(e){let t=F(e,["request","requestDigest"]);if(!t.ok)return u(t.reason);let n=v(t.record.request);if(n!==void 0)return u(n);let o=t.record.requestDigest;return O(o)?{ok:!0,value:{requestDigest:o}}:N()}function pr(e){let t=F(e,["tickId","request","requestDigest"]);if(!t.ok)return u(t.reason);let n=t.record.tickId;if(typeof n!="string"||n.length===0)return u("tickId is required");let o=v(t.record.request);if(o!==void 0)return u(o);let s=t.record.requestDigest;return O(s)?{ok:!0,value:{tickId:n,requestDigest:s}}:N()}function lr(e){let t=F(e,["phase","lifecycle","request","requestDigest"]);if(!t.ok)return u(t.reason);let n=t.record.phase;if(n!=="lifecycle"&&n!=="handler")return u('phase must be "lifecycle" or "handler"');let o=t.record.lifecycle,s;if(o!==void 0){if(o!=="enable"&&o!=="disable"&&o!=="renew")return u('lifecycle must be "enable", "disable", or "renew"');s=o}if(n==="lifecycle"&&s===void 0)return u("lifecycle is required for the lifecycle phase");let p=v(t.record.request);if(p!==void 0)return u(p);let l=t.record.requestDigest;return O(l)?{ok:!0,value:{phase:n,...s!==void 0?{lifecycle:s}:{},requestDigest:l}}:N()}function ne(e){return Ue.includes(e)?e:void 0}var Ge=["scopeKind","scopeId","requestDigest"];function ur(e){if(!i(e))return u("consume body must be a JSON object");for(let s of Object.keys(e))if(!Ge.includes(s))return u(`consume does not accept the "${s}" field`);let t=ne(e.scopeKind);if(t===void 0)return u("scopeKind is invalid");let n=e.scopeId;if(typeof n!="string"||n.length===0)return u("scopeId is required");let o=e.requestDigest;return O(o)?{ok:!0,value:{scopeKind:t,scopeId:n,requestDigest:o}}:N()}var He=["scopeKind","scopeId","providerHost","status","durationMs","requestBytes","responseBytes","errorCode"];function b(e,t){return typeof e!="number"||!Number.isInteger(e)||e<0?{ok:!1,reason:`${t} must be a non-negative integer`}:{ok:!0,value:e}}function cr(e){if(!i(e))return u("audit body must be a JSON object");for(let d of Object.keys(e))if(!He.includes(d))return u(`audit does not accept the "${d}" field`);let t=ne(e.scopeKind);if(t===void 0)return u("scopeKind is invalid");let n=e.scopeId;if(typeof n!="string"||n.length===0)return u("scopeId is required");let o=e.providerHost;if(typeof o!="string"||o.length===0)return u("providerHost is required");let s=b(e.durationMs,"durationMs");if(!s.ok)return u(s.reason);let p;if(e.status!==void 0){let d=b(e.status,"status");if(!d.ok)return u(d.reason);p=d.value}let l;if(e.requestBytes!==void 0){let d=b(e.requestBytes,"requestBytes");if(!d.ok)return u(d.reason);l=d.value}let c;if(e.responseBytes!==void 0){let d=b(e.responseBytes,"responseBytes");if(!d.ok)return u(d.reason);c=d.value}let H;if(e.errorCode!==void 0){let d=e.errorCode;if(typeof d!="string"||d.length===0)return u("errorCode must be a non-empty string");H=d}return{ok:!0,value:{scopeKind:t,scopeId:n,providerHost:o,...p!==void 0?{status:p}:{},durationMs:s.value,...l!==void 0?{requestBytes:l}:{},...c!==void 0?{responseBytes:c}:{},...H!==void 0?{errorCode:H}:{}}}}function dr(e){return!i(e)||!i(e.grant)?r("egress grant envelope must carry a grant object"):a(e.grant)}function gr(e){return!i(e)||e.consumed!==!0?r("egress grant consume data must carry consumed:true"):a({consumed:!0})}var Tr="/:flowRunId/runtime-credential",xr="/:invocationId/runtime-credential",Er="/:pollingInstanceId/runtime-credential",wr="/:triggerInstanceId/runtime-credential",Ar=e=>`${f}/${encodeURIComponent(e)}/runtime-credential`,kr=e=>`${q}/${encodeURIComponent(e)}/runtime-credential`,Sr=e=>`${P}/${encodeURIComponent(e)}/runtime-credential`,hr=e=>`${S}/${encodeURIComponent(e)}/runtime-credential`,Pr=["flow_action","tool_invoke","polling_trigger","webhook_trigger"];function U(e,t){if(!i(e))return{ok:!1,reason:"runtime credential request body must be a JSON object"};for(let n of Object.keys(e))if(!t.includes(n))return{ok:!1,reason:`runtime credential request does not accept the "${n}" field`};return{ok:!0,record:e}}function Or(e){let t=U(e,["nodeId"]);if(!t.ok)return r(t.reason);let n=t.record.nodeId;return typeof n!="string"||n.length===0?r("nodeId is required"):a({nodeId:n})}function Nr(e){let t=U(e??{},[]);return t.ok?a(null):r(t.reason)}function Dr(e){let t=U(e,["tickId"]);if(!t.ok)return r(t.reason);let n=t.record.tickId;return typeof n!="string"||n.length===0?r("tickId is required"):a({tickId:n})}function Cr(e){let t=U(e,["executionKind","deliveryId","lifecycleOperation"]);if(!t.ok)return r(t.reason);let n=t.record.executionKind;if(n!=="event_handler"&&n!=="lifecycle")return r('executionKind must be "event_handler" or "lifecycle"');let o,s=t.record.deliveryId;if(s!==void 0){if(typeof s!="string"||s.length===0)return r("deliveryId must be a non-empty string");o=s}let p,l=t.record.lifecycleOperation;if(l!==void 0){if(l!=="enable"&&l!=="disable"&&l!=="renew")return r('lifecycleOperation must be "enable", "disable", or "renew"');p=l}return n==="lifecycle"&&p===void 0?r("lifecycleOperation is required for the lifecycle execution kind"):a({executionKind:n,...o!==void 0?{deliveryId:o}:{},...p!==void 0?{lifecycleOperation:p}:{}})}function br(e){return!i(e)||typeof e.sessionId!="string"||typeof e.connectionId!="string"||!i(e.credential)?r("runtime credential session must carry sessionId, connectionId and a credential object"):a(e.credential)}var Me="/workspaces/:workspaceId/files",$e=e=>`/workspaces/${encodeURIComponent(e)}/files/upload-session`,Ke=(e,t)=>`/workspaces/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}/complete`,We=(e,t)=>`/workspaces/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}`,Ve=(e,t,n)=>`/workspaces/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}/access?intent=${encodeURIComponent(n)}`;function L(e){return!i(e)||typeof e.file_id!="string"||typeof e.name!="string"||typeof e.size_bytes!="number"||typeof e.created_at!="string"||typeof e.expires_at!="string"||e.mime_type!==void 0&&typeof e.mime_type!="string"||e.sha256!==void 0&&typeof e.sha256!="string"||e.source!==void 0&&typeof e.source!="string"?r("file ref data does not match the AIS file-ref shape"):a(e)}function re(e){return!i(e)||e.method!=="GET"&&e.method!=="PUT"||typeof e.url!="string"||typeof e.expires_at!="string"||!Xe(e.headers)?r("presigned file URL data is invalid"):a(e)}function qe(e){if(!i(e))return r("file upload session data is invalid");let t=L(e.file);if(!t.ok)return r(t.reason);let n=re(e.upload);return n.ok?a({file:t.value,upload:n.value}):r(n.reason)}function je(e){if(!i(e))return r("file metadata data is invalid");let t=L(e.file);return t.ok?a({file:t.value}):r(t.reason)}function j(e){if(!i(e)||!Je(e.intent))return r("file access data is invalid");let t=L(e.file);if(!t.ok)return r(t.reason);let n=re(e.access);return n.ok?a({file:t.value,access:n.value,intent:e.intent}):r(n.reason)}function Je(e){return e==="preview"||e==="download"||e==="text"}function Xe(e){return i(e)?Object.values(e).every(t=>typeof t=="string"):!1}var T="/internal/files",Gr="/upload-session",Hr="/:fileId/complete",Mr="/:fileId/access",$r="/:fileId/stat",Kr="/:fileId/content",Wr=()=>T,Vr=()=>`${T}/upload-session`,qr=e=>`${T}/${encodeURIComponent(e)}/complete`,jr=(e,t)=>`${T}/${encodeURIComponent(e)}/access?intent=${encodeURIComponent(t)}`,oe=e=>`?scope_kind=${encodeURIComponent(e.scopeKind)}&scope_id=${encodeURIComponent(e.scopeId)}`,Jr=(e,t)=>`${T}/${encodeURIComponent(e)}/stat${oe(t)}`,Xr=(e,t)=>`${T}/${encodeURIComponent(e)}/content${oe(t)}`;function Yr(e){if(!i(e))return r("internal file access data is invalid");if(e.intent==="runtime_read"||e.intent==="provider_multipart"){let t=j({...e,intent:"preview"});return t.ok?a({file:t.value.file,access:t.value.access,intent:e.intent}):r(t.reason)}return r("internal file access intent is invalid")}var eo="/:flowRunId/human-inputs",to="/:flowRunId/human-inputs/:requestId",no="/:flowRunId/human-inputs/:requestId/expire",ro="/:flowRunId/human-inputs/:requestId/acknowledge",Ye=e=>`${f}/${encodeURIComponent(e)}/human-inputs`,ie=(e,t)=>`${Ye(e)}/${encodeURIComponent(t)}`,oo=(e,t)=>`${ie(e,t)}/expire`,io=(e,t)=>`${ie(e,t)}/acknowledge`,ze="human_input_resolved";function so(e){return`${ze}_${e}`}function g(e){return{ok:!1,reason:e}}function R(e,t){return i(e)?{ok:!0,value:e}:g(`${t} must be an object`)}function x(e,t){return typeof e!="string"||e.length===0?g(`${t} must be a non-empty string`):{ok:!0,value:e}}var Qe=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})$/;function Ze(e,t){return typeof e!="string"||!Qe.test(e)||Number.isNaN(Date.parse(e))?g(`${t} must be an ISO-8601 timestamp`):{ok:!0,value:e}}function et(e){let t=R(e,"renderedPrompt");if(!t.ok)return t;let n=x(t.value.title,"renderedPrompt.title");if(!n.ok)return n;let o={title:n.value};if(t.value.body!==void 0){if(typeof t.value.body!="string")return g("renderedPrompt.body must be a string");o.body=t.value.body}if(t.value.format!==void 0){if(t.value.format!=="plain"&&t.value.format!=="markdown")return g("renderedPrompt.format is invalid");o.format=t.value.format}return{ok:!0,value:o}}function tt(e){let t=R(e,"input");if(!t.ok)return t;let n=t.value.kind;if(n==="choice"){if(!Array.isArray(t.value.choices))return g("input.choices must be an array")}else if(n!=="text")if(n==="form"){if(!Array.isArray(t.value.fields))return g("input.fields must be an array")}else return g("input.kind is invalid");return{ok:!0,value:t.value}}function nt(e){if(e==null)return{ok:!0,value:void 0};let t=R(e,"partiallyRenderedDelivery");if(!t.ok)return t;let n=t.value.actions;if(n===void 0)return{ok:!0,value:{}};if(!Array.isArray(n))return g("partiallyRenderedDelivery.actions must be an array");let o=[];for(let s of n){let p=R(s,"delivery action");if(!p.ok)return p;let l=x(p.value.id,"delivery action id");if(!l.ok)return l;let c=se(p.value.inputs,`delivery action '${l.value}' inputs`);if(!c.ok)return c;o.push({id:l.value,inputs:c.value})}return{ok:!0,value:{actions:o}}}function se(e,t){let n=R(e,t);if(!n.ok)return n;let o={};for(let[s,p]of Object.entries(n.value)){let l=ae(p,`${t}.${s}`);if(!l.ok)return l;o[s]=l.value}return{ok:!0,value:o}}function ae(e,t){let n=R(e,t);if(!n.ok)return n;switch(n.value.kind){case"literal":return{ok:!0,value:{kind:"literal",value:n.value.value}};case"human_input_ref":{let s=x(n.value.path,`${t}.path`);return s.ok?{ok:!0,value:{kind:"human_input_ref",path:s.value}}:s}case"array":{if(!Array.isArray(n.value.items))return g(`${t}.items must be an array`);let s=[];for(let[p,l]of n.value.items.entries()){let c=ae(l,`${t}[${p}]`);if(!c.ok)return c;s.push(c.value)}return{ok:!0,value:{kind:"array",items:s}}}case"object":{let s=se(n.value.entries,`${t}.entries`);return s.ok?{ok:!0,value:{kind:"object",entries:s.value}}:s}case"template":{if(!Array.isArray(n.value.parts))return g(`${t}.parts must be an array`);let s=[];for(let[p,l]of n.value.parts.entries()){let c=rt(l,`${t}.parts[${p}]`);if(!c.ok)return c;s.push(c.value)}return{ok:!0,value:{kind:"template",parts:s}}}default:return g(`${t}.kind is invalid`)}}function rt(e,t){let n=R(e,t);if(!n.ok)return n;let o=n.value.kind;if(o==="literal")return typeof n.value.value!="string"?g(`${t}.value must be a string`):{ok:!0,value:{kind:"literal",value:n.value.value}};if(o==="human_input_ref"){let s=x(n.value.path,`${t}.path`);return s.ok?{ok:!0,value:{kind:"human_input_ref",path:s.value}}:s}return g(`${t}.kind is invalid`)}function ao(e){let t=R(e,"request body");if(!t.ok)return r(t.reason);let n=x(t.value.nodeId,"nodeId");if(!n.ok)return r(n.reason);let o=et(t.value.renderedPrompt);if(!o.ok)return r(o.reason);let s=tt(t.value.input);if(!s.ok)return r(s.reason);let p=x(t.value.timeout,"timeout");if(!p.ok)return r(p.reason);let l=Ze(t.value.expiresAt,"expiresAt");if(!l.ok)return r(l.reason);let c=nt(t.value.partiallyRenderedDelivery);return c.ok?a({nodeId:n.value,renderedPrompt:o.value,input:s.value,timeout:p.value,expiresAt:l.value,...c.value!==void 0?{partiallyRenderedDelivery:c.value}:{}}):r(c.reason)}function ot(e){return!i(e)||typeof e.id!="string"||e.id.length===0||typeof e.nodeId!="string"||typeof e.status!="string"||!(e.output===null||i(e.output))?r("human input request view must carry id, nodeId, status and output"):a(e)}function po(e){if(!i(e)||typeof e.created!="boolean")return r("human input create data must carry created:boolean");let t=ot(e.request);return t.ok?a({created:e.created,request:t.value}):t}function lo(e){return!i(e)||e.acknowledged!==!0?r("human input acknowledge data must carry acknowledged:true"):a({acknowledged:!0})}var co="ablehi-wfp-user-runtime-manifest/v1",go="unknown";function fo(e){return e.endsWith(".js")?`${e.slice(0,-3)}.manifest.json`:`${e}.manifest.json`}var Ro="/internal/deployment-handshake",it=["start","terminate","send-event","start-webhook-watcher","run-polling-tick","invoke-tool","invoke-trigger-handler","invoke-webhook-protocol-adapter","deployment-handshake"],_o=it,Io="HANDSHAKE_REQUEST_INVALID",yo="HANDSHAKE_SECRET_UNCONFIGURED",To="HANDSHAKE_SECRET_MISMATCH",xo="HANDSHAKE_CONTRACT_VERSION_MISMATCH",Eo="HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH",wo="HANDSHAKE_CAPABILITY_MISSING";function Ao(e){return[e.nonce,e.timestamp,e.contractVersion,e.dispatchNamespace].map(n=>`${n.length}:${n}`).join(".")}function ko(e){return["response",e.nonce,e.contractVersion,e.dispatchNamespace,...e.capabilities].map(n=>`${n.length}:${n}`).join(".")}var ho="platform.access",Po="platform.api_key.manage";var No="/me",Do=()=>"/me";var st="/app/bootstrap",bo=()=>st;var pe="/workspaces",vo="/",Uo="/:workspaceId",at="/me/default-workspace",Lo=e=>`${pe}/${encodeURIComponent(e)}`,Bo=()=>pe,Go=()=>at;var J="/api-keys",pt="/grant-options",Mo="/:apiKeyId",$o="ahi_key_",Ko="workspace.full_access",Wo=()=>J,Vo=()=>`${J}${pt}`,qo=e=>`${J}/${encodeURIComponent(e)}`;var X="/catalog",Jo="/integrations",Xo="/integrations/:slug",Yo="/versions",zo="/integrations/:slug/default-provider-app-config",Qo=e=>{let t=`${X}/integrations`;return e?.category!==void 0&&e.category!==""?`${t}?category=${encodeURIComponent(e.category)}`:t},lt=e=>`${X}/integrations/${encodeURIComponent(e)}`,Zo=()=>`${X}/versions`,ei=e=>`${lt(e)}/default-provider-app-config`;var ni="/workspaces/:workspaceId/integrations",ri="/:installationId",oi="/:installationId/tools",ut=e=>`/workspaces/${encodeURIComponent(e)}/integrations`,ct=(e,t)=>`${ut(e)}/${encodeURIComponent(t)}`,ii=(e,t)=>`${ct(e,t)}/tools`;var ai="/workspaces/:workspaceId",pi="/connections",li="/integrations/:installationId/connect/start",ui="/integrations/:installationId/connect/options",ci="/connect-sessions/:sessionId/submit",di="/connect-sessions/:sessionId/complete",gi="/integrations/:installationId/connections/:connectionRef",fi="/callbacks/redirect",E=e=>`/workspaces/${encodeURIComponent(e)}`,mi=e=>`${E(e)}/connections`,Ri=(e,t)=>`${E(e)}/integrations/${encodeURIComponent(t)}/connect/start`,_i=(e,t)=>`${E(e)}/integrations/${encodeURIComponent(t)}/connect/options`,Ii=(e,t)=>`${E(e)}/connect-sessions/${encodeURIComponent(t)}/submit`,yi=(e,t)=>`${E(e)}/connect-sessions/${encodeURIComponent(t)}/complete`,Ti=(e,t,n)=>`${E(e)}/integrations/${encodeURIComponent(t)}/connections/${encodeURIComponent(n)}`;var Ei="/workspaces/:workspaceId/flows",wi="/validate",Ai="/:flowId",ki="/:flowId/enable",Si="/:flowId/disable",hi="/:flowId/draft",Pi="/:flowId/versions",Oi="/:flowId/versions/:version",le=e=>`/workspaces/${encodeURIComponent(e)}/flows`,Ni=e=>`${le(e)}/validate`,B=(e,t)=>`${le(e)}/${encodeURIComponent(t)}`,Di=(e,t)=>`${B(e,t)}/enable`,Ci=(e,t)=>`${B(e,t)}/disable`,bi=(e,t)=>`${B(e,t)}/draft`,dt=(e,t)=>`${B(e,t)}/versions`,Fi=(e,t,n)=>`${dt(e,t)}/${n}`;var Ui="/workspaces/:workspaceId/agent",Li="/chat",Bi="/flow-context",Gi="/sessions",Hi="/sessions/:sessionId",Mi=e=>`/workspaces/${encodeURIComponent(e)}/agent/chat`,$i=e=>`/workspaces/${encodeURIComponent(e)}/agent/sessions`,Ki=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/sessions/${encodeURIComponent(t)}`,Wi=20,Vi=50,qi=100,ji="flow_authoring",Ji=["flow","flow_run","inbox_entry","integration"],Xi=256,Yi=10,zi=256,Qi=["getFlowContext","getWorkingFlowIr","setFlowMeta","addNode","updateNode","removeNode","setTrigger","removeTrigger","setOutputs","setComposition","validateFlow","proposePublish","requestConnect"],Zi=["setFlowMeta","addNode","updateNode","removeNode","setTrigger","removeTrigger","setOutputs","setComposition"];function es(e){return JSON.stringify(e)}var G={type:"object",properties:{},additionalProperties:!1},w={type:"object",additionalProperties:!0},gt=[{name:"getFlowContext",execution:"server",description:"Read the current workspace environment snapshot (installed integrations, their control-plane tools and triggers with stable refs, and active connections). Call this first to learn which toolRef / triggerRef / connectionRef values are available before editing the flow.",inputSchema:G},{name:"getWorkingFlowIr",execution:"server",description:"Read the current Server-owned working flow IR (flow.ir.v1), including existing triggers, nodes, outputs, and composition. Call this before editing an existing or non-empty flow, or whenever you need to inspect the current flow state.",inputSchema:G},{name:"setFlowMeta",execution:"server",description:"Set the working flow metadata: the flow logical name and/or its inputSchema (the $input contract).",inputSchema:{type:"object",properties:{flow:{type:"string",description:"Flow logical name."},inputSchema:{...w,description:"JSON object describing $input."}},additionalProperties:!1}},{name:"addNode",execution:"server",description:"Add one node to the working flow IR. node.kind is action | wait_event | sleep | human_input. action needs { id, kind:'action', toolRef, connectionRef, inputs }. wait_event needs { id, kind:'wait_event', eventType, correlation, timeout, onTimeout }. sleep needs { id, kind:'sleep', duration }. human_input needs { id, kind:'human_input', prompt:{ title, body?, format?:'plain'|'markdown' }, input, timeout, delivery? } \u2014 use it whenever the flow must WAIT for a person to review/approve/choose/answer before continuing; never use a normal action node or a provider approval tool as the wait point. human_input.input is { kind:'choice', choices:[{ id, label, style? }], allowComment? } | { kind:'text', multiline?, placeholder?, required? } | { kind:'form', fields:[{ id, label, type:'text'|'textarea'|'number'|'boolean'|'select', required?, options? }] }. Approve/reject is input.kind:'choice' with choices approve and reject (reject is just a choice with NO automatic side effect; wire any reject behavior yourself). Three or more options is the same choice kind with more choices. Free text is input.kind:'text'; structured answers are input.kind:'form'. Downstream nodes read $nodes.<human_input_id>.output, whose runtime shape is { status:'submitted', response, actor, submissionSource, submittedAt } | { status:'expired', actor, expiredAt } \u2014 the submitted value is nested under output.response ({ kind:'choice', choiceId, comment? } | { kind:'text', text } | { kind:'form', values }), NEVER directly on output. Examples: choice branch runIf { eq:[ $nodes.review.output.response.choiceId, 'approve' ] }; text value ${$nodes.ask.output.response.text}; form field ${$nodes.details.output.response.values.priority}; timeout branch runIf { eq:[ $nodes.review.output.status, 'expired' ] } (an expired human_input is a normal output, not a failure). Optional external notifications go under delivery.actions[] as { id, toolRef, connectionRef, inputs } using the SAME action triad as an action node (concrete string toolRef + concrete user-chosen string connectionRef + inputs); Inbox is always the default surface and is never itself a delivery action; you may add zero or more delivery actions. Only delivery.actions[].inputs may reference $humanInput, and the standard payload field uses the whole-object single reference form $humanInput.actions.<deliveryActionId>.payload (never string-interpolated). Do not invent provider shorthand fields; use the action's own input names. If a native feedback action declares fixed choice ids, the human_input.input.choices[].id MUST match those ids exactly (labels may differ, e.g. Yes/No) \u2014 never auto-map yes/no to approve/reject. Use dependsOn and $nodes.<id>.output.* references to wire data between nodes. node inputs MUST NOT reference $trigger (trigger output is bound only in the trigger's inputMapping / dedupeKey); read trigger-derived values via $input.* instead. In text templates reference fields with ${$input.*} / ${$nodes.*}; mixed text MUST NOT contain a bare reference (write 'Issue: ${$input.title}', never 'Issue: $input.title'), and a literal dollar sign is written as $$ (e.g. 'Pay $$5'). duration / timeout strings MUST be '<positive integer> <unit>' where unit is second|minute|hour|day (plural allowed), e.g. '1 hour', '10 minutes', '5 days' \u2014 compact forms like '1h' / '10m' are rejected by the server.",inputSchema:{type:"object",properties:{node:{...w,description:"A FlowNode object."}},required:["node"],additionalProperties:!1}},{name:"updateNode",execution:"server",description:"Patch an existing node by id. patch is a partial node object whose fields are shallow-merged into the node.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Target node id."},patch:{...w,description:"Partial node fields to merge."}},required:["id","patch"],additionalProperties:!1}},{name:"removeNode",execution:"server",description:"Remove a node from the working flow IR by id.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Node id to remove."}},required:["id"],additionalProperties:!1}},{name:"setTrigger",execution:"server",description:"Upsert a trigger by id (replaces a trigger with the same id). trigger.kind is schedule | integration | manual. schedule needs { id, kind:'schedule', cron, timezone }. integration needs { id, kind:'integration', triggerRef, connectionRef, config, inputMapping?, dedupeKey? }. manual needs { id, kind:'manual' }. For an integration trigger, fill config from the trigger inputSchema in getFlowContext and NEVER omit a requiredInputs field (e.g. linear/new_issue requires config.team_id). $trigger.output.* may ONLY be referenced inside the trigger's own inputMapping / dedupeKey; node inputs MUST NOT reference $trigger. In any text template, reference fields with ${$input.*} / ${$nodes.*}; mixed text MUST NOT contain a bare reference (write 'Issue: ${$input.title}', never 'Issue: $input.title'), and a literal dollar sign is written as $$ (e.g. 'Pay $$5'). Always run validateFlow before proposing publish.",inputSchema:{type:"object",properties:{trigger:{...w,description:"A TriggerBinding object."}},required:["trigger"],additionalProperties:!1}},{name:"removeTrigger",execution:"server",description:"Remove a trigger from the working flow IR by id.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Trigger id to remove."}},required:["id"],additionalProperties:!1}},{name:"setOutputs",execution:"server",description:"Set the working flow outputs mapping: the MACHINE response / API response of the flow (structured data for programs and webhooks), NOT the user-facing result. The user-readable Inbox result is composition (use setComposition for that); never describe outputs to the user as their result, and never derive composition from outputs. Only reference fields that exist in a tool or trigger output schema. Use $nodes.<id>.output.<arrayField>.length to project an array count. In text templates reference fields with ${$input.*} / ${$nodes.*}; mixed text MUST NOT contain a bare reference (write 'Total: ${$nodes.sum.output.value}', never 'Total: $nodes.sum.output.value'), and a literal dollar sign is written as $$ (e.g. 'Pay $$5'). Do not invent output fields from node inputs; for example, if a search tool output only declares results, use a literal or $input value for the original query instead of $nodes.<id>.output.query.",inputSchema:{type:"object",properties:{outputs:{...w,description:"Outputs mapping object."}},required:["outputs"],additionalProperties:!1}},{name:"setComposition",execution:"server",description:"Set the flow composition: the USER-READABLE result work that a successful run saves as one Inbox result for a person to read (NOT the machine response \u2014 that is outputs). composition.title is a short headline. composition.detail.format MUST be 'markdown' and composition.detail.body is the markdown a human reads. Optionally composition.detail.data is a structured mapping kept for reference (never shown by default). Add composition.report ONLY when the flow already has a node that produces a human report (e.g. an AI analysis/report node): set its report.format='markdown' and report.body from that node output; never invent a report when no report-producing node exists. Reference run data with ${$input.*} / ${$nodes.*} only (composition MUST NOT reference $trigger or $outputs); mixed text MUST NOT contain a bare reference (write 'Result: ${$nodes.sum.output.value}', never 'Result: $nodes.sum.output.value'), and a literal dollar sign is written as $$ (e.g. 'Pay $$5'). Creating a flow MUST create a composition; editing nodes or input semantics MUST keep composition consistent. The whole composition object replaces the previous one.",inputSchema:{type:"object",properties:{composition:{...w,description:"A FlowCompositionSpec: { title, detail:{ format:'markdown', body, data? }, report?:{ title?, format:'markdown', body, data? } }."}},required:["composition"],additionalProperties:!1}},{name:"validateFlow",execution:"server",description:"Validate the current Server-owned working flow IR against the Ablehi Server (authoritative). A valid result automatically persists the flow draft and runs readiness; the server is the only source of flow validity.",inputSchema:G},{name:"proposePublish",execution:"server",description:"When the latest Server-owned draft is publishable, return a structured publish suggestion for the human. This tool never publishes and never creates an approval; publishing is only POST /publish with human confirm:true.",inputSchema:G},{name:"requestConnect",execution:"client",description:"Ask the user to connect an integration so a connectionRef becomes available. Opens the connection UI. The user supplies any credential directly to the Ablehi Server; you only receive { status, connectionRef? } and never the secret.",inputSchema:{type:"object",properties:{installationId:{type:"string",description:"Installation to connect."},connectionName:{type:"string",description:"Optional connection display name."}},required:["installationId"],additionalProperties:!1}}];function ts(e){return gt.find(t=>t.name===e)}var ns="AGENT_RUNTIME_UNCONFIGURED",rs="AGENT_RUNTIME_FAILED",os="AGENT_SESSION_NOT_FOUND",is="AGENT_MESSAGE_DELTA_INVALID",ss="AGENT_PAGE_CONTEXT_INVALID",Y="/agent/assets",as="/prompts",ps="/prompts/:targetKey/:revision",ls="/prompts/:targetKey/:revision/validate",us="/prompts/:targetKey/:revision/activate",cs="/model-input-targets",ds="/model-input-targets/:targetKey/render-preview",gs="/model-input-snapshots",fs="/flow-scenes",ms="/flow-scenes/:sceneKey/:revision",Rs="/flow-scenes/:sceneKey/:revision/validate",_s="/flow-scenes/:sceneKey/:revision/activate",Is="/flow-scenes/:sceneKey/:revision/reindex",ys="/flow-templates",Ts="/flow-templates/:templateKey/:revision",xs="/flow-templates/:templateKey/:revision/validate",Es="/flow-templates/:templateKey/:revision/activate",ws="/flow-templates/:templateKey/:revision/reindex",As="/flow-working-drafts/open",ks="/flow-working-drafts/:draftId",Ss="/flow-working-drafts/:draftId/commands",hs="/flow-working-drafts/:draftId/edit-turn/acquire",Ps="/flow-working-drafts/:draftId/edit-turn/release",Os="/flow-working-drafts/:draftId/publish",Ns="/flow-working-drafts/:draftId/readiness/check",Ds="/flow-working-drafts/:draftId/readiness/requirements/:requirementId/resolve",Cs="/flow-creation-tasks/:flowCreationTaskId",bs="/flow-creation-decisions/:decisionRecordId",Fs=()=>`${Y}/prompts`,vs=()=>`${Y}/flow-scenes`,Us=()=>`${Y}/flow-templates`,Ls=e=>`/workspaces/${encodeURIComponent(e)}/agent/flow-working-drafts/open`,A=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-working-drafts/${encodeURIComponent(t)}`,Bs=(e,t)=>`${A(e,t)}/commands`,Gs=(e,t)=>`${A(e,t)}/edit-turn/acquire`,Hs=(e,t)=>`${A(e,t)}/edit-turn/release`,Ms=(e,t)=>`${A(e,t)}/publish`,$s=(e,t)=>`${A(e,t)}/readiness/check`,Ks=(e,t,n)=>`${A(e,t)}/readiness/requirements/${encodeURIComponent(n)}/resolve`,Ws=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-creation-tasks/${encodeURIComponent(t)}`,Vs=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-creation-decisions/${encodeURIComponent(t)}`,qs="agent.asset.manage",js=/^[A-Za-z0-9_-]{1,64}$/,Js="flow_create_authoring_task",ft="oneoff_getActionContext",mt="oneoff_executeAction",Xs=[ft,mt],Ys=["agent.general.turn","agent.intent.flow_goal","agent.one_off.turn","flow_authoring.edit_turn","flow_authoring.create_from_brief_turn","flow_authoring.server_loop_command","workflow.flow_authoring.scene_fit_judge","workflow.flow_authoring.template_fit_judge","workflow.flow_authoring.brief_generation","workflow.flow_authoring.fallback_plan"],zs="AGENT_ASSET_NOT_FOUND",Qs="AGENT_ASSET_VALIDATION_FAILED",Zs="AGENT_PROMPT_TARGET_NOT_FOUND",ea="AGENT_PROMPT_ACTIVE_REVISION_MISSING",ta="AGENT_PROMPT_REVISION_NOT_FOUND",na="AGENT_PROMPT_REVISION_NOT_DRAFT",ra="AGENT_PROMPT_VALIDATION_FAILED",oa="AGENT_MODEL_INPUT_TARGET_PROTECTED",ia="AGENT_MODEL_INPUT_PREVIEW_UNAVAILABLE",sa="AGENT_FLOW_GOAL_INVALID",aa="AGENT_FLOW_CREATION_TASK_NOT_FOUND",pa="AGENT_FLOW_CREATION_TASK_CONFLICT",la="AGENT_FLOW_AUTHORING_WORKFLOW_FAILED",ua="FLOW_WORKING_DRAFT_NOT_FOUND",ca="FLOW_DRAFT_REVISION_CONFLICT",da="FLOW_DRAFT_COMMAND_INVALID",ga="FLOW_DRAFT_EDIT_LOCKED",fa="FLOW_EDIT_TURN_NOT_HELD",ma="FLOW_DRAFT_NOT_PUBLISHABLE",Ra="FLOW_PUBLISH_CONFIRMATION_REQUIRED",_a="FLOW_READINESS_REQUIREMENT_NOT_FOUND",Ia="FLOW_READINESS_REQUIREMENT_CONFLICT",ya="AGENT_ASSET_INDEX_FAILED";var xa="/workspaces/:workspaceId/runs",Ea="/workspaces/:workspaceId/flows/:flowId/runs",wa="/:runId",Aa="/:runId/cancel",ka="/:runId/events",Rt=e=>`/workspaces/${encodeURIComponent(e)}/runs`,ue=(e,t)=>`${Rt(e)}/${encodeURIComponent(t)}`,Sa=(e,t)=>`${ue(e,t)}/cancel`,ha=(e,t)=>`${ue(e,t)}/events`,Pa=(e,t)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/runs`,Oa=["queued","running","succeeded","failed","interrupted","cancelled"],Na=["succeeded","skipped","timed_out","failed"];var Ca="/workspaces/:workspaceId/inbox/items",ba="/workspaces/:workspaceId/inbox/entries",ce="/inbox/entries",Fa="/:itemId",va="/:entryId",Ua="/:entryId/human-input/submit",_t=e=>`/workspaces/${encodeURIComponent(e)}/inbox/items`,La=(e,t)=>`${_t(e)}/${encodeURIComponent(t)}`,It=e=>`/workspaces/${encodeURIComponent(e)}/inbox/entries`,yt=(e,t)=>`${It(e)}/${encodeURIComponent(t)}`,Ba=(e,t)=>`${yt(e,t)}/human-input/submit`,Ga=()=>ce,Tt=e=>`${ce}/${encodeURIComponent(e)}`,Ha=e=>`${Tt(e)}/human-input/submit`;var $a="/human-input/tokens",Ka="/:token",Wa="/:token/submit",xt=e=>`/human-input/tokens/${encodeURIComponent(e)}`,Va=e=>`${xt(e)}/submit`;var ja="/:flowId/trigger-instances",Ja="/:flowId/triggers/:triggerBindingId/simulate",Xa=(e,t)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/trigger-instances`,Ya=(e,t,n)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/triggers/${encodeURIComponent(n)}/simulate`;export{Y as AGENT_ASSETS_ROUTE_PREFIX,fs as AGENT_ASSET_FLOW_SCENES_SUBPATH,_s as AGENT_ASSET_FLOW_SCENE_ACTIVATE_SUBPATH,ms as AGENT_ASSET_FLOW_SCENE_ITEM_SUBPATH,Is as AGENT_ASSET_FLOW_SCENE_REINDEX_SUBPATH,Rs as AGENT_ASSET_FLOW_SCENE_VALIDATE_SUBPATH,ys as AGENT_ASSET_FLOW_TEMPLATES_SUBPATH,Es as AGENT_ASSET_FLOW_TEMPLATE_ACTIVATE_SUBPATH,Ts as AGENT_ASSET_FLOW_TEMPLATE_ITEM_SUBPATH,ws as AGENT_ASSET_FLOW_TEMPLATE_REINDEX_SUBPATH,xs as AGENT_ASSET_FLOW_TEMPLATE_VALIDATE_SUBPATH,ya as AGENT_ASSET_INDEX_FAILED_ERROR_CODE,qs as AGENT_ASSET_MANAGE_PERMISSION,gs as AGENT_ASSET_MODEL_INPUT_SNAPSHOTS_SUBPATH,cs as AGENT_ASSET_MODEL_INPUT_TARGETS_SUBPATH,ds as AGENT_ASSET_MODEL_INPUT_TARGET_PREVIEW_SUBPATH,zs as AGENT_ASSET_NOT_FOUND_ERROR_CODE,as as AGENT_ASSET_PROMPTS_SUBPATH,us as AGENT_ASSET_PROMPT_ACTIVATE_SUBPATH,ps as AGENT_ASSET_PROMPT_ITEM_SUBPATH,ls as AGENT_ASSET_PROMPT_VALIDATE_SUBPATH,Qs as AGENT_ASSET_VALIDATION_FAILED_ERROR_CODE,ji as AGENT_CAPABILITY_FLOW_AUTHORING,Li as AGENT_CHAT_ROUTE_SUBPATH,Js as AGENT_CREATE_FLOW_AUTHORING_TASK_TOOL_NAME,la as AGENT_FLOW_AUTHORING_WORKFLOW_FAILED_ERROR_CODE,Bi as AGENT_FLOW_CONTEXT_ROUTE_SUBPATH,bs as AGENT_FLOW_CREATION_DECISION_ITEM_SUBPATH,pa as AGENT_FLOW_CREATION_TASK_CONFLICT_ERROR_CODE,Cs as AGENT_FLOW_CREATION_TASK_ITEM_SUBPATH,aa as AGENT_FLOW_CREATION_TASK_NOT_FOUND_ERROR_CODE,sa as AGENT_FLOW_GOAL_INVALID_ERROR_CODE,Ds as AGENT_FLOW_READINESS_REQUIREMENT_RESOLVE_SUBPATH,Ss as AGENT_FLOW_WORKING_DRAFT_COMMANDS_SUBPATH,hs as AGENT_FLOW_WORKING_DRAFT_EDIT_TURN_ACQUIRE_SUBPATH,Ps as AGENT_FLOW_WORKING_DRAFT_EDIT_TURN_RELEASE_SUBPATH,ks as AGENT_FLOW_WORKING_DRAFT_ITEM_SUBPATH,As as AGENT_FLOW_WORKING_DRAFT_OPEN_SUBPATH,Os as AGENT_FLOW_WORKING_DRAFT_PUBLISH_SUBPATH,Ns as AGENT_FLOW_WORKING_DRAFT_READINESS_CHECK_SUBPATH,is as AGENT_MESSAGE_DELTA_INVALID_ERROR_CODE,ia as AGENT_MODEL_INPUT_PREVIEW_UNAVAILABLE_ERROR_CODE,Ys as AGENT_MODEL_INPUT_TARGET_KEYS,oa as AGENT_MODEL_INPUT_TARGET_PROTECTED_ERROR_CODE,ss as AGENT_PAGE_CONTEXT_INVALID_ERROR_CODE,Yi as AGENT_PAGE_CONTEXT_MAX_RESOURCES,zi as AGENT_PAGE_CONTEXT_RESOURCE_ID_MAX_LENGTH,Xi as AGENT_PAGE_CONTEXT_ROUTE_ID_MAX_LENGTH,Ji as AGENT_PAGE_RESOURCE_TYPES,ea as AGENT_PROMPT_ACTIVE_REVISION_MISSING_ERROR_CODE,na as AGENT_PROMPT_REVISION_NOT_DRAFT_ERROR_CODE,ta as AGENT_PROMPT_REVISION_NOT_FOUND_ERROR_CODE,Zs as AGENT_PROMPT_TARGET_NOT_FOUND_ERROR_CODE,ra as AGENT_PROMPT_VALIDATION_FAILED_ERROR_CODE,Ui as AGENT_ROUTE_PREFIX,rs as AGENT_RUNTIME_FAILED_ERROR_CODE,js as AGENT_RUNTIME_TOOL_NAME_PATTERN,ns as AGENT_RUNTIME_UNCONFIGURED_ERROR_CODE,Gi as AGENT_SESSIONS_ROUTE_SUBPATH,qi as AGENT_SESSION_DETAIL_MESSAGE_LIMIT,Hi as AGENT_SESSION_ITEM_ROUTE_SUBPATH,Wi as AGENT_SESSION_LIST_DEFAULT_LIMIT,Vi as AGENT_SESSION_LIST_MAX_LIMIT,os as AGENT_SESSION_NOT_FOUND_ERROR_CODE,J as API_KEYS_ROUTE_PREFIX,pt as API_KEY_GRANT_OPTIONS_ROUTE_SUBPATH,Mo as API_KEY_ITEM_ROUTE_SUBPATH,$o as API_KEY_TOKEN_PREFIX,Ko as API_KEY_WORKSPACE_FULL_ACCESS_SCOPE,st as APP_BOOTSTRAP_ROUTE_PATH,zo as CATALOG_DEFAULT_PROVIDER_APP_CONFIG_ROUTE_SUBPATH,Jo as CATALOG_INTEGRATIONS_ROUTE_SUBPATH,Xo as CATALOG_INTEGRATION_DETAIL_ROUTE_SUBPATH,X as CATALOG_ROUTE_PREFIX,Yo as CATALOG_VERSIONS_ROUTE_SUBPATH,pi as CONNECTIONS_ROUTE_SUBPATH,gi as CONNECTION_DISCONNECT_ROUTE_SUBPATH,di as CONNECT_COMPLETE_ROUTE_SUBPATH,ui as CONNECT_OPTIONS_ROUTE_SUBPATH,li as CONNECT_START_ROUTE_SUBPATH,ci as CONNECT_SUBMIT_ROUTE_SUBPATH,Pt as CONTEXT_STATE_CLEANUP_ROUTE_PATH,No as CURRENT_USER_ROUTE_PATH,at as DEFAULT_WORKSPACE_ROUTE_PATH,it as DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES,_o as DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES,Ro as DEPLOYMENT_HANDSHAKE_ROUTE,Zn as EGRESS_GRANT_AUDIT_ROUTE_SUBPATH,Qn as EGRESS_GRANT_CONSUME_ROUTE_SUBPATH,Ue as EGRESS_GRANT_SCOPE_KINDS,$t as EVENT_WAIT_ROUTE_SUBPATH,Ft as EXECUTION_CONTEXT_ROUTE_SUBPATH,Mr as FILE_ACCESS_ROUTE_SUBPATH,Hr as FILE_COMPLETE_ROUTE_SUBPATH,Kr as FILE_CONTENT_ROUTE_SUBPATH,$r as FILE_STAT_ROUTE_SUBPATH,Gr as FILE_UPLOAD_SESSION_ROUTE_SUBPATH,Zi as FLOW_AUTHORING_EDIT_TOOL_NAMES,gt as FLOW_AUTHORING_TOOL_DESCRIPTORS,Qi as FLOW_AUTHORING_TOOL_NAMES,Si as FLOW_DISABLE_ROUTE_SUBPATH,da as FLOW_DRAFT_COMMAND_INVALID_ERROR_CODE,ga as FLOW_DRAFT_EDIT_LOCKED_ERROR_CODE,ma as FLOW_DRAFT_NOT_PUBLISHABLE_ERROR_CODE,ca as FLOW_DRAFT_REVISION_CONFLICT_ERROR_CODE,hi as FLOW_DRAFT_ROUTE_SUBPATH,fa as FLOW_EDIT_TURN_NOT_HELD_ERROR_CODE,ki as FLOW_ENABLE_ROUTE_SUBPATH,ge as FLOW_INTERPRETER_CONTRACT_VERSION,wt as FLOW_IR_SCHEMA_VERSION,Ai as FLOW_ITEM_ROUTE_SUBPATH,Ra as FLOW_PUBLISH_CONFIRMATION_REQUIRED_ERROR_CODE,Ia as FLOW_READINESS_REQUIREMENT_CONFLICT_ERROR_CODE,_a as FLOW_READINESS_REQUIREMENT_NOT_FOUND_ERROR_CODE,Jn as FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH,Mt as FLOW_RUN_RESULT_ROUTE_SUBPATH,Tr as FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Oa as FLOW_RUN_STATUSES,wi as FLOW_VALIDATE_ROUTE_SUBPATH,Pi as FLOW_VERSIONS_ROUTE_SUBPATH,Oi as FLOW_VERSION_ITEM_ROUTE_SUBPATH,ua as FLOW_WORKING_DRAFT_NOT_FOUND_ERROR_CODE,ce as GLOBAL_INBOX_ENTRIES_ROUTE_PREFIX,en as HANDLER_BUNDLES_ROUTE_SUBPATH,wo as HANDSHAKE_CAPABILITY_MISSING,xo as HANDSHAKE_CONTRACT_VERSION_MISMATCH,Eo as HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH,Io as HANDSHAKE_REQUEST_INVALID,To as HANDSHAKE_SECRET_MISMATCH,yo as HANDSHAKE_SECRET_UNCONFIGURED,eo as HUMAN_INPUTS_ROUTE_SUBPATH,ro as HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH,no as HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH,to as HUMAN_INPUT_REQUEST_ROUTE_SUBPATH,ze as HUMAN_INPUT_RESOLVED_EVENT_PREFIX,$a as HUMAN_INPUT_TOKENS_ROUTE_PREFIX,Ka as HUMAN_INPUT_TOKEN_ROUTE_SUBPATH,Wa as HUMAN_INPUT_TOKEN_SUBMIT_ROUTE_SUBPATH,Ua as INBOX_ENTRY_HUMAN_INPUT_SUBMIT_ROUTE_SUBPATH,va as INBOX_ENTRY_ROUTE_SUBPATH,Fa as INBOX_ITEM_ROUTE_SUBPATH,ri as INTEGRATION_ITEM_ROUTE_SUBPATH,oi as INTEGRATION_TOOLS_ROUTE_SUBPATH,te as INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX,T as INTERNAL_FILES_ROUTE_PREFIX,f as INTERNAL_FLOW_RUNS_ROUTE_PREFIX,Ee as INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX,K as INTERNAL_INSTALLATIONS_ROUTE_PREFIX,P as INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX,q as INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX,S as INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX,mt as ONE_OFF_EXECUTE_ACTION_TOOL_NAME,ft as ONE_OFF_GET_ACTION_CONTEXT_TOOL_NAME,Xs as ONE_OFF_TOOL_NAMES,ho as PLATFORM_ACCESS_PERMISSION,Po as PLATFORM_API_KEY_MANAGE_PERMISSION,Fn as POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH,Yn as POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,vn as POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,Er as POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Un as POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH,fi as PROVIDER_CALLBACK_REDIRECT_ROUTE_PATH,Pr as RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS,Aa as RUN_CANCEL_ROUTE_SUBPATH,ka as RUN_EVENTS_ROUTE_SUBPATH,wa as RUN_ITEM_ROUTE_SUBPATH,de as SERVER_CONTRACT_VERSION,Ht as STEP_RESULT_ROUTE_SUBPATH,Na as STEP_RUN_STATUSES,tn as TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH,Xn as TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH,xr as TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,ja as TRIGGER_INSTANCES_ROUTE_SUBPATH,Ja as TRIGGER_SIMULATE_ROUTE_SUBPATH,En as WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH,An as WEBHOOK_PROTOCOL_ADAPTER_MODULE,dn as WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH,fn as WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH,zn as WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,mn as WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH,gn as WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,Rn as WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH,wr as WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,co as WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION,go as WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION,pe as WORKSPACES_ROUTE_PREFIX,Uo as WORKSPACE_ACCESS_ROUTE_SUBPATH,ai as WORKSPACE_CONNECTION_MOUNT_PREFIX,Me as WORKSPACE_FILES_ROUTE_PREFIX,Ei as WORKSPACE_FLOWS_ROUTE_PREFIX,Ea as WORKSPACE_FLOW_RUNS_ROUTE_PREFIX,ba as WORKSPACE_INBOX_ENTRIES_ROUTE_PREFIX,Ca as WORKSPACE_INBOX_ITEMS_ROUTE_PREFIX,ni as WORKSPACE_INTEGRATIONS_ROUTE_PREFIX,vo as WORKSPACE_LIST_ROUTE_SUBPATH,xa as WORKSPACE_RUNS_ROUTE_PREFIX,vs as agentAssetFlowScenesPath,Us as agentAssetFlowTemplatesPath,Fs as agentAssetPromptsPath,Mi as agentChatPath,Vs as agentFlowCreationDecisionPath,Ws as agentFlowCreationTaskPath,Ks as agentFlowReadinessRequirementResolvePath,Bs as agentFlowWorkingDraftCommandsPath,Gs as agentFlowWorkingDraftEditTurnAcquirePath,Hs as agentFlowWorkingDraftEditTurnReleasePath,Ls as agentFlowWorkingDraftOpenPath,A as agentFlowWorkingDraftPath,Ms as agentFlowWorkingDraftPublishPath,$s as agentFlowWorkingDraftReadinessCheckPath,Ki as agentSessionPath,$i as agentSessionsPath,Vo as apiKeyGrantOptionsPath,qo as apiKeyPath,Wo as apiKeysPath,bo as appBootstrapPath,ei as catalogDefaultProviderAppConfigPath,lt as catalogIntegrationPath,Qo as catalogIntegrationsPath,Zo as catalogVersionsPath,yi as connectCompletePath,_i as connectOptionsPath,Ri as connectStartPath,Ii as connectSubmitPath,Ti as connectionDisconnectPath,r as contractParseFail,a as contractParseOk,Do as currentUserPath,Go as defaultWorkspacePath,Ao as deploymentHandshakeProbePayload,ko as deploymentHandshakeResponseProofPayload,ir as egressGrantAuditPath,or as egressGrantConsumePath,Vt as eventWaitPath,vt as executionContextPath,ts as findFlowAuthoringToolDescriptor,Ci as flowDisablePath,bi as flowDraftPath,Di as flowEnablePath,B as flowPath,er as flowRunEgressGrantPath,Wt as flowRunResultPath,Ar as flowRunRuntimeCredentialPath,Pa as flowRunsPath,kn as flowScriptProtocolAdapterModuleName,Ni as flowValidatePath,Fi as flowVersionPath,dt as flowVersionsPath,es as formatFlowToolError,Ga as globalInboxEntriesPath,Ha as globalInboxEntryHumanInputSubmitPath,Tt as globalInboxEntryPath,nn as handlerBundlesPath,io as humanInputAcknowledgePath,oo as humanInputExpirePath,ie as humanInputRequestPath,so as humanInputResolvedEventType,xt as humanInputTokenPath,Va as humanInputTokenSubmitPath,Ye as humanInputsPath,Ba as inboxEntryHumanInputSubmitPath,yt as inboxEntryPath,La as inboxItemPath,ii as installationToolsPath,jr as internalFileAccessPath,qr as internalFileCompletePath,Xr as internalFileContentPath,Jr as internalFileStatPath,Vr as internalFileUploadSessionPath,Wr as internalFilesPath,i as isJsonRecord,O as isValidRequestDigest,zt as parseCompleteFlowRunWaitBody,Ot as parseContextStateCleanupRequestBody,Nt as parseContextStateCleanupResponseData,_ as parseContextStateScope,ao as parseCreateHumanInputBody,cr as parseEgressGrantAuditBody,ur as parseEgressGrantConsumeBody,gr as parseEgressGrantConsumeData,dr as parseEgressGrantData,Ut as parseExecutionContextData,j as parseFileAccessData,je as parseFileMetadataData,L as parseFileRefData,_e as parseFileRuntimeLimits,qe as parseFileUploadSessionData,sr as parseFlowActionGrantBody,Jt as parseFlowRunResultBody,Xt as parseFlowRunResultData,Or as parseFlowRuntimeCredentialBody,Ae as parseHandlerBundle,on as parseHandlerBundlesData,lo as parseHumanInputAcknowledgeData,po as parseHumanInputCreateData,ot as parseHumanInputRequestViewData,Yr as parseInternalFileAccessData,Mn as parsePollingPublishBody,Dr as parsePollingRuntimeCredentialBody,Hn as parsePollingTriggerContext,pr as parsePollingTriggerGrantBody,$n as parsePublishPollingTickEventsData,Yt as parseRegisterFlowRunWaitBody,Qt as parseRegisterFlowRunWaitData,br as parseRuntimeCredentialSessionCredential,C as parseRuntimeNetwork,ar as parseSingleToolGrantBody,Nr as parseSingleToolRuntimeCredentialBody,qt as parseStepRecordBody,jt as parseStepRecordData,sn as parseToolHandlerBundlesData,Pn as parseTriggerHandlerBundlesData,hn as parseWebhookDelivery,On as parseWebhookPublishEventsBody,Nn as parseWebhookRearmBody,Cr as parseWebhookRuntimeCredentialBody,lr as parseWebhookTriggerGrantBody,Sn as parseWebhookWatcherContext,Ln as pollingTriggerContextPath,nr as pollingTriggerEgressGrantPath,Bn as pollingTriggerHandlerBundlesPath,Sr as pollingTriggerRuntimeCredentialPath,Gn as pollingTriggerTickEventsPath,Be as requestHasMultipartFileParts,Sa as runCancelPath,ha as runEventsPath,ue as runPath,Kt as stepResultPath,rn as toolHandlerBundlesPath,tr as toolInvocationEgressGrantPath,kr as toolInvocationRuntimeCredentialPath,Xa as triggerInstancesPath,Ya as triggerSimulatePath,wn as webhookProtocolAdapterBundlePath,_n as webhookTriggerContextPath,yn as webhookTriggerDeliveryPath,rr as webhookTriggerEgressGrantPath,Tn as webhookTriggerEventsPath,In as webhookTriggerHandlerBundlesPath,xn as webhookTriggerRearmPath,hr as webhookTriggerRuntimeCredentialPath,fo as wfpUserRuntimeManifestPath,mi as workspaceConnectionsPath,Ve as workspaceFileAccessPath,Ke as workspaceFileCompletePath,We as workspaceFileMetadataPath,$e as workspaceFileUploadSessionPath,le as workspaceFlowsPath,It as workspaceInboxEntriesPath,_t as workspaceInboxItemsPath,ct as workspaceIntegrationPath,ut as workspaceIntegrationsPath,Lo as workspacePath,Rt as workspaceRunsPath,Bo as workspacesPath};
1
+ var ge="0.2.6";var wt="flow.ir.v1";var fe="flow.interp.v2";function a(e){return{ok:!0,value:e}}function r(e){return{ok:!1,reason:e}}function i(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Pt="/cleanup-state-scopes";function _(e){if(!i(e)||typeof e.kind!="string")return r("context state scope surface shape is invalid");switch(e.kind){case"webhook-trigger":return me(e);case"polling-trigger":return Re(e);case"flow-action":return _e(e);default:return r("context state scope kind is invalid")}}function Ot(e){if(!i(e))return r("cleanup request body must be a JSON object");let t=D(e,["scopes"]);if(t!==void 0)return r(`cleanup request does not accept the "${t}" field`);if(!Array.isArray(e.scopes))return r("cleanup request scopes must be an array");let n=[];for(let o of e.scopes){let s=_(o);if(!s.ok)return s;n.push(s.value)}return a({scopes:n})}function Nt(e){return!i(e)||typeof e.deleted!="number"||!Number.isSafeInteger(e.deleted)||e.deleted<0?r("cleanup response data surface shape is invalid"):a({deleted:e.deleted})}function me(e){let t=D(e,["kind","workspaceId","triggerInstanceId"]);return t!==void 0?r(`webhook trigger scope does not accept "${t}"`):e.kind!=="webhook-trigger"||!m(e.workspaceId)||!m(e.triggerInstanceId)?r("webhook trigger state scope is invalid"):a({kind:"webhook-trigger",workspaceId:e.workspaceId,triggerInstanceId:e.triggerInstanceId})}function Re(e){let t=D(e,["kind","workspaceId","pollingInstanceId"]);return t!==void 0?r(`polling trigger scope does not accept "${t}"`):e.kind!=="polling-trigger"||!m(e.workspaceId)||!m(e.pollingInstanceId)?r("polling trigger state scope is invalid"):a({kind:"polling-trigger",workspaceId:e.workspaceId,pollingInstanceId:e.pollingInstanceId})}function _e(e){let t=D(e,["kind","workspaceId","flowId","nodeId","connectionId"]);if(t!==void 0)return r(`flow action scope does not accept "${t}"`);let n=e.connectionId;return e.kind!=="flow-action"||!m(e.workspaceId)||!m(e.flowId)||!m(e.nodeId)||n!==null&&!m(n)?r("flow action state scope is invalid"):a({kind:"flow-action",workspaceId:e.workspaceId,flowId:e.flowId,nodeId:e.nodeId,connectionId:n})}function m(e){return typeof e=="string"&&e.length>0}function D(e,t){return Object.keys(e).find(n=>!t.includes(n))}var f="/internal/flow-runs",Ft="/:flowRunId/execution-context";function vt(e){return`${f}/${encodeURIComponent(e)}/execution-context`}function Ie(e){return!i(e)||!M(e.fileMaxBytes)||!M(e.fileReadMaxBytes)||!M(e.inlineMultipartBytesMax)?r("file runtime limits must carry three positive integer bounds"):a({fileMaxBytes:e.fileMaxBytes,fileReadMaxBytes:e.fileReadMaxBytes,inlineMultipartBytesMax:e.inlineMultipartBytesMax})}function Ut(e){if(!i(e))return r("execution context must be a JSON object");let t=e.compiled;if(typeof e.flowRunId!="string"||typeof e.workspaceId!="string"||!i(e.input)||!i(t)||typeof t.irSchemaVersion!="string"||typeof t.interpreterContractVersion!="string"||typeof t.compiledArtifactId!="string"||!i(t.ir)||!Array.isArray(t.ir.nodes)||!Te(e.executionBindings))return r("execution context surface shape is invalid");let n=ye(e.fileRuntime);return n.ok?a({...e,fileRuntime:n.value}):r(n.reason)}function ye(e){if(e===null)return a(null);if(!i(e))return r("fileRuntime must be null or an object");let t=Ie(e.limits);return t.ok?a({limits:t.value}):r(t.reason)}function Te(e){return Array.isArray(e)?e.every(t=>{if(!i(t))return!1;let n=t.connection,o=_(t.stateScope);return typeof t.nodeId=="string"&&typeof t.toolRef=="string"&&i(t.toolDescriptor)&&i(t.integrationDescriptor)&&i(n)&&typeof n.installationId=="string"&&typeof n.connectionRef=="string"&&typeof n.connectionId=="string"&&typeof n.authType=="string"&&o.ok}):!1}function M(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var Ht="/:flowRunId/steps/:nodeId/result",Mt="/:flowRunId/result",$t="/:flowRunId/event-waits/:nodeId";function Kt(e,t){return`${f}/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}/result`}function Wt(e){return`${f}/${encodeURIComponent(e)}/result`}function Vt(e,t){return`${f}/${encodeURIComponent(e)}/event-waits/${encodeURIComponent(t)}`}function qt(e){if(!i(e))return{ok:!1,kind:"validation",reason:"step record body must be a JSON object"};let t=I(e,["attempt","result","durationMs"]);if(t!==void 0)return{ok:!1,kind:"validation",reason:`step record does not accept the "${t}" field`};let n=e.attempt;if(typeof n!="number"||!Number.isInteger(n)||n<=0)return{ok:!1,kind:"validation",reason:"attempt must be a positive integer"};let o=xe(e.result);if(!o.ok)return o;let s={attempt:n,result:o.value};if(e.durationMs!==void 0){let p=e.durationMs;if(typeof p!="number"||!Number.isFinite(p)||p<0)return{ok:!1,kind:"validation",reason:"durationMs must be a non-negative number"};s.durationMs=p}return{ok:!0,value:s}}function xe(e){if(!i(e))return{ok:!1,kind:"step_result_invalid",reason:"result must be a JSON object"};let t=e.status;if(t==="succeeded"){let n=I(e,["status","output"]);return n!==void 0?{ok:!1,kind:"validation",reason:`step record result does not accept the "${n}" field`}:"output"in e?{ok:!0,value:{status:"succeeded",output:e.output}}:{ok:!1,kind:"step_result_invalid",reason:"a succeeded result must carry output"}}if(t==="failed"){let n=I(e,["status","errorCode","issues"]);if(n!==void 0)return{ok:!1,kind:"validation",reason:`step record result does not accept the "${n}" field`};let o=e.errorCode;if(typeof o!="string"||o.length===0)return{ok:!1,kind:"step_result_invalid",reason:"a failed result must carry a non-empty errorCode"};let s={status:"failed",errorCode:o};return e.issues!==void 0&&(s.issues=e.issues),{ok:!0,value:s}}return{ok:!1,kind:"step_result_invalid",reason:'result status must be "succeeded" or "failed"'}}function jt(e){return!i(e)||typeof e.flowRunId!="string"||typeof e.nodeId!="string"||e.recorded!=="succeeded"&&e.recorded!=="failed"?r("step record data surface shape is invalid"):a({flowRunId:e.flowRunId,nodeId:e.nodeId,recorded:e.recorded})}function Jt(e){if(!i(e))return r("result body must be a JSON object");let t=I(e,["status","output","error","composition"]);if(t!==void 0)return r(`result does not accept the "${t}" field`);let n=e.status;if(n!=="succeeded"&&n!=="failed")return r('result status must be "succeeded" or "failed"');let o={status:n};if(e.output!==void 0&&(o.output=e.output),e.error!==void 0){let s=e.error;if(!i(s))return r("result error must be a JSON object");let p=I(s,["code","message"]);if(p!==void 0)return r(`result error does not accept the "${p}" field`);if(typeof s.code!="string"||typeof s.message!="string")return r("result error must carry string code and message");o.error={code:s.code,message:s.message}}if(e.composition!==void 0){if(n!=="succeeded")return r("composition is only allowed on a succeeded result");o.composition=e.composition}return a(o)}function Xt(e){return i(e)?a(e):r("flow run result data must be a JSON object")}var Ee=/^[A-Za-z0-9_-]{1,100}$/;function Yt(e){if(!i(e))return r("register body must be a JSON object");let t=I(e,["eventType","correlationKey"]);if(t!==void 0)return r(`register wait does not accept the "${t}" field`);let n=z(e.eventType);if(!n.ok)return r(n.reason);let o=e.correlationKey;return typeof o!="string"||o.length===0?r("correlationKey must be a non-empty string"):a({eventType:n.value,correlationKey:o})}function zt(e){if(!i(e))return r("complete body must be a JSON object");let t=I(e,["eventType","correlationKey","outcome","eventId"]);if(t!==void 0)return r(`complete wait does not accept the "${t}" field`);let n=e.outcome;if(n!=="received"&&n!=="timed_out")return r('outcome must be "received" or "timed_out"');let o=z(e.eventType);if(!o.ok)return r(o.reason);let s=e.correlationKey;if(typeof s!="string"||s.length===0)return r("correlationKey must be a non-empty string");let p={eventType:o.value,correlationKey:s,outcome:n};if(e.eventId!==void 0){if(typeof e.eventId!="string"||e.eventId.length===0)return r("eventId must be a non-empty string");p.eventId=e.eventId}return a(p)}function Qt(e){return!i(e)||e.registered!==!0?r("register wait data surface shape is invalid"):a({registered:!0})}function z(e){return typeof e!="string"||e.length===0?r("eventType must be a non-empty string"):Ee.test(e)?a(e):r("eventType must match ^[A-Za-z0-9_-]{1,100}$")}function I(e,t){return Object.keys(e).find(n=>!t.includes(n))}var we="/internal/flow-versions",en="/:flowVersionId/handler-bundles",K="/internal/installations",tn="/:installationId/handler-bundles";function nn(e,t){return`${we}/${encodeURIComponent(e)}/handler-bundles?compiledArtifactId=${encodeURIComponent(t)}`}function rn(e){return`${K}/${encodeURIComponent(e.installationId)}/handler-bundles?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var Ae=new Set(["managed_only","managed_plus_unmanaged_sdk"]);function C(e){if(!y(e))return $("runtimeNetwork must be a JSON object");let t=e.networkModel;return typeof t!="string"||!Ae.has(t)?$("runtimeNetwork.networkModel is unknown"):!Q(e.apiHosts)||!Q(e.authHosts)||typeof e.httpsOnly!="boolean"?$("runtimeNetwork host/https fields are invalid"):{ok:!0,value:{networkModel:t,apiHosts:e.apiHosts,authHosts:e.authHosts,httpsOnly:e.httpsOnly}}}function on(e){if(!y(e)||typeof e.flowVersionId!="string"||typeof e.compiledArtifactId!="string"||!Array.isArray(e.bundles))return k("handler bundles data surface shape is invalid");let t=Z(e.bundles);return t.ok?{ok:!0,value:{flowVersionId:e.flowVersionId,compiledArtifactId:e.compiledArtifactId,bundles:t.value}}:t}function sn(e){if(!y(e)||typeof e.installationId!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.bundles))return k("tool handler bundles data surface shape is invalid");let t=Z(e.bundles);return t.ok?{ok:!0,value:{installationId:e.installationId,artifactDigest:e.artifactDigest,bundles:t.value}}:t}function Z(e){let t=[];for(let n of e){let o=ke(n);if(!o.ok)return o;t.push(o.value)}return{ok:!0,value:t}}function ke(e){if(!y(e)||typeof e.toolRef!="string"||e.kind!=="handler"&&e.kind!=="request")return k("handler bundle entry shape is invalid");if(e.kind==="request"){if(e.module!==void 0)return k("a request bundle must not carry a module");let o=C(e.runtimeNetwork);return o.ok?{ok:!0,value:{toolRef:e.toolRef,kind:"request",runtimeNetwork:o.value}}:o}let t=e.module;if(!y(t)||typeof t.entry!="string"||t.entry.length===0||!Se(t.files))return k("a handler bundle must carry a { entry, files } module");let n=C(e.runtimeNetwork);return n.ok?{ok:!0,value:{toolRef:e.toolRef,kind:"handler",module:{entry:t.entry,files:t.files},runtimeNetwork:n.value}}:n}function k(e){return{ok:!1,kind:"shape",reason:e}}function $(e){return{ok:!1,kind:"runtime_network",reason:e}}function y(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Q(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Se(e){return y(e)&&Object.values(e).every(t=>typeof t=="string")}var S="/internal/webhook-trigger-instances",dn="/:triggerInstanceId/context",gn="/:triggerInstanceId/handler-bundles",fn="/:triggerInstanceId/deliveries/:deliveryId",mn="/:triggerInstanceId/events",Rn="/:triggerInstanceId/rearm",h=e=>`${S}/${encodeURIComponent(e)}`;function _n(e,t){return`${h(e)}/context?artifactDigest=${encodeURIComponent(t)}`}function In(e,t){return`${h(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function yn(e,t){return`${h(e)}/deliveries/${encodeURIComponent(t)}`}function Tn(e){return`${h(e)}/events`}function xn(e){return`${h(e)}/rearm`}var En="/:installationId/webhook-protocol-adapter-bundle";function wn(e){return`${K}/${encodeURIComponent(e.installationId)}/webhook-protocol-adapter-bundle?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var An="modules/webhook/protocol-adapter.js";function kn(e){return`modules/webhook/protocol-adapter-${e}.js`}function Sn(e){let t=i(e)?_(e.stateScope):r("webhook watcher context state scope is invalid");return!i(e)||typeof e.artifactDigest!="string"||typeof e.triggerRef!="string"||typeof e.triggerName!="string"||typeof e.integrationRef!="string"||!i(e.inputs)||e.connection!==null&&!he(e.connection)||!Pe(e.runtime)||!t.ok||t.value.kind!=="webhook-trigger"?r("webhook watcher context surface shape is invalid"):a(e)}function he(e){return i(e)&&typeof e.connectionId=="string"&&typeof e.connectionRef=="string"&&typeof e.integrationRef=="string"&&typeof e.authType=="string"}function Pe(e){if(!i(e)||e.type!=="webhook"||typeof e.trigger_ref!="string")return!1;let t=e.webhook;return i(t)&&typeof t.event_handler_module=="string"&&typeof t.enable_handler_module=="string"&&typeof t.disable_handler_module=="string"}function hn(e){if(!i(e)||typeof e.deliveryId!="string"||typeof e.receivedAt!="string"||!i(e.request))return r("webhook delivery surface shape is invalid");let t=e.request;return t.method!=="POST"||!i(t.headers)||typeof t.rawBody!="string"?r("webhook delivery request shape is invalid"):a(e)}function Pn(e){if(!i(e)||typeof e.triggerRef!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.modules)||!e.modules.every(Oe))return{ok:!1,kind:"shape",reason:"trigger handler bundles data surface shape is invalid"};let t=C(e.runtimeNetwork);return t.ok?{ok:!0,value:{triggerRef:e.triggerRef,artifactDigest:e.artifactDigest,modules:e.modules,runtimeNetwork:t.value}}:t}function Oe(e){return i(e)&&typeof e.specifier=="string"&&e.specifier.length>0&&typeof e.source=="string"}function On(e){if(!i(e))return r("publish events body must be a JSON object");let t=W(e,["deliveryId","events"]);if(t!==void 0)return r(`publish events does not accept the "${t}" field`);let n=e.deliveryId;if(typeof n!="string"||n.length===0)return r("deliveryId must be a non-empty string");let o=e.events;if(!Array.isArray(o))return r("events must be an array");let s=[];for(let p of o){let l=Ne(p);if(!l.ok)return l;s.push(l.value)}return a({deliveryId:n,events:s})}function Ne(e){if(!i(e))return r("each event must be a JSON object");let t=W(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return r(`event does not accept the "${t}" field`);let n=e.eventId;if(typeof n!="string"||n.length===0)return r("eventId must be a non-empty string");let o=e.occurredAt;if(typeof o!="string"||o.length===0)return r("occurredAt must be a non-empty string");if(!i(e.payload))return r("event payload must be a JSON object");let s={eventId:n,occurredAt:o,payload:e.payload};if(e.dedupeKey!==void 0){if(typeof e.dedupeKey!="string"||e.dedupeKey.length===0)return r("dedupeKey must be a non-empty string");s.dedupeKey=e.dedupeKey}return a(s)}function Nn(e){if(!i(e))return r("rearm body must be a JSON object");let t=W(e,["expectedWatcherInstanceId"]);if(t!==void 0)return r(`rearm does not accept the "${t}" field`);let n=e.expectedWatcherInstanceId;return typeof n!="string"||n.length===0?r("expectedWatcherInstanceId must be a non-empty string"):a({expectedWatcherInstanceId:n})}function W(e,t){return Object.keys(e).find(n=>!t.includes(n))}var P="/internal/polling-trigger-instances",Fn="/:pollingInstanceId/context",vn="/:pollingInstanceId/handler-bundles",Un="/:pollingInstanceId/ticks/:tickId/events",V=e=>`${P}/${encodeURIComponent(e)}`;function Ln(e,t,n){return`${V(e)}/context?artifactDigest=${encodeURIComponent(t)}&tickId=${encodeURIComponent(n)}`}function Bn(e,t){return`${V(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function Gn(e,t){return`${V(e)}/ticks/${encodeURIComponent(t)}/events`}function Hn(e){let t=i(e)?_(e.stateScope):r("polling trigger context state scope is invalid");return!i(e)||typeof e.artifactDigest!="string"||typeof e.triggerRef!="string"||typeof e.triggerName!="string"||typeof e.integrationRef!="string"||!i(e.inputs)||e.connection!==null&&!De(e.connection)||!Ce(e.runtime)||!t.ok||t.value.kind!=="polling-trigger"||!be(e.tick)||!Fe(e.limits)?r("polling trigger context surface shape is invalid"):a(e)}function De(e){return i(e)&&typeof e.connectionId=="string"&&typeof e.connectionRef=="string"&&typeof e.integrationRef=="string"&&typeof e.authType=="string"}function Ce(e){if(!i(e)||e.type!=="polling"||typeof e.trigger_id!="string"||typeof e.trigger_ref!="string")return!1;let t=e.polling;if(!i(t)||typeof t.run_handler_module!="string")return!1;let n=t.schedule;if(!i(n)||n.type!=="interval"||typeof n.every_seconds!="number")return!1;let o=t.dedup;return i(o)&&(o.strategy==="cursor"||o.strategy==="hash"||o.strategy==="id_field")}function be(e){return i(e)&&typeof e.tickId=="string"&&typeof e.scheduledAt=="string"&&typeof e.attempt=="number"}function Fe(e){return i(e)&&typeof e.maxEventsPerTick=="number"}function Mn(e){if(!i(e))return r("publish body must be a JSON object");let t=ee(e,["events","nextCursor"]);if(t!==void 0)return r(`publish does not accept the "${t}" field`);let n=e.events;if(!Array.isArray(n))return r("events must be an array");let o=[];for(let p of n){let l=ve(p);if(!l.ok)return l;o.push(l.value)}let s={events:o};if("nextCursor"in e){let p=e.nextCursor;if(p!==null&&typeof p!="string")return r("nextCursor must be a string, null, or omitted");s.nextCursor=p}return a(s)}function ve(e){if(!i(e))return r("each event must be a JSON object");let t=ee(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return r(`event does not accept the "${t}" field`);if(typeof e.eventId!="string"||e.eventId.length===0)return r("event eventId must be a non-empty string");if(!i(e.payload))return r("event payload must be a JSON object");let n={eventId:e.eventId,payload:e.payload};if(e.occurredAt!==void 0){if(typeof e.occurredAt!="string"||e.occurredAt.length===0)return r("event occurredAt must be a non-empty string");n.occurredAt=e.occurredAt}if(e.dedupeKey!==void 0){if(typeof e.dedupeKey!="string"||e.dedupeKey.length===0)return r("event dedupeKey must be a non-empty string");n.dedupeKey=e.dedupeKey}return a(n)}function $n(e){return!i(e)||typeof e.tickId!="string"||typeof e.cursorUpdated!="boolean"||!Array.isArray(e.results)||!e.results.every(Ue)?r("publish polling tick events data surface shape is invalid"):a(e)}function Ue(e){return i(e)&&typeof e.eventId=="string"&&typeof e.dedupeKey=="string"&&typeof e.duplicate=="boolean"&&(e.flowRunId===null||typeof e.flowRunId=="string")}function ee(e,t){return Object.keys(e).find(n=>!t.includes(n))}var te="/internal/egress-grants",q="/internal/tool-invocations",Jn="/:flowRunId/egress-grant",Xn="/:invocationId/egress-grant",Yn="/:pollingInstanceId/egress-grant",zn="/:triggerInstanceId/egress-grant",Qn="/:grantId/consume",Zn="/:grantId/audit",er=e=>`${f}/${encodeURIComponent(e)}/egress-grant`,tr=e=>`${q}/${encodeURIComponent(e)}/egress-grant`,nr=e=>`${P}/${encodeURIComponent(e)}/egress-grant`,rr=e=>`${S}/${encodeURIComponent(e)}/egress-grant`,or=e=>`${te}/${encodeURIComponent(e)}/consume`,ir=e=>`${te}/${encodeURIComponent(e)}/audit`,Le=["flow_action","single_tool","polling_trigger","webhook_trigger"],Be=/^[A-Za-z0-9][A-Za-z0-9:_+/=.-]{15,1023}$/;function O(e){return typeof e=="string"&&Be.test(e)}function Ge(e){if(!i(e)||e.body_type!=="multipart")return!1;let t=e.body;if(!i(t))return!1;let n=t.parts;return Array.isArray(n)?n.some(o=>i(o)?o.kind==="file"&&typeof o.file_id=="string"&&o.file_id.length>0:!1):!1}function u(e){return{ok:!1,kind:"shape",reason:e}}function N(){return{ok:!1,kind:"request_digest",reason:"request digest is missing or malformed"}}function F(e,t){if(!i(e))return{ok:!1,reason:"grant request body must be a JSON object"};for(let n of Object.keys(e))if(!t.includes(n))return{ok:!1,reason:`grant request does not accept the "${n}" field`};return{ok:!0,record:e}}function v(e){if(!i(e))return"request must be a JSON object"}function sr(e){let t=F(e,["nodeId","request","requestDigest"]);if(!t.ok)return u(t.reason);let n=t.record.nodeId;if(typeof n!="string"||n.length===0)return u("nodeId is required");let o=v(t.record.request);if(o!==void 0)return u(o);let s=t.record.requestDigest;return O(s)?{ok:!0,value:{nodeId:n,requestDigest:s,requestHasMultipartFiles:Ge(t.record.request)}}:N()}function ar(e){let t=F(e,["request","requestDigest"]);if(!t.ok)return u(t.reason);let n=v(t.record.request);if(n!==void 0)return u(n);let o=t.record.requestDigest;return O(o)?{ok:!0,value:{requestDigest:o}}:N()}function pr(e){let t=F(e,["tickId","request","requestDigest"]);if(!t.ok)return u(t.reason);let n=t.record.tickId;if(typeof n!="string"||n.length===0)return u("tickId is required");let o=v(t.record.request);if(o!==void 0)return u(o);let s=t.record.requestDigest;return O(s)?{ok:!0,value:{tickId:n,requestDigest:s}}:N()}function lr(e){let t=F(e,["phase","lifecycle","request","requestDigest"]);if(!t.ok)return u(t.reason);let n=t.record.phase;if(n!=="lifecycle"&&n!=="handler")return u('phase must be "lifecycle" or "handler"');let o=t.record.lifecycle,s;if(o!==void 0){if(o!=="enable"&&o!=="disable"&&o!=="renew")return u('lifecycle must be "enable", "disable", or "renew"');s=o}if(n==="lifecycle"&&s===void 0)return u("lifecycle is required for the lifecycle phase");let p=v(t.record.request);if(p!==void 0)return u(p);let l=t.record.requestDigest;return O(l)?{ok:!0,value:{phase:n,...s!==void 0?{lifecycle:s}:{},requestDigest:l}}:N()}function ne(e){return Le.includes(e)?e:void 0}var He=["scopeKind","scopeId","requestDigest"];function ur(e){if(!i(e))return u("consume body must be a JSON object");for(let s of Object.keys(e))if(!He.includes(s))return u(`consume does not accept the "${s}" field`);let t=ne(e.scopeKind);if(t===void 0)return u("scopeKind is invalid");let n=e.scopeId;if(typeof n!="string"||n.length===0)return u("scopeId is required");let o=e.requestDigest;return O(o)?{ok:!0,value:{scopeKind:t,scopeId:n,requestDigest:o}}:N()}var Me=["scopeKind","scopeId","providerHost","status","durationMs","requestBytes","responseBytes","errorCode"];function b(e,t){return typeof e!="number"||!Number.isInteger(e)||e<0?{ok:!1,reason:`${t} must be a non-negative integer`}:{ok:!0,value:e}}function cr(e){if(!i(e))return u("audit body must be a JSON object");for(let d of Object.keys(e))if(!Me.includes(d))return u(`audit does not accept the "${d}" field`);let t=ne(e.scopeKind);if(t===void 0)return u("scopeKind is invalid");let n=e.scopeId;if(typeof n!="string"||n.length===0)return u("scopeId is required");let o=e.providerHost;if(typeof o!="string"||o.length===0)return u("providerHost is required");let s=b(e.durationMs,"durationMs");if(!s.ok)return u(s.reason);let p;if(e.status!==void 0){let d=b(e.status,"status");if(!d.ok)return u(d.reason);p=d.value}let l;if(e.requestBytes!==void 0){let d=b(e.requestBytes,"requestBytes");if(!d.ok)return u(d.reason);l=d.value}let c;if(e.responseBytes!==void 0){let d=b(e.responseBytes,"responseBytes");if(!d.ok)return u(d.reason);c=d.value}let H;if(e.errorCode!==void 0){let d=e.errorCode;if(typeof d!="string"||d.length===0)return u("errorCode must be a non-empty string");H=d}return{ok:!0,value:{scopeKind:t,scopeId:n,providerHost:o,...p!==void 0?{status:p}:{},durationMs:s.value,...l!==void 0?{requestBytes:l}:{},...c!==void 0?{responseBytes:c}:{},...H!==void 0?{errorCode:H}:{}}}}function dr(e){return!i(e)||!i(e.grant)?r("egress grant envelope must carry a grant object"):a(e.grant)}function gr(e){return!i(e)||e.consumed!==!0?r("egress grant consume data must carry consumed:true"):a({consumed:!0})}var Tr="/:flowRunId/runtime-credential",xr="/:invocationId/runtime-credential",Er="/:pollingInstanceId/runtime-credential",wr="/:triggerInstanceId/runtime-credential",Ar=e=>`${f}/${encodeURIComponent(e)}/runtime-credential`,kr=e=>`${q}/${encodeURIComponent(e)}/runtime-credential`,Sr=e=>`${P}/${encodeURIComponent(e)}/runtime-credential`,hr=e=>`${S}/${encodeURIComponent(e)}/runtime-credential`,Pr=["flow_action","tool_invoke","polling_trigger","webhook_trigger"];function U(e,t){if(!i(e))return{ok:!1,reason:"runtime credential request body must be a JSON object"};for(let n of Object.keys(e))if(!t.includes(n))return{ok:!1,reason:`runtime credential request does not accept the "${n}" field`};return{ok:!0,record:e}}function Or(e){let t=U(e,["nodeId"]);if(!t.ok)return r(t.reason);let n=t.record.nodeId;return typeof n!="string"||n.length===0?r("nodeId is required"):a({nodeId:n})}function Nr(e){let t=U(e??{},[]);return t.ok?a(null):r(t.reason)}function Dr(e){let t=U(e,["tickId"]);if(!t.ok)return r(t.reason);let n=t.record.tickId;return typeof n!="string"||n.length===0?r("tickId is required"):a({tickId:n})}function Cr(e){let t=U(e,["executionKind","deliveryId","lifecycleOperation"]);if(!t.ok)return r(t.reason);let n=t.record.executionKind;if(n!=="event_handler"&&n!=="lifecycle")return r('executionKind must be "event_handler" or "lifecycle"');let o,s=t.record.deliveryId;if(s!==void 0){if(typeof s!="string"||s.length===0)return r("deliveryId must be a non-empty string");o=s}let p,l=t.record.lifecycleOperation;if(l!==void 0){if(l!=="enable"&&l!=="disable"&&l!=="renew")return r('lifecycleOperation must be "enable", "disable", or "renew"');p=l}return n==="lifecycle"&&p===void 0?r("lifecycleOperation is required for the lifecycle execution kind"):a({executionKind:n,...o!==void 0?{deliveryId:o}:{},...p!==void 0?{lifecycleOperation:p}:{}})}function br(e){return!i(e)||typeof e.sessionId!="string"||typeof e.connectionId!="string"||!i(e.credential)?r("runtime credential session must carry sessionId, connectionId and a credential object"):a(e.credential)}var $e="/workspaces/:workspaceId/files",Ke=e=>`/workspaces/${encodeURIComponent(e)}/files/upload-session`,We=(e,t)=>`/workspaces/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}/complete`,Ve=(e,t)=>`/workspaces/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}`,qe=(e,t,n)=>`/workspaces/${encodeURIComponent(e)}/files/${encodeURIComponent(t)}/access?intent=${encodeURIComponent(n)}`;function L(e){return!i(e)||typeof e.file_id!="string"||typeof e.name!="string"||typeof e.size_bytes!="number"||typeof e.created_at!="string"||typeof e.expires_at!="string"||e.mime_type!==void 0&&typeof e.mime_type!="string"||e.sha256!==void 0&&typeof e.sha256!="string"||e.source!==void 0&&typeof e.source!="string"?r("file ref data does not match the AIS file-ref shape"):a(e)}function re(e){return!i(e)||e.method!=="GET"&&e.method!=="PUT"||typeof e.url!="string"||typeof e.expires_at!="string"||!Xe(e.headers)?r("presigned file URL data is invalid"):a(e)}function je(e){if(!i(e))return r("file upload session data is invalid");let t=L(e.file);if(!t.ok)return r(t.reason);let n=re(e.upload);return n.ok?a({file:t.value,upload:n.value}):r(n.reason)}function oe(e){if(!i(e))return r("file metadata data is invalid");let t=L(e.file);return t.ok?a({file:t.value}):r(t.reason)}function j(e){if(!i(e)||!Je(e.intent))return r("file access data is invalid");let t=L(e.file);if(!t.ok)return r(t.reason);let n=re(e.access);return n.ok?a({file:t.value,access:n.value,intent:e.intent}):r(n.reason)}function Je(e){return e==="preview"||e==="download"||e==="text"}function Xe(e){return i(e)?Object.values(e).every(t=>typeof t=="string"):!1}var T="/internal/files",Gr="/upload-session",Hr="/:fileId/complete",Mr="/:fileId/access",$r="/:fileId/stat",Kr="/:fileId/content",Wr=()=>T,Vr=()=>`${T}/upload-session`,qr=e=>`${T}/${encodeURIComponent(e)}/complete`,jr=(e,t)=>`${T}/${encodeURIComponent(e)}/access?intent=${encodeURIComponent(t)}`,ie=e=>`?scope_kind=${encodeURIComponent(e.scopeKind)}&scope_id=${encodeURIComponent(e.scopeId)}`,Jr=(e,t)=>`${T}/${encodeURIComponent(e)}/stat${ie(t)}`,Xr=(e,t)=>`${T}/${encodeURIComponent(e)}/content${ie(t)}`;function Yr(e){if(!i(e))return r("internal file access data is invalid");if(e.intent==="runtime_read"||e.intent==="provider_multipart"){let t=j({...e,intent:"preview"});return t.ok?a({file:t.value.file,access:t.value.access,intent:e.intent}):r(t.reason)}return r("internal file access intent is invalid")}var eo="/:flowRunId/human-inputs",to="/:flowRunId/human-inputs/:requestId",no="/:flowRunId/human-inputs/:requestId/expire",ro="/:flowRunId/human-inputs/:requestId/acknowledge",Ye=e=>`${f}/${encodeURIComponent(e)}/human-inputs`,se=(e,t)=>`${Ye(e)}/${encodeURIComponent(t)}`,oo=(e,t)=>`${se(e,t)}/expire`,io=(e,t)=>`${se(e,t)}/acknowledge`,ze="human_input_resolved";function so(e){return`${ze}_${e}`}function g(e){return{ok:!1,reason:e}}function R(e,t){return i(e)?{ok:!0,value:e}:g(`${t} must be an object`)}function x(e,t){return typeof e!="string"||e.length===0?g(`${t} must be a non-empty string`):{ok:!0,value:e}}var Qe=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})$/;function Ze(e,t){return typeof e!="string"||!Qe.test(e)||Number.isNaN(Date.parse(e))?g(`${t} must be an ISO-8601 timestamp`):{ok:!0,value:e}}function et(e){let t=R(e,"renderedPrompt");if(!t.ok)return t;let n=x(t.value.title,"renderedPrompt.title");if(!n.ok)return n;let o={title:n.value};if(t.value.body!==void 0){if(typeof t.value.body!="string")return g("renderedPrompt.body must be a string");o.body=t.value.body}if(t.value.format!==void 0){if(t.value.format!=="plain"&&t.value.format!=="markdown")return g("renderedPrompt.format is invalid");o.format=t.value.format}return{ok:!0,value:o}}function tt(e){let t=R(e,"input");if(!t.ok)return t;let n=t.value.kind;if(n==="choice"){if(!Array.isArray(t.value.choices))return g("input.choices must be an array")}else if(n!=="text")if(n==="form"){if(!Array.isArray(t.value.fields))return g("input.fields must be an array")}else return g("input.kind is invalid");return{ok:!0,value:t.value}}function nt(e){if(e==null)return{ok:!0,value:void 0};let t=R(e,"partiallyRenderedDelivery");if(!t.ok)return t;let n=t.value.actions;if(n===void 0)return{ok:!0,value:{}};if(!Array.isArray(n))return g("partiallyRenderedDelivery.actions must be an array");let o=[];for(let s of n){let p=R(s,"delivery action");if(!p.ok)return p;let l=x(p.value.id,"delivery action id");if(!l.ok)return l;let c=ae(p.value.inputs,`delivery action '${l.value}' inputs`);if(!c.ok)return c;o.push({id:l.value,inputs:c.value})}return{ok:!0,value:{actions:o}}}function ae(e,t){let n=R(e,t);if(!n.ok)return n;let o={};for(let[s,p]of Object.entries(n.value)){let l=pe(p,`${t}.${s}`);if(!l.ok)return l;o[s]=l.value}return{ok:!0,value:o}}function pe(e,t){let n=R(e,t);if(!n.ok)return n;switch(n.value.kind){case"literal":return{ok:!0,value:{kind:"literal",value:n.value.value}};case"human_input_ref":{let s=x(n.value.path,`${t}.path`);return s.ok?{ok:!0,value:{kind:"human_input_ref",path:s.value}}:s}case"array":{if(!Array.isArray(n.value.items))return g(`${t}.items must be an array`);let s=[];for(let[p,l]of n.value.items.entries()){let c=pe(l,`${t}[${p}]`);if(!c.ok)return c;s.push(c.value)}return{ok:!0,value:{kind:"array",items:s}}}case"object":{let s=ae(n.value.entries,`${t}.entries`);return s.ok?{ok:!0,value:{kind:"object",entries:s.value}}:s}case"template":{if(!Array.isArray(n.value.parts))return g(`${t}.parts must be an array`);let s=[];for(let[p,l]of n.value.parts.entries()){let c=rt(l,`${t}.parts[${p}]`);if(!c.ok)return c;s.push(c.value)}return{ok:!0,value:{kind:"template",parts:s}}}default:return g(`${t}.kind is invalid`)}}function rt(e,t){let n=R(e,t);if(!n.ok)return n;let o=n.value.kind;if(o==="literal")return typeof n.value.value!="string"?g(`${t}.value must be a string`):{ok:!0,value:{kind:"literal",value:n.value.value}};if(o==="human_input_ref"){let s=x(n.value.path,`${t}.path`);return s.ok?{ok:!0,value:{kind:"human_input_ref",path:s.value}}:s}return g(`${t}.kind is invalid`)}function ao(e){let t=R(e,"request body");if(!t.ok)return r(t.reason);let n=x(t.value.nodeId,"nodeId");if(!n.ok)return r(n.reason);let o=et(t.value.renderedPrompt);if(!o.ok)return r(o.reason);let s=tt(t.value.input);if(!s.ok)return r(s.reason);let p=x(t.value.timeout,"timeout");if(!p.ok)return r(p.reason);let l=Ze(t.value.expiresAt,"expiresAt");if(!l.ok)return r(l.reason);let c=nt(t.value.partiallyRenderedDelivery);return c.ok?a({nodeId:n.value,renderedPrompt:o.value,input:s.value,timeout:p.value,expiresAt:l.value,...c.value!==void 0?{partiallyRenderedDelivery:c.value}:{}}):r(c.reason)}function ot(e){return!i(e)||typeof e.id!="string"||e.id.length===0||typeof e.nodeId!="string"||typeof e.status!="string"||!(e.output===null||i(e.output))?r("human input request view must carry id, nodeId, status and output"):a(e)}function po(e){if(!i(e)||typeof e.created!="boolean")return r("human input create data must carry created:boolean");let t=ot(e.request);return t.ok?a({created:e.created,request:t.value}):t}function lo(e){return!i(e)||e.acknowledged!==!0?r("human input acknowledge data must carry acknowledged:true"):a({acknowledged:!0})}var co="ablehi-wfp-user-runtime-manifest/v1",go="unknown";function fo(e){return e.endsWith(".js")?`${e.slice(0,-3)}.manifest.json`:`${e}.manifest.json`}var Ro="/internal/deployment-handshake",it=["start","terminate","send-event","start-webhook-watcher","run-polling-tick","invoke-tool","invoke-trigger-handler","invoke-webhook-protocol-adapter","deployment-handshake"],_o=it,Io="HANDSHAKE_REQUEST_INVALID",yo="HANDSHAKE_SECRET_UNCONFIGURED",To="HANDSHAKE_SECRET_MISMATCH",xo="HANDSHAKE_CONTRACT_VERSION_MISMATCH",Eo="HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH",wo="HANDSHAKE_CAPABILITY_MISSING";function Ao(e){return[e.nonce,e.timestamp,e.contractVersion,e.dispatchNamespace].map(n=>`${n.length}:${n}`).join(".")}function ko(e){return["response",e.nonce,e.contractVersion,e.dispatchNamespace,...e.capabilities].map(n=>`${n.length}:${n}`).join(".")}var ho="platform.access",Po="platform.api_key.manage";var No="/me",Do=()=>"/me";var st="/app/bootstrap",bo=()=>st;var le="/workspaces",vo="/",Uo="/:workspaceId",at="/me/default-workspace",Lo=e=>`${le}/${encodeURIComponent(e)}`,Bo=()=>le,Go=()=>at;var J="/api-keys",pt="/grant-options",Mo="/:apiKeyId",$o="ahi_key_",Ko="workspace.full_access",Wo=()=>J,Vo=()=>`${J}${pt}`,qo=e=>`${J}/${encodeURIComponent(e)}`;var X="/catalog",Jo="/integrations",Xo="/integrations/:slug",Yo="/versions",zo="/integrations/:slug/default-provider-app-config",Qo=e=>{let t=`${X}/integrations`;return e?.category!==void 0&&e.category!==""?`${t}?category=${encodeURIComponent(e.category)}`:t},lt=e=>`${X}/integrations/${encodeURIComponent(e)}`,Zo=()=>`${X}/versions`,ei=e=>`${lt(e)}/default-provider-app-config`;var ni="/workspaces/:workspaceId/integrations",ri="/:installationId",oi="/:installationId/tools",ut=e=>`/workspaces/${encodeURIComponent(e)}/integrations`,ct=(e,t)=>`${ut(e)}/${encodeURIComponent(t)}`,ii=(e,t)=>`${ct(e,t)}/tools`;var ai="/workspaces/:workspaceId",pi="/connections",li="/integrations/:installationId/connect/start",ui="/integrations/:installationId/connect/options",ci="/connect-sessions/:sessionId/submit",di="/connect-sessions/:sessionId/complete",gi="/integrations/:installationId/connections/:connectionRef",fi="/callbacks/redirect",E=e=>`/workspaces/${encodeURIComponent(e)}`,mi=e=>`${E(e)}/connections`,Ri=(e,t)=>`${E(e)}/integrations/${encodeURIComponent(t)}/connect/start`,_i=(e,t)=>`${E(e)}/integrations/${encodeURIComponent(t)}/connect/options`,Ii=(e,t)=>`${E(e)}/connect-sessions/${encodeURIComponent(t)}/submit`,yi=(e,t)=>`${E(e)}/connect-sessions/${encodeURIComponent(t)}/complete`,Ti=(e,t,n)=>`${E(e)}/integrations/${encodeURIComponent(t)}/connections/${encodeURIComponent(n)}`;var Ei="/workspaces/:workspaceId/flows",wi="/validate",Ai="/:flowId",ki="/:flowId/enable",Si="/:flowId/disable",hi="/:flowId/draft",Pi="/:flowId/versions",Oi="/:flowId/versions/:version",ue=e=>`/workspaces/${encodeURIComponent(e)}/flows`,Ni=e=>`${ue(e)}/validate`,B=(e,t)=>`${ue(e)}/${encodeURIComponent(t)}`,Di=(e,t)=>`${B(e,t)}/enable`,Ci=(e,t)=>`${B(e,t)}/disable`,bi=(e,t)=>`${B(e,t)}/draft`,dt=(e,t)=>`${B(e,t)}/versions`,Fi=(e,t,n)=>`${dt(e,t)}/${n}`;var Ui="/workspaces/:workspaceId/agent",Li="/chat",Bi="/flow-context",Gi="/sessions",Hi="/sessions/:sessionId",Mi=e=>`/workspaces/${encodeURIComponent(e)}/agent/chat`,$i=e=>`/workspaces/${encodeURIComponent(e)}/agent/sessions`,Ki=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/sessions/${encodeURIComponent(t)}`,Wi=20,Vi=50,qi=100,ji="flow_authoring",Ji=["flow","flow_run","inbox_entry","integration"],Xi=256,Yi=10,zi=256,Qi=["getFlowContext","getWorkingFlowIr","setFlowMeta","addNode","updateNode","removeNode","setTrigger","removeTrigger","setOutputs","setComposition","validateFlow","proposePublish","requestConnect"],Zi=["setFlowMeta","addNode","updateNode","removeNode","setTrigger","removeTrigger","setOutputs","setComposition"];function es(e){return JSON.stringify(e)}var G={type:"object",properties:{},additionalProperties:!1},w={type:"object",additionalProperties:!0},gt=[{name:"getFlowContext",execution:"server",description:"Read the current workspace environment snapshot (installed integrations, their control-plane tools and triggers with stable refs, and active connections). Call this first to learn which toolRef / triggerRef / connectionRef values are available before editing the flow.",inputSchema:G},{name:"getWorkingFlowIr",execution:"server",description:"Read the current Server-owned working flow IR (flow.ir.v1), including existing triggers, nodes, outputs, and composition. Call this before editing an existing or non-empty flow, or whenever you need to inspect the current flow state.",inputSchema:G},{name:"setFlowMeta",execution:"server",description:"Set the working flow metadata: the flow logical name and/or its inputSchema (the $input contract).",inputSchema:{type:"object",properties:{flow:{type:"string",description:"Flow logical name."},inputSchema:{...w,description:"JSON object describing $input."}},additionalProperties:!1}},{name:"addNode",execution:"server",description:"Add one node to the working flow IR. node.kind is action | wait_event | sleep | human_input. action needs { id, kind:'action', toolRef, connectionRef, inputs }. wait_event needs { id, kind:'wait_event', eventType, correlation, timeout, onTimeout }. sleep needs { id, kind:'sleep', duration }. human_input needs { id, kind:'human_input', prompt:{ title, body?, format?:'plain'|'markdown' }, input, timeout, delivery? } \u2014 use it whenever the flow must WAIT for a person to review/approve/choose/answer before continuing; never use a normal action node or a provider approval tool as the wait point. human_input.input is { kind:'choice', choices:[{ id, label, style? }], allowComment? } | { kind:'text', multiline?, placeholder?, required? } | { kind:'form', fields:[{ id, label, type:'text'|'textarea'|'number'|'boolean'|'select', required?, options? }] }. Approve/reject is input.kind:'choice' with choices approve and reject (reject is just a choice with NO automatic side effect; wire any reject behavior yourself). Three or more options is the same choice kind with more choices. Free text is input.kind:'text'; structured answers are input.kind:'form'. Downstream nodes read $nodes.<human_input_id>.output, whose runtime shape is { status:'submitted', response, actor, submissionSource, submittedAt } | { status:'expired', actor, expiredAt } \u2014 the submitted value is nested under output.response ({ kind:'choice', choiceId, comment? } | { kind:'text', text } | { kind:'form', values }), NEVER directly on output. Examples: choice branch runIf { eq:[ $nodes.review.output.response.choiceId, 'approve' ] }; text value ${$nodes.ask.output.response.text}; form field ${$nodes.details.output.response.values.priority}; timeout branch runIf { eq:[ $nodes.review.output.status, 'expired' ] } (an expired human_input is a normal output, not a failure). Optional external notifications go under delivery.actions[] as { id, toolRef, connectionRef, inputs } using the SAME action triad as an action node (concrete string toolRef + concrete user-chosen string connectionRef + inputs); Inbox is always the default surface and is never itself a delivery action; you may add zero or more delivery actions. Only delivery.actions[].inputs may reference $humanInput, and the standard payload field uses the whole-object single reference form $humanInput.actions.<deliveryActionId>.payload (never string-interpolated). Do not invent provider shorthand fields; use the action's own input names. If a native feedback action declares fixed choice ids, the human_input.input.choices[].id MUST match those ids exactly (labels may differ, e.g. Yes/No) \u2014 never auto-map yes/no to approve/reject. Use dependsOn and $nodes.<id>.output.* references to wire data between nodes. node inputs MUST NOT reference $trigger (trigger output is bound only in the trigger's inputMapping / dedupeKey); read trigger-derived values via $input.* instead. In text templates reference fields with ${$input.*} / ${$nodes.*}; mixed text MUST NOT contain a bare reference (write 'Issue: ${$input.title}', never 'Issue: $input.title'), and a literal dollar sign is written as $$ (e.g. 'Pay $$5'). duration / timeout strings MUST be '<positive integer> <unit>' where unit is second|minute|hour|day (plural allowed), e.g. '1 hour', '10 minutes', '5 days' \u2014 compact forms like '1h' / '10m' are rejected by the server.",inputSchema:{type:"object",properties:{node:{...w,description:"A FlowNode object."}},required:["node"],additionalProperties:!1}},{name:"updateNode",execution:"server",description:"Patch an existing node by id. patch is a partial node object whose fields are shallow-merged into the node.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Target node id."},patch:{...w,description:"Partial node fields to merge."}},required:["id","patch"],additionalProperties:!1}},{name:"removeNode",execution:"server",description:"Remove a node from the working flow IR by id.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Node id to remove."}},required:["id"],additionalProperties:!1}},{name:"setTrigger",execution:"server",description:"Upsert a trigger by id (replaces a trigger with the same id). trigger.kind is schedule | integration | manual. schedule needs { id, kind:'schedule', cron, timezone }. integration needs { id, kind:'integration', triggerRef, connectionRef, config, inputMapping?, dedupeKey? }. manual needs { id, kind:'manual' }. For an integration trigger, fill config from the trigger inputSchema in getFlowContext and NEVER omit a requiredInputs field (e.g. linear/new_issue requires config.team_id). $trigger.output.* may ONLY be referenced inside the trigger's own inputMapping / dedupeKey; node inputs MUST NOT reference $trigger. In any text template, reference fields with ${$input.*} / ${$nodes.*}; mixed text MUST NOT contain a bare reference (write 'Issue: ${$input.title}', never 'Issue: $input.title'), and a literal dollar sign is written as $$ (e.g. 'Pay $$5'). Always run validateFlow before proposing publish.",inputSchema:{type:"object",properties:{trigger:{...w,description:"A TriggerBinding object."}},required:["trigger"],additionalProperties:!1}},{name:"removeTrigger",execution:"server",description:"Remove a trigger from the working flow IR by id.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Trigger id to remove."}},required:["id"],additionalProperties:!1}},{name:"setOutputs",execution:"server",description:"Set the working flow outputs mapping: the MACHINE response / API response of the flow (structured data for programs and webhooks), NOT the user-facing result. The user-readable Inbox result is composition (use setComposition for that); never describe outputs to the user as their result, and never derive composition from outputs. Only reference fields that exist in a tool or trigger output schema. Use $nodes.<id>.output.<arrayField>.length to project an array count. In text templates reference fields with ${$input.*} / ${$nodes.*}; mixed text MUST NOT contain a bare reference (write 'Total: ${$nodes.sum.output.value}', never 'Total: $nodes.sum.output.value'), and a literal dollar sign is written as $$ (e.g. 'Pay $$5'). Do not invent output fields from node inputs; for example, if a search tool output only declares results, use a literal or $input value for the original query instead of $nodes.<id>.output.query.",inputSchema:{type:"object",properties:{outputs:{...w,description:"Outputs mapping object."}},required:["outputs"],additionalProperties:!1}},{name:"setComposition",execution:"server",description:"Set the flow composition: the USER-READABLE result work that a successful run saves as one Inbox result for a person to read (NOT the machine response \u2014 that is outputs). composition.title is a short headline. composition.detail.format MUST be 'markdown' and composition.detail.body is the markdown a human reads. Optionally composition.detail.data is a structured mapping kept for reference (never shown by default). Add composition.report ONLY when the flow already has a node that produces a human report (e.g. an AI analysis/report node): set its report.format='markdown' and report.body from that node output; never invent a report when no report-producing node exists. Reference run data with ${$input.*} / ${$nodes.*} only (composition MUST NOT reference $trigger or $outputs); mixed text MUST NOT contain a bare reference (write 'Result: ${$nodes.sum.output.value}', never 'Result: $nodes.sum.output.value'), and a literal dollar sign is written as $$ (e.g. 'Pay $$5'). Creating a flow MUST create a composition; editing nodes or input semantics MUST keep composition consistent. The whole composition object replaces the previous one.",inputSchema:{type:"object",properties:{composition:{...w,description:"A FlowCompositionSpec: { title, detail:{ format:'markdown', body, data? }, report?:{ title?, format:'markdown', body, data? } }."}},required:["composition"],additionalProperties:!1}},{name:"validateFlow",execution:"server",description:"Validate the current Server-owned working flow IR against the Ablehi Server (authoritative). A valid result automatically persists the flow draft and runs readiness; the server is the only source of flow validity.",inputSchema:G},{name:"proposePublish",execution:"server",description:"When the latest Server-owned draft is publishable, return a structured publish suggestion for the human. This tool never publishes and never creates an approval; publishing is only POST /publish with human confirm:true.",inputSchema:G},{name:"requestConnect",execution:"client",description:"Ask the user to connect an integration so a connectionRef becomes available. Opens the connection UI. The user supplies any credential directly to the Ablehi Server; you only receive { status, connectionRef? } and never the secret.",inputSchema:{type:"object",properties:{installationId:{type:"string",description:"Installation to connect."},connectionName:{type:"string",description:"Optional connection display name."}},required:["installationId"],additionalProperties:!1}}];function ts(e){return gt.find(t=>t.name===e)}var ns="AGENT_RUNTIME_UNCONFIGURED",rs="AGENT_RUNTIME_FAILED",os="AGENT_SESSION_NOT_FOUND",is="AGENT_MESSAGE_DELTA_INVALID",ss="AGENT_PAGE_CONTEXT_INVALID",Y="/agent/assets",as="/prompts",ps="/prompts/:targetKey/:revision",ls="/prompts/:targetKey/:revision/validate",us="/prompts/:targetKey/:revision/activate",cs="/model-input-targets",ds="/model-input-targets/:targetKey/render-preview",gs="/model-input-snapshots",fs="/flow-scenes",ms="/flow-scenes/:sceneKey/:revision",Rs="/flow-scenes/:sceneKey/:revision/validate",_s="/flow-scenes/:sceneKey/:revision/activate",Is="/flow-scenes/:sceneKey/:revision/reindex",ys="/flow-templates",Ts="/flow-templates/:templateKey/:revision",xs="/flow-templates/:templateKey/:revision/validate",Es="/flow-templates/:templateKey/:revision/activate",ws="/flow-templates/:templateKey/:revision/reindex",As="/flow-working-drafts/open",ks="/flow-working-drafts/:draftId",Ss="/flow-working-drafts/:draftId/commands",hs="/flow-working-drafts/:draftId/edit-turn/acquire",Ps="/flow-working-drafts/:draftId/edit-turn/release",Os="/flow-working-drafts/:draftId/publish",Ns="/flow-working-drafts/:draftId/readiness/check",Ds="/flow-working-drafts/:draftId/readiness/requirements/:requirementId/resolve",Cs="/flow-creation-tasks/:flowCreationTaskId",bs="/flow-creation-decisions/:decisionRecordId",Fs=()=>`${Y}/prompts`,vs=()=>`${Y}/flow-scenes`,Us=()=>`${Y}/flow-templates`,Ls=e=>`/workspaces/${encodeURIComponent(e)}/agent/flow-working-drafts/open`,A=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-working-drafts/${encodeURIComponent(t)}`,Bs=(e,t)=>`${A(e,t)}/commands`,Gs=(e,t)=>`${A(e,t)}/edit-turn/acquire`,Hs=(e,t)=>`${A(e,t)}/edit-turn/release`,Ms=(e,t)=>`${A(e,t)}/publish`,$s=(e,t)=>`${A(e,t)}/readiness/check`,Ks=(e,t,n)=>`${A(e,t)}/readiness/requirements/${encodeURIComponent(n)}/resolve`,Ws=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-creation-tasks/${encodeURIComponent(t)}`,Vs=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-creation-decisions/${encodeURIComponent(t)}`,qs="agent.asset.manage",js=/^[A-Za-z0-9_-]{1,64}$/,Js="flow_create_authoring_task",ft="oneoff_getActionContext",mt="oneoff_executeAction",Xs=[ft,mt],Ys=["agent.general.turn","agent.intent.flow_goal","agent.one_off.turn","flow_authoring.edit_turn","flow_authoring.create_from_brief_turn","flow_authoring.server_loop_command","workflow.flow_authoring.scene_fit_judge","workflow.flow_authoring.template_fit_judge","workflow.flow_authoring.brief_generation","workflow.flow_authoring.fallback_plan"],zs="AGENT_ASSET_NOT_FOUND",Qs="AGENT_ASSET_VALIDATION_FAILED",Zs="AGENT_PROMPT_TARGET_NOT_FOUND",ea="AGENT_PROMPT_ACTIVE_REVISION_MISSING",ta="AGENT_PROMPT_REVISION_NOT_FOUND",na="AGENT_PROMPT_REVISION_NOT_DRAFT",ra="AGENT_PROMPT_VALIDATION_FAILED",oa="AGENT_MODEL_INPUT_TARGET_PROTECTED",ia="AGENT_MODEL_INPUT_PREVIEW_UNAVAILABLE",sa="AGENT_FLOW_GOAL_INVALID",aa="AGENT_FLOW_CREATION_TASK_NOT_FOUND",pa="AGENT_FLOW_CREATION_TASK_CONFLICT",la="AGENT_FLOW_AUTHORING_WORKFLOW_FAILED",ua="FLOW_WORKING_DRAFT_NOT_FOUND",ca="FLOW_DRAFT_REVISION_CONFLICT",da="FLOW_DRAFT_COMMAND_INVALID",ga="FLOW_DRAFT_EDIT_LOCKED",fa="FLOW_EDIT_TURN_NOT_HELD",ma="FLOW_DRAFT_NOT_PUBLISHABLE",Ra="FLOW_PUBLISH_CONFIRMATION_REQUIRED",_a="FLOW_READINESS_REQUIREMENT_NOT_FOUND",Ia="FLOW_READINESS_REQUIREMENT_CONFLICT",ya="AGENT_ASSET_INDEX_FAILED";var xa="/workspaces/:workspaceId/runs",Ea="/workspaces/:workspaceId/flows/:flowId/runs",wa="/:runId",Aa="/:runId/cancel",ka="/:runId/events",Rt=e=>`/workspaces/${encodeURIComponent(e)}/runs`,ce=(e,t)=>`${Rt(e)}/${encodeURIComponent(t)}`,Sa=(e,t)=>`${ce(e,t)}/cancel`,ha=(e,t)=>`${ce(e,t)}/events`,Pa=(e,t)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/runs`,Oa=["queued","running","succeeded","failed","interrupted","cancelled"],Na=["succeeded","skipped","timed_out","failed"];var Ca="/workspaces/:workspaceId/inbox/items",ba="/workspaces/:workspaceId/inbox/entries",de="/inbox/entries",Fa="/:itemId",va="/:entryId",Ua="/:entryId/human-input/submit",_t=e=>`/workspaces/${encodeURIComponent(e)}/inbox/items`,La=(e,t)=>`${_t(e)}/${encodeURIComponent(t)}`,It=e=>`/workspaces/${encodeURIComponent(e)}/inbox/entries`,yt=(e,t)=>`${It(e)}/${encodeURIComponent(t)}`,Ba=(e,t)=>`${yt(e,t)}/human-input/submit`,Ga=()=>de,Tt=e=>`${de}/${encodeURIComponent(e)}`,Ha=e=>`${Tt(e)}/human-input/submit`;var $a="/human-input/tokens",Ka="/:token",Wa="/:token/submit",xt=e=>`/human-input/tokens/${encodeURIComponent(e)}`,Va=e=>`${xt(e)}/submit`;var ja="/:flowId/trigger-instances",Ja="/:flowId/triggers/:triggerBindingId/simulate",Xa=(e,t)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/trigger-instances`,Ya=(e,t,n)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/triggers/${encodeURIComponent(n)}/simulate`;export{Y as AGENT_ASSETS_ROUTE_PREFIX,fs as AGENT_ASSET_FLOW_SCENES_SUBPATH,_s as AGENT_ASSET_FLOW_SCENE_ACTIVATE_SUBPATH,ms as AGENT_ASSET_FLOW_SCENE_ITEM_SUBPATH,Is as AGENT_ASSET_FLOW_SCENE_REINDEX_SUBPATH,Rs as AGENT_ASSET_FLOW_SCENE_VALIDATE_SUBPATH,ys as AGENT_ASSET_FLOW_TEMPLATES_SUBPATH,Es as AGENT_ASSET_FLOW_TEMPLATE_ACTIVATE_SUBPATH,Ts as AGENT_ASSET_FLOW_TEMPLATE_ITEM_SUBPATH,ws as AGENT_ASSET_FLOW_TEMPLATE_REINDEX_SUBPATH,xs as AGENT_ASSET_FLOW_TEMPLATE_VALIDATE_SUBPATH,ya as AGENT_ASSET_INDEX_FAILED_ERROR_CODE,qs as AGENT_ASSET_MANAGE_PERMISSION,gs as AGENT_ASSET_MODEL_INPUT_SNAPSHOTS_SUBPATH,cs as AGENT_ASSET_MODEL_INPUT_TARGETS_SUBPATH,ds as AGENT_ASSET_MODEL_INPUT_TARGET_PREVIEW_SUBPATH,zs as AGENT_ASSET_NOT_FOUND_ERROR_CODE,as as AGENT_ASSET_PROMPTS_SUBPATH,us as AGENT_ASSET_PROMPT_ACTIVATE_SUBPATH,ps as AGENT_ASSET_PROMPT_ITEM_SUBPATH,ls as AGENT_ASSET_PROMPT_VALIDATE_SUBPATH,Qs as AGENT_ASSET_VALIDATION_FAILED_ERROR_CODE,ji as AGENT_CAPABILITY_FLOW_AUTHORING,Li as AGENT_CHAT_ROUTE_SUBPATH,Js as AGENT_CREATE_FLOW_AUTHORING_TASK_TOOL_NAME,la as AGENT_FLOW_AUTHORING_WORKFLOW_FAILED_ERROR_CODE,Bi as AGENT_FLOW_CONTEXT_ROUTE_SUBPATH,bs as AGENT_FLOW_CREATION_DECISION_ITEM_SUBPATH,pa as AGENT_FLOW_CREATION_TASK_CONFLICT_ERROR_CODE,Cs as AGENT_FLOW_CREATION_TASK_ITEM_SUBPATH,aa as AGENT_FLOW_CREATION_TASK_NOT_FOUND_ERROR_CODE,sa as AGENT_FLOW_GOAL_INVALID_ERROR_CODE,Ds as AGENT_FLOW_READINESS_REQUIREMENT_RESOLVE_SUBPATH,Ss as AGENT_FLOW_WORKING_DRAFT_COMMANDS_SUBPATH,hs as AGENT_FLOW_WORKING_DRAFT_EDIT_TURN_ACQUIRE_SUBPATH,Ps as AGENT_FLOW_WORKING_DRAFT_EDIT_TURN_RELEASE_SUBPATH,ks as AGENT_FLOW_WORKING_DRAFT_ITEM_SUBPATH,As as AGENT_FLOW_WORKING_DRAFT_OPEN_SUBPATH,Os as AGENT_FLOW_WORKING_DRAFT_PUBLISH_SUBPATH,Ns as AGENT_FLOW_WORKING_DRAFT_READINESS_CHECK_SUBPATH,is as AGENT_MESSAGE_DELTA_INVALID_ERROR_CODE,ia as AGENT_MODEL_INPUT_PREVIEW_UNAVAILABLE_ERROR_CODE,Ys as AGENT_MODEL_INPUT_TARGET_KEYS,oa as AGENT_MODEL_INPUT_TARGET_PROTECTED_ERROR_CODE,ss as AGENT_PAGE_CONTEXT_INVALID_ERROR_CODE,Yi as AGENT_PAGE_CONTEXT_MAX_RESOURCES,zi as AGENT_PAGE_CONTEXT_RESOURCE_ID_MAX_LENGTH,Xi as AGENT_PAGE_CONTEXT_ROUTE_ID_MAX_LENGTH,Ji as AGENT_PAGE_RESOURCE_TYPES,ea as AGENT_PROMPT_ACTIVE_REVISION_MISSING_ERROR_CODE,na as AGENT_PROMPT_REVISION_NOT_DRAFT_ERROR_CODE,ta as AGENT_PROMPT_REVISION_NOT_FOUND_ERROR_CODE,Zs as AGENT_PROMPT_TARGET_NOT_FOUND_ERROR_CODE,ra as AGENT_PROMPT_VALIDATION_FAILED_ERROR_CODE,Ui as AGENT_ROUTE_PREFIX,rs as AGENT_RUNTIME_FAILED_ERROR_CODE,js as AGENT_RUNTIME_TOOL_NAME_PATTERN,ns as AGENT_RUNTIME_UNCONFIGURED_ERROR_CODE,Gi as AGENT_SESSIONS_ROUTE_SUBPATH,qi as AGENT_SESSION_DETAIL_MESSAGE_LIMIT,Hi as AGENT_SESSION_ITEM_ROUTE_SUBPATH,Wi as AGENT_SESSION_LIST_DEFAULT_LIMIT,Vi as AGENT_SESSION_LIST_MAX_LIMIT,os as AGENT_SESSION_NOT_FOUND_ERROR_CODE,J as API_KEYS_ROUTE_PREFIX,pt as API_KEY_GRANT_OPTIONS_ROUTE_SUBPATH,Mo as API_KEY_ITEM_ROUTE_SUBPATH,$o as API_KEY_TOKEN_PREFIX,Ko as API_KEY_WORKSPACE_FULL_ACCESS_SCOPE,st as APP_BOOTSTRAP_ROUTE_PATH,zo as CATALOG_DEFAULT_PROVIDER_APP_CONFIG_ROUTE_SUBPATH,Jo as CATALOG_INTEGRATIONS_ROUTE_SUBPATH,Xo as CATALOG_INTEGRATION_DETAIL_ROUTE_SUBPATH,X as CATALOG_ROUTE_PREFIX,Yo as CATALOG_VERSIONS_ROUTE_SUBPATH,pi as CONNECTIONS_ROUTE_SUBPATH,gi as CONNECTION_DISCONNECT_ROUTE_SUBPATH,di as CONNECT_COMPLETE_ROUTE_SUBPATH,ui as CONNECT_OPTIONS_ROUTE_SUBPATH,li as CONNECT_START_ROUTE_SUBPATH,ci as CONNECT_SUBMIT_ROUTE_SUBPATH,Pt as CONTEXT_STATE_CLEANUP_ROUTE_PATH,No as CURRENT_USER_ROUTE_PATH,at as DEFAULT_WORKSPACE_ROUTE_PATH,it as DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES,_o as DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES,Ro as DEPLOYMENT_HANDSHAKE_ROUTE,Zn as EGRESS_GRANT_AUDIT_ROUTE_SUBPATH,Qn as EGRESS_GRANT_CONSUME_ROUTE_SUBPATH,Le as EGRESS_GRANT_SCOPE_KINDS,$t as EVENT_WAIT_ROUTE_SUBPATH,Ft as EXECUTION_CONTEXT_ROUTE_SUBPATH,Mr as FILE_ACCESS_ROUTE_SUBPATH,Hr as FILE_COMPLETE_ROUTE_SUBPATH,Kr as FILE_CONTENT_ROUTE_SUBPATH,$r as FILE_STAT_ROUTE_SUBPATH,Gr as FILE_UPLOAD_SESSION_ROUTE_SUBPATH,Zi as FLOW_AUTHORING_EDIT_TOOL_NAMES,gt as FLOW_AUTHORING_TOOL_DESCRIPTORS,Qi as FLOW_AUTHORING_TOOL_NAMES,Si as FLOW_DISABLE_ROUTE_SUBPATH,da as FLOW_DRAFT_COMMAND_INVALID_ERROR_CODE,ga as FLOW_DRAFT_EDIT_LOCKED_ERROR_CODE,ma as FLOW_DRAFT_NOT_PUBLISHABLE_ERROR_CODE,ca as FLOW_DRAFT_REVISION_CONFLICT_ERROR_CODE,hi as FLOW_DRAFT_ROUTE_SUBPATH,fa as FLOW_EDIT_TURN_NOT_HELD_ERROR_CODE,ki as FLOW_ENABLE_ROUTE_SUBPATH,fe as FLOW_INTERPRETER_CONTRACT_VERSION,wt as FLOW_IR_SCHEMA_VERSION,Ai as FLOW_ITEM_ROUTE_SUBPATH,Ra as FLOW_PUBLISH_CONFIRMATION_REQUIRED_ERROR_CODE,Ia as FLOW_READINESS_REQUIREMENT_CONFLICT_ERROR_CODE,_a as FLOW_READINESS_REQUIREMENT_NOT_FOUND_ERROR_CODE,Jn as FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH,Mt as FLOW_RUN_RESULT_ROUTE_SUBPATH,Tr as FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Oa as FLOW_RUN_STATUSES,wi as FLOW_VALIDATE_ROUTE_SUBPATH,Pi as FLOW_VERSIONS_ROUTE_SUBPATH,Oi as FLOW_VERSION_ITEM_ROUTE_SUBPATH,ua as FLOW_WORKING_DRAFT_NOT_FOUND_ERROR_CODE,de as GLOBAL_INBOX_ENTRIES_ROUTE_PREFIX,en as HANDLER_BUNDLES_ROUTE_SUBPATH,wo as HANDSHAKE_CAPABILITY_MISSING,xo as HANDSHAKE_CONTRACT_VERSION_MISMATCH,Eo as HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH,Io as HANDSHAKE_REQUEST_INVALID,To as HANDSHAKE_SECRET_MISMATCH,yo as HANDSHAKE_SECRET_UNCONFIGURED,eo as HUMAN_INPUTS_ROUTE_SUBPATH,ro as HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH,no as HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH,to as HUMAN_INPUT_REQUEST_ROUTE_SUBPATH,ze as HUMAN_INPUT_RESOLVED_EVENT_PREFIX,$a as HUMAN_INPUT_TOKENS_ROUTE_PREFIX,Ka as HUMAN_INPUT_TOKEN_ROUTE_SUBPATH,Wa as HUMAN_INPUT_TOKEN_SUBMIT_ROUTE_SUBPATH,Ua as INBOX_ENTRY_HUMAN_INPUT_SUBMIT_ROUTE_SUBPATH,va as INBOX_ENTRY_ROUTE_SUBPATH,Fa as INBOX_ITEM_ROUTE_SUBPATH,ri as INTEGRATION_ITEM_ROUTE_SUBPATH,oi as INTEGRATION_TOOLS_ROUTE_SUBPATH,te as INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX,T as INTERNAL_FILES_ROUTE_PREFIX,f as INTERNAL_FLOW_RUNS_ROUTE_PREFIX,we as INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX,K as INTERNAL_INSTALLATIONS_ROUTE_PREFIX,P as INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX,q as INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX,S as INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX,mt as ONE_OFF_EXECUTE_ACTION_TOOL_NAME,ft as ONE_OFF_GET_ACTION_CONTEXT_TOOL_NAME,Xs as ONE_OFF_TOOL_NAMES,ho as PLATFORM_ACCESS_PERMISSION,Po as PLATFORM_API_KEY_MANAGE_PERMISSION,Fn as POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH,Yn as POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,vn as POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,Er as POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Un as POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH,fi as PROVIDER_CALLBACK_REDIRECT_ROUTE_PATH,Pr as RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS,Aa as RUN_CANCEL_ROUTE_SUBPATH,ka as RUN_EVENTS_ROUTE_SUBPATH,wa as RUN_ITEM_ROUTE_SUBPATH,ge as SERVER_CONTRACT_VERSION,Ht as STEP_RESULT_ROUTE_SUBPATH,Na as STEP_RUN_STATUSES,tn as TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH,Xn as TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH,xr as TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,ja as TRIGGER_INSTANCES_ROUTE_SUBPATH,Ja as TRIGGER_SIMULATE_ROUTE_SUBPATH,En as WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH,An as WEBHOOK_PROTOCOL_ADAPTER_MODULE,dn as WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH,fn as WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH,zn as WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,mn as WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH,gn as WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,Rn as WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH,wr as WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,co as WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION,go as WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION,le as WORKSPACES_ROUTE_PREFIX,Uo as WORKSPACE_ACCESS_ROUTE_SUBPATH,ai as WORKSPACE_CONNECTION_MOUNT_PREFIX,$e as WORKSPACE_FILES_ROUTE_PREFIX,Ei as WORKSPACE_FLOWS_ROUTE_PREFIX,Ea as WORKSPACE_FLOW_RUNS_ROUTE_PREFIX,ba as WORKSPACE_INBOX_ENTRIES_ROUTE_PREFIX,Ca as WORKSPACE_INBOX_ITEMS_ROUTE_PREFIX,ni as WORKSPACE_INTEGRATIONS_ROUTE_PREFIX,vo as WORKSPACE_LIST_ROUTE_SUBPATH,xa as WORKSPACE_RUNS_ROUTE_PREFIX,vs as agentAssetFlowScenesPath,Us as agentAssetFlowTemplatesPath,Fs as agentAssetPromptsPath,Mi as agentChatPath,Vs as agentFlowCreationDecisionPath,Ws as agentFlowCreationTaskPath,Ks as agentFlowReadinessRequirementResolvePath,Bs as agentFlowWorkingDraftCommandsPath,Gs as agentFlowWorkingDraftEditTurnAcquirePath,Hs as agentFlowWorkingDraftEditTurnReleasePath,Ls as agentFlowWorkingDraftOpenPath,A as agentFlowWorkingDraftPath,Ms as agentFlowWorkingDraftPublishPath,$s as agentFlowWorkingDraftReadinessCheckPath,Ki as agentSessionPath,$i as agentSessionsPath,Vo as apiKeyGrantOptionsPath,qo as apiKeyPath,Wo as apiKeysPath,bo as appBootstrapPath,ei as catalogDefaultProviderAppConfigPath,lt as catalogIntegrationPath,Qo as catalogIntegrationsPath,Zo as catalogVersionsPath,yi as connectCompletePath,_i as connectOptionsPath,Ri as connectStartPath,Ii as connectSubmitPath,Ti as connectionDisconnectPath,r as contractParseFail,a as contractParseOk,Do as currentUserPath,Go as defaultWorkspacePath,Ao as deploymentHandshakeProbePayload,ko as deploymentHandshakeResponseProofPayload,ir as egressGrantAuditPath,or as egressGrantConsumePath,Vt as eventWaitPath,vt as executionContextPath,ts as findFlowAuthoringToolDescriptor,Ci as flowDisablePath,bi as flowDraftPath,Di as flowEnablePath,B as flowPath,er as flowRunEgressGrantPath,Wt as flowRunResultPath,Ar as flowRunRuntimeCredentialPath,Pa as flowRunsPath,kn as flowScriptProtocolAdapterModuleName,Ni as flowValidatePath,Fi as flowVersionPath,dt as flowVersionsPath,es as formatFlowToolError,Ga as globalInboxEntriesPath,Ha as globalInboxEntryHumanInputSubmitPath,Tt as globalInboxEntryPath,nn as handlerBundlesPath,io as humanInputAcknowledgePath,oo as humanInputExpirePath,se as humanInputRequestPath,so as humanInputResolvedEventType,xt as humanInputTokenPath,Va as humanInputTokenSubmitPath,Ye as humanInputsPath,Ba as inboxEntryHumanInputSubmitPath,yt as inboxEntryPath,La as inboxItemPath,ii as installationToolsPath,jr as internalFileAccessPath,qr as internalFileCompletePath,Xr as internalFileContentPath,Jr as internalFileStatPath,Vr as internalFileUploadSessionPath,Wr as internalFilesPath,i as isJsonRecord,O as isValidRequestDigest,zt as parseCompleteFlowRunWaitBody,Ot as parseContextStateCleanupRequestBody,Nt as parseContextStateCleanupResponseData,_ as parseContextStateScope,ao as parseCreateHumanInputBody,cr as parseEgressGrantAuditBody,ur as parseEgressGrantConsumeBody,gr as parseEgressGrantConsumeData,dr as parseEgressGrantData,Ut as parseExecutionContextData,j as parseFileAccessData,oe as parseFileMetadataData,L as parseFileRefData,Ie as parseFileRuntimeLimits,je as parseFileUploadSessionData,sr as parseFlowActionGrantBody,Jt as parseFlowRunResultBody,Xt as parseFlowRunResultData,Or as parseFlowRuntimeCredentialBody,ke as parseHandlerBundle,on as parseHandlerBundlesData,lo as parseHumanInputAcknowledgeData,po as parseHumanInputCreateData,ot as parseHumanInputRequestViewData,Yr as parseInternalFileAccessData,Mn as parsePollingPublishBody,Dr as parsePollingRuntimeCredentialBody,Hn as parsePollingTriggerContext,pr as parsePollingTriggerGrantBody,$n as parsePublishPollingTickEventsData,Yt as parseRegisterFlowRunWaitBody,Qt as parseRegisterFlowRunWaitData,br as parseRuntimeCredentialSessionCredential,C as parseRuntimeNetwork,ar as parseSingleToolGrantBody,Nr as parseSingleToolRuntimeCredentialBody,qt as parseStepRecordBody,jt as parseStepRecordData,sn as parseToolHandlerBundlesData,Pn as parseTriggerHandlerBundlesData,hn as parseWebhookDelivery,On as parseWebhookPublishEventsBody,Nn as parseWebhookRearmBody,Cr as parseWebhookRuntimeCredentialBody,lr as parseWebhookTriggerGrantBody,Sn as parseWebhookWatcherContext,Ln as pollingTriggerContextPath,nr as pollingTriggerEgressGrantPath,Bn as pollingTriggerHandlerBundlesPath,Sr as pollingTriggerRuntimeCredentialPath,Gn as pollingTriggerTickEventsPath,Ge as requestHasMultipartFileParts,Sa as runCancelPath,ha as runEventsPath,ce as runPath,Kt as stepResultPath,rn as toolHandlerBundlesPath,tr as toolInvocationEgressGrantPath,kr as toolInvocationRuntimeCredentialPath,Xa as triggerInstancesPath,Ya as triggerSimulatePath,wn as webhookProtocolAdapterBundlePath,_n as webhookTriggerContextPath,yn as webhookTriggerDeliveryPath,rr as webhookTriggerEgressGrantPath,Tn as webhookTriggerEventsPath,In as webhookTriggerHandlerBundlesPath,xn as webhookTriggerRearmPath,hr as webhookTriggerRuntimeCredentialPath,fo as wfpUserRuntimeManifestPath,mi as workspaceConnectionsPath,qe as workspaceFileAccessPath,We as workspaceFileCompletePath,Ve as workspaceFileMetadataPath,Ke as workspaceFileUploadSessionPath,ue as workspaceFlowsPath,It as workspaceInboxEntriesPath,_t as workspaceInboxItemsPath,ct as workspaceIntegrationPath,ut as workspaceIntegrationsPath,Lo as workspacePath,Rt as workspaceRunsPath,Bo as workspacesPath};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ablehi/server-contract",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Ablehi server wire contract: routes, wire DTOs, Flow IR and interpreter version.",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {