opencode-swarm 7.199.1 → 7.199.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 (84) hide show
  1. package/.opencode/skills/swarm-pr-feedback/SKILL.md +9 -9
  2. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  3. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  4. package/dist/agents/architect.d.ts +1 -1
  5. package/dist/background/workspace-snapshot.d.ts +51 -0
  6. package/dist/cli/{auto-checkpoint-x13d1g1t.js → auto-checkpoint-0ajspw7n.js} +5 -5
  7. package/dist/cli/{checkpoint-68nb8k3t.js → checkpoint-1dsrg3ft.js} +9 -9
  8. package/dist/cli/{coder-settlement-kmdmdpyy.js → coder-settlement-189074m3.js} +5 -5
  9. package/dist/cli/{config-doctor-4b0jb15n.js → config-doctor-20pd12nw.js} +8 -8
  10. package/dist/cli/{core-6kkm2vrz.js → core-5bqceeft.js} +2 -2
  11. package/dist/cli/{curator-z8xzxh9f.js → curator-b3zn9w9q.js} +28 -28
  12. package/dist/cli/{curator-drift-axcgdjy4.js → curator-drift-ka477rrz.js} +6 -6
  13. package/dist/cli/{curator-llm-factory-58ec737y.js → curator-llm-factory-nbprwszt.js} +28 -28
  14. package/dist/cli/{doctor-knowledge-receipt-phase-id-hkjt6hv4.js → doctor-knowledge-receipt-phase-id-nrk52ak6.js} +5 -5
  15. package/dist/cli/{evidence-summary-service-981cx8wa.js → evidence-summary-service-qrr8zjhj.js} +10 -10
  16. package/dist/cli/{gate-evidence-zyvwsp7a.js → gate-evidence-cbs5xh1n.js} +3 -3
  17. package/dist/cli/{guardrail-explain-23b0amne.js → guardrail-explain-6xd6r3f5.js} +29 -29
  18. package/dist/cli/{guardrail-log-s2gxszvm.js → guardrail-log-qn1sqjs9.js} +4 -4
  19. package/dist/cli/{guardrail-reset-kt18vr45.js → guardrail-reset-ha3w0nby.js} +28 -28
  20. package/dist/cli/{hive-promoter-fz7ep8h4.js → hive-promoter-2dnv2xrg.js} +28 -28
  21. package/dist/cli/{index-3zzxrwaf.js → index-46sgm9rd.js} +1 -1
  22. package/dist/cli/{index-bb2rx8k2.js → index-4py6w3hy.js} +3 -3
  23. package/dist/cli/{index-t1t93qm0.js → index-5mbpybdm.js} +2 -2
  24. package/dist/cli/{index-14vhp87b.js → index-5v0wkcd9.js} +2 -2
  25. package/dist/cli/{index-vj0zede7.js → index-67ad9qbe.js} +1 -1
  26. package/dist/cli/{index-w9f2jbwe.js → index-7d3ft7by.js} +1 -1
  27. package/dist/cli/{index-n9ry04hw.js → index-9qc7d3q2.js} +15 -11
  28. package/dist/cli/{index-m4s5a2sp.js → index-bz5h9ttt.js} +4 -4
  29. package/dist/cli/{index-61fa8hg7.js → index-c2eqtpk1.js} +2 -2
  30. package/dist/cli/{index-61m1jw7p.js → index-cpdcscwt.js} +2 -2
  31. package/dist/cli/{index-fmbqyqqw.js → index-djtqb6b7.js} +2 -2
  32. package/dist/cli/{index-jccs3fgn.js → index-dyp5807d.js} +13 -1
  33. package/dist/cli/{index-f900029m.js → index-eyt9ryhd.js} +4 -4
  34. package/dist/cli/{index-p35gw2x7.js → index-gfdz460m.js} +1 -1
  35. package/dist/cli/{index-nacmcvc4.js → index-hfsyvkn0.js} +4 -4
  36. package/dist/cli/{index-jhk4000q.js → index-hj76n215.js} +1 -1
  37. package/dist/cli/{index-9ztsfved.js → index-hz2609qt.js} +117 -2
  38. package/dist/cli/{index-ge7vn1vz.js → index-jrdepg4w.js} +1 -1
  39. package/dist/cli/{index-4rrff8k6.js → index-km9tjdgw.js} +3 -3
  40. package/dist/cli/{index-408tpd21.js → index-kwh4b9cm.js} +2 -2
  41. package/dist/cli/{index-mzx33w6e.js → index-mb3y5cgy.js} +5 -5
  42. package/dist/cli/{index-r7ayh42s.js → index-mbygjbj8.js} +4 -4
  43. package/dist/cli/{index-795vmpe6.js → index-qksw8p51.js} +28 -28
  44. package/dist/cli/{index-w4624tpw.js → index-r9s68beh.js} +1 -1
  45. package/dist/cli/{index-pf0xrx9w.js → index-skg220qc.js} +423 -117
  46. package/dist/cli/{index-8pyg2qnw.js → index-t6gsqe10.js} +2 -2
  47. package/dist/cli/{index-weewx5nx.js → index-vd6s2mxq.js} +1 -1
  48. package/dist/cli/{index-npy15m50.js → index-ve0ncsnc.js} +1 -1
  49. package/dist/cli/{index-xj9260dh.js → index-wz8zc7w3.js} +6 -6
  50. package/dist/cli/{index-nreezgrd.js → index-xapmt05a.js} +3 -3
  51. package/dist/cli/{index-hqrkr9ag.js → index-xfzkq1k4.js} +5 -5
  52. package/dist/cli/{index-px1dnna2.js → index-y4kjbf12.js} +1 -1
  53. package/dist/cli/{index-qqv9rr8k.js → index-zvjrymp9.js} +30 -30
  54. package/dist/cli/index.js +29 -29
  55. package/dist/cli/{knowledge-escalator-cf6m9y0s.js → knowledge-escalator-k1mssp9r.js} +8 -8
  56. package/dist/cli/{knowledge-events-hn5hymam.js → knowledge-events-f7c0z8rb.js} +6 -6
  57. package/dist/cli/{knowledge-store-mgqk4hvy.js → knowledge-store-50vj5db0.js} +1 -1
  58. package/dist/cli/{knowledge-validator-x9yrte9q.js → knowledge-validator-afxk6dvk.js} +2 -2
  59. package/dist/cli/{mcp-hpmh4d6d.js → mcp-j0grf8gt.js} +1 -1
  60. package/dist/cli/{model-preflight-ry5jjnx4.js → model-preflight-ks9j40t5.js} +28 -28
  61. package/dist/cli/{pending-delegations-j850kj5p.js → pending-delegations-e42yvvj0.js} +2 -2
  62. package/dist/cli/{pr-subscriptions-mme9gb5e.js → pr-subscriptions-e92eg4ts.js} +1 -1
  63. package/dist/cli/{pr-workflow-gate-n6bj3dnn.js → pr-workflow-gate-zqwde6r6.js} +28 -28
  64. package/dist/cli/{runner-qe3fkzx5.js → runner-7sd43gan.js} +1 -1
  65. package/dist/cli/{scan-cursor-fdpxbx4f.js → scan-cursor-yehnf9jt.js} +2 -2
  66. package/dist/cli/{schema-amcjvk8a.js → schema-jw861rj0.js} +2 -2
  67. package/dist/cli/{scope-persistence-mp4kqpk2.js → scope-persistence-p778xbbq.js} +6 -6
  68. package/dist/cli/{server-ptdvpwyd.js → server-nkhvbbc5.js} +101 -39
  69. package/dist/cli/{skill-generator-v59hhybn.js → skill-generator-dd1w9p3t.js} +9 -9
  70. package/dist/cli/{snapshot-coordination-init-nv6e4svp.js → snapshot-coordination-init-11qb0jbs.js} +28 -28
  71. package/dist/cli/{speckit-checkoff-me8kd3wd.js → speckit-checkoff-d92ej93g.js} +4 -4
  72. package/dist/cli/{workspace-snapshot-vhvrkbbb.js → workspace-snapshot-4zfj5wnd.js} +13 -1
  73. package/dist/cli/{worktree-collision-ownership-84qyqars.js → worktree-collision-ownership-81wpkagz.js} +2 -2
  74. package/dist/cli/{worktree-isolation-99qvz8ap.js → worktree-isolation-zw3ydg49.js} +28 -28
  75. package/dist/config/skill-contract-digest.d.ts +8 -0
  76. package/dist/hooks/pr-workflow-gate.d.ts +32 -23
  77. package/dist/host/v2/events.d.ts +19 -1
  78. package/dist/host/v2/hooks.d.ts +25 -0
  79. package/dist/index.js +61 -59
  80. package/dist/tools/index.d.ts +1 -0
  81. package/dist/tools/manifest.d.ts +1 -0
  82. package/dist/tools/prepare-pr-feedback-commit-message.d.ts +30 -0
  83. package/dist/tools/tool-metadata.d.ts +4 -4
  84. package/package.json +1 -1
@@ -103,52 +103,52 @@ import {
103
103
  withPrWorkflowCheckoutMutationLock,
104
104
  withPrWorkflowCheckoutPreparationLock,
105
105
  writePrWorkflowAtomicJson
106
- } from "./index-pf0xrx9w.js";
107
- import"./index-408tpd21.js";
108
- import"./index-nacmcvc4.js";
109
- import"./index-px1dnna2.js";
106
+ } from "./index-skg220qc.js";
107
+ import"./index-kwh4b9cm.js";
108
+ import"./index-hfsyvkn0.js";
109
+ import"./index-y4kjbf12.js";
110
110
  import"./index-j2vv0h13.js";
111
- import"./index-jccs3fgn.js";
111
+ import"./index-dyp5807d.js";
112
112
  import"./index-7c432abn.js";
113
113
  import"./index-txdagbh7.js";
114
- import"./index-w4624tpw.js";
114
+ import"./index-r9s68beh.js";
115
115
  import"./index-rdec0y3z.js";
116
- import"./index-npy15m50.js";
117
- import"./index-m4s5a2sp.js";
118
- import"./index-n9ry04hw.js";
119
- import"./index-xj9260dh.js";
120
- import"./index-9ztsfved.js";
116
+ import"./index-ve0ncsnc.js";
117
+ import"./index-bz5h9ttt.js";
118
+ import"./index-9qc7d3q2.js";
119
+ import"./index-wz8zc7w3.js";
120
+ import"./index-hz2609qt.js";
121
121
  import"./index-bkscmz4z.js";
122
122
  import"./index-cjapb4hy.js";
123
123
  import"./index-pxdc0qn1.js";
124
124
  import"./index-pt7h91zc.js";
125
125
  import"./index-q7sjgr1y.js";
126
- import"./index-bb2rx8k2.js";
127
- import"./index-mzx33w6e.js";
126
+ import"./index-4py6w3hy.js";
127
+ import"./index-mb3y5cgy.js";
128
128
  import"./index-6b295cas.js";
129
129
  import"./index-9nyqt3kb.js";
130
- import"./index-nreezgrd.js";
130
+ import"./index-xapmt05a.js";
131
131
  import"./index-v3bmwmqw.js";
132
- import"./index-w9f2jbwe.js";
133
- import"./index-3zzxrwaf.js";
134
- import"./index-61m1jw7p.js";
132
+ import"./index-7d3ft7by.js";
133
+ import"./index-46sgm9rd.js";
134
+ import"./index-cpdcscwt.js";
135
135
  import"./index-g4fs6z4e.js";
136
136
  import {
137
137
  PR_REVIEW_BASE_DIMENSION_IDS
138
- } from "./index-jhk4000q.js";
139
- import"./index-8pyg2qnw.js";
140
- import"./index-61fa8hg7.js";
138
+ } from "./index-hj76n215.js";
139
+ import"./index-t6gsqe10.js";
140
+ import"./index-c2eqtpk1.js";
141
141
  import"./index-m9zzj4ee.js";
142
142
  import"./index-820pzqd6.js";
143
143
  import"./index-2s7dvzff.js";
144
- import"./index-vj0zede7.js";
144
+ import"./index-67ad9qbe.js";
145
145
  import"./index-2mx2gn97.js";
146
146
  import"./index-rtry5xyf.js";
147
- import"./index-4rrff8k6.js";
147
+ import"./index-km9tjdgw.js";
148
148
  import"./index-g22dps7x.js";
149
149
  import"./index-0725jpp7.js";
150
- import"./index-ge7vn1vz.js";
151
- import"./index-fmbqyqqw.js";
150
+ import"./index-jrdepg4w.js";
151
+ import"./index-djtqb6b7.js";
152
152
  import"./index-h349p91m.js";
153
153
  import"./index-p5pgjp7n.js";
154
154
  import"./index-nr1pj3hy.js";
@@ -157,7 +157,7 @@ import"./index-ry16d01s.js";
157
157
  import"./index-rdm3px0g.js";
158
158
  import"./index-7pmbnjvj.js";
159
159
  import"./index-hc6wa3yg.js";
160
- import"./index-f900029m.js";
160
+ import"./index-eyt9ryhd.js";
161
161
  import"./index-vzm6zre7.js";
162
162
  import"./index-ae75rja9.js";
163
163
  import"./index-2bc7zfw3.js";
@@ -170,10 +170,10 @@ import"./index-ejhxgyvm.js";
170
170
  import"./index-7g4c7s5r.js";
171
171
  import"./index-ywb5er8g.js";
172
172
  import"./index-gx2vp8gx.js";
173
- import"./index-weewx5nx.js";
173
+ import"./index-vd6s2mxq.js";
174
174
  import"./index-zxdawwc7.js";
175
- import"./index-t1t93qm0.js";
176
- import"./index-hqrkr9ag.js";
175
+ import"./index-5mbpybdm.js";
176
+ import"./index-xfzkq1k4.js";
177
177
  import"./index-bk5tah7q.js";
178
178
  import"./index-gknz3bv1.js";
179
179
  import"./index-zpsr8rpc.js";
@@ -3,7 +3,7 @@ import {
3
3
  _internals,
4
4
  createModelEvaluationExecutor,
5
5
  runEvaluation
6
- } from "./index-jccs3fgn.js";
6
+ } from "./index-dyp5807d.js";
7
7
  import"./index-7c432abn.js";
8
8
  import"./index-txdagbh7.js";
9
9
  import"./index-2s7dvzff.js";
@@ -4,8 +4,8 @@ import {
4
4
  alreadyCuratedThisGeneration,
5
5
  claimNextScanBatch,
6
6
  getScanStatus
7
- } from "./index-w4624tpw.js";
8
- import"./index-f900029m.js";
7
+ } from "./index-r9s68beh.js";
8
+ import"./index-eyt9ryhd.js";
9
9
  import"./index-vzm6zre7.js";
10
10
  import"./index-ae75rja9.js";
11
11
  import"./index-2bc7zfw3.js";
@@ -125,8 +125,8 @@ import {
125
125
  resolveGuardrailsConfig,
126
126
  retiredEpicKeyReplacement,
127
127
  stripKnownSwarmPrefix
128
- } from "./index-t1t93qm0.js";
129
- import"./index-hqrkr9ag.js";
128
+ } from "./index-5mbpybdm.js";
129
+ import"./index-xfzkq1k4.js";
130
130
  import"./index-bk5tah7q.js";
131
131
  import"./index-gknz3bv1.js";
132
132
  import"./index-zpsr8rpc.js";
@@ -25,8 +25,8 @@ import {
25
25
  tombstoneScopeBinding,
26
26
  writeScopeBindingToDisk,
27
27
  writeScopeToDisk
28
- } from "./index-ge7vn1vz.js";
29
- import"./index-fmbqyqqw.js";
28
+ } from "./index-jrdepg4w.js";
29
+ import"./index-djtqb6b7.js";
30
30
  import"./index-h349p91m.js";
31
31
  import"./index-p5pgjp7n.js";
32
32
  import"./index-nr1pj3hy.js";
@@ -35,7 +35,7 @@ import"./index-ry16d01s.js";
35
35
  import"./index-rdm3px0g.js";
36
36
  import"./index-7pmbnjvj.js";
37
37
  import"./index-hc6wa3yg.js";
38
- import"./index-f900029m.js";
38
+ import"./index-eyt9ryhd.js";
39
39
  import"./index-vzm6zre7.js";
40
40
  import"./index-ae75rja9.js";
41
41
  import"./index-2bc7zfw3.js";
@@ -48,10 +48,10 @@ import"./index-ejhxgyvm.js";
48
48
  import"./index-7g4c7s5r.js";
49
49
  import"./index-ywb5er8g.js";
50
50
  import"./index-gx2vp8gx.js";
51
- import"./index-weewx5nx.js";
51
+ import"./index-vd6s2mxq.js";
52
52
  import"./index-zxdawwc7.js";
53
- import"./index-t1t93qm0.js";
54
- import"./index-hqrkr9ag.js";
53
+ import"./index-5mbpybdm.js";
54
+ import"./index-xfzkq1k4.js";
55
55
  import"./index-bk5tah7q.js";
56
56
  import"./index-gknz3bv1.js";
57
57
  import"./index-zpsr8rpc.js";
@@ -22,33 +22,33 @@ import {
22
22
  resolveWriteTargets,
23
23
  searchKnowledge,
24
24
  symbols
25
- } from "./index-pf0xrx9w.js";
25
+ } from "./index-skg220qc.js";
26
26
  import {
27
27
  checkFileAuthority,
28
28
  checkWriteTargetForSymlink
29
- } from "./index-408tpd21.js";
30
- import"./index-nacmcvc4.js";
29
+ } from "./index-kwh4b9cm.js";
30
+ import"./index-hfsyvkn0.js";
31
31
  import {
32
32
  _internals,
33
33
  saveEvidence
34
- } from "./index-px1dnna2.js";
34
+ } from "./index-y4kjbf12.js";
35
35
  import {
36
36
  getProfileForFile
37
37
  } from "./index-j2vv0h13.js";
38
38
  import {
39
39
  pLimit
40
- } from "./index-jccs3fgn.js";
40
+ } from "./index-dyp5807d.js";
41
41
  import"./index-7c432abn.js";
42
42
  import"./index-txdagbh7.js";
43
43
  import {
44
44
  resolveCohortId
45
- } from "./index-w4624tpw.js";
45
+ } from "./index-r9s68beh.js";
46
46
  import"./index-rdec0y3z.js";
47
- import"./index-npy15m50.js";
48
- import"./index-m4s5a2sp.js";
49
- import"./index-n9ry04hw.js";
50
- import"./index-xj9260dh.js";
51
- import"./index-9ztsfved.js";
47
+ import"./index-ve0ncsnc.js";
48
+ import"./index-bz5h9ttt.js";
49
+ import"./index-9qc7d3q2.js";
50
+ import"./index-wz8zc7w3.js";
51
+ import"./index-hz2609qt.js";
52
52
  import"./index-bkscmz4z.js";
53
53
  import"./index-cjapb4hy.js";
54
54
  import"./index-pxdc0qn1.js";
@@ -59,11 +59,11 @@ import {
59
59
  import"./index-q7sjgr1y.js";
60
60
  import {
61
61
  createSwarmTool
62
- } from "./index-bb2rx8k2.js";
62
+ } from "./index-4py6w3hy.js";
63
63
  import {
64
64
  loadPlan,
65
65
  loadPlanJsonOnly
66
- } from "./index-mzx33w6e.js";
66
+ } from "./index-mb3y5cgy.js";
67
67
  import {
68
68
  containsControlChars,
69
69
  createTargetWithinRootValidator,
@@ -73,15 +73,15 @@ import {
73
73
  validateWorkspaceRoot
74
74
  } from "./index-6b295cas.js";
75
75
  import"./index-9nyqt3kb.js";
76
- import"./index-nreezgrd.js";
76
+ import"./index-xapmt05a.js";
77
77
  import"./index-v3bmwmqw.js";
78
- import"./index-w9f2jbwe.js";
79
- import"./index-3zzxrwaf.js";
80
- import"./index-61m1jw7p.js";
78
+ import"./index-7d3ft7by.js";
79
+ import"./index-46sgm9rd.js";
80
+ import"./index-cpdcscwt.js";
81
81
  import"./index-g4fs6z4e.js";
82
- import"./index-jhk4000q.js";
83
- import"./index-8pyg2qnw.js";
84
- import"./index-61fa8hg7.js";
82
+ import"./index-hj76n215.js";
83
+ import"./index-t6gsqe10.js";
84
+ import"./index-c2eqtpk1.js";
85
85
  import"./index-m9zzj4ee.js";
86
86
  import"./index-820pzqd6.js";
87
87
  import"./index-2s7dvzff.js";
@@ -90,18 +90,18 @@ import {
90
90
  validateActionability,
91
91
  validateActionableFields,
92
92
  validateLesson
93
- } from "./index-vj0zede7.js";
93
+ } from "./index-67ad9qbe.js";
94
94
  import {
95
95
  resolveWorktreeId
96
96
  } from "./index-2mx2gn97.js";
97
97
  import"./index-rtry5xyf.js";
98
- import"./index-4rrff8k6.js";
98
+ import"./index-km9tjdgw.js";
99
99
  import"./index-g22dps7x.js";
100
100
  import"./index-0725jpp7.js";
101
101
  import {
102
102
  normalizeScopeFiles
103
- } from "./index-ge7vn1vz.js";
104
- import"./index-fmbqyqqw.js";
103
+ } from "./index-jrdepg4w.js";
104
+ import"./index-djtqb6b7.js";
105
105
  import"./index-h349p91m.js";
106
106
  import"./index-p5pgjp7n.js";
107
107
  import"./index-nr1pj3hy.js";
@@ -119,7 +119,7 @@ import {
119
119
  reinforceSwarmKnowledgeEntry,
120
120
  resolveSwarmKnowledgePath,
121
121
  transactKnowledge
122
- } from "./index-f900029m.js";
122
+ } from "./index-eyt9ryhd.js";
123
123
  import"./index-vzm6zre7.js";
124
124
  import"./index-ae75rja9.js";
125
125
  import"./index-2bc7zfw3.js";
@@ -143,7 +143,7 @@ import"./index-gx2vp8gx.js";
143
143
  import {
144
144
  loadGateOverrides,
145
145
  loadPluginConfigWithMeta
146
- } from "./index-weewx5nx.js";
146
+ } from "./index-vd6s2mxq.js";
147
147
  import {
148
148
  init_git_executable,
149
149
  resolveGitExecutableAsync
@@ -151,11 +151,11 @@ import {
151
151
  import {
152
152
  KnowledgeConfigSchema,
153
153
  init_schema
154
- } from "./index-t1t93qm0.js";
154
+ } from "./index-5mbpybdm.js";
155
155
  import {
156
156
  TOOL_METADATA,
157
157
  init_tool_metadata
158
- } from "./index-hqrkr9ag.js";
158
+ } from "./index-xfzkq1k4.js";
159
159
  import {
160
160
  KNOWLEDGE_SCHEMA_VERSION,
161
161
  init_knowledge_types
@@ -13292,6 +13292,9 @@ class Protocol {
13292
13292
  this.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => {
13293
13293
  const handleTaskResult = async () => {
13294
13294
  const taskId = request.params.taskId;
13295
+ if (!await this._taskStore.getTask(taskId, extra.sessionId)) {
13296
+ throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
13297
+ }
13295
13298
  if (this._taskMessageQueue) {
13296
13299
  let queuedMessage;
13297
13300
  while (queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId)) {
@@ -13322,12 +13325,12 @@ class Protocol {
13322
13325
  throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
13323
13326
  }
13324
13327
  if (!isTerminal(task.status)) {
13325
- await this._waitForTaskUpdate(taskId, extra.signal);
13328
+ await this._waitForTaskUpdate(taskId, extra.signal, extra.sessionId);
13326
13329
  return await handleTaskResult();
13327
13330
  }
13328
13331
  if (isTerminal(task.status)) {
13329
13332
  const result = await this._taskStore.getTaskResult(taskId, extra.sessionId);
13330
- this._clearTaskQueue(taskId);
13333
+ this._clearTaskQueue(taskId, extra.sessionId);
13331
13334
  return {
13332
13335
  ...result,
13333
13336
  _meta: {
@@ -13364,7 +13367,7 @@ class Protocol {
13364
13367
  throw new McpError(ErrorCode.InvalidParams, `Cannot cancel task in terminal status: ${task.status}`);
13365
13368
  }
13366
13369
  await this._taskStore.updateTaskStatus(request.params.taskId, "cancelled", "Client cancelled task execution.", extra.sessionId);
13367
- this._clearTaskQueue(request.params.taskId);
13370
+ this._clearTaskQueue(request.params.taskId, extra.sessionId);
13368
13371
  const cancelledTask = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
13369
13372
  if (!cancelledTask) {
13370
13373
  throw new McpError(ErrorCode.InvalidParams, `Task not found after cancellation: ${request.params.taskId}`);
@@ -13487,6 +13490,19 @@ class Protocol {
13487
13490
  const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
13488
13491
  const capturedTransport = this._transport;
13489
13492
  const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId;
13493
+ const sessionId = capturedTransport?.sessionId;
13494
+ const store = this._taskStore;
13495
+ let relatedTaskFound = true;
13496
+ let relatedTaskLookup;
13497
+ if (relatedTaskId && store && this._taskMessageQueue && sessionId !== undefined) {
13498
+ relatedTaskFound = false;
13499
+ relatedTaskLookup = (async () => {
13500
+ if (!await store.getTask(relatedTaskId, sessionId)) {
13501
+ throw new McpError(ErrorCode.InvalidParams, `Task not found: ${relatedTaskId}`);
13502
+ }
13503
+ relatedTaskFound = true;
13504
+ })();
13505
+ }
13490
13506
  if (handler === undefined) {
13491
13507
  const errorResponse = {
13492
13508
  jsonrpc: "2.0",
@@ -13496,7 +13512,10 @@ class Protocol {
13496
13512
  message: "Method not found"
13497
13513
  }
13498
13514
  };
13499
- if (relatedTaskId && this._taskMessageQueue) {
13515
+ if (relatedTaskId && relatedTaskLookup) {
13516
+ const queuedError = { type: "error", message: errorResponse, timestamp: Date.now() };
13517
+ relatedTaskLookup.then(() => this._enqueueTaskMessage(relatedTaskId, queuedError, sessionId), () => capturedTransport?.send(errorResponse)).catch((error) => this._onerror(new Error(`Failed to send an error response: ${error}`)));
13518
+ } else if (relatedTaskId && this._taskMessageQueue) {
13500
13519
  this._enqueueTaskMessage(relatedTaskId, {
13501
13520
  type: "error",
13502
13521
  message: errorResponse,
@@ -13547,7 +13566,10 @@ class Protocol {
13547
13566
  closeSSEStream: extra?.closeSSEStream,
13548
13567
  closeStandaloneSSEStream: extra?.closeStandaloneSSEStream
13549
13568
  };
13550
- Promise.resolve().then(() => {
13569
+ (relatedTaskLookup ?? Promise.resolve()).then(() => {
13570
+ if (relatedTaskLookup && abortController.signal.aborted) {
13571
+ throw new McpError(ErrorCode.ConnectionClosed, "Request was cancelled");
13572
+ }
13551
13573
  if (taskCreationParams) {
13552
13574
  this.assertTaskHandlerCapability(request.method);
13553
13575
  }
@@ -13582,7 +13604,7 @@ class Protocol {
13582
13604
  ...error["data"] !== undefined && { data: error["data"] }
13583
13605
  }
13584
13606
  };
13585
- if (relatedTaskId && this._taskMessageQueue) {
13607
+ if (relatedTaskId && this._taskMessageQueue && relatedTaskFound) {
13586
13608
  await this._enqueueTaskMessage(relatedTaskId, {
13587
13609
  type: "error",
13588
13610
  message: errorResponse,
@@ -13970,7 +13992,7 @@ class Protocol {
13970
13992
  throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");
13971
13993
  }
13972
13994
  const maxQueueSize = this._options?.maxTaskQueueSize;
13973
- await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
13995
+ await this._taskMessageQueue.enqueue(taskId, message, sessionId ?? this._transport?.sessionId, maxQueueSize);
13974
13996
  }
13975
13997
  async _clearTaskQueue(taskId, sessionId) {
13976
13998
  if (this._taskMessageQueue) {
@@ -13989,10 +14011,10 @@ class Protocol {
13989
14011
  }
13990
14012
  }
13991
14013
  }
13992
- async _waitForTaskUpdate(taskId, signal) {
14014
+ async _waitForTaskUpdate(taskId, signal, sessionId) {
13993
14015
  let interval = this._options?.defaultTaskPollInterval ?? 1000;
13994
14016
  try {
13995
- const task = await this._taskStore?.getTask(taskId);
14017
+ const task = await this._taskStore?.getTask(taskId, sessionId);
13996
14018
  if (task?.pollInterval) {
13997
14019
  interval = task.pollInterval;
13998
14020
  }
@@ -14661,6 +14683,42 @@ class ExperimentalMcpServerTasks {
14661
14683
 
14662
14684
  // node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
14663
14685
  init_zod();
14686
+ function toolInputElementCount(value, max) {
14687
+ let count = 0;
14688
+ const stack = [value];
14689
+ while (stack.length > 0) {
14690
+ const node = stack.pop();
14691
+ if (node === null || typeof node !== "object")
14692
+ continue;
14693
+ if (Array.isArray(node)) {
14694
+ for (const child of node) {
14695
+ if (++count > max)
14696
+ return count;
14697
+ if (child !== null && typeof child === "object")
14698
+ stack.push(child);
14699
+ }
14700
+ } else {
14701
+ for (const key in node) {
14702
+ if (!Object.prototype.hasOwnProperty.call(node, key))
14703
+ continue;
14704
+ if (++count > max)
14705
+ return count;
14706
+ const child = node[key];
14707
+ if (child !== null && typeof child === "object")
14708
+ stack.push(child);
14709
+ }
14710
+ }
14711
+ }
14712
+ return count;
14713
+ }
14714
+ function resolveMaxToolInputElements(value) {
14715
+ if (value === undefined || value === Infinity)
14716
+ return;
14717
+ if (typeof value !== "number" || Number.isNaN(value) || value < 1) {
14718
+ throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(value)}`);
14719
+ }
14720
+ return value;
14721
+ }
14664
14722
 
14665
14723
  class McpServer {
14666
14724
  constructor(serverInfo, options) {
@@ -14673,6 +14731,7 @@ class McpServer {
14673
14731
  this._resourceHandlersInitialized = false;
14674
14732
  this._promptHandlersInitialized = false;
14675
14733
  this.server = new Server(serverInfo, options);
14734
+ this._maxToolInputElements = resolveMaxToolInputElements(options?.maxToolInputElements);
14676
14735
  }
14677
14736
  get experimental() {
14678
14737
  if (!this._experimental) {
@@ -14779,12 +14838,15 @@ class McpServer {
14779
14838
  };
14780
14839
  }
14781
14840
  async validateToolInput(tool, args, toolName) {
14841
+ if (this._maxToolInputElements !== undefined && toolInputElementCount(args, this._maxToolInputElements) > this._maxToolInputElements) {
14842
+ throw new McpError(ErrorCode.InvalidParams, `Invalid arguments for tool ${toolName}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);
14843
+ }
14782
14844
  if (!tool.inputSchema) {
14783
14845
  return;
14784
14846
  }
14785
14847
  const inputObj = normalizeObjectSchema(tool.inputSchema);
14786
14848
  const schemaToParse = inputObj ?? tool.inputSchema;
14787
- const parseResult = await safeParseAsync2(schemaToParse, args);
14849
+ const parseResult = await safeParseAsync2(schemaToParse, args ?? {});
14788
14850
  if (!parseResult.success) {
14789
14851
  const error = "error" in parseResult ? parseResult.error : "Unknown error";
14790
14852
  const errorMessage = getParseErrorMessage(error);
@@ -15009,7 +15071,7 @@ class McpServer {
15009
15071
  }
15010
15072
  if (prompt.argsSchema) {
15011
15073
  const argsObj = normalizeObjectSchema(prompt.argsSchema);
15012
- const parseResult = await safeParseAsync2(argsObj, request.params.arguments);
15074
+ const parseResult = await safeParseAsync2(argsObj, request.params.arguments ?? {});
15013
15075
  if (!parseResult.success) {
15014
15076
  const error = "error" in parseResult ? parseResult.error : "Unknown error";
15015
15077
  const errorMessage = getParseErrorMessage(error);
@@ -33,21 +33,21 @@ import {
33
33
  sanitizeSlug,
34
34
  selectCandidateEntries,
35
35
  writeEvalStub
36
- } from "./index-n9ry04hw.js";
36
+ } from "./index-9qc7d3q2.js";
37
37
  import"./index-q7sjgr1y.js";
38
- import"./index-8pyg2qnw.js";
39
- import"./index-61fa8hg7.js";
38
+ import"./index-t6gsqe10.js";
39
+ import"./index-c2eqtpk1.js";
40
40
  import"./index-m9zzj4ee.js";
41
41
  import"./index-820pzqd6.js";
42
42
  import"./index-2s7dvzff.js";
43
- import"./index-vj0zede7.js";
43
+ import"./index-67ad9qbe.js";
44
44
  import"./index-2mx2gn97.js";
45
45
  import"./index-rtry5xyf.js";
46
- import"./index-4rrff8k6.js";
46
+ import"./index-km9tjdgw.js";
47
47
  import"./index-g22dps7x.js";
48
48
  import"./index-0725jpp7.js";
49
49
  import"./index-hc6wa3yg.js";
50
- import"./index-f900029m.js";
50
+ import"./index-eyt9ryhd.js";
51
51
  import"./index-vzm6zre7.js";
52
52
  import"./index-ae75rja9.js";
53
53
  import"./index-2bc7zfw3.js";
@@ -60,10 +60,10 @@ import"./index-ejhxgyvm.js";
60
60
  import"./index-7g4c7s5r.js";
61
61
  import"./index-ywb5er8g.js";
62
62
  import"./index-gx2vp8gx.js";
63
- import"./index-weewx5nx.js";
63
+ import"./index-vd6s2mxq.js";
64
64
  import"./index-zxdawwc7.js";
65
- import"./index-t1t93qm0.js";
66
- import"./index-hqrkr9ag.js";
65
+ import"./index-5mbpybdm.js";
66
+ import"./index-xfzkq1k4.js";
67
67
  import"./index-bk5tah7q.js";
68
68
  import"./index-gknz3bv1.js";
69
69
  import"./index-zpsr8rpc.js";
@@ -8,50 +8,50 @@ import {
8
8
  markSnapshotCoordinationClosing,
9
9
  retrySnapshotCoordinationInitialization,
10
10
  startSnapshotCoordinationInitialization
11
- } from "./index-pf0xrx9w.js";
12
- import"./index-408tpd21.js";
13
- import"./index-nacmcvc4.js";
14
- import"./index-px1dnna2.js";
11
+ } from "./index-skg220qc.js";
12
+ import"./index-kwh4b9cm.js";
13
+ import"./index-hfsyvkn0.js";
14
+ import"./index-y4kjbf12.js";
15
15
  import"./index-j2vv0h13.js";
16
- import"./index-jccs3fgn.js";
16
+ import"./index-dyp5807d.js";
17
17
  import"./index-7c432abn.js";
18
18
  import"./index-txdagbh7.js";
19
- import"./index-w4624tpw.js";
19
+ import"./index-r9s68beh.js";
20
20
  import"./index-rdec0y3z.js";
21
- import"./index-npy15m50.js";
22
- import"./index-m4s5a2sp.js";
23
- import"./index-n9ry04hw.js";
24
- import"./index-xj9260dh.js";
25
- import"./index-9ztsfved.js";
21
+ import"./index-ve0ncsnc.js";
22
+ import"./index-bz5h9ttt.js";
23
+ import"./index-9qc7d3q2.js";
24
+ import"./index-wz8zc7w3.js";
25
+ import"./index-hz2609qt.js";
26
26
  import"./index-bkscmz4z.js";
27
27
  import"./index-cjapb4hy.js";
28
28
  import"./index-pxdc0qn1.js";
29
29
  import"./index-pt7h91zc.js";
30
30
  import"./index-q7sjgr1y.js";
31
- import"./index-bb2rx8k2.js";
32
- import"./index-mzx33w6e.js";
31
+ import"./index-4py6w3hy.js";
32
+ import"./index-mb3y5cgy.js";
33
33
  import"./index-6b295cas.js";
34
34
  import"./index-9nyqt3kb.js";
35
- import"./index-nreezgrd.js";
35
+ import"./index-xapmt05a.js";
36
36
  import"./index-v3bmwmqw.js";
37
- import"./index-w9f2jbwe.js";
38
- import"./index-3zzxrwaf.js";
39
- import"./index-61m1jw7p.js";
37
+ import"./index-7d3ft7by.js";
38
+ import"./index-46sgm9rd.js";
39
+ import"./index-cpdcscwt.js";
40
40
  import"./index-g4fs6z4e.js";
41
- import"./index-jhk4000q.js";
42
- import"./index-8pyg2qnw.js";
43
- import"./index-61fa8hg7.js";
41
+ import"./index-hj76n215.js";
42
+ import"./index-t6gsqe10.js";
43
+ import"./index-c2eqtpk1.js";
44
44
  import"./index-m9zzj4ee.js";
45
45
  import"./index-820pzqd6.js";
46
46
  import"./index-2s7dvzff.js";
47
- import"./index-vj0zede7.js";
47
+ import"./index-67ad9qbe.js";
48
48
  import"./index-2mx2gn97.js";
49
49
  import"./index-rtry5xyf.js";
50
- import"./index-4rrff8k6.js";
50
+ import"./index-km9tjdgw.js";
51
51
  import"./index-g22dps7x.js";
52
52
  import"./index-0725jpp7.js";
53
- import"./index-ge7vn1vz.js";
54
- import"./index-fmbqyqqw.js";
53
+ import"./index-jrdepg4w.js";
54
+ import"./index-djtqb6b7.js";
55
55
  import"./index-h349p91m.js";
56
56
  import"./index-p5pgjp7n.js";
57
57
  import"./index-nr1pj3hy.js";
@@ -60,7 +60,7 @@ import"./index-ry16d01s.js";
60
60
  import"./index-rdm3px0g.js";
61
61
  import"./index-7pmbnjvj.js";
62
62
  import"./index-hc6wa3yg.js";
63
- import"./index-f900029m.js";
63
+ import"./index-eyt9ryhd.js";
64
64
  import"./index-vzm6zre7.js";
65
65
  import"./index-ae75rja9.js";
66
66
  import"./index-2bc7zfw3.js";
@@ -73,10 +73,10 @@ import"./index-ejhxgyvm.js";
73
73
  import"./index-7g4c7s5r.js";
74
74
  import"./index-ywb5er8g.js";
75
75
  import"./index-gx2vp8gx.js";
76
- import"./index-weewx5nx.js";
76
+ import"./index-vd6s2mxq.js";
77
77
  import"./index-zxdawwc7.js";
78
- import"./index-t1t93qm0.js";
79
- import"./index-hqrkr9ag.js";
78
+ import"./index-5mbpybdm.js";
79
+ import"./index-xfzkq1k4.js";
80
80
  import"./index-bk5tah7q.js";
81
81
  import"./index-gknz3bv1.js";
82
82
  import"./index-zpsr8rpc.js";
@@ -7,14 +7,14 @@ import {
7
7
  parseSpeckitTasksContent,
8
8
  propagateSpeckitCheckoff,
9
9
  writeSpeckitCheckoffLedger
10
- } from "./index-w9f2jbwe.js";
10
+ } from "./index-7d3ft7by.js";
11
11
  import"./index-ejhxgyvm.js";
12
12
  import"./index-7g4c7s5r.js";
13
13
  import"./index-ywb5er8g.js";
14
- import"./index-weewx5nx.js";
14
+ import"./index-vd6s2mxq.js";
15
15
  import"./index-zxdawwc7.js";
16
- import"./index-t1t93qm0.js";
17
- import"./index-hqrkr9ag.js";
16
+ import"./index-5mbpybdm.js";
17
+ import"./index-xfzkq1k4.js";
18
18
  import"./index-bk5tah7q.js";
19
19
  import"./index-gknz3bv1.js";
20
20
  import"./index-zpsr8rpc.js";