opencode-swarm-plugin 0.38.0 → 0.40.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 (91) hide show
  1. package/.env +2 -0
  2. package/.hive/eval-results.json +26 -0
  3. package/.hive/issues.jsonl +27 -0
  4. package/.hive/memories.jsonl +23 -1
  5. package/.opencode/eval-history.jsonl +12 -0
  6. package/CHANGELOG.md +182 -0
  7. package/README.md +29 -12
  8. package/bin/swarm.test.ts +881 -0
  9. package/bin/swarm.ts +686 -0
  10. package/dist/compaction-hook.d.ts +8 -1
  11. package/dist/compaction-hook.d.ts.map +1 -1
  12. package/dist/compaction-observability.d.ts +173 -0
  13. package/dist/compaction-observability.d.ts.map +1 -0
  14. package/dist/compaction-prompt-scoring.d.ts +124 -0
  15. package/dist/compaction-prompt-scoring.d.ts.map +1 -0
  16. package/dist/eval-capture.d.ts +174 -1
  17. package/dist/eval-capture.d.ts.map +1 -1
  18. package/dist/eval-gates.d.ts +84 -0
  19. package/dist/eval-gates.d.ts.map +1 -0
  20. package/dist/eval-history.d.ts +117 -0
  21. package/dist/eval-history.d.ts.map +1 -0
  22. package/dist/eval-learning.d.ts +216 -0
  23. package/dist/eval-learning.d.ts.map +1 -0
  24. package/dist/hive.d.ts.map +1 -1
  25. package/dist/index.d.ts +80 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +16098 -651
  28. package/dist/plugin.js +16012 -756
  29. package/dist/post-compaction-tracker.d.ts +133 -0
  30. package/dist/post-compaction-tracker.d.ts.map +1 -0
  31. package/dist/schemas/task.d.ts +3 -3
  32. package/dist/swarm-orchestrate.d.ts +23 -0
  33. package/dist/swarm-orchestrate.d.ts.map +1 -1
  34. package/dist/swarm-prompts.d.ts +25 -1
  35. package/dist/swarm-prompts.d.ts.map +1 -1
  36. package/dist/swarm.d.ts +4 -0
  37. package/dist/swarm.d.ts.map +1 -1
  38. package/evals/README.md +702 -105
  39. package/evals/compaction-prompt.eval.ts +149 -0
  40. package/evals/coordinator-behavior.eval.ts +8 -8
  41. package/evals/fixtures/compaction-prompt-cases.ts +305 -0
  42. package/evals/lib/compaction-loader.test.ts +248 -0
  43. package/evals/lib/compaction-loader.ts +320 -0
  44. package/evals/lib/data-loader.test.ts +345 -0
  45. package/evals/lib/data-loader.ts +107 -6
  46. package/evals/scorers/compaction-prompt-scorers.ts +145 -0
  47. package/evals/scorers/compaction-scorers.ts +13 -13
  48. package/evals/scorers/coordinator-discipline.evalite-test.ts +166 -2
  49. package/evals/scorers/coordinator-discipline.ts +348 -15
  50. package/evals/scorers/index.test.ts +146 -0
  51. package/evals/scorers/index.ts +104 -0
  52. package/evals/swarm-decomposition.eval.ts +9 -2
  53. package/examples/commands/swarm.md +291 -21
  54. package/examples/plugin-wrapper-template.ts +117 -0
  55. package/package.json +7 -5
  56. package/scripts/migrate-unknown-sessions.ts +349 -0
  57. package/src/compaction-capture.integration.test.ts +257 -0
  58. package/src/compaction-hook.test.ts +42 -0
  59. package/src/compaction-hook.ts +315 -86
  60. package/src/compaction-observability.integration.test.ts +139 -0
  61. package/src/compaction-observability.test.ts +187 -0
  62. package/src/compaction-observability.ts +324 -0
  63. package/src/compaction-prompt-scorers.test.ts +299 -0
  64. package/src/compaction-prompt-scoring.ts +298 -0
  65. package/src/eval-capture.test.ts +626 -1
  66. package/src/eval-capture.ts +286 -2
  67. package/src/eval-gates.test.ts +306 -0
  68. package/src/eval-gates.ts +218 -0
  69. package/src/eval-history.test.ts +508 -0
  70. package/src/eval-history.ts +214 -0
  71. package/src/eval-learning.test.ts +378 -0
  72. package/src/eval-learning.ts +360 -0
  73. package/src/eval-runner.test.ts +96 -0
  74. package/src/eval-runner.ts +356 -0
  75. package/src/hive.ts +34 -0
  76. package/src/index.ts +115 -2
  77. package/src/memory.test.ts +110 -0
  78. package/src/memory.ts +34 -0
  79. package/src/post-compaction-tracker.test.ts +251 -0
  80. package/src/post-compaction-tracker.ts +237 -0
  81. package/src/swarm-decompose.ts +2 -2
  82. package/src/swarm-orchestrate.ts +2 -2
  83. package/src/swarm-prompts.ts +2 -2
  84. package/src/swarm-review.ts +3 -3
  85. package/dist/beads.d.ts +0 -386
  86. package/dist/beads.d.ts.map +0 -1
  87. package/dist/schemas/bead-events.d.ts +0 -698
  88. package/dist/schemas/bead-events.d.ts.map +0 -1
  89. package/dist/schemas/bead.d.ts +0 -255
  90. package/dist/schemas/bead.d.ts.map +0 -1
  91. /package/evals/{evalite.config.ts → evalite.config.ts.bak} +0 -0
package/dist/beads.d.ts DELETED
@@ -1,386 +0,0 @@
1
- import { z } from "zod";
2
- import { type BeadsAdapter } from "swarm-mail";
3
- /**
4
- * Set the working directory for all beads commands.
5
- * Call this from the plugin initialization with the project directory.
6
- *
7
- * @param directory - Absolute path to the project directory
8
- */
9
- export declare function setBeadsWorkingDirectory(directory: string): void;
10
- /**
11
- * Get the current working directory for beads commands.
12
- * Returns the configured directory or process.cwd() as fallback.
13
- */
14
- export declare function getBeadsWorkingDirectory(): string;
15
- /**
16
- * Custom error for bead operations
17
- */
18
- export declare class BeadError extends Error {
19
- readonly command: string;
20
- readonly exitCode?: number | undefined;
21
- readonly stderr?: string | undefined;
22
- constructor(message: string, command: string, exitCode?: number | undefined, stderr?: string | undefined);
23
- }
24
- /**
25
- * Custom error for validation failures
26
- */
27
- export declare class BeadValidationError extends Error {
28
- readonly zodError: z.ZodError;
29
- constructor(message: string, zodError: z.ZodError);
30
- }
31
- /**
32
- * Get or create a BeadsAdapter instance for a project
33
- * Exported for testing - allows tests to verify state directly
34
- *
35
- * On first initialization, checks for .beads/issues.jsonl and imports
36
- * historical beads if the database is empty.
37
- */
38
- export declare function getBeadsAdapter(projectKey: string): Promise<BeadsAdapter>;
39
- /**
40
- * Create a new bead with type-safe validation
41
- */
42
- export declare const beads_create: {
43
- description: string;
44
- args: {
45
- title: z.ZodString;
46
- type: z.ZodOptional<z.ZodEnum<{
47
- bug: "bug";
48
- feature: "feature";
49
- task: "task";
50
- epic: "epic";
51
- chore: "chore";
52
- }>>;
53
- priority: z.ZodOptional<z.ZodNumber>;
54
- description: z.ZodOptional<z.ZodString>;
55
- parent_id: z.ZodOptional<z.ZodString>;
56
- };
57
- execute(args: {
58
- title: string;
59
- type?: "bug" | "feature" | "task" | "epic" | "chore" | undefined;
60
- priority?: number | undefined;
61
- description?: string | undefined;
62
- parent_id?: string | undefined;
63
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
64
- };
65
- /**
66
- * Create an epic with subtasks in one atomic operation
67
- */
68
- export declare const beads_create_epic: {
69
- description: string;
70
- args: {
71
- epic_title: z.ZodString;
72
- epic_description: z.ZodOptional<z.ZodString>;
73
- epic_id: z.ZodOptional<z.ZodString>;
74
- subtasks: z.ZodArray<z.ZodObject<{
75
- title: z.ZodString;
76
- priority: z.ZodOptional<z.ZodNumber>;
77
- files: z.ZodOptional<z.ZodArray<z.ZodString>>;
78
- id_suffix: z.ZodOptional<z.ZodString>;
79
- }, z.core.$strip>>;
80
- strategy: z.ZodOptional<z.ZodEnum<{
81
- "file-based": "file-based";
82
- "feature-based": "feature-based";
83
- "risk-based": "risk-based";
84
- }>>;
85
- task: z.ZodOptional<z.ZodString>;
86
- project_key: z.ZodOptional<z.ZodString>;
87
- recovery_context: z.ZodOptional<z.ZodObject<{
88
- shared_context: z.ZodOptional<z.ZodString>;
89
- skills_to_load: z.ZodOptional<z.ZodArray<z.ZodString>>;
90
- coordinator_notes: z.ZodOptional<z.ZodString>;
91
- }, z.core.$strip>>;
92
- };
93
- execute(args: {
94
- epic_title: string;
95
- subtasks: {
96
- title: string;
97
- priority?: number | undefined;
98
- files?: string[] | undefined;
99
- id_suffix?: string | undefined;
100
- }[];
101
- epic_description?: string | undefined;
102
- epic_id?: string | undefined;
103
- strategy?: "file-based" | "feature-based" | "risk-based" | undefined;
104
- task?: string | undefined;
105
- project_key?: string | undefined;
106
- recovery_context?: {
107
- shared_context?: string | undefined;
108
- skills_to_load?: string[] | undefined;
109
- coordinator_notes?: string | undefined;
110
- } | undefined;
111
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
112
- };
113
- /**
114
- * Query beads with filters
115
- */
116
- export declare const beads_query: {
117
- description: string;
118
- args: {
119
- status: z.ZodOptional<z.ZodEnum<{
120
- open: "open";
121
- in_progress: "in_progress";
122
- blocked: "blocked";
123
- closed: "closed";
124
- }>>;
125
- type: z.ZodOptional<z.ZodEnum<{
126
- bug: "bug";
127
- feature: "feature";
128
- task: "task";
129
- epic: "epic";
130
- chore: "chore";
131
- }>>;
132
- ready: z.ZodOptional<z.ZodBoolean>;
133
- limit: z.ZodOptional<z.ZodNumber>;
134
- };
135
- execute(args: {
136
- status?: "open" | "in_progress" | "blocked" | "closed" | undefined;
137
- type?: "bug" | "feature" | "task" | "epic" | "chore" | undefined;
138
- ready?: boolean | undefined;
139
- limit?: number | undefined;
140
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
141
- };
142
- /**
143
- * Update a bead's status or description
144
- */
145
- export declare const beads_update: {
146
- description: string;
147
- args: {
148
- id: z.ZodString;
149
- status: z.ZodOptional<z.ZodEnum<{
150
- open: "open";
151
- in_progress: "in_progress";
152
- blocked: "blocked";
153
- closed: "closed";
154
- }>>;
155
- description: z.ZodOptional<z.ZodString>;
156
- priority: z.ZodOptional<z.ZodNumber>;
157
- };
158
- execute(args: {
159
- id: string;
160
- status?: "open" | "in_progress" | "blocked" | "closed" | undefined;
161
- description?: string | undefined;
162
- priority?: number | undefined;
163
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
164
- };
165
- /**
166
- * Close a bead with reason
167
- */
168
- export declare const beads_close: {
169
- description: string;
170
- args: {
171
- id: z.ZodString;
172
- reason: z.ZodString;
173
- };
174
- execute(args: {
175
- id: string;
176
- reason: string;
177
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
178
- };
179
- /**
180
- * Mark a bead as in-progress
181
- */
182
- export declare const beads_start: {
183
- description: string;
184
- args: {
185
- id: z.ZodString;
186
- };
187
- execute(args: {
188
- id: string;
189
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
190
- };
191
- /**
192
- * Get the next ready bead
193
- */
194
- export declare const beads_ready: {
195
- description: string;
196
- args: {};
197
- execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
198
- };
199
- /**
200
- * Sync beads to git and push
201
- */
202
- export declare const beads_sync: {
203
- description: string;
204
- args: {
205
- auto_pull: z.ZodOptional<z.ZodBoolean>;
206
- };
207
- execute(args: {
208
- auto_pull?: boolean | undefined;
209
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
210
- };
211
- /**
212
- * Link a bead to an Agent Mail thread
213
- */
214
- export declare const beads_link_thread: {
215
- description: string;
216
- args: {
217
- bead_id: z.ZodString;
218
- thread_id: z.ZodString;
219
- };
220
- execute(args: {
221
- bead_id: string;
222
- thread_id: string;
223
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
224
- };
225
- export declare const beadsTools: {
226
- beads_create: {
227
- description: string;
228
- args: {
229
- title: z.ZodString;
230
- type: z.ZodOptional<z.ZodEnum<{
231
- bug: "bug";
232
- feature: "feature";
233
- task: "task";
234
- epic: "epic";
235
- chore: "chore";
236
- }>>;
237
- priority: z.ZodOptional<z.ZodNumber>;
238
- description: z.ZodOptional<z.ZodString>;
239
- parent_id: z.ZodOptional<z.ZodString>;
240
- };
241
- execute(args: {
242
- title: string;
243
- type?: "bug" | "feature" | "task" | "epic" | "chore" | undefined;
244
- priority?: number | undefined;
245
- description?: string | undefined;
246
- parent_id?: string | undefined;
247
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
248
- };
249
- beads_create_epic: {
250
- description: string;
251
- args: {
252
- epic_title: z.ZodString;
253
- epic_description: z.ZodOptional<z.ZodString>;
254
- epic_id: z.ZodOptional<z.ZodString>;
255
- subtasks: z.ZodArray<z.ZodObject<{
256
- title: z.ZodString;
257
- priority: z.ZodOptional<z.ZodNumber>;
258
- files: z.ZodOptional<z.ZodArray<z.ZodString>>;
259
- id_suffix: z.ZodOptional<z.ZodString>;
260
- }, z.core.$strip>>;
261
- strategy: z.ZodOptional<z.ZodEnum<{
262
- "file-based": "file-based";
263
- "feature-based": "feature-based";
264
- "risk-based": "risk-based";
265
- }>>;
266
- task: z.ZodOptional<z.ZodString>;
267
- project_key: z.ZodOptional<z.ZodString>;
268
- recovery_context: z.ZodOptional<z.ZodObject<{
269
- shared_context: z.ZodOptional<z.ZodString>;
270
- skills_to_load: z.ZodOptional<z.ZodArray<z.ZodString>>;
271
- coordinator_notes: z.ZodOptional<z.ZodString>;
272
- }, z.core.$strip>>;
273
- };
274
- execute(args: {
275
- epic_title: string;
276
- subtasks: {
277
- title: string;
278
- priority?: number | undefined;
279
- files?: string[] | undefined;
280
- id_suffix?: string | undefined;
281
- }[];
282
- epic_description?: string | undefined;
283
- epic_id?: string | undefined;
284
- strategy?: "file-based" | "feature-based" | "risk-based" | undefined;
285
- task?: string | undefined;
286
- project_key?: string | undefined;
287
- recovery_context?: {
288
- shared_context?: string | undefined;
289
- skills_to_load?: string[] | undefined;
290
- coordinator_notes?: string | undefined;
291
- } | undefined;
292
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
293
- };
294
- beads_query: {
295
- description: string;
296
- args: {
297
- status: z.ZodOptional<z.ZodEnum<{
298
- open: "open";
299
- in_progress: "in_progress";
300
- blocked: "blocked";
301
- closed: "closed";
302
- }>>;
303
- type: z.ZodOptional<z.ZodEnum<{
304
- bug: "bug";
305
- feature: "feature";
306
- task: "task";
307
- epic: "epic";
308
- chore: "chore";
309
- }>>;
310
- ready: z.ZodOptional<z.ZodBoolean>;
311
- limit: z.ZodOptional<z.ZodNumber>;
312
- };
313
- execute(args: {
314
- status?: "open" | "in_progress" | "blocked" | "closed" | undefined;
315
- type?: "bug" | "feature" | "task" | "epic" | "chore" | undefined;
316
- ready?: boolean | undefined;
317
- limit?: number | undefined;
318
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
319
- };
320
- beads_update: {
321
- description: string;
322
- args: {
323
- id: z.ZodString;
324
- status: z.ZodOptional<z.ZodEnum<{
325
- open: "open";
326
- in_progress: "in_progress";
327
- blocked: "blocked";
328
- closed: "closed";
329
- }>>;
330
- description: z.ZodOptional<z.ZodString>;
331
- priority: z.ZodOptional<z.ZodNumber>;
332
- };
333
- execute(args: {
334
- id: string;
335
- status?: "open" | "in_progress" | "blocked" | "closed" | undefined;
336
- description?: string | undefined;
337
- priority?: number | undefined;
338
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
339
- };
340
- beads_close: {
341
- description: string;
342
- args: {
343
- id: z.ZodString;
344
- reason: z.ZodString;
345
- };
346
- execute(args: {
347
- id: string;
348
- reason: string;
349
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
350
- };
351
- beads_start: {
352
- description: string;
353
- args: {
354
- id: z.ZodString;
355
- };
356
- execute(args: {
357
- id: string;
358
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
359
- };
360
- beads_ready: {
361
- description: string;
362
- args: {};
363
- execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
364
- };
365
- beads_sync: {
366
- description: string;
367
- args: {
368
- auto_pull: z.ZodOptional<z.ZodBoolean>;
369
- };
370
- execute(args: {
371
- auto_pull?: boolean | undefined;
372
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
373
- };
374
- beads_link_thread: {
375
- description: string;
376
- args: {
377
- bead_id: z.ZodString;
378
- thread_id: z.ZodString;
379
- };
380
- execute(args: {
381
- bead_id: string;
382
- thread_id: string;
383
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
384
- };
385
- };
386
- //# sourceMappingURL=beads.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"beads.d.ts","sourceRoot":"","sources":["../src/beads.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OA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