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.
- package/README.md +97 -31
- package/bin/memhouse.js +657 -187
- package/editors/antigravity.js +2 -0
- package/editors/claude.js +3 -1
- package/editors/codebuff.js +2 -0
- package/editors/codex.js +4 -1
- package/editors/commandcode.js +2 -1
- package/editors/copilot-jetbrains.js +2 -1
- package/editors/copilot.js +2 -1
- package/editors/cursor-agent.js +2 -1
- package/editors/cursor.js +2 -0
- package/editors/gemini.js +2 -1
- package/editors/goose.js +2 -1
- package/editors/index.js +8 -1
- package/editors/kiro.js +3 -2
- package/editors/opencode.js +2 -1
- package/editors/scope.js +126 -0
- package/editors/vscode.js +2 -0
- package/editors/zed.js +2 -1
- package/memhouse/DESIGN.md +31 -8
- package/memhouse/channel.js +50 -0
- package/memhouse/delivery/AGENT-INSTALL-PROMPT.md +4 -3
- package/memhouse/delivery/AGENT-INSTALL.md +3 -3
- package/memhouse/delivery/INVITATION.md.tpl +130 -0
- package/memhouse/delivery/PROMPT.md +21 -14
- package/memhouse/delivery/kernel-install.md +4 -2
- package/memhouse/delivery/plugin/.claude-plugin/plugin.json +2 -2
- package/memhouse/delivery/plugin/reference/HOUSE.md +173 -0
- package/memhouse/delivery/plugin/skills/access/SKILL.md +148 -0
- package/memhouse/delivery/plugin/skills/admin/SKILL.md +30 -1
- package/memhouse/delivery/plugin/skills/house/SKILL.md +99 -0
- package/memhouse/delivery/plugin/skills/recall/SKILL.md +119 -0
- package/memhouse/delivery/plugin/skills/sql/SKILL.md +73 -194
- package/memhouse/flags.js +6 -4
- package/memhouse/house/HOUSE.md +25 -11
- package/memhouse/house/house.js +110 -27
- package/memhouse/house/migrate.js +7 -6
- package/memhouse/house/relocate.js +2 -2
- package/memhouse/house/schema.sql.tpl +3 -3
- package/memhouse/provision.js +100 -0
- package/memhouse/share.js +64 -0
- package/memhouse/shipper/ship.js +87 -28
- package/package.json +1 -1
- package/memhouse/delivery/plugin/skills/ask/SKILL.md +0 -131
- package/memhouse/delivery/plugin/skills/hello/SKILL.md +0 -121
- package/memhouse/delivery/plugin/skills/invite/SKILL.md +0 -130
- package/memhouse/delivery/plugin/skills/search/SKILL.md +0 -186
- package/memhouse/delivery/plugin/skills/sessions/SKILL.md +0 -164
- package/memhouse/delivery/plugin/skills/share/SKILL.md +0 -130
- package/memhouse/delivery/plugin/skills/status/SKILL.md +0 -139
- package/memhouse/delivery/plugin/skills/users/SKILL.md +0 -97
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: users
|
|
3
|
-
description: Show the people around your memory — who writes into your house and from which machines, which other houses on this ClickHouse you can read, and who can read yours. Use when the user asks "who can see my memory", "whose memory can I see", "which houses are on this server", "who else ships here", or before/after sharing with /mem:share.
|
|
4
|
-
user-invocable: true
|
|
5
|
-
argument-hint: ""
|
|
6
|
-
allowed-tools: Bash
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# /mem:users — who is around your memory
|
|
10
|
-
|
|
11
|
-
**Invoking this skill IS the request. Run the report immediately and present it; there
|
|
12
|
-
are no arguments and nothing to clarify.** Read-only throughout.
|
|
13
|
-
|
|
14
|
-
Throughout, `<your-db>` is the live `$MEMHOUSE_DB` and `<your-user>` the live
|
|
15
|
-
`$MEMHOUSE_USER` — take both from the connection environment, never from the
|
|
16
|
-
conversation or from examples.
|
|
17
|
-
|
|
18
|
-
Answers three questions, best-effort by design: ClickHouse shows a credential only what
|
|
19
|
-
it may see, so on someone else's server some sections legitimately come back thin — say
|
|
20
|
-
what could not be seen rather than guessing.
|
|
21
|
-
|
|
22
|
-
## Connection
|
|
23
|
-
|
|
24
|
-
**Never print this file or the variables in it.** No `cat "$MH_ENV"`, no `env | grep
|
|
25
|
-
MEMHOUSE`, no `set -x` around these commands.
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
MH_ENV="${MEMHOUSE_HOME:-$HOME/.memhouse}/env"
|
|
29
|
-
_u=${MEMHOUSE_URL-}; _s=${MEMHOUSE_USER-}; _p=${MEMHOUSE_PASSWORD-}; _d=${MEMHOUSE_DB-}
|
|
30
|
-
set -a; [ -f "$MH_ENV" ] && . "$MH_ENV"; set +a
|
|
31
|
-
[ -n "$_u" ] && MEMHOUSE_URL=$_u; [ -n "$_s" ] && MEMHOUSE_USER=$_s
|
|
32
|
-
[ -n "$_p" ] && MEMHOUSE_PASSWORD=$_p; [ -n "$_d" ] && MEMHOUSE_DB=$_d
|
|
33
|
-
if [ -z "${MEMHOUSE_URL:-}" ] || [ -z "${MEMHOUSE_USER:-}" ]; then
|
|
34
|
-
echo "no memhouse house configured — nothing in $MH_ENV and no MEMHOUSE_URL/MEMHOUSE_USER set." >&2
|
|
35
|
-
echo "Run: memhouse install" >&2
|
|
36
|
-
exit 1
|
|
37
|
-
fi
|
|
38
|
-
|
|
39
|
-
curl -sS --fail-with-body --user "$MEMHOUSE_USER:${MEMHOUSE_PASSWORD:-}" \
|
|
40
|
-
--data-binary @- "$MEMHOUSE_URL/?database=${MEMHOUSE_DB:-$MEMHOUSE_USER}&readonly=1" <<'SQL'
|
|
41
|
-
<the query>
|
|
42
|
-
FORMAT PrettyCompact
|
|
43
|
-
SQL
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## The report
|
|
47
|
-
|
|
48
|
-
**1. Who writes into YOUR house** — members × machines, from the data (same ground truth
|
|
49
|
-
as /mem:status's fleet):
|
|
50
|
-
|
|
51
|
-
```sql
|
|
52
|
-
SELECT user_id AS member, host AS machine, count() AS rows,
|
|
53
|
-
formatDateTime(max(ingested_at), '%Y-%m-%d %H:%i') AS last_write
|
|
54
|
-
FROM messages GROUP BY user_id, host ORDER BY last_write DESC
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
**2. Whose memory YOU can read** — every database your credential reaches is one someone
|
|
58
|
-
gave you (or your own):
|
|
59
|
-
|
|
60
|
-
```sql
|
|
61
|
-
SHOW DATABASES
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Drop `system`, `information_schema`, `INFORMATION_SCHEMA`, `default` unless they hold
|
|
65
|
-
rooms. For each OTHER house listed, it is readable because of a grant — one line each:
|
|
66
|
-
`house 'polat' — readable (shared with you); query it as polat.messages`.
|
|
67
|
-
|
|
68
|
-
**3. Who can read YOURS** — from the house's own share record (`system.grants` needs
|
|
69
|
-
privileges a member does not hold, so the record /mem:share keeps is the readable
|
|
70
|
-
source; an admin-issued grant will not appear in it, and the report should say so):
|
|
71
|
-
|
|
72
|
-
```sql
|
|
73
|
-
SELECT substring(key, 7) AS user, value AS state
|
|
74
|
-
FROM house_meta FINAL WHERE key LIKE 'share:%' ORDER BY key
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
`granted …` = a live read window (`/mem:share`); `revoked …` = closed. If the caller IS
|
|
78
|
-
privileged, prefer the authoritative form:
|
|
79
|
-
`SELECT user_name, groupUniqArray(access_type) FROM system.grants WHERE database = '<your-db>' AND user_name != '<your-user>' GROUP BY user_name`
|
|
80
|
-
— try it first, fall back to the record on refusal.
|
|
81
|
-
|
|
82
|
-
**4. Every user on the server** — usually admin-only; try it, and if refused say
|
|
83
|
-
"(full user list needs admin — showing only what this credential can see)":
|
|
84
|
-
|
|
85
|
-
```sql
|
|
86
|
-
SELECT name FROM system.users ORDER BY name
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## Presenting it
|
|
90
|
-
|
|
91
|
-
Four short sections in that order, each with its one-line meaning ("2 machines ship into
|
|
92
|
-
your house", "you can read polat's memory", "yigit can read yours — read-only", …).
|
|
93
|
-
Empty section three means "no shares made through /mem:share" — and ONLY that. The
|
|
94
|
-
record cannot see an admin-issued grant, so never promise "nobody can read your memory"
|
|
95
|
-
from an empty ledger; say "no shares recorded through this skill — the authoritative
|
|
96
|
-
check is the admin's system.grants query" and print it. Point at `/mem:share <user>` /
|
|
97
|
-
`/mem:share revoke <user>` for changes.
|