@jeffober/thatch 0.1.45 → 0.1.46

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 CHANGED
@@ -60,8 +60,8 @@ upgrades and works from read-only installs.
60
60
 
61
61
  ### NixOS / Nix
62
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.
63
+ This repo is a flake. The package bundles Bun and the native embedding
64
+ runtime, so you need no global `npm install` and no `bun` on PATH.
65
65
 
66
66
  Try it without installing:
67
67
 
@@ -69,23 +69,24 @@ Try it without installing:
69
69
  nix run github:sysread/thatch -- --version
70
70
  ```
71
71
 
72
- Install system-wide via the NixOS module (in your flake `configuration.nix`):
72
+ Install options:
73
73
 
74
- ```nix
75
- {
76
- inputs.thatch.url = "github:sysread/thatch";
74
+ - **NixOS module** (system-wide, all users):
77
75
 
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
- ```
76
+ ```nix
77
+ {
78
+ inputs.thatch.url = "github:sysread/thatch";
79
+
80
+ # in your NixOS system's modules:
81
+ imports = [ inputs.thatch.nixosModules.default ];
82
+ programs.thatch.enable = true; # puts `thatch` on PATH for every user
83
+ }
84
+ ```
83
85
 
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.
86
+ - **Overlay**: add `nixpkgs.overlays = [ inputs.thatch.overlays.default ];`,
87
+ then `environment.systemPackages = [ pkgs.thatch ];`
88
+ - **Package directly**: add `inputs.thatch.packages.${system}.default` to a
89
+ `home.packages` or `environment.systemPackages` list
89
90
 
90
91
  Once `thatch` is on PATH, wire it into your editor as usual:
91
92
 
@@ -94,10 +95,9 @@ cd /path/to/your/project
94
95
  thatch setup --claude --global # or --cursor
95
96
  ```
96
97
 
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.
98
+ The embedding model still downloads once at first use. Its cache lives in the
99
+ per-user cache dir described above, outside the read-only Nix store, so it
100
+ survives upgrades. `THATCH_MODEL_CACHE` overrides the location.
101
101
 
102
102
  ### Other MCP-compatible harnesses
103
103
 
@@ -110,7 +110,7 @@ Nix store.
110
110
  ```
111
111
 
112
112
  Include thatch's instructions in your agent's system prompt manually; see
113
- [docs/dev/mcp-parity.md](docs/dev/mcp-parity.md) for the prompt text.
113
+ [MCP parity](https://github.com/sysread/thatch/wiki/Mcp-Parity) for the prompt text.
114
114
 
115
115
  ## What's inside
116
116
 
@@ -179,7 +179,7 @@ review, review response, change and feature walkthroughs, memory verification,
179
179
  knowledge export, and writing tasks
180
180
  (PR descriptions, tickets, PR splitting).
181
181
 
182
- See the [user guide](docs/user/README.md) for the full tool list, CLI
182
+ See the [user guide](https://github.com/sysread/thatch/wiki/Guide%3A-Overview) for the full tool list, CLI
183
183
  commands, configuration, environment variables, and detailed setup for each
184
184
  host.
185
185
 
@@ -230,11 +230,11 @@ embeddings, no network.
230
230
 
231
231
  ## Docs
232
232
 
233
- - [User guide](docs/user/README.md) -- setup, tools, configuration, CLI
234
- - [Development](docs/dev/README.md) -- architecture, module responsibilities
235
- - [MCP parity](docs/dev/mcp-parity.md) -- OpenCode plugin vs MCP feature comparison
236
- - [QA tests](tests/qa/) -- executable use cases (auto/ and live/ subdirs)
237
- - [Design docs](docs/plans/) -- design-decision snapshots and in-progress plans
233
+ - [User guide](https://github.com/sysread/thatch/wiki/Guide%3A-Overview) -- setup, tools, configuration, CLI
234
+ - [Development](https://github.com/sysread/thatch/wiki/Developer-Guide) -- architecture, module responsibilities
235
+ - [MCP parity](https://github.com/sysread/thatch/wiki/Mcp-Parity) -- OpenCode plugin vs MCP feature comparison
236
+ - [QA tests](https://github.com/sysread/thatch/tree/main/tests/qa) -- executable use cases (auto/ and live/ subdirs)
237
+ - [Design docs](https://github.com/sysread/thatch/tree/main/docs/plans) -- design-decision snapshots and in-progress plans
238
238
 
239
239
  ## License
240
240
 
@@ -5,7 +5,7 @@ Thatch uses GitHub Actions for CI and publishing, plus a local release helper sc
5
5
  ## CI pipeline (.github/workflows/ci.yml)
6
6
 
7
7
  Runs on every push/PR to main. Three jobs:
8
- 1. **Typecheck** — `bunx tsc -p tsconfig.check.json` (includes test files that the build's `tsconfig.json` excludes)
8
+ 1. **Typecheck** — `bunx tsc -p tsconfig.check.json` (includes src, tests, and the CI scripts in `.github/scripts`; the build's `tsconfig.json` includes only src)
9
9
  2. **Tests** — `bun test` (bun:test framework, no network, `:memory:` DB or temp dirs)
10
10
  3. **Markdownlint** — `bunx markdownlint-cli2` on `README.md` and `docs/**/*.md` (excluding `docs/plans/**`)
11
11
 
@@ -22,6 +22,14 @@ Key details:
22
22
  - npm 12 shipped a sigstore bug that broke OIDC publishing; the pin prevents it
23
23
  - The workflow deliberately sets NO `registry-url`, which would write a token-expecting `.npmrc` that preempts the OIDC exchange
24
24
 
25
+ ## Wiki pipeline (.github/workflows/wiki.yml)
26
+
27
+ Triggered by pushes to main that touch `docs/**`, the workflow file, or the render script. One-way mirror of `docs/` into the GitHub wiki: renders each doc to a flat wiki page (tiered prefixes `Guide:`, bare, `Feature:`; see `.github/scripts/sync-wiki.ts`), rewrites relative md links, generates `Home.md` + `_Sidebar.md`, wipes and rewrites all wiki pages, then pushes to `sysread/thatch.wiki.git`.
28
+
29
+ - Uses the `WIKI_TOKEN` Actions secret (classic PAT, `public_repo` scope) because the built-in `GITHUB_TOKEN` cannot push to wiki repos
30
+ - Precondition: the wiki must be initialized once via the UI (GitHub does not auto-create `.wiki.git` repos)
31
+ - `docs/plans/` and `docs/in-progress/` are excluded; duplicate or reserved page names fail the render script
32
+
25
33
  ## Release helper (bin/release)
26
34
 
27
35
  A bash script (`set -euo pipefail`) that bumps, checks, commits, tags, and pushes.
@@ -45,7 +53,7 @@ Steps:
45
53
  | `test` | Run the test suite (`bun test`) |
46
54
  | `test-watch` | Run tests in watch mode |
47
55
  | `coverage` | Run tests with coverage report |
48
- | `typecheck` | Typecheck src + tests (`bunx tsc -p tsconfig.check.json`) |
56
+ | `typecheck` | Typecheck src + tests + `.github/scripts` (`bunx tsc -p tsconfig.check.json`) |
49
57
  | `lint-md` | Lint markdown docs (`bunx markdownlint-cli2`) |
50
58
  | `check` | The CI gate: typecheck + tests + markdownlint |
51
59
  | `release` | Bump version, commit, tag, push (args: `patch\|minor\|major`) |
@@ -60,7 +68,7 @@ Steps:
60
68
  ## Development tooling
61
69
 
62
70
  - **Bun 1.3.14** (pinned via mise)
63
- - **TypeScript** with `tsconfig.check.json` for typecheck (includes test files; build's `tsconfig.json` excludes them)
71
+ - **TypeScript** with `tsconfig.check.json` for typecheck (includes src, tests, and `.github/scripts`; build's `tsconfig.json` includes only src)
64
72
  - **bun:test** framework (no network, `:memory:` DB or temp dirs, mock embeddings)
65
73
  - **markdownlint-cli2** with custom config (`.markdownlint-cli2.jsonc`): disables MD013 (line length), MD032 (blanks around lists), MD036 (emphasis as heading), MD060 (table alignment). Keeps MD040 (code-block language), MD047 (trailing newline), heading hierarchy.
66
74
  - **Zod** for tool schema validation and JSON Schema generation (`src/tool-defs.ts`)
@@ -74,10 +82,11 @@ Steps:
74
82
 
75
83
  - `.github/workflows/ci.yml` — CI pipeline
76
84
  - `.github/workflows/publish.yml` — publish pipeline (OIDC)
85
+ - `.github/workflows/wiki.yml` + `.github/scripts/sync-wiki.ts` — wiki mirror pipeline
77
86
  - `bin/release` — release helper script
78
87
  - `mise.toml` — task definitions, tool pins, env vars
79
88
  - `.markdownlint-cli2.jsonc` — markdownlint config
80
- - `tsconfig.check.json` — typecheck config (includes tests)
89
+ - `tsconfig.check.json` — typecheck config (includes src, tests, `.github/scripts`)
81
90
 
82
91
  ## Key invariants
83
92
 
@@ -86,4 +95,4 @@ Steps:
86
95
  - npm is pinned to 11.x. npm 12 shipped a sigstore bug that broke OIDC publishing.
87
96
  - The release helper checks for tagged-but-not-published state (tag exists, npm returns E404) and refuses to proceed with recovery instructions.
88
97
  - CI runs on push/PR to main. Publish runs only on `v*` tags. The release helper bridges them: tag + push triggers publish.
89
- - `tsconfig.check.json` includes test files for typecheck. The build's `tsconfig.json` excludes them.
98
+ - `tsconfig.check.json` includes src, tests, and `.github/scripts` for typecheck. The build's `tsconfig.json` includes only src.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jeffober/thatch",
3
- "version": "0.1.45",
3
+ "version": "0.1.46",
4
4
  "description": "Persistent memory for AI coding agents — local embeddings, SQLite stores, zero config. Works with OpenCode (as a plugin), Claude Code (as an MCP server), and Cursor (as an MCP server).",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,89 +0,0 @@
1
- # Nomenclater
2
-
3
- ## Synopsis
4
-
5
- Assigns a geeky/sci-fi name to the agent at the start of each new opencode
6
- session. The name is generated by a fast LLM call, cached for the session, and
7
- injected into the system prompt so the agent knows its name. opencode-only;
8
- requires plugin hooks. Pure cosmetic, no functional dependency.
9
-
10
- ## Background
11
-
12
- Fnord's Nomenclater (backed by a GenServer name pool) generates whimsical names
13
- for sub-agents so their actions are distinguishable in logs. Jeff explicitly
14
- wants this for thatch: "I'd love to have this!" It builds agent identity and
15
- rapport, complementing the personality instructions in OPENCODE.md.
16
-
17
- The name must not change mid-conversation and must not trigger on continued
18
- or resumed sessions.
19
-
20
- ## Session detection
21
-
22
- Same mechanism as the intuition-drives plan. See that plan for full detail.
23
-
24
- `session.created` fires only on brand-new session creation (fresh or fork). It
25
- does not fire when resuming an existing conversation. Detection: track
26
- `session.created` for top-level sessions (no `parentID`) in a `Set<string>`,
27
- generate the name on first `chat.message` for sessions in that set, remove
28
- from set after generating. Continued/resumed sessions never enter the set.
29
-
30
- ## What it does
31
-
32
- ```
33
- session.created (top-level) → add sessionID to newSessions Set
34
-
35
- chat.message (first message for sessionID in newSessions)
36
- → remove from newSessions
37
- → generate name via fast model → cache in Map<sessionID, name>
38
-
39
- experimental.chat.system.transform
40
- → if name cached for sessionID: append "Your name for this session is <name>."
41
-
42
- session.deleted
43
- → delete from name cache, newSessions set
44
- ```
45
-
46
- Name generation uses fnord's theme list (Jargon File, Zork, Futurama,
47
- Discworld, D&D, Klingons, Sandman, etc.) and the same JSON-schema response
48
- format. One LLM call with a fast model. Themes are shuffled and 3 are selected
49
- per batch to avoid clustering.
50
-
51
- ## Constraints
52
-
53
- - **opencode-only.** Requires plugin hook injection. The name is generated by a
54
- fast LLM call and injected via `experimental.chat.system.transform`.
55
- - **First-message-only.** Same session-detection mechanism. The name must not
56
- change mid-conversation.
57
- - **No persistent state needed.** The name is generated fresh per session and
58
- held in a per-session map for the duration of that session. No DB writes.
59
- - **Must not trigger on continued sessions.** A resumed conversation keeps
60
- whatever name the agent had (or had none, if the feature was added after the
61
- session started). The `session.created` gate handles this.
62
-
63
- ## Open question
64
-
65
- 1. **Where does the name surface?** System prompt injection means the agent
66
- knows its name but the user only sees it if the agent chooses to use it. Is
67
- that enough, or should the name appear in the TUI somehow (e.g., a toast on
68
- session start)?
69
-
70
- ## Decisions
71
-
72
- | Decision | Rationale |
73
- |----------|-----------|
74
- | opencode-only | Requires plugin hooks for generation and injection |
75
- | One name per session, cached in memory | No DB writes; name is ephemeral, tied to session lifecycle |
76
- | Gated to first message of new sessions | Must not rename mid-conversation or trigger on resumed sessions |
77
- | Detection via session.created + chat.message | Same mechanism as the intuition-drives plan |
78
-
79
- ## Dependencies
80
-
81
- ### Runtime
82
-
83
- - Fast model for name generation (one LLM call per new session)
84
-
85
- ### Built-in
86
-
87
- - Plugin hooks: `event` (session.created, session.deleted),
88
- `chat.message`, `experimental.chat.system.transform`
89
- - In-process `Map` for per-session name caching