@stackmemoryai/stackmemory 1.12.0 → 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 (162) hide show
  1. package/LICENSE +131 -64
  2. package/README.md +3 -1
  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/codex-sm.js +51 -11
  11. package/dist/src/cli/commands/brain.js +206 -0
  12. package/dist/src/cli/commands/company-os.js +184 -0
  13. package/dist/src/cli/commands/context.js +5 -0
  14. package/dist/src/cli/commands/operator.js +127 -0
  15. package/dist/src/cli/commands/orchestrate.js +2 -0
  16. package/dist/src/cli/commands/orchestrator.js +3 -2
  17. package/dist/src/cli/commands/patterns.js +254 -0
  18. package/dist/src/cli/commands/portal.js +161 -0
  19. package/dist/src/cli/commands/scaffold.js +92 -0
  20. package/dist/src/cli/commands/setup.js +1 -4
  21. package/dist/src/cli/commands/sync.js +253 -0
  22. package/dist/src/cli/commands/tasks.js +130 -1
  23. package/dist/src/cli/commands/vision.js +221 -0
  24. package/dist/src/cli/hermes-sm.js +224 -0
  25. package/dist/src/cli/index.js +15 -10
  26. package/dist/src/cli/utils/real-cli-bin.js +72 -0
  27. package/dist/src/core/brain/brain-store.js +187 -0
  28. package/dist/src/core/brain/brain-sync.js +193 -0
  29. package/dist/src/core/brain/index.js +78 -0
  30. package/dist/src/core/brain/types.js +10 -0
  31. package/dist/src/core/cache/token-estimator.js +24 -1
  32. package/dist/src/core/config/feature-flags.js +2 -6
  33. package/dist/src/core/context/frame-database.js +44 -0
  34. package/dist/src/core/context/recursive-context-manager.js +1 -1
  35. package/dist/src/core/context/rehydration.js +2 -1
  36. package/dist/src/core/database/sqlite-adapter.js +14 -1
  37. package/dist/src/core/models/model-router.js +33 -1
  38. package/dist/src/core/models/provider-pricing.js +58 -4
  39. package/dist/src/core/patterns/index.js +22 -0
  40. package/dist/src/core/patterns/pattern-applier.js +39 -0
  41. package/dist/src/core/patterns/pattern-observer.js +157 -0
  42. package/dist/src/core/patterns/pattern-store.js +259 -0
  43. package/dist/src/core/patterns/types.js +19 -0
  44. package/dist/src/core/retrieval/llm-context-retrieval.js +5 -4
  45. package/dist/src/core/retrieval/unified-context-assembler.js +11 -66
  46. package/dist/src/core/skill-packs/types.js +14 -1
  47. package/dist/src/core/storage/cloud-sync-manager.js +116 -0
  48. package/dist/src/core/storage/cloud-sync.js +574 -0
  49. package/dist/src/core/storage/two-tier-storage.js +5 -1
  50. package/dist/src/core/tasks/master-tasks-template.js +43 -0
  51. package/dist/src/core/tasks/md-task-parser.js +138 -0
  52. package/dist/src/core/vision/index.js +27 -0
  53. package/dist/src/core/vision/signals.js +79 -0
  54. package/dist/src/core/vision/types.js +22 -0
  55. package/dist/src/core/vision/vision-file.js +146 -0
  56. package/dist/src/core/vision/vision-loop.js +220 -0
  57. package/dist/src/core/wiki/wiki-compiler.js +103 -1
  58. package/dist/src/daemon/daemon-config.js +45 -0
  59. package/dist/src/daemon/services/desire-path-service.js +566 -0
  60. package/dist/src/daemon/services/research-stream-service.js +320 -0
  61. package/dist/src/daemon/services/telemetry-service.js +192 -0
  62. package/dist/src/daemon/unified-daemon.js +28 -1
  63. package/dist/src/features/browser/cli-browser-agent.js +417 -0
  64. package/dist/src/features/browser/stagehand-workflows.js +578 -0
  65. package/dist/src/features/operator/adapter-factory.js +62 -0
  66. package/dist/src/features/operator/browser-adapter.js +109 -0
  67. package/dist/src/features/operator/desktop-adapter.js +125 -0
  68. package/dist/src/features/operator/index.js +39 -0
  69. package/dist/src/features/operator/llm-decision.js +137 -0
  70. package/dist/src/features/operator/operator-logger.js +92 -0
  71. package/dist/src/features/operator/overnight-runner.js +327 -0
  72. package/dist/src/features/operator/screen-adapter.js +91 -0
  73. package/dist/src/features/operator/session-manager.js +127 -0
  74. package/dist/src/features/operator/state-machine.js +227 -0
  75. package/dist/src/features/operator/task-queue.js +81 -0
  76. package/dist/src/features/portal/index.js +26 -0
  77. package/dist/src/features/portal/server.js +240 -0
  78. package/dist/src/features/portal/types.js +14 -0
  79. package/dist/src/features/portal/ui.js +195 -0
  80. package/dist/src/features/tasks/task-aware-context.js +2 -1
  81. package/dist/src/features/tui/simple-monitor.js +0 -23
  82. package/dist/src/features/tui/swarm-monitor.js +8 -66
  83. package/dist/src/{integrations/diffmem/index.js → features/web/client/hooks/use-socket.js} +6 -5
  84. package/dist/src/features/web/client/lib/utils.js +12 -0
  85. package/dist/src/features/web/client/stores/session-store.js +12 -0
  86. package/dist/src/features/web/server/gcp-billing.js +76 -0
  87. package/dist/src/features/web/server/index.js +10 -0
  88. package/dist/src/features/web/server/spend-calculator.js +228 -0
  89. package/dist/src/hooks/schemas.js +4 -1
  90. package/dist/src/integrations/anthropic/client.js +3 -2
  91. package/dist/src/integrations/claude-code/agent-bridge.js +0 -3
  92. package/dist/src/integrations/claude-code/subagent-client.js +218 -11
  93. package/dist/src/integrations/claude-code/task-coordinator.js +2 -1
  94. package/dist/src/integrations/linear/webhook-retry.js +196 -0
  95. package/dist/src/integrations/linear/webhook-server.js +18 -22
  96. package/dist/src/integrations/mcp/handlers/cloud-sync-handlers.js +101 -0
  97. package/dist/src/integrations/mcp/handlers/index.js +27 -52
  98. package/dist/src/integrations/mcp/server.js +122 -335
  99. package/dist/src/integrations/mcp/tool-alias-registry.js +0 -73
  100. package/dist/src/integrations/mcp/tool-definitions.js +111 -510
  101. package/dist/src/mcp/stackmemory-mcp-server.js +404 -379
  102. package/dist/src/orchestrators/multimodal/determinism.js +2 -1
  103. package/dist/src/orchestrators/multimodal/harness.js +2 -1
  104. package/dist/src/skills/recursive-agent-orchestrator.js +2 -4
  105. package/dist/src/utils/process-cleanup.js +1 -7
  106. package/docs/README.md +42 -0
  107. package/docs/guides/README_INSTALL.md +208 -0
  108. package/package.json +18 -9
  109. package/scripts/claude-code-wrapper.sh +11 -0
  110. package/scripts/claude-sm-setup.sh +12 -1
  111. package/scripts/codex-wrapper.sh +11 -0
  112. package/scripts/git-hooks/branch-context-manager.sh +11 -0
  113. package/scripts/git-hooks/post-checkout-stackmemory.sh +11 -0
  114. package/scripts/git-hooks/post-commit-stackmemory.sh +11 -0
  115. package/scripts/git-hooks/pre-commit-stackmemory.sh +11 -0
  116. package/scripts/hooks/cleanup-shell.sh +12 -1
  117. package/scripts/hooks/task-complete.sh +12 -1
  118. package/scripts/install-code-execution-hooks.sh +12 -1
  119. package/scripts/install-sweep-hook.sh +12 -0
  120. package/scripts/install.sh +11 -0
  121. package/scripts/opencode-wrapper.sh +11 -0
  122. package/scripts/portal/cloud-init.yaml +69 -0
  123. package/scripts/portal/setup.sh +69 -0
  124. package/scripts/portal/stackmemory-portal.service +34 -0
  125. package/scripts/setup-claude-integration.sh +12 -1
  126. package/scripts/smoke-init-db.sh +23 -0
  127. package/scripts/stackmemory-daemon.sh +11 -0
  128. package/scripts/verify-dist.cjs +11 -4
  129. package/dist/src/cli/commands/ralph.js +0 -1053
  130. package/dist/src/hooks/diffmem-hooks.js +0 -376
  131. package/dist/src/integrations/diffmem/client.js +0 -208
  132. package/dist/src/integrations/diffmem/config.js +0 -14
  133. package/dist/src/integrations/greptile/client.js +0 -101
  134. package/dist/src/integrations/greptile/config.js +0 -14
  135. package/dist/src/integrations/greptile/index.js +0 -11
  136. package/dist/src/integrations/mcp/handlers/cross-search-handlers.js +0 -188
  137. package/dist/src/integrations/mcp/handlers/diffmem-handlers.js +0 -455
  138. package/dist/src/integrations/mcp/handlers/greptile-handlers.js +0 -456
  139. package/dist/src/integrations/mcp/handlers/provider-handlers.js +0 -227
  140. package/dist/src/integrations/ralph/bridge/ralph-stackmemory-bridge.js +0 -863
  141. package/dist/src/integrations/ralph/context/context-budget-manager.js +0 -308
  142. package/dist/src/integrations/ralph/context/stackmemory-context-loader.js +0 -354
  143. package/dist/src/integrations/ralph/index.js +0 -17
  144. package/dist/src/integrations/ralph/learning/pattern-learner.js +0 -416
  145. package/dist/src/integrations/ralph/lifecycle/iteration-lifecycle.js +0 -448
  146. package/dist/src/integrations/ralph/loopmax.js +0 -488
  147. package/dist/src/integrations/ralph/monitoring/swarm-dashboard.js +0 -293
  148. package/dist/src/integrations/ralph/monitoring/swarm-registry.js +0 -107
  149. package/dist/src/integrations/ralph/orchestration/multi-loop-orchestrator.js +0 -508
  150. package/dist/src/integrations/ralph/patterns/compounding-engineering-pattern.js +0 -407
  151. package/dist/src/integrations/ralph/patterns/extended-coherence-sessions.js +0 -495
  152. package/dist/src/integrations/ralph/patterns/oracle-worker-pattern.js +0 -387
  153. package/dist/src/integrations/ralph/performance/performance-optimizer.js +0 -357
  154. package/dist/src/integrations/ralph/recovery/crash-recovery.js +0 -461
  155. package/dist/src/integrations/ralph/state/state-reconciler.js +0 -420
  156. package/dist/src/integrations/ralph/swarm/git-workflow-manager.js +0 -444
  157. package/dist/src/integrations/ralph/swarm/swarm-coordinator.js +0 -1005
  158. package/dist/src/integrations/ralph/visualization/ralph-debugger.js +0 -635
  159. package/scripts/ralph-loop-implementation.js +0 -404
  160. /package/dist/src/{integrations/diffmem/types.js → core/storage/cloud-sync-types.js} +0 -0
  161. /package/dist/src/{integrations/greptile → features/operator}/types.js +0 -0
  162. /package/dist/src/{integrations/ralph/types.js → features/web/client/next-env.d.js} +0 -0
@@ -3,6 +3,7 @@ import { dirname as __pathDirname } from 'path';
3
3
  const __filename = __fileURLToPath(import.meta.url);
4
4
  const __dirname = __pathDirname(__filename);
5
5
  import { createHash } from "crypto";
6
+ import { estimateTokens } from "../../core/cache/token-estimator.js";
6
7
  import {
7
8
  appendFileSync,
8
9
  existsSync,
@@ -77,7 +78,7 @@ function normalizeResult(result) {
77
78
  }
78
79
  function estimateContextTokens(result) {
79
80
  const normalized = normalizeResult(result);
80
- return Math.ceil(stableStringify(normalized).length / 4);
81
+ return estimateTokens(stableStringify(normalized));
81
82
  }
82
83
  function toSnapshot(result, index) {
83
84
  const normalized = normalizeResult(result);
@@ -2,6 +2,7 @@ import { fileURLToPath as __fileURLToPath } from 'url';
2
2
  import { dirname as __pathDirname } from 'path';
3
3
  const __filename = __fileURLToPath(import.meta.url);
4
4
  const __dirname = __pathDirname(__filename);
5
+ import { estimateTokens } from "../../core/cache/token-estimator.js";
5
6
  import {
6
7
  callClaude,
7
8
  callCodexCLI,
@@ -239,7 +240,7 @@ ${diff}${checksSection}`;
239
240
  editAttempts: editMetrics.editAttempts,
240
241
  editSuccesses: editMetrics.editSuccesses,
241
242
  editFuzzyFallbacks: editMetrics.editFuzzyFallbacks,
242
- contextTokens: Math.ceil(finalDiff.length / 4)
243
+ contextTokens: estimateTokens(finalDiff)
243
244
  };
244
245
  if (options.persistAudit !== false) {
245
246
  try {
@@ -5,6 +5,7 @@ const __dirname = __pathDirname(__filename);
5
5
  import * as fs from "fs";
6
6
  import * as path from "path";
7
7
  import { logger } from "../core/monitoring/logger.js";
8
+ import { estimateTokens } from "../core/cache/token-estimator.js";
8
9
  import { ParallelExecutor } from "../core/execution/parallel-executor.js";
9
10
  import { RecursiveContextManager } from "../core/context/recursive-context-manager.js";
10
11
  import { ClaudeCodeSubagentClient } from "../integrations/claude-code/subagent-client.js";
@@ -345,7 +346,7 @@ Rules:
345
346
  context: agentContext
346
347
  });
347
348
  node.result = response.result;
348
- node.tokens = response.tokens || this.estimateTokens(JSON.stringify(response));
349
+ node.tokens = response.tokens || estimateTokens(JSON.stringify(response));
349
350
  node.cost = this.calculateNodeCost(node.tokens, agentConfig.model);
350
351
  if (options.shareContextRealtime) {
351
352
  await this.shareAgentResults(node);
@@ -527,9 +528,6 @@ ${sections.join("\n\n")}` : "";
527
528
  `- Output structured JSON when possible`
528
529
  ].join("\n");
529
530
  }
530
- estimateTokens(text) {
531
- return Math.ceil(text.length / 4);
532
- }
533
531
  async shareAgentResults(_node) {
534
532
  logger.debug("Sharing agent results", { nodeId: _node.id });
535
533
  }
@@ -15,13 +15,7 @@ function isProcessAlive(pid) {
15
15
  return false;
16
16
  }
17
17
  }
18
- const STACKMEMORY_PROCESS_PATTERNS = [
19
- "stackmemory",
20
- "ralph orchestrate",
21
- "ralph swarm",
22
- "ralph loop",
23
- "hooks start"
24
- ];
18
+ const STACKMEMORY_PROCESS_PATTERNS = ["stackmemory", "hooks start"];
25
19
  function getStackmemoryProcesses() {
26
20
  const processes = [];
27
21
  try {
package/docs/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # StackMemory Documentation
2
+
3
+ ## Quick Start
4
+
5
+ - **[Setup Guide](SETUP.md)** - Installation, Railway deployment, Linear/Claude integration
6
+ - **[Features](FEATURES.md)** - Context persistence, TUI, storage, browser testing
7
+ - **[Development](DEVELOPMENT.md)** - Testing, architecture, quality gates, security
8
+ - **[API Reference](API_REFERENCE.md)** - Commands, MCP tools, REST endpoints
9
+
10
+ ## Core Documents
11
+
12
+ - **[SPEC.md](SPEC.md)** - Technical specification and system architecture
13
+ - **[AGENTS.md](AGENTS.md)** - Agent system and skill management
14
+ - **[BM25+RLM Search](BM25-RLM-10DAY-FINAL.md)** - Next-gen code search (10-day implementation)
15
+
16
+ ## Specialized Areas
17
+
18
+ ### Architecture
19
+ - [Technical Architecture](architecture/TECHNICAL_ARCHITECTURE.md) - System design patterns
20
+ - [Deployment](architecture/DEPLOYMENT.md) - Infrastructure and scaling
21
+ - [Multi-Project Support](architecture/MULTI_PROJECT.md) - Project isolation
22
+
23
+ ### Integrations
24
+ - [Linear Integration](integrations/) - Task management sync
25
+ - [Browser MCP](integrations/) - Web testing capabilities
26
+ - [Database Migration](postgres-migration-plan.md) - PostgreSQL transition
27
+
28
+ ### Development
29
+ - [Session Persistence](session-persistence-design.md) - Context survival design
30
+ - [Query Language](query-language.md) - Context query syntax
31
+ - [Testing Agent](testing-agent.md) - Automated testing framework
32
+
33
+ ## Archives
34
+ Historical documentation in [archives/](archives/) - implementation summaries, security reports, migration guides.
35
+
36
+ ## Documentation Standards
37
+
38
+ - Technical accuracy over marketing language
39
+ - Real metrics and benchmarks
40
+ - Practical code examples
41
+ - Version-specific information
42
+ - Clear troubleshooting guides
@@ -0,0 +1,208 @@
1
+ # 🚀 StackMemory Quick Installation
2
+
3
+ ## One-Command Install (Global for ALL Claude Instances)
4
+
5
+ ```bash
6
+ # Clone and install globally
7
+ git clone https://github.com/yourusername/stackmemory.git
8
+ cd stackmemory
9
+ ./install.sh
10
+ ```
11
+
12
+ **That's it!** StackMemory is now available in:
13
+ - ✅ ALL Claude Code instances
14
+ - ✅ ANY git repository
15
+ - ✅ Automatically starts with Claude
16
+
17
+ ---
18
+
19
+ ## 🎯 What the Installer Does
20
+
21
+ 1. **Installs globally** to `~/.stackmemory`
22
+ 2. **Configures Claude Code** MCP automatically
23
+ 3. **Creates `stackmemory` command** available everywhere
24
+ 4. **Auto-detects** git repositories
25
+ 5. **No manual configuration needed**
26
+
27
+ ---
28
+
29
+ ## 📝 After Installation
30
+
31
+ ### Restart Claude Code
32
+ Close and reopen Claude Code to load the MCP server.
33
+
34
+ ### Test It Works
35
+ In Claude Code, ask:
36
+ - "What's the project context?"
37
+ - "Add decision: We're using PostgreSQL"
38
+ - "Start task: Implementing authentication"
39
+
40
+ ### Use in Any Git Repo
41
+ ```bash
42
+ cd your-project
43
+ stackmemory init # One-time setup
44
+ stackmemory status # Check what's stored
45
+ stackmemory test # Run quality tests
46
+ ```
47
+
48
+ ---
49
+
50
+ ## 🔧 Manual Installation (Alternative)
51
+
52
+ If the installer doesn't work, manually configure:
53
+
54
+ ### 1. Find your Claude config directory:
55
+ - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
56
+ - **Linux**: `~/.config/claude/claude_desktop_config.json`
57
+
58
+ ### 2. Add this configuration:
59
+ ```json
60
+ {
61
+ "mcpServers": {
62
+ "stackmemory": {
63
+ "command": "node",
64
+ "args": ["/path/to/stackmemory/dist/src/mcp-server.js"],
65
+ "env": {
66
+ "STACKMEMORY_GLOBAL": "true"
67
+ }
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ ### 3. Build StackMemory:
74
+ ```bash
75
+ cd stackmemory
76
+ npm install
77
+ npm run build
78
+ ```
79
+
80
+ ### 4. Restart Claude Code
81
+
82
+ ---
83
+
84
+ ## 🧪 Test Suite
85
+
86
+ Run the test to verify context quality:
87
+
88
+ ```bash
89
+ # In any project with StackMemory initialized
90
+ stackmemory test
91
+ ```
92
+
93
+ This will:
94
+ - Simulate multiple sessions
95
+ - Test context recall accuracy
96
+ - Measure relevance over time
97
+ - Generate performance report
98
+ - Export CSV with detailed metrics
99
+
100
+ ### Reading Test Results
101
+
102
+ ```
103
+ 📊 Test Results Summary
104
+
105
+ Overall Performance:
106
+ Recall Accuracy: ████████░░ 82.3%
107
+ Context Relevance: ██████░░░░ 61.5%
108
+ Importance Stability: ████████░░ 85.2%
109
+ Avg Response Time: 15ms
110
+
111
+ Learning Curve:
112
+ Session 1→2: 📈 +15.2% improvement
113
+ Session 2→3: 📈 +8.7% improvement
114
+ ```
115
+
116
+ ---
117
+
118
+ ## 🌍 Global Commands
119
+
120
+ Once installed, these commands work anywhere:
121
+
122
+ | Command | Description |
123
+ |---------|-------------|
124
+ | `stackmemory` | Start MCP server in current directory |
125
+ | `stackmemory init` | Initialize in current git repo |
126
+ | `stackmemory status` | Show stored contexts and metrics |
127
+ | `stackmemory test` | Run quality test suite |
128
+
129
+ ---
130
+
131
+ ## 🔍 Verify Installation
132
+
133
+ Check if properly installed:
134
+
135
+ ```bash
136
+ # Check command exists
137
+ which stackmemory
138
+
139
+ # Check Claude config
140
+ cat ~/Library/Application\ Support/Claude/claude_desktop_config.json | grep stackmemory
141
+
142
+ # Test in a git repo
143
+ cd any-git-repo
144
+ stackmemory init
145
+ stackmemory status
146
+ ```
147
+
148
+ ---
149
+
150
+ ## ⚡ Performance Metrics
151
+
152
+ After a week of usage, check metrics:
153
+
154
+ ```bash
155
+ stackmemory status
156
+ ```
157
+
158
+ You'll see:
159
+ - **Top contexts by importance** (what matters most)
160
+ - **Access patterns** (what's used frequently)
161
+ - **Attention scores** (what influences responses)
162
+ - **Decay indicators** (what's becoming stale)
163
+
164
+ ---
165
+
166
+ ## 🐛 Troubleshooting
167
+
168
+ ### Claude Code doesn't see StackMemory
169
+ 1. Check config file location
170
+ 2. Restart Claude Code completely
171
+ 3. Check logs: `tail -f /tmp/stackmemory.log`
172
+
173
+ ### Command not found
174
+ ```bash
175
+ export PATH="$HOME/.local/bin:$PATH"
176
+ source ~/.bashrc
177
+ ```
178
+
179
+ ### Permission denied
180
+ ```bash
181
+ chmod +x ~/.local/bin/stackmemory
182
+ ```
183
+
184
+ ---
185
+
186
+ ## 📊 Monitoring Context Quality
187
+
188
+ The system tracks:
189
+ - **Recall accuracy**: Can it remember decisions?
190
+ - **Relevance**: Is retrieved context useful?
191
+ - **Learning rate**: Does it improve over time?
192
+
193
+ View metrics:
194
+ ```bash
195
+ sqlite3 ~/.stackmemory/attention.db "SELECT * FROM learned_importance ORDER BY importance DESC LIMIT 10;"
196
+ ```
197
+
198
+ ---
199
+
200
+ ## 🚀 That's It!
201
+
202
+ StackMemory is now running globally across all your Claude Code instances. It will:
203
+ - ✅ Learn what context matters
204
+ - ✅ Improve over time
205
+ - ✅ Work in every git repository
206
+ - ✅ Share context across sessions
207
+
208
+ No further configuration needed!
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stackmemoryai/stackmemory",
3
- "version": "1.12.0",
4
- "description": "Lossless, project-scoped memory for AI coding tools. Durable context across sessions with 56 MCP tools, FTS5 search, conductor orchestrator, loop/watch monitoring, snapshot capture, pre-flight overlap checks, Claude/Codex/OpenCode wrappers, Linear sync, and automatic hooks.",
3
+ "version": "1.14.0",
4
+ "description": "Lossless, project-scoped memory for AI coding tools. Durable context across sessions with MCP tools, FTS5 search, cloud sync, trace optimization, Claude/Codex/OpenCode/Gemini wrappers, skill packs, and automatic hooks.",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=10.0.0"
@@ -15,13 +15,16 @@
15
15
  "claude-sm": "bin/claude-sm",
16
16
  "claude-smd": "bin/claude-smd",
17
17
  "opencode-sm": "bin/opencode-sm",
18
- "gemini-sm": "bin/gemini-sm"
18
+ "gemini-sm": "bin/gemini-sm",
19
+ "hermes-sm": "bin/hermes-sm",
20
+ "hermes-smd": "bin/hermes-smd"
19
21
  },
20
22
  "files": [
21
23
  "bin",
22
24
  "dist/src",
23
25
  "scripts/git-hooks",
24
26
  "scripts/hooks",
27
+ "scripts/portal",
25
28
  "scripts/setup",
26
29
  "scripts/setup.sh",
27
30
  "scripts/install.sh",
@@ -39,13 +42,13 @@
39
42
  "scripts/codex-wrapper.sh",
40
43
  "scripts/opencode-wrapper.sh",
41
44
  "scripts/stackmemory-daemon.sh",
42
- "scripts/ralph-loop-implementation.js",
43
45
  "scripts/setup-claude-integration.sh",
44
46
  "scripts/setup-claude-integration.js",
45
47
  "scripts/verify-dist.cjs",
46
48
  "scripts/smoke-init-db.sh",
47
49
  "templates",
48
50
  "packs",
51
+ "docs/guides/README_INSTALL.md",
49
52
  "README.md",
50
53
  "LICENSE"
51
54
  ],
@@ -58,7 +61,7 @@
58
61
  "url": "https://github.com/stackmemoryai/stackmemory/issues"
59
62
  },
60
63
  "author": "StackMemory AI",
61
- "license": "BUSL-1.1",
64
+ "license": "PolyForm-Noncommercial-1.0.0",
62
65
  "publishConfig": {
63
66
  "access": "public"
64
67
  },
@@ -134,8 +137,6 @@
134
137
  "daemons:stop": "node scripts/claude-sm-autostart.js stop",
135
138
  "daemon:session": "node dist/daemon/session-daemon.js",
136
139
  "daemon:session:start": "node dist/daemon/session-daemon.js --session-id",
137
- "diffmem:start": "PYTHONPATH=packages/diffmem/src packages/diffmem/.venv/bin/uvicorn diffmem.server:app --host 127.0.0.1 --port 8000",
138
- "diffmem:setup": "cd packages/diffmem && python3 -m venv .venv && .venv/bin/pip install -r requirements-server.txt -e .",
139
140
  "daemon:start": "node dist/daemon/unified-daemon.js",
140
141
  "daemon:stop": "node dist/cli/index.js daemon stop",
141
142
  "daemon:status": "node dist/cli/index.js daemon status",
@@ -156,6 +157,7 @@
156
157
  "@anthropic-ai/tokenizer": "^0.0.4",
157
158
  "@aws-sdk/client-s3": "^3.958.0",
158
159
  "@browsermcp/mcp": "^0.1.3",
160
+ "@google-cloud/bigquery": "^7.9.4",
159
161
  "@google-cloud/storage": "^7.18.0",
160
162
  "@linear/sdk": "^68.1.0",
161
163
  "@modelcontextprotocol/sdk": "^1.25.3",
@@ -163,7 +165,7 @@
163
165
  "@types/blessed": "^0.1.27",
164
166
  "@types/inquirer": "^9.0.9",
165
167
  "@types/pg": "^8.16.0",
166
- "better-sqlite3": "^9.6.0",
168
+ "better-sqlite3": "^12.10.0",
167
169
  "chalk": "^5.3.0",
168
170
  "cli-table3": "^0.6.5",
169
171
  "commander": "^11.1.0",
@@ -176,11 +178,13 @@
176
178
  "helmet": "^8.1.0",
177
179
  "ignore": "^7.0.5",
178
180
  "inquirer": "^9.3.8",
181
+ "js-tiktoken": "^1.0.21",
179
182
  "msgpackr": "^1.10.1",
180
183
  "node-pty": "^1.1.0",
181
184
  "open": "^11.0.0",
182
185
  "ora": "^9.0.0",
183
186
  "pg": "^8.17.1",
187
+ "raindrop-ai": "^0.1.1",
184
188
  "rate-limiter-flexible": "^9.0.1",
185
189
  "shell-escape": "^0.2.0",
186
190
  "socket.io": "^4.6.0",
@@ -218,9 +222,14 @@
218
222
  ]
219
223
  },
220
224
  "optionalDependencies": {
225
+ "@browserbasehq/stagehand": "^3.4.0",
221
226
  "@xenova/transformers": "^2.17.2",
222
227
  "blessed": "^0.1.81",
223
228
  "blessed-contrib": "^4.11.0",
224
- "chokidar": "^5.0.0"
229
+ "chokidar": "^5.0.0",
230
+ "playwright": "^1.60.0"
231
+ },
232
+ "overrides": {
233
+ "better-sqlite3": "^12.10.0"
225
234
  }
226
235
  }
@@ -3,6 +3,17 @@
3
3
  # Claude Code wrapper with StackMemory integration
4
4
  # Usage: Add alias to ~/.zshrc: alias claude='~/Dev/stackmemory/scripts/claude-code-wrapper.sh'
5
5
 
6
+ # Use Node version from .nvmrc
7
+ export NVM_DIR="$HOME/.nvm"
8
+ if [ -s "$NVM_DIR/nvm.sh" ]; then
9
+ . "$NVM_DIR/nvm.sh"
10
+ nvm use 2>/dev/null
11
+ elif [ -d "$HOME/.nvm/versions/node" ]; then
12
+ NODE_VER=$(cat "$(dirname "$0")/../.nvmrc" 2>/dev/null || echo "20")
13
+ NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
14
+ [ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
15
+ fi
16
+
6
17
  # Check for auto-sync flag and filter wrapper-specific args
7
18
  AUTO_SYNC=false
8
19
  SYNC_INTERVAL=5
@@ -5,6 +5,17 @@
5
5
 
6
6
  set -e
7
7
 
8
+ # Use Node version from .nvmrc
9
+ export NVM_DIR="$HOME/.nvm"
10
+ if [ -s "$NVM_DIR/nvm.sh" ]; then
11
+ . "$NVM_DIR/nvm.sh"
12
+ nvm use 2>/dev/null
13
+ elif [ -d "$HOME/.nvm/versions/node" ]; then
14
+ NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
15
+ NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
16
+ [ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
17
+ fi
18
+
8
19
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
20
  PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
10
21
  CLAUDE_CONFIG_DIR="${HOME}/.claude"
@@ -364,4 +375,4 @@ main() {
364
375
  }
365
376
 
366
377
  # Run main
367
- main "$@"
378
+ main "$@"
@@ -3,6 +3,17 @@
3
3
  # Codex CLI wrapper with StackMemory integration
4
4
  # Usage: Add alias to your shell: alias codex-sm='~/Dev/stackmemory/scripts/codex-wrapper.sh'
5
5
 
6
+ # Use Node version from .nvmrc
7
+ export NVM_DIR="$HOME/.nvm"
8
+ if [ -s "$NVM_DIR/nvm.sh" ]; then
9
+ . "$NVM_DIR/nvm.sh"
10
+ nvm use 2>/dev/null
11
+ elif [ -d "$HOME/.nvm/versions/node" ]; then
12
+ NODE_VER=$(cat "$(dirname "$0")/../.nvmrc" 2>/dev/null || echo "20")
13
+ NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
14
+ [ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
15
+ fi
16
+
6
17
  # Check for auto-sync flag
7
18
  AUTO_SYNC=false
8
19
  SYNC_INTERVAL=5
@@ -4,6 +4,17 @@
4
4
 
5
5
  set -e
6
6
 
7
+ # Use Node version from .nvmrc
8
+ export NVM_DIR="$HOME/.nvm"
9
+ if [ -s "$NVM_DIR/nvm.sh" ]; then
10
+ . "$NVM_DIR/nvm.sh"
11
+ nvm use 2>/dev/null
12
+ elif [ -d "$HOME/.nvm/versions/node" ]; then
13
+ NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
14
+ NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
15
+ [ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
16
+ fi
17
+
7
18
  # Colors for output
8
19
  RED='\033[0;31m'
9
20
  GREEN='\033[0;32m'
@@ -4,6 +4,17 @@
4
4
 
5
5
  set -e
6
6
 
7
+ # Use Node version from .nvmrc
8
+ export NVM_DIR="$HOME/.nvm"
9
+ if [ -s "$NVM_DIR/nvm.sh" ]; then
10
+ . "$NVM_DIR/nvm.sh"
11
+ nvm use 2>/dev/null
12
+ elif [ -d "$HOME/.nvm/versions/node" ]; then
13
+ NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
14
+ NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
15
+ [ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
16
+ fi
17
+
7
18
  # Hook parameters from git
8
19
  prev_head="$1"
9
20
  new_head="$2"
@@ -4,6 +4,17 @@
4
4
 
5
5
  set -e
6
6
 
7
+ # Use Node version from .nvmrc
8
+ export NVM_DIR="$HOME/.nvm"
9
+ if [ -s "$NVM_DIR/nvm.sh" ]; then
10
+ . "$NVM_DIR/nvm.sh"
11
+ nvm use 2>/dev/null
12
+ elif [ -d "$HOME/.nvm/versions/node" ]; then
13
+ NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
14
+ NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
15
+ [ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
16
+ fi
17
+
7
18
  # Colors for output
8
19
  RED='\033[0;31m'
9
20
  GREEN='\033[0;32m'
@@ -4,6 +4,17 @@
4
4
 
5
5
  set -e
6
6
 
7
+ # Use Node version from .nvmrc
8
+ export NVM_DIR="$HOME/.nvm"
9
+ if [ -s "$NVM_DIR/nvm.sh" ]; then
10
+ . "$NVM_DIR/nvm.sh"
11
+ nvm use 2>/dev/null
12
+ elif [ -d "$HOME/.nvm/versions/node" ]; then
13
+ NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
14
+ NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
15
+ [ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
16
+ fi
17
+
7
18
  # Colors for output
8
19
  RED='\033[0;31m'
9
20
  GREEN='\033[0;32m'
@@ -1,5 +1,16 @@
1
1
  #!/bin/bash
2
2
 
3
+ # Use Node version from .nvmrc
4
+ export NVM_DIR="$HOME/.nvm"
5
+ if [ -s "$NVM_DIR/nvm.sh" ]; then
6
+ . "$NVM_DIR/nvm.sh"
7
+ nvm use 2>/dev/null
8
+ elif [ -d "$HOME/.nvm/versions/node" ]; then
9
+ NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
10
+ NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
11
+ [ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
12
+ fi
13
+
3
14
  # Script to clean up and consolidate StackMemory shell configurations
4
15
 
5
16
  echo "🧹 Cleaning up shell configurations..."
@@ -127,4 +138,4 @@ if [[ "$response" == "y" || "$response" == "Y" ]]; then
127
138
  echo " source ~/.bash_profile (for bash)"
128
139
  else
129
140
  echo "Manual cleanup required. Please edit your shell configs."
130
- fi
141
+ fi
@@ -1,5 +1,16 @@
1
1
  #!/bin/bash
2
2
 
3
+ # Use Node version from .nvmrc
4
+ export NVM_DIR="$HOME/.nvm"
5
+ if [ -s "$NVM_DIR/nvm.sh" ]; then
6
+ . "$NVM_DIR/nvm.sh"
7
+ nvm use 2>/dev/null
8
+ elif [ -d "$HOME/.nvm/versions/node" ]; then
9
+ NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
10
+ NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
11
+ [ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
12
+ fi
13
+
3
14
  # Task Completion Hook for StackMemory
4
15
  # Integrates with Linear to prompt for next task when current task is completed
5
16
 
@@ -111,4 +122,4 @@ main() {
111
122
  esac
112
123
  }
113
124
 
114
- main "$@"
125
+ main "$@"
@@ -4,6 +4,17 @@
4
4
 
5
5
  set -e
6
6
 
7
+ # Use Node version from .nvmrc
8
+ export NVM_DIR="$HOME/.nvm"
9
+ if [ -s "$NVM_DIR/nvm.sh" ]; then
10
+ . "$NVM_DIR/nvm.sh"
11
+ nvm use 2>/dev/null
12
+ elif [ -d "$HOME/.nvm/versions/node" ]; then
13
+ NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
14
+ NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
15
+ [ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
16
+ fi
17
+
7
18
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
19
  PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
9
20
  CLAUDE_HOOKS_DIR="$HOME/.claude/hooks"
@@ -93,4 +104,4 @@ echo ""
93
104
  echo "The code_only mode creates a restricted environment similar to"
94
105
  echo "execute_code_py, where Claude can only perform computations."
95
106
  echo ""
96
- echo "✨ Ready to use with Claude Code!"
107
+ echo "✨ Ready to use with Claude Code!"
@@ -3,6 +3,17 @@
3
3
 
4
4
  set -e
5
5
 
6
+ # Use Node version from .nvmrc
7
+ export NVM_DIR="$HOME/.nvm"
8
+ if [ -s "$NVM_DIR/nvm.sh" ]; then
9
+ . "$NVM_DIR/nvm.sh"
10
+ nvm use 2>/dev/null
11
+ elif [ -d "$HOME/.nvm/versions/node" ]; then
12
+ NODE_VER=$(cat "$(git rev-parse --show-toplevel)/.nvmrc" 2>/dev/null || echo "20")
13
+ NODE_PATH=$(ls -d "$HOME/.nvm/versions/node/v${NODE_VER}"* 2>/dev/null | head -1)
14
+ [ -n "$NODE_PATH" ] && export PATH="$NODE_PATH/bin:$PATH"
15
+ fi
16
+
6
17
  HOOK_DIR="$HOME/.claude/hooks"
7
18
  SWEEP_DIR="$HOME/.stackmemory/sweep"
8
19
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -87,3 +98,4 @@ echo " - Check status: node $HOOK_DIR/post-edit-sweep.js --status"
87
98
  echo " - Clear state: node $HOOK_DIR/post-edit-sweep.js --clear"
88
99
  echo " - Disable: export SWEEP_ENABLED=false"
89
100
  echo ""
101
+