@ablehi/server-contract 0.2.4 → 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.
- package/dist/{edge-COdVAE2s.d.ts → edge-DNtGw1Sl.d.ts} +6 -2
- package/dist/edge.d.ts +1 -1
- package/dist/edge.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const SERVER_CONTRACT_VERSION = "0.2.
|
|
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";
|
|
@@ -766,6 +766,9 @@ type FileUploadSessionData = {
|
|
|
766
766
|
file: FileRefData;
|
|
767
767
|
upload: PresignedFileUrlData;
|
|
768
768
|
};
|
|
769
|
+
type FileMetadataData = {
|
|
770
|
+
file: FileRefData;
|
|
771
|
+
};
|
|
769
772
|
type FileAccessData = {
|
|
770
773
|
file: FileRefData;
|
|
771
774
|
access: PresignedFileUrlData;
|
|
@@ -777,6 +780,7 @@ declare const workspaceFileMetadataPath: (workspaceId: string, fileId: string) =
|
|
|
777
780
|
declare const workspaceFileAccessPath: (workspaceId: string, fileId: string, intent: FileAccessIntent) => string;
|
|
778
781
|
declare function parseFileRefData(data: unknown): ContractParseResult<FileRefData>;
|
|
779
782
|
declare function parseFileUploadSessionData(data: unknown): ContractParseResult<FileUploadSessionData>;
|
|
783
|
+
declare function parseFileMetadataData(data: unknown): ContractParseResult<FileMetadataData>;
|
|
780
784
|
declare function parseFileAccessData(data: unknown): ContractParseResult<FileAccessData>;
|
|
781
785
|
|
|
782
786
|
declare const INTERNAL_FILES_ROUTE_PREFIX = "/internal/files";
|
|
@@ -984,4 +988,4 @@ declare function deploymentHandshakeResponseProofPayload(input: {
|
|
|
984
988
|
capabilities: string[];
|
|
985
989
|
}): string;
|
|
986
990
|
|
|
987
|
-
export { type FileAccessIntent as $, type AblehiEnvelope as A, type BooleanExpression as B, CONTEXT_STATE_CLEANUP_ROUTE_PATH as C, DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES as D, EGRESS_GRANT_AUDIT_ROUTE_SUBPATH as E, type FlowNode as F, type EgressGrantConsumeBody as G, type EgressGrantFileRuntime as H, type EgressGrantScopeKind as I, type JsonValue as J, type ExecutionBinding as K, type ExecutionBindingConnection as L, type Mapping as M, type ExecutionContextCompiled as N, type ExecutionContextData as O, FILE_ACCESS_ROUTE_SUBPATH as P, FILE_COMPLETE_ROUTE_SUBPATH as Q, FILE_CONTENT_ROUTE_SUBPATH as R, FILE_STAT_ROUTE_SUBPATH as S, type TriggerBinding as T, FILE_UPLOAD_SESSION_ROUTE_SUBPATH as U, FLOW_INTERPRETER_CONTRACT_VERSION as V, FLOW_IR_SCHEMA_VERSION as W, FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH as X, FLOW_RUN_RESULT_ROUTE_SUBPATH as Y, FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH as Z, type FileAccessData as _, type FlowIrValidationResult as a,
|
|
991
|
+
export { type FileAccessIntent as $, type AblehiEnvelope as A, type BooleanExpression as B, CONTEXT_STATE_CLEANUP_ROUTE_PATH as C, DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES as D, EGRESS_GRANT_AUDIT_ROUTE_SUBPATH as E, type FlowNode as F, type EgressGrantConsumeBody as G, type EgressGrantFileRuntime as H, type EgressGrantScopeKind as I, type JsonValue as J, type ExecutionBinding as K, type ExecutionBindingConnection as L, type Mapping as M, type ExecutionContextCompiled as N, type ExecutionContextData as O, FILE_ACCESS_ROUTE_SUBPATH as P, FILE_COMPLETE_ROUTE_SUBPATH as Q, FILE_CONTENT_ROUTE_SUBPATH as R, FILE_STAT_ROUTE_SUBPATH as S, type TriggerBinding as T, FILE_UPLOAD_SESSION_ROUTE_SUBPATH as U, FLOW_INTERPRETER_CONTRACT_VERSION as V, FLOW_IR_SCHEMA_VERSION as W, FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH as X, FLOW_RUN_RESULT_ROUTE_SUBPATH as Y, FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH as Z, type FileAccessData as _, type FlowIrValidationResult as a, POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH as a$, type FileMetadataData as a0, type FileRefData as a1, type FileRuntimeLimits as a2, type FileRuntimeScope as a3, type FileRuntimeScopeKind as a4, type FileUploadSessionData as a5, type FlowActionGrantBody as a6, type FlowDefinition as a7, type FlowExecutionContextFileRuntime as a8, type FlowInterpreterContractVersion as a9, type HumanInputDelivery as aA, type HumanInputDeliveryAction as aB, type HumanInputNode as aC, type HumanInputOutput as aD, type HumanInputPrompt as aE, type HumanInputRequestView as aF, type HumanInputResolvedEvent as aG, type HumanInputResponse as aH, type HumanInputSpec as aI, type HumanTextInput as aJ, INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX as aK, INTERNAL_FILES_ROUTE_PREFIX as aL, INTERNAL_FLOW_RUNS_ROUTE_PREFIX as aM, INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX as aN, INTERNAL_INSTALLATIONS_ROUTE_PREFIX as aO, INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX as aP, INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX as aQ, INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX as aR, type IntegrationTriggerBinding as aS, type InternalFileAccessData as aT, type InternalFileAccessIntent as aU, type JsonArray as aV, type ManualTriggerBinding as aW, type NodeCommon as aX, type Operand as aY, POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH as aZ, POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH as a_, type FlowIrValidationCode as aa, type FlowIrValidationIssue as ab, type FlowRunResultData as ac, type FlowRunResultRequestBody as ad, type FlowRuntimeCredentialBody as ae, HANDLER_BUNDLES_ROUTE_SUBPATH as af, HANDSHAKE_CAPABILITY_MISSING as ag, HANDSHAKE_CONTRACT_VERSION_MISMATCH as ah, HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH as ai, HANDSHAKE_REQUEST_INVALID as aj, HANDSHAKE_SECRET_MISMATCH as ak, HANDSHAKE_SECRET_UNCONFIGURED as al, HUMAN_INPUTS_ROUTE_SUBPATH as am, HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH as an, HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH as ao, HUMAN_INPUT_REQUEST_ROUTE_SUBPATH as ap, HUMAN_INPUT_RESOLVED_EVENT_PREFIX as aq, type HandlerBundle as ar, type HandlerBundleModule as as, type HandlerBundlesData as at, type HandlerBundlesParseResult as au, type HumanChoiceInput as av, type HumanFormField as aw, type HumanFormInput as ax, type HumanInputActor as ay, type HumanInputChoice as az, type JsonObject as b, type WebhookPublishEventsBody as b$, POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH as b0, POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH as b1, type PackagePollingTriggerRuntimeDescriptor as b2, type PackageWebhookTriggerRuntimeDescriptor as b3, type ParsedFlowRunResultBody as b4, type PartiallyRenderedHumanInputDelivery as b5, type PartiallyRenderedMapping as b6, type PartiallyRenderedTemplatePart as b7, type PartiallyRenderedValue as b8, type PollingPublishBody as b9, type StepRecordResult as bA, TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH as bB, TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH as bC, TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH as bD, type TextExpression as bE, type ToolHandlerBundlesData as bF, type TriggerConnectionInfo as bG, type TriggerHandlerBundlesData as bH, type TriggerHandlerModule as bI, type ValueExpression as bJ, WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH as bK, WEBHOOK_PROTOCOL_ADAPTER_MODULE as bL, WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH as bM, WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH as bN, WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH as bO, WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH as bP, WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH as bQ, WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH as bR, WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH as bS, WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION as bT, WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION as bU, WORKSPACE_FILES_ROUTE_PREFIX as bV, type WaitEventNode as bW, type WebhookDelivery as bX, type WebhookProtocolAdapterBundleData as bY, type WebhookProtocolAdapterModule as bZ, type WebhookPublishEvent as b_, type PollingPublishEvent as ba, type PollingRuntimeCredentialBody as bb, type PollingTriggerContext as bc, type PollingTriggerGrantBody as bd, type PresignedFileUrlData as be, type PublishPollingTickEventResult as bf, type PublishPollingTickEventsData as bg, RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS as bh, type RegisterFlowRunWaitBody as bi, type RegisterFlowRunWaitData as bj, type RenderedFlowComposition as bk, type RenderedHumanInputPrompt as bl, type RuntimeCredentialSession as bm, type RuntimeCredentialSessionNetwork as bn, type RuntimeCredentialSessionScopeKind as bo, type RuntimeNetwork as bp, type RuntimeNetworkModel as bq, SERVER_CONTRACT_VERSION as br, STEP_RESULT_ROUTE_SUBPATH as bs, type ScheduleTriggerBinding as bt, type ServerContractVersion as bu, type SingleToolGrantBody as bv, type SleepNode as bw, type StepRecordBody as bx, type StepRecordBodyParseResult as by, type StepRecordData as bz, type FlowCompositionSpec as c, parsePublishPollingTickEventsData as c$, type WebhookPublishEventsData as c0, type WebhookRearmBody as c1, type WebhookRearmData as c2, type WebhookRuntimeCredentialBody as c3, type WebhookTriggerGrantBody as c4, type WebhookTriggerVerificationMethod as c5, type WebhookWatcherContext as c6, type WfpUserRuntimeManifest as c7, contractParseFail as c8, contractParseOk as c9, parseContextStateCleanupResponseData as cA, parseContextStateScope as cB, parseCreateHumanInputBody as cC, parseEgressGrantAuditBody as cD, parseEgressGrantConsumeBody as cE, parseEgressGrantConsumeData as cF, parseEgressGrantData as cG, parseExecutionContextData as cH, parseFileAccessData as cI, parseFileMetadataData as cJ, parseFileRefData as cK, parseFileRuntimeLimits as cL, parseFileUploadSessionData as cM, parseFlowActionGrantBody as cN, parseFlowRunResultBody as cO, parseFlowRunResultData as cP, parseFlowRuntimeCredentialBody as cQ, parseHandlerBundle as cR, parseHandlerBundlesData as cS, parseHumanInputAcknowledgeData as cT, parseHumanInputCreateData as cU, parseHumanInputRequestViewData as cV, parseInternalFileAccessData as cW, parsePollingPublishBody as cX, parsePollingRuntimeCredentialBody as cY, parsePollingTriggerContext as cZ, parsePollingTriggerGrantBody as c_, deploymentHandshakeProbePayload as ca, deploymentHandshakeResponseProofPayload as cb, egressGrantAuditPath as cc, egressGrantConsumePath as cd, eventWaitPath as ce, executionContextPath as cf, flowRunEgressGrantPath as cg, flowRunResultPath as ch, flowRunRuntimeCredentialPath as ci, flowScriptProtocolAdapterModuleName as cj, handlerBundlesPath as ck, humanInputAcknowledgePath as cl, humanInputExpirePath as cm, humanInputRequestPath as cn, humanInputResolvedEventType as co, humanInputsPath as cp, internalFileAccessPath as cq, internalFileCompletePath as cr, internalFileContentPath as cs, internalFileStatPath as ct, internalFileUploadSessionPath as cu, internalFilesPath as cv, isJsonRecord as cw, isValidRequestDigest as cx, parseCompleteFlowRunWaitBody as cy, parseContextStateCleanupRequestBody as cz, type AblehiFailure as d, parseRegisterFlowRunWaitBody as d0, parseRegisterFlowRunWaitData as d1, parseRuntimeCredentialSessionCredential as d2, parseRuntimeNetwork as d3, parseSingleToolGrantBody as d4, parseSingleToolRuntimeCredentialBody as d5, parseStepRecordBody as d6, parseStepRecordData as d7, parseToolHandlerBundlesData as d8, parseTriggerHandlerBundlesData as d9, workspaceFileAccessPath as dA, workspaceFileCompletePath as dB, workspaceFileMetadataPath as dC, workspaceFileUploadSessionPath as dD, parseWebhookDelivery as da, parseWebhookPublishEventsBody as db, parseWebhookRearmBody as dc, parseWebhookRuntimeCredentialBody as dd, parseWebhookTriggerGrantBody as de, parseWebhookWatcherContext as df, pollingTriggerContextPath as dg, pollingTriggerEgressGrantPath as dh, pollingTriggerHandlerBundlesPath as di, pollingTriggerRuntimeCredentialPath as dj, pollingTriggerTickEventsPath as dk, requestHasMultipartFileParts as dl, stepResultPath as dm, toolHandlerBundlesPath as dn, toolInvocationEgressGrantPath as dp, toolInvocationRuntimeCredentialPath as dq, webhookProtocolAdapterBundlePath as dr, webhookTriggerContextPath as ds, webhookTriggerDeliveryPath as dt, webhookTriggerEgressGrantPath as du, webhookTriggerEventsPath as dv, webhookTriggerHandlerBundlesPath as dw, webhookTriggerRearmPath as dx, webhookTriggerRuntimeCredentialPath as dy, wfpUserRuntimeManifestPath as dz, type AblehiSuccess as e, type ActionNode as f, type Collection as g, type CompleteFlowRunWaitBody as h, type CompleteFlowRunWaitData as i, type ContextStateCleanupRequestBody as j, type ContextStateCleanupResponseData as k, type ContextStateScope as l, type ContractParseResult as m, type CreateHumanInputRequestBody as n, DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES as o, DEPLOYMENT_HANDSHAKE_ROUTE as p, type DeploymentHandshakeData as q, type DeploymentHandshakeRequestBody as r, type DeploymentHandshakeResponse as s, EGRESS_GRANT_CONSUME_ROUTE_SUBPATH as t, EGRESS_GRANT_SCOPE_KINDS as u, EVENT_WAIT_ROUTE_SUBPATH as v, EXECUTION_CONTEXT_ROUTE_SUBPATH as w, type EgressGrant as x, type EgressGrantAuditBody as y, type EgressGrantBodyParseResult as z };
|
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, a0 as
|
|
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.4";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-
|
|
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
|
|
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.4";var Et="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 ht="/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 Pt(e){if(!i(e))return r("cleanup request body must be a JSON object");let t=C(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 Ot(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=C(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=C(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=C(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 C(e,t){return Object.keys(e).find(n=>!t.includes(n))}var f="/internal/flow-runs",bt="/:flowRunId/execution-context";function Ft(e){return`${f}/${encodeURIComponent(e)}/execution-context`}function _e(e){return!i(e)||!H(e.fileMaxBytes)||!H(e.fileReadMaxBytes)||!H(e.inlineMultipartBytesMax)?r("file runtime limits must carry three positive integer bounds"):a({fileMaxBytes:e.fileMaxBytes,fileReadMaxBytes:e.fileReadMaxBytes,inlineMultipartBytesMax:e.inlineMultipartBytesMax})}function vt(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 H(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var Gt="/:flowRunId/steps/:nodeId/result",Ht="/:flowRunId/result",Mt="/:flowRunId/event-waits/:nodeId";function $t(e,t){return`${f}/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}/result`}function Kt(e){return`${f}/${encodeURIComponent(e)}/result`}function Wt(e,t){return`${f}/${encodeURIComponent(e)}/event-waits/${encodeURIComponent(t)}`}function Vt(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 qt(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 Jt(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 Xt(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 Yt(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 zt(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",Zt="/:flowVersionId/handler-bundles",$="/internal/installations",en="/:installationId/handler-bundles";function tn(e,t){return`${Ee}/${encodeURIComponent(e)}/handler-bundles?compiledArtifactId=${encodeURIComponent(t)}`}function nn(e){return`${$}/${encodeURIComponent(e.installationId)}/handler-bundles?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var we=new Set(["managed_only","managed_plus_unmanaged_sdk"]);function D(e){if(!y(e))return M("runtimeNetwork must be a JSON object");let t=e.networkModel;return typeof t!="string"||!we.has(t)?M("runtimeNetwork.networkModel is unknown"):!Q(e.apiHosts)||!Q(e.authHosts)||typeof e.httpsOnly!="boolean"?M("runtimeNetwork host/https fields are invalid"):{ok:!0,value:{networkModel:t,apiHosts:e.apiHosts,authHosts:e.authHosts,httpsOnly:e.httpsOnly}}}function rn(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 on(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=D(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=D(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 M(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",cn="/:triggerInstanceId/context",dn="/:triggerInstanceId/handler-bundles",gn="/:triggerInstanceId/deliveries/:deliveryId",fn="/:triggerInstanceId/events",mn="/:triggerInstanceId/rearm",h=e=>`${S}/${encodeURIComponent(e)}`;function Rn(e,t){return`${h(e)}/context?artifactDigest=${encodeURIComponent(t)}`}function _n(e,t){return`${h(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function In(e,t){return`${h(e)}/deliveries/${encodeURIComponent(t)}`}function yn(e){return`${h(e)}/events`}function Tn(e){return`${h(e)}/rearm`}var xn="/:installationId/webhook-protocol-adapter-bundle";function En(e){return`${$}/${encodeURIComponent(e.installationId)}/webhook-protocol-adapter-bundle?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var wn="modules/webhook/protocol-adapter.js";function An(e){return`modules/webhook/protocol-adapter-${e}.js`}function kn(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 Sn(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 hn(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=D(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 Pn(e){if(!i(e))return r("publish events body must be a JSON object");let t=K(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 u=Oe(p);if(!u.ok)return u;s.push(u.value)}return a({deliveryId:n,events:s})}function Oe(e){if(!i(e))return r("each event must be a JSON object");let t=K(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 On(e){if(!i(e))return r("rearm body must be a JSON object");let t=K(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 K(e,t){return Object.keys(e).find(n=>!t.includes(n))}var P="/internal/polling-trigger-instances",bn="/:pollingInstanceId/context",Fn="/:pollingInstanceId/handler-bundles",vn="/:pollingInstanceId/ticks/:tickId/events",W=e=>`${P}/${encodeURIComponent(e)}`;function Un(e,t,n){return`${W(e)}/context?artifactDigest=${encodeURIComponent(t)}&tickId=${encodeURIComponent(n)}`}function Ln(e,t){return`${W(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function Bn(e,t){return`${W(e)}/ticks/${encodeURIComponent(t)}/events`}function Gn(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)||!Ce(e.runtime)||!t.ok||t.value.kind!=="polling-trigger"||!De(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 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 De(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 Hn(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 u=Fe(p);if(!u.ok)return u;o.push(u.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 Mn(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",V="/internal/tool-invocations",jn="/:flowRunId/egress-grant",Jn="/:invocationId/egress-grant",Xn="/:pollingInstanceId/egress-grant",Yn="/:triggerInstanceId/egress-grant",zn="/:grantId/consume",Qn="/:grantId/audit",Zn=e=>`${f}/${encodeURIComponent(e)}/egress-grant`,er=e=>`${V}/${encodeURIComponent(e)}/egress-grant`,tr=e=>`${P}/${encodeURIComponent(e)}/egress-grant`,nr=e=>`${S}/${encodeURIComponent(e)}/egress-grant`,rr=e=>`${te}/${encodeURIComponent(e)}/consume`,or=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 l(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 ir(e){let t=F(e,["nodeId","request","requestDigest"]);if(!t.ok)return l(t.reason);let n=t.record.nodeId;if(typeof n!="string"||n.length===0)return l("nodeId is required");let o=v(t.record.request);if(o!==void 0)return l(o);let s=t.record.requestDigest;return O(s)?{ok:!0,value:{nodeId:n,requestDigest:s,requestHasMultipartFiles:Be(t.record.request)}}:N()}function sr(e){let t=F(e,["request","requestDigest"]);if(!t.ok)return l(t.reason);let n=v(t.record.request);if(n!==void 0)return l(n);let o=t.record.requestDigest;return O(o)?{ok:!0,value:{requestDigest:o}}:N()}function ar(e){let t=F(e,["tickId","request","requestDigest"]);if(!t.ok)return l(t.reason);let n=t.record.tickId;if(typeof n!="string"||n.length===0)return l("tickId is required");let o=v(t.record.request);if(o!==void 0)return l(o);let s=t.record.requestDigest;return O(s)?{ok:!0,value:{tickId:n,requestDigest:s}}:N()}function pr(e){let t=F(e,["phase","lifecycle","request","requestDigest"]);if(!t.ok)return l(t.reason);let n=t.record.phase;if(n!=="lifecycle"&&n!=="handler")return l('phase must be "lifecycle" or "handler"');let o=t.record.lifecycle,s;if(o!==void 0){if(o!=="enable"&&o!=="disable"&&o!=="renew")return l('lifecycle must be "enable", "disable", or "renew"');s=o}if(n==="lifecycle"&&s===void 0)return l("lifecycle is required for the lifecycle phase");let p=v(t.record.request);if(p!==void 0)return l(p);let u=t.record.requestDigest;return O(u)?{ok:!0,value:{phase:n,...s!==void 0?{lifecycle:s}:{},requestDigest:u}}:N()}function ne(e){return Ue.includes(e)?e:void 0}var Ge=["scopeKind","scopeId","requestDigest"];function ur(e){if(!i(e))return l("consume body must be a JSON object");for(let s of Object.keys(e))if(!Ge.includes(s))return l(`consume does not accept the "${s}" field`);let t=ne(e.scopeKind);if(t===void 0)return l("scopeKind is invalid");let n=e.scopeId;if(typeof n!="string"||n.length===0)return l("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 lr(e){if(!i(e))return l("audit body must be a JSON object");for(let d of Object.keys(e))if(!He.includes(d))return l(`audit does not accept the "${d}" field`);let t=ne(e.scopeKind);if(t===void 0)return l("scopeKind is invalid");let n=e.scopeId;if(typeof n!="string"||n.length===0)return l("scopeId is required");let o=e.providerHost;if(typeof o!="string"||o.length===0)return l("providerHost is required");let s=b(e.durationMs,"durationMs");if(!s.ok)return l(s.reason);let p;if(e.status!==void 0){let d=b(e.status,"status");if(!d.ok)return l(d.reason);p=d.value}let u;if(e.requestBytes!==void 0){let d=b(e.requestBytes,"requestBytes");if(!d.ok)return l(d.reason);u=d.value}let c;if(e.responseBytes!==void 0){let d=b(e.responseBytes,"responseBytes");if(!d.ok)return l(d.reason);c=d.value}let G;if(e.errorCode!==void 0){let d=e.errorCode;if(typeof d!="string"||d.length===0)return l("errorCode must be a non-empty string");G=d}return{ok:!0,value:{scopeKind:t,scopeId:n,providerHost:o,...p!==void 0?{status:p}:{},durationMs:s.value,...u!==void 0?{requestBytes:u}:{},...c!==void 0?{responseBytes:c}:{},...G!==void 0?{errorCode:G}:{}}}}function cr(e){return!i(e)||!i(e.grant)?r("egress grant envelope must carry a grant object"):a(e.grant)}function dr(e){return!i(e)||e.consumed!==!0?r("egress grant consume data must carry consumed:true"):a({consumed:!0})}var yr="/:flowRunId/runtime-credential",Tr="/:invocationId/runtime-credential",xr="/:pollingInstanceId/runtime-credential",Er="/:triggerInstanceId/runtime-credential",wr=e=>`${f}/${encodeURIComponent(e)}/runtime-credential`,Ar=e=>`${V}/${encodeURIComponent(e)}/runtime-credential`,kr=e=>`${P}/${encodeURIComponent(e)}/runtime-credential`,Sr=e=>`${S}/${encodeURIComponent(e)}/runtime-credential`,hr=["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 Pr(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 Or(e){let t=U(e??{},[]);return t.ok?a(null):r(t.reason)}function Nr(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,u=t.record.lifecycleOperation;if(u!==void 0){if(u!=="enable"&&u!=="disable"&&u!=="renew")return r('lifecycleOperation must be "enable", "disable", or "renew"');p=u}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 Dr(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 q(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"||!Je(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=q(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 j(e){if(!i(e)||!je(e.intent))return r("file access data is invalid");let t=q(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 Je(e){return i(e)?Object.values(e).every(t=>typeof t=="string"):!1}var T="/internal/files",Br="/upload-session",Gr="/:fileId/complete",Hr="/:fileId/access",Mr="/:fileId/stat",$r="/:fileId/content",Kr=()=>T,Wr=()=>`${T}/upload-session`,Vr=e=>`${T}/${encodeURIComponent(e)}/complete`,qr=(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)}`,Jr=(e,t)=>`${T}/${encodeURIComponent(e)}/content${oe(t)}`;function Xr(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 Zr="/:flowRunId/human-inputs",eo="/:flowRunId/human-inputs/:requestId",to="/:flowRunId/human-inputs/:requestId/expire",no="/:flowRunId/human-inputs/:requestId/acknowledge",Xe=e=>`${f}/${encodeURIComponent(e)}/human-inputs`,ie=(e,t)=>`${Xe(e)}/${encodeURIComponent(t)}`,ro=(e,t)=>`${ie(e,t)}/expire`,oo=(e,t)=>`${ie(e,t)}/acknowledge`,Ye="human_input_resolved";function io(e){return`${Ye}_${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 ze=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})$/;function Qe(e,t){return typeof e!="string"||!ze.test(e)||Number.isNaN(Date.parse(e))?g(`${t} must be an ISO-8601 timestamp`):{ok:!0,value:e}}function Ze(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 et(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 tt(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 u=x(p.value.id,"delivery action id");if(!u.ok)return u;let c=se(p.value.inputs,`delivery action '${u.value}' inputs`);if(!c.ok)return c;o.push({id:u.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 u=ae(p,`${t}.${s}`);if(!u.ok)return u;o[s]=u.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,u]of n.value.items.entries()){let c=ae(u,`${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,u]of n.value.parts.entries()){let c=nt(u,`${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 nt(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 so(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=Ze(t.value.renderedPrompt);if(!o.ok)return r(o.reason);let s=et(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 u=Qe(t.value.expiresAt,"expiresAt");if(!u.ok)return r(u.reason);let c=tt(t.value.partiallyRenderedDelivery);return c.ok?a({nodeId:n.value,renderedPrompt:o.value,input:s.value,timeout:p.value,expiresAt:u.value,...c.value!==void 0?{partiallyRenderedDelivery:c.value}:{}}):r(c.reason)}function rt(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 ao(e){if(!i(e)||typeof e.created!="boolean")return r("human input create data must carry created:boolean");let t=rt(e.request);return t.ok?a({created:e.created,request:t.value}):t}function po(e){return!i(e)||e.acknowledged!==!0?r("human input acknowledge data must carry acknowledged:true"):a({acknowledged:!0})}var lo="ablehi-wfp-user-runtime-manifest/v1",co="unknown";function go(e){return e.endsWith(".js")?`${e.slice(0,-3)}.manifest.json`:`${e}.manifest.json`}var mo="/internal/deployment-handshake",ot=["start","terminate","send-event","start-webhook-watcher","run-polling-tick","invoke-tool","invoke-trigger-handler","invoke-webhook-protocol-adapter","deployment-handshake"],Ro=ot,_o="HANDSHAKE_REQUEST_INVALID",Io="HANDSHAKE_SECRET_UNCONFIGURED",yo="HANDSHAKE_SECRET_MISMATCH",To="HANDSHAKE_CONTRACT_VERSION_MISMATCH",xo="HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH",Eo="HANDSHAKE_CAPABILITY_MISSING";function wo(e){return[e.nonce,e.timestamp,e.contractVersion,e.dispatchNamespace].map(n=>`${n.length}:${n}`).join(".")}function Ao(e){return["response",e.nonce,e.contractVersion,e.dispatchNamespace,...e.capabilities].map(n=>`${n.length}:${n}`).join(".")}var So="platform.access",ho="platform.api_key.manage";var Oo="/me",No=()=>"/me";var it="/app/bootstrap",Do=()=>it;var pe="/workspaces",Fo="/",vo="/:workspaceId",st="/me/default-workspace",Uo=e=>`${pe}/${encodeURIComponent(e)}`,Lo=()=>pe,Bo=()=>st;var J="/api-keys",at="/grant-options",Ho="/:apiKeyId",Mo="ahi_key_",$o="workspace.full_access",Ko=()=>J,Wo=()=>`${J}${at}`,Vo=e=>`${J}/${encodeURIComponent(e)}`;var X="/catalog",jo="/integrations",Jo="/integrations/:slug",Xo="/versions",Yo="/integrations/:slug/default-provider-app-config",zo=e=>{let t=`${X}/integrations`;return e?.category!==void 0&&e.category!==""?`${t}?category=${encodeURIComponent(e.category)}`:t},pt=e=>`${X}/integrations/${encodeURIComponent(e)}`,Qo=()=>`${X}/versions`,Zo=e=>`${pt(e)}/default-provider-app-config`;var ti="/workspaces/:workspaceId/integrations",ni="/:installationId",ri="/:installationId/tools",ut=e=>`/workspaces/${encodeURIComponent(e)}/integrations`,lt=(e,t)=>`${ut(e)}/${encodeURIComponent(t)}`,oi=(e,t)=>`${lt(e,t)}/tools`;var si="/workspaces/:workspaceId",ai="/connections",pi="/integrations/:installationId/connect/start",ui="/integrations/:installationId/connect/options",li="/connect-sessions/:sessionId/submit",ci="/connect-sessions/:sessionId/complete",di="/integrations/:installationId/connections/:connectionRef",gi="/callbacks/redirect",E=e=>`/workspaces/${encodeURIComponent(e)}`,fi=e=>`${E(e)}/connections`,mi=(e,t)=>`${E(e)}/integrations/${encodeURIComponent(t)}/connect/start`,Ri=(e,t)=>`${E(e)}/integrations/${encodeURIComponent(t)}/connect/options`,_i=(e,t)=>`${E(e)}/connect-sessions/${encodeURIComponent(t)}/submit`,Ii=(e,t)=>`${E(e)}/connect-sessions/${encodeURIComponent(t)}/complete`,yi=(e,t,n)=>`${E(e)}/integrations/${encodeURIComponent(t)}/connections/${encodeURIComponent(n)}`;var xi="/workspaces/:workspaceId/flows",Ei="/validate",wi="/:flowId",Ai="/:flowId/enable",ki="/:flowId/disable",Si="/:flowId/draft",hi="/:flowId/versions",Pi="/:flowId/versions/:version",ue=e=>`/workspaces/${encodeURIComponent(e)}/flows`,Oi=e=>`${ue(e)}/validate`,L=(e,t)=>`${ue(e)}/${encodeURIComponent(t)}`,Ni=(e,t)=>`${L(e,t)}/enable`,Ci=(e,t)=>`${L(e,t)}/disable`,Di=(e,t)=>`${L(e,t)}/draft`,ct=(e,t)=>`${L(e,t)}/versions`,bi=(e,t,n)=>`${ct(e,t)}/${n}`;var vi="/workspaces/:workspaceId/agent",Ui="/chat",Li="/flow-context",Bi="/sessions",Gi="/sessions/:sessionId",Hi=e=>`/workspaces/${encodeURIComponent(e)}/agent/chat`,Mi=e=>`/workspaces/${encodeURIComponent(e)}/agent/sessions`,$i=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/sessions/${encodeURIComponent(t)}`,Ki=20,Wi=50,Vi=100,qi="flow_authoring",ji=["flow","flow_run","inbox_entry","integration"],Ji=256,Xi=10,Yi=256,zi=["getFlowContext","getWorkingFlowIr","setFlowMeta","addNode","updateNode","removeNode","setTrigger","removeTrigger","setOutputs","setComposition","validateFlow","proposePublish","requestConnect"],Qi=["setFlowMeta","addNode","updateNode","removeNode","setTrigger","removeTrigger","setOutputs","setComposition"];function Zi(e){return JSON.stringify(e)}var B={type:"object",properties:{},additionalProperties:!1},w={type:"object",additionalProperties:!0},dt=[{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:B},{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:B},{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:B},{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:B},{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 es(e){return dt.find(t=>t.name===e)}var ts="AGENT_RUNTIME_UNCONFIGURED",ns="AGENT_RUNTIME_FAILED",rs="AGENT_SESSION_NOT_FOUND",os="AGENT_MESSAGE_DELTA_INVALID",is="AGENT_PAGE_CONTEXT_INVALID",Y="/agent/assets",ss="/prompts",as="/prompts/:targetKey/:revision",ps="/prompts/:targetKey/:revision/validate",us="/prompts/:targetKey/:revision/activate",ls="/model-input-targets",cs="/model-input-targets/:targetKey/render-preview",ds="/model-input-snapshots",gs="/flow-scenes",fs="/flow-scenes/:sceneKey/:revision",ms="/flow-scenes/:sceneKey/:revision/validate",Rs="/flow-scenes/:sceneKey/:revision/activate",_s="/flow-scenes/:sceneKey/:revision/reindex",Is="/flow-templates",ys="/flow-templates/:templateKey/:revision",Ts="/flow-templates/:templateKey/:revision/validate",xs="/flow-templates/:templateKey/:revision/activate",Es="/flow-templates/:templateKey/:revision/reindex",ws="/flow-working-drafts/open",As="/flow-working-drafts/:draftId",ks="/flow-working-drafts/:draftId/commands",Ss="/flow-working-drafts/:draftId/edit-turn/acquire",hs="/flow-working-drafts/:draftId/edit-turn/release",Ps="/flow-working-drafts/:draftId/publish",Os="/flow-working-drafts/:draftId/readiness/check",Ns="/flow-working-drafts/:draftId/readiness/requirements/:requirementId/resolve",Cs="/flow-creation-tasks/:flowCreationTaskId",Ds="/flow-creation-decisions/:decisionRecordId",bs=()=>`${Y}/prompts`,Fs=()=>`${Y}/flow-scenes`,vs=()=>`${Y}/flow-templates`,Us=e=>`/workspaces/${encodeURIComponent(e)}/agent/flow-working-drafts/open`,A=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-working-drafts/${encodeURIComponent(t)}`,Ls=(e,t)=>`${A(e,t)}/commands`,Bs=(e,t)=>`${A(e,t)}/edit-turn/acquire`,Gs=(e,t)=>`${A(e,t)}/edit-turn/release`,Hs=(e,t)=>`${A(e,t)}/publish`,Ms=(e,t)=>`${A(e,t)}/readiness/check`,$s=(e,t,n)=>`${A(e,t)}/readiness/requirements/${encodeURIComponent(n)}/resolve`,Ks=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-creation-tasks/${encodeURIComponent(t)}`,Ws=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-creation-decisions/${encodeURIComponent(t)}`,Vs="agent.asset.manage",qs=/^[A-Za-z0-9_-]{1,64}$/,js="flow_create_authoring_task",gt="oneoff_getActionContext",ft="oneoff_executeAction",Js=[gt,ft],Xs=["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"],Ys="AGENT_ASSET_NOT_FOUND",zs="AGENT_ASSET_VALIDATION_FAILED",Qs="AGENT_PROMPT_TARGET_NOT_FOUND",Zs="AGENT_PROMPT_ACTIVE_REVISION_MISSING",ea="AGENT_PROMPT_REVISION_NOT_FOUND",ta="AGENT_PROMPT_REVISION_NOT_DRAFT",na="AGENT_PROMPT_VALIDATION_FAILED",ra="AGENT_MODEL_INPUT_TARGET_PROTECTED",oa="AGENT_MODEL_INPUT_PREVIEW_UNAVAILABLE",ia="AGENT_FLOW_GOAL_INVALID",sa="AGENT_FLOW_CREATION_TASK_NOT_FOUND",aa="AGENT_FLOW_CREATION_TASK_CONFLICT",pa="AGENT_FLOW_AUTHORING_WORKFLOW_FAILED",ua="FLOW_WORKING_DRAFT_NOT_FOUND",la="FLOW_DRAFT_REVISION_CONFLICT",ca="FLOW_DRAFT_COMMAND_INVALID",da="FLOW_DRAFT_EDIT_LOCKED",ga="FLOW_EDIT_TURN_NOT_HELD",fa="FLOW_DRAFT_NOT_PUBLISHABLE",ma="FLOW_PUBLISH_CONFIRMATION_REQUIRED",Ra="FLOW_READINESS_REQUIREMENT_NOT_FOUND",_a="FLOW_READINESS_REQUIREMENT_CONFLICT",Ia="AGENT_ASSET_INDEX_FAILED";var Ta="/workspaces/:workspaceId/runs",xa="/workspaces/:workspaceId/flows/:flowId/runs",Ea="/:runId",wa="/:runId/cancel",Aa="/:runId/events",mt=e=>`/workspaces/${encodeURIComponent(e)}/runs`,le=(e,t)=>`${mt(e)}/${encodeURIComponent(t)}`,ka=(e,t)=>`${le(e,t)}/cancel`,Sa=(e,t)=>`${le(e,t)}/events`,ha=(e,t)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/runs`,Pa=["queued","running","succeeded","failed","interrupted","cancelled"],Oa=["succeeded","skipped","timed_out","failed"];var Ca="/workspaces/:workspaceId/inbox/items",Da="/workspaces/:workspaceId/inbox/entries",ce="/inbox/entries",ba="/:itemId",Fa="/:entryId",va="/:entryId/human-input/submit",Rt=e=>`/workspaces/${encodeURIComponent(e)}/inbox/items`,Ua=(e,t)=>`${Rt(e)}/${encodeURIComponent(t)}`,_t=e=>`/workspaces/${encodeURIComponent(e)}/inbox/entries`,It=(e,t)=>`${_t(e)}/${encodeURIComponent(t)}`,La=(e,t)=>`${It(e,t)}/human-input/submit`,Ba=()=>ce,yt=e=>`${ce}/${encodeURIComponent(e)}`,Ga=e=>`${yt(e)}/human-input/submit`;var Ma="/human-input/tokens",$a="/:token",Ka="/:token/submit",Tt=e=>`/human-input/tokens/${encodeURIComponent(e)}`,Wa=e=>`${Tt(e)}/submit`;var qa="/:flowId/trigger-instances",ja="/:flowId/triggers/:triggerBindingId/simulate",Ja=(e,t)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/trigger-instances`,Xa=(e,t,n)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/triggers/${encodeURIComponent(n)}/simulate`;export{Y as AGENT_ASSETS_ROUTE_PREFIX,gs as AGENT_ASSET_FLOW_SCENES_SUBPATH,Rs as AGENT_ASSET_FLOW_SCENE_ACTIVATE_SUBPATH,fs as AGENT_ASSET_FLOW_SCENE_ITEM_SUBPATH,_s as AGENT_ASSET_FLOW_SCENE_REINDEX_SUBPATH,ms as AGENT_ASSET_FLOW_SCENE_VALIDATE_SUBPATH,Is as AGENT_ASSET_FLOW_TEMPLATES_SUBPATH,xs as AGENT_ASSET_FLOW_TEMPLATE_ACTIVATE_SUBPATH,ys as AGENT_ASSET_FLOW_TEMPLATE_ITEM_SUBPATH,Es as AGENT_ASSET_FLOW_TEMPLATE_REINDEX_SUBPATH,Ts as AGENT_ASSET_FLOW_TEMPLATE_VALIDATE_SUBPATH,Ia as AGENT_ASSET_INDEX_FAILED_ERROR_CODE,Vs as AGENT_ASSET_MANAGE_PERMISSION,ds as AGENT_ASSET_MODEL_INPUT_SNAPSHOTS_SUBPATH,ls as AGENT_ASSET_MODEL_INPUT_TARGETS_SUBPATH,cs as AGENT_ASSET_MODEL_INPUT_TARGET_PREVIEW_SUBPATH,Ys as AGENT_ASSET_NOT_FOUND_ERROR_CODE,ss as AGENT_ASSET_PROMPTS_SUBPATH,us as AGENT_ASSET_PROMPT_ACTIVATE_SUBPATH,as as AGENT_ASSET_PROMPT_ITEM_SUBPATH,ps as AGENT_ASSET_PROMPT_VALIDATE_SUBPATH,zs as AGENT_ASSET_VALIDATION_FAILED_ERROR_CODE,qi as AGENT_CAPABILITY_FLOW_AUTHORING,Ui as AGENT_CHAT_ROUTE_SUBPATH,js as AGENT_CREATE_FLOW_AUTHORING_TASK_TOOL_NAME,pa as AGENT_FLOW_AUTHORING_WORKFLOW_FAILED_ERROR_CODE,Li as AGENT_FLOW_CONTEXT_ROUTE_SUBPATH,Ds as AGENT_FLOW_CREATION_DECISION_ITEM_SUBPATH,aa as AGENT_FLOW_CREATION_TASK_CONFLICT_ERROR_CODE,Cs as AGENT_FLOW_CREATION_TASK_ITEM_SUBPATH,sa as AGENT_FLOW_CREATION_TASK_NOT_FOUND_ERROR_CODE,ia as AGENT_FLOW_GOAL_INVALID_ERROR_CODE,Ns as AGENT_FLOW_READINESS_REQUIREMENT_RESOLVE_SUBPATH,ks as AGENT_FLOW_WORKING_DRAFT_COMMANDS_SUBPATH,Ss as AGENT_FLOW_WORKING_DRAFT_EDIT_TURN_ACQUIRE_SUBPATH,hs as AGENT_FLOW_WORKING_DRAFT_EDIT_TURN_RELEASE_SUBPATH,As as AGENT_FLOW_WORKING_DRAFT_ITEM_SUBPATH,ws as AGENT_FLOW_WORKING_DRAFT_OPEN_SUBPATH,Ps as AGENT_FLOW_WORKING_DRAFT_PUBLISH_SUBPATH,Os as AGENT_FLOW_WORKING_DRAFT_READINESS_CHECK_SUBPATH,os as AGENT_MESSAGE_DELTA_INVALID_ERROR_CODE,oa as AGENT_MODEL_INPUT_PREVIEW_UNAVAILABLE_ERROR_CODE,Xs as AGENT_MODEL_INPUT_TARGET_KEYS,ra as AGENT_MODEL_INPUT_TARGET_PROTECTED_ERROR_CODE,is as AGENT_PAGE_CONTEXT_INVALID_ERROR_CODE,Xi as AGENT_PAGE_CONTEXT_MAX_RESOURCES,Yi as AGENT_PAGE_CONTEXT_RESOURCE_ID_MAX_LENGTH,Ji as AGENT_PAGE_CONTEXT_ROUTE_ID_MAX_LENGTH,ji as AGENT_PAGE_RESOURCE_TYPES,Zs as AGENT_PROMPT_ACTIVE_REVISION_MISSING_ERROR_CODE,ta as AGENT_PROMPT_REVISION_NOT_DRAFT_ERROR_CODE,ea as AGENT_PROMPT_REVISION_NOT_FOUND_ERROR_CODE,Qs as AGENT_PROMPT_TARGET_NOT_FOUND_ERROR_CODE,na as AGENT_PROMPT_VALIDATION_FAILED_ERROR_CODE,vi as AGENT_ROUTE_PREFIX,ns as AGENT_RUNTIME_FAILED_ERROR_CODE,qs as AGENT_RUNTIME_TOOL_NAME_PATTERN,ts as AGENT_RUNTIME_UNCONFIGURED_ERROR_CODE,Bi as AGENT_SESSIONS_ROUTE_SUBPATH,Vi as AGENT_SESSION_DETAIL_MESSAGE_LIMIT,Gi as AGENT_SESSION_ITEM_ROUTE_SUBPATH,Ki as AGENT_SESSION_LIST_DEFAULT_LIMIT,Wi as AGENT_SESSION_LIST_MAX_LIMIT,rs as AGENT_SESSION_NOT_FOUND_ERROR_CODE,J as API_KEYS_ROUTE_PREFIX,at as API_KEY_GRANT_OPTIONS_ROUTE_SUBPATH,Ho as API_KEY_ITEM_ROUTE_SUBPATH,Mo as API_KEY_TOKEN_PREFIX,$o as API_KEY_WORKSPACE_FULL_ACCESS_SCOPE,it as APP_BOOTSTRAP_ROUTE_PATH,Yo as CATALOG_DEFAULT_PROVIDER_APP_CONFIG_ROUTE_SUBPATH,jo as CATALOG_INTEGRATIONS_ROUTE_SUBPATH,Jo as CATALOG_INTEGRATION_DETAIL_ROUTE_SUBPATH,X as CATALOG_ROUTE_PREFIX,Xo as CATALOG_VERSIONS_ROUTE_SUBPATH,ai as CONNECTIONS_ROUTE_SUBPATH,di as CONNECTION_DISCONNECT_ROUTE_SUBPATH,ci as CONNECT_COMPLETE_ROUTE_SUBPATH,ui as CONNECT_OPTIONS_ROUTE_SUBPATH,pi as CONNECT_START_ROUTE_SUBPATH,li as CONNECT_SUBMIT_ROUTE_SUBPATH,ht as CONTEXT_STATE_CLEANUP_ROUTE_PATH,Oo as CURRENT_USER_ROUTE_PATH,st as DEFAULT_WORKSPACE_ROUTE_PATH,ot as DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES,Ro as DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES,mo as DEPLOYMENT_HANDSHAKE_ROUTE,Qn as EGRESS_GRANT_AUDIT_ROUTE_SUBPATH,zn as EGRESS_GRANT_CONSUME_ROUTE_SUBPATH,Ue as EGRESS_GRANT_SCOPE_KINDS,Mt as EVENT_WAIT_ROUTE_SUBPATH,bt as EXECUTION_CONTEXT_ROUTE_SUBPATH,Hr as FILE_ACCESS_ROUTE_SUBPATH,Gr as FILE_COMPLETE_ROUTE_SUBPATH,$r as FILE_CONTENT_ROUTE_SUBPATH,Mr as FILE_STAT_ROUTE_SUBPATH,Br as FILE_UPLOAD_SESSION_ROUTE_SUBPATH,Qi as FLOW_AUTHORING_EDIT_TOOL_NAMES,dt as FLOW_AUTHORING_TOOL_DESCRIPTORS,zi as FLOW_AUTHORING_TOOL_NAMES,ki as FLOW_DISABLE_ROUTE_SUBPATH,ca as FLOW_DRAFT_COMMAND_INVALID_ERROR_CODE,da as FLOW_DRAFT_EDIT_LOCKED_ERROR_CODE,fa as FLOW_DRAFT_NOT_PUBLISHABLE_ERROR_CODE,la as FLOW_DRAFT_REVISION_CONFLICT_ERROR_CODE,Si as FLOW_DRAFT_ROUTE_SUBPATH,ga as FLOW_EDIT_TURN_NOT_HELD_ERROR_CODE,Ai as FLOW_ENABLE_ROUTE_SUBPATH,ge as FLOW_INTERPRETER_CONTRACT_VERSION,Et as FLOW_IR_SCHEMA_VERSION,wi as FLOW_ITEM_ROUTE_SUBPATH,ma as FLOW_PUBLISH_CONFIRMATION_REQUIRED_ERROR_CODE,_a as FLOW_READINESS_REQUIREMENT_CONFLICT_ERROR_CODE,Ra as FLOW_READINESS_REQUIREMENT_NOT_FOUND_ERROR_CODE,jn as FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH,Ht as FLOW_RUN_RESULT_ROUTE_SUBPATH,yr as FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Pa as FLOW_RUN_STATUSES,Ei as FLOW_VALIDATE_ROUTE_SUBPATH,hi as FLOW_VERSIONS_ROUTE_SUBPATH,Pi as FLOW_VERSION_ITEM_ROUTE_SUBPATH,ua as FLOW_WORKING_DRAFT_NOT_FOUND_ERROR_CODE,ce as GLOBAL_INBOX_ENTRIES_ROUTE_PREFIX,Zt as HANDLER_BUNDLES_ROUTE_SUBPATH,Eo as HANDSHAKE_CAPABILITY_MISSING,To as HANDSHAKE_CONTRACT_VERSION_MISMATCH,xo as HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH,_o as HANDSHAKE_REQUEST_INVALID,yo as HANDSHAKE_SECRET_MISMATCH,Io as HANDSHAKE_SECRET_UNCONFIGURED,Zr as HUMAN_INPUTS_ROUTE_SUBPATH,no as HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH,to as HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH,eo as HUMAN_INPUT_REQUEST_ROUTE_SUBPATH,Ye as HUMAN_INPUT_RESOLVED_EVENT_PREFIX,Ma as HUMAN_INPUT_TOKENS_ROUTE_PREFIX,$a as HUMAN_INPUT_TOKEN_ROUTE_SUBPATH,Ka as HUMAN_INPUT_TOKEN_SUBMIT_ROUTE_SUBPATH,va as INBOX_ENTRY_HUMAN_INPUT_SUBMIT_ROUTE_SUBPATH,Fa as INBOX_ENTRY_ROUTE_SUBPATH,ba as INBOX_ITEM_ROUTE_SUBPATH,ni as INTEGRATION_ITEM_ROUTE_SUBPATH,ri 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,$ as INTERNAL_INSTALLATIONS_ROUTE_PREFIX,P as INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX,V as INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX,S as INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX,ft as ONE_OFF_EXECUTE_ACTION_TOOL_NAME,gt as ONE_OFF_GET_ACTION_CONTEXT_TOOL_NAME,Js as ONE_OFF_TOOL_NAMES,So as PLATFORM_ACCESS_PERMISSION,ho as PLATFORM_API_KEY_MANAGE_PERMISSION,bn as POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH,Xn as POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,Fn as POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,xr as POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,vn as POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH,gi as PROVIDER_CALLBACK_REDIRECT_ROUTE_PATH,hr as RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS,wa as RUN_CANCEL_ROUTE_SUBPATH,Aa as RUN_EVENTS_ROUTE_SUBPATH,Ea as RUN_ITEM_ROUTE_SUBPATH,de as SERVER_CONTRACT_VERSION,Gt as STEP_RESULT_ROUTE_SUBPATH,Oa as STEP_RUN_STATUSES,en as TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH,Jn as TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH,Tr as TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,qa as TRIGGER_INSTANCES_ROUTE_SUBPATH,ja as TRIGGER_SIMULATE_ROUTE_SUBPATH,xn as WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH,wn as WEBHOOK_PROTOCOL_ADAPTER_MODULE,cn as WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH,gn as WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH,Yn as WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,fn as WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH,dn as WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,mn as WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH,Er as WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,lo as WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION,co as WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION,pe as WORKSPACES_ROUTE_PREFIX,vo as WORKSPACE_ACCESS_ROUTE_SUBPATH,si as WORKSPACE_CONNECTION_MOUNT_PREFIX,Me as WORKSPACE_FILES_ROUTE_PREFIX,xi as WORKSPACE_FLOWS_ROUTE_PREFIX,xa as WORKSPACE_FLOW_RUNS_ROUTE_PREFIX,Da as WORKSPACE_INBOX_ENTRIES_ROUTE_PREFIX,Ca as WORKSPACE_INBOX_ITEMS_ROUTE_PREFIX,ti as WORKSPACE_INTEGRATIONS_ROUTE_PREFIX,Fo as WORKSPACE_LIST_ROUTE_SUBPATH,Ta as WORKSPACE_RUNS_ROUTE_PREFIX,Fs as agentAssetFlowScenesPath,vs as agentAssetFlowTemplatesPath,bs as agentAssetPromptsPath,Hi as agentChatPath,Ws as agentFlowCreationDecisionPath,Ks as agentFlowCreationTaskPath,$s as agentFlowReadinessRequirementResolvePath,Ls as agentFlowWorkingDraftCommandsPath,Bs as agentFlowWorkingDraftEditTurnAcquirePath,Gs as agentFlowWorkingDraftEditTurnReleasePath,Us as agentFlowWorkingDraftOpenPath,A as agentFlowWorkingDraftPath,Hs as agentFlowWorkingDraftPublishPath,Ms as agentFlowWorkingDraftReadinessCheckPath,$i as agentSessionPath,Mi as agentSessionsPath,Wo as apiKeyGrantOptionsPath,Vo as apiKeyPath,Ko as apiKeysPath,Do as appBootstrapPath,Zo as catalogDefaultProviderAppConfigPath,pt as catalogIntegrationPath,zo as catalogIntegrationsPath,Qo as catalogVersionsPath,Ii as connectCompletePath,Ri as connectOptionsPath,mi as connectStartPath,_i as connectSubmitPath,yi as connectionDisconnectPath,r as contractParseFail,a as contractParseOk,No as currentUserPath,Bo as defaultWorkspacePath,wo as deploymentHandshakeProbePayload,Ao as deploymentHandshakeResponseProofPayload,or as egressGrantAuditPath,rr as egressGrantConsumePath,Wt as eventWaitPath,Ft as executionContextPath,es as findFlowAuthoringToolDescriptor,Ci as flowDisablePath,Di as flowDraftPath,Ni as flowEnablePath,L as flowPath,Zn as flowRunEgressGrantPath,Kt as flowRunResultPath,wr as flowRunRuntimeCredentialPath,ha as flowRunsPath,An as flowScriptProtocolAdapterModuleName,Oi as flowValidatePath,bi as flowVersionPath,ct as flowVersionsPath,Zi as formatFlowToolError,Ba as globalInboxEntriesPath,Ga as globalInboxEntryHumanInputSubmitPath,yt as globalInboxEntryPath,tn as handlerBundlesPath,oo as humanInputAcknowledgePath,ro as humanInputExpirePath,ie as humanInputRequestPath,io as humanInputResolvedEventType,Tt as humanInputTokenPath,Wa as humanInputTokenSubmitPath,Xe as humanInputsPath,La as inboxEntryHumanInputSubmitPath,It as inboxEntryPath,Ua as inboxItemPath,oi as installationToolsPath,qr as internalFileAccessPath,Vr as internalFileCompletePath,Jr as internalFileContentPath,jr as internalFileStatPath,Wr as internalFileUploadSessionPath,Kr as internalFilesPath,i as isJsonRecord,O as isValidRequestDigest,Yt as parseCompleteFlowRunWaitBody,Pt as parseContextStateCleanupRequestBody,Ot as parseContextStateCleanupResponseData,_ as parseContextStateScope,so as parseCreateHumanInputBody,lr as parseEgressGrantAuditBody,ur as parseEgressGrantConsumeBody,dr as parseEgressGrantConsumeData,cr as parseEgressGrantData,vt as parseExecutionContextData,j as parseFileAccessData,q as parseFileRefData,_e as parseFileRuntimeLimits,qe as parseFileUploadSessionData,ir as parseFlowActionGrantBody,jt as parseFlowRunResultBody,Jt as parseFlowRunResultData,Pr as parseFlowRuntimeCredentialBody,Ae as parseHandlerBundle,rn as parseHandlerBundlesData,po as parseHumanInputAcknowledgeData,ao as parseHumanInputCreateData,rt as parseHumanInputRequestViewData,Xr as parseInternalFileAccessData,Hn as parsePollingPublishBody,Nr as parsePollingRuntimeCredentialBody,Gn as parsePollingTriggerContext,ar as parsePollingTriggerGrantBody,Mn as parsePublishPollingTickEventsData,Xt as parseRegisterFlowRunWaitBody,zt as parseRegisterFlowRunWaitData,Dr as parseRuntimeCredentialSessionCredential,D as parseRuntimeNetwork,sr as parseSingleToolGrantBody,Or as parseSingleToolRuntimeCredentialBody,Vt as parseStepRecordBody,qt as parseStepRecordData,on as parseToolHandlerBundlesData,hn as parseTriggerHandlerBundlesData,Sn as parseWebhookDelivery,Pn as parseWebhookPublishEventsBody,On as parseWebhookRearmBody,Cr as parseWebhookRuntimeCredentialBody,pr as parseWebhookTriggerGrantBody,kn as parseWebhookWatcherContext,Un as pollingTriggerContextPath,tr as pollingTriggerEgressGrantPath,Ln as pollingTriggerHandlerBundlesPath,kr as pollingTriggerRuntimeCredentialPath,Bn as pollingTriggerTickEventsPath,Be as requestHasMultipartFileParts,ka as runCancelPath,Sa as runEventsPath,le as runPath,$t as stepResultPath,nn as toolHandlerBundlesPath,er as toolInvocationEgressGrantPath,Ar as toolInvocationRuntimeCredentialPath,Ja as triggerInstancesPath,Xa as triggerSimulatePath,En as webhookProtocolAdapterBundlePath,Rn as webhookTriggerContextPath,In as webhookTriggerDeliveryPath,nr as webhookTriggerEgressGrantPath,yn as webhookTriggerEventsPath,_n as webhookTriggerHandlerBundlesPath,Tn as webhookTriggerRearmPath,Sr as webhookTriggerRuntimeCredentialPath,go as wfpUserRuntimeManifestPath,fi as workspaceConnectionsPath,Ve as workspaceFileAccessPath,Ke as workspaceFileCompletePath,We as workspaceFileMetadataPath,$e as workspaceFileUploadSessionPath,ue as workspaceFlowsPath,_t as workspaceInboxEntriesPath,Rt as workspaceInboxItemsPath,lt as workspaceIntegrationPath,ut as workspaceIntegrationsPath,Uo as workspacePath,mt as workspaceRunsPath,Lo 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};
|