@stackmemoryai/stackmemory 1.10.5 → 1.14.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 (225) hide show
  1. package/LICENSE +131 -64
  2. package/README.md +107 -24
  3. package/bin/claude-sm +16 -1
  4. package/bin/claude-smd +16 -1
  5. package/bin/codex-smd +16 -1
  6. package/bin/gemini-sm +16 -1
  7. package/bin/hermes-sm +21 -0
  8. package/bin/hermes-smd +21 -0
  9. package/bin/opencode-sm +16 -1
  10. package/dist/src/cli/claude-sm.js +266 -84
  11. package/dist/src/cli/codex-sm.js +225 -33
  12. package/dist/src/cli/commands/bench.js +209 -2
  13. package/dist/src/cli/commands/brain.js +206 -0
  14. package/dist/src/cli/commands/cache.js +126 -0
  15. package/dist/src/cli/commands/company-os.js +184 -0
  16. package/dist/src/cli/commands/context.js +5 -0
  17. package/dist/src/cli/commands/daemon.js +41 -0
  18. package/dist/src/cli/commands/handoff.js +40 -9
  19. package/dist/src/cli/commands/onboard.js +70 -3
  20. package/dist/src/cli/commands/operator.js +127 -0
  21. package/dist/src/cli/commands/optimize.js +117 -0
  22. package/dist/src/cli/commands/orchestrate.js +232 -5
  23. package/dist/src/cli/commands/orchestrator.js +315 -26
  24. package/dist/src/cli/commands/pack.js +322 -0
  25. package/dist/src/cli/commands/patterns.js +254 -0
  26. package/dist/src/cli/commands/portal.js +161 -0
  27. package/dist/src/cli/commands/scaffold.js +92 -0
  28. package/dist/src/cli/commands/search.js +40 -1
  29. package/dist/src/cli/commands/setup.js +178 -11
  30. package/dist/src/cli/commands/skills.js +10 -1
  31. package/dist/src/cli/commands/state.js +265 -0
  32. package/dist/src/cli/commands/sync.js +253 -0
  33. package/dist/src/cli/commands/tasks.js +130 -1
  34. package/dist/src/cli/commands/vision.js +221 -0
  35. package/dist/src/cli/gemini-sm.js +19 -29
  36. package/dist/src/cli/hermes-sm.js +224 -0
  37. package/dist/src/cli/index.js +105 -39
  38. package/dist/src/cli/opencode-sm.js +38 -21
  39. package/dist/src/cli/utils/determinism-watcher.js +66 -0
  40. package/dist/src/cli/utils/real-cli-bin.js +116 -0
  41. package/dist/src/core/brain/brain-store.js +187 -0
  42. package/dist/src/core/brain/brain-sync.js +193 -0
  43. package/dist/src/core/brain/index.js +78 -0
  44. package/dist/src/core/brain/types.js +10 -0
  45. package/dist/src/core/cache/content-cache.js +238 -0
  46. package/dist/src/{integrations/diffmem → core/cache}/index.js +5 -5
  47. package/dist/src/core/cache/token-estimator.js +39 -0
  48. package/dist/src/core/config/feature-flags.js +2 -6
  49. package/dist/src/core/context/frame-database.js +79 -27
  50. package/dist/src/core/context/recursive-context-manager.js +1 -1
  51. package/dist/src/core/context/rehydration.js +2 -1
  52. package/dist/src/core/cross-search/cross-project-search.js +269 -0
  53. package/dist/src/core/cross-search/index.js +10 -0
  54. package/dist/src/core/database/sqlite-adapter.js +14 -84
  55. package/dist/src/core/extensions/provider-adapter.js +5 -0
  56. package/dist/src/core/models/model-router.js +54 -2
  57. package/dist/src/core/models/provider-pricing.js +58 -4
  58. package/dist/src/core/monitoring/logger.js +2 -1
  59. package/dist/src/core/optimization/trace-optimizer.js +413 -0
  60. package/dist/src/core/patterns/index.js +22 -0
  61. package/dist/src/core/patterns/pattern-applier.js +39 -0
  62. package/dist/src/core/patterns/pattern-observer.js +157 -0
  63. package/dist/src/core/patterns/pattern-store.js +259 -0
  64. package/dist/src/core/patterns/types.js +19 -0
  65. package/dist/src/core/provenance/confidence-scorer.js +128 -0
  66. package/dist/src/core/provenance/index.js +40 -0
  67. package/dist/src/core/provenance/provenance-store.js +194 -0
  68. package/dist/src/core/provenance/types.js +82 -0
  69. package/dist/src/core/retrieval/llm-context-retrieval.js +5 -4
  70. package/dist/src/core/retrieval/unified-context-assembler.js +11 -66
  71. package/dist/src/core/session/project-handoff.js +64 -0
  72. package/dist/src/core/session/session-manager.js +28 -0
  73. package/dist/src/core/shared-state/canonical-store.js +564 -0
  74. package/dist/src/core/skill-packs/index.js +18 -0
  75. package/dist/src/core/skill-packs/parser.js +42 -0
  76. package/dist/src/core/skill-packs/registry.js +224 -0
  77. package/dist/src/core/skill-packs/types.js +79 -0
  78. package/dist/src/core/storage/cloud-sync-manager.js +116 -0
  79. package/dist/src/core/storage/cloud-sync.js +574 -0
  80. package/dist/src/core/storage/two-tier-storage.js +5 -1
  81. package/dist/src/core/tasks/master-tasks-template.js +43 -0
  82. package/dist/src/core/tasks/md-task-parser.js +138 -0
  83. package/dist/src/core/trace/trace-event-store.js +282 -0
  84. package/dist/src/core/vision/index.js +27 -0
  85. package/dist/src/core/vision/signals.js +79 -0
  86. package/dist/src/core/vision/types.js +22 -0
  87. package/dist/src/core/vision/vision-file.js +146 -0
  88. package/dist/src/core/vision/vision-loop.js +220 -0
  89. package/dist/src/core/wiki/wiki-compiler.js +103 -1
  90. package/dist/src/daemon/daemon-config.js +52 -0
  91. package/dist/src/daemon/services/desire-path-service.js +566 -0
  92. package/dist/src/daemon/services/github-service.js +126 -0
  93. package/dist/src/daemon/services/research-stream-service.js +320 -0
  94. package/dist/src/daemon/services/telemetry-service.js +192 -0
  95. package/dist/src/daemon/unified-daemon.js +58 -1
  96. package/dist/src/features/browser/cli-browser-agent.js +417 -0
  97. package/dist/src/features/browser/stagehand-workflows.js +578 -0
  98. package/dist/src/features/operator/adapter-factory.js +62 -0
  99. package/dist/src/features/operator/browser-adapter.js +109 -0
  100. package/dist/src/features/operator/desktop-adapter.js +125 -0
  101. package/dist/src/features/operator/index.js +39 -0
  102. package/dist/src/features/operator/llm-decision.js +137 -0
  103. package/dist/src/features/operator/operator-logger.js +92 -0
  104. package/dist/src/features/operator/overnight-runner.js +327 -0
  105. package/dist/src/features/operator/screen-adapter.js +91 -0
  106. package/dist/src/features/operator/session-manager.js +127 -0
  107. package/dist/src/features/operator/state-machine.js +227 -0
  108. package/dist/src/features/operator/task-queue.js +81 -0
  109. package/dist/src/features/portal/index.js +26 -0
  110. package/dist/src/features/portal/server.js +240 -0
  111. package/dist/src/features/portal/types.js +14 -0
  112. package/dist/src/features/portal/ui.js +195 -0
  113. package/dist/src/features/sweep/pty-wrapper.js +13 -5
  114. package/dist/src/features/tasks/task-aware-context.js +2 -1
  115. package/dist/src/features/tui/simple-monitor.js +0 -23
  116. package/dist/src/features/tui/swarm-monitor.js +8 -66
  117. package/dist/src/features/web/client/hooks/use-socket.js +12 -0
  118. package/dist/src/{core/merge/index.js → features/web/client/lib/utils.js} +8 -4
  119. package/dist/src/features/web/client/next-env.d.js +4 -0
  120. package/dist/src/features/web/client/stores/session-store.js +12 -0
  121. package/dist/src/features/web/server/gcp-billing.js +76 -0
  122. package/dist/src/features/web/server/index.js +10 -0
  123. package/dist/src/features/web/server/spend-calculator.js +228 -0
  124. package/dist/src/hooks/schemas.js +6 -1
  125. package/dist/src/integrations/anthropic/client.js +3 -2
  126. package/dist/src/integrations/claude-code/agent-bridge.js +0 -3
  127. package/dist/src/integrations/claude-code/subagent-client.js +307 -11
  128. package/dist/src/integrations/claude-code/task-coordinator.js +2 -1
  129. package/dist/src/integrations/github/pr-state.js +158 -0
  130. package/dist/src/integrations/linear/client.js +4 -1
  131. package/dist/src/integrations/linear/webhook-retry.js +196 -0
  132. package/dist/src/integrations/linear/webhook-server.js +18 -22
  133. package/dist/src/integrations/mcp/handlers/cloud-sync-handlers.js +101 -0
  134. package/dist/src/integrations/mcp/handlers/index.js +40 -84
  135. package/dist/src/integrations/mcp/server.js +542 -641
  136. package/dist/src/integrations/mcp/tool-alias-registry.js +297 -0
  137. package/dist/src/integrations/mcp/tool-definitions.js +152 -682
  138. package/dist/src/mcp/stackmemory-mcp-server.js +571 -231
  139. package/dist/src/orchestrators/multimodal/determinism.js +244 -0
  140. package/dist/src/orchestrators/multimodal/harness.js +149 -78
  141. package/dist/src/orchestrators/multimodal/providers.js +44 -3
  142. package/dist/src/skills/recursive-agent-orchestrator.js +2 -4
  143. package/dist/src/utils/hook-installer.js +0 -8
  144. package/dist/src/utils/process-cleanup.js +1 -7
  145. package/docs/README.md +42 -0
  146. package/docs/guides/README_INSTALL.md +208 -0
  147. package/package.json +27 -9
  148. package/packs/coding/python-fastapi/instructions.md +60 -0
  149. package/packs/coding/python-fastapi/pack.yaml +28 -0
  150. package/packs/coding/typescript-react/instructions.md +47 -0
  151. package/packs/coding/typescript-react/pack.yaml +28 -0
  152. package/packs/core/commands/capture.md +32 -0
  153. package/packs/core/commands/learn.md +73 -0
  154. package/packs/core/commands/next.md +36 -0
  155. package/packs/core/commands/restart.md +58 -0
  156. package/packs/core/commands/restore.md +29 -0
  157. package/packs/core/commands/start.md +57 -0
  158. package/packs/core/commands/stop.md +65 -0
  159. package/packs/core/commands/summary.md +40 -0
  160. package/packs/core/manifest.json +24 -0
  161. package/packs/ops/decision-recovery/instructions.md +65 -0
  162. package/packs/ops/decision-recovery/pack.yaml +89 -0
  163. package/scripts/claude-code-wrapper.sh +11 -0
  164. package/scripts/claude-sm-setup.sh +12 -1
  165. package/scripts/codex-wrapper.sh +11 -0
  166. package/scripts/git-hooks/branch-context-manager.sh +11 -0
  167. package/scripts/git-hooks/post-checkout-stackmemory.sh +11 -0
  168. package/scripts/git-hooks/post-commit-stackmemory.sh +11 -0
  169. package/scripts/git-hooks/pre-commit-stackmemory.sh +11 -0
  170. package/scripts/hooks/cleanup-shell.sh +12 -1
  171. package/scripts/hooks/task-complete.sh +12 -1
  172. package/scripts/install-code-execution-hooks.sh +12 -1
  173. package/scripts/install-sweep-hook.sh +12 -0
  174. package/scripts/install.sh +11 -0
  175. package/scripts/opencode-wrapper.sh +11 -0
  176. package/scripts/portal/cloud-init.yaml +69 -0
  177. package/scripts/portal/setup.sh +69 -0
  178. package/scripts/portal/stackmemory-portal.service +34 -0
  179. package/scripts/setup-claude-integration.sh +12 -1
  180. package/scripts/smoke-init-db.sh +23 -0
  181. package/scripts/stackmemory-daemon.sh +11 -0
  182. package/scripts/verify-dist.cjs +11 -4
  183. package/dist/src/cli/commands/ralph.js +0 -1053
  184. package/dist/src/cli/commands/team.js +0 -168
  185. package/dist/src/core/context/shared-context-layer.js +0 -620
  186. package/dist/src/core/context/stack-merge-resolver.js +0 -748
  187. package/dist/src/core/merge/conflict-detector.js +0 -430
  188. package/dist/src/core/merge/resolution-engine.js +0 -557
  189. package/dist/src/core/merge/stack-diff.js +0 -531
  190. package/dist/src/core/merge/unified-merge-resolver.js +0 -302
  191. package/dist/src/hooks/diffmem-hooks.js +0 -376
  192. package/dist/src/integrations/diffmem/client.js +0 -208
  193. package/dist/src/integrations/diffmem/config.js +0 -14
  194. package/dist/src/integrations/greptile/client.js +0 -101
  195. package/dist/src/integrations/greptile/config.js +0 -14
  196. package/dist/src/integrations/greptile/index.js +0 -11
  197. package/dist/src/integrations/mcp/handlers/cord-handlers.js +0 -397
  198. package/dist/src/integrations/mcp/handlers/diffmem-handlers.js +0 -455
  199. package/dist/src/integrations/mcp/handlers/greptile-handlers.js +0 -456
  200. package/dist/src/integrations/mcp/handlers/provider-handlers.js +0 -227
  201. package/dist/src/integrations/mcp/handlers/team-handlers.js +0 -211
  202. package/dist/src/integrations/ralph/bridge/ralph-stackmemory-bridge.js +0 -863
  203. package/dist/src/integrations/ralph/context/context-budget-manager.js +0 -308
  204. package/dist/src/integrations/ralph/context/stackmemory-context-loader.js +0 -391
  205. package/dist/src/integrations/ralph/index.js +0 -17
  206. package/dist/src/integrations/ralph/learning/pattern-learner.js +0 -435
  207. package/dist/src/integrations/ralph/lifecycle/iteration-lifecycle.js +0 -448
  208. package/dist/src/integrations/ralph/loopmax.js +0 -488
  209. package/dist/src/integrations/ralph/monitoring/swarm-dashboard.js +0 -293
  210. package/dist/src/integrations/ralph/monitoring/swarm-registry.js +0 -107
  211. package/dist/src/integrations/ralph/orchestration/multi-loop-orchestrator.js +0 -508
  212. package/dist/src/integrations/ralph/patterns/compounding-engineering-pattern.js +0 -407
  213. package/dist/src/integrations/ralph/patterns/extended-coherence-sessions.js +0 -495
  214. package/dist/src/integrations/ralph/patterns/oracle-worker-pattern.js +0 -387
  215. package/dist/src/integrations/ralph/performance/performance-optimizer.js +0 -357
  216. package/dist/src/integrations/ralph/recovery/crash-recovery.js +0 -461
  217. package/dist/src/integrations/ralph/state/state-reconciler.js +0 -420
  218. package/dist/src/integrations/ralph/swarm/git-workflow-manager.js +0 -444
  219. package/dist/src/integrations/ralph/swarm/swarm-coordinator.js +0 -1007
  220. package/dist/src/integrations/ralph/visualization/ralph-debugger.js +0 -635
  221. package/scripts/ralph-loop-implementation.js +0 -404
  222. /package/dist/src/core/{merge → cache}/types.js +0 -0
  223. /package/dist/src/{integrations/diffmem/types.js → core/storage/cloud-sync-types.js} +0 -0
  224. /package/dist/src/{integrations/greptile/types.js → core/trace/trace-event.js} +0 -0
  225. /package/dist/src/{integrations/ralph → features/operator}/types.js +0 -0
package/LICENSE CHANGED
@@ -1,64 +1,131 @@
1
- Business Source License 1.1
2
-
3
- Parameters
4
-
5
- Licensor: StackMemory AI
6
- Licensed Work: StackMemory v1.0.0
7
- The Licensed Work is (c) 2026 StackMemory AI
8
- Additional Use Grant: You may make production use of the Licensed Work,
9
- provided such use does not include offering the
10
- Licensed Work to third parties on a hosted or
11
- embedded basis which is competitive with StackMemory
12
- AI's products.
13
- Change Date: 2030-02-10
14
- Change License: MIT
15
-
16
- For information about alternative licensing arrangements for the Licensed
17
- Work, please contact: hello@stackmemory.ai
18
-
19
- Notice
20
-
21
- Business Source License 1.1
22
-
23
- Terms
24
-
25
- The Licensor hereby grants you the right to copy, modify, create
26
- derivative works, redistribute, and make non-production use of the
27
- Licensed Work. The Licensor may make an Additional Use Grant, above,
28
- permitting limited production use.
29
-
30
- Effective on the Change Date, or the fourth anniversary of the first
31
- publicly available distribution of a specific version of the Licensed
32
- Work under this License, whichever comes first, the Licensor hereby
33
- grants you rights under the terms of the Change License, and the rights
34
- granted in the paragraph above terminate.
35
-
36
- If your use of the Licensed Work does not comply with the requirements
37
- currently in effect as described in this License, you must purchase a
38
- commercial license from the Licensor, its affiliated entities, or
39
- authorized resellers, or you must refrain from using the Licensed Work.
40
-
41
- All copies of the original and modified Licensed Work, and derivative
42
- works of the Licensed Work, are subject to this License. This License
43
- applies separately for each version of the Licensed Work and the Change
44
- Date may vary for each version of the Licensed Work released by
45
- Licensor.
46
-
47
- You must conspicuously display this License on each original or modified
48
- copy of the Licensed Work. If you receive the Licensed Work in original
49
- or modified form from a third party, the terms and conditions set forth
50
- in this License apply to your use of that work.
51
-
52
- Any use of the Licensed Work in violation of this License will
53
- automatically terminate your rights under this License for the current
54
- and all other versions of the Licensed Work.
55
-
56
- This License does not grant you any right in any trademark or logo of
57
- Licensor or its affiliates (provided that you may use a trademark or
58
- logo of Licensor as expressly required by this License).
59
-
60
- TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS
61
- PROVIDED ON AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES
62
- AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION)
63
- WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
64
- NON-INFRINGEMENT, AND TITLE.
1
+ PolyForm Noncommercial License 1.0.0
2
+
3
+ https://polyformproject.org/licenses/noncommercial/1.0.0
4
+
5
+ Acceptance
6
+
7
+ In order to get any license under these terms, you must agree
8
+ to them as both strict obligations and conditions to all
9
+ your licenses.
10
+
11
+ Copyright License
12
+
13
+ The licensor grants you a copyright license for the
14
+ software to do everything you might do with the software
15
+ that would otherwise infringe the licensor's copyright
16
+ in it for any permitted purpose. However, you may
17
+ only distribute the software according to Distribution
18
+ License and make changes or new works
19
+ based on the software according to Changes and New Works
20
+ License.
21
+
22
+ Distribution License
23
+
24
+ The licensor grants you an additional copyright license
25
+ to distribute copies of the software. Your license
26
+ to distribute covers distributing the software with
27
+ changes and new works permitted by Changes and New Works
28
+ License.
29
+
30
+ Notices
31
+
32
+ You must ensure that anyone who gets a copy of any part of
33
+ the software from you also gets a copy of these terms or the
34
+ URL for them above, as well as copies of any plain-text lines
35
+ beginning with `Required Notice:` that the licensor provided
36
+ with the software. For example:
37
+
38
+ > Required Notice: Copyright StackMemory AI (https://stackmemory.ai)
39
+
40
+ Changes and New Works License
41
+
42
+ The licensor grants you an additional copyright license to
43
+ make changes and new works based on the software for any
44
+ permitted purpose.
45
+
46
+ Patent License
47
+
48
+ The licensor grants you a patent license for the software that
49
+ covers patent claims the licensor can license, or becomes able
50
+ to license, that you would infringe by using the software.
51
+
52
+ Noncommercial Purposes
53
+
54
+ Any noncommercial purpose is a permitted purpose.
55
+
56
+ Personal Uses
57
+
58
+ Personal use for research, experiment, and testing for
59
+ the benefit of public knowledge, personal study, private
60
+ entertainment, hobby projects, amateur pursuits, or religious
61
+ observance, without any anticipated commercial application,
62
+ is use for a permitted purpose.
63
+
64
+ Noncommercial Organizations
65
+
66
+ Use by any charitable organization, educational institution,
67
+ public research organization, public safety or health
68
+ organization, environmental protection organization,
69
+ or government institution is use for a permitted purpose
70
+ regardless of the source of funding or obligations resulting
71
+ from the funding.
72
+
73
+ Fair Use
74
+
75
+ You may have "fair use" rights for the software under the
76
+ law. These terms do not limit them.
77
+
78
+ No Other Rights
79
+
80
+ These terms do not allow you to sublicense or transfer any of
81
+ your licenses to anyone else, or prevent the licensor from
82
+ granting licenses to anyone else. These terms do not imply
83
+ any other licenses.
84
+
85
+ Patent Defense
86
+
87
+ If you make any written claim that the software infringes or
88
+ contributes to infringement of any patent, your patent license
89
+ for the software granted under these terms ends immediately. If
90
+ your company makes such a claim, your patent license ends
91
+ immediately for work on behalf of your company.
92
+
93
+ Violations
94
+
95
+ The first time you are notified in writing that you have
96
+ violated any of these terms, or done anything with the software
97
+ not covered by your licenses, your licenses can nonetheless
98
+ continue if you come into full compliance with these terms,
99
+ and take practical steps to correct past violations, within
100
+ 32 days of receiving notice. Otherwise, all your licenses
101
+ end immediately.
102
+
103
+ No Liability
104
+
105
+ As far as the law allows, the software comes as is, without
106
+ any warranty or condition, and the licensor will not be liable
107
+ to you for any damages arising out of these terms or the use
108
+ or nature of the software, under any kind of legal claim.
109
+
110
+ Definitions
111
+
112
+ The licensor is the individual or entity offering these
113
+ terms, and the software is the software the licensor makes
114
+ available under these terms.
115
+
116
+ You refers to the individual or entity agreeing to these
117
+ terms.
118
+
119
+ Your company is any legal entity, sole proprietorship,
120
+ or other kind of organization that you work for, plus all
121
+ organizations that have control over, are under the control of,
122
+ or are under common control with that organization. Control
123
+ means ownership of substantially all the assets of an entity,
124
+ or the power to direct its management and policies by vote,
125
+ contract, or otherwise. Control can be direct or indirect.
126
+
127
+ Your licenses are all the licenses granted to you for the
128
+ software under these terms.
129
+
130
+ Use means anything you do with the software requiring one
131
+ of your licenses.
package/README.md CHANGED
@@ -14,7 +14,7 @@ Lossless, project-scoped memory for AI coding tools. **[Website](https://stackme
14
14
  StackMemory is a **production-ready memory runtime** for AI coding tools that preserves full project context across sessions:
15
15
 
16
16
  - **Zero-config setup** — `stackmemory init` just works
17
- - **56 MCP tools** for Claude Code integration (context, tasks, Linear, traces, discovery, cord, team, planning, providers, and more)
17
+ - **73 MCP tools** for Claude Code integration (context, tasks, Linear, traces, discovery, cord, team, planning, providers, and more)
18
18
  - **FTS5 full-text search** with BM25 scoring and hybrid retrieval
19
19
  - **Full Linear integration** with bidirectional sync and OAuth/API key support
20
20
  - **Context persistence** that survives `/clear` operations
@@ -97,6 +97,16 @@ stackmemory doctor
97
97
 
98
98
  Restart Claude Code and StackMemory MCP tools will be available.
99
99
 
100
+ ### Also available as `croissant-ai`
101
+
102
+ [croissant.ai](https://croissant.ai) wraps StackMemory as a business-facing CLI for executive intelligence. Install via `npx croissant-ai` — all unknown commands forward to StackMemory automatically.
103
+
104
+ ```bash
105
+ npx croissant-ai ask "What's our MRR?" # croissant.ai query API
106
+ npx croissant-ai memory capture # → stackmemory capture
107
+ npx croissant-ai init # → stackmemory init (fallback)
108
+ ```
109
+
100
110
  ### Wrapper Scripts
101
111
 
102
112
  StackMemory ships wrapper scripts that launch your coding tool with StackMemory context pre-loaded:
@@ -132,6 +142,44 @@ Runs as an MCP server. Editors (e.g., Claude Code) call StackMemory on each inte
132
142
 
133
143
  ---
134
144
 
145
+ ## Command Packs
146
+
147
+ StackMemory ships installable command packs for Claude Code — curated slash commands that integrate session lifecycle management directly into your workflow.
148
+
149
+ ### Core Pack
150
+
151
+ The **core** pack provides session lifecycle commands that use StackMemory for context persistence:
152
+
153
+ | Command | Description |
154
+ |---------|-------------|
155
+ | `/start` | Boot a session — load memory, restore handoff, show git state, suggest next work |
156
+ | `/stop` | End a session — summarize, capture handoff, review learnings |
157
+ | `/restart` | Chain `/stop` → `/clear` → `/start` in one command |
158
+ | `/next` | Suggest what to work on based on context |
159
+
160
+ Internal dependencies (installed automatically): `/summary`, `/capture`, `/learn`, `/restore`
161
+
162
+ ```bash
163
+ # Install core commands
164
+ stackmemory setup-commands
165
+
166
+ # List available packs
167
+ stackmemory setup-commands --list
168
+
169
+ # Preview what would be installed
170
+ stackmemory setup-commands --dry-run
171
+
172
+ # Reinstall (overwrite existing)
173
+ stackmemory setup-commands --force
174
+
175
+ # Remove installed commands
176
+ stackmemory setup-commands --uninstall
177
+ ```
178
+
179
+ Commands are symlinked to `~/.claude/commands/` and available immediately in Claude Code.
180
+
181
+ ---
182
+
135
183
  ## Skills System
136
184
 
137
185
  StackMemory ships Claude Code skills that integrate directly into your workflow. Skills are invoked via `/skill-name` in Claude Code or `stackmemory skills <name>` from the CLI.
@@ -272,34 +320,54 @@ claude-sm
272
320
 
273
321
  ---
274
322
 
275
- ## RLM (Recursive Language Model) Orchestration
323
+ ## RLM-Aware Harness
324
+
325
+ StackMemory includes an RLM (Recursive Language Model) system inspired by [predict-rlm](https://github.com/Trampoline-AI/predict-rlm) — three layers that make agents self-harnessing:
326
+
327
+ ### Layer 1: Context-as-REPL
328
+
329
+ Agents access tenant data programmatically via tool functions instead of prose handoffs:
330
+
331
+ - `search_knowledge(query, topK)` — vector search over tenant data
332
+ - `read_context(query)` — knowledge graph entity/relationship queries
333
+ - `list_runs(threadId)` — prior run history with status summaries
334
+ - `get_run_events(runId)` — event stream replay for a specific run
335
+ - `query_interrupts(threadId)` — pending approvals and blocks
336
+ - `llm_summarize(prompt)` — sub-LLM (Haiku) for quick synthesis
337
+
338
+ ### Layer 2: Typed Dispatch
339
+
340
+ Signature-based sub-agent spawning with validated I/O contracts:
341
+
342
+ | Signature | Persona | Inputs | Outputs |
343
+ |-----------|---------|--------|---------|
344
+ | `ImplementFeature` | eng | spec, context_files | branch, changed_files, test_passed |
345
+ | `FixBug` | eng | description, error_log | branch, changed_files, root_cause |
346
+ | `ReviewPR` | eng | pr_url, focus_areas | verdict, comments, risk_level |
347
+ | `Investigate` | data | question, data_sources | findings, evidence, confidence |
348
+ | `Summarize` | data | content, format | summary, key_points |
349
+
350
+ Parent runs dispatch typed sub-runs via `dispatchSubRun()` and collect validated results via `collectSubRun()` with timeout handling.
351
+
352
+ ### Layer 3: Critic + Self-Decomposition
276
353
 
277
- StackMemory includes an RLM system that handles complex tasks through recursive decomposition and parallel execution using Claude Code's Task tool.
354
+ LLM quality gate that evaluates run output (ported from predict-rlm's critic pattern):
278
355
 
279
- ### Key Features
356
+ - **Score >= 80**: Pass — run ships as-is
357
+ - **Score 50-79**: Revise — creates a new run with critic feedback appended
358
+ - **Score < 50**: Decompose — dispatches typed sub-runs to break down the task
280
359
 
281
- - **Recursive Task Decomposition**: Breaks complex tasks into manageable subtasks
282
- - **Parallel Subagent Execution**: Run multiple specialized agents concurrently
283
- - **8 Specialized Agent Types**: Planning, Code, Testing, Linting, Review, Improve, Context, Publish
284
- - **Multi-Stage Review**: Iterative improvement cycles with quality scoring (0-1 scale)
285
- - **Automatic Test Generation**: Unit, integration, and E2E test creation
360
+ Loop control: max 3 revisions, max depth 2 for decomposition.
286
361
 
287
- ### Usage
362
+ ### Legacy RLM Orchestrator
363
+
364
+ The original RLM system remains available for direct use:
288
365
 
289
366
  ```bash
290
- # Basic usage
291
367
  stackmemory skills rlm "Your complex task description"
292
-
293
- # With options
294
- stackmemory skills rlm "Refactor authentication system" \
295
- --max-parallel 8 \
296
- --review-stages 5 \
297
- --quality-threshold 0.9 \
298
- --test-mode all
368
+ stackmemory skills rlm "Refactor auth" --max-parallel 8 --quality-threshold 0.9
299
369
  ```
300
370
 
301
- ### Configuration Options
302
-
303
371
  | Option | Description | Default |
304
372
  |--------|-------------|---------|
305
373
  | `--max-parallel` | Maximum concurrent subagents | 5 |
@@ -307,7 +375,6 @@ stackmemory skills rlm "Refactor authentication system" \
307
375
  | `--review-stages` | Number of review iterations | 3 |
308
376
  | `--quality-threshold` | Target quality score (0-1) | 0.85 |
309
377
  | `--test-mode` | Test generation mode (unit/integration/e2e/all) | all |
310
- | `--verbose` | Show all recursive operations | false |
311
378
 
312
379
  **Note**: RLM requires Claude Code Max plan for unlimited subagent execution.
313
380
 
@@ -417,18 +484,34 @@ Options: `--until`, `--until-not`, `--until-empty`, `--until-non-empty`, `--unti
417
484
  ## Documentation
418
485
 
419
486
  - [Getting Started](./docs/GETTING_STARTED.md) — Quick start guide (5 minutes)
420
- - [MCP Tools Reference](https://stackmemoryai.github.io/stackmemory/tools.html) — All 56 MCP tools
487
+ - [MCP Tools Reference](https://stackmemoryai.github.io/stackmemory/tools.html) — All 73 MCP tools
421
488
  - [CLI Reference](./docs/cli.md) — Full command reference
422
489
  - [Setup Guide](./docs/SETUP.md) — Advanced setup options
423
490
  - [Development Guide](./docs/DEVELOPMENT.md) — Contributing and development
424
491
  - [Architecture](./docs/architecture.md) — System design
425
492
  - [API Reference](./docs/API_REFERENCE.md) — API documentation
426
- - [Vision](./vision.md) — Product vision and principles
493
+ - [Vision](./docs/vision.md) — Product vision and principles
427
494
  - [Status](./docs/status.md) — Current project status
428
495
  - [Roadmap](./docs/roadmap.md) — Future plans
429
496
 
430
497
  ---
431
498
 
499
+ ## Substrate: The Three-Layer Vision
500
+
501
+ StackMemory is the foundation of a three-layer architecture for AI-native development:
502
+
503
+ | Layer | Product | Status | Purpose |
504
+ |-------|---------|--------|---------|
505
+ | **L1** | StackMemory | Shipped (v1.10.6) | Context persistence — lossless memory across sessions |
506
+ | **L2** | Substrate Desktop | Shipping | Agent orchestration — multi-agent coordination with worktree isolation |
507
+ | **L3** | Substrate Cloud | Design | Multiplayer development — shared context across teams and agents |
508
+
509
+ Grounded in distributed systems theory: FLP impossibility, Byzantine→Crash conversion via test hooks, Chandra-Toueg failure detectors for agent liveness. See [COORDINATION_THEORY.md](./docs/architecture/COORDINATION_THEORY.md).
510
+
511
+ ---
512
+
432
513
  ## License
433
514
 
434
- Licensed under the [Business Source License 1.1](./LICENSE). You can use, modify, and self-host StackMemory freely. The one restriction: you may not offer it as a competing hosted service. The license converts to MIT after 4 years per release.
515
+ Licensed under the [PolyForm Noncommercial License 1.0.0](./LICENSE).
516
+
517
+ Free for personal, research, educational, and noncommercial use. Commercial use requires a separate license from StackMemory AI.
package/bin/claude-sm CHANGED
@@ -3,4 +3,19 @@
3
3
  * Claude-SM CLI Launcher (ESM)
4
4
  * Delegates to built CLI in dist without requiring tsx.
5
5
  */
6
- import('../dist/src/cli/claude-sm.js');
6
+ import { existsSync } from 'fs';
7
+ import { fileURLToPath } from 'url';
8
+ import { dirname, join } from 'path';
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
12
+ const target = join(__dirname, '../dist/src/cli/claude-sm.js');
13
+
14
+ if (!existsSync(target)) {
15
+ console.error('Error: StackMemory has not been built.');
16
+ console.error(`Missing: ${target}`);
17
+ console.error('Run: npm install && npm run build');
18
+ process.exit(1);
19
+ }
20
+
21
+ import(target);
package/bin/claude-smd CHANGED
@@ -3,4 +3,19 @@
3
3
  * Claude-SM-Danger CLI Launcher (ESM)
4
4
  * Delegates to built CLI in dist without requiring tsx.
5
5
  */
6
- import('../dist/src/cli/claude-sm-danger.js');
6
+ import { existsSync } from 'fs';
7
+ import { fileURLToPath } from 'url';
8
+ import { dirname, join } from 'path';
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
12
+ const target = join(__dirname, '../dist/src/cli/claude-sm-danger.js');
13
+
14
+ if (!existsSync(target)) {
15
+ console.error('Error: StackMemory has not been built.');
16
+ console.error(`Missing: ${target}`);
17
+ console.error('Run: npm install && npm run build');
18
+ process.exit(1);
19
+ }
20
+
21
+ import(target);
package/bin/codex-smd CHANGED
@@ -3,4 +3,19 @@
3
3
  * Codex-SM-Danger CLI Launcher (ESM)
4
4
  * Delegates to built CLI in dist without requiring tsx.
5
5
  */
6
- import('../dist/src/cli/codex-sm-danger.js');
6
+ import { existsSync } from 'fs';
7
+ import { fileURLToPath } from 'url';
8
+ import { dirname, join } from 'path';
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
12
+ const target = join(__dirname, '../dist/src/cli/codex-sm-danger.js');
13
+
14
+ if (!existsSync(target)) {
15
+ console.error('Error: StackMemory has not been built.');
16
+ console.error(`Missing: ${target}`);
17
+ console.error('Run: npm install && npm run build');
18
+ process.exit(1);
19
+ }
20
+
21
+ import(target);
package/bin/gemini-sm CHANGED
@@ -3,4 +3,19 @@
3
3
  * Gemini-SM CLI Launcher (ESM)
4
4
  * Delegates to built CLI in dist without requiring tsx.
5
5
  */
6
- import('../dist/src/cli/gemini-sm.js');
6
+ import { existsSync } from 'fs';
7
+ import { fileURLToPath } from 'url';
8
+ import { dirname, join } from 'path';
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
12
+ const target = join(__dirname, '../dist/src/cli/gemini-sm.js');
13
+
14
+ if (!existsSync(target)) {
15
+ console.error('Error: StackMemory has not been built.');
16
+ console.error(`Missing: ${target}`);
17
+ console.error('Run: npm install && npm run build');
18
+ process.exit(1);
19
+ }
20
+
21
+ import(target);
package/bin/hermes-sm ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Hermes-SM CLI Launcher (ESM)
4
+ * Delegates to built CLI in dist without requiring tsx.
5
+ */
6
+ import { existsSync } from 'fs';
7
+ import { fileURLToPath } from 'url';
8
+ import { dirname, join } from 'path';
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
12
+ const target = join(__dirname, '../dist/src/cli/hermes-sm.js');
13
+
14
+ if (!existsSync(target)) {
15
+ console.error('Error: StackMemory has not been built.');
16
+ console.error(`Missing: ${target}`);
17
+ console.error('Run: npm install && npm run build');
18
+ process.exit(1);
19
+ }
20
+
21
+ import(target);
package/bin/hermes-smd ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Hermes-SM-Danger CLI Launcher (ESM) — danger mode
4
+ * Delegates to built CLI in dist without requiring tsx.
5
+ */
6
+ import { existsSync } from 'fs';
7
+ import { fileURLToPath } from 'url';
8
+ import { dirname, join } from 'path';
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
12
+ const target = join(__dirname, '../dist/src/cli/hermes-sm.js');
13
+
14
+ if (!existsSync(target)) {
15
+ console.error('Error: StackMemory has not been built.');
16
+ console.error(`Missing: ${target}`);
17
+ console.error('Run: npm install && npm run build');
18
+ process.exit(1);
19
+ }
20
+
21
+ import(target);
package/bin/opencode-sm CHANGED
@@ -3,4 +3,19 @@
3
3
  * OpenCode-SM CLI Launcher (ESM)
4
4
  * Delegates to built CLI in dist without requiring tsx.
5
5
  */
6
- import('../dist/src/cli/opencode-sm.js');
6
+ import { existsSync } from 'fs';
7
+ import { fileURLToPath } from 'url';
8
+ import { dirname, join } from 'path';
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
12
+ const target = join(__dirname, '../dist/src/cli/opencode-sm.js');
13
+
14
+ if (!existsSync(target)) {
15
+ console.error('Error: StackMemory has not been built.');
16
+ console.error(`Missing: ${target}`);
17
+ console.error('Run: npm install && npm run build');
18
+ process.exit(1);
19
+ }
20
+
21
+ import(target);