opencode-swarm-plugin 0.30.6 → 0.30.7
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-build.log +2 -2
- package/.turbo/turbo-test.log +317 -317
- package/CHANGELOG.md +7 -0
- package/dist/hive.d.ts.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +134 -29
- 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 +134 -29
- package/dist/schemas/task.d.ts +2 -0
- package/dist/schemas/task.d.ts.map +1 -1
- package/dist/swarm-prompts.d.ts +5 -1
- package/dist/swarm-prompts.d.ts.map +1 -1
- package/dist/swarm.d.ts +2 -0
- package/dist/swarm.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/hive.ts +16 -2
- package/src/memory-tools.ts +5 -1
- package/src/memory.ts +9 -0
- package/src/swarm-prompts.test.ts +12 -9
- package/src/swarm-prompts.ts +38 -12
- package/src/swarm.integration.test.ts +4 -4
package/src/swarm-prompts.ts
CHANGED
|
@@ -406,21 +406,44 @@ swarm_checkpoint(
|
|
|
406
406
|
|
|
407
407
|
**Checkpoints preserve context so you can recover if things go wrong.**
|
|
408
408
|
|
|
409
|
-
### Step 8:
|
|
409
|
+
### Step 8: 💾 STORE YOUR LEARNINGS (if you discovered something)
|
|
410
|
+
|
|
411
|
+
**If you learned it the hard way, STORE IT so the next agent doesn't have to.**
|
|
412
|
+
|
|
410
413
|
\`\`\`
|
|
411
414
|
semantic-memory_store(
|
|
412
415
|
information="<what you learned, WHY it matters, how to apply it>",
|
|
413
|
-
|
|
416
|
+
tags="<domain, tech-stack, pattern-type>"
|
|
414
417
|
)
|
|
415
418
|
\`\`\`
|
|
416
419
|
|
|
417
|
-
**Store:**
|
|
418
|
-
-
|
|
419
|
-
-
|
|
420
|
-
-
|
|
421
|
-
-
|
|
420
|
+
**MANDATORY Storage Triggers - Store when you:**
|
|
421
|
+
- 🐛 **Solved a tricky bug** (>15min debugging) - include root cause + solution
|
|
422
|
+
- 💡 **Discovered a project-specific pattern** - domain rules, business logic quirks
|
|
423
|
+
- ⚠️ **Found a tool/library gotcha** - API quirks, version-specific bugs, workarounds
|
|
424
|
+
- 🚫 **Tried an approach that failed** - anti-patterns to avoid, why it didn't work
|
|
425
|
+
- 🏗️ **Made an architectural decision** - reasoning, alternatives considered, tradeoffs
|
|
426
|
+
|
|
427
|
+
**What Makes a GOOD Memory:**
|
|
422
428
|
|
|
423
|
-
**
|
|
429
|
+
✅ **GOOD** (actionable, explains WHY):
|
|
430
|
+
\`\`\`
|
|
431
|
+
"OAuth refresh tokens need 5min buffer before expiry to avoid race conditions.
|
|
432
|
+
Without buffer, token refresh can fail mid-request if expiry happens between
|
|
433
|
+
check and use. Implemented with: if (expiresAt - Date.now() < 300000) refresh()"
|
|
434
|
+
\`\`\`
|
|
435
|
+
|
|
436
|
+
❌ **BAD** (generic, no context):
|
|
437
|
+
\`\`\`
|
|
438
|
+
"Fixed the auth bug by adding a null check"
|
|
439
|
+
\`\`\`
|
|
440
|
+
|
|
441
|
+
**What NOT to Store:**
|
|
442
|
+
- Generic knowledge that's in official documentation
|
|
443
|
+
- Implementation details that change frequently
|
|
444
|
+
- Vague descriptions without context ("fixed the thing")
|
|
445
|
+
|
|
446
|
+
**The WHY matters more than the WHAT.** Future agents need context to apply your learning.
|
|
424
447
|
|
|
425
448
|
### Step 9: Complete (REQUIRED - releases reservations)
|
|
426
449
|
\`\`\`
|
|
@@ -511,17 +534,20 @@ Other cell operations:
|
|
|
511
534
|
|
|
512
535
|
**NON-NEGOTIABLE:**
|
|
513
536
|
1. Step 1 (swarmmail_init) MUST be first - do it before anything else
|
|
514
|
-
2. Step 2 (semantic-memory_find) MUST happen
|
|
537
|
+
2. 🧠 Step 2 (semantic-memory_find) MUST happen BEFORE starting work - query first, code second
|
|
515
538
|
3. Step 4 (swarmmail_reserve) - YOU reserve files, not coordinator
|
|
516
539
|
4. Step 6 (swarm_progress) - Report at milestones, don't work silently
|
|
517
|
-
5. Step
|
|
540
|
+
5. 💾 Step 8 (semantic-memory_store) - If you learned something hard, STORE IT
|
|
541
|
+
6. Step 9 (swarm_complete) - Use this to close, NOT hive_close
|
|
518
542
|
|
|
519
543
|
**If you skip these steps:**
|
|
520
544
|
- Your work won't be tracked (swarm_complete will fail)
|
|
521
|
-
- You'll waste time repeating solved problems (no semantic memory query)
|
|
545
|
+
- 🔄 You'll waste time repeating already-solved problems (no semantic memory query)
|
|
522
546
|
- Edit conflicts with other agents (no file reservation)
|
|
523
547
|
- Lost work if you crash (no checkpoints)
|
|
524
|
-
- Future agents repeat
|
|
548
|
+
- 🔄 Future agents repeat YOUR mistakes (no learnings stored)
|
|
549
|
+
|
|
550
|
+
**Memory is the swarm's collective intelligence. Query it. Feed it.**
|
|
525
551
|
|
|
526
552
|
Begin now.`;
|
|
527
553
|
|
|
@@ -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", () => {
|