@desplega.ai/agent-swarm 1.165.0 → 1.166.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/dist/{acp-adapter-w6zws6me.js → acp-adapter-yzfxn8vj.js} +4 -4
- package/dist/{actions-jna0b3wm.js → actions-qz3m692w.js} +20 -24
- package/dist/{amp-adapter-0eve81pz.js → amp-adapter-j1xbmsqz.js} +4 -4
- package/dist/{app-75hm5cfa.js → app-43vrdmv8.js} +6 -7
- package/dist/{assistant-yzd51j33.js → assistant-ertffmka.js} +21 -25
- package/dist/{boot-reembed-z158xq32.js → boot-reembed-998jtpdg.js} +9 -12
- package/dist/{boot-reembed-2ex2mcsh.js → boot-reembed-s7k7c6v2.js} +10 -12
- package/dist/boot-scrub-sweep-nepsk4t1.js +211 -0
- package/dist/{boot-seeds-2bmnh18p.js → boot-seeds-vvzs1zhk.js} +8 -8
- package/dist/{claude-adapter-jbj1mycz.js → claude-adapter-2zvmekrp.js} +9 -11
- package/dist/{claude-managed-adapter-17ggz09t.js → claude-managed-adapter-s49wbk8t.js} +3 -3
- package/dist/{claude-managed-setup-ptm1nzm2.js → claude-managed-setup-cvhqq8qn.js} +4 -4
- package/dist/{claude-sdk-session-9re1g7r2.js → claude-sdk-session-kkbxtw5q.js} +2618 -2600
- package/dist/{cli-k6xx3pve.js → cli-0nhdwxd5.js} +4 -4
- package/dist/{cli-n9ehc28t.js → cli-0qjcsxgz.js} +4 -4
- package/dist/{cli-zn2v3t8v.js → cli-3ddybbbx.js} +1 -1
- package/dist/{cli-5anb0ev3.js → cli-3qn4r334.js} +71 -14
- package/dist/{cli-1kzfvd1z.js → cli-4r1sjfc4.js} +9 -5
- package/dist/{cli-ba66wyhy.js → cli-66zh26sp.js} +6 -6
- package/dist/{cli-9xb89xca.js → cli-68r1j4sg.js} +6 -6
- package/dist/{cli-xnzrzets.js → cli-8kgvmkak.js} +2 -2
- package/dist/{cli-28smfvbn.js → cli-8t229cmr.js} +5 -5
- package/dist/{cli-9866bd07.js → cli-aqcey741.js} +1 -1
- package/dist/{cli-90v942q1.js → cli-cpfmqz3n.js} +8 -8
- package/dist/{cli-50eg13rj.js → cli-df56tqdw.js} +459 -282
- package/dist/{cli-8gpbwy09.js → cli-dw2q9f7g.js} +5 -5
- package/dist/{cli-0n4fasz0.js → cli-ecknp7p1.js} +15 -15
- package/dist/{cli-xb3c6aat.js → cli-f2n17zhp.js} +1 -1
- package/dist/{cli-ftry7975.js → cli-feh3dkah.js} +1 -1
- package/dist/{cli-amwhs8h2.js → cli-fn697bnt.js} +2 -2
- package/dist/{cli-prt9emct.js → cli-gt8azyet.js} +3 -3
- package/dist/{cli-59jn5twa.js → cli-h3x613ze.js} +2 -2
- package/dist/{cli-mmzwwptd.js → cli-hf5s9pgf.js} +1 -1
- package/dist/cli-j2jbr8af.js +516 -0
- package/dist/{cli-wfajtmf7.js → cli-jhm6hzjn.js} +593 -10
- package/dist/{cli-xtgtyafv.js → cli-jvj6a0cv.js} +190 -439
- package/dist/{cli-hpryr6em.js → cli-mb75wpxf.js} +1 -1
- package/dist/{cli-420bdgw0.js → cli-mv2520nm.js} +1 -1
- package/dist/{cli-pjxnr1jn.js → cli-mwegs4af.js} +3 -3
- package/dist/{cli-5b2fjjzh.js → cli-p4ztb80h.js} +2 -2
- package/dist/{cli-e7t4snpa.js → cli-rggdq8wq.js} +4 -4
- package/dist/{cli-bdv39kgj.js → cli-rsy933yz.js} +5 -5
- package/dist/{cli-gh5yqzpe.js → cli-v2a8x45d.js} +2 -2
- package/dist/{cli-bns5c8k9.js → cli-vzc73wet.js} +43 -47
- package/dist/cli-wt7ccy4r.js +2654 -0
- package/dist/{cli-j0pdrmwg.js → cli-x7kpr72a.js} +3 -3
- package/dist/{cli-x7afk5wm.js → cli-xvc3q9br.js} +1 -1
- package/dist/{cli-9s3h836g.js → cli-xvdgasgy.js} +1 -1
- package/dist/{cli-zvckv750.js → cli-y59h2pk9.js} +2 -2
- package/dist/{cli-qdv8kgz7.js → cli-yshaazs1.js} +13884 -3241
- package/dist/{cli-nfygw434.js → cli-ysnyhws9.js} +2 -2
- package/dist/{cli-fw6vdcq5.js → cli-zp67qg5x.js} +34 -1
- package/dist/{cli-ma3zvh39.js → cli-zy7vwsne.js} +6066 -5829
- package/dist/cli.js +24 -20
- package/dist/{codex-adapter-3qnxshje.js → codex-adapter-dw1wxqt8.js} +7 -7
- package/dist/{codex-login-brkxhhdg.js → codex-login-terbdsqq.js} +2 -2
- package/dist/{codex-session-runner-612wnapp.js → codex-session-runner-3cgb8y1g.js} +7 -7
- package/dist/{commands-2ybfcxkj.js → commands-mhxam6z2.js} +6 -6
- package/dist/{cursor-adapter-p3jgdehv.js → cursor-adapter-2qda3st7.js} +3 -3
- package/dist/{db-f4ans0jj.js → db-sjks418k.js} +8 -6
- package/dist/{devin-adapter-dhzt01ff.js → devin-adapter-bffjj5n4.js} +2 -2
- package/dist/{dispatcher-pk182apd.js → dispatcher-1es759rn.js} +18 -22
- package/dist/{dsh-adapter-7twaeps1.js → dsh-adapter-bek4cyw9.js} +3 -3
- package/dist/{e2b-y8t3jzyz.js → e2b-nd50eccg.js} +1 -1
- package/dist/{event-bus-w7ac4n3c.js → event-bus-vnfthafg.js} +2 -2
- package/dist/{grok-adapter-yt9pab3k.js → grok-adapter-ar9cw9jg.js} +5 -5
- package/dist/{handlers-g2wnr4t9.js → handlers-1gkbhktr.js} +21 -25
- package/dist/{hook-f7jt9vnm.js → hook-ds2zxq9v.js} +14 -16
- package/dist/{hook-bbdpnkb4.js → hook-vxa3tcsy.js} +8 -10
- package/dist/{http-w40q4w94.js → http-3h21z9md.js} +247 -164
- package/dist/{index-056j5kzn.js → index-9b65j1m5.js} +8 -8
- package/dist/{index-9bfssf54.js → index-bn6cy8ps.js} +18 -22
- package/dist/{index-cj1r9q83.js → index-dkfxpkmm.js} +19 -23
- package/dist/{index-7n70jwbb.js → index-f8xnqrye.js} +19 -21
- package/dist/{index-fdk1t4d6.js → index-n0rxa4ca.js} +11962 -9900
- package/dist/{index-k8xc083e.js → index-n99fycq7.js} +18 -22
- package/dist/{keepalive-1tj10tf4.js → keepalive-3xspa9jw.js} +11 -8
- package/dist/{lead-st0bg7v4.js → lead-6qphc124.js} +34 -38
- package/dist/{maintenance-nz71zats.js → maintenance-0teem1bb.js} +7 -9
- package/dist/{node-f0ykebbv.js → node-9sg7ajby.js} +25 -7
- package/dist/{oauth-refresh-sweep-aefzwvvq.js → oauth-refresh-sweep-sh9q25xp.js} +10 -7
- package/dist/{onboard-kgpr9mbn.js → onboard-54qmnqxe.js} +2 -2
- package/dist/{opencode-adapter-0c8e70dk.js → opencode-adapter-wjfa2wvd.js} +2 -2
- package/dist/{otel-impl-x8zp4y5a.js → otel-impl-ycqzp2a1.js} +2 -2
- package/dist/{pi-mono-adapter-t280ah5c.js → pi-mono-adapter-e77e9zst.js} +4 -4
- package/dist/{pricing-refresh-9e0q7cwk.js → pricing-refresh-atnkngqs.js} +7 -7
- package/dist/{rbac-roles-kcp6zge2.js → rbac-roles-9pjphh9q.js} +6 -6
- package/dist/{rbac-roles-790j3ga8.js → rbac-roles-j78wdksm.js} +6 -6
- package/dist/{render-v2-tch4nefj.js → render-v2-pxjs49fx.js} +6 -7
- package/dist/{setup-rcm303ns.js → setup-ymej0xtx.js} +2 -2
- package/dist/{work-objects-ctg7t70w.js → work-objects-3nh4ymzb.js} +22 -26
- package/dist/{worker-5dp0xm55.js → worker-qa9fkz5s.js} +34 -38
- package/dist/{x-v3yw66zs.js → x-ma4gnfgy.js} +2 -2
- package/openapi.json +5 -2
- package/package.json +9 -5
- package/src/be/automation-preflight.ts +9 -4
- package/src/be/boot-scrub-sweep.ts +302 -0
- package/src/be/crypto/key-bootstrap.ts +1 -1
- package/src/be/db/approvals.ts +15 -1
- package/src/be/db/codex-oauth-device-flows.ts +40 -0
- package/src/be/db/config-secrets.ts +31 -0
- package/src/be/db/runtime.ts +4 -0
- package/src/be/db/script-runs.ts +15 -0
- package/src/be/db/tasks/write.ts +1 -1
- package/src/be/db-queries/mcp-oauth.ts +5 -0
- package/src/be/db-queries/oauth.ts +77 -0
- package/src/be/db.ts +162 -59
- package/src/be/events.ts +17 -1
- package/src/be/memory/index-content.ts +2 -2
- package/src/be/memory/providers/sqlite-store.ts +63 -11
- package/src/be/memory/types.ts +14 -0
- package/src/be/migrations/201_workflow_replay_columns.sql +10 -0
- package/src/be/migrations/202_codex_oauth_device_flows.sql +24 -0
- package/src/be/scripts/db.ts +28 -4
- package/src/be/scripts/source-secrets.ts +37 -0
- package/src/be/scrub-json.ts +32 -0
- package/src/be/sealed-json.ts +59 -0
- package/src/be/secret-registry.ts +131 -0
- package/src/be/workflow-replay.ts +77 -0
- package/src/http/codex-oauth-device.ts +8 -10
- package/src/http/db-query-bounded.ts +3 -0
- package/src/http/db-query-shared.ts +107 -15
- package/src/http/db-query.ts +10 -2
- package/src/http/index.ts +23 -6
- package/src/http/script-runs.ts +9 -1
- package/src/http/scripts.ts +15 -0
- package/src/http/workflows.ts +3 -2
- package/src/oauth/mcp-wrapper.ts +1 -1
- package/src/providers/acp-adapter.ts +25 -11
- package/src/providers/acp-target-catalog.ts +35 -1
- package/src/providers/acp-targets.ts +69 -3
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/script-workflows/supervisor.ts +11 -2
- package/src/scripts-runtime/eval-harness.ts +2 -12
- package/src/scripts-runtime/executors/quickjs-bundle.ts +152 -0
- package/src/scripts-runtime/executors/quickjs-prelude.ts +285 -0
- package/src/scripts-runtime/executors/quickjs-runner.ts +580 -0
- package/src/scripts-runtime/executors/quickjs-worker.ts +81 -0
- package/src/scripts-runtime/executors/quickjs.ts +196 -0
- package/src/scripts-runtime/executors/registry.ts +2 -0
- package/src/scripts-runtime/executors/sourcemap.ts +79 -0
- package/src/scripts-runtime/script-error-hints.ts +14 -0
- package/src/server.ts +3 -1
- package/src/tests/acp-adapter.test.ts +127 -2
- package/src/tests/boot-scrub-sweep.test.ts +390 -0
- package/src/tests/check-text-columns.test.ts +145 -0
- package/src/tests/claude-sdk-process.fixture.ts +13 -2
- package/src/tests/codex-oauth-device.test.ts +23 -37
- package/src/tests/db-query-denylist.test.ts +202 -0
- package/src/tests/db-task-read-contract.test.ts +1 -0
- package/src/tests/db-task-write-contract.test.ts +1 -0
- package/src/tests/entrypoint-acp-target-binary.test.ts +31 -1
- package/src/tests/events-scrub.test.ts +88 -0
- package/src/tests/fixtures/secret-corpus.ts +320 -0
- package/src/tests/script-connections.test.ts +5 -0
- package/src/tests/script-executor-conformance.test.ts +3 -0
- package/src/tests/script-executor-quickjs.test.ts +442 -0
- package/src/tests/script-executor-registry.test.ts +6 -1
- package/src/tests/script-runs-http.test.ts +88 -1
- package/src/tests/script-runs-scrub.test.ts +275 -0
- package/src/tests/scripts-http.test.ts +82 -1
- package/src/tests/scrubbed-text-12e.test.ts +289 -0
- package/src/tests/sealed-key-guard.test.ts +166 -0
- package/src/tests/secret-canary-sweep.test.ts +958 -0
- package/src/tests/secret-registry.test.ts +355 -0
- package/src/tests/secret-rules.test.ts +230 -0
- package/src/tests/secret-scrubber.test.ts +3 -2
- package/src/tests/workflow-replay.test.ts +518 -0
- package/src/tests/workflow-scrub.test.ts +242 -0
- package/src/tools/db-query.ts +1 -1
- package/src/tools/inject-learning.ts +1 -1
- package/src/tools/workflows/get-workflow-run.ts +3 -2
- package/src/types.ts +1 -1
- package/src/utils/secret-rules.generated.ts +2055 -0
- package/src/utils/secret-scrubber.ts +363 -29
- package/src/workflows/engine.ts +39 -4
- package/src/workflows/recovery.ts +10 -1
- package/src/workflows/resume.ts +62 -3
- package/src/workflows/retry-poller.ts +3 -0
- package/dist/boot-scrub-logs-246yn076.js +0 -99
- package/dist/cli-3a4m1aws.js +0 -572
- package/dist/cli-a87b04k8.js +0 -951
- package/dist/cli-cvk6yzw5.js +0 -40
- package/dist/cli-h1spv8v4.js +0 -427
- package/dist/cli-jqt9hrnz.js +0 -168
- package/dist/cli-yhmwmv0g.js +0 -9281
- package/src/be/boot-scrub-logs.ts +0 -132
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./cli-efnd2kce.js";
|
|
11
11
|
import {
|
|
12
12
|
ACP_TARGET_IDS
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-zp67qg5x.js";
|
|
14
14
|
import {
|
|
15
15
|
isCodexOAuthConfigKey
|
|
16
16
|
} from "./cli-bqjfjex4.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
import {
|
|
28
28
|
ensureAgentFsCredentialsForAgent,
|
|
29
29
|
inviteEmailToSharedOrg
|
|
30
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-gt8azyet.js";
|
|
31
31
|
import {
|
|
32
32
|
DEFAULT_CONNECTOR_CODE_LABEL,
|
|
33
33
|
checkHeartbeatChecklist,
|
|
@@ -35,10 +35,10 @@ import {
|
|
|
35
35
|
exchangeConnectorCode,
|
|
36
36
|
runHeartbeatSweep,
|
|
37
37
|
stopHeartbeat
|
|
38
|
-
} from "./cli-
|
|
38
|
+
} from "./cli-66zh26sp.js";
|
|
39
39
|
import {
|
|
40
40
|
Anthropic
|
|
41
|
-
} from "./cli-
|
|
41
|
+
} from "./cli-zy7vwsne.js";
|
|
42
42
|
import {
|
|
43
43
|
AGENT_MAX_TASKS_CONFIG_KEY,
|
|
44
44
|
ALL_CAPABILITIES,
|
|
@@ -335,13 +335,13 @@ import {
|
|
|
335
335
|
workflowModelErrors,
|
|
336
336
|
workflowSaveWarnings,
|
|
337
337
|
writeUnhandledError
|
|
338
|
-
} from "./cli-
|
|
339
|
-
import"./cli-
|
|
338
|
+
} from "./cli-df56tqdw.js";
|
|
339
|
+
import"./cli-xvc3q9br.js";
|
|
340
340
|
import {
|
|
341
341
|
AMP_ESTIMATE_MODELS,
|
|
342
342
|
ampBillsCacheWrites,
|
|
343
343
|
resolveAmpModel
|
|
344
|
-
} from "./cli-
|
|
344
|
+
} from "./cli-mv2520nm.js";
|
|
345
345
|
import {
|
|
346
346
|
RATING_MODEL_MAX_LENGTH,
|
|
347
347
|
REFERENCES_SOURCE_MAX_LENGTH,
|
|
@@ -350,16 +350,16 @@ import {
|
|
|
350
350
|
import {
|
|
351
351
|
isMultiRuntimeEnabled
|
|
352
352
|
} from "./cli-re8z5p8p.js";
|
|
353
|
-
import"./cli-
|
|
353
|
+
import"./cli-0nhdwxd5.js";
|
|
354
354
|
import {
|
|
355
355
|
deleteModelCatalogOverlay,
|
|
356
356
|
loadModelsCatalog,
|
|
357
357
|
requestModelCatalogRefresh,
|
|
358
358
|
upsertModelCatalogOverlay
|
|
359
|
-
} from "./cli-
|
|
359
|
+
} from "./cli-rggdq8wq.js";
|
|
360
360
|
import {
|
|
361
361
|
normalizeModelKey
|
|
362
|
-
} from "./cli-
|
|
362
|
+
} from "./cli-ysnyhws9.js";
|
|
363
363
|
import {
|
|
364
364
|
ConnectionAuthInputSchema,
|
|
365
365
|
MAX_SCRIPT_WALL_CLOCK_MS,
|
|
@@ -381,11 +381,8 @@ import {
|
|
|
381
381
|
connectionAuthSummary,
|
|
382
382
|
consumeMcpOAuthPending,
|
|
383
383
|
createApprovalFollowUpTask,
|
|
384
|
-
createScriptApi,
|
|
385
384
|
definitionNodeIds,
|
|
386
385
|
deleteMcpOAuthToken,
|
|
387
|
-
deleteScript,
|
|
388
|
-
deleteScriptApi,
|
|
389
386
|
discoverAuthorizationServerMetadata,
|
|
390
387
|
discoverProtectedResourceMetadata,
|
|
391
388
|
ensureMcpToken,
|
|
@@ -400,13 +397,9 @@ import {
|
|
|
400
397
|
getCredentialBindingById,
|
|
401
398
|
getMcpOAuthToken,
|
|
402
399
|
getOAuthBindingTokenStatus,
|
|
403
|
-
getScript,
|
|
404
|
-
getScriptApiById,
|
|
405
400
|
getScriptApiConnectionDescriptors,
|
|
406
|
-
getScriptApiSecret,
|
|
407
401
|
getScriptApiTypes,
|
|
408
402
|
getScriptAppTypes,
|
|
409
|
-
getScriptById,
|
|
410
403
|
getScriptConnectionById,
|
|
411
404
|
getScriptMcpConnectionDescriptors,
|
|
412
405
|
getScriptMcpTypes,
|
|
@@ -415,27 +408,21 @@ import {
|
|
|
415
408
|
isInvalidClientError,
|
|
416
409
|
listAppRecords,
|
|
417
410
|
listRelationalCredentialBindings,
|
|
418
|
-
listScriptApisForScript,
|
|
419
411
|
listScriptConnections,
|
|
420
412
|
listScriptConnectionsAsync,
|
|
421
|
-
listScriptVersions,
|
|
422
|
-
listScripts,
|
|
423
413
|
listVendoredOpenapiEntries,
|
|
424
414
|
markMcpOAuthTokenStatus,
|
|
425
415
|
normalizeTokenEndpointAuthMethod,
|
|
426
416
|
oauthAppToProviderConfig,
|
|
427
417
|
publicEndpointSsrfOptions,
|
|
428
418
|
readStreamCapped,
|
|
429
|
-
recordScriptApiUsage,
|
|
430
419
|
refreshMcpToken,
|
|
431
420
|
refreshScriptConnection,
|
|
432
421
|
registerClient,
|
|
433
422
|
require_dist,
|
|
434
423
|
require_typescript,
|
|
435
424
|
resolveAdvertisedTokenEndpointAuthMethod,
|
|
436
|
-
restoreScratchScriptLastUsedIfUnchanged,
|
|
437
425
|
revokeMcpToken,
|
|
438
|
-
rotateScriptApiSecret,
|
|
439
426
|
runScript,
|
|
440
427
|
sandboxSpawnEnv,
|
|
441
428
|
scriptSdkTypesWithGeneratedApis,
|
|
@@ -443,16 +430,13 @@ import {
|
|
|
443
430
|
selectDcrTokenEndpointAuthMethod,
|
|
444
431
|
setMcpServerAuthMethod,
|
|
445
432
|
setScriptConnectionEnabled,
|
|
446
|
-
touchScratchScriptLastUsed,
|
|
447
433
|
typecheckScript,
|
|
448
434
|
typecheckWithAmbient,
|
|
449
|
-
updateScriptApi,
|
|
450
435
|
upsertCredentialBinding,
|
|
451
436
|
upsertMcpOAuthToken,
|
|
452
|
-
upsertScriptByName,
|
|
453
437
|
upsertScriptConnection,
|
|
454
438
|
validateDefinition
|
|
455
|
-
} from "./cli-
|
|
439
|
+
} from "./cli-jvj6a0cv.js";
|
|
456
440
|
import"./cli-epan13p1.js";
|
|
457
441
|
import {
|
|
458
442
|
getApiKey
|
|
@@ -464,7 +448,7 @@ import {
|
|
|
464
448
|
signalProcessGroup,
|
|
465
449
|
terminateProcessGroup
|
|
466
450
|
} from "./cli-zt3w1cn1.js";
|
|
467
|
-
import"./cli-
|
|
451
|
+
import"./cli-f2n17zhp.js";
|
|
468
452
|
import {
|
|
469
453
|
CLIENT_ID,
|
|
470
454
|
MAX_CODEX_OAUTH_SLOT,
|
|
@@ -475,7 +459,7 @@ import {
|
|
|
475
459
|
getAccountId,
|
|
476
460
|
getValidCodexOAuth,
|
|
477
461
|
loadAllCodexOAuthSlots
|
|
478
|
-
} from "./cli-
|
|
462
|
+
} from "./cli-feh3dkah.js";
|
|
479
463
|
import"./cli-3dpj7atn.js";
|
|
480
464
|
import"./cli-2x0e561b.js";
|
|
481
465
|
import"./cli-pkke6geq.js";
|
|
@@ -488,46 +472,12 @@ import {
|
|
|
488
472
|
normalizeFilesError
|
|
489
473
|
} from "./cli-mzfth0bp.js";
|
|
490
474
|
import {
|
|
491
|
-
searchScripts
|
|
492
|
-
} from "./cli-jqt9hrnz.js";
|
|
493
|
-
import {
|
|
494
|
-
CANDIDATE_SET_MULTIPLIER,
|
|
495
|
-
EMBEDDING_DIMENSIONS,
|
|
496
|
-
MEMORY_KEY_MAX_LENGTH,
|
|
497
|
-
OpenAI,
|
|
498
|
-
getEmbeddingProvider,
|
|
499
|
-
getMemoryStore,
|
|
500
|
-
init_constants as init_constants2,
|
|
501
|
-
init_key_paths,
|
|
502
|
-
init_openai,
|
|
503
|
-
init_reranker,
|
|
504
|
-
rerank
|
|
505
|
-
} from "./cli-yhmwmv0g.js";
|
|
506
|
-
import"./cli-wfajtmf7.js";
|
|
507
|
-
import {
|
|
508
|
-
acquireOAuthRefreshLock,
|
|
509
475
|
buildAuthorizationUrl,
|
|
510
|
-
consumeOAuthPending,
|
|
511
|
-
createOAuthApp,
|
|
512
|
-
deleteAuthorizationById,
|
|
513
|
-
deleteAuthorizationsForApp,
|
|
514
|
-
deleteOAuthTokens,
|
|
515
476
|
exchangeAuthorizationCode,
|
|
516
477
|
forceRefreshAuthorizationOrThrow,
|
|
517
478
|
forceRefreshTokenOrThrow,
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
getDefaultAuthorizationIdForProvider,
|
|
521
|
-
getOAuthApp,
|
|
522
|
-
getOAuthAppById,
|
|
523
|
-
getOAuthTokens,
|
|
524
|
-
listAuthorizationsForApp,
|
|
525
|
-
oauthAppRowToProviderConfig,
|
|
526
|
-
releaseOAuthRefreshLock,
|
|
527
|
-
updateAuthorizationIdentity,
|
|
528
|
-
updateOAuthAppById,
|
|
529
|
-
upsertAuthorization
|
|
530
|
-
} from "./cli-a87b04k8.js";
|
|
479
|
+
oauthAppRowToProviderConfig
|
|
480
|
+
} from "./cli-j2jbr8af.js";
|
|
531
481
|
import"./cli-fad8m16k.js";
|
|
532
482
|
import"./cli-bsakbbkm.js";
|
|
533
483
|
import"./cli-zxg80zs9.js";
|
|
@@ -552,10 +502,9 @@ import {
|
|
|
552
502
|
withRemoteContext,
|
|
553
503
|
withSpan,
|
|
554
504
|
withSpanContext
|
|
555
|
-
} from "./cli-
|
|
505
|
+
} from "./cli-ecknp7p1.js";
|
|
556
506
|
import"./cli-q51yprfq.js";
|
|
557
507
|
import"./cli-3er6gcsn.js";
|
|
558
|
-
import"./cli-cvk6yzw5.js";
|
|
559
508
|
import"./cli-yatxqynm.js";
|
|
560
509
|
import {
|
|
561
510
|
bedrockProviderModule
|
|
@@ -583,7 +532,7 @@ import"./cli-pzxba7gw.js";
|
|
|
583
532
|
import {
|
|
584
533
|
getUserGrant,
|
|
585
534
|
init_rbac_roles
|
|
586
|
-
} from "./cli-
|
|
535
|
+
} from "./cli-8kgvmkak.js";
|
|
587
536
|
import {
|
|
588
537
|
LEGACY_RULES,
|
|
589
538
|
can,
|
|
@@ -595,19 +544,24 @@ import {
|
|
|
595
544
|
} from "./cli-rfphkzh5.js";
|
|
596
545
|
import {
|
|
597
546
|
API_DRAINING_HEADER,
|
|
547
|
+
CANDIDATE_SET_MULTIPLIER,
|
|
598
548
|
CODEX_AUTH_WATCH_NAMESPACE,
|
|
599
549
|
CredentialBindingSchema,
|
|
600
550
|
DB_RETENTION_TUNING_BOUNDS,
|
|
551
|
+
EMBEDDING_DIMENSIONS,
|
|
601
552
|
EXTENSION_AGENT_ROLE,
|
|
602
553
|
ExtensionAgentAssignmentError,
|
|
603
554
|
HeartbeatExpiryError,
|
|
604
555
|
KvTypeCollisionError,
|
|
605
556
|
MAX_DB_RETENTION_DAYS,
|
|
557
|
+
MEMORY_KEY_MAX_LENGTH,
|
|
606
558
|
NOT_EXTENSION_AGENT_SQL,
|
|
559
|
+
OpenAI,
|
|
607
560
|
ReservedAgentRoleError,
|
|
608
561
|
SteeringRequestError,
|
|
609
562
|
_resolveIntegrationProvider,
|
|
610
563
|
_resolveIntegrationType,
|
|
564
|
+
acquireOAuthRefreshLock,
|
|
611
565
|
agentContextKey,
|
|
612
566
|
auditAssetKeys,
|
|
613
567
|
backfillSupersedeTaskResumeTaskId,
|
|
@@ -626,6 +580,7 @@ import {
|
|
|
626
580
|
completeTask,
|
|
627
581
|
computeContentHash,
|
|
628
582
|
configureOrgDomainPersistence,
|
|
583
|
+
consumeOAuthPending,
|
|
629
584
|
countActiveScriptRuns,
|
|
630
585
|
countAllMetrics,
|
|
631
586
|
countAllPages,
|
|
@@ -642,8 +597,10 @@ import {
|
|
|
642
597
|
createLogEntry,
|
|
643
598
|
createMcpServer,
|
|
644
599
|
createMetric,
|
|
600
|
+
createOAuthApp,
|
|
645
601
|
createPage,
|
|
646
602
|
createScheduledTask,
|
|
603
|
+
createScriptApi,
|
|
647
604
|
createScriptRun,
|
|
648
605
|
createSessionCost,
|
|
649
606
|
createSessionLogs,
|
|
@@ -655,14 +612,19 @@ import {
|
|
|
655
612
|
decryptSecret,
|
|
656
613
|
deleteActiveSession,
|
|
657
614
|
deleteActiveSessionById,
|
|
615
|
+
deleteAuthorizationById,
|
|
616
|
+
deleteAuthorizationsForApp,
|
|
658
617
|
deleteBudget,
|
|
659
618
|
deleteKv,
|
|
660
619
|
deleteMcpServer,
|
|
661
620
|
deleteMetric,
|
|
621
|
+
deleteOAuthTokens,
|
|
662
622
|
deletePage,
|
|
663
623
|
deletePricingRow,
|
|
664
624
|
deletePromptTemplate,
|
|
665
625
|
deleteScheduledTask,
|
|
626
|
+
deleteScript,
|
|
627
|
+
deleteScriptApi,
|
|
666
628
|
deleteSkill,
|
|
667
629
|
deleteSkillFile,
|
|
668
630
|
deleteSwarmConfig,
|
|
@@ -679,6 +641,7 @@ import {
|
|
|
679
641
|
encryptSecret,
|
|
680
642
|
extensionAgentAssignmentError,
|
|
681
643
|
failTask,
|
|
644
|
+
gcOAuthPending,
|
|
682
645
|
getActivePricingRow,
|
|
683
646
|
getActiveSessions,
|
|
684
647
|
getAgentById,
|
|
@@ -699,6 +662,7 @@ import {
|
|
|
699
662
|
getAllUsers,
|
|
700
663
|
getApprovalRequestById,
|
|
701
664
|
getAttributionByPerson,
|
|
665
|
+
getAuthorizationById,
|
|
702
666
|
getAvailableKeyIndices,
|
|
703
667
|
getBudget,
|
|
704
668
|
getBudgets,
|
|
@@ -710,6 +674,8 @@ import {
|
|
|
710
674
|
getDashboardCostSummary,
|
|
711
675
|
getDb,
|
|
712
676
|
getDbClient,
|
|
677
|
+
getDefaultAuthorizationIdForProvider,
|
|
678
|
+
getEmbeddingProvider,
|
|
713
679
|
getEncryptionKey,
|
|
714
680
|
getInboxSummary,
|
|
715
681
|
getInstanceActivity,
|
|
@@ -723,9 +689,13 @@ import {
|
|
|
723
689
|
getLogsByAgentId,
|
|
724
690
|
getLogsByTaskId,
|
|
725
691
|
getMcpServerById,
|
|
692
|
+
getMemoryStore,
|
|
726
693
|
getMetric,
|
|
727
694
|
getMetricVersion,
|
|
728
695
|
getMetricVersions,
|
|
696
|
+
getOAuthApp,
|
|
697
|
+
getOAuthAppById,
|
|
698
|
+
getOAuthTokens,
|
|
729
699
|
getOfferedTasksForAgent,
|
|
730
700
|
getPage,
|
|
731
701
|
getPageBySlug,
|
|
@@ -750,8 +720,13 @@ import {
|
|
|
750
720
|
getScheduledTaskById,
|
|
751
721
|
getScheduledTaskByName,
|
|
752
722
|
getScheduledTasks,
|
|
723
|
+
getScript,
|
|
724
|
+
getScriptApiById,
|
|
725
|
+
getScriptApiSecret,
|
|
726
|
+
getScriptById,
|
|
753
727
|
getScriptRun,
|
|
754
728
|
getScriptRunByIdempotencyKey,
|
|
729
|
+
getScriptRunExecutionArgs,
|
|
755
730
|
getScriptRunJournalStep,
|
|
756
731
|
getServicesByAgentId,
|
|
757
732
|
getSessionCostSummary,
|
|
@@ -793,16 +768,25 @@ import {
|
|
|
793
768
|
init_api_drain,
|
|
794
769
|
init_asset_key_audit,
|
|
795
770
|
init_codex_auth_failure,
|
|
771
|
+
init_constants as init_constants2,
|
|
796
772
|
init_context_key,
|
|
797
773
|
init_credential_broker,
|
|
798
774
|
init_crypto,
|
|
799
775
|
init_date_utils,
|
|
800
776
|
init_db,
|
|
777
|
+
init_db1 as init_db2,
|
|
801
778
|
init_default_drift,
|
|
779
|
+
init_embeddings,
|
|
802
780
|
init_heartbeat_expiry,
|
|
803
781
|
init_human_free,
|
|
782
|
+
init_key_paths,
|
|
783
|
+
init_memory,
|
|
784
|
+
init_oauth,
|
|
785
|
+
init_openai,
|
|
804
786
|
init_request_auth_context,
|
|
787
|
+
init_reranker,
|
|
805
788
|
init_runtime,
|
|
789
|
+
init_secret_registry,
|
|
806
790
|
init_steering,
|
|
807
791
|
init_swarm_config_guard,
|
|
808
792
|
init_task_tool_manifest,
|
|
@@ -828,6 +812,7 @@ import {
|
|
|
828
812
|
listApprovalRequestSummaries,
|
|
829
813
|
listApprovalRequests,
|
|
830
814
|
listAssetSummaries,
|
|
815
|
+
listAuthorizationsForApp,
|
|
831
816
|
listFavorites,
|
|
832
817
|
listInboxState,
|
|
833
818
|
listKv,
|
|
@@ -835,13 +820,17 @@ import {
|
|
|
835
820
|
listMetricsByAgent,
|
|
836
821
|
listPagesByAgent,
|
|
837
822
|
listRecentSessions,
|
|
823
|
+
listScriptApisForScript,
|
|
838
824
|
listScriptRunJournalSteps,
|
|
839
825
|
listScriptRuns,
|
|
826
|
+
listScriptVersions,
|
|
827
|
+
listScripts,
|
|
840
828
|
listSkillFileManifest,
|
|
841
829
|
listSkills,
|
|
842
830
|
listTaskTemplates,
|
|
843
831
|
listWorkflowRunsPage,
|
|
844
832
|
listWorkflows,
|
|
833
|
+
loadSecretRegistry,
|
|
845
834
|
markKeyRateLimited,
|
|
846
835
|
markSteeringDelivered,
|
|
847
836
|
markSteeringHandled,
|
|
@@ -862,9 +851,12 @@ import {
|
|
|
862
851
|
recordKeyRateLimitWindows,
|
|
863
852
|
recordKeySeatMismatch,
|
|
864
853
|
recordKeyUsage,
|
|
854
|
+
recordScriptApiUsage,
|
|
865
855
|
recordTaskProviderIfUnset,
|
|
866
856
|
refreshActiveSessionOnActivity,
|
|
857
|
+
releaseOAuthRefreshLock,
|
|
867
858
|
requestSteering,
|
|
859
|
+
rerank,
|
|
868
860
|
reservedKeyError,
|
|
869
861
|
resetEmptyPollCount,
|
|
870
862
|
resetOrphanedInProgressTasksForAgent,
|
|
@@ -872,7 +864,10 @@ import {
|
|
|
872
864
|
resolveApprovalRequest,
|
|
873
865
|
resolvePromptTemplate,
|
|
874
866
|
resolveTriggerSurface,
|
|
867
|
+
restoreScratchScriptLastUsedIfUnchanged,
|
|
875
868
|
resumeTask,
|
|
869
|
+
rotateScriptApiSecret,
|
|
870
|
+
searchScripts,
|
|
876
871
|
searchSkills,
|
|
877
872
|
selectTaskTools,
|
|
878
873
|
setAgentHarnessProvider,
|
|
@@ -887,6 +882,7 @@ import {
|
|
|
887
882
|
supersedeTask,
|
|
888
883
|
sweepExpiredKv,
|
|
889
884
|
telemetry,
|
|
885
|
+
touchScratchScriptLastUsed,
|
|
890
886
|
uninstallMcpServer,
|
|
891
887
|
uninstallSkill,
|
|
892
888
|
updateActiveSessionProviderSessionId,
|
|
@@ -900,9 +896,12 @@ import {
|
|
|
900
896
|
updateAgentProvider,
|
|
901
897
|
updateAgentStatus,
|
|
902
898
|
updateAgentStatusFromCapacity,
|
|
899
|
+
updateAuthorizationIdentity,
|
|
903
900
|
updateMetric,
|
|
901
|
+
updateOAuthAppById,
|
|
904
902
|
updatePage,
|
|
905
903
|
updateScheduledTask,
|
|
904
|
+
updateScriptApi,
|
|
906
905
|
updateScriptRun,
|
|
907
906
|
updateScriptRunIfNotTerminal,
|
|
908
907
|
updateScriptRunIfRunning,
|
|
@@ -913,18 +912,20 @@ import {
|
|
|
913
912
|
updateTaskVcs,
|
|
914
913
|
updateUser,
|
|
915
914
|
upsertAssetKeyMapping,
|
|
915
|
+
upsertAuthorization,
|
|
916
916
|
upsertBudget,
|
|
917
917
|
upsertChannelActivityCursor,
|
|
918
918
|
upsertInboxState,
|
|
919
919
|
upsertKv,
|
|
920
920
|
upsertPromptTemplate,
|
|
921
|
+
upsertScriptByName,
|
|
921
922
|
upsertScriptRunJournalStep,
|
|
922
923
|
upsertSkillFile,
|
|
923
924
|
upsertSkillFiles,
|
|
924
925
|
upsertSwarmConfig,
|
|
925
926
|
validateConfigValue,
|
|
926
927
|
withFavoriteFlags
|
|
927
|
-
} from "./cli-
|
|
928
|
+
} from "./cli-yshaazs1.js";
|
|
928
929
|
import {
|
|
929
930
|
ActiveSessionSchema,
|
|
930
931
|
AgentAcpStatusSchema,
|
|
@@ -1051,13 +1052,13 @@ import {
|
|
|
1051
1052
|
isSafeBundlePath,
|
|
1052
1053
|
isTerminalTaskStatus,
|
|
1053
1054
|
splitLegacyModelAlias
|
|
1054
|
-
} from "./cli-
|
|
1055
|
+
} from "./cli-xvdgasgy.js";
|
|
1055
1056
|
import"./cli-3qhyh31j.js";
|
|
1056
1057
|
import {
|
|
1057
1058
|
IDENTITY_FIELD_BUDGETS,
|
|
1058
1059
|
IdentityFieldBudgetError,
|
|
1059
1060
|
init_identity_field_budget
|
|
1060
|
-
} from "./cli-
|
|
1061
|
+
} from "./cli-jhm6hzjn.js";
|
|
1061
1062
|
import {
|
|
1062
1063
|
init_steering_enabled,
|
|
1063
1064
|
isSteeringEnabled
|
|
@@ -1124,21 +1125,22 @@ import {
|
|
|
1124
1125
|
import {
|
|
1125
1126
|
init_package,
|
|
1126
1127
|
package_default
|
|
1127
|
-
} from "./cli-
|
|
1128
|
+
} from "./cli-4r1sjfc4.js";
|
|
1128
1129
|
import {
|
|
1129
1130
|
init_event_bus,
|
|
1130
1131
|
workflowEventBus
|
|
1131
|
-
} from "./cli-
|
|
1132
|
+
} from "./cli-mb75wpxf.js";
|
|
1132
1133
|
import {
|
|
1133
1134
|
init_bus,
|
|
1134
1135
|
realtimeBus
|
|
1135
1136
|
} from "./cli-zf8jjwex.js";
|
|
1136
1137
|
import {
|
|
1138
|
+
findSecretsIn,
|
|
1137
1139
|
init_secret_scrubber,
|
|
1138
1140
|
registerVolatileSecret,
|
|
1139
1141
|
scrubObject,
|
|
1140
1142
|
scrubSecrets
|
|
1141
|
-
} from "./cli-
|
|
1143
|
+
} from "./cli-wt7ccy4r.js";
|
|
1142
1144
|
import {
|
|
1143
1145
|
__require,
|
|
1144
1146
|
__toESM
|
|
@@ -1193,13 +1195,13 @@ setBedrockProviderModule(bedrockProviderModule);
|
|
|
1193
1195
|
import {
|
|
1194
1196
|
createServer as createHttpServer
|
|
1195
1197
|
} from "node:http";
|
|
1196
|
-
|
|
1198
|
+
init_db2();
|
|
1197
1199
|
|
|
1198
1200
|
// src/be/db-retention.ts
|
|
1199
1201
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
1200
1202
|
init_env_flag();
|
|
1201
1203
|
init_secret_scrubber();
|
|
1202
|
-
|
|
1204
|
+
init_db2();
|
|
1203
1205
|
init_swarm_config_guard();
|
|
1204
1206
|
var DAY_MS = 24 * 60 * 60 * 1000;
|
|
1205
1207
|
var RETENTION_INTERVAL_MS = 60 * 60 * 1000;
|
|
@@ -1750,7 +1752,7 @@ function stopHumanFreeDrain() {
|
|
|
1750
1752
|
}
|
|
1751
1753
|
|
|
1752
1754
|
// src/be/scripts/retention.ts
|
|
1753
|
-
|
|
1755
|
+
init_db2();
|
|
1754
1756
|
var SCRATCH_RETENTION_DAYS = 14;
|
|
1755
1757
|
var SCRATCH_GC_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
|
1756
1758
|
var scratchGcTimer = null;
|
|
@@ -1857,8 +1859,11 @@ function stopScratchScriptGc() {
|
|
|
1857
1859
|
scratchGcTimer = null;
|
|
1858
1860
|
}
|
|
1859
1861
|
|
|
1862
|
+
// src/http/index.ts
|
|
1863
|
+
init_secret_registry();
|
|
1864
|
+
|
|
1860
1865
|
// src/be/seed-capabilities.ts
|
|
1861
|
-
|
|
1866
|
+
init_db2();
|
|
1862
1867
|
var LEGACY_ALWAYS_ON_DEFAULTS = [
|
|
1863
1868
|
"core",
|
|
1864
1869
|
"config",
|
|
@@ -1893,7 +1898,7 @@ async function seedLegacyCapabilitiesConfig() {
|
|
|
1893
1898
|
}
|
|
1894
1899
|
|
|
1895
1900
|
// src/queue-stall-alarm.ts
|
|
1896
|
-
|
|
1901
|
+
init_db2();
|
|
1897
1902
|
init_secret_scrubber();
|
|
1898
1903
|
var QUEUE_STALL_THRESHOLD_MS = 30 * 60 * 1000;
|
|
1899
1904
|
var QUEUE_STALL_CHECK_INTERVAL_MS = 5 * 60 * 1000;
|
|
@@ -2054,7 +2059,7 @@ init_bus();
|
|
|
2054
2059
|
|
|
2055
2060
|
// src/realtime/transport.ts
|
|
2056
2061
|
init_zod();
|
|
2057
|
-
|
|
2062
|
+
init_db2();
|
|
2058
2063
|
init_secret_scrubber();
|
|
2059
2064
|
init_bus();
|
|
2060
2065
|
|
|
@@ -2471,7 +2476,8 @@ function connect(ws, auth) {
|
|
|
2471
2476
|
}
|
|
2472
2477
|
|
|
2473
2478
|
// src/script-workflows/supervisor.ts
|
|
2474
|
-
|
|
2479
|
+
init_db2();
|
|
2480
|
+
init_secret_scrubber();
|
|
2475
2481
|
|
|
2476
2482
|
// src/script-workflows/executor.ts
|
|
2477
2483
|
import { randomUUID } from "node:crypto";
|
|
@@ -3315,7 +3321,9 @@ async function startScriptRunProcess(run, baseUrl, apiKeyOverride) {
|
|
|
3315
3321
|
if (process.env.SCRIPT_WORKFLOW_DEBUG === "true") {
|
|
3316
3322
|
console.error(`[script-workflows] spawning ${run.id} auth override=${apiKeyOverride ? "yes" : "no"} len=${apiKey.length}`);
|
|
3317
3323
|
}
|
|
3318
|
-
const
|
|
3324
|
+
const sealedArgs = await getScriptRunExecutionArgs(run.id);
|
|
3325
|
+
const args = sealedArgs === undefined ? run.args : sealedArgs;
|
|
3326
|
+
const execution = await scriptExecutor.start({ run: { ...run, args }, baseUrl, apiKey });
|
|
3319
3327
|
managed.set(run.id, { execution });
|
|
3320
3328
|
await updateScriptRun(run.id, {
|
|
3321
3329
|
status: "running",
|
|
@@ -3326,7 +3334,7 @@ async function startScriptRunProcess(run, baseUrl, apiKeyOverride) {
|
|
|
3326
3334
|
const current = await getScriptRun(run.id);
|
|
3327
3335
|
if (current && current.status === "running") {
|
|
3328
3336
|
if (exitCode !== 0) {
|
|
3329
|
-
console.error(`[script-workflows] run ${run.id} subprocess exited ${exitCode}: ${stderr.trim() || "(no stderr)"}`);
|
|
3337
|
+
console.error(scrubSecrets(`[script-workflows] run ${run.id} subprocess exited ${exitCode}: ${stderr.trim() || "(no stderr)"}`));
|
|
3330
3338
|
}
|
|
3331
3339
|
await updateScriptRunIfRunning(run.id, {
|
|
3332
3340
|
status: exitCode === 0 ? "completed" : "failed",
|
|
@@ -3564,7 +3572,7 @@ init_secret_scrubber();
|
|
|
3564
3572
|
|
|
3565
3573
|
// src/http/active-sessions.ts
|
|
3566
3574
|
init_zod();
|
|
3567
|
-
|
|
3575
|
+
init_db2();
|
|
3568
3576
|
init_types();
|
|
3569
3577
|
var listActiveSessions = route({
|
|
3570
3578
|
method: "get",
|
|
@@ -3767,7 +3775,7 @@ async function handleActiveSessions(req, res, pathSegments, queryParams, myAgent
|
|
|
3767
3775
|
// src/http/agents.ts
|
|
3768
3776
|
init_src();
|
|
3769
3777
|
init_zod();
|
|
3770
|
-
|
|
3778
|
+
init_db2();
|
|
3771
3779
|
init_telemetry();
|
|
3772
3780
|
init_types();
|
|
3773
3781
|
init_constants();
|
|
@@ -4847,7 +4855,7 @@ async function handleAgentsRest(req, res, pathSegments, queryParams, _myAgentId)
|
|
|
4847
4855
|
|
|
4848
4856
|
// src/http/api-keys.ts
|
|
4849
4857
|
init_zod();
|
|
4850
|
-
|
|
4858
|
+
init_db2();
|
|
4851
4859
|
init_model_rate_limit_windows();
|
|
4852
4860
|
init_subscription_plans();
|
|
4853
4861
|
|
|
@@ -5501,7 +5509,7 @@ async function handleApiKeys(req, res, pathSegments, queryParams) {
|
|
|
5501
5509
|
|
|
5502
5510
|
// src/http/approval-requests.ts
|
|
5503
5511
|
init_zod();
|
|
5504
|
-
|
|
5512
|
+
init_db2();
|
|
5505
5513
|
init_rbac();
|
|
5506
5514
|
init_request_auth_context();
|
|
5507
5515
|
init_event_bus();
|
|
@@ -6066,13 +6074,14 @@ async function approvalQuorumMet(approvers, votes) {
|
|
|
6066
6074
|
// src/http/assets.ts
|
|
6067
6075
|
init_zod();
|
|
6068
6076
|
init_asset_key_audit();
|
|
6077
|
+
init_db2();
|
|
6069
6078
|
init_db();
|
|
6070
6079
|
init_rbac();
|
|
6071
6080
|
init_types();
|
|
6072
6081
|
init_request_auth_context();
|
|
6073
6082
|
|
|
6074
6083
|
// src/http/request-principal.ts
|
|
6075
|
-
|
|
6084
|
+
init_db2();
|
|
6076
6085
|
init_request_auth_context();
|
|
6077
6086
|
async function requestPrincipal(req, myAgentId) {
|
|
6078
6087
|
const auth = getRequestAuth(req);
|
|
@@ -6406,7 +6415,7 @@ async function handleAssets(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
6406
6415
|
|
|
6407
6416
|
// src/http/budgets.ts
|
|
6408
6417
|
init_zod();
|
|
6409
|
-
|
|
6418
|
+
init_db2();
|
|
6410
6419
|
init_types();
|
|
6411
6420
|
init_secret_scrubber();
|
|
6412
6421
|
import { createHash } from "node:crypto";
|
|
@@ -6569,14 +6578,37 @@ async function handleBudgets(req, res, pathSegments, queryParams, _myAgentId) {
|
|
|
6569
6578
|
// src/http/codex-oauth-device.ts
|
|
6570
6579
|
init_zod();
|
|
6571
6580
|
init_crypto();
|
|
6572
|
-
|
|
6581
|
+
init_db2();
|
|
6582
|
+
|
|
6583
|
+
// src/be/db/codex-oauth-device-flows.ts
|
|
6584
|
+
init_runtime();
|
|
6585
|
+
async function getCodexDeviceFlow(flowId) {
|
|
6586
|
+
const row = await getDbClient().get("SELECT state, expires_at FROM codex_oauth_device_flows WHERE flow_id = ?", [flowId]);
|
|
6587
|
+
if (!row)
|
|
6588
|
+
return null;
|
|
6589
|
+
if (row.expires_at <= Date.now()) {
|
|
6590
|
+
await getDbClient().run("DELETE FROM codex_oauth_device_flows WHERE flow_id = ?", [flowId]);
|
|
6591
|
+
return null;
|
|
6592
|
+
}
|
|
6593
|
+
return { state: row.state, expiresAt: row.expires_at };
|
|
6594
|
+
}
|
|
6595
|
+
async function upsertCodexDeviceFlow(input) {
|
|
6596
|
+
const now = Date.now();
|
|
6597
|
+
await getDbClient().run("DELETE FROM codex_oauth_device_flows WHERE expires_at <= ?", [now]);
|
|
6598
|
+
await getDbClient().run(`INSERT INTO codex_oauth_device_flows (flow_id, state, expires_at, created_at, updated_at)
|
|
6599
|
+
VALUES (?, ?, ?, ?, ?)
|
|
6600
|
+
ON CONFLICT(flow_id) DO UPDATE SET
|
|
6601
|
+
state = excluded.state,
|
|
6602
|
+
expires_at = excluded.expires_at,
|
|
6603
|
+
updated_at = excluded.updated_at`, [input.flowId, input.state, input.expiresAt, now, now]);
|
|
6604
|
+
}
|
|
6573
6605
|
|
|
6574
6606
|
// src/be/onboarding.ts
|
|
6575
6607
|
init_telemetry();
|
|
6576
6608
|
init_types();
|
|
6577
6609
|
init_request_auth_context();
|
|
6578
6610
|
init_zod_openapi();
|
|
6579
|
-
|
|
6611
|
+
init_db2();
|
|
6580
6612
|
init_swarm_config_guard();
|
|
6581
6613
|
var ONBOARDING_CONFIG_KEY = "onboarding_state";
|
|
6582
6614
|
var OnboardingStepIdSchema = exports_zod.enum([
|
|
@@ -7185,7 +7217,7 @@ init_secret_scrubber();
|
|
|
7185
7217
|
|
|
7186
7218
|
// src/http/config.ts
|
|
7187
7219
|
init_zod();
|
|
7188
|
-
|
|
7220
|
+
init_db2();
|
|
7189
7221
|
init_rbac_roles();
|
|
7190
7222
|
init_swarm_config_guard();
|
|
7191
7223
|
init_rbac();
|
|
@@ -7568,7 +7600,6 @@ async function handleConfig(req, res, pathSegments, queryParams) {
|
|
|
7568
7600
|
}
|
|
7569
7601
|
|
|
7570
7602
|
// src/http/codex-oauth-device.ts
|
|
7571
|
-
var FLOW_NAMESPACE = "codex-oauth-device";
|
|
7572
7603
|
var FLOW_TTL_MS = 15 * 60 * 1000;
|
|
7573
7604
|
var POLL_LEASE_MS = 45000;
|
|
7574
7605
|
var FlowStateSchema = exports_external.object({
|
|
@@ -7628,11 +7659,11 @@ function registerFlowSecrets(state) {
|
|
|
7628
7659
|
registerVolatileSecret(state.userCode, "codex-device-user-code");
|
|
7629
7660
|
}
|
|
7630
7661
|
async function readFlow(flowId) {
|
|
7631
|
-
const entry = await
|
|
7632
|
-
if (!entry
|
|
7662
|
+
const entry = await getCodexDeviceFlow(flowId);
|
|
7663
|
+
if (!entry)
|
|
7633
7664
|
return null;
|
|
7634
7665
|
try {
|
|
7635
|
-
const plaintext = decryptSecret(entry.
|
|
7666
|
+
const plaintext = decryptSecret(entry.state, getEncryptionKey());
|
|
7636
7667
|
const parsed = FlowStateSchema.safeParse(JSON.parse(plaintext));
|
|
7637
7668
|
if (!parsed.success)
|
|
7638
7669
|
return null;
|
|
@@ -7643,11 +7674,9 @@ async function readFlow(flowId) {
|
|
|
7643
7674
|
}
|
|
7644
7675
|
}
|
|
7645
7676
|
async function writeFlow(flowId, state) {
|
|
7646
|
-
await
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
value: encryptSecret(JSON.stringify(state), getEncryptionKey()),
|
|
7650
|
-
valueType: "string",
|
|
7677
|
+
await upsertCodexDeviceFlow({
|
|
7678
|
+
flowId,
|
|
7679
|
+
state: encryptSecret(JSON.stringify(state), getEncryptionKey()),
|
|
7651
7680
|
expiresAt: state.expiresAt
|
|
7652
7681
|
});
|
|
7653
7682
|
}
|
|
@@ -7857,7 +7886,7 @@ async function handleCodexOAuthDevice(req, res, pathSegments, queryParams) {
|
|
|
7857
7886
|
|
|
7858
7887
|
// src/http/codex-oauth-keep-warm.ts
|
|
7859
7888
|
init_zod();
|
|
7860
|
-
|
|
7889
|
+
init_db2();
|
|
7861
7890
|
init_codex_auth_failure();
|
|
7862
7891
|
init_constants();
|
|
7863
7892
|
var KEEP_WARM_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1000;
|
|
@@ -7931,7 +7960,7 @@ async function handleCodexOAuthKeepWarm(req, res, pathSegments) {
|
|
|
7931
7960
|
init_zod();
|
|
7932
7961
|
|
|
7933
7962
|
// src/comb/review-batch.ts
|
|
7934
|
-
|
|
7963
|
+
init_db2();
|
|
7935
7964
|
init_resolver();
|
|
7936
7965
|
init_constants();
|
|
7937
7966
|
init_secret_scrubber();
|
|
@@ -8372,7 +8401,7 @@ async function handleComb(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
8372
8401
|
|
|
8373
8402
|
// src/http/context.ts
|
|
8374
8403
|
init_zod();
|
|
8375
|
-
|
|
8404
|
+
init_db2();
|
|
8376
8405
|
init_types();
|
|
8377
8406
|
var PostContextResponseSchema = exports_external.object({
|
|
8378
8407
|
ok: exports_external.literal(true),
|
|
@@ -8481,7 +8510,7 @@ async function handleContext(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
8481
8510
|
|
|
8482
8511
|
// src/http/ecosystem.ts
|
|
8483
8512
|
init_zod();
|
|
8484
|
-
|
|
8513
|
+
init_db2();
|
|
8485
8514
|
var EcosystemAppSchema = exports_external.object({
|
|
8486
8515
|
name: exports_external.string(),
|
|
8487
8516
|
script: exports_external.string(),
|
|
@@ -8731,7 +8760,7 @@ async function handleEvents(req, res, pathSegments, queryParams, _myAgentId) {
|
|
|
8731
8760
|
|
|
8732
8761
|
// src/http/extensions.ts
|
|
8733
8762
|
init_zod();
|
|
8734
|
-
|
|
8763
|
+
init_db2();
|
|
8735
8764
|
|
|
8736
8765
|
// src/be/extensions/validate.ts
|
|
8737
8766
|
init_bundle_path();
|
|
@@ -10773,7 +10802,7 @@ async function handleExtensions(req, res, pathSegments, queryParams, agentId) {
|
|
|
10773
10802
|
|
|
10774
10803
|
// src/http/favorites.ts
|
|
10775
10804
|
init_zod();
|
|
10776
|
-
|
|
10805
|
+
init_db2();
|
|
10777
10806
|
init_types();
|
|
10778
10807
|
var listFavorites2 = route({
|
|
10779
10808
|
method: "get",
|
|
@@ -10873,7 +10902,7 @@ async function handleFavorites(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
10873
10902
|
|
|
10874
10903
|
// src/http/fs.ts
|
|
10875
10904
|
init_zod();
|
|
10876
|
-
|
|
10905
|
+
init_db2();
|
|
10877
10906
|
init_rbac();
|
|
10878
10907
|
init_types();
|
|
10879
10908
|
|
|
@@ -11418,7 +11447,7 @@ async function handleHeartbeat(req, res, pathSegments) {
|
|
|
11418
11447
|
|
|
11419
11448
|
// src/http/inbox-state.ts
|
|
11420
11449
|
init_zod();
|
|
11421
|
-
|
|
11450
|
+
init_db2();
|
|
11422
11451
|
init_types();
|
|
11423
11452
|
var listState = route({
|
|
11424
11453
|
method: "get",
|
|
@@ -11628,7 +11657,7 @@ function buildSlackManifest(name) {
|
|
|
11628
11657
|
}
|
|
11629
11658
|
|
|
11630
11659
|
// src/http/config-values.ts
|
|
11631
|
-
|
|
11660
|
+
init_db2();
|
|
11632
11661
|
async function resolveConfigValue(key) {
|
|
11633
11662
|
const configs = await getResolvedConfig();
|
|
11634
11663
|
const variants = [key, key.toLowerCase(), key.toUpperCase()];
|
|
@@ -11761,7 +11790,7 @@ var handleIntegrations = createIntegrationsHandler();
|
|
|
11761
11790
|
|
|
11762
11791
|
// src/http/kv.ts
|
|
11763
11792
|
init_zod();
|
|
11764
|
-
|
|
11793
|
+
init_db2();
|
|
11765
11794
|
init_rbac();
|
|
11766
11795
|
init_context_key();
|
|
11767
11796
|
init_types();
|
|
@@ -13524,7 +13553,7 @@ class StreamableHTTPServerTransport {
|
|
|
13524
13553
|
}
|
|
13525
13554
|
|
|
13526
13555
|
// src/http/mcp.ts
|
|
13527
|
-
|
|
13556
|
+
init_db2();
|
|
13528
13557
|
init_env_flag();
|
|
13529
13558
|
init_request_auth_context();
|
|
13530
13559
|
init_task_tool_manifest();
|
|
@@ -13719,7 +13748,7 @@ async function handleMcp(req, res, transports, sessionActivity = {}, sessionAgen
|
|
|
13719
13748
|
|
|
13720
13749
|
// src/http/mcp-oauth.ts
|
|
13721
13750
|
init_zod();
|
|
13722
|
-
|
|
13751
|
+
init_db2();
|
|
13723
13752
|
init_types();
|
|
13724
13753
|
init_constants();
|
|
13725
13754
|
init_env_flag();
|
|
@@ -14461,7 +14490,7 @@ async function handleMcpOAuth(req, res, pathSegments, queryParams) {
|
|
|
14461
14490
|
|
|
14462
14491
|
// src/http/mcp-servers.ts
|
|
14463
14492
|
init_zod();
|
|
14464
|
-
|
|
14493
|
+
init_db2();
|
|
14465
14494
|
init_rbac_roles();
|
|
14466
14495
|
init_rbac();
|
|
14467
14496
|
init_types();
|
|
@@ -15162,11 +15191,12 @@ function closeIdleMcpUserTransports(transports, sessionUsers, sessionActivity, o
|
|
|
15162
15191
|
|
|
15163
15192
|
// src/http/memory.ts
|
|
15164
15193
|
init_zod();
|
|
15165
|
-
|
|
15194
|
+
init_db2();
|
|
15195
|
+
init_memory();
|
|
15166
15196
|
init_constants2();
|
|
15167
15197
|
|
|
15168
15198
|
// src/be/memory/edges-store.ts
|
|
15169
|
-
|
|
15199
|
+
init_db2();
|
|
15170
15200
|
var USEFULNESS_FLOOR = 1;
|
|
15171
15201
|
var USEFULNESS_CEILING = 2;
|
|
15172
15202
|
async function listEdgesForAgent(agentId, memoryId) {
|
|
@@ -15202,7 +15232,7 @@ init_key_paths();
|
|
|
15202
15232
|
init_reranker();
|
|
15203
15233
|
|
|
15204
15234
|
// src/be/memory/retrieval-store.ts
|
|
15205
|
-
|
|
15235
|
+
init_db2();
|
|
15206
15236
|
var RETRIEVAL_CONTENT_SNIPPET_CHARS = 500;
|
|
15207
15237
|
var RETRIEVAL_LIST_LIMIT = 50;
|
|
15208
15238
|
async function getRetrievalsForAgent(agentId, filter) {
|
|
@@ -15245,7 +15275,7 @@ async function hasRetrievalForTask(taskId, memoryId) {
|
|
|
15245
15275
|
}
|
|
15246
15276
|
|
|
15247
15277
|
// src/be/memory/usefulness-stats.ts
|
|
15248
|
-
|
|
15278
|
+
init_db2();
|
|
15249
15279
|
async function getUsefulnessStats(options = {}) {
|
|
15250
15280
|
const days = options.days ?? 30;
|
|
15251
15281
|
const threshold = options.threshold ?? 0.6;
|
|
@@ -16644,7 +16674,7 @@ function stopMemoryGc() {
|
|
|
16644
16674
|
|
|
16645
16675
|
// src/http/metrics.ts
|
|
16646
16676
|
init_zod();
|
|
16647
|
-
|
|
16677
|
+
init_db2();
|
|
16648
16678
|
init_types();
|
|
16649
16679
|
var DEFAULT_METRIC_MAX_ROWS = 100;
|
|
16650
16680
|
var HARD_METRIC_MAX_ROWS = 500;
|
|
@@ -17098,7 +17128,7 @@ async function handleMetrics(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
17098
17128
|
|
|
17099
17129
|
// src/http/models-catalog.ts
|
|
17100
17130
|
init_zod();
|
|
17101
|
-
|
|
17131
|
+
init_db2();
|
|
17102
17132
|
init_rbac();
|
|
17103
17133
|
init_types();
|
|
17104
17134
|
init_request_auth_context();
|
|
@@ -17410,9 +17440,11 @@ async function handleModelsCatalog(req, res, pathSegments, queryParams) {
|
|
|
17410
17440
|
|
|
17411
17441
|
// src/http/oauth-callback.ts
|
|
17412
17442
|
init_zod();
|
|
17413
|
-
|
|
17443
|
+
init_db2();
|
|
17444
|
+
init_oauth();
|
|
17414
17445
|
|
|
17415
17446
|
// src/jira/oauth.ts
|
|
17447
|
+
init_oauth();
|
|
17416
17448
|
var ACCESSIBLE_RESOURCES_URL = "https://api.atlassian.com/oauth/token/accessible-resources";
|
|
17417
17449
|
async function getJiraOAuthConfig() {
|
|
17418
17450
|
const app = await getOAuthApp("jira");
|
|
@@ -17453,7 +17485,8 @@ async function resolveAndStoreJiraCloudId(accessToken) {
|
|
|
17453
17485
|
}
|
|
17454
17486
|
|
|
17455
17487
|
// src/linear/oauth.ts
|
|
17456
|
-
|
|
17488
|
+
init_db2();
|
|
17489
|
+
init_oauth();
|
|
17457
17490
|
var APP_USER_ID_NAMESPACE = "integration:linear:bot-app-user-id";
|
|
17458
17491
|
async function getLinearOAuthConfig() {
|
|
17459
17492
|
const app = await getOAuthApp("linear");
|
|
@@ -17880,6 +17913,7 @@ async function handleGenericOAuth(req, res, pathSegments, queryParams) {
|
|
|
17880
17913
|
|
|
17881
17914
|
// src/http/oauth-locks.ts
|
|
17882
17915
|
init_zod();
|
|
17916
|
+
init_oauth();
|
|
17883
17917
|
var MAX_LOCK_TTL_MS = 5 * 60 * 1000;
|
|
17884
17918
|
var LOCK_KEY_PATTERN = /^[a-zA-Z0-9._:-]{1,200}$/;
|
|
17885
17919
|
var LockKeySchema = exports_external.object({ key: exports_external.string().regex(LOCK_KEY_PATTERN) });
|
|
@@ -17946,13 +17980,15 @@ async function handleOAuthLocks(req, res, pathSegments, queryParams) {
|
|
|
17946
17980
|
|
|
17947
17981
|
// src/http/onboarding.ts
|
|
17948
17982
|
init_openai();
|
|
17949
|
-
|
|
17983
|
+
init_db2();
|
|
17984
|
+
init_memory();
|
|
17950
17985
|
init_constants2();
|
|
17951
17986
|
init_types();
|
|
17952
17987
|
|
|
17953
17988
|
// src/http/status.ts
|
|
17954
17989
|
init_zod();
|
|
17955
|
-
|
|
17990
|
+
init_db2();
|
|
17991
|
+
init_memory();
|
|
17956
17992
|
init_config();
|
|
17957
17993
|
init_telemetry();
|
|
17958
17994
|
init_types();
|
|
@@ -18742,7 +18778,7 @@ async function handleOnboarding(req, res, pathSegments, queryParams) {
|
|
|
18742
18778
|
}
|
|
18743
18779
|
|
|
18744
18780
|
// src/http/page-proxy.ts
|
|
18745
|
-
|
|
18781
|
+
init_db2();
|
|
18746
18782
|
route({
|
|
18747
18783
|
method: "get",
|
|
18748
18784
|
path: "/@swarm/api/{path}",
|
|
@@ -18931,7 +18967,7 @@ async function handlePageProxy(req, res) {
|
|
|
18931
18967
|
// src/http/pages.ts
|
|
18932
18968
|
init_zod();
|
|
18933
18969
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
18934
|
-
|
|
18970
|
+
init_db2();
|
|
18935
18971
|
init_types();
|
|
18936
18972
|
init_constants();
|
|
18937
18973
|
init_request_auth_context();
|
|
@@ -19489,7 +19525,7 @@ async function handlePages(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
19489
19525
|
|
|
19490
19526
|
// src/http/pages-public.ts
|
|
19491
19527
|
init_zod();
|
|
19492
|
-
|
|
19528
|
+
init_db2();
|
|
19493
19529
|
init_types();
|
|
19494
19530
|
init_constants();
|
|
19495
19531
|
init_secret_scrubber();
|
|
@@ -19919,7 +19955,7 @@ async function bumpViewCount(pageId) {
|
|
|
19919
19955
|
|
|
19920
19956
|
// src/http/poll.ts
|
|
19921
19957
|
init_zod();
|
|
19922
|
-
|
|
19958
|
+
init_db2();
|
|
19923
19959
|
|
|
19924
19960
|
// src/slack/channel-activity.ts
|
|
19925
19961
|
var cachedBotUserId = null;
|
|
@@ -20484,7 +20520,7 @@ async function handlePoll(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
20484
20520
|
|
|
20485
20521
|
// src/http/pricing.ts
|
|
20486
20522
|
init_zod();
|
|
20487
|
-
|
|
20523
|
+
init_db2();
|
|
20488
20524
|
init_types();
|
|
20489
20525
|
init_secret_scrubber();
|
|
20490
20526
|
import { createHash as createHash2 } from "node:crypto";
|
|
@@ -20660,7 +20696,7 @@ async function handlePricing(req, res, pathSegments, queryParams, _myAgentId) {
|
|
|
20660
20696
|
|
|
20661
20697
|
// src/http/prompt-templates.ts
|
|
20662
20698
|
init_zod();
|
|
20663
|
-
|
|
20699
|
+
init_db2();
|
|
20664
20700
|
init_default_drift();
|
|
20665
20701
|
init_registry();
|
|
20666
20702
|
init_resolver();
|
|
@@ -21155,7 +21191,7 @@ async function handleRealtimeAsset(req, res) {
|
|
|
21155
21191
|
|
|
21156
21192
|
// src/http/repos.ts
|
|
21157
21193
|
init_zod();
|
|
21158
|
-
|
|
21194
|
+
init_db2();
|
|
21159
21195
|
init_rbac();
|
|
21160
21196
|
init_telemetry();
|
|
21161
21197
|
init_types();
|
|
@@ -21635,6 +21671,7 @@ async function handleRooms(req, res, pathSegments, queryParams) {
|
|
|
21635
21671
|
// src/http/schedules.ts
|
|
21636
21672
|
init_zod();
|
|
21637
21673
|
var import_cron_parser = __toESM(require_dist(), 1);
|
|
21674
|
+
init_db2();
|
|
21638
21675
|
init_db();
|
|
21639
21676
|
init_types();
|
|
21640
21677
|
var scheduleUpdateBodySchema = exports_external.object({
|
|
@@ -22223,7 +22260,7 @@ async function handleSchedules(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
22223
22260
|
|
|
22224
22261
|
// src/http/script-connection-proxy.ts
|
|
22225
22262
|
init_zod();
|
|
22226
|
-
|
|
22263
|
+
init_db2();
|
|
22227
22264
|
init_rbac();
|
|
22228
22265
|
var McpToolCallResultSchema = exports_external.object({
|
|
22229
22266
|
content: exports_external.array(exports_external.object({ type: exports_external.string(), text: exports_external.string().optional() })),
|
|
@@ -22332,7 +22369,8 @@ async function handleScriptConnectionProxy(req, res, pathSegments, queryParams,
|
|
|
22332
22369
|
// src/http/script-connections.ts
|
|
22333
22370
|
init_zod();
|
|
22334
22371
|
init_date_utils();
|
|
22335
|
-
|
|
22372
|
+
init_db2();
|
|
22373
|
+
init_oauth();
|
|
22336
22374
|
init_rbac();
|
|
22337
22375
|
init_credential_broker();
|
|
22338
22376
|
init_telemetry();
|
|
@@ -24227,7 +24265,25 @@ async function handleScriptConnections(req, res, pathSegments, queryParams, agen
|
|
|
24227
24265
|
|
|
24228
24266
|
// src/http/script-runs.ts
|
|
24229
24267
|
init_zod();
|
|
24230
|
-
|
|
24268
|
+
init_db2();
|
|
24269
|
+
|
|
24270
|
+
// src/be/scripts/source-secrets.ts
|
|
24271
|
+
init_secret_scrubber();
|
|
24272
|
+
function refuseSourceWithSecrets(source) {
|
|
24273
|
+
const { knownValues, gitleaksRules } = findSecretsIn(source);
|
|
24274
|
+
if (knownValues.length === 0 && gitleaksRules.length === 0)
|
|
24275
|
+
return null;
|
|
24276
|
+
const findings = [
|
|
24277
|
+
...knownValues.map((id) => ({ kind: "registered-secret", id })),
|
|
24278
|
+
...gitleaksRules.map((id) => ({ kind: "gitleaks-rule", id }))
|
|
24279
|
+
];
|
|
24280
|
+
const named = findings.map((f) => f.kind === "registered-secret" ? `registered secret ${f.id}` : `gitleaks rule ${f.id}`).join(", ");
|
|
24281
|
+
return {
|
|
24282
|
+
error: "source_contains_secret",
|
|
24283
|
+
message: `Script source contains a secret (${named}); nothing was saved or run. Source is stored and shown verbatim, so read secrets at run time instead: a credential binding (ctx.api.<slug> / ctx.mcp.<slug>) or ctx.swarm.config.get("<KEY>").`,
|
|
24284
|
+
findings
|
|
24285
|
+
};
|
|
24286
|
+
}
|
|
24231
24287
|
|
|
24232
24288
|
// src/script-workflows/label-lint.ts
|
|
24233
24289
|
var import_typescript = __toESM(require_typescript(), 1);
|
|
@@ -24300,6 +24356,7 @@ function lintWorkflowLabels(source) {
|
|
|
24300
24356
|
// src/http/script-runs.ts
|
|
24301
24357
|
init_types();
|
|
24302
24358
|
init_constants();
|
|
24359
|
+
init_secret_scrubber();
|
|
24303
24360
|
var DEFAULT_SCRIPT_RUN_CONCURRENCY_CAP = 10;
|
|
24304
24361
|
var runIdParamsSchema = exports_external.object({ runId: exports_external.string().uuid() });
|
|
24305
24362
|
var idParamsSchema3 = exports_external.object({ id: exports_external.string().uuid() });
|
|
@@ -24575,6 +24632,11 @@ async function handleScriptRuns(req, res, pathSegments, queryParams, agentId) {
|
|
|
24575
24632
|
const agent = await requireAgent(res, agentId);
|
|
24576
24633
|
if (!agent)
|
|
24577
24634
|
return true;
|
|
24635
|
+
const secretRefusal = refuseSourceWithSecrets(parsed.body.source);
|
|
24636
|
+
if (secretRefusal) {
|
|
24637
|
+
json(res, secretRefusal, 400);
|
|
24638
|
+
return true;
|
|
24639
|
+
}
|
|
24578
24640
|
const lint = lintWorkflowLabels(parsed.body.source);
|
|
24579
24641
|
if (!lint.ok) {
|
|
24580
24642
|
json(res, {
|
|
@@ -24728,7 +24790,7 @@ async function handleScriptRuns(req, res, pathSegments, queryParams, agentId) {
|
|
|
24728
24790
|
config: parsed.body.config ?? {},
|
|
24729
24791
|
status: parsed.body.status,
|
|
24730
24792
|
result: parsed.body.result,
|
|
24731
|
-
error: parsed.body.error,
|
|
24793
|
+
error: parsed.body.error === undefined ? undefined : scrubSecrets(parsed.body.error),
|
|
24732
24794
|
durationMs: parsed.body.durationMs
|
|
24733
24795
|
});
|
|
24734
24796
|
return assertRunWithinLimits(run.id);
|
|
@@ -24859,7 +24921,9 @@ async function handleScriptRuns(req, res, pathSegments, queryParams, agentId) {
|
|
|
24859
24921
|
|
|
24860
24922
|
// src/http/scripts.ts
|
|
24861
24923
|
init_zod();
|
|
24924
|
+
init_db2();
|
|
24862
24925
|
init_db();
|
|
24926
|
+
init_embeddings();
|
|
24863
24927
|
init_rbac();
|
|
24864
24928
|
init_types();
|
|
24865
24929
|
init_secret_scrubber();
|
|
@@ -25315,6 +25379,11 @@ async function handleScripts(req, res, pathSegments, queryParams, agentId) {
|
|
|
25315
25379
|
return true;
|
|
25316
25380
|
}
|
|
25317
25381
|
}
|
|
25382
|
+
const secretRefusal = refuseSourceWithSecrets(parsed.body.source);
|
|
25383
|
+
if (secretRefusal) {
|
|
25384
|
+
json(res, secretRefusal, 400);
|
|
25385
|
+
return true;
|
|
25386
|
+
}
|
|
25318
25387
|
const typecheck = await typecheckScript(parsed.body.source, { agentId: agent.id });
|
|
25319
25388
|
if (!typecheck.ok) {
|
|
25320
25389
|
json(res, {
|
|
@@ -25365,6 +25434,11 @@ async function handleScripts(req, res, pathSegments, queryParams, agentId) {
|
|
|
25365
25434
|
if (!agent)
|
|
25366
25435
|
return true;
|
|
25367
25436
|
const runtimeInstanceId = ((h) => Array.isArray(h) ? h[0] : h)(req.headers["x-runtime-instance-id"]);
|
|
25437
|
+
const secretRefusal = parsed.body.source ? refuseSourceWithSecrets(parsed.body.source) : null;
|
|
25438
|
+
if (secretRefusal) {
|
|
25439
|
+
json(res, secretRefusal, 400);
|
|
25440
|
+
return true;
|
|
25441
|
+
}
|
|
25368
25442
|
let source = parsed.body.source;
|
|
25369
25443
|
let fsMode = parsed.body.fsMode;
|
|
25370
25444
|
let namedScript = null;
|
|
@@ -25723,7 +25797,7 @@ async function handleScripts(req, res, pathSegments, queryParams, agentId) {
|
|
|
25723
25797
|
|
|
25724
25798
|
// src/http/session-data.ts
|
|
25725
25799
|
init_zod();
|
|
25726
|
-
|
|
25800
|
+
init_db2();
|
|
25727
25801
|
init_types();
|
|
25728
25802
|
|
|
25729
25803
|
// src/http/session-cost-recompute.ts
|
|
@@ -26260,7 +26334,7 @@ async function handleSessionData(req, res, pathSegments, queryParams, _myAgentId
|
|
|
26260
26334
|
|
|
26261
26335
|
// src/http/sessions.ts
|
|
26262
26336
|
init_zod();
|
|
26263
|
-
|
|
26337
|
+
init_db2();
|
|
26264
26338
|
init_steering();
|
|
26265
26339
|
init_types();
|
|
26266
26340
|
init_request_auth_context();
|
|
@@ -26481,11 +26555,11 @@ async function handleSessions(req, res, pathSegments, queryParams) {
|
|
|
26481
26555
|
|
|
26482
26556
|
// src/http/skills.ts
|
|
26483
26557
|
init_zod();
|
|
26484
|
-
|
|
26558
|
+
init_db2();
|
|
26485
26559
|
|
|
26486
26560
|
// src/be/skill-sync.ts
|
|
26487
26561
|
import { homedir } from "node:os";
|
|
26488
|
-
|
|
26562
|
+
init_db2();
|
|
26489
26563
|
async function syncSkillsToFilesystem(agentId, harnessType = "all", homeOverride) {
|
|
26490
26564
|
const skills = await getAgentSkills(agentId);
|
|
26491
26565
|
const home = homeOverride ?? homedir();
|
|
@@ -27257,7 +27331,7 @@ async function handleSkills(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
27257
27331
|
|
|
27258
27332
|
// src/http/stats.ts
|
|
27259
27333
|
init_zod();
|
|
27260
|
-
|
|
27334
|
+
init_db2();
|
|
27261
27335
|
init_steering();
|
|
27262
27336
|
init_types();
|
|
27263
27337
|
init_env_flag();
|
|
@@ -27520,7 +27594,7 @@ async function handleStats(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
27520
27594
|
|
|
27521
27595
|
// src/http/task-templates.ts
|
|
27522
27596
|
init_zod();
|
|
27523
|
-
|
|
27597
|
+
init_db2();
|
|
27524
27598
|
init_types();
|
|
27525
27599
|
var listTemplates = route({
|
|
27526
27600
|
method: "get",
|
|
@@ -27560,7 +27634,7 @@ async function handleTaskTemplates(req, res, pathSegments, queryParams) {
|
|
|
27560
27634
|
|
|
27561
27635
|
// src/http/tasks.ts
|
|
27562
27636
|
init_zod();
|
|
27563
|
-
|
|
27637
|
+
init_db2();
|
|
27564
27638
|
init_steering();
|
|
27565
27639
|
init_rbac();
|
|
27566
27640
|
init_types();
|
|
@@ -28995,6 +29069,7 @@ async function handleTasks(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
28995
29069
|
|
|
28996
29070
|
// src/http/trackers/jira.ts
|
|
28997
29071
|
init_zod();
|
|
29072
|
+
init_oauth();
|
|
28998
29073
|
var MANUAL_WEBHOOK_INSTRUCTIONS = "See docs-site/.../integrations/jira.mdx for manual webhook registration steps.";
|
|
28999
29074
|
var JiraWebhookIdEntrySchema = exports_external.object({
|
|
29000
29075
|
id: exports_external.number().int(),
|
|
@@ -29370,6 +29445,7 @@ async function handleJiraTracker(req, res, pathSegments) {
|
|
|
29370
29445
|
|
|
29371
29446
|
// src/http/trackers/linear.ts
|
|
29372
29447
|
init_zod();
|
|
29448
|
+
init_oauth();
|
|
29373
29449
|
|
|
29374
29450
|
// src/linear/webhook.ts
|
|
29375
29451
|
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
@@ -29680,7 +29756,7 @@ async function handleTrackers(req, res, pathSegments) {
|
|
|
29680
29756
|
|
|
29681
29757
|
// src/http/users.ts
|
|
29682
29758
|
init_zod();
|
|
29683
|
-
|
|
29759
|
+
init_db2();
|
|
29684
29760
|
init_types();
|
|
29685
29761
|
init_request_auth_context();
|
|
29686
29762
|
|
|
@@ -30740,7 +30816,7 @@ async function handleUsers(req, res, pathSegments, queryParams) {
|
|
|
30740
30816
|
init_zod();
|
|
30741
30817
|
|
|
30742
30818
|
// src/agentmail/inbound-archive.ts
|
|
30743
|
-
|
|
30819
|
+
init_db2();
|
|
30744
30820
|
init_secret_scrubber();
|
|
30745
30821
|
import { createHash as createHash3 } from "node:crypto";
|
|
30746
30822
|
var INBOUND_ARCHIVE_NAMESPACE = "agentmail-inbound";
|
|
@@ -31503,7 +31579,7 @@ async function handleWebhooks(req, res, pathSegments) {
|
|
|
31503
31579
|
|
|
31504
31580
|
// src/http/workflow-events.ts
|
|
31505
31581
|
init_zod();
|
|
31506
|
-
|
|
31582
|
+
init_db2();
|
|
31507
31583
|
init_event_bus();
|
|
31508
31584
|
var runScopedSignalRoute = route({
|
|
31509
31585
|
method: "post",
|
|
@@ -31586,7 +31662,7 @@ async function handleWorkflowEvents(req, res, pathSegments, queryParams) {
|
|
|
31586
31662
|
|
|
31587
31663
|
// src/http/workflows.ts
|
|
31588
31664
|
init_zod();
|
|
31589
|
-
|
|
31665
|
+
init_db2();
|
|
31590
31666
|
init_types();
|
|
31591
31667
|
var WorkflowWithFavoriteSchema = WorkflowSchema.extend({ favorite: exports_external.boolean() });
|
|
31592
31668
|
var WorkflowSaveResponseSchema = WorkflowSchema.extend({
|
|
@@ -32311,13 +32387,13 @@ async function handleWorkflows(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
32311
32387
|
const parsed = await getWorkflowRunRoute.parse(req, res, pathSegments, queryParams);
|
|
32312
32388
|
if (!parsed)
|
|
32313
32389
|
return true;
|
|
32314
|
-
const run = await getWorkflowRun(parsed.params.id);
|
|
32390
|
+
const run = await getWorkflowRun(parsed.params.id, "display");
|
|
32315
32391
|
if (!run) {
|
|
32316
32392
|
res.writeHead(404);
|
|
32317
32393
|
res.end();
|
|
32318
32394
|
return true;
|
|
32319
32395
|
}
|
|
32320
|
-
const steps = await getWorkflowRunStepsByRunId(parsed.params.id);
|
|
32396
|
+
const steps = await getWorkflowRunStepsByRunId(parsed.params.id, "display");
|
|
32321
32397
|
getWorkflowRunRoute.respond(res, 200, { run, steps });
|
|
32322
32398
|
return true;
|
|
32323
32399
|
}
|
|
@@ -32352,8 +32428,9 @@ async function handleWorkflows(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
32352
32428
|
|
|
32353
32429
|
// src/http/x.ts
|
|
32354
32430
|
init_zod();
|
|
32355
|
-
|
|
32431
|
+
init_db2();
|
|
32356
32432
|
import { timingSafeEqual as timingSafeEqual2 } from "node:crypto";
|
|
32433
|
+
init_db();
|
|
32357
32434
|
init_secret_scrubber();
|
|
32358
32435
|
var DEFAULT_TIMEOUT_MS = 60000;
|
|
32359
32436
|
var TIMEOUT_HEADER = "x-swarm-timeout-ms";
|
|
@@ -32771,7 +32848,7 @@ async function shutdown() {
|
|
|
32771
32848
|
sessionsProcessed: getServerSessionsProcessed()
|
|
32772
32849
|
});
|
|
32773
32850
|
if (hasCapability("scheduling")) {
|
|
32774
|
-
const { stopScheduler } = await import("./index-
|
|
32851
|
+
const { stopScheduler } = await import("./index-bn6cy8ps.js");
|
|
32775
32852
|
stopScheduler();
|
|
32776
32853
|
}
|
|
32777
32854
|
stopHeartbeat();
|
|
@@ -32780,7 +32857,7 @@ async function shutdown() {
|
|
|
32780
32857
|
await stopScriptRunSupervisor();
|
|
32781
32858
|
await stopSlackApp();
|
|
32782
32859
|
if (process.env.OAUTH_KEEPALIVE_DISABLE !== "true") {
|
|
32783
|
-
const { stopOAuthKeepalive } = await import("./keepalive-
|
|
32860
|
+
const { stopOAuthKeepalive } = await import("./keepalive-3xspa9jw.js");
|
|
32784
32861
|
await stopOAuthKeepalive();
|
|
32785
32862
|
}
|
|
32786
32863
|
stopOAuthPendingGc();
|
|
@@ -32843,21 +32920,27 @@ try {
|
|
|
32843
32920
|
throw err;
|
|
32844
32921
|
}
|
|
32845
32922
|
warnIfCorsAllowsAnyOrigin();
|
|
32923
|
+
try {
|
|
32924
|
+
const loaded = await loadSecretRegistry();
|
|
32925
|
+
console.log(`[secret-registry] registered config=${loaded.config} oauth=${loaded.oauth} scriptApi=${loaded.scriptApi} failed=${loaded.failed}`);
|
|
32926
|
+
} catch (err) {
|
|
32927
|
+
console.error("[secret-registry] load failed (non-fatal):", scrubSecrets(err instanceof Error ? err.message : String(err)));
|
|
32928
|
+
}
|
|
32846
32929
|
try {
|
|
32847
32930
|
await seedLegacyCapabilitiesConfig();
|
|
32848
32931
|
} catch (err) {
|
|
32849
32932
|
console.warn("[startup] CAPABILITIES upgrade seed failed (non-fatal):", err);
|
|
32850
32933
|
}
|
|
32851
32934
|
try {
|
|
32852
|
-
const { ensurePricingSeeded } = await import("./boot-seeds-
|
|
32935
|
+
const { ensurePricingSeeded } = await import("./boot-seeds-vvzs1zhk.js");
|
|
32853
32936
|
ensurePricingSeeded();
|
|
32854
|
-
const { startPricingRefreshLoop } = await import("./pricing-refresh-
|
|
32937
|
+
const { startPricingRefreshLoop } = await import("./pricing-refresh-atnkngqs.js");
|
|
32855
32938
|
startPricingRefreshLoop();
|
|
32856
32939
|
} catch (err) {
|
|
32857
32940
|
console.error("[startup] Failed to seed pricing rows:", err);
|
|
32858
32941
|
}
|
|
32859
32942
|
try {
|
|
32860
|
-
const { ensureRbacSeeded } = await import("./boot-seeds-
|
|
32943
|
+
const { ensureRbacSeeded } = await import("./boot-seeds-vvzs1zhk.js");
|
|
32861
32944
|
ensureRbacSeeded();
|
|
32862
32945
|
} catch (err) {
|
|
32863
32946
|
console.error("[startup] Failed to sync RBAC seed rows:", err);
|
|
@@ -32865,7 +32948,7 @@ try {
|
|
|
32865
32948
|
throw err;
|
|
32866
32949
|
}
|
|
32867
32950
|
try {
|
|
32868
|
-
const { runAllSeeders } = await import("./index-
|
|
32951
|
+
const { runAllSeeders } = await import("./index-f8xnqrye.js");
|
|
32869
32952
|
await runAllSeeders({ scriptEmbeddingMode: "skip" });
|
|
32870
32953
|
} catch (err) {
|
|
32871
32954
|
console.error("[startup] Failed to seed built-in entities:", err);
|
|
@@ -32925,38 +33008,38 @@ httpServer.listen(port, async () => {
|
|
|
32925
33008
|
await initWorkflows();
|
|
32926
33009
|
await startScriptRunSupervisor(getMcpBaseUrl());
|
|
32927
33010
|
if (hasCapability("scheduling")) {
|
|
32928
|
-
const { startScheduler } = await import("./index-
|
|
32929
|
-
const { getExecutorRegistry: getExecutorRegistry2 } = await import("./index-
|
|
33011
|
+
const { startScheduler } = await import("./index-bn6cy8ps.js");
|
|
33012
|
+
const { getExecutorRegistry: getExecutorRegistry2 } = await import("./index-n99fycq7.js");
|
|
32930
33013
|
const intervalMs = Number(process.env.SCHEDULER_INTERVAL_MS) || 1e4;
|
|
32931
33014
|
startScheduler(getExecutorRegistry2(), intervalMs, {
|
|
32932
33015
|
runId: globalState.__runId
|
|
32933
33016
|
});
|
|
32934
33017
|
}
|
|
32935
33018
|
if (!isEnvFlagEnabled("HEARTBEAT_DISABLE", false)) {
|
|
32936
|
-
const { startHeartbeat } = await import("./index-
|
|
33019
|
+
const { startHeartbeat } = await import("./index-dkfxpkmm.js");
|
|
32937
33020
|
const heartbeatMs = Number(process.env.HEARTBEAT_INTERVAL_MS) || 90000;
|
|
32938
33021
|
startHeartbeat(heartbeatMs);
|
|
32939
33022
|
}
|
|
32940
33023
|
if (process.env.OAUTH_KEEPALIVE_DISABLE !== "true") {
|
|
32941
|
-
const { startOAuthKeepalive } = await import("./keepalive-
|
|
33024
|
+
const { startOAuthKeepalive } = await import("./keepalive-3xspa9jw.js");
|
|
32942
33025
|
startOAuthKeepalive();
|
|
32943
33026
|
}
|
|
32944
33027
|
if (process.env.OAUTH_REFRESH_SWEEP_DISABLE !== "true") {
|
|
32945
|
-
const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-
|
|
33028
|
+
const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-sh9q25xp.js");
|
|
32946
33029
|
startOAuthRefreshSweep();
|
|
32947
33030
|
}
|
|
32948
33031
|
startOAuthPendingGc();
|
|
32949
33032
|
await startMemoryGc();
|
|
32950
33033
|
await startDbRetention();
|
|
32951
33034
|
startHumanFreeDrain();
|
|
32952
|
-
import("./boot-reembed-
|
|
33035
|
+
import("./boot-reembed-s7k7c6v2.js").then(({ runBootReembed }) => runBootReembed()).catch((err) => {
|
|
32953
33036
|
console.error("[boot-reembed] startup backfill failed (non-fatal):", err);
|
|
32954
33037
|
});
|
|
32955
|
-
import("./boot-reembed-
|
|
33038
|
+
import("./boot-reembed-998jtpdg.js").then(({ runBootReembedScripts }) => runBootReembedScripts()).catch((err) => {
|
|
32956
33039
|
console.error("[boot-reembed-scripts] startup backfill failed (non-fatal):", err);
|
|
32957
33040
|
});
|
|
32958
|
-
import("./boot-scrub-
|
|
32959
|
-
console.error("[boot-scrub-
|
|
33041
|
+
import("./boot-scrub-sweep-nepsk4t1.js").then(({ runBootScrubSweep }) => runBootScrubSweep()).catch((err) => {
|
|
33042
|
+
console.error("[boot-scrub-sweep] startup scrub failed (non-fatal):", err);
|
|
32960
33043
|
});
|
|
32961
33044
|
}).on("error", (err) => {
|
|
32962
33045
|
console.error("HTTP Server Error:", err);
|