@desplega.ai/agent-swarm 2.6.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/{acp-adapter-dgfakfpw.js → acp-adapter-ma1js5n7.js} +6 -6
- package/dist/{actions-fbqma8aa.js → actions-1vhmtvg9.js} +18 -18
- package/dist/{amp-adapter-en0jy6hs.js → amp-adapter-sxqqvmdk.js} +3 -3
- package/dist/{app-k8a5cgpp.js → app-mwx1d5a9.js} +3 -3
- package/dist/{assistant-a16433gr.js → assistant-yx1p6g82.js} +20 -20
- package/dist/{boot-reembed-f4nn561n.js → boot-reembed-5h37a2c2.js} +1 -1
- package/dist/{boot-reembed-6c1sjfnr.js → boot-reembed-7h78vmvv.js} +2 -1
- package/dist/{boot-scrub-sweep-d4w9gajf.js → boot-scrub-sweep-8mawd4gw.js} +3 -3
- package/dist/{boot-seeds-9bmkspyw.js → boot-seeds-ca84dhnn.js} +4 -4
- package/dist/{claude-adapter-nys1kjxa.js → claude-adapter-wqt4hfkq.js} +7 -7
- package/dist/{claude-managed-adapter-55207973.js → claude-managed-adapter-6fjqtr2z.js} +2 -2
- package/dist/{claude-managed-setup-3cm35gey.js → claude-managed-setup-rqv98sea.js} +2 -2
- package/dist/{claude-sdk-session-nw5yd8cp.js → claude-sdk-session-f29f3b2x.js} +7 -7
- package/dist/{cli-sxgtf5fw.js → cli-07q03xm2.js} +1 -1
- package/dist/{cli-k21gx5ht.js → cli-1hhbzkbb.js} +6 -6
- package/dist/{cli-v49fkghp.js → cli-1m9x8dr5.js} +1 -1
- package/dist/{cli-24j1jeeb.js → cli-2pvzmas1.js} +3 -3
- package/dist/{cli-w2656ka1.js → cli-2y7v133v.js} +7 -7
- package/dist/{cli-g8ka5j4j.js → cli-48gxjmcz.js} +94 -36
- package/dist/{cli-2sjhpsns.js → cli-54sj64fc.js} +1 -1
- package/dist/{cli-aj8djyqt.js → cli-60sty27p.js} +2 -2
- package/dist/{cli-4hxrf0p4.js → cli-6a9qfa8b.js} +308 -47
- package/dist/{cli-n7asmce6.js → cli-6mgdba42.js} +3 -3
- package/dist/{cli-gf95q3bm.js → cli-6srv653c.js} +3 -3
- package/dist/{cli-9abdgn5t.js → cli-86ehn4s5.js} +3 -3
- package/dist/{cli-bqztfyve.js → cli-8mbc9za9.js} +1 -1
- package/dist/{cli-a2rr0fmg.js → cli-8wmj18cz.js} +1 -1
- package/dist/{cli-c2habvsf.js → cli-9gsm2rzp.js} +8 -8
- package/dist/{cli-4rf0f5vg.js → cli-9pshx6rd.js} +4 -2
- package/dist/{cli-abkm71vr.js → cli-a6ds2epe.js} +1 -1
- package/dist/{cli-esakngh8.js → cli-a89zdqz9.js} +1 -1
- package/dist/{cli-3ndmpxxv.js → cli-ay40dnj3.js} +2 -2
- package/dist/{cli-kf4jree9.js → cli-aypd09nf.js} +1 -1
- package/dist/{cli-6y51ryva.js → cli-b3yzyc57.js} +1 -1
- package/dist/{cli-ag2yrnt5.js → cli-c668vvcf.js} +2 -2
- package/dist/{cli-5sckpqcx.js → cli-d20qvpr2.js} +1 -1
- package/dist/{cli-a34pr3w1.js → cli-e1595bgx.js} +2 -2
- package/dist/{cli-m70bajzr.js → cli-f12mr20z.js} +1 -1
- package/dist/{cli-dqygeeh5.js → cli-f1e0ptjj.js} +10 -1
- package/dist/{cli-mvjz5an3.js → cli-f4dbh7a5.js} +7 -7
- package/dist/{cli-az25fn5f.js → cli-gsfk58nw.js} +2 -2
- package/dist/{cli-1tem6ns9.js → cli-gt4h8cxw.js} +3 -2
- package/dist/{cli-cz37jqss.js → cli-h5jeg46p.js} +2 -2
- package/dist/{cli-emhjcj2y.js → cli-he9gbdx0.js} +60 -10
- package/dist/{cli-3fwqy71j.js → cli-j0ppywdr.js} +38 -31
- package/dist/{cli-5rj83bam.js → cli-j3y0x2n4.js} +34 -33
- package/dist/{cli-3gfvmzht.js → cli-j9bpmykh.js} +73 -25
- package/dist/{cli-m5a9m0ak.js → cli-kv7sbc2c.js} +3 -3
- package/dist/{cli-g20jjwt4.js → cli-m30k9777.js} +12 -12
- package/dist/{cli-683y0b3a.js → cli-m5e802r7.js} +2 -2
- package/dist/{cli-nn6vx2mq.js → cli-ptfq202x.js} +5 -3
- package/dist/{cli-d2dpf95n.js → cli-qj442fws.js} +1 -1
- package/dist/{cli-03gg9pd1.js → cli-rd5m70gj.js} +4 -4
- package/dist/{cli-gnsb1zxa.js → cli-s09j9vp5.js} +1 -1
- package/dist/{cli-zqne1qcj.js → cli-s0mgx214.js} +2 -2
- package/dist/{cli-sqma6vw1.js → cli-sgqm2582.js} +5 -5
- package/dist/{cli-nq677csy.js → cli-sjctjr48.js} +1 -1
- package/dist/{cli-3aqd4jaa.js → cli-twctnkng.js} +3 -3
- package/dist/{cli-j6rktc91.js → cli-v6shg7na.js} +1 -1
- package/dist/{cli-7enjwya9.js → cli-vz78s5wm.js} +1 -1
- package/dist/{cli-art7c1zh.js → cli-wqr7cea4.js} +4 -4
- package/dist/{cli-hfeb68z4.js → cli-x37r7qwf.js} +11 -3
- package/dist/{cli-ffvsj2qw.js → cli-yd2nreqw.js} +2 -2
- package/dist/{cli-ca6banwz.js → cli-ymjpkxgn.js} +6 -6
- package/dist/{cli-mtnj4fwa.js → cli-yxbsmx56.js} +5 -5
- package/dist/cli.js +18 -16
- package/dist/{codex-adapter-d95q4qsn.js → codex-adapter-zk59x2zh.js} +5 -5
- package/dist/{codex-hook-brpnycn5.js → codex-hook-xyjhvxwd.js} +1 -1
- package/dist/{codex-session-runner-gdwd8h0c.js → codex-session-runner-kh6s4j3n.js} +5 -5
- package/dist/{commands-jqmgk54b.js → commands-68et1qv2.js} +2 -2
- package/dist/{controller-z3jq589f.js → controller-fyrbnzg4.js} +2 -2
- package/dist/{controllers-connect-r2za39ef.js → controllers-connect-nep9h2xv.js} +19 -19
- package/dist/{cursor-adapter-4mr4jgkw.js → cursor-adapter-yss3pg7t.js} +1 -1
- package/dist/{db-w36wwb5g.js → db-28gjyvxj.js} +2 -2
- package/dist/{db-ppv2tze7.js → db-8ftwvzba.js} +3 -3
- package/dist/{dispatcher-pv5h77vf.js → dispatcher-hayexmkr.js} +17 -17
- package/dist/{dsh-adapter-d4pdpb3r.js → dsh-adapter-46wawff9.js} +1 -1
- package/dist/{easter-egg-3d-4sp4dvmc.js → easter-egg-3d-8d1e0h4m.js} +1 -1
- package/dist/{execute-jev839y1.js → execute-cjrfxfnm.js} +1 -1
- package/dist/{external-channel-y6nkzhnn.js → external-channel-xbmxcg09.js} +2 -2
- package/dist/{grok-adapter-t08b9ntm.js → grok-adapter-ag4wks2a.js} +7 -7
- package/dist/handlers-tzmevqb5.js +41 -0
- package/dist/{heartbeat-vn31xwdk.js → heartbeat-psfvcgwp.js} +20 -20
- package/dist/{hook-6d0zbvvt.js → hook-8pz04697.js} +5 -5
- package/dist/{hook-cpjs8q51.js → hook-cyq4mryn.js} +6 -6
- package/dist/{http-9c6medda.js → http-haj1nd6k.js} +109 -114
- package/dist/{index-qhjf2htm.js → index-jwt2bj6f.js} +261 -96
- package/dist/{index-g6k9tctj.js → index-q52f47pe.js} +1 -1
- package/dist/{index-pkma1yf8.js → index-syvhnvtw.js} +1 -1
- package/dist/{index-yqgbfgaj.js → index-y1ajx04a.js} +20 -20
- package/dist/{index-k0yt1tvq.js → index-z5h22pes.js} +17 -17
- package/dist/{index-38t35h0n.js → index-zyq8ct52.js} +17 -17
- package/dist/{keepalive-em0117bp.js → keepalive-xdvsamvj.js} +3 -3
- package/dist/{lead-23e7z59t.js → lead-hqg57kdp.js} +35 -35
- package/dist/{maintenance-kbme3qy9.js → maintenance-4y2xzh3a.js} +1 -1
- package/dist/{oauth-refresh-sweep-xysj4yse.js → oauth-refresh-sweep-jd4r7zbs.js} +8 -3
- package/dist/{onboard-p6q0vz97.js → onboard-18447q9q.js} +5 -5
- package/dist/{opencode-adapter-esv3k9yn.js → opencode-adapter-26b2frdf.js} +5 -5
- package/dist/{otel-impl-54qhqh1z.js → otel-impl-f9tgr8yw.js} +1 -1
- package/dist/{pi-mono-adapter-mymbwhj0.js → pi-mono-adapter-qn6qbga1.js} +33 -12
- package/dist/{pricing-refresh-yb75wv33.js → pricing-refresh-dw2tgb53.js} +3 -3
- package/dist/{rbac-roles-1vp2mw4p.js → rbac-roles-aygm2760.js} +2 -2
- package/dist/{rbac-roles-dexhc9x8.js → rbac-roles-s4nwj2m3.js} +1 -1
- package/dist/{render-v2-tjay5hhf.js → render-v2-yfvdfr0x.js} +3 -3
- package/dist/{resume-8ayf37g5.js → resume-1bmvjbf3.js} +7 -7
- package/dist/{runtime-hqe5cqcd.js → runtime-f7tpzedy.js} +1 -1
- package/dist/{session-access-fdhp987s.js → session-access-r5garej6.js} +4 -4
- package/dist/{session-source-backfill-qgtc86z1.js → session-source-backfill-424wzv0r.js} +2 -2
- package/dist/{setup-4rrmqcq3.js → setup-8tygvxkq.js} +1 -1
- package/dist/{virtual-modules-52km00d6.js → virtual-modules-xsw323b3.js} +2 -2
- package/dist/{work-objects-p28fgd70.js → work-objects-ggnghpgf.js} +20 -20
- package/dist/{worker-e3w7vye1.js → worker-sqjd1nqf.js} +35 -35
- package/openapi.json +69 -1
- package/package.json +5 -3
- package/src/be/automation-preflight.ts +2 -0
- package/src/be/db/api-keys.ts +9 -0
- package/src/be/db/workflow-runs.ts +36 -5
- package/src/be/db.ts +80 -22
- package/src/be/memory/task-learning.ts +155 -0
- package/src/be/migrations/245_script_executor.sql +3 -0
- package/src/be/oauth-refresh-sweep.ts +2 -1
- package/src/be/scripts/boot-reembed.ts +2 -0
- package/src/be/scripts/db.ts +14 -4
- package/src/be/scripts/embeddings.ts +2 -0
- package/src/be/scripts/run-saved.ts +1 -0
- package/src/be/scripts/typecheck.ts +9 -3
- package/src/be/seed-skills/index.ts +7 -0
- package/src/commands/onboard/compose-generator.ts +5 -3
- package/src/commands/provider-credentials.ts +2 -1
- package/src/heartbeat/heartbeat.ts +14 -1
- package/src/heartbeat/script-runner-probe.ts +47 -0
- package/src/http/api-keys.ts +24 -9
- package/src/http/idempotency-key.ts +1 -1
- package/src/http/index.ts +3 -3
- package/src/http/pages-public.ts +38 -5
- package/src/http/scripts.ts +27 -0
- package/src/http/workflows.ts +10 -0
- package/src/http/x.ts +5 -0
- package/src/prompts/base-prompt.ts +21 -1
- package/src/prompts/session-templates.ts +17 -3
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/dsh-adapter.ts +1 -1
- package/src/providers/pi-mono-adapter.ts +41 -11
- package/src/scheduler/scheduler.ts +2 -1
- package/src/scripts-runtime/eval-harness.ts +8 -1
- package/src/scripts-runtime/executors/native.ts +22 -16
- package/src/scripts-runtime/executors/quickjs-prelude.ts +103 -1
- package/src/scripts-runtime/executors/quickjs-runner.ts +2 -1
- package/src/scripts-runtime/executors/quickjs.ts +7 -0
- package/src/scripts-runtime/executors/registry.ts +32 -0
- package/src/scripts-runtime/executors/types.ts +7 -0
- package/src/scripts-runtime/host-validated-args.ts +133 -0
- package/src/scripts-runtime/loader.ts +30 -3
- package/src/scripts-runtime/swarm-sdk.ts +9 -2
- package/src/scripts-runtime/types/stdlib.d.ts +9 -1
- package/src/scripts-runtime/types/swarm-sdk.d.ts +9 -1
- package/src/tests/api-key-status-by-suffix.test.ts +242 -0
- package/src/tests/base-prompt.test.ts +70 -2
- package/src/tests/community-linear-delivery-loop.test.ts +2099 -0
- package/src/tests/credential-check.test.ts +4 -2
- package/src/tests/docs-index.test.ts +135 -0
- package/src/tests/dsh-adapter.test.ts +1 -1
- package/src/tests/fetch-resolved-env.test.ts +16 -2
- package/src/tests/heartbeat-checklist.test.ts +89 -0
- package/src/tests/heartbeat-script-runner-probe.test.ts +83 -0
- package/src/tests/oauth-refresh-sweep.test.ts +34 -1
- package/src/tests/onboard-compose.test.ts +20 -0
- package/src/tests/opencode-adapter.test.ts +2 -1
- package/src/tests/pages-frame-ancestors.test.ts +162 -0
- package/src/tests/pi-codemode.test.ts +2 -1
- package/src/tests/pi-mono-adapter.test.ts +54 -0
- package/src/tests/pi-native-mcp.test.ts +13 -1
- package/src/tests/pi-tool-exposure.test.ts +8 -8
- package/src/tests/probe-tool-schema-tokens.test.ts +144 -0
- package/src/tests/prompt-template-session.test.ts +4 -3
- package/src/tests/request-composition-derive.test.ts +329 -0
- package/src/tests/script-connections.test.ts +2 -0
- package/src/tests/script-executor-conformance.test.ts +36 -1
- package/src/tests/script-executor-quickjs-pool.test.ts +50 -0
- package/src/tests/script-executor-quickjs.test.ts +140 -0
- package/src/tests/script-host-validated-args-native.test.ts +196 -0
- package/src/tests/script-per-script-executor.test.ts +415 -0
- package/src/tests/scripts-external-api.test.ts +45 -0
- package/src/tests/sdk-allowlist.test.ts +3 -2
- package/src/tests/self-improvement.test.ts +4 -4
- package/src/tests/store-progress-learning.test.ts +288 -0
- package/src/tests/ui-logs-parser.test.ts +180 -0
- package/src/tests/workflow-engine-v2.test.ts +116 -1
- package/src/tests/workflow-mcp-trigger-schema.test.ts +209 -0
- package/src/tests/workflow-run-finished-event.test.ts +263 -0
- package/src/tests/workflow-swarm-script.test.ts +34 -0
- package/src/tools/script-common.ts +1 -0
- package/src/tools/script-run.ts +7 -0
- package/src/tools/script-upsert.ts +7 -0
- package/src/tools/store-progress.ts +67 -1
- package/src/tools/workflows/trigger-workflow.ts +104 -10
- package/src/types.ts +12 -1
- package/src/utils/credentials.ts +5 -2
- package/src/workflows/engine.ts +18 -16
- package/src/workflows/executors/swarm-script.ts +5 -0
- package/src/workflows/foreach-driver.ts +5 -11
- package/src/workflows/node-timeout.ts +30 -0
- package/templates/community/linear-delivery-loop/PLAYBOOK.md +323 -0
- package/templates/community/linear-delivery-loop/README.md +38 -0
- package/templates/community/linear-delivery-loop/config.example.json +31 -0
- package/templates/community/linear-delivery-loop/lead-prompt.md +34 -0
- package/templates/community/linear-delivery-loop/schedule.json +10 -0
- package/templates/community/linear-delivery-loop/scripts/linear-delivery-setup.ts +148 -0
- package/templates/community/linear-delivery-loop/scripts/linear-delivery-tick.ts +1781 -0
- package/templates/skills/swarm-docs/config.json +14 -0
- package/templates/skills/swarm-docs/content.md +144 -0
- package/dist/handlers-eqsnmv95.js +0 -41
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
getWorkflowRunStatus,
|
|
18
18
|
getChildWorkflowRunId,
|
|
19
19
|
isParentStepAttemptCurrent,
|
|
20
|
+
emitRunFinished,
|
|
20
21
|
createForeachChildSteps,
|
|
21
22
|
init_workflow_runs,
|
|
22
23
|
isApiOnlyConfigKey,
|
|
@@ -55,30 +56,30 @@ import {
|
|
|
55
56
|
releaseApprovalCancellationNotificationClaim2,
|
|
56
57
|
updateApprovalRequestNotifications2,
|
|
57
58
|
init_db3
|
|
58
|
-
} from "./cli-
|
|
59
|
+
} from "./cli-48gxjmcz.js";
|
|
59
60
|
import {
|
|
60
61
|
isMultiRuntimeEnabled
|
|
61
62
|
} from "./cli-e8xyjvfc.js";
|
|
62
63
|
import {
|
|
63
64
|
getSlackApp2
|
|
64
|
-
} from "./cli-
|
|
65
|
+
} from "./cli-m30k9777.js";
|
|
65
66
|
import {
|
|
66
67
|
externalChannelToolError2,
|
|
67
68
|
isBlockExternalEnabled2,
|
|
68
69
|
getChannelBlockReason2
|
|
69
|
-
} from "./cli-
|
|
70
|
+
} from "./cli-s09j9vp5.js";
|
|
70
71
|
import {
|
|
71
72
|
DEFAULT_MODEL,
|
|
72
73
|
resolveCredential
|
|
73
|
-
} from "./cli-
|
|
74
|
+
} from "./cli-1m9x8dr5.js";
|
|
74
75
|
import {
|
|
75
76
|
revokeRuntimeTokensForRuntime,
|
|
76
77
|
init_users
|
|
77
|
-
} from "./cli-
|
|
78
|
+
} from "./cli-a89zdqz9.js";
|
|
78
79
|
import {
|
|
79
80
|
TERMINAL_TASK_STATUSES,
|
|
80
81
|
init_types
|
|
81
|
-
} from "./cli-
|
|
82
|
+
} from "./cli-9pshx6rd.js";
|
|
82
83
|
import {
|
|
83
84
|
getSlackConfiguration,
|
|
84
85
|
isSlackConfigured,
|
|
@@ -87,7 +88,7 @@ import {
|
|
|
87
88
|
import {
|
|
88
89
|
selectCredential,
|
|
89
90
|
init_credentials
|
|
90
|
-
} from "./cli-
|
|
91
|
+
} from "./cli-gt4h8cxw.js";
|
|
91
92
|
import {
|
|
92
93
|
DEFAULT_OPENROUTER_BASE_URL,
|
|
93
94
|
getOpenRouterBaseUrl,
|
|
@@ -99,7 +100,7 @@ import {
|
|
|
99
100
|
init_template,
|
|
100
101
|
resolveTemplate,
|
|
101
102
|
init_resolver
|
|
102
|
-
} from "./cli-
|
|
103
|
+
} from "./cli-f1e0ptjj.js";
|
|
103
104
|
import {
|
|
104
105
|
init_zod
|
|
105
106
|
} from "./cli-4chz1hye.js";
|
|
@@ -149,7 +150,7 @@ async function notifyAutomationPreflightFailure(preflight) {
|
|
|
149
150
|
return;
|
|
150
151
|
}
|
|
151
152
|
try {
|
|
152
|
-
const { getSlackApp } = await import("./app-
|
|
153
|
+
const { getSlackApp } = await import("./app-mwx1d5a9.js");
|
|
153
154
|
const app = getSlackApp();
|
|
154
155
|
if (!app) {
|
|
155
156
|
console.warn("[Automation Preflight] Slack not available, cannot send notification");
|
|
@@ -176,6 +177,7 @@ init_config();
|
|
|
176
177
|
init_env_flag();
|
|
177
178
|
init_secret_scrubber();
|
|
178
179
|
init_db3();
|
|
180
|
+
init_workflow_runs();
|
|
179
181
|
init_oauth();
|
|
180
182
|
init_scrub_json();
|
|
181
183
|
var NEEDS_SETUP_PREFIX = "needs_setup:";
|
|
@@ -438,6 +440,7 @@ async function recordWorkflowPreflightFailure(input) {
|
|
|
438
440
|
timestamp,
|
|
439
441
|
timestamp
|
|
440
442
|
]);
|
|
443
|
+
emitRunFinished(runId, input.workflowId, "failed");
|
|
441
444
|
return {
|
|
442
445
|
runId,
|
|
443
446
|
recorded: await isFirstWorkflowPreflightFailureToday(input.workflowId, runId, now)
|
|
@@ -3812,6 +3815,18 @@ function resolveNodeTimeoutMs(node) {
|
|
|
3812
3815
|
return config.timeout;
|
|
3813
3816
|
return DEFAULT_NODE_TIMEOUT_MS;
|
|
3814
3817
|
}
|
|
3818
|
+
function startStepDeadline(timeoutMs) {
|
|
3819
|
+
const controller = new AbortController;
|
|
3820
|
+
let timer;
|
|
3821
|
+
const expired = new Promise((_, reject) => {
|
|
3822
|
+
timer = setTimeout(() => {
|
|
3823
|
+
const error = new Error(`Step timed out after ${timeoutMs}ms`);
|
|
3824
|
+
reject(error);
|
|
3825
|
+
controller.abort(error);
|
|
3826
|
+
}, timeoutMs);
|
|
3827
|
+
});
|
|
3828
|
+
return { signal: controller.signal, expired, clear: () => clearTimeout(timer) };
|
|
3829
|
+
}
|
|
3815
3830
|
|
|
3816
3831
|
// src/workflows/readiness.ts
|
|
3817
3832
|
async function findWorkflowReadinessProblems(definition, registry) {
|
|
@@ -4011,8 +4026,9 @@ async function startWorkflowExecution2(workflow, triggerData, registry, options
|
|
|
4011
4026
|
if (initial.status)
|
|
4012
4027
|
return runId;
|
|
4013
4028
|
const walk = walkGraph(workflow.definition, runId, initial.context, findEntryNodes(workflow.definition), registry, workflow.id, getSecretInputKeys(workflow.input), options);
|
|
4014
|
-
if (options.parentStepId) {
|
|
4015
|
-
|
|
4029
|
+
if (options.parentStepId || options.detach) {
|
|
4030
|
+
const kind = options.parentStepId ? "Child" : "Detached";
|
|
4031
|
+
walk.catch((err) => console.error(`[workflows] ${kind} workflow run ${runId} failed:`, err));
|
|
4016
4032
|
return runId;
|
|
4017
4033
|
}
|
|
4018
4034
|
await walk;
|
|
@@ -4487,17 +4503,17 @@ async function runClaimedStep(def, runId, ctx, node, registry, existingStep, ste
|
|
|
4487
4503
|
requestedByUserId: options.requestedByUserId,
|
|
4488
4504
|
inputCtx: interpolationCtx
|
|
4489
4505
|
};
|
|
4490
|
-
const
|
|
4506
|
+
const deadline = startStepDeadline(resolveNodeTimeoutMs(node));
|
|
4491
4507
|
let result;
|
|
4492
4508
|
try {
|
|
4493
4509
|
result = await Promise.race([
|
|
4494
4510
|
executor.run({
|
|
4495
4511
|
config: interpolatedConfig,
|
|
4496
4512
|
context: executionCtx,
|
|
4497
|
-
meta
|
|
4513
|
+
meta: { ...meta, signal: deadline.signal }
|
|
4498
4514
|
}),
|
|
4499
|
-
|
|
4500
|
-
]);
|
|
4515
|
+
deadline.expired
|
|
4516
|
+
]).finally(deadline.clear);
|
|
4501
4517
|
} catch (err) {
|
|
4502
4518
|
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
4503
4519
|
const retryPolicy = node.retry || executor.retryPolicy;
|
|
@@ -4536,7 +4552,7 @@ async function runClaimedStep(def, runId, ctx, node, registry, existingStep, ste
|
|
|
4536
4552
|
}
|
|
4537
4553
|
const waiting = await checkpointStepWaiting(runId, stepId, ctx);
|
|
4538
4554
|
if (waiting && result.waitFor === "workflow.child.finished") {
|
|
4539
|
-
const { resumeFromChildRun } = await import("./resume-
|
|
4555
|
+
const { resumeFromChildRun } = await import("./resume-1bmvjbf3.js");
|
|
4540
4556
|
await resumeFromChildRun(stepId, registry);
|
|
4541
4557
|
}
|
|
4542
4558
|
return { outcome: waiting ? "waiting" : "completed", successors: [] };
|
|
@@ -4741,11 +4757,6 @@ function scriptBodyInterpolationError(nodeId, tokens) {
|
|
|
4741
4757
|
const renderedTokens = [...new Set(tokens)].map((token) => `{{${token}}}`).join(", ");
|
|
4742
4758
|
return `Script body interpolation failed for node "${nodeId}": unresolved or disallowed token(s): ${renderedTokens}. Executable source may interpolate only input, workflow, swarm, or run values. Pass dynamic trigger or upstream values through config.args and read them from argv.`;
|
|
4743
4759
|
}
|
|
4744
|
-
function timeoutPromise(ms) {
|
|
4745
|
-
return new Promise((_, reject) => {
|
|
4746
|
-
setTimeout(() => reject(new Error(`Step timed out after ${ms}ms`)), ms);
|
|
4747
|
-
});
|
|
4748
|
-
}
|
|
4749
4760
|
|
|
4750
4761
|
// src/workflows/executors/foreach.ts
|
|
4751
4762
|
init_zod();
|
|
@@ -4998,7 +5009,7 @@ async function runForeachDrive(runId, parentNodeId, registry) {
|
|
|
4998
5009
|
if (drive.successors.length > 0) {
|
|
4999
5010
|
await walkGraph(workflow.definition, runId, ctx, drive.successors, registry, workflow.id, getSecretInputKeys(workflow.input));
|
|
5000
5011
|
} else {
|
|
5001
|
-
const { finalizeOrWait } = await import("./resume-
|
|
5012
|
+
const { finalizeOrWait } = await import("./resume-1bmvjbf3.js");
|
|
5002
5013
|
await finalizeOrWait(runId);
|
|
5003
5014
|
}
|
|
5004
5015
|
return drive;
|
|
@@ -5114,25 +5125,21 @@ async function startChild(input) {
|
|
|
5114
5125
|
}
|
|
5115
5126
|
}
|
|
5116
5127
|
const executor = registry.get(bodyType);
|
|
5117
|
-
const
|
|
5118
|
-
let timer;
|
|
5128
|
+
const deadline = startStepDeadline(resolveNodeTimeoutMs({ type: bodyType, config }));
|
|
5119
5129
|
let result;
|
|
5120
5130
|
try {
|
|
5121
5131
|
result = await Promise.race([
|
|
5122
5132
|
executor.run({
|
|
5123
5133
|
config,
|
|
5124
5134
|
context: { ...ctx, ...bodyCtx },
|
|
5125
|
-
meta: { ...meta, stepId: child.id, nodeId: child.nodeId }
|
|
5135
|
+
meta: { ...meta, stepId: child.id, nodeId: child.nodeId, signal: deadline.signal }
|
|
5126
5136
|
}),
|
|
5127
|
-
|
|
5128
|
-
timer = setTimeout(() => reject(new Error(`Step timed out after ${timeoutMs}ms`)), timeoutMs);
|
|
5129
|
-
})
|
|
5137
|
+
deadline.expired
|
|
5130
5138
|
]);
|
|
5131
5139
|
} catch (err) {
|
|
5132
5140
|
return { status: "failed", error: err instanceof Error ? err.message : String(err) };
|
|
5133
5141
|
} finally {
|
|
5134
|
-
|
|
5135
|
-
clearTimeout(timer);
|
|
5142
|
+
deadline.clear();
|
|
5136
5143
|
}
|
|
5137
5144
|
if (result.status === "failed") {
|
|
5138
5145
|
return {
|
|
@@ -5145,7 +5152,7 @@ async function startChild(input) {
|
|
|
5145
5152
|
const parked = await getDbClient2().get("UPDATE workflow_run_steps SET status = 'waiting' WHERE id = ? AND status = 'running' RETURNING id", [child.id]);
|
|
5146
5153
|
if (parked && result.waitFor === "workflow.child.finished") {
|
|
5147
5154
|
ownedChildren.delete(child.id);
|
|
5148
|
-
const { resumeFromChildRun } = await import("./resume-
|
|
5155
|
+
const { resumeFromChildRun } = await import("./resume-1bmvjbf3.js");
|
|
5149
5156
|
await resumeFromChildRun(child.id, registry);
|
|
5150
5157
|
}
|
|
5151
5158
|
return null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderSteeringDelivery
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-07q03xm2.js";
|
|
4
4
|
import {
|
|
5
5
|
authJsonToCredentialSelection,
|
|
6
6
|
credentialsToAuthJson,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
checkDeepSeekApiKey,
|
|
28
28
|
checkOpenAICompatibleProvider,
|
|
29
29
|
writeSkillsToFilesystem
|
|
30
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-6mgdba42.js";
|
|
31
31
|
import {
|
|
32
32
|
isPollTracingEnabled,
|
|
33
33
|
initOtel,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
injectTraceContext2,
|
|
38
38
|
initialize,
|
|
39
39
|
ensure
|
|
40
|
-
} from "./cli-
|
|
40
|
+
} from "./cli-m30k9777.js";
|
|
41
41
|
import {
|
|
42
42
|
MAX_RATE_LIMIT_RESET_MS,
|
|
43
43
|
isRateLimitMessage,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
CODEX_CREDITS_EXHAUSTED_COOLDOWN_MS,
|
|
46
46
|
resolveCodexCreditsExhaustedCooldownMs,
|
|
47
47
|
parseRateLimitResetTime
|
|
48
|
-
} from "./cli-
|
|
48
|
+
} from "./cli-vz78s5wm.js";
|
|
49
49
|
import {
|
|
50
50
|
terminateRegisteredProcessGroups
|
|
51
51
|
} from "./cli-3ggwdtb0.js";
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
canonicalAzureDevOpsRepoUrl,
|
|
56
56
|
parseAzureDevOpsRepoUrl,
|
|
57
57
|
resolveScriptsOnlyMode
|
|
58
|
-
} from "./cli-
|
|
58
|
+
} from "./cli-6a9qfa8b.js";
|
|
59
59
|
import {
|
|
60
60
|
ACP_TARGET_IDS,
|
|
61
61
|
isAcpTarget
|
|
@@ -63,32 +63,32 @@ import {
|
|
|
63
63
|
import {
|
|
64
64
|
checkAmpCredentials2,
|
|
65
65
|
liveTestAmpCredentials2
|
|
66
|
-
} from "./cli-
|
|
66
|
+
} from "./cli-kv7sbc2c.js";
|
|
67
67
|
import {
|
|
68
68
|
checkClaudeCredentials2
|
|
69
|
-
} from "./cli-
|
|
69
|
+
} from "./cli-1hhbzkbb.js";
|
|
70
70
|
import {
|
|
71
71
|
checkClaudeManagedCredentials2
|
|
72
|
-
} from "./cli-
|
|
72
|
+
} from "./cli-yd2nreqw.js";
|
|
73
73
|
import {
|
|
74
74
|
codexUserHome,
|
|
75
75
|
checkCodexCredentials2
|
|
76
|
-
} from "./cli-
|
|
76
|
+
} from "./cli-ymjpkxgn.js";
|
|
77
77
|
import {
|
|
78
78
|
checkCursorCredentials2
|
|
79
|
-
} from "./cli-
|
|
79
|
+
} from "./cli-h5jeg46p.js";
|
|
80
80
|
import {
|
|
81
81
|
checkDevinCredentials2
|
|
82
82
|
} from "./cli-39rrw8yp.js";
|
|
83
83
|
import {
|
|
84
84
|
checkDshCredentials2
|
|
85
|
-
} from "./cli-
|
|
85
|
+
} from "./cli-gsfk58nw.js";
|
|
86
86
|
import {
|
|
87
87
|
checkOpencodeCredentials2
|
|
88
|
-
} from "./cli-
|
|
88
|
+
} from "./cli-86ehn4s5.js";
|
|
89
89
|
import {
|
|
90
90
|
checkGrokCredentials2
|
|
91
|
-
} from "./cli-
|
|
91
|
+
} from "./cli-f12mr20z.js";
|
|
92
92
|
import {
|
|
93
93
|
getContextWindowSize,
|
|
94
94
|
init_context_window
|
|
@@ -101,7 +101,7 @@ import {
|
|
|
101
101
|
} from "./cli-j4bwnpkm.js";
|
|
102
102
|
import {
|
|
103
103
|
validateJsonSchema
|
|
104
|
-
} from "./cli-
|
|
104
|
+
} from "./cli-j0ppywdr.js";
|
|
105
105
|
import {
|
|
106
106
|
mapTriggerSurface,
|
|
107
107
|
init_telemetry_context,
|
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
init_vcs_repo_match,
|
|
120
120
|
isApiDrainingResponse,
|
|
121
121
|
init_api_drain
|
|
122
|
-
} from "./cli-
|
|
122
|
+
} from "./cli-48gxjmcz.js";
|
|
123
123
|
import {
|
|
124
124
|
parseWorkerModelTierOverrides,
|
|
125
125
|
resolveTaskModelSelection,
|
|
@@ -127,7 +127,7 @@ import {
|
|
|
127
127
|
ProviderNameSchema,
|
|
128
128
|
WorkerNudgeSchema,
|
|
129
129
|
init_types
|
|
130
|
-
} from "./cli-
|
|
130
|
+
} from "./cli-9pshx6rd.js";
|
|
131
131
|
import {
|
|
132
132
|
generateDefaultClaudeMd2,
|
|
133
133
|
generateDefaultSoulMd2,
|
|
@@ -151,14 +151,14 @@ import {
|
|
|
151
151
|
resolveClaudeMdPath,
|
|
152
152
|
syncProfileFilesToServer,
|
|
153
153
|
init_profile_sync
|
|
154
|
-
} from "./cli-
|
|
154
|
+
} from "./cli-x37r7qwf.js";
|
|
155
155
|
import {
|
|
156
156
|
isSteeringEnabled2,
|
|
157
157
|
init_steering_enabled
|
|
158
158
|
} from "./cli-4sydckyj.js";
|
|
159
159
|
import {
|
|
160
160
|
init_templates3
|
|
161
|
-
} from "./cli-
|
|
161
|
+
} from "./cli-v6shg7na.js";
|
|
162
162
|
import {
|
|
163
163
|
validateRoute,
|
|
164
164
|
deriveDefaultRoute,
|
|
@@ -175,14 +175,14 @@ import {
|
|
|
175
175
|
CLAUDE_CREDENTIALS_HINT,
|
|
176
176
|
resolveCredentialPools,
|
|
177
177
|
init_credentials
|
|
178
|
-
} from "./cli-
|
|
178
|
+
} from "./cli-gt4h8cxw.js";
|
|
179
179
|
import {
|
|
180
180
|
interpolate,
|
|
181
181
|
init_template,
|
|
182
182
|
configureHttpResolver,
|
|
183
183
|
resolveTemplateAsync,
|
|
184
184
|
init_resolver
|
|
185
|
-
} from "./cli-
|
|
185
|
+
} from "./cli-f1e0ptjj.js";
|
|
186
186
|
import {
|
|
187
187
|
runtimeHarnessSections,
|
|
188
188
|
refreshRuntimeModelCatalog,
|
|
@@ -248,19 +248,19 @@ async function materializeCodexAuthJson(_slot, creds, deps = {}) {
|
|
|
248
248
|
async function createProviderAdapter(provider) {
|
|
249
249
|
switch (provider) {
|
|
250
250
|
case "claude": {
|
|
251
|
-
const { ClaudeAdapter } = await import("./claude-adapter-
|
|
251
|
+
const { ClaudeAdapter } = await import("./claude-adapter-wqt4hfkq.js");
|
|
252
252
|
return new ClaudeAdapter;
|
|
253
253
|
}
|
|
254
254
|
case "pi": {
|
|
255
|
-
const { PiMonoAdapter } = await import("./pi-mono-adapter-
|
|
255
|
+
const { PiMonoAdapter } = await import("./pi-mono-adapter-qn6qbga1.js");
|
|
256
256
|
return new PiMonoAdapter;
|
|
257
257
|
}
|
|
258
258
|
case "codex": {
|
|
259
|
-
const { CodexAdapter } = await import("./codex-adapter-
|
|
259
|
+
const { CodexAdapter } = await import("./codex-adapter-zk59x2zh.js");
|
|
260
260
|
return new CodexAdapter;
|
|
261
261
|
}
|
|
262
262
|
case "claude-managed": {
|
|
263
|
-
const { ClaudeManagedAdapter } = await import("./claude-managed-adapter-
|
|
263
|
+
const { ClaudeManagedAdapter } = await import("./claude-managed-adapter-6fjqtr2z.js");
|
|
264
264
|
return new ClaudeManagedAdapter;
|
|
265
265
|
}
|
|
266
266
|
case "devin": {
|
|
@@ -268,27 +268,27 @@ async function createProviderAdapter(provider) {
|
|
|
268
268
|
return new DevinAdapter;
|
|
269
269
|
}
|
|
270
270
|
case "opencode": {
|
|
271
|
-
const { OpencodeAdapter } = await import("./opencode-adapter-
|
|
271
|
+
const { OpencodeAdapter } = await import("./opencode-adapter-26b2frdf.js");
|
|
272
272
|
return new OpencodeAdapter;
|
|
273
273
|
}
|
|
274
274
|
case "dsh": {
|
|
275
|
-
const { DshAdapter } = await import("./dsh-adapter-
|
|
275
|
+
const { DshAdapter } = await import("./dsh-adapter-46wawff9.js");
|
|
276
276
|
return new DshAdapter;
|
|
277
277
|
}
|
|
278
278
|
case "amp": {
|
|
279
|
-
const { AmpAdapter } = await import("./amp-adapter-
|
|
279
|
+
const { AmpAdapter } = await import("./amp-adapter-sxqqvmdk.js");
|
|
280
280
|
return new AmpAdapter;
|
|
281
281
|
}
|
|
282
282
|
case "cursor": {
|
|
283
|
-
const { CursorAdapter } = await import("./cursor-adapter-
|
|
283
|
+
const { CursorAdapter } = await import("./cursor-adapter-yss3pg7t.js");
|
|
284
284
|
return new CursorAdapter;
|
|
285
285
|
}
|
|
286
286
|
case "grok": {
|
|
287
|
-
const { GrokAdapter } = await import("./grok-adapter-
|
|
287
|
+
const { GrokAdapter } = await import("./grok-adapter-ag4wks2a.js");
|
|
288
288
|
return new GrokAdapter;
|
|
289
289
|
}
|
|
290
290
|
case "acp": {
|
|
291
|
-
const { ACPAdapter } = await import("./acp-adapter-
|
|
291
|
+
const { ACPAdapter } = await import("./acp-adapter-ma1js5n7.js");
|
|
292
292
|
return new ACPAdapter;
|
|
293
293
|
}
|
|
294
294
|
default:
|
|
@@ -1231,6 +1231,7 @@ init_secret_scrubber();
|
|
|
1231
1231
|
init_src2();
|
|
1232
1232
|
init_src();
|
|
1233
1233
|
init_credentials();
|
|
1234
|
+
init_env_flag();
|
|
1234
1235
|
init_secret_scrubber();
|
|
1235
1236
|
function isBedrockMode(env) {
|
|
1236
1237
|
const mode = env.BEDROCK_AUTH_MODE?.toLowerCase();
|
|
@@ -1273,7 +1274,7 @@ var CREDENTIAL_PROVIDER_CHECKERS = {
|
|
|
1273
1274
|
devin: (env) => checkDevinCredentials2(env),
|
|
1274
1275
|
opencode: (env, opts) => checkOpencodeCredentials2(env, opts),
|
|
1275
1276
|
pi: async (env, opts) => {
|
|
1276
|
-
const { checkPiMonoCredentials, listPiOpencodeGoModelIds } = await import("./pi-mono-adapter-
|
|
1277
|
+
const { checkPiMonoCredentials, listPiOpencodeGoModelIds } = await import("./pi-mono-adapter-qn6qbga1.js");
|
|
1277
1278
|
return {
|
|
1278
1279
|
...await checkPiMonoCredentials(env, opts),
|
|
1279
1280
|
opencodeGoModels: listPiOpencodeGoModelIds()
|
|
@@ -1552,7 +1553,7 @@ async function validateProviderCredentials(provider, env = process.env, presence
|
|
|
1552
1553
|
latency_ms: Date.now() - startedAt
|
|
1553
1554
|
};
|
|
1554
1555
|
}
|
|
1555
|
-
const { liveTestCursorKey } = await import("./cursor-adapter-
|
|
1556
|
+
const { liveTestCursorKey } = await import("./cursor-adapter-yss3pg7t.js");
|
|
1556
1557
|
return checkEachKey("CURSOR_API_KEY", apiKey, async (member) => {
|
|
1557
1558
|
const start = Date.now();
|
|
1558
1559
|
const result = await liveTestCursorKey(member);
|
|
@@ -1587,7 +1588,7 @@ async function validateProviderCredentials(provider, env = process.env, presence
|
|
|
1587
1588
|
}
|
|
1588
1589
|
}
|
|
1589
1590
|
function isCredCheckDisabled(env) {
|
|
1590
|
-
return
|
|
1591
|
+
return isEnvFlagEnabled("CRED_CHECK_DISABLE", false, env);
|
|
1591
1592
|
}
|
|
1592
1593
|
async function buildCredStatusReport(provider, env, opts = {}, kind) {
|
|
1593
1594
|
const presence = await checkProviderCredentials(provider, env, opts);
|
|
@@ -40,14 +40,14 @@ import {
|
|
|
40
40
|
getResolvedConfig2,
|
|
41
41
|
getMcpServerById2,
|
|
42
42
|
init_db3
|
|
43
|
-
} from "./cli-
|
|
43
|
+
} from "./cli-48gxjmcz.js";
|
|
44
44
|
import {
|
|
45
45
|
generateRandomCodeVerifier,
|
|
46
46
|
generateRandomState,
|
|
47
47
|
calculatePKCECodeChallenge,
|
|
48
48
|
oauthAppRowToProviderConfig,
|
|
49
49
|
ensureAuthorizationTokenOrThrow
|
|
50
|
-
} from "./cli-
|
|
50
|
+
} from "./cli-aypd09nf.js";
|
|
51
51
|
import {
|
|
52
52
|
detachedProcessGroup,
|
|
53
53
|
registerProcessGroup,
|
|
@@ -60,11 +60,11 @@ import {
|
|
|
60
60
|
mintScriptRunToken,
|
|
61
61
|
revokeSessionToken,
|
|
62
62
|
init_users
|
|
63
|
-
} from "./cli-
|
|
63
|
+
} from "./cli-a89zdqz9.js";
|
|
64
64
|
import {
|
|
65
65
|
defaultAssetKey,
|
|
66
66
|
init_key
|
|
67
|
-
} from "./cli-
|
|
67
|
+
} from "./cli-9pshx6rd.js";
|
|
68
68
|
import {
|
|
69
69
|
init_zod
|
|
70
70
|
} from "./cli-4chz1hye.js";
|
|
@@ -177950,21 +177950,18 @@ class NativeScriptExecutor {
|
|
|
177950
177950
|
let killed = input.signal?.aborted ?? false;
|
|
177951
177951
|
let removeAbortListener;
|
|
177952
177952
|
let proc;
|
|
177953
|
+
const killedOutput = () => ({
|
|
177954
|
+
result: undefined,
|
|
177955
|
+
stdout: "",
|
|
177956
|
+
stderr: "",
|
|
177957
|
+
truncated: { stdout: false, stderr: false },
|
|
177958
|
+
durationMs: Date.now() - start,
|
|
177959
|
+
exitCode: 1,
|
|
177960
|
+
error: "killed"
|
|
177961
|
+
});
|
|
177953
177962
|
try {
|
|
177954
|
-
if (killed)
|
|
177955
|
-
return
|
|
177956
|
-
result: undefined,
|
|
177957
|
-
stdout: "",
|
|
177958
|
-
stderr: "",
|
|
177959
|
-
truncated: { stdout: false, stderr: false },
|
|
177960
|
-
durationMs: Date.now() - start,
|
|
177961
|
-
exitCode: 1,
|
|
177962
|
-
error: "killed"
|
|
177963
|
-
};
|
|
177964
|
-
}
|
|
177965
|
-
await Bun.write(argsFile, JSON.stringify(input.args ?? null));
|
|
177966
|
-
await Bun.write(sourceFile, input.source);
|
|
177967
|
-
await writeBareImportShims(tmpdir);
|
|
177963
|
+
if (killed)
|
|
177964
|
+
return killedOutput();
|
|
177968
177965
|
const onExternalAbort = () => {
|
|
177969
177966
|
killed = true;
|
|
177970
177967
|
if (proc)
|
|
@@ -177972,6 +177969,11 @@ class NativeScriptExecutor {
|
|
|
177972
177969
|
};
|
|
177973
177970
|
input.signal?.addEventListener("abort", onExternalAbort, { once: true });
|
|
177974
177971
|
removeAbortListener = () => input.signal?.removeEventListener("abort", onExternalAbort);
|
|
177972
|
+
await Bun.write(argsFile, JSON.stringify(input.args ?? null));
|
|
177973
|
+
await Bun.write(sourceFile, input.source);
|
|
177974
|
+
await writeBareImportShims(tmpdir);
|
|
177975
|
+
if (killed)
|
|
177976
|
+
return killedOutput();
|
|
177975
177977
|
const timeout = setTimeout(() => {
|
|
177976
177978
|
timedOut = true;
|
|
177977
177979
|
if (proc)
|
|
@@ -177988,7 +177990,8 @@ class NativeScriptExecutor {
|
|
|
177988
177990
|
SWARM_SCRIPT_SOURCE_FILE: sourceFile,
|
|
177989
177991
|
SWARM_SCRIPT_RESULT_FILE: resultFile,
|
|
177990
177992
|
SWARM_SCRIPT_ERROR_FILE: errorFile,
|
|
177991
|
-
SWARM_SCRIPT_STARTED_FILE: startedFile
|
|
177993
|
+
SWARM_SCRIPT_STARTED_FILE: startedFile,
|
|
177994
|
+
...input.hostValidatedArgs ? { SWARM_SCRIPT_HOST_VALIDATED_ARGS: "1" } : {}
|
|
177992
177995
|
};
|
|
177993
177996
|
proc = registerProcessGroup(Bun.spawn(harnessCommand(harnessPath, input, harnessEnv), {
|
|
177994
177997
|
env: sandboxSpawnEnv(harnessEnv),
|
|
@@ -178145,6 +178148,10 @@ class QuickJSScriptExecutor {
|
|
|
178145
178148
|
pool.discard(slot);
|
|
178146
178149
|
return emptyOutput("executor_error", `quickjs worker failed to start: ${error instanceof Error ? error.message : String(error)}`);
|
|
178147
178150
|
}
|
|
178151
|
+
if (input.signal?.aborted) {
|
|
178152
|
+
pool.release(slot);
|
|
178153
|
+
return emptyOutput("killed");
|
|
178154
|
+
}
|
|
178148
178155
|
const id = ++requestSeq;
|
|
178149
178156
|
const start = performance.now();
|
|
178150
178157
|
return await new Promise((resolve) => {
|
|
@@ -178186,6 +178193,7 @@ class QuickJSScriptExecutor {
|
|
|
178186
178193
|
job: {
|
|
178187
178194
|
source: input.source,
|
|
178188
178195
|
args: input.args,
|
|
178196
|
+
...input.hostValidatedArgs ? { hostValidatedArgs: true } : {},
|
|
178189
178197
|
configPayload: input.configPayload,
|
|
178190
178198
|
resources: input.resources,
|
|
178191
178199
|
network: input.network
|
|
@@ -178200,6 +178208,17 @@ var EXECUTORS = {
|
|
|
178200
178208
|
native: () => new NativeScriptExecutor,
|
|
178201
178209
|
quickjs: () => new QuickJSScriptExecutor
|
|
178202
178210
|
};
|
|
178211
|
+
function getDeploymentScriptExecutorName(env = process.env) {
|
|
178212
|
+
return (env.SCRIPT_EXECUTOR ?? "native").trim();
|
|
178213
|
+
}
|
|
178214
|
+
function isExecutorAllowedByDeployment(requested, env = process.env) {
|
|
178215
|
+
if (!requested)
|
|
178216
|
+
return true;
|
|
178217
|
+
if (getDeploymentScriptExecutorName(env) === "quickjs" && requested.trim() === "native") {
|
|
178218
|
+
return false;
|
|
178219
|
+
}
|
|
178220
|
+
return true;
|
|
178221
|
+
}
|
|
178203
178222
|
function getScriptExecutor(name = process.env.SCRIPT_EXECUTOR ?? "native") {
|
|
178204
178223
|
const factory = EXECUTORS[name.trim()];
|
|
178205
178224
|
if (!factory) {
|
|
@@ -178207,6 +178226,13 @@ function getScriptExecutor(name = process.env.SCRIPT_EXECUTOR ?? "native") {
|
|
|
178207
178226
|
}
|
|
178208
178227
|
return factory();
|
|
178209
178228
|
}
|
|
178229
|
+
function resolveScriptExecutor(requested, env = process.env) {
|
|
178230
|
+
if (!isExecutorAllowedByDeployment(requested, env)) {
|
|
178231
|
+
throw new Error('Executor "native" is not permitted when deployment SCRIPT_EXECUTOR="quickjs"');
|
|
178232
|
+
}
|
|
178233
|
+
const effective = requested ?? env.SCRIPT_EXECUTOR ?? "native";
|
|
178234
|
+
return getScriptExecutor(effective);
|
|
178235
|
+
}
|
|
178210
178236
|
|
|
178211
178237
|
// src/scripts-runtime/executors/types.ts
|
|
178212
178238
|
var MIN_SCRIPT_WALL_CLOCK_MS = 1000;
|
|
@@ -178222,6 +178248,9 @@ var DEFAULT_SCRIPT_RESOURCES = {
|
|
|
178222
178248
|
maxStdoutBytes: 1048576
|
|
178223
178249
|
};
|
|
178224
178250
|
|
|
178251
|
+
// src/scripts-runtime/host-validated-args.ts
|
|
178252
|
+
var HOST_VALIDATED_ARGS = Symbol("swarm.hostValidatedArgs");
|
|
178253
|
+
|
|
178225
178254
|
// src/scripts-runtime/import-allowlist.ts
|
|
178226
178255
|
var import_typescript = __toESM(require_typescript2(), 1);
|
|
178227
178256
|
var SCRIPT_ALLOWED_BARE_IMPORTS = ["swarm-sdk", "stdlib", "zod", "zod/mini"];
|
|
@@ -178365,6 +178394,17 @@ async function runScript(input) {
|
|
|
178365
178394
|
error: "executor_error"
|
|
178366
178395
|
};
|
|
178367
178396
|
}
|
|
178397
|
+
if (!isExecutorAllowedByDeployment(input.executor)) {
|
|
178398
|
+
return {
|
|
178399
|
+
result: undefined,
|
|
178400
|
+
stdout: "",
|
|
178401
|
+
stderr: 'Executor "native" is not permitted when deployment SCRIPT_EXECUTOR="quickjs"',
|
|
178402
|
+
truncated: { stdout: false, stderr: false },
|
|
178403
|
+
durationMs: 0,
|
|
178404
|
+
exitCode: 1,
|
|
178405
|
+
error: "executor_error"
|
|
178406
|
+
};
|
|
178407
|
+
}
|
|
178368
178408
|
const runSecrets = createValueScrubber(Object.entries(input.userConfig ?? {}).filter(([, entry]) => entry.isSecret).map(([key, entry]) => ({ value: entry.value, name: `config:${key}` })));
|
|
178369
178409
|
const imports = validateScriptImports(input.source);
|
|
178370
178410
|
if (!imports.ok) {
|
|
@@ -178387,18 +178427,19 @@ async function runScript(input) {
|
|
|
178387
178427
|
const executorInput = {
|
|
178388
178428
|
source: input.source,
|
|
178389
178429
|
args: input.args ?? null,
|
|
178430
|
+
...input[HOST_VALIDATED_ARGS] === true ? { hostValidatedArgs: true } : {},
|
|
178390
178431
|
configPayload,
|
|
178391
178432
|
resources,
|
|
178392
178433
|
fsMode: input.fsMode ?? "none",
|
|
178393
178434
|
network: scriptEgressPolicy(),
|
|
178394
178435
|
signal: input.signal
|
|
178395
178436
|
};
|
|
178396
|
-
let output = await
|
|
178437
|
+
let output = await resolveScriptExecutor(input.executor).run(executorInput);
|
|
178397
178438
|
for (const delayMs of CAPACITY_EXCEEDED_RETRY_DELAYS_MS) {
|
|
178398
178439
|
if (output.error !== "capacity_exceeded" || input.signal?.aborted)
|
|
178399
178440
|
break;
|
|
178400
178441
|
await Bun.sleep(delayMs);
|
|
178401
|
-
output = await
|
|
178442
|
+
output = await resolveScriptExecutor(input.executor).run(executorInput);
|
|
178402
178443
|
}
|
|
178403
178444
|
return {
|
|
178404
178445
|
...output,
|
|
@@ -178571,6 +178612,7 @@ async function runSavedScriptAsAgent(args, deps = {}) {
|
|
|
178571
178612
|
source: args.script.source,
|
|
178572
178613
|
args: args.input,
|
|
178573
178614
|
fsMode: args.script.fsMode,
|
|
178615
|
+
executor: args.script.executor,
|
|
178574
178616
|
agentId: args.agentId,
|
|
178575
178617
|
egressSecrets: credentials.egressSecrets,
|
|
178576
178618
|
failedBindings: credentials.failedBindings,
|
|
@@ -184019,6 +184061,7 @@ var SCRIPT_SDK_TYPES = `
|
|
|
184019
184061
|
export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };
|
|
184020
184062
|
export type ScriptScope = "agent" | "global";
|
|
184021
184063
|
export type ScriptFsMode = "none" | "workspace-rw";
|
|
184064
|
+
export type ScriptExecutorName = "native" | "quickjs";
|
|
184022
184065
|
export type ScriptApiRawOptions = { raw: true };
|
|
184023
184066
|
export type ScriptApiDefaultOptions = { raw?: false };
|
|
184024
184067
|
export type RoutingReason = "skill" | "continuity" | "overflow" | "human_pinned" | "reroute_fault";
|
|
@@ -184210,7 +184253,7 @@ export interface SwarmSdk {
|
|
|
184210
184253
|
schedule_list(args?: { enabled?: boolean; name?: string; scheduleType?: "recurring" | "one_time"; targetType?: "agent-task" | "workflow" | "script"; workflowId?: string; scriptName?: string; hideCompleted?: boolean; consecutiveErrorsMin?: number; lastRunStatus?: "failed" | "succeeded"; includeFull?: boolean }): Promise<unknown>;
|
|
184211
184254
|
// --- scripts ---
|
|
184212
184255
|
script_search(args: { query?: string; scope?: ScriptScope; limit?: number }): Promise<unknown>;
|
|
184213
|
-
script_run(args: { name?: string; source?: string; args?: unknown; intent?: string; scope?: ScriptScope; fsMode?: ScriptFsMode; idempotencyKey?: string }): Promise<unknown>;
|
|
184256
|
+
script_run(args: { name?: string; source?: string; args?: unknown; intent?: string; scope?: ScriptScope; fsMode?: ScriptFsMode; executor?: ScriptExecutorName | null; idempotencyKey?: string }): Promise<unknown>;
|
|
184214
184257
|
// --- swarm / agent ---
|
|
184215
184258
|
swarm_get(args?: { includeFull?: boolean }): Promise<unknown>;
|
|
184216
184259
|
agent_info(args?: Record<string, unknown>): Promise<unknown>;
|
|
@@ -184327,7 +184370,12 @@ export interface SwarmSdk {
|
|
|
184327
184370
|
workflow_patch(args: Record<string, unknown>): Promise<unknown>;
|
|
184328
184371
|
workflow_patchNode(args: Record<string, unknown>): Promise<unknown>;
|
|
184329
184372
|
workflow_delete(args: { id: string }): Promise<unknown>;
|
|
184330
|
-
workflow_trigger(args: {
|
|
184373
|
+
workflow_trigger(args: {
|
|
184374
|
+
id: string;
|
|
184375
|
+
triggerData?: Record<string, unknown>;
|
|
184376
|
+
wait?: boolean;
|
|
184377
|
+
idempotencyKey?: string;
|
|
184378
|
+
}): Promise<unknown>;
|
|
184331
184379
|
workflow_retryRun(args: { id: string }): Promise<unknown>;
|
|
184332
184380
|
workflow_cancelRun(args: { id: string }): Promise<unknown>;
|
|
184333
184381
|
|
|
@@ -184337,7 +184385,7 @@ export interface SwarmSdk {
|
|
|
184337
184385
|
prompt_preview(args: Record<string, unknown>): Promise<unknown>;
|
|
184338
184386
|
|
|
184339
184387
|
// --- write: scripts ---
|
|
184340
|
-
script_upsert(args: { name: string; source: string; description?: string; intent?: string; scope?: ScriptScope; fsMode?: ScriptFsMode }): Promise<unknown>;
|
|
184388
|
+
script_upsert(args: { name: string; source: string; description?: string; intent?: string; scope?: ScriptScope; fsMode?: ScriptFsMode; executor?: ScriptExecutorName | null }): Promise<unknown>;
|
|
184341
184389
|
script_delete(args: { name: string; scope?: ScriptScope }): Promise<unknown>;
|
|
184342
184390
|
script_queryTypes(args: { name: string; scope?: ScriptScope }): Promise<unknown>;
|
|
184343
184391
|
script_launchRun(args: { source: string; args?: unknown; idempotencyKey?: string; scriptName?: string; requestedByUserId?: string }): Promise<unknown>;
|
|
@@ -185178,4 +185226,4 @@ function parseSkillContent(content) {
|
|
|
185178
185226
|
};
|
|
185179
185227
|
}
|
|
185180
185228
|
|
|
185181
|
-
export { require_dist2, isInvalidClientError, publicEndpointSsrfOptions, mcpOAuthSsrfOptions, discoverProtectedResourceMetadata, discoverAuthorizationServerMetadata, normalizeTokenEndpointAuthMethod, resolveAdvertisedTokenEndpointAuthMethod, authMethodForStoredClient, selectDcrTokenEndpointAuthMethod, registerClient, buildAuthorizeUrl, exchangeCodeForTokens, refreshMcpToken, revokeMcpToken, computeExpiresAt, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, ensureMcpToken, callMcpServerTool, resolveSqlDsn, runReadOnlyQuery, listVendoredOpenapiEntries, ConnectionAuthInputSchema, SqlDsnInputSchema, connectionAuthSummary, listRelationalCredentialBindings, getCredentialBindingById, findCredentialBindingByIdentity, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, listScriptConnectionsAsync, getScriptConnectionById, ScriptConnectionConflictError, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, deleteScriptConnection, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, buildScriptCredentialBindingsWithFailures, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, writeBareImportShim, MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, require_typescript2, checkImportAllowlist, validateScriptImports, runScriptWithRunCredential, extractScriptSignature, extractArgsJsonSchema, getSavedScriptOwnerAgentId, runSavedScriptAsAgent, checkQuickJSCompat, quickJSCompatWarnings, resolveSyncRunAs, AppNameSchema, ScalarColumnKindSchema, isIso8601Date, jsonColumnSizeLabel, jsonColumnValueIssue, isValidColumnValue, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppElementsSchema, AppDefinitionSchema, collectScriptReferences, scriptCompatWarnings, parseAppDefinition, applyAppDefinitionPatch, upgradeAppDefinition, decodeAppDefinition, appDefinitionNeedsRepair, createApp, getApp, listApps, listAppRecords, updateApp, deleteApp, getScriptAppTypes, SCRIPT_SDK_TYPES, scriptSdkTypesWithGeneratedApis, SCRIPT_STDLIB_MODULE_TYPES, scriptStdlibTypesWithGeneratedApis, typecheckWithAmbient, typecheckScript, parseSkillContent };
|
|
185229
|
+
export { require_dist2, isInvalidClientError, publicEndpointSsrfOptions, mcpOAuthSsrfOptions, discoverProtectedResourceMetadata, discoverAuthorizationServerMetadata, normalizeTokenEndpointAuthMethod, resolveAdvertisedTokenEndpointAuthMethod, authMethodForStoredClient, selectDcrTokenEndpointAuthMethod, registerClient, buildAuthorizeUrl, exchangeCodeForTokens, refreshMcpToken, revokeMcpToken, computeExpiresAt, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, ensureMcpToken, callMcpServerTool, resolveSqlDsn, runReadOnlyQuery, listVendoredOpenapiEntries, ConnectionAuthInputSchema, SqlDsnInputSchema, connectionAuthSummary, listRelationalCredentialBindings, getCredentialBindingById, findCredentialBindingByIdentity, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, listScriptConnectionsAsync, getScriptConnectionById, ScriptConnectionConflictError, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, deleteScriptConnection, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, buildScriptCredentialBindingsWithFailures, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, writeBareImportShim, isExecutorAllowedByDeployment, MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, HOST_VALIDATED_ARGS, require_typescript2, checkImportAllowlist, validateScriptImports, runScriptWithRunCredential, extractScriptSignature, extractArgsJsonSchema, getSavedScriptOwnerAgentId, runSavedScriptAsAgent, checkQuickJSCompat, quickJSCompatWarnings, resolveSyncRunAs, AppNameSchema, ScalarColumnKindSchema, isIso8601Date, jsonColumnSizeLabel, jsonColumnValueIssue, isValidColumnValue, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppElementsSchema, AppDefinitionSchema, collectScriptReferences, scriptCompatWarnings, parseAppDefinition, applyAppDefinitionPatch, upgradeAppDefinition, decodeAppDefinition, appDefinitionNeedsRepair, createApp, getApp, listApps, listAppRecords, updateApp, deleteApp, getScriptAppTypes, SCRIPT_SDK_TYPES, scriptSdkTypesWithGeneratedApis, SCRIPT_STDLIB_MODULE_TYPES, scriptStdlibTypesWithGeneratedApis, typecheckWithAmbient, typecheckScript, parseSkillContent };
|