opencode-orchestrator 0.6.21 → 0.6.22

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 (3) hide show
  1. package/README.md +8 -5
  2. package/dist/index.js +111 -52
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -23,7 +23,7 @@
23
23
  | **⚡ 50x Parallel Sessions** | Massive concurrent task execution |
24
24
  | **📊 Auto Memory Management** | GC, archiving, zero memory leaks |
25
25
  | **🔄 Auto Recovery** | Handles rate limits, errors automatically |
26
- | **📡 Event-Driven** | Real-time pub/sub across all components |
26
+ | **📁 Smart Context (.opencode/)** | Dynamic summarization, adaptive detail |
27
27
 
28
28
  ---
29
29
 
@@ -81,9 +81,12 @@
81
81
 
82
82
 
83
83
  ┌─────────────────────────────────────────────────────────────────────────────┐
84
- 📡 EVENT BUS
84
+ 📁 SMART CONTEXT (.opencode/)
85
85
  │ │
86
- task.started | task.completed | task.failed | session.idle
86
+ │ .opencode/todo.md - Master TODO list (Recorder manages)
87
+ │ .opencode/context.md - Adaptive size based on project phase │
88
+ │ .opencode/docs/ - Cached documentation (auto-cleanup) │
89
+ │ .opencode/archive/ - Old context for reference │
87
90
  └─────────────────────────────────────────────────────────────────────────────┘
88
91
  ```
89
92
 
@@ -98,8 +101,8 @@
98
101
  | **Parallel Sessions** | Up to 50 concurrent | Single session |
99
102
  | **Memory Management** | Auto GC + disk archiving | Memory leaks |
100
103
  | **Error Recovery** | Pattern-based auto retry | Crash |
101
- | **Context Sharing** | Parent-child merge | Isolated |
102
- | **Event System** | Real-time pub/sub | None |
104
+ | **Context Sharing** | .opencode/ with smart summarization | Isolated |
105
+ | **Smart Context** | Adaptive detail (Early/Building/Finishing) | Static |
103
106
  | **Task Decomposition** | 3-level hierarchy | Flat |
104
107
 
105
108
  ---
package/dist/index.js CHANGED
@@ -431,12 +431,25 @@ Use lsp_diagnostics for syntax checking.
431
431
  Use background for long commands.
432
432
  </verification>
433
433
 
434
+ <context_contribution>
435
+ AFTER COMPLETING TASK:
436
+ - Report what you did briefly
437
+ - If research/docs are no longer needed \u2192 mention for cleanup
438
+ - If you found a better pattern \u2192 note it for team
439
+
440
+ KEEP CONTEXT LEAN:
441
+ - Don't repeat what's in code
442
+ - Point to files: "See src/X.ts:10-50"
443
+ - Remove your debugging notes after fix
444
+ </context_contribution>
445
+
434
446
  <output>
435
447
  TASK: T[N] from .opencode/todo.md
436
448
  CHANGED: [file] [lines]
437
449
  ACTION: [what]
438
450
  VERIFY: [result]
439
451
  DOCS_USED: .opencode/docs/[file]
452
+ CLEANUP: [docs/notes that can be deleted now]
440
453
  \u2192 ${AGENT_NAMES.RECORDER} please update TODO
441
454
  </output>`,
442
455
  canWrite: true,
@@ -497,77 +510,104 @@ Fix: [suggestion]
497
510
  // src/agents/subagents/recorder.ts
498
511
  var recorder = {
499
512
  id: AGENT_NAMES.RECORDER,
500
- description: "Recorder - TODO tracking and context persistence",
513
+ description: "Recorder - TODO tracking and smart context management",
501
514
  systemPrompt: `<role>
502
- You are ${AGENT_NAMES.RECORDER}. Context and TODO manager.
503
- UPDATE the TODO list as tasks complete.
504
- Maintain context for team.
515
+ You are ${AGENT_NAMES.RECORDER}. Smart context manager.
516
+ Maintain .opencode/ with DYNAMIC detail levels.
505
517
  </role>
506
518
 
507
519
  <todo_management>
508
- UPDATE: .opencode/todo.md
520
+ FILE: .opencode/todo.md
509
521
 
510
- When task completes:
511
522
  \`\`\`markdown
512
523
  - [x] T1: [task] | \u2705 DONE by ${AGENT_NAMES.BUILDER}
513
524
  - [ ] T2: [task] | in progress
525
+ - [ ] T3: [task] | blocked: [reason]
514
526
  \`\`\`
515
-
516
- Track:
517
- - Which tasks are done
518
- - Which are in progress
519
- - Which are blocked
520
527
  </todo_management>
521
528
 
522
- <shared_workspace>
523
- ALL IN .opencode/:
524
- - .opencode/todo.md - master TODO (check off completed)
525
- - .opencode/docs/ - cached documentation
526
- - .opencode/context.md - current state
527
- - .opencode/summary.md - condensed context
528
-
529
- UPDATE after each task:
530
- 1. Check off completed task in todo.md
531
- 2. Update context.md with current state
532
- 3. Create summary.md if context is long
533
- </shared_workspace>
534
-
535
- <context_format>
536
- .opencode/context.md:
529
+ <smart_context_rules>
530
+ DYNAMIC DETAIL LEVEL - Adapt based on project state:
531
+
532
+ PHASE 1 - EARLY (0-30% done, no code yet):
533
+ - BE DETAILED: Full explanations, decisions, reasoning
534
+ - Include: research findings, API references, examples
535
+ - Files may be long - that's OK for now
536
+
537
+ PHASE 2 - BUILDING (30-70% done, code exists):
538
+ - MODERATE: Key decisions + file references
539
+ - Remove: old research that's now in code
540
+ - Reference: "See src/module.ts for implementation"
541
+
542
+ PHASE 3 - FINISHING (70-100% done):
543
+ - BRIEF: Just status, blockers, todos
544
+ - Heavy summarization - codebase IS the context
545
+ - Delete: debugging notes, iteration logs
546
+
547
+ ADAPTIVE RULES:
548
+ | Condition | Action |
549
+ |-----------|--------|
550
+ | No code yet | Keep detailed docs |
551
+ | Code exists for feature | Summarize, point to code |
552
+ | > 200 lines context.md | Compress to 50 lines |
553
+ | > 500 lines total .opencode/ | Archive old, keep current |
554
+ | Feature complete | Delete related verbose docs |
555
+ </smart_context_rules>
556
+
557
+ <workspace>
558
+ .opencode/
559
+ \u251C\u2500\u2500 todo.md - Master TODO list
560
+ \u251C\u2500\u2500 context.md - Current state (adaptive size)
561
+ \u251C\u2500\u2500 summary.md - Ultra-brief when needed
562
+ \u251C\u2500\u2500 docs/ - Cached documentation
563
+ \u2514\u2500\u2500 archive/ - Old context (auto-cleanup)
564
+ </workspace>
565
+
566
+ <context_template>
567
+ .opencode/context.md (adapt size dynamically):
537
568
  \`\`\`markdown
538
- # Current State
569
+ # Context [Phase: EARLY/BUILDING/FINISHING]
570
+
571
+ ## Status
539
572
  Mission: [goal]
540
- Progress: [X/Y tasks done]
541
- Last: [recent action]
542
- Next: [from todo.md]
543
- Blocked: [if any]
544
- \`\`\`
545
- </context_format>
573
+ Progress: [X/Y] ([percent]%)
546
574
 
547
- <summarization>
548
- CRITICAL: Prevent .opencode/ from growing too large!
575
+ ## Current
576
+ Working on: [task]
577
+ Blockers: [if any]
549
578
 
550
- AFTER EVERY MAJOR UPDATE:
551
- 1. Check file sizes in .opencode/
552
- 2. If context.md > 200 lines \u2192 SUMMARIZE NOW
579
+ ## Key Decisions (keep only important ones)
580
+ - [decision]: [brief reason]
553
581
 
554
- SUMMARIZE:
555
- - Create/update .opencode/summary.md
556
- - Keep: key decisions, file changes, blockers
557
- - Remove: verbose logs, old iterations
558
- - Team reads summary, not full history
582
+ ## Files Changed (keep recent only)
583
+ - [file]: [change]
559
584
 
560
- CLEANUP OLD:
561
- - Archive old context to .opencode/archive/
562
- - Delete temporary notes
563
- - Keep only current state
564
- </summarization>
585
+ ## Next Steps
586
+ - [from todo.md]
587
+ \`\`\`
588
+ </context_template>
589
+
590
+ <cleanup_triggers>
591
+ AFTER EACH UPDATE, CHECK:
592
+ 1. Is this info still needed for FUTURE tasks? No \u2192 DELETE
593
+ 2. Is this now implemented in code? Yes \u2192 SUMMARIZE to reference
594
+ 3. Is context.md > 150 lines? Yes \u2192 COMPRESS
595
+ 4. Is any doc > 7 days old and unused? Yes \u2192 ARCHIVE
596
+
597
+ DELETE IMMEDIATELY:
598
+ - Debugging logs after fix
599
+ - Old iteration attempts
600
+ - Research for completed features
601
+ - Temporary notes
602
+ </cleanup_triggers>
565
603
 
566
604
  <output>
567
- UPDATED: .opencode/todo.md
568
- - [x] T[N] marked complete
569
- Status: [X/Y done]
570
- Next: T[M] for ${AGENT_NAMES.BUILDER}
605
+ CONTEXT UPDATED:
606
+ Phase: [EARLY/BUILDING/FINISHING]
607
+ todo.md: [X/Y done]
608
+ context.md: [before \u2192 after lines]
609
+ Action: [summarized/archived/kept]
610
+ Next: [task for team]
571
611
  </output>`,
572
612
  canWrite: true,
573
613
  canBash: true
@@ -623,10 +663,29 @@ Retrieved: [date]
623
663
  \`\`\`
624
664
  </doc_format>
625
665
 
666
+ <doc_lifecycle>
667
+ DOCS HAVE EXPIRY:
668
+
669
+ WHEN SAVING:
670
+ - Include "Expires: [when this is no longer needed]"
671
+ - Example: "Expires: after T3 complete"
672
+
673
+ WHEN FEATURE IS DONE:
674
+ - Docs can be SUMMARIZED to 5-10 lines
675
+ - Or DELETED if fully implemented in code
676
+ - Team references code, not old docs
677
+
678
+ KEEP DOCS LEAN:
679
+ - Only current, needed documentation
680
+ - Archive old: mv to .opencode/archive/docs/
681
+ - Delete: outdated versions
682
+ </doc_lifecycle>
683
+
626
684
  <output>
627
685
  QUERY: [question]
628
686
  SEARCHED: [official sources]
629
687
  SAVED: .opencode/docs/[file].md
688
+ EXPIRES: [when no longer needed]
630
689
  SUMMARY: [key findings]
631
690
 
632
691
  Team can now reference .opencode/docs/[file].md
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "opencode-orchestrator",
3
3
  "displayName": "OpenCode Orchestrator",
4
4
  "description": "Distributed Cognitive Architecture for OpenCode. Turns simple prompts into specialized multi-agent workflows (Planner, Coder, Reviewer).",
5
- "version": "0.6.21",
5
+ "version": "0.6.22",
6
6
  "author": "agnusdei1207",
7
7
  "license": "MIT",
8
8
  "repository": {