opencode-swarm-plugin 0.30.6 → 0.31.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/.hive/memories.jsonl +10 -0
- package/.turbo/turbo-build.log +3 -3
- package/.turbo/turbo-test.log +339 -339
- package/CHANGELOG.md +103 -0
- package/dist/hive.d.ts.map +1 -1
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +241 -49
- package/dist/memory-tools.d.ts +4 -0
- package/dist/memory-tools.d.ts.map +1 -1
- package/dist/memory.d.ts +2 -0
- package/dist/memory.d.ts.map +1 -1
- package/dist/model-selection.d.ts +37 -0
- package/dist/model-selection.d.ts.map +1 -0
- package/dist/plugin.js +241 -49
- package/dist/schemas/task.d.ts +2 -0
- package/dist/schemas/task.d.ts.map +1 -1
- package/dist/swarm-decompose.d.ts +8 -8
- package/dist/swarm-decompose.d.ts.map +1 -1
- package/dist/swarm-orchestrate.d.ts.map +1 -1
- package/dist/swarm-prompts.d.ts +11 -7
- package/dist/swarm-prompts.d.ts.map +1 -1
- package/dist/swarm.d.ts +8 -6
- package/dist/swarm.d.ts.map +1 -1
- package/opencode-swarm-plugin-0.30.7.tgz +0 -0
- package/package.json +2 -2
- package/src/hive.integration.test.ts +332 -3
- package/src/hive.ts +171 -13
- package/src/memory-tools.ts +5 -1
- package/src/memory.ts +9 -0
- package/src/swarm-decompose.ts +7 -11
- package/src/swarm-orchestrate.ts +27 -1
- package/src/swarm-prompts.test.ts +12 -9
- package/src/swarm-prompts.ts +43 -19
- package/src/swarm.integration.test.ts +74 -4
|
@@ -1426,7 +1426,7 @@ describe("Swarm Prompt V2 (with Swarm Mail/Beads)", () => {
|
|
|
1426
1426
|
expect(SUBTASK_PROMPT_V2).toContain("semantic-memory_find");
|
|
1427
1427
|
expect(SUBTASK_PROMPT_V2).toContain("Query Past Learnings");
|
|
1428
1428
|
expect(SUBTASK_PROMPT_V2).toContain("BEFORE starting work");
|
|
1429
|
-
expect(SUBTASK_PROMPT_V2).toContain("
|
|
1429
|
+
expect(SUBTASK_PROMPT_V2).toContain("If you skip this step, you WILL waste time solving already-solved problems");
|
|
1430
1430
|
});
|
|
1431
1431
|
|
|
1432
1432
|
it("contains survival checklist: skills discovery and loading", () => {
|
|
@@ -1465,9 +1465,9 @@ describe("Swarm Prompt V2 (with Swarm Mail/Beads)", () => {
|
|
|
1465
1465
|
it("contains survival checklist: semantic-memory_store for learnings", () => {
|
|
1466
1466
|
// Step 8: Store discoveries and learnings
|
|
1467
1467
|
expect(SUBTASK_PROMPT_V2).toContain("semantic-memory_store");
|
|
1468
|
-
expect(SUBTASK_PROMPT_V2).toContain("
|
|
1469
|
-
expect(SUBTASK_PROMPT_V2).toContain("
|
|
1470
|
-
expect(SUBTASK_PROMPT_V2).toContain("
|
|
1468
|
+
expect(SUBTASK_PROMPT_V2).toContain("STORE YOUR LEARNINGS");
|
|
1469
|
+
expect(SUBTASK_PROMPT_V2).toContain("Solved a tricky bug");
|
|
1470
|
+
expect(SUBTASK_PROMPT_V2).toContain("The WHY matters more than the WHAT");
|
|
1471
1471
|
});
|
|
1472
1472
|
|
|
1473
1473
|
it("does NOT mention coordinator reserving files", () => {
|
|
@@ -2341,4 +2341,74 @@ describe("Contract Validation", () => {
|
|
|
2341
2341
|
expect(parsed.error).toBeUndefined();
|
|
2342
2342
|
});
|
|
2343
2343
|
});
|
|
2344
|
+
|
|
2345
|
+
describe("swarm_complete auto-sync", () => {
|
|
2346
|
+
it("calls hive_sync after closing cell on successful completion", async () => {
|
|
2347
|
+
const testProjectPath = "/tmp/swarm-auto-sync-test-" + Date.now();
|
|
2348
|
+
const { getHiveAdapter } = await import("./hive");
|
|
2349
|
+
const adapter = await getHiveAdapter(testProjectPath);
|
|
2350
|
+
|
|
2351
|
+
// Create a task cell directly
|
|
2352
|
+
const cell = await adapter.createCell(testProjectPath, {
|
|
2353
|
+
title: "Test task for auto-sync",
|
|
2354
|
+
type: "task",
|
|
2355
|
+
priority: 2,
|
|
2356
|
+
});
|
|
2357
|
+
|
|
2358
|
+
// Start the task
|
|
2359
|
+
await adapter.updateCell(testProjectPath, cell.id, {
|
|
2360
|
+
status: "in_progress",
|
|
2361
|
+
});
|
|
2362
|
+
|
|
2363
|
+
// Complete with skip_review and skip_verification
|
|
2364
|
+
const result = await swarm_complete.execute(
|
|
2365
|
+
{
|
|
2366
|
+
project_key: testProjectPath,
|
|
2367
|
+
agent_name: "TestAgent",
|
|
2368
|
+
bead_id: cell.id,
|
|
2369
|
+
summary: "Done - testing auto-sync",
|
|
2370
|
+
files_touched: [],
|
|
2371
|
+
skip_verification: true,
|
|
2372
|
+
skip_review: true,
|
|
2373
|
+
},
|
|
2374
|
+
mockContext,
|
|
2375
|
+
);
|
|
2376
|
+
|
|
2377
|
+
const parsed = JSON.parse(result);
|
|
2378
|
+
|
|
2379
|
+
// Should complete successfully
|
|
2380
|
+
expect(parsed.success).toBe(true);
|
|
2381
|
+
expect(parsed.closed).toBe(true);
|
|
2382
|
+
|
|
2383
|
+
// Check that cell is actually closed in database
|
|
2384
|
+
const closedCell = await adapter.getCell(testProjectPath, cell.id);
|
|
2385
|
+
expect(closedCell?.status).toBe("closed");
|
|
2386
|
+
|
|
2387
|
+
// The sync should have flushed the cell to .hive/issues.jsonl
|
|
2388
|
+
// We can verify the cell appears in the JSONL
|
|
2389
|
+
const hivePath = `${testProjectPath}/.hive/issues.jsonl`;
|
|
2390
|
+
const hiveFile = Bun.file(hivePath);
|
|
2391
|
+
const exists = await hiveFile.exists();
|
|
2392
|
+
|
|
2393
|
+
// The file should exist after sync
|
|
2394
|
+
expect(exists).toBe(true);
|
|
2395
|
+
|
|
2396
|
+
if (exists) {
|
|
2397
|
+
const content = await hiveFile.text();
|
|
2398
|
+
const lines = content.trim().split("\n");
|
|
2399
|
+
|
|
2400
|
+
// Should have at least one cell exported
|
|
2401
|
+
expect(lines.length).toBeGreaterThan(0);
|
|
2402
|
+
|
|
2403
|
+
// Parse the exported cells to find our closed cell
|
|
2404
|
+
const cells = lines.map((line) => JSON.parse(line));
|
|
2405
|
+
const exportedCell = cells.find((c) => c.id === cell.id);
|
|
2406
|
+
|
|
2407
|
+
// Our cell should be in the export
|
|
2408
|
+
expect(exportedCell).toBeDefined();
|
|
2409
|
+
expect(exportedCell.status).toBe("closed");
|
|
2410
|
+
expect(exportedCell.title).toBe("Test task for auto-sync");
|
|
2411
|
+
}
|
|
2412
|
+
});
|
|
2413
|
+
});
|
|
2344
2414
|
});
|