agent-knowledge 1.9.8 → 3.0.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/CHANGELOG.md +82 -0
- package/README.md +53 -52
- package/dist/events.d.ts +16 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +31 -0
- package/dist/events.js.map +1 -0
- package/dist/index.js +31 -13
- package/dist/index.js.map +1 -1
- package/dist/knowledge/analyze.d.ts.map +1 -1
- package/dist/knowledge/analyze.js +18 -11
- package/dist/knowledge/analyze.js.map +1 -1
- package/dist/knowledge/consolidate.d.ts +2 -2
- package/dist/knowledge/consolidate.js +2 -2
- package/dist/knowledge/distill.d.ts.map +1 -1
- package/dist/knowledge/distill.js +28 -16
- package/dist/knowledge/distill.js.map +1 -1
- package/dist/knowledge/freshness.js +1 -1
- package/dist/knowledge/freshness.js.map +1 -1
- package/dist/knowledge/git.d.ts +3 -4
- package/dist/knowledge/git.d.ts.map +1 -1
- package/dist/knowledge/git.js +62 -49
- package/dist/knowledge/git.js.map +1 -1
- package/dist/knowledge/graph.d.ts +2 -0
- package/dist/knowledge/graph.d.ts.map +1 -1
- package/dist/knowledge/graph.js +8 -0
- package/dist/knowledge/graph.js.map +1 -1
- package/dist/knowledge/ingest-freshness.d.ts +22 -0
- package/dist/knowledge/ingest-freshness.d.ts.map +1 -0
- package/dist/knowledge/ingest-freshness.js +93 -0
- package/dist/knowledge/ingest-freshness.js.map +1 -0
- package/dist/knowledge/promote.js +1 -1
- package/dist/knowledge/promote.js.map +1 -1
- package/dist/knowledge/reflect.js +2 -2
- package/dist/knowledge/reflect.js.map +1 -1
- package/dist/knowledge/remove.d.ts +11 -0
- package/dist/knowledge/remove.d.ts.map +1 -0
- package/dist/knowledge/remove.js +24 -0
- package/dist/knowledge/remove.js.map +1 -0
- package/dist/knowledge/search.d.ts +76 -4
- package/dist/knowledge/search.d.ts.map +1 -1
- package/dist/knowledge/search.js +364 -37
- package/dist/knowledge/search.js.map +1 -1
- package/dist/knowledge/similar.d.ts +7 -0
- package/dist/knowledge/similar.d.ts.map +1 -0
- package/dist/knowledge/similar.js +51 -0
- package/dist/knowledge/similar.js.map +1 -0
- package/dist/knowledge/store.d.ts +20 -1
- package/dist/knowledge/store.d.ts.map +1 -1
- package/dist/knowledge/store.js +119 -84
- package/dist/knowledge/store.js.map +1 -1
- package/dist/lib.d.ts +1 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/package-meta.d.ts +4 -1
- package/dist/package-meta.d.ts.map +1 -1
- package/dist/package-meta.js +18 -9
- package/dist/package-meta.js.map +1 -1
- package/dist/rest-server.d.ts +31 -0
- package/dist/rest-server.d.ts.map +1 -0
- package/dist/rest-server.js +142 -0
- package/dist/rest-server.js.map +1 -0
- package/dist/search/bm25.d.ts +8 -0
- package/dist/search/bm25.d.ts.map +1 -1
- package/dist/search/bm25.js +32 -20
- package/dist/search/bm25.js.map +1 -1
- package/dist/search/excerpt.d.ts +1 -1
- package/dist/search/excerpt.d.ts.map +1 -1
- package/dist/search/excerpt.js +19 -1
- package/dist/search/excerpt.js.map +1 -1
- package/dist/search/lexicon.d.ts +37 -0
- package/dist/search/lexicon.d.ts.map +1 -0
- package/dist/search/lexicon.js +83 -0
- package/dist/search/lexicon.js.map +1 -0
- package/dist/search/mmr.d.ts +9 -3
- package/dist/search/mmr.d.ts.map +1 -1
- package/dist/search/mmr.js +21 -7
- package/dist/search/mmr.js.map +1 -1
- package/dist/search/types.d.ts +2 -0
- package/dist/search/types.d.ts.map +1 -1
- package/dist/server.d.ts +1 -5
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1 -13
- package/dist/server.js.map +1 -1
- package/dist/sessions/human.d.ts +12 -0
- package/dist/sessions/human.d.ts.map +1 -0
- package/dist/sessions/human.js +52 -0
- package/dist/sessions/human.js.map +1 -0
- package/dist/sessions/indexer.d.ts +4 -0
- package/dist/sessions/indexer.d.ts.map +1 -1
- package/dist/sessions/indexer.js +6 -1
- package/dist/sessions/indexer.js.map +1 -1
- package/dist/sessions/parser.d.ts +39 -0
- package/dist/sessions/parser.d.ts.map +1 -1
- package/dist/sessions/parser.js +169 -15
- package/dist/sessions/parser.js.map +1 -1
- package/dist/sessions/search.d.ts +2 -0
- package/dist/sessions/search.d.ts.map +1 -1
- package/dist/sessions/search.js +147 -67
- package/dist/sessions/search.js.map +1 -1
- package/dist/sessions/snapshot.d.ts +19 -0
- package/dist/sessions/snapshot.d.ts.map +1 -0
- package/dist/sessions/snapshot.js +118 -0
- package/dist/sessions/snapshot.js.map +1 -0
- package/dist/sessions/summary.d.ts +24 -5
- package/dist/sessions/summary.d.ts.map +1 -1
- package/dist/sessions/summary.js +122 -146
- package/dist/sessions/summary.js.map +1 -1
- package/dist/slice.d.ts +5 -0
- package/dist/slice.d.ts.map +1 -0
- package/dist/slice.js +28 -0
- package/dist/slice.js.map +1 -0
- package/dist/text.d.ts +9 -0
- package/dist/text.d.ts.map +1 -0
- package/dist/text.js +16 -0
- package/dist/text.js.map +1 -0
- package/dist/tool-handlers.d.ts.map +1 -1
- package/dist/tool-handlers.js +6 -10
- package/dist/tool-handlers.js.map +1 -1
- package/dist/transport/guard.d.ts +5 -0
- package/dist/transport/guard.d.ts.map +1 -0
- package/dist/transport/guard.js +51 -0
- package/dist/transport/guard.js.map +1 -0
- package/dist/transport/http.d.ts +17 -0
- package/dist/transport/http.d.ts.map +1 -0
- package/dist/transport/http.js +97 -0
- package/dist/transport/http.js.map +1 -0
- package/dist/transport/rest.d.ts +4 -0
- package/dist/transport/rest.d.ts.map +1 -0
- package/dist/transport/rest.js +424 -0
- package/dist/transport/rest.js.map +1 -0
- package/dist/vectorstore/store.d.ts +9 -0
- package/dist/vectorstore/store.d.ts.map +1 -1
- package/dist/vectorstore/store.js +23 -0
- package/dist/vectorstore/store.js.map +1 -1
- package/dist/wakeup.d.ts +5 -0
- package/dist/wakeup.d.ts.map +1 -1
- package/dist/wakeup.js +10 -1
- package/dist/wakeup.js.map +1 -1
- package/docs/ARCHITECTURE.md +25 -39
- package/docs/HOOKS.md +138 -237
- package/docs/INGEST.md +1 -1
- package/docs/SETUP.md +87 -143
- package/docs/USER-MANUAL.md +169 -100
- package/package.json +20 -17
- package/{skills → plugin/skills}/knowledge-ingest/SKILL.md +1 -1
- package/{skills → plugin/skills}/knowledge-ingest/scripts/validate.mjs +2 -2
- package/scripts/plugins/opencode/agent-knowledge.ts +37 -86
- package/scripts/setup.js +80 -146
- package/scripts/source-walk.d.mts +12 -0
- package/scripts/source-walk.mjs +94 -0
- package/scripts/tree-sitter-extract.mjs +10 -76
- package/.claude-plugin/marketplace.json +0 -19
- package/.claude-plugin/plugin.json +0 -12
- package/.mcp.json +0 -8
- package/agent-desk-plugin.json +0 -20
- package/dist/dashboard.d.ts +0 -5
- package/dist/dashboard.d.ts.map +0 -1
- package/dist/dashboard.js +0 -666
- package/dist/dashboard.js.map +0 -1
- package/dist/ui/app.js +0 -1013
- package/dist/ui/index.html +0 -460
- package/dist/ui/morphdom.min.js +0 -1
- package/dist/ui/render-graph.js +0 -482
- package/dist/ui/render-knowledge.js +0 -288
- package/dist/ui/render-panel.js +0 -475
- package/dist/ui/render-search.js +0 -105
- package/dist/ui/render-sessions.js +0 -237
- package/dist/ui/styles.css +0 -2322
- package/dist/ui/template.js +0 -173
- package/dist/ui/ui-utils.js +0 -217
- package/dist/ui/vis-network.min.js +0 -34
- package/docs/DASHBOARD.md +0 -191
- package/scripts/copy-ui.js +0 -14
- package/scripts/hooks/first-prompt-inject.mjs +0 -242
- package/scripts/hooks/precompact-distill.mjs +0 -105
- package/scripts/hooks/precompact-flush.mjs +0 -192
- package/scripts/hooks/session-start-ingest.mjs +0 -238
- package/scripts/hooks/session-start.js +0 -212
- package/scripts/hooks/sessionend-distill.mjs +0 -198
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,87 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.0.0 (2026-11-13) — the session lifecycle moves into the plugin
|
|
4
|
+
|
|
5
|
+
### Breaking
|
|
6
|
+
|
|
7
|
+
- **The six Claude Code command hooks are gone** (`scripts/hooks/session-start.js`, `session-start-ingest.mjs`, `first-prompt-inject.mjs`, `precompact-flush.mjs`, `precompact-distill.mjs`, `sessionend-distill.mjs`) and `scripts/setup.js` no longer installs hooks. The plugin's mod does their work (Claude Code 2.1.289+); see [docs/HOOKS.md](docs/HOOKS.md). Coming from 2.x: `node scripts/setup.js --host=claude` removes their entries from `~/.claude/settings.json`, then install the plugin. `setup.js` no longer registers the MCP server in `~/.claude.json` either (the plugin runs it) and installs the knowledge-ingest skill to `~/.agents/skills` only (the plugin carries it for Claude Code).
|
|
8
|
+
- **One session snapshot replaces three files**: the session's gist is written to `sessions/<project>/<day>-<id>.md`, rewritten at each compaction and at the end, in place of `projects/session-<cwd>-<id>.md`, `projects/precompact-<cwd>-<id>.md` and `sessions/<project>/PreCompact-<time>-<id>.md`, and with no `sessions/index.md` breadcrumb. Files the 2.x hooks wrote stay where they are.
|
|
9
|
+
- **`AGENT_KNOWLEDGE_EVENTS` is gone**: the session-end receipt is a live event recorded by the server itself.
|
|
10
|
+
- **The first-prompt marker files** (`<data dir>/.first-prompt-seen/`) are no longer written for Claude Code: the mod keeps the conversation's id in its session state. The opencode plugin keeps its own markers.
|
|
11
|
+
- `plugin/.mcp.json` runs `agent-knowledge@^3`.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **The session lifecycle in the plugin's mod**: the conversation's first message carries what the knowledge base holds, who the person is (or the onboarding question) and the project's ingest state; the first real prompt carries the matching entries (MMR re-ranked) with one line naming them; a compaction of the main thread snapshots the session and asks the summary to keep, under "Knowledge to save", what was not yet written; the session ending (or `/clear`) takes the last snapshot. Each fails open; the `AGENT_KNOWLEDGE_*` switches and budgets of 2.x apply.
|
|
16
|
+
- **REST**: `POST /api/sessions/:id/snapshot`, `GET /api/wakeup` (with `onboarding`: configured, declined or pending), `GET /api/ingest?cwd=`, and `mmr=true` on `GET /api/knowledge/search`. Any host can drive the same lifecycle.
|
|
17
|
+
- **The /knowledge pane draws a progress indicator** while it loads the entries, an entry, the sessions or a session.
|
|
18
|
+
- **The plugin manifest names its documentation** (`documentationUrl`) and carries an icon.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- **A deleted entry left its graph edges behind**: its links still showed on other pages, led nowhere, and counted in Analyze. Deleting (the MCP tool and the pane alike, now one pipeline) drops them; a link to an entry that is not there is drawn as `· gone`, not pressed, and Analyze counts only links whose ends exist. Following a link to an entry deleted meanwhile says so on the page, which stays.
|
|
23
|
+
- **MMR re-ranking diversified nothing**: raw BM25 relevance (20 and more) outweighed any similarity in [0, 1], and MMR only reorders, so with no strong alternative the slots still filled with copies. Relevance is now taken against the best candidate, and a candidate 0.8 similar or more to one already picked is dropped: near-copies come once.
|
|
24
|
+
- **The first-prompt hits misled more than they helped**: chit-chat, sums ("what's 17 times 23?") and asks about the person's own code ("add a dark mode toggle to the settings page", "the build is green now, thanks") brought entries that shared a word, and on-topic prompts came with unrelated ones beside the answer. Precision now comes first (no hit costs little, the model can still search): two hits at most, each named by the prompt's specific words (its title, path or tags, for 40% of what the prompt's words tell) and holding 60% of it, near the best; a prompt of generic words (said in a tenth of the person's sessions, naming almost no entry: commit, push, build) brings nothing, nor news that ends in thanks, a task on what is at hand, or a bare sum. With the local embedding model, the entry closest in meaning (cosine 0.6 or more) answers too. Measured in tests/first-prompt-eval.test.ts on prompts it was never tuned on (the reviewers', rounds 6 and 7), and on a copy of a real store: no off-topic injection on any base, 92% of the hits on topic (words) and 94% (with embeddings), against 4 of 10 off-topic prompts injected and 9 of 39 hits on topic before.
|
|
25
|
+
- **Sessions and snapshots read slash commands as questions**: a session after `/clear` was titled "/clear" and its summary began with it, most sessions in the list showed no prompt or "/clear". Slash commands and notices are not prompts: a session's preview, prompt count, "What was asked" and snapshot title skip them, and a session where nothing was asked writes no snapshot. The list folds such sessions away and marks this session; session hits in Search are named by their folder, as the list names them.
|
|
26
|
+
- **Counts disagreed**: the status line, Browse and Health counted the knowledge base three ways. The overview and `/health` count the curated entries and the session snapshots apart (`entries`, `snapshots`), and every count in the pane reads them; snapshots are named `snapshots` throughout.
|
|
27
|
+
- **Analyze capped its list at 30**: the rest of the entries with one link or none could not be reached. They come 30 at a time, fewest links first; on an empty knowledge base Analyze says only that there is nothing to analyze.
|
|
28
|
+
- **Session summaries missed errors**: `FAILED tests/…` and `psycopg2.errors.UniqueViolation: …` were not found (the match was case-sensitive and wanted `FAIL:`). A coloured error line (`\x1b[31mFAILED`) is found too.
|
|
29
|
+
- **Toasts stopped after the REST server changed hands**: each process numbered its events from 1, and the pane, remembering the highest it had seen, showed none until the new numbers caught up. Event ids now rise across processes.
|
|
30
|
+
- **Titles kept their YAML quotes** (`"Task #1: …"`): a quoted frontmatter value is read without its quotes, escapes included, tags too.
|
|
31
|
+
- **`/knowledge tools/gitbook-sync` was taken for a path**: words with a slash are a path only with `.md` or a folder of the knowledge base first; else they are searched.
|
|
32
|
+
- **Analyze sorted numbered titles as text** (1, 10, 2): it sorts them as numbers.
|
|
33
|
+
- **The 2.x hooks' session dumps flooded the knowledge base** (`projects/session-*`, `projects/precompact-*`, typed session-end, precompact): they are told apart as session records, like the snapshots: counted apart, out of Browse's all, the first-prompt hits and Analyze, left where they are. An entry without a title is named by its first heading; one without a date sorts by the date in its file name, else the file's.
|
|
34
|
+
- **A search right after the server started failed**: it waits for the index a bounded while, then the server says it is warming up (503) and the pane tries again, saying so.
|
|
35
|
+
- **Text with terminal control in it blanked the pane** (a session's tool output in colour, `\x1b[31m`): Claude Code refuses a whole drawing that holds a control character. Everything the server sends the pane is cleaned where it comes in (escape sequences dropped whole, the one-byte C1 forms of CSI, OSC and the other strings too, other controls shown as `�`), and the server writes no escape sequence into a snapshot, nor into an excerpt.
|
|
36
|
+
- **A compaction's summary counted as a prompt**: it was "What was asked" in the snapshot (and in git) and one more prompt in the session's count. A compaction summary is no prompt.
|
|
37
|
+
- **The /knowledge pane**: an open entry follows its file (an edit elsewhere shows, a delete elsewhere takes you back, said); a snapshot whose transcript is not on this machine no longer offers to open it, and one that is comes back to the snapshot; the digits stay the pane's while the server is down; code is drawn apart from the prose and a wrapped command reads as one; a table too wide keeps every value with its header; the ingest never done or behind reaches the person (a toast, Health, the empty Browse's **Ingest ›**), not only the model.; Sessions go on past the newest 100, a page at a time from the server; an edit made elsewhere to the open entry is said (`! … changed elsewhere`); the ring waits on Refresh while a delete is drawn away, never on a category in its place; the snapshots are named snapshots in their heading and facts; the first-prompt line names its hits whole; the folder is shown whole; a search with no entry hit says so beside the session hits; a snapshot page says when its session was last active; the row a page added is shown whole; `/knowledge <path>` leaves no old Find behind it; the ring in Find stays there when a folder appears or goes above it, written or emptied elsewhere; after `/clear` an open pane draws its list again; the snapshot `/clear` takes is said in the next conversation's first line (a toast is drawn neither in the one ending nor in a screen `/clear` just emptied), and a compaction's toast says "at compaction"; plain `/knowledge` is Browse; Find wants all its words; `/knowledge projects/` opens that folder; a tab key while the server is down is said; Enter twice on Ingest no longer runs the command it put in the prompt (the prompt takes the keys with the text; an Enter there within 400 ms is held and the command put back), and Ingest, Sync and Delete hold a press that comes as the view changes; a key pressed while the ring lands wins over the landing, a search typed in its field leaving it while it runs; a Find or Search field drawn anew shows what is applied or typed; after a delete the ring rests on Refresh; a 2.x dump without a title is named by its project, day and kind
|
|
38
|
+
- **The /knowledge pane follows the conventions it shares with /pipeline and /discover**: replies to `/knowledge` say something only when something is wrong; the busy line is a progress line; outcomes marked ✓ done, ✗ failed, ! changed elsewhere, – nothing happened, and mirrored in the status line while the pane shows; toasts `Label: subject`, three at most; folds `▸ N more` / `▾ Show less`, dimmed; the delete confirmation says what goes and what links are lost, with **Keep it** first; the ring never lands on Sync; the rows keep their order while the pane has the keyboard; an open pane is opened afresh by `/knowledge`; a failed sync is kept under Recent activity.
|
|
39
|
+
- **Session summaries**: Commits are the ones `git commit` reported (a SHA a log or a push showed is not one made in the session), and Files are the ones an editing or writing tool call changed (a path a result mentioned is not).
|
|
40
|
+
- **The /knowledge pane**: Search lands on its tab (2 again or Enter on the tab types), so the tab hotkeys never dead-end in the field; a deleted entry leaves the search hits; a new view starts at its top; a capped list says it shows the best; One link or none says how many in all; the onboarding names the folder as it is on disk; an outcome is no longer wiped by one slow poll; toasts say what happened in words; the folder keeps its root (`~\…\knowledge`); list items and Recent activity hang-indent; the age comes before the tags in a row.
|
|
41
|
+
- **Session names and previews read as the person typed them**: a slash command shows as `/name args`, not its `<command-name>` wrapper, and the caveat, stdout and reminder blocks Claude Code wraps around it are left out of previews, prompt counts and summary topics; a session's project is its folder's name and a detached `HEAD` is no branch. A session summary in the pane names its id and how to resume it (`claude --resume <id>`).
|
|
42
|
+
- **Session snapshots stay apart from curated knowledge**: Browse counts and lists the curated entries (the snapshots are their own category, _snapshots_, with an empty state that leads to them), Analyze leaves them out, and the first-prompt hits skip them (`skip=sessions` on `GET /api/knowledge/search`). A snapshot page names its session and opens it.
|
|
43
|
+
- **Entry pages**: an incoming link reads with the other entry first (`← title · depends on this`); links in the body are listed as _mentions_ that open their entry (a gone one marked), the text plain; a table wider than the pane reads one row a line; times carry their date (`YYYY-MM-DD HH:MM`), ages past a day count days; a row drops a fact that does not fit whole; Find narrows as it is typed; `/knowledge README.md` opens the entry; command replies say what was found for the words, or that nothing was; an unknown event kind reads as words; Analyze on an empty knowledge base says there is nothing to analyze; back from a session opened from a search lands on its hit; the snapshot a session made is toasted once.
|
|
44
|
+
- **Search excerpts**: a question not found as one phrase is centred on the first of its words that is, and a short code line stays in the excerpt.
|
|
45
|
+
- **The REST server stopped answering for seconds at a time, and a stuck holder kept the port**: the search indexes were thrown away every 60 s and rebuilt in one synchronous block (4.7 s for 2,000 entries; 25–35 s for a gigabyte of session transcripts), so the process holding the port answered nothing meanwhile and every caller timed out. Both indexes now follow their files: a search compares sizes and times and re-reads only what changed, and a live session's file is read from where the last read ended (warm searches: about 0.2 s). Builds run in slices that give the event loop back, and the process that takes the port warms them as it starts. The holder asks itself for `/health` every 30 s; two unanswered checks close its listener and it binds again, so a listener that stopped accepting no longer holds the port for every session.
|
|
46
|
+
- **The plugin never waits on a stuck server**: every call gives up after a bound (2 s for the session's first message and the first prompt, 5 s for the pane's poll, 10 s for other pane calls, 60 s for a git sync or delete), and the session goes on as without the plugin.
|
|
47
|
+
- **The real-CLI suites build into `dist-e2e/`**, never the `dist/` running sessions' servers were started from.
|
|
48
|
+
- **Session files carried secrets and noise into git**: the 2.x session-end and pre-compact files held prompts as typed, tokens and task notifications included. The snapshot scrubs them as the distiller does (secrets, e-mail addresses, home paths, system reminders, task notifications, command wrappers) and leaves out a session where nothing was asked.
|
|
49
|
+
- **A background task's notice or another session's message no longer spends the first-prompt injection**, and a server that does not answer leaves it for the next prompt.
|
|
50
|
+
|
|
51
|
+
## 2.0.0 (2026-10-23) — the /knowledge pane replaces the web dashboard
|
|
52
|
+
|
|
53
|
+
### Breaking
|
|
54
|
+
|
|
55
|
+
- **The web dashboard is gone**: `src/ui/`, the WebSocket and its livereload file watcher, static file serving, the CSP and browser-only headers, and the Playwright dashboard suite. Port 3423 now answers JSON only. In Claude Code, `/knowledge` (agent-knowledge plugin) shows the knowledge base in a pane beside the conversation.
|
|
56
|
+
- **REST routes the dashboard alone used are removed**: `/api/index-status`, `/api/knowledge/consolidate|reflect|god-nodes|bridges|gaps|brief|graph-data`, `/api/sessions/recall`, `/api/sessions/:id`. The MCP tools keep every one of these capabilities.
|
|
57
|
+
- **`GET /api/sessions` always answers `{ sessions, total }`** (limit default 50, max 500, `offset`), not a bare array.
|
|
58
|
+
- **`GET /api/knowledge/:path`** answers 404 for a missing entry and 400 for a path outside the knowledge base (was 500).
|
|
59
|
+
- **The plugin moved to `plugin/`**: `plugin/.claude-plugin/plugin.json`, `plugin/.mcp.json` (`agent-knowledge@^2`), and the knowledge-ingest skill at `plugin/skills/knowledge-ingest/`. The marketplace entry points at `./plugin`. The root `.mcp.json` is removed.
|
|
60
|
+
- **`AGENT_KNOWLEDGE_DASHBOARD_EVENTS` is renamed `AGENT_KNOWLEDGE_EVENTS`** (`0` stops the session-end hook's `POST /api/events`).
|
|
61
|
+
- **No agent-common dependency**: the request guard, the router and the package metadata live in `src/`.
|
|
62
|
+
- **Background indexing runs only in the process that serves the REST port**: `createServer()` (also from `agent-knowledge/lib`) no longer starts it. A program embedding the library gets no embeddings unless it runs `backgroundIndex()` itself.
|
|
63
|
+
|
|
64
|
+
### Added
|
|
65
|
+
|
|
66
|
+
- **The `/knowledge` pane** (`plugin/hooks/`, Claude Code 2.1.289+): see the user manual.
|
|
67
|
+
- **REST takeover**: the first MCP process serves `127.0.0.1:3423`; the others retry the port every 5 s, so the pane and the hooks keep working when the serving session exits. The process holding the port also runs the background indexer, so it moves with the takeover.
|
|
68
|
+
- **Pane routes**: `GET /api/overview`, `GET /api/analysis`, `DELETE /api/knowledge/:path`, `POST /api/knowledge/sync`; `GET /api/knowledge/:path/links` gives each edge the title of the entry at its other end.
|
|
69
|
+
- **Tests**: every kept REST route against its caller's contract, the request guard, the takeover, the release manifests, the session-start-ingest hook, and a real Claude Code suite (`tests/e2e-claude/mcp.e2e.test.ts`, `AGENT_KNOWLEDGE_E2E_CLAUDE=1`) that calls every MCP tool and action through `claude -p` and checks the files, git history and DB rows they leave.
|
|
70
|
+
|
|
71
|
+
### Fixed
|
|
72
|
+
|
|
73
|
+
- **Tool calls in Claude Code sessions were invisible**: Claude Code nests `tool_use` and `tool_result` blocks inside message content, which the parser dropped (tool calls) or indexed as JSON user text (results). The `tools` search scope never matched a Claude Code session and session summaries listed no tools. Both are now extracted as `tool_use` / `tool_result` messages.
|
|
74
|
+
- **Prompts named tools that do not exist**: the reflect instructions said `knowledge_link` (now `knowledge_graph` action `link`), and the knowledge base README template listed `knowledge_list`, `knowledge_read`, `knowledge_write`, `knowledge_sync`, `knowledge_config`.
|
|
75
|
+
- **The rate limiter is gone**: the server is loopback only and every caller shares one address, so its shared 100/min bucket throttled every pane and hook at once.
|
|
76
|
+
- **A body over the size limit now gets its 413** instead of a reset connection.
|
|
77
|
+
- **Knowledge-search excerpts showed the raw frontmatter** (`--- title: … tags: …`) to MCP callers and the pane; they now come from the entry body. Ranking still indexes the whole file.
|
|
78
|
+
- **Search excerpts ran unrelated text together**: a heading was glued onto the body and list items lost their separators. Excerpts drop headings and code blocks (with what they hold), read a table row as its cells, and join paragraphs, list items and rows with `·`, for MCP callers and the pane alike.
|
|
79
|
+
- **A session file under 32 KB got an end time equal to its start time** (`fastMeta` read the end only past 32 KB; a smaller file now takes its last timestamped line).
|
|
80
|
+
- **Listing entries was slow on a large base** (1.1 s on 1,721 entries): the counts the pane polls come from file names alone.
|
|
81
|
+
- **Link analysis ran the duplicate scan** (274 s on the same base); it now lists the most linked entries and the ones with one link or none, each entry in one list only.
|
|
82
|
+
- **The REST server opened a new vector-store connection on every overview** and never closed it; it shares the indexer's one connection, closed on exit.
|
|
83
|
+
- **Unit tests read the person's real sessions and config** through home-dir auto-detection, which made several of them slow or flaky; each test file now gets a scratch HOME (`tests/setup-home.ts`).
|
|
84
|
+
|
|
3
85
|
## 1.9.7 (2026-04-21) — first-class OpenCode plugin + setup auto-wiring
|
|
4
86
|
|
|
5
87
|
OpenCode parity for the lifecycle hooks that were previously Claude-Code-only.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](LICENSE)
|
|
4
4
|
[](https://nodejs.org)
|
|
5
|
-
[]()
|
|
6
6
|
[]()
|
|
7
7
|
[]()
|
|
8
8
|
|
|
@@ -10,16 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
**Benchmark:** **R@5 = 97.2% (sparse) / 98.8% (hybrid)** on `longmemeval_s` and **86.0% (sparse) / 88.4% (hybrid)** on the harder `longmemeval_m` split — the public LongMemEval academic benchmark (Wu et al. 2024, ICLR 2025), full 500 questions per split, no LLM, no API key, runs entirely offline. **+8.6pp to +13.2pp R@5 over the paper's official `flat-bm25` baseline** in apples-to-apples reproduction. Full per-category table, reproduction instructions, and paper-comparison details in [`bench/README.md`](bench/README.md).
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<td><img src="docs/assets/search-light.png" alt="Session Search" width="480"></td>
|
|
17
|
-
</tr>
|
|
18
|
-
<tr>
|
|
19
|
-
<td align="center"><em>Knowledge base with category filtering</em></td>
|
|
20
|
-
<td align="center"><em>TF-IDF ranked session search</em></td>
|
|
21
|
-
</tr>
|
|
22
|
-
</table>
|
|
13
|
+
In Claude Code, the agent-knowledge plugin adds the `/knowledge` pane: the knowledge base beside the conversation. How it works, with pictures: [the user manual](docs/USER-MANUAL.md#4-the-knowledge-pane).
|
|
14
|
+
|
|
15
|
+

|
|
23
16
|
|
|
24
17
|
## Why
|
|
25
18
|
|
|
@@ -60,8 +53,8 @@ No configuration needed. Additional session roots can be added via the `AGENT_KN
|
|
|
60
53
|
- **Fuzzy matching** -- typo-tolerant search using Levenshtein distance
|
|
61
54
|
- **6 search scopes** -- errors, plans, configs, tools, files, decisions
|
|
62
55
|
- **6 MCP tools** -- consolidated action-based interface (`knowledge`, `knowledge_search`, `knowledge_session`, `knowledge_graph`, `knowledge_analyze`, `knowledge_admin`)
|
|
63
|
-
- **Evergreen entries** -- `evergreen: true` in frontmatter exempts an entry from decay in ranking AND makes it append-only under promotion.
|
|
64
|
-
- **Author attribution** -- optional `author: <string>` frontmatter
|
|
56
|
+
- **Evergreen entries** -- `evergreen: true` in frontmatter exempts an entry from decay in ranking AND makes it append-only under promotion. The `/knowledge` pane marks them.
|
|
57
|
+
- **Author attribution** -- optional `author: <string>` frontmatter, kept with the entry and returned by the REST API.
|
|
65
58
|
- **Code graph resolution** -- `calls`, `imports`, `inherits` edge types for code structure; directed BFS traversal (`outbound`/`inbound`/`both`); `bulk_link` for efficient ingestion; `unlink_by_origin` for clearing stale code edges before re-ingest; `code:` prefixed node IDs distinguish code from knowledge
|
|
66
59
|
- **Temporal knowledge graph** -- edges support `valid_from` / `valid_to` validity windows; `as_of` queries return point-in-time snapshots; `invalidate` action marks facts as ended without deleting them
|
|
67
60
|
- **Hybrid scoring boosts** -- proper-noun and temporal-proximity boosts on top of TF-IDF + semantic blend, capped at +66.7%, short-circuit when no signals are present
|
|
@@ -69,7 +62,7 @@ No configuration needed. Additional session roots can be added via the `AGENT_KN
|
|
|
69
62
|
- **Verbatim session indexing** -- per-message chunks (≥30 chars) embedded into the vector store so raw conversation is retrievable; toggle with `AGENT_KNOWLEDGE_INDEX_VERBATIM=false`
|
|
70
63
|
- **Configurable git URL** -- `knowledge_admin(action: "config")` for runtime setup, persisted at XDG/AppData location
|
|
71
64
|
- **Cross-machine persistence** -- knowledge syncs via git, sessions read from local storage of each tool
|
|
72
|
-
-
|
|
65
|
+
- **`/knowledge` pane in Claude Code** -- browse and search the knowledge base beside the conversation (agent-knowledge plugin)
|
|
73
66
|
- **Secrets scrubbing** -- API keys, tokens, passwords, private keys automatically redacted before git push
|
|
74
67
|
- **Knowledge graph** -- relationship edges between entries (related_to, supersedes, depends_on, contradicts, specializes, part_of, alternative_to, builds_on) with BFS traversal
|
|
75
68
|
- **Confidence/decay scoring** -- entries scored by access frequency and recency; auto-promotion from candidate to established to proven
|
|
@@ -83,7 +76,7 @@ No configuration needed. Additional session roots can be added via the `AGENT_KN
|
|
|
83
76
|
- **Deterministic pre-extraction in distillation** — session summaries now include git commits, error patterns, URLs accessed, and packages changed extracted via regex from bash/tool output (no LLM cost)
|
|
84
77
|
- **Freshness metadata on every search hit** — every knowledge result carries `freshness: { body_age_days, last_accessed, access_count, verified_at, verification_age_days, evergreen }`. Agent reads the trust signal and decides; we impose no policy demotion.
|
|
85
78
|
- **Per-category decay windows** — the "Unused" filter and bytype chart honor per-category thresholds (projects 180d, people 365d, decisions 90d, workflows 60d, notes 30d) so identity-shaped content doesn't look stale just because it isn't re-read weekly.
|
|
86
|
-
- **
|
|
79
|
+
- **Session lifecycle (Claude Code plugin)** — each conversation starts knowing what the knowledge base holds, who the person is (or asks them once) and whether the project's ingest is current; the first real prompt carries the entries that match it; the session is snapshotted into the knowledge base when it is compacted and when it ends, secrets scrubbed. No command hooks: the plugin's mod does it, fail-open, each part switchable by an `AGENT_KNOWLEDGE_*` env var. See [`docs/HOOKS.md`](docs/HOOKS.md).
|
|
87
80
|
- **Replaces host auto-memory** — on hosts with a per-session memory system (Claude Code's `~/.claude/projects/*/memory/`, similar in other IDEs), route durable user facts and feedback to agent-knowledge instead. Auto-memory is machine-local and invisible to other machines; agent-knowledge is git-synced, cross-machine, searchable, and surfaces in wakeup. See the Claude Code integration note in [`docs/USER-MANUAL.md`](docs/USER-MANUAL.md#persistent-memory--agent-knowledge-not-host-auto-memory).
|
|
88
81
|
|
|
89
82
|
## Codebase Ingestion
|
|
@@ -129,16 +122,19 @@ Add to your MCP client config (Claude Code, Cline, etc.):
|
|
|
129
122
|
}
|
|
130
123
|
```
|
|
131
124
|
|
|
132
|
-
The
|
|
125
|
+
The first MCP process also serves a local REST API on `127.0.0.1:3423` (what the Claude Code plugin, the opencode plugin and agent-tasks call); when it exits, another running session takes the port over.
|
|
133
126
|
|
|
134
127
|
See [Setup Guide](docs/SETUP.md) for client-specific instructions (Claude Code, Cursor, Windsurf, OpenCode).
|
|
135
128
|
|
|
136
|
-
### Option 2:
|
|
129
|
+
### Option 2: Claude Code plugin
|
|
137
130
|
|
|
138
131
|
```bash
|
|
139
|
-
|
|
132
|
+
claude plugin marketplace add keshrath/agent-knowledge
|
|
133
|
+
claude plugin install agent-knowledge@agent-knowledge
|
|
140
134
|
```
|
|
141
135
|
|
|
136
|
+
The plugin brings the MCP server, the `knowledge-ingest` skill and a mod (Claude Code 2.1.289+): the `/knowledge` pane and the [session lifecycle](docs/HOOKS.md). Use it in place of Option 1 in Claude Code; a hand-written `agent-knowledge` entry in `~/.claude.json` would list the tools twice. Coming from 2.x, run `node scripts/setup.js --host=claude` once: it removes the old command hooks from `settings.json`.
|
|
137
|
+
|
|
142
138
|
## MCP Tools (6)
|
|
143
139
|
|
|
144
140
|
### Knowledge Base
|
|
@@ -230,22 +226,27 @@ Write-bench harness: `npm run bench:promote` — offline replay with auto-labeli
|
|
|
230
226
|
|
|
231
227
|
## REST API
|
|
232
228
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
|
236
|
-
|
|
|
237
|
-
| GET | `/
|
|
238
|
-
| GET | `/api/knowledge
|
|
239
|
-
| GET | `/api/knowledge
|
|
240
|
-
| GET | `/api/knowledge/
|
|
241
|
-
| GET | `/api/knowledge
|
|
242
|
-
| GET | `/api/
|
|
243
|
-
|
|
|
244
|
-
|
|
|
245
|
-
|
|
|
246
|
-
| GET | `/api/
|
|
247
|
-
|
|
|
248
|
-
| GET | `/
|
|
229
|
+
Loopback only (`127.0.0.1`), JSON only. Every request goes through a guard: a foreign `Host` or any `Origin` header gets 403, a request body must be `application/json`. A `:path` with a slash is sent encoded (`notes%2Fx.md`).
|
|
230
|
+
|
|
231
|
+
| Method | Endpoint | Caller | Description |
|
|
232
|
+
| ------ | -------------------------------------------- | --------------------------- | ---------------------------------------------------------- |
|
|
233
|
+
| GET | `/health` | pane | Status, version, `entries` (curated), `snapshots` |
|
|
234
|
+
| GET | `/api/overview` | `/knowledge` pane | `entries`, `snapshots`, curated `categories`, events |
|
|
235
|
+
| GET | `/api/knowledge?category=&tag=` | pane | List entries with their scoring |
|
|
236
|
+
| GET | `/api/knowledge/search?q=&max_results=&mmr=` | pane, mod, opencode plugin | Search (`mmr`, `skip=sessions`, `min_terms=2`, `prompt`) |
|
|
237
|
+
| GET | `/api/knowledge/:path` | pane | Read one entry (a snapshot: `session_on_machine`) |
|
|
238
|
+
| GET | `/api/knowledge/:path/links` | pane | The entry's graph edges, each with the other end's title |
|
|
239
|
+
| DELETE | `/api/knowledge/:path` | pane | Delete an entry (git synced) |
|
|
240
|
+
| POST | `/api/knowledge` | agent-tasks KnowledgeBridge | Write an entry (full write pipeline) |
|
|
241
|
+
| POST | `/api/knowledge/sync` | pane | git pull + push |
|
|
242
|
+
| GET | `/api/analysis?offset=&limit=` | pane | Hubs; `sparse` paged (fewest links, title), `sparse_total` |
|
|
243
|
+
| GET | `/api/sessions?limit=&offset=&project=` | pane | Sessions, paged: `{ sessions, total }` |
|
|
244
|
+
| GET | `/api/sessions/search?q=&role=` | pane | Search sessions (each hit's project as `name`) |
|
|
245
|
+
| GET | `/api/sessions/:id/summary` | pane | Session summary |
|
|
246
|
+
| POST | `/api/sessions/:id/snapshot` | mod, opencode plugin | `{ event, cwd? }`: the session into `sessions/<project>/` |
|
|
247
|
+
| GET | `/api/wakeup?sections=&budget=` | mod (first message) | The wakeup bundle and `onboarding` (identity state) |
|
|
248
|
+
| GET | `/api/ingest?cwd=` | mod (first message) | The folder's ingest freshness |
|
|
249
|
+
| POST | `/api/events` | any host | `{ kind, message }`: a receipt the pane toasts |
|
|
249
250
|
|
|
250
251
|
## Architecture
|
|
251
252
|
|
|
@@ -268,13 +269,13 @@ graph LR
|
|
|
268
269
|
KM[Knowledge Module<br/>store / search / git]
|
|
269
270
|
AD[Session Adapters<br/>auto-discovery]
|
|
270
271
|
SE[Search Engine<br/>TF-IDF + Fuzzy]
|
|
271
|
-
DS[
|
|
272
|
+
DS[REST API<br/>127.0.0.1:3423]
|
|
272
273
|
MCP[MCP Server<br/>stdio]
|
|
273
274
|
end
|
|
274
275
|
|
|
275
276
|
subgraph Clients
|
|
276
277
|
AG[Agent Sessions]
|
|
277
|
-
|
|
278
|
+
PN["/knowledge pane + mod<br/>agent-tasks"]
|
|
278
279
|
end
|
|
279
280
|
|
|
280
281
|
KB <-->|git pull/push| KM
|
|
@@ -290,7 +291,7 @@ graph LR
|
|
|
290
291
|
KM --> DS
|
|
291
292
|
SE --> DS
|
|
292
293
|
MCP --> AG
|
|
293
|
-
DS -->
|
|
294
|
+
DS --> PN
|
|
294
295
|
```
|
|
295
296
|
|
|
296
297
|
## Knowledge Graph
|
|
@@ -378,12 +379,12 @@ This enables HTTP-based writes from other services without an MCP connection.
|
|
|
378
379
|
|
|
379
380
|
### agent-tasks KnowledgeBridge
|
|
380
381
|
|
|
381
|
-
[agent-tasks](https://github.com/keshrath/agent-tasks) has a built-in `KnowledgeBridge` that auto-pushes `learning` and `decision` artifacts to agent-knowledge on task completion. Entries land in `decisions/` with frontmatter tags (`agent-tasks`, project name, artifact type), are auto-indexed with embeddings, and auto-linked to similar entries. No configuration needed
|
|
382
|
+
[agent-tasks](https://github.com/keshrath/agent-tasks) has a built-in `KnowledgeBridge` that auto-pushes `learning` and `decision` artifacts to agent-knowledge on task completion. Entries land in `decisions/` with frontmatter tags (`agent-tasks`, project name, artifact type), are auto-indexed with embeddings, and auto-linked to similar entries. No configuration needed: while any session runs agent-knowledge, its REST API on `127.0.0.1:3423` answers.
|
|
382
383
|
|
|
383
384
|
## Testing
|
|
384
385
|
|
|
385
386
|
```bash
|
|
386
|
-
npm test #
|
|
387
|
+
npm test # 604 tests across 39 files
|
|
387
388
|
npm run test:watch # Watch mode
|
|
388
389
|
npm run lint # ESLint on src/ and tests/
|
|
389
390
|
npm run typecheck # tsc --noEmit
|
|
@@ -404,8 +405,8 @@ All env vars live under the `AGENT_KNOWLEDGE_*` prefix. No host name is baked in
|
|
|
404
405
|
| `AGENT_KNOWLEDGE_INDEX_VERBATIM` | `true` | Index raw session message chunks into the vector store so conversation is retrievable later. Set `false` to save disk at scale. |
|
|
405
406
|
| `AGENT_KNOWLEDGE_DATA_DIR` | (platform config) | Override the primary host data root. Leave unset in the common case — adapters auto-detect every well-known host root under `~/`. |
|
|
406
407
|
| `AGENT_KNOWLEDGE_EXTRA_SESSION_ROOTS` | -- | Extra session directories, comma-separated. Added to whatever auto-detection finds. |
|
|
407
|
-
| `AGENT_KNOWLEDGE_PORT` | `3423` |
|
|
408
|
-
| `AGENT_KNOWLEDGE_HOST` | `127.0.0.1` |
|
|
408
|
+
| `AGENT_KNOWLEDGE_PORT` | `3423` | Local REST API port (the Claude Code plugin, the opencode plugin, agent-tasks) |
|
|
409
|
+
| `AGENT_KNOWLEDGE_HOST` | `127.0.0.1` | REST bind address |
|
|
409
410
|
|
|
410
411
|
### Embeddings
|
|
411
412
|
|
|
@@ -427,16 +428,16 @@ Project-scoped overrides win over the standard keys. Set either; the scoped form
|
|
|
427
428
|
| `AGENT_KNOWLEDGE_ANTHROPIC_API_KEY` | `ANTHROPIC_API_KEY` | Claude / Voyage embeddings |
|
|
428
429
|
| `AGENT_KNOWLEDGE_GEMINI_API_KEY` | `GEMINI_API_KEY` | Gemini embeddings |
|
|
429
430
|
|
|
430
|
-
###
|
|
431
|
+
### Session lifecycle (Claude Code plugin, opencode plugin)
|
|
431
432
|
|
|
432
|
-
| Variable | Default | Description
|
|
433
|
-
| -------------------------------------- | ------- |
|
|
434
|
-
| `AGENT_KNOWLEDGE_AUTOWAKE` | `1` |
|
|
435
|
-
| `AGENT_KNOWLEDGE_WAKEUP_BUDGET` | `
|
|
436
|
-
| `AGENT_KNOWLEDGE_FIRSTPROMPT_INJECT` | `1` |
|
|
437
|
-
| `AGENT_KNOWLEDGE_FIRSTPROMPT_BUDGET` | `600` | Tokens for
|
|
438
|
-
| `AGENT_KNOWLEDGE_FIRSTPROMPT_MAX_HITS` | `
|
|
439
|
-
| `AGENT_KNOWLEDGE_PRECOMPACT_NUDGE` | `1` |
|
|
433
|
+
| Variable | Default | Description |
|
|
434
|
+
| -------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------- |
|
|
435
|
+
| `AGENT_KNOWLEDGE_AUTOWAKE` | `1` | Who the person is (or the onboarding question) in the first message. `0` / `false` / `off` to disable. |
|
|
436
|
+
| `AGENT_KNOWLEDGE_WAKEUP_BUDGET` | `200` | Tokens for the identity section (clamp `[50, 4000]`) |
|
|
437
|
+
| `AGENT_KNOWLEDGE_FIRSTPROMPT_INJECT` | `1` | The first real prompt carries the matching entries. `0` / `false` / `off` to disable. |
|
|
438
|
+
| `AGENT_KNOWLEDGE_FIRSTPROMPT_BUDGET` | `600` | Tokens for those entries (clamp `[100, 8000]`) |
|
|
439
|
+
| `AGENT_KNOWLEDGE_FIRSTPROMPT_MAX_HITS` | `2` | Entries at most (clamp `[1, 2]`) |
|
|
440
|
+
| `AGENT_KNOWLEDGE_PRECOMPACT_NUDGE` | `1` | A compaction's summary keeps what is still to be saved. `0` / `false` leaves it; `off` takes no snapshot. |
|
|
440
441
|
|
|
441
442
|
### External tool overrides
|
|
442
443
|
|
|
@@ -446,10 +447,10 @@ Project-scoped overrides win over the standard keys. Set either; the scoped form
|
|
|
446
447
|
|
|
447
448
|
## Documentation
|
|
448
449
|
|
|
449
|
-
- [Setup Guide](docs/SETUP.md) — installation, client setup (Claude Code, OpenCode, Cursor, Windsurf),
|
|
450
|
+
- [Setup Guide](docs/SETUP.md) — installation, client setup (Claude Code, OpenCode, Cursor, Windsurf), skills
|
|
450
451
|
- [Ingestion Guide](docs/INGEST.md) — codebase ingestion skill, tree-sitter extraction, incremental updates
|
|
451
452
|
- [Architecture](docs/ARCHITECTURE.md) — source structure, design principles, database schema
|
|
452
|
-
- [
|
|
453
|
+
- [Session lifecycle](docs/HOOKS.md) — what the Claude Code plugin does around each session
|
|
453
454
|
- [Changelog](CHANGELOG.md)
|
|
454
455
|
|
|
455
456
|
## License
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface LiveEvent {
|
|
2
|
+
id: number;
|
|
3
|
+
kind: string;
|
|
4
|
+
message: string;
|
|
5
|
+
ts: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Ids rise across processes, not only within one: each is the time it was recorded (in ms),
|
|
9
|
+
* or one past the last when two come in the same ms. A process that takes the port over
|
|
10
|
+
* after another goes on above the ids that one gave, so a reader that remembers the highest
|
|
11
|
+
* id it saw (the pane) sees the new events, not none until the ids catch up.
|
|
12
|
+
*/
|
|
13
|
+
export declare function recordEvent(kind: string, message: string): LiveEvent;
|
|
14
|
+
/** The ring's events, oldest first. */
|
|
15
|
+
export declare function recentEvents(): LiveEvent[];
|
|
16
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ;AAMD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAOpE;AAED,uCAAuC;AACvC,wBAAgB,YAAY,IAAI,SAAS,EAAE,CAE1C"}
|
package/dist/events.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// agent-knowledge — Live event ring
|
|
3
|
+
//
|
|
4
|
+
// A short in-memory buffer of recent events (session-end receipts, distill
|
|
5
|
+
// results) that hooks POST to /api/events and the /knowledge pane reads.
|
|
6
|
+
// Unpersisted: the authoritative receipts land on disk as session files.
|
|
7
|
+
// The oldest event drops when the ring is full.
|
|
8
|
+
// =============================================================================
|
|
9
|
+
const EVENT_RING_MAX = 10;
|
|
10
|
+
const ring = [];
|
|
11
|
+
let lastId = 0;
|
|
12
|
+
/**
|
|
13
|
+
* Ids rise across processes, not only within one: each is the time it was recorded (in ms),
|
|
14
|
+
* or one past the last when two come in the same ms. A process that takes the port over
|
|
15
|
+
* after another goes on above the ids that one gave, so a reader that remembers the highest
|
|
16
|
+
* id it saw (the pane) sees the new events, not none until the ids catch up.
|
|
17
|
+
*/
|
|
18
|
+
export function recordEvent(kind, message) {
|
|
19
|
+
const ts = Date.now();
|
|
20
|
+
lastId = Math.max(lastId + 1, ts);
|
|
21
|
+
const evt = { id: lastId, kind, message, ts };
|
|
22
|
+
ring.push(evt);
|
|
23
|
+
while (ring.length > EVENT_RING_MAX)
|
|
24
|
+
ring.shift();
|
|
25
|
+
return evt;
|
|
26
|
+
}
|
|
27
|
+
/** The ring's events, oldest first. */
|
|
28
|
+
export function recentEvents() {
|
|
29
|
+
return ring.slice();
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oCAAoC;AACpC,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,yEAAyE;AACzE,gDAAgD;AAChD,gFAAgF;AAShF,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,IAAI,GAAgB,EAAE,CAAC;AAC7B,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,OAAe;IACvD,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACtB,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IAClC,MAAM,GAAG,GAAc,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,OAAO,IAAI,CAAC,MAAM,GAAG,cAAc;QAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IAClD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,YAAY;IAC1B,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;AACtB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// agent-knowledge — MCP stdio entry point
|
|
4
|
+
//
|
|
5
|
+
// Serves the MCP tools over stdio. The process that holds the REST port
|
|
6
|
+
// (AGENT_KNOWLEDGE_PORT, default 3423) also runs the background indexer; the
|
|
7
|
+
// others retry the port and take over when its holder exits.
|
|
8
|
+
// =============================================================================
|
|
2
9
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
10
|
import { createServer } from './server.js';
|
|
4
|
-
import {
|
|
11
|
+
import { DEFAULT_PORT, serveRestWhenFree } from './rest-server.js';
|
|
12
|
+
import { backgroundIndex, closeVectorStore } from './sessions/indexer.js';
|
|
13
|
+
import { warmKnowledgeIndex } from './knowledge/search.js';
|
|
14
|
+
import { warmSessionIndex } from './sessions/search.js';
|
|
15
|
+
import { getConfig } from './types.js';
|
|
16
|
+
import { ensureRepo } from './knowledge/git.js';
|
|
5
17
|
async function main() {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
// The knowledge folder exists (cloned from the remote the first time) before anything reads it.
|
|
19
|
+
const config = getConfig();
|
|
20
|
+
const repo = await ensureRepo(config.memoryDir, config.gitUrl);
|
|
21
|
+
console.error(`[knowledge] Repo init: ${repo.message}`);
|
|
22
|
+
const port = parseInt(process.env.AGENT_KNOWLEDGE_PORT || String(DEFAULT_PORT), 10);
|
|
23
|
+
const rest = serveRestWhenFree(port, 5_000, () => {
|
|
24
|
+
// The searches the plugin's lifecycle and the pane send land on warm indexes.
|
|
25
|
+
warmKnowledgeIndex(getConfig().memoryDir)
|
|
26
|
+
.then(() => warmSessionIndex())
|
|
27
|
+
.catch((err) => console.error('[knowledge] warming the search indexes failed:', err));
|
|
28
|
+
setTimeout(() => backgroundIndex().catch((bgErr) => console.error('[knowledge] Background index failed:', bgErr)), 5000).unref();
|
|
29
|
+
});
|
|
30
|
+
process.on('exit', () => {
|
|
31
|
+
rest.close();
|
|
32
|
+
closeVectorStore();
|
|
33
|
+
});
|
|
34
|
+
const server = createServer();
|
|
35
|
+
await server.connect(new StdioServerTransport());
|
|
18
36
|
}
|
|
19
37
|
main().catch(console.error);
|
|
20
38
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,wEAAwE;AACxE,6EAA6E;AAC7E,6DAA6D;AAC7D,gFAAgF;AAEhF,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,KAAK,UAAU,IAAI;IACjB,gGAAgG;IAChG,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/D,OAAO,CAAC,KAAK,CAAC,0BAA0B,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;I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AO,GAAE,iBAAsB,GAAG,SAAS,EAAE,CAYvE;AAMD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAYxE,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CA6FzD"}
|
|
@@ -9,6 +9,11 @@ import { getKnowledgeGraph } from './graph.js';
|
|
|
9
9
|
import { getEntryScoring } from './scoring.js';
|
|
10
10
|
import { getSearchGaps } from './query-log.js';
|
|
11
11
|
// ── God Nodes ────────────────────────────────────────────────────────────────
|
|
12
|
+
/** The edges whose both ends exist: an entry, or a code node of an ingest. */
|
|
13
|
+
function liveEdges(edges, entries) {
|
|
14
|
+
const isLive = (p) => p.startsWith('code:') || entries.has(p);
|
|
15
|
+
return edges.filter((e) => isLive(e.source) && isLive(e.target));
|
|
16
|
+
}
|
|
12
17
|
/**
|
|
13
18
|
* Find the most-connected entries in the knowledge graph (degree centrality).
|
|
14
19
|
* Excludes auto-distilled entries that only have auto-link edges (noise).
|
|
@@ -18,10 +23,17 @@ export function godNodes(dir, topN = 10) {
|
|
|
18
23
|
const allEdges = graph.links();
|
|
19
24
|
if (allEdges.length === 0)
|
|
20
25
|
return [];
|
|
21
|
-
//
|
|
26
|
+
// Load entry metadata
|
|
27
|
+
// A session's record (a snapshot, a 2.x dump) is no knowledge to link: left out.
|
|
28
|
+
const entries = listEntries(dir).filter((e) => !e.snapshot);
|
|
29
|
+
const entryMap = new Map();
|
|
30
|
+
for (const e of entries) {
|
|
31
|
+
entryMap.set(e.path, e);
|
|
32
|
+
}
|
|
33
|
+
// Count degree per entry; an edge to an entry no longer there counts for neither end
|
|
22
34
|
const degree = new Map();
|
|
23
35
|
const hasManualEdge = new Set();
|
|
24
|
-
for (const edge of allEdges) {
|
|
36
|
+
for (const edge of liveEdges(allEdges, entryMap)) {
|
|
25
37
|
degree.set(edge.source, (degree.get(edge.source) ?? 0) + 1);
|
|
26
38
|
degree.set(edge.target, (degree.get(edge.target) ?? 0) + 1);
|
|
27
39
|
if (edge.origin !== 'auto-link') {
|
|
@@ -29,12 +41,6 @@ export function godNodes(dir, topN = 10) {
|
|
|
29
41
|
hasManualEdge.add(edge.target);
|
|
30
42
|
}
|
|
31
43
|
}
|
|
32
|
-
// Load entry metadata
|
|
33
|
-
const entries = listEntries(dir);
|
|
34
|
-
const entryMap = new Map();
|
|
35
|
-
for (const e of entries) {
|
|
36
|
-
entryMap.set(e.path, e);
|
|
37
|
-
}
|
|
38
44
|
// Sort by degree, filter out pure auto-link nodes and code graph nodes
|
|
39
45
|
const sorted = Array.from(degree.entries())
|
|
40
46
|
.filter(([path]) => entryMap.has(path) && !path.startsWith('code:'))
|
|
@@ -174,13 +180,14 @@ export function gaps(dir, maxEntries = 30) {
|
|
|
174
180
|
const graph = getKnowledgeGraph();
|
|
175
181
|
const allEdges = graph.links();
|
|
176
182
|
const scoring = getEntryScoring();
|
|
177
|
-
//
|
|
183
|
+
// A session's record (a snapshot, a 2.x dump) is no knowledge to link: left out.
|
|
184
|
+
const entries = listEntries(dir).filter((e) => !e.snapshot);
|
|
185
|
+
// Count degree per entry; an edge to an entry no longer there counts for neither end
|
|
178
186
|
const degree = new Map();
|
|
179
|
-
for (const edge of allEdges) {
|
|
187
|
+
for (const edge of liveEdges(allEdges, new Set(entries.map((e) => e.path)))) {
|
|
180
188
|
degree.set(edge.source, (degree.get(edge.source) ?? 0) + 1);
|
|
181
189
|
degree.set(edge.target, (degree.get(edge.target) ?? 0) + 1);
|
|
182
190
|
}
|
|
183
|
-
const entries = listEntries(dir);
|
|
184
191
|
const result = [];
|
|
185
192
|
for (const entry of entries) {
|
|
186
193
|
if (entry.path.startsWith('code:'))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../src/knowledge/analyze.ts"],"names":[],"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