@ulrichc1/sparn 1.0.1 → 1.1.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.
- package/README.md +38 -6
- package/dist/cli/index.cjs +646 -15
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +639 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/daemon/index.cjs +882 -0
- package/dist/daemon/index.cjs.map +1 -0
- package/dist/daemon/index.d.cts +2 -0
- package/dist/daemon/index.d.ts +2 -0
- package/dist/daemon/index.js +880 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/hooks/post-tool-result.cjs +270 -0
- package/dist/hooks/post-tool-result.cjs.map +1 -0
- package/dist/hooks/post-tool-result.d.cts +1 -0
- package/dist/hooks/post-tool-result.d.ts +1 -0
- package/dist/hooks/post-tool-result.js +269 -0
- package/dist/hooks/post-tool-result.js.map +1 -0
- package/dist/hooks/pre-prompt.cjs +287 -0
- package/dist/hooks/pre-prompt.cjs.map +1 -0
- package/dist/hooks/pre-prompt.d.cts +1 -0
- package/dist/hooks/pre-prompt.d.ts +1 -0
- package/dist/hooks/pre-prompt.js +286 -0
- package/dist/hooks/pre-prompt.js.map +1 -0
- package/dist/index.cjs +961 -68
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +459 -20
- package/dist/index.d.ts +459 -20
- package/dist/index.js +956 -66
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
> 🧠 Neuroscience-inspired context optimization for AI coding agents
|
|
8
8
|
|
|
9
|
-
**Status**: ✅ **Production Ready** - All Core Features Complete
|
|
9
|
+
**Status**: ✅ **Production Ready** - All Core Features Complete + Real-Time Optimization
|
|
10
10
|
|
|
11
|
-
**Version**: 1.
|
|
11
|
+
**Version**: 1.1.0
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -38,10 +38,17 @@ Sparn is an npm CLI package that applies 6 neuroscience principles to intelligen
|
|
|
38
38
|
- GenericAdapter + ClaudeCodeAdapter (Agent-Agnostic)
|
|
39
39
|
- SleepCompressor (Sleep Replay)
|
|
40
40
|
- ✅ **Context Optimization** - 60-90% token reduction pipeline
|
|
41
|
-
- ✅ **
|
|
41
|
+
- ✅ **Real-Time Optimization** (NEW!) - Always-on background daemon and hooks
|
|
42
|
+
- Background daemon with auto-optimization at 80K token threshold
|
|
43
|
+
- Claude Code hooks (pre-prompt & post-tool-result)
|
|
44
|
+
- Incremental optimization with <50ms delta processing
|
|
45
|
+
- Budget-aware pruning targeting specific token counts
|
|
46
|
+
- Tool output compression (npm, docker, tests, git diffs)
|
|
47
|
+
- ✅ **CLI Commands** - init, optimize, stats, relay, consolidate, config, daemon, hooks
|
|
42
48
|
- ✅ **Programmatic API** - Full TypeScript support, JSDoc, standalone modules
|
|
43
49
|
- ✅ **Database** - SQLite with dual index/value tables, corruption detection
|
|
44
50
|
- ✅ **Configuration** - YAML config with runtime modification
|
|
51
|
+
- ✅ **Metrics & Telemetry** - P50/P95/P99 latency tracking, cache hit rates, token savings
|
|
45
52
|
|
|
46
53
|
### ✨ Polish & UX
|
|
47
54
|
- ✨ **Progress Indicators** - Real-time ora spinners for all long operations
|
|
@@ -52,10 +59,10 @@ Sparn is an npm CLI package that applies 6 neuroscience principles to intelligen
|
|
|
52
59
|
- ✨ **Lazy Loading** - Fast startup (<200ms for --help/--version)
|
|
53
60
|
|
|
54
61
|
### 📊 Quality & CI/CD
|
|
55
|
-
- 📊 **
|
|
56
|
-
- 📊 **Benchmarks** -
|
|
62
|
+
- 📊 **176 Tests** - Comprehensive unit + integration test coverage, all passing
|
|
63
|
+
- 📊 **Performance Benchmarks** - Validates <50ms incremental optimization target
|
|
57
64
|
- 📊 **CI Pipeline** - GitHub Actions with cross-platform tests (Ubuntu, macOS, Windows)
|
|
58
|
-
- 📊 **Documentation** - NEUROSCIENCE.md, CONTRIBUTING.md, comprehensive README
|
|
65
|
+
- 📊 **Documentation** - NEUROSCIENCE.md, CONTRIBUTING.md, CHANGELOG.md, comprehensive README
|
|
59
66
|
- 📊 **NPM Ready** - Package validated with publish --dry-run
|
|
60
67
|
|
|
61
68
|
---
|
|
@@ -120,6 +127,31 @@ Before/after token savings with progress bars and celebration messages:
|
|
|
120
127
|
|
|
121
128
|
---
|
|
122
129
|
|
|
130
|
+
## 🤖 Claude Code Integration
|
|
131
|
+
|
|
132
|
+
**NEW!** Sparn now integrates with Claude Code CLI for real-time context optimization!
|
|
133
|
+
|
|
134
|
+
### Quick Start with Claude Code
|
|
135
|
+
|
|
136
|
+
1. **Install the skill**:
|
|
137
|
+
```bash
|
|
138
|
+
# Skill is pre-installed at ~/.claude/skills/sparn/
|
|
139
|
+
# Just ensure Sparn is installed globally
|
|
140
|
+
npm install -g @ulrichc1/sparn
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
2. **Use in Claude Code**:
|
|
144
|
+
```bash
|
|
145
|
+
claude-code
|
|
146
|
+
> /sparn.go # Start real-time optimization
|
|
147
|
+
> /sparn.optimize # Manual optimization
|
|
148
|
+
> /sparn.stats # View statistics
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**See** [`CLAUDE-CODE-SKILL.md`](./CLAUDE-CODE-SKILL.md) **for complete documentation.**
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
123
155
|
## Installation
|
|
124
156
|
|
|
125
157
|
### Global CLI Install
|