@ulrichc1/sparn 1.0.0 → 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 +46 -10
- package/dist/cli/index.cjs +646 -15
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +640 -7
- 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
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
# Sparn
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@ulrichc1/sparn)
|
|
4
|
+
[](https://www.npmjs.com/package/@ulrichc1/sparn)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
3
7
|
> 🧠 Neuroscience-inspired context optimization for AI coding agents
|
|
4
8
|
|
|
5
|
-
**Status**: ✅ **Production Ready** - All Core Features Complete
|
|
9
|
+
**Status**: ✅ **Production Ready** - All Core Features Complete + Real-Time Optimization
|
|
6
10
|
|
|
7
|
-
**Version**: 1.
|
|
11
|
+
**Version**: 1.1.0
|
|
8
12
|
|
|
9
13
|
---
|
|
10
14
|
|
|
@@ -34,10 +38,17 @@ Sparn is an npm CLI package that applies 6 neuroscience principles to intelligen
|
|
|
34
38
|
- GenericAdapter + ClaudeCodeAdapter (Agent-Agnostic)
|
|
35
39
|
- SleepCompressor (Sleep Replay)
|
|
36
40
|
- ✅ **Context Optimization** - 60-90% token reduction pipeline
|
|
37
|
-
- ✅ **
|
|
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
|
|
38
48
|
- ✅ **Programmatic API** - Full TypeScript support, JSDoc, standalone modules
|
|
39
49
|
- ✅ **Database** - SQLite with dual index/value tables, corruption detection
|
|
40
50
|
- ✅ **Configuration** - YAML config with runtime modification
|
|
51
|
+
- ✅ **Metrics & Telemetry** - P50/P95/P99 latency tracking, cache hit rates, token savings
|
|
41
52
|
|
|
42
53
|
### ✨ Polish & UX
|
|
43
54
|
- ✨ **Progress Indicators** - Real-time ora spinners for all long operations
|
|
@@ -48,10 +59,10 @@ Sparn is an npm CLI package that applies 6 neuroscience principles to intelligen
|
|
|
48
59
|
- ✨ **Lazy Loading** - Fast startup (<200ms for --help/--version)
|
|
49
60
|
|
|
50
61
|
### 📊 Quality & CI/CD
|
|
51
|
-
- 📊 **
|
|
52
|
-
- 📊 **Benchmarks** -
|
|
62
|
+
- 📊 **176 Tests** - Comprehensive unit + integration test coverage, all passing
|
|
63
|
+
- 📊 **Performance Benchmarks** - Validates <50ms incremental optimization target
|
|
53
64
|
- 📊 **CI Pipeline** - GitHub Actions with cross-platform tests (Ubuntu, macOS, Windows)
|
|
54
|
-
- 📊 **Documentation** - NEUROSCIENCE.md, CONTRIBUTING.md, comprehensive README
|
|
65
|
+
- 📊 **Documentation** - NEUROSCIENCE.md, CONTRIBUTING.md, CHANGELOG.md, comprehensive README
|
|
55
66
|
- 📊 **NPM Ready** - Package validated with publish --dry-run
|
|
56
67
|
|
|
57
68
|
---
|
|
@@ -116,12 +127,37 @@ Before/after token savings with progress bars and celebration messages:
|
|
|
116
127
|
|
|
117
128
|
---
|
|
118
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
|
+
|
|
119
155
|
## Installation
|
|
120
156
|
|
|
121
157
|
### Global CLI Install
|
|
122
158
|
|
|
123
159
|
```bash
|
|
124
|
-
npm install -g sparn
|
|
160
|
+
npm install -g @ulrichc1/sparn
|
|
125
161
|
|
|
126
162
|
# Verify installation
|
|
127
163
|
sparn --version
|
|
@@ -130,11 +166,11 @@ sparn --version
|
|
|
130
166
|
### Project Dependency
|
|
131
167
|
|
|
132
168
|
```bash
|
|
133
|
-
npm install sparn
|
|
169
|
+
npm install @ulrichc1/sparn
|
|
134
170
|
|
|
135
171
|
# Or with other package managers
|
|
136
|
-
yarn add sparn
|
|
137
|
-
pnpm add sparn
|
|
172
|
+
yarn add @ulrichc1/sparn
|
|
173
|
+
pnpm add @ulrichc1/sparn
|
|
138
174
|
```
|
|
139
175
|
|
|
140
176
|
---
|