@ulrichc1/sparn 1.0.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/LICENSE +21 -0
- package/PRIVACY.md +350 -0
- package/README.md +683 -0
- package/SECURITY.md +247 -0
- package/dist/cli/index.cjs +1897 -0
- package/dist/cli/index.cjs.map +1 -0
- package/dist/cli/index.d.cts +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +1868 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.cjs +948 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +567 -0
- package/dist/index.d.ts +567 -0
- package/dist/index.js +900 -0
- package/dist/index.js.map +1 -0
- package/package.json +77 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 @ulrichc1
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/PRIVACY.md
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
# Privacy Policy
|
|
2
|
+
|
|
3
|
+
**Last Updated**: 2026-02-22
|
|
4
|
+
**Effective Date**: 2026-02-22
|
|
5
|
+
**Version**: 1.0
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## π Your Privacy Matters
|
|
10
|
+
|
|
11
|
+
Sparn is a **local-only CLI tool** that respects your privacy. We believe your data belongs to you, which is why Sparn never sends your data anywhere.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## π What Data Does Sparn Store?
|
|
16
|
+
|
|
17
|
+
All data is stored **locally on your machine** in the `.sparn/` directory within your project:
|
|
18
|
+
|
|
19
|
+
### 1. Context Content
|
|
20
|
+
- **What**: The AI agent context you choose to optimize
|
|
21
|
+
- **Where**: `.sparn/memory.db` (SQLite database)
|
|
22
|
+
- **Why**: To optimize and reduce token usage
|
|
23
|
+
- **Control**: You decide what content to optimize
|
|
24
|
+
|
|
25
|
+
### 2. Optimization Statistics
|
|
26
|
+
- **What**: Token counts, timestamps, performance metrics
|
|
27
|
+
- **Where**: `.sparn/memory.db` (SQLite database)
|
|
28
|
+
- **Why**: To track optimization effectiveness
|
|
29
|
+
- **Control**: View with `sparn stats`, delete with `sparn stats --reset`
|
|
30
|
+
|
|
31
|
+
### 3. Configuration
|
|
32
|
+
- **What**: Your preferences (theme, agent type, optimization settings)
|
|
33
|
+
- **Where**: `.sparn/config.yaml`
|
|
34
|
+
- **Why**: To customize Sparn's behavior
|
|
35
|
+
- **Control**: Edit with `sparn config` or text editor
|
|
36
|
+
|
|
37
|
+
### 4. Metadata
|
|
38
|
+
- **What**: Entry IDs, hashes, scores, timestamps
|
|
39
|
+
- **Where**: `.sparn/memory.db`
|
|
40
|
+
- **Why**: To manage memory lifecycle (decay, deduplication)
|
|
41
|
+
- **Control**: Managed automatically, visible in database
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## π« What Sparn Does NOT Do
|
|
46
|
+
|
|
47
|
+
We want to be crystal clear about what we **don't** do:
|
|
48
|
+
|
|
49
|
+
- β **No Data Transmission**: Sparn NEVER sends data to external servers
|
|
50
|
+
- β **No Telemetry**: We don't collect usage statistics or analytics
|
|
51
|
+
- β **No Tracking**: No cookies, no tracking pixels, no fingerprinting
|
|
52
|
+
- β **No Cloud Storage**: All data stays on your local machine
|
|
53
|
+
- β **No Third-Party Sharing**: Your data never leaves your computer
|
|
54
|
+
- β **No Personal Data Collection**: We don't collect names, emails, or identifiers
|
|
55
|
+
- β **No Account Required**: No sign-up, no registration, no login
|
|
56
|
+
|
|
57
|
+
**Bottom line**: Sparn works 100% offline. You could disconnect from the internet and it would still work perfectly.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## π How Your Data is Protected
|
|
62
|
+
|
|
63
|
+
### Local-Only Architecture
|
|
64
|
+
- All processing happens on your machine
|
|
65
|
+
- Data never transmitted over the network
|
|
66
|
+
- No risk of server breaches or interception
|
|
67
|
+
|
|
68
|
+
### File System Permissions
|
|
69
|
+
- Data protected by your OS file permissions
|
|
70
|
+
- Only you (and programs you run) can access `.sparn/`
|
|
71
|
+
- Standard file system security applies
|
|
72
|
+
|
|
73
|
+
### Database Integrity
|
|
74
|
+
- SQLite database with ACID compliance
|
|
75
|
+
- Automatic corruption detection
|
|
76
|
+
- Timestamped backups on corruption
|
|
77
|
+
|
|
78
|
+
### No External Dependencies
|
|
79
|
+
- Doesn't require internet connection
|
|
80
|
+
- No API keys or credentials needed
|
|
81
|
+
- Self-contained processing
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## ποΈ Your Data, Your Control
|
|
86
|
+
|
|
87
|
+
You have **complete control** over your data:
|
|
88
|
+
|
|
89
|
+
### Access Your Data β
|
|
90
|
+
View everything Sparn stores:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# View database structure
|
|
94
|
+
sqlite3 .sparn/memory.db ".schema"
|
|
95
|
+
|
|
96
|
+
# View stored entries
|
|
97
|
+
sqlite3 .sparn/memory.db "SELECT id, timestamp, score, state FROM entries_index LIMIT 10;"
|
|
98
|
+
|
|
99
|
+
# View statistics
|
|
100
|
+
sparn stats --json
|
|
101
|
+
|
|
102
|
+
# View configuration
|
|
103
|
+
cat .sparn/config.yaml
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Export Your Data β
|
|
107
|
+
Take your data anywhere:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Full database export (SQL format)
|
|
111
|
+
sqlite3 .sparn/memory.db .dump > sparn-backup.sql
|
|
112
|
+
|
|
113
|
+
# Export statistics (JSON format)
|
|
114
|
+
sparn stats --json > stats.json
|
|
115
|
+
|
|
116
|
+
# Copy entire directory
|
|
117
|
+
cp -r .sparn/ sparn-backup/
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Modify Your Data β
|
|
121
|
+
Change anything you want:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Edit configuration
|
|
125
|
+
sparn config set pruning.threshold 10
|
|
126
|
+
|
|
127
|
+
# Or edit directly
|
|
128
|
+
nano .sparn/config.yaml
|
|
129
|
+
|
|
130
|
+
# Modify database (advanced)
|
|
131
|
+
sqlite3 .sparn/memory.db "UPDATE entries_index SET score = 1.0 WHERE isBTSP = 1;"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Delete Your Data β
|
|
135
|
+
Remove data anytime:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Delete all Sparn data (complete removal)
|
|
139
|
+
rm -rf .sparn/
|
|
140
|
+
|
|
141
|
+
# Delete old/decayed entries only
|
|
142
|
+
sparn consolidate
|
|
143
|
+
|
|
144
|
+
# Clear statistics only
|
|
145
|
+
sparn stats --reset
|
|
146
|
+
|
|
147
|
+
# Uninstall Sparn entirely
|
|
148
|
+
npm uninstall sparn
|
|
149
|
+
rm -rf .sparn/
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## π GDPR & Privacy Regulations
|
|
155
|
+
|
|
156
|
+
### EU GDPR Compliance β
|
|
157
|
+
|
|
158
|
+
Sparn is **fully compliant** with the EU General Data Protection Regulation (GDPR):
|
|
159
|
+
|
|
160
|
+
#### Your Rights Under GDPR:
|
|
161
|
+
- β
**Right to Access** (Art. 15): Access all data in `.sparn/`
|
|
162
|
+
- β
**Right to Rectification** (Art. 16): Edit config or database
|
|
163
|
+
- β
**Right to Erasure** (Art. 17): Delete `.sparn/` directory
|
|
164
|
+
- β
**Right to Data Portability** (Art. 20): Export SQLite database
|
|
165
|
+
- β
**Right to Object** (Art. 21): Stop processing anytime
|
|
166
|
+
|
|
167
|
+
#### How Sparn Complies:
|
|
168
|
+
- **Data Minimization**: Only stores necessary data
|
|
169
|
+
- **Purpose Limitation**: Data used only for optimization
|
|
170
|
+
- **Storage Limitation**: TTL mechanism, automatic decay
|
|
171
|
+
- **Privacy by Design**: Local-only architecture
|
|
172
|
+
- **Security**: No transmission, file permissions, integrity checks
|
|
173
|
+
|
|
174
|
+
### Other Privacy Laws β
|
|
175
|
+
- π¬π§ **UK GDPR**: Compliant (same as EU GDPR)
|
|
176
|
+
- πΊπΈ **California CCPA**: Compliant (no data collection)
|
|
177
|
+
- π§π· **Brazil LGPD**: Compliant (local-only processing)
|
|
178
|
+
- π¨π¦ **Canada PIPEDA**: Compliant (no personal data)
|
|
179
|
+
- π¦πΊ **Australia Privacy Act**: Compliant
|
|
180
|
+
|
|
181
|
+
**Why Sparn is Universally Compliant**: Local-only tools don't trigger most privacy regulations because there's no data collection, transmission, or third-party processing.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## β οΈ Your Responsibilities
|
|
186
|
+
|
|
187
|
+
### When Using Sparn with Personal Data
|
|
188
|
+
|
|
189
|
+
If you choose to optimize context that contains **personal data** (names, emails, addresses, etc.), **you** are responsible for:
|
|
190
|
+
|
|
191
|
+
1. **Legal Basis**: Ensure you have the right to process this data
|
|
192
|
+
2. **Consent**: Obtain consent from data subjects if required
|
|
193
|
+
3. **Security**: Secure your machine and `.sparn/` directory
|
|
194
|
+
4. **Data Subject Rights**: Honor access/deletion requests from individuals
|
|
195
|
+
5. **Breach Notification**: Report breaches per applicable laws
|
|
196
|
+
|
|
197
|
+
**Example**: If you optimize customer support transcripts containing customer names and emails, you become the **data controller** and must comply with GDPR/privacy laws.
|
|
198
|
+
|
|
199
|
+
### Sparn's Role vs Your Role
|
|
200
|
+
|
|
201
|
+
- **Sparn (the tool)**: Provides local optimization functionality
|
|
202
|
+
- **You (the user)**: Decide what data to process and are responsible for compliance
|
|
203
|
+
|
|
204
|
+
This is similar to using Microsoft Word or Excel with personal dataβthe tool provider isn't responsible for your use of the tool.
|
|
205
|
+
|
|
206
|
+
### Best Practices
|
|
207
|
+
|
|
208
|
+
To minimize privacy risks:
|
|
209
|
+
- β
**Anonymize data** before optimization if possible
|
|
210
|
+
- β
**Remove PII** from context when not needed
|
|
211
|
+
- β
**Secure your machine** with encryption, passwords
|
|
212
|
+
- β
**Don't share** `.sparn/` directory with others
|
|
213
|
+
- β
**Regular cleanup** using `sparn consolidate`
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## π Data Retention
|
|
218
|
+
|
|
219
|
+
### Automatic Data Management
|
|
220
|
+
|
|
221
|
+
Sparn uses **neuroscience-inspired decay** to automatically manage data:
|
|
222
|
+
|
|
223
|
+
1. **Time-to-Live (TTL)**: Entries have configurable lifespans
|
|
224
|
+
2. **Engram Decay**: Scores decrease over time (like memory fading)
|
|
225
|
+
3. **State Transitions**: Old entries become "silent" (not retrieved)
|
|
226
|
+
4. **Consolidation**: `sparn consolidate` removes fully decayed entries
|
|
227
|
+
|
|
228
|
+
### Manual Data Control
|
|
229
|
+
|
|
230
|
+
You can control retention:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# Remove old/decayed data
|
|
234
|
+
sparn consolidate
|
|
235
|
+
|
|
236
|
+
# Adjust decay rate (config)
|
|
237
|
+
sparn config set decay.defaultTTL 24 # 24 hours
|
|
238
|
+
|
|
239
|
+
# Clear everything
|
|
240
|
+
rm -rf .sparn/
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### No Indefinite Storage
|
|
244
|
+
|
|
245
|
+
By design, Sparn doesn't keep data forever:
|
|
246
|
+
- Unused entries decay naturally
|
|
247
|
+
- Low-score entries are pruned during optimization
|
|
248
|
+
- Consolidation removes old data
|
|
249
|
+
- Database stays lean and efficient
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## π Transparency
|
|
254
|
+
|
|
255
|
+
### Open Source
|
|
256
|
+
|
|
257
|
+
Sparn is **open source** (MIT License):
|
|
258
|
+
- View all code: https://github.com/ulrichc1/sparn
|
|
259
|
+
- Verify no data transmission
|
|
260
|
+
- Review security measures
|
|
261
|
+
- Contribute improvements
|
|
262
|
+
|
|
263
|
+
### No Hidden Behavior
|
|
264
|
+
|
|
265
|
+
What you see is what you get:
|
|
266
|
+
- No compiled binaries with hidden code
|
|
267
|
+
- No obfuscation
|
|
268
|
+
- No analytics libraries
|
|
269
|
+
- No network dependencies
|
|
270
|
+
|
|
271
|
+
### Audit Trail
|
|
272
|
+
|
|
273
|
+
You can audit Sparn's behavior:
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
# Monitor file system access
|
|
277
|
+
strace -e open,write sparn optimize -i input.txt
|
|
278
|
+
|
|
279
|
+
# Monitor network (you'll see ZERO network calls)
|
|
280
|
+
tcpdump -i any host sparn
|
|
281
|
+
|
|
282
|
+
# Check for loaded network libraries
|
|
283
|
+
lsof -p $(pgrep sparn) | grep socket
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## π§ Privacy Questions?
|
|
289
|
+
|
|
290
|
+
### General Privacy Questions
|
|
291
|
+
- **Open a Discussion**: https://github.com/ulrichc1/sparn/discussions
|
|
292
|
+
- **Read the Code**: https://github.com/ulrichc1/sparn
|
|
293
|
+
- **Review GDPR Compliance**: See GDPR-COMPLIANCE.md (internal doc)
|
|
294
|
+
|
|
295
|
+
### Security Concerns
|
|
296
|
+
- **Security Policy**: See SECURITY.md
|
|
297
|
+
- **Report Vulnerabilities**: GitHub Security Advisories
|
|
298
|
+
|
|
299
|
+
### Legal Questions
|
|
300
|
+
- **Consult a Lawyer**: For specific legal advice about your use case
|
|
301
|
+
- **Review GDPR**: https://gdpr-info.eu/
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## π Changes to This Policy
|
|
306
|
+
|
|
307
|
+
We may update this Privacy Policy to reflect:
|
|
308
|
+
- New features or functionality
|
|
309
|
+
- Changes in privacy regulations
|
|
310
|
+
- User feedback and clarifications
|
|
311
|
+
|
|
312
|
+
**How We Notify You**:
|
|
313
|
+
- Version number updated in this document
|
|
314
|
+
- Change announced in release notes
|
|
315
|
+
- Commit history visible on GitHub
|
|
316
|
+
|
|
317
|
+
**Your Continued Use**: Using Sparn after policy changes means you accept the updated policy.
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## π Legal Disclaimer
|
|
322
|
+
|
|
323
|
+
This Privacy Policy describes how Sparn (the software tool) handles data. It does not constitute legal advice. If you use Sparn to process personal data, consult a qualified attorney about your obligations under applicable privacy laws.
|
|
324
|
+
|
|
325
|
+
**Tool Provider**: We provide Sparn as-is under the MIT License.
|
|
326
|
+
**Data Controller**: You (the user) are the data controller when you use Sparn.
|
|
327
|
+
**No Service Provider Relationship**: We don't provide data processing services.
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## β
Summary
|
|
332
|
+
|
|
333
|
+
- π **100% Local**: All data stays on your machine
|
|
334
|
+
- π« **Zero Tracking**: No telemetry, analytics, or tracking
|
|
335
|
+
- ποΈ **Full Control**: You own and control all data
|
|
336
|
+
- β
**GDPR Compliant**: Respects all data protection regulations
|
|
337
|
+
- π **Open Source**: Transparent, auditable code
|
|
338
|
+
- πΎ **Your Responsibility**: You control what data you process
|
|
339
|
+
|
|
340
|
+
**Privacy Score**: πππππ (5/5)
|
|
341
|
+
|
|
342
|
+
Sparn respects your privacy because your data never leaves your machine. Period.
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
**Questions?** Open a discussion on GitHub or review the source code.
|
|
347
|
+
|
|
348
|
+
**Effective Date**: 2026-02-22
|
|
349
|
+
**Version**: 1.0
|
|
350
|
+
**Last Updated**: 2026-02-22
|