@ablehi/server-contract 0.1.7 → 0.1.9
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 +1 -1
- package/dist/edge.js +1 -1
- package/dist/index.d.ts +274 -34
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/edge.d.ts
CHANGED
package/dist/edge.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var J="0.1.7";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.1.9";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};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JsonValue, FlowNode,
|
|
2
|
-
export { AblehiEnvelope, AblehiFailure, AblehiSuccess, ActionNode, BooleanExpression, Collection, CompleteFlowRunWaitBody, CompleteFlowRunWaitData, ContractParseResult, CreateHumanInputRequestBody, DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES, DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES, DEPLOYMENT_HANDSHAKE_ROUTE, DeploymentHandshakeData, DeploymentHandshakeRequestBody, DeploymentHandshakeResponse, EGRESS_GRANT_AUDIT_ROUTE_SUBPATH, EGRESS_GRANT_CONSUME_ROUTE_SUBPATH, EGRESS_GRANT_SCOPE_KINDS, EVENT_WAIT_ROUTE_SUBPATH, EXECUTION_CONTEXT_ROUTE_SUBPATH, EgressGrant, EgressGrantAuditBody, EgressGrantBodyParseResult, EgressGrantConsumeBody, EgressGrantFileRuntime, EgressGrantScopeKind, ExecutionBinding, ExecutionBindingConnection, ExecutionContextCompiled, ExecutionContextData, FILE_CONTENT_ROUTE_SUBPATH, FILE_STAT_ROUTE_SUBPATH, FLOW_INTERPRETER_CONTRACT_VERSION, FLOW_IR_SCHEMA_VERSION, FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH, FLOW_RUN_RESULT_ROUTE_SUBPATH, FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, FileRefData, FileRuntimeLimits, FileRuntimeScope, FileRuntimeScopeKind, FlowActionGrantBody, FlowDefinition, FlowExecutionContextFileRuntime, FlowInterpreterContractVersion, FlowIrValidationCode, FlowIrValidationIssue,
|
|
1
|
+
import { JsonValue, FlowNode, FlowIrValidationResult, JsonObject, FlowCompositionSpec, Mapping, TriggerBinding } from './edge.js';
|
|
2
|
+
export { AblehiEnvelope, AblehiFailure, AblehiSuccess, ActionNode, BooleanExpression, Collection, CompleteFlowRunWaitBody, CompleteFlowRunWaitData, ContractParseResult, CreateHumanInputRequestBody, DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES, DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES, DEPLOYMENT_HANDSHAKE_ROUTE, DeploymentHandshakeData, DeploymentHandshakeRequestBody, DeploymentHandshakeResponse, EGRESS_GRANT_AUDIT_ROUTE_SUBPATH, EGRESS_GRANT_CONSUME_ROUTE_SUBPATH, EGRESS_GRANT_SCOPE_KINDS, EVENT_WAIT_ROUTE_SUBPATH, EXECUTION_CONTEXT_ROUTE_SUBPATH, EgressGrant, EgressGrantAuditBody, EgressGrantBodyParseResult, EgressGrantConsumeBody, EgressGrantFileRuntime, EgressGrantScopeKind, ExecutionBinding, ExecutionBindingConnection, ExecutionContextCompiled, ExecutionContextData, FILE_CONTENT_ROUTE_SUBPATH, FILE_STAT_ROUTE_SUBPATH, FLOW_INTERPRETER_CONTRACT_VERSION, FLOW_IR_SCHEMA_VERSION, FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH, FLOW_RUN_RESULT_ROUTE_SUBPATH, FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, FileRefData, FileRuntimeLimits, FileRuntimeScope, FileRuntimeScopeKind, FlowActionGrantBody, FlowDefinition, FlowExecutionContextFileRuntime, FlowInterpreterContractVersion, FlowIrValidationCode, FlowIrValidationIssue, FlowRunResultData, FlowRunResultRequestBody, FlowRuntimeCredentialBody, HANDLER_BUNDLES_ROUTE_SUBPATH, HANDSHAKE_CAPABILITY_MISSING, HANDSHAKE_CONTRACT_VERSION_MISMATCH, HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH, HANDSHAKE_REQUEST_INVALID, HANDSHAKE_SECRET_MISMATCH, HANDSHAKE_SECRET_UNCONFIGURED, HUMAN_INPUTS_ROUTE_SUBPATH, HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH, HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH, HUMAN_INPUT_REQUEST_ROUTE_SUBPATH, HUMAN_INPUT_RESOLVED_EVENT_PREFIX, HandlerBundle, HandlerBundleModule, HandlerBundlesData, HandlerBundlesParseResult, HumanChoiceInput, HumanFormField, HumanFormInput, HumanInputActor, HumanInputChoice, HumanInputDelivery, HumanInputDeliveryAction, HumanInputNode, HumanInputOutput, HumanInputPrompt, HumanInputRequestView, HumanInputResolvedEvent, HumanInputResponse, HumanInputSpec, HumanTextInput, INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX, INTERNAL_FILES_ROUTE_PREFIX, INTERNAL_FLOW_RUNS_ROUTE_PREFIX, INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX, INTERNAL_INSTALLATIONS_ROUTE_PREFIX, INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX, INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX, INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX, IntegrationTriggerBinding, JsonArray, ManualTriggerBinding, NodeCommon, Operand, POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH, POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH, POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH, POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, POLLING_TRIGGER_STORE_ROUTE_SUBPATH, POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH, PackagePollingTriggerRuntimeDescriptor, PackageWebhookTriggerRuntimeDescriptor, ParsedFlowRunResultBody, PartiallyRenderedHumanInputDelivery, PartiallyRenderedMapping, PartiallyRenderedTemplatePart, PartiallyRenderedValue, PollingPublishBody, PollingPublishEvent, PollingRuntimeCredentialBody, PollingStoreGetData, PollingStorePutBody, PollingTriggerContext, PollingTriggerGrantBody, PublishPollingTickEventResult, PublishPollingTickEventsData, RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS, RegisterFlowRunWaitBody, RegisterFlowRunWaitData, RenderedFlowComposition, RenderedHumanInputPrompt, RuntimeCredentialSession, RuntimeCredentialSessionNetwork, RuntimeCredentialSessionScopeKind, RuntimeNetwork, RuntimeNetworkModel, SERVER_CONTRACT_VERSION, STEP_RESULT_ROUTE_SUBPATH, ScheduleTriggerBinding, ServerContractVersion, SingleToolGrantBody, SleepNode, StepRecordBody, StepRecordBodyParseResult, StepRecordData, StepRecordResult, TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH, TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH, TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, TextExpression, ToolHandlerBundlesData, TriggerConnectionInfo, TriggerHandlerBundlesData, TriggerHandlerModule, ValueExpression, WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH, WEBHOOK_PROTOCOL_ADAPTER_MODULE, WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH, WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH, WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH, WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH, WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH, WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH, WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH, WEBHOOK_TRIGGER_STORE_ROUTE_SUBPATH, WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION, WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION, WaitEventNode, WebhookDelivery, WebhookProtocolAdapterBundleData, WebhookProtocolAdapterModule, WebhookPublishEvent, WebhookPublishEventsBody, WebhookPublishEventsData, WebhookRearmBody, WebhookRearmData, WebhookRuntimeCredentialBody, PollingStoreGetData as WebhookStoreGetData, PollingStorePutBody as WebhookStorePutBody, WebhookTriggerGrantBody, WebhookTriggerVerificationMethod, WebhookWatcherContext, WfpUserRuntimeManifest, contractParseFail, contractParseOk, deploymentHandshakeProbePayload, deploymentHandshakeResponseProofPayload, egressGrantAuditPath, egressGrantConsumePath, eventWaitPath, executionContextPath, flowRunEgressGrantPath, flowRunResultPath, flowRunRuntimeCredentialPath, flowScriptProtocolAdapterModuleName, handlerBundlesPath, humanInputAcknowledgePath, humanInputExpirePath, humanInputRequestPath, humanInputResolvedEventType, humanInputsPath, internalFileContentPath, internalFileStatPath, internalFilesPath, isJsonRecord, isValidRequestDigest, parseCompleteFlowRunWaitBody, parseCreateHumanInputBody, parseEgressGrantAuditBody, parseEgressGrantConsumeBody, parseEgressGrantConsumeData, parseEgressGrantData, parseExecutionContextData, parseFileRefData, parseFileRuntimeLimits, parseFlowActionGrantBody, parseFlowRunResultBody, parseFlowRunResultData, parseFlowRuntimeCredentialBody, parseHandlerBundle, parseHandlerBundlesData, parseHumanInputAcknowledgeData, parseHumanInputCreateData, parseHumanInputRequestViewData, parsePollingPublishBody, parsePollingRuntimeCredentialBody, parsePollingStorePutBody, parsePollingStoreValue, parsePollingTriggerContext, parsePollingTriggerGrantBody, parsePublishPollingTickEventsData, parseRegisterFlowRunWaitBody, parseRegisterFlowRunWaitData, parseRuntimeCredentialSessionCredential, parseRuntimeNetwork, parseSingleToolGrantBody, parseSingleToolRuntimeCredentialBody, parseStepRecordBody, parseStepRecordData, parseToolHandlerBundlesData, parseTriggerHandlerBundlesData, parseWebhookDelivery, parseWebhookPublishEventsBody, parseWebhookRearmBody, parseWebhookRuntimeCredentialBody, parsePollingStorePutBody as parseWebhookStorePutBody, parsePollingStoreValue as parseWebhookStoreValue, parseWebhookTriggerGrantBody, parseWebhookWatcherContext, pollingTriggerContextPath, pollingTriggerEgressGrantPath, pollingTriggerHandlerBundlesPath, pollingTriggerRuntimeCredentialPath, pollingTriggerStorePath, pollingTriggerTickEventsPath, requestHasMultipartFileParts, stepResultPath, toolHandlerBundlesPath, toolInvocationEgressGrantPath, toolInvocationRuntimeCredentialPath, webhookProtocolAdapterBundlePath, webhookTriggerContextPath, webhookTriggerDeliveryPath, webhookTriggerEgressGrantPath, webhookTriggerEventsPath, webhookTriggerHandlerBundlesPath, webhookTriggerRearmPath, webhookTriggerRuntimeCredentialPath, webhookTriggerStorePath, wfpUserRuntimeManifestPath } from './edge.js';
|
|
3
3
|
|
|
4
4
|
declare const CURRENT_USER_ROUTE_PATH = "/me";
|
|
5
5
|
declare const currentUserPath: () => string;
|
|
@@ -566,14 +566,11 @@ type AgentPageContext = {
|
|
|
566
566
|
declare const AGENT_PAGE_CONTEXT_ROUTE_ID_MAX_LENGTH = 256;
|
|
567
567
|
declare const AGENT_PAGE_CONTEXT_MAX_RESOURCES = 10;
|
|
568
568
|
declare const AGENT_PAGE_CONTEXT_RESOURCE_ID_MAX_LENGTH = 256;
|
|
569
|
-
type FlowAuthoringWorkingDraftCandidate = {
|
|
570
|
-
flowId?: string | null;
|
|
571
|
-
ir: unknown;
|
|
572
|
-
};
|
|
573
569
|
type AgentTaskSurface = {
|
|
574
570
|
kind: "flow_authoring";
|
|
575
|
-
|
|
576
|
-
|
|
571
|
+
draftId: string;
|
|
572
|
+
expectedRevision: number;
|
|
573
|
+
flowCreationTaskId?: string;
|
|
577
574
|
};
|
|
578
575
|
type AgentChatRequestBody = {
|
|
579
576
|
sessionId: string;
|
|
@@ -702,6 +699,7 @@ declare const AGENT_RUNTIME_UNCONFIGURED_ERROR_CODE = "AGENT_RUNTIME_UNCONFIGURE
|
|
|
702
699
|
declare const AGENT_RUNTIME_FAILED_ERROR_CODE = "AGENT_RUNTIME_FAILED";
|
|
703
700
|
declare const AGENT_APPROVAL_NOT_FOUND_ERROR_CODE = "AGENT_APPROVAL_NOT_FOUND";
|
|
704
701
|
declare const AGENT_APPROVAL_EXPIRED_ERROR_CODE = "AGENT_APPROVAL_EXPIRED";
|
|
702
|
+
declare const FLOW_DRAFT_APPROVAL_DIGEST_MISMATCH_ERROR_CODE = "FLOW_DRAFT_APPROVAL_DIGEST_MISMATCH";
|
|
705
703
|
declare const AGENT_SESSION_NOT_FOUND_ERROR_CODE = "AGENT_SESSION_NOT_FOUND";
|
|
706
704
|
declare const AGENT_MESSAGE_DELTA_INVALID_ERROR_CODE = "AGENT_MESSAGE_DELTA_INVALID";
|
|
707
705
|
declare const AGENT_PAGE_CONTEXT_INVALID_ERROR_CODE = "AGENT_PAGE_CONTEXT_INVALID";
|
|
@@ -724,24 +722,107 @@ declare const AGENT_ASSET_FLOW_TEMPLATE_ITEM_SUBPATH = "/flow-templates/:templat
|
|
|
724
722
|
declare const AGENT_ASSET_FLOW_TEMPLATE_VALIDATE_SUBPATH = "/flow-templates/:templateKey/:revision/validate";
|
|
725
723
|
declare const AGENT_ASSET_FLOW_TEMPLATE_ACTIVATE_SUBPATH = "/flow-templates/:templateKey/:revision/activate";
|
|
726
724
|
declare const AGENT_ASSET_FLOW_TEMPLATE_REINDEX_SUBPATH = "/flow-templates/:templateKey/:revision/reindex";
|
|
727
|
-
declare const
|
|
728
|
-
declare const
|
|
725
|
+
declare const AGENT_FLOW_WORKING_DRAFT_OPEN_SUBPATH = "/flow-working-drafts/open";
|
|
726
|
+
declare const AGENT_FLOW_WORKING_DRAFT_ITEM_SUBPATH = "/flow-working-drafts/:draftId";
|
|
727
|
+
declare const AGENT_FLOW_WORKING_DRAFT_COMMANDS_SUBPATH = "/flow-working-drafts/:draftId/commands";
|
|
728
|
+
declare const AGENT_FLOW_WORKING_DRAFT_READINESS_CHECK_SUBPATH = "/flow-working-drafts/:draftId/readiness/check";
|
|
729
|
+
declare const AGENT_FLOW_READINESS_REQUIREMENT_RESOLVE_SUBPATH = "/flow-working-drafts/:draftId/readiness/requirements/:requirementId/resolve";
|
|
730
|
+
declare const AGENT_FLOW_CREATION_TASK_ITEM_SUBPATH = "/flow-creation-tasks/:flowCreationTaskId";
|
|
731
|
+
declare const AGENT_FLOW_CREATION_DECISION_ITEM_SUBPATH = "/flow-creation-decisions/:decisionRecordId";
|
|
729
732
|
declare const agentAssetPromptsPath: () => string;
|
|
730
733
|
declare const agentAssetFlowScenesPath: () => string;
|
|
731
734
|
declare const agentAssetFlowTemplatesPath: () => string;
|
|
732
|
-
declare const
|
|
733
|
-
declare const
|
|
735
|
+
declare const agentFlowWorkingDraftOpenPath: (workspaceId: string) => string;
|
|
736
|
+
declare const agentFlowWorkingDraftPath: (workspaceId: string, draftId: string) => string;
|
|
737
|
+
declare const agentFlowWorkingDraftCommandsPath: (workspaceId: string, draftId: string) => string;
|
|
738
|
+
declare const agentFlowWorkingDraftReadinessCheckPath: (workspaceId: string, draftId: string) => string;
|
|
739
|
+
declare const agentFlowReadinessRequirementResolvePath: (workspaceId: string, draftId: string, requirementId: string) => string;
|
|
740
|
+
declare const agentFlowCreationTaskPath: (workspaceId: string, flowCreationTaskId: string) => string;
|
|
741
|
+
declare const agentFlowCreationDecisionPath: (workspaceId: string, decisionRecordId: string) => string;
|
|
734
742
|
declare const AGENT_ASSET_MANAGE_PERMISSION = "agent.asset.manage";
|
|
735
|
-
declare const
|
|
743
|
+
declare const AGENT_RUNTIME_TOOL_NAME_PATTERN: RegExp;
|
|
744
|
+
declare const AGENT_CREATE_FLOW_AUTHORING_TASK_TOOL_NAME = "flow_create_authoring_task";
|
|
745
|
+
declare const ONE_OFF_GET_ACTION_CONTEXT_TOOL_NAME = "oneoff_getActionContext";
|
|
746
|
+
declare const ONE_OFF_EXECUTE_ACTION_TOOL_NAME = "oneoff_executeAction";
|
|
747
|
+
declare const ONE_OFF_TOOL_NAMES: readonly ["oneoff_getActionContext", "oneoff_executeAction"];
|
|
748
|
+
type OneOffToolName = (typeof ONE_OFF_TOOL_NAMES)[number];
|
|
749
|
+
type OneOffGetActionContextInput = Record<string, never>;
|
|
750
|
+
type OneOffExecuteActionInput = {
|
|
751
|
+
installationId: string;
|
|
752
|
+
toolName: string;
|
|
753
|
+
inputs: JsonObject;
|
|
754
|
+
connectionRef?: string;
|
|
755
|
+
};
|
|
756
|
+
type OneOffActionContext = {
|
|
757
|
+
workspace: {
|
|
758
|
+
id: string;
|
|
759
|
+
name: string;
|
|
760
|
+
};
|
|
761
|
+
integrations: Array<{
|
|
762
|
+
installationId: string;
|
|
763
|
+
packageName: string;
|
|
764
|
+
toolCatalogStatus: "available" | "unavailable";
|
|
765
|
+
actions: Array<{
|
|
766
|
+
toolName: string;
|
|
767
|
+
toolRef: string;
|
|
768
|
+
description: string;
|
|
769
|
+
authRequired: boolean;
|
|
770
|
+
requiredInputs: string[];
|
|
771
|
+
inputSchema: Record<string, unknown>;
|
|
772
|
+
outputSchema: Record<string, unknown>;
|
|
773
|
+
}>;
|
|
774
|
+
connections: Array<{
|
|
775
|
+
connectionRef: string;
|
|
776
|
+
connectionName: string;
|
|
777
|
+
authType: string;
|
|
778
|
+
status: "active";
|
|
779
|
+
}>;
|
|
780
|
+
}>;
|
|
781
|
+
};
|
|
782
|
+
type OneOffGetActionContextOutput = {
|
|
783
|
+
status: "ok";
|
|
784
|
+
context: OneOffActionContext;
|
|
785
|
+
} | {
|
|
786
|
+
status: "error";
|
|
787
|
+
errorKind: "not_found" | "misconfigured" | "generic";
|
|
788
|
+
code: string;
|
|
789
|
+
message: string;
|
|
790
|
+
};
|
|
791
|
+
type OneOffExecuteActionOutput = {
|
|
792
|
+
status: "ok";
|
|
793
|
+
taskId: string;
|
|
794
|
+
stepId: string;
|
|
795
|
+
output: unknown;
|
|
796
|
+
timing: {
|
|
797
|
+
totalMs: number;
|
|
798
|
+
scriptResolveMs: number;
|
|
799
|
+
dispatchMs: number;
|
|
800
|
+
reusedExistingScript: boolean | null;
|
|
801
|
+
};
|
|
802
|
+
} | {
|
|
803
|
+
status: "needs_connection";
|
|
804
|
+
installationId: string;
|
|
805
|
+
toolName: string;
|
|
806
|
+
message: string;
|
|
807
|
+
} | {
|
|
808
|
+
status: "not_executable";
|
|
809
|
+
code: string;
|
|
810
|
+
message: string;
|
|
811
|
+
} | {
|
|
812
|
+
status: "failed";
|
|
813
|
+
code: string;
|
|
814
|
+
message: string;
|
|
815
|
+
retryable: boolean;
|
|
816
|
+
};
|
|
736
817
|
type AgentValidationIssue = {
|
|
737
818
|
code: string;
|
|
738
819
|
path?: string;
|
|
739
820
|
message: string;
|
|
740
821
|
severity: "blocking" | "warning";
|
|
741
822
|
};
|
|
742
|
-
type AgentPromptSlot = "agent.global.system" | "agent.intent.flow_goal_spec" | "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";
|
|
823
|
+
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";
|
|
743
824
|
declare const AGENT_PROMPT_SLOTS: readonly AgentPromptSlot[];
|
|
744
|
-
type AgentPromptPurpose = "general_agent" | "flow_goal_generation" | "flow_scene_fit_judge" | "flow_template_fit_judge" | "fallback_authoring_plan" | "flow_authoring_brief_generation" | "flow_authoring_agent" | "flow_execution_content";
|
|
825
|
+
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";
|
|
745
826
|
declare const AGENT_PROMPT_PURPOSES: readonly AgentPromptPurpose[];
|
|
746
827
|
type AgentPromptStatus = "draft" | "active" | "archived";
|
|
747
828
|
type AgentPromptAsset = {
|
|
@@ -1068,36 +1149,57 @@ type FlowAuthoringBrief = {
|
|
|
1068
1149
|
selectionNotes: string[];
|
|
1069
1150
|
assetRefs: FlowAuthoringAssetRef[];
|
|
1070
1151
|
};
|
|
1071
|
-
type
|
|
1072
|
-
type
|
|
1152
|
+
type FlowCreationTaskState = "brief_generating" | "draft_authoring" | "validating" | "readiness_checking" | "setup_required" | "approval_pending" | "saved" | "cancelled" | "failed";
|
|
1153
|
+
type FlowAuthoringBriefSummary = {
|
|
1154
|
+
strategyMode: FlowAuthoringStrategyMode;
|
|
1155
|
+
selectedScene?: {
|
|
1156
|
+
sceneKey: string;
|
|
1157
|
+
title: string;
|
|
1158
|
+
};
|
|
1159
|
+
selectedTemplate?: {
|
|
1160
|
+
templateKey: string;
|
|
1161
|
+
title: string;
|
|
1162
|
+
};
|
|
1163
|
+
authoringGuidance: string[];
|
|
1164
|
+
selectionNotes: string[];
|
|
1165
|
+
};
|
|
1166
|
+
type FlowCreationTaskData = {
|
|
1073
1167
|
id: string;
|
|
1074
1168
|
workspaceId: string;
|
|
1075
1169
|
sessionId: string;
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1170
|
+
state: FlowCreationTaskState;
|
|
1171
|
+
title: string;
|
|
1172
|
+
summary?: string;
|
|
1173
|
+
userVisibleStatus: string;
|
|
1079
1174
|
flowGoalSpec?: FlowGoalSpec;
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1175
|
+
authoringBriefSummary?: FlowAuthoringBriefSummary;
|
|
1176
|
+
workingDraftRef?: {
|
|
1177
|
+
draftId: string;
|
|
1178
|
+
revision: number;
|
|
1179
|
+
};
|
|
1180
|
+
readinessRequirements?: SafeFlowReadinessRequirementData[];
|
|
1181
|
+
flowArtifactRef?: {
|
|
1182
|
+
flowId: string;
|
|
1183
|
+
draftId: string;
|
|
1184
|
+
};
|
|
1083
1185
|
decisionRecordIds: string[];
|
|
1084
1186
|
traceRef?: string;
|
|
1085
1187
|
createdAt: string;
|
|
1086
1188
|
updatedAt: string;
|
|
1087
1189
|
};
|
|
1088
|
-
type
|
|
1190
|
+
type FlowCreationDecisionKind = "goal_interpretation" | "scene_selection" | "template_selection" | "slot_resolution" | "fallback_authoring_plan_generation" | "brief_generation" | "flow_validation" | "draft_command" | "readiness_check" | "save_approval";
|
|
1089
1191
|
type FlowAuthoringDecisionContextRefKind = "ambient" | "resource" | "integration" | "page";
|
|
1090
1192
|
type FlowAuthoringDecisionContextRef = {
|
|
1091
1193
|
kind: FlowAuthoringDecisionContextRefKind;
|
|
1092
1194
|
key: string;
|
|
1093
1195
|
contentHash?: string;
|
|
1094
1196
|
};
|
|
1095
|
-
type
|
|
1197
|
+
type FlowCreationDecisionRecordData = {
|
|
1096
1198
|
id: string;
|
|
1097
1199
|
workspaceId: string;
|
|
1098
1200
|
sessionId: string;
|
|
1099
|
-
|
|
1100
|
-
decisionKind:
|
|
1201
|
+
flowCreationTaskId: string;
|
|
1202
|
+
decisionKind: FlowCreationDecisionKind;
|
|
1101
1203
|
inputJson: JsonValue;
|
|
1102
1204
|
outputJson: JsonValue;
|
|
1103
1205
|
promptSnapshots: AgentPromptSnapshot[];
|
|
@@ -1106,6 +1208,139 @@ type FlowAuthoringDecisionRecordData = {
|
|
|
1106
1208
|
traceRef?: string;
|
|
1107
1209
|
createdAt: string;
|
|
1108
1210
|
};
|
|
1211
|
+
type FlowCreationLifecycleEventType = "draft_opened" | "draft_command_applied" | "validation_passed" | "validation_failed" | "readiness_passed" | "readiness_requirement_created" | "readiness_requirement_resolved" | "approval_pending" | "flow_saved" | "save_cancelled" | "save_failed";
|
|
1212
|
+
type FlowCreationLifecycleEventData = {
|
|
1213
|
+
id: string;
|
|
1214
|
+
workspaceId: string;
|
|
1215
|
+
flowCreationTaskId?: string;
|
|
1216
|
+
draftId?: string;
|
|
1217
|
+
eventType: FlowCreationLifecycleEventType;
|
|
1218
|
+
payload: JsonObject;
|
|
1219
|
+
createdAt: string;
|
|
1220
|
+
};
|
|
1221
|
+
type FlowWorkingDraftOwner = {
|
|
1222
|
+
kind: "flow_creation_task";
|
|
1223
|
+
taskId: string;
|
|
1224
|
+
} | {
|
|
1225
|
+
kind: "direct_flow_edit";
|
|
1226
|
+
flowId: string;
|
|
1227
|
+
};
|
|
1228
|
+
type FlowWorkingDraftOwnerKind = FlowWorkingDraftOwner["kind"];
|
|
1229
|
+
type FlowWorkingDraftSummary = {
|
|
1230
|
+
flow: string | null;
|
|
1231
|
+
triggerIds: string[];
|
|
1232
|
+
nodeIds: string[];
|
|
1233
|
+
toolRefs: string[];
|
|
1234
|
+
connectionRefs: string[];
|
|
1235
|
+
};
|
|
1236
|
+
type FlowDraftProjection<TIr = unknown> = {
|
|
1237
|
+
draftId: string;
|
|
1238
|
+
workspaceId: string;
|
|
1239
|
+
owner: FlowWorkingDraftOwner;
|
|
1240
|
+
revision: number;
|
|
1241
|
+
ir: TIr;
|
|
1242
|
+
summary: FlowWorkingDraftSummary;
|
|
1243
|
+
validationResult?: FlowIrValidationResult;
|
|
1244
|
+
updatedAt: string;
|
|
1245
|
+
};
|
|
1246
|
+
type FlowWorkingDraftOpenRequest = {
|
|
1247
|
+
ownerKind: "flow_creation_task";
|
|
1248
|
+
flowCreationTaskId: string;
|
|
1249
|
+
} | {
|
|
1250
|
+
ownerKind: "direct_flow_edit";
|
|
1251
|
+
flowId: string;
|
|
1252
|
+
};
|
|
1253
|
+
type FlowDraftCommand = {
|
|
1254
|
+
type: "replace_draft";
|
|
1255
|
+
commandId: string;
|
|
1256
|
+
expectedRevision: number;
|
|
1257
|
+
ir: unknown;
|
|
1258
|
+
reason: "user_import" | "repair" | "system_migration";
|
|
1259
|
+
} | {
|
|
1260
|
+
type: "apply_authoring_tool";
|
|
1261
|
+
commandId: string;
|
|
1262
|
+
expectedRevision: number;
|
|
1263
|
+
toolName: FlowAuthoringEditToolName;
|
|
1264
|
+
input: JsonObject;
|
|
1265
|
+
} | {
|
|
1266
|
+
type: "validate_draft";
|
|
1267
|
+
commandId: string;
|
|
1268
|
+
expectedRevision: number;
|
|
1269
|
+
};
|
|
1270
|
+
type OpenFlowWorkingDraftResponse<TIr = unknown> = {
|
|
1271
|
+
draft: FlowDraftProjection<TIr>;
|
|
1272
|
+
task?: FlowCreationTaskData;
|
|
1273
|
+
};
|
|
1274
|
+
type ApplyFlowDraftCommandResponse<TIr = unknown> = {
|
|
1275
|
+
draft: FlowDraftProjection<TIr>;
|
|
1276
|
+
event?: FlowCreationLifecycleEventData;
|
|
1277
|
+
};
|
|
1278
|
+
type FlowReadinessRequirementType = "missing_installation" | "missing_connection" | "missing_stable_config" | "confirmation_required" | "publish_blocker";
|
|
1279
|
+
type FlowReadinessRequirementStatus = "open" | "resolved" | "cancelled";
|
|
1280
|
+
type FlowReadinessRequirementBase = {
|
|
1281
|
+
id: string;
|
|
1282
|
+
status: FlowReadinessRequirementStatus;
|
|
1283
|
+
};
|
|
1284
|
+
type SafeFlowReadinessRequirementData = (FlowReadinessRequirementBase & {
|
|
1285
|
+
type: "missing_installation";
|
|
1286
|
+
integrationRef: string;
|
|
1287
|
+
label: string;
|
|
1288
|
+
}) | (FlowReadinessRequirementBase & {
|
|
1289
|
+
type: "missing_connection";
|
|
1290
|
+
integrationRef: string;
|
|
1291
|
+
label: string;
|
|
1292
|
+
}) | (FlowReadinessRequirementBase & {
|
|
1293
|
+
type: "missing_stable_config";
|
|
1294
|
+
integrationRef: string;
|
|
1295
|
+
configKey: string;
|
|
1296
|
+
label: string;
|
|
1297
|
+
saveAsDefaultAllowed: boolean;
|
|
1298
|
+
}) | (FlowReadinessRequirementBase & {
|
|
1299
|
+
type: "confirmation_required";
|
|
1300
|
+
reason: string;
|
|
1301
|
+
riskLevel: "low" | "medium" | "high";
|
|
1302
|
+
}) | (FlowReadinessRequirementBase & {
|
|
1303
|
+
type: "publish_blocker";
|
|
1304
|
+
code: string;
|
|
1305
|
+
message: string;
|
|
1306
|
+
});
|
|
1307
|
+
type FlowReadinessResultData = {
|
|
1308
|
+
status: "ready" | "setup_required" | "failed";
|
|
1309
|
+
checkedRevision: number;
|
|
1310
|
+
validationDigest: string;
|
|
1311
|
+
requirements: SafeFlowReadinessRequirementData[];
|
|
1312
|
+
summary: {
|
|
1313
|
+
requiredInstallations: number;
|
|
1314
|
+
requiredConnections: number;
|
|
1315
|
+
requiredStableConfigs: number;
|
|
1316
|
+
requiredConfirmations: number;
|
|
1317
|
+
publishBlockers: number;
|
|
1318
|
+
};
|
|
1319
|
+
checkedAt: string;
|
|
1320
|
+
};
|
|
1321
|
+
type CheckFlowReadinessResponse<TIr = unknown> = {
|
|
1322
|
+
draft: FlowDraftProjection<TIr>;
|
|
1323
|
+
readiness: FlowReadinessResultData;
|
|
1324
|
+
event?: FlowCreationLifecycleEventData;
|
|
1325
|
+
};
|
|
1326
|
+
type ResolveFlowReadinessRequirementRequest = {
|
|
1327
|
+
type: "use_existing_connection";
|
|
1328
|
+
connectionLabel: string;
|
|
1329
|
+
} | {
|
|
1330
|
+
type: "save_stable_config";
|
|
1331
|
+
label: string;
|
|
1332
|
+
value: JsonValue;
|
|
1333
|
+
saveAsDefault: boolean;
|
|
1334
|
+
} | {
|
|
1335
|
+
type: "confirm_risk";
|
|
1336
|
+
accepted: boolean;
|
|
1337
|
+
};
|
|
1338
|
+
type ResolveFlowReadinessRequirementResponse<TIr = unknown> = {
|
|
1339
|
+
draft: FlowDraftProjection<TIr>;
|
|
1340
|
+
readiness: FlowReadinessResultData;
|
|
1341
|
+
requirement: SafeFlowReadinessRequirementData;
|
|
1342
|
+
event?: FlowCreationLifecycleEventData;
|
|
1343
|
+
};
|
|
1109
1344
|
type AgentRenderedPromptPreview = {
|
|
1110
1345
|
instructions: string;
|
|
1111
1346
|
promptRef: AgentPromptRef;
|
|
@@ -1179,7 +1414,7 @@ type FlowSceneWriteData = {
|
|
|
1179
1414
|
type FlowTemplateWriteData = {
|
|
1180
1415
|
template: FlowTemplateAsset;
|
|
1181
1416
|
};
|
|
1182
|
-
type
|
|
1417
|
+
type CreateFlowCreationTaskResult = {
|
|
1183
1418
|
status: "flow_goal_invalid";
|
|
1184
1419
|
reason: string;
|
|
1185
1420
|
issues: AgentValidationIssue[];
|
|
@@ -1189,25 +1424,30 @@ type CreateFlowAuthoringTaskResult = {
|
|
|
1189
1424
|
issues: AgentValidationIssue[];
|
|
1190
1425
|
} | {
|
|
1191
1426
|
status: "brief_ready";
|
|
1192
|
-
|
|
1427
|
+
flowCreationTaskId: string;
|
|
1193
1428
|
title: string;
|
|
1194
1429
|
summary: string;
|
|
1195
1430
|
} | {
|
|
1196
1431
|
status: "failed";
|
|
1197
|
-
|
|
1432
|
+
flowCreationTaskId?: string;
|
|
1198
1433
|
reason: string;
|
|
1199
1434
|
} | {
|
|
1200
1435
|
status: "cancelled";
|
|
1201
|
-
|
|
1436
|
+
flowCreationTaskId?: string;
|
|
1202
1437
|
reason: string;
|
|
1203
1438
|
};
|
|
1204
1439
|
declare const AGENT_ASSET_NOT_FOUND_ERROR_CODE = "AGENT_ASSET_NOT_FOUND";
|
|
1205
1440
|
declare const AGENT_ASSET_VALIDATION_FAILED_ERROR_CODE = "AGENT_ASSET_VALIDATION_FAILED";
|
|
1206
1441
|
declare const AGENT_PROMPT_BINDING_CONFLICT_ERROR_CODE = "AGENT_PROMPT_BINDING_CONFLICT";
|
|
1207
1442
|
declare const AGENT_FLOW_GOAL_INVALID_ERROR_CODE = "AGENT_FLOW_GOAL_INVALID";
|
|
1208
|
-
declare const
|
|
1209
|
-
declare const
|
|
1443
|
+
declare const AGENT_FLOW_CREATION_TASK_NOT_FOUND_ERROR_CODE = "AGENT_FLOW_CREATION_TASK_NOT_FOUND";
|
|
1444
|
+
declare const AGENT_FLOW_CREATION_TASK_CONFLICT_ERROR_CODE = "AGENT_FLOW_CREATION_TASK_CONFLICT";
|
|
1210
1445
|
declare const AGENT_FLOW_AUTHORING_WORKFLOW_FAILED_ERROR_CODE = "AGENT_FLOW_AUTHORING_WORKFLOW_FAILED";
|
|
1446
|
+
declare const FLOW_WORKING_DRAFT_NOT_FOUND_ERROR_CODE = "FLOW_WORKING_DRAFT_NOT_FOUND";
|
|
1447
|
+
declare const FLOW_DRAFT_REVISION_CONFLICT_ERROR_CODE = "FLOW_DRAFT_REVISION_CONFLICT";
|
|
1448
|
+
declare const FLOW_DRAFT_COMMAND_INVALID_ERROR_CODE = "FLOW_DRAFT_COMMAND_INVALID";
|
|
1449
|
+
declare const FLOW_READINESS_REQUIREMENT_NOT_FOUND_ERROR_CODE = "FLOW_READINESS_REQUIREMENT_NOT_FOUND";
|
|
1450
|
+
declare const FLOW_READINESS_REQUIREMENT_CONFLICT_ERROR_CODE = "FLOW_READINESS_REQUIREMENT_CONFLICT";
|
|
1211
1451
|
declare const AGENT_ASSET_INDEX_FAILED_ERROR_CODE = "AGENT_ASSET_INDEX_FAILED";
|
|
1212
1452
|
|
|
1213
1453
|
declare const WORKSPACE_RUNS_ROUTE_PREFIX = "/workspaces/:workspaceId/runs";
|
|
@@ -1454,4 +1694,4 @@ type SimulateTriggerData = {
|
|
|
1454
1694
|
duplicate: boolean;
|
|
1455
1695
|
};
|
|
1456
1696
|
|
|
1457
|
-
export { AGENT_APPROVAL_EXPIRED_ERROR_CODE, AGENT_APPROVAL_NOT_FOUND_ERROR_CODE, 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_CANDIDATE_INVALID_ERROR_CODE, AGENT_CAPABILITY_FLOW_AUTHORING, AGENT_CHAT_ROUTE_SUBPATH, AGENT_CREATE_FLOW_AUTHORING_TASK_TOOL_NAME, AGENT_FLOW_AUTHORING_DECISION_ITEM_SUBPATH, AGENT_FLOW_AUTHORING_TASK_CONFLICT_ERROR_CODE, AGENT_FLOW_AUTHORING_TASK_ITEM_SUBPATH, AGENT_FLOW_AUTHORING_TASK_NOT_FOUND_ERROR_CODE, AGENT_FLOW_AUTHORING_WORKFLOW_FAILED_ERROR_CODE, AGENT_FLOW_CONTEXT_ROUTE_SUBPATH, AGENT_FLOW_GOAL_INVALID_ERROR_CODE, 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_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, 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 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 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 CreateFlowAuthoringTaskResult, type CreateFlowSceneInput, type CreateFlowTemplateInput, type CurrentUserData, type DefaultProviderAppConfigAdminData, type DefaultProviderAppConfigDisableData, type DefaultProviderAppConfigUpsertBody, type DefaultProviderAppConfigWriteData, 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_APPROVAL_DATA_PART_TYPE, FLOW_DRAFT_APPROVAL_KIND, FLOW_DRAFT_ROUTE_SUBPATH, FLOW_ENABLE_ROUTE_SUBPATH, FLOW_ITEM_ROUTE_SUBPATH, FLOW_RUN_STATUSES, FLOW_VALIDATE_ROUTE_SUBPATH, FLOW_VERSIONS_ROUTE_SUBPATH, FLOW_VERSION_ITEM_ROUTE_SUBPATH, type FallbackAuthoringPlan, type FlowAssetIndexDocType, type FlowAssetIndexDocument, type FlowAssetStatus, type FlowAssetStrength, type FlowAuthoringAssetRef, type FlowAuthoringBrief, type FlowAuthoringDecisionContextRef, type FlowAuthoringDecisionContextRefKind, type FlowAuthoringDecisionKind, type FlowAuthoringDecisionRecordData, type FlowAuthoringEditToolName, type FlowAuthoringSceneBrief, type FlowAuthoringStrategyMode, type FlowAuthoringTaskData, type FlowAuthoringTaskStatus, type FlowAuthoringTemplateBrief, type FlowAuthoringToolDescriptor, type FlowAuthoringToolExecution, type FlowAuthoringToolInputSchema, type FlowAuthoringToolName, type FlowAuthoringWorkingDraftCandidate, type FlowBadgeData, FlowCompositionSpec, type FlowDeleteData, type FlowDraftApprovalProjection, type FlowDraftRecordData, type FlowDraftSaveSummary, type FlowGoalAssumption, type FlowGoalAssumptionSource, type FlowGoalDelivery, type FlowGoalDeliveryKind, type FlowGoalPersistence, type FlowGoalScheduleFrequency, type FlowGoalSpec, type FlowGoalSpecifiedIntegration, type FlowGoalTrigger, type FlowListData, type FlowListItemData, type FlowMetaUpdate, FlowNode, type FlowPublishData, 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 GetFlowContextInput, type GetWorkingFlowIrInput, type GetWorkingFlowIrOutput, 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, PROVIDER_CALLBACK_REDIRECT_ROUTE_PATH, 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, STEP_RUN_STATUSES, type SaveFlowDraftInput, type SaveToolOutput, 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_API_KEYS_ROUTE_SUBPATH, WORKSPACE_API_KEY_CANONICAL_SCOPES, WORKSPACE_API_KEY_FULL_ACCESS_SCOPE, WORKSPACE_API_KEY_ITEM_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_RUNS_ROUTE_PREFIX, type WorkingIrSummary, type WorkspaceAccessData, type WorkspaceApiKeyCreateBody, type WorkspaceApiKeyCreateData, type WorkspaceApiKeyData, type WorkspaceApiKeyListData, type WorkspaceApiKeyRevokeData, type WorkspaceApiKeyScope, type WorkspaceApiKeyStatus, type WorkspaceData, type WorkspaceMembershipData, type WorkspaceMembershipRole, agentAssetFlowScenesPath, agentAssetFlowTemplatesPath, agentAssetPromptsPath, agentChatPath, agentFlowAuthoringDecisionPath, agentFlowAuthoringTaskPath, agentSessionPath, agentSessionsPath, catalogDefaultProviderAppConfigPath, catalogIntegrationPath, catalogIntegrationsPath, catalogVersionsPath, connectCompletePath, connectOptionsPath, connectStartPath, connectSubmitPath, connectionDisconnectPath, currentUserPath, findFlowAuthoringToolDescriptor, flowDisablePath, flowDraftPath, flowEnablePath, flowPath, flowRunsPath, flowValidatePath, flowVersionPath, flowVersionsPath, formatFlowToolError, humanInputTokenPath, humanInputTokenSubmitPath, inboxEntryHumanInputSubmitPath, inboxEntryPath, inboxItemPath, installationToolsPath, runCancelPath, runEventsPath, runPath, triggerInstancesPath, triggerSimulatePath, workspaceApiKeyPath, workspaceApiKeysPath, workspaceConnectionsPath, workspaceFlowsPath, workspaceInboxEntriesPath, workspaceInboxItemsPath, workspaceIntegrationPath, workspaceIntegrationsPath, workspacePath, workspaceRunsPath };
|
|
1697
|
+
export { AGENT_APPROVAL_EXPIRED_ERROR_CODE, AGENT_APPROVAL_NOT_FOUND_ERROR_CODE, 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_CANDIDATE_INVALID_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_ITEM_SUBPATH, AGENT_FLOW_WORKING_DRAFT_OPEN_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, 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 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, type DefaultProviderAppConfigAdminData, type DefaultProviderAppConfigDisableData, type DefaultProviderAppConfigUpsertBody, type DefaultProviderAppConfigWriteData, 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_APPROVAL_DATA_PART_TYPE, FLOW_DRAFT_APPROVAL_DIGEST_MISMATCH_ERROR_CODE, FLOW_DRAFT_APPROVAL_KIND, FLOW_DRAFT_COMMAND_INVALID_ERROR_CODE, FLOW_DRAFT_REVISION_CONFLICT_ERROR_CODE, FLOW_DRAFT_ROUTE_SUBPATH, FLOW_ENABLE_ROUTE_SUBPATH, FLOW_ITEM_ROUTE_SUBPATH, 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 FlowDraftApprovalProjection, type FlowDraftCommand, type FlowDraftProjection, type FlowDraftRecordData, type FlowDraftSaveSummary, 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, type GetFlowContextInput, type GetWorkingFlowIrInput, type GetWorkingFlowIrOutput, 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, PROVIDER_CALLBACK_REDIRECT_ROUTE_PATH, 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 SaveFlowDraftInput, type SaveToolOutput, 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_API_KEYS_ROUTE_SUBPATH, WORKSPACE_API_KEY_CANONICAL_SCOPES, WORKSPACE_API_KEY_FULL_ACCESS_SCOPE, WORKSPACE_API_KEY_ITEM_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_RUNS_ROUTE_PREFIX, type WorkingIrSummary, type WorkspaceAccessData, type WorkspaceApiKeyCreateBody, type WorkspaceApiKeyCreateData, type WorkspaceApiKeyData, type WorkspaceApiKeyListData, type WorkspaceApiKeyRevokeData, type WorkspaceApiKeyScope, type WorkspaceApiKeyStatus, type WorkspaceData, type WorkspaceMembershipData, type WorkspaceMembershipRole, agentAssetFlowScenesPath, agentAssetFlowTemplatesPath, agentAssetPromptsPath, agentChatPath, agentFlowCreationDecisionPath, agentFlowCreationTaskPath, agentFlowReadinessRequirementResolvePath, agentFlowWorkingDraftCommandsPath, agentFlowWorkingDraftOpenPath, agentFlowWorkingDraftPath, agentFlowWorkingDraftReadinessCheckPath, agentSessionPath, agentSessionsPath, catalogDefaultProviderAppConfigPath, catalogIntegrationPath, catalogIntegrationsPath, catalogVersionsPath, connectCompletePath, connectOptionsPath, connectStartPath, connectSubmitPath, connectionDisconnectPath, currentUserPath, findFlowAuthoringToolDescriptor, flowDisablePath, flowDraftPath, flowEnablePath, flowPath, flowRunsPath, flowValidatePath, flowVersionPath, flowVersionsPath, formatFlowToolError, humanInputTokenPath, humanInputTokenSubmitPath, inboxEntryHumanInputSubmitPath, inboxEntryPath, inboxItemPath, installationToolsPath, runCancelPath, runEventsPath, runPath, triggerInstancesPath, triggerSimulatePath, workspaceApiKeyPath, workspaceApiKeysPath, workspaceConnectionsPath, workspaceFlowsPath, workspaceInboxEntriesPath, workspaceInboxItemsPath, workspaceIntegrationPath, workspaceIntegrationsPath, workspacePath, workspaceRunsPath };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var re="0.1.7";var et="flow.ir.v1";var oe="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",it="/:flowRunId/execution-context";function st(e){return`${f}/${encodeURIComponent(e)}/execution-context`}function ie(e){return!i(e)||!F(e.fileMaxBytes)||!F(e.fileReadMaxBytes)||!F(e.inlineMultipartBytesMax)?o("file runtime limits must carry three positive integer bounds"):p({fileMaxBytes:e.fileMaxBytes,fileReadMaxBytes:e.fileReadMaxBytes,inlineMultipartBytesMax:e.inlineMultipartBytesMax})}function at(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)||!ae(e.executionBindings))return o("execution context surface shape is invalid");let n=se(e.fileRuntime);return n.ok?p({...e,fileRuntime:n.value}):o(n.reason)}function se(e){if(e===null)return p(null);if(!i(e))return o("fileRuntime must be null or an object");let t=ie(e.limits);return t.ok?p({limits:t.value}):o(t.reason)}function ae(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 F(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var dt="/:flowRunId/steps/:nodeId/result",ct="/:flowRunId/result",gt="/:flowRunId/event-waits/:nodeId";function ft(e,t){return`${f}/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}/result`}function mt(e){return`${f}/${encodeURIComponent(e)}/result`}function yt(e,t){return`${f}/${encodeURIComponent(e)}/event-waits/${encodeURIComponent(t)}`}function Rt(e){if(!i(e))return{ok:!1,kind:"validation",reason:"step record body must be a JSON object"};let t=y(e,["attempt","result","durationMs"]);if(t!==void 0)return{ok:!1,kind:"validation",reason:`step record does not accept the "${t}" field`};let n=e.attempt;if(typeof n!="number"||!Number.isInteger(n)||n<=0)return{ok:!1,kind:"validation",reason:"attempt must be a positive integer"};let r=pe(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 pe(e){if(!i(e))return{ok:!1,kind:"step_result_invalid",reason:"result must be a JSON object"};let t=e.status;if(t==="succeeded"){let n=y(e,["status","output"]);return n!==void 0?{ok:!1,kind:"validation",reason:`step record result does not accept the "${n}" field`}:"output"in e?{ok:!0,value:{status:"succeeded",output:e.output}}:{ok:!1,kind:"step_result_invalid",reason:"a succeeded result must carry output"}}if(t==="failed"){let n=y(e,["status","errorCode","issues"]);if(n!==void 0)return{ok:!1,kind:"validation",reason:`step record result does not accept the "${n}" field`};let 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 _t(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 It(e){if(!i(e))return o("result body must be a JSON object");let t=y(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=y(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 Tt(e){return i(e)?p(e):o("flow run result data must be a JSON object")}var ue=/^[A-Za-z0-9_-]{1,100}$/;function xt(e){if(!i(e))return o("register body must be a JSON object");let t=y(e,["eventType","correlationKey"]);if(t!==void 0)return o(`register wait does not accept the "${t}" field`);let n=W(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 At(e){if(!i(e))return o("complete body must be a JSON object");let t=y(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=W(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 wt(e){return!i(e)||e.registered!==!0?o("register wait data surface shape is invalid"):p({registered:!0})}function W(e){return typeof e!="string"||e.length===0?o("eventType must be a non-empty string"):ue.test(e)?p(e):o("eventType must match ^[A-Za-z0-9_-]{1,100}$")}function y(e,t){return Object.keys(e).find(n=>!t.includes(n))}var le="/internal/flow-versions",kt="/:flowVersionId/handler-bundles",H="/internal/installations",St="/:installationId/handler-bundles";function ht(e,t){return`${le}/${encodeURIComponent(e)}/handler-bundles?compiledArtifactId=${encodeURIComponent(t)}`}function Pt(e){return`${H}/${encodeURIComponent(e.installationId)}/handler-bundles?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var de=new Set(["managed_only","managed_plus_unmanaged_sdk"]);function h(e){if(!R(e))return B("runtimeNetwork must be a JSON object");let t=e.networkModel;return typeof t!="string"||!de.has(t)?B("runtimeNetwork.networkModel is unknown"):!q(e.apiHosts)||!q(e.authHosts)||typeof e.httpsOnly!="boolean"?B("runtimeNetwork host/https fields are invalid"):{ok:!0,value:{networkModel:t,apiHosts:e.apiHosts,authHosts:e.authHosts,httpsOnly:e.httpsOnly}}}function Nt(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 bt(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=ce(n);if(!r.ok)return r;t.push(r.value)}return{ok:!0,value:t}}function ce(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=h(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||!ge(t.files))return A("a handler bundle must carry a { entry, files } module");let n=h(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 B(e){return{ok:!1,kind:"runtime_network",reason:e}}function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function q(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function ge(e){return R(e)&&Object.values(e).every(t=>typeof t=="string")}var w="/internal/webhook-trigger-instances",Ut="/:triggerInstanceId/context",Ft="/:triggerInstanceId/handler-bundles",Bt="/:triggerInstanceId/deliveries/:deliveryId",Ht="/:triggerInstanceId/events",Gt="/:triggerInstanceId/rearm",Lt="/:triggerInstanceId/store/:namespace/:key",_=e=>`${w}/${encodeURIComponent(e)}`;function $t(e,t){return`${_(e)}/context?artifactDigest=${encodeURIComponent(t)}`}function Mt(e,t){return`${_(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function Kt(e,t){return`${_(e)}/deliveries/${encodeURIComponent(t)}`}function Vt(e){return`${_(e)}/events`}function Wt(e){return`${_(e)}/rearm`}function qt(e,t,n){return`${_(e)}/store/${encodeURIComponent(t)}/${encodeURIComponent(n)}`}var jt="/:installationId/webhook-protocol-adapter-bundle";function Jt(e){return`${H}/${encodeURIComponent(e.installationId)}/webhook-protocol-adapter-bundle?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var Xt="modules/webhook/protocol-adapter.js";function Yt(e){return`modules/webhook/protocol-adapter-${e}.js`}function zt(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&&!fe(e.connection)||!me(e.runtime)?o("webhook watcher context surface shape is invalid"):p(e)}function fe(e){return i(e)&&typeof e.connectionId=="string"&&typeof e.connectionRef=="string"&&typeof e.integrationRef=="string"&&typeof e.authType=="string"}function me(e){if(!i(e)||e.type!=="webhook"||typeof e.trigger_ref!="string")return!1;let t=e.webhook;return i(t)&&typeof t.event_handler_module=="string"&&typeof t.enable_handler_module=="string"&&typeof t.disable_handler_module=="string"}function Qt(e){if(!i(e)||typeof e.deliveryId!="string"||typeof e.receivedAt!="string"||!i(e.request))return 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 Zt(e){if(!i(e)||typeof e.triggerRef!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.modules)||!e.modules.every(ye))return{ok:!1,kind:"shape",reason:"trigger handler bundles data surface shape is invalid"};let t=h(e.runtimeNetwork);return t.ok?{ok:!0,value:{triggerRef:e.triggerRef,artifactDigest:e.artifactDigest,modules:e.modules,runtimeNetwork:t.value}}:t}function ye(e){return i(e)&&typeof e.specifier=="string"&&e.specifier.length>0&&typeof e.source=="string"}function Re(e){return!i(e)||!("value"in e)?o("webhook store get surface shape is invalid"):p(e.value)}function en(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=_e(a);if(!u.ok)return u;s.push(u.value)}return p({deliveryId:n,events:s})}function _e(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 tn(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 Ie(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 E="/internal/polling-trigger-instances",on="/:pollingInstanceId/context",sn="/:pollingInstanceId/handler-bundles",an="/:pollingInstanceId/ticks/:tickId/events",pn="/:pollingInstanceId/store/:namespace/:key",N=e=>`${E}/${encodeURIComponent(e)}`;function un(e,t,n){return`${N(e)}/context?artifactDigest=${encodeURIComponent(t)}&tickId=${encodeURIComponent(n)}`}function ln(e,t){return`${N(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function dn(e,t){return`${N(e)}/ticks/${encodeURIComponent(t)}/events`}function cn(e,t,n){return`${N(e)}/store/${encodeURIComponent(t)}/${encodeURIComponent(n)}`}function gn(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&&!Te(e.connection)||!xe(e.runtime)||!Ae(e.tick)||!we(e.limits)?o("polling trigger context surface shape is invalid"):p(e)}function Te(e){return i(e)&&typeof e.connectionId=="string"&&typeof e.connectionRef=="string"&&typeof e.integrationRef=="string"&&typeof e.authType=="string"}function xe(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 Ae(e){return i(e)&&typeof e.tickId=="string"&&typeof e.scheduledAt=="string"&&typeof e.attempt=="number"}function we(e){return i(e)&&typeof e.maxEventsPerTick=="number"}function fn(e){if(!i(e))return o("publish body must be a JSON object");let t=J(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=Ee(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 Ee(e){if(!i(e))return o("each event must be a JSON object");let t=J(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 mn(e){return!i(e)||typeof e.tickId!="string"||typeof e.cursorUpdated!="boolean"||!Array.isArray(e.results)||!e.results.every(ke)?o("publish polling tick events data surface shape is invalid"):p(e)}function ke(e){return i(e)&&typeof e.eventId=="string"&&typeof e.dedupeKey=="string"&&typeof e.duplicate=="boolean"&&(e.flowRunId===null||typeof e.flowRunId=="string")}function J(e,t){return Object.keys(e).find(n=>!t.includes(n))}var X="/internal/egress-grants",G="/internal/tool-invocations",An="/:flowRunId/egress-grant",wn="/:invocationId/egress-grant",En="/:pollingInstanceId/egress-grant",kn="/:triggerInstanceId/egress-grant",Sn="/:grantId/consume",hn="/:grantId/audit",Pn=e=>`${f}/${encodeURIComponent(e)}/egress-grant`,Nn=e=>`${G}/${encodeURIComponent(e)}/egress-grant`,bn=e=>`${E}/${encodeURIComponent(e)}/egress-grant`,On=e=>`${w}/${encodeURIComponent(e)}/egress-grant`,Cn=e=>`${X}/${encodeURIComponent(e)}/consume`,vn=e=>`${X}/${encodeURIComponent(e)}/audit`,Se=["flow_action","single_tool","polling_trigger","webhook_trigger"],he=/^[A-Za-z0-9][A-Za-z0-9:_+/=.-]{15,1023}$/;function k(e){return typeof e=="string"&&he.test(e)}function Pe(e){if(!i(e)||e.body_type!=="multipart")return!1;let t=e.body;if(!i(t))return!1;let n=t.parts;return Array.isArray(n)?n.some(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 S(){return{ok:!1,kind:"request_digest",reason:"request digest is missing or malformed"}}function O(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 Dn(e){let t=O(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 k(s)?{ok:!0,value:{nodeId:n,requestDigest:s,requestHasMultipartFiles:Pe(t.record.request)}}:S()}function Un(e){let t=O(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 k(r)?{ok:!0,value:{requestDigest:r}}:S()}function Fn(e){let t=O(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 k(s)?{ok:!0,value:{tickId:n,requestDigest:s}}:S()}function Bn(e){let t=O(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 k(u)?{ok:!0,value:{phase:n,...s!==void 0?{lifecycle:s}:{},requestDigest:u}}:S()}function Y(e){return Se.includes(e)?e:void 0}var Ne=["scopeKind","scopeId","requestDigest"];function Hn(e){if(!i(e))return l("consume body must be a JSON object");for(let s of Object.keys(e))if(!Ne.includes(s))return l(`consume does not accept the "${s}" field`);let t=Y(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 k(r)?{ok:!0,value:{scopeKind:t,scopeId:n,requestDigest:r}}:S()}var be=["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 Gn(e){if(!i(e))return l("audit body must be a JSON object");for(let c of Object.keys(e))if(!be.includes(c))return l(`audit does not accept the "${c}" field`);let t=Y(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 U;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");U=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}:{},...U!==void 0?{errorCode:U}:{}}}}function Ln(e){return!i(e)||!i(e.grant)?o("egress grant envelope must carry a grant object"):p(e.grant)}function $n(e){return!i(e)||e.consumed!==!0?o("egress grant consume data must carry consumed:true"):p({consumed:!0})}var Jn="/:flowRunId/runtime-credential",Xn="/:invocationId/runtime-credential",Yn="/:pollingInstanceId/runtime-credential",zn="/:triggerInstanceId/runtime-credential",Qn=e=>`${f}/${encodeURIComponent(e)}/runtime-credential`,Zn=e=>`${G}/${encodeURIComponent(e)}/runtime-credential`,er=e=>`${E}/${encodeURIComponent(e)}/runtime-credential`,tr=e=>`${w}/${encodeURIComponent(e)}/runtime-credential`,nr=["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 rr(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 or(e){let t=v(e??{},[]);return t.ok?p(null):o(t.reason)}function ir(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 sr(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 ar(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 L="/internal/files",lr="/:fileId/stat",dr="/:fileId/content",cr=()=>L,z=e=>`?scope_kind=${encodeURIComponent(e.scopeKind)}&scope_id=${encodeURIComponent(e.scopeId)}`,gr=(e,t)=>`${L}/${encodeURIComponent(e)}/stat${z(t)}`,fr=(e,t)=>`${L}/${encodeURIComponent(e)}/content${z(t)}`;function mr(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 Ir="/:flowRunId/human-inputs",Tr="/:flowRunId/human-inputs/:requestId",xr="/:flowRunId/human-inputs/:requestId/expire",Ar="/:flowRunId/human-inputs/:requestId/acknowledge",Oe=e=>`${f}/${encodeURIComponent(e)}/human-inputs`,Q=(e,t)=>`${Oe(e)}/${encodeURIComponent(t)}`,wr=(e,t)=>`${Q(e,t)}/expire`,Er=(e,t)=>`${Q(e,t)}/acknowledge`,Ce="human_input_resolved";function kr(e){return`${Ce}_${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 ve=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})$/;function De(e,t){return typeof e!="string"||!ve.test(e)||Number.isNaN(Date.parse(e))?g(`${t} must be an ISO-8601 timestamp`):{ok:!0,value:e}}function Ue(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 Fe(e){let t=m(e,"input");if(!t.ok)return t;let n=t.value.kind;if(n==="choice"){if(!Array.isArray(t.value.choices))return g("input.choices must be an array")}else if(n!=="text")if(n==="form"){if(!Array.isArray(t.value.fields))return g("input.fields must be an array")}else return g("input.kind is invalid");return{ok:!0,value:t.value}}function 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 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=Z(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 Z(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=ee(a,`${t}.${s}`);if(!u.ok)return u;r[s]=u.value}return{ok:!0,value:r}}function ee(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=ee(u,`${t}[${a}]`);if(!d.ok)return d;s.push(d.value)}return{ok:!0,value:{kind:"array",items:s}}}case"object":{let s=Z(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=He(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 He(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 Sr(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=Ue(t.value.renderedPrompt);if(!r.ok)return o(r.reason);let s=Fe(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=De(t.value.expiresAt,"expiresAt");if(!u.ok)return o(u.reason);let d=Be(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 Ge(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 hr(e){if(!i(e)||typeof e.created!="boolean")return o("human input create data must carry created:boolean");let t=Ge(e.request);return t.ok?p({created:e.created,request:t.value}):t}function Pr(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",Or="unknown";function Cr(e){return e.endsWith(".js")?`${e.slice(0,-3)}.manifest.json`:`${e}.manifest.json`}var Dr="/internal/deployment-handshake",Le=["start","terminate","send-event","start-webhook-watcher","run-polling-tick","invoke-tool","invoke-trigger-handler","invoke-webhook-protocol-adapter","deployment-handshake"],Ur=Le,Fr="HANDSHAKE_REQUEST_INVALID",Br="HANDSHAKE_SECRET_UNCONFIGURED",Hr="HANDSHAKE_SECRET_MISMATCH",Gr="HANDSHAKE_CONTRACT_VERSION_MISMATCH",Lr="HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH",$r="HANDSHAKE_CAPABILITY_MISSING";function Mr(e){return[e.nonce,e.timestamp,e.contractVersion,e.dispatchNamespace].map(n=>`${n.length}:${n}`).join(".")}function Kr(e){return["response",e.nonce,e.contractVersion,e.dispatchNamespace,...e.capabilities].map(n=>`${n.length}:${n}`).join(".")}var Wr="/me",qr=()=>"/me";var $="/workspaces",Jr="/:workspaceId",Xr=e=>`${$}/${encodeURIComponent(e)}`;var Qr="/:workspaceId/api-keys",Zr="/:workspaceId/api-keys/:apiKeyId",$e=e=>`${$}/${encodeURIComponent(e)}/api-keys`,eo=(e,t)=>`${$e(e)}/${encodeURIComponent(t)}`,Me="workspace.full_access",to=[Me];var M="/catalog",ro="/integrations",oo="/integrations/:slug",io="/versions",so="/integrations/:slug/default-provider-app-config",ao=e=>{let t=`${M}/integrations`;return e?.category!==void 0&&e.category!==""?`${t}?category=${encodeURIComponent(e.category)}`:t},Ke=e=>`${M}/integrations/${encodeURIComponent(e)}`,po=()=>`${M}/versions`,uo=e=>`${Ke(e)}/default-provider-app-config`;var co="/workspaces/:workspaceId/integrations",go="/:installationId",fo="/:installationId/tools",Ve=e=>`/workspaces/${encodeURIComponent(e)}/integrations`,We=(e,t)=>`${Ve(e)}/${encodeURIComponent(t)}`,mo=(e,t)=>`${We(e,t)}/tools`;var Ro="/workspaces/:workspaceId",_o="/connections",Io="/integrations/:installationId/connect/start",To="/integrations/:installationId/connect/options",xo="/connect-sessions/:sessionId/submit",Ao="/connect-sessions/:sessionId/complete",wo="/integrations/:installationId/connections/:connectionRef",Eo="/callbacks/redirect",T=e=>`/workspaces/${encodeURIComponent(e)}`,ko=e=>`${T(e)}/connections`,So=(e,t)=>`${T(e)}/integrations/${encodeURIComponent(t)}/connect/start`,ho=(e,t)=>`${T(e)}/integrations/${encodeURIComponent(t)}/connect/options`,Po=(e,t)=>`${T(e)}/connect-sessions/${encodeURIComponent(t)}/submit`,No=(e,t)=>`${T(e)}/connect-sessions/${encodeURIComponent(t)}/complete`,bo=(e,t,n)=>`${T(e)}/integrations/${encodeURIComponent(t)}/connections/${encodeURIComponent(n)}`;var Co="/workspaces/:workspaceId/flows",vo="/validate",Do="/:flowId",Uo="/:flowId/enable",Fo="/:flowId/disable",Bo="/:flowId/draft",Ho="/:flowId/versions",Go="/:flowId/versions/:version",te=e=>`/workspaces/${encodeURIComponent(e)}/flows`,Lo=e=>`${te(e)}/validate`,D=(e,t)=>`${te(e)}/${encodeURIComponent(t)}`,$o=(e,t)=>`${D(e,t)}/enable`,Mo=(e,t)=>`${D(e,t)}/disable`,Ko=(e,t)=>`${D(e,t)}/draft`,qe=(e,t)=>`${D(e,t)}/versions`,Vo=(e,t,n)=>`${qe(e,t)}/${n}`;var qo="/workspaces/:workspaceId/agent",jo="/chat",Jo="/flow-context",Xo="/sessions",Yo="/sessions/:sessionId",zo=e=>`/workspaces/${encodeURIComponent(e)}/agent/chat`,Qo=e=>`/workspaces/${encodeURIComponent(e)}/agent/sessions`,Zo=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/sessions/${encodeURIComponent(t)}`,ei=20,ti=50,ni=100,ri="flow_authoring",oi=["flow","flow_run","inbox_entry","integration"],ii=256,si=10,ai=256,pi=["getFlowContext","getWorkingFlowIr","setFlowMeta","addNode","updateNode","removeNode","setTrigger","removeTrigger","setOutputs","setComposition","validateFlow","saveFlowDraft","requestConnect"],ui=["setFlowMeta","addNode","updateNode","removeNode","setTrigger","removeTrigger","setOutputs","setComposition"];function li(e){return JSON.stringify(e)}var K={type:"object",properties:{},additionalProperties:!1},x={type:"object",additionalProperties:!0},je=[{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:K},{name:"getWorkingFlowIr",execution:"client",description:"Read the current browser 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:K},{name:"setFlowMeta",execution:"client",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:"client",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:"client",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:"client",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:"client",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 (Server /flows/validate) before saveFlowDraft.",inputSchema:{type:"object",properties:{trigger:{...x,description:"A TriggerBinding object."}},required:["trigger"],additionalProperties:!1}},{name:"removeTrigger",execution:"client",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:"client",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:"client",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:"client",description:"Validate the current working flow IR against the Ablehi Server (authoritative). Returns { valid, issues }. The server is the only source of flow validity.",inputSchema:K},{name:"saveFlowDraft",execution:"server",needsApproval:!0,description:"Persist the current working flow IR as a draft on the Ablehi Server (the persistence truth). Requires user approval before running. Optionally pass a flow name.",inputSchema:{type:"object",properties:{flow:{type:"string",description:"Optional flow name."}},additionalProperties:!1}},{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 di(e){return je.find(t=>t.name===e)}var ci="data-flowDraftApproval",gi="save_flow_draft",fi="AGENT_RUNTIME_UNCONFIGURED",mi="AGENT_RUNTIME_FAILED",yi="AGENT_APPROVAL_NOT_FOUND",Ri="AGENT_APPROVAL_EXPIRED",_i="AGENT_SESSION_NOT_FOUND",Ii="AGENT_MESSAGE_DELTA_INVALID",Ti="AGENT_PAGE_CONTEXT_INVALID",xi="AGENT_CANDIDATE_INVALID",V="/agent/assets",Ai="/prompts",wi="/prompts/:key/:revision",Ei="/prompts/:key/:revision/validate",ki="/prompts/:key/:revision/activate",Si="/prompt-bindings",hi="/prompt-bindings/:id",Pi="/prompt-bindings/:id/validate",Ni="/flow-scenes",bi="/flow-scenes/:sceneKey/:revision",Oi="/flow-scenes/:sceneKey/:revision/validate",Ci="/flow-scenes/:sceneKey/:revision/activate",vi="/flow-scenes/:sceneKey/:revision/reindex",Di="/flow-templates",Ui="/flow-templates/:templateKey/:revision",Fi="/flow-templates/:templateKey/:revision/validate",Bi="/flow-templates/:templateKey/:revision/activate",Hi="/flow-templates/:templateKey/:revision/reindex",Gi="/flow-authoring-tasks/:flowAuthoringTaskId",Li="/flow-authoring-decisions/:decisionRecordId",$i=()=>`${V}/prompts`,Mi=()=>`${V}/flow-scenes`,Ki=()=>`${V}/flow-templates`,Vi=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-authoring-tasks/${encodeURIComponent(t)}`,Wi=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-authoring-decisions/${encodeURIComponent(t)}`,qi="agent.asset.manage",ji="flow.create_authoring_task",Ji=["agent.global.system","agent.intent.flow_goal_spec","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"],Xi=["general_agent","flow_goal_generation","flow_scene_fit_judge","flow_template_fit_judge","fallback_authoring_plan","flow_authoring_brief_generation","flow_authoring_agent","flow_execution_content"],Yi="AGENT_ASSET_NOT_FOUND",zi="AGENT_ASSET_VALIDATION_FAILED",Qi="AGENT_PROMPT_BINDING_CONFLICT",Zi="AGENT_FLOW_GOAL_INVALID",es="AGENT_FLOW_AUTHORING_TASK_NOT_FOUND",ts="AGENT_FLOW_AUTHORING_TASK_CONFLICT",ns="AGENT_FLOW_AUTHORING_WORKFLOW_FAILED",rs="AGENT_ASSET_INDEX_FAILED";var is="/workspaces/:workspaceId/runs",ss="/workspaces/:workspaceId/flows/:flowId/runs",as="/:runId",ps="/:runId/cancel",us="/:runId/events",Je=e=>`/workspaces/${encodeURIComponent(e)}/runs`,ne=(e,t)=>`${Je(e)}/${encodeURIComponent(t)}`,ls=(e,t)=>`${ne(e,t)}/cancel`,ds=(e,t)=>`${ne(e,t)}/events`,cs=(e,t)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/runs`,gs=["queued","running","succeeded","failed","interrupted","cancelled"],fs=["succeeded","skipped","timed_out","failed"];var ys="/workspaces/:workspaceId/inbox/items",Rs="/workspaces/:workspaceId/inbox/entries",_s="/:itemId",Is="/:entryId",Ts="/:entryId/human-input/submit",Xe=e=>`/workspaces/${encodeURIComponent(e)}/inbox/items`,xs=(e,t)=>`${Xe(e)}/${encodeURIComponent(t)}`,Ye=e=>`/workspaces/${encodeURIComponent(e)}/inbox/entries`,ze=(e,t)=>`${Ye(e)}/${encodeURIComponent(t)}`,As=(e,t)=>`${ze(e,t)}/human-input/submit`;var Es="/human-input/tokens",ks="/:token",Ss="/:token/submit",Qe=e=>`/human-input/tokens/${encodeURIComponent(e)}`,hs=e=>`${Qe(e)}/submit`;var Ns="/:flowId/trigger-instances",bs="/:flowId/triggers/:triggerBindingId/simulate",Os=(e,t)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/trigger-instances`,Cs=(e,t,n)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/triggers/${encodeURIComponent(n)}/simulate`;export{Ri as AGENT_APPROVAL_EXPIRED_ERROR_CODE,yi as AGENT_APPROVAL_NOT_FOUND_ERROR_CODE,V as AGENT_ASSETS_ROUTE_PREFIX,Ni as AGENT_ASSET_FLOW_SCENES_SUBPATH,Ci as AGENT_ASSET_FLOW_SCENE_ACTIVATE_SUBPATH,bi as AGENT_ASSET_FLOW_SCENE_ITEM_SUBPATH,vi as AGENT_ASSET_FLOW_SCENE_REINDEX_SUBPATH,Oi as AGENT_ASSET_FLOW_SCENE_VALIDATE_SUBPATH,Di as AGENT_ASSET_FLOW_TEMPLATES_SUBPATH,Bi as AGENT_ASSET_FLOW_TEMPLATE_ACTIVATE_SUBPATH,Ui as AGENT_ASSET_FLOW_TEMPLATE_ITEM_SUBPATH,Hi as AGENT_ASSET_FLOW_TEMPLATE_REINDEX_SUBPATH,Fi as AGENT_ASSET_FLOW_TEMPLATE_VALIDATE_SUBPATH,rs as AGENT_ASSET_INDEX_FAILED_ERROR_CODE,qi as AGENT_ASSET_MANAGE_PERMISSION,Yi as AGENT_ASSET_NOT_FOUND_ERROR_CODE,Ai as AGENT_ASSET_PROMPTS_SUBPATH,ki as AGENT_ASSET_PROMPT_ACTIVATE_SUBPATH,Si as AGENT_ASSET_PROMPT_BINDINGS_SUBPATH,hi as AGENT_ASSET_PROMPT_BINDING_ITEM_SUBPATH,Pi as AGENT_ASSET_PROMPT_BINDING_VALIDATE_SUBPATH,wi as AGENT_ASSET_PROMPT_ITEM_SUBPATH,Ei as AGENT_ASSET_PROMPT_VALIDATE_SUBPATH,zi as AGENT_ASSET_VALIDATION_FAILED_ERROR_CODE,xi as AGENT_CANDIDATE_INVALID_ERROR_CODE,ri as AGENT_CAPABILITY_FLOW_AUTHORING,jo as AGENT_CHAT_ROUTE_SUBPATH,ji as AGENT_CREATE_FLOW_AUTHORING_TASK_TOOL_NAME,Li as AGENT_FLOW_AUTHORING_DECISION_ITEM_SUBPATH,ts as AGENT_FLOW_AUTHORING_TASK_CONFLICT_ERROR_CODE,Gi as AGENT_FLOW_AUTHORING_TASK_ITEM_SUBPATH,es as AGENT_FLOW_AUTHORING_TASK_NOT_FOUND_ERROR_CODE,ns as AGENT_FLOW_AUTHORING_WORKFLOW_FAILED_ERROR_CODE,Jo as AGENT_FLOW_CONTEXT_ROUTE_SUBPATH,Zi as AGENT_FLOW_GOAL_INVALID_ERROR_CODE,Ii as AGENT_MESSAGE_DELTA_INVALID_ERROR_CODE,Ti as AGENT_PAGE_CONTEXT_INVALID_ERROR_CODE,si as AGENT_PAGE_CONTEXT_MAX_RESOURCES,ai as AGENT_PAGE_CONTEXT_RESOURCE_ID_MAX_LENGTH,ii as AGENT_PAGE_CONTEXT_ROUTE_ID_MAX_LENGTH,oi as AGENT_PAGE_RESOURCE_TYPES,Qi as AGENT_PROMPT_BINDING_CONFLICT_ERROR_CODE,Xi as AGENT_PROMPT_PURPOSES,Ji as AGENT_PROMPT_SLOTS,qo as AGENT_ROUTE_PREFIX,mi as AGENT_RUNTIME_FAILED_ERROR_CODE,fi as AGENT_RUNTIME_UNCONFIGURED_ERROR_CODE,Xo as AGENT_SESSIONS_ROUTE_SUBPATH,ni as AGENT_SESSION_DETAIL_MESSAGE_LIMIT,Yo as AGENT_SESSION_ITEM_ROUTE_SUBPATH,ei as AGENT_SESSION_LIST_DEFAULT_LIMIT,ti as AGENT_SESSION_LIST_MAX_LIMIT,_i as AGENT_SESSION_NOT_FOUND_ERROR_CODE,so as CATALOG_DEFAULT_PROVIDER_APP_CONFIG_ROUTE_SUBPATH,ro as CATALOG_INTEGRATIONS_ROUTE_SUBPATH,oo as CATALOG_INTEGRATION_DETAIL_ROUTE_SUBPATH,M as CATALOG_ROUTE_PREFIX,io as CATALOG_VERSIONS_ROUTE_SUBPATH,_o as CONNECTIONS_ROUTE_SUBPATH,wo as CONNECTION_DISCONNECT_ROUTE_SUBPATH,Ao as CONNECT_COMPLETE_ROUTE_SUBPATH,To as CONNECT_OPTIONS_ROUTE_SUBPATH,Io as CONNECT_START_ROUTE_SUBPATH,xo as CONNECT_SUBMIT_ROUTE_SUBPATH,Wr as CURRENT_USER_ROUTE_PATH,Le as DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES,Ur as DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES,Dr as DEPLOYMENT_HANDSHAKE_ROUTE,hn as EGRESS_GRANT_AUDIT_ROUTE_SUBPATH,Sn as EGRESS_GRANT_CONSUME_ROUTE_SUBPATH,Se as EGRESS_GRANT_SCOPE_KINDS,gt as EVENT_WAIT_ROUTE_SUBPATH,it as EXECUTION_CONTEXT_ROUTE_SUBPATH,dr as FILE_CONTENT_ROUTE_SUBPATH,lr as FILE_STAT_ROUTE_SUBPATH,ui as FLOW_AUTHORING_EDIT_TOOL_NAMES,je as FLOW_AUTHORING_TOOL_DESCRIPTORS,pi as FLOW_AUTHORING_TOOL_NAMES,Fo as FLOW_DISABLE_ROUTE_SUBPATH,ci as FLOW_DRAFT_APPROVAL_DATA_PART_TYPE,gi as FLOW_DRAFT_APPROVAL_KIND,Bo as FLOW_DRAFT_ROUTE_SUBPATH,Uo as FLOW_ENABLE_ROUTE_SUBPATH,oe as FLOW_INTERPRETER_CONTRACT_VERSION,et as FLOW_IR_SCHEMA_VERSION,Do as FLOW_ITEM_ROUTE_SUBPATH,An as FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH,ct as FLOW_RUN_RESULT_ROUTE_SUBPATH,Jn as FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,gs as FLOW_RUN_STATUSES,vo as FLOW_VALIDATE_ROUTE_SUBPATH,Ho as FLOW_VERSIONS_ROUTE_SUBPATH,Go as FLOW_VERSION_ITEM_ROUTE_SUBPATH,kt as HANDLER_BUNDLES_ROUTE_SUBPATH,$r as HANDSHAKE_CAPABILITY_MISSING,Gr as HANDSHAKE_CONTRACT_VERSION_MISMATCH,Lr as HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH,Fr as HANDSHAKE_REQUEST_INVALID,Hr as HANDSHAKE_SECRET_MISMATCH,Br as HANDSHAKE_SECRET_UNCONFIGURED,Ir as HUMAN_INPUTS_ROUTE_SUBPATH,Ar as HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH,xr as HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH,Tr as HUMAN_INPUT_REQUEST_ROUTE_SUBPATH,Ce as HUMAN_INPUT_RESOLVED_EVENT_PREFIX,Es as HUMAN_INPUT_TOKENS_ROUTE_PREFIX,ks as HUMAN_INPUT_TOKEN_ROUTE_SUBPATH,Ss as HUMAN_INPUT_TOKEN_SUBMIT_ROUTE_SUBPATH,Ts as INBOX_ENTRY_HUMAN_INPUT_SUBMIT_ROUTE_SUBPATH,Is as INBOX_ENTRY_ROUTE_SUBPATH,_s as INBOX_ITEM_ROUTE_SUBPATH,go as INTEGRATION_ITEM_ROUTE_SUBPATH,fo as INTEGRATION_TOOLS_ROUTE_SUBPATH,X as INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX,L as INTERNAL_FILES_ROUTE_PREFIX,f as INTERNAL_FLOW_RUNS_ROUTE_PREFIX,le as INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX,H as INTERNAL_INSTALLATIONS_ROUTE_PREFIX,E as INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX,G as INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX,w as INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX,on as POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH,En as POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,sn as POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,Yn as POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,pn as POLLING_TRIGGER_STORE_ROUTE_SUBPATH,an as POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH,Eo as PROVIDER_CALLBACK_REDIRECT_ROUTE_PATH,nr as RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS,ps as RUN_CANCEL_ROUTE_SUBPATH,us as RUN_EVENTS_ROUTE_SUBPATH,as as RUN_ITEM_ROUTE_SUBPATH,re as SERVER_CONTRACT_VERSION,dt as STEP_RESULT_ROUTE_SUBPATH,fs as STEP_RUN_STATUSES,St as TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH,wn as TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH,Xn as TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Ns as TRIGGER_INSTANCES_ROUTE_SUBPATH,bs as TRIGGER_SIMULATE_ROUTE_SUBPATH,jt as WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH,Xt as WEBHOOK_PROTOCOL_ADAPTER_MODULE,Ut as WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH,Bt as WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH,kn as WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,Ht as WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH,Ft as WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,Gt as WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH,zn as WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Lt as WEBHOOK_TRIGGER_STORE_ROUTE_SUBPATH,br as WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION,Or as WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION,$ as WORKSPACES_ROUTE_PREFIX,Jr as WORKSPACE_ACCESS_ROUTE_SUBPATH,Qr as WORKSPACE_API_KEYS_ROUTE_SUBPATH,to as WORKSPACE_API_KEY_CANONICAL_SCOPES,Me as WORKSPACE_API_KEY_FULL_ACCESS_SCOPE,Zr as WORKSPACE_API_KEY_ITEM_ROUTE_SUBPATH,Ro as WORKSPACE_CONNECTION_MOUNT_PREFIX,Co as WORKSPACE_FLOWS_ROUTE_PREFIX,ss as WORKSPACE_FLOW_RUNS_ROUTE_PREFIX,Rs as WORKSPACE_INBOX_ENTRIES_ROUTE_PREFIX,ys as WORKSPACE_INBOX_ITEMS_ROUTE_PREFIX,co as WORKSPACE_INTEGRATIONS_ROUTE_PREFIX,is as WORKSPACE_RUNS_ROUTE_PREFIX,Mi as agentAssetFlowScenesPath,Ki as agentAssetFlowTemplatesPath,$i as agentAssetPromptsPath,zo as agentChatPath,Wi as agentFlowAuthoringDecisionPath,Vi as agentFlowAuthoringTaskPath,Zo as agentSessionPath,Qo as agentSessionsPath,uo as catalogDefaultProviderAppConfigPath,Ke as catalogIntegrationPath,ao as catalogIntegrationsPath,po as catalogVersionsPath,No as connectCompletePath,ho as connectOptionsPath,So as connectStartPath,Po as connectSubmitPath,bo as connectionDisconnectPath,o as contractParseFail,p as contractParseOk,qr as currentUserPath,Mr as deploymentHandshakeProbePayload,Kr as deploymentHandshakeResponseProofPayload,vn as egressGrantAuditPath,Cn as egressGrantConsumePath,yt as eventWaitPath,st as executionContextPath,di as findFlowAuthoringToolDescriptor,Mo as flowDisablePath,Ko as flowDraftPath,$o as flowEnablePath,D as flowPath,Pn as flowRunEgressGrantPath,mt as flowRunResultPath,Qn as flowRunRuntimeCredentialPath,cs as flowRunsPath,Yt as flowScriptProtocolAdapterModuleName,Lo as flowValidatePath,Vo as flowVersionPath,qe as flowVersionsPath,li as formatFlowToolError,ht as handlerBundlesPath,Er as humanInputAcknowledgePath,wr as humanInputExpirePath,Q as humanInputRequestPath,kr as humanInputResolvedEventType,Qe as humanInputTokenPath,hs as humanInputTokenSubmitPath,Oe as humanInputsPath,As as inboxEntryHumanInputSubmitPath,ze as inboxEntryPath,xs as inboxItemPath,mo as installationToolsPath,fr as internalFileContentPath,gr as internalFileStatPath,cr as internalFilesPath,i as isJsonRecord,k as isValidRequestDigest,At as parseCompleteFlowRunWaitBody,Sr as parseCreateHumanInputBody,Gn as parseEgressGrantAuditBody,Hn as parseEgressGrantConsumeBody,$n as parseEgressGrantConsumeData,Ln as parseEgressGrantData,at as parseExecutionContextData,mr as parseFileRefData,ie as parseFileRuntimeLimits,Dn as parseFlowActionGrantBody,It as parseFlowRunResultBody,Tt as parseFlowRunResultData,rr as parseFlowRuntimeCredentialBody,ce as parseHandlerBundle,Nt as parseHandlerBundlesData,Pr as parseHumanInputAcknowledgeData,hr as parseHumanInputCreateData,Ge as parseHumanInputRequestViewData,fn as parsePollingPublishBody,ir as parsePollingRuntimeCredentialBody,Ie as parsePollingStorePutBody,Re as parsePollingStoreValue,gn as parsePollingTriggerContext,Fn as parsePollingTriggerGrantBody,mn as parsePublishPollingTickEventsData,xt as parseRegisterFlowRunWaitBody,wt as parseRegisterFlowRunWaitData,ar as parseRuntimeCredentialSessionCredential,h as parseRuntimeNetwork,Un as parseSingleToolGrantBody,or as parseSingleToolRuntimeCredentialBody,Rt as parseStepRecordBody,_t as parseStepRecordData,bt as parseToolHandlerBundlesData,Zt as parseTriggerHandlerBundlesData,Qt as parseWebhookDelivery,en as parseWebhookPublishEventsBody,tn as parseWebhookRearmBody,sr as parseWebhookRuntimeCredentialBody,Ie as parseWebhookStorePutBody,Re as parseWebhookStoreValue,Bn as parseWebhookTriggerGrantBody,zt as parseWebhookWatcherContext,un as pollingTriggerContextPath,bn as pollingTriggerEgressGrantPath,ln as pollingTriggerHandlerBundlesPath,er as pollingTriggerRuntimeCredentialPath,cn as pollingTriggerStorePath,dn as pollingTriggerTickEventsPath,Pe as requestHasMultipartFileParts,ls as runCancelPath,ds as runEventsPath,ne as runPath,ft as stepResultPath,Pt as toolHandlerBundlesPath,Nn as toolInvocationEgressGrantPath,Zn as toolInvocationRuntimeCredentialPath,Os as triggerInstancesPath,Cs as triggerSimulatePath,Jt as webhookProtocolAdapterBundlePath,$t as webhookTriggerContextPath,Kt as webhookTriggerDeliveryPath,On as webhookTriggerEgressGrantPath,Vt as webhookTriggerEventsPath,Mt as webhookTriggerHandlerBundlesPath,Wt as webhookTriggerRearmPath,tr as webhookTriggerRuntimeCredentialPath,qt as webhookTriggerStorePath,Cr as wfpUserRuntimeManifestPath,eo as workspaceApiKeyPath,$e as workspaceApiKeysPath,ko as workspaceConnectionsPath,te as workspaceFlowsPath,Ye as workspaceInboxEntriesPath,Xe as workspaceInboxItemsPath,We as workspaceIntegrationPath,Ve as workspaceIntegrationsPath,Xr as workspacePath,Je as workspaceRunsPath};
|
|
1
|
+
var oe="0.1.9";var rt="flow.ir.v1";var ie="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",pt="/:flowRunId/execution-context";function ut(e){return`${f}/${encodeURIComponent(e)}/execution-context`}function se(e){return!i(e)||!U(e.fileMaxBytes)||!U(e.fileReadMaxBytes)||!U(e.inlineMultipartBytesMax)?o("file runtime limits must carry three positive integer bounds"):p({fileMaxBytes:e.fileMaxBytes,fileReadMaxBytes:e.fileReadMaxBytes,inlineMultipartBytesMax:e.inlineMultipartBytesMax})}function lt(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)||!pe(e.executionBindings))return o("execution context surface shape is invalid");let n=ae(e.fileRuntime);return n.ok?p({...e,fileRuntime:n.value}):o(n.reason)}function ae(e){if(e===null)return p(null);if(!i(e))return o("fileRuntime must be null or an object");let t=se(e.limits);return t.ok?p({limits:t.value}):o(t.reason)}function pe(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 U(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}var ft="/:flowRunId/steps/:nodeId/result",mt="/:flowRunId/result",_t="/:flowRunId/event-waits/:nodeId";function Rt(e,t){return`${f}/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}/result`}function yt(e){return`${f}/${encodeURIComponent(e)}/result`}function It(e,t){return`${f}/${encodeURIComponent(e)}/event-waits/${encodeURIComponent(t)}`}function Tt(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=ue(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 ue(e){if(!i(e))return{ok:!1,kind:"step_result_invalid",reason:"result must be a JSON object"};let t=e.status;if(t==="succeeded"){let n=_(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 xt(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 wt(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 At(e){return i(e)?p(e):o("flow run result data must be a JSON object")}var le=/^[A-Za-z0-9_-]{1,100}$/;function Et(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 kt(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 St(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"):le.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 de="/internal/flow-versions",Pt="/:flowVersionId/handler-bundles",L="/internal/installations",Ot="/:installationId/handler-bundles";function Nt(e,t){return`${de}/${encodeURIComponent(e)}/handler-bundles?compiledArtifactId=${encodeURIComponent(t)}`}function bt(e){return`${L}/${encodeURIComponent(e.installationId)}/handler-bundles?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var ce=new Set(["managed_only","managed_plus_unmanaged_sdk"]);function h(e){if(!R(e))return B("runtimeNetwork must be a JSON object");let t=e.networkModel;return typeof t!="string"||!ce.has(t)?B("runtimeNetwork.networkModel is unknown"):!j(e.apiHosts)||!j(e.authHosts)||typeof e.httpsOnly!="boolean"?B("runtimeNetwork host/https fields are invalid"):{ok:!0,value:{networkModel:t,apiHosts:e.apiHosts,authHosts:e.authHosts,httpsOnly:e.httpsOnly}}}function Ct(e){if(!R(e)||typeof e.flowVersionId!="string"||typeof e.compiledArtifactId!="string"||!Array.isArray(e.bundles))return w("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 Dt(e){if(!R(e)||typeof e.installationId!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.bundles))return w("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=ge(n);if(!r.ok)return r;t.push(r.value)}return{ok:!0,value:t}}function ge(e){if(!R(e)||typeof e.toolRef!="string"||e.kind!=="handler"&&e.kind!=="request")return w("handler bundle entry shape is invalid");if(e.kind==="request"){if(e.module!==void 0)return w("a request bundle must not carry a module");let r=h(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||!fe(t.files))return w("a handler bundle must carry a { entry, files } module");let n=h(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 w(e){return{ok:!1,kind:"shape",reason:e}}function B(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 fe(e){return R(e)&&Object.values(e).every(t=>typeof t=="string")}var A="/internal/webhook-trigger-instances",Lt="/:triggerInstanceId/context",Ht="/:triggerInstanceId/handler-bundles",Gt="/:triggerInstanceId/deliveries/:deliveryId",$t="/:triggerInstanceId/events",Mt="/:triggerInstanceId/rearm",Kt="/:triggerInstanceId/store/:namespace/:key",y=e=>`${A}/${encodeURIComponent(e)}`;function Wt(e,t){return`${y(e)}/context?artifactDigest=${encodeURIComponent(t)}`}function Vt(e,t){return`${y(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function qt(e,t){return`${y(e)}/deliveries/${encodeURIComponent(t)}`}function jt(e){return`${y(e)}/events`}function Jt(e){return`${y(e)}/rearm`}function Xt(e,t,n){return`${y(e)}/store/${encodeURIComponent(t)}/${encodeURIComponent(n)}`}var Yt="/:installationId/webhook-protocol-adapter-bundle";function zt(e){return`${L}/${encodeURIComponent(e.installationId)}/webhook-protocol-adapter-bundle?workspaceId=${encodeURIComponent(e.workspaceId)}&artifactDigest=${encodeURIComponent(e.artifactDigest)}`}var Qt="modules/webhook/protocol-adapter.js";function Zt(e){return`modules/webhook/protocol-adapter-${e}.js`}function en(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&&!me(e.connection)||!_e(e.runtime)?o("webhook watcher context surface shape is invalid"):p(e)}function me(e){return i(e)&&typeof e.connectionId=="string"&&typeof e.connectionRef=="string"&&typeof e.integrationRef=="string"&&typeof e.authType=="string"}function _e(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 tn(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 nn(e){if(!i(e)||typeof e.triggerRef!="string"||typeof e.artifactDigest!="string"||!Array.isArray(e.modules)||!e.modules.every(Re))return{ok:!1,kind:"shape",reason:"trigger handler bundles data surface shape is invalid"};let t=h(e.runtimeNetwork);return t.ok?{ok:!0,value:{triggerRef:e.triggerRef,artifactDigest:e.artifactDigest,modules:e.modules,runtimeNetwork:t.value}}:t}function Re(e){return i(e)&&typeof e.specifier=="string"&&e.specifier.length>0&&typeof e.source=="string"}function ye(e){return!i(e)||!("value"in e)?o("webhook store get surface shape is invalid"):p(e.value)}function rn(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=Ie(a);if(!u.ok)return u;s.push(u.value)}return p({deliveryId:n,events:s})}function Ie(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 on(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 Te(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 E="/internal/polling-trigger-instances",pn="/:pollingInstanceId/context",un="/:pollingInstanceId/handler-bundles",ln="/:pollingInstanceId/ticks/:tickId/events",dn="/:pollingInstanceId/store/:namespace/:key",O=e=>`${E}/${encodeURIComponent(e)}`;function cn(e,t,n){return`${O(e)}/context?artifactDigest=${encodeURIComponent(t)}&tickId=${encodeURIComponent(n)}`}function gn(e,t){return`${O(e)}/handler-bundles?artifactDigest=${encodeURIComponent(t)}`}function fn(e,t){return`${O(e)}/ticks/${encodeURIComponent(t)}/events`}function mn(e,t,n){return`${O(e)}/store/${encodeURIComponent(t)}/${encodeURIComponent(n)}`}function _n(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&&!xe(e.connection)||!we(e.runtime)||!Ae(e.tick)||!Ee(e.limits)?o("polling trigger context surface shape is invalid"):p(e)}function xe(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 Ae(e){return i(e)&&typeof e.tickId=="string"&&typeof e.scheduledAt=="string"&&typeof e.attempt=="number"}function Ee(e){return i(e)&&typeof e.maxEventsPerTick=="number"}function Rn(e){if(!i(e))return 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=ke(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 ke(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 yn(e){return!i(e)||typeof e.tickId!="string"||typeof e.cursorUpdated!="boolean"||!Array.isArray(e.results)||!e.results.every(Se)?o("publish polling tick events data surface shape is invalid"):p(e)}function Se(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",H="/internal/tool-invocations",kn="/:flowRunId/egress-grant",Sn="/:invocationId/egress-grant",hn="/:pollingInstanceId/egress-grant",Pn="/:triggerInstanceId/egress-grant",On="/:grantId/consume",Nn="/:grantId/audit",bn=e=>`${f}/${encodeURIComponent(e)}/egress-grant`,Cn=e=>`${H}/${encodeURIComponent(e)}/egress-grant`,Dn=e=>`${E}/${encodeURIComponent(e)}/egress-grant`,vn=e=>`${A}/${encodeURIComponent(e)}/egress-grant`,Fn=e=>`${Y}/${encodeURIComponent(e)}/consume`,Un=e=>`${Y}/${encodeURIComponent(e)}/audit`,he=["flow_action","single_tool","polling_trigger","webhook_trigger"],Pe=/^[A-Za-z0-9][A-Za-z0-9:_+/=.-]{15,1023}$/;function k(e){return typeof e=="string"&&Pe.test(e)}function Oe(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 S(){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 C(e){if(!i(e))return"request must be a JSON object"}function Bn(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=C(t.record.request);if(r!==void 0)return l(r);let s=t.record.requestDigest;return k(s)?{ok:!0,value:{nodeId:n,requestDigest:s,requestHasMultipartFiles:Oe(t.record.request)}}:S()}function Ln(e){let t=b(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 k(r)?{ok:!0,value:{requestDigest:r}}:S()}function Hn(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=C(t.record.request);if(r!==void 0)return l(r);let s=t.record.requestDigest;return k(s)?{ok:!0,value:{tickId:n,requestDigest:s}}:S()}function Gn(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 a=C(t.record.request);if(a!==void 0)return l(a);let u=t.record.requestDigest;return k(u)?{ok:!0,value:{phase:n,...s!==void 0?{lifecycle:s}:{},requestDigest:u}}:S()}function z(e){return he.includes(e)?e:void 0}var Ne=["scopeKind","scopeId","requestDigest"];function $n(e){if(!i(e))return l("consume body must be a JSON object");for(let s of Object.keys(e))if(!Ne.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 k(r)?{ok:!0,value:{scopeKind:t,scopeId:n,requestDigest:r}}:S()}var be=["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 Mn(e){if(!i(e))return l("audit body must be a JSON object");for(let c of Object.keys(e))if(!be.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 F;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");F=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}:{},...F!==void 0?{errorCode:F}:{}}}}function Kn(e){return!i(e)||!i(e.grant)?o("egress grant envelope must carry a grant object"):p(e.grant)}function Wn(e){return!i(e)||e.consumed!==!0?o("egress grant consume data must carry consumed:true"):p({consumed:!0})}var zn="/:flowRunId/runtime-credential",Qn="/:invocationId/runtime-credential",Zn="/:pollingInstanceId/runtime-credential",er="/:triggerInstanceId/runtime-credential",tr=e=>`${f}/${encodeURIComponent(e)}/runtime-credential`,nr=e=>`${H}/${encodeURIComponent(e)}/runtime-credential`,rr=e=>`${E}/${encodeURIComponent(e)}/runtime-credential`,or=e=>`${A}/${encodeURIComponent(e)}/runtime-credential`,ir=["flow_action","tool_invoke","polling_trigger","webhook_trigger"];function D(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 sr(e){let t=D(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 ar(e){let t=D(e??{},[]);return t.ok?p(null):o(t.reason)}function pr(e){let t=D(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 ur(e){let t=D(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 lr(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 G="/internal/files",gr="/:fileId/stat",fr="/:fileId/content",mr=()=>G,Q=e=>`?scope_kind=${encodeURIComponent(e.scopeKind)}&scope_id=${encodeURIComponent(e.scopeId)}`,_r=(e,t)=>`${G}/${encodeURIComponent(e)}/stat${Q(t)}`,Rr=(e,t)=>`${G}/${encodeURIComponent(e)}/content${Q(t)}`;function yr(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 wr="/:flowRunId/human-inputs",Ar="/:flowRunId/human-inputs/:requestId",Er="/:flowRunId/human-inputs/:requestId/expire",kr="/:flowRunId/human-inputs/:requestId/acknowledge",Ce=e=>`${f}/${encodeURIComponent(e)}/human-inputs`,Z=(e,t)=>`${Ce(e)}/${encodeURIComponent(t)}`,Sr=(e,t)=>`${Z(e,t)}/expire`,hr=(e,t)=>`${Z(e,t)}/acknowledge`,De="human_input_resolved";function Pr(e){return`${De}_${e}`}function g(e){return{ok:!1,reason:e}}function m(e,t){return i(e)?{ok:!0,value:e}:g(`${t} must be an object`)}function I(e,t){return typeof e!="string"||e.length===0?g(`${t} must be a non-empty string`):{ok:!0,value:e}}var ve=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?(?:Z|[+-]\d{2}:\d{2})$/;function Fe(e,t){return typeof e!="string"||!ve.test(e)||Number.isNaN(Date.parse(e))?g(`${t} must be an ISO-8601 timestamp`):{ok:!0,value:e}}function Ue(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 Be(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 Le(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=He(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 He(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 Or(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=Ue(t.value.renderedPrompt);if(!r.ok)return o(r.reason);let s=Be(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=Fe(t.value.expiresAt,"expiresAt");if(!u.ok)return o(u.reason);let d=Le(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 Ge(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 Nr(e){if(!i(e)||typeof e.created!="boolean")return o("human input create data must carry created:boolean");let t=Ge(e.request);return t.ok?p({created:e.created,request:t.value}):t}function br(e){return!i(e)||e.acknowledged!==!0?o("human input acknowledge data must carry acknowledged:true"):p({acknowledged:!0})}var Dr="ablehi-wfp-user-runtime-manifest/v1",vr="unknown";function Fr(e){return e.endsWith(".js")?`${e.slice(0,-3)}.manifest.json`:`${e}.manifest.json`}var Br="/internal/deployment-handshake",$e=["start","terminate","send-event","start-webhook-watcher","run-polling-tick","invoke-tool","invoke-trigger-handler","invoke-webhook-protocol-adapter","deployment-handshake"],Lr=$e,Hr="HANDSHAKE_REQUEST_INVALID",Gr="HANDSHAKE_SECRET_UNCONFIGURED",$r="HANDSHAKE_SECRET_MISMATCH",Mr="HANDSHAKE_CONTRACT_VERSION_MISMATCH",Kr="HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH",Wr="HANDSHAKE_CAPABILITY_MISSING";function Vr(e){return[e.nonce,e.timestamp,e.contractVersion,e.dispatchNamespace].map(n=>`${n.length}:${n}`).join(".")}function qr(e){return["response",e.nonce,e.contractVersion,e.dispatchNamespace,...e.capabilities].map(n=>`${n.length}:${n}`).join(".")}var Jr="/me",Xr=()=>"/me";var $="/workspaces",zr="/:workspaceId",Qr=e=>`${$}/${encodeURIComponent(e)}`;var to="/:workspaceId/api-keys",no="/:workspaceId/api-keys/:apiKeyId",Me=e=>`${$}/${encodeURIComponent(e)}/api-keys`,ro=(e,t)=>`${Me(e)}/${encodeURIComponent(t)}`,Ke="workspace.full_access",oo=[Ke];var M="/catalog",so="/integrations",ao="/integrations/:slug",po="/versions",uo="/integrations/:slug/default-provider-app-config",lo=e=>{let t=`${M}/integrations`;return e?.category!==void 0&&e.category!==""?`${t}?category=${encodeURIComponent(e.category)}`:t},We=e=>`${M}/integrations/${encodeURIComponent(e)}`,co=()=>`${M}/versions`,go=e=>`${We(e)}/default-provider-app-config`;var mo="/workspaces/:workspaceId/integrations",_o="/:installationId",Ro="/:installationId/tools",Ve=e=>`/workspaces/${encodeURIComponent(e)}/integrations`,qe=(e,t)=>`${Ve(e)}/${encodeURIComponent(t)}`,yo=(e,t)=>`${qe(e,t)}/tools`;var To="/workspaces/:workspaceId",xo="/connections",wo="/integrations/:installationId/connect/start",Ao="/integrations/:installationId/connect/options",Eo="/connect-sessions/:sessionId/submit",ko="/connect-sessions/:sessionId/complete",So="/integrations/:installationId/connections/:connectionRef",ho="/callbacks/redirect",T=e=>`/workspaces/${encodeURIComponent(e)}`,Po=e=>`${T(e)}/connections`,Oo=(e,t)=>`${T(e)}/integrations/${encodeURIComponent(t)}/connect/start`,No=(e,t)=>`${T(e)}/integrations/${encodeURIComponent(t)}/connect/options`,bo=(e,t)=>`${T(e)}/connect-sessions/${encodeURIComponent(t)}/submit`,Co=(e,t)=>`${T(e)}/connect-sessions/${encodeURIComponent(t)}/complete`,Do=(e,t,n)=>`${T(e)}/integrations/${encodeURIComponent(t)}/connections/${encodeURIComponent(n)}`;var Fo="/workspaces/:workspaceId/flows",Uo="/validate",Bo="/:flowId",Lo="/:flowId/enable",Ho="/:flowId/disable",Go="/:flowId/draft",$o="/:flowId/versions",Mo="/:flowId/versions/:version",ne=e=>`/workspaces/${encodeURIComponent(e)}/flows`,Ko=e=>`${ne(e)}/validate`,v=(e,t)=>`${ne(e)}/${encodeURIComponent(t)}`,Wo=(e,t)=>`${v(e,t)}/enable`,Vo=(e,t)=>`${v(e,t)}/disable`,qo=(e,t)=>`${v(e,t)}/draft`,je=(e,t)=>`${v(e,t)}/versions`,jo=(e,t,n)=>`${je(e,t)}/${n}`;var Xo="/workspaces/:workspaceId/agent",Yo="/chat",zo="/flow-context",Qo="/sessions",Zo="/sessions/:sessionId",ei=e=>`/workspaces/${encodeURIComponent(e)}/agent/chat`,ti=e=>`/workspaces/${encodeURIComponent(e)}/agent/sessions`,ni=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/sessions/${encodeURIComponent(t)}`,ri=20,oi=50,ii=100,si="flow_authoring",ai=["flow","flow_run","inbox_entry","integration"],pi=256,ui=10,li=256,di=["getFlowContext","getWorkingFlowIr","setFlowMeta","addNode","updateNode","removeNode","setTrigger","removeTrigger","setOutputs","setComposition","validateFlow","saveFlowDraft","requestConnect"],ci=["setFlowMeta","addNode","updateNode","removeNode","setTrigger","removeTrigger","setOutputs","setComposition"];function gi(e){return JSON.stringify(e)}var K={type:"object",properties:{},additionalProperties:!1},x={type:"object",additionalProperties:!0},Je=[{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:K},{name:"getWorkingFlowIr",execution:"client",description:"Read the current browser 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:K},{name:"setFlowMeta",execution:"client",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:"client",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:"client",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:"client",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:"client",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 (Server /flows/validate) before saveFlowDraft.",inputSchema:{type:"object",properties:{trigger:{...x,description:"A TriggerBinding object."}},required:["trigger"],additionalProperties:!1}},{name:"removeTrigger",execution:"client",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:"client",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:"client",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:"client",description:"Validate the current working flow IR against the Ablehi Server (authoritative). Returns { valid, issues }. The server is the only source of flow validity.",inputSchema:K},{name:"saveFlowDraft",execution:"server",needsApproval:!0,description:"Persist the current working flow IR as a draft on the Ablehi Server (the persistence truth). Requires user approval before running. Optionally pass a flow name.",inputSchema:{type:"object",properties:{flow:{type:"string",description:"Optional flow name."}},additionalProperties:!1}},{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 fi(e){return Je.find(t=>t.name===e)}var mi="data-flowDraftApproval",_i="save_flow_draft",Ri="AGENT_RUNTIME_UNCONFIGURED",yi="AGENT_RUNTIME_FAILED",Ii="AGENT_APPROVAL_NOT_FOUND",Ti="AGENT_APPROVAL_EXPIRED",xi="FLOW_DRAFT_APPROVAL_DIGEST_MISMATCH",wi="AGENT_SESSION_NOT_FOUND",Ai="AGENT_MESSAGE_DELTA_INVALID",Ei="AGENT_PAGE_CONTEXT_INVALID",ki="AGENT_CANDIDATE_INVALID",W="/agent/assets",Si="/prompts",hi="/prompts/:key/:revision",Pi="/prompts/:key/:revision/validate",Oi="/prompts/:key/:revision/activate",Ni="/prompt-bindings",bi="/prompt-bindings/:id",Ci="/prompt-bindings/:id/validate",Di="/flow-scenes",vi="/flow-scenes/:sceneKey/:revision",Fi="/flow-scenes/:sceneKey/:revision/validate",Ui="/flow-scenes/:sceneKey/:revision/activate",Bi="/flow-scenes/:sceneKey/:revision/reindex",Li="/flow-templates",Hi="/flow-templates/:templateKey/:revision",Gi="/flow-templates/:templateKey/:revision/validate",$i="/flow-templates/:templateKey/:revision/activate",Mi="/flow-templates/:templateKey/:revision/reindex",Ki="/flow-working-drafts/open",Wi="/flow-working-drafts/:draftId",Vi="/flow-working-drafts/:draftId/commands",qi="/flow-working-drafts/:draftId/readiness/check",ji="/flow-working-drafts/:draftId/readiness/requirements/:requirementId/resolve",Ji="/flow-creation-tasks/:flowCreationTaskId",Xi="/flow-creation-decisions/:decisionRecordId",Yi=()=>`${W}/prompts`,zi=()=>`${W}/flow-scenes`,Qi=()=>`${W}/flow-templates`,Zi=e=>`/workspaces/${encodeURIComponent(e)}/agent/flow-working-drafts/open`,V=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-working-drafts/${encodeURIComponent(t)}`,es=(e,t)=>`${V(e,t)}/commands`,ts=(e,t)=>`${V(e,t)}/readiness/check`,ns=(e,t,n)=>`${V(e,t)}/readiness/requirements/${encodeURIComponent(n)}/resolve`,rs=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-creation-tasks/${encodeURIComponent(t)}`,os=(e,t)=>`/workspaces/${encodeURIComponent(e)}/agent/flow-creation-decisions/${encodeURIComponent(t)}`,is="agent.asset.manage",ss=/^[A-Za-z0-9_-]{1,64}$/,as="flow_create_authoring_task",Xe="oneoff_getActionContext",Ye="oneoff_executeAction",ps=[Xe,Ye],us=["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"],ls=["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"],ds="AGENT_ASSET_NOT_FOUND",cs="AGENT_ASSET_VALIDATION_FAILED",gs="AGENT_PROMPT_BINDING_CONFLICT",fs="AGENT_FLOW_GOAL_INVALID",ms="AGENT_FLOW_CREATION_TASK_NOT_FOUND",_s="AGENT_FLOW_CREATION_TASK_CONFLICT",Rs="AGENT_FLOW_AUTHORING_WORKFLOW_FAILED",ys="FLOW_WORKING_DRAFT_NOT_FOUND",Is="FLOW_DRAFT_REVISION_CONFLICT",Ts="FLOW_DRAFT_COMMAND_INVALID",xs="FLOW_READINESS_REQUIREMENT_NOT_FOUND",ws="FLOW_READINESS_REQUIREMENT_CONFLICT",As="AGENT_ASSET_INDEX_FAILED";var ks="/workspaces/:workspaceId/runs",Ss="/workspaces/:workspaceId/flows/:flowId/runs",hs="/:runId",Ps="/:runId/cancel",Os="/:runId/events",ze=e=>`/workspaces/${encodeURIComponent(e)}/runs`,re=(e,t)=>`${ze(e)}/${encodeURIComponent(t)}`,Ns=(e,t)=>`${re(e,t)}/cancel`,bs=(e,t)=>`${re(e,t)}/events`,Cs=(e,t)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/runs`,Ds=["queued","running","succeeded","failed","interrupted","cancelled"],vs=["succeeded","skipped","timed_out","failed"];var Us="/workspaces/:workspaceId/inbox/items",Bs="/workspaces/:workspaceId/inbox/entries",Ls="/:itemId",Hs="/:entryId",Gs="/:entryId/human-input/submit",Qe=e=>`/workspaces/${encodeURIComponent(e)}/inbox/items`,$s=(e,t)=>`${Qe(e)}/${encodeURIComponent(t)}`,Ze=e=>`/workspaces/${encodeURIComponent(e)}/inbox/entries`,et=(e,t)=>`${Ze(e)}/${encodeURIComponent(t)}`,Ms=(e,t)=>`${et(e,t)}/human-input/submit`;var Ws="/human-input/tokens",Vs="/:token",qs="/:token/submit",tt=e=>`/human-input/tokens/${encodeURIComponent(e)}`,js=e=>`${tt(e)}/submit`;var Xs="/:flowId/trigger-instances",Ys="/:flowId/triggers/:triggerBindingId/simulate",zs=(e,t)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/trigger-instances`,Qs=(e,t,n)=>`/workspaces/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}/triggers/${encodeURIComponent(n)}/simulate`;export{Ti as AGENT_APPROVAL_EXPIRED_ERROR_CODE,Ii as AGENT_APPROVAL_NOT_FOUND_ERROR_CODE,W as AGENT_ASSETS_ROUTE_PREFIX,Di as AGENT_ASSET_FLOW_SCENES_SUBPATH,Ui as AGENT_ASSET_FLOW_SCENE_ACTIVATE_SUBPATH,vi as AGENT_ASSET_FLOW_SCENE_ITEM_SUBPATH,Bi as AGENT_ASSET_FLOW_SCENE_REINDEX_SUBPATH,Fi as AGENT_ASSET_FLOW_SCENE_VALIDATE_SUBPATH,Li as AGENT_ASSET_FLOW_TEMPLATES_SUBPATH,$i as AGENT_ASSET_FLOW_TEMPLATE_ACTIVATE_SUBPATH,Hi as AGENT_ASSET_FLOW_TEMPLATE_ITEM_SUBPATH,Mi as AGENT_ASSET_FLOW_TEMPLATE_REINDEX_SUBPATH,Gi as AGENT_ASSET_FLOW_TEMPLATE_VALIDATE_SUBPATH,As as AGENT_ASSET_INDEX_FAILED_ERROR_CODE,is as AGENT_ASSET_MANAGE_PERMISSION,ds as AGENT_ASSET_NOT_FOUND_ERROR_CODE,Si as AGENT_ASSET_PROMPTS_SUBPATH,Oi as AGENT_ASSET_PROMPT_ACTIVATE_SUBPATH,Ni as AGENT_ASSET_PROMPT_BINDINGS_SUBPATH,bi as AGENT_ASSET_PROMPT_BINDING_ITEM_SUBPATH,Ci as AGENT_ASSET_PROMPT_BINDING_VALIDATE_SUBPATH,hi as AGENT_ASSET_PROMPT_ITEM_SUBPATH,Pi as AGENT_ASSET_PROMPT_VALIDATE_SUBPATH,cs as AGENT_ASSET_VALIDATION_FAILED_ERROR_CODE,ki as AGENT_CANDIDATE_INVALID_ERROR_CODE,si as AGENT_CAPABILITY_FLOW_AUTHORING,Yo as AGENT_CHAT_ROUTE_SUBPATH,as as AGENT_CREATE_FLOW_AUTHORING_TASK_TOOL_NAME,Rs as AGENT_FLOW_AUTHORING_WORKFLOW_FAILED_ERROR_CODE,zo as AGENT_FLOW_CONTEXT_ROUTE_SUBPATH,Xi as AGENT_FLOW_CREATION_DECISION_ITEM_SUBPATH,_s as AGENT_FLOW_CREATION_TASK_CONFLICT_ERROR_CODE,Ji as AGENT_FLOW_CREATION_TASK_ITEM_SUBPATH,ms as AGENT_FLOW_CREATION_TASK_NOT_FOUND_ERROR_CODE,fs as AGENT_FLOW_GOAL_INVALID_ERROR_CODE,ji as AGENT_FLOW_READINESS_REQUIREMENT_RESOLVE_SUBPATH,Vi as AGENT_FLOW_WORKING_DRAFT_COMMANDS_SUBPATH,Wi as AGENT_FLOW_WORKING_DRAFT_ITEM_SUBPATH,Ki as AGENT_FLOW_WORKING_DRAFT_OPEN_SUBPATH,qi as AGENT_FLOW_WORKING_DRAFT_READINESS_CHECK_SUBPATH,Ai as AGENT_MESSAGE_DELTA_INVALID_ERROR_CODE,Ei as AGENT_PAGE_CONTEXT_INVALID_ERROR_CODE,ui as AGENT_PAGE_CONTEXT_MAX_RESOURCES,li as AGENT_PAGE_CONTEXT_RESOURCE_ID_MAX_LENGTH,pi as AGENT_PAGE_CONTEXT_ROUTE_ID_MAX_LENGTH,ai as AGENT_PAGE_RESOURCE_TYPES,gs as AGENT_PROMPT_BINDING_CONFLICT_ERROR_CODE,ls as AGENT_PROMPT_PURPOSES,us as AGENT_PROMPT_SLOTS,Xo as AGENT_ROUTE_PREFIX,yi as AGENT_RUNTIME_FAILED_ERROR_CODE,ss as AGENT_RUNTIME_TOOL_NAME_PATTERN,Ri as AGENT_RUNTIME_UNCONFIGURED_ERROR_CODE,Qo as AGENT_SESSIONS_ROUTE_SUBPATH,ii as AGENT_SESSION_DETAIL_MESSAGE_LIMIT,Zo as AGENT_SESSION_ITEM_ROUTE_SUBPATH,ri as AGENT_SESSION_LIST_DEFAULT_LIMIT,oi as AGENT_SESSION_LIST_MAX_LIMIT,wi as AGENT_SESSION_NOT_FOUND_ERROR_CODE,uo as CATALOG_DEFAULT_PROVIDER_APP_CONFIG_ROUTE_SUBPATH,so as CATALOG_INTEGRATIONS_ROUTE_SUBPATH,ao as CATALOG_INTEGRATION_DETAIL_ROUTE_SUBPATH,M as CATALOG_ROUTE_PREFIX,po as CATALOG_VERSIONS_ROUTE_SUBPATH,xo as CONNECTIONS_ROUTE_SUBPATH,So as CONNECTION_DISCONNECT_ROUTE_SUBPATH,ko as CONNECT_COMPLETE_ROUTE_SUBPATH,Ao as CONNECT_OPTIONS_ROUTE_SUBPATH,wo as CONNECT_START_ROUTE_SUBPATH,Eo as CONNECT_SUBMIT_ROUTE_SUBPATH,Jr as CURRENT_USER_ROUTE_PATH,$e as DEPLOYMENT_HANDSHAKE_DISPATCHER_CAPABILITIES,Lr as DEPLOYMENT_HANDSHAKE_REQUIRED_CAPABILITIES,Br as DEPLOYMENT_HANDSHAKE_ROUTE,Nn as EGRESS_GRANT_AUDIT_ROUTE_SUBPATH,On as EGRESS_GRANT_CONSUME_ROUTE_SUBPATH,he as EGRESS_GRANT_SCOPE_KINDS,_t as EVENT_WAIT_ROUTE_SUBPATH,pt as EXECUTION_CONTEXT_ROUTE_SUBPATH,fr as FILE_CONTENT_ROUTE_SUBPATH,gr as FILE_STAT_ROUTE_SUBPATH,ci as FLOW_AUTHORING_EDIT_TOOL_NAMES,Je as FLOW_AUTHORING_TOOL_DESCRIPTORS,di as FLOW_AUTHORING_TOOL_NAMES,Ho as FLOW_DISABLE_ROUTE_SUBPATH,mi as FLOW_DRAFT_APPROVAL_DATA_PART_TYPE,xi as FLOW_DRAFT_APPROVAL_DIGEST_MISMATCH_ERROR_CODE,_i as FLOW_DRAFT_APPROVAL_KIND,Ts as FLOW_DRAFT_COMMAND_INVALID_ERROR_CODE,Is as FLOW_DRAFT_REVISION_CONFLICT_ERROR_CODE,Go as FLOW_DRAFT_ROUTE_SUBPATH,Lo as FLOW_ENABLE_ROUTE_SUBPATH,ie as FLOW_INTERPRETER_CONTRACT_VERSION,rt as FLOW_IR_SCHEMA_VERSION,Bo as FLOW_ITEM_ROUTE_SUBPATH,ws as FLOW_READINESS_REQUIREMENT_CONFLICT_ERROR_CODE,xs as FLOW_READINESS_REQUIREMENT_NOT_FOUND_ERROR_CODE,kn as FLOW_RUN_EGRESS_GRANT_ROUTE_SUBPATH,mt as FLOW_RUN_RESULT_ROUTE_SUBPATH,zn as FLOW_RUN_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Ds as FLOW_RUN_STATUSES,Uo as FLOW_VALIDATE_ROUTE_SUBPATH,$o as FLOW_VERSIONS_ROUTE_SUBPATH,Mo as FLOW_VERSION_ITEM_ROUTE_SUBPATH,ys as FLOW_WORKING_DRAFT_NOT_FOUND_ERROR_CODE,Pt as HANDLER_BUNDLES_ROUTE_SUBPATH,Wr as HANDSHAKE_CAPABILITY_MISSING,Mr as HANDSHAKE_CONTRACT_VERSION_MISMATCH,Kr as HANDSHAKE_DISPATCH_NAMESPACE_MISMATCH,Hr as HANDSHAKE_REQUEST_INVALID,$r as HANDSHAKE_SECRET_MISMATCH,Gr as HANDSHAKE_SECRET_UNCONFIGURED,wr as HUMAN_INPUTS_ROUTE_SUBPATH,kr as HUMAN_INPUT_ACKNOWLEDGE_ROUTE_SUBPATH,Er as HUMAN_INPUT_EXPIRE_ROUTE_SUBPATH,Ar as HUMAN_INPUT_REQUEST_ROUTE_SUBPATH,De as HUMAN_INPUT_RESOLVED_EVENT_PREFIX,Ws as HUMAN_INPUT_TOKENS_ROUTE_PREFIX,Vs as HUMAN_INPUT_TOKEN_ROUTE_SUBPATH,qs as HUMAN_INPUT_TOKEN_SUBMIT_ROUTE_SUBPATH,Gs as INBOX_ENTRY_HUMAN_INPUT_SUBMIT_ROUTE_SUBPATH,Hs as INBOX_ENTRY_ROUTE_SUBPATH,Ls as INBOX_ITEM_ROUTE_SUBPATH,_o as INTEGRATION_ITEM_ROUTE_SUBPATH,Ro as INTEGRATION_TOOLS_ROUTE_SUBPATH,Y as INTERNAL_EGRESS_GRANTS_ROUTE_PREFIX,G as INTERNAL_FILES_ROUTE_PREFIX,f as INTERNAL_FLOW_RUNS_ROUTE_PREFIX,de as INTERNAL_FLOW_VERSIONS_ROUTE_PREFIX,L as INTERNAL_INSTALLATIONS_ROUTE_PREFIX,E as INTERNAL_POLLING_TRIGGER_INSTANCES_ROUTE_PREFIX,H as INTERNAL_TOOL_INVOCATIONS_ROUTE_PREFIX,A as INTERNAL_WEBHOOK_TRIGGER_INSTANCES_ROUTE_PREFIX,Ye as ONE_OFF_EXECUTE_ACTION_TOOL_NAME,Xe as ONE_OFF_GET_ACTION_CONTEXT_TOOL_NAME,ps as ONE_OFF_TOOL_NAMES,pn as POLLING_TRIGGER_CONTEXT_ROUTE_SUBPATH,hn as POLLING_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,un as POLLING_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,Zn as POLLING_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,dn as POLLING_TRIGGER_STORE_ROUTE_SUBPATH,ln as POLLING_TRIGGER_TICK_EVENTS_ROUTE_SUBPATH,ho as PROVIDER_CALLBACK_REDIRECT_ROUTE_PATH,ir as RUNTIME_CREDENTIAL_SESSION_SCOPE_KINDS,Ps as RUN_CANCEL_ROUTE_SUBPATH,Os as RUN_EVENTS_ROUTE_SUBPATH,hs as RUN_ITEM_ROUTE_SUBPATH,oe as SERVER_CONTRACT_VERSION,ft as STEP_RESULT_ROUTE_SUBPATH,vs as STEP_RUN_STATUSES,Ot as TOOL_HANDLER_BUNDLES_ROUTE_SUBPATH,Sn as TOOL_INVOCATION_EGRESS_GRANT_ROUTE_SUBPATH,Qn as TOOL_INVOCATION_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Xs as TRIGGER_INSTANCES_ROUTE_SUBPATH,Ys as TRIGGER_SIMULATE_ROUTE_SUBPATH,Yt as WEBHOOK_PROTOCOL_ADAPTER_BUNDLE_ROUTE_SUBPATH,Qt as WEBHOOK_PROTOCOL_ADAPTER_MODULE,Lt as WEBHOOK_TRIGGER_CONTEXT_ROUTE_SUBPATH,Gt as WEBHOOK_TRIGGER_DELIVERY_ROUTE_SUBPATH,Pn as WEBHOOK_TRIGGER_EGRESS_GRANT_ROUTE_SUBPATH,$t as WEBHOOK_TRIGGER_EVENTS_ROUTE_SUBPATH,Ht as WEBHOOK_TRIGGER_HANDLER_BUNDLES_ROUTE_SUBPATH,Mt as WEBHOOK_TRIGGER_REARM_ROUTE_SUBPATH,er as WEBHOOK_TRIGGER_RUNTIME_CREDENTIAL_ROUTE_SUBPATH,Kt as WEBHOOK_TRIGGER_STORE_ROUTE_SUBPATH,Dr as WFP_USER_RUNTIME_MANIFEST_FORMAT_VERSION,vr as WFP_USER_RUNTIME_UNKNOWN_SOURCE_REVISION,$ as WORKSPACES_ROUTE_PREFIX,zr as WORKSPACE_ACCESS_ROUTE_SUBPATH,to as WORKSPACE_API_KEYS_ROUTE_SUBPATH,oo as WORKSPACE_API_KEY_CANONICAL_SCOPES,Ke as WORKSPACE_API_KEY_FULL_ACCESS_SCOPE,no as WORKSPACE_API_KEY_ITEM_ROUTE_SUBPATH,To as WORKSPACE_CONNECTION_MOUNT_PREFIX,Fo as WORKSPACE_FLOWS_ROUTE_PREFIX,Ss as WORKSPACE_FLOW_RUNS_ROUTE_PREFIX,Bs as WORKSPACE_INBOX_ENTRIES_ROUTE_PREFIX,Us as WORKSPACE_INBOX_ITEMS_ROUTE_PREFIX,mo as WORKSPACE_INTEGRATIONS_ROUTE_PREFIX,ks as WORKSPACE_RUNS_ROUTE_PREFIX,zi as agentAssetFlowScenesPath,Qi as agentAssetFlowTemplatesPath,Yi as agentAssetPromptsPath,ei as agentChatPath,os as agentFlowCreationDecisionPath,rs as agentFlowCreationTaskPath,ns as agentFlowReadinessRequirementResolvePath,es as agentFlowWorkingDraftCommandsPath,Zi as agentFlowWorkingDraftOpenPath,V as agentFlowWorkingDraftPath,ts as agentFlowWorkingDraftReadinessCheckPath,ni as agentSessionPath,ti as agentSessionsPath,go as catalogDefaultProviderAppConfigPath,We as catalogIntegrationPath,lo as catalogIntegrationsPath,co as catalogVersionsPath,Co as connectCompletePath,No as connectOptionsPath,Oo as connectStartPath,bo as connectSubmitPath,Do as connectionDisconnectPath,o as contractParseFail,p as contractParseOk,Xr as currentUserPath,Vr as deploymentHandshakeProbePayload,qr as deploymentHandshakeResponseProofPayload,Un as egressGrantAuditPath,Fn as egressGrantConsumePath,It as eventWaitPath,ut as executionContextPath,fi as findFlowAuthoringToolDescriptor,Vo as flowDisablePath,qo as flowDraftPath,Wo as flowEnablePath,v as flowPath,bn as flowRunEgressGrantPath,yt as flowRunResultPath,tr as flowRunRuntimeCredentialPath,Cs as flowRunsPath,Zt as flowScriptProtocolAdapterModuleName,Ko as flowValidatePath,jo as flowVersionPath,je as flowVersionsPath,gi as formatFlowToolError,Nt as handlerBundlesPath,hr as humanInputAcknowledgePath,Sr as humanInputExpirePath,Z as humanInputRequestPath,Pr as humanInputResolvedEventType,tt as humanInputTokenPath,js as humanInputTokenSubmitPath,Ce as humanInputsPath,Ms as inboxEntryHumanInputSubmitPath,et as inboxEntryPath,$s as inboxItemPath,yo as installationToolsPath,Rr as internalFileContentPath,_r as internalFileStatPath,mr as internalFilesPath,i as isJsonRecord,k as isValidRequestDigest,kt as parseCompleteFlowRunWaitBody,Or as parseCreateHumanInputBody,Mn as parseEgressGrantAuditBody,$n as parseEgressGrantConsumeBody,Wn as parseEgressGrantConsumeData,Kn as parseEgressGrantData,lt as parseExecutionContextData,yr as parseFileRefData,se as parseFileRuntimeLimits,Bn as parseFlowActionGrantBody,wt as parseFlowRunResultBody,At as parseFlowRunResultData,sr as parseFlowRuntimeCredentialBody,ge as parseHandlerBundle,Ct as parseHandlerBundlesData,br as parseHumanInputAcknowledgeData,Nr as parseHumanInputCreateData,Ge as parseHumanInputRequestViewData,Rn as parsePollingPublishBody,pr as parsePollingRuntimeCredentialBody,Te as parsePollingStorePutBody,ye as parsePollingStoreValue,_n as parsePollingTriggerContext,Hn as parsePollingTriggerGrantBody,yn as parsePublishPollingTickEventsData,Et as parseRegisterFlowRunWaitBody,St as parseRegisterFlowRunWaitData,lr as parseRuntimeCredentialSessionCredential,h as parseRuntimeNetwork,Ln as parseSingleToolGrantBody,ar as parseSingleToolRuntimeCredentialBody,Tt as parseStepRecordBody,xt as parseStepRecordData,Dt as parseToolHandlerBundlesData,nn as parseTriggerHandlerBundlesData,tn as parseWebhookDelivery,rn as parseWebhookPublishEventsBody,on as parseWebhookRearmBody,ur as parseWebhookRuntimeCredentialBody,Te as parseWebhookStorePutBody,ye as parseWebhookStoreValue,Gn as parseWebhookTriggerGrantBody,en as parseWebhookWatcherContext,cn as pollingTriggerContextPath,Dn as pollingTriggerEgressGrantPath,gn as pollingTriggerHandlerBundlesPath,rr as pollingTriggerRuntimeCredentialPath,mn as pollingTriggerStorePath,fn as pollingTriggerTickEventsPath,Oe as requestHasMultipartFileParts,Ns as runCancelPath,bs as runEventsPath,re as runPath,Rt as stepResultPath,bt as toolHandlerBundlesPath,Cn as toolInvocationEgressGrantPath,nr as toolInvocationRuntimeCredentialPath,zs as triggerInstancesPath,Qs as triggerSimulatePath,zt as webhookProtocolAdapterBundlePath,Wt as webhookTriggerContextPath,qt as webhookTriggerDeliveryPath,vn as webhookTriggerEgressGrantPath,jt as webhookTriggerEventsPath,Vt as webhookTriggerHandlerBundlesPath,Jt as webhookTriggerRearmPath,or as webhookTriggerRuntimeCredentialPath,Xt as webhookTriggerStorePath,Fr as wfpUserRuntimeManifestPath,ro as workspaceApiKeyPath,Me as workspaceApiKeysPath,Po as workspaceConnectionsPath,ne as workspaceFlowsPath,Ze as workspaceInboxEntriesPath,Qe as workspaceInboxItemsPath,qe as workspaceIntegrationPath,Ve as workspaceIntegrationsPath,Qr as workspacePath,ze as workspaceRunsPath};
|