@stackmemoryai/stackmemory 1.2.1 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/cli/codex-sm.js +6 -8
- package/dist/src/cli/commands/config.js +0 -81
- package/dist/src/cli/commands/context-rehydrate.js +133 -47
- package/dist/src/cli/commands/db.js +35 -8
- package/dist/src/cli/commands/handoff.js +1 -1
- package/dist/src/cli/commands/linear.js +9 -0
- package/dist/src/cli/commands/ralph.js +2 -2
- package/dist/src/cli/commands/setup.js +2 -2
- package/dist/src/cli/commands/signup.js +3 -1
- package/dist/src/cli/commands/skills.js +123 -1
- package/dist/src/cli/commands/storage-tier.js +26 -8
- package/dist/src/cli/index.js +1 -57
- package/dist/src/core/config/feature-flags.js +0 -4
- package/dist/src/core/context/dual-stack-manager.js +10 -3
- package/dist/src/core/context/frame-database.js +32 -0
- package/dist/src/core/context/frame-handoff-manager.js +2 -2
- package/dist/src/core/context/{refactored-frame-manager.js → frame-manager.js} +3 -3
- package/dist/src/core/context/index.js +2 -2
- package/dist/src/core/database/sqlite-adapter.js +161 -1
- package/dist/src/core/digest/frame-digest-integration.js +1 -1
- package/dist/src/core/digest/index.js +1 -1
- package/dist/src/core/execution/parallel-executor.js +5 -1
- package/dist/src/core/projects/project-isolation.js +18 -4
- package/dist/src/core/security/index.js +2 -0
- package/dist/src/core/security/input-sanitizer.js +23 -0
- package/dist/src/core/utils/update-checker.js +10 -6
- package/dist/src/daemon/daemon-config.js +2 -1
- package/dist/src/daemon/services/auto-save-service.js +121 -0
- package/dist/src/daemon/services/maintenance-service.js +76 -1
- package/dist/src/features/sweep/prompt-builder.js +2 -2
- package/dist/src/hooks/graphiti-hooks.js +149 -0
- package/dist/src/hooks/session-summary.js +30 -0
- package/dist/src/integrations/graphiti/linear-graphiti-bridge.js +115 -0
- package/dist/src/integrations/greptile/client.js +101 -0
- package/dist/src/integrations/greptile/config.js +14 -0
- package/dist/src/integrations/greptile/index.js +11 -0
- package/dist/src/integrations/greptile/types.js +4 -0
- package/dist/src/integrations/linear/config.js +3 -1
- package/dist/src/integrations/linear/sync.js +18 -5
- package/dist/src/integrations/linear/webhook.js +16 -0
- package/dist/src/integrations/mcp/handlers/code-execution-handlers.js +33 -7
- package/dist/src/integrations/mcp/handlers/cord-handlers.js +397 -0
- package/dist/src/integrations/mcp/handlers/greptile-handlers.js +456 -0
- package/dist/src/integrations/mcp/handlers/index.js +55 -1
- package/dist/src/integrations/mcp/handlers/task-handlers.js +55 -12
- package/dist/src/integrations/mcp/handlers/team-handlers.js +211 -0
- package/dist/src/integrations/mcp/handlers/trace-handlers.js +25 -9
- package/dist/src/integrations/mcp/index.js +2 -2
- package/dist/src/integrations/mcp/refactored-server.js +31 -10
- package/dist/src/integrations/mcp/server.js +27 -0
- package/dist/src/integrations/mcp/tool-definitions.js +215 -1
- package/dist/src/integrations/ralph/context/context-budget-manager.js +10 -2
- package/dist/src/integrations/ralph/context/stackmemory-context-loader.js +54 -22
- package/dist/src/integrations/ralph/learning/pattern-learner.js +59 -24
- package/dist/src/integrations/ralph/orchestration/multi-loop-orchestrator.js +81 -35
- package/dist/src/integrations/ralph/patterns/compounding-engineering-pattern.js +12 -4
- package/dist/src/integrations/ralph/patterns/extended-coherence-sessions.js +32 -9
- package/dist/src/integrations/ralph/swarm/git-workflow-manager.js +25 -8
- package/dist/src/integrations/ralph/swarm/swarm-coordinator.js +17 -5
- package/dist/src/integrations/ralph/visualization/ralph-debugger.js +73 -22
- package/dist/src/skills/claude-skills.js +46 -103
- package/dist/src/skills/parallel-agent-skill.js +514 -0
- package/dist/src/utils/hook-installer.js +8 -0
- package/package.json +5 -5
- package/scripts/gepa/.before-optimize.md +140 -159
- package/scripts/gepa/config.json +7 -1
- package/scripts/gepa/evals/fixtures/api-endpoint.ts +31 -0
- package/scripts/gepa/evals/fixtures/brittle-integration.ts +38 -0
- package/scripts/gepa/evals/fixtures/fts5-triggers.sql +23 -0
- package/scripts/gepa/evals/fixtures/leaky-service.ts +70 -0
- package/scripts/gepa/evals/fixtures/mcp-dispatch-stub.ts +39 -0
- package/scripts/gepa/evals/fixtures/pr-diff.txt +24 -0
- package/scripts/gepa/evals/fixtures/unsafe-webhook.ts +34 -0
- package/scripts/gepa/evals/fixtures/unwrapped-db-op.ts +42 -0
- package/scripts/gepa/evals/stackmemory-tasks.jsonl +8 -0
- package/scripts/gepa/generations/gen-000/baseline.md +172 -159
- package/scripts/gepa/generations/gen-001/baseline.md +172 -159
- package/scripts/gepa/generations/gen-001/variant-a.md +156 -146
- package/scripts/gepa/generations/gen-001/variant-b.md +199 -170
- package/scripts/gepa/generations/gen-001/variant-c.md +127 -46
- package/scripts/gepa/generations/gen-001/variant-d.md +160 -107
- package/scripts/gepa/hooks/reflect.js +44 -5
- package/scripts/gepa/optimize.js +281 -39
- package/scripts/gepa/results/eval-1-baseline.json +187 -10
- package/scripts/gepa/results/eval-1-variant-a.json +188 -11
- package/scripts/gepa/results/eval-1-variant-b.json +188 -11
- package/scripts/gepa/results/eval-1-variant-c.json +168 -11
- package/scripts/gepa/results/eval-1-variant-d.json +169 -12
- package/scripts/gepa/state.json +18 -18
- package/scripts/install-claude-hooks-auto.js +8 -0
- package/templates/claude-hooks/cord-trace.js +225 -0
- package/dist/src/core/config/storage-config.js +0 -114
- package/dist/src/core/storage/chromadb-adapter.js +0 -379
- package/dist/src/integrations/claude-code/enhanced-pre-clear-hooks.js +0 -458
- package/dist/src/integrations/ralph/coordination/enhanced-coordination.js +0 -409
- package/dist/src/skills/repo-ingestion-skill.js +0 -631
- package/templates/claude-hooks/chromadb-wrapper +0 -21
- /package/dist/src/core/context/{enhanced-rehydration.js → rehydration.js} +0 -0
- /package/dist/src/core/digest/{enhanced-hybrid-digest.js → hybrid-digest.js} +0 -0
- /package/dist/src/core/session/{enhanced-handoff.js → handoff.js} +0 -0
|
@@ -1,159 +1,172 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
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104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
1
|
+
# StackMemory - Project Configuration
|
|
2
|
+
|
|
3
|
+
## Project Structure
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
src/
|
|
7
|
+
cli/ # CLI commands and entry point
|
|
8
|
+
core/ # Core business logic
|
|
9
|
+
context/ # Frame and context management
|
|
10
|
+
database/ # Database adapters (SQLite, ParadeDB)
|
|
11
|
+
digest/ # Digest generation
|
|
12
|
+
query/ # Query parsing and routing
|
|
13
|
+
integrations/ # External integrations (Linear, MCP)
|
|
14
|
+
services/ # Business services
|
|
15
|
+
skills/ # Claude Code skills
|
|
16
|
+
utils/ # Shared utilities
|
|
17
|
+
scripts/ # Build and utility scripts
|
|
18
|
+
config/ # Configuration files
|
|
19
|
+
docs/ # Documentation
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Key Files
|
|
23
|
+
|
|
24
|
+
- Entry: src/cli/index.ts
|
|
25
|
+
- MCP Server: src/integrations/mcp/server.ts
|
|
26
|
+
- Frame Manager: src/core/context/frame-manager.ts
|
|
27
|
+
- Database: src/core/database/sqlite-adapter.ts
|
|
28
|
+
|
|
29
|
+
## Detailed Guides
|
|
30
|
+
|
|
31
|
+
Quick reference (agent_docs/):
|
|
32
|
+
- linear_integration.md - Linear sync
|
|
33
|
+
- mcp_server.md - MCP tools
|
|
34
|
+
- database_storage.md - Storage
|
|
35
|
+
- claude_hooks.md - Hooks
|
|
36
|
+
|
|
37
|
+
Full documentation (docs/):
|
|
38
|
+
- principles.md - Agent programming paradigm
|
|
39
|
+
- architecture.md - Extension model and browser sandbox
|
|
40
|
+
- SPEC.md - Technical specification
|
|
41
|
+
- API_REFERENCE.md - API docs
|
|
42
|
+
- DEVELOPMENT.md - Dev guide
|
|
43
|
+
- SETUP.md - Installation
|
|
44
|
+
|
|
45
|
+
## Commands
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm run build # Compile TypeScript (esbuild)
|
|
49
|
+
npm run lint # ESLint check
|
|
50
|
+
npm run lint:fix # Auto-fix lint issues
|
|
51
|
+
npm test # Run Vitest (watch)
|
|
52
|
+
npm run test:run # Run tests once
|
|
53
|
+
npm run linear:sync # Sync with Linear
|
|
54
|
+
|
|
55
|
+
# StackMemory CLI
|
|
56
|
+
stackmemory capture # Save session state for handoff
|
|
57
|
+
stackmemory restore # Restore from captured state
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Working Directory
|
|
61
|
+
|
|
62
|
+
- PRIMARY: /Users/jwu/Dev/stackmemory
|
|
63
|
+
- ALLOWED: All subdirectories
|
|
64
|
+
- TEMP: /tmp for temporary operations
|
|
65
|
+
|
|
66
|
+
## Validation (MUST DO)
|
|
67
|
+
|
|
68
|
+
After code changes:
|
|
69
|
+
1. `npm run lint` - fix any errors AND warnings
|
|
70
|
+
2. `npm run test:run` - verify no regressions
|
|
71
|
+
3. `npm run build` - ensure compilation
|
|
72
|
+
4. Run code to verify it works
|
|
73
|
+
|
|
74
|
+
Test coverage:
|
|
75
|
+
- New features require tests in `src/**/__tests__/`
|
|
76
|
+
- Maintain or improve coverage (no untested code paths)
|
|
77
|
+
- Critical paths: context management, handoff, Linear sync
|
|
78
|
+
|
|
79
|
+
Never: Assume success | Skip testing | Use mock data as fallback
|
|
80
|
+
|
|
81
|
+
## Git Rules (CRITICAL)
|
|
82
|
+
|
|
83
|
+
- NEVER use `--no-verify` on git push or commit
|
|
84
|
+
- ALWAYS fix lint/test errors before pushing
|
|
85
|
+
- If pre-push hooks fail, fix the underlying issue
|
|
86
|
+
- Run `npm run lint && npm run test:run` before pushing
|
|
87
|
+
- Commit message format: `type(scope): message`
|
|
88
|
+
- Branch naming: `feature/STA-XXX-description` | `fix/STA-XXX-description` | `chore/description`
|
|
89
|
+
|
|
90
|
+
## Task Management
|
|
91
|
+
|
|
92
|
+
- Use TodoWrite for 3+ steps or multiple requests
|
|
93
|
+
- Keep one task in_progress at a time
|
|
94
|
+
- Update task status immediately on completion
|
|
95
|
+
|
|
96
|
+
## Security
|
|
97
|
+
|
|
98
|
+
NEVER hardcode secrets - use process.env with dotenv/config
|
|
99
|
+
|
|
100
|
+
```javascript
|
|
101
|
+
import 'dotenv/config';
|
|
102
|
+
const API_KEY = process.env.LINEAR_API_KEY;
|
|
103
|
+
if (!API_KEY) {
|
|
104
|
+
console.error('LINEAR_API_KEY not set');
|
|
105
|
+
process.exit(1);
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Environment sources (check in order):
|
|
110
|
+
1. .env file
|
|
111
|
+
2. .env.local
|
|
112
|
+
3. ~/.zshrc
|
|
113
|
+
4. Process environment
|
|
114
|
+
|
|
115
|
+
Secret patterns to block: lin_api_* | lin_oauth_* | sk-* | npm_*
|
|
116
|
+
|
|
117
|
+
## Deploy
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# npm publish (uses NPM_TOKEN from .env, no OTP needed)
|
|
121
|
+
git stash -- scripts/gepa/ # stash GEPA state (dirties working tree)
|
|
122
|
+
NPM_TOKEN=$(grep '^NPM_TOKEN=' .env | cut -d= -f2) \
|
|
123
|
+
npm publish --registry https://registry.npmjs.org/ \
|
|
124
|
+
--//registry.npmjs.org/:_authToken="$NPM_TOKEN"
|
|
125
|
+
git stash pop # restore GEPA state
|
|
126
|
+
|
|
127
|
+
# Railway
|
|
128
|
+
railway up
|
|
129
|
+
|
|
130
|
+
# Pre-publish checks require clean git status — stash GEPA files first
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Task Delegation Model
|
|
134
|
+
|
|
135
|
+
Route effort by task complexity — not all code changes deserve equal scrutiny:
|
|
136
|
+
|
|
137
|
+
**AUTOMATE** — Execute immediately, lint+test is sufficient:
|
|
138
|
+
- CRUD operations, boilerplate, formatting, simple transforms
|
|
139
|
+
- Adding a tool handler following existing switch/case pattern
|
|
140
|
+
- Config additions (new env var, feature flag)
|
|
141
|
+
|
|
142
|
+
**STANDARD** — Normal workflow, lint+test+build:
|
|
143
|
+
- Feature implementation, bug fixes, refactoring
|
|
144
|
+
- New test coverage, documentation updates
|
|
145
|
+
- Integration wiring (adding handler to server.ts dispatch)
|
|
146
|
+
|
|
147
|
+
**CAREFUL** — Review approach before implementation:
|
|
148
|
+
- API/schema changes, database migrations, auth flows
|
|
149
|
+
- New integration patterns (MCP tools, webhook handlers)
|
|
150
|
+
- Changes to frame-manager, sqlite-adapter, or daemon lifecycle
|
|
151
|
+
- Anything touching error handling chains
|
|
152
|
+
|
|
153
|
+
**ARCHITECT** — Plan mode required, explore existing patterns first:
|
|
154
|
+
- New service boundaries, system integrations
|
|
155
|
+
- Performance-critical paths (FTS5 queries, search scoring)
|
|
156
|
+
- Breaking changes to MCP protocol or CLI interface
|
|
157
|
+
|
|
158
|
+
**HUMAN** — Explicit user approval before any changes:
|
|
159
|
+
- Security-critical decisions, secret handling
|
|
160
|
+
- Irreversible operations (data migrations, schema drops)
|
|
161
|
+
- Publishing (npm publish, Railway deploy)
|
|
162
|
+
|
|
163
|
+
Quality gates scale with tier — don't over-engineer AUTOMATE tasks, don't under-review CAREFUL ones.
|
|
164
|
+
|
|
165
|
+
## Workflow
|
|
166
|
+
|
|
167
|
+
- Check .env for API keys before asking
|
|
168
|
+
- Run npm run linear:sync after task completion
|
|
169
|
+
- Use browser MCP for visual testing
|
|
170
|
+
- Review recent commits and stackmemory.json on session start
|
|
171
|
+
- Use subagents for multi-step tasks
|
|
172
|
+
- Ask 1-3 clarifying questions for complex commands (one at a time)
|