@desplega.ai/agent-swarm 2.2.0 → 2.3.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 (107) hide show
  1. package/dist/{acp-adapter-k0vwfyvn.js → acp-adapter-v85a2bqy.js} +1 -1
  2. package/dist/{actions-w4pnb8vz.js → actions-zgcxfspj.js} +15 -15
  3. package/dist/{amp-adapter-0cmxb2t5.js → amp-adapter-jw9xfz42.js} +2 -2
  4. package/dist/{app-zneem7g9.js → app-4e1s4675.js} +3 -3
  5. package/dist/{assistant-wbzd2rnr.js → assistant-v238n9dk.js} +16 -16
  6. package/dist/{boot-reembed-4kx69j3g.js → boot-reembed-p666cw5n.js} +1 -1
  7. package/dist/{boot-reembed-db0wwgy1.js → boot-reembed-w6pm64j4.js} +1 -1
  8. package/dist/{boot-scrub-sweep-tfv4d3mm.js → boot-scrub-sweep-jcyjagn3.js} +2 -2
  9. package/dist/{boot-seeds-w2hmkxn5.js → boot-seeds-gbedmamp.js} +4 -4
  10. package/dist/{claude-adapter-5qrc2paq.js → claude-adapter-q7wspzt8.js} +2 -2
  11. package/dist/{claude-managed-setup-7ra32em4.js → claude-managed-setup-wza784fb.js} +1 -1
  12. package/dist/{claude-sdk-session-cd02gc76.js → claude-sdk-session-yf400ptr.js} +2 -2
  13. package/dist/{cli-p46xdr1m.js → cli-0rh20bp3.js} +1 -1
  14. package/dist/{cli-e5y285rg.js → cli-1v8w782f.js} +1 -1
  15. package/dist/{cli-8c1m9mhy.js → cli-30m5q8mc.js} +5 -5
  16. package/dist/{cli-xnp2vkx7.js → cli-4hmaheb6.js} +6 -6
  17. package/dist/{cli-xhgtay7w.js → cli-4s1kqrqg.js} +1 -1
  18. package/dist/{cli-2jm992rm.js → cli-5d1m1qca.js} +2 -2
  19. package/dist/{cli-mvsfbbgq.js → cli-65q70v2v.js} +3 -3
  20. package/dist/{cli-th8krqbf.js → cli-6p7ddg72.js} +2 -2
  21. package/dist/{cli-6q7pyd3k.js → cli-6vcyw6v7.js} +1 -1
  22. package/dist/{cli-bddxamg7.js → cli-8qsx817b.js} +23 -22
  23. package/dist/{cli-ztcxv5nv.js → cli-9e9kjqsj.js} +1 -1
  24. package/dist/{cli-jrk8mj0t.js → cli-a17tzmn0.js} +1 -1
  25. package/dist/{cli-raejy0mp.js → cli-d43xqzbe.js} +1 -1
  26. package/dist/{cli-tba8fxf9.js → cli-dxwh4j32.js} +11 -11
  27. package/dist/{cli-c9vrwcpb.js → cli-ea7chd26.js} +19 -19
  28. package/dist/{cli-vmbakbq0.js → cli-fhvqt2fp.js} +1 -1
  29. package/dist/{cli-z3dk189k.js → cli-fp4xbw07.js} +6 -6
  30. package/dist/{cli-xx13gqf3.js → cli-g6p7c2my.js} +1 -1
  31. package/dist/{cli-c0dpzwnx.js → cli-hn3pftj2.js} +2 -2
  32. package/dist/{cli-h23mr2s6.js → cli-hz64bcnj.js} +2 -2
  33. package/dist/{cli-dw0njd9q.js → cli-jhmjwqcg.js} +5 -5
  34. package/dist/{cli-0k9rcwfy.js → cli-ka01m5rb.js} +28 -12
  35. package/dist/{cli-jhhb2v9n.js → cli-kqypty34.js} +2 -2
  36. package/dist/{cli-hwc4a9xm.js → cli-q1812jbw.js} +4 -4
  37. package/dist/{cli-8w65vwee.js → cli-qrwp40st.js} +1 -1
  38. package/dist/{cli-4c7k75rq.js → cli-re4wkbzx.js} +54 -41
  39. package/dist/{cli-z1hh99j0.js → cli-tr24eeny.js} +2 -2
  40. package/dist/{cli-q6gw45wj.js → cli-wtg6edvd.js} +1 -1
  41. package/dist/{cli-mnry16kh.js → cli-xgn4rwyv.js} +4 -4
  42. package/dist/{cli-5ks6x36q.js → cli-y3dvz6ge.js} +3 -3
  43. package/dist/{cli-ksrphveb.js → cli-yv0vgscc.js} +1 -0
  44. package/dist/{cli-ak4c12mh.js → cli-yv3n83x8.js} +1 -1
  45. package/dist/{cli-9ac0mkg5.js → cli-zes4tsbb.js} +1 -1
  46. package/dist/cli.js +14 -14
  47. package/dist/{codex-adapter-m0fx3v3s.js → codex-adapter-nhjj2veb.js} +1 -1
  48. package/dist/{codex-session-runner-j9m2gfyy.js → codex-session-runner-6hggrjbx.js} +1 -1
  49. package/dist/{commands-ktnqwrv4.js → commands-mrw1ph2w.js} +2 -2
  50. package/dist/{controller-nex2he8v.js → controller-pt1zam5w.js} +2 -2
  51. package/dist/{controllers-connect-6yhwqv9v.js → controllers-connect-ymw5541d.js} +16 -16
  52. package/dist/{cursor-adapter-02s5ekva.js → cursor-adapter-cf4zh5x0.js} +1 -1
  53. package/dist/{db-19tw9r5s.js → db-hhpy6m4x.js} +2 -2
  54. package/dist/{db-jvr86v7f.js → db-hy80219q.js} +1 -1
  55. package/dist/{dispatcher-d3mnsg2y.js → dispatcher-6pdjtkr1.js} +14 -14
  56. package/dist/{dsh-adapter-63rvej88.js → dsh-adapter-fbx06re2.js} +1 -1
  57. package/dist/{external-channel-44cwer32.js → external-channel-j6vb6ya1.js} +2 -2
  58. package/dist/{grok-adapter-ysp907f6.js → grok-adapter-1193sprp.js} +2 -2
  59. package/dist/{handlers-t5pbabwf.js → handlers-tb3xgjnm.js} +17 -17
  60. package/dist/{heartbeat-2etacsqq.js → heartbeat-h1w1ktce.js} +17 -17
  61. package/dist/{hook-3kvmax6d.js → hook-ejja4bpe.js} +1 -1
  62. package/dist/{hook-mzxxs5n2.js → hook-skrbja18.js} +1 -1
  63. package/dist/{http-fn978m0g.js → http-mzh41mfj.js} +108 -52
  64. package/dist/{index-039x2sag.js → index-6rmnn89d.js} +40 -12
  65. package/dist/{index-w2wr89xd.js → index-epr2gnbw.js} +1 -1
  66. package/dist/{index-qyjbb7br.js → index-nyfcdpky.js} +17 -17
  67. package/dist/{index-e4tsa1h7.js → index-vjn3wbzf.js} +14 -14
  68. package/dist/{index-1r8hw4vd.js → index-xmmkyx82.js} +14 -14
  69. package/dist/{keepalive-d4nzs76x.js → keepalive-4djvbm2j.js} +3 -3
  70. package/dist/{lead-8h5n9k5f.js → lead-61kqp604.js} +23 -23
  71. package/dist/{maintenance-ea6jfw42.js → maintenance-f3xhnjsm.js} +1 -1
  72. package/dist/{oauth-refresh-sweep-3f25djq3.js → oauth-refresh-sweep-fpd6x6rw.js} +2 -2
  73. package/dist/{onboard-pvk7hdb2.js → onboard-196tjgyn.js} +2 -2
  74. package/dist/{otel-impl-qb7nhgdp.js → otel-impl-g8fh4c21.js} +1 -1
  75. package/dist/{pricing-refresh-6ehwkcmp.js → pricing-refresh-sdcf5yaz.js} +3 -3
  76. package/dist/{rbac-roles-9648nh00.js → rbac-roles-2x4g1wb5.js} +2 -2
  77. package/dist/{rbac-roles-km0f9cmm.js → rbac-roles-bsp5657v.js} +1 -1
  78. package/dist/{render-v2-xkze1wef.js → render-v2-0pyb39bb.js} +3 -3
  79. package/dist/{resume-tq0bbvt5.js → resume-a86tkj6r.js} +5 -5
  80. package/dist/{setup-rnrazxvd.js → setup-ypbzcapd.js} +1 -1
  81. package/dist/{work-objects-e75q2rqs.js → work-objects-yjp8de12.js} +17 -17
  82. package/dist/{worker-4ww4hjef.js → worker-4ptnn1ge.js} +23 -23
  83. package/openapi.json +168 -6
  84. package/package.json +2 -2
  85. package/src/be/asset-key-audit.ts +4 -13
  86. package/src/be/db.ts +57 -33
  87. package/src/be/migrations/227_inbox_item_state_last_read_at.sql +1 -0
  88. package/src/be/seed-scripts/catalog/heartbeat-jev-gate.ts +22 -4
  89. package/src/heartbeat/heartbeat.ts +25 -7
  90. package/src/http/assets.ts +26 -4
  91. package/src/http/inbox-state.ts +58 -8
  92. package/src/kv-reserved-namespaces.ts +1 -0
  93. package/src/providers/amp-adapter.ts +1 -1
  94. package/src/tests/asset-key-api.test.ts +128 -0
  95. package/src/tests/asset-key-invariants.test.ts +179 -3
  96. package/src/tests/asset-key-migration.test.ts +35 -0
  97. package/src/tests/docs-index-footprint.test.js +2 -2
  98. package/src/tests/heartbeat-checklist.test.ts +88 -0
  99. package/src/tests/heartbeat-jev-gate.test.ts +394 -10
  100. package/src/tests/inbox-state.test.ts +167 -0
  101. package/src/tests/kv-tool.test.ts +15 -0
  102. package/src/tests/script-connections.test.ts +2 -0
  103. package/src/types.ts +2 -0
  104. package/templates/skills/code-quality/content.md +2 -2
  105. package/templates/skills/pages/content.md +4 -0
  106. package/templates/skills/swarm-scripts/SKILL.md +6 -0
  107. package/templates/skills/swarm-scripts/content.md +6 -0
@@ -1,35 +1,35 @@
1
1
  import {
2
2
  isUserAllowed2,
3
3
  registerMessageHandler2
4
- } from "./cli-xnp2vkx7.js";
5
- import"./cli-8c1m9mhy.js";
6
- import"./cli-5ks6x36q.js";
7
- import"./cli-bddxamg7.js";
4
+ } from "./cli-4hmaheb6.js";
5
+ import"./cli-30m5q8mc.js";
6
+ import"./cli-y3dvz6ge.js";
7
+ import"./cli-8qsx817b.js";
8
8
  import"./cli-rdr166ht.js";
9
- import"./cli-vmbakbq0.js";
9
+ import"./cli-fhvqt2fp.js";
10
10
  import"./cli-qz93y3x5.js";
11
- import"./cli-mvsfbbgq.js";
11
+ import"./cli-65q70v2v.js";
12
12
  import"./cli-3h26v7yj.js";
13
13
  import"./cli-7a91w22y.js";
14
14
  import"./cli-3ggwdtb0.js";
15
- import"./cli-xx13gqf3.js";
16
- import"./cli-mnry16kh.js";
17
- import"./cli-jhhb2v9n.js";
18
- import"./cli-8w65vwee.js";
15
+ import"./cli-g6p7c2my.js";
16
+ import"./cli-xgn4rwyv.js";
17
+ import"./cli-kqypty34.js";
18
+ import"./cli-qrwp40st.js";
19
19
  import"./cli-qje9k2nh.js";
20
- import"./cli-dw0njd9q.js";
21
- import"./cli-hwc4a9xm.js";
20
+ import"./cli-jhmjwqcg.js";
21
+ import"./cli-q1812jbw.js";
22
22
  import"./cli-8cvvytad.js";
23
23
  import"./cli-vjfpshn3.js";
24
24
  import"./cli-13p25grh.js";
25
25
  import"./cli-0adyhvq2.js";
26
- import"./cli-tba8fxf9.js";
27
- import"./cli-ztcxv5nv.js";
28
- import"./cli-h23mr2s6.js";
26
+ import"./cli-dxwh4j32.js";
27
+ import"./cli-9e9kjqsj.js";
28
+ import"./cli-hz64bcnj.js";
29
29
  import"./cli-445c1vp7.js";
30
30
  import"./cli-kvzgak7c.js";
31
- import"./cli-6q7pyd3k.js";
32
- import"./cli-4c7k75rq.js";
31
+ import"./cli-6vcyw6v7.js";
32
+ import"./cli-re4wkbzx.js";
33
33
  import"./cli-ptkpaqfy.js";
34
34
  export {
35
35
  isUserAllowed2 as isUserAllowed,
@@ -7,36 +7,36 @@ import {
7
7
  runHeartbeatSweep2,
8
8
  startHeartbeat2,
9
9
  stopHeartbeat2
10
- } from "./cli-0k9rcwfy.js";
11
- import"./cli-z3dk189k.js";
12
- import"./cli-raejy0mp.js";
13
- import"./cli-bddxamg7.js";
10
+ } from "./cli-ka01m5rb.js";
11
+ import"./cli-fp4xbw07.js";
12
+ import"./cli-d43xqzbe.js";
13
+ import"./cli-8qsx817b.js";
14
14
  import"./cli-rdr166ht.js";
15
- import"./cli-vmbakbq0.js";
15
+ import"./cli-fhvqt2fp.js";
16
16
  import"./cli-qz93y3x5.js";
17
- import"./cli-mvsfbbgq.js";
17
+ import"./cli-65q70v2v.js";
18
18
  import"./cli-3h26v7yj.js";
19
19
  import"./cli-7a91w22y.js";
20
20
  import"./cli-3ggwdtb0.js";
21
- import"./cli-xx13gqf3.js";
22
- import"./cli-mnry16kh.js";
23
- import"./cli-jhhb2v9n.js";
24
- import"./cli-8w65vwee.js";
21
+ import"./cli-g6p7c2my.js";
22
+ import"./cli-xgn4rwyv.js";
23
+ import"./cli-kqypty34.js";
24
+ import"./cli-qrwp40st.js";
25
25
  import"./cli-qje9k2nh.js";
26
- import"./cli-dw0njd9q.js";
27
- import"./cli-hwc4a9xm.js";
26
+ import"./cli-jhmjwqcg.js";
27
+ import"./cli-q1812jbw.js";
28
28
  import"./cli-8cvvytad.js";
29
29
  import"./cli-vjfpshn3.js";
30
30
  import"./cli-13p25grh.js";
31
31
  import"./cli-0adyhvq2.js";
32
- import"./cli-tba8fxf9.js";
33
- import"./cli-ztcxv5nv.js";
34
- import"./cli-h23mr2s6.js";
32
+ import"./cli-dxwh4j32.js";
33
+ import"./cli-9e9kjqsj.js";
34
+ import"./cli-hz64bcnj.js";
35
35
  import"./cli-445c1vp7.js";
36
36
  import"./cli-kvzgak7c.js";
37
37
  import"./cli-b2mz5mjc.js";
38
- import"./cli-6q7pyd3k.js";
39
- import"./cli-4c7k75rq.js";
38
+ import"./cli-6vcyw6v7.js";
39
+ import"./cli-re4wkbzx.js";
40
40
  import"./cli-ptkpaqfy.js";
41
41
  export {
42
42
  checkHeartbeatChecklist2 as checkHeartbeatChecklist,
@@ -37,7 +37,7 @@ import {
37
37
  import {
38
38
  init_package,
39
39
  package_default
40
- } from "./cli-2jm992rm.js";
40
+ } from "./cli-5d1m1qca.js";
41
41
  import {
42
42
  MAX_PROFILE_FILE_LENGTH,
43
43
  getMcpBaseUrl,
@@ -9,7 +9,7 @@ import"./cli-c5sbmw1v.js";
9
9
  import"./cli-0726awxw.js";
10
10
  import {
11
11
  handleHook
12
- } from "./cli-e5y285rg.js";
12
+ } from "./cli-1v8w782f.js";
13
13
  import"./cli-13p25grh.js";
14
14
  import"./cli-0adyhvq2.js";
15
15
 
@@ -303,7 +303,7 @@ import {
303
303
  hasCapability,
304
304
  getEnabledCapabilities,
305
305
  createServer
306
- } from "./cli-bddxamg7.js";
306
+ } from "./cli-8qsx817b.js";
307
307
  import {
308
308
  chatThreadOfContextKey,
309
309
  agentContextKey,
@@ -724,26 +724,26 @@ import {
724
724
  countScriptRunJournalSteps2,
725
725
  countScriptRunJournalAgentTaskSteps2,
726
726
  init_db3
727
- } from "./cli-4c7k75rq.js";
727
+ } from "./cli-re4wkbzx.js";
728
728
  import {
729
729
  getUserGrant2,
730
730
  init_rbac_roles
731
- } from "./cli-6q7pyd3k.js";
732
- import"./cli-mnry16kh.js";
731
+ } from "./cli-6vcyw6v7.js";
732
+ import"./cli-xgn4rwyv.js";
733
733
  import {
734
734
  normalizeModelKey
735
- } from "./cli-8w65vwee.js";
735
+ } from "./cli-qrwp40st.js";
736
736
  import {
737
737
  upsertModelCatalogOverlay,
738
738
  deleteModelCatalogOverlay,
739
739
  loadModelsCatalog,
740
740
  requestModelCatalogRefresh2
741
- } from "./cli-jhhb2v9n.js";
741
+ } from "./cli-kqypty34.js";
742
742
  import {
743
743
  AMP_ESTIMATE_MODELS,
744
744
  ampBillsCacheWrites,
745
745
  resolveAmpModel
746
- } from "./cli-vmbakbq0.js";
746
+ } from "./cli-fhvqt2fp.js";
747
747
  import {
748
748
  automationIntegrationFixUrl,
749
749
  preflightAutomation,
@@ -755,7 +755,7 @@ import {
755
755
  cancelWorkflowRun2,
756
756
  TriggerSchemaError,
757
757
  startWorkflowExecution2
758
- } from "./cli-dw0njd9q.js";
758
+ } from "./cli-jhmjwqcg.js";
759
759
  import {
760
760
  require_dist2,
761
761
  isInvalidClientError,
@@ -835,14 +835,14 @@ import {
835
835
  typecheckWithAmbient,
836
836
  typecheckScript,
837
837
  parseSkillContent
838
- } from "./cli-mvsfbbgq.js";
838
+ } from "./cli-65q70v2v.js";
839
839
  import {
840
840
  buildAuthorizationUrl,
841
841
  exchangeAuthorizationCode,
842
842
  oauthAppRowToProviderConfig,
843
843
  forceRefreshAuthorizationOrThrow,
844
844
  forceRefreshTokenOrThrow
845
- } from "./cli-xx13gqf3.js";
845
+ } from "./cli-g6p7c2my.js";
846
846
  import {
847
847
  signalProcessGroup,
848
848
  detachedProcessGroup,
@@ -870,14 +870,14 @@ import {
870
870
  getSlackApp2,
871
871
  startSlackApp2,
872
872
  stopSlackApp2
873
- } from "./cli-tba8fxf9.js";
874
- import"./cli-ztcxv5nv.js";
873
+ } from "./cli-dxwh4j32.js";
874
+ import"./cli-9e9kjqsj.js";
875
875
  import {
876
876
  createApprovalFollowUpTask,
877
877
  generateEdges,
878
878
  definitionNodeIds,
879
879
  validateDefinition
880
- } from "./cli-hwc4a9xm.js";
880
+ } from "./cli-q1812jbw.js";
881
881
  import"./cli-8cvvytad.js";
882
882
  import {
883
883
  _fetchHolder,
@@ -942,7 +942,7 @@ import {
942
942
  resolvePoolDelivery2,
943
943
  createPoolAgent2,
944
944
  init_db
945
- } from "./cli-h23mr2s6.js";
945
+ } from "./cli-hz64bcnj.js";
946
946
  import {
947
947
  RATING_MODEL_MAX_LENGTH,
948
948
  REFERENCES_SOURCE_MAX_LENGTH,
@@ -958,8 +958,8 @@ import {
958
958
  checkHeartbeatChecklist2,
959
959
  runHeartbeatSweep2,
960
960
  stopHeartbeat2
961
- } from "./cli-0k9rcwfy.js";
962
- import"./cli-raejy0mp.js";
961
+ } from "./cli-ka01m5rb.js";
962
+ import"./cli-d43xqzbe.js";
963
963
  import {
964
964
  import_websocket,
965
965
  import_websocket_server
@@ -968,7 +968,7 @@ import {
968
968
  runtimeSupervisorStatus,
969
969
  startRuntimeSupervisor,
970
970
  stopRuntimeSupervisor
971
- } from "./cli-z3dk189k.js";
971
+ } from "./cli-fp4xbw07.js";
972
972
  import"./cli-ns59dc6r.js";
973
973
  import {
974
974
  ACP_TARGET_IDS
@@ -983,7 +983,7 @@ import {
983
983
  import {
984
984
  inviteEmailToSharedOrg,
985
985
  ensureAgentFsCredentialsForAgent
986
- } from "./cli-ak4c12mh.js";
986
+ } from "./cli-yv3n83x8.js";
987
987
  import {
988
988
  Anthropic
989
989
  } from "./cli-er83cjbn.js";
@@ -1156,7 +1156,7 @@ import {
1156
1156
  KvKeySchema,
1157
1157
  KvEntrySchema,
1158
1158
  init_types
1159
- } from "./cli-ksrphveb.js";
1159
+ } from "./cli-yv0vgscc.js";
1160
1160
  import {
1161
1161
  IDENTITY_FIELD_BUDGETS,
1162
1162
  IdentityFieldBudgetError,
@@ -1228,7 +1228,7 @@ import {
1228
1228
  import {
1229
1229
  init_package,
1230
1230
  package_default
1231
- } from "./cli-2jm992rm.js";
1231
+ } from "./cli-5d1m1qca.js";
1232
1232
  import {
1233
1233
  realtimeBus,
1234
1234
  init_bus
@@ -6522,10 +6522,14 @@ function ensureOperator(req, res) {
6522
6522
  return false;
6523
6523
  }
6524
6524
  var moveAssetBodySchema = object2({ key: AssetKeySchema });
6525
+ var moveGenericAssetBodySchema = moveAssetBodySchema.extend({
6526
+ cascade: boolean().optional().describe("For tasks only, also move every descendant task recursively through parentTaskId.")
6527
+ });
6525
6528
  var moveAssetSuccessSchema = object2({
6526
6529
  entityType: AssetEntityTypeSchema,
6527
6530
  id: string2(),
6528
- key: AssetKeySchema
6531
+ key: AssetKeySchema,
6532
+ movedTaskIds: array2(string2()).optional()
6529
6533
  });
6530
6534
  var moveAssetResponses = {
6531
6535
  200: { description: "Asset namespace updated", schema: moveAssetSuccessSchema },
@@ -6564,7 +6568,7 @@ var moveAssetRoute = route({
6564
6568
  description: "Updates namespace metadata only. Provider-backed files keep the same provider key, org, and drive; no remote move occurs. Personal keys are labels, not a privacy guarantee.",
6565
6569
  tags: ["Assets"],
6566
6570
  params: object2({ entityType: AssetEntityTypeSchema, id: string2().min(1) }),
6567
- body: moveAssetBodySchema,
6571
+ body: moveGenericAssetBodySchema,
6568
6572
  responses: moveAssetResponses,
6569
6573
  rbac: {
6570
6574
  ungated: "preserves each entity's current mutation posture; task moves use task.fs.mutate, app moves use app.manage, scripts preserve agent ownership/global-lead rules, file moves require operator authentication, and personal destinations require a matching trusted user"
@@ -6671,18 +6675,27 @@ async function handleAssets(req, res, pathSegments, queryParams, myAgentId) {
6671
6675
  const parsed = await moveAssetRoute.parse(req, res, pathSegments, queryParams);
6672
6676
  if (!parsed)
6673
6677
  return true;
6678
+ if (parsed.body.cascade && parsed.params.entityType !== "task") {
6679
+ jsonError(res, "Cascade is only supported for task namespace moves", 400);
6680
+ return true;
6681
+ }
6674
6682
  if (parsed.params.entityType === "file" && !ensureOperator(req, res))
6675
6683
  return true;
6684
+ let descendantTaskIds;
6676
6685
  if (parsed.params.entityType === "task") {
6677
6686
  const task = await getTaskById2(parsed.params.id);
6678
6687
  if (!task) {
6679
6688
  jsonError(res, "Asset not found", 404);
6680
6689
  return true;
6681
6690
  }
6682
- if (!await canMutateTaskNamespace(task, myAgentId, req)) {
6683
- jsonError(res, "Not authorized to move this task namespace", 403);
6684
- return true;
6691
+ const tasks = parsed.body.cascade ? await getRootTaskChain2(task.id) : [task];
6692
+ for (const target of tasks) {
6693
+ if (!await canMutateTaskNamespace(target, myAgentId, req)) {
6694
+ jsonError(res, "Not authorized to move this task namespace", 403);
6695
+ return true;
6696
+ }
6685
6697
  }
6698
+ descendantTaskIds = tasks.filter((target) => target.id !== task.id).map((target) => target.id);
6686
6699
  }
6687
6700
  if (parsed.params.entityType === "app") {
6688
6701
  if (!await getApp(parsed.params.id)) {
@@ -6712,7 +6725,8 @@ async function handleAssets(req, res, pathSegments, queryParams, myAgentId) {
6712
6725
  entityType: parsed.params.entityType,
6713
6726
  id: parsed.params.id,
6714
6727
  key,
6715
- changedBy: actor ?? undefined
6728
+ changedBy: actor ?? undefined,
6729
+ descendantTaskIds
6716
6730
  });
6717
6731
  if (!moved) {
6718
6732
  jsonError(res, "Asset not found", 404);
@@ -6721,7 +6735,8 @@ async function handleAssets(req, res, pathSegments, queryParams, myAgentId) {
6721
6735
  moveAssetRoute.respond(res, 200, {
6722
6736
  entityType: parsed.params.entityType,
6723
6737
  id: parsed.params.id,
6724
- key
6738
+ key,
6739
+ ...moved
6725
6740
  });
6726
6741
  } catch (error) {
6727
6742
  if (error instanceof AssetKeyAuthorizationError) {
@@ -13333,20 +13348,21 @@ var listState = route({
13333
13348
  },
13334
13349
  auth: { apiKey: true }
13335
13350
  });
13351
+ var inboxStateItemSchema = object2({
13352
+ itemType: InboxItemTypeSchema,
13353
+ itemId: string2().min(1),
13354
+ status: InboxItemStatusSchema,
13355
+ snoozeUntil: string2().datetime().optional(),
13356
+ readAt: string2().datetime().optional(),
13357
+ lastReadAt: string2().datetime().nullable().optional().describe("Omit to preserve the read cursor, send null to clear it, or send a timestamp to set it, including an earlier time.")
13358
+ });
13336
13359
  var upsertState = route({
13337
13360
  method: "patch",
13338
13361
  path: "/api/inbox-state",
13339
13362
  pattern: ["api", "inbox-state"],
13340
13363
  summary: "Upsert per-user dismiss/snooze/done state for an inbox item",
13341
13364
  tags: ["Inbox State"],
13342
- body: object2({
13343
- userId: string2(),
13344
- itemType: InboxItemTypeSchema,
13345
- itemId: string2().min(1),
13346
- status: InboxItemStatusSchema,
13347
- snoozeUntil: string2().datetime().optional(),
13348
- readAt: string2().datetime().optional()
13349
- }),
13365
+ body: inboxStateItemSchema.extend({ userId: string2() }),
13350
13366
  responses: {
13351
13367
  200: {
13352
13368
  description: "Upserted inbox state row",
@@ -13357,6 +13373,27 @@ var upsertState = route({
13357
13373
  },
13358
13374
  auth: { apiKey: true }
13359
13375
  });
13376
+ var bulkUpsertState = route({
13377
+ method: "patch",
13378
+ path: "/api/inbox-state/bulk",
13379
+ pattern: ["api", "inbox-state", "bulk"],
13380
+ summary: "Upsert inbox-item state in one transaction",
13381
+ tags: ["Inbox State"],
13382
+ body: object2({
13383
+ userId: string2(),
13384
+ items: array2(inboxStateItemSchema).min(1).max(200)
13385
+ }),
13386
+ responses: {
13387
+ 200: {
13388
+ description: "Upserted inbox state rows in request order",
13389
+ schema: object2({ items: array2(InboxItemStateSchema) })
13390
+ },
13391
+ 400: { description: "Validation error" },
13392
+ 401: { description: "Unauthorized" }
13393
+ },
13394
+ auth: { apiKey: true },
13395
+ rbac: { ungated: "per-user inbox UI state, same posture as PATCH /api/inbox-state" }
13396
+ });
13360
13397
  async function handleInboxState(req, res, pathSegments, queryParams) {
13361
13398
  if (listState.match(req.method, pathSegments)) {
13362
13399
  const parsed = await listState.parse(req, res, pathSegments, queryParams);
@@ -13370,6 +13407,24 @@ async function handleInboxState(req, res, pathSegments, queryParams) {
13370
13407
  listState.respond(res, 200, { items });
13371
13408
  return true;
13372
13409
  }
13410
+ if (bulkUpsertState.match(req.method, pathSegments)) {
13411
+ const parsed = await bulkUpsertState.parse(req, res, pathSegments, queryParams);
13412
+ if (!parsed)
13413
+ return true;
13414
+ try {
13415
+ const items = await getDbClient2().transaction(async () => {
13416
+ const rows = [];
13417
+ for (const item of parsed.body.items) {
13418
+ rows.push(await upsertInboxState2({ ...item, userId: parsed.body.userId }));
13419
+ }
13420
+ return rows;
13421
+ });
13422
+ bulkUpsertState.respond(res, 200, { items });
13423
+ } catch (err) {
13424
+ jsonError(res, err instanceof Error ? err.message : "Failed to upsert inbox state", 500);
13425
+ }
13426
+ return true;
13427
+ }
13373
13428
  if (upsertState.match(req.method, pathSegments)) {
13374
13429
  const parsed = await upsertState.parse(req, res, pathSegments, queryParams);
13375
13430
  if (!parsed)
@@ -13381,7 +13436,8 @@ async function handleInboxState(req, res, pathSegments, queryParams) {
13381
13436
  itemId: parsed.body.itemId,
13382
13437
  status: parsed.body.status,
13383
13438
  snoozeUntil: parsed.body.snoozeUntil,
13384
- readAt: parsed.body.readAt
13439
+ readAt: parsed.body.readAt,
13440
+ lastReadAt: parsed.body.lastReadAt
13385
13441
  });
13386
13442
  upsertState.respond(res, 200, { item });
13387
13443
  } catch (err) {
@@ -38341,7 +38397,7 @@ var httpServer = createHttpServer(async (req, res) => {
38341
38397
  });
38342
38398
  });
38343
38399
  var detachRealtime = attachRealtimeTransport(httpServer);
38344
- var { attachControllerTransport } = await import("./controllers-connect-6yhwqv9v.js");
38400
+ var { attachControllerTransport } = await import("./controllers-connect-ymw5541d.js");
38345
38401
  var detachControllers = attachControllerTransport(httpServer);
38346
38402
  var stopWorkerNudges = startWorkerNudgeListener();
38347
38403
  var stopRoomDeletion = realtimeBus.subscribe("room:namespace-deleted", (namespace) => {
@@ -38370,7 +38426,7 @@ async function shutdown() {
38370
38426
  sessionsProcessed: getServerSessionsProcessed()
38371
38427
  });
38372
38428
  if (hasCapability("scheduling")) {
38373
- const { stopScheduler } = await import("./index-e4tsa1h7.js");
38429
+ const { stopScheduler } = await import("./index-vjn3wbzf.js");
38374
38430
  stopScheduler();
38375
38431
  }
38376
38432
  stopHeartbeat2();
@@ -38382,7 +38438,7 @@ async function shutdown() {
38382
38438
  await stopSlackApp2();
38383
38439
  await stopChatSdk();
38384
38440
  if (process.env.OAUTH_KEEPALIVE_DISABLE !== "true") {
38385
- const { stopOAuthKeepalive } = await import("./keepalive-d4nzs76x.js");
38441
+ const { stopOAuthKeepalive } = await import("./keepalive-4djvbm2j.js");
38386
38442
  await stopOAuthKeepalive();
38387
38443
  }
38388
38444
  stopOAuthPendingGc();
@@ -38462,21 +38518,21 @@ try {
38462
38518
  console.warn("[startup] CAPABILITIES upgrade seed failed (non-fatal):", err);
38463
38519
  }
38464
38520
  try {
38465
- const { ensurePricingSeeded } = await import("./boot-seeds-w2hmkxn5.js");
38521
+ const { ensurePricingSeeded } = await import("./boot-seeds-gbedmamp.js");
38466
38522
  ensurePricingSeeded();
38467
- const { startPricingRefreshLoop } = await import("./pricing-refresh-6ehwkcmp.js");
38523
+ const { startPricingRefreshLoop } = await import("./pricing-refresh-sdcf5yaz.js");
38468
38524
  startPricingRefreshLoop();
38469
38525
  } catch (err) {
38470
38526
  console.error("[startup] Failed to seed pricing rows:", err);
38471
38527
  }
38472
38528
  try {
38473
- const { ensureModelProfilesSeeded } = await import("./boot-seeds-w2hmkxn5.js");
38529
+ const { ensureModelProfilesSeeded } = await import("./boot-seeds-gbedmamp.js");
38474
38530
  await ensureModelProfilesSeeded();
38475
38531
  } catch (err) {
38476
38532
  console.error("[startup] Failed to seed model profiles:", err);
38477
38533
  }
38478
38534
  try {
38479
- const { ensureRbacSeeded } = await import("./boot-seeds-w2hmkxn5.js");
38535
+ const { ensureRbacSeeded } = await import("./boot-seeds-gbedmamp.js");
38480
38536
  ensureRbacSeeded();
38481
38537
  } catch (err) {
38482
38538
  console.error("[startup] Failed to sync RBAC seed rows:", err);
@@ -38484,7 +38540,7 @@ try {
38484
38540
  throw err;
38485
38541
  }
38486
38542
  try {
38487
- const { runAllSeeders } = await import("./index-039x2sag.js");
38543
+ const { runAllSeeders } = await import("./index-6rmnn89d.js");
38488
38544
  await runAllSeeders({ scriptEmbeddingMode: "skip" });
38489
38545
  } catch (err) {
38490
38546
  console.error("[startup] Failed to seed built-in entities:", err);
@@ -38546,39 +38602,39 @@ httpServer.listen(port, async () => {
38546
38602
  await initWorkflows2();
38547
38603
  await startScriptRunSupervisor(getMcpBaseUrl());
38548
38604
  if (hasCapability("scheduling")) {
38549
- const { startScheduler } = await import("./index-e4tsa1h7.js");
38550
- const { getExecutorRegistry } = await import("./index-1r8hw4vd.js");
38605
+ const { startScheduler } = await import("./index-vjn3wbzf.js");
38606
+ const { getExecutorRegistry } = await import("./index-xmmkyx82.js");
38551
38607
  const intervalMs = Number(process.env.SCHEDULER_INTERVAL_MS) || 1e4;
38552
38608
  startScheduler(getExecutorRegistry(), intervalMs, {
38553
38609
  runId: globalState.__runId
38554
38610
  });
38555
38611
  }
38556
38612
  if (!isEnvFlagEnabled("HEARTBEAT_DISABLE", false)) {
38557
- const { startHeartbeat } = await import("./index-qyjbb7br.js");
38613
+ const { startHeartbeat } = await import("./index-nyfcdpky.js");
38558
38614
  const heartbeatMs = Number(process.env.HEARTBEAT_INTERVAL_MS) || 90000;
38559
38615
  startHeartbeat(heartbeatMs);
38560
38616
  }
38561
38617
  startPoolRouting();
38562
38618
  startRuntimeSupervisor();
38563
38619
  if (process.env.OAUTH_KEEPALIVE_DISABLE !== "true") {
38564
- const { startOAuthKeepalive } = await import("./keepalive-d4nzs76x.js");
38620
+ const { startOAuthKeepalive } = await import("./keepalive-4djvbm2j.js");
38565
38621
  startOAuthKeepalive();
38566
38622
  }
38567
38623
  if (process.env.OAUTH_REFRESH_SWEEP_DISABLE !== "true") {
38568
- const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-3f25djq3.js");
38624
+ const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-fpd6x6rw.js");
38569
38625
  startOAuthRefreshSweep();
38570
38626
  }
38571
38627
  startOAuthPendingGc();
38572
38628
  await startMemoryGc();
38573
38629
  await startDbRetention();
38574
38630
  startHumanFreeDrain();
38575
- import("./boot-reembed-4kx69j3g.js").then(({ runBootReembed }) => runBootReembed()).catch((err) => {
38631
+ import("./boot-reembed-p666cw5n.js").then(({ runBootReembed }) => runBootReembed()).catch((err) => {
38576
38632
  console.error("[boot-reembed] startup backfill failed (non-fatal):", err);
38577
38633
  });
38578
- import("./boot-reembed-db0wwgy1.js").then(({ runBootReembedScripts }) => runBootReembedScripts()).catch((err) => {
38634
+ import("./boot-reembed-w6pm64j4.js").then(({ runBootReembedScripts }) => runBootReembedScripts()).catch((err) => {
38579
38635
  console.error("[boot-reembed-scripts] startup backfill failed (non-fatal):", err);
38580
38636
  });
38581
- import("./boot-scrub-sweep-tfv4d3mm.js").then(({ runBootScrubSweep }) => runBootScrubSweep()).catch((err) => {
38637
+ import("./boot-scrub-sweep-jcyjagn3.js").then(({ runBootScrubSweep }) => runBootScrubSweep()).catch((err) => {
38582
38638
  console.error("[boot-scrub-sweep] startup scrub failed (non-fatal):", err);
38583
38639
  });
38584
38640
  }).on("error", (err) => {