@desplega.ai/agent-swarm 2.4.0 → 2.4.2

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 (239) hide show
  1. package/README.md +1 -1
  2. package/dist/{acp-adapter-kedstxx6.js → acp-adapter-dv7hmx4r.js} +9 -9
  3. package/dist/{actions-vget6r1k.js → actions-51nc1gny.js} +21 -21
  4. package/dist/{amp-adapter-xeb5mktv.js → amp-adapter-abp5tdx8.js} +4 -4
  5. package/dist/{app-mqap8t8m.js → app-9h14qvr6.js} +3 -3
  6. package/dist/{assistant-h0gv97mv.js → assistant-wv1gz3mt.js} +22 -22
  7. package/dist/{boot-reembed-qr8a894z.js → boot-reembed-6yn53ms9.js} +1 -1
  8. package/dist/{boot-reembed-rj85jjhw.js → boot-reembed-7fcka4z5.js} +1 -1
  9. package/dist/{boot-scrub-sweep-eyfvn6v9.js → boot-scrub-sweep-pm1580ax.js} +4 -4
  10. package/dist/{boot-seeds-xs9a8dx1.js → boot-seeds-g5hfc1x8.js} +4 -4
  11. package/dist/{claude-adapter-bm23cye7.js → claude-adapter-gf3kxhf0.js} +9 -9
  12. package/dist/{claude-managed-adapter-1mwrsm9d.js → claude-managed-adapter-h2y889ge.js} +2 -2
  13. package/dist/{claude-managed-setup-gkfgks4j.js → claude-managed-setup-h00hsgtz.js} +2 -2
  14. package/dist/{claude-sdk-session-apb4ypz3.js → claude-sdk-session-s2k1qd8y.js} +13 -13
  15. package/dist/{cli-tj4j2ts4.js → cli-02qm7src.js} +8 -8
  16. package/dist/{cli-1cevz46c.js → cli-0qvtffe9.js} +6 -6
  17. package/dist/{cli-avmqhatn.js → cli-10hhg0km.js} +8 -8
  18. package/dist/{cli-7gh7020n.js → cli-1dmcq2eh.js} +1 -1
  19. package/dist/{cli-kz116kvw.js → cli-239yjk27.js} +7 -7
  20. package/dist/{cli-7ayprxp7.js → cli-2dfbv8qr.js} +8 -0
  21. package/dist/{cli-a49vpbf3.js → cli-5kqnemen.js} +1 -1
  22. package/dist/{cli-x719j3vs.js → cli-5rk36sjf.js} +442 -205
  23. package/dist/{cli-fb6t92v8.js → cli-6x9ma5w5.js} +1 -1
  24. package/dist/{cli-c8fwpgqb.js → cli-7225gwj7.js} +2 -2
  25. package/dist/{cli-5s5hx57y.js → cli-7awf1fp8.js} +1 -1
  26. package/dist/{cli-bn26xbcs.js → cli-8nyhf7za.js} +1 -1
  27. package/dist/{cli-ywyrffff.js → cli-8sxqsbbq.js} +1 -1
  28. package/dist/{cli-rsd7ga7v.js → cli-8zwe9mpk.js} +11 -11
  29. package/dist/{cli-y83zk5sb.js → cli-a0kcty51.js} +4 -4
  30. package/dist/{cli-8b9wvjps.js → cli-a4gvwttf.js} +4 -4
  31. package/dist/{cli-jhp7w1fy.js → cli-a5ebc95n.js} +2 -2
  32. package/dist/{cli-mvg2hf8p.js → cli-ahtpy9kf.js} +14 -7
  33. package/dist/{cli-x1p5dhq2.js → cli-bcj753sq.js} +3 -3
  34. package/dist/{cli-p22zdvnt.js → cli-bn0rewsy.js} +3 -3
  35. package/dist/{cli-p1m2b6gc.js → cli-d2mb5s8a.js} +7 -7
  36. package/dist/{cli-rg7ntypm.js → cli-d3qqdy4c.js} +456 -94
  37. package/dist/{cli-c5sbmw1v.js → cli-d82btycs.js} +94 -15
  38. package/dist/{cli-02vhhssk.js → cli-efaqv1c7.js} +5 -5
  39. package/dist/{cli-vjfpshn3.js → cli-ejs3m1sx.js} +1 -1
  40. package/dist/{cli-kk2r80n5.js → cli-faypxz7q.js} +4 -4
  41. package/dist/{cli-a1esmmee.js → cli-fpmsqq59.js} +7 -2
  42. package/dist/{cli-wrv09v7q.js → cli-ftyypbg5.js} +1 -1
  43. package/dist/{cli-zvze9rbm.js → cli-fyzjmseb.js} +3 -3
  44. package/dist/{cli-8rwvksbc.js → cli-g0hgtz4p.js} +5 -5
  45. package/dist/{cli-nrrg0fvy.js → cli-h38rjv87.js} +133 -12
  46. package/dist/{cli-tg9ksbn8.js → cli-h93c9vb3.js} +2 -2
  47. package/dist/{cli-eqgfs202.js → cli-hqhzg1qq.js} +2 -2
  48. package/dist/{cli-bhwa8rzc.js → cli-hyfw2j1e.js} +13 -12
  49. package/dist/{cli-3wjs22x3.js → cli-j4rqdf2n.js} +2 -2
  50. package/dist/{cli-6ftrrwm1.js → cli-n85dqg6d.js} +5 -5
  51. package/dist/{cli-8cxkw1f5.js → cli-nmqdc2t3.js} +2 -2
  52. package/dist/{cli-4fhyq711.js → cli-nn47d7e8.js} +13 -13
  53. package/dist/{cli-x3en6ct3.js → cli-nwyw3zhg.js} +1 -1
  54. package/dist/{cli-3avfh5az.js → cli-pemywhfq.js} +2 -2
  55. package/dist/{cli-xfe63zx3.js → cli-pkht5hap.js} +2 -2
  56. package/dist/{cli-sppc0cmw.js → cli-pnp2j5zg.js} +2 -2
  57. package/dist/{cli-wk8ccrz6.js → cli-pw7v69vp.js} +2 -2
  58. package/dist/{cli-tgvpmnwz.js → cli-r99kc9yq.js} +5 -5
  59. package/dist/{cli-bfc3k1x5.js → cli-rdyw3mct.js} +9 -9
  60. package/dist/{cli-b80a1100.js → cli-s6vr7r2d.js} +2 -2
  61. package/dist/{cli-zv4vy2b0.js → cli-s95dknxh.js} +1 -1
  62. package/dist/{cli-ttaz6c7m.js → cli-saw9a6f6.js} +6 -5
  63. package/dist/{cli-mz1ezzzh.js → cli-shvfedvm.js} +3 -3
  64. package/dist/{cli-rdr166ht.js → cli-smvcw9z5.js} +1 -1
  65. package/dist/{cli-2rwet3r7.js → cli-sv5gb0yb.js} +1 -1
  66. package/dist/{cli-5ff2sjyt.js → cli-t30yj95q.js} +2 -2
  67. package/dist/{cli-ptkpaqfy.js → cli-wt645v7q.js} +1 -1
  68. package/dist/{cli-f3nx1h8z.js → cli-wxbn3yfx.js} +2 -2
  69. package/dist/{cli-wyrr38xm.js → cli-x5mq1fyq.js} +1 -1
  70. package/dist/{cli-ccn0eybf.js → cli-xbzvet96.js} +6 -6
  71. package/dist/{cli-4mkvwgzr.js → cli-xf234ws8.js} +1 -1
  72. package/dist/{cli-nme7wery.js → cli-y2x52gs2.js} +46 -13
  73. package/dist/{cli-ffbrkh1r.js → cli-y8n5k515.js} +46 -38
  74. package/dist/{cli-ecshf504.js → cli-z4wd2ftv.js} +7 -7
  75. package/dist/{cli-dsgj3e7a.js → cli-zfg9enh9.js} +2 -2
  76. package/dist/{cli-yxqag76b.js → cli-zw88zjba.js} +1 -1
  77. package/dist/cli.js +20 -20
  78. package/dist/{codex-adapter-pp2gq8gr.js → codex-adapter-ttygw382.js} +6 -6
  79. package/dist/{codex-hook-qwzccd64.js → codex-hook-x7nejyrr.js} +7 -4
  80. package/dist/{codex-login-35p4sk85.js → codex-login-m819c41r.js} +1 -1
  81. package/dist/{codex-session-runner-0vzn09t8.js → codex-session-runner-60b58vv3.js} +7 -7
  82. package/dist/{commands-psqhkttb.js → commands-edmdwa4x.js} +2 -2
  83. package/dist/{controller-t20vz2k8.js → controller-m263fg43.js} +4 -4
  84. package/dist/{controllers-connect-gkxmqw9d.js → controllers-connect-5fym8sw1.js} +23 -23
  85. package/dist/{cursor-adapter-3v542qe5.js → cursor-adapter-cz6nm6mj.js} +3 -3
  86. package/dist/{db-nc1rd869.js → db-2y0mgstc.js} +3 -3
  87. package/dist/{db-2xbyenjr.js → db-nn0hcmx5.js} +6 -2
  88. package/dist/{devin-adapter-7egzmt0k.js → devin-adapter-zgqadvnm.js} +1 -1
  89. package/dist/{dispatcher-ewceb8ts.js → dispatcher-0a9wwjcx.js} +20 -20
  90. package/dist/{docker-njavd3fb.js → docker-fkgtr75t.js} +2 -2
  91. package/dist/{dsh-adapter-75xwh78t.js → dsh-adapter-3n3net33.js} +3 -3
  92. package/dist/{e2b-5r6a5jeb.js → e2b-7am6tmq6.js} +2 -2
  93. package/dist/{e2b-pw1nvtmh.js → e2b-thdcxtjd.js} +2 -2
  94. package/dist/{easter-egg-3d-xsc47jwf.js → easter-egg-3d-5cgynaja.js} +1 -1
  95. package/dist/{event-bus-101fenkh.js → event-bus-9vpk8gmq.js} +1 -1
  96. package/dist/{execute-gzmw1mnw.js → execute-t4e6m3rw.js} +1 -1
  97. package/dist/{external-channel-a5dsmxn4.js → external-channel-zhvt95n3.js} +2 -2
  98. package/dist/{grok-adapter-vj88xr23.js → grok-adapter-qnr1hp2y.js} +10 -10
  99. package/dist/handlers-dkcarkd0.js +39 -0
  100. package/dist/{heartbeat-t2m9r3wa.js → heartbeat-gz97r7ac.js} +23 -23
  101. package/dist/{hook-xa677f8r.js → hook-1mmdgjqs.js} +16 -9
  102. package/dist/{hook-8femx1bg.js → hook-x8rthca4.js} +6 -6
  103. package/dist/{http-xpmmq028.js → http-r8f85xr9.js} +274 -160
  104. package/dist/index-5jecgp3n.js +41 -0
  105. package/dist/index-aex0eba9.js +40 -0
  106. package/dist/{index-syztqdt6.js → index-g6tbb6ve.js} +1 -1
  107. package/dist/{index-cdzyfrsp.js → index-smxyk04s.js} +1 -1
  108. package/dist/{index-dg2tmj99.js → index-vzvfqzfj.js} +20 -20
  109. package/dist/{index-s7ckdajq.js → index-y7rbcrc1.js} +10 -10
  110. package/dist/{keepalive-3nr4st3r.js → keepalive-64c0f34c.js} +4 -4
  111. package/dist/lead-b1da0f97.js +78 -0
  112. package/dist/{maintenance-verwpe2c.js → maintenance-mnxpar12.js} +1 -1
  113. package/dist/{oauth-refresh-sweep-9q2t0y3q.js → oauth-refresh-sweep-36hs2v4h.js} +3 -3
  114. package/dist/{onboard-aytqedmq.js → onboard-xes8de61.js} +3 -3
  115. package/dist/{opencode-adapter-f4hryjny.js → opencode-adapter-3s7ax02e.js} +7 -7
  116. package/dist/{otel-impl-hckw4wt1.js → otel-impl-fzc57kcq.js} +2 -2
  117. package/dist/{pi-mono-adapter-hxby0ce1.js → pi-mono-adapter-ytp7gz8b.js} +22 -11
  118. package/dist/{pricing-refresh-5nvme3sm.js → pricing-refresh-1nek2w7b.js} +3 -3
  119. package/dist/{rbac-roles-vbpy21mg.js → rbac-roles-sqefb5hw.js} +2 -2
  120. package/dist/{rbac-roles-pd8c26m1.js → rbac-roles-ttyfaep2.js} +1 -1
  121. package/dist/{render-v2-7nqgvk2q.js → render-v2-vb527jwn.js} +3 -3
  122. package/dist/{resume-b6djcj3c.js → resume-jcdzg1bn.js} +10 -8
  123. package/dist/{runtime-txrxc9za.js → runtime-xe3aqy4x.js} +1 -1
  124. package/dist/{session-access-fc3f9y12.js → session-access-zsp4wsp0.js} +4 -4
  125. package/dist/{setup-n39szm6b.js → setup-1nb2zqd3.js} +1 -1
  126. package/dist/{virtual-modules-wyp2k6z3.js → virtual-modules-4r3zkc20.js} +2 -2
  127. package/dist/{work-objects-jem2fre0.js → work-objects-61w08fwr.js} +23 -23
  128. package/dist/worker-c1e68hpa.js +78 -0
  129. package/dist/{x-8ewt8gxn.js → x-y45mthwn.js} +2 -2
  130. package/openapi.json +491 -52
  131. package/package.json +3 -3
  132. package/src/apps/action-runner.ts +146 -0
  133. package/src/apps/catalog.generated.json +3 -2
  134. package/src/apps/definition.ts +152 -4
  135. package/src/apps/row-store.ts +23 -9
  136. package/src/apps/schema-migrate.ts +14 -6
  137. package/src/apps/script-types.ts +2 -1
  138. package/src/apps/sync.ts +20 -19
  139. package/src/be/db/tasks/read.ts +112 -0
  140. package/src/be/db.ts +16 -4
  141. package/src/be/fleet-benchmark-stats.ts +10 -5
  142. package/src/be/models-catalog.ts +4 -0
  143. package/src/be/onboarding.ts +6 -0
  144. package/src/be/scripts/typecheck.ts +13 -0
  145. package/src/be/swarm-config-guard.ts +25 -1
  146. package/src/be/telemetry-enable.ts +1 -1
  147. package/src/commands/provider-credentials.ts +12 -2
  148. package/src/commands/runner.ts +3 -0
  149. package/src/heartbeat/heartbeat.ts +2 -2
  150. package/src/hooks/codex-hook.ts +6 -2
  151. package/src/hooks/hook.ts +7 -0
  152. package/src/hooks/pr-body-guard.ts +38 -11
  153. package/src/hooks/pr-room-guard.ts +88 -0
  154. package/src/http/agents.ts +1 -0
  155. package/src/http/apps.ts +99 -183
  156. package/src/http/fleet-benchmark.ts +79 -30
  157. package/src/http/global-config.ts +7 -0
  158. package/src/http/ranking.ts +24 -40
  159. package/src/http/status.ts +49 -43
  160. package/src/http/tasks.ts +49 -1
  161. package/src/http/telemetry-ui.ts +1 -1
  162. package/src/http/used-by.ts +55 -19
  163. package/src/http/users.ts +2 -2
  164. package/src/providers/acp-targets.ts +1 -1
  165. package/src/providers/amp-adapter.ts +1 -1
  166. package/src/providers/pi-mono-adapter.ts +15 -0
  167. package/src/providers/reasoning-effort.ts +2 -1
  168. package/src/providers/types.ts +2 -0
  169. package/src/ranking/telemetry-ranking.ts +5 -33
  170. package/src/scripts-runtime/sdk-allowlist.ts +7 -0
  171. package/src/scripts-runtime/types/stdlib.d.ts +31 -0
  172. package/src/scripts-runtime/types/swarm-sdk.d.ts +31 -0
  173. package/src/server.ts +4 -0
  174. package/src/telemetry-context.ts +19 -1
  175. package/src/telemetry-contract/EVENTS.md +42 -8
  176. package/src/telemetry-contract/SOURCE.json +6 -5
  177. package/src/telemetry-contract/catalog.json +225 -5
  178. package/src/telemetry-contract/ranking/fixtures/valid/no-claim.json +10 -0
  179. package/src/telemetry-contract/ranking/listing.v1.schema.json +2 -2
  180. package/src/telemetry-contract/types.gen.ts +225 -27
  181. package/src/telemetry-identity.ts +47 -9
  182. package/src/telemetry-snapshot.ts +9 -1
  183. package/src/telemetry-ui-events.ts +9 -2
  184. package/src/telemetry.ts +29 -6
  185. package/src/tests/app-action-run-tool.test.ts +178 -0
  186. package/src/tests/app-row-tools.test.ts +385 -0
  187. package/src/tests/apps-json-column.test.ts +611 -0
  188. package/src/tests/apps-script-types.test.ts +2 -0
  189. package/src/tests/apps-sync-engine.test.ts +42 -0
  190. package/src/tests/check-pr-body.test.ts +0 -23
  191. package/src/tests/credential-check.test.ts +38 -0
  192. package/src/tests/db-task-read-contract.test.ts +4 -0
  193. package/src/tests/db-task-write-contract.test.ts +2 -0
  194. package/src/tests/docs-index-footprint.test.js +2 -2
  195. package/src/tests/fleet-benchmark.test.ts +122 -2
  196. package/src/tests/http-users.test.ts +62 -1
  197. package/src/tests/model-catalog-table.test.ts +63 -0
  198. package/src/tests/model-profiles-api.test.ts +19 -7
  199. package/src/tests/models-catalog.test.ts +50 -0
  200. package/src/tests/onboarding.test.ts +21 -0
  201. package/src/tests/org-website.test.ts +62 -0
  202. package/src/tests/pi-mono-adapter.test.ts +23 -0
  203. package/src/tests/pr-body-leaks.test.ts +4 -0
  204. package/src/tests/pr-room-guard.test.ts +242 -0
  205. package/src/tests/ranking-listing.test.ts +8 -23
  206. package/src/tests/ranking-route.test.ts +49 -47
  207. package/src/tests/reasoning-effort.test.ts +39 -3
  208. package/src/tests/runner-harness-telemetry-env.test.ts +62 -1
  209. package/src/tests/status.test.ts +158 -9
  210. package/src/tests/swarm-tool-result-gate.test.ts +2 -4
  211. package/src/tests/task-lineage.test.ts +180 -0
  212. package/src/tests/telemetry-context.test.ts +128 -2
  213. package/src/tests/telemetry-init.test.ts +62 -5
  214. package/src/tests/telemetry-ui-route.test.ts +123 -0
  215. package/src/tests/tool-annotations.test.ts +3 -2
  216. package/src/tests/used-by-route.test.ts +144 -10
  217. package/src/tests/user-token-rest-auth.test.ts +38 -0
  218. package/src/tests/workflow-agent-task-retry.test.ts +130 -4
  219. package/src/tests/workflow-wait-recovery.test.ts +116 -4
  220. package/src/tools/app-action-run.ts +63 -0
  221. package/src/tools/app-rows.ts +239 -0
  222. package/src/tools/model-catalog/index.ts +1 -1
  223. package/src/tools/tool-config.ts +8 -0
  224. package/src/tools/utils.ts +1 -1
  225. package/src/tools/workflows/retry-workflow-run.ts +1 -1
  226. package/src/types.ts +17 -0
  227. package/src/utils/company-profile.ts +24 -0
  228. package/src/utils/org-website.ts +58 -21
  229. package/src/workflows/recovery.ts +10 -22
  230. package/src/workflows/resume.ts +16 -0
  231. package/src/workflows/task-step-routing.ts +47 -7
  232. package/templates/skills/apps/SKILL.md +44 -4
  233. package/templates/skills/apps/content.md +44 -4
  234. package/dist/handlers-zbs90bny.js +0 -39
  235. package/dist/index-8pwc1jc8.js +0 -40
  236. package/dist/index-nxa6me0q.js +0 -41
  237. package/dist/lead-td8h2sfn.js +0 -78
  238. package/dist/worker-wr6xgfr2.js +0 -78
  239. package/src/tests/check-ranking-entry.test.ts +0 -146
@@ -280,7 +280,7 @@ import {
280
280
  hasCapability,
281
281
  getEnabledCapabilities,
282
282
  createServer
283
- } from "./cli-x719j3vs.js";
283
+ } from "./cli-5rk36sjf.js";
284
284
  import {
285
285
  chatThreadOfContextKey,
286
286
  agentContextKey,
@@ -288,6 +288,10 @@ import {
288
288
  init_context_key,
289
289
  init_catalog,
290
290
  catalog_default,
291
+ COMPANY_TEAM_SIZES,
292
+ COMPANY_USE_CASES,
293
+ USER_FUNCTIONS,
294
+ init_company_profile,
291
295
  TELEMETRY_PROXY_ORIGIN,
292
296
  normalizeOrgWebsite,
293
297
  orgLogoUrl,
@@ -302,6 +306,7 @@ import {
302
306
  _resolveIntegrationType,
303
307
  _resolveIntegrationProvider,
304
308
  setTelemetryRoleResolver,
309
+ setTelemetryFunctionResolver,
305
310
  isTelemetryReady,
306
311
  trackRelayed,
307
312
  telemetry,
@@ -326,6 +331,7 @@ import {
326
331
  getDbClient2,
327
332
  init_runtime,
328
333
  cachedUserRole,
334
+ cachedUserFunction,
329
335
  configureOrgDomainPersistence,
330
336
  recomputeOrgDomain,
331
337
  init_telemetry_identity,
@@ -371,6 +377,8 @@ import {
371
377
  recordApprovalVotes2,
372
378
  computeContentHash2,
373
379
  getTaskById2,
380
+ TASK_LINEAGE_LIMITS2,
381
+ getTaskLineage2,
374
382
  getAllTasks2,
375
383
  getTasksCount2,
376
384
  getTaskStats2,
@@ -422,11 +430,7 @@ import {
422
430
  RANKING_CATEGORIES,
423
431
  readTelemetryRanking,
424
432
  rankingFormSchema,
425
- mintRankingClaim,
426
433
  buildListing,
427
- rankingEntryFile,
428
- rankingPrUrl,
429
- rankingLeaveUrl,
430
434
  init_telemetry_ranking,
431
435
  API_DRAINING_HEADER,
432
436
  init_api_drain,
@@ -712,26 +716,26 @@ import {
712
716
  countScriptRunJournalSteps2,
713
717
  countScriptRunJournalAgentTaskSteps2,
714
718
  init_db3
715
- } from "./cli-rg7ntypm.js";
719
+ } from "./cli-d3qqdy4c.js";
716
720
  import {
717
721
  getUserGrant2,
718
722
  init_rbac_roles
719
- } from "./cli-5s5hx57y.js";
720
- import"./cli-kk2r80n5.js";
723
+ } from "./cli-7awf1fp8.js";
724
+ import"./cli-faypxz7q.js";
721
725
  import {
722
726
  normalizeModelKey
723
- } from "./cli-tg9ksbn8.js";
727
+ } from "./cli-h93c9vb3.js";
724
728
  import {
725
729
  upsertModelCatalogOverlay,
726
730
  deleteModelCatalogOverlay,
727
731
  loadModelsCatalog,
728
732
  requestModelCatalogRefresh2
729
- } from "./cli-ttaz6c7m.js";
733
+ } from "./cli-saw9a6f6.js";
730
734
  import {
731
735
  AMP_ESTIMATE_MODELS,
732
736
  ampBillsCacheWrites,
733
737
  resolveAmpModel
734
- } from "./cli-2rwet3r7.js";
738
+ } from "./cli-sv5gb0yb.js";
735
739
  import {
736
740
  automationIntegrationFixUrl,
737
741
  preflightAutomation,
@@ -743,7 +747,7 @@ import {
743
747
  cancelWorkflowRun2,
744
748
  TriggerSchemaError,
745
749
  startWorkflowExecution2
746
- } from "./cli-nme7wery.js";
750
+ } from "./cli-y2x52gs2.js";
747
751
  import {
748
752
  require_dist2,
749
753
  isInvalidClientError,
@@ -823,14 +827,14 @@ import {
823
827
  typecheckWithAmbient,
824
828
  typecheckScript,
825
829
  parseSkillContent
826
- } from "./cli-nrrg0fvy.js";
830
+ } from "./cli-h38rjv87.js";
827
831
  import {
828
832
  buildAuthorizationUrl,
829
833
  exchangeAuthorizationCode,
830
834
  oauthAppRowToProviderConfig,
831
835
  forceRefreshAuthorizationOrThrow,
832
836
  forceRefreshTokenOrThrow
833
- } from "./cli-b80a1100.js";
837
+ } from "./cli-s6vr7r2d.js";
834
838
  import {
835
839
  signalProcessGroup,
836
840
  detachedProcessGroup,
@@ -858,15 +862,15 @@ import {
858
862
  getSlackApp2,
859
863
  startSlackApp2,
860
864
  stopSlackApp2
861
- } from "./cli-4fhyq711.js";
862
- import"./cli-xfe63zx3.js";
865
+ } from "./cli-nn47d7e8.js";
866
+ import"./cli-pkht5hap.js";
863
867
  import {
864
868
  createApprovalFollowUpTask,
865
869
  generateEdges,
866
870
  definitionNodeIds,
867
871
  validateDefinition
868
- } from "./cli-tj4j2ts4.js";
869
- import"./cli-bn26xbcs.js";
872
+ } from "./cli-02qm7src.js";
873
+ import"./cli-8nyhf7za.js";
870
874
  import {
871
875
  _fetchHolder,
872
876
  CLIENT_ID,
@@ -877,11 +881,11 @@ import {
877
881
  codexOAuthKeyForSlot,
878
882
  loadAllCodexOAuthSlots,
879
883
  getValidCodexOAuth
880
- } from "./cli-vjfpshn3.js";
884
+ } from "./cli-ejs3m1sx.js";
881
885
  import {
882
886
  workflowEventBus2,
883
887
  init_event_bus
884
- } from "./cli-ptkpaqfy.js";
888
+ } from "./cli-wt645v7q.js";
885
889
  import {
886
890
  duplicateGuardedQueryKey,
887
891
  warnIfCorsAllowsAnyOrigin,
@@ -923,7 +927,7 @@ import {
923
927
  bodyListTask,
924
928
  describeRequestRoute,
925
929
  route
926
- } from "./cli-02vhhssk.js";
930
+ } from "./cli-efaqv1c7.js";
927
931
  import {
928
932
  isMultiRuntimeEnabled
929
933
  } from "./cli-7a91w22y.js";
@@ -954,13 +958,13 @@ import {
954
958
  resolvePoolDelivery2,
955
959
  createPoolAgent2,
956
960
  init_db
957
- } from "./cli-6ftrrwm1.js";
961
+ } from "./cli-n85dqg6d.js";
958
962
  import {
959
963
  RATING_MODEL_MAX_LENGTH,
960
964
  REFERENCES_SOURCE_MAX_LENGTH,
961
965
  sanitizeReferencesSource
962
966
  } from "./cli-3h26v7yj.js";
963
- import"./cli-rdr166ht.js";
967
+ import"./cli-smvcw9z5.js";
964
968
  import {
965
969
  startPoolRouting,
966
970
  stopPoolRouting,
@@ -970,8 +974,8 @@ import {
970
974
  checkHeartbeatChecklist2,
971
975
  runHeartbeatSweep2,
972
976
  stopHeartbeat2
973
- } from "./cli-bhwa8rzc.js";
974
- import"./cli-eqgfs202.js";
977
+ } from "./cli-hyfw2j1e.js";
978
+ import"./cli-hqhzg1qq.js";
975
979
  import {
976
980
  import_websocket,
977
981
  import_websocket_server
@@ -980,15 +984,15 @@ import {
980
984
  runtimeSupervisorStatus,
981
985
  startRuntimeSupervisor,
982
986
  stopRuntimeSupervisor
983
- } from "./cli-rsd7ga7v.js";
987
+ } from "./cli-8zwe9mpk.js";
984
988
  import"./cli-ns59dc6r.js";
985
989
  import {
986
990
  ACP_TARGET_IDS
987
- } from "./cli-a49vpbf3.js";
991
+ } from "./cli-5kqnemen.js";
988
992
  import {
989
993
  reasoningCapability,
990
994
  supportedReasoningLevels
991
- } from "./cli-p22zdvnt.js";
995
+ } from "./cli-bn0rewsy.js";
992
996
  import {
993
997
  MAX_RATE_LIMIT_RESET_MS
994
998
  } from "./cli-gx4rm0qx.js";
@@ -1000,11 +1004,11 @@ import {
1000
1004
  memoryRelevance,
1001
1005
  isUnknownModelError,
1002
1006
  writeSkillsToFilesystem
1003
- } from "./cli-wrv09v7q.js";
1007
+ } from "./cli-ftyypbg5.js";
1004
1008
  import {
1005
1009
  inviteEmailToSharedOrg,
1006
1010
  ensureAgentFsCredentialsForAgent
1007
- } from "./cli-5ff2sjyt.js";
1011
+ } from "./cli-t30yj95q.js";
1008
1012
  import {
1009
1013
  Anthropic
1010
1014
  } from "./cli-er83cjbn.js";
@@ -1039,7 +1043,7 @@ import {
1039
1043
  revokeSessionToken,
1040
1044
  fingerprintApiKey,
1041
1045
  init_users
1042
- } from "./cli-8cxkw1f5.js";
1046
+ } from "./cli-nmqdc2t3.js";
1043
1047
  import"./cli-v41kn3cd.js";
1044
1048
  import"./cli-wgtk7xxr.js";
1045
1049
  import {
@@ -1131,6 +1135,7 @@ import {
1131
1135
  RuntimePoolSchema,
1132
1136
  RuntimePoolCreateAgentSchema,
1133
1137
  RuntimeInstanceSchema,
1138
+ SUPERSEDED_WORKFLOW_TASK_REASON,
1134
1139
  WorkflowEdgeSchema,
1135
1140
  WorkflowDefinitionSchema,
1136
1141
  WorkflowNodePatchSchema,
@@ -1194,12 +1199,12 @@ import {
1194
1199
  KvKeySchema,
1195
1200
  KvEntrySchema,
1196
1201
  init_types
1197
- } from "./cli-a1esmmee.js";
1202
+ } from "./cli-fpmsqq59.js";
1198
1203
  import {
1199
1204
  IDENTITY_FIELD_BUDGETS,
1200
1205
  IdentityFieldBudgetError,
1201
1206
  init_identity_field_budget
1202
- } from "./cli-wyrr38xm.js";
1207
+ } from "./cli-x5mq1fyq.js";
1203
1208
  import {
1204
1209
  getSlackConfiguration,
1205
1210
  init_config
@@ -1267,7 +1272,7 @@ import {
1267
1272
  import {
1268
1273
  init_package,
1269
1274
  package_default
1270
- } from "./cli-mz1ezzzh.js";
1275
+ } from "./cli-shvfedvm.js";
1271
1276
  import {
1272
1277
  realtimeBus,
1273
1278
  init_bus
@@ -1296,11 +1301,11 @@ import {
1296
1301
  scrubObject,
1297
1302
  registerVolatileSecret,
1298
1303
  init_secret_scrubber
1299
- } from "./cli-4mkvwgzr.js";
1304
+ } from "./cli-xf234ws8.js";
1300
1305
  import {
1301
1306
  isAlias,
1302
1307
  init_src2
1303
- } from "./cli-x3en6ct3.js";
1308
+ } from "./cli-nwyw3zhg.js";
1304
1309
  import {
1305
1310
  __toESM
1306
1311
  } from "./cli-242037k3.js";
@@ -3891,6 +3896,7 @@ function startTelemetryTicker(deps) {
3891
3896
  return;
3892
3897
  stopTelemetryTicker();
3893
3898
  setTelemetryRoleResolver(cachedUserRole);
3899
+ setTelemetryFunctionResolver(cachedUserFunction);
3894
3900
  const tick = async () => {
3895
3901
  try {
3896
3902
  await recomputeOrgDomain();
@@ -3921,6 +3927,7 @@ function stopTelemetryTicker() {
3921
3927
  tickTimer = null;
3922
3928
  firstTimer = null;
3923
3929
  setTelemetryRoleResolver(null);
3930
+ setTelemetryFunctionResolver(null);
3924
3931
  configureOrgDomainPersistence(null);
3925
3932
  }
3926
3933
 
@@ -5220,6 +5227,7 @@ async function handleAgentsRest(req, res, pathSegments, queryParams, myAgentId)
5220
5227
  reportedAt: parsed.body.latest_model?.reportedAt ?? parsed.body.acp.reportedAt,
5221
5228
  reportKind: "post_task",
5222
5229
  bedrock: null,
5230
+ opencodeGo: null,
5223
5231
  acp: null
5224
5232
  };
5225
5233
  finalAgent = await updateAgentCredStatus2(parsed.params.id, {
@@ -7400,6 +7408,10 @@ function deriveState(state, signals, funnelEvents) {
7400
7408
  if (state.steps.connect.status !== "done") {
7401
7409
  changed = completeStep(state, "connect", "api_key", true, events) || changed;
7402
7410
  }
7411
+ const orgName = process.env.SWARM_ORG_NAME?.trim();
7412
+ if (state.steps.name.status !== "done" && orgName && orgName !== "Your Swarm") {
7413
+ changed = completeStep(state, "name", "custom_name", true, events) || changed;
7414
+ }
7403
7415
  if (state.steps.ai.status !== "done" && signals.providers.some((entry) => entry.state === "verified")) {
7404
7416
  changed = completeStep(state, "ai", inferAiMethod(signals), true, events) || changed;
7405
7417
  }
@@ -7703,31 +7715,50 @@ init_telemetry_ranking();
7703
7715
  init_telemetry();
7704
7716
  init_env_flag();
7705
7717
 
7718
+ // src/http/global-config.ts
7719
+ init_db3();
7720
+ async function globalConfig(key) {
7721
+ const stored = (await getSwarmConfigs2({ scope: "global", key }))?.[0]?.value;
7722
+ return (stored ?? process.env[key])?.trim() || undefined;
7723
+ }
7724
+
7706
7725
  // src/http/used-by.ts
7707
7726
  init_zod();
7708
7727
  init_db3();
7709
7728
  init_telemetry();
7729
+ init_company_profile();
7710
7730
  init_org_website();
7711
7731
  var CONSENT_KEY = "SWARM_USED_BY_CONSENT";
7712
7732
  var CONSENT_AT_KEY = "SWARM_USED_BY_CONSENT_AT";
7713
7733
  var GRANTED_NAME_KEY = "SWARM_USED_BY_ORG_NAME";
7714
7734
  var GRANTED_WEBSITE_KEY = "SWARM_USED_BY_ORG_WEBSITE";
7735
+ var CONTACT_EMAIL_KEY = "SWARM_USED_BY_CONTACT_EMAIL";
7736
+ var CONTACT_FUNCTION_KEY = "SWARM_USED_BY_CONTACT_FUNCTION";
7737
+ var QUOTE_KEY = "SWARM_USED_BY_QUOTE";
7715
7738
  var TIMEOUT_MS = 1e4;
7716
7739
  var usedBy = route({
7717
7740
  method: "post",
7718
7741
  path: "/api/used-by",
7719
7742
  pattern: ["api", "used-by"],
7720
7743
  summary: "Grant or revoke the 'used by' logo consent",
7721
- description: "Records whether agent-swarm.dev may show this organization's logo as a company that uses Agent Swarm. Sends the organization name and website to the telemetry proxy, where a person approves each logo by hand. An explicit admin action, so it is not gated by the telemetry opt-out.",
7744
+ description: "Records consent to show the organization's logo on agent-swarm.dev. A grant requires a valid contact email. It sends organization identity, contact details, and an optional quote to the proxy for manual review. This explicit admin action works when telemetry is off. A revoke clears the stored contact details and quote.",
7722
7745
  tags: ["Telemetry"],
7723
- body: object2({ granted: boolean() }),
7746
+ body: object2({
7747
+ granted: boolean(),
7748
+ contactEmail: string2().max(320, "Contact email must be at most 320 characters").email("Contact email must be a valid email address").optional(),
7749
+ contactFunction: _enum2(USER_FUNCTIONS).optional(),
7750
+ quote: string2().max(280).optional()
7751
+ }).refine((body) => !body.granted || body.contactEmail !== undefined, {
7752
+ path: ["contactEmail"],
7753
+ message: "Contact email is required when granting logo consent"
7754
+ }),
7724
7755
  responses: {
7725
7756
  200: {
7726
7757
  description: "Consent recorded",
7727
7758
  schema: object2({ granted: boolean(), changedAt: string2() })
7728
7759
  },
7729
7760
  400: {
7730
- description: "Organization name or website is not set (a revoke falls back to the identity of the last grant)"
7761
+ description: "Invalid contact details, or missing organization name or website"
7731
7762
  },
7732
7763
  401: { description: "Unauthorized" },
7733
7764
  403: { description: "Only a config admin can change the consent" },
@@ -7735,10 +7766,6 @@ var usedBy = route({
7735
7766
  },
7736
7767
  rbac: { permission: "config.write.any" }
7737
7768
  });
7738
- async function globalConfig(key) {
7739
- const stored = (await getSwarmConfigs2({ scope: "global", key }))?.[0]?.value?.trim();
7740
- return stored || process.env[key]?.trim() || undefined;
7741
- }
7742
7769
  async function telemetryProxyEndpoint(path) {
7743
7770
  const feedback = await globalConfig("feedback_endpoint");
7744
7771
  if (feedback && /^https?:\/\/[^/]+\/v1\/feedback\/?$/.test(feedback)) {
@@ -7757,7 +7784,7 @@ async function handleUsedBy(req, res, pathSegments, queryParams, myAgentId) {
7757
7784
  return true;
7758
7785
  if (!await ensureConfigAdmin(req, res, "config.write.any"))
7759
7786
  return true;
7760
- const { granted } = parsed.body;
7787
+ const { granted, contactEmail, contactFunction, quote } = parsed.body;
7761
7788
  const current = orgIdentityStatus({
7762
7789
  SWARM_ORG_NAME: await globalConfig("SWARM_ORG_NAME"),
7763
7790
  SWARM_ORG_WEBSITE: await globalConfig("SWARM_ORG_WEBSITE")
@@ -7784,6 +7811,7 @@ async function handleUsedBy(req, res, pathSegments, queryParams, myAgentId) {
7784
7811
  org_website: orgWebsite,
7785
7812
  ...orgDomain ? { org_domain: orgDomain } : {},
7786
7813
  granted,
7814
+ ...granted ? { contact_email: contactEmail, contact_function: contactFunction, quote } : {},
7787
7815
  changed_at: changedAt
7788
7816
  }),
7789
7817
  signal: AbortSignal.timeout(TIMEOUT_MS)
@@ -7796,15 +7824,34 @@ async function handleUsedBy(req, res, pathSegments, queryParams, myAgentId) {
7796
7824
  jsonError(res, "Could not reach the telemetry proxy", 502);
7797
7825
  return true;
7798
7826
  }
7799
- await upsertSwarmConfig2({ scope: "global", key: CONSENT_KEY, value: String(granted) });
7800
- await upsertSwarmConfig2({ scope: "global", key: CONSENT_AT_KEY, value: changedAt });
7801
- if (granted) {
7802
- await upsertSwarmConfig2({ scope: "global", key: GRANTED_NAME_KEY, value: orgName });
7803
- await upsertSwarmConfig2({ scope: "global", key: GRANTED_WEBSITE_KEY, value: orgWebsite });
7804
- }
7827
+ await getDbClient2().transaction(async () => {
7828
+ await upsertSwarmConfig2({ scope: "global", key: CONSENT_KEY, value: String(granted) });
7829
+ await upsertSwarmConfig2({ scope: "global", key: CONSENT_AT_KEY, value: changedAt });
7830
+ if (granted) {
7831
+ await upsertSwarmConfig2({ scope: "global", key: GRANTED_NAME_KEY, value: orgName });
7832
+ await upsertSwarmConfig2({ scope: "global", key: GRANTED_WEBSITE_KEY, value: orgWebsite });
7833
+ }
7834
+ for (const [key, value, isSecret] of [
7835
+ [CONTACT_EMAIL_KEY, contactEmail, true],
7836
+ [CONTACT_FUNCTION_KEY, contactFunction, false],
7837
+ [QUOTE_KEY, quote, false]
7838
+ ]) {
7839
+ await upsertSwarmConfig2({
7840
+ scope: "global",
7841
+ key,
7842
+ value: granted ? value ?? "" : "",
7843
+ isSecret,
7844
+ exportToEnv: false
7845
+ });
7846
+ }
7847
+ });
7805
7848
  scheduleIntegrationsReload();
7806
7849
  const owner = await resolveHttpFavoriteOwner(req, myAgentId);
7807
- trackRelayed("used_by.consent_changed", { granted }, { actor: owner?.userId ? { userId: owner.userId } : undefined, emitter: "ui" });
7850
+ trackRelayed("used_by.consent_changed", {
7851
+ granted,
7852
+ has_quote: granted && Boolean(quote),
7853
+ has_function: granted && Boolean(contactFunction)
7854
+ }, { actor: owner?.userId ? { userId: owner.userId } : undefined, emitter: "ui" });
7808
7855
  usedBy.respond(res, 200, { granted, changedAt });
7809
7856
  return true;
7810
7857
  }
@@ -7812,7 +7859,6 @@ async function handleUsedBy(req, res, pathSegments, queryParams, myAgentId) {
7812
7859
  // src/http/ranking.ts
7813
7860
  var ListingSchema = object2({
7814
7861
  v: literal2(1),
7815
- claim: string2(),
7816
7862
  name: string2(),
7817
7863
  domain: string2(),
7818
7864
  category: _enum2(RANKING_CATEGORIES),
@@ -7830,28 +7876,22 @@ var RankingStateSchema = object2({
7830
7876
  domain: string2().nullable(),
7831
7877
  listing: ListingSchema.nullable(),
7832
7878
  listingMatchesDomain: boolean(),
7833
- fileJson: string2().nullable(),
7834
- prUrl: string2().nullable(),
7835
7879
  verifyUrl: string2().nullable()
7836
7880
  });
7837
7881
  var OptInResponseSchema = object2({
7838
7882
  domain: string2(),
7839
- claim: string2(),
7840
7883
  listing: ListingSchema,
7841
- fileJson: string2(),
7842
- prUrl: string2(),
7843
7884
  verifyUrl: string2()
7844
7885
  });
7845
7886
  var OptOutResponseSchema = object2({
7846
- enabled: literal2(false),
7847
- leaveUrl: string2().nullable()
7887
+ enabled: literal2(false)
7848
7888
  });
7849
7889
  var getRanking = route({
7850
7890
  method: "get",
7851
7891
  path: "/api/ranking",
7852
7892
  pattern: ["api", "ranking"],
7853
7893
  summary: "Public ranking state",
7854
- description: "Whether this install can join the public agent-swarm.dev ranking (telemetry on, organization name and website set), whether it is opted in, and its stored listing. The listing carries the private ranking claim, so only a config admin can read it.",
7894
+ description: "Whether this install can join the public agent-swarm.dev ranking (telemetry on, organization name and website set), whether it is opted in, and its stored listing. Only a config admin can read it.",
7855
7895
  tags: ["Telemetry"],
7856
7896
  responses: {
7857
7897
  200: { description: "Ranking state", schema: RankingStateSchema },
@@ -7865,7 +7905,7 @@ var optIn = route({
7865
7905
  path: "/api/ranking/opt-in",
7866
7906
  pattern: ["api", "ranking", "opt-in"],
7867
7907
  summary: "Opt this install into the public ranking",
7868
- description: "Builds the telemetry_ranking listing from the organization name and website plus the chosen category, stores it, turns PUBLIC_RANKING_ENABLED on and sends ranking.opted_in. The install is ranked only after a ranking PR with the returned file is merged into desplega-ai/agent-swarm.",
7908
+ description: "Builds the telemetry_ranking listing from the organization name and website plus the chosen category, stores it, turns PUBLIC_RANKING_ENABLED on and sends ranking.opted_in. That is the whole opt-in: the install shows on agent-swarm.dev/ranking at the next hourly refresh.",
7869
7909
  tags: ["Telemetry"],
7870
7910
  body: rankingFormSchema,
7871
7911
  responses: {
@@ -7884,7 +7924,7 @@ var optOut = route({
7884
7924
  path: "/api/ranking/opt-out",
7885
7925
  pattern: ["api", "ranking", "opt-out"],
7886
7926
  summary: "Leave the public ranking",
7887
- description: "Turns PUBLIC_RANKING_ENABLED off and sends ranking.opted_out, so workers stop sending ranking.usage. Returns the GitHub page that deletes the ranking entry.",
7927
+ description: "Turns PUBLIC_RANKING_ENABLED off and sends ranking.opted_out, so workers stop sending ranking.usage. The install leaves agent-swarm.dev/ranking at the next hourly refresh.",
7888
7928
  tags: ["Telemetry"],
7889
7929
  responses: {
7890
7930
  200: { description: "Opted out", schema: OptOutResponseSchema },
@@ -7913,10 +7953,14 @@ async function rankingEnabled() {
7913
7953
  async function telemetryReady() {
7914
7954
  return isTelemetryEnabled() && Boolean(await globalConfig("telemetry_installation_id"));
7915
7955
  }
7916
- async function verifyUrl(listing) {
7917
- const params = new URLSearchParams({ domain: listing.domain, claim: listing.claim });
7956
+ async function verifyUrl(domain) {
7957
+ const params = new URLSearchParams({ domain });
7918
7958
  return `${await telemetryProxyEndpoint("/v1/ranking/verify")}?${params.toString()}`;
7919
7959
  }
7960
+ function withoutClaim(listing) {
7961
+ const { claim: _claim, ...rest } = listing;
7962
+ return rest;
7963
+ }
7920
7964
  async function setEnabled(enabled) {
7921
7965
  await upsertSwarmConfig2({
7922
7966
  scope: "global",
@@ -7925,7 +7969,7 @@ async function setEnabled(enabled) {
7925
7969
  });
7926
7970
  }
7927
7971
  function emitOptedIn(listing) {
7928
- telemetry.ranking("opted_in", { listing: JSON.stringify(listing) }, { orgName: listing.name, orgWebsite: listing.domain });
7972
+ telemetry.ranking("opted_in", { listing: JSON.stringify(withoutClaim(listing)) }, { orgName: listing.name, orgWebsite: listing.domain });
7929
7973
  }
7930
7974
  function emitOptedOut(domain) {
7931
7975
  telemetry.ranking("opted_out", { domain });
@@ -7946,11 +7990,9 @@ async function buildRankingState() {
7946
7990
  enabled: enabled && listingMatchesDomain,
7947
7991
  name: identity.name,
7948
7992
  domain: identity.website,
7949
- listing,
7993
+ listing: listing ? withoutClaim(listing) : null,
7950
7994
  listingMatchesDomain,
7951
- fileJson: current ? rankingEntryFile(current) : null,
7952
- prUrl: current ? rankingPrUrl(current) : null,
7953
- verifyUrl: current ? await verifyUrl(current) : null
7995
+ verifyUrl: current ? await verifyUrl(current.domain) : null
7954
7996
  };
7955
7997
  }
7956
7998
  async function syncRankingAfterConfigChange(key, value) {
@@ -7973,7 +8015,7 @@ async function syncRankingAfterConfigChange(key, value) {
7973
8015
  if (identity.name === listing.name)
7974
8016
  return;
7975
8017
  try {
7976
- rebuilt = buildListing(identity, listing, listing.claim);
8018
+ rebuilt = buildListing(identity, listing);
7977
8019
  } catch {}
7978
8020
  }
7979
8021
  if (!rebuilt) {
@@ -8024,14 +8066,11 @@ async function handleRanking(req, res, pathSegments, queryParams) {
8024
8066
  });
8025
8067
  return true;
8026
8068
  }
8027
- const website = identity.website;
8028
8069
  const db = getDbClient2();
8029
8070
  const built = await db.transaction(async () => {
8030
- const stored = await storedListing();
8031
- const claim = stored?.domain === website ? stored.claim : mintRankingClaim();
8032
8071
  let listing;
8033
8072
  try {
8034
- listing = buildListing(identity, parsed.body, claim);
8073
+ listing = buildListing(identity, parsed.body);
8035
8074
  } catch (error) {
8036
8075
  return { ok: false, error };
8037
8076
  }
@@ -8056,11 +8095,8 @@ async function handleRanking(req, res, pathSegments, queryParams) {
8056
8095
  scheduleIntegrationsReload();
8057
8096
  optIn.respond(res, 200, {
8058
8097
  domain: listing.domain,
8059
- claim: listing.claim,
8060
8098
  listing,
8061
- fileJson: rankingEntryFile(listing),
8062
- prUrl: rankingPrUrl(listing),
8063
- verifyUrl: await verifyUrl(listing)
8099
+ verifyUrl: await verifyUrl(listing.domain)
8064
8100
  });
8065
8101
  return true;
8066
8102
  }
@@ -8075,10 +8111,7 @@ async function handleRanking(req, res, pathSegments, queryParams) {
8075
8111
  if (listing)
8076
8112
  emitOptedOut(listing.domain);
8077
8113
  scheduleIntegrationsReload();
8078
- optOut.respond(res, 200, {
8079
- enabled: false,
8080
- leaveUrl: listing ? rankingLeaveUrl(listing.domain) : null
8081
- });
8114
+ optOut.respond(res, 200, { enabled: false });
8082
8115
  return true;
8083
8116
  }
8084
8117
  return false;
@@ -12926,7 +12959,6 @@ async function handleFavorites(req, res, pathSegments, queryParams, myAgentId) {
12926
12959
 
12927
12960
  // src/http/fleet-benchmark.ts
12928
12961
  init_zod();
12929
- init_db3();
12930
12962
 
12931
12963
  // src/fleet-benchmark.ts
12932
12964
  var FLEET_WINDOW_DAYS = 30;
@@ -13005,8 +13037,8 @@ function round(value, decimals) {
13005
13037
 
13006
13038
  // src/be/fleet-benchmark-stats.ts
13007
13039
  init_runtime();
13008
- async function getLocalFleetStats(now = new Date) {
13009
- const start = fleetCountStart(await getTelemetryIngestAnchor(), now);
13040
+ async function getLocalFleetStats(now = new Date, { requireIngestAnchor = true } = {}) {
13041
+ const start = requireIngestAnchor ? fleetCountStart(await getTelemetryIngestAnchor(), now) : new Date(now.getTime() - FLEET_WINDOW_DAYS * 86400000);
13010
13042
  if (!start)
13011
13043
  return null;
13012
13044
  const since = start.toISOString();
@@ -13027,6 +13059,8 @@ async function getLocalFleetStats(now = new Date) {
13027
13059
 
13028
13060
  // src/http/fleet-benchmark.ts
13029
13061
  init_telemetry();
13062
+ init_company_profile();
13063
+ init_org_website();
13030
13064
  var FLEET_TTL_MS = 24 * 60 * 60 * 1000;
13031
13065
  var FLEET_FAILURE_TTL_MS = 60 * 60 * 1000;
13032
13066
  var LOCAL_TTL_MS = 10 * 60 * 1000;
@@ -13040,6 +13074,12 @@ var FleetStateSchema = _enum2([
13040
13074
  ]);
13041
13075
  var FleetBenchmarkResponseSchema = object2({
13042
13076
  state: FleetStateSchema,
13077
+ level: _enum2(["basic", "full"]),
13078
+ peerGroup: object2({
13079
+ teamSize: string2().nullable(),
13080
+ useCase: string2().nullable(),
13081
+ orgs: number2().int()
13082
+ }).nullable(),
13043
13083
  local: object2({
13044
13084
  tasksPerWeek: number2(),
13045
13085
  taskSuccessRate: number2().nullable(),
@@ -13063,7 +13103,7 @@ var fleetBenchmark = route({
13063
13103
  path: "/api/fleet-benchmark",
13064
13104
  pattern: ["api", "fleet-benchmark"],
13065
13105
  summary: "Compare this swarm with similar swarms",
13066
- description: "Places this swarm's tasks per week and task success rate (last 30 days) in the fleet percentiles published by the telemetry proxy, against swarms with the same agent count when enough exist. Needs telemetry on and an organization name; otherwise `state` says what is missing and the proxy is not called. `unavailable` also covers an install whose first event the proxy saw cannot be established locally (until 30 days after the first accepted event). The fleet numbers are cached for a day.",
13106
+ description: "Compares local task volume and success rate with fleet percentiles over the last 30 days. Comparisons require telemetry, an organization name, and a known proxy ingest date. A website, team size, and use case enable full comparisons with peer filters. The response includes the proxy's peer group when available. With telemetry off, it returns local DB counts without a proxy request. The fleet cache key includes the peer filters.",
13067
13107
  tags: ["Telemetry"],
13068
13108
  responses: {
13069
13109
  200: {
@@ -13099,48 +13139,64 @@ var ProxyFleetBenchmarksSchema = object2({
13099
13139
  "1": ProxyBlockSchema.optional(),
13100
13140
  "2-5": ProxyBlockSchema.optional(),
13101
13141
  "6+": ProxyBlockSchema.optional()
13102
- })
13103
- });
13104
- async function fleetBenchmarks(now) {
13105
- if (fleetCache && fleetCache.until > now)
13142
+ }),
13143
+ peer_group: object2({
13144
+ team_size: string2().nullable(),
13145
+ use_case: string2().nullable(),
13146
+ orgs: number2().int().nonnegative()
13147
+ }).nullable().optional()
13148
+ });
13149
+ async function fleetBenchmarks(now, peerGroup) {
13150
+ const endpoint = new URL(await telemetryProxyEndpoint("/v1/fleet/benchmarks"));
13151
+ endpoint.searchParams.set("window", "30d");
13152
+ if (peerGroup) {
13153
+ endpoint.searchParams.set("team_size", peerGroup.teamSize);
13154
+ endpoint.searchParams.set("use_case", peerGroup.useCase);
13155
+ }
13156
+ const key = endpoint.toString();
13157
+ if (fleetCache?.key === key && fleetCache.until > now)
13106
13158
  return fleetCache.value;
13107
13159
  let value = null;
13108
13160
  try {
13109
- const response = await fetch(`${await telemetryProxyEndpoint("/v1/fleet/benchmarks")}?window=30d`, {
13110
- signal: AbortSignal.timeout(TIMEOUT_MS2)
13111
- });
13161
+ const response = await fetch(key, { signal: AbortSignal.timeout(TIMEOUT_MS2) });
13112
13162
  if (response.ok) {
13113
13163
  const parsed = ProxyFleetBenchmarksSchema.safeParse(await response.json());
13114
13164
  if (parsed.success)
13115
13165
  value = parsed.data;
13116
13166
  }
13117
13167
  } catch {}
13118
- fleetCache = { value, until: now + (value ? FLEET_TTL_MS : FLEET_FAILURE_TTL_MS) };
13168
+ fleetCache = { key, value, until: now + (value ? FLEET_TTL_MS : FLEET_FAILURE_TTL_MS) };
13119
13169
  return value;
13120
13170
  }
13121
- async function localStats(now) {
13122
- if (localCache && localCache.until > now.getTime())
13171
+ async function localStats(now, requireIngestAnchor = true) {
13172
+ if (localCache?.requireIngestAnchor === requireIngestAnchor && localCache.until > now.getTime())
13123
13173
  return localCache.value;
13124
- const value = await getLocalFleetStats(now);
13125
- localCache = { value, until: now.getTime() + LOCAL_TTL_MS };
13174
+ const value = await getLocalFleetStats(now, { requireIngestAnchor });
13175
+ localCache = { requireIngestAnchor, value, until: now.getTime() + LOCAL_TTL_MS };
13126
13176
  return value;
13127
13177
  }
13128
- async function orgName() {
13129
- const stored = (await getSwarmConfigs2({ scope: "global", key: "SWARM_ORG_NAME" }))?.[0]?.value?.trim();
13130
- return stored || process.env.SWARM_ORG_NAME?.trim() || undefined;
13131
- }
13132
13178
  async function buildFleetBenchmarkResponse(now = new Date) {
13179
+ const [name, website, teamSize, useCase] = await Promise.all([
13180
+ globalConfig("SWARM_ORG_NAME"),
13181
+ globalConfig("SWARM_ORG_WEBSITE"),
13182
+ globalConfig("SWARM_ORG_TEAM_SIZE"),
13183
+ globalConfig("SWARM_ORG_USE_CASE")
13184
+ ]);
13185
+ const team = _enum2(COMPANY_TEAM_SIZES).safeParse(teamSize);
13186
+ const use = _enum2(COMPANY_USE_CASES).safeParse(useCase);
13187
+ const peerGroup = normalizeOrgWebsite(website) && team.success && use.success ? { teamSize: team.data, useCase: use.data } : null;
13133
13188
  const empty = {
13189
+ level: peerGroup ? "full" : "basic",
13190
+ peerGroup: null,
13134
13191
  local: null,
13135
13192
  minFinishedTasks: FLEET_MIN_FINISHED_TASKS,
13136
13193
  generatedAt: null,
13137
13194
  comparisons: []
13138
13195
  };
13139
- if (!isTelemetryEnabled())
13140
- return { state: "telemetry_off", ...empty };
13141
- if (!await orgName())
13196
+ const telemetryEnabled = isTelemetryEnabled();
13197
+ if (telemetryEnabled && !name)
13142
13198
  return { state: "no_org_name", ...empty };
13143
- const stats = await localStats(now);
13199
+ const stats = await localStats(now, telemetryEnabled);
13144
13200
  if (!stats)
13145
13201
  return { state: "unavailable", ...empty };
13146
13202
  const finishedTasks = stats.tasksCompleted + stats.tasksFailed;
@@ -13151,14 +13207,23 @@ async function buildFleetBenchmarkResponse(now = new Date) {
13151
13207
  agents: stats.agents,
13152
13208
  bucket: fleetBucketFor(stats.agents)
13153
13209
  };
13210
+ if (!telemetryEnabled)
13211
+ return { ...empty, state: "telemetry_off", local };
13154
13212
  if (finishedTasks < FLEET_MIN_FINISHED_TASKS)
13155
13213
  return { ...empty, state: "not_enough_tasks", local };
13156
- const fleet = await fleetBenchmarks(now.getTime());
13214
+ const fleet = await fleetBenchmarks(now.getTime(), peerGroup);
13215
+ const responsePeerGroup = peerGroup && fleet?.peer_group ? {
13216
+ teamSize: fleet.peer_group.team_size,
13217
+ useCase: fleet.peer_group.use_case,
13218
+ orgs: fleet.peer_group.orgs
13219
+ } : null;
13157
13220
  const comparisons = fleet ? compareWithFleet(stats, fleet, now) : [];
13158
13221
  if (!fleet || comparisons.length === 0)
13159
- return { ...empty, state: "unavailable", local };
13222
+ return { ...empty, state: "unavailable", local, peerGroup: responsePeerGroup };
13160
13223
  return {
13224
+ ...empty,
13161
13225
  state: "ready",
13226
+ peerGroup: responsePeerGroup,
13162
13227
  local,
13163
13228
  minFinishedTasks: FLEET_MIN_FINISHED_TASKS,
13164
13229
  generatedAt: fleet.generatedAt,
@@ -21155,17 +21220,8 @@ var TestConnectionResponseSchema = object2({
21155
21220
  error: string2().optional(),
21156
21221
  latency_ms: number2().int().nonnegative()
21157
21222
  });
21158
- function getCredVerifyTtlMs() {
21159
- const raw = process.env.SWARM_VERIFY_TTL_MS;
21160
- if (!raw)
21161
- return 3600000;
21162
- const parsed = Number.parseInt(raw, 10);
21163
- if (Number.isNaN(parsed) || parsed <= 0)
21164
- return 3600000;
21165
- return parsed;
21166
- }
21167
21223
  async function rollupCredStatusForProvider(provider) {
21168
- const agents = await listAgentsWithCredStatusByProvider2(provider);
21224
+ const agents = (await listAgentsWithCredStatusByProvider2(provider)).filter((a) => a.status !== "offline");
21169
21225
  const reports = agents.map((a) => a.credStatus).filter((s) => s != null);
21170
21226
  if (reports.length === 0) {
21171
21227
  return {
@@ -21178,14 +21234,12 @@ async function rollupCredStatusForProvider(provider) {
21178
21234
  oldestReportAgeMs: null
21179
21235
  };
21180
21236
  }
21181
- const ttl = getCredVerifyTtlMs();
21182
21237
  const now = Date.now();
21183
- const isFreshPassingReport = (report) => report.liveTest?.ok === true && now - (report.liveTest?.testedAt ?? 0) < ttl;
21184
- const passing = reports.filter(isFreshPassingReport).sort((a, b) => (b.liveTest?.testedAt ?? 0) - (a.liveTest?.testedAt ?? 0));
21238
+ const passing = reports.filter((r) => r.liveTest?.ok === true);
21185
21239
  const anyLive = reports.filter((r) => r.liveTest != null).sort((a, b) => (b.liveTest?.testedAt ?? 0) - (a.liveTest?.testedAt ?? 0));
21186
- const latestLiveTest = passing[0]?.liveTest ?? anyLive[0]?.liveTest ?? null;
21240
+ const latestLiveTest = anyLive[0]?.liveTest ?? null;
21187
21241
  const anyReady = reports.some((r) => r.ready);
21188
- const state = passing.length > 0 ? "verified" : anyReady ? "configured" : "unverified";
21242
+ const state = latestLiveTest?.ok === true ? "verified" : anyReady ? "configured" : "unverified";
21189
21243
  const latestNotReady = reports.filter((r) => !r.ready).sort((a, b) => b.reportedAt - a.reportedAt)[0];
21190
21244
  const latestMissing = latestNotReady?.missing ?? [];
21191
21245
  const oldestReportAgeMs = reports.length > 0 ? Math.max(...reports.map((r) => now - r.reportedAt)) : null;
@@ -21213,17 +21267,16 @@ function buildIdentity() {
21213
21267
  };
21214
21268
  }
21215
21269
  function describeRoll(roll) {
21270
+ if (roll.state === "verified")
21271
+ return null;
21216
21272
  if (roll.workers === 0)
21217
21273
  return "no workers";
21218
- if (roll.reports === 0) {
21219
- return `${roll.workers} ${roll.workers === 1 ? "worker" : "workers"}, none reported`;
21274
+ if (roll.reports === 0)
21275
+ return "no credential report";
21276
+ if (roll.state === "configured") {
21277
+ return roll.latestLiveTest?.ok === false ? "live test failed" : "not live-tested";
21220
21278
  }
21221
- const w = `${roll.workers} ${roll.workers === 1 ? "worker" : "workers"}`;
21222
- if (roll.state === "verified")
21223
- return `${w} · live test ok`;
21224
- if (roll.state === "configured")
21225
- return `${w} · presence ok, awaiting live test`;
21226
- return roll.latestMissing.length > 0 ? `missing: ${roll.latestMissing.join(", ")}` : "creds blocked";
21279
+ return roll.latestMissing.length > 0 ? `missing: ${roll.latestMissing.join(", ")}` : "credentials blocked";
21227
21280
  }
21228
21281
  async function harnessMilestone() {
21229
21282
  const fleet = await getAgentHarnessProviders2();
@@ -21237,14 +21290,25 @@ async function harnessMilestone() {
21237
21290
  };
21238
21291
  }
21239
21292
  const perProvider = [];
21293
+ let recognised = 0;
21240
21294
  for (const { provider } of fleet) {
21241
21295
  const parsed = ProviderNameSchema.safeParse(provider);
21242
21296
  if (!parsed.success)
21243
21297
  continue;
21244
- perProvider.push({
21245
- provider: parsed.data,
21246
- roll: await rollupCredStatusForProvider(parsed.data)
21247
- });
21298
+ recognised++;
21299
+ const roll = await rollupCredStatusForProvider(parsed.data);
21300
+ if (roll.workers === 0)
21301
+ continue;
21302
+ perProvider.push({ provider: parsed.data, roll });
21303
+ }
21304
+ if (recognised > 0 && perProvider.length === 0) {
21305
+ return {
21306
+ id: "harness",
21307
+ label: "Harness configured",
21308
+ state: "unverified",
21309
+ hint: "No agents online. Start a worker to run a live credential test.",
21310
+ action_url: "/agents"
21311
+ };
21248
21312
  }
21249
21313
  if (perProvider.length === 0) {
21250
21314
  return {
@@ -21257,7 +21321,10 @@ async function harnessMilestone() {
21257
21321
  }
21258
21322
  const states = perProvider.map((p) => p.roll.state);
21259
21323
  const aggregateState = states.every((s) => s === "verified") ? "verified" : states.every((s) => s !== "unverified") ? "configured" : "unverified";
21260
- const hint = perProvider.map((p) => `${p.provider}: ${describeRoll(p.roll)}`).join(" · ");
21324
+ const hint = perProvider.flatMap((p) => {
21325
+ const phrase = describeRoll(p.roll);
21326
+ return phrase ? [`${p.provider}: ${phrase}`] : [];
21327
+ }).join(" · ") || undefined;
21261
21328
  const singleProvider = perProvider.length === 1 ? perProvider[0]?.provider : undefined;
21262
21329
  return {
21263
21330
  id: "harness",
@@ -21582,7 +21649,7 @@ async function handleStatus(req, res, pathSegments, queryParams) {
21582
21649
  if (roll.workers === 0) {
21583
21650
  json(res, {
21584
21651
  ok: false,
21585
- error: `No workers registered with HARNESS_PROVIDER=${provider}. Start a worker — its boot loop will run a live test and report it here.`,
21652
+ error: `No online workers with HARNESS_PROVIDER=${provider}. Start a worker — its boot loop will run a live test and report it here.`,
21586
21653
  latency_ms: 0
21587
21654
  });
21588
21655
  return true;
@@ -22486,6 +22553,32 @@ var getTask = route({
22486
22553
  404: { description: "Task not found" }
22487
22554
  }
22488
22555
  });
22556
+ var getTaskLineageRoute = route({
22557
+ method: "get",
22558
+ path: "/api/tasks/{id}/lineage",
22559
+ pattern: ["api", "tasks", null, "lineage"],
22560
+ session: { taskParam: "id" },
22561
+ summary: "Get the tree a task belongs to (ancestors and descendants)",
22562
+ description: `Follows \`parentTaskId\` up to the topmost ancestor, then returns every descendant of that root as slim task rows, the task's own subtree first. Bounded: at most ${TASK_LINEAGE_LIMITS2.maxAncestors} hops up, \`maxDepth\` levels down and about twice \`maxNodes\` rows; \`truncated\` is true when any task in the tree is missing from the response.`,
22563
+ tags: ["Tasks"],
22564
+ params: object2({ id: string2() }),
22565
+ query: object2({
22566
+ maxNodes: exports_coerce.number().int().min(1).max(TASK_LINEAGE_LIMITS2.maxNodes).optional(),
22567
+ maxDepth: exports_coerce.number().int().min(1).max(TASK_LINEAGE_LIMITS2.maxDepth).optional()
22568
+ }),
22569
+ responses: {
22570
+ 200: {
22571
+ description: "The lineage tree as a flat list linked by `parentTaskId`",
22572
+ schema: object2({
22573
+ rootTaskId: string2(),
22574
+ tasks: array2(AgentTaskSummarySchema.extend({ workflowRunId: string2().optional() })),
22575
+ truncated: boolean()
22576
+ })
22577
+ },
22578
+ 403: { description: "A user caller cannot read the task's session" },
22579
+ 404: { description: "Task not found" }
22580
+ }
22581
+ });
22489
22582
  var updateTaskProgressRoute = route({
22490
22583
  method: "post",
22491
22584
  path: "/api/tasks/{id}/progress",
@@ -22876,6 +22969,7 @@ async function handleTasks(req, res, pathSegments, queryParams, myAgentId) {
22876
22969
  offeredTo: parsed.body.offeredTo || undefined,
22877
22970
  dir: parsed.body.dir || undefined,
22878
22971
  parentTaskId: parsed.body.parentTaskId || undefined,
22972
+ inheritParentOutputSchema: principal.kind === "agent",
22879
22973
  source: parsed.body.source || "api",
22880
22974
  outputSchema: parsed.body.outputSchema || undefined,
22881
22975
  contextKey: parsed.body.contextKey || undefined,
@@ -23280,6 +23374,21 @@ async function handleTasks(req, res, pathSegments, queryParams, myAgentId) {
23280
23374
  });
23281
23375
  return true;
23282
23376
  }
23377
+ if (getTaskLineageRoute.match(req.method, pathSegments)) {
23378
+ const parsed = await getTaskLineageRoute.parse(req, res, pathSegments, queryParams);
23379
+ if (!parsed)
23380
+ return true;
23381
+ const lineage = await getTaskLineage2(parsed.params.id, {
23382
+ maxNodes: parsed.query.maxNodes,
23383
+ maxDepth: parsed.query.maxDepth
23384
+ });
23385
+ if (!lineage) {
23386
+ jsonError(res, "Task not found", 404);
23387
+ return true;
23388
+ }
23389
+ getTaskLineageRoute.respond(res, 200, lineage);
23390
+ return true;
23391
+ }
23283
23392
  if (updateTaskProgressRoute.match(req.method, pathSegments)) {
23284
23393
  const parsed = await updateTaskProgressRoute.parse(req, res, pathSegments, queryParams);
23285
23394
  if (!parsed)
@@ -23575,7 +23684,7 @@ async function handleTasks(req, res, pathSegments, queryParams, myAgentId) {
23575
23684
  return true;
23576
23685
  }
23577
23686
  if (task.workflowRunStepId != null) {
23578
- const failed = await failTask2(parsed.params.id, "superseded_workflow_task");
23687
+ const failed = await failTask2(parsed.params.id, SUPERSEDED_WORKFLOW_TASK_REASON);
23579
23688
  ensure({
23580
23689
  id: "task.workflow_step_failed_on_supersede",
23581
23690
  flow: "task",
@@ -34968,9 +35077,8 @@ function uiEventEmitter(event) {
34968
35077
  return relayable.get(event)?.source;
34969
35078
  }
34970
35079
  function resolveSpec(spec) {
34971
- if (!spec.ref)
34972
- return spec;
34973
- return { ...file.definitions[spec.ref], ...spec };
35080
+ const resolved = spec.ref ? { ...file.definitions[spec.ref], ...spec } : spec;
35081
+ return resolved.items ? { ...resolved, items: resolveSpec(resolved.items) } : resolved;
34974
35082
  }
34975
35083
  function typeMatches(type, value) {
34976
35084
  switch (type) {
@@ -35015,6 +35123,12 @@ function validateUiEvent(event, properties) {
35015
35123
  if (spec.enum && !spec.enum.includes(value)) {
35016
35124
  problems.push(`"${key}" must be one of ${spec.enum.join(", ")}`);
35017
35125
  }
35126
+ if (Array.isArray(value) && spec.items?.enum) {
35127
+ const allowed = spec.items.enum;
35128
+ if (value.some((item) => !allowed.includes(item))) {
35129
+ problems.push(`"${key}" items must be one of ${allowed.join(", ")}`);
35130
+ }
35131
+ }
35018
35132
  if (typeof spec.minimum === "number" && typeof value === "number" && value < spec.minimum) {
35019
35133
  problems.push(`"${key}" must be at least ${spec.minimum}`);
35020
35134
  }
@@ -35055,7 +35169,7 @@ var enableTelemetry = route({
35055
35169
  summary: "Turn telemetry on",
35056
35170
  description: "Stores `ANONYMIZED_TELEMETRY=true` and applies it to the running server: the install ID is minted if needed and `telemetry.enabled` is sent once, so no restart is needed.",
35057
35171
  tags: ["Telemetry"],
35058
- body: object2({ via: _enum2(["banner", "settings"]).default("banner") }),
35172
+ body: object2({ via: _enum2(["banner", "settings", "benchmark"]).default("banner") }),
35059
35173
  responses: {
35060
35174
  200: {
35061
35175
  description: "Telemetry is on",
@@ -36006,7 +36120,7 @@ var createUserRoute = route({
36006
36120
  tags: ["Users"],
36007
36121
  body: object2({
36008
36122
  name: string2().min(1),
36009
- email: string2().optional(),
36123
+ email: string2().email("Email must be a valid email address").optional(),
36010
36124
  role: string2().optional(),
36011
36125
  notes: string2().optional(),
36012
36126
  emailAliases: array2(string2()).optional(),
@@ -36101,7 +36215,7 @@ var updateUserRoute = route({
36101
36215
  params: object2({ id: string2() }),
36102
36216
  body: object2({
36103
36217
  name: string2().min(1).optional(),
36104
- email: string2().optional(),
36218
+ email: string2().email("Email must be a valid email address").nullable().optional(),
36105
36219
  role: string2().optional(),
36106
36220
  notes: string2().optional(),
36107
36221
  emailAliases: array2(string2()).optional(),
@@ -39012,7 +39126,7 @@ var httpServer = createHttpServer(async (req, res) => {
39012
39126
  });
39013
39127
  });
39014
39128
  var detachRealtime = attachRealtimeTransport(httpServer);
39015
- var { attachControllerTransport } = await import("./controllers-connect-gkxmqw9d.js");
39129
+ var { attachControllerTransport } = await import("./controllers-connect-5fym8sw1.js");
39016
39130
  var detachControllers = attachControllerTransport(httpServer);
39017
39131
  var stopWorkerNudges = startWorkerNudgeListener();
39018
39132
  var stopRoomDeletion = realtimeBus.subscribe("room:namespace-deleted", (namespace) => {
@@ -39041,7 +39155,7 @@ async function shutdown() {
39041
39155
  sessionsProcessed: getServerSessionsProcessed()
39042
39156
  });
39043
39157
  if (hasCapability("scheduling")) {
39044
- const { stopScheduler } = await import("./index-8pwc1jc8.js");
39158
+ const { stopScheduler } = await import("./index-aex0eba9.js");
39045
39159
  stopScheduler();
39046
39160
  }
39047
39161
  stopHeartbeat2();
@@ -39053,7 +39167,7 @@ async function shutdown() {
39053
39167
  await stopSlackApp2();
39054
39168
  await stopChatSdk();
39055
39169
  if (process.env.OAUTH_KEEPALIVE_DISABLE !== "true") {
39056
- const { stopOAuthKeepalive } = await import("./keepalive-3nr4st3r.js");
39170
+ const { stopOAuthKeepalive } = await import("./keepalive-64c0f34c.js");
39057
39171
  await stopOAuthKeepalive();
39058
39172
  }
39059
39173
  stopOAuthPendingGc();
@@ -39133,21 +39247,21 @@ try {
39133
39247
  console.warn("[startup] CAPABILITIES upgrade seed failed (non-fatal):", err);
39134
39248
  }
39135
39249
  try {
39136
- const { ensurePricingSeeded } = await import("./boot-seeds-xs9a8dx1.js");
39250
+ const { ensurePricingSeeded } = await import("./boot-seeds-g5hfc1x8.js");
39137
39251
  ensurePricingSeeded();
39138
- const { startPricingRefreshLoop } = await import("./pricing-refresh-5nvme3sm.js");
39252
+ const { startPricingRefreshLoop } = await import("./pricing-refresh-1nek2w7b.js");
39139
39253
  startPricingRefreshLoop();
39140
39254
  } catch (err) {
39141
39255
  console.error("[startup] Failed to seed pricing rows:", err);
39142
39256
  }
39143
39257
  try {
39144
- const { ensureModelProfilesSeeded } = await import("./boot-seeds-xs9a8dx1.js");
39258
+ const { ensureModelProfilesSeeded } = await import("./boot-seeds-g5hfc1x8.js");
39145
39259
  await ensureModelProfilesSeeded();
39146
39260
  } catch (err) {
39147
39261
  console.error("[startup] Failed to seed model profiles:", err);
39148
39262
  }
39149
39263
  try {
39150
- const { ensureRbacSeeded } = await import("./boot-seeds-xs9a8dx1.js");
39264
+ const { ensureRbacSeeded } = await import("./boot-seeds-g5hfc1x8.js");
39151
39265
  ensureRbacSeeded();
39152
39266
  } catch (err) {
39153
39267
  console.error("[startup] Failed to sync RBAC seed rows:", err);
@@ -39155,7 +39269,7 @@ try {
39155
39269
  throw err;
39156
39270
  }
39157
39271
  try {
39158
- const { runAllSeeders } = await import("./index-s7ckdajq.js");
39272
+ const { runAllSeeders } = await import("./index-y7rbcrc1.js");
39159
39273
  await runAllSeeders({ scriptEmbeddingMode: "skip" });
39160
39274
  } catch (err) {
39161
39275
  console.error("[startup] Failed to seed built-in entities:", err);
@@ -39217,39 +39331,39 @@ httpServer.listen(port, async () => {
39217
39331
  await initWorkflows2();
39218
39332
  await startScriptRunSupervisor(getMcpBaseUrl());
39219
39333
  if (hasCapability("scheduling")) {
39220
- const { startScheduler } = await import("./index-8pwc1jc8.js");
39221
- const { getExecutorRegistry } = await import("./index-dg2tmj99.js");
39334
+ const { startScheduler } = await import("./index-aex0eba9.js");
39335
+ const { getExecutorRegistry } = await import("./index-vzvfqzfj.js");
39222
39336
  const intervalMs = Number(process.env.SCHEDULER_INTERVAL_MS) || 1e4;
39223
39337
  startScheduler(getExecutorRegistry(), intervalMs, {
39224
39338
  runId: globalState.__runId
39225
39339
  });
39226
39340
  }
39227
39341
  if (!isEnvFlagEnabled("HEARTBEAT_DISABLE", false)) {
39228
- const { startHeartbeat } = await import("./index-nxa6me0q.js");
39342
+ const { startHeartbeat } = await import("./index-5jecgp3n.js");
39229
39343
  const heartbeatMs = Number(process.env.HEARTBEAT_INTERVAL_MS) || 90000;
39230
39344
  startHeartbeat(heartbeatMs);
39231
39345
  }
39232
39346
  startPoolRouting();
39233
39347
  startRuntimeSupervisor();
39234
39348
  if (process.env.OAUTH_KEEPALIVE_DISABLE !== "true") {
39235
- const { startOAuthKeepalive } = await import("./keepalive-3nr4st3r.js");
39349
+ const { startOAuthKeepalive } = await import("./keepalive-64c0f34c.js");
39236
39350
  startOAuthKeepalive();
39237
39351
  }
39238
39352
  if (process.env.OAUTH_REFRESH_SWEEP_DISABLE !== "true") {
39239
- const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-9q2t0y3q.js");
39353
+ const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-36hs2v4h.js");
39240
39354
  startOAuthRefreshSweep();
39241
39355
  }
39242
39356
  startOAuthPendingGc();
39243
39357
  await startMemoryGc();
39244
39358
  await startDbRetention();
39245
39359
  startHumanFreeDrain();
39246
- import("./boot-reembed-qr8a894z.js").then(({ runBootReembed }) => runBootReembed()).catch((err) => {
39360
+ import("./boot-reembed-6yn53ms9.js").then(({ runBootReembed }) => runBootReembed()).catch((err) => {
39247
39361
  console.error("[boot-reembed] startup backfill failed (non-fatal):", err);
39248
39362
  });
39249
- import("./boot-reembed-rj85jjhw.js").then(({ runBootReembedScripts }) => runBootReembedScripts()).catch((err) => {
39363
+ import("./boot-reembed-7fcka4z5.js").then(({ runBootReembedScripts }) => runBootReembedScripts()).catch((err) => {
39250
39364
  console.error("[boot-reembed-scripts] startup backfill failed (non-fatal):", err);
39251
39365
  });
39252
- import("./boot-scrub-sweep-eyfvn6v9.js").then(({ runBootScrubSweep }) => runBootScrubSweep()).catch((err) => {
39366
+ import("./boot-scrub-sweep-pm1580ax.js").then(({ runBootScrubSweep }) => runBootScrubSweep()).catch((err) => {
39253
39367
  console.error("[boot-scrub-sweep] startup scrub failed (non-fatal):", err);
39254
39368
  });
39255
39369
  }).on("error", (err) => {