@desplega.ai/agent-swarm 1.153.0 → 1.154.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 (143) hide show
  1. package/README.md +1 -1
  2. package/dist/{acp-adapter-ahmjxhek.js → acp-adapter-eb2aj8xy.js} +1 -1
  3. package/dist/{actions-jzrfpkmn.js → actions-kpnwp1kz.js} +18 -18
  4. package/dist/{app-03na2vwb.js → app-zk1apkf6.js} +6 -6
  5. package/dist/{assistant-hfkxvhgt.js → assistant-kwq4y50q.js} +19 -19
  6. package/dist/{boot-reembed-c98xrad3.js → boot-reembed-22hd3jjn.js} +7 -7
  7. package/dist/{boot-reembed-zt3qm9xn.js → boot-reembed-qe168424.js} +8 -8
  8. package/dist/{boot-scrub-logs-jcqd8ksj.js → boot-scrub-logs-pkdpsrjd.js} +5 -5
  9. package/dist/{claude-adapter-mgryg8g3.js → claude-adapter-3fx90nww.js} +10 -10
  10. package/dist/{claude-sdk-session-jjf4zss1.js → claude-sdk-session-z7fahf1k.js} +10 -10
  11. package/dist/{cli-1hwnb4hc.js → cli-09y3tjxz.js} +1 -1
  12. package/dist/{cli-b2g6mzjc.js → cli-0e31nm4n.js} +1 -1
  13. package/dist/{cli-5mbmvxnn.js → cli-1jpjafw4.js} +5 -5
  14. package/dist/{cli-bw0dfwkr.js → cli-243tzws8.js} +1 -1
  15. package/dist/{cli-rj7de4b2.js → cli-24k806sc.js} +1 -1
  16. package/dist/{cli-7g9s78jf.js → cli-3bkz2p7j.js} +7 -6
  17. package/dist/{cli-zcsyfw2z.js → cli-4k7jazkq.js} +4 -0
  18. package/dist/{cli-s5s1f2yn.js → cli-5vs0nh43.js} +25 -20
  19. package/dist/{cli-qrqhc31j.js → cli-6r3cgpk2.js} +94 -52
  20. package/dist/{cli-pgj4a5fb.js → cli-71cj99hx.js} +4 -3
  21. package/dist/{cli-d6hk10xx.js → cli-8sea27q4.js} +2 -2
  22. package/dist/{cli-a9scg8sv.js → cli-913yakhv.js} +22 -7
  23. package/dist/{cli-pf9q3696.js → cli-927erqqt.js} +5 -2
  24. package/dist/{cli-zy5w9gpt.js → cli-95jnpnqg.js} +1 -1
  25. package/dist/{cli-cdq08v3r.js → cli-abp3g4ax.js} +15 -2
  26. package/dist/{cli-nq0kgyxe.js → cli-acy6bfhr.js} +10 -7
  27. package/dist/{cli-n0q9b7j4.js → cli-c1v10xb2.js} +157 -52
  28. package/dist/{cli-tdh4hjr2.js → cli-e0pg4zeh.js} +1 -1
  29. package/dist/{cli-83wkg402.js → cli-e31ehqwy.js} +1 -1
  30. package/dist/{cli-m04pt18h.js → cli-e3229na9.js} +3 -3
  31. package/dist/{cli-ysc1kbet.js → cli-e3cyf59d.js} +2 -2
  32. package/dist/{cli-mzgyhxbe.js → cli-fdzg6jhf.js} +2 -2
  33. package/dist/{cli-0d9nbqxf.js → cli-g2h29qar.js} +2 -2
  34. package/dist/{cli-djvxhnc4.js → cli-ge67p080.js} +124 -26
  35. package/dist/{cli-7pnz2v6s.js → cli-hws0vn86.js} +2 -2
  36. package/dist/{cli-3bcmp015.js → cli-kp3qs53m.js} +2 -2
  37. package/dist/{cli-ybpp1srm.js → cli-myaxtgh8.js} +2 -1
  38. package/dist/{cli-r8tdds6s.js → cli-n62atwh9.js} +1 -1
  39. package/dist/{cli-6ks9xf1n.js → cli-pf1v8xhb.js} +4 -4
  40. package/dist/{cli-5taqtpze.js → cli-q85qhckh.js} +6 -6
  41. package/dist/{cli-eazstkad.js → cli-r1d3dzt6.js} +2 -2
  42. package/dist/{cli-ja7mrygn.js → cli-rxkqvngf.js} +2 -2
  43. package/dist/{cli-vw03hg5t.js → cli-stwsmd6k.js} +2 -2
  44. package/dist/{cli-z61ykvam.js → cli-wg04s9kr.js} +4 -3
  45. package/dist/cli.js +13 -12
  46. package/dist/{codex-adapter-8548daap.js → codex-adapter-ttdm995v.js} +5 -5
  47. package/dist/{codex-hook-8jexc34x.js → codex-hook-8gx7bcz0.js} +3 -3
  48. package/dist/{codex-session-runner-2dad8p4x.js → codex-session-runner-3v8nh4c8.js} +5 -5
  49. package/dist/{commands-355dbpa8.js → commands-1cxwbhhq.js} +5 -5
  50. package/dist/{db-4jjvwz1s.js → db-y9zwsr79.js} +23 -5
  51. package/dist/{dispatcher-ca590nkz.js → dispatcher-9m9zss36.js} +17 -17
  52. package/dist/{dsh-adapter-rgvj6ykp.js → dsh-adapter-gsb2qqf9.js} +2 -2
  53. package/dist/{google-generative-ai-xtw7tggr.js → google-generative-ai-gwwrnzqn.js} +1 -1
  54. package/dist/{google-vertex-zdqpms6n.js → google-vertex-5wfawpwz.js} +1 -1
  55. package/dist/{handlers-2y6dqpvf.js → handlers-36fm1bwn.js} +20 -20
  56. package/dist/{hook-0s8knepr.js → hook-pntw4r8h.js} +8 -8
  57. package/dist/{hook-k0gec254.js → hook-vwq8y26p.js} +9 -9
  58. package/dist/{http-jp2nb4zw.js → http-20jesakk.js} +89 -56
  59. package/dist/{index-42s7eezq.js → index-6artrehg.js} +17 -17
  60. package/dist/{index-3mq6ce93.js → index-9n5z2492.js} +17 -17
  61. package/dist/{index-0wzg3sp3.js → index-j5wrf1yw.js} +11 -11
  62. package/dist/{index-s37dbevy.js → index-m2xqpz5r.js} +18 -18
  63. package/dist/{index-b56xkbc7.js → index-m9ks8a7t.js} +7 -7
  64. package/dist/{keepalive-9pfw7t02.js → keepalive-pwxvxd2c.js} +7 -7
  65. package/dist/{lead-7vcmcdq4.js → lead-m789wqa3.js} +26 -26
  66. package/dist/{maintenance-x277jbpd.js → maintenance-bvg6w7e2.js} +8 -8
  67. package/dist/{oauth-refresh-sweep-5fwa7th2.js → oauth-refresh-sweep-6v4bd737.js} +6 -6
  68. package/dist/{onboard-17sv0f51.js → onboard-snckpcj1.js} +14 -2
  69. package/dist/{otel-impl-srjy4be4.js → otel-impl-e0ytens5.js} +1 -1
  70. package/dist/{pi-mono-adapter-946a0sdd.js → pi-mono-adapter-c4ggemhz.js} +6 -6
  71. package/dist/{pricing-refresh-vetcm563.js → pricing-refresh-52g2ywrw.js} +7 -7
  72. package/dist/{rbac-roles-cmxaddmy.js → rbac-roles-5455kfdn.js} +5 -5
  73. package/dist/{rbac-roles-cfzgr6r1.js → rbac-roles-hbf0xa52.js} +6 -6
  74. package/dist/{render-v2-f9hzff72.js → render-v2-npm8xdzh.js} +12 -8
  75. package/dist/{seed-pricing-jggk6rsy.js → seed-pricing-650wbr1n.js} +6 -6
  76. package/dist/{setup-8mfceb9t.js → setup-k1mew5rf.js} +2 -2
  77. package/dist/{virtual-modules-ax661xp0.js → virtual-modules-2q5b2pk4.js} +2 -2
  78. package/dist/{work-objects-vdsdcczj.js → work-objects-2ea3kvwg.js} +20 -20
  79. package/dist/{worker-cd0nhyv1.js → worker-ec6hvc4m.js} +26 -26
  80. package/openapi.json +74 -3
  81. package/package.json +2 -1
  82. package/plugin/opencode-plugins/lib/memory-raters.ts +7 -0
  83. package/src/be/db/agents.ts +75 -2
  84. package/src/be/db/tasks/read.ts +2 -0
  85. package/src/be/db/tasks/write.ts +7 -1
  86. package/src/be/db.ts +140 -18
  87. package/src/be/memory/raters/llm.ts +2 -6
  88. package/src/be/memory/raters/noop.ts +2 -3
  89. package/src/be/memory/raters/registry.ts +4 -10
  90. package/src/be/migrations/157_defer_provenance_and_marker.sql +27 -0
  91. package/src/be/seed/agent-fs-provision.ts +23 -0
  92. package/src/commands/onboard/compose-generator.ts +10 -0
  93. package/src/commands/onboard/env-generator.ts +8 -0
  94. package/src/commands/runner.ts +18 -2
  95. package/src/extensions/identity.ts +15 -7
  96. package/src/hooks/codex-hook.ts +7 -1
  97. package/src/http/agents.ts +10 -2
  98. package/src/http/poll.ts +7 -0
  99. package/src/http/schedules.ts +10 -0
  100. package/src/http/script-runs.ts +35 -26
  101. package/src/http/status.ts +2 -1
  102. package/src/http/tasks.ts +6 -1
  103. package/src/prompts/memories.ts +5 -7
  104. package/src/prompts/session-templates.ts +3 -2
  105. package/src/prompts/steering-delivery.ts +2 -0
  106. package/src/providers/codex-adapter.ts +3 -6
  107. package/src/providers/pi-mono-extension.ts +2 -5
  108. package/src/slack/ack.ts +43 -8
  109. package/src/slack/handlers.ts +7 -1
  110. package/src/slack/render-v2.ts +186 -17
  111. package/src/slack/responses.ts +1 -3
  112. package/src/slack/task-output.ts +66 -8
  113. package/src/slack/thread-buffer.ts +27 -3
  114. package/src/tests/agent-fs-provision-seeder.test.ts +56 -2
  115. package/src/tests/codex-steering-hook.test.ts +2 -2
  116. package/src/tests/db-task-read-contract.test.ts +9 -0
  117. package/src/tests/db-task-write-contract.test.ts +9 -0
  118. package/src/tests/defer-task.test.ts +115 -16
  119. package/src/tests/extension-agent-visibility.test.ts +474 -0
  120. package/src/tests/extensions-lifecycle.test.ts +3 -1
  121. package/src/tests/fetch-resolved-env.test.ts +43 -0
  122. package/src/tests/memory-rate-tool.test.ts +7 -10
  123. package/src/tests/memory-rater-defaults.test.ts +23 -0
  124. package/src/tests/memory-rater-e2e.test.ts +2 -3
  125. package/src/tests/script-connections.test.ts +3 -0
  126. package/src/tests/slack-render-v2.test.ts +446 -16
  127. package/src/tests/slack-steering.test.ts +69 -1
  128. package/src/tests/slack-task-output.test.ts +33 -12
  129. package/src/tests/steering-core.test.ts +35 -0
  130. package/src/tests/steering-delivery.test.ts +39 -0
  131. package/src/tests/steering-transport.test.ts +2 -2
  132. package/src/tests/workflow-live-recovery.test.ts +126 -0
  133. package/src/tools/defer-task.ts +64 -26
  134. package/src/tools/join-swarm.ts +1 -1
  135. package/src/tools/schedules/create-schedule.ts +11 -1
  136. package/src/tools/schedules/patch-schedule.ts +5 -0
  137. package/src/tools/schedules/update-schedule.ts +5 -0
  138. package/src/tools/send-task.ts +6 -0
  139. package/src/tools/utils.ts +1 -1
  140. package/src/types.ts +13 -0
  141. package/src/utils/memory-raters.ts +3 -0
  142. package/src/workflows/engine.ts +28 -0
  143. package/src/workflows/recovery.ts +7 -4
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  handleHook
3
- } from "./cli-5mbmvxnn.js";
4
- import"./cli-1hwnb4hc.js";
5
- import"./cli-mzgyhxbe.js";
3
+ } from "./cli-1jpjafw4.js";
4
+ import"./cli-09y3tjxz.js";
5
+ import"./cli-fdzg6jhf.js";
6
6
  import"./cli-hp1n6zq3.js";
7
- import"./cli-7g9s78jf.js";
7
+ import"./cli-3bkz2p7j.js";
8
8
  import"./cli-e7d20cty.js";
9
9
  import"./cli-3dpj7atn.js";
10
- import"./cli-d6hk10xx.js";
10
+ import"./cli-8sea27q4.js";
11
11
  import"./cli-f14fvzag.js";
12
12
  import"./cli-bsakbbkm.js";
13
- import"./cli-0d9nbqxf.js";
13
+ import"./cli-g2h29qar.js";
14
14
  import"./cli-2658f6at.js";
15
- import"./cli-b2g6mzjc.js";
16
- import"./cli-z61ykvam.js";
15
+ import"./cli-0e31nm4n.js";
16
+ import"./cli-wg04s9kr.js";
17
17
  import"./cli-dv6cdjs2.js";
18
18
  import"./cli-n7h1kqpf.js";
19
19
  import"./cli-ej6gbxfb.js";
20
20
  import"./cli-sd0mxa3c.js";
21
21
  import"./cli-w5e1d1vv.js";
22
- import"./cli-ybpp1srm.js";
22
+ import"./cli-myaxtgh8.js";
23
23
  import"./cli-r2ap2czm.js";
24
24
  import"./cli-5b6b62tz.js";
25
25
  import"./cli-btbzvq95.js";
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  SIMILARITY_THRESHOLD,
10
10
  writeSkillsToFilesystem
11
- } from "./cli-pf9q3696.js";
11
+ } from "./cli-927erqqt.js";
12
12
  import {
13
13
  Anthropic
14
14
  } from "./cli-j490egb5.js";
@@ -16,7 +16,7 @@ import {
16
16
  checkHeartbeatChecklist,
17
17
  runHeartbeatSweep,
18
18
  stopHeartbeat
19
- } from "./cli-m04pt18h.js";
19
+ } from "./cli-e3229na9.js";
20
20
  import {
21
21
  isClaudeBridgeEffective,
22
22
  resolveClaudeTransport
@@ -36,7 +36,7 @@ import {
36
36
  scriptStdlibTypesWithGeneratedApis,
37
37
  typecheckScript,
38
38
  typecheckWithAmbient
39
- } from "./cli-cdq08v3r.js";
39
+ } from "./cli-abp3g4ax.js";
40
40
  import {
41
41
  AGENT_MAX_TASKS_CONFIG_KEY,
42
42
  ALL_CAPABILITIES,
@@ -286,12 +286,12 @@ import {
286
286
  verifyWebhookSignature,
287
287
  warnIfCorsAllowsAnyOrigin,
288
288
  wireHttpSpanLifecycle
289
- } from "./cli-qrqhc31j.js";
289
+ } from "./cli-6r3cgpk2.js";
290
290
  import"./cli-0z2v4nhw.js";
291
291
  import {
292
292
  REFERENCES_SOURCE_MAX_LENGTH,
293
293
  sanitizeReferencesSource
294
- } from "./cli-7g9s78jf.js";
294
+ } from "./cli-3bkz2p7j.js";
295
295
  import {
296
296
  deriveCodexKeySuffix,
297
297
  getValidCodexOAuth,
@@ -301,16 +301,16 @@ import {
301
301
  isMultiRuntimeEnabled
302
302
  } from "./cli-re8z5p8p.js";
303
303
  import"./cli-3dpj7atn.js";
304
- import"./cli-d6hk10xx.js";
304
+ import"./cli-8sea27q4.js";
305
305
  import {
306
306
  getModelsCatalog
307
- } from "./cli-vw03hg5t.js";
307
+ } from "./cli-stwsmd6k.js";
308
308
  import {
309
309
  normalizeModelKey
310
- } from "./cli-tdh4hjr2.js";
310
+ } from "./cli-e0pg4zeh.js";
311
311
  import {
312
312
  getUserGrant
313
- } from "./cli-83wkg402.js";
313
+ } from "./cli-e31ehqwy.js";
314
314
  import {
315
315
  LEGACY_RULES,
316
316
  can,
@@ -401,7 +401,7 @@ import {
401
401
  upsertScriptByName,
402
402
  upsertScriptConnection,
403
403
  validateDefinition
404
- } from "./cli-6ks9xf1n.js";
404
+ } from "./cli-pf1v8xhb.js";
405
405
  import"./cli-epan13p1.js";
406
406
  import {
407
407
  detachedProcessGroup,
@@ -436,7 +436,7 @@ import {
436
436
  updateAuthorizationIdentity,
437
437
  updateOAuthAppById,
438
438
  upsertAuthorization
439
- } from "./cli-r8tdds6s.js";
439
+ } from "./cli-n62atwh9.js";
440
440
  import"./cli-bsakbbkm.js";
441
441
  import"./cli-fad8m16k.js";
442
442
  import {
@@ -446,7 +446,7 @@ import {
446
446
  } from "./cli-jsp14b6c.js";
447
447
  import {
448
448
  searchScripts
449
- } from "./cli-ysc1kbet.js";
449
+ } from "./cli-e3cyf59d.js";
450
450
  import {
451
451
  CANDIDATE_SET_MULTIPLIER,
452
452
  getEmbeddingProvider,
@@ -454,8 +454,8 @@ import {
454
454
  init_constants as init_constants2,
455
455
  init_reranker,
456
456
  rerank
457
- } from "./cli-7pnz2v6s.js";
458
- import"./cli-0d9nbqxf.js";
457
+ } from "./cli-hws0vn86.js";
458
+ import"./cli-g2h29qar.js";
459
459
  import"./cli-aehm1rbq.js";
460
460
  import"./cli-51tf7ac3.js";
461
461
  import {
@@ -473,7 +473,7 @@ import {
473
473
  withRemoteContext,
474
474
  withSpan,
475
475
  withSpanContext
476
- } from "./cli-n0q9b7j4.js";
476
+ } from "./cli-c1v10xb2.js";
477
477
  import"./cli-q51yprfq.js";
478
478
  import"./cli-3er6gcsn.js";
479
479
  import"./cli-yatxqynm.js";
@@ -481,9 +481,13 @@ import"./cli-2658f6at.js";
481
481
  import {
482
482
  CredentialBindingSchema,
483
483
  DB_RETENTION_TUNING_BOUNDS,
484
+ EXTENSION_AGENT_ROLE,
485
+ ExtensionAgentAssignmentError,
484
486
  HeartbeatExpiryError,
485
487
  KvTypeCollisionError,
486
488
  MAX_DB_RETENTION_DAYS,
489
+ NOT_EXTENSION_AGENT_SQL,
490
+ ReservedAgentRoleError,
487
491
  SteeringRequestError,
488
492
  _resolveIntegrationProvider,
489
493
  _resolveIntegrationType,
@@ -549,6 +553,7 @@ import {
549
553
  emitBuiltInIntegrationConnectedOnce,
550
554
  emitIntegrationConnected,
551
555
  emitMcpServerConnectedTelemetry,
556
+ extensionAgentAssignmentError,
552
557
  failTask,
553
558
  getActivePricingRow,
554
559
  getActiveSessions,
@@ -671,6 +676,7 @@ import {
671
676
  insertPricingRow,
672
677
  installMcpServer,
673
678
  installSkill,
679
+ isExtensionAgent,
674
680
  isReservedConfigKey,
675
681
  isSteeringEnabled as isSteeringEnabled2,
676
682
  listAgentsWithCredStatusByProvider,
@@ -766,7 +772,7 @@ import {
766
772
  upsertSwarmConfig,
767
773
  validateConfigValue,
768
774
  withFavoriteFlags
769
- } from "./cli-djvxhnc4.js";
775
+ } from "./cli-ge67p080.js";
770
776
  import {
771
777
  ActiveSessionSchema,
772
778
  AgentAcpStatusSchema,
@@ -890,12 +896,12 @@ import {
890
896
  isSafeBundlePath,
891
897
  isTerminalTaskStatus,
892
898
  splitLegacyModelAlias
893
- } from "./cli-zcsyfw2z.js";
899
+ } from "./cli-4k7jazkq.js";
894
900
  import {
895
901
  IDENTITY_FIELD_BUDGETS,
896
902
  IdentityFieldBudgetError,
897
903
  init_identity_field_budget
898
- } from "./cli-b2g6mzjc.js";
904
+ } from "./cli-0e31nm4n.js";
899
905
  import {
900
906
  getAllTemplateDefinitions,
901
907
  getTemplateDefinition,
@@ -906,7 +912,7 @@ import {
906
912
  interpolate,
907
913
  isSteeringEnabled,
908
914
  resolveTemplate
909
- } from "./cli-z61ykvam.js";
915
+ } from "./cli-wg04s9kr.js";
910
916
  import"./cli-v4en75c5.js";
911
917
  import {
912
918
  MAX_PROFILE_FILE_LENGTH,
@@ -940,7 +946,7 @@ import {
940
946
  import {
941
947
  init_package,
942
948
  package_default
943
- } from "./cli-ybpp1srm.js";
949
+ } from "./cli-myaxtgh8.js";
944
950
  import {
945
951
  init_secret_scrubber,
946
952
  registerVolatileSecret,
@@ -3469,7 +3475,7 @@ var listAgents = route({
3469
3475
  path: "/api/agents",
3470
3476
  pattern: ["api", "agents"],
3471
3477
  summary: "List all agents",
3472
- description: "Returns agents WITHOUT the six identity-markdown blobs (`claudeMd`/`soulMd`/`identityMd`/`toolsMd`/`heartbeatMd`/`setupScript`) by default — they bloat the list by ~16 KB/agent and the overview never renders them. Pass `fields=full` to restore them, or fetch a single agent via `GET /api/agents/{id}`.",
3478
+ description: "Returns agents WITHOUT the six identity-markdown blobs (`claudeMd`/`soulMd`/`identityMd`/`toolsMd`/`heartbeatMd`/`setupScript`) by default — they bloat the list by ~16 KB/agent and the overview never renders them. Pass `fields=full` to restore them, or fetch a single agent via `GET /api/agents/{id}`. Extension identities (`ext:<name>`, role `extension`) are never listed; they are API principals, not workers.",
3473
3479
  tags: ["Agents"],
3474
3480
  query: exports_external.object({
3475
3481
  include: exports_external.enum(["tasks"]).optional(),
@@ -3664,6 +3670,10 @@ async function handleAgentRegister(req, res, pathSegments, myAgentId) {
3664
3670
  const parsed = await registerAgent.parse(req, res, pathSegments, new URLSearchParams);
3665
3671
  if (!parsed)
3666
3672
  return true;
3673
+ if (parsed.body.role === EXTENSION_AGENT_ROLE) {
3674
+ jsonError(res, `Role "${EXTENSION_AGENT_ROLE}" is reserved for extension identities.`, 400);
3675
+ return true;
3676
+ }
3667
3677
  const agentId = myAgentId || crypto.randomUUID();
3668
3678
  const multiRuntime = isMultiRuntimeEnabled();
3669
3679
  if (multiRuntime && parsed.body.runtimeInstanceId) {
@@ -3872,7 +3882,7 @@ async function handleAgentsRest(req, res, pathSegments, queryParams, _myAgentId)
3872
3882
  onConflict: (conflict) => conflicts.push(conflict)
3873
3883
  });
3874
3884
  } catch (error) {
3875
- if (error instanceof HeartbeatExpiryError) {
3885
+ if (error instanceof HeartbeatExpiryError || error instanceof ReservedAgentRoleError) {
3876
3886
  jsonError(res, error.message, 400);
3877
3887
  return true;
3878
3888
  }
@@ -15223,6 +15233,9 @@ async function handlePoll(req, res, pathSegments, queryParams, myAgentId) {
15223
15233
  if (!agent) {
15224
15234
  return { error: "Agent not found", status: 404 };
15225
15235
  }
15236
+ if (isExtensionAgent(agent)) {
15237
+ return { trigger: null };
15238
+ }
15226
15239
  if (isMultiRuntimeEnabled() && !(runtimeInstanceId && await touchRuntimeInstance(runtimeInstanceId, agent.id))) {
15227
15240
  return { trigger: null };
15228
15241
  }
@@ -16810,6 +16823,10 @@ async function handleSchedules(req, res, pathSegments, queryParams, myAgentId) {
16810
16823
  jsonError(res, "Target agent not found", 400);
16811
16824
  return true;
16812
16825
  }
16826
+ if (isExtensionAgent(agent)) {
16827
+ jsonError(res, extensionAgentAssignmentError(agent), 400);
16828
+ return true;
16829
+ }
16813
16830
  }
16814
16831
  const targetType = body.targetType ?? "agent-task";
16815
16832
  if (targetType === "agent-task" && !body.taskTemplate) {
@@ -17008,6 +17025,10 @@ async function handleSchedules(req, res, pathSegments, queryParams, myAgentId) {
17008
17025
  jsonError(res, "Target agent not found", 400);
17009
17026
  return true;
17010
17027
  }
17028
+ if (isExtensionAgent(agent)) {
17029
+ jsonError(res, extensionAgentAssignmentError(agent), 400);
17030
+ return true;
17031
+ }
17011
17032
  }
17012
17033
  const mergedTargetType = parsed.body.targetType ?? existing.targetType;
17013
17034
  const mergedTaskTemplate = parsed.body.taskTemplate !== undefined ? parsed.body.taskTemplate : existing.taskTemplate;
@@ -19659,24 +19680,32 @@ async function handleScriptRuns(req, res, pathSegments, queryParams, agentId) {
19659
19680
  const contextKey = `script-run:${run.id}:${parsed.body.stepKey}`;
19660
19681
  let task = await getLatestScriptRunStepTaskByContextKey(contextKey);
19661
19682
  if (!task) {
19662
- task = await createTaskExtended(parsed.body.template ?? parsed.body.task ?? parsed.body.stepKey, {
19663
- agentId: parsed.body.agentId,
19664
- routingReason: parsed.body.routingReason ?? (parsed.body.agentId ? "human_pinned" : undefined),
19665
- routingNote: parsed.body.routingNote,
19666
- routingSource: parsed.body.routingReason ? "declared" : parsed.body.agentId ? "engine_default" : undefined,
19667
- tags: parsed.body.tags,
19668
- priority: parsed.body.priority,
19669
- offeredTo: parsed.body.offerMode ? parsed.body.agentId : undefined,
19670
- taskType: "script-run-step",
19671
- source: "mcp",
19672
- dir: parsed.body.dir,
19673
- vcsRepo: parsed.body.vcsRepo,
19674
- model: parsed.body.model,
19675
- parentTaskId: parsed.body.parentTaskId,
19676
- requestedByUserId: parsed.body.requestedByUserId ?? run.requestedByUserId,
19677
- outputSchema: parsed.body.outputSchema,
19678
- contextKey
19679
- });
19683
+ try {
19684
+ task = await createTaskExtended(parsed.body.template ?? parsed.body.task ?? parsed.body.stepKey, {
19685
+ agentId: parsed.body.agentId,
19686
+ routingReason: parsed.body.routingReason ?? (parsed.body.agentId ? "human_pinned" : undefined),
19687
+ routingNote: parsed.body.routingNote,
19688
+ routingSource: parsed.body.routingReason ? "declared" : parsed.body.agentId ? "engine_default" : undefined,
19689
+ tags: parsed.body.tags,
19690
+ priority: parsed.body.priority,
19691
+ offeredTo: parsed.body.offerMode ? parsed.body.agentId : undefined,
19692
+ taskType: "script-run-step",
19693
+ source: "mcp",
19694
+ dir: parsed.body.dir,
19695
+ vcsRepo: parsed.body.vcsRepo,
19696
+ model: parsed.body.model,
19697
+ parentTaskId: parsed.body.parentTaskId,
19698
+ requestedByUserId: parsed.body.requestedByUserId ?? run.requestedByUserId,
19699
+ outputSchema: parsed.body.outputSchema,
19700
+ contextKey
19701
+ });
19702
+ } catch (error) {
19703
+ if (error instanceof ExtensionAgentAssignmentError) {
19704
+ jsonError(res, error.message, 400);
19705
+ return true;
19706
+ }
19707
+ throw error;
19708
+ }
19680
19709
  }
19681
19710
  const deadline = Date.now() + 30000;
19682
19711
  while (Date.now() < deadline) {
@@ -22604,7 +22633,7 @@ function agentfsMilestone(state) {
22604
22633
  };
22605
22634
  }
22606
22635
  async function workersMilestone() {
22607
- const totalRow = await getDbClient().get(`SELECT COUNT(*) AS count FROM agents`);
22636
+ const totalRow = await getDbClient().get(`SELECT COUNT(*) AS count FROM agents WHERE ${NOT_EXTENSION_AGENT_SQL}`);
22608
22637
  const totalAgents = totalRow?.count ?? 0;
22609
22638
  const { leads_alive, workers_alive } = await getLiveAgentCounts(5);
22610
22639
  if (leads_alive > 0 && workers_alive > 0) {
@@ -22972,7 +23001,7 @@ var createTask = route({
22972
23001
  }),
22973
23002
  responses: {
22974
23003
  201: { description: "Task created", schema: AgentTaskSchema },
22975
- 400: { description: "Validation error" },
23004
+ 400: { description: "Validation error, or agentId/offeredTo targets an extension identity" },
22976
23005
  422: {
22977
23006
  description: "Task creation blocked by an extension",
22978
23007
  schema: exports_external.object({
@@ -23505,6 +23534,10 @@ async function handleTasks(req, res, pathSegments, queryParams, myAgentId) {
23505
23534
  createTask.respond(res, 422, { error: error.reason, extension: error.extension });
23506
23535
  return true;
23507
23536
  }
23537
+ if (error instanceof ExtensionAgentAssignmentError) {
23538
+ jsonError(res, error.message, 400);
23539
+ return true;
23540
+ }
23508
23541
  console.error("[HTTP] Failed to create task:", error);
23509
23542
  jsonError(res, "Failed to create task", 500);
23510
23543
  }
@@ -27529,7 +27562,7 @@ async function shutdown() {
27529
27562
  sessionsProcessed: getServerSessionsProcessed()
27530
27563
  });
27531
27564
  if (hasCapability("scheduling")) {
27532
- const { stopScheduler } = await import("./index-3mq6ce93.js");
27565
+ const { stopScheduler } = await import("./index-9n5z2492.js");
27533
27566
  stopScheduler();
27534
27567
  }
27535
27568
  stopHeartbeat();
@@ -27537,7 +27570,7 @@ async function shutdown() {
27537
27570
  await stopScriptRunSupervisor();
27538
27571
  await stopSlackApp();
27539
27572
  if (process.env.OAUTH_KEEPALIVE_DISABLE !== "true") {
27540
- const { stopOAuthKeepalive } = await import("./keepalive-9pfw7t02.js");
27573
+ const { stopOAuthKeepalive } = await import("./keepalive-pwxvxd2c.js");
27541
27574
  await stopOAuthKeepalive();
27542
27575
  }
27543
27576
  stopOAuthPendingGc();
@@ -27605,15 +27638,15 @@ try {
27605
27638
  console.warn("[startup] CAPABILITIES upgrade seed failed (non-fatal):", err);
27606
27639
  }
27607
27640
  try {
27608
- const { seedPricingFromModelsDev } = await import("./seed-pricing-jggk6rsy.js");
27641
+ const { seedPricingFromModelsDev } = await import("./seed-pricing-650wbr1n.js");
27609
27642
  seedPricingFromModelsDev();
27610
- const { startPricingRefreshLoop } = await import("./pricing-refresh-vetcm563.js");
27643
+ const { startPricingRefreshLoop } = await import("./pricing-refresh-52g2ywrw.js");
27611
27644
  startPricingRefreshLoop();
27612
27645
  } catch (err) {
27613
27646
  console.error("[startup] Failed to seed pricing rows:", err);
27614
27647
  }
27615
27648
  try {
27616
- const { ensureRbacSeedsSynced } = await import("./rbac-roles-cfzgr6r1.js");
27649
+ const { ensureRbacSeedsSynced } = await import("./rbac-roles-hbf0xa52.js");
27617
27650
  ensureRbacSeedsSynced();
27618
27651
  } catch (err) {
27619
27652
  console.error("[startup] Failed to sync RBAC seed rows:", err);
@@ -27621,7 +27654,7 @@ try {
27621
27654
  throw err;
27622
27655
  }
27623
27656
  try {
27624
- const { runAllSeeders } = await import("./index-0wzg3sp3.js");
27657
+ const { runAllSeeders } = await import("./index-j5wrf1yw.js");
27625
27658
  await runAllSeeders({ scriptEmbeddingMode: "skip" });
27626
27659
  } catch (err) {
27627
27660
  console.error("[startup] Failed to seed built-in entities:", err);
@@ -27675,36 +27708,36 @@ httpServer.listen(port, async () => {
27675
27708
  await initWorkflows();
27676
27709
  await startScriptRunSupervisor(getMcpBaseUrl());
27677
27710
  if (hasCapability("scheduling")) {
27678
- const { startScheduler } = await import("./index-3mq6ce93.js");
27679
- const { getExecutorRegistry: getExecutorRegistry2 } = await import("./index-42s7eezq.js");
27711
+ const { startScheduler } = await import("./index-9n5z2492.js");
27712
+ const { getExecutorRegistry: getExecutorRegistry2 } = await import("./index-6artrehg.js");
27680
27713
  const intervalMs = Number(process.env.SCHEDULER_INTERVAL_MS) || 1e4;
27681
27714
  startScheduler(getExecutorRegistry2(), intervalMs, {
27682
27715
  runId: globalState.__runId
27683
27716
  });
27684
27717
  }
27685
27718
  if (!isEnvFlagEnabled("HEARTBEAT_DISABLE", false)) {
27686
- const { startHeartbeat } = await import("./index-s37dbevy.js");
27719
+ const { startHeartbeat } = await import("./index-m2xqpz5r.js");
27687
27720
  const heartbeatMs = Number(process.env.HEARTBEAT_INTERVAL_MS) || 90000;
27688
27721
  startHeartbeat(heartbeatMs);
27689
27722
  }
27690
27723
  if (process.env.OAUTH_KEEPALIVE_DISABLE !== "true") {
27691
- const { startOAuthKeepalive } = await import("./keepalive-9pfw7t02.js");
27724
+ const { startOAuthKeepalive } = await import("./keepalive-pwxvxd2c.js");
27692
27725
  startOAuthKeepalive();
27693
27726
  }
27694
27727
  if (process.env.OAUTH_REFRESH_SWEEP_DISABLE !== "true") {
27695
- const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-5fwa7th2.js");
27728
+ const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-6v4bd737.js");
27696
27729
  startOAuthRefreshSweep();
27697
27730
  }
27698
27731
  startOAuthPendingGc();
27699
27732
  await startMemoryGc();
27700
27733
  await startDbRetention();
27701
- import("./boot-reembed-c98xrad3.js").then(({ runBootReembed }) => runBootReembed()).catch((err) => {
27734
+ import("./boot-reembed-22hd3jjn.js").then(({ runBootReembed }) => runBootReembed()).catch((err) => {
27702
27735
  console.error("[boot-reembed] startup backfill failed (non-fatal):", err);
27703
27736
  });
27704
- import("./boot-reembed-zt3qm9xn.js").then(({ runBootReembedScripts }) => runBootReembedScripts()).catch((err) => {
27737
+ import("./boot-reembed-qe168424.js").then(({ runBootReembedScripts }) => runBootReembedScripts()).catch((err) => {
27705
27738
  console.error("[boot-reembed-scripts] startup backfill failed (non-fatal):", err);
27706
27739
  });
27707
- import("./boot-scrub-logs-jcqd8ksj.js").then(({ runBootScrubLogs }) => runBootScrubLogs()).catch((err) => {
27740
+ import("./boot-scrub-logs-pkdpsrjd.js").then(({ runBootScrubLogs }) => runBootScrubLogs()).catch((err) => {
27708
27741
  console.error("[boot-scrub-logs] startup scrub failed (non-fatal):", err);
27709
27742
  });
27710
27743
  }).on("error", (err) => {
@@ -20,51 +20,51 @@ import {
20
20
  stopWaitPoller,
21
21
  subscribeWaitToBus,
22
22
  validateTemplateVariables
23
- } from "./cli-qrqhc31j.js";
23
+ } from "./cli-6r3cgpk2.js";
24
24
  import"./cli-0z2v4nhw.js";
25
- import"./cli-7g9s78jf.js";
25
+ import"./cli-3bkz2p7j.js";
26
26
  import"./cli-e7d20cty.js";
27
27
  import"./cli-re8z5p8p.js";
28
28
  import"./cli-3dpj7atn.js";
29
- import"./cli-d6hk10xx.js";
30
- import"./cli-vw03hg5t.js";
31
- import"./cli-tdh4hjr2.js";
32
- import"./cli-83wkg402.js";
29
+ import"./cli-8sea27q4.js";
30
+ import"./cli-stwsmd6k.js";
31
+ import"./cli-e0pg4zeh.js";
32
+ import"./cli-e31ehqwy.js";
33
33
  import"./cli-ytxs7mn1.js";
34
34
  import {
35
35
  findEntryNodes,
36
36
  getSuccessors
37
- } from "./cli-6ks9xf1n.js";
37
+ } from "./cli-pf1v8xhb.js";
38
38
  import"./cli-epan13p1.js";
39
39
  import"./cli-y89t4nca.js";
40
40
  import"./cli-f14fvzag.js";
41
- import"./cli-r8tdds6s.js";
41
+ import"./cli-n62atwh9.js";
42
42
  import"./cli-bsakbbkm.js";
43
43
  import"./cli-fad8m16k.js";
44
44
  import"./cli-jsp14b6c.js";
45
- import"./cli-ysc1kbet.js";
46
- import"./cli-7pnz2v6s.js";
47
- import"./cli-0d9nbqxf.js";
45
+ import"./cli-e3cyf59d.js";
46
+ import"./cli-hws0vn86.js";
47
+ import"./cli-g2h29qar.js";
48
48
  import"./cli-aehm1rbq.js";
49
49
  import"./cli-51tf7ac3.js";
50
- import"./cli-n0q9b7j4.js";
50
+ import"./cli-c1v10xb2.js";
51
51
  import"./cli-q51yprfq.js";
52
52
  import"./cli-3er6gcsn.js";
53
53
  import"./cli-yatxqynm.js";
54
54
  import"./cli-2658f6at.js";
55
- import"./cli-djvxhnc4.js";
56
- import"./cli-zcsyfw2z.js";
57
- import"./cli-b2g6mzjc.js";
55
+ import"./cli-ge67p080.js";
56
+ import"./cli-4k7jazkq.js";
57
+ import"./cli-0e31nm4n.js";
58
58
  import {
59
59
  interpolate
60
- } from "./cli-z61ykvam.js";
60
+ } from "./cli-wg04s9kr.js";
61
61
  import"./cli-v4en75c5.js";
62
62
  import"./cli-dv6cdjs2.js";
63
63
  import"./cli-n7h1kqpf.js";
64
64
  import"./cli-ej6gbxfb.js";
65
65
  import"./cli-sd0mxa3c.js";
66
66
  import"./cli-w5e1d1vv.js";
67
- import"./cli-ybpp1srm.js";
67
+ import"./cli-myaxtgh8.js";
68
68
  import"./cli-r2ap2czm.js";
69
69
  import"./cli-5b6b62tz.js";
70
70
  import"./cli-btbzvq95.js";
@@ -4,46 +4,46 @@ import {
4
4
  runScheduleNow,
5
5
  startScheduler,
6
6
  stopScheduler
7
- } from "./cli-qrqhc31j.js";
7
+ } from "./cli-6r3cgpk2.js";
8
8
  import"./cli-0z2v4nhw.js";
9
- import"./cli-7g9s78jf.js";
9
+ import"./cli-3bkz2p7j.js";
10
10
  import"./cli-e7d20cty.js";
11
11
  import"./cli-re8z5p8p.js";
12
12
  import"./cli-3dpj7atn.js";
13
- import"./cli-d6hk10xx.js";
14
- import"./cli-vw03hg5t.js";
15
- import"./cli-tdh4hjr2.js";
16
- import"./cli-83wkg402.js";
13
+ import"./cli-8sea27q4.js";
14
+ import"./cli-stwsmd6k.js";
15
+ import"./cli-e0pg4zeh.js";
16
+ import"./cli-e31ehqwy.js";
17
17
  import"./cli-ytxs7mn1.js";
18
- import"./cli-6ks9xf1n.js";
18
+ import"./cli-pf1v8xhb.js";
19
19
  import"./cli-epan13p1.js";
20
20
  import"./cli-y89t4nca.js";
21
21
  import"./cli-f14fvzag.js";
22
- import"./cli-r8tdds6s.js";
22
+ import"./cli-n62atwh9.js";
23
23
  import"./cli-bsakbbkm.js";
24
24
  import"./cli-fad8m16k.js";
25
25
  import"./cli-jsp14b6c.js";
26
- import"./cli-ysc1kbet.js";
27
- import"./cli-7pnz2v6s.js";
28
- import"./cli-0d9nbqxf.js";
26
+ import"./cli-e3cyf59d.js";
27
+ import"./cli-hws0vn86.js";
28
+ import"./cli-g2h29qar.js";
29
29
  import"./cli-aehm1rbq.js";
30
30
  import"./cli-51tf7ac3.js";
31
- import"./cli-n0q9b7j4.js";
31
+ import"./cli-c1v10xb2.js";
32
32
  import"./cli-q51yprfq.js";
33
33
  import"./cli-3er6gcsn.js";
34
34
  import"./cli-yatxqynm.js";
35
35
  import"./cli-2658f6at.js";
36
- import"./cli-djvxhnc4.js";
37
- import"./cli-zcsyfw2z.js";
38
- import"./cli-b2g6mzjc.js";
39
- import"./cli-z61ykvam.js";
36
+ import"./cli-ge67p080.js";
37
+ import"./cli-4k7jazkq.js";
38
+ import"./cli-0e31nm4n.js";
39
+ import"./cli-wg04s9kr.js";
40
40
  import"./cli-v4en75c5.js";
41
41
  import"./cli-dv6cdjs2.js";
42
42
  import"./cli-n7h1kqpf.js";
43
43
  import"./cli-ej6gbxfb.js";
44
44
  import"./cli-sd0mxa3c.js";
45
45
  import"./cli-w5e1d1vv.js";
46
- import"./cli-ybpp1srm.js";
46
+ import"./cli-myaxtgh8.js";
47
47
  import"./cli-r2ap2czm.js";
48
48
  import"./cli-5b6b62tz.js";
49
49
  import"./cli-btbzvq95.js";
@@ -6,21 +6,21 @@ import {
6
6
  extractArgsJsonSchema,
7
7
  extractScriptSignature,
8
8
  typecheckScript
9
- } from "./cli-cdq08v3r.js";
9
+ } from "./cli-abp3g4ax.js";
10
10
  import {
11
11
  getScript,
12
12
  require_dist,
13
13
  upsertScriptByName,
14
14
  validateDefinition,
15
15
  validateScriptImports
16
- } from "./cli-6ks9xf1n.js";
16
+ } from "./cli-pf1v8xhb.js";
17
17
  import"./cli-epan13p1.js";
18
18
  import"./cli-y89t4nca.js";
19
19
  import"./cli-f14fvzag.js";
20
- import"./cli-r8tdds6s.js";
21
- import"./cli-ysc1kbet.js";
22
- import"./cli-7pnz2v6s.js";
23
- import"./cli-0d9nbqxf.js";
20
+ import"./cli-n62atwh9.js";
21
+ import"./cli-e3cyf59d.js";
22
+ import"./cli-hws0vn86.js";
23
+ import"./cli-g2h29qar.js";
24
24
  import"./cli-aehm1rbq.js";
25
25
  import"./cli-2658f6at.js";
26
26
  import {
@@ -39,17 +39,17 @@ import {
39
39
  updateSkill,
40
40
  updateWorkflow,
41
41
  upsertSkillFiles
42
- } from "./cli-djvxhnc4.js";
43
- import"./cli-zcsyfw2z.js";
44
- import"./cli-b2g6mzjc.js";
45
- import"./cli-z61ykvam.js";
42
+ } from "./cli-ge67p080.js";
43
+ import"./cli-4k7jazkq.js";
44
+ import"./cli-0e31nm4n.js";
45
+ import"./cli-wg04s9kr.js";
46
46
  import"./cli-v4en75c5.js";
47
47
  import"./cli-dv6cdjs2.js";
48
48
  import"./cli-n7h1kqpf.js";
49
49
  import"./cli-ej6gbxfb.js";
50
50
  import"./cli-sd0mxa3c.js";
51
51
  import"./cli-w5e1d1vv.js";
52
- import"./cli-ybpp1srm.js";
52
+ import"./cli-myaxtgh8.js";
53
53
  import"./cli-r2ap2czm.js";
54
54
  import"./cli-zf8jjwex.js";
55
55
  import {