@ablehi/server-contract 0.2.0 → 0.2.2

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.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare const SERVER_CONTRACT_VERSION = "0.2.0";
1
+ declare const SERVER_CONTRACT_VERSION = "0.2.2";
2
2
  type ServerContractVersion = typeof SERVER_CONTRACT_VERSION;
3
3
 
4
4
  declare const FLOW_IR_SCHEMA_VERSION = "flow.ir.v1";
@@ -157,7 +157,7 @@ type FlowDefinition = {
157
157
  outputs?: Mapping;
158
158
  composition: FlowCompositionSpec;
159
159
  };
160
- type FlowIrValidationCode = "INVALID_IR_SHAPE" | "INVALID_NODE_ID" | "INVALID_TRIGGER_ID" | "INVALID_TRIGGER_KIND" | "INVALID_CRON" | "INVALID_NODE_KIND" | "MISSING_NODE_FIELD" | "INVALID_EVENT_TYPE" | "INVALID_DURATION" | "INVALID_RETRY" | "INVALID_HUMAN_INPUT" | "DUPLICATE_NODE_ID" | "DUPLICATE_TRIGGER_ID" | "DANGLING_DEPENDS_ON" | "DATA_REF_TARGET_MISSING" | "DATA_REF_TARGET_NO_OUTPUT" | "DATA_REF_FORWARD_REFERENCE" | "CYCLE_DETECTED" | "INVALID_ON_TIMEOUT_TARGET" | "INVALID_DSL_OPERATOR" | "INVALID_DSL_OPERAND" | "INVALID_DSL_ARITY" | "TRIGGER_REF_SCOPE_VIOLATION" | "NODE_REF_SCOPE_VIOLATION" | "HUMAN_INPUT_REF_SCOPE_VIOLATION" | "UNKNOWN_REF_ROOT" | "MALFORMED_TEMPLATE_REFERENCE";
160
+ type FlowIrValidationCode = "INVALID_IR_SHAPE" | "INVALID_NODE_ID" | "INVALID_TRIGGER_ID" | "INVALID_TRIGGER_KIND" | "INVALID_CRON" | "INVALID_NODE_KIND" | "MISSING_NODE_FIELD" | "INVALID_EVENT_TYPE" | "INVALID_DURATION" | "INVALID_RETRY" | "INVALID_HUMAN_INPUT" | "DUPLICATE_NODE_ID" | "DUPLICATE_TRIGGER_ID" | "DANGLING_DEPENDS_ON" | "DATA_REF_TARGET_MISSING" | "DATA_REF_TARGET_NO_OUTPUT" | "DATA_REF_FORWARD_REFERENCE" | "CYCLE_DETECTED" | "INVALID_ON_TIMEOUT_TARGET" | "INVALID_DSL_OPERATOR" | "INVALID_DSL_OPERAND" | "INVALID_DSL_ARITY" | "TRIGGER_REF_SCOPE_VIOLATION" | "NODE_REF_SCOPE_VIOLATION" | "HUMAN_INPUT_REF_SCOPE_VIOLATION" | "NOW_REF_SCOPE_VIOLATION" | "UNKNOWN_REF_ROOT" | "MALFORMED_TEMPLATE_REFERENCE" | "MALFORMED_NOW_EXPR";
161
161
  type FlowIrValidationIssue = {
162
162
  code: FlowIrValidationCode;
163
163
  message: string;
package/dist/edge.js CHANGED
@@ -1 +1 @@
1
- var J="0.2.0";var Ce="flow.ir.v1";var X="flow.interp.v2";function a(e){return{ok:!0,value:e}}function o(e){return{ok:!1,reason:e}}function i(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var f="/internal/flow-runs",Fe="/:flowRunId/execution-context";function Ge(e){return`${f}/${encodeURIComponent(e)}/execution-context`}function Y(e){return!i(e)||!C(e.fileMaxBytes)||!C(e.fileReadMaxBytes)||!C(e.inlineMultipartBytesMax)?o("file runtime limits must carry three positive integer bounds"):a({fileMaxBytes:e.fileMaxBytes,fileReadMaxBytes:e.fileReadMaxBytes,inlineMultipartBytesMax:e.inlineMultipartBytesMax})}function Le(e){if(!i(e))return o("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)||!Q(e.executionBindings))return o("execution context surface shape is invalid");let n=z(e.fileRuntime);return n.ok?a({...e,fileRuntime:n.value}):o(n.reason)}function z(e){if(e===null)return a(null);if(!i(e))return o("fileRuntime must be null or an object");let t=Y(e.limits);return t.ok?a({limits:t.value}):o(t.reason)}function Q(e){return Array.isArray(e)?e.every(t=>{if(!i(t))return!1;let n=t.connection;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"}):!1}function C(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var We="/:flowRunId/steps/:nodeId/result",Ve="/:flowRunId/result",qe="/:flowRunId/event-waits/:nodeId";function je(e,t){return`${f}/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}/result`}function Je(e){return`${f}/${encodeURIComponent(e)}/result`}function Xe(e,t){return`${f}/${encodeURIComponent(e)}/event-waits/${encodeURIComponent(t)}`}function Ye(e){if(!i(e))return{ok:!1,kind:"validation",reason:"step record body must be a JSON object"};let t=R(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 r=Z(e.result);if(!r.ok)return r;let s={attempt:n,result:r.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 Z(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=R(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=R(e,["status","errorCode","issues"]);if(n!==void 0)return{ok:!1,kind:"validation",reason:`step record result does not accept the "${n}" field`};let r=e.errorCode;if(typeof r!="string"||r.length===0)return{ok:!1,kind:"step_result_invalid",reason:"a failed result must carry a non-empty errorCode"};let s={status:"failed",errorCode:r};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 ze(e){return!i(e)||typeof e.flowRunId!="string"||typeof e.nodeId!="string"||e.recorded!=="succeeded"&&e.recorded!=="failed"?o("step record data surface shape is invalid"):a({flowRunId:e.flowRunId,nodeId:e.nodeId,recorded:e.recorded})}function Qe(e){if(!i(e))return o("result body must be a JSON object");let t=R(e,["status","output","error","composition"]);if(t!==void 0)return o(`result does not accept the "${t}" field`);let n=e.status;if(n!=="succeeded"&&n!=="failed")return o('result status must be "succeeded" or "failed"');let r={status:n};if(e.output!==void 0&&(r.output=e.output),e.error!==void 0){let s=e.error;if(!i(s))return o("result error must be a JSON object");let u=R(s,["code","message"]);if(u!==void 0)return o(`result error does not accept the "${u}" field`);if(typeof s.code!="string"||typeof s.message!="string")return o("result error must carry string code and message");r.error={code:s.code,message:s.message}}if(e.composition!==void 0){if(n!=="succeeded")return o("composition is only allowed on a succeeded result");r.composition=e.composition}return a(r)}function Ze(e){return i(e)?a(e):o("flow run result data must be a JSON object")}var ee=/^[A-Za-z0-9_-]{1,100}$/;function et(e){if(!i(e))return o("register body must be a JSON object");let t=R(e,["eventType","correlationKey"]);if(t!==void 0)return o(`register wait does not accept the "${t}" field`);let n=F(e.eventType);if(!n.ok)return o(n.reason);let r=e.correlationKey;return typeof r!="string"||r.length===0?o("correlationKey must be a non-empty string"):a({eventType:n.value,correlationKey:r})}function tt(e){if(!i(e))return o("complete body must be a JSON object");let t=R(e,["eventType","correlationKey","outcome","eventId"]);if(t!==void 0)return o(`complete wait does not accept the "${t}" field`);let n=e.outcome;if(n!=="received"&&n!=="timed_out")return o('outcome must be "received" or "timed_out"');let r=F(e.eventType);if(!r.ok)return o(r.reason);let s=e.correlationKey;if(typeof s!="string"||s.length===0)return o("correlationKey must be a non-empty string");let u={eventType:r.value,correlationKey:s,outcome:n};if(e.eventId!==void 0){if(typeof e.eventId!="string"||e.eventId.length===0)return o("eventId must be a non-empty string");u.eventId=e.eventId}return a(u)}function nt(e){return!i(e)||e.registered!==!0?o("register wait data surface shape is invalid"):a({registered:!0})}function F(e){return typeof e!="string"||e.length===0?o("eventType must be a non-empty string"):ee.test(e)?a(e):o("eventType must match ^[A-Za-z0-9_-]{1,100}$")}function R(e,t){return Object.keys(e).find(n=>!t.includes(n))}var te="/internal/flow-versions",ot="/:flowVersionId/handler-bundles",B="/internal/installations",it="/:installationId/handler-bundles";function st(e,t){return`${te}/${encodeURIComponent(e)}/handler-bundles?compiledArtifactId=${encodeURIComponent(t)}`}function ut(e){return`${B}/${encodeURIComponent(e.installationId)}/handler-bundles?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var ne=new Set(["managed_only","managed_plus_unmanaged_sdk"]);function w(e){if(!y(e))return D("runtimeNetwork must be a JSON object");let t=e.networkModel;return typeof t!="string"||!ne.has(t)?D("runtimeNetwork.networkModel is unknown"):!G(e.apiHosts)||!G(e.authHosts)||typeof e.httpsOnly!="boolean"?D("runtimeNetwork host/https fields are invalid"):{ok:!0,value:{networkModel:t,apiHosts:e.apiHosts,authHosts:e.authHosts,httpsOnly:e.httpsOnly}}}function at(e){if(!y(e)||typeof e.flowVersionId!="string"||typeof e.compiledArtifactId!="string"||!Array.isArray(e.bundles))return _("handler bundles data surface shape is invalid");let t=L(e.bundles);return t.ok?{ok:!0,value:{flowVersionId:e.flowVersionId,compiledArtifactId:e.compiledArtifactId,bundles:t.value}}:t}function dt(e){if(!y(e)||typeof e.installationId!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.bundles))return _("tool handler bundles data surface shape is invalid");let t=L(e.bundles);return t.ok?{ok:!0,value:{installationId:e.installationId,artifactDigest:e.artifactDigest,bundles:t.value}}:t}function L(e){let t=[];for(let n of e){let r=re(n);if(!r.ok)return r;t.push(r.value)}return{ok:!0,value:t}}function re(e){if(!y(e)||typeof e.toolRef!="string"||e.kind!=="handler"&&e.kind!=="request")return _("handler bundle entry shape is invalid");if(e.kind==="request"){if(e.module!==void 0)return _("a request bundle must not carry a module");let r=w(e.runtimeNetwork);return r.ok?{ok:!0,value:{toolRef:e.toolRef,kind:"request",runtimeNetwork:r.value}}:r}let t=e.module;if(!y(t)||typeof t.entry!="string"||t.entry.length===0||!oe(t.files))return _("a handler bundle must carry a { entry, files } module");let n=w(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 _(e){return{ok:!1,kind:"shape",reason:e}}function D(e){return{ok:!1,kind:"runtime_network",reason:e}}function y(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function G(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function oe(e){return y(e)&&Object.values(e).every(t=>typeof t=="string")}var E="/internal/webhook-trigger-instances",ft="/:triggerInstanceId/context",mt="/:triggerInstanceId/handler-bundles",Rt="/:triggerInstanceId/deliveries/:deliveryId",yt="/:triggerInstanceId/events",It="/:triggerInstanceId/rearm",kt="/:triggerInstanceId/store/:namespace/:key",I=e=>`${E}/${encodeURIComponent(e)}`;function _t(e,t){return`${I(e)}/context?artifactDigest=${encodeURIComponent(t)}`}function Et(e,t){return`${I(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function Tt(e,t){return`${I(e)}/deliveries/${encodeURIComponent(t)}`}function xt(e){return`${I(e)}/events`}function ht(e){return`${I(e)}/rearm`}function wt(e,t,n){return`${I(e)}/store/${encodeURIComponent(t)}/${encodeURIComponent(n)}`}var Pt="/:installationId/webhook-protocol-adapter-bundle";function Nt(e){return`${B}/${encodeURIComponent(e.installationId)}/webhook-protocol-adapter-bundle?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var bt="modules/webhook/protocol-adapter.js";function At(e){return`modules/webhook/protocol-adapter-${e}.js`}function St(e){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)||!se(e.runtime)?o("webhook watcher 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 se(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 vt(e){if(!i(e)||typeof e.deliveryId!="string"||typeof e.receivedAt!="string"||!i(e.request))return o("webhook delivery surface shape is invalid");let t=e.request;return t.method!=="POST"||!i(t.headers)||typeof t.rawBody!="string"?o("webhook delivery request shape is invalid"):a(e)}function Ot(e){if(!i(e)||typeof e.triggerRef!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.modules)||!e.modules.every(ue))return{ok:!1,kind:"shape",reason:"trigger handler bundles data surface shape is invalid"};let t=w(e.runtimeNetwork);return t.ok?{ok:!0,value:{triggerRef:e.triggerRef,artifactDigest:e.artifactDigest,modules:e.modules,runtimeNetwork:t.value}}:t}function ue(e){return i(e)&&typeof e.specifier=="string"&&e.specifier.length>0&&typeof e.source=="string"}function ae(e){return!i(e)||!("value"in e)?o("webhook store get surface shape is invalid"):a(e.value)}function Ct(e){if(!i(e))return o("publish events body must be a JSON object");let t=P(e,["deliveryId","events"]);if(t!==void 0)return o(`publish events does not accept the "${t}" field`);let n=e.deliveryId;if(typeof n!="string"||n.length===0)return o("deliveryId must be a non-empty string");let r=e.events;if(!Array.isArray(r))return o("events must be an array");let s=[];for(let u of r){let d=de(u);if(!d.ok)return d;s.push(d.value)}return a({deliveryId:n,events:s})}function de(e){if(!i(e))return o("each event must be a JSON object");let t=P(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return o(`event does not accept the "${t}" field`);let n=e.eventId;if(typeof n!="string"||n.length===0)return o("eventId must be a non-empty string");let r=e.occurredAt;if(typeof r!="string"||r.length===0)return o("occurredAt must be a non-empty string");if(!i(e.payload))return o("event payload must be a JSON object");let s={eventId:n,occurredAt:r,payload:e.payload};if(e.dedupeKey!==void 0){if(typeof e.dedupeKey!="string"||e.dedupeKey.length===0)return o("dedupeKey must be a non-empty string");s.dedupeKey=e.dedupeKey}return a(s)}function Dt(e){if(!i(e))return o("rearm body must be a JSON object");let t=P(e,["expectedWatcherInstanceId"]);if(t!==void 0)return o(`rearm does not accept the "${t}" field`);let n=e.expectedWatcherInstanceId;return typeof n!="string"||n.length===0?o("expectedWatcherInstanceId must be a non-empty string"):a({expectedWatcherInstanceId:n})}function le(e){if(!i(e))return o("store body must be a JSON object");let t=P(e,["value"]);return t!==void 0?o(`store put does not accept the "${t}" field`):"value"in e?a({value:e.value}):o("store put requires a value field")}function P(e,t){return Object.keys(e).find(n=>!t.includes(n))}var T="/internal/polling-trigger-instances",Ut="/:pollingInstanceId/context",Ft="/:pollingInstanceId/handler-bundles",Gt="/:pollingInstanceId/ticks/:tickId/events",Lt="/:pollingInstanceId/store/:namespace/:key",N=e=>`${T}/${encodeURIComponent(e)}`;function Mt(e,t,n){return`${N(e)}/context?artifactDigest=${encodeURIComponent(t)}&tickId=${encodeURIComponent(n)}`}function $t(e,t){return`${N(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function Kt(e,t){return`${N(e)}/ticks/${encodeURIComponent(t)}/events`}function Wt(e,t,n){return`${N(e)}/store/${encodeURIComponent(t)}/${encodeURIComponent(n)}`}function Vt(e){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&&!pe(e.connection)||!ce(e.runtime)||!ge(e.tick)||!fe(e.limits)?o("polling trigger context surface shape is invalid"):a(e)}function pe(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 r=t.dedup;return i(r)&&(r.strategy==="cursor"||r.strategy==="hash"||r.strategy==="id_field")}function ge(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 qt(e){if(!i(e))return o("publish body must be a JSON object");let t=M(e,["events","nextCursor"]);if(t!==void 0)return o(`publish does not accept the "${t}" field`);let n=e.events;if(!Array.isArray(n))return o("events must be an array");let r=[];for(let u of n){let d=me(u);if(!d.ok)return d;r.push(d.value)}let s={events:r};if("nextCursor"in e){let u=e.nextCursor;if(u!==null&&typeof u!="string")return o("nextCursor must be a string, null, or omitted");s.nextCursor=u}return a(s)}function me(e){if(!i(e))return o("each event must be a JSON object");let t=M(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return o(`event does not accept the "${t}" field`);if(typeof e.eventId!="string"||e.eventId.length===0)return o("event eventId must be a non-empty string");if(!i(e.payload))return o("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 o("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 o("event dedupeKey must be a non-empty string");n.dedupeKey=e.dedupeKey}return a(n)}function jt(e){return!i(e)||typeof e.tickId!="string"||typeof e.cursorUpdated!="boolean"||!Array.isArray(e.results)||!e.results.every(Re)?o("publish polling tick events data surface shape is invalid"):a(e)}function Re(e){return i(e)&&typeof e.eventId=="string"&&typeof e.dedupeKey=="string"&&typeof e.duplicate=="boolean"&&(e.flowRunId===null||typeof e.flowRunId=="string")}function M(e,t){return Object.keys(e).find(n=>!t.includes(n))}var $="/internal/egress-grants",H="/internal/tool-invocations",en="/:flowRunId/egress-grant",tn="/:invocationId/egress-grant",nn="/:pollingInstanceId/egress-grant",rn="/:triggerInstanceId/egress-grant",on="/:grantId/consume",sn="/:grantId/audit",un=e=>`${f}/${encodeURIComponent(e)}/egress-grant`,an=e=>`${H}/${encodeURIComponent(e)}/egress-grant`,dn=e=>`${T}/${encodeURIComponent(e)}/egress-grant`,ln=e=>`${E}/${encodeURIComponent(e)}/egress-grant`,pn=e=>`${$}/${encodeURIComponent(e)}/consume`,cn=e=>`${$}/${encodeURIComponent(e)}/audit`,ye=["flow_action","single_tool","polling_trigger","webhook_trigger"],Ie=/^[A-Za-z0-9][A-Za-z0-9:_+/=.-]{15,1023}$/;function x(e){return typeof e=="string"&&Ie.test(e)}function ke(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(r=>i(r)?r.kind==="file"&&typeof r.file_id=="string"&&r.file_id.length>0:!1):!1}function l(e){return{ok:!1,kind:"shape",reason:e}}function h(){return{ok:!1,kind:"request_digest",reason:"request digest is missing or malformed"}}function A(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 S(e){if(!i(e))return"request must be a JSON object"}function gn(e){let t=A(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 r=S(t.record.request);if(r!==void 0)return l(r);let s=t.record.requestDigest;return x(s)?{ok:!0,value:{nodeId:n,requestDigest:s,requestHasMultipartFiles:ke(t.record.request)}}:h()}function fn(e){let t=A(e,["request","requestDigest"]);if(!t.ok)return l(t.reason);let n=S(t.record.request);if(n!==void 0)return l(n);let r=t.record.requestDigest;return x(r)?{ok:!0,value:{requestDigest:r}}:h()}function mn(e){let t=A(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 r=S(t.record.request);if(r!==void 0)return l(r);let s=t.record.requestDigest;return x(s)?{ok:!0,value:{tickId:n,requestDigest:s}}:h()}function Rn(e){let t=A(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 r=t.record.lifecycle,s;if(r!==void 0){if(r!=="enable"&&r!=="disable"&&r!=="renew")return l('lifecycle must be "enable", "disable", or "renew"');s=r}if(n==="lifecycle"&&s===void 0)return l("lifecycle is required for the lifecycle phase");let u=S(t.record.request);if(u!==void 0)return l(u);let d=t.record.requestDigest;return x(d)?{ok:!0,value:{phase:n,...s!==void 0?{lifecycle:s}:{},requestDigest:d}}:h()}function K(e){return ye.includes(e)?e:void 0}var _e=["scopeKind","scopeId","requestDigest"];function yn(e){if(!i(e))return l("consume body must be a JSON object");for(let s of Object.keys(e))if(!_e.includes(s))return l(`consume does not accept the "${s}" field`);let t=K(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 r=e.requestDigest;return x(r)?{ok:!0,value:{scopeKind:t,scopeId:n,requestDigest:r}}:h()}var Ee=["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 In(e){if(!i(e))return l("audit body must be a JSON object");for(let c of Object.keys(e))if(!Ee.includes(c))return l(`audit does not accept the "${c}" field`);let t=K(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 r=e.providerHost;if(typeof r!="string"||r.length===0)return l("providerHost is required");let s=b(e.durationMs,"durationMs");if(!s.ok)return l(s.reason);let u;if(e.status!==void 0){let c=b(e.status,"status");if(!c.ok)return l(c.reason);u=c.value}let d;if(e.requestBytes!==void 0){let c=b(e.requestBytes,"requestBytes");if(!c.ok)return l(c.reason);d=c.value}let p;if(e.responseBytes!==void 0){let c=b(e.responseBytes,"responseBytes");if(!c.ok)return l(c.reason);p=c.value}let O;if(e.errorCode!==void 0){let c=e.errorCode;if(typeof c!="string"||c.length===0)return l("errorCode must be a non-empty string");O=c}return{ok:!0,value:{scopeKind:t,scopeId:n,providerHost:r,...u!==void 0?{status:u}:{},durationMs:s.value,...d!==void 0?{requestBytes:d}:{},...p!==void 0?{responseBytes:p}:{},...O!==void 0?{errorCode:O}:{}}}}function kn(e){return!i(e)||!i(e.grant)?o("egress grant envelope must carry a grant object"):a(e.grant)}function _n(e){return!i(e)||e.consumed!==!0?o("egress grant consume data must carry consumed:true"):a({consumed:!0})}var Nn="/:flowRunId/runtime-credential",bn="/:invocationId/runtime-credential",An="/:pollingInstanceId/runtime-credential",Sn="/:triggerInstanceId/runtime-credential",vn=e=>`${f}/${encodeURIComponent(e)}/runtime-credential`,On=e=>`${H}/${encodeURIComponent(e)}/runtime-credential`,Cn=e=>`${T}/${encodeURIComponent(e)}/runtime-credential`,Dn=e=>`${E}/${encodeURIComponent(e)}/runtime-credential`,Bn=["flow_action","tool_invoke","polling_trigger","webhook_trigger"];function v(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 Hn(e){let t=v(e,["nodeId"]);if(!t.ok)return o(t.reason);let n=t.record.nodeId;return typeof n!="string"||n.length===0?o("nodeId is required"):a({nodeId:n})}function Un(e){let t=v(e??{},[]);return t.ok?a(null):o(t.reason)}function Fn(e){let t=v(e,["tickId"]);if(!t.ok)return o(t.reason);let n=t.record.tickId;return typeof n!="string"||n.length===0?o("tickId is required"):a({tickId:n})}function Gn(e){let t=v(e,["executionKind","deliveryId","lifecycleOperation"]);if(!t.ok)return o(t.reason);let n=t.record.executionKind;if(n!=="event_handler"&&n!=="lifecycle")return o('executionKind must be "event_handler" or "lifecycle"');let r,s=t.record.deliveryId;if(s!==void 0){if(typeof s!="string"||s.length===0)return o("deliveryId must be a non-empty string");r=s}let u,d=t.record.lifecycleOperation;if(d!==void 0){if(d!=="enable"&&d!=="disable"&&d!=="renew")return o('lifecycleOperation must be "enable", "disable", or "renew"');u=d}return n==="lifecycle"&&u===void 0?o("lifecycleOperation is required for the lifecycle execution kind"):a({executionKind:n,...r!==void 0?{deliveryId:r}:{},...u!==void 0?{lifecycleOperation:u}:{}})}function Ln(e){return!i(e)||typeof e.sessionId!="string"||typeof e.connectionId!="string"||!i(e.credential)?o("runtime credential session must carry sessionId, connectionId and a credential object"):a(e.credential)}var U="/internal/files",Kn="/:fileId/stat",Wn="/:fileId/content",Vn=()=>U,W=e=>`?scope_kind=${encodeURIComponent(e.scopeKind)}&scope_id=${encodeURIComponent(e.scopeId)}`,qn=(e,t)=>`${U}/${encodeURIComponent(e)}/stat${W(t)}`,jn=(e,t)=>`${U}/${encodeURIComponent(e)}/content${W(t)}`;function Jn(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"?o("file ref data does not match the AIS file-ref shape"):a(e)}var Qn="/:flowRunId/human-inputs",Zn="/:flowRunId/human-inputs/:requestId",er="/:flowRunId/human-inputs/:requestId/expire",tr="/:flowRunId/human-inputs/:requestId/acknowledge",Te=e=>`${f}/${encodeURIComponent(e)}/human-inputs`,V=(e,t)=>`${Te(e)}/${encodeURIComponent(t)}`,nr=(e,t)=>`${V(e,t)}/expire`,rr=(e,t)=>`${V(e,t)}/acknowledge`,xe="human_input_resolved";function or(e){return`${xe}_${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 k(e,t){return typeof e!="string"||e.length===0?g(`${t} must be a non-empty string`):{ok:!0,value:e}}var he=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})$/;function we(e,t){return typeof e!="string"||!he.test(e)||Number.isNaN(Date.parse(e))?g(`${t} must be an ISO-8601 timestamp`):{ok:!0,value:e}}function Pe(e){let t=m(e,"renderedPrompt");if(!t.ok)return t;let n=k(t.value.title,"renderedPrompt.title");if(!n.ok)return n;let r={title:n.value};if(t.value.body!==void 0){if(typeof t.value.body!="string")return g("renderedPrompt.body must be a string");r.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");r.format=t.value.format}return{ok:!0,value:r}}function Ne(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 be(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 r=[];for(let s of n){let u=m(s,"delivery action");if(!u.ok)return u;let d=k(u.value.id,"delivery action id");if(!d.ok)return d;let p=q(u.value.inputs,`delivery action '${d.value}' inputs`);if(!p.ok)return p;r.push({id:d.value,inputs:p.value})}return{ok:!0,value:{actions:r}}}function q(e,t){let n=m(e,t);if(!n.ok)return n;let r={};for(let[s,u]of Object.entries(n.value)){let d=j(u,`${t}.${s}`);if(!d.ok)return d;r[s]=d.value}return{ok:!0,value:r}}function j(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=k(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,d]of n.value.items.entries()){let p=j(d,`${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,d]of n.value.parts.entries()){let p=Ae(d,`${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 Ae(e,t){let n=m(e,t);if(!n.ok)return n;let r=n.value.kind;if(r==="literal")return typeof n.value.value!="string"?g(`${t}.value must be a string`):{ok:!0,value:{kind:"literal",value:n.value.value}};if(r==="human_input_ref"){let s=k(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 ir(e){let t=m(e,"request body");if(!t.ok)return o(t.reason);let n=k(t.value.nodeId,"nodeId");if(!n.ok)return o(n.reason);let r=Pe(t.value.renderedPrompt);if(!r.ok)return o(r.reason);let s=Ne(t.value.input);if(!s.ok)return o(s.reason);let u=k(t.value.timeout,"timeout");if(!u.ok)return o(u.reason);let d=we(t.value.expiresAt,"expiresAt");if(!d.ok)return o(d.reason);let p=be(t.value.partiallyRenderedDelivery);return p.ok?a({nodeId:n.value,renderedPrompt:r.value,input:s.value,timeout:u.value,expiresAt:d.value,...p.value!==void 0?{partiallyRenderedDelivery:p.value}:{}}):o(p.reason)}function Se(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))?o("human input request view must carry id, nodeId, status and output"):a(e)}function sr(e){if(!i(e)||typeof e.created!="boolean")return o("human input create data must carry created:boolean");let t=Se(e.request);return t.ok?a({created:e.created,request:t.value}):t}function ur(e){return!i(e)||e.acknowledged!==!0?o("human input acknowledge data must carry acknowledged:true"):a({acknowledged:!0})}var dr="ablehi-wfp-user-runtime-manifest/v1",lr="unknown";function pr(e){return e.endsWith(".js")?`${e.slice(0,-3)}.manifest.json`:`${e}.manifest.json`}var gr="/internal/deployment-handshake",ve=["start","terminate","send-event","start-webhook-watcher","run-polling-tick","invoke-tool","invoke-trigger-handler","invoke-webhook-protocol-adapter","deployment-handshake"],fr=ve,mr="HANDSHAKE_REQUEST_INVALID",Rr="HANDSHAKE_SECRET_UNCONFIGURED",yr="HANDSHAKE_SECRET_MISMATCH",Ir="HANDSHAKE_CONTRACT_VERSION_MISMATCH",kr="HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH",_r="HANDSHAKE_CAPABILITY_MISSING";function Er(e){return[e.nonce,e.timestamp,e.contractVersion,e.dispatchNamespace].map(n=>`${n.length}:${n}`).join(".")}function Tr(e){return["response",e.nonce,e.contractVersion,e.dispatchNamespace,...e.capabilities].map(n=>`${n.length}:${n}`).join(".")}export{ve as DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES,fr as DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES,gr as DEPLOYMENT_HANDSHAKE_ROUTE,sn as EGRESS_GRANT_AUDIT_ROUTE_SUBPATH,on as EGRESS_GRANT_CONSUME_ROUTE_SUBPATH,ye as EGRESS_GRANT_SCOPE_KINDS,qe as EVENT_WAIT_ROUTE_SUBPATH,Fe as EXECUTION_CONTEXT_ROUTE_SUBPATH,Wn as FILE_CONTENT_ROUTE_SUBPATH,Kn as FILE_STAT_ROUTE_SUBPATH,X as FLOW_INTERPRETER_CONTRACT_VERSION,Ce as FLOW_IR_SCHEMA_VERSION,en as FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH,Ve as FLOW_RUN_RESULT_ROUTE_SUBPATH,Nn as FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,ot as HANDLER_BUNDLES_ROUTE_SUBPATH,_r as HANDSHAKE_CAPABILITY_MISSING,Ir as HANDSHAKE_CONTRACT_VERSION_MISMATCH,kr as HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH,mr as HANDSHAKE_REQUEST_INVALID,yr as HANDSHAKE_SECRET_MISMATCH,Rr as HANDSHAKE_SECRET_UNCONFIGURED,Qn as HUMAN_INPUTS_ROUTE_SUBPATH,tr as HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH,er as HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH,Zn as HUMAN_INPUT_REQUEST_ROUTE_SUBPATH,xe as HUMAN_INPUT_RESOLVED_EVENT_PREFIX,$ as INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX,U as INTERNAL_FILES_ROUTE_PREFIX,f as INTERNAL_FLOW_RUNS_ROUTE_PREFIX,te as INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX,B as INTERNAL_INSTALLATIONS_ROUTE_PREFIX,T as INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX,H as INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX,E as INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX,Ut as POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH,nn as POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,Ft as POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,An as POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Lt as POLLING_TRIGGER_STORE_ROUTE_SUBPATH,Gt as POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH,Bn as RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS,J as SERVER_CONTRACT_VERSION,We as STEP_RESULT_ROUTE_SUBPATH,it as TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH,tn as TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH,bn as TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Pt as WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH,bt as WEBHOOK_PROTOCOL_ADAPTER_MODULE,ft as WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH,Rt as WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH,rn as WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,yt as WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH,mt as WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,It as WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH,Sn as WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,kt as WEBHOOK_TRIGGER_STORE_ROUTE_SUBPATH,dr as WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION,lr as WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION,o as contractParseFail,a as contractParseOk,Er as deploymentHandshakeProbePayload,Tr as deploymentHandshakeResponseProofPayload,cn as egressGrantAuditPath,pn as egressGrantConsumePath,Xe as eventWaitPath,Ge as executionContextPath,un as flowRunEgressGrantPath,Je as flowRunResultPath,vn as flowRunRuntimeCredentialPath,At as flowScriptProtocolAdapterModuleName,st as handlerBundlesPath,rr as humanInputAcknowledgePath,nr as humanInputExpirePath,V as humanInputRequestPath,or as humanInputResolvedEventType,Te as humanInputsPath,jn as internalFileContentPath,qn as internalFileStatPath,Vn as internalFilesPath,i as isJsonRecord,x as isValidRequestDigest,tt as parseCompleteFlowRunWaitBody,ir as parseCreateHumanInputBody,In as parseEgressGrantAuditBody,yn as parseEgressGrantConsumeBody,_n as parseEgressGrantConsumeData,kn as parseEgressGrantData,Le as parseExecutionContextData,Jn as parseFileRefData,Y as parseFileRuntimeLimits,gn as parseFlowActionGrantBody,Qe as parseFlowRunResultBody,Ze as parseFlowRunResultData,Hn as parseFlowRuntimeCredentialBody,re as parseHandlerBundle,at as parseHandlerBundlesData,ur as parseHumanInputAcknowledgeData,sr as parseHumanInputCreateData,Se as parseHumanInputRequestViewData,qt as parsePollingPublishBody,Fn as parsePollingRuntimeCredentialBody,le as parsePollingStorePutBody,ae as parsePollingStoreValue,Vt as parsePollingTriggerContext,mn as parsePollingTriggerGrantBody,jt as parsePublishPollingTickEventsData,et as parseRegisterFlowRunWaitBody,nt as parseRegisterFlowRunWaitData,Ln as parseRuntimeCredentialSessionCredential,w as parseRuntimeNetwork,fn as parseSingleToolGrantBody,Un as parseSingleToolRuntimeCredentialBody,Ye as parseStepRecordBody,ze as parseStepRecordData,dt as parseToolHandlerBundlesData,Ot as parseTriggerHandlerBundlesData,vt as parseWebhookDelivery,Ct as parseWebhookPublishEventsBody,Dt as parseWebhookRearmBody,Gn as parseWebhookRuntimeCredentialBody,le as parseWebhookStorePutBody,ae as parseWebhookStoreValue,Rn as parseWebhookTriggerGrantBody,St as parseWebhookWatcherContext,Mt as pollingTriggerContextPath,dn as pollingTriggerEgressGrantPath,$t as pollingTriggerHandlerBundlesPath,Cn as pollingTriggerRuntimeCredentialPath,Wt as pollingTriggerStorePath,Kt as pollingTriggerTickEventsPath,ke as requestHasMultipartFileParts,je as stepResultPath,ut as toolHandlerBundlesPath,an as toolInvocationEgressGrantPath,On as toolInvocationRuntimeCredentialPath,Nt as webhookProtocolAdapterBundlePath,_t as webhookTriggerContextPath,Tt as webhookTriggerDeliveryPath,ln as webhookTriggerEgressGrantPath,xt as webhookTriggerEventsPath,Et as webhookTriggerHandlerBundlesPath,ht as webhookTriggerRearmPath,Dn as webhookTriggerRuntimeCredentialPath,wt as webhookTriggerStorePath,pr as wfpUserRuntimeManifestPath};
1
+ var J="0.2.2";var Ce="flow.ir.v1";var X="flow.interp.v2";function a(e){return{ok:!0,value:e}}function o(e){return{ok:!1,reason:e}}function i(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var f="/internal/flow-runs",Fe="/:flowRunId/execution-context";function Ge(e){return`${f}/${encodeURIComponent(e)}/execution-context`}function Y(e){return!i(e)||!C(e.fileMaxBytes)||!C(e.fileReadMaxBytes)||!C(e.inlineMultipartBytesMax)?o("file runtime limits must carry three positive integer bounds"):a({fileMaxBytes:e.fileMaxBytes,fileReadMaxBytes:e.fileReadMaxBytes,inlineMultipartBytesMax:e.inlineMultipartBytesMax})}function Le(e){if(!i(e))return o("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)||!Q(e.executionBindings))return o("execution context surface shape is invalid");let n=z(e.fileRuntime);return n.ok?a({...e,fileRuntime:n.value}):o(n.reason)}function z(e){if(e===null)return a(null);if(!i(e))return o("fileRuntime must be null or an object");let t=Y(e.limits);return t.ok?a({limits:t.value}):o(t.reason)}function Q(e){return Array.isArray(e)?e.every(t=>{if(!i(t))return!1;let n=t.connection;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"}):!1}function C(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var We="/:flowRunId/steps/:nodeId/result",Ve="/:flowRunId/result",qe="/:flowRunId/event-waits/:nodeId";function je(e,t){return`${f}/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}/result`}function Je(e){return`${f}/${encodeURIComponent(e)}/result`}function Xe(e,t){return`${f}/${encodeURIComponent(e)}/event-waits/${encodeURIComponent(t)}`}function Ye(e){if(!i(e))return{ok:!1,kind:"validation",reason:"step record body must be a JSON object"};let t=R(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 r=Z(e.result);if(!r.ok)return r;let s={attempt:n,result:r.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 Z(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=R(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=R(e,["status","errorCode","issues"]);if(n!==void 0)return{ok:!1,kind:"validation",reason:`step record result does not accept the "${n}" field`};let r=e.errorCode;if(typeof r!="string"||r.length===0)return{ok:!1,kind:"step_result_invalid",reason:"a failed result must carry a non-empty errorCode"};let s={status:"failed",errorCode:r};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 ze(e){return!i(e)||typeof e.flowRunId!="string"||typeof e.nodeId!="string"||e.recorded!=="succeeded"&&e.recorded!=="failed"?o("step record data surface shape is invalid"):a({flowRunId:e.flowRunId,nodeId:e.nodeId,recorded:e.recorded})}function Qe(e){if(!i(e))return o("result body must be a JSON object");let t=R(e,["status","output","error","composition"]);if(t!==void 0)return o(`result does not accept the "${t}" field`);let n=e.status;if(n!=="succeeded"&&n!=="failed")return o('result status must be "succeeded" or "failed"');let r={status:n};if(e.output!==void 0&&(r.output=e.output),e.error!==void 0){let s=e.error;if(!i(s))return o("result error must be a JSON object");let u=R(s,["code","message"]);if(u!==void 0)return o(`result error does not accept the "${u}" field`);if(typeof s.code!="string"||typeof s.message!="string")return o("result error must carry string code and message");r.error={code:s.code,message:s.message}}if(e.composition!==void 0){if(n!=="succeeded")return o("composition is only allowed on a succeeded result");r.composition=e.composition}return a(r)}function Ze(e){return i(e)?a(e):o("flow run result data must be a JSON object")}var ee=/^[A-Za-z0-9_-]{1,100}$/;function et(e){if(!i(e))return o("register body must be a JSON object");let t=R(e,["eventType","correlationKey"]);if(t!==void 0)return o(`register wait does not accept the "${t}" field`);let n=F(e.eventType);if(!n.ok)return o(n.reason);let r=e.correlationKey;return typeof r!="string"||r.length===0?o("correlationKey must be a non-empty string"):a({eventType:n.value,correlationKey:r})}function tt(e){if(!i(e))return o("complete body must be a JSON object");let t=R(e,["eventType","correlationKey","outcome","eventId"]);if(t!==void 0)return o(`complete wait does not accept the "${t}" field`);let n=e.outcome;if(n!=="received"&&n!=="timed_out")return o('outcome must be "received" or "timed_out"');let r=F(e.eventType);if(!r.ok)return o(r.reason);let s=e.correlationKey;if(typeof s!="string"||s.length===0)return o("correlationKey must be a non-empty string");let u={eventType:r.value,correlationKey:s,outcome:n};if(e.eventId!==void 0){if(typeof e.eventId!="string"||e.eventId.length===0)return o("eventId must be a non-empty string");u.eventId=e.eventId}return a(u)}function nt(e){return!i(e)||e.registered!==!0?o("register wait data surface shape is invalid"):a({registered:!0})}function F(e){return typeof e!="string"||e.length===0?o("eventType must be a non-empty string"):ee.test(e)?a(e):o("eventType must match ^[A-Za-z0-9_-]{1,100}$")}function R(e,t){return Object.keys(e).find(n=>!t.includes(n))}var te="/internal/flow-versions",ot="/:flowVersionId/handler-bundles",B="/internal/installations",it="/:installationId/handler-bundles";function st(e,t){return`${te}/${encodeURIComponent(e)}/handler-bundles?compiledArtifactId=${encodeURIComponent(t)}`}function ut(e){return`${B}/${encodeURIComponent(e.installationId)}/handler-bundles?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var ne=new Set(["managed_only","managed_plus_unmanaged_sdk"]);function w(e){if(!y(e))return D("runtimeNetwork must be a JSON object");let t=e.networkModel;return typeof t!="string"||!ne.has(t)?D("runtimeNetwork.networkModel is unknown"):!G(e.apiHosts)||!G(e.authHosts)||typeof e.httpsOnly!="boolean"?D("runtimeNetwork host/https fields are invalid"):{ok:!0,value:{networkModel:t,apiHosts:e.apiHosts,authHosts:e.authHosts,httpsOnly:e.httpsOnly}}}function at(e){if(!y(e)||typeof e.flowVersionId!="string"||typeof e.compiledArtifactId!="string"||!Array.isArray(e.bundles))return _("handler bundles data surface shape is invalid");let t=L(e.bundles);return t.ok?{ok:!0,value:{flowVersionId:e.flowVersionId,compiledArtifactId:e.compiledArtifactId,bundles:t.value}}:t}function dt(e){if(!y(e)||typeof e.installationId!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.bundles))return _("tool handler bundles data surface shape is invalid");let t=L(e.bundles);return t.ok?{ok:!0,value:{installationId:e.installationId,artifactDigest:e.artifactDigest,bundles:t.value}}:t}function L(e){let t=[];for(let n of e){let r=re(n);if(!r.ok)return r;t.push(r.value)}return{ok:!0,value:t}}function re(e){if(!y(e)||typeof e.toolRef!="string"||e.kind!=="handler"&&e.kind!=="request")return _("handler bundle entry shape is invalid");if(e.kind==="request"){if(e.module!==void 0)return _("a request bundle must not carry a module");let r=w(e.runtimeNetwork);return r.ok?{ok:!0,value:{toolRef:e.toolRef,kind:"request",runtimeNetwork:r.value}}:r}let t=e.module;if(!y(t)||typeof t.entry!="string"||t.entry.length===0||!oe(t.files))return _("a handler bundle must carry a { entry, files } module");let n=w(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 _(e){return{ok:!1,kind:"shape",reason:e}}function D(e){return{ok:!1,kind:"runtime_network",reason:e}}function y(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function G(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function oe(e){return y(e)&&Object.values(e).every(t=>typeof t=="string")}var E="/internal/webhook-trigger-instances",ft="/:triggerInstanceId/context",mt="/:triggerInstanceId/handler-bundles",Rt="/:triggerInstanceId/deliveries/:deliveryId",yt="/:triggerInstanceId/events",It="/:triggerInstanceId/rearm",kt="/:triggerInstanceId/store/:namespace/:key",I=e=>`${E}/${encodeURIComponent(e)}`;function _t(e,t){return`${I(e)}/context?artifactDigest=${encodeURIComponent(t)}`}function Et(e,t){return`${I(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function Tt(e,t){return`${I(e)}/deliveries/${encodeURIComponent(t)}`}function xt(e){return`${I(e)}/events`}function ht(e){return`${I(e)}/rearm`}function wt(e,t,n){return`${I(e)}/store/${encodeURIComponent(t)}/${encodeURIComponent(n)}`}var Pt="/:installationId/webhook-protocol-adapter-bundle";function Nt(e){return`${B}/${encodeURIComponent(e.installationId)}/webhook-protocol-adapter-bundle?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var At="modules/webhook/protocol-adapter.js";function bt(e){return`modules/webhook/protocol-adapter-${e}.js`}function St(e){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)||!se(e.runtime)?o("webhook watcher 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 se(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 vt(e){if(!i(e)||typeof e.deliveryId!="string"||typeof e.receivedAt!="string"||!i(e.request))return o("webhook delivery surface shape is invalid");let t=e.request;return t.method!=="POST"||!i(t.headers)||typeof t.rawBody!="string"?o("webhook delivery request shape is invalid"):a(e)}function Ot(e){if(!i(e)||typeof e.triggerRef!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.modules)||!e.modules.every(ue))return{ok:!1,kind:"shape",reason:"trigger handler bundles data surface shape is invalid"};let t=w(e.runtimeNetwork);return t.ok?{ok:!0,value:{triggerRef:e.triggerRef,artifactDigest:e.artifactDigest,modules:e.modules,runtimeNetwork:t.value}}:t}function ue(e){return i(e)&&typeof e.specifier=="string"&&e.specifier.length>0&&typeof e.source=="string"}function ae(e){return!i(e)||!("value"in e)?o("webhook store get surface shape is invalid"):a(e.value)}function Ct(e){if(!i(e))return o("publish events body must be a JSON object");let t=P(e,["deliveryId","events"]);if(t!==void 0)return o(`publish events does not accept the "${t}" field`);let n=e.deliveryId;if(typeof n!="string"||n.length===0)return o("deliveryId must be a non-empty string");let r=e.events;if(!Array.isArray(r))return o("events must be an array");let s=[];for(let u of r){let d=de(u);if(!d.ok)return d;s.push(d.value)}return a({deliveryId:n,events:s})}function de(e){if(!i(e))return o("each event must be a JSON object");let t=P(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return o(`event does not accept the "${t}" field`);let n=e.eventId;if(typeof n!="string"||n.length===0)return o("eventId must be a non-empty string");let r=e.occurredAt;if(typeof r!="string"||r.length===0)return o("occurredAt must be a non-empty string");if(!i(e.payload))return o("event payload must be a JSON object");let s={eventId:n,occurredAt:r,payload:e.payload};if(e.dedupeKey!==void 0){if(typeof e.dedupeKey!="string"||e.dedupeKey.length===0)return o("dedupeKey must be a non-empty string");s.dedupeKey=e.dedupeKey}return a(s)}function Dt(e){if(!i(e))return o("rearm body must be a JSON object");let t=P(e,["expectedWatcherInstanceId"]);if(t!==void 0)return o(`rearm does not accept the "${t}" field`);let n=e.expectedWatcherInstanceId;return typeof n!="string"||n.length===0?o("expectedWatcherInstanceId must be a non-empty string"):a({expectedWatcherInstanceId:n})}function le(e){if(!i(e))return o("store body must be a JSON object");let t=P(e,["value"]);return t!==void 0?o(`store put does not accept the "${t}" field`):"value"in e?a({value:e.value}):o("store put requires a value field")}function P(e,t){return Object.keys(e).find(n=>!t.includes(n))}var T="/internal/polling-trigger-instances",Ut="/:pollingInstanceId/context",Ft="/:pollingInstanceId/handler-bundles",Gt="/:pollingInstanceId/ticks/:tickId/events",Lt="/:pollingInstanceId/store/:namespace/:key",N=e=>`${T}/${encodeURIComponent(e)}`;function Mt(e,t,n){return`${N(e)}/context?artifactDigest=${encodeURIComponent(t)}&tickId=${encodeURIComponent(n)}`}function $t(e,t){return`${N(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function Kt(e,t){return`${N(e)}/ticks/${encodeURIComponent(t)}/events`}function Wt(e,t,n){return`${N(e)}/store/${encodeURIComponent(t)}/${encodeURIComponent(n)}`}function Vt(e){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&&!pe(e.connection)||!ce(e.runtime)||!ge(e.tick)||!fe(e.limits)?o("polling trigger context surface shape is invalid"):a(e)}function pe(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 r=t.dedup;return i(r)&&(r.strategy==="cursor"||r.strategy==="hash"||r.strategy==="id_field")}function ge(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 qt(e){if(!i(e))return o("publish body must be a JSON object");let t=M(e,["events","nextCursor"]);if(t!==void 0)return o(`publish does not accept the "${t}" field`);let n=e.events;if(!Array.isArray(n))return o("events must be an array");let r=[];for(let u of n){let d=me(u);if(!d.ok)return d;r.push(d.value)}let s={events:r};if("nextCursor"in e){let u=e.nextCursor;if(u!==null&&typeof u!="string")return o("nextCursor must be a string, null, or omitted");s.nextCursor=u}return a(s)}function me(e){if(!i(e))return o("each event must be a JSON object");let t=M(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return o(`event does not accept the "${t}" field`);if(typeof e.eventId!="string"||e.eventId.length===0)return o("event eventId must be a non-empty string");if(!i(e.payload))return o("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 o("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 o("event dedupeKey must be a non-empty string");n.dedupeKey=e.dedupeKey}return a(n)}function jt(e){return!i(e)||typeof e.tickId!="string"||typeof e.cursorUpdated!="boolean"||!Array.isArray(e.results)||!e.results.every(Re)?o("publish polling tick events data surface shape is invalid"):a(e)}function Re(e){return i(e)&&typeof e.eventId=="string"&&typeof e.dedupeKey=="string"&&typeof e.duplicate=="boolean"&&(e.flowRunId===null||typeof e.flowRunId=="string")}function M(e,t){return Object.keys(e).find(n=>!t.includes(n))}var $="/internal/egress-grants",H="/internal/tool-invocations",en="/:flowRunId/egress-grant",tn="/:invocationId/egress-grant",nn="/:pollingInstanceId/egress-grant",rn="/:triggerInstanceId/egress-grant",on="/:grantId/consume",sn="/:grantId/audit",un=e=>`${f}/${encodeURIComponent(e)}/egress-grant`,an=e=>`${H}/${encodeURIComponent(e)}/egress-grant`,dn=e=>`${T}/${encodeURIComponent(e)}/egress-grant`,ln=e=>`${E}/${encodeURIComponent(e)}/egress-grant`,pn=e=>`${$}/${encodeURIComponent(e)}/consume`,cn=e=>`${$}/${encodeURIComponent(e)}/audit`,ye=["flow_action","single_tool","polling_trigger","webhook_trigger"],Ie=/^[A-Za-z0-9][A-Za-z0-9:_+/=.-]{15,1023}$/;function x(e){return typeof e=="string"&&Ie.test(e)}function ke(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(r=>i(r)?r.kind==="file"&&typeof r.file_id=="string"&&r.file_id.length>0:!1):!1}function l(e){return{ok:!1,kind:"shape",reason:e}}function h(){return{ok:!1,kind:"request_digest",reason:"request digest is missing or malformed"}}function b(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 S(e){if(!i(e))return"request must be a JSON object"}function gn(e){let t=b(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 r=S(t.record.request);if(r!==void 0)return l(r);let s=t.record.requestDigest;return x(s)?{ok:!0,value:{nodeId:n,requestDigest:s,requestHasMultipartFiles:ke(t.record.request)}}:h()}function fn(e){let t=b(e,["request","requestDigest"]);if(!t.ok)return l(t.reason);let n=S(t.record.request);if(n!==void 0)return l(n);let r=t.record.requestDigest;return x(r)?{ok:!0,value:{requestDigest:r}}:h()}function mn(e){let t=b(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 r=S(t.record.request);if(r!==void 0)return l(r);let s=t.record.requestDigest;return x(s)?{ok:!0,value:{tickId:n,requestDigest:s}}:h()}function Rn(e){let t=b(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 r=t.record.lifecycle,s;if(r!==void 0){if(r!=="enable"&&r!=="disable"&&r!=="renew")return l('lifecycle must be "enable", "disable", or "renew"');s=r}if(n==="lifecycle"&&s===void 0)return l("lifecycle is required for the lifecycle phase");let u=S(t.record.request);if(u!==void 0)return l(u);let d=t.record.requestDigest;return x(d)?{ok:!0,value:{phase:n,...s!==void 0?{lifecycle:s}:{},requestDigest:d}}:h()}function K(e){return ye.includes(e)?e:void 0}var _e=["scopeKind","scopeId","requestDigest"];function yn(e){if(!i(e))return l("consume body must be a JSON object");for(let s of Object.keys(e))if(!_e.includes(s))return l(`consume does not accept the "${s}" field`);let t=K(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 r=e.requestDigest;return x(r)?{ok:!0,value:{scopeKind:t,scopeId:n,requestDigest:r}}:h()}var Ee=["scopeKind","scopeId","providerHost","status","durationMs","requestBytes","responseBytes","errorCode"];function A(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 In(e){if(!i(e))return l("audit body must be a JSON object");for(let c of Object.keys(e))if(!Ee.includes(c))return l(`audit does not accept the "${c}" field`);let t=K(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 r=e.providerHost;if(typeof r!="string"||r.length===0)return l("providerHost is required");let s=A(e.durationMs,"durationMs");if(!s.ok)return l(s.reason);let u;if(e.status!==void 0){let c=A(e.status,"status");if(!c.ok)return l(c.reason);u=c.value}let d;if(e.requestBytes!==void 0){let c=A(e.requestBytes,"requestBytes");if(!c.ok)return l(c.reason);d=c.value}let p;if(e.responseBytes!==void 0){let c=A(e.responseBytes,"responseBytes");if(!c.ok)return l(c.reason);p=c.value}let O;if(e.errorCode!==void 0){let c=e.errorCode;if(typeof c!="string"||c.length===0)return l("errorCode must be a non-empty string");O=c}return{ok:!0,value:{scopeKind:t,scopeId:n,providerHost:r,...u!==void 0?{status:u}:{},durationMs:s.value,...d!==void 0?{requestBytes:d}:{},...p!==void 0?{responseBytes:p}:{},...O!==void 0?{errorCode:O}:{}}}}function kn(e){return!i(e)||!i(e.grant)?o("egress grant envelope must carry a grant object"):a(e.grant)}function _n(e){return!i(e)||e.consumed!==!0?o("egress grant consume data must carry consumed:true"):a({consumed:!0})}var Nn="/:flowRunId/runtime-credential",An="/:invocationId/runtime-credential",bn="/:pollingInstanceId/runtime-credential",Sn="/:triggerInstanceId/runtime-credential",vn=e=>`${f}/${encodeURIComponent(e)}/runtime-credential`,On=e=>`${H}/${encodeURIComponent(e)}/runtime-credential`,Cn=e=>`${T}/${encodeURIComponent(e)}/runtime-credential`,Dn=e=>`${E}/${encodeURIComponent(e)}/runtime-credential`,Bn=["flow_action","tool_invoke","polling_trigger","webhook_trigger"];function v(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 Hn(e){let t=v(e,["nodeId"]);if(!t.ok)return o(t.reason);let n=t.record.nodeId;return typeof n!="string"||n.length===0?o("nodeId is required"):a({nodeId:n})}function Un(e){let t=v(e??{},[]);return t.ok?a(null):o(t.reason)}function Fn(e){let t=v(e,["tickId"]);if(!t.ok)return o(t.reason);let n=t.record.tickId;return typeof n!="string"||n.length===0?o("tickId is required"):a({tickId:n})}function Gn(e){let t=v(e,["executionKind","deliveryId","lifecycleOperation"]);if(!t.ok)return o(t.reason);let n=t.record.executionKind;if(n!=="event_handler"&&n!=="lifecycle")return o('executionKind must be "event_handler" or "lifecycle"');let r,s=t.record.deliveryId;if(s!==void 0){if(typeof s!="string"||s.length===0)return o("deliveryId must be a non-empty string");r=s}let u,d=t.record.lifecycleOperation;if(d!==void 0){if(d!=="enable"&&d!=="disable"&&d!=="renew")return o('lifecycleOperation must be "enable", "disable", or "renew"');u=d}return n==="lifecycle"&&u===void 0?o("lifecycleOperation is required for the lifecycle execution kind"):a({executionKind:n,...r!==void 0?{deliveryId:r}:{},...u!==void 0?{lifecycleOperation:u}:{}})}function Ln(e){return!i(e)||typeof e.sessionId!="string"||typeof e.connectionId!="string"||!i(e.credential)?o("runtime credential session must carry sessionId, connectionId and a credential object"):a(e.credential)}var U="/internal/files",Kn="/:fileId/stat",Wn="/:fileId/content",Vn=()=>U,W=e=>`?scope_kind=${encodeURIComponent(e.scopeKind)}&scope_id=${encodeURIComponent(e.scopeId)}`,qn=(e,t)=>`${U}/${encodeURIComponent(e)}/stat${W(t)}`,jn=(e,t)=>`${U}/${encodeURIComponent(e)}/content${W(t)}`;function Jn(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"?o("file ref data does not match the AIS file-ref shape"):a(e)}var Qn="/:flowRunId/human-inputs",Zn="/:flowRunId/human-inputs/:requestId",er="/:flowRunId/human-inputs/:requestId/expire",tr="/:flowRunId/human-inputs/:requestId/acknowledge",Te=e=>`${f}/${encodeURIComponent(e)}/human-inputs`,V=(e,t)=>`${Te(e)}/${encodeURIComponent(t)}`,nr=(e,t)=>`${V(e,t)}/expire`,rr=(e,t)=>`${V(e,t)}/acknowledge`,xe="human_input_resolved";function or(e){return`${xe}_${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 k(e,t){return typeof e!="string"||e.length===0?g(`${t} must be a non-empty string`):{ok:!0,value:e}}var he=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})$/;function we(e,t){return typeof e!="string"||!he.test(e)||Number.isNaN(Date.parse(e))?g(`${t} must be an ISO-8601 timestamp`):{ok:!0,value:e}}function Pe(e){let t=m(e,"renderedPrompt");if(!t.ok)return t;let n=k(t.value.title,"renderedPrompt.title");if(!n.ok)return n;let r={title:n.value};if(t.value.body!==void 0){if(typeof t.value.body!="string")return g("renderedPrompt.body must be a string");r.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");r.format=t.value.format}return{ok:!0,value:r}}function Ne(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 Ae(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 r=[];for(let s of n){let u=m(s,"delivery action");if(!u.ok)return u;let d=k(u.value.id,"delivery action id");if(!d.ok)return d;let p=q(u.value.inputs,`delivery action '${d.value}' inputs`);if(!p.ok)return p;r.push({id:d.value,inputs:p.value})}return{ok:!0,value:{actions:r}}}function q(e,t){let n=m(e,t);if(!n.ok)return n;let r={};for(let[s,u]of Object.entries(n.value)){let d=j(u,`${t}.${s}`);if(!d.ok)return d;r[s]=d.value}return{ok:!0,value:r}}function j(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=k(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,d]of n.value.items.entries()){let p=j(d,`${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,d]of n.value.parts.entries()){let p=be(d,`${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 be(e,t){let n=m(e,t);if(!n.ok)return n;let r=n.value.kind;if(r==="literal")return typeof n.value.value!="string"?g(`${t}.value must be a string`):{ok:!0,value:{kind:"literal",value:n.value.value}};if(r==="human_input_ref"){let s=k(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 ir(e){let t=m(e,"request body");if(!t.ok)return o(t.reason);let n=k(t.value.nodeId,"nodeId");if(!n.ok)return o(n.reason);let r=Pe(t.value.renderedPrompt);if(!r.ok)return o(r.reason);let s=Ne(t.value.input);if(!s.ok)return o(s.reason);let u=k(t.value.timeout,"timeout");if(!u.ok)return o(u.reason);let d=we(t.value.expiresAt,"expiresAt");if(!d.ok)return o(d.reason);let p=Ae(t.value.partiallyRenderedDelivery);return p.ok?a({nodeId:n.value,renderedPrompt:r.value,input:s.value,timeout:u.value,expiresAt:d.value,...p.value!==void 0?{partiallyRenderedDelivery:p.value}:{}}):o(p.reason)}function Se(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))?o("human input request view must carry id, nodeId, status and output"):a(e)}function sr(e){if(!i(e)||typeof e.created!="boolean")return o("human input create data must carry created:boolean");let t=Se(e.request);return t.ok?a({created:e.created,request:t.value}):t}function ur(e){return!i(e)||e.acknowledged!==!0?o("human input acknowledge data must carry acknowledged:true"):a({acknowledged:!0})}var dr="ablehi-wfp-user-runtime-manifest/v1",lr="unknown";function pr(e){return e.endsWith(".js")?`${e.slice(0,-3)}.manifest.json`:`${e}.manifest.json`}var gr="/internal/deployment-handshake",ve=["start","terminate","send-event","start-webhook-watcher","run-polling-tick","invoke-tool","invoke-trigger-handler","invoke-webhook-protocol-adapter","deployment-handshake"],fr=ve,mr="HANDSHAKE_REQUEST_INVALID",Rr="HANDSHAKE_SECRET_UNCONFIGURED",yr="HANDSHAKE_SECRET_MISMATCH",Ir="HANDSHAKE_CONTRACT_VERSION_MISMATCH",kr="HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH",_r="HANDSHAKE_CAPABILITY_MISSING";function Er(e){return[e.nonce,e.timestamp,e.contractVersion,e.dispatchNamespace].map(n=>`${n.length}:${n}`).join(".")}function Tr(e){return["response",e.nonce,e.contractVersion,e.dispatchNamespace,...e.capabilities].map(n=>`${n.length}:${n}`).join(".")}export{ve as DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES,fr as DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES,gr as DEPLOYMENT_HANDSHAKE_ROUTE,sn as EGRESS_GRANT_AUDIT_ROUTE_SUBPATH,on as EGRESS_GRANT_CONSUME_ROUTE_SUBPATH,ye as EGRESS_GRANT_SCOPE_KINDS,qe as EVENT_WAIT_ROUTE_SUBPATH,Fe as EXECUTION_CONTEXT_ROUTE_SUBPATH,Wn as FILE_CONTENT_ROUTE_SUBPATH,Kn as FILE_STAT_ROUTE_SUBPATH,X as FLOW_INTERPRETER_CONTRACT_VERSION,Ce as FLOW_IR_SCHEMA_VERSION,en as FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH,Ve as FLOW_RUN_RESULT_ROUTE_SUBPATH,Nn as FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,ot as HANDLER_BUNDLES_ROUTE_SUBPATH,_r as HANDSHAKE_CAPABILITY_MISSING,Ir as HANDSHAKE_CONTRACT_VERSION_MISMATCH,kr as HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH,mr as HANDSHAKE_REQUEST_INVALID,yr as HANDSHAKE_SECRET_MISMATCH,Rr as HANDSHAKE_SECRET_UNCONFIGURED,Qn as HUMAN_INPUTS_ROUTE_SUBPATH,tr as HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH,er as HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH,Zn as HUMAN_INPUT_REQUEST_ROUTE_SUBPATH,xe as HUMAN_INPUT_RESOLVED_EVENT_PREFIX,$ as INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX,U as INTERNAL_FILES_ROUTE_PREFIX,f as INTERNAL_FLOW_RUNS_ROUTE_PREFIX,te as INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX,B as INTERNAL_INSTALLATIONS_ROUTE_PREFIX,T as INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX,H as INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX,E as INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX,Ut as POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH,nn as POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,Ft as POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,bn as POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Lt as POLLING_TRIGGER_STORE_ROUTE_SUBPATH,Gt as POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH,Bn as RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS,J as SERVER_CONTRACT_VERSION,We as STEP_RESULT_ROUTE_SUBPATH,it as TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH,tn as TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH,An as TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Pt as WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH,At as WEBHOOK_PROTOCOL_ADAPTER_MODULE,ft as WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH,Rt as WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH,rn as WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,yt as WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH,mt as WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,It as WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH,Sn as WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,kt as WEBHOOK_TRIGGER_STORE_ROUTE_SUBPATH,dr as WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION,lr as WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION,o as contractParseFail,a as contractParseOk,Er as deploymentHandshakeProbePayload,Tr as deploymentHandshakeResponseProofPayload,cn as egressGrantAuditPath,pn as egressGrantConsumePath,Xe as eventWaitPath,Ge as executionContextPath,un as flowRunEgressGrantPath,Je as flowRunResultPath,vn as flowRunRuntimeCredentialPath,bt as flowScriptProtocolAdapterModuleName,st as handlerBundlesPath,rr as humanInputAcknowledgePath,nr as humanInputExpirePath,V as humanInputRequestPath,or as humanInputResolvedEventType,Te as humanInputsPath,jn as internalFileContentPath,qn as internalFileStatPath,Vn as internalFilesPath,i as isJsonRecord,x as isValidRequestDigest,tt as parseCompleteFlowRunWaitBody,ir as parseCreateHumanInputBody,In as parseEgressGrantAuditBody,yn as parseEgressGrantConsumeBody,_n as parseEgressGrantConsumeData,kn as parseEgressGrantData,Le as parseExecutionContextData,Jn as parseFileRefData,Y as parseFileRuntimeLimits,gn as parseFlowActionGrantBody,Qe as parseFlowRunResultBody,Ze as parseFlowRunResultData,Hn as parseFlowRuntimeCredentialBody,re as parseHandlerBundle,at as parseHandlerBundlesData,ur as parseHumanInputAcknowledgeData,sr as parseHumanInputCreateData,Se as parseHumanInputRequestViewData,qt as parsePollingPublishBody,Fn as parsePollingRuntimeCredentialBody,le as parsePollingStorePutBody,ae as parsePollingStoreValue,Vt as parsePollingTriggerContext,mn as parsePollingTriggerGrantBody,jt as parsePublishPollingTickEventsData,et as parseRegisterFlowRunWaitBody,nt as parseRegisterFlowRunWaitData,Ln as parseRuntimeCredentialSessionCredential,w as parseRuntimeNetwork,fn as parseSingleToolGrantBody,Un as parseSingleToolRuntimeCredentialBody,Ye as parseStepRecordBody,ze as parseStepRecordData,dt as parseToolHandlerBundlesData,Ot as parseTriggerHandlerBundlesData,vt as parseWebhookDelivery,Ct as parseWebhookPublishEventsBody,Dt as parseWebhookRearmBody,Gn as parseWebhookRuntimeCredentialBody,le as parseWebhookStorePutBody,ae as parseWebhookStoreValue,Rn as parseWebhookTriggerGrantBody,St as parseWebhookWatcherContext,Mt as pollingTriggerContextPath,dn as pollingTriggerEgressGrantPath,$t as pollingTriggerHandlerBundlesPath,Cn as pollingTriggerRuntimeCredentialPath,Wt as pollingTriggerStorePath,Kt as pollingTriggerTickEventsPath,ke as requestHasMultipartFileParts,je as stepResultPath,ut as toolHandlerBundlesPath,an as toolInvocationEgressGrantPath,On as toolInvocationRuntimeCredentialPath,Nt as webhookProtocolAdapterBundlePath,_t as webhookTriggerContextPath,Tt as webhookTriggerDeliveryPath,ln as webhookTriggerEgressGrantPath,xt as webhookTriggerEventsPath,Et as webhookTriggerHandlerBundlesPath,ht as webhookTriggerRearmPath,Dn as webhookTriggerRuntimeCredentialPath,wt as webhookTriggerStorePath,pr as wfpUserRuntimeManifestPath};
package/dist/index.d.ts CHANGED
@@ -759,12 +759,12 @@ declare const AGENT_MESSAGE_DELTA_INVALID_ERROR_CODE = "AGENT_MESSAGE_DELTA_INVA
759
759
  declare const AGENT_PAGE_CONTEXT_INVALID_ERROR_CODE = "AGENT_PAGE_CONTEXT_INVALID";
760
760
  declare const AGENT_ASSETS_ROUTE_PREFIX = "/agent/assets";
761
761
  declare const AGENT_ASSET_PROMPTS_SUBPATH = "/prompts";
762
- declare const AGENT_ASSET_PROMPT_ITEM_SUBPATH = "/prompts/:key/:revision";
763
- declare const AGENT_ASSET_PROMPT_VALIDATE_SUBPATH = "/prompts/:key/:revision/validate";
764
- declare const AGENT_ASSET_PROMPT_ACTIVATE_SUBPATH = "/prompts/:key/:revision/activate";
765
- declare const AGENT_ASSET_PROMPT_BINDINGS_SUBPATH = "/prompt-bindings";
766
- declare const AGENT_ASSET_PROMPT_BINDING_ITEM_SUBPATH = "/prompt-bindings/:id";
767
- declare const AGENT_ASSET_PROMPT_BINDING_VALIDATE_SUBPATH = "/prompt-bindings/:id/validate";
762
+ declare const AGENT_ASSET_PROMPT_ITEM_SUBPATH = "/prompts/:targetKey/:revision";
763
+ declare const AGENT_ASSET_PROMPT_VALIDATE_SUBPATH = "/prompts/:targetKey/:revision/validate";
764
+ declare const AGENT_ASSET_PROMPT_ACTIVATE_SUBPATH = "/prompts/:targetKey/:revision/activate";
765
+ declare const AGENT_ASSET_MODEL_INPUT_TARGETS_SUBPATH = "/model-input-targets";
766
+ declare const AGENT_ASSET_MODEL_INPUT_TARGET_PREVIEW_SUBPATH = "/model-input-targets/:targetKey/render-preview";
767
+ declare const AGENT_ASSET_MODEL_INPUT_SNAPSHOTS_SUBPATH = "/model-input-snapshots";
768
768
  declare const AGENT_ASSET_FLOW_SCENES_SUBPATH = "/flow-scenes";
769
769
  declare const AGENT_ASSET_FLOW_SCENE_ITEM_SUBPATH = "/flow-scenes/:sceneKey/:revision";
770
770
  declare const AGENT_ASSET_FLOW_SCENE_VALIDATE_SUBPATH = "/flow-scenes/:sceneKey/:revision/validate";
@@ -879,59 +879,81 @@ type AgentValidationIssue = {
879
879
  message: string;
880
880
  severity: "blocking" | "warning";
881
881
  };
882
- type AgentPromptSlot = "agent.global.system" | "agent.intent.flow_goal_spec" | "agent.one_off.runtime" | "agent.flow_authoring.runtime" | "workflow.flow_authoring.scene_fit_judge" | "workflow.flow_authoring.template_fit_judge" | "workflow.flow_authoring.fallback_plan" | "workflow.flow_authoring.brief_generation" | "tool.flow_authoring.validate_repair";
883
- declare const AGENT_PROMPT_SLOTS: readonly AgentPromptSlot[];
884
- type AgentPromptPurpose = "general_agent" | "one_off_execution" | "flow_goal_generation" | "flow_scene_fit_judge" | "flow_template_fit_judge" | "fallback_authoring_plan" | "flow_authoring_brief_generation" | "flow_authoring_agent" | "flow_execution_content";
885
- declare const AGENT_PROMPT_PURPOSES: readonly AgentPromptPurpose[];
882
+ type PromptTargetKey = "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";
883
+ declare const AGENT_MODEL_INPUT_TARGET_KEYS: readonly PromptTargetKey[];
884
+ type AgentModelInputDomain = "agent" | "flow_authoring" | "workflow";
885
+ type AgentModelInputTargetLifecycle = "managed" | "protected";
886
+ type AgentModelInputContextBlockSource = "page_context" | "flow_context" | "integration_context" | "working_flow_ir" | "brief" | "runtime";
887
+ type AgentModelInputToolContractOwner = "server_contract" | "integration_catalog";
886
888
  type AgentPromptStatus = "draft" | "active" | "archived";
887
- type AgentPromptAsset = {
888
- key: string;
889
+ type AgentPromptRevision = {
890
+ targetKey: PromptTargetKey;
889
891
  revision: string;
890
892
  status: AgentPromptStatus;
891
- purpose: AgentPromptPurpose;
892
- locale?: string;
893
893
  title: string;
894
- description?: string;
895
894
  content: string;
896
- variablesSchema: JsonValue;
897
895
  contentHash: string;
896
+ notes?: string;
898
897
  createdAt: string;
899
898
  activatedAt?: string;
900
899
  };
901
- type AgentPromptBindingTaskKind = "general" | "flow_authoring";
902
- type AgentPromptBindingConditions = {
903
- locale?: string;
904
- modelProvider?: string;
905
- modelId?: string;
906
- workspaceId?: string;
907
- taskKind?: AgentPromptBindingTaskKind;
908
- sceneKey?: string;
909
- templateKey?: string;
910
- experimentKey?: string;
900
+ type AgentPromptRef = {
901
+ targetKey: PromptTargetKey;
902
+ revision: string;
903
+ contentHash: string;
911
904
  };
912
- type AgentPromptBinding = {
913
- id: string;
914
- slot: AgentPromptSlot;
915
- promptKey: string;
916
- enabled: boolean;
917
- priority: number;
918
- conditions?: AgentPromptBindingConditions;
919
- createdAt: string;
920
- updatedAt: string;
905
+ type AgentPromptRevisionRef = AgentPromptRef;
906
+ type AgentModelInputContextBlock = {
907
+ key: string;
908
+ source: AgentModelInputContextBlockSource;
909
+ description: string;
910
+ required: boolean;
921
911
  };
922
- type AgentPromptRefSource = "builtin" | "db_override";
923
- type AgentPromptRef = {
912
+ type AgentModelInputToolContractRef = {
924
913
  key: string;
925
- revision: string;
914
+ owner: AgentModelInputToolContractOwner;
926
915
  contentHash: string;
927
- source: AgentPromptRefSource;
928
916
  };
929
- type AgentPromptSnapshot = {
930
- slot: AgentPromptSlot;
917
+ type AgentModelInputTarget = {
918
+ targetKey: PromptTargetKey;
919
+ domain: AgentModelInputDomain;
920
+ title: string;
921
+ description: string;
922
+ editable: boolean;
923
+ lifecycle: AgentModelInputTargetLifecycle;
924
+ usePoint: string;
925
+ prompt?: {
926
+ activeRevision?: AgentPromptRevisionRef;
927
+ };
928
+ contextBlocks: AgentModelInputContextBlock[];
929
+ toolContracts: AgentModelInputToolContractRef[];
930
+ };
931
+ type AgentModelInputSnapshot = {
932
+ id: string;
933
+ workspaceId?: string;
934
+ sessionId?: string;
935
+ targetKey: PromptTargetKey;
936
+ usePoint: string;
931
937
  promptRef: AgentPromptRef;
932
- bindingId?: string;
933
- variablesHash: string;
934
- renderedHash: string;
938
+ contextRefs: Array<{
939
+ key: string;
940
+ source: AgentModelInputContextBlockSource;
941
+ contentHash: string;
942
+ sizeBytes: number;
943
+ }>;
944
+ toolContractRefs: AgentModelInputToolContractRef[];
945
+ messageRefs: Array<{
946
+ id: string;
947
+ role: "user" | "assistant" | "system" | "tool";
948
+ }>;
949
+ finalInputHash: string;
950
+ createdAt: string;
951
+ };
952
+ type AgentModelInputSnapshotRef = {
953
+ id: string;
954
+ targetKey: PromptTargetKey;
955
+ promptRef: AgentPromptRef;
956
+ finalInputHash: string;
935
957
  };
936
958
  type FlowSceneTriggerType = "manual" | "schedule" | "integration";
937
959
  type FlowScenePersistence = "one_off" | "recurring_flow" | "any";
@@ -1022,38 +1044,28 @@ type FlowAssetIndexDocument = {
1022
1044
  indexedAt?: string;
1023
1045
  };
1024
1046
  type CreateAgentPromptInput = {
1025
- key: string;
1026
- purpose: AgentPromptPurpose;
1027
- locale?: string;
1047
+ targetKey: PromptTargetKey;
1048
+ revision: string;
1028
1049
  title: string;
1029
- description?: string;
1030
1050
  content: string;
1031
- variablesSchema: JsonValue;
1051
+ notes?: string;
1032
1052
  };
1033
1053
  type UpdateAgentPromptInput = {
1034
- key: string;
1054
+ targetKey: PromptTargetKey;
1035
1055
  revision: string;
1036
- purpose?: AgentPromptPurpose;
1037
- locale?: string;
1038
1056
  title?: string;
1039
- description?: string;
1040
1057
  content?: string;
1041
- variablesSchema?: JsonValue;
1058
+ notes?: string | null;
1042
1059
  };
1043
- type CreateAgentPromptBindingInput = {
1044
- slot: AgentPromptSlot;
1045
- promptKey: string;
1046
- enabled: boolean;
1047
- priority: number;
1048
- conditions?: AgentPromptBindingConditions;
1060
+ type RenderModelInputPreviewInput = {
1061
+ sampleContext?: "empty" | "fixture";
1049
1062
  };
1050
- type UpdateAgentPromptBindingInput = {
1051
- id: string;
1052
- slot?: AgentPromptSlot;
1053
- promptKey?: string;
1054
- enabled?: boolean;
1055
- priority?: number;
1056
- conditions?: AgentPromptBindingConditions;
1063
+ type AgentModelInputSnapshotListQuery = {
1064
+ workspaceId?: string;
1065
+ sessionId?: string;
1066
+ targetKey?: PromptTargetKey;
1067
+ limit?: number;
1068
+ cursor?: string;
1057
1069
  };
1058
1070
  type CreateFlowSceneInput = {
1059
1071
  sceneKey: string;
@@ -1241,6 +1253,7 @@ type FlowCreationTaskData = {
1241
1253
  flowId: string;
1242
1254
  draftId: string;
1243
1255
  };
1256
+ modelInputSnapshots: AgentModelInputSnapshotRef[];
1244
1257
  decisionRecordIds: string[];
1245
1258
  traceRef?: string;
1246
1259
  createdAt: string;
@@ -1261,7 +1274,7 @@ type FlowCreationDecisionRecordData = {
1261
1274
  decisionKind: FlowCreationDecisionKind;
1262
1275
  inputJson: JsonValue;
1263
1276
  outputJson: JsonValue;
1264
- promptSnapshots: AgentPromptSnapshot[];
1277
+ modelInputSnapshots: AgentModelInputSnapshotRef[];
1265
1278
  assetRefs: FlowAuthoringAssetRef[];
1266
1279
  contextRefs: FlowAuthoringDecisionContextRef[];
1267
1280
  traceRef?: string;
@@ -1433,7 +1446,7 @@ type ResolveFlowReadinessRequirementResponse<TIr = unknown> = {
1433
1446
  type AgentRenderedPromptPreview = {
1434
1447
  instructions: string;
1435
1448
  promptRef: AgentPromptRef;
1436
- snapshot: AgentPromptSnapshot;
1449
+ finalInputHash?: string;
1437
1450
  };
1438
1451
  type ValidateAgentPromptResult = {
1439
1452
  ok: boolean;
@@ -1441,13 +1454,16 @@ type ValidateAgentPromptResult = {
1441
1454
  renderedPreview?: AgentRenderedPromptPreview;
1442
1455
  };
1443
1456
  type ActivateAgentPromptResult = {
1444
- prompt: AgentPromptAsset;
1457
+ prompt: AgentPromptRevision;
1445
1458
  promptRef: AgentPromptRef;
1446
1459
  };
1447
- type ValidateAgentPromptBindingResult = {
1460
+ type RenderModelInputPreviewResult = {
1448
1461
  ok: boolean;
1449
1462
  issues: AgentValidationIssue[];
1450
- resolvedPromptPreview?: AgentRenderedPromptPreview;
1463
+ preview?: AgentRenderedPromptPreview & {
1464
+ contextRefs: AgentModelInputSnapshot["contextRefs"];
1465
+ toolContractRefs: AgentModelInputToolContractRef[];
1466
+ };
1451
1467
  };
1452
1468
  type AgentAssetIndexingStatus = "queued" | "completed" | "failed";
1453
1469
  type ValidateFlowSceneResult = {
@@ -1478,11 +1494,15 @@ type ReindexFlowTemplateResult = {
1478
1494
  revision: string;
1479
1495
  indexingStatus: AgentAssetIndexingStatus;
1480
1496
  };
1497
+ type AgentModelInputTargetListData = {
1498
+ targets: AgentModelInputTarget[];
1499
+ };
1481
1500
  type AgentPromptListData = {
1482
- prompts: AgentPromptAsset[];
1501
+ prompts: AgentPromptRevision[];
1483
1502
  };
1484
- type AgentPromptBindingListData = {
1485
- bindings: AgentPromptBinding[];
1503
+ type AgentModelInputSnapshotListData = {
1504
+ snapshots: AgentModelInputSnapshot[];
1505
+ nextCursor?: string;
1486
1506
  };
1487
1507
  type FlowSceneListData = {
1488
1508
  scenes: FlowSceneAsset[];
@@ -1491,12 +1511,9 @@ type FlowTemplateListData = {
1491
1511
  templates: FlowTemplateAsset[];
1492
1512
  };
1493
1513
  type AgentPromptCreateData = {
1494
- prompt: AgentPromptAsset;
1514
+ prompt: AgentPromptRevision;
1495
1515
  promptRef: AgentPromptRef;
1496
1516
  };
1497
- type AgentPromptBindingWriteData = {
1498
- binding: AgentPromptBinding;
1499
- };
1500
1517
  type FlowSceneWriteData = {
1501
1518
  scene: FlowSceneAsset;
1502
1519
  };
@@ -1527,7 +1544,13 @@ type CreateFlowCreationTaskResult = {
1527
1544
  };
1528
1545
  declare const AGENT_ASSET_NOT_FOUND_ERROR_CODE = "AGENT_ASSET_NOT_FOUND";
1529
1546
  declare const AGENT_ASSET_VALIDATION_FAILED_ERROR_CODE = "AGENT_ASSET_VALIDATION_FAILED";
1530
- declare const AGENT_PROMPT_BINDING_CONFLICT_ERROR_CODE = "AGENT_PROMPT_BINDING_CONFLICT";
1547
+ declare const AGENT_PROMPT_TARGET_NOT_FOUND_ERROR_CODE = "AGENT_PROMPT_TARGET_NOT_FOUND";
1548
+ declare const AGENT_PROMPT_ACTIVE_REVISION_MISSING_ERROR_CODE = "AGENT_PROMPT_ACTIVE_REVISION_MISSING";
1549
+ declare const AGENT_PROMPT_REVISION_NOT_FOUND_ERROR_CODE = "AGENT_PROMPT_REVISION_NOT_FOUND";
1550
+ declare const AGENT_PROMPT_REVISION_NOT_DRAFT_ERROR_CODE = "AGENT_PROMPT_REVISION_NOT_DRAFT";
1551
+ declare const AGENT_PROMPT_VALIDATION_FAILED_ERROR_CODE = "AGENT_PROMPT_VALIDATION_FAILED";
1552
+ declare const AGENT_MODEL_INPUT_TARGET_PROTECTED_ERROR_CODE = "AGENT_MODEL_INPUT_TARGET_PROTECTED";
1553
+ declare const AGENT_MODEL_INPUT_PREVIEW_UNAVAILABLE_ERROR_CODE = "AGENT_MODEL_INPUT_PREVIEW_UNAVAILABLE";
1531
1554
  declare const AGENT_FLOW_GOAL_INVALID_ERROR_CODE = "AGENT_FLOW_GOAL_INVALID";
1532
1555
  declare const AGENT_FLOW_CREATION_TASK_NOT_FOUND_ERROR_CODE = "AGENT_FLOW_CREATION_TASK_NOT_FOUND";
1533
1556
  declare const AGENT_FLOW_CREATION_TASK_CONFLICT_ERROR_CODE = "AGENT_FLOW_CREATION_TASK_CONFLICT";
@@ -1813,4 +1836,4 @@ type SimulateTriggerData = {
1813
1836
  duplicate: boolean;
1814
1837
  };
1815
1838
 
1816
- export { AGENT_ASSETS_ROUTE_PREFIX, AGENT_ASSET_FLOW_SCENES_SUBPATH, AGENT_ASSET_FLOW_SCENE_ACTIVATE_SUBPATH, AGENT_ASSET_FLOW_SCENE_ITEM_SUBPATH, AGENT_ASSET_FLOW_SCENE_REINDEX_SUBPATH, AGENT_ASSET_FLOW_SCENE_VALIDATE_SUBPATH, AGENT_ASSET_FLOW_TEMPLATES_SUBPATH, AGENT_ASSET_FLOW_TEMPLATE_ACTIVATE_SUBPATH, AGENT_ASSET_FLOW_TEMPLATE_ITEM_SUBPATH, AGENT_ASSET_FLOW_TEMPLATE_REINDEX_SUBPATH, AGENT_ASSET_FLOW_TEMPLATE_VALIDATE_SUBPATH, AGENT_ASSET_INDEX_FAILED_ERROR_CODE, AGENT_ASSET_MANAGE_PERMISSION, AGENT_ASSET_NOT_FOUND_ERROR_CODE, AGENT_ASSET_PROMPTS_SUBPATH, AGENT_ASSET_PROMPT_ACTIVATE_SUBPATH, AGENT_ASSET_PROMPT_BINDINGS_SUBPATH, AGENT_ASSET_PROMPT_BINDING_ITEM_SUBPATH, AGENT_ASSET_PROMPT_BINDING_VALIDATE_SUBPATH, AGENT_ASSET_PROMPT_ITEM_SUBPATH, AGENT_ASSET_PROMPT_VALIDATE_SUBPATH, AGENT_ASSET_VALIDATION_FAILED_ERROR_CODE, AGENT_CAPABILITY_FLOW_AUTHORING, AGENT_CHAT_ROUTE_SUBPATH, AGENT_CREATE_FLOW_AUTHORING_TASK_TOOL_NAME, AGENT_FLOW_AUTHORING_WORKFLOW_FAILED_ERROR_CODE, AGENT_FLOW_CONTEXT_ROUTE_SUBPATH, AGENT_FLOW_CREATION_DECISION_ITEM_SUBPATH, AGENT_FLOW_CREATION_TASK_CONFLICT_ERROR_CODE, AGENT_FLOW_CREATION_TASK_ITEM_SUBPATH, AGENT_FLOW_CREATION_TASK_NOT_FOUND_ERROR_CODE, AGENT_FLOW_GOAL_INVALID_ERROR_CODE, AGENT_FLOW_READINESS_REQUIREMENT_RESOLVE_SUBPATH, AGENT_FLOW_WORKING_DRAFT_COMMANDS_SUBPATH, AGENT_FLOW_WORKING_DRAFT_EDIT_TURN_ACQUIRE_SUBPATH, AGENT_FLOW_WORKING_DRAFT_EDIT_TURN_RELEASE_SUBPATH, AGENT_FLOW_WORKING_DRAFT_ITEM_SUBPATH, AGENT_FLOW_WORKING_DRAFT_OPEN_SUBPATH, AGENT_FLOW_WORKING_DRAFT_PUBLISH_SUBPATH, AGENT_FLOW_WORKING_DRAFT_READINESS_CHECK_SUBPATH, AGENT_MESSAGE_DELTA_INVALID_ERROR_CODE, AGENT_PAGE_CONTEXT_INVALID_ERROR_CODE, AGENT_PAGE_CONTEXT_MAX_RESOURCES, AGENT_PAGE_CONTEXT_RESOURCE_ID_MAX_LENGTH, AGENT_PAGE_CONTEXT_ROUTE_ID_MAX_LENGTH, AGENT_PAGE_RESOURCE_TYPES, AGENT_PROMPT_BINDING_CONFLICT_ERROR_CODE, AGENT_PROMPT_PURPOSES, AGENT_PROMPT_SLOTS, AGENT_ROUTE_PREFIX, AGENT_RUNTIME_FAILED_ERROR_CODE, AGENT_RUNTIME_TOOL_NAME_PATTERN, AGENT_RUNTIME_UNCONFIGURED_ERROR_CODE, AGENT_SESSIONS_ROUTE_SUBPATH, AGENT_SESSION_DETAIL_MESSAGE_LIMIT, AGENT_SESSION_ITEM_ROUTE_SUBPATH, AGENT_SESSION_LIST_DEFAULT_LIMIT, AGENT_SESSION_LIST_MAX_LIMIT, AGENT_SESSION_NOT_FOUND_ERROR_CODE, API_KEYS_ROUTE_PREFIX, API_KEY_GRANT_OPTIONS_ROUTE_SUBPATH, API_KEY_ITEM_ROUTE_SUBPATH, API_KEY_TOKEN_PREFIX, API_KEY_WORKSPACE_FULL_ACCESS_SCOPE, APP_BOOTSTRAP_ROUTE_PATH, type ActivateAgentPromptResult, type ActivateFlowSceneResult, type ActivateFlowTemplateResult, type AddNodeInput, type AgentAssetIndexingStatus, type AgentCapabilityKind, type AgentChatRequestBody, type AgentPageContext, type AgentPageResourceRef, type AgentPageResourceType, type AgentPromptAsset, type AgentPromptBinding, type AgentPromptBindingConditions, type AgentPromptBindingListData, type AgentPromptBindingTaskKind, type AgentPromptBindingWriteData, type AgentPromptCreateData, type AgentPromptListData, type AgentPromptPurpose, type AgentPromptRef, type AgentPromptRefSource, type AgentPromptSlot, type AgentPromptSnapshot, type AgentPromptStatus, type AgentSessionDetailData, type AgentSessionListData, type AgentSessionSummary, type AgentTaskSurface, type AgentUiMessageProjection, type AgentUiMessageRole, type AgentValidationIssue, type ApiKeyCreateBody, type ApiKeyCreateData, type ApiKeyData, type ApiKeyGrantCreateInput, type ApiKeyGrantData, type ApiKeyGrantOptionsData, type ApiKeyGrantType, type ApiKeyListData, type ApiKeyPlatformGrantCreateInput, type ApiKeyPlatformGrantOptionData, type ApiKeyRevokeData, type ApiKeyStatus, type ApiKeyWorkspaceGrantCreateInput, type ApiKeyWorkspaceGrantOptionData, type ApiKeyWorkspaceScope, type AppBootstrapData, type ApplyFlowDraftCommandResponse, type Bounded, CATALOG_DEFAULT_PROVIDER_APP_CONFIG_ROUTE_SUBPATH, CATALOG_INTEGRATIONS_ROUTE_SUBPATH, CATALOG_INTEGRATION_DETAIL_ROUTE_SUBPATH, CATALOG_ROUTE_PREFIX, CATALOG_VERSIONS_ROUTE_SUBPATH, CONNECTIONS_ROUTE_SUBPATH, CONNECTION_DISCONNECT_ROUTE_SUBPATH, CONNECT_COMPLETE_ROUTE_SUBPATH, CONNECT_OPTIONS_ROUTE_SUBPATH, CONNECT_START_ROUTE_SUBPATH, CONNECT_SUBMIT_ROUTE_SUBPATH, CURRENT_USER_ROUTE_PATH, type CatalogDetailData, type CatalogDetailLatestData, type CatalogIntegrationSummaryData, type CatalogListData, type CatalogPublishData, type CatalogToolFunctionData, type CatalogTriggerFunctionData, type CatalogVersionSummaryData, type CheckFlowReadinessResponse, type CompiledFlowVersionSummaryData, type ConnectCompleteResultData, type ConnectCompletedResultData, type ConnectDefaultUnavailableReason, type ConnectFieldDefData, type ConnectInputNextActionData, type ConnectInputTarget, type ConnectOptionsData, type ConnectRedirectNextActionData, type ConnectStartBody, type ConnectStartResultData, type ConnectSubmitBody, type ConnectSubmitResultData, type ConnectionAuthType, type ConnectionListData, type ConnectionSummaryData, type ControlPlaneToolData, type ControlPlaneToolDeliveryData, type ControlPlaneTriggerData, type CreateAgentPromptBindingInput, type CreateAgentPromptInput, type CreateFlowAuthoringTaskInput, type CreateFlowCreationTaskResult, type CreateFlowSceneInput, type CreateFlowTemplateInput, type CurrentUserData, DEFAULT_WORKSPACE_ROUTE_PATH, type DefaultProviderAppConfigAdminData, type DefaultProviderAppConfigDisableData, type DefaultProviderAppConfigUpsertBody, type DefaultProviderAppConfigWriteData, type DefaultWorkspaceUpdateBody, type DefaultWorkspaceUpdateData, type DeletedFlowSummaryData, type DeliverFlowRunEventData, type DisconnectResultData, FLOW_AUTHORING_EDIT_TOOL_NAMES, FLOW_AUTHORING_TOOL_DESCRIPTORS, FLOW_AUTHORING_TOOL_NAMES, FLOW_DISABLE_ROUTE_SUBPATH, FLOW_DRAFT_COMMAND_INVALID_ERROR_CODE, FLOW_DRAFT_EDIT_LOCKED_ERROR_CODE, FLOW_DRAFT_NOT_PUBLISHABLE_ERROR_CODE, FLOW_DRAFT_REVISION_CONFLICT_ERROR_CODE, FLOW_DRAFT_ROUTE_SUBPATH, FLOW_EDIT_TURN_NOT_HELD_ERROR_CODE, FLOW_ENABLE_ROUTE_SUBPATH, FLOW_ITEM_ROUTE_SUBPATH, FLOW_PUBLISH_CONFIRMATION_REQUIRED_ERROR_CODE, FLOW_READINESS_REQUIREMENT_CONFLICT_ERROR_CODE, FLOW_READINESS_REQUIREMENT_NOT_FOUND_ERROR_CODE, FLOW_RUN_STATUSES, FLOW_VALIDATE_ROUTE_SUBPATH, FLOW_VERSIONS_ROUTE_SUBPATH, FLOW_VERSION_ITEM_ROUTE_SUBPATH, FLOW_WORKING_DRAFT_NOT_FOUND_ERROR_CODE, type FallbackAuthoringPlan, type FlowAssetIndexDocType, type FlowAssetIndexDocument, type FlowAssetStatus, type FlowAssetStrength, type FlowAuthoringAssetRef, type FlowAuthoringBrief, type FlowAuthoringBriefSummary, type FlowAuthoringDecisionContextRef, type FlowAuthoringDecisionContextRefKind, type FlowAuthoringEditToolName, type FlowAuthoringSceneBrief, type FlowAuthoringStrategyMode, type FlowAuthoringTemplateBrief, type FlowAuthoringToolDescriptor, type FlowAuthoringToolExecution, type FlowAuthoringToolInputSchema, type FlowAuthoringToolName, type FlowBadgeData, FlowCompositionSpec, type FlowCreationDecisionKind, type FlowCreationDecisionRecordData, type FlowCreationLifecycleEventData, type FlowCreationLifecycleEventType, type FlowCreationTaskData, type FlowCreationTaskState, type FlowDeleteData, type FlowDraftActor, type FlowDraftCommand, type FlowDraftEditTurn, type FlowDraftProjection, type FlowDraftPublishRequest, type FlowDraftPublishResult, type FlowDraftRecordData, type FlowDraftStatus, type FlowGoalAssumption, type FlowGoalAssumptionSource, type FlowGoalDelivery, type FlowGoalDeliveryKind, type FlowGoalPersistence, type FlowGoalScheduleFrequency, type FlowGoalSpec, type FlowGoalSpecifiedIntegration, type FlowGoalTrigger, FlowIrValidationResult, type FlowListData, type FlowListItemData, type FlowMetaUpdate, FlowNode, type FlowPublishData, type FlowReadinessRequirementStatus, type FlowReadinessRequirementType, type FlowReadinessResultData, type FlowRecordData, type FlowRunCancelData, type FlowRunDetailData, type FlowRunListData, type FlowRunStatus, type FlowRunSummaryData, type FlowRunTerminalErrorData, type FlowRunTriggerData, type FlowSceneAsset, type FlowSceneCandidate, type FlowSceneDefaultStrategy, type FlowSceneListData, type FlowSceneOverridable, type FlowScenePersistence, type FlowScenePreferredIntegration, type FlowSceneTriggerType, type FlowSceneWriteData, type FlowSlotResolution, type FlowSlotResolutionSource, type FlowStatus, type FlowTemplateAsset, type FlowTemplateCandidate, type FlowTemplateListData, type FlowTemplateWriteData, type FlowToolError, type FlowValidateData, type FlowValidationIssueData, type FlowVersionGetData, type FlowVersionListData, type FlowWithDraftData, type FlowWorkingDraftOpenRequest, type FlowWorkingDraftOwner, type FlowWorkingDraftOwnerKind, type FlowWorkingDraftSummary, GLOBAL_INBOX_ENTRIES_ROUTE_PREFIX, type GetFlowContextInput, type GetWorkingFlowIrInput, type GetWorkingFlowIrOutput, type GlobalInboxEntryDetailData, type GlobalInboxEntryListData, type GlobalInboxEntryListEntryData, type GlobalInboxEntryListQuery, type GlobalInboxWorkspaceData, HUMAN_INPUT_TOKENS_ROUTE_PREFIX, HUMAN_INPUT_TOKEN_ROUTE_SUBPATH, HUMAN_INPUT_TOKEN_SUBMIT_ROUTE_SUBPATH, type HumanInputPublicOutputData, type HumanInputRequestViewData, type HumanInputSubmitPayload, type HumanInputTokenSubmitData, type HumanInputTokenViewData, INBOX_ENTRY_HUMAN_INPUT_SUBMIT_ROUTE_SUBPATH, INBOX_ENTRY_ROUTE_SUBPATH, INBOX_ITEM_ROUTE_SUBPATH, INTEGRATION_ITEM_ROUTE_SUBPATH, INTEGRATION_TOOLS_ROUTE_SUBPATH, type InboxEntryDetailData, type InboxEntryListData, type InboxEntryListEntryData, type InboxEntryStatus, type InboxEntryType, type InboxHumanInputEntryData, type InboxItemDetailData, type InboxItemDetailEntryData, type InboxItemListData, type InboxItemListEntryData, type InboxLinksData, type InboxReportData, type InstallationCatalogInfoData, type InstallationData, type InstallationSource, type InstallationToolsData, type IntegrationGetData, type IntegrationInstallBody, type IntegrationInstallData, type IntegrationListData, type IntegrationUninstallData, JsonObject, JsonValue, Mapping, ONE_OFF_EXECUTE_ACTION_TOOL_NAME, ONE_OFF_GET_ACTION_CONTEXT_TOOL_NAME, ONE_OFF_TOOL_NAMES, type OneOffActionContext, type OneOffExecuteActionInput, type OneOffExecuteActionOutput, type OneOffGetActionContextInput, type OneOffGetActionContextOutput, type OneOffToolName, type OpenFlowWorkingDraftResponse, PLATFORM_ACCESS_PERMISSION, PLATFORM_API_KEY_MANAGE_PERMISSION, PROVIDER_CALLBACK_REDIRECT_ROUTE_PATH, type ProposePublishInput, type ProposePublishOutput, type ProviderAppConfigSource, type ProviderSetupData, type PublicCompiledFlowVersionData, type PublicResolvedBindingData, type PublicResolvedToolBindingData, type PublicResolvedTriggerBindingData, RUN_CANCEL_ROUTE_SUBPATH, RUN_EVENTS_ROUTE_SUBPATH, RUN_ITEM_ROUTE_SUBPATH, type RegistrationSummaryData, type ReindexFlowSceneResult, type ReindexFlowTemplateResult, type RemoveNodeInput, type RemoveTriggerInput, type RequestConnectInput, type RequestConnectOutput, type ResolveFlowReadinessRequirementRequest, type ResolveFlowReadinessRequirementResponse, STEP_RUN_STATUSES, type SafeFlowReadinessRequirementData, type SetCompositionInput, type SetFlowMetaInput, type SetOutputsInput, type SetTriggerInput, type SimulateTriggerBody, type SimulateTriggerData, type SimulateTriggerEventBody, type StepRunStatus, type StepRunSummaryData, TRIGGER_INSTANCES_ROUTE_SUBPATH, TRIGGER_SIMULATE_ROUTE_SUBPATH, TriggerBinding, type TriggerInstanceDiagnosticData, type TriggerInstanceLastErrorData, type TriggerInstanceStatus, type TriggerInstancesData, type TruncatedPlaceholder, type UpdateAgentPromptBindingInput, type UpdateAgentPromptInput, type UpdateFlowSceneInput, type UpdateFlowTemplateInput, type UpdateNodeInput, type ValidateAgentPromptBindingResult, type ValidateAgentPromptResult, type ValidateFlowSceneResult, type ValidateFlowTemplateResult, type ValidateFlowToolInput, type ValidateToolOutput, WORKSPACES_ROUTE_PREFIX, WORKSPACE_ACCESS_ROUTE_SUBPATH, WORKSPACE_CONNECTION_MOUNT_PREFIX, WORKSPACE_FLOWS_ROUTE_PREFIX, WORKSPACE_FLOW_RUNS_ROUTE_PREFIX, WORKSPACE_INBOX_ENTRIES_ROUTE_PREFIX, WORKSPACE_INBOX_ITEMS_ROUTE_PREFIX, WORKSPACE_INTEGRATIONS_ROUTE_PREFIX, WORKSPACE_LIST_ROUTE_SUBPATH, WORKSPACE_RUNS_ROUTE_PREFIX, type WorkingIrSummary, type WorkspaceAccessData, type WorkspaceAccessSummaryData, type WorkspaceData, type WorkspaceListData, type WorkspaceMembershipData, type WorkspaceMembershipRole, agentAssetFlowScenesPath, agentAssetFlowTemplatesPath, agentAssetPromptsPath, agentChatPath, agentFlowCreationDecisionPath, agentFlowCreationTaskPath, agentFlowReadinessRequirementResolvePath, agentFlowWorkingDraftCommandsPath, agentFlowWorkingDraftEditTurnAcquirePath, agentFlowWorkingDraftEditTurnReleasePath, agentFlowWorkingDraftOpenPath, agentFlowWorkingDraftPath, agentFlowWorkingDraftPublishPath, agentFlowWorkingDraftReadinessCheckPath, agentSessionPath, agentSessionsPath, apiKeyGrantOptionsPath, apiKeyPath, apiKeysPath, appBootstrapPath, catalogDefaultProviderAppConfigPath, catalogIntegrationPath, catalogIntegrationsPath, catalogVersionsPath, connectCompletePath, connectOptionsPath, connectStartPath, connectSubmitPath, connectionDisconnectPath, currentUserPath, defaultWorkspacePath, findFlowAuthoringToolDescriptor, flowDisablePath, flowDraftPath, flowEnablePath, flowPath, flowRunsPath, flowValidatePath, flowVersionPath, flowVersionsPath, formatFlowToolError, globalInboxEntriesPath, globalInboxEntryHumanInputSubmitPath, globalInboxEntryPath, humanInputTokenPath, humanInputTokenSubmitPath, inboxEntryHumanInputSubmitPath, inboxEntryPath, inboxItemPath, installationToolsPath, runCancelPath, runEventsPath, runPath, triggerInstancesPath, triggerSimulatePath, workspaceConnectionsPath, workspaceFlowsPath, workspaceInboxEntriesPath, workspaceInboxItemsPath, workspaceIntegrationPath, workspaceIntegrationsPath, workspacePath, workspaceRunsPath, workspacesPath };
1839
+ export { AGENT_ASSETS_ROUTE_PREFIX, AGENT_ASSET_FLOW_SCENES_SUBPATH, AGENT_ASSET_FLOW_SCENE_ACTIVATE_SUBPATH, AGENT_ASSET_FLOW_SCENE_ITEM_SUBPATH, AGENT_ASSET_FLOW_SCENE_REINDEX_SUBPATH, AGENT_ASSET_FLOW_SCENE_VALIDATE_SUBPATH, AGENT_ASSET_FLOW_TEMPLATES_SUBPATH, AGENT_ASSET_FLOW_TEMPLATE_ACTIVATE_SUBPATH, AGENT_ASSET_FLOW_TEMPLATE_ITEM_SUBPATH, AGENT_ASSET_FLOW_TEMPLATE_REINDEX_SUBPATH, AGENT_ASSET_FLOW_TEMPLATE_VALIDATE_SUBPATH, AGENT_ASSET_INDEX_FAILED_ERROR_CODE, AGENT_ASSET_MANAGE_PERMISSION, AGENT_ASSET_MODEL_INPUT_SNAPSHOTS_SUBPATH, AGENT_ASSET_MODEL_INPUT_TARGETS_SUBPATH, AGENT_ASSET_MODEL_INPUT_TARGET_PREVIEW_SUBPATH, AGENT_ASSET_NOT_FOUND_ERROR_CODE, AGENT_ASSET_PROMPTS_SUBPATH, AGENT_ASSET_PROMPT_ACTIVATE_SUBPATH, AGENT_ASSET_PROMPT_ITEM_SUBPATH, AGENT_ASSET_PROMPT_VALIDATE_SUBPATH, AGENT_ASSET_VALIDATION_FAILED_ERROR_CODE, AGENT_CAPABILITY_FLOW_AUTHORING, AGENT_CHAT_ROUTE_SUBPATH, AGENT_CREATE_FLOW_AUTHORING_TASK_TOOL_NAME, AGENT_FLOW_AUTHORING_WORKFLOW_FAILED_ERROR_CODE, AGENT_FLOW_CONTEXT_ROUTE_SUBPATH, AGENT_FLOW_CREATION_DECISION_ITEM_SUBPATH, AGENT_FLOW_CREATION_TASK_CONFLICT_ERROR_CODE, AGENT_FLOW_CREATION_TASK_ITEM_SUBPATH, AGENT_FLOW_CREATION_TASK_NOT_FOUND_ERROR_CODE, AGENT_FLOW_GOAL_INVALID_ERROR_CODE, AGENT_FLOW_READINESS_REQUIREMENT_RESOLVE_SUBPATH, AGENT_FLOW_WORKING_DRAFT_COMMANDS_SUBPATH, AGENT_FLOW_WORKING_DRAFT_EDIT_TURN_ACQUIRE_SUBPATH, AGENT_FLOW_WORKING_DRAFT_EDIT_TURN_RELEASE_SUBPATH, AGENT_FLOW_WORKING_DRAFT_ITEM_SUBPATH, AGENT_FLOW_WORKING_DRAFT_OPEN_SUBPATH, AGENT_FLOW_WORKING_DRAFT_PUBLISH_SUBPATH, AGENT_FLOW_WORKING_DRAFT_READINESS_CHECK_SUBPATH, AGENT_MESSAGE_DELTA_INVALID_ERROR_CODE, AGENT_MODEL_INPUT_PREVIEW_UNAVAILABLE_ERROR_CODE, AGENT_MODEL_INPUT_TARGET_KEYS, AGENT_MODEL_INPUT_TARGET_PROTECTED_ERROR_CODE, AGENT_PAGE_CONTEXT_INVALID_ERROR_CODE, AGENT_PAGE_CONTEXT_MAX_RESOURCES, AGENT_PAGE_CONTEXT_RESOURCE_ID_MAX_LENGTH, AGENT_PAGE_CONTEXT_ROUTE_ID_MAX_LENGTH, AGENT_PAGE_RESOURCE_TYPES, AGENT_PROMPT_ACTIVE_REVISION_MISSING_ERROR_CODE, AGENT_PROMPT_REVISION_NOT_DRAFT_ERROR_CODE, AGENT_PROMPT_REVISION_NOT_FOUND_ERROR_CODE, AGENT_PROMPT_TARGET_NOT_FOUND_ERROR_CODE, AGENT_PROMPT_VALIDATION_FAILED_ERROR_CODE, AGENT_ROUTE_PREFIX, AGENT_RUNTIME_FAILED_ERROR_CODE, AGENT_RUNTIME_TOOL_NAME_PATTERN, AGENT_RUNTIME_UNCONFIGURED_ERROR_CODE, AGENT_SESSIONS_ROUTE_SUBPATH, AGENT_SESSION_DETAIL_MESSAGE_LIMIT, AGENT_SESSION_ITEM_ROUTE_SUBPATH, AGENT_SESSION_LIST_DEFAULT_LIMIT, AGENT_SESSION_LIST_MAX_LIMIT, AGENT_SESSION_NOT_FOUND_ERROR_CODE, API_KEYS_ROUTE_PREFIX, API_KEY_GRANT_OPTIONS_ROUTE_SUBPATH, API_KEY_ITEM_ROUTE_SUBPATH, API_KEY_TOKEN_PREFIX, API_KEY_WORKSPACE_FULL_ACCESS_SCOPE, APP_BOOTSTRAP_ROUTE_PATH, type ActivateAgentPromptResult, type ActivateFlowSceneResult, type ActivateFlowTemplateResult, type AddNodeInput, type AgentAssetIndexingStatus, type AgentCapabilityKind, type AgentChatRequestBody, type AgentModelInputContextBlock, type AgentModelInputContextBlockSource, type AgentModelInputDomain, type AgentModelInputSnapshot, type AgentModelInputSnapshotListData, type AgentModelInputSnapshotListQuery, type AgentModelInputSnapshotRef, type AgentModelInputTarget, type AgentModelInputTargetLifecycle, type AgentModelInputTargetListData, type AgentModelInputToolContractOwner, type AgentModelInputToolContractRef, type AgentPageContext, type AgentPageResourceRef, type AgentPageResourceType, type AgentPromptCreateData, type AgentPromptListData, type AgentPromptRef, type AgentPromptRevision, type AgentPromptRevisionRef, type AgentPromptStatus, type AgentSessionDetailData, type AgentSessionListData, type AgentSessionSummary, type AgentTaskSurface, type AgentUiMessageProjection, type AgentUiMessageRole, type AgentValidationIssue, type ApiKeyCreateBody, type ApiKeyCreateData, type ApiKeyData, type ApiKeyGrantCreateInput, type ApiKeyGrantData, type ApiKeyGrantOptionsData, type ApiKeyGrantType, type ApiKeyListData, type ApiKeyPlatformGrantCreateInput, type ApiKeyPlatformGrantOptionData, type ApiKeyRevokeData, type ApiKeyStatus, type ApiKeyWorkspaceGrantCreateInput, type ApiKeyWorkspaceGrantOptionData, type ApiKeyWorkspaceScope, type AppBootstrapData, type ApplyFlowDraftCommandResponse, type Bounded, CATALOG_DEFAULT_PROVIDER_APP_CONFIG_ROUTE_SUBPATH, CATALOG_INTEGRATIONS_ROUTE_SUBPATH, CATALOG_INTEGRATION_DETAIL_ROUTE_SUBPATH, CATALOG_ROUTE_PREFIX, CATALOG_VERSIONS_ROUTE_SUBPATH, CONNECTIONS_ROUTE_SUBPATH, CONNECTION_DISCONNECT_ROUTE_SUBPATH, CONNECT_COMPLETE_ROUTE_SUBPATH, CONNECT_OPTIONS_ROUTE_SUBPATH, CONNECT_START_ROUTE_SUBPATH, CONNECT_SUBMIT_ROUTE_SUBPATH, CURRENT_USER_ROUTE_PATH, type CatalogDetailData, type CatalogDetailLatestData, type CatalogIntegrationSummaryData, type CatalogListData, type CatalogPublishData, type CatalogToolFunctionData, type CatalogTriggerFunctionData, type CatalogVersionSummaryData, type CheckFlowReadinessResponse, type CompiledFlowVersionSummaryData, type ConnectCompleteResultData, type ConnectCompletedResultData, type ConnectDefaultUnavailableReason, type ConnectFieldDefData, type ConnectInputNextActionData, type ConnectInputTarget, type ConnectOptionsData, type ConnectRedirectNextActionData, type ConnectStartBody, type ConnectStartResultData, type ConnectSubmitBody, type ConnectSubmitResultData, type ConnectionAuthType, type ConnectionListData, type ConnectionSummaryData, type ControlPlaneToolData, type ControlPlaneToolDeliveryData, type ControlPlaneTriggerData, type CreateAgentPromptInput, type CreateFlowAuthoringTaskInput, type CreateFlowCreationTaskResult, type CreateFlowSceneInput, type CreateFlowTemplateInput, type CurrentUserData, DEFAULT_WORKSPACE_ROUTE_PATH, type DefaultProviderAppConfigAdminData, type DefaultProviderAppConfigDisableData, type DefaultProviderAppConfigUpsertBody, type DefaultProviderAppConfigWriteData, type DefaultWorkspaceUpdateBody, type DefaultWorkspaceUpdateData, type DeletedFlowSummaryData, type DeliverFlowRunEventData, type DisconnectResultData, FLOW_AUTHORING_EDIT_TOOL_NAMES, FLOW_AUTHORING_TOOL_DESCRIPTORS, FLOW_AUTHORING_TOOL_NAMES, FLOW_DISABLE_ROUTE_SUBPATH, FLOW_DRAFT_COMMAND_INVALID_ERROR_CODE, FLOW_DRAFT_EDIT_LOCKED_ERROR_CODE, FLOW_DRAFT_NOT_PUBLISHABLE_ERROR_CODE, FLOW_DRAFT_REVISION_CONFLICT_ERROR_CODE, FLOW_DRAFT_ROUTE_SUBPATH, FLOW_EDIT_TURN_NOT_HELD_ERROR_CODE, FLOW_ENABLE_ROUTE_SUBPATH, FLOW_ITEM_ROUTE_SUBPATH, FLOW_PUBLISH_CONFIRMATION_REQUIRED_ERROR_CODE, FLOW_READINESS_REQUIREMENT_CONFLICT_ERROR_CODE, FLOW_READINESS_REQUIREMENT_NOT_FOUND_ERROR_CODE, FLOW_RUN_STATUSES, FLOW_VALIDATE_ROUTE_SUBPATH, FLOW_VERSIONS_ROUTE_SUBPATH, FLOW_VERSION_ITEM_ROUTE_SUBPATH, FLOW_WORKING_DRAFT_NOT_FOUND_ERROR_CODE, type FallbackAuthoringPlan, type FlowAssetIndexDocType, type FlowAssetIndexDocument, type FlowAssetStatus, type FlowAssetStrength, type FlowAuthoringAssetRef, type FlowAuthoringBrief, type FlowAuthoringBriefSummary, type FlowAuthoringDecisionContextRef, type FlowAuthoringDecisionContextRefKind, type FlowAuthoringEditToolName, type FlowAuthoringSceneBrief, type FlowAuthoringStrategyMode, type FlowAuthoringTemplateBrief, type FlowAuthoringToolDescriptor, type FlowAuthoringToolExecution, type FlowAuthoringToolInputSchema, type FlowAuthoringToolName, type FlowBadgeData, FlowCompositionSpec, type FlowCreationDecisionKind, type FlowCreationDecisionRecordData, type FlowCreationLifecycleEventData, type FlowCreationLifecycleEventType, type FlowCreationTaskData, type FlowCreationTaskState, type FlowDeleteData, type FlowDraftActor, type FlowDraftCommand, type FlowDraftEditTurn, type FlowDraftProjection, type FlowDraftPublishRequest, type FlowDraftPublishResult, type FlowDraftRecordData, type FlowDraftStatus, type FlowGoalAssumption, type FlowGoalAssumptionSource, type FlowGoalDelivery, type FlowGoalDeliveryKind, type FlowGoalPersistence, type FlowGoalScheduleFrequency, type FlowGoalSpec, type FlowGoalSpecifiedIntegration, type FlowGoalTrigger, FlowIrValidationResult, type FlowListData, type FlowListItemData, type FlowMetaUpdate, FlowNode, type FlowPublishData, type FlowReadinessRequirementStatus, type FlowReadinessRequirementType, type FlowReadinessResultData, type FlowRecordData, type FlowRunCancelData, type FlowRunDetailData, type FlowRunListData, type FlowRunStatus, type FlowRunSummaryData, type FlowRunTerminalErrorData, type FlowRunTriggerData, type FlowSceneAsset, type FlowSceneCandidate, type FlowSceneDefaultStrategy, type FlowSceneListData, type FlowSceneOverridable, type FlowScenePersistence, type FlowScenePreferredIntegration, type FlowSceneTriggerType, type FlowSceneWriteData, type FlowSlotResolution, type FlowSlotResolutionSource, type FlowStatus, type FlowTemplateAsset, type FlowTemplateCandidate, type FlowTemplateListData, type FlowTemplateWriteData, type FlowToolError, type FlowValidateData, type FlowValidationIssueData, type FlowVersionGetData, type FlowVersionListData, type FlowWithDraftData, type FlowWorkingDraftOpenRequest, type FlowWorkingDraftOwner, type FlowWorkingDraftOwnerKind, type FlowWorkingDraftSummary, GLOBAL_INBOX_ENTRIES_ROUTE_PREFIX, type GetFlowContextInput, type GetWorkingFlowIrInput, type GetWorkingFlowIrOutput, type GlobalInboxEntryDetailData, type GlobalInboxEntryListData, type GlobalInboxEntryListEntryData, type GlobalInboxEntryListQuery, type GlobalInboxWorkspaceData, HUMAN_INPUT_TOKENS_ROUTE_PREFIX, HUMAN_INPUT_TOKEN_ROUTE_SUBPATH, HUMAN_INPUT_TOKEN_SUBMIT_ROUTE_SUBPATH, type HumanInputPublicOutputData, type HumanInputRequestViewData, type HumanInputSubmitPayload, type HumanInputTokenSubmitData, type HumanInputTokenViewData, INBOX_ENTRY_HUMAN_INPUT_SUBMIT_ROUTE_SUBPATH, INBOX_ENTRY_ROUTE_SUBPATH, INBOX_ITEM_ROUTE_SUBPATH, INTEGRATION_ITEM_ROUTE_SUBPATH, INTEGRATION_TOOLS_ROUTE_SUBPATH, type InboxEntryDetailData, type InboxEntryListData, type InboxEntryListEntryData, type InboxEntryStatus, type InboxEntryType, type InboxHumanInputEntryData, type InboxItemDetailData, type InboxItemDetailEntryData, type InboxItemListData, type InboxItemListEntryData, type InboxLinksData, type InboxReportData, type InstallationCatalogInfoData, type InstallationData, type InstallationSource, type InstallationToolsData, type IntegrationGetData, type IntegrationInstallBody, type IntegrationInstallData, type IntegrationListData, type IntegrationUninstallData, JsonObject, JsonValue, Mapping, ONE_OFF_EXECUTE_ACTION_TOOL_NAME, ONE_OFF_GET_ACTION_CONTEXT_TOOL_NAME, ONE_OFF_TOOL_NAMES, type OneOffActionContext, type OneOffExecuteActionInput, type OneOffExecuteActionOutput, type OneOffGetActionContextInput, type OneOffGetActionContextOutput, type OneOffToolName, type OpenFlowWorkingDraftResponse, PLATFORM_ACCESS_PERMISSION, PLATFORM_API_KEY_MANAGE_PERMISSION, PROVIDER_CALLBACK_REDIRECT_ROUTE_PATH, type PromptTargetKey, type ProposePublishInput, type ProposePublishOutput, type ProviderAppConfigSource, type ProviderSetupData, type PublicCompiledFlowVersionData, type PublicResolvedBindingData, type PublicResolvedToolBindingData, type PublicResolvedTriggerBindingData, RUN_CANCEL_ROUTE_SUBPATH, RUN_EVENTS_ROUTE_SUBPATH, RUN_ITEM_ROUTE_SUBPATH, type RegistrationSummaryData, type ReindexFlowSceneResult, type ReindexFlowTemplateResult, type RemoveNodeInput, type RemoveTriggerInput, type RenderModelInputPreviewInput, type RenderModelInputPreviewResult, type RequestConnectInput, type RequestConnectOutput, type ResolveFlowReadinessRequirementRequest, type ResolveFlowReadinessRequirementResponse, STEP_RUN_STATUSES, type SafeFlowReadinessRequirementData, type SetCompositionInput, type SetFlowMetaInput, type SetOutputsInput, type SetTriggerInput, type SimulateTriggerBody, type SimulateTriggerData, type SimulateTriggerEventBody, type StepRunStatus, type StepRunSummaryData, TRIGGER_INSTANCES_ROUTE_SUBPATH, TRIGGER_SIMULATE_ROUTE_SUBPATH, TriggerBinding, type TriggerInstanceDiagnosticData, type TriggerInstanceLastErrorData, type TriggerInstanceStatus, type TriggerInstancesData, type TruncatedPlaceholder, type UpdateAgentPromptInput, type UpdateFlowSceneInput, type UpdateFlowTemplateInput, type UpdateNodeInput, type ValidateAgentPromptResult, type ValidateFlowSceneResult, type ValidateFlowTemplateResult, type ValidateFlowToolInput, type ValidateToolOutput, WORKSPACES_ROUTE_PREFIX, WORKSPACE_ACCESS_ROUTE_SUBPATH, WORKSPACE_CONNECTION_MOUNT_PREFIX, WORKSPACE_FLOWS_ROUTE_PREFIX, WORKSPACE_FLOW_RUNS_ROUTE_PREFIX, WORKSPACE_INBOX_ENTRIES_ROUTE_PREFIX, WORKSPACE_INBOX_ITEMS_ROUTE_PREFIX, WORKSPACE_INTEGRATIONS_ROUTE_PREFIX, WORKSPACE_LIST_ROUTE_SUBPATH, WORKSPACE_RUNS_ROUTE_PREFIX, type WorkingIrSummary, type WorkspaceAccessData, type WorkspaceAccessSummaryData, type WorkspaceData, type WorkspaceListData, type WorkspaceMembershipData, type WorkspaceMembershipRole, agentAssetFlowScenesPath, agentAssetFlowTemplatesPath, agentAssetPromptsPath, agentChatPath, agentFlowCreationDecisionPath, agentFlowCreationTaskPath, agentFlowReadinessRequirementResolvePath, agentFlowWorkingDraftCommandsPath, agentFlowWorkingDraftEditTurnAcquirePath, agentFlowWorkingDraftEditTurnReleasePath, agentFlowWorkingDraftOpenPath, agentFlowWorkingDraftPath, agentFlowWorkingDraftPublishPath, agentFlowWorkingDraftReadinessCheckPath, agentSessionPath, agentSessionsPath, apiKeyGrantOptionsPath, apiKeyPath, apiKeysPath, appBootstrapPath, catalogDefaultProviderAppConfigPath, catalogIntegrationPath, catalogIntegrationsPath, catalogVersionsPath, connectCompletePath, connectOptionsPath, connectStartPath, connectSubmitPath, connectionDisconnectPath, currentUserPath, defaultWorkspacePath, findFlowAuthoringToolDescriptor, flowDisablePath, flowDraftPath, flowEnablePath, flowPath, flowRunsPath, flowValidatePath, flowVersionPath, flowVersionsPath, formatFlowToolError, globalInboxEntriesPath, globalInboxEntryHumanInputSubmitPath, globalInboxEntryPath, humanInputTokenPath, humanInputTokenSubmitPath, inboxEntryHumanInputSubmitPath, inboxEntryPath, inboxItemPath, installationToolsPath, runCancelPath, runEventsPath, runPath, triggerInstancesPath, triggerSimulatePath, workspaceConnectionsPath, workspaceFlowsPath, workspaceInboxEntriesPath, workspaceInboxItemsPath, workspaceIntegrationPath, workspaceIntegrationsPath, workspacePath, workspaceRunsPath, workspacesPath };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var se="0.2.0";var at="flow.ir.v1";var ae="flow.interp.v2";function p(e){return{ok:!0,value:e}}function o(e){return{ok:!1,reason:e}}function i(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var f="/internal/flow-runs",ct="/:flowRunId/execution-context";function gt(e){return`${f}/${encodeURIComponent(e)}/execution-context`}function pe(e){return!i(e)||!L(e.fileMaxBytes)||!L(e.fileReadMaxBytes)||!L(e.inlineMultipartBytesMax)?o("file runtime limits must carry three positive integer bounds"):p({fileMaxBytes:e.fileMaxBytes,fileReadMaxBytes:e.fileReadMaxBytes,inlineMultipartBytesMax:e.inlineMultipartBytesMax})}function ft(e){if(!i(e))return o("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)||!le(e.executionBindings))return o("execution context surface shape is invalid");let n=ue(e.fileRuntime);return n.ok?p({...e,fileRuntime:n.value}):o(n.reason)}function ue(e){if(e===null)return p(null);if(!i(e))return o("fileRuntime must be null or an object");let t=pe(e.limits);return t.ok?p({limits:t.value}):o(t.reason)}function le(e){return Array.isArray(e)?e.every(t=>{if(!i(t))return!1;let n=t.connection;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"}):!1}function L(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var Rt="/:flowRunId/steps/:nodeId/result",It="/:flowRunId/result",Tt="/:flowRunId/event-waits/:nodeId";function xt(e,t){return`${f}/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}/result`}function wt(e){return`${f}/${encodeURIComponent(e)}/result`}function Et(e,t){return`${f}/${encodeURIComponent(e)}/event-waits/${encodeURIComponent(t)}`}function At(e){if(!i(e))return{ok:!1,kind:"validation",reason:"step record body must be a JSON object"};let t=_(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 r=de(e.result);if(!r.ok)return r;let s={attempt:n,result:r.value};if(e.durationMs!==void 0){let a=e.durationMs;if(typeof a!="number"||!Number.isFinite(a)||a<0)return{ok:!1,kind:"validation",reason:"durationMs must be a non-negative number"};s.durationMs=a}return{ok:!0,value:s}}function de(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=_(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=_(e,["status","errorCode","issues"]);if(n!==void 0)return{ok:!1,kind:"validation",reason:`step record result does not accept the "${n}" field`};let r=e.errorCode;if(typeof r!="string"||r.length===0)return{ok:!1,kind:"step_result_invalid",reason:"a failed result must carry a non-empty errorCode"};let s={status:"failed",errorCode:r};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 kt(e){return!i(e)||typeof e.flowRunId!="string"||typeof e.nodeId!="string"||e.recorded!=="succeeded"&&e.recorded!=="failed"?o("step record data surface shape is invalid"):p({flowRunId:e.flowRunId,nodeId:e.nodeId,recorded:e.recorded})}function St(e){if(!i(e))return o("result body must be a JSON object");let t=_(e,["status","output","error","composition"]);if(t!==void 0)return o(`result does not accept the "${t}" field`);let n=e.status;if(n!=="succeeded"&&n!=="failed")return o('result status must be "succeeded" or "failed"');let r={status:n};if(e.output!==void 0&&(r.output=e.output),e.error!==void 0){let s=e.error;if(!i(s))return o("result error must be a JSON object");let a=_(s,["code","message"]);if(a!==void 0)return o(`result error does not accept the "${a}" field`);if(typeof s.code!="string"||typeof s.message!="string")return o("result error must carry string code and message");r.error={code:s.code,message:s.message}}if(e.composition!==void 0){if(n!=="succeeded")return o("composition is only allowed on a succeeded result");r.composition=e.composition}return p(r)}function ht(e){return i(e)?p(e):o("flow run result data must be a JSON object")}var ce=/^[A-Za-z0-9_-]{1,100}$/;function Pt(e){if(!i(e))return o("register body must be a JSON object");let t=_(e,["eventType","correlationKey"]);if(t!==void 0)return o(`register wait does not accept the "${t}" field`);let n=q(e.eventType);if(!n.ok)return o(n.reason);let r=e.correlationKey;return typeof r!="string"||r.length===0?o("correlationKey must be a non-empty string"):p({eventType:n.value,correlationKey:r})}function Ot(e){if(!i(e))return o("complete body must be a JSON object");let t=_(e,["eventType","correlationKey","outcome","eventId"]);if(t!==void 0)return o(`complete wait does not accept the "${t}" field`);let n=e.outcome;if(n!=="received"&&n!=="timed_out")return o('outcome must be "received" or "timed_out"');let r=q(e.eventType);if(!r.ok)return o(r.reason);let s=e.correlationKey;if(typeof s!="string"||s.length===0)return o("correlationKey must be a non-empty string");let a={eventType:r.value,correlationKey:s,outcome:n};if(e.eventId!==void 0){if(typeof e.eventId!="string"||e.eventId.length===0)return o("eventId must be a non-empty string");a.eventId=e.eventId}return p(a)}function bt(e){return!i(e)||e.registered!==!0?o("register wait data surface shape is invalid"):p({registered:!0})}function q(e){return typeof e!="string"||e.length===0?o("eventType must be a non-empty string"):ce.test(e)?p(e):o("eventType must match ^[A-Za-z0-9_-]{1,100}$")}function _(e,t){return Object.keys(e).find(n=>!t.includes(n))}var ge="/internal/flow-versions",Dt="/:flowVersionId/handler-bundles",G="/internal/installations",Ct="/:installationId/handler-bundles";function vt(e,t){return`${ge}/${encodeURIComponent(e)}/handler-bundles?compiledArtifactId=${encodeURIComponent(t)}`}function Ft(e){return`${G}/${encodeURIComponent(e.installationId)}/handler-bundles?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var fe=new Set(["managed_only","managed_plus_unmanaged_sdk"]);function P(e){if(!y(e))return H("runtimeNetwork must be a JSON object");let t=e.networkModel;return typeof t!="string"||!fe.has(t)?H("runtimeNetwork.networkModel is unknown"):!j(e.apiHosts)||!j(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 Ut(e){if(!y(e)||typeof e.flowVersionId!="string"||typeof e.compiledArtifactId!="string"||!Array.isArray(e.bundles))return E("handler bundles data surface shape is invalid");let t=J(e.bundles);return t.ok?{ok:!0,value:{flowVersionId:e.flowVersionId,compiledArtifactId:e.compiledArtifactId,bundles:t.value}}:t}function Bt(e){if(!y(e)||typeof e.installationId!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.bundles))return E("tool handler bundles data surface shape is invalid");let t=J(e.bundles);return t.ok?{ok:!0,value:{installationId:e.installationId,artifactDigest:e.artifactDigest,bundles:t.value}}:t}function J(e){let t=[];for(let n of e){let r=me(n);if(!r.ok)return r;t.push(r.value)}return{ok:!0,value:t}}function me(e){if(!y(e)||typeof e.toolRef!="string"||e.kind!=="handler"&&e.kind!=="request")return E("handler bundle entry shape is invalid");if(e.kind==="request"){if(e.module!==void 0)return E("a request bundle must not carry a module");let r=P(e.runtimeNetwork);return r.ok?{ok:!0,value:{toolRef:e.toolRef,kind:"request",runtimeNetwork:r.value}}:r}let t=e.module;if(!y(t)||typeof t.entry!="string"||t.entry.length===0||!_e(t.files))return E("a handler bundle must carry a { entry, files } module");let n=P(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 E(e){return{ok:!1,kind:"shape",reason:e}}function H(e){return{ok:!1,kind:"runtime_network",reason:e}}function y(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function j(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function _e(e){return y(e)&&Object.values(e).every(t=>typeof t=="string")}var A="/internal/webhook-trigger-instances",Mt="/:triggerInstanceId/context",Kt="/:triggerInstanceId/handler-bundles",Wt="/:triggerInstanceId/deliveries/:deliveryId",Vt="/:triggerInstanceId/events",qt="/:triggerInstanceId/rearm",jt="/:triggerInstanceId/store/:namespace/:key",R=e=>`${A}/${encodeURIComponent(e)}`;function Jt(e,t){return`${R(e)}/context?artifactDigest=${encodeURIComponent(t)}`}function Xt(e,t){return`${R(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function Yt(e,t){return`${R(e)}/deliveries/${encodeURIComponent(t)}`}function zt(e){return`${R(e)}/events`}function Qt(e){return`${R(e)}/rearm`}function Zt(e,t,n){return`${R(e)}/store/${encodeURIComponent(t)}/${encodeURIComponent(n)}`}var en="/:installationId/webhook-protocol-adapter-bundle";function tn(e){return`${G}/${encodeURIComponent(e.installationId)}/webhook-protocol-adapter-bundle?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var nn="modules/webhook/protocol-adapter.js";function rn(e){return`modules/webhook/protocol-adapter-${e}.js`}function on(e){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&&!ye(e.connection)||!Re(e.runtime)?o("webhook watcher context surface shape is invalid"):p(e)}function ye(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 sn(e){if(!i(e)||typeof e.deliveryId!="string"||typeof e.receivedAt!="string"||!i(e.request))return o("webhook delivery surface shape is invalid");let t=e.request;return t.method!=="POST"||!i(t.headers)||typeof t.rawBody!="string"?o("webhook delivery request shape is invalid"):p(e)}function an(e){if(!i(e)||typeof e.triggerRef!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.modules)||!e.modules.every(Ie))return{ok:!1,kind:"shape",reason:"trigger handler bundles data surface shape is invalid"};let t=P(e.runtimeNetwork);return t.ok?{ok:!0,value:{triggerRef:e.triggerRef,artifactDigest:e.artifactDigest,modules:e.modules,runtimeNetwork:t.value}}:t}function Ie(e){return i(e)&&typeof e.specifier=="string"&&e.specifier.length>0&&typeof e.source=="string"}function Te(e){return!i(e)||!("value"in e)?o("webhook store get surface shape is invalid"):p(e.value)}function pn(e){if(!i(e))return o("publish events body must be a JSON object");let t=O(e,["deliveryId","events"]);if(t!==void 0)return o(`publish events does not accept the "${t}" field`);let n=e.deliveryId;if(typeof n!="string"||n.length===0)return o("deliveryId must be a non-empty string");let r=e.events;if(!Array.isArray(r))return o("events must be an array");let s=[];for(let a of r){let u=xe(a);if(!u.ok)return u;s.push(u.value)}return p({deliveryId:n,events:s})}function xe(e){if(!i(e))return o("each event must be a JSON object");let t=O(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return o(`event does not accept the "${t}" field`);let n=e.eventId;if(typeof n!="string"||n.length===0)return o("eventId must be a non-empty string");let r=e.occurredAt;if(typeof r!="string"||r.length===0)return o("occurredAt must be a non-empty string");if(!i(e.payload))return o("event payload must be a JSON object");let s={eventId:n,occurredAt:r,payload:e.payload};if(e.dedupeKey!==void 0){if(typeof e.dedupeKey!="string"||e.dedupeKey.length===0)return o("dedupeKey must be a non-empty string");s.dedupeKey=e.dedupeKey}return p(s)}function un(e){if(!i(e))return o("rearm body must be a JSON object");let t=O(e,["expectedWatcherInstanceId"]);if(t!==void 0)return o(`rearm does not accept the "${t}" field`);let n=e.expectedWatcherInstanceId;return typeof n!="string"||n.length===0?o("expectedWatcherInstanceId must be a non-empty string"):p({expectedWatcherInstanceId:n})}function we(e){if(!i(e))return o("store body must be a JSON object");let t=O(e,["value"]);return t!==void 0?o(`store put does not accept the "${t}" field`):"value"in e?p({value:e.value}):o("store put requires a value field")}function O(e,t){return Object.keys(e).find(n=>!t.includes(n))}var k="/internal/polling-trigger-instances",cn="/:pollingInstanceId/context",gn="/:pollingInstanceId/handler-bundles",fn="/:pollingInstanceId/ticks/:tickId/events",mn="/:pollingInstanceId/store/:namespace/:key",b=e=>`${k}/${encodeURIComponent(e)}`;function _n(e,t,n){return`${b(e)}/context?artifactDigest=${encodeURIComponent(t)}&tickId=${encodeURIComponent(n)}`}function yn(e,t){return`${b(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function Rn(e,t){return`${b(e)}/ticks/${encodeURIComponent(t)}/events`}function In(e,t,n){return`${b(e)}/store/${encodeURIComponent(t)}/${encodeURIComponent(n)}`}function Tn(e){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&&!Ee(e.connection)||!Ae(e.runtime)||!ke(e.tick)||!Se(e.limits)?o("polling trigger context surface shape is invalid"):p(e)}function Ee(e){return i(e)&&typeof e.connectionId=="string"&&typeof e.connectionRef=="string"&&typeof e.integrationRef=="string"&&typeof e.authType=="string"}function Ae(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 r=t.dedup;return i(r)&&(r.strategy==="cursor"||r.strategy==="hash"||r.strategy==="id_field")}function ke(e){return i(e)&&typeof e.tickId=="string"&&typeof e.scheduledAt=="string"&&typeof e.attempt=="number"}function Se(e){return i(e)&&typeof e.maxEventsPerTick=="number"}function xn(e){if(!i(e))return o("publish body must be a JSON object");let t=X(e,["events","nextCursor"]);if(t!==void 0)return o(`publish does not accept the "${t}" field`);let n=e.events;if(!Array.isArray(n))return o("events must be an array");let r=[];for(let a of n){let u=he(a);if(!u.ok)return u;r.push(u.value)}let s={events:r};if("nextCursor"in e){let a=e.nextCursor;if(a!==null&&typeof a!="string")return o("nextCursor must be a string, null, or omitted");s.nextCursor=a}return p(s)}function he(e){if(!i(e))return o("each event must be a JSON object");let t=X(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return o(`event does not accept the "${t}" field`);if(typeof e.eventId!="string"||e.eventId.length===0)return o("event eventId must be a non-empty string");if(!i(e.payload))return o("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 o("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 o("event dedupeKey must be a non-empty string");n.dedupeKey=e.dedupeKey}return p(n)}function wn(e){return!i(e)||typeof e.tickId!="string"||typeof e.cursorUpdated!="boolean"||!Array.isArray(e.results)||!e.results.every(Pe)?o("publish polling tick events data surface shape is invalid"):p(e)}function Pe(e){return i(e)&&typeof e.eventId=="string"&&typeof e.dedupeKey=="string"&&typeof e.duplicate=="boolean"&&(e.flowRunId===null||typeof e.flowRunId=="string")}function X(e,t){return Object.keys(e).find(n=>!t.includes(n))}var Y="/internal/egress-grants",$="/internal/tool-invocations",On="/:flowRunId/egress-grant",bn="/:invocationId/egress-grant",Nn="/:pollingInstanceId/egress-grant",Dn="/:triggerInstanceId/egress-grant",Cn="/:grantId/consume",vn="/:grantId/audit",Fn=e=>`${f}/${encodeURIComponent(e)}/egress-grant`,Un=e=>`${$}/${encodeURIComponent(e)}/egress-grant`,Bn=e=>`${k}/${encodeURIComponent(e)}/egress-grant`,Ln=e=>`${A}/${encodeURIComponent(e)}/egress-grant`,Hn=e=>`${Y}/${encodeURIComponent(e)}/consume`,Gn=e=>`${Y}/${encodeURIComponent(e)}/audit`,Oe=["flow_action","single_tool","polling_trigger","webhook_trigger"],be=/^[A-Za-z0-9][A-Za-z0-9:_+/=.-]{15,1023}$/;function S(e){return typeof e=="string"&&be.test(e)}function Ne(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(r=>i(r)?r.kind==="file"&&typeof r.file_id=="string"&&r.file_id.length>0:!1):!1}function l(e){return{ok:!1,kind:"shape",reason:e}}function h(){return{ok:!1,kind:"request_digest",reason:"request digest is missing or malformed"}}function D(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 C(e){if(!i(e))return"request must be a JSON object"}function $n(e){let t=D(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 r=C(t.record.request);if(r!==void 0)return l(r);let s=t.record.requestDigest;return S(s)?{ok:!0,value:{nodeId:n,requestDigest:s,requestHasMultipartFiles:Ne(t.record.request)}}:h()}function Mn(e){let t=D(e,["request","requestDigest"]);if(!t.ok)return l(t.reason);let n=C(t.record.request);if(n!==void 0)return l(n);let r=t.record.requestDigest;return S(r)?{ok:!0,value:{requestDigest:r}}:h()}function Kn(e){let t=D(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 r=C(t.record.request);if(r!==void 0)return l(r);let s=t.record.requestDigest;return S(s)?{ok:!0,value:{tickId:n,requestDigest:s}}:h()}function Wn(e){let t=D(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 r=t.record.lifecycle,s;if(r!==void 0){if(r!=="enable"&&r!=="disable"&&r!=="renew")return l('lifecycle must be "enable", "disable", or "renew"');s=r}if(n==="lifecycle"&&s===void 0)return l("lifecycle is required for the lifecycle phase");let a=C(t.record.request);if(a!==void 0)return l(a);let u=t.record.requestDigest;return S(u)?{ok:!0,value:{phase:n,...s!==void 0?{lifecycle:s}:{},requestDigest:u}}:h()}function z(e){return Oe.includes(e)?e:void 0}var De=["scopeKind","scopeId","requestDigest"];function Vn(e){if(!i(e))return l("consume body must be a JSON object");for(let s of Object.keys(e))if(!De.includes(s))return l(`consume does not accept the "${s}" field`);let t=z(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 r=e.requestDigest;return S(r)?{ok:!0,value:{scopeKind:t,scopeId:n,requestDigest:r}}:h()}var Ce=["scopeKind","scopeId","providerHost","status","durationMs","requestBytes","responseBytes","errorCode"];function N(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 qn(e){if(!i(e))return l("audit body must be a JSON object");for(let c of Object.keys(e))if(!Ce.includes(c))return l(`audit does not accept the "${c}" field`);let t=z(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 r=e.providerHost;if(typeof r!="string"||r.length===0)return l("providerHost is required");let s=N(e.durationMs,"durationMs");if(!s.ok)return l(s.reason);let a;if(e.status!==void 0){let c=N(e.status,"status");if(!c.ok)return l(c.reason);a=c.value}let u;if(e.requestBytes!==void 0){let c=N(e.requestBytes,"requestBytes");if(!c.ok)return l(c.reason);u=c.value}let d;if(e.responseBytes!==void 0){let c=N(e.responseBytes,"responseBytes");if(!c.ok)return l(c.reason);d=c.value}let B;if(e.errorCode!==void 0){let c=e.errorCode;if(typeof c!="string"||c.length===0)return l("errorCode must be a non-empty string");B=c}return{ok:!0,value:{scopeKind:t,scopeId:n,providerHost:r,...a!==void 0?{status:a}:{},durationMs:s.value,...u!==void 0?{requestBytes:u}:{},...d!==void 0?{responseBytes:d}:{},...B!==void 0?{errorCode:B}:{}}}}function jn(e){return!i(e)||!i(e.grant)?o("egress grant envelope must carry a grant object"):p(e.grant)}function Jn(e){return!i(e)||e.consumed!==!0?o("egress grant consume data must carry consumed:true"):p({consumed:!0})}var tr="/:flowRunId/runtime-credential",nr="/:invocationId/runtime-credential",rr="/:pollingInstanceId/runtime-credential",or="/:triggerInstanceId/runtime-credential",ir=e=>`${f}/${encodeURIComponent(e)}/runtime-credential`,sr=e=>`${$}/${encodeURIComponent(e)}/runtime-credential`,ar=e=>`${k}/${encodeURIComponent(e)}/runtime-credential`,pr=e=>`${A}/${encodeURIComponent(e)}/runtime-credential`,ur=["flow_action","tool_invoke","polling_trigger","webhook_trigger"];function v(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 lr(e){let t=v(e,["nodeId"]);if(!t.ok)return o(t.reason);let n=t.record.nodeId;return typeof n!="string"||n.length===0?o("nodeId is required"):p({nodeId:n})}function dr(e){let t=v(e??{},[]);return t.ok?p(null):o(t.reason)}function cr(e){let t=v(e,["tickId"]);if(!t.ok)return o(t.reason);let n=t.record.tickId;return typeof n!="string"||n.length===0?o("tickId is required"):p({tickId:n})}function gr(e){let t=v(e,["executionKind","deliveryId","lifecycleOperation"]);if(!t.ok)return o(t.reason);let n=t.record.executionKind;if(n!=="event_handler"&&n!=="lifecycle")return o('executionKind must be "event_handler" or "lifecycle"');let r,s=t.record.deliveryId;if(s!==void 0){if(typeof s!="string"||s.length===0)return o("deliveryId must be a non-empty string");r=s}let a,u=t.record.lifecycleOperation;if(u!==void 0){if(u!=="enable"&&u!=="disable"&&u!=="renew")return o('lifecycleOperation must be "enable", "disable", or "renew"');a=u}return n==="lifecycle"&&a===void 0?o("lifecycleOperation is required for the lifecycle execution kind"):p({executionKind:n,...r!==void 0?{deliveryId:r}:{},...a!==void 0?{lifecycleOperation:a}:{}})}function fr(e){return!i(e)||typeof e.sessionId!="string"||typeof e.connectionId!="string"||!i(e.credential)?o("runtime credential session must carry sessionId, connectionId and a credential object"):p(e.credential)}var M="/internal/files",yr="/:fileId/stat",Rr="/:fileId/content",Ir=()=>M,Q=e=>`?scope_kind=${encodeURIComponent(e.scopeKind)}&scope_id=${encodeURIComponent(e.scopeId)}`,Tr=(e,t)=>`${M}/${encodeURIComponent(e)}/stat${Q(t)}`,xr=(e,t)=>`${M}/${encodeURIComponent(e)}/content${Q(t)}`;function wr(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"?o("file ref data does not match the AIS file-ref shape"):p(e)}var Sr="/:flowRunId/human-inputs",hr="/:flowRunId/human-inputs/:requestId",Pr="/:flowRunId/human-inputs/:requestId/expire",Or="/:flowRunId/human-inputs/:requestId/acknowledge",ve=e=>`${f}/${encodeURIComponent(e)}/human-inputs`,Z=(e,t)=>`${ve(e)}/${encodeURIComponent(t)}`,br=(e,t)=>`${Z(e,t)}/expire`,Nr=(e,t)=>`${Z(e,t)}/acknowledge`,Fe="human_input_resolved";function Dr(e){return`${Fe}_${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 I(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 Le(e){let t=m(e,"renderedPrompt");if(!t.ok)return t;let n=I(t.value.title,"renderedPrompt.title");if(!n.ok)return n;let r={title:n.value};if(t.value.body!==void 0){if(typeof t.value.body!="string")return g("renderedPrompt.body must be a string");r.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");r.format=t.value.format}return{ok:!0,value:r}}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 Ge(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 r=[];for(let s of n){let a=m(s,"delivery action");if(!a.ok)return a;let u=I(a.value.id,"delivery action id");if(!u.ok)return u;let d=ee(a.value.inputs,`delivery action '${u.value}' inputs`);if(!d.ok)return d;r.push({id:u.value,inputs:d.value})}return{ok:!0,value:{actions:r}}}function ee(e,t){let n=m(e,t);if(!n.ok)return n;let r={};for(let[s,a]of Object.entries(n.value)){let u=te(a,`${t}.${s}`);if(!u.ok)return u;r[s]=u.value}return{ok:!0,value:r}}function te(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=I(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[a,u]of n.value.items.entries()){let d=te(u,`${t}[${a}]`);if(!d.ok)return d;s.push(d.value)}return{ok:!0,value:{kind:"array",items:s}}}case"object":{let s=ee(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[a,u]of n.value.parts.entries()){let d=$e(u,`${t}.parts[${a}]`);if(!d.ok)return d;s.push(d.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 r=n.value.kind;if(r==="literal")return typeof n.value.value!="string"?g(`${t}.value must be a string`):{ok:!0,value:{kind:"literal",value:n.value.value}};if(r==="human_input_ref"){let s=I(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 Cr(e){let t=m(e,"request body");if(!t.ok)return o(t.reason);let n=I(t.value.nodeId,"nodeId");if(!n.ok)return o(n.reason);let r=Le(t.value.renderedPrompt);if(!r.ok)return o(r.reason);let s=He(t.value.input);if(!s.ok)return o(s.reason);let a=I(t.value.timeout,"timeout");if(!a.ok)return o(a.reason);let u=Be(t.value.expiresAt,"expiresAt");if(!u.ok)return o(u.reason);let d=Ge(t.value.partiallyRenderedDelivery);return d.ok?p({nodeId:n.value,renderedPrompt:r.value,input:s.value,timeout:a.value,expiresAt:u.value,...d.value!==void 0?{partiallyRenderedDelivery:d.value}:{}}):o(d.reason)}function Me(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))?o("human input request view must carry id, nodeId, status and output"):p(e)}function vr(e){if(!i(e)||typeof e.created!="boolean")return o("human input create data must carry created:boolean");let t=Me(e.request);return t.ok?p({created:e.created,request:t.value}):t}function Fr(e){return!i(e)||e.acknowledged!==!0?o("human input acknowledge data must carry acknowledged:true"):p({acknowledged:!0})}var Br="ablehi-wfp-user-runtime-manifest/v1",Lr="unknown";function Hr(e){return e.endsWith(".js")?`${e.slice(0,-3)}.manifest.json`:`${e}.manifest.json`}var $r="/internal/deployment-handshake",Ke=["start","terminate","send-event","start-webhook-watcher","run-polling-tick","invoke-tool","invoke-trigger-handler","invoke-webhook-protocol-adapter","deployment-handshake"],Mr=Ke,Kr="HANDSHAKE_REQUEST_INVALID",Wr="HANDSHAKE_SECRET_UNCONFIGURED",Vr="HANDSHAKE_SECRET_MISMATCH",qr="HANDSHAKE_CONTRACT_VERSION_MISMATCH",jr="HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH",Jr="HANDSHAKE_CAPABILITY_MISSING";function Xr(e){return[e.nonce,e.timestamp,e.contractVersion,e.dispatchNamespace].map(n=>`${n.length}:${n}`).join(".")}function Yr(e){return["response",e.nonce,e.contractVersion,e.dispatchNamespace,...e.capabilities].map(n=>`${n.length}:${n}`).join(".")}var Qr="platform.access",Zr="platform.api_key.manage";var to="/me",no=()=>"/me";var We="/app/bootstrap",oo=()=>We;var ne="/workspaces",so="/",ao="/:workspaceId",Ve="/me/default-workspace",po=e=>`${ne}/${encodeURIComponent(e)}`,uo=()=>ne,lo=()=>Ve;var K="/api-keys",qe="/grant-options",go="/:apiKeyId",fo="ahi_key_",mo="workspace.full_access",_o=()=>K,yo=()=>`${K}${qe}`,Ro=e=>`${K}/${encodeURIComponent(e)}`;var W="/catalog",To="/integrations",xo="/integrations/:slug",wo="/versions",Eo="/integrations/:slug/default-provider-app-config",Ao=e=>{let t=`${W}/integrations`;return e?.category!==void 0&&e.category!==""?`${t}?category=${encodeURIComponent(e.category)}`:t},je=e=>`${W}/integrations/${encodeURIComponent(e)}`,ko=()=>`${W}/versions`,So=e=>`${je(e)}/default-provider-app-config`;var Po="/workspaces/:workspaceId/integrations",Oo="/:installationId",bo="/:installationId/tools",Je=e=>`/workspaces/${encodeURIComponent(e)}/integrations`,Xe=(e,t)=>`${Je(e)}/${encodeURIComponent(t)}`,No=(e,t)=>`${Xe(e,t)}/tools`;var Co="/workspaces/:workspaceId",vo="/connections",Fo="/integrations/:installationId/connect/start",Uo="/integrations/:installationId/connect/options",Bo="/connect-sessions/:sessionId/submit",Lo="/connect-sessions/:sessionId/complete",Ho="/integrations/:installationId/connections/:connectionRef",Go="/callbacks/redirect",T=e=>`/workspaces/${encodeURIComponent(e)}`,$o=e=>`${T(e)}/connections`,Mo=(e,t)=>`${T(e)}/integrations/${encodeURIComponent(t)}/connect/start`,Ko=(e,t)=>`${T(e)}/integrations/${encodeURIComponent(t)}/connect/options`,Wo=(e,t)=>`${T(e)}/connect-sessions/${encodeURIComponent(t)}/submit`,Vo=(e,t)=>`${T(e)}/connect-sessions/${encodeURIComponent(t)}/complete`,qo=(e,t,n)=>`${T(e)}/integrations/${encodeURIComponent(t)}/connections/${encodeURIComponent(n)}`;var Jo="/workspaces/:workspaceId/flows",Xo="/validate",Yo="/:flowId",zo="/:flowId/enable",Qo="/:flowId/disable",Zo="/:flowId/draft",ei="/:flowId/versions",ti="/:flowId/versions/:version",re=e=>`/workspaces/${encodeURIComponent(e)}/flows`,ni=e=>`${re(e)}/validate`,F=(e,t)=>`${re(e)}/${encodeURIComponent(t)}`,ri=(e,t)=>`${F(e,t)}/enable`,oi=(e,t)=>`${F(e,t)}/disable`,ii=(e,t)=>`${F(e,t)}/draft`,Ye=(e,t)=>`${F(e,t)}/versions`,si=(e,t,n)=>`${Ye(e,t)}/${n}`;var pi="/workspaces/:workspaceId/agent",ui="/chat",li="/flow-context",di="/sessions",ci="/sessions/:sessionId",gi=e=>`/workspaces/${encodeURIComponent(e)}/agent/chat`,fi=e=>`/workspaces/${encodeURIComponent(e)}/agent/sessions`,mi=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/sessions/${encodeURIComponent(t)}`,_i=20,yi=50,Ri=100,Ii="flow_authoring",Ti=["flow","flow_run","inbox_entry","integration"],xi=256,wi=10,Ei=256,Ai=["getFlowContext","getWorkingFlowIr","setFlowMeta","addNode","updateNode","removeNode","setTrigger","removeTrigger","setOutputs","setComposition","validateFlow","proposePublish","requestConnect"],ki=["setFlowMeta","addNode","updateNode","removeNode","setTrigger","removeTrigger","setOutputs","setComposition"];function Si(e){return JSON.stringify(e)}var U={type:"object",properties:{},additionalProperties:!1},x={type:"object",additionalProperties:!0},ze=[{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:U},{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:U},{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:{...x,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:{...x,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:{...x,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:{...x,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:{...x,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:{...x,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:U},{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:U},{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 hi(e){return ze.find(t=>t.name===e)}var Pi="AGENT_RUNTIME_UNCONFIGURED",Oi="AGENT_RUNTIME_FAILED",bi="AGENT_SESSION_NOT_FOUND",Ni="AGENT_MESSAGE_DELTA_INVALID",Di="AGENT_PAGE_CONTEXT_INVALID",V="/agent/assets",Ci="/prompts",vi="/prompts/:key/:revision",Fi="/prompts/:key/:revision/validate",Ui="/prompts/:key/:revision/activate",Bi="/prompt-bindings",Li="/prompt-bindings/:id",Hi="/prompt-bindings/:id/validate",Gi="/flow-scenes",$i="/flow-scenes/:sceneKey/:revision",Mi="/flow-scenes/:sceneKey/:revision/validate",Ki="/flow-scenes/:sceneKey/:revision/activate",Wi="/flow-scenes/:sceneKey/:revision/reindex",Vi="/flow-templates",qi="/flow-templates/:templateKey/:revision",ji="/flow-templates/:templateKey/:revision/validate",Ji="/flow-templates/:templateKey/:revision/activate",Xi="/flow-templates/:templateKey/:revision/reindex",Yi="/flow-working-drafts/open",zi="/flow-working-drafts/:draftId",Qi="/flow-working-drafts/:draftId/commands",Zi="/flow-working-drafts/:draftId/edit-turn/acquire",es="/flow-working-drafts/:draftId/edit-turn/release",ts="/flow-working-drafts/:draftId/publish",ns="/flow-working-drafts/:draftId/readiness/check",rs="/flow-working-drafts/:draftId/readiness/requirements/:requirementId/resolve",os="/flow-creation-tasks/:flowCreationTaskId",is="/flow-creation-decisions/:decisionRecordId",ss=()=>`${V}/prompts`,as=()=>`${V}/flow-scenes`,ps=()=>`${V}/flow-templates`,us=e=>`/workspaces/${encodeURIComponent(e)}/agent/flow-working-drafts/open`,w=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-working-drafts/${encodeURIComponent(t)}`,ls=(e,t)=>`${w(e,t)}/commands`,ds=(e,t)=>`${w(e,t)}/edit-turn/acquire`,cs=(e,t)=>`${w(e,t)}/edit-turn/release`,gs=(e,t)=>`${w(e,t)}/publish`,fs=(e,t)=>`${w(e,t)}/readiness/check`,ms=(e,t,n)=>`${w(e,t)}/readiness/requirements/${encodeURIComponent(n)}/resolve`,_s=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-creation-tasks/${encodeURIComponent(t)}`,ys=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-creation-decisions/${encodeURIComponent(t)}`,Rs="agent.asset.manage",Is=/^[A-Za-z0-9_-]{1,64}$/,Ts="flow_create_authoring_task",Qe="oneoff_getActionContext",Ze="oneoff_executeAction",xs=[Qe,Ze],ws=["agent.global.system","agent.intent.flow_goal_spec","agent.one_off.runtime","agent.flow_authoring.runtime","workflow.flow_authoring.scene_fit_judge","workflow.flow_authoring.template_fit_judge","workflow.flow_authoring.fallback_plan","workflow.flow_authoring.brief_generation","tool.flow_authoring.validate_repair"],Es=["general_agent","one_off_execution","flow_goal_generation","flow_scene_fit_judge","flow_template_fit_judge","fallback_authoring_plan","flow_authoring_brief_generation","flow_authoring_agent","flow_execution_content"],As="AGENT_ASSET_NOT_FOUND",ks="AGENT_ASSET_VALIDATION_FAILED",Ss="AGENT_PROMPT_BINDING_CONFLICT",hs="AGENT_FLOW_GOAL_INVALID",Ps="AGENT_FLOW_CREATION_TASK_NOT_FOUND",Os="AGENT_FLOW_CREATION_TASK_CONFLICT",bs="AGENT_FLOW_AUTHORING_WORKFLOW_FAILED",Ns="FLOW_WORKING_DRAFT_NOT_FOUND",Ds="FLOW_DRAFT_REVISION_CONFLICT",Cs="FLOW_DRAFT_COMMAND_INVALID",vs="FLOW_DRAFT_EDIT_LOCKED",Fs="FLOW_EDIT_TURN_NOT_HELD",Us="FLOW_DRAFT_NOT_PUBLISHABLE",Bs="FLOW_PUBLISH_CONFIRMATION_REQUIRED",Ls="FLOW_READINESS_REQUIREMENT_NOT_FOUND",Hs="FLOW_READINESS_REQUIREMENT_CONFLICT",Gs="AGENT_ASSET_INDEX_FAILED";var Ms="/workspaces/:workspaceId/runs",Ks="/workspaces/:workspaceId/flows/:flowId/runs",Ws="/:runId",Vs="/:runId/cancel",qs="/:runId/events",et=e=>`/workspaces/${encodeURIComponent(e)}/runs`,oe=(e,t)=>`${et(e)}/${encodeURIComponent(t)}`,js=(e,t)=>`${oe(e,t)}/cancel`,Js=(e,t)=>`${oe(e,t)}/events`,Xs=(e,t)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/runs`,Ys=["queued","running","succeeded","failed","interrupted","cancelled"],zs=["succeeded","skipped","timed_out","failed"];var Zs="/workspaces/:workspaceId/inbox/items",ea="/workspaces/:workspaceId/inbox/entries",ie="/inbox/entries",ta="/:itemId",na="/:entryId",ra="/:entryId/human-input/submit",tt=e=>`/workspaces/${encodeURIComponent(e)}/inbox/items`,oa=(e,t)=>`${tt(e)}/${encodeURIComponent(t)}`,nt=e=>`/workspaces/${encodeURIComponent(e)}/inbox/entries`,rt=(e,t)=>`${nt(e)}/${encodeURIComponent(t)}`,ia=(e,t)=>`${rt(e,t)}/human-input/submit`,sa=()=>ie,ot=e=>`${ie}/${encodeURIComponent(e)}`,aa=e=>`${ot(e)}/human-input/submit`;var ua="/human-input/tokens",la="/:token",da="/:token/submit",it=e=>`/human-input/tokens/${encodeURIComponent(e)}`,ca=e=>`${it(e)}/submit`;var fa="/:flowId/trigger-instances",ma="/:flowId/triggers/:triggerBindingId/simulate",_a=(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{V as AGENT_ASSETS_ROUTE_PREFIX,Gi as AGENT_ASSET_FLOW_SCENES_SUBPATH,Ki as AGENT_ASSET_FLOW_SCENE_ACTIVATE_SUBPATH,$i as AGENT_ASSET_FLOW_SCENE_ITEM_SUBPATH,Wi as AGENT_ASSET_FLOW_SCENE_REINDEX_SUBPATH,Mi as AGENT_ASSET_FLOW_SCENE_VALIDATE_SUBPATH,Vi as AGENT_ASSET_FLOW_TEMPLATES_SUBPATH,Ji as AGENT_ASSET_FLOW_TEMPLATE_ACTIVATE_SUBPATH,qi as AGENT_ASSET_FLOW_TEMPLATE_ITEM_SUBPATH,Xi as AGENT_ASSET_FLOW_TEMPLATE_REINDEX_SUBPATH,ji as AGENT_ASSET_FLOW_TEMPLATE_VALIDATE_SUBPATH,Gs as AGENT_ASSET_INDEX_FAILED_ERROR_CODE,Rs as AGENT_ASSET_MANAGE_PERMISSION,As as AGENT_ASSET_NOT_FOUND_ERROR_CODE,Ci as AGENT_ASSET_PROMPTS_SUBPATH,Ui as AGENT_ASSET_PROMPT_ACTIVATE_SUBPATH,Bi as AGENT_ASSET_PROMPT_BINDINGS_SUBPATH,Li as AGENT_ASSET_PROMPT_BINDING_ITEM_SUBPATH,Hi as AGENT_ASSET_PROMPT_BINDING_VALIDATE_SUBPATH,vi as AGENT_ASSET_PROMPT_ITEM_SUBPATH,Fi as AGENT_ASSET_PROMPT_VALIDATE_SUBPATH,ks as AGENT_ASSET_VALIDATION_FAILED_ERROR_CODE,Ii as AGENT_CAPABILITY_FLOW_AUTHORING,ui as AGENT_CHAT_ROUTE_SUBPATH,Ts as AGENT_CREATE_FLOW_AUTHORING_TASK_TOOL_NAME,bs as AGENT_FLOW_AUTHORING_WORKFLOW_FAILED_ERROR_CODE,li as AGENT_FLOW_CONTEXT_ROUTE_SUBPATH,is as AGENT_FLOW_CREATION_DECISION_ITEM_SUBPATH,Os as AGENT_FLOW_CREATION_TASK_CONFLICT_ERROR_CODE,os as AGENT_FLOW_CREATION_TASK_ITEM_SUBPATH,Ps as AGENT_FLOW_CREATION_TASK_NOT_FOUND_ERROR_CODE,hs as AGENT_FLOW_GOAL_INVALID_ERROR_CODE,rs as AGENT_FLOW_READINESS_REQUIREMENT_RESOLVE_SUBPATH,Qi as AGENT_FLOW_WORKING_DRAFT_COMMANDS_SUBPATH,Zi as AGENT_FLOW_WORKING_DRAFT_EDIT_TURN_ACQUIRE_SUBPATH,es as AGENT_FLOW_WORKING_DRAFT_EDIT_TURN_RELEASE_SUBPATH,zi as AGENT_FLOW_WORKING_DRAFT_ITEM_SUBPATH,Yi as AGENT_FLOW_WORKING_DRAFT_OPEN_SUBPATH,ts as AGENT_FLOW_WORKING_DRAFT_PUBLISH_SUBPATH,ns as AGENT_FLOW_WORKING_DRAFT_READINESS_CHECK_SUBPATH,Ni as AGENT_MESSAGE_DELTA_INVALID_ERROR_CODE,Di as AGENT_PAGE_CONTEXT_INVALID_ERROR_CODE,wi as AGENT_PAGE_CONTEXT_MAX_RESOURCES,Ei as AGENT_PAGE_CONTEXT_RESOURCE_ID_MAX_LENGTH,xi as AGENT_PAGE_CONTEXT_ROUTE_ID_MAX_LENGTH,Ti as AGENT_PAGE_RESOURCE_TYPES,Ss as AGENT_PROMPT_BINDING_CONFLICT_ERROR_CODE,Es as AGENT_PROMPT_PURPOSES,ws as AGENT_PROMPT_SLOTS,pi as AGENT_ROUTE_PREFIX,Oi as AGENT_RUNTIME_FAILED_ERROR_CODE,Is as AGENT_RUNTIME_TOOL_NAME_PATTERN,Pi as AGENT_RUNTIME_UNCONFIGURED_ERROR_CODE,di as AGENT_SESSIONS_ROUTE_SUBPATH,Ri as AGENT_SESSION_DETAIL_MESSAGE_LIMIT,ci as AGENT_SESSION_ITEM_ROUTE_SUBPATH,_i as AGENT_SESSION_LIST_DEFAULT_LIMIT,yi as AGENT_SESSION_LIST_MAX_LIMIT,bi as AGENT_SESSION_NOT_FOUND_ERROR_CODE,K as API_KEYS_ROUTE_PREFIX,qe as API_KEY_GRANT_OPTIONS_ROUTE_SUBPATH,go as API_KEY_ITEM_ROUTE_SUBPATH,fo as API_KEY_TOKEN_PREFIX,mo as API_KEY_WORKSPACE_FULL_ACCESS_SCOPE,We as APP_BOOTSTRAP_ROUTE_PATH,Eo as CATALOG_DEFAULT_PROVIDER_APP_CONFIG_ROUTE_SUBPATH,To as CATALOG_INTEGRATIONS_ROUTE_SUBPATH,xo as CATALOG_INTEGRATION_DETAIL_ROUTE_SUBPATH,W as CATALOG_ROUTE_PREFIX,wo as CATALOG_VERSIONS_ROUTE_SUBPATH,vo as CONNECTIONS_ROUTE_SUBPATH,Ho as CONNECTION_DISCONNECT_ROUTE_SUBPATH,Lo as CONNECT_COMPLETE_ROUTE_SUBPATH,Uo as CONNECT_OPTIONS_ROUTE_SUBPATH,Fo as CONNECT_START_ROUTE_SUBPATH,Bo as CONNECT_SUBMIT_ROUTE_SUBPATH,to as CURRENT_USER_ROUTE_PATH,Ve as DEFAULT_WORKSPACE_ROUTE_PATH,Ke as DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES,Mr as DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES,$r as DEPLOYMENT_HANDSHAKE_ROUTE,vn as EGRESS_GRANT_AUDIT_ROUTE_SUBPATH,Cn as EGRESS_GRANT_CONSUME_ROUTE_SUBPATH,Oe as EGRESS_GRANT_SCOPE_KINDS,Tt as EVENT_WAIT_ROUTE_SUBPATH,ct as EXECUTION_CONTEXT_ROUTE_SUBPATH,Rr as FILE_CONTENT_ROUTE_SUBPATH,yr as FILE_STAT_ROUTE_SUBPATH,ki as FLOW_AUTHORING_EDIT_TOOL_NAMES,ze as FLOW_AUTHORING_TOOL_DESCRIPTORS,Ai as FLOW_AUTHORING_TOOL_NAMES,Qo as FLOW_DISABLE_ROUTE_SUBPATH,Cs as FLOW_DRAFT_COMMAND_INVALID_ERROR_CODE,vs as FLOW_DRAFT_EDIT_LOCKED_ERROR_CODE,Us as FLOW_DRAFT_NOT_PUBLISHABLE_ERROR_CODE,Ds as FLOW_DRAFT_REVISION_CONFLICT_ERROR_CODE,Zo as FLOW_DRAFT_ROUTE_SUBPATH,Fs as FLOW_EDIT_TURN_NOT_HELD_ERROR_CODE,zo as FLOW_ENABLE_ROUTE_SUBPATH,ae as FLOW_INTERPRETER_CONTRACT_VERSION,at as FLOW_IR_SCHEMA_VERSION,Yo as FLOW_ITEM_ROUTE_SUBPATH,Bs as FLOW_PUBLISH_CONFIRMATION_REQUIRED_ERROR_CODE,Hs as FLOW_READINESS_REQUIREMENT_CONFLICT_ERROR_CODE,Ls as FLOW_READINESS_REQUIREMENT_NOT_FOUND_ERROR_CODE,On as FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH,It as FLOW_RUN_RESULT_ROUTE_SUBPATH,tr as FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Ys as FLOW_RUN_STATUSES,Xo as FLOW_VALIDATE_ROUTE_SUBPATH,ei as FLOW_VERSIONS_ROUTE_SUBPATH,ti as FLOW_VERSION_ITEM_ROUTE_SUBPATH,Ns as FLOW_WORKING_DRAFT_NOT_FOUND_ERROR_CODE,ie as GLOBAL_INBOX_ENTRIES_ROUTE_PREFIX,Dt as HANDLER_BUNDLES_ROUTE_SUBPATH,Jr as HANDSHAKE_CAPABILITY_MISSING,qr as HANDSHAKE_CONTRACT_VERSION_MISMATCH,jr as HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH,Kr as HANDSHAKE_REQUEST_INVALID,Vr as HANDSHAKE_SECRET_MISMATCH,Wr as HANDSHAKE_SECRET_UNCONFIGURED,Sr as HUMAN_INPUTS_ROUTE_SUBPATH,Or as HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH,Pr as HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH,hr as HUMAN_INPUT_REQUEST_ROUTE_SUBPATH,Fe as HUMAN_INPUT_RESOLVED_EVENT_PREFIX,ua as HUMAN_INPUT_TOKENS_ROUTE_PREFIX,la as HUMAN_INPUT_TOKEN_ROUTE_SUBPATH,da as HUMAN_INPUT_TOKEN_SUBMIT_ROUTE_SUBPATH,ra as INBOX_ENTRY_HUMAN_INPUT_SUBMIT_ROUTE_SUBPATH,na as INBOX_ENTRY_ROUTE_SUBPATH,ta as INBOX_ITEM_ROUTE_SUBPATH,Oo as INTEGRATION_ITEM_ROUTE_SUBPATH,bo as INTEGRATION_TOOLS_ROUTE_SUBPATH,Y as INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX,M as INTERNAL_FILES_ROUTE_PREFIX,f as INTERNAL_FLOW_RUNS_ROUTE_PREFIX,ge as INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX,G as INTERNAL_INSTALLATIONS_ROUTE_PREFIX,k as INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX,$ as INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX,A as INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX,Ze as ONE_OFF_EXECUTE_ACTION_TOOL_NAME,Qe as ONE_OFF_GET_ACTION_CONTEXT_TOOL_NAME,xs as ONE_OFF_TOOL_NAMES,Qr as PLATFORM_ACCESS_PERMISSION,Zr as PLATFORM_API_KEY_MANAGE_PERMISSION,cn as POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH,Nn as POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,gn as POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,rr as POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,mn as POLLING_TRIGGER_STORE_ROUTE_SUBPATH,fn as POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH,Go as PROVIDER_CALLBACK_REDIRECT_ROUTE_PATH,ur as RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS,Vs as RUN_CANCEL_ROUTE_SUBPATH,qs as RUN_EVENTS_ROUTE_SUBPATH,Ws as RUN_ITEM_ROUTE_SUBPATH,se as SERVER_CONTRACT_VERSION,Rt as STEP_RESULT_ROUTE_SUBPATH,zs as STEP_RUN_STATUSES,Ct as TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH,bn as TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH,nr as TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,fa as TRIGGER_INSTANCES_ROUTE_SUBPATH,ma as TRIGGER_SIMULATE_ROUTE_SUBPATH,en as WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH,nn as WEBHOOK_PROTOCOL_ADAPTER_MODULE,Mt as WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH,Wt as WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH,Dn as WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,Vt as WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH,Kt as WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,qt as WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH,or as WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,jt as WEBHOOK_TRIGGER_STORE_ROUTE_SUBPATH,Br as WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION,Lr as WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION,ne as WORKSPACES_ROUTE_PREFIX,ao as WORKSPACE_ACCESS_ROUTE_SUBPATH,Co as WORKSPACE_CONNECTION_MOUNT_PREFIX,Jo as WORKSPACE_FLOWS_ROUTE_PREFIX,Ks as WORKSPACE_FLOW_RUNS_ROUTE_PREFIX,ea as WORKSPACE_INBOX_ENTRIES_ROUTE_PREFIX,Zs as WORKSPACE_INBOX_ITEMS_ROUTE_PREFIX,Po as WORKSPACE_INTEGRATIONS_ROUTE_PREFIX,so as WORKSPACE_LIST_ROUTE_SUBPATH,Ms as WORKSPACE_RUNS_ROUTE_PREFIX,as as agentAssetFlowScenesPath,ps as agentAssetFlowTemplatesPath,ss as agentAssetPromptsPath,gi as agentChatPath,ys as agentFlowCreationDecisionPath,_s as agentFlowCreationTaskPath,ms as agentFlowReadinessRequirementResolvePath,ls as agentFlowWorkingDraftCommandsPath,ds as agentFlowWorkingDraftEditTurnAcquirePath,cs as agentFlowWorkingDraftEditTurnReleasePath,us as agentFlowWorkingDraftOpenPath,w as agentFlowWorkingDraftPath,gs as agentFlowWorkingDraftPublishPath,fs as agentFlowWorkingDraftReadinessCheckPath,mi as agentSessionPath,fi as agentSessionsPath,yo as apiKeyGrantOptionsPath,Ro as apiKeyPath,_o as apiKeysPath,oo as appBootstrapPath,So as catalogDefaultProviderAppConfigPath,je as catalogIntegrationPath,Ao as catalogIntegrationsPath,ko as catalogVersionsPath,Vo as connectCompletePath,Ko as connectOptionsPath,Mo as connectStartPath,Wo as connectSubmitPath,qo as connectionDisconnectPath,o as contractParseFail,p as contractParseOk,no as currentUserPath,lo as defaultWorkspacePath,Xr as deploymentHandshakeProbePayload,Yr as deploymentHandshakeResponseProofPayload,Gn as egressGrantAuditPath,Hn as egressGrantConsumePath,Et as eventWaitPath,gt as executionContextPath,hi as findFlowAuthoringToolDescriptor,oi as flowDisablePath,ii as flowDraftPath,ri as flowEnablePath,F as flowPath,Fn as flowRunEgressGrantPath,wt as flowRunResultPath,ir as flowRunRuntimeCredentialPath,Xs as flowRunsPath,rn as flowScriptProtocolAdapterModuleName,ni as flowValidatePath,si as flowVersionPath,Ye as flowVersionsPath,Si as formatFlowToolError,sa as globalInboxEntriesPath,aa as globalInboxEntryHumanInputSubmitPath,ot as globalInboxEntryPath,vt as handlerBundlesPath,Nr as humanInputAcknowledgePath,br as humanInputExpirePath,Z as humanInputRequestPath,Dr as humanInputResolvedEventType,it as humanInputTokenPath,ca as humanInputTokenSubmitPath,ve as humanInputsPath,ia as inboxEntryHumanInputSubmitPath,rt as inboxEntryPath,oa as inboxItemPath,No as installationToolsPath,xr as internalFileContentPath,Tr as internalFileStatPath,Ir as internalFilesPath,i as isJsonRecord,S as isValidRequestDigest,Ot as parseCompleteFlowRunWaitBody,Cr as parseCreateHumanInputBody,qn as parseEgressGrantAuditBody,Vn as parseEgressGrantConsumeBody,Jn as parseEgressGrantConsumeData,jn as parseEgressGrantData,ft as parseExecutionContextData,wr as parseFileRefData,pe as parseFileRuntimeLimits,$n as parseFlowActionGrantBody,St as parseFlowRunResultBody,ht as parseFlowRunResultData,lr as parseFlowRuntimeCredentialBody,me as parseHandlerBundle,Ut as parseHandlerBundlesData,Fr as parseHumanInputAcknowledgeData,vr as parseHumanInputCreateData,Me as parseHumanInputRequestViewData,xn as parsePollingPublishBody,cr as parsePollingRuntimeCredentialBody,we as parsePollingStorePutBody,Te as parsePollingStoreValue,Tn as parsePollingTriggerContext,Kn as parsePollingTriggerGrantBody,wn as parsePublishPollingTickEventsData,Pt as parseRegisterFlowRunWaitBody,bt as parseRegisterFlowRunWaitData,fr as parseRuntimeCredentialSessionCredential,P as parseRuntimeNetwork,Mn as parseSingleToolGrantBody,dr as parseSingleToolRuntimeCredentialBody,At as parseStepRecordBody,kt as parseStepRecordData,Bt as parseToolHandlerBundlesData,an as parseTriggerHandlerBundlesData,sn as parseWebhookDelivery,pn as parseWebhookPublishEventsBody,un as parseWebhookRearmBody,gr as parseWebhookRuntimeCredentialBody,we as parseWebhookStorePutBody,Te as parseWebhookStoreValue,Wn as parseWebhookTriggerGrantBody,on as parseWebhookWatcherContext,_n as pollingTriggerContextPath,Bn as pollingTriggerEgressGrantPath,yn as pollingTriggerHandlerBundlesPath,ar as pollingTriggerRuntimeCredentialPath,In as pollingTriggerStorePath,Rn as pollingTriggerTickEventsPath,Ne as requestHasMultipartFileParts,js as runCancelPath,Js as runEventsPath,oe as runPath,xt as stepResultPath,Ft as toolHandlerBundlesPath,Un as toolInvocationEgressGrantPath,sr as toolInvocationRuntimeCredentialPath,_a as triggerInstancesPath,ya as triggerSimulatePath,tn as webhookProtocolAdapterBundlePath,Jt as webhookTriggerContextPath,Yt as webhookTriggerDeliveryPath,Ln as webhookTriggerEgressGrantPath,zt as webhookTriggerEventsPath,Xt as webhookTriggerHandlerBundlesPath,Qt as webhookTriggerRearmPath,pr as webhookTriggerRuntimeCredentialPath,Zt as webhookTriggerStorePath,Hr as wfpUserRuntimeManifestPath,$o as workspaceConnectionsPath,re as workspaceFlowsPath,nt as workspaceInboxEntriesPath,tt as workspaceInboxItemsPath,Xe as workspaceIntegrationPath,Je as workspaceIntegrationsPath,po as workspacePath,et as workspaceRunsPath,uo as workspacesPath};
1
+ var se="0.2.2";var at="flow.ir.v1";var ae="flow.interp.v2";function p(e){return{ok:!0,value:e}}function o(e){return{ok:!1,reason:e}}function i(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var f="/internal/flow-runs",ct="/:flowRunId/execution-context";function gt(e){return`${f}/${encodeURIComponent(e)}/execution-context`}function pe(e){return!i(e)||!B(e.fileMaxBytes)||!B(e.fileReadMaxBytes)||!B(e.inlineMultipartBytesMax)?o("file runtime limits must carry three positive integer bounds"):p({fileMaxBytes:e.fileMaxBytes,fileReadMaxBytes:e.fileReadMaxBytes,inlineMultipartBytesMax:e.inlineMultipartBytesMax})}function ft(e){if(!i(e))return o("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)||!le(e.executionBindings))return o("execution context surface shape is invalid");let n=ue(e.fileRuntime);return n.ok?p({...e,fileRuntime:n.value}):o(n.reason)}function ue(e){if(e===null)return p(null);if(!i(e))return o("fileRuntime must be null or an object");let t=pe(e.limits);return t.ok?p({limits:t.value}):o(t.reason)}function le(e){return Array.isArray(e)?e.every(t=>{if(!i(t))return!1;let n=t.connection;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"}):!1}function B(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var yt="/:flowRunId/steps/:nodeId/result",It="/:flowRunId/result",Tt="/:flowRunId/event-waits/:nodeId";function xt(e,t){return`${f}/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}/result`}function Et(e){return`${f}/${encodeURIComponent(e)}/result`}function At(e,t){return`${f}/${encodeURIComponent(e)}/event-waits/${encodeURIComponent(t)}`}function wt(e){if(!i(e))return{ok:!1,kind:"validation",reason:"step record body must be a JSON object"};let t=_(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 r=de(e.result);if(!r.ok)return r;let s={attempt:n,result:r.value};if(e.durationMs!==void 0){let a=e.durationMs;if(typeof a!="number"||!Number.isFinite(a)||a<0)return{ok:!1,kind:"validation",reason:"durationMs must be a non-negative number"};s.durationMs=a}return{ok:!0,value:s}}function de(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=_(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=_(e,["status","errorCode","issues"]);if(n!==void 0)return{ok:!1,kind:"validation",reason:`step record result does not accept the "${n}" field`};let r=e.errorCode;if(typeof r!="string"||r.length===0)return{ok:!1,kind:"step_result_invalid",reason:"a failed result must carry a non-empty errorCode"};let s={status:"failed",errorCode:r};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 kt(e){return!i(e)||typeof e.flowRunId!="string"||typeof e.nodeId!="string"||e.recorded!=="succeeded"&&e.recorded!=="failed"?o("step record data surface shape is invalid"):p({flowRunId:e.flowRunId,nodeId:e.nodeId,recorded:e.recorded})}function St(e){if(!i(e))return o("result body must be a JSON object");let t=_(e,["status","output","error","composition"]);if(t!==void 0)return o(`result does not accept the "${t}" field`);let n=e.status;if(n!=="succeeded"&&n!=="failed")return o('result status must be "succeeded" or "failed"');let r={status:n};if(e.output!==void 0&&(r.output=e.output),e.error!==void 0){let s=e.error;if(!i(s))return o("result error must be a JSON object");let a=_(s,["code","message"]);if(a!==void 0)return o(`result error does not accept the "${a}" field`);if(typeof s.code!="string"||typeof s.message!="string")return o("result error must carry string code and message");r.error={code:s.code,message:s.message}}if(e.composition!==void 0){if(n!=="succeeded")return o("composition is only allowed on a succeeded result");r.composition=e.composition}return p(r)}function ht(e){return i(e)?p(e):o("flow run result data must be a JSON object")}var ce=/^[A-Za-z0-9_-]{1,100}$/;function Ot(e){if(!i(e))return o("register body must be a JSON object");let t=_(e,["eventType","correlationKey"]);if(t!==void 0)return o(`register wait does not accept the "${t}" field`);let n=q(e.eventType);if(!n.ok)return o(n.reason);let r=e.correlationKey;return typeof r!="string"||r.length===0?o("correlationKey must be a non-empty string"):p({eventType:n.value,correlationKey:r})}function Pt(e){if(!i(e))return o("complete body must be a JSON object");let t=_(e,["eventType","correlationKey","outcome","eventId"]);if(t!==void 0)return o(`complete wait does not accept the "${t}" field`);let n=e.outcome;if(n!=="received"&&n!=="timed_out")return o('outcome must be "received" or "timed_out"');let r=q(e.eventType);if(!r.ok)return o(r.reason);let s=e.correlationKey;if(typeof s!="string"||s.length===0)return o("correlationKey must be a non-empty string");let a={eventType:r.value,correlationKey:s,outcome:n};if(e.eventId!==void 0){if(typeof e.eventId!="string"||e.eventId.length===0)return o("eventId must be a non-empty string");a.eventId=e.eventId}return p(a)}function Nt(e){return!i(e)||e.registered!==!0?o("register wait data surface shape is invalid"):p({registered:!0})}function q(e){return typeof e!="string"||e.length===0?o("eventType must be a non-empty string"):ce.test(e)?p(e):o("eventType must match ^[A-Za-z0-9_-]{1,100}$")}function _(e,t){return Object.keys(e).find(n=>!t.includes(n))}var ge="/internal/flow-versions",Dt="/:flowVersionId/handler-bundles",H="/internal/installations",Ct="/:installationId/handler-bundles";function vt(e,t){return`${ge}/${encodeURIComponent(e)}/handler-bundles?compiledArtifactId=${encodeURIComponent(t)}`}function Ft(e){return`${H}/${encodeURIComponent(e.installationId)}/handler-bundles?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var fe=new Set(["managed_only","managed_plus_unmanaged_sdk"]);function O(e){if(!R(e))return G("runtimeNetwork must be a JSON object");let t=e.networkModel;return typeof t!="string"||!fe.has(t)?G("runtimeNetwork.networkModel is unknown"):!j(e.apiHosts)||!j(e.authHosts)||typeof e.httpsOnly!="boolean"?G("runtimeNetwork host/https fields are invalid"):{ok:!0,value:{networkModel:t,apiHosts:e.apiHosts,authHosts:e.authHosts,httpsOnly:e.httpsOnly}}}function Ut(e){if(!R(e)||typeof e.flowVersionId!="string"||typeof e.compiledArtifactId!="string"||!Array.isArray(e.bundles))return A("handler bundles data surface shape is invalid");let t=J(e.bundles);return t.ok?{ok:!0,value:{flowVersionId:e.flowVersionId,compiledArtifactId:e.compiledArtifactId,bundles:t.value}}:t}function Lt(e){if(!R(e)||typeof e.installationId!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.bundles))return A("tool handler bundles data surface shape is invalid");let t=J(e.bundles);return t.ok?{ok:!0,value:{installationId:e.installationId,artifactDigest:e.artifactDigest,bundles:t.value}}:t}function J(e){let t=[];for(let n of e){let r=me(n);if(!r.ok)return r;t.push(r.value)}return{ok:!0,value:t}}function me(e){if(!R(e)||typeof e.toolRef!="string"||e.kind!=="handler"&&e.kind!=="request")return A("handler bundle entry shape is invalid");if(e.kind==="request"){if(e.module!==void 0)return A("a request bundle must not carry a module");let r=O(e.runtimeNetwork);return r.ok?{ok:!0,value:{toolRef:e.toolRef,kind:"request",runtimeNetwork:r.value}}:r}let t=e.module;if(!R(t)||typeof t.entry!="string"||t.entry.length===0||!_e(t.files))return A("a handler bundle must carry a { entry, files } module");let n=O(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 A(e){return{ok:!1,kind:"shape",reason:e}}function G(e){return{ok:!1,kind:"runtime_network",reason:e}}function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function j(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function _e(e){return R(e)&&Object.values(e).every(t=>typeof t=="string")}var w="/internal/webhook-trigger-instances",$t="/:triggerInstanceId/context",Kt="/:triggerInstanceId/handler-bundles",Wt="/:triggerInstanceId/deliveries/:deliveryId",Vt="/:triggerInstanceId/events",qt="/:triggerInstanceId/rearm",jt="/:triggerInstanceId/store/:namespace/:key",y=e=>`${w}/${encodeURIComponent(e)}`;function Jt(e,t){return`${y(e)}/context?artifactDigest=${encodeURIComponent(t)}`}function Xt(e,t){return`${y(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function Yt(e,t){return`${y(e)}/deliveries/${encodeURIComponent(t)}`}function zt(e){return`${y(e)}/events`}function Qt(e){return`${y(e)}/rearm`}function Zt(e,t,n){return`${y(e)}/store/${encodeURIComponent(t)}/${encodeURIComponent(n)}`}var en="/:installationId/webhook-protocol-adapter-bundle";function tn(e){return`${H}/${encodeURIComponent(e.installationId)}/webhook-protocol-adapter-bundle?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var nn="modules/webhook/protocol-adapter.js";function rn(e){return`modules/webhook/protocol-adapter-${e}.js`}function on(e){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&&!Re(e.connection)||!ye(e.runtime)?o("webhook watcher context surface shape is invalid"):p(e)}function Re(e){return i(e)&&typeof e.connectionId=="string"&&typeof e.connectionRef=="string"&&typeof e.integrationRef=="string"&&typeof e.authType=="string"}function ye(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 o("webhook delivery surface shape is invalid");let t=e.request;return t.method!=="POST"||!i(t.headers)||typeof t.rawBody!="string"?o("webhook delivery request shape is invalid"):p(e)}function an(e){if(!i(e)||typeof e.triggerRef!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.modules)||!e.modules.every(Ie))return{ok:!1,kind:"shape",reason:"trigger handler bundles data surface shape is invalid"};let t=O(e.runtimeNetwork);return t.ok?{ok:!0,value:{triggerRef:e.triggerRef,artifactDigest:e.artifactDigest,modules:e.modules,runtimeNetwork:t.value}}:t}function Ie(e){return i(e)&&typeof e.specifier=="string"&&e.specifier.length>0&&typeof e.source=="string"}function Te(e){return!i(e)||!("value"in e)?o("webhook store get surface shape is invalid"):p(e.value)}function pn(e){if(!i(e))return o("publish events body must be a JSON object");let t=P(e,["deliveryId","events"]);if(t!==void 0)return o(`publish events does not accept the "${t}" field`);let n=e.deliveryId;if(typeof n!="string"||n.length===0)return o("deliveryId must be a non-empty string");let r=e.events;if(!Array.isArray(r))return o("events must be an array");let s=[];for(let a of r){let u=xe(a);if(!u.ok)return u;s.push(u.value)}return p({deliveryId:n,events:s})}function xe(e){if(!i(e))return o("each event must be a JSON object");let t=P(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return o(`event does not accept the "${t}" field`);let n=e.eventId;if(typeof n!="string"||n.length===0)return o("eventId must be a non-empty string");let r=e.occurredAt;if(typeof r!="string"||r.length===0)return o("occurredAt must be a non-empty string");if(!i(e.payload))return o("event payload must be a JSON object");let s={eventId:n,occurredAt:r,payload:e.payload};if(e.dedupeKey!==void 0){if(typeof e.dedupeKey!="string"||e.dedupeKey.length===0)return o("dedupeKey must be a non-empty string");s.dedupeKey=e.dedupeKey}return p(s)}function un(e){if(!i(e))return o("rearm body must be a JSON object");let t=P(e,["expectedWatcherInstanceId"]);if(t!==void 0)return o(`rearm does not accept the "${t}" field`);let n=e.expectedWatcherInstanceId;return typeof n!="string"||n.length===0?o("expectedWatcherInstanceId must be a non-empty string"):p({expectedWatcherInstanceId:n})}function Ee(e){if(!i(e))return o("store body must be a JSON object");let t=P(e,["value"]);return t!==void 0?o(`store put does not accept the "${t}" field`):"value"in e?p({value:e.value}):o("store put requires a value field")}function P(e,t){return Object.keys(e).find(n=>!t.includes(n))}var k="/internal/polling-trigger-instances",cn="/:pollingInstanceId/context",gn="/:pollingInstanceId/handler-bundles",fn="/:pollingInstanceId/ticks/:tickId/events",mn="/:pollingInstanceId/store/:namespace/:key",N=e=>`${k}/${encodeURIComponent(e)}`;function _n(e,t,n){return`${N(e)}/context?artifactDigest=${encodeURIComponent(t)}&tickId=${encodeURIComponent(n)}`}function Rn(e,t){return`${N(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function yn(e,t){return`${N(e)}/ticks/${encodeURIComponent(t)}/events`}function In(e,t,n){return`${N(e)}/store/${encodeURIComponent(t)}/${encodeURIComponent(n)}`}function Tn(e){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&&!Ae(e.connection)||!we(e.runtime)||!ke(e.tick)||!Se(e.limits)?o("polling trigger context surface shape is invalid"):p(e)}function Ae(e){return i(e)&&typeof e.connectionId=="string"&&typeof e.connectionRef=="string"&&typeof e.integrationRef=="string"&&typeof e.authType=="string"}function we(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 r=t.dedup;return i(r)&&(r.strategy==="cursor"||r.strategy==="hash"||r.strategy==="id_field")}function ke(e){return i(e)&&typeof e.tickId=="string"&&typeof e.scheduledAt=="string"&&typeof e.attempt=="number"}function Se(e){return i(e)&&typeof e.maxEventsPerTick=="number"}function xn(e){if(!i(e))return o("publish body must be a JSON object");let t=X(e,["events","nextCursor"]);if(t!==void 0)return o(`publish does not accept the "${t}" field`);let n=e.events;if(!Array.isArray(n))return o("events must be an array");let r=[];for(let a of n){let u=he(a);if(!u.ok)return u;r.push(u.value)}let s={events:r};if("nextCursor"in e){let a=e.nextCursor;if(a!==null&&typeof a!="string")return o("nextCursor must be a string, null, or omitted");s.nextCursor=a}return p(s)}function he(e){if(!i(e))return o("each event must be a JSON object");let t=X(e,["eventId","occurredAt","dedupeKey","payload"]);if(t!==void 0)return o(`event does not accept the "${t}" field`);if(typeof e.eventId!="string"||e.eventId.length===0)return o("event eventId must be a non-empty string");if(!i(e.payload))return o("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 o("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 o("event dedupeKey must be a non-empty string");n.dedupeKey=e.dedupeKey}return p(n)}function En(e){return!i(e)||typeof e.tickId!="string"||typeof e.cursorUpdated!="boolean"||!Array.isArray(e.results)||!e.results.every(Oe)?o("publish polling tick events data surface shape is invalid"):p(e)}function Oe(e){return i(e)&&typeof e.eventId=="string"&&typeof e.dedupeKey=="string"&&typeof e.duplicate=="boolean"&&(e.flowRunId===null||typeof e.flowRunId=="string")}function X(e,t){return Object.keys(e).find(n=>!t.includes(n))}var Y="/internal/egress-grants",M="/internal/tool-invocations",Pn="/:flowRunId/egress-grant",Nn="/:invocationId/egress-grant",bn="/:pollingInstanceId/egress-grant",Dn="/:triggerInstanceId/egress-grant",Cn="/:grantId/consume",vn="/:grantId/audit",Fn=e=>`${f}/${encodeURIComponent(e)}/egress-grant`,Un=e=>`${M}/${encodeURIComponent(e)}/egress-grant`,Ln=e=>`${k}/${encodeURIComponent(e)}/egress-grant`,Bn=e=>`${w}/${encodeURIComponent(e)}/egress-grant`,Gn=e=>`${Y}/${encodeURIComponent(e)}/consume`,Hn=e=>`${Y}/${encodeURIComponent(e)}/audit`,Pe=["flow_action","single_tool","polling_trigger","webhook_trigger"],Ne=/^[A-Za-z0-9][A-Za-z0-9:_+/=.-]{15,1023}$/;function S(e){return typeof e=="string"&&Ne.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(r=>i(r)?r.kind==="file"&&typeof r.file_id=="string"&&r.file_id.length>0:!1):!1}function l(e){return{ok:!1,kind:"shape",reason:e}}function h(){return{ok:!1,kind:"request_digest",reason:"request digest is missing or malformed"}}function D(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 C(e){if(!i(e))return"request must be a JSON object"}function Mn(e){let t=D(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 r=C(t.record.request);if(r!==void 0)return l(r);let s=t.record.requestDigest;return S(s)?{ok:!0,value:{nodeId:n,requestDigest:s,requestHasMultipartFiles:be(t.record.request)}}:h()}function $n(e){let t=D(e,["request","requestDigest"]);if(!t.ok)return l(t.reason);let n=C(t.record.request);if(n!==void 0)return l(n);let r=t.record.requestDigest;return S(r)?{ok:!0,value:{requestDigest:r}}:h()}function Kn(e){let t=D(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 r=C(t.record.request);if(r!==void 0)return l(r);let s=t.record.requestDigest;return S(s)?{ok:!0,value:{tickId:n,requestDigest:s}}:h()}function Wn(e){let t=D(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 r=t.record.lifecycle,s;if(r!==void 0){if(r!=="enable"&&r!=="disable"&&r!=="renew")return l('lifecycle must be "enable", "disable", or "renew"');s=r}if(n==="lifecycle"&&s===void 0)return l("lifecycle is required for the lifecycle phase");let a=C(t.record.request);if(a!==void 0)return l(a);let u=t.record.requestDigest;return S(u)?{ok:!0,value:{phase:n,...s!==void 0?{lifecycle:s}:{},requestDigest:u}}:h()}function z(e){return Pe.includes(e)?e:void 0}var De=["scopeKind","scopeId","requestDigest"];function Vn(e){if(!i(e))return l("consume body must be a JSON object");for(let s of Object.keys(e))if(!De.includes(s))return l(`consume does not accept the "${s}" field`);let t=z(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 r=e.requestDigest;return S(r)?{ok:!0,value:{scopeKind:t,scopeId:n,requestDigest:r}}:h()}var Ce=["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 qn(e){if(!i(e))return l("audit body must be a JSON object");for(let c of Object.keys(e))if(!Ce.includes(c))return l(`audit does not accept the "${c}" field`);let t=z(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 r=e.providerHost;if(typeof r!="string"||r.length===0)return l("providerHost is required");let s=b(e.durationMs,"durationMs");if(!s.ok)return l(s.reason);let a;if(e.status!==void 0){let c=b(e.status,"status");if(!c.ok)return l(c.reason);a=c.value}let u;if(e.requestBytes!==void 0){let c=b(e.requestBytes,"requestBytes");if(!c.ok)return l(c.reason);u=c.value}let d;if(e.responseBytes!==void 0){let c=b(e.responseBytes,"responseBytes");if(!c.ok)return l(c.reason);d=c.value}let L;if(e.errorCode!==void 0){let c=e.errorCode;if(typeof c!="string"||c.length===0)return l("errorCode must be a non-empty string");L=c}return{ok:!0,value:{scopeKind:t,scopeId:n,providerHost:r,...a!==void 0?{status:a}:{},durationMs:s.value,...u!==void 0?{requestBytes:u}:{},...d!==void 0?{responseBytes:d}:{},...L!==void 0?{errorCode:L}:{}}}}function jn(e){return!i(e)||!i(e.grant)?o("egress grant envelope must carry a grant object"):p(e.grant)}function Jn(e){return!i(e)||e.consumed!==!0?o("egress grant consume data must carry consumed:true"):p({consumed:!0})}var tr="/:flowRunId/runtime-credential",nr="/:invocationId/runtime-credential",rr="/:pollingInstanceId/runtime-credential",or="/:triggerInstanceId/runtime-credential",ir=e=>`${f}/${encodeURIComponent(e)}/runtime-credential`,sr=e=>`${M}/${encodeURIComponent(e)}/runtime-credential`,ar=e=>`${k}/${encodeURIComponent(e)}/runtime-credential`,pr=e=>`${w}/${encodeURIComponent(e)}/runtime-credential`,ur=["flow_action","tool_invoke","polling_trigger","webhook_trigger"];function v(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 lr(e){let t=v(e,["nodeId"]);if(!t.ok)return o(t.reason);let n=t.record.nodeId;return typeof n!="string"||n.length===0?o("nodeId is required"):p({nodeId:n})}function dr(e){let t=v(e??{},[]);return t.ok?p(null):o(t.reason)}function cr(e){let t=v(e,["tickId"]);if(!t.ok)return o(t.reason);let n=t.record.tickId;return typeof n!="string"||n.length===0?o("tickId is required"):p({tickId:n})}function gr(e){let t=v(e,["executionKind","deliveryId","lifecycleOperation"]);if(!t.ok)return o(t.reason);let n=t.record.executionKind;if(n!=="event_handler"&&n!=="lifecycle")return o('executionKind must be "event_handler" or "lifecycle"');let r,s=t.record.deliveryId;if(s!==void 0){if(typeof s!="string"||s.length===0)return o("deliveryId must be a non-empty string");r=s}let a,u=t.record.lifecycleOperation;if(u!==void 0){if(u!=="enable"&&u!=="disable"&&u!=="renew")return o('lifecycleOperation must be "enable", "disable", or "renew"');a=u}return n==="lifecycle"&&a===void 0?o("lifecycleOperation is required for the lifecycle execution kind"):p({executionKind:n,...r!==void 0?{deliveryId:r}:{},...a!==void 0?{lifecycleOperation:a}:{}})}function fr(e){return!i(e)||typeof e.sessionId!="string"||typeof e.connectionId!="string"||!i(e.credential)?o("runtime credential session must carry sessionId, connectionId and a credential object"):p(e.credential)}var $="/internal/files",Rr="/:fileId/stat",yr="/:fileId/content",Ir=()=>$,Q=e=>`?scope_kind=${encodeURIComponent(e.scopeKind)}&scope_id=${encodeURIComponent(e.scopeId)}`,Tr=(e,t)=>`${$}/${encodeURIComponent(e)}/stat${Q(t)}`,xr=(e,t)=>`${$}/${encodeURIComponent(e)}/content${Q(t)}`;function Er(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"?o("file ref data does not match the AIS file-ref shape"):p(e)}var Sr="/:flowRunId/human-inputs",hr="/:flowRunId/human-inputs/:requestId",Or="/:flowRunId/human-inputs/:requestId/expire",Pr="/:flowRunId/human-inputs/:requestId/acknowledge",ve=e=>`${f}/${encodeURIComponent(e)}/human-inputs`,Z=(e,t)=>`${ve(e)}/${encodeURIComponent(t)}`,Nr=(e,t)=>`${Z(e,t)}/expire`,br=(e,t)=>`${Z(e,t)}/acknowledge`,Fe="human_input_resolved";function Dr(e){return`${Fe}_${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 I(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 Le(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 Be(e){let t=m(e,"renderedPrompt");if(!t.ok)return t;let n=I(t.value.title,"renderedPrompt.title");if(!n.ok)return n;let r={title:n.value};if(t.value.body!==void 0){if(typeof t.value.body!="string")return g("renderedPrompt.body must be a string");r.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");r.format=t.value.format}return{ok:!0,value:r}}function Ge(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 He(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 r=[];for(let s of n){let a=m(s,"delivery action");if(!a.ok)return a;let u=I(a.value.id,"delivery action id");if(!u.ok)return u;let d=ee(a.value.inputs,`delivery action '${u.value}' inputs`);if(!d.ok)return d;r.push({id:u.value,inputs:d.value})}return{ok:!0,value:{actions:r}}}function ee(e,t){let n=m(e,t);if(!n.ok)return n;let r={};for(let[s,a]of Object.entries(n.value)){let u=te(a,`${t}.${s}`);if(!u.ok)return u;r[s]=u.value}return{ok:!0,value:r}}function te(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=I(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[a,u]of n.value.items.entries()){let d=te(u,`${t}[${a}]`);if(!d.ok)return d;s.push(d.value)}return{ok:!0,value:{kind:"array",items:s}}}case"object":{let s=ee(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[a,u]of n.value.parts.entries()){let d=Me(u,`${t}.parts[${a}]`);if(!d.ok)return d;s.push(d.value)}return{ok:!0,value:{kind:"template",parts:s}}}default:return g(`${t}.kind is invalid`)}}function Me(e,t){let n=m(e,t);if(!n.ok)return n;let r=n.value.kind;if(r==="literal")return typeof n.value.value!="string"?g(`${t}.value must be a string`):{ok:!0,value:{kind:"literal",value:n.value.value}};if(r==="human_input_ref"){let s=I(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 Cr(e){let t=m(e,"request body");if(!t.ok)return o(t.reason);let n=I(t.value.nodeId,"nodeId");if(!n.ok)return o(n.reason);let r=Be(t.value.renderedPrompt);if(!r.ok)return o(r.reason);let s=Ge(t.value.input);if(!s.ok)return o(s.reason);let a=I(t.value.timeout,"timeout");if(!a.ok)return o(a.reason);let u=Le(t.value.expiresAt,"expiresAt");if(!u.ok)return o(u.reason);let d=He(t.value.partiallyRenderedDelivery);return d.ok?p({nodeId:n.value,renderedPrompt:r.value,input:s.value,timeout:a.value,expiresAt:u.value,...d.value!==void 0?{partiallyRenderedDelivery:d.value}:{}}):o(d.reason)}function $e(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))?o("human input request view must carry id, nodeId, status and output"):p(e)}function vr(e){if(!i(e)||typeof e.created!="boolean")return o("human input create data must carry created:boolean");let t=$e(e.request);return t.ok?p({created:e.created,request:t.value}):t}function Fr(e){return!i(e)||e.acknowledged!==!0?o("human input acknowledge data must carry acknowledged:true"):p({acknowledged:!0})}var Lr="ablehi-wfp-user-runtime-manifest/v1",Br="unknown";function Gr(e){return e.endsWith(".js")?`${e.slice(0,-3)}.manifest.json`:`${e}.manifest.json`}var Mr="/internal/deployment-handshake",Ke=["start","terminate","send-event","start-webhook-watcher","run-polling-tick","invoke-tool","invoke-trigger-handler","invoke-webhook-protocol-adapter","deployment-handshake"],$r=Ke,Kr="HANDSHAKE_REQUEST_INVALID",Wr="HANDSHAKE_SECRET_UNCONFIGURED",Vr="HANDSHAKE_SECRET_MISMATCH",qr="HANDSHAKE_CONTRACT_VERSION_MISMATCH",jr="HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH",Jr="HANDSHAKE_CAPABILITY_MISSING";function Xr(e){return[e.nonce,e.timestamp,e.contractVersion,e.dispatchNamespace].map(n=>`${n.length}:${n}`).join(".")}function Yr(e){return["response",e.nonce,e.contractVersion,e.dispatchNamespace,...e.capabilities].map(n=>`${n.length}:${n}`).join(".")}var Qr="platform.access",Zr="platform.api_key.manage";var to="/me",no=()=>"/me";var We="/app/bootstrap",oo=()=>We;var ne="/workspaces",so="/",ao="/:workspaceId",Ve="/me/default-workspace",po=e=>`${ne}/${encodeURIComponent(e)}`,uo=()=>ne,lo=()=>Ve;var K="/api-keys",qe="/grant-options",go="/:apiKeyId",fo="ahi_key_",mo="workspace.full_access",_o=()=>K,Ro=()=>`${K}${qe}`,yo=e=>`${K}/${encodeURIComponent(e)}`;var W="/catalog",To="/integrations",xo="/integrations/:slug",Eo="/versions",Ao="/integrations/:slug/default-provider-app-config",wo=e=>{let t=`${W}/integrations`;return e?.category!==void 0&&e.category!==""?`${t}?category=${encodeURIComponent(e.category)}`:t},je=e=>`${W}/integrations/${encodeURIComponent(e)}`,ko=()=>`${W}/versions`,So=e=>`${je(e)}/default-provider-app-config`;var Oo="/workspaces/:workspaceId/integrations",Po="/:installationId",No="/:installationId/tools",Je=e=>`/workspaces/${encodeURIComponent(e)}/integrations`,Xe=(e,t)=>`${Je(e)}/${encodeURIComponent(t)}`,bo=(e,t)=>`${Xe(e,t)}/tools`;var Co="/workspaces/:workspaceId",vo="/connections",Fo="/integrations/:installationId/connect/start",Uo="/integrations/:installationId/connect/options",Lo="/connect-sessions/:sessionId/submit",Bo="/connect-sessions/:sessionId/complete",Go="/integrations/:installationId/connections/:connectionRef",Ho="/callbacks/redirect",T=e=>`/workspaces/${encodeURIComponent(e)}`,Mo=e=>`${T(e)}/connections`,$o=(e,t)=>`${T(e)}/integrations/${encodeURIComponent(t)}/connect/start`,Ko=(e,t)=>`${T(e)}/integrations/${encodeURIComponent(t)}/connect/options`,Wo=(e,t)=>`${T(e)}/connect-sessions/${encodeURIComponent(t)}/submit`,Vo=(e,t)=>`${T(e)}/connect-sessions/${encodeURIComponent(t)}/complete`,qo=(e,t,n)=>`${T(e)}/integrations/${encodeURIComponent(t)}/connections/${encodeURIComponent(n)}`;var Jo="/workspaces/:workspaceId/flows",Xo="/validate",Yo="/:flowId",zo="/:flowId/enable",Qo="/:flowId/disable",Zo="/:flowId/draft",ei="/:flowId/versions",ti="/:flowId/versions/:version",re=e=>`/workspaces/${encodeURIComponent(e)}/flows`,ni=e=>`${re(e)}/validate`,F=(e,t)=>`${re(e)}/${encodeURIComponent(t)}`,ri=(e,t)=>`${F(e,t)}/enable`,oi=(e,t)=>`${F(e,t)}/disable`,ii=(e,t)=>`${F(e,t)}/draft`,Ye=(e,t)=>`${F(e,t)}/versions`,si=(e,t,n)=>`${Ye(e,t)}/${n}`;var pi="/workspaces/:workspaceId/agent",ui="/chat",li="/flow-context",di="/sessions",ci="/sessions/:sessionId",gi=e=>`/workspaces/${encodeURIComponent(e)}/agent/chat`,fi=e=>`/workspaces/${encodeURIComponent(e)}/agent/sessions`,mi=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/sessions/${encodeURIComponent(t)}`,_i=20,Ri=50,yi=100,Ii="flow_authoring",Ti=["flow","flow_run","inbox_entry","integration"],xi=256,Ei=10,Ai=256,wi=["getFlowContext","getWorkingFlowIr","setFlowMeta","addNode","updateNode","removeNode","setTrigger","removeTrigger","setOutputs","setComposition","validateFlow","proposePublish","requestConnect"],ki=["setFlowMeta","addNode","updateNode","removeNode","setTrigger","removeTrigger","setOutputs","setComposition"];function Si(e){return JSON.stringify(e)}var U={type:"object",properties:{},additionalProperties:!1},x={type:"object",additionalProperties:!0},ze=[{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:U},{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:U},{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:{...x,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:{...x,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:{...x,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:{...x,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:{...x,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:{...x,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:U},{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:U},{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 hi(e){return ze.find(t=>t.name===e)}var Oi="AGENT_RUNTIME_UNCONFIGURED",Pi="AGENT_RUNTIME_FAILED",Ni="AGENT_SESSION_NOT_FOUND",bi="AGENT_MESSAGE_DELTA_INVALID",Di="AGENT_PAGE_CONTEXT_INVALID",V="/agent/assets",Ci="/prompts",vi="/prompts/:targetKey/:revision",Fi="/prompts/:targetKey/:revision/validate",Ui="/prompts/:targetKey/:revision/activate",Li="/model-input-targets",Bi="/model-input-targets/:targetKey/render-preview",Gi="/model-input-snapshots",Hi="/flow-scenes",Mi="/flow-scenes/:sceneKey/:revision",$i="/flow-scenes/:sceneKey/:revision/validate",Ki="/flow-scenes/:sceneKey/:revision/activate",Wi="/flow-scenes/:sceneKey/:revision/reindex",Vi="/flow-templates",qi="/flow-templates/:templateKey/:revision",ji="/flow-templates/:templateKey/:revision/validate",Ji="/flow-templates/:templateKey/:revision/activate",Xi="/flow-templates/:templateKey/:revision/reindex",Yi="/flow-working-drafts/open",zi="/flow-working-drafts/:draftId",Qi="/flow-working-drafts/:draftId/commands",Zi="/flow-working-drafts/:draftId/edit-turn/acquire",es="/flow-working-drafts/:draftId/edit-turn/release",ts="/flow-working-drafts/:draftId/publish",ns="/flow-working-drafts/:draftId/readiness/check",rs="/flow-working-drafts/:draftId/readiness/requirements/:requirementId/resolve",os="/flow-creation-tasks/:flowCreationTaskId",is="/flow-creation-decisions/:decisionRecordId",ss=()=>`${V}/prompts`,as=()=>`${V}/flow-scenes`,ps=()=>`${V}/flow-templates`,us=e=>`/workspaces/${encodeURIComponent(e)}/agent/flow-working-drafts/open`,E=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-working-drafts/${encodeURIComponent(t)}`,ls=(e,t)=>`${E(e,t)}/commands`,ds=(e,t)=>`${E(e,t)}/edit-turn/acquire`,cs=(e,t)=>`${E(e,t)}/edit-turn/release`,gs=(e,t)=>`${E(e,t)}/publish`,fs=(e,t)=>`${E(e,t)}/readiness/check`,ms=(e,t,n)=>`${E(e,t)}/readiness/requirements/${encodeURIComponent(n)}/resolve`,_s=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-creation-tasks/${encodeURIComponent(t)}`,Rs=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-creation-decisions/${encodeURIComponent(t)}`,ys="agent.asset.manage",Is=/^[A-Za-z0-9_-]{1,64}$/,Ts="flow_create_authoring_task",Qe="oneoff_getActionContext",Ze="oneoff_executeAction",xs=[Qe,Ze],Es=["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"],As="AGENT_ASSET_NOT_FOUND",ws="AGENT_ASSET_VALIDATION_FAILED",ks="AGENT_PROMPT_TARGET_NOT_FOUND",Ss="AGENT_PROMPT_ACTIVE_REVISION_MISSING",hs="AGENT_PROMPT_REVISION_NOT_FOUND",Os="AGENT_PROMPT_REVISION_NOT_DRAFT",Ps="AGENT_PROMPT_VALIDATION_FAILED",Ns="AGENT_MODEL_INPUT_TARGET_PROTECTED",bs="AGENT_MODEL_INPUT_PREVIEW_UNAVAILABLE",Ds="AGENT_FLOW_GOAL_INVALID",Cs="AGENT_FLOW_CREATION_TASK_NOT_FOUND",vs="AGENT_FLOW_CREATION_TASK_CONFLICT",Fs="AGENT_FLOW_AUTHORING_WORKFLOW_FAILED",Us="FLOW_WORKING_DRAFT_NOT_FOUND",Ls="FLOW_DRAFT_REVISION_CONFLICT",Bs="FLOW_DRAFT_COMMAND_INVALID",Gs="FLOW_DRAFT_EDIT_LOCKED",Hs="FLOW_EDIT_TURN_NOT_HELD",Ms="FLOW_DRAFT_NOT_PUBLISHABLE",$s="FLOW_PUBLISH_CONFIRMATION_REQUIRED",Ks="FLOW_READINESS_REQUIREMENT_NOT_FOUND",Ws="FLOW_READINESS_REQUIREMENT_CONFLICT",Vs="AGENT_ASSET_INDEX_FAILED";var js="/workspaces/:workspaceId/runs",Js="/workspaces/:workspaceId/flows/:flowId/runs",Xs="/:runId",Ys="/:runId/cancel",zs="/:runId/events",et=e=>`/workspaces/${encodeURIComponent(e)}/runs`,oe=(e,t)=>`${et(e)}/${encodeURIComponent(t)}`,Qs=(e,t)=>`${oe(e,t)}/cancel`,Zs=(e,t)=>`${oe(e,t)}/events`,ea=(e,t)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/runs`,ta=["queued","running","succeeded","failed","interrupted","cancelled"],na=["succeeded","skipped","timed_out","failed"];var oa="/workspaces/:workspaceId/inbox/items",ia="/workspaces/:workspaceId/inbox/entries",ie="/inbox/entries",sa="/:itemId",aa="/:entryId",pa="/:entryId/human-input/submit",tt=e=>`/workspaces/${encodeURIComponent(e)}/inbox/items`,ua=(e,t)=>`${tt(e)}/${encodeURIComponent(t)}`,nt=e=>`/workspaces/${encodeURIComponent(e)}/inbox/entries`,rt=(e,t)=>`${nt(e)}/${encodeURIComponent(t)}`,la=(e,t)=>`${rt(e,t)}/human-input/submit`,da=()=>ie,ot=e=>`${ie}/${encodeURIComponent(e)}`,ca=e=>`${ot(e)}/human-input/submit`;var fa="/human-input/tokens",ma="/:token",_a="/:token/submit",it=e=>`/human-input/tokens/${encodeURIComponent(e)}`,Ra=e=>`${it(e)}/submit`;var Ia="/:flowId/trigger-instances",Ta="/:flowId/triggers/:triggerBindingId/simulate",xa=(e,t)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/trigger-instances`,Ea=(e,t,n)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/triggers/${encodeURIComponent(n)}/simulate`;export{V as AGENT_ASSETS_ROUTE_PREFIX,Hi as AGENT_ASSET_FLOW_SCENES_SUBPATH,Ki as AGENT_ASSET_FLOW_SCENE_ACTIVATE_SUBPATH,Mi as AGENT_ASSET_FLOW_SCENE_ITEM_SUBPATH,Wi as AGENT_ASSET_FLOW_SCENE_REINDEX_SUBPATH,$i as AGENT_ASSET_FLOW_SCENE_VALIDATE_SUBPATH,Vi as AGENT_ASSET_FLOW_TEMPLATES_SUBPATH,Ji as AGENT_ASSET_FLOW_TEMPLATE_ACTIVATE_SUBPATH,qi as AGENT_ASSET_FLOW_TEMPLATE_ITEM_SUBPATH,Xi as AGENT_ASSET_FLOW_TEMPLATE_REINDEX_SUBPATH,ji as AGENT_ASSET_FLOW_TEMPLATE_VALIDATE_SUBPATH,Vs as AGENT_ASSET_INDEX_FAILED_ERROR_CODE,ys as AGENT_ASSET_MANAGE_PERMISSION,Gi as AGENT_ASSET_MODEL_INPUT_SNAPSHOTS_SUBPATH,Li as AGENT_ASSET_MODEL_INPUT_TARGETS_SUBPATH,Bi as AGENT_ASSET_MODEL_INPUT_TARGET_PREVIEW_SUBPATH,As as AGENT_ASSET_NOT_FOUND_ERROR_CODE,Ci as AGENT_ASSET_PROMPTS_SUBPATH,Ui as AGENT_ASSET_PROMPT_ACTIVATE_SUBPATH,vi as AGENT_ASSET_PROMPT_ITEM_SUBPATH,Fi as AGENT_ASSET_PROMPT_VALIDATE_SUBPATH,ws as AGENT_ASSET_VALIDATION_FAILED_ERROR_CODE,Ii as AGENT_CAPABILITY_FLOW_AUTHORING,ui as AGENT_CHAT_ROUTE_SUBPATH,Ts as AGENT_CREATE_FLOW_AUTHORING_TASK_TOOL_NAME,Fs as AGENT_FLOW_AUTHORING_WORKFLOW_FAILED_ERROR_CODE,li as AGENT_FLOW_CONTEXT_ROUTE_SUBPATH,is as AGENT_FLOW_CREATION_DECISION_ITEM_SUBPATH,vs as AGENT_FLOW_CREATION_TASK_CONFLICT_ERROR_CODE,os as AGENT_FLOW_CREATION_TASK_ITEM_SUBPATH,Cs as AGENT_FLOW_CREATION_TASK_NOT_FOUND_ERROR_CODE,Ds as AGENT_FLOW_GOAL_INVALID_ERROR_CODE,rs as AGENT_FLOW_READINESS_REQUIREMENT_RESOLVE_SUBPATH,Qi as AGENT_FLOW_WORKING_DRAFT_COMMANDS_SUBPATH,Zi as AGENT_FLOW_WORKING_DRAFT_EDIT_TURN_ACQUIRE_SUBPATH,es as AGENT_FLOW_WORKING_DRAFT_EDIT_TURN_RELEASE_SUBPATH,zi as AGENT_FLOW_WORKING_DRAFT_ITEM_SUBPATH,Yi as AGENT_FLOW_WORKING_DRAFT_OPEN_SUBPATH,ts as AGENT_FLOW_WORKING_DRAFT_PUBLISH_SUBPATH,ns as AGENT_FLOW_WORKING_DRAFT_READINESS_CHECK_SUBPATH,bi as AGENT_MESSAGE_DELTA_INVALID_ERROR_CODE,bs as AGENT_MODEL_INPUT_PREVIEW_UNAVAILABLE_ERROR_CODE,Es as AGENT_MODEL_INPUT_TARGET_KEYS,Ns as AGENT_MODEL_INPUT_TARGET_PROTECTED_ERROR_CODE,Di as AGENT_PAGE_CONTEXT_INVALID_ERROR_CODE,Ei as AGENT_PAGE_CONTEXT_MAX_RESOURCES,Ai as AGENT_PAGE_CONTEXT_RESOURCE_ID_MAX_LENGTH,xi as AGENT_PAGE_CONTEXT_ROUTE_ID_MAX_LENGTH,Ti as AGENT_PAGE_RESOURCE_TYPES,Ss as AGENT_PROMPT_ACTIVE_REVISION_MISSING_ERROR_CODE,Os as AGENT_PROMPT_REVISION_NOT_DRAFT_ERROR_CODE,hs as AGENT_PROMPT_REVISION_NOT_FOUND_ERROR_CODE,ks as AGENT_PROMPT_TARGET_NOT_FOUND_ERROR_CODE,Ps as AGENT_PROMPT_VALIDATION_FAILED_ERROR_CODE,pi as AGENT_ROUTE_PREFIX,Pi as AGENT_RUNTIME_FAILED_ERROR_CODE,Is as AGENT_RUNTIME_TOOL_NAME_PATTERN,Oi as AGENT_RUNTIME_UNCONFIGURED_ERROR_CODE,di as AGENT_SESSIONS_ROUTE_SUBPATH,yi as AGENT_SESSION_DETAIL_MESSAGE_LIMIT,ci as AGENT_SESSION_ITEM_ROUTE_SUBPATH,_i as AGENT_SESSION_LIST_DEFAULT_LIMIT,Ri as AGENT_SESSION_LIST_MAX_LIMIT,Ni as AGENT_SESSION_NOT_FOUND_ERROR_CODE,K as API_KEYS_ROUTE_PREFIX,qe as API_KEY_GRANT_OPTIONS_ROUTE_SUBPATH,go as API_KEY_ITEM_ROUTE_SUBPATH,fo as API_KEY_TOKEN_PREFIX,mo as API_KEY_WORKSPACE_FULL_ACCESS_SCOPE,We as APP_BOOTSTRAP_ROUTE_PATH,Ao as CATALOG_DEFAULT_PROVIDER_APP_CONFIG_ROUTE_SUBPATH,To as CATALOG_INTEGRATIONS_ROUTE_SUBPATH,xo as CATALOG_INTEGRATION_DETAIL_ROUTE_SUBPATH,W as CATALOG_ROUTE_PREFIX,Eo as CATALOG_VERSIONS_ROUTE_SUBPATH,vo as CONNECTIONS_ROUTE_SUBPATH,Go as CONNECTION_DISCONNECT_ROUTE_SUBPATH,Bo as CONNECT_COMPLETE_ROUTE_SUBPATH,Uo as CONNECT_OPTIONS_ROUTE_SUBPATH,Fo as CONNECT_START_ROUTE_SUBPATH,Lo as CONNECT_SUBMIT_ROUTE_SUBPATH,to as CURRENT_USER_ROUTE_PATH,Ve as DEFAULT_WORKSPACE_ROUTE_PATH,Ke as DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES,$r as DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES,Mr as DEPLOYMENT_HANDSHAKE_ROUTE,vn as EGRESS_GRANT_AUDIT_ROUTE_SUBPATH,Cn as EGRESS_GRANT_CONSUME_ROUTE_SUBPATH,Pe as EGRESS_GRANT_SCOPE_KINDS,Tt as EVENT_WAIT_ROUTE_SUBPATH,ct as EXECUTION_CONTEXT_ROUTE_SUBPATH,yr as FILE_CONTENT_ROUTE_SUBPATH,Rr as FILE_STAT_ROUTE_SUBPATH,ki as FLOW_AUTHORING_EDIT_TOOL_NAMES,ze as FLOW_AUTHORING_TOOL_DESCRIPTORS,wi as FLOW_AUTHORING_TOOL_NAMES,Qo as FLOW_DISABLE_ROUTE_SUBPATH,Bs as FLOW_DRAFT_COMMAND_INVALID_ERROR_CODE,Gs as FLOW_DRAFT_EDIT_LOCKED_ERROR_CODE,Ms as FLOW_DRAFT_NOT_PUBLISHABLE_ERROR_CODE,Ls as FLOW_DRAFT_REVISION_CONFLICT_ERROR_CODE,Zo as FLOW_DRAFT_ROUTE_SUBPATH,Hs as FLOW_EDIT_TURN_NOT_HELD_ERROR_CODE,zo as FLOW_ENABLE_ROUTE_SUBPATH,ae as FLOW_INTERPRETER_CONTRACT_VERSION,at as FLOW_IR_SCHEMA_VERSION,Yo as FLOW_ITEM_ROUTE_SUBPATH,$s as FLOW_PUBLISH_CONFIRMATION_REQUIRED_ERROR_CODE,Ws as FLOW_READINESS_REQUIREMENT_CONFLICT_ERROR_CODE,Ks as FLOW_READINESS_REQUIREMENT_NOT_FOUND_ERROR_CODE,Pn as FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH,It as FLOW_RUN_RESULT_ROUTE_SUBPATH,tr as FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,ta as FLOW_RUN_STATUSES,Xo as FLOW_VALIDATE_ROUTE_SUBPATH,ei as FLOW_VERSIONS_ROUTE_SUBPATH,ti as FLOW_VERSION_ITEM_ROUTE_SUBPATH,Us as FLOW_WORKING_DRAFT_NOT_FOUND_ERROR_CODE,ie as GLOBAL_INBOX_ENTRIES_ROUTE_PREFIX,Dt as HANDLER_BUNDLES_ROUTE_SUBPATH,Jr as HANDSHAKE_CAPABILITY_MISSING,qr as HANDSHAKE_CONTRACT_VERSION_MISMATCH,jr as HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH,Kr as HANDSHAKE_REQUEST_INVALID,Vr as HANDSHAKE_SECRET_MISMATCH,Wr as HANDSHAKE_SECRET_UNCONFIGURED,Sr as HUMAN_INPUTS_ROUTE_SUBPATH,Pr as HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH,Or as HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH,hr as HUMAN_INPUT_REQUEST_ROUTE_SUBPATH,Fe as HUMAN_INPUT_RESOLVED_EVENT_PREFIX,fa as HUMAN_INPUT_TOKENS_ROUTE_PREFIX,ma as HUMAN_INPUT_TOKEN_ROUTE_SUBPATH,_a as HUMAN_INPUT_TOKEN_SUBMIT_ROUTE_SUBPATH,pa as INBOX_ENTRY_HUMAN_INPUT_SUBMIT_ROUTE_SUBPATH,aa as INBOX_ENTRY_ROUTE_SUBPATH,sa as INBOX_ITEM_ROUTE_SUBPATH,Po as INTEGRATION_ITEM_ROUTE_SUBPATH,No as INTEGRATION_TOOLS_ROUTE_SUBPATH,Y as INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX,$ as INTERNAL_FILES_ROUTE_PREFIX,f as INTERNAL_FLOW_RUNS_ROUTE_PREFIX,ge as INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX,H as INTERNAL_INSTALLATIONS_ROUTE_PREFIX,k as INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX,M as INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX,w as INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX,Ze as ONE_OFF_EXECUTE_ACTION_TOOL_NAME,Qe as ONE_OFF_GET_ACTION_CONTEXT_TOOL_NAME,xs as ONE_OFF_TOOL_NAMES,Qr as PLATFORM_ACCESS_PERMISSION,Zr as PLATFORM_API_KEY_MANAGE_PERMISSION,cn as POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH,bn as POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,gn as POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,rr as POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,mn as POLLING_TRIGGER_STORE_ROUTE_SUBPATH,fn as POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH,Ho as PROVIDER_CALLBACK_REDIRECT_ROUTE_PATH,ur as RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS,Ys as RUN_CANCEL_ROUTE_SUBPATH,zs as RUN_EVENTS_ROUTE_SUBPATH,Xs as RUN_ITEM_ROUTE_SUBPATH,se as SERVER_CONTRACT_VERSION,yt as STEP_RESULT_ROUTE_SUBPATH,na as STEP_RUN_STATUSES,Ct as TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH,Nn as TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH,nr as TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Ia as TRIGGER_INSTANCES_ROUTE_SUBPATH,Ta as TRIGGER_SIMULATE_ROUTE_SUBPATH,en as WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH,nn as WEBHOOK_PROTOCOL_ADAPTER_MODULE,$t as WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH,Wt as WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH,Dn as WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,Vt as WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH,Kt as WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,qt as WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH,or as WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,jt as WEBHOOK_TRIGGER_STORE_ROUTE_SUBPATH,Lr as WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION,Br as WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION,ne as WORKSPACES_ROUTE_PREFIX,ao as WORKSPACE_ACCESS_ROUTE_SUBPATH,Co as WORKSPACE_CONNECTION_MOUNT_PREFIX,Jo as WORKSPACE_FLOWS_ROUTE_PREFIX,Js as WORKSPACE_FLOW_RUNS_ROUTE_PREFIX,ia as WORKSPACE_INBOX_ENTRIES_ROUTE_PREFIX,oa as WORKSPACE_INBOX_ITEMS_ROUTE_PREFIX,Oo as WORKSPACE_INTEGRATIONS_ROUTE_PREFIX,so as WORKSPACE_LIST_ROUTE_SUBPATH,js as WORKSPACE_RUNS_ROUTE_PREFIX,as as agentAssetFlowScenesPath,ps as agentAssetFlowTemplatesPath,ss as agentAssetPromptsPath,gi as agentChatPath,Rs as agentFlowCreationDecisionPath,_s as agentFlowCreationTaskPath,ms as agentFlowReadinessRequirementResolvePath,ls as agentFlowWorkingDraftCommandsPath,ds as agentFlowWorkingDraftEditTurnAcquirePath,cs as agentFlowWorkingDraftEditTurnReleasePath,us as agentFlowWorkingDraftOpenPath,E as agentFlowWorkingDraftPath,gs as agentFlowWorkingDraftPublishPath,fs as agentFlowWorkingDraftReadinessCheckPath,mi as agentSessionPath,fi as agentSessionsPath,Ro as apiKeyGrantOptionsPath,yo as apiKeyPath,_o as apiKeysPath,oo as appBootstrapPath,So as catalogDefaultProviderAppConfigPath,je as catalogIntegrationPath,wo as catalogIntegrationsPath,ko as catalogVersionsPath,Vo as connectCompletePath,Ko as connectOptionsPath,$o as connectStartPath,Wo as connectSubmitPath,qo as connectionDisconnectPath,o as contractParseFail,p as contractParseOk,no as currentUserPath,lo as defaultWorkspacePath,Xr as deploymentHandshakeProbePayload,Yr as deploymentHandshakeResponseProofPayload,Hn as egressGrantAuditPath,Gn as egressGrantConsumePath,At as eventWaitPath,gt as executionContextPath,hi as findFlowAuthoringToolDescriptor,oi as flowDisablePath,ii as flowDraftPath,ri as flowEnablePath,F as flowPath,Fn as flowRunEgressGrantPath,Et as flowRunResultPath,ir as flowRunRuntimeCredentialPath,ea as flowRunsPath,rn as flowScriptProtocolAdapterModuleName,ni as flowValidatePath,si as flowVersionPath,Ye as flowVersionsPath,Si as formatFlowToolError,da as globalInboxEntriesPath,ca as globalInboxEntryHumanInputSubmitPath,ot as globalInboxEntryPath,vt as handlerBundlesPath,br as humanInputAcknowledgePath,Nr as humanInputExpirePath,Z as humanInputRequestPath,Dr as humanInputResolvedEventType,it as humanInputTokenPath,Ra as humanInputTokenSubmitPath,ve as humanInputsPath,la as inboxEntryHumanInputSubmitPath,rt as inboxEntryPath,ua as inboxItemPath,bo as installationToolsPath,xr as internalFileContentPath,Tr as internalFileStatPath,Ir as internalFilesPath,i as isJsonRecord,S as isValidRequestDigest,Pt as parseCompleteFlowRunWaitBody,Cr as parseCreateHumanInputBody,qn as parseEgressGrantAuditBody,Vn as parseEgressGrantConsumeBody,Jn as parseEgressGrantConsumeData,jn as parseEgressGrantData,ft as parseExecutionContextData,Er as parseFileRefData,pe as parseFileRuntimeLimits,Mn as parseFlowActionGrantBody,St as parseFlowRunResultBody,ht as parseFlowRunResultData,lr as parseFlowRuntimeCredentialBody,me as parseHandlerBundle,Ut as parseHandlerBundlesData,Fr as parseHumanInputAcknowledgeData,vr as parseHumanInputCreateData,$e as parseHumanInputRequestViewData,xn as parsePollingPublishBody,cr as parsePollingRuntimeCredentialBody,Ee as parsePollingStorePutBody,Te as parsePollingStoreValue,Tn as parsePollingTriggerContext,Kn as parsePollingTriggerGrantBody,En as parsePublishPollingTickEventsData,Ot as parseRegisterFlowRunWaitBody,Nt as parseRegisterFlowRunWaitData,fr as parseRuntimeCredentialSessionCredential,O as parseRuntimeNetwork,$n as parseSingleToolGrantBody,dr as parseSingleToolRuntimeCredentialBody,wt as parseStepRecordBody,kt as parseStepRecordData,Lt as parseToolHandlerBundlesData,an as parseTriggerHandlerBundlesData,sn as parseWebhookDelivery,pn as parseWebhookPublishEventsBody,un as parseWebhookRearmBody,gr as parseWebhookRuntimeCredentialBody,Ee as parseWebhookStorePutBody,Te as parseWebhookStoreValue,Wn as parseWebhookTriggerGrantBody,on as parseWebhookWatcherContext,_n as pollingTriggerContextPath,Ln as pollingTriggerEgressGrantPath,Rn as pollingTriggerHandlerBundlesPath,ar as pollingTriggerRuntimeCredentialPath,In as pollingTriggerStorePath,yn as pollingTriggerTickEventsPath,be as requestHasMultipartFileParts,Qs as runCancelPath,Zs as runEventsPath,oe as runPath,xt as stepResultPath,Ft as toolHandlerBundlesPath,Un as toolInvocationEgressGrantPath,sr as toolInvocationRuntimeCredentialPath,xa as triggerInstancesPath,Ea as triggerSimulatePath,tn as webhookProtocolAdapterBundlePath,Jt as webhookTriggerContextPath,Yt as webhookTriggerDeliveryPath,Bn as webhookTriggerEgressGrantPath,zt as webhookTriggerEventsPath,Xt as webhookTriggerHandlerBundlesPath,Qt as webhookTriggerRearmPath,pr as webhookTriggerRuntimeCredentialPath,Zt as webhookTriggerStorePath,Gr as wfpUserRuntimeManifestPath,Mo as workspaceConnectionsPath,re as workspaceFlowsPath,nt as workspaceInboxEntriesPath,tt as workspaceInboxItemsPath,Xe as workspaceIntegrationPath,Je as workspaceIntegrationsPath,po as workspacePath,et as workspaceRunsPath,uo as workspacesPath};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ablehi/server-contract",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Ablehi server wire contract: routes, wire DTOs, Flow IR and interpreter version.",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {