@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.
Files changed (213) hide show
  1. package/README.md +2 -0
  2. package/dist/{acp-adapter-dgfakfpw.js → acp-adapter-ma1js5n7.js} +6 -6
  3. package/dist/{actions-fbqma8aa.js → actions-1vhmtvg9.js} +18 -18
  4. package/dist/{amp-adapter-en0jy6hs.js → amp-adapter-sxqqvmdk.js} +3 -3
  5. package/dist/{app-k8a5cgpp.js → app-mwx1d5a9.js} +3 -3
  6. package/dist/{assistant-a16433gr.js → assistant-yx1p6g82.js} +20 -20
  7. package/dist/{boot-reembed-f4nn561n.js → boot-reembed-5h37a2c2.js} +1 -1
  8. package/dist/{boot-reembed-6c1sjfnr.js → boot-reembed-7h78vmvv.js} +2 -1
  9. package/dist/{boot-scrub-sweep-d4w9gajf.js → boot-scrub-sweep-8mawd4gw.js} +3 -3
  10. package/dist/{boot-seeds-9bmkspyw.js → boot-seeds-ca84dhnn.js} +4 -4
  11. package/dist/{claude-adapter-nys1kjxa.js → claude-adapter-wqt4hfkq.js} +7 -7
  12. package/dist/{claude-managed-adapter-55207973.js → claude-managed-adapter-6fjqtr2z.js} +2 -2
  13. package/dist/{claude-managed-setup-3cm35gey.js → claude-managed-setup-rqv98sea.js} +2 -2
  14. package/dist/{claude-sdk-session-nw5yd8cp.js → claude-sdk-session-f29f3b2x.js} +7 -7
  15. package/dist/{cli-sxgtf5fw.js → cli-07q03xm2.js} +1 -1
  16. package/dist/{cli-k21gx5ht.js → cli-1hhbzkbb.js} +6 -6
  17. package/dist/{cli-v49fkghp.js → cli-1m9x8dr5.js} +1 -1
  18. package/dist/{cli-24j1jeeb.js → cli-2pvzmas1.js} +3 -3
  19. package/dist/{cli-w2656ka1.js → cli-2y7v133v.js} +7 -7
  20. package/dist/{cli-g8ka5j4j.js → cli-48gxjmcz.js} +94 -36
  21. package/dist/{cli-2sjhpsns.js → cli-54sj64fc.js} +1 -1
  22. package/dist/{cli-aj8djyqt.js → cli-60sty27p.js} +2 -2
  23. package/dist/{cli-4hxrf0p4.js → cli-6a9qfa8b.js} +308 -47
  24. package/dist/{cli-n7asmce6.js → cli-6mgdba42.js} +3 -3
  25. package/dist/{cli-gf95q3bm.js → cli-6srv653c.js} +3 -3
  26. package/dist/{cli-9abdgn5t.js → cli-86ehn4s5.js} +3 -3
  27. package/dist/{cli-bqztfyve.js → cli-8mbc9za9.js} +1 -1
  28. package/dist/{cli-a2rr0fmg.js → cli-8wmj18cz.js} +1 -1
  29. package/dist/{cli-c2habvsf.js → cli-9gsm2rzp.js} +8 -8
  30. package/dist/{cli-4rf0f5vg.js → cli-9pshx6rd.js} +4 -2
  31. package/dist/{cli-abkm71vr.js → cli-a6ds2epe.js} +1 -1
  32. package/dist/{cli-esakngh8.js → cli-a89zdqz9.js} +1 -1
  33. package/dist/{cli-3ndmpxxv.js → cli-ay40dnj3.js} +2 -2
  34. package/dist/{cli-kf4jree9.js → cli-aypd09nf.js} +1 -1
  35. package/dist/{cli-6y51ryva.js → cli-b3yzyc57.js} +1 -1
  36. package/dist/{cli-ag2yrnt5.js → cli-c668vvcf.js} +2 -2
  37. package/dist/{cli-5sckpqcx.js → cli-d20qvpr2.js} +1 -1
  38. package/dist/{cli-a34pr3w1.js → cli-e1595bgx.js} +2 -2
  39. package/dist/{cli-m70bajzr.js → cli-f12mr20z.js} +1 -1
  40. package/dist/{cli-dqygeeh5.js → cli-f1e0ptjj.js} +10 -1
  41. package/dist/{cli-mvjz5an3.js → cli-f4dbh7a5.js} +7 -7
  42. package/dist/{cli-az25fn5f.js → cli-gsfk58nw.js} +2 -2
  43. package/dist/{cli-1tem6ns9.js → cli-gt4h8cxw.js} +3 -2
  44. package/dist/{cli-cz37jqss.js → cli-h5jeg46p.js} +2 -2
  45. package/dist/{cli-emhjcj2y.js → cli-he9gbdx0.js} +60 -10
  46. package/dist/{cli-3fwqy71j.js → cli-j0ppywdr.js} +38 -31
  47. package/dist/{cli-5rj83bam.js → cli-j3y0x2n4.js} +34 -33
  48. package/dist/{cli-3gfvmzht.js → cli-j9bpmykh.js} +73 -25
  49. package/dist/{cli-m5a9m0ak.js → cli-kv7sbc2c.js} +3 -3
  50. package/dist/{cli-g20jjwt4.js → cli-m30k9777.js} +12 -12
  51. package/dist/{cli-683y0b3a.js → cli-m5e802r7.js} +2 -2
  52. package/dist/{cli-nn6vx2mq.js → cli-ptfq202x.js} +5 -3
  53. package/dist/{cli-d2dpf95n.js → cli-qj442fws.js} +1 -1
  54. package/dist/{cli-03gg9pd1.js → cli-rd5m70gj.js} +4 -4
  55. package/dist/{cli-gnsb1zxa.js → cli-s09j9vp5.js} +1 -1
  56. package/dist/{cli-zqne1qcj.js → cli-s0mgx214.js} +2 -2
  57. package/dist/{cli-sqma6vw1.js → cli-sgqm2582.js} +5 -5
  58. package/dist/{cli-nq677csy.js → cli-sjctjr48.js} +1 -1
  59. package/dist/{cli-3aqd4jaa.js → cli-twctnkng.js} +3 -3
  60. package/dist/{cli-j6rktc91.js → cli-v6shg7na.js} +1 -1
  61. package/dist/{cli-7enjwya9.js → cli-vz78s5wm.js} +1 -1
  62. package/dist/{cli-art7c1zh.js → cli-wqr7cea4.js} +4 -4
  63. package/dist/{cli-hfeb68z4.js → cli-x37r7qwf.js} +11 -3
  64. package/dist/{cli-ffvsj2qw.js → cli-yd2nreqw.js} +2 -2
  65. package/dist/{cli-ca6banwz.js → cli-ymjpkxgn.js} +6 -6
  66. package/dist/{cli-mtnj4fwa.js → cli-yxbsmx56.js} +5 -5
  67. package/dist/cli.js +18 -16
  68. package/dist/{codex-adapter-d95q4qsn.js → codex-adapter-zk59x2zh.js} +5 -5
  69. package/dist/{codex-hook-brpnycn5.js → codex-hook-xyjhvxwd.js} +1 -1
  70. package/dist/{codex-session-runner-gdwd8h0c.js → codex-session-runner-kh6s4j3n.js} +5 -5
  71. package/dist/{commands-jqmgk54b.js → commands-68et1qv2.js} +2 -2
  72. package/dist/{controller-z3jq589f.js → controller-fyrbnzg4.js} +2 -2
  73. package/dist/{controllers-connect-r2za39ef.js → controllers-connect-nep9h2xv.js} +19 -19
  74. package/dist/{cursor-adapter-4mr4jgkw.js → cursor-adapter-yss3pg7t.js} +1 -1
  75. package/dist/{db-w36wwb5g.js → db-28gjyvxj.js} +2 -2
  76. package/dist/{db-ppv2tze7.js → db-8ftwvzba.js} +3 -3
  77. package/dist/{dispatcher-pv5h77vf.js → dispatcher-hayexmkr.js} +17 -17
  78. package/dist/{dsh-adapter-d4pdpb3r.js → dsh-adapter-46wawff9.js} +1 -1
  79. package/dist/{easter-egg-3d-4sp4dvmc.js → easter-egg-3d-8d1e0h4m.js} +1 -1
  80. package/dist/{execute-jev839y1.js → execute-cjrfxfnm.js} +1 -1
  81. package/dist/{external-channel-y6nkzhnn.js → external-channel-xbmxcg09.js} +2 -2
  82. package/dist/{grok-adapter-t08b9ntm.js → grok-adapter-ag4wks2a.js} +7 -7
  83. package/dist/handlers-tzmevqb5.js +41 -0
  84. package/dist/{heartbeat-vn31xwdk.js → heartbeat-psfvcgwp.js} +20 -20
  85. package/dist/{hook-6d0zbvvt.js → hook-8pz04697.js} +5 -5
  86. package/dist/{hook-cpjs8q51.js → hook-cyq4mryn.js} +6 -6
  87. package/dist/{http-9c6medda.js → http-haj1nd6k.js} +109 -114
  88. package/dist/{index-qhjf2htm.js → index-jwt2bj6f.js} +261 -96
  89. package/dist/{index-g6k9tctj.js → index-q52f47pe.js} +1 -1
  90. package/dist/{index-pkma1yf8.js → index-syvhnvtw.js} +1 -1
  91. package/dist/{index-yqgbfgaj.js → index-y1ajx04a.js} +20 -20
  92. package/dist/{index-k0yt1tvq.js → index-z5h22pes.js} +17 -17
  93. package/dist/{index-38t35h0n.js → index-zyq8ct52.js} +17 -17
  94. package/dist/{keepalive-em0117bp.js → keepalive-xdvsamvj.js} +3 -3
  95. package/dist/{lead-23e7z59t.js → lead-hqg57kdp.js} +35 -35
  96. package/dist/{maintenance-kbme3qy9.js → maintenance-4y2xzh3a.js} +1 -1
  97. package/dist/{oauth-refresh-sweep-xysj4yse.js → oauth-refresh-sweep-jd4r7zbs.js} +8 -3
  98. package/dist/{onboard-p6q0vz97.js → onboard-18447q9q.js} +5 -5
  99. package/dist/{opencode-adapter-esv3k9yn.js → opencode-adapter-26b2frdf.js} +5 -5
  100. package/dist/{otel-impl-54qhqh1z.js → otel-impl-f9tgr8yw.js} +1 -1
  101. package/dist/{pi-mono-adapter-mymbwhj0.js → pi-mono-adapter-qn6qbga1.js} +33 -12
  102. package/dist/{pricing-refresh-yb75wv33.js → pricing-refresh-dw2tgb53.js} +3 -3
  103. package/dist/{rbac-roles-1vp2mw4p.js → rbac-roles-aygm2760.js} +2 -2
  104. package/dist/{rbac-roles-dexhc9x8.js → rbac-roles-s4nwj2m3.js} +1 -1
  105. package/dist/{render-v2-tjay5hhf.js → render-v2-yfvdfr0x.js} +3 -3
  106. package/dist/{resume-8ayf37g5.js → resume-1bmvjbf3.js} +7 -7
  107. package/dist/{runtime-hqe5cqcd.js → runtime-f7tpzedy.js} +1 -1
  108. package/dist/{session-access-fdhp987s.js → session-access-r5garej6.js} +4 -4
  109. package/dist/{session-source-backfill-qgtc86z1.js → session-source-backfill-424wzv0r.js} +2 -2
  110. package/dist/{setup-4rrmqcq3.js → setup-8tygvxkq.js} +1 -1
  111. package/dist/{virtual-modules-52km00d6.js → virtual-modules-xsw323b3.js} +2 -2
  112. package/dist/{work-objects-p28fgd70.js → work-objects-ggnghpgf.js} +20 -20
  113. package/dist/{worker-e3w7vye1.js → worker-sqjd1nqf.js} +35 -35
  114. package/openapi.json +69 -1
  115. package/package.json +5 -3
  116. package/src/be/automation-preflight.ts +2 -0
  117. package/src/be/db/api-keys.ts +9 -0
  118. package/src/be/db/workflow-runs.ts +36 -5
  119. package/src/be/db.ts +80 -22
  120. package/src/be/memory/task-learning.ts +155 -0
  121. package/src/be/migrations/245_script_executor.sql +3 -0
  122. package/src/be/oauth-refresh-sweep.ts +2 -1
  123. package/src/be/scripts/boot-reembed.ts +2 -0
  124. package/src/be/scripts/db.ts +14 -4
  125. package/src/be/scripts/embeddings.ts +2 -0
  126. package/src/be/scripts/run-saved.ts +1 -0
  127. package/src/be/scripts/typecheck.ts +9 -3
  128. package/src/be/seed-skills/index.ts +7 -0
  129. package/src/commands/onboard/compose-generator.ts +5 -3
  130. package/src/commands/provider-credentials.ts +2 -1
  131. package/src/heartbeat/heartbeat.ts +14 -1
  132. package/src/heartbeat/script-runner-probe.ts +47 -0
  133. package/src/http/api-keys.ts +24 -9
  134. package/src/http/idempotency-key.ts +1 -1
  135. package/src/http/index.ts +3 -3
  136. package/src/http/pages-public.ts +38 -5
  137. package/src/http/scripts.ts +27 -0
  138. package/src/http/workflows.ts +10 -0
  139. package/src/http/x.ts +5 -0
  140. package/src/prompts/base-prompt.ts +21 -1
  141. package/src/prompts/session-templates.ts +17 -3
  142. package/src/providers/amp-adapter.ts +1 -1
  143. package/src/providers/dsh-adapter.ts +1 -1
  144. package/src/providers/pi-mono-adapter.ts +41 -11
  145. package/src/scheduler/scheduler.ts +2 -1
  146. package/src/scripts-runtime/eval-harness.ts +8 -1
  147. package/src/scripts-runtime/executors/native.ts +22 -16
  148. package/src/scripts-runtime/executors/quickjs-prelude.ts +103 -1
  149. package/src/scripts-runtime/executors/quickjs-runner.ts +2 -1
  150. package/src/scripts-runtime/executors/quickjs.ts +7 -0
  151. package/src/scripts-runtime/executors/registry.ts +32 -0
  152. package/src/scripts-runtime/executors/types.ts +7 -0
  153. package/src/scripts-runtime/host-validated-args.ts +133 -0
  154. package/src/scripts-runtime/loader.ts +30 -3
  155. package/src/scripts-runtime/swarm-sdk.ts +9 -2
  156. package/src/scripts-runtime/types/stdlib.d.ts +9 -1
  157. package/src/scripts-runtime/types/swarm-sdk.d.ts +9 -1
  158. package/src/tests/api-key-status-by-suffix.test.ts +242 -0
  159. package/src/tests/base-prompt.test.ts +70 -2
  160. package/src/tests/community-linear-delivery-loop.test.ts +2099 -0
  161. package/src/tests/credential-check.test.ts +4 -2
  162. package/src/tests/docs-index.test.ts +135 -0
  163. package/src/tests/dsh-adapter.test.ts +1 -1
  164. package/src/tests/fetch-resolved-env.test.ts +16 -2
  165. package/src/tests/heartbeat-checklist.test.ts +89 -0
  166. package/src/tests/heartbeat-script-runner-probe.test.ts +83 -0
  167. package/src/tests/oauth-refresh-sweep.test.ts +34 -1
  168. package/src/tests/onboard-compose.test.ts +20 -0
  169. package/src/tests/opencode-adapter.test.ts +2 -1
  170. package/src/tests/pages-frame-ancestors.test.ts +162 -0
  171. package/src/tests/pi-codemode.test.ts +2 -1
  172. package/src/tests/pi-mono-adapter.test.ts +54 -0
  173. package/src/tests/pi-native-mcp.test.ts +13 -1
  174. package/src/tests/pi-tool-exposure.test.ts +8 -8
  175. package/src/tests/probe-tool-schema-tokens.test.ts +144 -0
  176. package/src/tests/prompt-template-session.test.ts +4 -3
  177. package/src/tests/request-composition-derive.test.ts +329 -0
  178. package/src/tests/script-connections.test.ts +2 -0
  179. package/src/tests/script-executor-conformance.test.ts +36 -1
  180. package/src/tests/script-executor-quickjs-pool.test.ts +50 -0
  181. package/src/tests/script-executor-quickjs.test.ts +140 -0
  182. package/src/tests/script-host-validated-args-native.test.ts +196 -0
  183. package/src/tests/script-per-script-executor.test.ts +415 -0
  184. package/src/tests/scripts-external-api.test.ts +45 -0
  185. package/src/tests/sdk-allowlist.test.ts +3 -2
  186. package/src/tests/self-improvement.test.ts +4 -4
  187. package/src/tests/store-progress-learning.test.ts +288 -0
  188. package/src/tests/ui-logs-parser.test.ts +180 -0
  189. package/src/tests/workflow-engine-v2.test.ts +116 -1
  190. package/src/tests/workflow-mcp-trigger-schema.test.ts +209 -0
  191. package/src/tests/workflow-run-finished-event.test.ts +263 -0
  192. package/src/tests/workflow-swarm-script.test.ts +34 -0
  193. package/src/tools/script-common.ts +1 -0
  194. package/src/tools/script-run.ts +7 -0
  195. package/src/tools/script-upsert.ts +7 -0
  196. package/src/tools/store-progress.ts +67 -1
  197. package/src/tools/workflows/trigger-workflow.ts +104 -10
  198. package/src/types.ts +12 -1
  199. package/src/utils/credentials.ts +5 -2
  200. package/src/workflows/engine.ts +18 -16
  201. package/src/workflows/executors/swarm-script.ts +5 -0
  202. package/src/workflows/foreach-driver.ts +5 -11
  203. package/src/workflows/node-timeout.ts +30 -0
  204. package/templates/community/linear-delivery-loop/PLAYBOOK.md +323 -0
  205. package/templates/community/linear-delivery-loop/README.md +38 -0
  206. package/templates/community/linear-delivery-loop/config.example.json +31 -0
  207. package/templates/community/linear-delivery-loop/lead-prompt.md +34 -0
  208. package/templates/community/linear-delivery-loop/schedule.json +10 -0
  209. package/templates/community/linear-delivery-loop/scripts/linear-delivery-setup.ts +148 -0
  210. package/templates/community/linear-delivery-loop/scripts/linear-delivery-tick.ts +1781 -0
  211. package/templates/skills/swarm-docs/config.json +14 -0
  212. package/templates/skills/swarm-docs/content.md +144 -0
  213. package/dist/handlers-eqsnmv95.js +0 -41
@@ -288,12 +288,15 @@ import {
288
288
  emitBudgetRefusalSideEffects,
289
289
  workflowModelErrors,
290
290
  patchWorkflowDefinition,
291
+ idempotencyKeyHeader,
292
+ readIdempotencyKey,
293
+ replayAcceptedOperation,
291
294
  resolveScriptsOnlyMode,
292
295
  ALL_CAPABILITIES,
293
296
  hasCapability,
294
297
  getEnabledCapabilities,
295
298
  createServer
296
- } from "./cli-4hxrf0p4.js";
299
+ } from "./cli-6a9qfa8b.js";
297
300
  import {
298
301
  chatThreadOfContextKey,
299
302
  agentContextKey,
@@ -454,7 +457,6 @@ import {
454
457
  updateTaskProgress2,
455
458
  IdempotencyKeyTakenError,
456
459
  workflowRequestFingerprint,
457
- findAcceptedWorkflowOperation,
458
460
  assertWorkflowIdempotencyKeyUnused,
459
461
  recordAcceptedWorkflowOperation,
460
462
  init_workflow_idempotency,
@@ -763,7 +765,7 @@ import {
763
765
  countScriptRunJournalSteps2,
764
766
  countScriptRunJournalAgentTaskSteps2,
765
767
  init_db3
766
- } from "./cli-g8ka5j4j.js";
768
+ } from "./cli-48gxjmcz.js";
767
769
  import {
768
770
  PRIMARY_ROLE_NAMES2,
769
771
  getUserGrant2,
@@ -774,22 +776,22 @@ import {
774
776
  assertNotLastAdmin2,
775
777
  setUserRoles2,
776
778
  init_rbac_roles
777
- } from "./cli-a2rr0fmg.js";
778
- import"./cli-03gg9pd1.js";
779
+ } from "./cli-8wmj18cz.js";
780
+ import"./cli-rd5m70gj.js";
779
781
  import {
780
782
  normalizeModelKey
781
- } from "./cli-5sckpqcx.js";
783
+ } from "./cli-d20qvpr2.js";
782
784
  import {
783
785
  upsertModelCatalogOverlay,
784
786
  deleteModelCatalogOverlay,
785
787
  loadModelsCatalog,
786
788
  requestModelCatalogRefresh2
787
- } from "./cli-aj8djyqt.js";
789
+ } from "./cli-60sty27p.js";
788
790
  import {
789
791
  AMP_ESTIMATE_MODELS,
790
792
  ampBillsCacheWrites,
791
793
  resolveAmpModel
792
- } from "./cli-bqztfyve.js";
794
+ } from "./cli-8mbc9za9.js";
793
795
  import {
794
796
  workflowEventBus2,
795
797
  init_event_bus
@@ -829,7 +831,7 @@ import {
829
831
  generateEdges,
830
832
  definitionNodeIds,
831
833
  validateDefinition
832
- } from "./cli-3fwqy71j.js";
834
+ } from "./cli-j0ppywdr.js";
833
835
  import {
834
836
  require_dist2,
835
837
  isInvalidClientError,
@@ -889,8 +891,10 @@ import {
889
891
  buildSandboxedCommand,
890
892
  sandboxSpawnEnv,
891
893
  readStreamCapped,
894
+ isExecutorAllowedByDeployment,
892
895
  MIN_SCRIPT_WALL_CLOCK_MS,
893
896
  MAX_SCRIPT_WALL_CLOCK_MS,
897
+ HOST_VALIDATED_ARGS,
894
898
  require_typescript2,
895
899
  checkImportAllowlist,
896
900
  runScriptWithRunCredential,
@@ -909,14 +913,14 @@ import {
909
913
  typecheckWithAmbient,
910
914
  typecheckScript,
911
915
  parseSkillContent
912
- } from "./cli-3gfvmzht.js";
916
+ } from "./cli-j9bpmykh.js";
913
917
  import {
914
918
  buildAuthorizationUrl,
915
919
  exchangeAuthorizationCode,
916
920
  oauthAppRowToProviderConfig,
917
921
  forceRefreshAuthorizationOrThrow,
918
922
  forceRefreshTokenOrThrow
919
- } from "./cli-kf4jree9.js";
923
+ } from "./cli-aypd09nf.js";
920
924
  import {
921
925
  signalProcessGroup,
922
926
  detachedProcessGroup,
@@ -949,9 +953,9 @@ import {
949
953
  getSlackApp2,
950
954
  startSlackApp2,
951
955
  stopSlackApp2
952
- } from "./cli-g20jjwt4.js";
953
- import"./cli-gnsb1zxa.js";
954
- import"./cli-v49fkghp.js";
956
+ } from "./cli-m30k9777.js";
957
+ import"./cli-s09j9vp5.js";
958
+ import"./cli-1m9x8dr5.js";
955
959
  import {
956
960
  _fetchHolder,
957
961
  CLIENT_ID,
@@ -968,7 +972,7 @@ import {
968
972
  import {
969
973
  retryFailedRun2,
970
974
  cancelWorkflowRun2
971
- } from "./cli-3aqd4jaa.js";
975
+ } from "./cli-twctnkng.js";
972
976
  import {
973
977
  duplicateGuardedQueryKey,
974
978
  warnIfCorsAllowsAnyOrigin,
@@ -1013,7 +1017,7 @@ import {
1013
1017
  bodyListTask,
1014
1018
  describeRequestRoute,
1015
1019
  route
1016
- } from "./cli-art7c1zh.js";
1020
+ } from "./cli-wqr7cea4.js";
1017
1021
  import {
1018
1022
  FilesError,
1019
1023
  normalizeFilesError,
@@ -1041,7 +1045,7 @@ import {
1041
1045
  resolvePoolDelivery2,
1042
1046
  createPoolAgent2,
1043
1047
  init_db
1044
- } from "./cli-gf95q3bm.js";
1048
+ } from "./cli-6srv653c.js";
1045
1049
  import {
1046
1050
  RATING_MODEL_MAX_LENGTH,
1047
1051
  REFERENCES_SOURCE_MAX_LENGTH,
@@ -1057,8 +1061,8 @@ import {
1057
1061
  checkHeartbeatChecklist2,
1058
1062
  runHeartbeatSweep2,
1059
1063
  stopHeartbeat2
1060
- } from "./cli-emhjcj2y.js";
1061
- import"./cli-d2dpf95n.js";
1064
+ } from "./cli-he9gbdx0.js";
1065
+ import"./cli-qj442fws.js";
1062
1066
  import {
1063
1067
  import_websocket,
1064
1068
  import_websocket_server
@@ -1067,7 +1071,7 @@ import {
1067
1071
  runtimeSupervisorStatus,
1068
1072
  startRuntimeSupervisor,
1069
1073
  stopRuntimeSupervisor
1070
- } from "./cli-c2habvsf.js";
1074
+ } from "./cli-9gsm2rzp.js";
1071
1075
  import"./cli-ns59dc6r.js";
1072
1076
  import {
1073
1077
  ACP_TARGET_IDS
@@ -1078,7 +1082,7 @@ import {
1078
1082
  } from "./cli-c081bj3b.js";
1079
1083
  import {
1080
1084
  MAX_RATE_LIMIT_RESET_MS
1081
- } from "./cli-7enjwya9.js";
1085
+ } from "./cli-vz78s5wm.js";
1082
1086
  import {
1083
1087
  isLeadChannelMonitoringEnabled,
1084
1088
  ORG_IDENTITY_KEYS,
@@ -1088,11 +1092,11 @@ import {
1088
1092
  isUnknownModelError,
1089
1093
  checkProviderPoolKey,
1090
1094
  writeSkillsToFilesystem
1091
- } from "./cli-n7asmce6.js";
1095
+ } from "./cli-6mgdba42.js";
1092
1096
  import {
1093
1097
  inviteEmailToSharedOrg,
1094
1098
  ensureAgentFsCredentialsForAgent
1095
- } from "./cli-6y51ryva.js";
1099
+ } from "./cli-b3yzyc57.js";
1096
1100
  import {
1097
1101
  Anthropic
1098
1102
  } from "./cli-rr7zx19j.js";
@@ -1132,7 +1136,7 @@ import {
1132
1136
  revokeAgentTokens,
1133
1137
  fingerprintApiKey,
1134
1138
  init_users
1135
- } from "./cli-esakngh8.js";
1139
+ } from "./cli-a89zdqz9.js";
1136
1140
  import"./cli-v41kn3cd.js";
1137
1141
  import"./cli-wgtk7xxr.js";
1138
1142
  import"./cli-1f0gp9vz.js";
@@ -1265,6 +1269,7 @@ import {
1265
1269
  PromptTemplateHistorySchema,
1266
1270
  ScriptScopeSchema,
1267
1271
  ScriptFsModeSchema,
1272
+ ScriptExecutorNameSchema,
1268
1273
  ScriptRecordSchema,
1269
1274
  ScriptVersionRecordSchema,
1270
1275
  ExtensionManifestSchema,
@@ -1297,12 +1302,12 @@ import {
1297
1302
  KvKeySchema,
1298
1303
  KvEntrySchema,
1299
1304
  init_types
1300
- } from "./cli-4rf0f5vg.js";
1305
+ } from "./cli-9pshx6rd.js";
1301
1306
  import {
1302
1307
  IDENTITY_FIELD_BUDGETS,
1303
1308
  IdentityFieldBudgetError,
1304
1309
  init_identity_field_budget
1305
- } from "./cli-hfeb68z4.js";
1310
+ } from "./cli-x37r7qwf.js";
1306
1311
  import {
1307
1312
  isSteeringEnabled2,
1308
1313
  init_steering_enabled
@@ -1325,7 +1330,7 @@ import {
1325
1330
  splitCredentialPool,
1326
1331
  selectCredential,
1327
1332
  init_credentials
1328
- } from "./cli-1tem6ns9.js";
1333
+ } from "./cli-gt4h8cxw.js";
1329
1334
  import {
1330
1335
  getOpenRouterAttributionHeaders,
1331
1336
  init_openrouter_base_url
@@ -1339,7 +1344,7 @@ import {
1339
1344
  resolveTemplate,
1340
1345
  init_resolver,
1341
1346
  init_session_templates
1342
- } from "./cli-dqygeeh5.js";
1347
+ } from "./cli-f1e0ptjj.js";
1343
1348
  import {
1344
1349
  init_zod
1345
1350
  } from "./cli-4chz1hye.js";
@@ -1374,7 +1379,7 @@ import {
1374
1379
  import {
1375
1380
  init_package,
1376
1381
  package_default
1377
- } from "./cli-nn6vx2mq.js";
1382
+ } from "./cli-ptfq202x.js";
1378
1383
  import {
1379
1384
  realtimeBus,
1380
1385
  init_bus
@@ -5651,7 +5656,11 @@ var getAvailable = route({
5651
5656
  totalKeys: exports_coerce.number().int().min(1),
5652
5657
  scope: string2().optional(),
5653
5658
  scopeId: string2().optional(),
5654
- model: _enum2(["fable", "opus", "sonnet", "haiku"]).optional()
5659
+ model: _enum2(["fable", "opus", "sonnet", "haiku"]).optional(),
5660
+ keySuffixes: string2().transform((value) => value.split(",")).optional()
5661
+ }).refine((query) => !query.keySuffixes || query.keySuffixes.length === query.totalKeys, {
5662
+ message: "keySuffixes must list exactly totalKeys suffixes",
5663
+ path: ["keySuffixes"]
5655
5664
  }),
5656
5665
  responses: {
5657
5666
  200: {
@@ -5986,9 +5995,9 @@ async function handleApiKeys(req, res, pathSegments, queryParams) {
5986
5995
  const parsed = await getAvailable.parse(req, res, pathSegments, queryParams);
5987
5996
  if (!parsed)
5988
5997
  return true;
5989
- const { keyType, totalKeys, scope, scopeId, model } = parsed.query;
5998
+ const { keyType, totalKeys, scope, scopeId, model, keySuffixes } = parsed.query;
5990
5999
  try {
5991
- const result = await getAvailableKeyIndices2(keyType, totalKeys, scope, scopeId ?? null, model);
6000
+ const result = await getAvailableKeyIndices2(keyType, totalKeys, scope, scopeId ?? null, model, keySuffixes);
5992
6001
  getAvailable.respond(res, 200, {
5993
6002
  success: true,
5994
6003
  availableIndices: result.availableIndices,
@@ -26840,7 +26849,26 @@ var LOCAL_PAGE_APP_URL = "http://localhost:5274";
26840
26849
  function getAppBaseUrl2() {
26841
26850
  return getAppUrl(LOCAL_PAGE_APP_URL);
26842
26851
  }
26843
- function buildCsp() {
26852
+ var FRAME_ANCESTOR_SOURCE_RE = /^(?:https?:\/\/)?(?:\*\.)?[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*(?::(?:\d{1,5}|\*))?$/i;
26853
+ var cachedFrameAncestors = null;
26854
+ function getPageFrameAncestors() {
26855
+ const raw = process.env.PAGES_FRAME_ANCESTORS ?? "";
26856
+ if (cachedFrameAncestors?.raw === raw)
26857
+ return cachedFrameAncestors.origins;
26858
+ const origins = [];
26859
+ for (const entry of raw.split(/[\s,]+/)) {
26860
+ const value = entry.replace(/\/+$/, "");
26861
+ if (!value)
26862
+ continue;
26863
+ if (FRAME_ANCESTOR_SOURCE_RE.test(value))
26864
+ origins.push(value);
26865
+ else
26866
+ console.warn(`[pages] ignoring invalid PAGES_FRAME_ANCESTORS entry: ${entry}`);
26867
+ }
26868
+ cachedFrameAncestors = { raw, origins };
26869
+ return origins;
26870
+ }
26871
+ function buildCsp(page) {
26844
26872
  const configured = getConfiguredAppUrls();
26845
26873
  const devFallbacks = getNodeEnv() === "production" ? [] : [
26846
26874
  "http://localhost:5274",
@@ -26850,7 +26878,8 @@ function buildCsp() {
26850
26878
  "https://*.localhost",
26851
26879
  "http://*.localhost"
26852
26880
  ];
26853
- const ancestors = Array.from(new Set([...configured, ...devFallbacks]));
26881
+ const embedders = page.authMode === "public" ? getPageFrameAncestors() : [];
26882
+ const ancestors = Array.from(new Set([...configured, ...devFallbacks, ...embedders]));
26854
26883
  return [
26855
26884
  "default-src 'self'",
26856
26885
  "script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.tailwindcss.com https://cdn.jsdelivr.net https://unpkg.com",
@@ -27016,7 +27045,7 @@ async function handlePagesPublic(req, res, pathSegments, queryParams) {
27016
27045
  const headers = {
27017
27046
  "Content-Type": "text/html; charset=utf-8",
27018
27047
  "Cache-Control": "no-store",
27019
- "Content-Security-Policy": buildCsp(),
27048
+ "Content-Security-Policy": buildCsp(page),
27020
27049
  "X-Content-Type-Options": "nosniff"
27021
27050
  };
27022
27051
  if (inlineSetCookie.length > 0)
@@ -27040,7 +27069,7 @@ async function handlePagesPublic(req, res, pathSegments, queryParams) {
27040
27069
  const headers = {
27041
27070
  "Content-Type": "text/html; charset=utf-8",
27042
27071
  "Cache-Control": "no-store",
27043
- "Content-Security-Policy": buildCsp(),
27072
+ "Content-Security-Policy": buildCsp(page),
27044
27073
  "X-Content-Type-Options": "nosniff"
27045
27074
  };
27046
27075
  if (inlineSetCookie.length > 0)
@@ -32852,7 +32881,8 @@ var upsertBodySchema = object2({
32852
32881
  description: string2().default(""),
32853
32882
  intent: string2().default(""),
32854
32883
  scope: ScriptScopeSchema.default("agent"),
32855
- fsMode: ScriptFsModeSchema.default("none")
32884
+ fsMode: ScriptFsModeSchema.default("none"),
32885
+ executor: ScriptExecutorNameSchema.nullable().optional()
32856
32886
  });
32857
32887
  var runBodySchema = object2({
32858
32888
  name: scriptNameSchema.optional(),
@@ -32861,6 +32891,7 @@ var runBodySchema = object2({
32861
32891
  intent: string2().default(""),
32862
32892
  scope: ScriptScopeSchema.optional(),
32863
32893
  fsMode: ScriptFsModeSchema.default("none"),
32894
+ executor: ScriptExecutorNameSchema.nullable().optional(),
32864
32895
  idempotencyKey: string2().max(200).optional()
32865
32896
  }).refine((body) => Boolean(body.name) !== Boolean(body.source), {
32866
32897
  message: "Provide exactly one of name or source"
@@ -33309,6 +33340,10 @@ async function handleScripts(req, res, pathSegments, queryParams, agentId) {
33309
33340
  return true;
33310
33341
  }
33311
33342
  }
33343
+ if (parsed.body.executor && !isExecutorAllowedByDeployment(parsed.body.executor)) {
33344
+ jsonError(res, 'Executor "native" is not permitted when deployment SCRIPT_EXECUTOR="quickjs"', 400);
33345
+ return true;
33346
+ }
33312
33347
  const secretRefusal = refuseSourceWithSecrets(parsed.body.source);
33313
33348
  if (secretRefusal) {
33314
33349
  json(res, secretRefusal, 400);
@@ -33336,6 +33371,7 @@ async function handleScripts(req, res, pathSegments, queryParams, agentId) {
33336
33371
  signatureJson: signatureJsonFor(parsed.body.source),
33337
33372
  argsJsonSchema,
33338
33373
  fsMode: parsed.body.fsMode,
33374
+ executor: parsed.body.executor,
33339
33375
  agentId: agent.id,
33340
33376
  isScratch: false,
33341
33377
  typeChecked: true,
@@ -33373,6 +33409,7 @@ async function handleScripts(req, res, pathSegments, queryParams, agentId) {
33373
33409
  }
33374
33410
  let source = parsed.body.source;
33375
33411
  let fsMode = parsed.body.fsMode;
33412
+ let executor = parsed.body.executor ?? null;
33376
33413
  let namedScript = null;
33377
33414
  if (parsed.body.name) {
33378
33415
  const script = await resolveScript(parsed.body.name, agent.id, parsed.body.scope);
@@ -33383,11 +33420,16 @@ async function handleScripts(req, res, pathSegments, queryParams, agentId) {
33383
33420
  namedScript = script;
33384
33421
  source = script.source;
33385
33422
  fsMode = script.fsMode;
33423
+ executor = parsed.body.executor !== undefined ? parsed.body.executor : script.executor;
33386
33424
  }
33387
33425
  if (fsMode === "workspace-rw") {
33388
33426
  jsonError(res, "workspace-rw scripts are not supported by /api/scripts/run in v1", 501);
33389
33427
  return true;
33390
33428
  }
33429
+ if (executor && !isExecutorAllowedByDeployment(executor)) {
33430
+ jsonError(res, 'Executor "native" is not permitted when deployment SCRIPT_EXECUTOR="quickjs"', 400);
33431
+ return true;
33432
+ }
33391
33433
  const startedAt = new Date().toISOString();
33392
33434
  const runStartTouch = namedScript?.isScratch ? await touchScratchScriptLastUsed(namedScript.id) : null;
33393
33435
  const credentials = await buildScriptCredentialBindingsWithFailures({ agentId: agent.id });
@@ -33395,6 +33437,7 @@ async function handleScripts(req, res, pathSegments, queryParams, agentId) {
33395
33437
  source,
33396
33438
  args: parsed.body.args,
33397
33439
  fsMode,
33440
+ executor,
33398
33441
  agentId: agent.id,
33399
33442
  runtimeInstanceId,
33400
33443
  egressSecrets: credentials.egressSecrets,
@@ -33523,6 +33566,7 @@ async function handleScripts(req, res, pathSegments, queryParams, agentId) {
33523
33566
  isScratch: script.isScratch,
33524
33567
  typeChecked: script.typeChecked,
33525
33568
  fsMode: script.fsMode,
33569
+ executor: script.executor,
33526
33570
  createdByAgentId: script.createdByAgentId,
33527
33571
  createdAt: script.createdAt,
33528
33572
  updatedAt: script.updatedAt
@@ -40006,63 +40050,6 @@ init_db3();
40006
40050
  init_workflow_idempotency();
40007
40051
  init_workflow_runs();
40008
40052
  init_types();
40009
-
40010
- // src/http/idempotency-key.ts
40011
- init_zod();
40012
- init_workflow_idempotency();
40013
- init_request_auth_context();
40014
- var IDEMPOTENCY_KEY_PATTERN = /^[\x21-\x7E]{1,255}$/;
40015
- var IDEMPOTENT_REPLAYED_HEADER = "Idempotent-Replayed";
40016
- var idempotencyKeyHeader = (accepted) => object2({
40017
- "Idempotency-Key": string2().regex(IDEMPOTENCY_KEY_PATTERN).optional().describe("Optional client-generated key, 1-255 visible ASCII characters (a UUID works). " + `The first request the server accepts under a key ${accepted}; a retry with the same key ` + "and an equivalent body gets that request's status and body back (with " + `\`${IDEMPOTENT_REPLAYED_HEADER}: true\`) and changes nothing. The key is scoped to the ` + "caller's identity and this operation; it is not a credential. The same key with a " + "different body is a 409. A request rejected before it is accepted (validation, auth, " + "not found, disabled) does not use up the key. Accepted keys do not expire.")
40018
- });
40019
- function idempotencyPrincipal(req, myAgentId) {
40020
- const auth = getRequestAuth(req);
40021
- switch (auth?.kind) {
40022
- case "user":
40023
- return `user:${auth.userId}`;
40024
- case "agent":
40025
- return `agent:${auth.agentId}`;
40026
- case "controller":
40027
- return `controller:${auth.controllerId}`;
40028
- case "guest":
40029
- return null;
40030
- default:
40031
- return myAgentId ? `agent:${myAgentId}` : "operator";
40032
- }
40033
- }
40034
- function readIdempotencyKey(req, res, myAgentId) {
40035
- const raw = req.headers["idempotency-key"];
40036
- if (raw === undefined)
40037
- return;
40038
- const key = Array.isArray(raw) ? raw.join(", ") : raw;
40039
- if (!IDEMPOTENCY_KEY_PATTERN.test(key)) {
40040
- jsonError(res, "Idempotency-Key must be 1-255 visible ASCII characters", 400);
40041
- return null;
40042
- }
40043
- const principal = idempotencyPrincipal(req, myAgentId);
40044
- if (!principal) {
40045
- jsonError(res, "Idempotency-Key needs an identified caller", 400);
40046
- return null;
40047
- }
40048
- return { principal, key };
40049
- }
40050
- async function replayAcceptedOperation(res, claim, send) {
40051
- const accepted = await findAcceptedWorkflowOperation(claim);
40052
- if (!accepted)
40053
- return false;
40054
- if (accepted.fingerprint !== claim.fingerprint) {
40055
- jsonError(res, "Idempotency-Key was already used for a different request", 409);
40056
- } else if (accepted.resourceDeletedAt !== null) {
40057
- jsonError(res, "The workflow this Idempotency-Key created or triggered was deleted; send a new key to start over", 410);
40058
- } else {
40059
- res.setHeader(IDEMPOTENT_REPLAYED_HEADER, "true");
40060
- send(accepted.body);
40061
- }
40062
- return true;
40063
- }
40064
-
40065
- // src/http/workflows.ts
40066
40053
  var WorkflowWithFavoriteSchema = WorkflowSchema.extend({ favorite: boolean() });
40067
40054
  var WorkflowSaveResponseSchema = WorkflowSchema.extend({
40068
40055
  warnings: array2(string2()).optional()
@@ -40256,6 +40243,9 @@ var triggerWorkflowRoute = route({
40256
40243
  description: "With an `Idempotency-Key`, a retry returns the accepted run's `runId` and `skipped` without starting, resuming or waiting for anything, even after the workflow was disabled or edited and whatever state the run is in now.",
40257
40244
  tags: ["Workflows"],
40258
40245
  params: object2({ id: string2() }),
40246
+ query: object2({
40247
+ wait: _enum2(["true", "false"]).optional().describe("Default true: respond after the run's instant steps ran, when it finishes or parks at its first async step. " + "false: respond as soon as the run is committed and walk it in the background.")
40248
+ }),
40259
40249
  headers: idempotencyKeyHeader("starts one run"),
40260
40250
  responses: {
40261
40251
  201: {
@@ -40854,6 +40844,7 @@ async function handleWorkflows(req, res, pathSegments, queryParams, myAgentId) {
40854
40844
  runId = await startWorkflowExecution2(workflow, body, getExecutorRegistry2(), {
40855
40845
  triggerType: "api",
40856
40846
  requestedByUserId: await resolveHttpAuditUserId(req, myAgentId) ?? undefined,
40847
+ detach: parsed.query.wait === "false",
40857
40848
  accept: claim ? async (run) => {
40858
40849
  const response = { runId: run.runId, skipped: run.skipped };
40859
40850
  await recordAcceptedWorkflowOperation(claim, {
@@ -41098,6 +41089,7 @@ async function handleX(req, res, pathSegments) {
41098
41089
  jsonError(res, "workspace-rw scripts are not supported", 501);
41099
41090
  return true;
41100
41091
  }
41092
+ let hostValidatedArgs = false;
41101
41093
  if (script.argsJsonSchema) {
41102
41094
  try {
41103
41095
  const schema = JSON.parse(script.argsJsonSchema);
@@ -41111,6 +41103,7 @@ async function handleX(req, res, pathSegments) {
41111
41103
  });
41112
41104
  return true;
41113
41105
  }
41106
+ hostValidatedArgs = true;
41114
41107
  } catch {}
41115
41108
  }
41116
41109
  const timeoutMs = resolveTimeoutMs(req);
@@ -41122,7 +41115,9 @@ async function handleX(req, res, pathSegments) {
41122
41115
  const output = await runScriptWithRunCredential({
41123
41116
  source: script.source,
41124
41117
  args: args ?? null,
41118
+ [HOST_VALIDATED_ARGS]: hostValidatedArgs,
41125
41119
  fsMode: "none",
41120
+ executor: script.executor,
41126
41121
  agentId: endpoint.agentId,
41127
41122
  timeoutMs,
41128
41123
  egressSecrets: credentials.egressSecrets,
@@ -41373,7 +41368,7 @@ var httpServer = createHttpServer(async (req, res) => {
41373
41368
  });
41374
41369
  });
41375
41370
  var detachRealtime = attachRealtimeTransport(httpServer);
41376
- var { attachControllerTransport } = await import("./controllers-connect-r2za39ef.js");
41371
+ var { attachControllerTransport } = await import("./controllers-connect-nep9h2xv.js");
41377
41372
  var detachControllers = attachControllerTransport(httpServer);
41378
41373
  var stopWorkerNudges = startWorkerNudgeListener();
41379
41374
  var stopRoomDeletion = realtimeBus.subscribe("room:namespace-deleted", (namespace) => {
@@ -41402,7 +41397,7 @@ async function shutdown() {
41402
41397
  sessionsProcessed: getServerSessionsProcessed()
41403
41398
  });
41404
41399
  if (hasCapability("scheduling")) {
41405
- const { stopScheduler } = await import("./index-38t35h0n.js");
41400
+ const { stopScheduler } = await import("./index-zyq8ct52.js");
41406
41401
  stopScheduler();
41407
41402
  }
41408
41403
  stopHeartbeat2();
@@ -41413,8 +41408,8 @@ async function shutdown() {
41413
41408
  await stopScriptRunSupervisor();
41414
41409
  await stopSlackApp2();
41415
41410
  await stopChatSdk();
41416
- if (process.env.OAUTH_KEEPALIVE_DISABLE !== "true") {
41417
- const { stopOAuthKeepalive } = await import("./keepalive-em0117bp.js");
41411
+ if (!isEnvFlagEnabled("OAUTH_KEEPALIVE_DISABLE", false)) {
41412
+ const { stopOAuthKeepalive } = await import("./keepalive-xdvsamvj.js");
41418
41413
  await stopOAuthKeepalive();
41419
41414
  }
41420
41415
  stopOAuthPendingGc();
@@ -41494,21 +41489,21 @@ try {
41494
41489
  console.warn("[startup] CAPABILITIES upgrade seed failed (non-fatal):", err);
41495
41490
  }
41496
41491
  try {
41497
- const { ensurePricingSeeded } = await import("./boot-seeds-9bmkspyw.js");
41492
+ const { ensurePricingSeeded } = await import("./boot-seeds-ca84dhnn.js");
41498
41493
  ensurePricingSeeded();
41499
- const { startPricingRefreshLoop } = await import("./pricing-refresh-yb75wv33.js");
41494
+ const { startPricingRefreshLoop } = await import("./pricing-refresh-dw2tgb53.js");
41500
41495
  startPricingRefreshLoop();
41501
41496
  } catch (err) {
41502
41497
  console.error("[startup] Failed to seed pricing rows:", err);
41503
41498
  }
41504
41499
  try {
41505
- const { ensureModelProfilesSeeded } = await import("./boot-seeds-9bmkspyw.js");
41500
+ const { ensureModelProfilesSeeded } = await import("./boot-seeds-ca84dhnn.js");
41506
41501
  await ensureModelProfilesSeeded();
41507
41502
  } catch (err) {
41508
41503
  console.error("[startup] Failed to seed model profiles:", err);
41509
41504
  }
41510
41505
  try {
41511
- const { ensureRbacSeeded } = await import("./boot-seeds-9bmkspyw.js");
41506
+ const { ensureRbacSeeded } = await import("./boot-seeds-ca84dhnn.js");
41512
41507
  ensureRbacSeeded();
41513
41508
  } catch (err) {
41514
41509
  console.error("[startup] Failed to sync RBAC seed rows:", err);
@@ -41516,7 +41511,7 @@ try {
41516
41511
  throw err;
41517
41512
  }
41518
41513
  try {
41519
- const { runAllSeeders } = await import("./index-qhjf2htm.js");
41514
+ const { runAllSeeders } = await import("./index-jwt2bj6f.js");
41520
41515
  await runAllSeeders({ scriptEmbeddingMode: "skip" });
41521
41516
  } catch (err) {
41522
41517
  console.error("[startup] Failed to seed built-in entities:", err);
@@ -41579,42 +41574,42 @@ httpServer.listen(port, async () => {
41579
41574
  await initWorkflows2();
41580
41575
  await startScriptRunSupervisor(getMcpBaseUrl());
41581
41576
  if (hasCapability("scheduling")) {
41582
- const { startScheduler } = await import("./index-38t35h0n.js");
41583
- const { getExecutorRegistry } = await import("./index-k0yt1tvq.js");
41577
+ const { startScheduler } = await import("./index-zyq8ct52.js");
41578
+ const { getExecutorRegistry } = await import("./index-z5h22pes.js");
41584
41579
  const intervalMs = Number(process.env.SCHEDULER_INTERVAL_MS) || 1e4;
41585
41580
  startScheduler(getExecutorRegistry(), intervalMs, {
41586
41581
  runId: globalState.__runId
41587
41582
  });
41588
41583
  }
41589
41584
  if (!isEnvFlagEnabled("HEARTBEAT_DISABLE", false)) {
41590
- const { startHeartbeat } = await import("./index-yqgbfgaj.js");
41585
+ const { startHeartbeat } = await import("./index-y1ajx04a.js");
41591
41586
  const heartbeatMs = Number(process.env.HEARTBEAT_INTERVAL_MS) || 90000;
41592
41587
  startHeartbeat(heartbeatMs);
41593
41588
  }
41594
41589
  startPoolRouting();
41595
41590
  startRuntimeSupervisor();
41596
- if (process.env.OAUTH_KEEPALIVE_DISABLE !== "true") {
41597
- const { startOAuthKeepalive } = await import("./keepalive-em0117bp.js");
41591
+ if (!isEnvFlagEnabled("OAUTH_KEEPALIVE_DISABLE", false)) {
41592
+ const { startOAuthKeepalive } = await import("./keepalive-xdvsamvj.js");
41598
41593
  startOAuthKeepalive();
41599
41594
  }
41600
- if (process.env.OAUTH_REFRESH_SWEEP_DISABLE !== "true") {
41601
- const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-xysj4yse.js");
41595
+ if (!isEnvFlagEnabled("OAUTH_REFRESH_SWEEP_DISABLE", false)) {
41596
+ const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-jd4r7zbs.js");
41602
41597
  startOAuthRefreshSweep();
41603
41598
  }
41604
41599
  startOAuthPendingGc();
41605
41600
  await startMemoryGc();
41606
41601
  await startDbRetention();
41607
41602
  startHumanFreeDrain();
41608
- import("./boot-reembed-f4nn561n.js").then(({ runBootReembed }) => runBootReembed()).catch((err) => {
41603
+ import("./boot-reembed-5h37a2c2.js").then(({ runBootReembed }) => runBootReembed()).catch((err) => {
41609
41604
  console.error("[boot-reembed] startup backfill failed (non-fatal):", err);
41610
41605
  });
41611
- import("./boot-reembed-6c1sjfnr.js").then(({ runBootReembedScripts }) => runBootReembedScripts()).catch((err) => {
41606
+ import("./boot-reembed-7h78vmvv.js").then(({ runBootReembedScripts }) => runBootReembedScripts()).catch((err) => {
41612
41607
  console.error("[boot-reembed-scripts] startup backfill failed (non-fatal):", err);
41613
41608
  });
41614
- import("./boot-scrub-sweep-d4w9gajf.js").then(({ runBootScrubSweep }) => runBootScrubSweep()).catch((err) => {
41609
+ import("./boot-scrub-sweep-8mawd4gw.js").then(({ runBootScrubSweep }) => runBootScrubSweep()).catch((err) => {
41615
41610
  console.error("[boot-scrub-sweep] startup scrub failed (non-fatal):", err);
41616
41611
  });
41617
- import("./session-source-backfill-qgtc86z1.js").then(({ runSessionSourceBackfill }) => runSessionSourceBackfill()).catch((err) => {
41612
+ import("./session-source-backfill-424wzv0r.js").then(({ runSessionSourceBackfill }) => runSessionSourceBackfill()).catch((err) => {
41618
41613
  console.error("[session-source-backfill] startup run failed (non-fatal):", err);
41619
41614
  });
41620
41615
  }).on("error", (err) => {