@jeffober/thatch 0.1.43 → 0.1.45
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 +84 -9
- package/bin/thatch +307 -95
- package/docs/dev/README.md +12 -3
- package/docs/dev/features/README.md +1 -0
- package/docs/dev/features/cli.md +15 -17
- package/docs/dev/features/commands.md +74 -0
- package/docs/dev/features/cross-session-chat.md +128 -45
- package/docs/dev/features/database.md +7 -3
- package/docs/dev/features/extraction.md +5 -0
- package/docs/dev/features/multi-host.md +1 -1
- package/docs/dev/features/session-lifecycle.md +1 -1
- package/docs/dev/gotchas.md +20 -0
- package/docs/dev/mcp-parity.md +2 -0
- package/docs/dev/setup-and-hooks.md +20 -8
- package/docs/plans/thatch-actions.md +179 -0
- package/docs/user/README.md +10 -4
- package/docs/user/cli.md +45 -44
- package/docs/user/commands.md +50 -0
- package/docs/user/cross-session-chat.md +94 -22
- package/docs/user/setup.md +9 -3
- package/package.json +1 -1
- package/src/chat-names.ts +2 -2
- package/src/chat.ts +372 -185
- package/src/commands.ts +138 -19
- package/src/db.ts +46 -0
- package/src/debug.ts +44 -0
- package/src/embeddings.ts +42 -1
- package/src/index.ts +262 -39
- package/src/mcp.ts +78 -3
- package/src/prompts.ts +57 -3
- package/src/setup.ts +212 -33
- package/src/tool-defs.ts +115 -30
- package/src/watchers.ts +51 -29
package/README.md
CHANGED
|
@@ -51,6 +51,54 @@ thatch setup --claude --global # or --cursor --global
|
|
|
51
51
|
Restart your editor and thatch's tools are available as `mcp__thatch__*`.
|
|
52
52
|
Requires [Bun] on PATH.
|
|
53
53
|
|
|
54
|
+
The embedding model downloads once at first use. It is cached in the
|
|
55
|
+
platform's per-user cache dir: `~/Library/Caches/thatch/models` on macOS (or
|
|
56
|
+
`$XDG_CACHE_HOME/thatch/models` when `XDG_CACHE_HOME` is set),
|
|
57
|
+
`$XDG_CACHE_HOME/thatch/models` (default `~/.cache/thatch/models`) elsewhere.
|
|
58
|
+
Set `THATCH_MODEL_CACHE` to override the location. The cache survives
|
|
59
|
+
upgrades and works from read-only installs.
|
|
60
|
+
|
|
61
|
+
### NixOS / Nix
|
|
62
|
+
|
|
63
|
+
This repo is a flake. Bun and the native embedding runtime are bundled, so no
|
|
64
|
+
global `npm install` or `bun` on PATH is required.
|
|
65
|
+
|
|
66
|
+
Try it without installing:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
nix run github:sysread/thatch -- --version
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Install system-wide via the NixOS module (in your flake `configuration.nix`):
|
|
73
|
+
|
|
74
|
+
```nix
|
|
75
|
+
{
|
|
76
|
+
inputs.thatch.url = "github:sysread/thatch";
|
|
77
|
+
|
|
78
|
+
# in your NixOS system's modules:
|
|
79
|
+
imports = [ inputs.thatch.nixosModules.default ];
|
|
80
|
+
programs.thatch.enable = true; # puts `thatch` on PATH for every user
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Or add the package yourself with the overlay
|
|
85
|
+
(`nixpkgs.overlays = [ inputs.thatch.overlays.default ];` then
|
|
86
|
+
`environment.systemPackages = [ pkgs.thatch ];`), or drop
|
|
87
|
+
`inputs.thatch.packages.${system}.default` into a `home.packages` /
|
|
88
|
+
`environment.systemPackages` list directly.
|
|
89
|
+
|
|
90
|
+
Once `thatch` is on PATH, wire it into your editor as usual:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
cd /path/to/your/project
|
|
94
|
+
thatch setup --claude --global # or --cursor
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The embedding model still downloads once at first use and is cached in the
|
|
98
|
+
platform's per-user cache dir (the per-platform paths above; override with
|
|
99
|
+
`THATCH_MODEL_CACHE`), so it survives upgrades and works from the read-only
|
|
100
|
+
Nix store.
|
|
101
|
+
|
|
54
102
|
### Other MCP-compatible harnesses
|
|
55
103
|
|
|
56
104
|
```json
|
|
@@ -99,20 +147,26 @@ Thatch gives your agent:
|
|
|
99
147
|
(opencode, Claude Code, and Cursor; same machine). opencode sessions
|
|
100
148
|
join the directory automatically under an assigned, never-reused name
|
|
101
149
|
(a slug of the session title plus a counter); others see the roster, and
|
|
102
|
-
messages land in inboxes -- opencode sessions get woken with a
|
|
103
|
-
|
|
150
|
+
messages land in inboxes -- idle opencode sessions get woken with a
|
|
151
|
+
prompt, and Cursor and Claude Code wake when a turn ends with unread
|
|
152
|
+
mail (Cursor also at prompt time; Claude Code also at startup and
|
|
153
|
+
resume). Loop-safe:
|
|
104
154
|
messages are informational to the receiving agent, and wake prompts are
|
|
105
155
|
rate-capped. Delivered messages are framed as untrusted content so a
|
|
106
156
|
hostile message cannot impersonate your instructions. Disable the whole
|
|
107
157
|
feature with `chat.enabled: false` in the thatch config (or just the
|
|
108
158
|
auto-joining with `chat.autoRegister: false`).
|
|
109
|
-
- **
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
159
|
+
- **Slash commands** -- `/thatch/defrag` (consolidate duplicate memories),
|
|
160
|
+
`/thatch/extract` (drain the extraction queue now), `/thatch/hygiene`
|
|
161
|
+
(tend stale and orphaned memories), and `/thatch/reflect` (persist what
|
|
162
|
+
the session learned) run on demand the same behaviors the nudges run on
|
|
163
|
+
their own schedule. Plus the opencode-only wrap-ups: `/thatch/compact` and
|
|
164
|
+
`/thatch/exit` run a pre-flight checklist before a compaction or an exit:
|
|
165
|
+
the agent flushes pending fact extraction, finishes promised memory
|
|
166
|
+
writes, and surfaces todos or follow-ups it never addressed. It ends its
|
|
167
|
+
response with a greenlight token only when the checklist is clean; thatch
|
|
168
|
+
then triggers the compaction or quits opencode. With items outstanding,
|
|
169
|
+
the agent lists them and nothing fires -- you decide when to retry.
|
|
116
170
|
- **Notifications + user config** -- the agent can ping you out-of-band when a
|
|
117
171
|
long-running outcome lands: a desktop banner, a spoken voice
|
|
118
172
|
announcement, or both (macOS and Linux). Preferences live in a
|
|
@@ -129,6 +183,24 @@ See the [user guide](docs/user/README.md) for the full tool list, CLI
|
|
|
129
183
|
commands, configuration, environment variables, and detailed setup for each
|
|
130
184
|
host.
|
|
131
185
|
|
|
186
|
+
## What works in Claude Code
|
|
187
|
+
|
|
188
|
+
The memory tools, prediction and behavior engines, conversation search via
|
|
189
|
+
the `thatch session` CLI, cross-session chat (with stop-hook wake), skills,
|
|
190
|
+
and the on-demand actions `/thatch/defrag`, `/thatch/hygiene`, and
|
|
191
|
+
`/thatch/reflect` (synced by `thatch setup --claude`). Not available: the
|
|
192
|
+
wrap-up commands and `/thatch/extract` (they need the opencode plugin's
|
|
193
|
+
session identity and TUI control routes), live recall/prediction nudges
|
|
194
|
+
beyond the hook-based flow, and toast notifications.
|
|
195
|
+
|
|
196
|
+
## What works in Cursor
|
|
197
|
+
|
|
198
|
+
The same core set as Claude Code (memory, predictions, behaviors, chat with
|
|
199
|
+
stop-hook wake, skills, and the `defrag`/`hygiene`/`reflect` actions). Cursor
|
|
200
|
+
has no file-based slash commands, so the actions surface through MCP prompts
|
|
201
|
+
instead. Not available: the wrap-up commands, `/thatch/extract`, and toast
|
|
202
|
+
notifications.
|
|
203
|
+
|
|
132
204
|
## Privacy
|
|
133
205
|
|
|
134
206
|
Everything is local. The embedding model downloads once from Hugging Face Hub
|
|
@@ -150,6 +222,9 @@ bun install
|
|
|
150
222
|
mise run check # typecheck + bun test + markdownlint (the CI gate)
|
|
151
223
|
```
|
|
152
224
|
|
|
225
|
+
On Nix, `nix develop` drops you into a shell with bun, mise, and node already
|
|
226
|
+
on PATH -- no system install needed.
|
|
227
|
+
|
|
153
228
|
Tests never reach outside the sandbox: temp-directory SQLite files, mock
|
|
154
229
|
embeddings, no network.
|
|
155
230
|
|