opencode-swarm-plugin 0.34.0 → 0.36.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.
- package/.turbo/turbo-test.log +333 -333
- package/CHANGELOG.md +97 -0
- package/bin/swarm.test.ts +70 -0
- package/bin/swarm.ts +139 -14
- package/examples/plugin-wrapper-template.ts +447 -33
- package/package.json +1 -1
- package/src/compaction-hook.test.ts +226 -258
- package/src/compaction-hook.ts +361 -16
- package/src/eval-capture.ts +5 -6
- package/src/index.ts +21 -1
- package/src/learning.integration.test.ts +0 -2
- package/src/schemas/task.ts +0 -1
- package/src/swarm-decompose.ts +1 -15
- package/src/swarm-prompts.ts +1 -8
- package/src/swarm.integration.test.ts +0 -40
|
@@ -79,7 +79,6 @@ describe("swarm_decompose", () => {
|
|
|
79
79
|
const result = await swarm_decompose.execute(
|
|
80
80
|
{
|
|
81
81
|
task: "Add user authentication with OAuth",
|
|
82
|
-
max_subtasks: 3,
|
|
83
82
|
},
|
|
84
83
|
mockContext,
|
|
85
84
|
);
|
|
@@ -97,7 +96,6 @@ describe("swarm_decompose", () => {
|
|
|
97
96
|
const result = await swarm_decompose.execute(
|
|
98
97
|
{
|
|
99
98
|
task: "Refactor the API routes",
|
|
100
|
-
max_subtasks: 5,
|
|
101
99
|
context: "Using Next.js App Router with RSC",
|
|
102
100
|
},
|
|
103
101
|
mockContext,
|
|
@@ -109,20 +107,6 @@ describe("swarm_decompose", () => {
|
|
|
109
107
|
expect(parsed.prompt).toContain("Additional Context");
|
|
110
108
|
});
|
|
111
109
|
|
|
112
|
-
it("uses default max_subtasks when not provided", async () => {
|
|
113
|
-
const result = await swarm_decompose.execute(
|
|
114
|
-
{
|
|
115
|
-
task: "Simple task",
|
|
116
|
-
max_subtasks: 5, // Explicit default since schema requires it
|
|
117
|
-
},
|
|
118
|
-
mockContext,
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
const parsed = JSON.parse(result);
|
|
122
|
-
|
|
123
|
-
// Prompt should say "as many as needed" (max_subtasks no longer in template)
|
|
124
|
-
expect(parsed.prompt).toContain("as many as needed");
|
|
125
|
-
});
|
|
126
110
|
});
|
|
127
111
|
|
|
128
112
|
// ============================================================================
|
|
@@ -262,7 +246,6 @@ describe("swarm_plan_prompt", () => {
|
|
|
262
246
|
const result = await swarm_plan_prompt.execute(
|
|
263
247
|
{
|
|
264
248
|
task: "Add user settings page",
|
|
265
|
-
max_subtasks: 3,
|
|
266
249
|
query_cass: false, // Disable CASS to isolate test
|
|
267
250
|
},
|
|
268
251
|
mockContext,
|
|
@@ -281,7 +264,6 @@ describe("swarm_plan_prompt", () => {
|
|
|
281
264
|
{
|
|
282
265
|
task: "Do something",
|
|
283
266
|
strategy: "risk-based",
|
|
284
|
-
max_subtasks: 3,
|
|
285
267
|
query_cass: false,
|
|
286
268
|
},
|
|
287
269
|
mockContext,
|
|
@@ -296,7 +278,6 @@ describe("swarm_plan_prompt", () => {
|
|
|
296
278
|
const result = await swarm_plan_prompt.execute(
|
|
297
279
|
{
|
|
298
280
|
task: "Refactor the codebase",
|
|
299
|
-
max_subtasks: 4,
|
|
300
281
|
query_cass: false,
|
|
301
282
|
},
|
|
302
283
|
mockContext,
|
|
@@ -314,7 +295,6 @@ describe("swarm_plan_prompt", () => {
|
|
|
314
295
|
const result = await swarm_plan_prompt.execute(
|
|
315
296
|
{
|
|
316
297
|
task: "Build new feature",
|
|
317
|
-
max_subtasks: 3,
|
|
318
298
|
query_cass: false,
|
|
319
299
|
},
|
|
320
300
|
mockContext,
|
|
@@ -330,7 +310,6 @@ describe("swarm_plan_prompt", () => {
|
|
|
330
310
|
const result = await swarm_plan_prompt.execute(
|
|
331
311
|
{
|
|
332
312
|
task: "Some task",
|
|
333
|
-
max_subtasks: 5,
|
|
334
313
|
query_cass: false,
|
|
335
314
|
},
|
|
336
315
|
mockContext,
|
|
@@ -350,7 +329,6 @@ describe("swarm_plan_prompt", () => {
|
|
|
350
329
|
const result = await swarm_plan_prompt.execute(
|
|
351
330
|
{
|
|
352
331
|
task: "Add feature",
|
|
353
|
-
max_subtasks: 3,
|
|
354
332
|
},
|
|
355
333
|
mockContext,
|
|
356
334
|
);
|
|
@@ -375,7 +353,6 @@ describe("swarm_plan_prompt", () => {
|
|
|
375
353
|
const result = await swarm_plan_prompt.execute(
|
|
376
354
|
{
|
|
377
355
|
task: "Add user profile",
|
|
378
|
-
max_subtasks: 3,
|
|
379
356
|
context: "We use Next.js App Router with server components",
|
|
380
357
|
query_cass: false,
|
|
381
358
|
},
|
|
@@ -387,19 +364,6 @@ describe("swarm_plan_prompt", () => {
|
|
|
387
364
|
expect(parsed.prompt).toContain("server components");
|
|
388
365
|
});
|
|
389
366
|
|
|
390
|
-
it("includes max_subtasks in prompt", async () => {
|
|
391
|
-
const result = await swarm_plan_prompt.execute(
|
|
392
|
-
{
|
|
393
|
-
task: "Build something",
|
|
394
|
-
max_subtasks: 7,
|
|
395
|
-
query_cass: false,
|
|
396
|
-
},
|
|
397
|
-
mockContext,
|
|
398
|
-
);
|
|
399
|
-
const parsed = JSON.parse(result);
|
|
400
|
-
|
|
401
|
-
expect(parsed.prompt).toContain("as many as needed");
|
|
402
|
-
});
|
|
403
367
|
});
|
|
404
368
|
|
|
405
369
|
describe("swarm_validate_decomposition", () => {
|
|
@@ -920,7 +884,6 @@ describe("full swarm flow (integration)", () => {
|
|
|
920
884
|
const decomposeResult = await swarm_decompose.execute(
|
|
921
885
|
{
|
|
922
886
|
task: "Add unit tests for auth module",
|
|
923
|
-
max_subtasks: 2,
|
|
924
887
|
},
|
|
925
888
|
ctx,
|
|
926
889
|
);
|
|
@@ -1228,7 +1191,6 @@ describe("swarm_init", () => {
|
|
|
1228
1191
|
const result = await swarm_decompose.execute(
|
|
1229
1192
|
{
|
|
1230
1193
|
task: "Add user authentication",
|
|
1231
|
-
max_subtasks: 3,
|
|
1232
1194
|
query_cass: true, // Request CASS but it may not be available
|
|
1233
1195
|
},
|
|
1234
1196
|
mockContext,
|
|
@@ -1249,7 +1211,6 @@ describe("swarm_init", () => {
|
|
|
1249
1211
|
const result = await swarm_decompose.execute(
|
|
1250
1212
|
{
|
|
1251
1213
|
task: "Add user authentication",
|
|
1252
|
-
max_subtasks: 3,
|
|
1253
1214
|
query_cass: false, // Explicitly skip CASS
|
|
1254
1215
|
},
|
|
1255
1216
|
mockContext,
|
|
@@ -1264,7 +1225,6 @@ describe("swarm_init", () => {
|
|
|
1264
1225
|
const result = await swarm_decompose.execute(
|
|
1265
1226
|
{
|
|
1266
1227
|
task: "Build feature X",
|
|
1267
|
-
max_subtasks: 3,
|
|
1268
1228
|
},
|
|
1269
1229
|
mockContext,
|
|
1270
1230
|
);
|