@pcircle/memesh 4.9.4 → 4.10.2
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/AGENTS.md +75 -13
- package/README.de.md +5 -5
- package/README.md +5 -5
- package/README.zh-TW.md +5 -5
- package/dashboard/dist/index.html +8 -8
- package/dist/cli/view-live.d.ts.map +1 -1
- package/dist/cli/view-live.js +0 -427
- package/dist/cli/view-live.js.map +1 -1
- package/dist/core/agent-message-inbox.d.ts +6 -0
- package/dist/core/agent-message-inbox.d.ts.map +1 -1
- package/dist/core/agent-message-inbox.js +28 -1
- package/dist/core/agent-message-inbox.js.map +1 -1
- package/dist/core/briefing-index.d.ts +30 -0
- package/dist/core/briefing-index.d.ts.map +1 -0
- package/dist/core/briefing-index.js +140 -0
- package/dist/core/briefing-index.js.map +1 -0
- package/dist/core/briefing-level.d.ts +22 -0
- package/dist/core/briefing-level.d.ts.map +1 -0
- package/dist/core/briefing-level.js +75 -0
- package/dist/core/briefing-level.js.map +1 -0
- package/dist/core/briefing.d.ts +7 -0
- package/dist/core/briefing.d.ts.map +1 -1
- package/dist/core/briefing.js +72 -12
- package/dist/core/briefing.js.map +1 -1
- package/dist/core/capture-liveness.d.ts +137 -0
- package/dist/core/capture-liveness.d.ts.map +1 -0
- package/dist/core/capture-liveness.js +448 -0
- package/dist/core/capture-liveness.js.map +1 -0
- package/dist/core/config.d.ts +2 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +5 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/delegation.d.ts +47 -0
- package/dist/core/delegation.d.ts.map +1 -0
- package/dist/core/delegation.js +174 -0
- package/dist/core/delegation.js.map +1 -0
- package/dist/core/doctor-fixes.d.ts +1 -0
- package/dist/core/doctor-fixes.d.ts.map +1 -1
- package/dist/core/doctor-fixes.js +21 -0
- package/dist/core/doctor-fixes.js.map +1 -1
- package/dist/core/doctor.d.ts +8 -0
- package/dist/core/doctor.d.ts.map +1 -1
- package/dist/core/doctor.js +148 -3
- package/dist/core/doctor.js.map +1 -1
- package/dist/core/note-derive.d.ts +14 -0
- package/dist/core/note-derive.d.ts.map +1 -0
- package/dist/core/note-derive.js +66 -0
- package/dist/core/note-derive.js.map +1 -0
- package/dist/core/note-ingest.d.ts +34 -0
- package/dist/core/note-ingest.d.ts.map +1 -0
- package/dist/core/note-ingest.js +445 -0
- package/dist/core/note-ingest.js.map +1 -0
- package/dist/core/operations.d.ts +10 -1
- package/dist/core/operations.d.ts.map +1 -1
- package/dist/core/operations.js +129 -14
- package/dist/core/operations.js.map +1 -1
- package/dist/core/paths.d.ts +1 -0
- package/dist/core/paths.d.ts.map +1 -1
- package/dist/core/paths.js +4 -0
- package/dist/core/paths.js.map +1 -1
- package/dist/core/schema-export.d.ts.map +1 -1
- package/dist/core/schema-export.js +15 -5
- package/dist/core/schema-export.js.map +1 -1
- package/dist/core/serializer.d.ts +2 -0
- package/dist/core/serializer.d.ts.map +1 -1
- package/dist/core/serializer.js +119 -3
- package/dist/core/serializer.js.map +1 -1
- package/dist/core/session-insight.d.ts +44 -0
- package/dist/core/session-insight.d.ts.map +1 -0
- package/dist/core/session-insight.js +216 -0
- package/dist/core/session-insight.js.map +1 -0
- package/dist/core/task-state-store.d.ts +4 -0
- package/dist/core/task-state-store.d.ts.map +1 -1
- package/dist/core/task-state-store.js +18 -5
- package/dist/core/task-state-store.js.map +1 -1
- package/dist/core/task-state.d.ts +5 -0
- package/dist/core/task-state.d.ts.map +1 -1
- package/dist/core/task-state.js +70 -0
- package/dist/core/task-state.js.map +1 -1
- package/dist/core/turn-signal.d.ts +22 -0
- package/dist/core/turn-signal.d.ts.map +1 -0
- package/dist/core/turn-signal.js +89 -0
- package/dist/core/turn-signal.js.map +1 -0
- package/dist/core/types.d.ts +14 -3
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/update-entrypoint.d.ts +19 -0
- package/dist/core/update-entrypoint.d.ts.map +1 -0
- package/dist/core/update-entrypoint.js +222 -0
- package/dist/core/update-entrypoint.js.map +1 -0
- package/dist/core/update-notice.d.ts +69 -0
- package/dist/core/update-notice.d.ts.map +1 -0
- package/dist/core/update-notice.js +188 -0
- package/dist/core/update-notice.js.map +1 -0
- package/dist/core/work-topology.d.ts +1 -0
- package/dist/core/work-topology.d.ts.map +1 -1
- package/dist/core/work-topology.js +3 -0
- package/dist/core/work-topology.js.map +1 -1
- package/dist/host-runtime/codex-session.d.ts +10 -0
- package/dist/host-runtime/codex-session.d.ts.map +1 -1
- package/dist/host-runtime/codex-session.js +1 -1
- package/dist/host-runtime/codex-session.js.map +1 -1
- package/dist/knowledge-graph.d.ts.map +1 -1
- package/dist/knowledge-graph.js +24 -3
- package/dist/knowledge-graph.js.map +1 -1
- package/dist/mcp/THIRD_PARTY_NOTICES.txt +2 -2
- package/dist/mcp/server.js +1438 -122
- package/dist/mcp/server.js.map +3 -3
- package/dist/skills-manifest.json +61 -36
- package/dist/storage/fts-index.d.ts +1 -0
- package/dist/storage/fts-index.d.ts.map +1 -1
- package/dist/storage/fts-index.js +5 -0
- package/dist/storage/fts-index.js.map +1 -1
- package/dist/transports/cli/cli.d.ts.map +1 -1
- package/dist/transports/cli/cli.js +7846 -5613
- package/dist/transports/cli/cli.js.map +3 -3
- package/dist/transports/http/server.d.ts.map +1 -1
- package/dist/transports/http/server.js +48 -28
- package/dist/transports/http/server.js.map +1 -1
- package/dist/transports/mcp/handlers.d.ts +31 -7
- package/dist/transports/mcp/handlers.d.ts.map +1 -1
- package/dist/transports/mcp/handlers.js +49 -7
- package/dist/transports/mcp/handlers.js.map +1 -1
- package/dist/transports/schemas.d.ts +5 -2
- package/dist/transports/schemas.d.ts.map +1 -1
- package/dist/transports/schemas.js +30 -3
- package/dist/transports/schemas.js.map +1 -1
- package/docs/platforms/README.md +1 -0
- package/docs/platforms/agent-messaging.md +39 -8
- package/package.json +11 -6
- package/scripts/hooks/_generated/agent-message-inbox.js +28 -1
- package/scripts/hooks/_generated/briefing-index.js +147 -0
- package/scripts/hooks/_generated/briefing-level.js +82 -0
- package/scripts/hooks/_generated/capture-liveness.js +455 -0
- package/scripts/hooks/_generated/core-paths.js +4 -0
- package/scripts/hooks/_generated/fts-index.js +5 -0
- package/scripts/hooks/_generated/task-state.js +70 -0
- package/scripts/hooks/_generated/update-notice.js +195 -0
- package/scripts/hooks/_generated/work-topology.js +3 -0
- package/scripts/hooks/_shared.js +923 -27
- package/scripts/hooks/_stop-notes.js +504 -0
- package/scripts/hooks/auto-update-runner.mjs +22 -0
- package/scripts/hooks/decision-nudge.js +32 -5
- package/scripts/hooks/guard-check.js +30 -3
- package/scripts/hooks/post-commit.js +329 -133
- package/scripts/hooks/pre-compact.js +17 -2
- package/scripts/hooks/pre-edit-recall.js +416 -64
- package/scripts/hooks/session-start.js +617 -150
- package/scripts/hooks/session-summary.js +217 -41
- package/scripts/hooks/user-prompt-intent.js +124 -22
- package/scripts/upgrade-plugin.sh +3 -4
- package/skills/memesh/SKILL.md +45 -23
- package/dist/cli/assets/d3.v7.min.js +0 -2
- package/dist/core/graph.d.ts +0 -26
- package/dist/core/graph.d.ts.map +0 -1
- package/dist/core/graph.js +0 -74
- package/dist/core/graph.js.map +0 -1
package/skills/memesh/SKILL.md
CHANGED
|
@@ -28,14 +28,14 @@ All examples below use CLI. MCP tools accept the same parameters as JSON objects
|
|
|
28
28
|
| Tool | Purpose |
|
|
29
29
|
|---|---|
|
|
30
30
|
| `work_package` | Prepare one bounded untrusted `digest` (calendar cluster) or `transcript` package from the newest Claude Code session under the client's single matching MCP workspace root; submit exactly one strict result or defer. Submit only stages pending human review and retains bounded redacted source turns for comparison; agents cannot apply or reject. No hidden reasoning, raw transcript, transcript path, API key, LLM, embedding, or vector data is exposed or used; hashes identify freshness and workspace scope rather than authentication. |
|
|
31
|
-
| `remember` | Store knowledge as an entity with observations, tags, and relations |
|
|
31
|
+
| `remember` | Store knowledge as an entity with observations, tags, and relations; `note` (free text) derives title/observations/name; `replace: true` rewrites a named memory, keeping history |
|
|
32
32
|
| `recall` | Search stored knowledge; empty query lists recent memories |
|
|
33
33
|
| `forget` | Archive an entity or remove one exact observation |
|
|
34
34
|
| `export` | Export memories as portable JSON |
|
|
35
35
|
| `import` | Import a JSON export with the required skip, append, or overwrite strategy |
|
|
36
36
|
| `learn` | Record a structured lesson with error, fix, root cause, and prevention |
|
|
37
37
|
| `task_state` | Read or update user-stated goal, next step, blocker, and finished work |
|
|
38
|
-
| `briefing` | Assemble the current project's work topology |
|
|
38
|
+
| `briefing` | Assemble the current project's work topology, closing, by default, with a capped index of its durable memories (the `briefing` setting — `minimal` / `standard` / `full` — controls how much is assembled) |
|
|
39
39
|
| `user_patterns` | Analyze work schedule, tool preferences, and focus areas |
|
|
40
40
|
| `improvement` | Propose an evidence-linked product improvement or read its status; only a human may accept or reject it |
|
|
41
41
|
| `message` | Discover live agents in one project, then contact one exact recipient with a bounded, untrusted payload. Native size and availability failures are distinct; acceptance, discovery, polling, and fetching do not acknowledge |
|
|
@@ -98,15 +98,22 @@ Durable audit does not mean unbounded silent growth. Owners can inspect it with
|
|
|
98
98
|
|
|
99
99
|
**SESSION START → load the briefing (once).**
|
|
100
100
|
Call the `briefing` MCP tool or run `memesh briefing`. It returns the assembled
|
|
101
|
-
work topology:
|
|
102
|
-
|
|
101
|
+
work topology: this project's decisions and direction, lessons not to repeat,
|
|
102
|
+
what is known, and recent activity always; where the work was left off (goal /
|
|
103
|
+
next / blocked / done) too at `standard`/`full` (the `briefing` setting's
|
|
104
|
+
default and above).
|
|
103
105
|
One call is cheaper than re-exploring the repo to reconstruct the same picture.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
`memesh briefing --index` returns only the index of durable memories — what is
|
|
107
|
+
known here, one line each, without the ranked sections.
|
|
108
|
+
Generic briefing does not report unread durable messages: it has no recipient
|
|
109
|
+
identity. The session-start hook and each prompt do report them, but only when
|
|
110
|
+
the session declared who it is by starting with `MEMESH_RECIPIENT=<id>`. If you
|
|
111
|
+
already know the exact logical recipient, pass `recipient` with `project` (MCP) or use
|
|
107
112
|
`memesh briefing --project <name> --recipient <id>`. The scoped line names the
|
|
108
113
|
project and recipient and directs you to `message poll` first, then `message
|
|
109
|
-
fetch` each returned `message_id
|
|
114
|
+
fetch` each returned `message_id`, then record `intake` for it (the session-start
|
|
115
|
+
and prompt reminders repeat until you do; fetching alone does not acknowledge).
|
|
116
|
+
At zero
|
|
110
117
|
unread it also says so explicitly if that exact recipient id has never been
|
|
111
118
|
seen in this project at all — treat that as a probable typo in `--recipient`,
|
|
112
119
|
not as an empty, healthy inbox.
|
|
@@ -120,15 +127,18 @@ memesh task --blocked "Waiting on the Windows runner"
|
|
|
120
127
|
memesh task --blocked "" # blocker resolved — empty string clears the field
|
|
121
128
|
```
|
|
122
129
|
Fields: `--goal` `--next` `--blocked` `--done` (MCP tool: `task_state`).
|
|
123
|
-
Record ONLY what the user actually said.
|
|
124
|
-
the next session
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
Record ONLY what the user actually said. Fresh state is injected at the top
|
|
131
|
+
of the next session at `standard`/`full` (default and above) and read as
|
|
132
|
+
fact — a goal you guessed from which files were edited reaches that session
|
|
133
|
+
with nothing to correct it; `minimal` never shows a fresh state, but a
|
|
134
|
+
stale or unknown-age one still gets a one-line flag at every level. If it
|
|
135
|
+
was not said, leave the field out.
|
|
127
136
|
|
|
128
137
|
**SESSION END or milestone → make the task state match reality.**
|
|
129
|
-
`memesh task` (no flags) shows
|
|
130
|
-
|
|
131
|
-
|
|
138
|
+
`memesh task` (no flags) always shows the complete stored state — not
|
|
139
|
+
necessarily what the next session will be told, which depends on freshness
|
|
140
|
+
and the `briefing` level. If "next" is now done, record what is actually
|
|
141
|
+
next; if the blocker cleared, clear it.
|
|
132
142
|
|
|
133
143
|
**USER ASKS "what do you remember / where were we" → briefing, then relay.**
|
|
134
144
|
Run `memesh briefing` (or `--project <name>`) and answer from it. For specific
|
|
@@ -149,18 +159,19 @@ With the Claude Code plugin, the first eight rows happen **without any action fr
|
|
|
149
159
|
|
|
150
160
|
| Hook | When | What it does |
|
|
151
161
|
|------|------|-------------|
|
|
152
|
-
| **SessionStart** | Every session begins | Injects the briefing
|
|
162
|
+
| **SessionStart** | Every session begins | Injects the briefing when the configured level has something to show (an empty project at `minimal` injects nothing) — decisions, lessons and recent activity always; task state and the durable-memory index too at `standard`/`full` (default and above) |
|
|
153
163
|
| **PreToolUse (Edit/Write)** | Before editing files | Injects memories related to the file or project |
|
|
154
164
|
| **UserPromptSubmit** | When you submit a prompt | Detects "remember this" intent (5 languages) and reminds Claude to use memesh |
|
|
155
165
|
| **PostToolUse (Bash)** | After `git commit` | Auto-tracks the commit with diff stats as a memory entity |
|
|
156
166
|
| **PostToolUse (ExitPlanMode/AskUserQuestion)** | A plan is approved or you answer a question | Reminds Claude to `remember` the decision if it's worth keeping — once per tool per session |
|
|
157
|
-
| **Stop** | Session ends | Auto-captures session knowledge and applies the configured update policy |
|
|
167
|
+
| **Stop** | Session ends | Auto-captures session knowledge, ingests the project's Claude Code memory directory (frontmatter notes → `source:note-file` memories), shows one line when the turn made a decision-shaped move and stored no memory, and applies the configured update policy. The two writes (session capture, note-directory ingestion) stop when auto-capture is off (`memesh config set autoCapture false` / `MEMESH_AUTO_CAPTURE=false`); the advisory line still runs |
|
|
158
168
|
| **PreCompact** | Before context compaction | Saves important knowledge before history is compressed |
|
|
159
169
|
| **PreToolUse (Bash)** | Before a command runs | Fires accepted lesson-guards — warns when a recorded mistake is about to repeat |
|
|
160
170
|
| **SessionStart/SessionEnd (Codex)** | An ordinary Codex CLI plugin session starts, resumes, or ends | Launches the detached exact-thread companion, replaces its generation on resume, and retires it after the bounded idle queue window; a matching owner-private config may override its project/principal |
|
|
161
171
|
|
|
162
172
|
Because of the SessionStart hook: **in Claude Code, do NOT call `briefing` at
|
|
163
|
-
session start —
|
|
173
|
+
session start — whatever the configured level has to show is already in your
|
|
174
|
+
context.** Call it only mid-session
|
|
164
175
|
(context was compacted, or the user asks what you remember) or on hosts
|
|
165
176
|
without these hooks (other MCP clients, shell-only agents). Double-injection
|
|
166
177
|
spends the very tokens this system exists to save.
|
|
@@ -174,7 +185,8 @@ and retiring outdated info.
|
|
|
174
185
|
| Situation | Action |
|
|
175
186
|
|-----------|--------|
|
|
176
187
|
| User states what they're working on / what's next / what's blocking | `memesh task --goal "…"` / `--next "…"` / `--blocked "…"` |
|
|
177
|
-
| Design decision made | `memesh remember
|
|
188
|
+
| Design decision made | `memesh remember "Use OAuth 2.0 with PKCE for the API" --type decision --tags "project:myapp"` (or `remember({ note })` over MCP) |
|
|
189
|
+
| A stored memory is wrong | `memesh remember --name "auth-choice" --obs "the corrected fact" --replace` — the memory keeps its type and the old version moves to `metadata.replaced_history` (add `--type` only to reclassify it) |
|
|
178
190
|
| Bug fixed | `memesh learn --error "what broke" --fix "what fixed it" --root-cause "why" --severity major` |
|
|
179
191
|
| Starting work on a feature | `memesh recall "feature-name" --json` |
|
|
180
192
|
| User asks "what did we decide?" | `memesh recall "topic" --tag "project:myapp"` |
|
|
@@ -211,7 +223,13 @@ memesh remember \
|
|
|
211
223
|
Use a **stable name** (`db-choice`, not `db-choice-2026-08-16`): reusing the
|
|
212
224
|
name appends to the same entity instead of scattering duplicates. `--title` is
|
|
213
225
|
the human-readable headline; the name stays the machine key. If this replaces
|
|
214
|
-
an older decision, add `--supersedes "old-db-choice"`.
|
|
226
|
+
an older decision, add `--supersedes "old-db-choice"`. To correct it instead
|
|
227
|
+
of adding to it, repeat the call with `--replace`.
|
|
228
|
+
|
|
229
|
+
Quicker when the text is all you have: `memesh remember "SQLite for local-first
|
|
230
|
+
storage"` (MCP: `remember({ note: "…" })`). The first line becomes the title,
|
|
231
|
+
each following paragraph an observation, and the name is derived from the text,
|
|
232
|
+
so repeating the same text does not create a duplicate.
|
|
215
233
|
Types: `decision` `pattern` `lesson_learned` `bug_fix` `architecture` `convention` `feature` `best_practice` `concept` `tool` `note`
|
|
216
234
|
|
|
217
235
|
### You need context on a specific topic
|
|
@@ -239,15 +257,19 @@ human review. Do not hand-compress memories yourself.
|
|
|
239
257
|
```bash
|
|
240
258
|
memesh export --tag "project:myapp" > memories.json
|
|
241
259
|
memesh import memories.json --merge skip # skip | overwrite | append
|
|
260
|
+
# append/overwrite leave a memory you archived (forgot) alone; --merge append|overwrite --restore-archived brings it back
|
|
242
261
|
memesh status # version, install channel, update state
|
|
243
262
|
memesh reindex --fts # rebuild the local keyword index
|
|
244
263
|
```
|
|
245
264
|
|
|
246
265
|
## Memory hygiene
|
|
247
266
|
|
|
248
|
-
1. **Stable names append.** Remembering under an
|
|
249
|
-
observations and dedupes tags
|
|
250
|
-
|
|
267
|
+
1. **Stable names append — unless you ask to replace.** Remembering under an
|
|
268
|
+
existing name adds observations and dedupes tags by default. Pass
|
|
269
|
+
`replace: true` (CLI: `--replace`) to rewrite the entity's observations,
|
|
270
|
+
tags and title instead — the previous version moves to
|
|
271
|
+
`metadata.replaced_history`, not lost. Reuse the name to grow or correct
|
|
272
|
+
one memory; do not mint `-v2` / dated variants of it.
|
|
251
273
|
2. **`supersedes` retires the loser.** When a new memory replaces an old one,
|
|
252
274
|
record it with `--supersedes <old-name>` (MCP: a relation of type
|
|
253
275
|
`supersedes`). The old entity is archived — recoverable, out of recall.
|