@desplega.ai/agent-swarm 2.7.10 → 2.8.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 (281) hide show
  1. package/dist/acp-adapter-t949vbbp.js +15 -0
  2. package/dist/{actions-b8aqhrsg.js → actions-7e9czc7s.js} +18 -19
  3. package/dist/{amp-adapter-4c165vgn.js → amp-adapter-gv6cbb7d.js} +2 -3
  4. package/dist/{app-m9khefrh.js → app-b9fbkp9v.js} +3 -3
  5. package/dist/{assistant-rh4v3ntz.js → assistant-wjb7v4c7.js} +20 -21
  6. package/dist/{boot-args-schema-hwkc8bzv.js → boot-args-schema-2t37e0fe.js} +1 -1
  7. package/dist/{boot-reembed-5y6yw9sj.js → boot-reembed-a35nkyr1.js} +1 -1
  8. package/dist/{boot-reembed-fdyk55h4.js → boot-reembed-gka3zas7.js} +1 -1
  9. package/dist/{boot-scrub-sweep-r5r8kqsn.js → boot-scrub-sweep-65sdnp6c.js} +3 -3
  10. package/dist/{boot-seeds-8f9zt5cm.js → boot-seeds-x42tzytw.js} +4 -5
  11. package/dist/{claude-adapter-s5df247c.js → claude-adapter-v221b2fd.js} +7 -8
  12. package/dist/{claude-managed-adapter-h74d06yz.js → claude-managed-adapter-29eq09wd.js} +2 -2
  13. package/dist/{claude-managed-setup-9gsmwzyx.js → claude-managed-setup-9m6450zk.js} +2 -2
  14. package/dist/{claude-sdk-session-dq1j4nz9.js → claude-sdk-session-0q0ptaba.js} +9066 -8818
  15. package/dist/{cli-n5yexkdg.js → cli-0b4zam62.js} +1 -0
  16. package/dist/{cli-5wfz00be.js → cli-0jzra9ad.js} +2 -2
  17. package/dist/{cli-eqtfgfr6.js → cli-2gxeg5gr.js} +1 -1
  18. package/dist/{cli-eqk5p56g.js → cli-2wnq8jkz.js} +9 -9
  19. package/dist/{cli-hfkwwy1h.js → cli-2zp0et3v.js} +21 -2
  20. package/dist/{cli-rt0ag4x1.js → cli-334z18y3.js} +4 -4
  21. package/dist/{cli-6m6b4bep.js → cli-3rkdne1h.js} +2 -2
  22. package/dist/{cli-3xddv0rk.js → cli-4txa0ter.js} +5 -7
  23. package/dist/{cli-jc1g9ndz.js → cli-5j88qqa8.js} +10 -5
  24. package/dist/{cli-xfjrc279.js → cli-5mrq3ake.js} +48 -14
  25. package/dist/{cli-n07eecjs.js → cli-6t09sdhy.js} +3 -3
  26. package/dist/{cli-38yww4e9.js → cli-6wxjceza.js} +8 -8
  27. package/dist/{cli-5xcb8gxq.js → cli-7b8sbmag.js} +8 -8
  28. package/dist/{cli-3xj33nrx.js → cli-7cp6aa1q.js} +10 -3
  29. package/dist/{cli-mp9aa8g5.js → cli-7p1kvkck.js} +6 -6
  30. package/dist/{cli-w3bk0dgv.js → cli-8aes17e4.js} +2 -2
  31. package/dist/{cli-n9abj89w.js → cli-8fknbnhw.js} +8 -8
  32. package/dist/{cli-xd5ebp64.js → cli-8kzasymh.js} +3 -3
  33. package/dist/{cli-2tsfpc70.js → cli-a7wvp2km.js} +1 -1
  34. package/dist/{cli-kx4c8j05.js → cli-abejgen1.js} +63 -19
  35. package/dist/{cli-36wdfzgn.js → cli-bsywb58a.js} +8 -8
  36. package/dist/{cli-yz7v0sh4.js → cli-c55z5chy.js} +4 -6
  37. package/dist/{cli-18qt3few.js → cli-deefvewm.js} +1 -1
  38. package/dist/{cli-jg24scat.js → cli-ee0b971j.js} +3 -3
  39. package/dist/cli-f3vq58d2.js +242 -0
  40. package/dist/{cli-3xcwp3z8.js → cli-ffhtssbp.js} +2 -2
  41. package/dist/{cli-rjyghzg4.js → cli-g70vxtjh.js} +2 -2
  42. package/dist/{cli-g1px1g2e.js → cli-gxkx0zzp.js} +1 -1
  43. package/dist/{cli-j7d73g1y.js → cli-h38x262p.js} +3035 -354
  44. package/dist/{cli-zjphdj1a.js → cli-j790gp2w.js} +40 -18
  45. package/dist/{cli-f2zenhja.js → cli-kc7v1nfv.js} +1 -1
  46. package/dist/{cli-td33w98c.js → cli-m23zjcy2.js} +10 -10
  47. package/dist/{cli-8ewkreqd.js → cli-m28atx8q.js} +7 -9
  48. package/dist/{cli-x9exydey.js → cli-m4dqmnbp.js} +1 -1
  49. package/dist/{cli-ybjdc978.js → cli-mrt48bx7.js} +7 -4
  50. package/dist/{cli-mr97t7cc.js → cli-p1bq50aa.js} +263 -14
  51. package/dist/{cli-ttbqe3q4.js → cli-p1w18yhx.js} +1 -1
  52. package/dist/{cli-nj3x45rw.js → cli-p2gfst4m.js} +52 -43
  53. package/dist/{cli-z9cs5m0w.js → cli-pasjcnmj.js} +12 -12
  54. package/dist/{cli-an1knn2k.js → cli-qa4wdgsy.js} +5 -5
  55. package/dist/{cli-xncjscpm.js → cli-qfedvmcr.js} +50 -24
  56. package/dist/{cli-tmft5dz2.js → cli-qmqk2yc2.js} +1 -1
  57. package/dist/{cli-bxz823sz.js → cli-qsnnd04k.js} +1 -1
  58. package/dist/{cli-cr14kftt.js → cli-qwca7s44.js} +3 -3
  59. package/dist/{cli-7wz05bx3.js → cli-rfywm85n.js} +460 -737
  60. package/dist/{cli-v2fwbnsk.js → cli-rmmpt0wm.js} +6 -6
  61. package/dist/{cli-xbtq4d6s.js → cli-rzsy6nc6.js} +12 -8
  62. package/dist/{cli-0m7rtm11.js → cli-s7t6p9my.js} +1 -1
  63. package/dist/{cli-16phend6.js → cli-sdtt3men.js} +1 -1
  64. package/dist/{cli-pyrxt9gw.js → cli-tk7cjj8h.js} +1 -1
  65. package/dist/{cli-xvymtmv4.js → cli-tqegb8eq.js} +3 -3
  66. package/dist/{cli-kf3pxxdg.js → cli-v1dv1r37.js} +1 -1
  67. package/dist/{cli-h49ejvmc.js → cli-wcg8x116.js} +1 -1
  68. package/dist/{cli-q581b386.js → cli-wk18cm92.js} +5 -5
  69. package/dist/{cli-4vwxp550.js → cli-x1wa213s.js} +1 -1
  70. package/dist/{cli-jrp1dt73.js → cli-xzm9vcfg.js} +1 -1
  71. package/dist/{cli-eb2azq8n.js → cli-y97qxcfx.js} +9 -9
  72. package/dist/{cli-55bkx8hh.js → cli-yq3zak69.js} +1 -1
  73. package/dist/cli.js +17 -17
  74. package/dist/{codex-adapter-yr60sme6.js → codex-adapter-30j9bpzd.js} +5 -6
  75. package/dist/{codex-hook-fac6175r.js → codex-hook-h3vk6xzr.js} +1 -1
  76. package/dist/{codex-session-runner-pch8x584.js → codex-session-runner-8vp57v8w.js} +5 -6
  77. package/dist/{commands-phjfbkv0.js → commands-bngnz9g7.js} +3 -3
  78. package/dist/{controller-jkx994pz.js → controller-hxx8wwy1.js} +2 -2
  79. package/dist/{controllers-connect-c4448kwa.js → controllers-connect-e2b4gyxc.js} +19 -20
  80. package/dist/{cursor-adapter-ndebqnm8.js → cursor-adapter-n5nc3mfe.js} +1 -2
  81. package/dist/{db-ez6egt6v.js → db-bgm7vkc0.js} +3 -3
  82. package/dist/{db-ef32tbfc.js → db-c6np41ca.js} +10 -2
  83. package/dist/{devin-adapter-z46ep5ph.js → devin-adapter-xedz98zv.js} +1 -1
  84. package/dist/{dispatcher-g3tt9hs9.js → dispatcher-jnybck15.js} +17 -18
  85. package/dist/{dsh-adapter-tcyn3099.js → dsh-adapter-nrhbrjz8.js} +1 -2
  86. package/dist/{easter-egg-3d-e36hk5td.js → easter-egg-3d-533knw22.js} +1 -1
  87. package/dist/{embedding-space-4kyh5qqj.js → embedding-space-crsm2zp0.js} +6 -6
  88. package/dist/{embeddings-6a8v4a6t.js → embeddings-e7z3f27f.js} +1 -1
  89. package/dist/{execute-3cbg0twf.js → execute-b3mrb1mv.js} +1 -1
  90. package/dist/{external-channel-se646snz.js → external-channel-m77wf5z3.js} +2 -2
  91. package/dist/{fx-adapter-yw795hqq.js → fx-adapter-b6w0kf56.js} +7 -8
  92. package/dist/{grok-adapter-ttmcss2j.js → grok-adapter-4sqtebdk.js} +7 -8
  93. package/dist/handlers-kdjcyzdj.js +32 -0
  94. package/dist/heartbeat-xgb036sx.js +43 -0
  95. package/dist/{hook-g3nhexsy.js → hook-5h02c9ga.js} +6 -6
  96. package/dist/{hook-hq93y5ej.js → hook-xsk1jbha.js} +5 -5
  97. package/dist/{http-5a9p4h6y.js → http-txe7qhvn.js} +282 -140
  98. package/dist/{index-6haqt3v5.js → index-4a0670yh.js} +8917 -8476
  99. package/dist/index-835xdgnm.js +33 -0
  100. package/dist/index-d469300x.js +37 -0
  101. package/dist/index-rzqwp11g.js +32 -0
  102. package/dist/{index-s72rqgsx.js → index-tvfafeyy.js} +1 -1
  103. package/dist/{index-hgn3c961.js → index-vk63emp7.js} +978 -35
  104. package/dist/{index-3c5pxbge.js → index-ysvbhg5m.js} +1 -1
  105. package/dist/{keepalive-1j4n4dmk.js → keepalive-4zsrce78.js} +3 -3
  106. package/dist/lead-yqt47dkr.js +70 -0
  107. package/dist/{maintenance-dmghacy5.js → maintenance-86jvartk.js} +1 -1
  108. package/dist/{oauth-refresh-sweep-yy06c03c.js → oauth-refresh-sweep-j52kg9pr.js} +2 -2
  109. package/dist/{onboard-52f9t5dm.js → onboard-c2aj5p8q.js} +3 -3
  110. package/dist/{opencode-adapter-krnh9jkn.js → opencode-adapter-dsagkhtw.js} +5 -6
  111. package/dist/{otel-impl-xjqz6wjj.js → otel-impl-yyy203z8.js} +1 -1
  112. package/dist/{pi-mono-adapter-dbxyp0qv.js → pi-mono-adapter-546cd1cc.js} +9 -9
  113. package/dist/{pricing-refresh-ctdr74pd.js → pricing-refresh-1rgzqyzz.js} +2 -3
  114. package/dist/{rbac-roles-q0gr8eyj.js → rbac-roles-e70xfeyj.js} +4 -6
  115. package/dist/{rbac-roles-ehv8s10n.js → rbac-roles-q89qe8er.js} +3 -3
  116. package/dist/{registry-hpjfmcfz.js → registry-32b1mft6.js} +1 -1
  117. package/dist/{render-v2-5b6chvcq.js → render-v2-k6tt107q.js} +3 -3
  118. package/dist/{resume-5a5d2845.js → resume-cnnrjfxa.js} +6 -6
  119. package/dist/{runtime-khxszyfp.js → runtime-1hv06jsn.js} +1 -1
  120. package/dist/{session-access-gj0bjhqg.js → session-access-xkxkjw3n.js} +4 -4
  121. package/dist/{session-source-backfill-2sy0krfk.js → session-source-backfill-1d5pdwww.js} +2 -2
  122. package/dist/{setup-7ssfakk1.js → setup-se8q7gkc.js} +1 -1
  123. package/dist/{virtual-modules-pjj0knwf.js → virtual-modules-gazyapte.js} +3 -3
  124. package/dist/{work-objects-bf3syvhq.js → work-objects-1kxnbzy5.js} +20 -21
  125. package/dist/{worker-follow-up-38xevga6.js → worker-follow-up-zqm8apt4.js} +17 -18
  126. package/dist/worker-j6xxtq7p.js +70 -0
  127. package/openapi.json +334 -7
  128. package/package.json +4 -4
  129. package/src/apps/definition.ts +11 -0
  130. package/src/apps/store.ts +28 -8
  131. package/src/be/db/model-profiles.ts +147 -38
  132. package/src/be/db/tasks/read.ts +5 -1
  133. package/src/be/db/workflow-run-definitions.ts +117 -0
  134. package/src/be/db.ts +24 -3
  135. package/src/be/memory/constants.ts +14 -1
  136. package/src/be/memory/key-paths.ts +8 -0
  137. package/src/be/memory/providers/sqlite-store.ts +160 -10
  138. package/src/be/memory/task-learning.ts +79 -14
  139. package/src/be/memory/types.ts +24 -1
  140. package/src/be/migrations/279_backfill_learning_expiry.sql +15 -0
  141. package/src/be/migrations/281_model_profiles_pr2.sql +28 -0
  142. package/src/be/migrations/283_workflow_run_definitions.sql +14 -0
  143. package/src/be/model-profile-check.ts +284 -0
  144. package/src/be/model-tier-resolution.ts +112 -12
  145. package/src/be/multi-runtime.ts +27 -0
  146. package/src/be/runtime-pools/routing.ts +52 -4
  147. package/src/be/scripts/typecheck.ts +1 -0
  148. package/src/be/seed-scripts/catalog/dreaming-learnings.ts +552 -0
  149. package/src/be/seed-scripts/catalog/dreaming-memtax-create.ts +389 -14
  150. package/src/be/seed-scripts/catalog/dreaming-memtax.ts +6 -3
  151. package/src/be/seed-scripts/index.ts +9 -0
  152. package/src/be/steering.ts +8 -2
  153. package/src/commands/onboard/agent-fs-version.ts +1 -1
  154. package/src/commands/runner.ts +32 -1
  155. package/src/fs/provider.ts +17 -3
  156. package/src/heartbeat/heartbeat.ts +12 -1
  157. package/src/heartbeat/index.ts +1 -0
  158. package/src/http/agents.ts +56 -4
  159. package/src/http/apps.ts +3 -1
  160. package/src/http/config.ts +2 -6
  161. package/src/http/index.ts +2 -3
  162. package/src/http/model-profiles.ts +58 -10
  163. package/src/http/poll.ts +36 -3
  164. package/src/http/schedules.ts +42 -3
  165. package/src/http/tasks.ts +37 -12
  166. package/src/http/workflows.ts +15 -2
  167. package/src/prompts/session-templates.ts +1 -1
  168. package/src/providers/acp-targets.ts +11 -6
  169. package/src/providers/amp-adapter.ts +1 -1
  170. package/src/providers/claude-sdk-session.ts +132 -23
  171. package/src/providers/codex-skill-resolver.ts +10 -4
  172. package/src/providers/cursor-adapter.ts +1 -1
  173. package/src/providers/devin-skill-resolver.ts +5 -5
  174. package/src/providers/dsh-adapter.ts +1 -1
  175. package/src/scheduler/schedule-task.ts +1 -0
  176. package/src/scripts-runtime/sdk-allowlist.ts +1 -0
  177. package/src/scripts-runtime/swarm-sdk.ts +18 -1
  178. package/src/scripts-runtime/types/stdlib.d.ts +1 -0
  179. package/src/scripts-runtime/types/swarm-sdk.d.ts +1 -0
  180. package/src/server.ts +2 -0
  181. package/src/slack/app.ts +93 -0
  182. package/src/slack/inbound-dispatch.ts +18 -1
  183. package/src/slack/workspace-guard.ts +345 -0
  184. package/src/tasks/task-terminal-effects.ts +4 -0
  185. package/src/tasks/worker-follow-up.ts +102 -2
  186. package/src/tests/acp-adapter.test.ts +82 -0
  187. package/src/tests/apps-icon.test.ts +120 -0
  188. package/src/tests/chained-task-follow-up.test.ts +248 -0
  189. package/src/tests/check-pr-body.test.ts +40 -0
  190. package/src/tests/claude-sdk-lifecycle.test.ts +216 -1
  191. package/src/tests/claude-sdk-process.fixture.ts +57 -0
  192. package/src/tests/codex-skill-resolver.test.ts +31 -0
  193. package/src/tests/credentials-allowlist.test.ts +470 -0
  194. package/src/tests/db-task-read-contract.test.ts +5 -0
  195. package/src/tests/db-task-write-contract.test.ts +5 -0
  196. package/src/tests/deferred-wake-follow-up.test.ts +47 -0
  197. package/src/tests/docs-index-footprint.test.js +3 -3
  198. package/src/tests/dreaming-learnings.test.ts +1395 -0
  199. package/src/tests/dsh-adapter.test.ts +1 -1
  200. package/src/tests/explicit-model-validation.test.ts +2 -0
  201. package/src/tests/fs-provider.test.ts +42 -0
  202. package/src/tests/heartbeat.test.ts +28 -1
  203. package/src/tests/human-free-reclassify.test.ts +5 -1
  204. package/src/tests/list-endpoint-slimming.test.ts +17 -0
  205. package/src/tests/migration-283-workflow-run-definitions.test.ts +69 -0
  206. package/src/tests/model-profile-check.test.ts +387 -0
  207. package/src/tests/model-profiles-api.test.ts +528 -1
  208. package/src/tests/profile-claim.test.ts +415 -3
  209. package/src/tests/profile-tier-alias.test.ts +382 -0
  210. package/src/tests/schedule-profile.test.ts +359 -0
  211. package/src/tests/script-connections.test.ts +6 -0
  212. package/src/tests/script-per-script-executor.test.ts +1 -0
  213. package/src/tests/scripts-sdk-bridge-tool-failure.test.ts +141 -0
  214. package/src/tests/seed-scripts.test.ts +2 -2
  215. package/src/tests/slack-inbound-receipts.test.ts +22 -2
  216. package/src/tests/slack-socket-ack.test.ts +16 -1
  217. package/src/tests/slack-workspace-guard.test.ts +905 -0
  218. package/src/tests/steering-core.test.ts +40 -0
  219. package/src/tests/store-progress-learning.test.ts +605 -20
  220. package/src/tests/tool-annotations.test.ts +1 -1
  221. package/src/tests/workflow-convergence.test.ts +46 -40
  222. package/src/tests/workflow-definition-pinning-recovery.test.ts +552 -0
  223. package/src/tests/workflow-definition-pinning.test.ts +645 -0
  224. package/src/tests/workflow-executors.test.ts +16 -7
  225. package/src/tests/workflow-foreach.test.ts +43 -20
  226. package/src/tests/workflow-notify-slack-ready.test.ts +161 -0
  227. package/src/tests/workflow-profile.test.ts +328 -0
  228. package/src/tools/app-upsert.ts +1 -1
  229. package/src/tools/memory-edit.ts +2 -1
  230. package/src/tools/model-profiles/check-model-profile.ts +63 -0
  231. package/src/tools/schedules/create-schedule.ts +45 -4
  232. package/src/tools/schedules/patch-schedule.ts +50 -4
  233. package/src/tools/schedules/update-schedule.ts +50 -4
  234. package/src/tools/send-task.ts +17 -2
  235. package/src/tools/store-progress.ts +15 -3
  236. package/src/tools/task-action.ts +9 -1
  237. package/src/tools/templates.ts +13 -0
  238. package/src/tools/tool-config.ts +2 -1
  239. package/src/tools/utils.ts +61 -4
  240. package/src/tools/workflows/create-workflow.ts +1 -1
  241. package/src/tools/workflows/retry-workflow-run.ts +1 -1
  242. package/src/tools/workflows/update-workflow.ts +10 -1
  243. package/src/types.ts +56 -1
  244. package/src/utils/credentials.ts +89 -12
  245. package/src/workflows/engine.ts +10 -1
  246. package/src/workflows/executors/agent-task.ts +21 -2
  247. package/src/workflows/executors/foreach.ts +4 -1
  248. package/src/workflows/executors/notify.ts +62 -6
  249. package/src/workflows/executors/sub-workflow.ts +1 -1
  250. package/src/workflows/executors/swarm-script.ts +4 -1
  251. package/src/workflows/foreach-driver.ts +8 -5
  252. package/src/workflows/limits.ts +2 -1
  253. package/src/workflows/model-validation.ts +27 -2
  254. package/src/workflows/patch-definition.ts +3 -1
  255. package/src/workflows/recovery.ts +6 -6
  256. package/src/workflows/resume.ts +9 -9
  257. package/src/workflows/retry-poller.ts +2 -2
  258. package/templates/skills/apps/SKILL.md +2 -0
  259. package/templates/skills/apps/content.md +2 -0
  260. package/templates/skills/code-quality/content.md +12 -0
  261. package/templates/skills/memory/content.md +8 -0
  262. package/templates/skills/scheduling/config.json +1 -1
  263. package/templates/skills/scheduling/content.md +2 -2
  264. package/templates/skills/swarm-docs/content.md +4 -0
  265. package/templates/skills/swarm-extensions/content.md +1 -1
  266. package/templates/skills/swarm-scripts/SKILL.md +1 -1
  267. package/templates/skills/swarm-scripts/content.md +1 -1
  268. package/templates/skills/work-on-task/SKILL.md +2 -0
  269. package/templates/skills/work-on-task/content.md +2 -0
  270. package/templates/workflows/dreaming/content.md +174 -7
  271. package/dist/acp-adapter-srfhs1s9.js +0 -16
  272. package/dist/cli-bzvs88tv.js +0 -339
  273. package/dist/cli-cyn9v8zr.js +0 -748
  274. package/dist/cli-ed6yqpf1.js +0 -779
  275. package/dist/handlers-17wha3ze.js +0 -33
  276. package/dist/heartbeat-gwewgdms.js +0 -42
  277. package/dist/index-8arwq8mw.js +0 -34
  278. package/dist/index-tpw054az.js +0 -38
  279. package/dist/index-waq75j2j.js +0 -31
  280. package/dist/lead-re73kdgc.js +0 -72
  281. package/dist/worker-r8mz7a65.js +0 -72
@@ -64,6 +64,13 @@ import {
64
64
  closeDb2,
65
65
  getDbClient2,
66
66
  init_runtime2,
67
+ isRbacEnabled,
68
+ decideToolAdmission,
69
+ LEGACY_RULES,
70
+ setAuditSink,
71
+ clearAuditSink,
72
+ can,
73
+ init_rbac,
67
74
  CHAT_SDK_ADAPTER_NAMES,
68
75
  isAdapterEntryEnabled,
69
76
  init_schema,
@@ -134,6 +141,35 @@ import {
134
141
  recordApprovalVotes2,
135
142
  getPendingApprovalsForTasks2,
136
143
  computeContentHash2,
144
+ taskModelPin,
145
+ init_model_pin,
146
+ normalizeModelKey,
147
+ init_pricing_normalize,
148
+ upsertModelCatalogOverlay,
149
+ deleteModelCatalogOverlay,
150
+ loadModelsCatalog,
151
+ init_model_catalog_store,
152
+ listHarnessModelSupport,
153
+ recordHarnessModelSupport,
154
+ agentRanModel,
155
+ getAgentHarnessCliVersion,
156
+ setAgentHarnessCliVersion,
157
+ init_harness_model_support,
158
+ sanitizeModelTierOverrides,
159
+ parseModelTierOverridesHeader,
160
+ setAgentModelTierOverrides,
161
+ previewModelTiers,
162
+ recordClaimModelResolution,
163
+ init_model_tier_resolution,
164
+ harnessModelErrorFor,
165
+ poolTaskRunsOnHarness,
166
+ explicitModelError,
167
+ explicitModelErrorForAgent,
168
+ init_model_validation2,
169
+ runtimeReadsRepoSecrets,
170
+ checkProfileForAgent,
171
+ formatProfileCheckFailures,
172
+ init_model_profile_check,
137
173
  startTaskSearchBackfill,
138
174
  stopTaskSearchBackfill,
139
175
  init_search_index,
@@ -148,6 +184,7 @@ import {
148
184
  getLatestScriptRunStepTaskByContextKey2,
149
185
  init_read,
150
186
  MODEL_PROFILE_CONFIG_KEY,
187
+ hasUnreadableCredentialAllowlist,
151
188
  listModelProfiles,
152
189
  getModelProfileByName,
153
190
  createModelProfile,
@@ -156,6 +193,7 @@ import {
156
193
  modelProfileRefError,
157
194
  deleteModelProfile,
158
195
  taskProfileError,
196
+ scheduleProfileUpdate,
159
197
  init_model_profiles,
160
198
  AssetKeyMovesBlockedError2,
161
199
  assertAssetKeyMovesAllowed2,
@@ -484,7 +522,7 @@ import {
484
522
  countScriptRunJournalSteps2,
485
523
  countScriptRunJournalAgentTaskSteps2,
486
524
  init_db4
487
- } from "./cli-j7d73g1y.js";
525
+ } from "./cli-h38x262p.js";
488
526
  import {
489
527
  PRIMARY_ROLE_NAMES2,
490
528
  OperatorGrantedTargetError2,
@@ -498,21 +536,17 @@ import {
498
536
  assertNotLastAdmin2,
499
537
  setUserRoles2,
500
538
  init_rbac_roles
501
- } from "./cli-yz7v0sh4.js";
502
- import"./cli-3xddv0rk.js";
539
+ } from "./cli-c55z5chy.js";
540
+ import"./cli-4txa0ter.js";
503
541
  import {
504
- upsertModelCatalogOverlay,
505
- deleteModelCatalogOverlay,
506
- loadModelsCatalog,
507
- init_model_catalog_store,
508
542
  requestModelCatalogRefresh2,
509
543
  init_pricing_refresh
510
- } from "./cli-ed6yqpf1.js";
544
+ } from "./cli-f3vq58d2.js";
511
545
  import {
512
546
  workflowEventBus2,
513
547
  init_event_bus
514
548
  } from "./cli-eddnyg3t.js";
515
- import"./cli-bxz823sz.js";
549
+ import"./cli-qsnnd04k.js";
516
550
  import {
517
551
  require_dist4,
518
552
  getSlackConnectionState,
@@ -543,12 +577,12 @@ import {
543
577
  startSlackApp2,
544
578
  stopSlackApp2,
545
579
  init_app3
546
- } from "./cli-mr97t7cc.js";
580
+ } from "./cli-p1bq50aa.js";
547
581
  import {
548
582
  retryFailedRun2,
549
583
  cancelWorkflowRun2,
550
584
  init_resume
551
- } from "./cli-z9cs5m0w.js";
585
+ } from "./cli-pasjcnmj.js";
552
586
  import {
553
587
  DEFAULT_NEGOTIATED_PROTOCOL_VERSION,
554
588
  SUPPORTED_PROTOCOL_VERSIONS,
@@ -575,25 +609,6 @@ import {
575
609
  scopeFromAttachment,
576
610
  backingProviderId,
577
611
  init_task_attachment_store,
578
- taskModelPin,
579
- init_model_pin,
580
- listHarnessModelSupport,
581
- recordHarnessModelSupport,
582
- agentRanModel,
583
- getAgentHarnessCliVersion,
584
- setAgentHarnessCliVersion,
585
- init_harness_model_support,
586
- sanitizeModelTierOverrides,
587
- parseModelTierOverridesHeader,
588
- setAgentModelTierOverrides,
589
- previewModelTiers,
590
- recordClaimModelResolution,
591
- init_model_tier_resolution,
592
- harnessModelErrorFor,
593
- poolTaskRunsOnHarness,
594
- explicitModelError,
595
- explicitModelErrorForAgent,
596
- init_model_validation,
597
612
  stripSiblingBlock,
598
613
  init_sibling_block,
599
614
  createTaskWithSiblingAwareness,
@@ -971,7 +986,7 @@ import {
971
986
  emitBudgetRefusalSideEffects,
972
987
  init_budget_refusal_notify,
973
988
  workflowModelErrors,
974
- init_model_validation2,
989
+ init_model_validation,
975
990
  patchWorkflowDefinition,
976
991
  init_patch_definition,
977
992
  idempotencyKeyHeader,
@@ -985,7 +1000,7 @@ import {
985
1000
  getEnabledCapabilities,
986
1001
  createServer,
987
1002
  init_server
988
- } from "./cli-7wz05bx3.js";
1003
+ } from "./cli-rfywm85n.js";
989
1004
  import {
990
1005
  FilesError,
991
1006
  normalizeFilesError,
@@ -995,7 +1010,7 @@ import {
995
1010
  init_agent_fs_provider,
996
1011
  getFileStorageProvider2,
997
1012
  init_registry2
998
- } from "./cli-3xj33nrx.js";
1013
+ } from "./cli-7cp6aa1q.js";
999
1014
  import"./cli-n9ftpys4.js";
1000
1015
  import {
1001
1016
  RuntimePoolError2,
@@ -1018,7 +1033,7 @@ import {
1018
1033
  resolvePoolDelivery2,
1019
1034
  createPoolAgent2,
1020
1035
  init_db2
1021
- } from "./cli-xd5ebp64.js";
1036
+ } from "./cli-8kzasymh.js";
1022
1037
  import {
1023
1038
  duplicateGuardedQueryKey,
1024
1039
  warnIfCorsAllowsAnyOrigin,
@@ -1075,7 +1090,7 @@ import {
1075
1090
  describeRequestRoute,
1076
1091
  route,
1077
1092
  init_route_def
1078
- } from "./cli-8ewkreqd.js";
1093
+ } from "./cli-m28atx8q.js";
1079
1094
  import {
1080
1095
  startPoolRouting,
1081
1096
  stopPoolRouting,
@@ -1088,17 +1103,17 @@ import {
1088
1103
  checkHeartbeatChecklist2,
1089
1104
  runHeartbeatSweep2,
1090
1105
  stopHeartbeat2
1091
- } from "./cli-kx4c8j05.js";
1092
- import"./cli-x9exydey.js";
1106
+ } from "./cli-abejgen1.js";
1107
+ import"./cli-m4dqmnbp.js";
1093
1108
  import {
1094
1109
  runtimeSupervisorStatus,
1095
1110
  startRuntimeSupervisor,
1096
1111
  stopRuntimeSupervisor
1097
- } from "./cli-38yww4e9.js";
1112
+ } from "./cli-6wxjceza.js";
1098
1113
  import {
1099
1114
  TASK_TITLE_TIMEOUT_MS,
1100
1115
  generateTaskTitle
1101
- } from "./cli-w3bk0dgv.js";
1116
+ } from "./cli-8aes17e4.js";
1102
1117
  import"./cli-ns59dc6r.js";
1103
1118
  import {
1104
1119
  ACP_TARGET_IDS
@@ -1109,7 +1124,7 @@ import {
1109
1124
  } from "./cli-jrzkw01m.js";
1110
1125
  import {
1111
1126
  MAX_RATE_LIMIT_RESET_MS
1112
- } from "./cli-f2zenhja.js";
1127
+ } from "./cli-kc7v1nfv.js";
1113
1128
  import {
1114
1129
  isLeadChannelMonitoringEnabled,
1115
1130
  ORG_IDENTITY_KEYS,
@@ -1119,11 +1134,11 @@ import {
1119
1134
  isUnknownModelError,
1120
1135
  checkProviderPoolKey,
1121
1136
  writeSkillsToFilesystem
1122
- } from "./cli-jg24scat.js";
1137
+ } from "./cli-ee0b971j.js";
1123
1138
  import {
1124
1139
  inviteEmailToSharedOrg,
1125
1140
  ensureAgentFsCredentialsForAgent
1126
- } from "./cli-cr14kftt.js";
1141
+ } from "./cli-qwca7s44.js";
1127
1142
  import {
1128
1143
  Anthropic
1129
1144
  } from "./cli-t73cas91.js";
@@ -1134,22 +1149,12 @@ import {
1134
1149
  resolveClaudeTransport,
1135
1150
  isClaudeBridgeEffective
1136
1151
  } from "./cli-9fzgd3hg.js";
1137
- import {
1138
- AMP_ESTIMATE_MODELS,
1139
- ampBillsCacheWrites,
1140
- resolveAmpModel,
1141
- init_amp_models
1142
- } from "./cli-ttbqe3q4.js";
1143
1152
  import {
1144
1153
  RATING_MODEL_MAX_LENGTH,
1145
1154
  REFERENCES_SOURCE_MAX_LENGTH,
1146
1155
  sanitizeReferencesSource,
1147
1156
  init_types2
1148
1157
  } from "./cli-2xv18ywz.js";
1149
- import {
1150
- normalizeModelKey,
1151
- init_pricing_normalize
1152
- } from "./cli-bzvs88tv.js";
1153
1158
  import {
1154
1159
  require_dist2,
1155
1160
  getMcpOAuthToken,
@@ -1238,7 +1243,7 @@ import {
1238
1243
  init_typecheck,
1239
1244
  parseSkillContent,
1240
1245
  init_skill_parser
1241
- } from "./cli-zjphdj1a.js";
1246
+ } from "./cli-j790gp2w.js";
1242
1247
  import {
1243
1248
  signalProcessGroup,
1244
1249
  detachedProcessGroup,
@@ -1255,7 +1260,7 @@ import {
1255
1260
  forceRefreshAuthorizationOrThrow,
1256
1261
  forceRefreshTokenOrThrow,
1257
1262
  init_ensure_token
1258
- } from "./cli-16phend6.js";
1263
+ } from "./cli-sdtt3men.js";
1259
1264
  import {
1260
1265
  automationIntegrationFixUrl,
1261
1266
  preflightAutomation,
@@ -1299,7 +1304,7 @@ import {
1299
1304
  definitionNodeIds,
1300
1305
  validateDefinition,
1301
1306
  init_definition2
1302
- } from "./cli-xncjscpm.js";
1307
+ } from "./cli-qfedvmcr.js";
1303
1308
  import {
1304
1309
  _fetchHolder,
1305
1310
  CLIENT_ID,
@@ -1323,7 +1328,7 @@ import {
1323
1328
  import {
1324
1329
  require_content_type
1325
1330
  } from "./cli-yjdgea32.js";
1326
- import"./cli-2tsfpc70.js";
1331
+ import"./cli-a7wvp2km.js";
1327
1332
  import {
1328
1333
  isInvalidClientError,
1329
1334
  publicEndpointSsrfOptions,
@@ -1341,7 +1346,7 @@ import {
1341
1346
  revokeMcpToken,
1342
1347
  computeExpiresAt,
1343
1348
  init_mcp_wrapper
1344
- } from "./cli-0m7rtm11.js";
1349
+ } from "./cli-s7t6p9my.js";
1345
1350
  import {
1346
1351
  createRuntimeProvider,
1347
1352
  init_runtime_providers
@@ -1356,15 +1361,6 @@ import {
1356
1361
  import_websocket_server,
1357
1362
  init_wrapper2
1358
1363
  } from "./cli-69szn7w7.js";
1359
- import {
1360
- isRbacEnabled,
1361
- decideToolAdmission,
1362
- LEGACY_RULES,
1363
- setAuditSink,
1364
- clearAuditSink,
1365
- can,
1366
- init_rbac
1367
- } from "./cli-cyn9v8zr.js";
1368
1364
  import {
1369
1365
  registerSessionTokenConnection,
1370
1366
  init_session_token_connections,
@@ -1391,7 +1387,13 @@ import {
1391
1387
  revokeAgentTokens,
1392
1388
  fingerprintApiKey,
1393
1389
  init_users
1394
- } from "./cli-g1px1g2e.js";
1390
+ } from "./cli-gxkx0zzp.js";
1391
+ import {
1392
+ AMP_ESTIMATE_MODELS,
1393
+ ampBillsCacheWrites,
1394
+ resolveAmpModel,
1395
+ init_amp_models
1396
+ } from "./cli-p1w18yhx.js";
1395
1397
  import {
1396
1398
  ASSET_KEY_MAX_LENGTH,
1397
1399
  normalizeAssetKey,
@@ -1422,7 +1424,9 @@ import {
1422
1424
  RoutingReasonSchema,
1423
1425
  ProviderNameSchema,
1424
1426
  ModelProfileNameSchema,
1427
+ ModelProfileCredentialsSchema,
1425
1428
  ModelProfileSchema,
1429
+ ProfileCheckResultSchema,
1426
1430
  SessionAccessSchema,
1427
1431
  SessionOwnerSchema,
1428
1432
  SessionSharesSchema,
@@ -1551,7 +1555,7 @@ import {
1551
1555
  KvKeySchema,
1552
1556
  KvEntrySchema,
1553
1557
  init_types4
1554
- } from "./cli-hfkwwy1h.js";
1558
+ } from "./cli-2zp0et3v.js";
1555
1559
  import {
1556
1560
  CODEX_AUTH_FAILURE_BENCH_THRESHOLD,
1557
1561
  CODEX_AUTH_WATCH_NAMESPACE,
@@ -1562,7 +1566,7 @@ import {
1562
1566
  IDENTITY_FIELD_BUDGETS,
1563
1567
  IdentityFieldBudgetError,
1564
1568
  init_identity_field_budget
1565
- } from "./cli-pyrxt9gw.js";
1569
+ } from "./cli-tk7cjj8h.js";
1566
1570
  import {
1567
1571
  getSlackConfiguration,
1568
1572
  init_config4
@@ -1586,10 +1590,12 @@ import {
1586
1590
  activeModelBlocks,
1587
1591
  init_model_rate_limit_windows,
1588
1592
  CREDENTIAL_POOL_VARS,
1593
+ PROVIDER_CREDENTIAL_VARS,
1594
+ getModelAwareCredentialVars,
1589
1595
  splitCredentialPool,
1590
1596
  selectCredential,
1591
1597
  init_credentials2
1592
- } from "./cli-xfjrc279.js";
1598
+ } from "./cli-5mrq3ake.js";
1593
1599
  import {
1594
1600
  interpolate,
1595
1601
  init_template2,
@@ -1599,7 +1605,7 @@ import {
1599
1605
  resolveTemplate,
1600
1606
  init_resolver,
1601
1607
  init_session_templates
1602
- } from "./cli-kf3pxxdg.js";
1608
+ } from "./cli-v1dv1r37.js";
1603
1609
  import {
1604
1610
  init_zod
1605
1611
  } from "./cli-zcfpsfzf.js";
@@ -1631,7 +1637,7 @@ import {
1631
1637
  import {
1632
1638
  init_package,
1633
1639
  package_default
1634
- } from "./cli-rt0ag4x1.js";
1640
+ } from "./cli-334z18y3.js";
1635
1641
  import {
1636
1642
  realtimeBus,
1637
1643
  init_bus
@@ -5081,8 +5087,9 @@ init_db4();
5081
5087
  init_model_profiles();
5082
5088
  init_events();
5083
5089
  init_harness_model_support();
5090
+ init_model_profile_check();
5084
5091
  init_model_tier_resolution();
5085
- init_model_validation();
5092
+ init_model_validation2();
5086
5093
  init_multi_runtime();
5087
5094
  init_db2();
5088
5095
  init_server();
@@ -5238,7 +5245,7 @@ var updateAgentRuntimeRoute = route({
5238
5245
  path: "/api/agents/{id}/runtime",
5239
5246
  pattern: ["api", "agents", null, "runtime"],
5240
5247
  summary: "Update an agent's runtime harness and default model",
5241
- description: "Updates `agents.harness_provider` and agent-scoped runtime config. The settings apply to future provider sessions. For `model`, `reasoning_effort`, and `claude.transport`: omit the field to leave it unchanged, send `null` to clear the corresponding override, or send a value to set it. A `model` the model catalog does not list is a 400 unless `allow_custom_model` is true. A `latest:` alias is not accepted here (aliases resolve for a task's model and for `MODEL_TIER_*` values); `reasoning_effort` must be one the harness and model support. `profile` sets the agent's default model profile (same tri-state): it must exist and run on `harness_provider`, and it cannot be sent with `model`. Sending `model`, or changing the model or effort override by any path, clears the default profile.",
5248
+ description: "Updates `agents.harness_provider` and agent-scoped runtime config. The settings apply to future provider sessions. For `model`, `reasoning_effort`, and `claude.transport`: omit the field to leave it unchanged, send `null` to clear the corresponding override, or send a value to set it. A `model` the model catalog does not list is a 400 unless `allow_custom_model` is true. A `latest:` alias is not accepted here (aliases resolve for a task's model and for `MODEL_TIER_*` values); `reasoning_effort` must be one the harness and model support. `profile` sets the agent's default model profile (same tri-state): it must exist, run on `harness_provider` and pass the profile check (`GET /api/agents/{id}/profile-check`) against it, and it cannot be sent with `model`. A failing check is a 400 `{ error, check }`; a passing one returns the result as `profileCheck`. Sending `model`, or changing the model or effort override by any path, clears the default profile.",
5242
5249
  tags: ["Agents"],
5243
5250
  params: object2({ id: string2() }),
5244
5251
  query: object2({ repoId: string2().optional() }),
@@ -5252,8 +5259,11 @@ var updateAgentRuntimeRoute = route({
5252
5259
  claude: ClaudeRuntimeConfigSchema.optional()
5253
5260
  }),
5254
5261
  responses: {
5255
- 200: { description: "Updated agent row", schema: AgentWithCapacitySchema },
5256
- 400: { description: "Validation error" },
5262
+ 200: {
5263
+ description: "Updated agent row. `profileCheck` is set when the body set `profile`, so warnings show.",
5264
+ schema: AgentWithCapacitySchema.extend({ profileCheck: ProfileCheckResultSchema.optional() })
5265
+ },
5266
+ 400: { description: "Validation error, or `{ error, check }` when the profile check fails" },
5257
5267
  404: { description: "Agent not found" }
5258
5268
  }
5259
5269
  });
@@ -5507,6 +5517,20 @@ var getAgentCredentialStatusRoute = route({
5507
5517
  404: { description: "Agent not found" }
5508
5518
  }
5509
5519
  });
5520
+ var getAgentProfileCheckRoute = route({
5521
+ method: "get",
5522
+ path: "/api/agents/{id}/profile-check",
5523
+ pattern: ["api", "agents", null, "profile-check"],
5524
+ summary: "Check whether an agent can run a model profile",
5525
+ description: "Read-only. Judges the profile's harness, model, the agent's credential report and the profile's credential allowlist. Each row is pass, warn, fail or unverified; `ok` is false only when a row fails. Never returns a secret value.",
5526
+ tags: ["Agents"],
5527
+ params: object2({ id: string2() }),
5528
+ query: object2({ profile: string2().trim().min(1) }),
5529
+ responses: {
5530
+ 200: { description: "The check result", schema: ProfileCheckResultSchema },
5531
+ 404: { description: "Agent or profile not found" }
5532
+ }
5533
+ });
5510
5534
  var listCredentialStatusRoute = route({
5511
5535
  method: "get",
5512
5536
  path: "/api/agents/credential-status",
@@ -5910,6 +5934,7 @@ async function handleAgentsRest(req, res, pathSegments, queryParams, myAgentId)
5910
5934
  if (!parsed)
5911
5935
  return true;
5912
5936
  const { harness_provider, model, allow_custom_model, reasoning_effort, profile, acp, claude } = parsed.body;
5937
+ let profileCheck = null;
5913
5938
  if (typeof profile === "string") {
5914
5939
  if (model !== undefined) {
5915
5940
  jsonError(res, "Send `profile` or `model`, not both", 400);
@@ -5924,6 +5949,13 @@ async function handleAgentsRest(req, res, pathSegments, queryParams, myAgentId)
5924
5949
  jsonError(res, `Model profile "${profile}" runs on the ${picked.harness} harness, not ${harness_provider}`, 400);
5925
5950
  return true;
5926
5951
  }
5952
+ profileCheck = await checkProfileForAgent(parsed.params.id, profile, {
5953
+ harness: harness_provider
5954
+ });
5955
+ if (profileCheck && !profileCheck.ok) {
5956
+ json(res, { error: formatProfileCheckFailures(profileCheck), check: profileCheck }, 400);
5957
+ return true;
5958
+ }
5927
5959
  }
5928
5960
  if (acp && harness_provider !== "acp") {
5929
5961
  jsonError(res, "ACP configuration requires harness_provider=acp", 400);
@@ -6109,7 +6141,10 @@ async function handleAgentsRest(req, res, pathSegments, queryParams, myAgentId)
6109
6141
  jsonError(res, "Agent not found", 404);
6110
6142
  return true;
6111
6143
  }
6112
- updateAgentRuntimeRoute.respond(res, 200, await agentWithCapacity(agent));
6144
+ updateAgentRuntimeRoute.respond(res, 200, {
6145
+ ...await agentWithCapacity(agent),
6146
+ ...profileCheck ? { profileCheck } : {}
6147
+ });
6113
6148
  return true;
6114
6149
  }
6115
6150
  if (listCredentialStatusRoute.match(req.method, pathSegments)) {
@@ -6213,6 +6248,22 @@ async function handleAgentsRest(req, res, pathSegments, queryParams, myAgentId)
6213
6248
  });
6214
6249
  return true;
6215
6250
  }
6251
+ if (getAgentProfileCheckRoute.match(req.method, pathSegments)) {
6252
+ const parsed = await getAgentProfileCheckRoute.parse(req, res, pathSegments, queryParams);
6253
+ if (!parsed)
6254
+ return true;
6255
+ if (!await getAgentById2(parsed.params.id)) {
6256
+ jsonError(res, "Agent not found", 404);
6257
+ return true;
6258
+ }
6259
+ const result = await checkProfileForAgent(parsed.params.id, parsed.query.profile);
6260
+ if (!result) {
6261
+ jsonError(res, `Model profile "${parsed.query.profile}" not found`, 404);
6262
+ return true;
6263
+ }
6264
+ getAgentProfileCheckRoute.respond(res, 200, result);
6265
+ return true;
6266
+ }
6216
6267
  if (getAgent.match(req.method, pathSegments)) {
6217
6268
  const parsed = await getAgent.parse(req, res, pathSegments, queryParams);
6218
6269
  if (!parsed)
@@ -6958,6 +7009,7 @@ init_event_bus();
6958
7009
  init_zod();
6959
7010
  init_db4();
6960
7011
  init_model_profiles();
7012
+ init_model_profile_check();
6961
7013
  init_multi_runtime();
6962
7014
 
6963
7015
  // src/be/org-profile.ts
@@ -7432,12 +7484,7 @@ function singleHeader(req, name) {
7432
7484
  function readsRepoSecrets(auth, agent) {
7433
7485
  if (auth?.kind !== "agent" || !auth.runtimeId)
7434
7486
  return true;
7435
- return can({
7436
- principal: { kind: "agent", agentId: auth.agentId, isLead: agent?.isLead ?? false },
7437
- verb: "config.read.secrets",
7438
- resource: { kind: "none" },
7439
- source: "http"
7440
- }).allow;
7487
+ return runtimeReadsRepoSecrets({ id: auth.agentId, isLead: agent?.isLead });
7441
7488
  }
7442
7489
  async function requestSecretReadScope(req, resolvedScope) {
7443
7490
  const principal = await requestPrincipal(req, undefined);
@@ -22450,9 +22497,10 @@ init_src2();
22450
22497
  init_zod();
22451
22498
  init_audit_user();
22452
22499
  init_model_profiles();
22453
- init_model_validation();
22500
+ init_model_validation2();
22454
22501
  init_rbac();
22455
22502
  init_types4();
22503
+ init_credentials2();
22456
22504
  init_request_principal();
22457
22505
  init_route_def();
22458
22506
  init_utils2();
@@ -22488,7 +22536,7 @@ var createProfile = route({
22488
22536
  path: "/api/model-profiles",
22489
22537
  pattern: ["api", "model-profiles"],
22490
22538
  summary: "Create a model profile",
22491
- description: "A profile runs on one harness. `model` must run on that harness and be in the model catalog unless `allowCustomModel` is true (a gateway id, a fresh launch); a `latest:` alias is accepted and resolves at claim. `effort` must be a level the harness and model support. Operator only (the shared API key).",
22539
+ description: "A profile runs on one harness. `model` must run on that harness and be in the model catalog unless `allowCustomModel` is true (a gateway id, a fresh launch); a `latest:` alias is accepted and resolves at claim. `effort` must be a level the harness and model support. `credentials` pins which pooled keys the profile uses: per credential var of the harness, the last 5 characters of each allowed key (`CODEX_OAUTH` is not supported). Operator only (the shared API key).",
22492
22540
  tags: ["Models"],
22493
22541
  rbac: { permission: "models.profiles.write" },
22494
22542
  body: object2({
@@ -22497,7 +22545,8 @@ var createProfile = route({
22497
22545
  model: string2().trim().min(1),
22498
22546
  effort: ReasoningEffortSchema.nullable().optional(),
22499
22547
  allowCustomModel: boolean().optional().default(false),
22500
- description: string2().trim().max(500).nullable().optional()
22548
+ description: string2().trim().max(500).nullable().optional(),
22549
+ credentials: ModelProfileCredentialsSchema.nullable().optional()
22501
22550
  }),
22502
22551
  responses: {
22503
22552
  201: { description: "Profile created", schema: ModelProfileSchema },
@@ -22511,7 +22560,7 @@ var updateProfile = route({
22511
22560
  path: "/api/model-profiles/{name}",
22512
22561
  pattern: ["api", "model-profiles", null],
22513
22562
  summary: "Update a model profile",
22514
- description: "Changes the model, effort, custom-model flag or description; the name and harness are fixed. Omit a field to keep it; `effort: null` clears it. Applies to tasks claimed after the change. Operator only (the shared API key).",
22563
+ description: "Changes the model, effort, custom-model flag, description or credential allowlist; the name and harness are fixed. Omit a field to keep it; `effort: null` and `credentials: null` clear it. Applies to tasks claimed after the change. Operator only (the shared API key).",
22515
22564
  tags: ["Models"],
22516
22565
  rbac: { permission: "models.profiles.write" },
22517
22566
  params: object2({ name: string2() }),
@@ -22519,7 +22568,8 @@ var updateProfile = route({
22519
22568
  model: string2().trim().min(1).optional(),
22520
22569
  effort: ReasoningEffortSchema.nullable().optional(),
22521
22570
  allowCustomModel: boolean().optional(),
22522
- description: string2().trim().max(500).nullable().optional()
22571
+ description: string2().trim().max(500).nullable().optional(),
22572
+ credentials: ModelProfileCredentialsSchema.nullable().optional()
22523
22573
  }),
22524
22574
  responses: {
22525
22575
  200: { description: "Profile updated", schema: ModelProfileSchema },
@@ -22533,7 +22583,7 @@ var deleteProfile = route({
22533
22583
  path: "/api/model-profiles/{name}",
22534
22584
  pattern: ["api", "model-profiles", null],
22535
22585
  summary: "Delete a model profile",
22536
- description: "Refused (409) for a shipped `<harness>-<tier>` seed (edit it instead; it would come back at the next boot), and while an agent has the profile as its default or a task holds it (unfinished, or superseded and still owed its resume). Operator only (the shared API key).",
22586
+ description: "Refused (409) for a shipped `<harness>-<tier>` seed (edit it instead; it would come back at the next boot), and while an agent has the profile as its default, a schedule names it, or a task holds it (unfinished, or superseded and still owed its resume). Operator only (the shared API key).",
22537
22587
  tags: ["Models"],
22538
22588
  rbac: { permission: "models.profiles.write" },
22539
22589
  params: object2({ name: string2() }),
@@ -22544,6 +22594,28 @@ var deleteProfile = route({
22544
22594
  409: { description: "The profile is a seed or still in use" }
22545
22595
  }
22546
22596
  });
22597
+ function credentialsError(harness, model, credentials) {
22598
+ if (!credentials)
22599
+ return null;
22600
+ const base = PROVIDER_CREDENTIAL_VARS[harness] ?? [];
22601
+ const allowed = new Set(base.length > 0 ? getModelAwareCredentialVars(harness, model) : []);
22602
+ for (const [envVar, suffixes] of Object.entries(credentials)) {
22603
+ if (envVar === "CODEX_OAUTH") {
22604
+ return "A credential allowlist for CODEX_OAUTH is not supported in v1.";
22605
+ }
22606
+ if (!allowed.has(envVar)) {
22607
+ return `"${envVar}" is not a credential var of the ${harness} harness${allowed.size > 0 ? ` (expected one of ${[...allowed].join(", ")})` : ""}.`;
22608
+ }
22609
+ if (suffixes.length === 0)
22610
+ return `The allowlist for ${envVar} is empty.`;
22611
+ }
22612
+ return null;
22613
+ }
22614
+ function dedupeCredentials(credentials) {
22615
+ if (!credentials)
22616
+ return credentials;
22617
+ return Object.fromEntries(Object.entries(credentials).map(([envVar, suffixes]) => [envVar, [...new Set(suffixes)]]));
22618
+ }
22547
22619
  async function profileValueError(input) {
22548
22620
  const modelError = await explicitModelError({
22549
22621
  model: input.model,
@@ -22555,7 +22627,7 @@ async function profileValueError(input) {
22555
22627
  if (input.effort && !isAlias(input.model) && !supportedReasoningLevels(input.harness, input.model).includes(input.effort)) {
22556
22628
  return `Effort "${input.effort}" is not supported by ${input.model} on ${input.harness}.`;
22557
22629
  }
22558
- return null;
22630
+ return credentialsError(input.harness, input.model, input.credentials);
22559
22631
  }
22560
22632
  async function canWriteProfiles(req, res, myAgentId) {
22561
22633
  const decision = can({
@@ -22598,7 +22670,7 @@ async function handleModelProfiles(req, res, pathSegments, queryParams, myAgentI
22598
22670
  return true;
22599
22671
  if (!await canWriteProfiles(req, res, myAgentId))
22600
22672
  return true;
22601
- const body = parsed.body;
22673
+ const body = { ...parsed.body, credentials: dedupeCredentials(parsed.body.credentials) };
22602
22674
  const error = await profileValueError({ ...body, effort: body.effort ?? null });
22603
22675
  if (error) {
22604
22676
  jsonError(res, error, 400);
@@ -22625,12 +22697,13 @@ async function handleModelProfiles(req, res, pathSegments, queryParams, myAgentI
22625
22697
  jsonError(res, "Model profile not found", 404);
22626
22698
  return true;
22627
22699
  }
22628
- const body = parsed.body;
22700
+ const body = { ...parsed.body, credentials: dedupeCredentials(parsed.body.credentials) };
22629
22701
  const error = await profileValueError({
22630
22702
  harness: current.harness,
22631
22703
  model: body.model ?? current.model,
22632
22704
  effort: body.effort === undefined ? current.effort : body.effort,
22633
- allowCustomModel: body.allowCustomModel ?? current.allowCustomModel
22705
+ allowCustomModel: body.allowCustomModel ?? current.allowCustomModel,
22706
+ credentials: body.credentials === undefined ? current.credentials : body.credentials
22634
22707
  });
22635
22708
  if (error) {
22636
22709
  jsonError(res, error, 400);
@@ -22662,13 +22735,14 @@ async function handleModelProfiles(req, res, pathSegments, queryParams, myAgentI
22662
22735
  return true;
22663
22736
  }
22664
22737
  const refs = await modelProfileReferences(current.name);
22665
- if (refs.agentIds.length > 0 || refs.openTaskCount > 0) {
22666
- jsonError(res, `"${current.name}" is in use: default of ${refs.agentIds.length} agent(s), held by ${refs.openTaskCount} unfinished or awaiting-resume task(s).`, 409);
22738
+ if (refs.agentIds.length > 0 || refs.openTaskCount > 0 || refs.scheduleIds.length > 0) {
22739
+ const schedules = refs.scheduleIds.length > 0 ? ` (${refs.scheduleIds.join(", ")})` : "";
22740
+ jsonError(res, `"${current.name}" is in use: default of ${refs.agentIds.length} agent(s), held by ${refs.openTaskCount} unfinished or awaiting-resume task(s), named by ${refs.scheduleIds.length} schedule(s)${schedules}.`, 409);
22667
22741
  return true;
22668
22742
  }
22669
22743
  const outcome = await deleteModelProfile(current.name);
22670
22744
  if (outcome === "in-use") {
22671
- jsonError(res, `"${current.name}" is in use by a task or an agent default created just now.`, 409);
22745
+ jsonError(res, `"${current.name}" is in use by a task, a schedule or an agent default created just now.`, 409);
22672
22746
  return true;
22673
22747
  }
22674
22748
  if (outcome === "missing") {
@@ -24728,7 +24802,7 @@ init_asset_key_auth();
24728
24802
  init_audit_user();
24729
24803
  init_db4();
24730
24804
  init_model_profiles();
24731
- init_model_validation();
24805
+ init_model_validation2();
24732
24806
  init_rbac_roles();
24733
24807
  init_session_shares();
24734
24808
  init_steering2();
@@ -24849,6 +24923,8 @@ var AgentTaskSummarySchema = AgentTaskSchema.pick({
24849
24923
  modelAlias: true,
24850
24924
  effort: true,
24851
24925
  resolvedEffort: true,
24926
+ profile: true,
24927
+ resolvedProfile: true,
24852
24928
  provider: true,
24853
24929
  requestedByUserId: true,
24854
24930
  progress: true,
@@ -25307,7 +25383,8 @@ var listPausedTasks = route({
25307
25383
  schema: object2({
25308
25384
  tasks: array2(AgentTaskSchema.extend({
25309
25385
  attachments: array2(TaskAttachmentSchema),
25310
- requestedBy: TaskRequestedBySchema.optional()
25386
+ requestedBy: TaskRequestedBySchema.optional(),
25387
+ credentialAllowlist: ModelProfileCredentialsSchema.optional()
25311
25388
  }))
25312
25389
  })
25313
25390
  }
@@ -25569,15 +25646,6 @@ async function handleTasks(req, res, pathSegments, queryParams, myAgentId) {
25569
25646
  jsonError(res, modelError, 400);
25570
25647
  return true;
25571
25648
  }
25572
- const profileError = await taskProfileError({
25573
- profile: parsed.body.profile,
25574
- ...splitLegacyModelAlias({ model: parsed.body.model, modelTier: parsed.body.modelTier }),
25575
- agentId: defaultAgentId
25576
- });
25577
- if (profileError) {
25578
- jsonError(res, profileError, 400);
25579
- return true;
25580
- }
25581
25649
  const parentTask = parsed.body.parentTaskId ? await getTaskById2(parsed.body.parentTaskId) : null;
25582
25650
  const principal = await resolveTaskWritePrincipal(req, myAgentId);
25583
25651
  if (parentTask && await denyParentAttach2(req, res, myAgentId, parentTask, principal)) {
@@ -25591,6 +25659,16 @@ async function handleTasks(req, res, pathSegments, queryParams, myAgentId) {
25591
25659
  jsonError(res, "You don't have access to the tasks in this context.", 403);
25592
25660
  return true;
25593
25661
  }
25662
+ const profileError = await taskProfileError({
25663
+ profile: parsed.body.profile,
25664
+ ...splitLegacyModelAlias({ model: parsed.body.model, modelTier: parsed.body.modelTier }),
25665
+ agentId: defaultAgentId,
25666
+ vcsRepo: parentTask?.vcsRepo
25667
+ });
25668
+ if (profileError) {
25669
+ jsonError(res, profileError, 400);
25670
+ return true;
25671
+ }
25594
25672
  let assetKey;
25595
25673
  try {
25596
25674
  const inheritedKey = parentTask?.key;
@@ -26200,13 +26278,19 @@ async function handleTasks(req, res, pathSegments, queryParams, myAgentId) {
26200
26278
  const pausedTasks = await getPausedTasksForAgent2(myAgentId, readableByFor2(await resolveSessionActor2(req, myAgentId)));
26201
26279
  const tasks = await Promise.all(pausedTasks.map(async (task) => {
26202
26280
  const requestedBy = await buildTaskRequestedBy(task);
26281
+ const profile = task.resolvedProfile ? await getModelProfileByName(task.resolvedProfile) : null;
26282
+ if (profile && hasUnreadableCredentialAllowlist(profile)) {
26283
+ console.warn(`[paused-tasks] holding task ${task.id}: profile "${profile.name}" has an unreadable credential allowlist`);
26284
+ return null;
26285
+ }
26203
26286
  return {
26204
26287
  ...task,
26205
26288
  attachments: await getTaskAttachments2(task.id),
26206
- ...requestedBy && { requestedBy }
26289
+ ...requestedBy && { requestedBy },
26290
+ ...profile?.credentials && { credentialAllowlist: profile.credentials }
26207
26291
  };
26208
26292
  }));
26209
- listPausedTasks.respond(res, 200, { tasks });
26293
+ listPausedTasks.respond(res, 200, { tasks: tasks.filter((task) => task !== null) });
26210
26294
  return true;
26211
26295
  }
26212
26296
  if (pauseTaskRoute.match(req.method, pathSegments)) {
@@ -29721,8 +29805,9 @@ init_api_drain();
29721
29805
  init_budget_admission();
29722
29806
  init_budget_refusal_notify();
29723
29807
  init_db4();
29808
+ init_model_profile_check();
29724
29809
  init_model_tier_resolution();
29725
- init_model_validation();
29810
+ init_model_validation2();
29726
29811
  init_multi_runtime();
29727
29812
  init_server();
29728
29813
 
@@ -29879,7 +29964,8 @@ var PollTaskAssignedTriggerSchema = object2({
29879
29964
  taskId: string2(),
29880
29965
  triggerSurface: string2().optional(),
29881
29966
  task: AgentTaskSchema.extend({
29882
- attachments: array2(PollTriggerAttachmentSchema)
29967
+ attachments: array2(PollTriggerAttachmentSchema),
29968
+ credentialAllowlist: ModelProfileCredentialsSchema.optional()
29883
29969
  }),
29884
29970
  requestedBy: TaskRequestedBySchema.optional()
29885
29971
  });
@@ -29944,7 +30030,8 @@ async function claimModelFields(task, agent, auth) {
29944
30030
  resolvedModel: undefined,
29945
30031
  modelSource: undefined,
29946
30032
  modelAlias: undefined,
29947
- resolvedProfile: undefined
30033
+ resolvedProfile: undefined,
30034
+ credentialAllowlist: undefined
29948
30035
  };
29949
30036
  try {
29950
30037
  return {
@@ -30151,7 +30238,22 @@ async function handlePoll(req, res, pathSegments, queryParams, myAgentId) {
30151
30238
  if (agent.isLead) {} else {
30152
30239
  if (await hasCapacity2(myAgentId)) {
30153
30240
  const harness = agent.harnessProvider ?? agent.provider ?? null;
30154
- const unassignedIds = await getUnassignedTaskIdsForAgent2(myAgentId, 5, (task) => poolTaskRunsOnHarness(task, harness));
30241
+ const profileOk = new Map;
30242
+ const includeRepoSecrets = readsRepoSecrets(getRequestAuth(req), agent);
30243
+ const passesProfileCheck = async (profile, vcsRepo) => {
30244
+ const memoKey = JSON.stringify([profile, vcsRepo ?? null]);
30245
+ const cached = profileOk.get(memoKey);
30246
+ if (cached !== undefined)
30247
+ return cached;
30248
+ const result = await checkProfileForAgent(myAgentId, profile, {
30249
+ vcsRepo,
30250
+ includeRepoSecrets
30251
+ });
30252
+ const ok = result?.ok !== false;
30253
+ profileOk.set(memoKey, ok);
30254
+ return ok;
30255
+ };
30256
+ const unassignedIds = await getUnassignedTaskIdsForAgent2(myAgentId, 5, async (task) => await poolTaskRunsOnHarness(task, harness) && (!task.profile || await passesProfileCheck(task.profile, task.vcsRepo)));
30155
30257
  if (unassignedIds.length > 0) {
30156
30258
  const candidateId = unassignedIds[0];
30157
30259
  const candidateTask = await getTaskById2(candidateId);
@@ -32190,7 +32292,8 @@ init_zod();
32190
32292
  init_asset_key_auth();
32191
32293
  init_audit_user();
32192
32294
  init_db4();
32193
- init_model_validation();
32295
+ init_model_profiles();
32296
+ init_model_validation2();
32194
32297
  init_validate();
32195
32298
  init_db3();
32196
32299
  init_rbac();
@@ -32216,6 +32319,7 @@ var scheduleUpdateBodySchema = object2({
32216
32319
  timezone: string2().optional(),
32217
32320
  model: string2().nullable().optional(),
32218
32321
  modelTier: ModelTierSchema.nullable().optional(),
32322
+ profile: string2().nullable().optional(),
32219
32323
  allowCustomModel: boolean().optional(),
32220
32324
  nextRunAt: string2().nullable().optional(),
32221
32325
  targetType: ScheduledTaskTargetTypeSchema.optional(),
@@ -32257,6 +32361,7 @@ var createSchedule = route({
32257
32361
  timezone: string2().optional(),
32258
32362
  model: string2().optional(),
32259
32363
  modelTier: ModelTierSchema.optional(),
32364
+ profile: string2().optional(),
32260
32365
  allowCustomModel: boolean().optional(),
32261
32366
  scheduleType: _enum2(["recurring", "one_time"]).optional(),
32262
32367
  targetType: ScheduledTaskTargetTypeSchema.optional(),
@@ -32510,6 +32615,16 @@ async function handleSchedules(req, res, pathSegments, queryParams, myAgentId) {
32510
32615
  jsonError(res, modelError, 400);
32511
32616
  return true;
32512
32617
  }
32618
+ const profileError = await taskProfileError({
32619
+ profile: body.profile,
32620
+ model: body.model,
32621
+ modelTier: body.modelTier,
32622
+ agentId: body.targetAgentId
32623
+ });
32624
+ if (profileError) {
32625
+ jsonError(res, profileError, 400);
32626
+ return true;
32627
+ }
32513
32628
  try {
32514
32629
  const trustedUserId = await resolveHttpAuditUserId(req, myAgentId);
32515
32630
  let key;
@@ -32552,6 +32667,7 @@ async function handleSchedules(req, res, pathSegments, queryParams, myAgentId) {
32552
32667
  nextRunAt,
32553
32668
  timezone: body.timezone,
32554
32669
  ...splitLegacyModelAlias({ model: body.model, modelTier: body.modelTier }),
32670
+ profile: body.profile?.trim() || undefined,
32555
32671
  scheduleType: body.scheduleType,
32556
32672
  targetType: body.targetType,
32557
32673
  workflowId: body.workflowId,
@@ -32563,7 +32679,11 @@ async function handleSchedules(req, res, pathSegments, queryParams, myAgentId) {
32563
32679
  createdBy: await resolveHttpAuditUserId(req, myAgentId) ?? undefined
32564
32680
  });
32565
32681
  createSchedule.respond(res, 201, schedule);
32566
- } catch (_error) {
32682
+ } catch (error) {
32683
+ if (modelProfileRefError(error) === "missing") {
32684
+ jsonError(res, `Unknown model profile "${body.profile}".`, 400);
32685
+ return true;
32686
+ }
32567
32687
  jsonError(res, "Failed to create schedule", 500);
32568
32688
  }
32569
32689
  return true;
@@ -32658,6 +32778,11 @@ async function handleSchedules(req, res, pathSegments, queryParams, myAgentId) {
32658
32778
  }
32659
32779
  }
32660
32780
  const agentChanged = parsed.body.targetAgentId !== undefined && parsed.body.targetAgentId !== existing.targetAgentId;
32781
+ const profileUpdate = await scheduleProfileUpdate(existing, parsed.body);
32782
+ if (profileUpdate.error !== undefined) {
32783
+ jsonError(res, profileUpdate.error, 400);
32784
+ return true;
32785
+ }
32661
32786
  if (parsed.body.model !== undefined || parsed.body.modelTier !== undefined) {
32662
32787
  const normalizedModel = splitLegacyModelAlias({
32663
32788
  model: parsed.body.model,
@@ -32679,7 +32804,7 @@ async function handleSchedules(req, res, pathSegments, queryParams, myAgentId) {
32679
32804
  if (parsed.body.modelTier !== undefined || normalizedModel.modelTier) {
32680
32805
  body.modelTier = normalizedModel.modelTier ?? null;
32681
32806
  }
32682
- } else if (agentChanged && existing.model) {
32807
+ } else if (agentChanged && existing.model && !profileUpdate.fields.profile) {
32683
32808
  const modelError = await explicitModelErrorForAgent({
32684
32809
  model: existing.model,
32685
32810
  allowCustomModel: true,
@@ -32690,6 +32815,7 @@ async function handleSchedules(req, res, pathSegments, queryParams, myAgentId) {
32690
32815
  return true;
32691
32816
  }
32692
32817
  }
32818
+ Object.assign(body, profileUpdate.fields);
32693
32819
  if (existing.scheduleType === "one_time" && !existing.enabled && existing.lastRunAt) {
32694
32820
  jsonError(res, "One-time schedule has already executed. Create a new one instead.", 400);
32695
32821
  return true;
@@ -32784,7 +32910,15 @@ async function handleSchedules(req, res, pathSegments, queryParams, myAgentId) {
32784
32910
  const updatedBy = await resolveHttpAuditUserId(req, myAgentId);
32785
32911
  if (updatedBy !== null)
32786
32912
  body.updatedBy = updatedBy;
32787
- const schedule = await updateScheduledTask2(parsed.params.id, body);
32913
+ let schedule;
32914
+ try {
32915
+ schedule = await updateScheduledTask2(parsed.params.id, body);
32916
+ } catch (error) {
32917
+ if (modelProfileRefError(error) !== "missing")
32918
+ throw error;
32919
+ jsonError(res, `Unknown model profile "${body.profile}".`, 400);
32920
+ return true;
32921
+ }
32788
32922
  routeHandle.respond(res, 200, schedule);
32789
32923
  return true;
32790
32924
  }
@@ -34857,7 +34991,7 @@ async function handleScriptConnections(req, res, pathSegments, queryParams, agen
34857
34991
  // src/http/script-runs.ts
34858
34992
  init_zod();
34859
34993
  init_db4();
34860
- init_model_validation();
34994
+ init_model_validation2();
34861
34995
 
34862
34996
  // src/be/scripts/source-secrets.ts
34863
34997
  init_secret_scrubber();
@@ -43205,7 +43339,7 @@ init_workflows();
43205
43339
  init_definition2();
43206
43340
  init_engine();
43207
43341
  init_json_schema_validator();
43208
- init_model_validation2();
43342
+ init_model_validation();
43209
43343
  init_patch_definition();
43210
43344
  init_readiness();
43211
43345
  init_resume();
@@ -43511,6 +43645,7 @@ var retryWorkflowRunRoute = route({
43511
43645
  path: "/api/workflow-runs/{id}/retry",
43512
43646
  pattern: ["api", "workflow-runs", null, "retry"],
43513
43647
  summary: "Retry a failed workflow run",
43648
+ description: "Retries on the definition the run started with; to use an edited workflow, trigger a new run.",
43514
43649
  tags: ["Workflows"],
43515
43650
  params: object2({ id: string2() }),
43516
43651
  responses: {
@@ -43716,7 +43851,9 @@ async function handleWorkflows(req, res, pathSegments, queryParams, myAgentId) {
43716
43851
  jsonError(res, `Invalid definition: ${validation.errors.join("; ")}`, 400);
43717
43852
  return true;
43718
43853
  }
43719
- const modelErrors = await workflowModelErrors(parsed.body.definition);
43854
+ const modelErrors = await workflowModelErrors(parsed.body.definition, {
43855
+ vcsRepo: parsed.body.vcsRepo
43856
+ });
43720
43857
  if (modelErrors.length > 0) {
43721
43858
  jsonError(res, `Invalid definition: ${modelErrors.join("; ")}`, 400);
43722
43859
  return true;
@@ -43898,7 +44035,13 @@ async function handleWorkflows(req, res, pathSegments, queryParams, myAgentId) {
43898
44035
  jsonError(res, `Invalid definition: ${validation.errors.join("; ")}`, 400);
43899
44036
  return true;
43900
44037
  }
43901
- const modelErrors = await workflowModelErrors(body.definition);
44038
+ }
44039
+ const repoChanged = body.vcsRepo !== undefined && (body.vcsRepo ?? null) !== (existing.vcsRepo ?? null);
44040
+ const judged = body.definition ?? (repoChanged ? existing.definition : undefined);
44041
+ if (judged) {
44042
+ const modelErrors = await workflowModelErrors(judged, {
44043
+ vcsRepo: body.vcsRepo === undefined ? existing.vcsRepo : body.vcsRepo
44044
+ });
43902
44045
  if (modelErrors.length > 0) {
43903
44046
  jsonError(res, `Invalid definition: ${modelErrors.join("; ")}`, 400);
43904
44047
  return true;
@@ -44553,7 +44696,7 @@ var httpServer = createHttpServer(async (req, res) => {
44553
44696
  });
44554
44697
  });
44555
44698
  var detachRealtime = attachRealtimeTransport(httpServer);
44556
- var { attachControllerTransport } = await import("./controllers-connect-c4448kwa.js");
44699
+ var { attachControllerTransport } = await import("./controllers-connect-e2b4gyxc.js");
44557
44700
  var detachControllers = attachControllerTransport(httpServer);
44558
44701
  var stopWorkerNudges = startWorkerNudgeListener();
44559
44702
  var taskAutoTitles = startTaskAutoTitleListener();
@@ -44584,7 +44727,7 @@ async function shutdown() {
44584
44727
  sessionsProcessed: getServerSessionsProcessed()
44585
44728
  });
44586
44729
  if (hasCapability("scheduling")) {
44587
- const { stopScheduler } = await import("./index-8arwq8mw.js");
44730
+ const { stopScheduler } = await import("./index-835xdgnm.js");
44588
44731
  stopScheduler();
44589
44732
  }
44590
44733
  stopHeartbeat2();
@@ -44596,7 +44739,7 @@ async function shutdown() {
44596
44739
  await stopSlackApp2();
44597
44740
  await stopChatSdk();
44598
44741
  if (!isEnvFlagEnabled("OAUTH_KEEPALIVE_DISABLE", false)) {
44599
- const { stopOAuthKeepalive } = await import("./keepalive-1j4n4dmk.js");
44742
+ const { stopOAuthKeepalive } = await import("./keepalive-4zsrce78.js");
44600
44743
  await stopOAuthKeepalive();
44601
44744
  }
44602
44745
  stopOAuthPendingGc();
@@ -44680,21 +44823,21 @@ try {
44680
44823
  console.warn("[startup] CAPABILITIES upgrade seed failed (non-fatal):", err);
44681
44824
  }
44682
44825
  try {
44683
- const { ensurePricingSeeded } = await import("./boot-seeds-8f9zt5cm.js");
44826
+ const { ensurePricingSeeded } = await import("./boot-seeds-x42tzytw.js");
44684
44827
  ensurePricingSeeded();
44685
- const { startPricingRefreshLoop } = await import("./pricing-refresh-ctdr74pd.js");
44828
+ const { startPricingRefreshLoop } = await import("./pricing-refresh-1rgzqyzz.js");
44686
44829
  startPricingRefreshLoop();
44687
44830
  } catch (err) {
44688
44831
  console.error("[startup] Failed to seed pricing rows:", err);
44689
44832
  }
44690
44833
  try {
44691
- const { ensureModelProfilesSeeded } = await import("./boot-seeds-8f9zt5cm.js");
44834
+ const { ensureModelProfilesSeeded } = await import("./boot-seeds-x42tzytw.js");
44692
44835
  await ensureModelProfilesSeeded();
44693
44836
  } catch (err) {
44694
44837
  console.error("[startup] Failed to seed model profiles:", err);
44695
44838
  }
44696
44839
  try {
44697
- const { ensureRbacSeeded } = await import("./boot-seeds-8f9zt5cm.js");
44840
+ const { ensureRbacSeeded } = await import("./boot-seeds-x42tzytw.js");
44698
44841
  ensureRbacSeeded();
44699
44842
  } catch (err) {
44700
44843
  console.error("[startup] Failed to sync RBAC seed rows:", err);
@@ -44702,7 +44845,7 @@ try {
44702
44845
  throw err;
44703
44846
  }
44704
44847
  try {
44705
- const { runAllSeeders } = await import("./index-hgn3c961.js");
44848
+ const { runAllSeeders } = await import("./index-vk63emp7.js");
44706
44849
  await runAllSeeders({ scriptEmbeddingMode: "skip" });
44707
44850
  } catch (err) {
44708
44851
  console.error("[startup] Failed to seed built-in entities:", err);
@@ -44765,26 +44908,25 @@ httpServer.listen(port, async () => {
44765
44908
  await initWorkflows2();
44766
44909
  await startScriptRunSupervisor(getMcpBaseUrl());
44767
44910
  if (hasCapability("scheduling")) {
44768
- const { startScheduler } = await import("./index-8arwq8mw.js");
44769
- const { getExecutorRegistry } = await import("./index-tpw054az.js");
44911
+ const { startScheduler } = await import("./index-835xdgnm.js");
44912
+ const { getExecutorRegistry } = await import("./index-d469300x.js");
44770
44913
  const intervalMs = Number(process.env.SCHEDULER_INTERVAL_MS) || 1e4;
44771
44914
  startScheduler(getExecutorRegistry(), intervalMs, {
44772
44915
  runId: globalState.__runId
44773
44916
  });
44774
44917
  }
44775
44918
  if (!isEnvFlagEnabled("HEARTBEAT_DISABLE", false)) {
44776
- const { startHeartbeat } = await import("./index-waq75j2j.js");
44777
- const heartbeatMs = Number(process.env.HEARTBEAT_INTERVAL_MS) || 90000;
44778
- startHeartbeat(heartbeatMs);
44919
+ const { parseHeartbeatIntervalMs, startHeartbeat } = await import("./index-rzqwp11g.js");
44920
+ startHeartbeat(parseHeartbeatIntervalMs(process.env.HEARTBEAT_INTERVAL_MS));
44779
44921
  }
44780
44922
  startPoolRouting();
44781
44923
  startRuntimeSupervisor();
44782
44924
  if (!isEnvFlagEnabled("OAUTH_KEEPALIVE_DISABLE", false)) {
44783
- const { startOAuthKeepalive } = await import("./keepalive-1j4n4dmk.js");
44925
+ const { startOAuthKeepalive } = await import("./keepalive-4zsrce78.js");
44784
44926
  startOAuthKeepalive();
44785
44927
  }
44786
44928
  if (!isEnvFlagEnabled("OAUTH_REFRESH_SWEEP_DISABLE", false)) {
44787
- const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-yy06c03c.js");
44929
+ const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-j52kg9pr.js");
44788
44930
  startOAuthRefreshSweep();
44789
44931
  }
44790
44932
  startOAuthPendingGc();
@@ -44793,19 +44935,19 @@ httpServer.listen(port, async () => {
44793
44935
  await startDbRetention();
44794
44936
  startHumanFreeDrain();
44795
44937
  startTaskSearchBackfill();
44796
- import("./embedding-space-4kyh5qqj.js").then(({ runEmbeddingMaintenance, setDeploymentEnvReader }) => {
44938
+ import("./embedding-space-crsm2zp0.js").then(({ runEmbeddingMaintenance, setDeploymentEnvReader }) => {
44797
44939
  setDeploymentEnvReader(getDeploymentEnvValue);
44798
44940
  return runEmbeddingMaintenance({ backfill: true });
44799
44941
  }).catch((err) => {
44800
44942
  console.error("[embedding-space] startup maintenance failed (non-fatal):", err);
44801
44943
  });
44802
- import("./boot-args-schema-hwkc8bzv.js").then(({ runBootArgsSchemaBackfill }) => runBootArgsSchemaBackfill()).catch((err) => {
44944
+ import("./boot-args-schema-2t37e0fe.js").then(({ runBootArgsSchemaBackfill }) => runBootArgsSchemaBackfill()).catch((err) => {
44803
44945
  console.error("[boot-args-schema] startup backfill failed (non-fatal):", err);
44804
44946
  });
44805
- import("./boot-scrub-sweep-r5r8kqsn.js").then(({ runBootScrubSweep }) => runBootScrubSweep()).catch((err) => {
44947
+ import("./boot-scrub-sweep-65sdnp6c.js").then(({ runBootScrubSweep }) => runBootScrubSweep()).catch((err) => {
44806
44948
  console.error("[boot-scrub-sweep] startup scrub failed (non-fatal):", err);
44807
44949
  });
44808
- import("./session-source-backfill-2sy0krfk.js").then(({ runSessionSourceBackfill }) => runSessionSourceBackfill()).catch((err) => {
44950
+ import("./session-source-backfill-1d5pdwww.js").then(({ runSessionSourceBackfill }) => runSessionSourceBackfill()).catch((err) => {
44809
44951
  console.error("[session-source-backfill] startup run failed (non-fatal):", err);
44810
44952
  });
44811
44953
  }).on("error", (err) => {