memhouse 0.16.0 → 0.18.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 (51) hide show
  1. package/README.md +97 -31
  2. package/bin/memhouse.js +657 -187
  3. package/editors/antigravity.js +2 -0
  4. package/editors/claude.js +3 -1
  5. package/editors/codebuff.js +2 -0
  6. package/editors/codex.js +4 -1
  7. package/editors/commandcode.js +2 -1
  8. package/editors/copilot-jetbrains.js +2 -1
  9. package/editors/copilot.js +2 -1
  10. package/editors/cursor-agent.js +2 -1
  11. package/editors/cursor.js +2 -0
  12. package/editors/gemini.js +2 -1
  13. package/editors/goose.js +2 -1
  14. package/editors/index.js +8 -1
  15. package/editors/kiro.js +3 -2
  16. package/editors/opencode.js +2 -1
  17. package/editors/scope.js +126 -0
  18. package/editors/vscode.js +2 -0
  19. package/editors/zed.js +2 -1
  20. package/memhouse/DESIGN.md +31 -8
  21. package/memhouse/channel.js +50 -0
  22. package/memhouse/delivery/AGENT-INSTALL-PROMPT.md +4 -3
  23. package/memhouse/delivery/AGENT-INSTALL.md +3 -3
  24. package/memhouse/delivery/INVITATION.md.tpl +130 -0
  25. package/memhouse/delivery/PROMPT.md +21 -14
  26. package/memhouse/delivery/kernel-install.md +4 -2
  27. package/memhouse/delivery/plugin/.claude-plugin/plugin.json +2 -2
  28. package/memhouse/delivery/plugin/reference/HOUSE.md +173 -0
  29. package/memhouse/delivery/plugin/skills/access/SKILL.md +148 -0
  30. package/memhouse/delivery/plugin/skills/admin/SKILL.md +30 -1
  31. package/memhouse/delivery/plugin/skills/house/SKILL.md +99 -0
  32. package/memhouse/delivery/plugin/skills/recall/SKILL.md +119 -0
  33. package/memhouse/delivery/plugin/skills/sql/SKILL.md +73 -194
  34. package/memhouse/flags.js +6 -4
  35. package/memhouse/house/HOUSE.md +25 -11
  36. package/memhouse/house/house.js +110 -27
  37. package/memhouse/house/migrate.js +7 -6
  38. package/memhouse/house/relocate.js +2 -2
  39. package/memhouse/house/schema.sql.tpl +3 -3
  40. package/memhouse/provision.js +100 -0
  41. package/memhouse/share.js +64 -0
  42. package/memhouse/shipper/ship.js +87 -28
  43. package/package.json +1 -1
  44. package/memhouse/delivery/plugin/skills/ask/SKILL.md +0 -131
  45. package/memhouse/delivery/plugin/skills/hello/SKILL.md +0 -121
  46. package/memhouse/delivery/plugin/skills/invite/SKILL.md +0 -130
  47. package/memhouse/delivery/plugin/skills/search/SKILL.md +0 -186
  48. package/memhouse/delivery/plugin/skills/sessions/SKILL.md +0 -164
  49. package/memhouse/delivery/plugin/skills/share/SKILL.md +0 -130
  50. package/memhouse/delivery/plugin/skills/status/SKILL.md +0 -139
  51. package/memhouse/delivery/plugin/skills/users/SKILL.md +0 -97
package/README.md CHANGED
@@ -9,9 +9,12 @@ something durable was keeping it.
9
9
  memhouse is that something. It reads the session transcripts your editors already
10
10
  write to disk — **17 of them**: Claude Code, Codex, Cursor, Zed, Copilot, Gemini
11
11
  CLI and the rest — parses them locally, and ships typed rows into a ClickHouse
12
- **you own**. Nothing is proxied, intercepted, or sent to anyone's cloud. Then you
13
- can search every past session, see what it cost, resume the conversation that
14
- solved this before, and let an agent query its own history.
12
+ **you choose**: a container on this laptop, a box you run, your company's cluster,
13
+ or ClickHouse Cloud. memhouse runs no service of its own — there is no memhouse
14
+ cloud to sign up for and nothing is proxied through anyone — so the account is
15
+ yours and the data is wherever you decided to put it. Then you can search every
16
+ past session, see what it cost, resume the conversation that solved this before,
17
+ and let an agent query its own history.
15
18
 
16
19
  And every row says where it came from, in a way no client can fake: `user_id` is
17
20
  stamped **by the server** (`MATERIALIZED currentUser()`, async inserts pinned off
@@ -72,19 +75,26 @@ container engine, install one of the two.
72
75
  memhouse onboard | install | setup | discover | doctor | uninstall | reset
73
76
  memhouse ship [--full|--loop N] | search <terms> | stats | status
74
77
  memhouse resume <session-id> print the command that reopens a session
75
- memhouse update [--check] upgrade, restart daemons, check the schema
78
+ memhouse update [--check] [--channel TAG] upgrade along the channel this install follows,
79
+ restart daemons, check the schema
76
80
  memhouse start | stop dashboard + shipper as daemons
77
81
  memhouse service install | uninstall survive a reboot
78
82
  memhouse deploy --local | --down stand up (or remove) a local house
79
83
  memhouse invite <name> mint a member + house, hand them one env file
84
+ memhouse members [--db X] who is in a house, and what each can reach
85
+ memhouse whoami [--admin] which credential is in play, and what it may do
86
+ memhouse rooms what your rooms are actually called
87
+ memhouse share <user> [--only …|--revoke|--list]
88
+ let a housemate read yours, in whole or in part
89
+ memhouse sessions-query print the session rollup SQL
80
90
  memhouse passwd rotate this member's password
81
91
  memhouse migrate | migrate-rooms [--dry-run] [--yes]
82
92
  run whatever this house still needs
83
93
  memhouse relocate --to <url> copy this house to a new ClickHouse, then repoint
84
94
  memhouse nightly [--out DIR] build an installable tarball from this checkout
85
- memhouse plugins install claude 9 skills — ask, hello, invite, search,
86
- sessions, share, sql, status, users — into
87
- every Claude Code config dir found
95
+ memhouse plugins install claude 5 skills — house, recall, sql, access,
96
+ admin — into every Claude Code config
97
+ dir found
88
98
  memhouse prompt memory snippet for an agent's system prompt
89
99
  memhouse prompt --install an install prompt, rendered for this machine
90
100
  ```
@@ -99,7 +109,7 @@ an agent — so an agent can install its own memory unattended.
99
109
  config directory on the machine** — `~/.claude`, whatever `CLAUDE_CONFIG_DIR` points
100
110
  at, and each Kommander-style playbook under `~/.claude-playbooks/`. All are selected by
101
111
  default; answer with numbers to narrow it, or pass `--target DIR` for exactly one.
102
- Installing into just the default config is how `/mem:search` ends up missing from
112
+ Installing into just the default config is how `/mem:recall` ends up missing from
103
113
  the instance you actually work in, silently, since a missing skill never announces
104
114
  itself.
105
115
 
@@ -108,6 +118,50 @@ Config resolves: flags → `MEMHOUSE_*` env → `$MEMHOUSE_HOME/env` (default
108
118
  commands that read or write memory refuse and say so rather than guessing
109
119
  `localhost:8123`, which on a lot of machines is a real house belonging to someone else.
110
120
 
121
+ ## Which sessions ship
122
+
123
+ Everything on the machine, by default: every adapter, from wherever that editor keeps its
124
+ sessions. `memhouse discover` prints what each adapter is watching and the variable that
125
+ moves it:
126
+
127
+ ```
128
+ Watched directories (override with the variable shown, in the env file):
129
+ claude ~/.claude, ~/.claude-playbooks/kommander, … [MEMHOUSE_CLAUDE_ROOTS]
130
+ codex ~/.codex [MEMHOUSE_CODEX_ROOTS]
131
+ gemini-cli ~/.gemini [MEMHOUSE_GEMINI_CLI_ROOTS]
132
+ cursor ~/Library/Application Support/Cursor/User, … [built-in]
133
+ ```
134
+
135
+ Two kinds of line in the env file narrow it, or `--editors` / `--claude-roots` at install:
136
+
137
+ ```
138
+ MEMHOUSE_EDITORS='claude'
139
+ MEMHOUSE_CLAUDE_ROOTS='~/.claude-playbooks/kommander-chaos'
140
+ ```
141
+
142
+ `MEMHOUSE_EDITORS` names the adapters to run. `MEMHOUSE_<EDITOR>_ROOTS` replaces one
143
+ adapter's location: the adapter's name upper-cased, dashes to underscores. Claude is the
144
+ one adapter with many roots (every Claude Code config directory), so its list may hold
145
+ several; every other adapter has one store, so one path. Adapters marked `[built-in]`
146
+ resolve a platform app-data directory and cannot be moved yet.
147
+
148
+ An adapter name or a directory that does not exist is refused and reported against that
149
+ adapter, never shipped from the default instead: a typo that quietly shipped nothing would
150
+ look like a working install with an empty house, and one that quietly shipped the wrong
151
+ store would be worse.
152
+
153
+ ## Channels
154
+
155
+ `memhouse update` follows the npm dist-tag the install came from, not `latest` by
156
+ reflex. A house published under another tag — `npm publish --tag team`, so one team can
157
+ run a newer layout without every other house being dragged along — installs with
158
+ `npm install -g memhouse@team`, and `update` keeps it there. The channel is inferred from
159
+ the installed version; pin it with `MEMHOUSE_CHANNEL='team'` in the env file or
160
+ `memhouse update --channel team`, which writes the same line. A tarball or checkout
161
+ build sits on no tag and is never auto-updated; `update --check` says so and names the
162
+ way forward. An invite from a house on a channel carries it, so the invitee follows it
163
+ too.
164
+
111
165
  ## Going back into a session
112
166
 
113
167
  `search` finds the conversation; `resume` hands you back into it.
@@ -184,30 +238,43 @@ immediate.
184
238
 
185
239
  ## How your memory is stored
186
240
 
187
- **A house is a database; its rooms are three shared tables.** `sessions`, `messages`
188
- and `tool_calls` live in whatever database you point at — your own name by default
189
- (`polat.messages`), a team's (`team_a.messages`), even `default`. Everyone in the
190
- house writes into the same tables with their own credential, and every row says where
191
- it came from: `user_id`, stamped by the server (`MATERIALIZED currentUser()`, with
192
- async inserts pinned off so the stamp cannot be skipped), and `host`, the machine's
193
- install fingerprint.
241
+ **A house is a database; its rooms are tables.** `sessions`, `messages` and `tool_calls`
242
+ hold your turns. Every row says where it came from: `user_id`, stamped by the server
243
+ (`MATERIALIZED currentUser()`, with async inserts pinned off so the stamp cannot be
244
+ skipped), and `host`, the machine's install fingerprint. `WHERE user_id = 'alice'` is one
245
+ person; `WHERE host = '…'` is one machine. Neither is forgeable from the client.
246
+
247
+ **Your rooms are named for you, and one grant covers them.** Every member of a house holds
248
+ `GRANT … ON mem.<name>_* TO <name>`: their own rooms, present and future, and nothing else
249
+ in the database. That is the whole access model, and it is the same on a laptop, a team's
250
+ server, or a kernel:
251
+
252
+ | | rooms | the member holds |
253
+ |---|---|---|
254
+ | alone on your laptop | `mem.polat_*` | one grant on `mem.polat_*` |
255
+ | a team on one server | `mem.polat_*`, `mem.alice_*`, … | each their own |
256
+
257
+ A colleague can read their isolation back with `SHOW GRANTS` in one line, which is the
258
+ property this rests on. There is no row policy to trust and no database-wide grant to
259
+ worry about: `ALL ON mem.*` would cover rooms created later, which is how two people in one
260
+ database once became a leak, so memhouse never issues it — not to a member, not to you.
194
261
 
195
- `WHERE user_id = 'alice'` is one person. `WHERE host = '…'` is one machine. No filter
196
- is the whole house — which is exactly what a team dashboard wants.
262
+ Standalone is a team of one. `memhouse deploy --local` creates the house with an admin
263
+ credential (`memhouse_root`) and a member named after your OS user, keeps both in the env
264
+ file, and ships as the member. Inviting a colleague later is `memhouse invite <name>`; the
265
+ admin credential is already there.
197
266
 
198
- Sharing is not a feature bolted on top; it IS the house. A team makes a database,
199
- grants each person `ALL` on it, and their shippers all write into the same rooms:
267
+ Reading across everyone is a `UNION ALL` over the rooms you hold:
200
268
 
201
269
  ```sql
202
- CREATE DATABASE team_a;
203
- CREATE USER alice IDENTIFIED BY '…';
204
- GRANT ALL ON team_a.* TO alice; -- repeat per housemate
270
+ SELECT user_id, count() FROM mem.polat_messages GROUP BY user_id
271
+ UNION ALL
272
+ SELECT user_id, count() FROM mem.alice_messages GROUP BY user_id
205
273
  ```
206
274
 
207
- `ALL` on your own house reaches nothing outside it — the database is the boundary,
208
- which is also why joining a ClickHouse someone else runs (a kernel's, a team's) needs
209
- no negotiation beyond a database and a credential. Housemates are collaborators;
210
- groups that should not see each other get separate houses.
275
+ An operator with an admin credential reads every room; a member reads the ones they own
276
+ plus whatever was shared with them, and naming a room they do not hold is an error rather
277
+ than a silent omission.
211
278
 
212
279
  ### The house never destroys what it cannot rebuild
213
280
 
@@ -245,7 +312,7 @@ count its messages twice.
245
312
  The shipper verifies the sorting keys before it writes and refuses if they are wrong, so
246
313
  an old house cannot be corrupted by a new shipper. `memhouse migrate-rooms` rebuilds it:
247
314
  copy, atomic swap, and the old room kept as `<room>_pre_epoch` for you to drop. The house
248
- records the move in `house_events`, and `memhouse doctor` reads it back.
315
+ records the move in `events`, and `memhouse doctor` reads it back.
249
316
 
250
317
  ## Upgrading
251
318
 
@@ -341,10 +408,9 @@ and are not part of `npm test`.
341
408
  | `agency/` | the earlier agentlytics-agency wrap — prior art, not how memhouse works |
342
409
  | `TERMINOLOGY.md` | the constellation terminology canon |
343
410
 
344
- Deeper reading: `memhouse/DESIGN.md` (the four bets),
345
- `memhouse/per-member/INSTALL.md` (the three install paths and every refusal),
346
- `memhouse/per-member/SCHEMA.md`, `memhouse/delivery/kernel-install.md`,
347
- `memhouse/COMPETITION.md`.
411
+ Deeper reading: `memhouse/DESIGN.md` (the bets, and why the room layout has moved three
412
+ times), `memhouse/house/HOUSE.md` (the layout and the schema), `SECURITY.md` (what
413
+ holds, and what does not), `memhouse/delivery/kernel-install.md`, `memhouse/COMPETITION.md`.
348
414
 
349
415
  Deferred designs (captured, not yet built): `docs/design/host-repoint-reconciliation.md`
350
416
  — what should happen when the shipper is repointed at a new, empty host (house identity,