swarm-engine 1.3.0 → 1.41.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 (145) hide show
  1. package/README.md +45 -7
  2. package/dist/cli/commands/memory.js +117 -0
  3. package/dist/cli/commands/memory.js.map +1 -1
  4. package/dist/core/patterns.d.ts +7 -1
  5. package/dist/core/patterns.d.ts.map +1 -1
  6. package/dist/core/patterns.js +23 -0
  7. package/dist/core/patterns.js.map +1 -1
  8. package/dist/core/types.d.ts +39 -0
  9. package/dist/core/types.d.ts.map +1 -1
  10. package/dist/core/types.js.map +1 -1
  11. package/dist/index.d.ts +55 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +40 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/memory/index.d.ts +37 -0
  16. package/dist/memory/index.d.ts.map +1 -1
  17. package/dist/memory/index.js +91 -0
  18. package/dist/memory/index.js.map +1 -1
  19. package/dist/runtime/adaptive.d.ts +1 -0
  20. package/dist/runtime/adaptive.d.ts.map +1 -1
  21. package/dist/runtime/adaptive.js +18 -4
  22. package/dist/runtime/adaptive.js.map +1 -1
  23. package/dist/runtime/agent-runner.d.ts +18 -0
  24. package/dist/runtime/agent-runner.d.ts.map +1 -1
  25. package/dist/runtime/agent-runner.js +147 -4
  26. package/dist/runtime/agent-runner.js.map +1 -1
  27. package/dist/runtime/backends/claude-session.d.ts +49 -0
  28. package/dist/runtime/backends/claude-session.d.ts.map +1 -0
  29. package/dist/runtime/backends/claude-session.js +237 -0
  30. package/dist/runtime/backends/claude-session.js.map +1 -0
  31. package/dist/runtime/backends/claude.d.ts.map +1 -1
  32. package/dist/runtime/backends/claude.js +90 -4
  33. package/dist/runtime/backends/claude.js.map +1 -1
  34. package/dist/runtime/backends/types.d.ts +31 -1
  35. package/dist/runtime/backends/types.d.ts.map +1 -1
  36. package/dist/runtime/compaction.d.ts +7 -1
  37. package/dist/runtime/compaction.d.ts.map +1 -1
  38. package/dist/runtime/compaction.js +12 -2
  39. package/dist/runtime/compaction.js.map +1 -1
  40. package/dist/runtime/distiller.d.ts +1 -0
  41. package/dist/runtime/distiller.d.ts.map +1 -1
  42. package/dist/runtime/distiller.js +8 -2
  43. package/dist/runtime/distiller.js.map +1 -1
  44. package/dist/runtime/engine.d.ts +48 -2
  45. package/dist/runtime/engine.d.ts.map +1 -1
  46. package/dist/runtime/engine.js +600 -8
  47. package/dist/runtime/engine.js.map +1 -1
  48. package/dist/runtime/execution-graph.d.ts +86 -0
  49. package/dist/runtime/execution-graph.d.ts.map +1 -0
  50. package/dist/runtime/execution-graph.js +441 -0
  51. package/dist/runtime/execution-graph.js.map +1 -0
  52. package/dist/runtime/executor.d.ts +7 -1
  53. package/dist/runtime/executor.d.ts.map +1 -1
  54. package/dist/runtime/executor.js +20 -0
  55. package/dist/runtime/executor.js.map +1 -1
  56. package/dist/runtime/graph-adversarial.d.ts +88 -0
  57. package/dist/runtime/graph-adversarial.d.ts.map +1 -0
  58. package/dist/runtime/graph-adversarial.js +378 -0
  59. package/dist/runtime/graph-adversarial.js.map +1 -0
  60. package/dist/runtime/graph-analyzer.d.ts +106 -0
  61. package/dist/runtime/graph-analyzer.d.ts.map +1 -0
  62. package/dist/runtime/graph-analyzer.js +321 -0
  63. package/dist/runtime/graph-analyzer.js.map +1 -0
  64. package/dist/runtime/graph-causal.d.ts +91 -0
  65. package/dist/runtime/graph-causal.d.ts.map +1 -0
  66. package/dist/runtime/graph-causal.js +292 -0
  67. package/dist/runtime/graph-causal.js.map +1 -0
  68. package/dist/runtime/graph-context-router.d.ts +73 -0
  69. package/dist/runtime/graph-context-router.d.ts.map +1 -0
  70. package/dist/runtime/graph-context-router.js +162 -0
  71. package/dist/runtime/graph-context-router.js.map +1 -0
  72. package/dist/runtime/graph-discovery.d.ts +71 -0
  73. package/dist/runtime/graph-discovery.d.ts.map +1 -0
  74. package/dist/runtime/graph-discovery.js +364 -0
  75. package/dist/runtime/graph-discovery.js.map +1 -0
  76. package/dist/runtime/graph-dropout.d.ts +59 -0
  77. package/dist/runtime/graph-dropout.d.ts.map +1 -0
  78. package/dist/runtime/graph-dropout.js +204 -0
  79. package/dist/runtime/graph-dropout.js.map +1 -0
  80. package/dist/runtime/graph-embeddings.d.ts +58 -0
  81. package/dist/runtime/graph-embeddings.d.ts.map +1 -0
  82. package/dist/runtime/graph-embeddings.js +299 -0
  83. package/dist/runtime/graph-embeddings.js.map +1 -0
  84. package/dist/runtime/graph-feedback.d.ts +30 -0
  85. package/dist/runtime/graph-feedback.d.ts.map +1 -0
  86. package/dist/runtime/graph-feedback.js +80 -0
  87. package/dist/runtime/graph-feedback.js.map +1 -0
  88. package/dist/runtime/graph-gnn.d.ts +120 -0
  89. package/dist/runtime/graph-gnn.d.ts.map +1 -0
  90. package/dist/runtime/graph-gnn.js +524 -0
  91. package/dist/runtime/graph-gnn.js.map +1 -0
  92. package/dist/runtime/graph-learner.d.ts +70 -0
  93. package/dist/runtime/graph-learner.d.ts.map +1 -0
  94. package/dist/runtime/graph-learner.js +265 -0
  95. package/dist/runtime/graph-learner.js.map +1 -0
  96. package/dist/runtime/graph-meta-adversarial.d.ts +113 -0
  97. package/dist/runtime/graph-meta-adversarial.d.ts.map +1 -0
  98. package/dist/runtime/graph-meta-adversarial.js +366 -0
  99. package/dist/runtime/graph-meta-adversarial.js.map +1 -0
  100. package/dist/runtime/graph-meta.d.ts +115 -0
  101. package/dist/runtime/graph-meta.d.ts.map +1 -0
  102. package/dist/runtime/graph-meta.js +465 -0
  103. package/dist/runtime/graph-meta.js.map +1 -0
  104. package/dist/runtime/graph-self-evolve.d.ts +92 -0
  105. package/dist/runtime/graph-self-evolve.d.ts.map +1 -0
  106. package/dist/runtime/graph-self-evolve.js +422 -0
  107. package/dist/runtime/graph-self-evolve.js.map +1 -0
  108. package/dist/runtime/graph-synthesis.d.ts +47 -0
  109. package/dist/runtime/graph-synthesis.d.ts.map +1 -0
  110. package/dist/runtime/graph-synthesis.js +232 -0
  111. package/dist/runtime/graph-synthesis.js.map +1 -0
  112. package/dist/runtime/graph-trajectory.d.ts +88 -0
  113. package/dist/runtime/graph-trajectory.d.ts.map +1 -0
  114. package/dist/runtime/graph-trajectory.js +334 -0
  115. package/dist/runtime/graph-trajectory.js.map +1 -0
  116. package/dist/runtime/learning-engine.d.ts +12 -0
  117. package/dist/runtime/learning-engine.d.ts.map +1 -1
  118. package/dist/runtime/learning-engine.js +70 -0
  119. package/dist/runtime/learning-engine.js.map +1 -1
  120. package/dist/runtime/prompt-compressor.d.ts +16 -0
  121. package/dist/runtime/prompt-compressor.d.ts.map +1 -0
  122. package/dist/runtime/prompt-compressor.js +68 -0
  123. package/dist/runtime/prompt-compressor.js.map +1 -0
  124. package/dist/runtime/repo-map.d.ts +40 -0
  125. package/dist/runtime/repo-map.d.ts.map +1 -0
  126. package/dist/runtime/repo-map.js +358 -0
  127. package/dist/runtime/repo-map.js.map +1 -0
  128. package/dist/runtime/sdk-mcp-server.d.ts +44 -0
  129. package/dist/runtime/sdk-mcp-server.d.ts.map +1 -0
  130. package/dist/runtime/sdk-mcp-server.js +133 -0
  131. package/dist/runtime/sdk-mcp-server.js.map +1 -0
  132. package/dist/runtime/structured-handoff.d.ts +41 -0
  133. package/dist/runtime/structured-handoff.d.ts.map +1 -0
  134. package/dist/runtime/structured-handoff.js +279 -0
  135. package/dist/runtime/structured-handoff.js.map +1 -0
  136. package/dist/runtime/token-analytics.d.ts +38 -0
  137. package/dist/runtime/token-analytics.d.ts.map +1 -0
  138. package/dist/runtime/token-analytics.js +59 -0
  139. package/dist/runtime/token-analytics.js.map +1 -0
  140. package/dist/runtime/verifier.d.ts +10 -0
  141. package/dist/runtime/verifier.d.ts.map +1 -1
  142. package/dist/runtime/verifier.js +97 -1
  143. package/dist/runtime/verifier.js.map +1 -1
  144. package/package.json +2 -2
  145. package/skills/swarm-output-style/SKILL.md +71 -33
@@ -15,24 +15,24 @@ All orchestration output follows this guide. The goal: the user should always kn
15
15
 
16
16
  Show this BEFORE creating any team or spawning any agent. The user must approve before tokens are spent.
17
17
 
18
- ```
19
- ## Orchestration Plan
18
+ Use `swarm-box.py` for the header, then markdown tables for the detail:
20
19
 
21
- **Task**: [1-line description]
22
- **Pattern**: [pattern name] | **Phases**: [N] | **Agents**: [N] | **Est. cost**: ~$[amount] | **Est. time**: ~[duration]
20
+ ```bash
21
+ python3 ~/.claude/scripts/swarm-box.py <<'BOX'
22
+ title: SWARM ORCHESTRATION — [Task Name]
23
+ title: Pattern: [name] │ Repo: [repo]
24
+ title: [scope summary]
25
+ BOX
26
+ ```
23
27
 
24
- ### Phase 1: [Name] -- [parallel/sequential] (~[time], ~$[cost])
25
- | Agent | Model | Focus |
26
- |-------|-------|-------|
27
- | `agent-name` | [model] | [what this agent will do] |
28
+ Then show phase details as markdown tables:
28
29
 
29
- ### Phase 2: [Name] -- [parallel/sequential] (~[time], ~$[cost])
30
+ ```
31
+ ### Phase 1: [Name] -- [parallel/sequential] (~[time])
30
32
  | Agent | Model | Focus |
31
33
  |-------|-------|-------|
32
34
  | `agent-name` | [model] | [what this agent will do] |
33
35
 
34
- [repeat for all phases]
35
-
36
36
  Proceed?
37
37
  ```
38
38
 
@@ -45,12 +45,25 @@ Cost estimates use these rough defaults per agent type:
45
45
 
46
46
  ## 2. Phase Transition Banners
47
47
 
48
- At the start of each phase, show a clear banner with running totals:
48
+ **MANDATORY**: Use `python3 ~/.claude/scripts/swarm-box.py` via Bash tool for ALL box-drawing output. NEVER hand-draw boxes.
49
49
 
50
+ Phase start banner:
51
+ ```bash
52
+ python3 ~/.claude/scripts/swarm-box.py <<'BOX'
53
+ title: PHASE 1 · Research | ⏱ 0:00
54
+ 3 agents · sonnet · read-only
55
+ BOX
50
56
  ```
57
+
58
+ Phase completion summary:
59
+ ```bash
60
+ python3 ~/.claude/scripts/swarm-box.py <<'BOX'
61
+ title: PHASE 2 · Implement · COMPLETE | ⏱ ~10 min
51
62
  ---
52
- **Phase [N] / [total]: [Name]** -- [N] agent(s) [parallel/sequential]
53
- Running total: ~$[amount] | [elapsed] elapsed
63
+ implementer-core — 40 new tests, graph modules done
64
+ implementer-wiring — engine/runner/learner wired
65
+ ✓ implementer-docs — docs.html + llms-full.txt updated
66
+ BOX
54
67
  ```
55
68
 
56
69
  ## 3. Agent Completion Lines
@@ -113,34 +126,59 @@ Options:
113
126
 
114
127
  ## 6. Post-Completion Summary (MANDATORY)
115
128
 
116
- ```
129
+ **MANDATORY**: Use `python3 ~/.claude/scripts/swarm-box.py` via the Bash tool. NEVER hand-draw boxes — they will always be misaligned.
130
+
131
+ ### How to use swarm-box.py
132
+
133
+ Call via Bash tool with a heredoc. The script auto-pads all lines to identical display width.
134
+
135
+ ```bash
136
+ python3 ~/.claude/scripts/swarm-box.py <<'BOX'
137
+ title: ORCHESTRATION COMPLETE | STATUS: PASS
117
138
  ---
118
- ## Orchestration Complete -- [PASS / NEEDS ATTENTION / FAILED]
119
139
 
120
- **Pattern**: [name] | **Phases**: [N] | **Agents**: [N] | **Duration**: [time]
121
- **Tokens**: ~[total] | **Cost**: ~$[amount]
140
+ Phases: 4 │ Agents: 8 │ Duration: ~14 min
122
141
 
123
- ### What Changed
124
- [List files with brief descriptions. Include `git diff --stat` output if available.]
142
+ [What Changed]
143
+ 20 files changed, +3,838 lines
125
144
 
126
- ### Review Gate: [PASS / FAIL] ([Nth] iteration)
127
- | Reviewer | Result | Findings |
128
- |----------|--------|----------|
129
- | [name] | PASS/FAIL | [count] critical, [count] important, [count] suggestions |
145
+ Tests: 53 new (987 1041), 64 files, all green
146
+ Memory: purge, prune, get, delete CLI commands
147
+ Docs: Knowledge Graph section on swarmengine.dev
148
+ Version: 1.3.0 1.31.0
149
+ Branch: feat/execution-knowledge-graph → main
150
+ [/]
130
151
 
131
- ### Suggestions (non-blocking)
132
- - [suggestion with reviewer attribution]
152
+ [Review Gate]
153
+ reviewer-correctness PASS (2 important fixed)
154
+ reviewer-convention PASS (1 important → fixed)
155
+ fixer 6/6 findings resolved
156
+ [/]
133
157
 
134
- ### Knowledge Stored
135
- - [what was saved to memory, if anything]
158
+ Next: npm publish (run npm publish when ready)
136
159
 
137
- ---
138
- **Next steps:**
139
- - Review changes: `git diff HEAD`
140
- - Run tests: `npm test` (or project equivalent)
141
- - Run verification: type `/verify`
160
+ BOX
142
161
  ```
143
162
 
163
+ ### Input format
164
+
165
+ | Line type | Syntax | Renders as |
166
+ |-----------|--------|------------|
167
+ | Header | `title: TEXT` | `║ TEXT ║` (top of box) |
168
+ | Separator | `---` | `╠═══════╣` |
169
+ | Sub-box start | `[Label]` | `║ ┌─ Label ──┐ ║` |
170
+ | Sub-box end | `[/]` | `║ └──────────┘ ║` |
171
+ | Content (inside sub-box) | plain text | `║ │ text │ ║` |
172
+ | Content (outside sub-box) | plain text | `║ text ║` |
173
+ | Blank line | empty line | `║ ║` |
174
+
175
+ ### Rules
176
+
177
+ - **EVERY box in swarm output MUST be generated by `swarm-box.py`** — phase banners, completion summaries, pre-flight plan headers, error recovery boxes. No exceptions.
178
+ - The script guarantees all lines have identical display width (verified internally).
179
+ - Copy-paste the script output directly into your response.
180
+ - If the script is unavailable, fall back to markdown tables — never hand-draw box characters.
181
+
144
182
  ## Anti-Patterns (DO NOT)
145
183
 
146
184
  - Do NOT spawn agents before showing the pre-flight plan