@yurtsever/capsa 0.1.0-alpha.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 (33) hide show
  1. package/README.md +95 -0
  2. package/dist/index.js +40113 -0
  3. package/dist/ui/404.html +1 -0
  4. package/dist/ui/__next.__PAGE__.txt +6 -0
  5. package/dist/ui/__next._full.txt +16 -0
  6. package/dist/ui/__next._head.txt +6 -0
  7. package/dist/ui/__next._index.txt +6 -0
  8. package/dist/ui/__next._tree.txt +2 -0
  9. package/dist/ui/_next/static/K6Bslqz583LlweZHb60dJ/_buildManifest.js +11 -0
  10. package/dist/ui/_next/static/K6Bslqz583LlweZHb60dJ/_clientMiddlewareManifest.js +1 -0
  11. package/dist/ui/_next/static/K6Bslqz583LlweZHb60dJ/_ssgManifest.js +1 -0
  12. package/dist/ui/_next/static/chunks/03~yq9q893hmn.js +1 -0
  13. package/dist/ui/_next/static/chunks/04q3okw~r7w72.js +1 -0
  14. package/dist/ui/_next/static/chunks/04qeus~kw06ki.js +1 -0
  15. package/dist/ui/_next/static/chunks/0n_vjzua_x26v.css +2 -0
  16. package/dist/ui/_next/static/chunks/0nh42gwsv4oi6.js +1 -0
  17. package/dist/ui/_next/static/chunks/14o5ksci_1zd4.js +1 -0
  18. package/dist/ui/_next/static/chunks/15z35d-fzompq.js +5 -0
  19. package/dist/ui/_next/static/chunks/16o9b8utojqmg.js +31 -0
  20. package/dist/ui/_next/static/chunks/turbopack-06.nec4079olb.js +1 -0
  21. package/dist/ui/_next/static/media/favicon.0x3dzn~oxb6tn.ico +0 -0
  22. package/dist/ui/_not-found/__next._full.txt +17 -0
  23. package/dist/ui/_not-found/__next._head.txt +6 -0
  24. package/dist/ui/_not-found/__next._index.txt +6 -0
  25. package/dist/ui/_not-found/__next._not-found.__PAGE__.txt +5 -0
  26. package/dist/ui/_not-found/__next._not-found.txt +5 -0
  27. package/dist/ui/_not-found/__next._tree.txt +2 -0
  28. package/dist/ui/_not-found.html +1 -0
  29. package/dist/ui/_not-found.txt +17 -0
  30. package/dist/ui/favicon.ico +0 -0
  31. package/dist/ui/index.html +1 -0
  32. package/dist/ui/index.txt +16 -0
  33. package/package.json +60 -0
package/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # capsa
2
+
3
+ **Your project's knowledge in one capsule — and your coding agent gets exactly what it needs.**
4
+
5
+ Capsa is a local-first project memory for AI coding agents (Claude Code, Cursor, Continue, Cline). It indexes the knowledge that already lives in your repo — runbooks, tickets, plans, decisions, `CLAUDE.md`/`AGENTS.md`, Cursor rules, Claude Skills — and hands the agent the *smallest* relevant slice of it, over MCP, for every task.
6
+
7
+ Not more context. Less, and the right one. Every delivery is logged, so you can see what the agent saw and how many tokens it cost.
8
+
9
+ > Status: **MVP in progress.** Weeks 1–2 (indexer + MCP) are usable from source; the cockpit UI comes after the retrieval proof. See [`docs/idea/04-mvp-konzept.md`](docs/idea/04-mvp-konzept.md).
10
+
11
+ ## Quick start (from source)
12
+
13
+ Requirements: Node ≥ 22.13, bun, and [Ollama](https://ollama.com) with the embedding model:
14
+
15
+ ```sh
16
+ ollama pull bge-m3
17
+ ```
18
+
19
+ ```sh
20
+ git clone https://github.com/yurtsever/capsa
21
+ cd capsa
22
+ bun install
23
+ bun run build
24
+
25
+ # index a project (writes <project>/.capsa/index.db — git-ignore it)
26
+ node packages/cli/dist/index.js index ~/code/my-project
27
+
28
+ # what would an agent get for this task?
29
+ node packages/cli/dist/index.js search "add rate limiting to the login endpoint" ~/code/my-project
30
+
31
+ # where does the project stand?
32
+ node packages/cli/dist/index.js state ~/code/my-project
33
+ ```
34
+
35
+ Try it on capsa itself: `node packages/cli/dist/index.js index .` — the repo's own docs, ADRs and tickets are the first test corpus.
36
+
37
+ ## Wire it into your agent (MCP)
38
+
39
+ ```sh
40
+ claude mcp add capsa -- node /abs/path/to/capsa/packages/cli/dist/index.js mcp /abs/path/to/project
41
+ ```
42
+
43
+ Tools the agent gets:
44
+
45
+ | Tool | What it does |
46
+ |---|---|
47
+ | `get_context(task, maxTokens?)` | the smallest relevant set of project knowledge for a task (default budget 1500 tokens) |
48
+ | `get_project_state()` | open tickets/plans, recent decisions, recently changed knowledge |
49
+ | `record_decision(title, body, related?)` | write a decision back so future sessions retrieve it |
50
+
51
+ Once published, `npx capsa …` replaces the `node packages/cli/dist/index.js …` prefix.
52
+
53
+ ## What it indexes
54
+
55
+ | Kind | Where | Ranking signals |
56
+ |---|---|---|
57
+ | Instruction files | `CLAUDE.md`, `AGENTS.md`, `.cursorrules`, `.cursor/rules/*.mdc`, `SKILL.md` | kind |
58
+ | Runbooks / wiki | `docs/**/*.md`, `runbooks/**/*.md` | recency |
59
+ | Decisions | `docs/adr/**/*.md`, `decisions/**/*.md` | recency, kind |
60
+ | Tickets | `tickets/**/*.md`, `docs/tickets/**/*.md` | **status** from checkboxes or `status:` frontmatter, recency |
61
+ | Plans | `plans/**/*.md` | status, recency |
62
+
63
+ Adding a source is one adapter package (`packages/adapter-*`) — the scanner does not change.
64
+
65
+ ## How retrieval works
66
+
67
+ Vector search (bge-m3 via Ollama, [sqlite-vec](https://github.com/asg017/sqlite-vec)) and full-text search (FTS5) are fused with reciprocal rank fusion, then weighted by what the source can honestly claim about itself: how recent it is, whether it is still live (`in-progress` beats `done`), and what kind of knowledge it is. Results are filled greedily into the token budget, at most two chunks per file.
68
+
69
+ All of it lives in one SQLite file per project, `.capsa/index.db`. Every weight is a hypothesis; the `context_log` table is how they get corrected.
70
+
71
+ ## The web UI
72
+
73
+ `node packages/cli/dist/index.js [paths…]` starts the instruction-file library from skillary on `127.0.0.1:4820`. It is being redesigned into the cockpit (goal – state – history, context inspector, instructions) after the retrieval gate.
74
+
75
+ ## Local-first, by construction
76
+
77
+ - The server binds `127.0.0.1`, never `0.0.0.0`.
78
+ - Capsa never edits your files. It writes exactly two things: its own index under `.capsa/`, and decisions an agent explicitly records.
79
+ - No telemetry, no accounts, no network beyond `localhost:11434` (Ollama).
80
+
81
+ ## Development
82
+
83
+ See [`docs/runbooks/development.md`](docs/runbooks/development.md) and [`CLAUDE.md`](CLAUDE.md).
84
+
85
+ ```sh
86
+ bun run build && bun run test && bun run typecheck
87
+ ```
88
+
89
+ ## Heritage
90
+
91
+ Capsa grew out of [skillary](https://github.com/yurtsever/skillary), a read-only library for AI instruction files. The scanner, adapters, server and UI are its; see [`docs/adr/001-build-on-skillary.md`](docs/adr/001-build-on-skillary.md).
92
+
93
+ ## License
94
+
95
+ MIT