agent-knowledge 1.9.8 → 2.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.
Files changed (98) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +39 -41
  3. package/dist/events.d.ts +10 -0
  4. package/dist/events.d.ts.map +1 -0
  5. package/dist/events.js +23 -0
  6. package/dist/events.js.map +1 -0
  7. package/dist/index.js +19 -13
  8. package/dist/index.js.map +1 -1
  9. package/dist/knowledge/consolidate.d.ts +2 -2
  10. package/dist/knowledge/consolidate.js +2 -2
  11. package/dist/knowledge/freshness.js +1 -1
  12. package/dist/knowledge/freshness.js.map +1 -1
  13. package/dist/knowledge/git.d.ts.map +1 -1
  14. package/dist/knowledge/git.js +2 -3
  15. package/dist/knowledge/git.js.map +1 -1
  16. package/dist/knowledge/promote.js +1 -1
  17. package/dist/knowledge/promote.js.map +1 -1
  18. package/dist/knowledge/reflect.js +2 -2
  19. package/dist/knowledge/reflect.js.map +1 -1
  20. package/dist/knowledge/search.d.ts +6 -0
  21. package/dist/knowledge/search.d.ts.map +1 -1
  22. package/dist/knowledge/search.js +49 -3
  23. package/dist/knowledge/search.js.map +1 -1
  24. package/dist/knowledge/store.d.ts +3 -1
  25. package/dist/knowledge/store.d.ts.map +1 -1
  26. package/dist/knowledge/store.js +2 -5
  27. package/dist/knowledge/store.js.map +1 -1
  28. package/dist/lib.d.ts +1 -1
  29. package/dist/lib.d.ts.map +1 -1
  30. package/dist/lib.js.map +1 -1
  31. package/dist/package-meta.d.ts +4 -1
  32. package/dist/package-meta.d.ts.map +1 -1
  33. package/dist/package-meta.js +18 -9
  34. package/dist/package-meta.js.map +1 -1
  35. package/dist/rest-server.d.ts +21 -0
  36. package/dist/rest-server.d.ts.map +1 -0
  37. package/dist/rest-server.js +77 -0
  38. package/dist/rest-server.js.map +1 -0
  39. package/dist/server.d.ts +1 -5
  40. package/dist/server.d.ts.map +1 -1
  41. package/dist/server.js +1 -8
  42. package/dist/server.js.map +1 -1
  43. package/dist/sessions/indexer.d.ts +4 -0
  44. package/dist/sessions/indexer.d.ts.map +1 -1
  45. package/dist/sessions/indexer.js +6 -1
  46. package/dist/sessions/indexer.js.map +1 -1
  47. package/dist/sessions/parser.d.ts.map +1 -1
  48. package/dist/sessions/parser.js +32 -2
  49. package/dist/sessions/parser.js.map +1 -1
  50. package/dist/sessions/summary.d.ts.map +1 -1
  51. package/dist/sessions/summary.js +16 -1
  52. package/dist/sessions/summary.js.map +1 -1
  53. package/dist/transport/guard.d.ts +5 -0
  54. package/dist/transport/guard.d.ts.map +1 -0
  55. package/dist/transport/guard.js +51 -0
  56. package/dist/transport/guard.js.map +1 -0
  57. package/dist/transport/http.d.ts +17 -0
  58. package/dist/transport/http.d.ts.map +1 -0
  59. package/dist/transport/http.js +97 -0
  60. package/dist/transport/http.js.map +1 -0
  61. package/dist/transport/rest.d.ts +4 -0
  62. package/dist/transport/rest.d.ts.map +1 -0
  63. package/dist/transport/rest.js +307 -0
  64. package/dist/transport/rest.js.map +1 -0
  65. package/docs/ARCHITECTURE.md +23 -34
  66. package/docs/HOOKS.md +16 -16
  67. package/docs/INGEST.md +1 -1
  68. package/docs/SETUP.md +31 -26
  69. package/docs/USER-MANUAL.md +150 -89
  70. package/package.json +17 -14
  71. package/{skills → plugin/skills}/knowledge-ingest/SKILL.md +1 -1
  72. package/scripts/hooks/session-start.js +6 -7
  73. package/scripts/hooks/sessionend-distill.mjs +5 -5
  74. package/scripts/plugins/opencode/agent-knowledge.ts +6 -6
  75. package/scripts/setup.js +8 -7
  76. package/.claude-plugin/marketplace.json +0 -19
  77. package/.claude-plugin/plugin.json +0 -12
  78. package/.mcp.json +0 -8
  79. package/agent-desk-plugin.json +0 -20
  80. package/dist/dashboard.d.ts +0 -5
  81. package/dist/dashboard.d.ts.map +0 -1
  82. package/dist/dashboard.js +0 -666
  83. package/dist/dashboard.js.map +0 -1
  84. package/dist/ui/app.js +0 -1013
  85. package/dist/ui/index.html +0 -460
  86. package/dist/ui/morphdom.min.js +0 -1
  87. package/dist/ui/render-graph.js +0 -482
  88. package/dist/ui/render-knowledge.js +0 -288
  89. package/dist/ui/render-panel.js +0 -475
  90. package/dist/ui/render-search.js +0 -105
  91. package/dist/ui/render-sessions.js +0 -237
  92. package/dist/ui/styles.css +0 -2322
  93. package/dist/ui/template.js +0 -173
  94. package/dist/ui/ui-utils.js +0 -217
  95. package/dist/ui/vis-network.min.js +0 -34
  96. package/docs/DASHBOARD.md +0 -191
  97. package/scripts/copy-ui.js +0 -14
  98. /package/{skills → plugin/skills}/knowledge-ingest/scripts/validate.mjs +0 -0
package/docs/DASHBOARD.md DELETED
@@ -1,191 +0,0 @@
1
- # Dashboard
2
-
3
- The dashboard runs at **http://localhost:3423** and auto-starts with the MCP server.
4
-
5
- ## Tabs
6
-
7
- | Tab | Purpose |
8
- | ------------- | --------------------------------------------------------------- |
9
- | **Knowledge** | Browse knowledge base entries by category |
10
- | **Search** | TF-IDF ranked search across session transcripts |
11
- | **Sessions** | Browse and read session conversation logs |
12
- | **Recall** | Scoped search (errors, plans, configs, tools, files, decisions) |
13
-
14
- ## Knowledge Tab
15
-
16
- Card grid of knowledge entries. Each card shows:
17
-
18
- - Category badge with color: projects (blue), people (purple), decisions (orange), workflows (green), notes (yellow)
19
- - **Maturity badge**: candidate (gray), established (blue), proven (green) — based on access frequency
20
- - **Pin badge** (Material Symbols `push_pin`) when the entry has `evergreen: true` frontmatter — these entries are exempt from decay in ranking and append-only under promotion.
21
- - **Author chip** (muted, footer row) when the entry has `author: <string>` frontmatter — surfaces who wrote or owns it.
22
- - Title and tag pills
23
- - Last updated date
24
-
25
- ![Knowledge entries with maturity badges](assets/knowledge-maturity.png)
26
-
27
- Category filter chips at the top: All, Projects, People, Decisions, Workflows, Notes. Search bar for filtering entries by title.
28
-
29
- **Unused filter chip** (top-right of the header): shows `Unused (N)` where `N` is the count of entries past their per-category staleness threshold. Click to filter the grid to just those entries; click again to clear. Auto-hides when the count is zero.
30
-
31
- **By Type access chart** (between the tabs and the grid): a horizontal bar per canonical category, row-normalized so each bar fills its own track. Green share = accessed within the per-category recent window, orange = unused. Volume comparison via the right-side `accessed/unused` counts. Per-category thresholds: `projects` 180/365d, `people` 365/730d, `decisions` 90/180d, `workflows` 60/120d, `notes` 30/90d.
32
-
33
- **Header action buttons:**
34
-
35
- - **Duplicates** — scans all entries for near-duplicates using TF-IDF similarity. Entries in duplicate clusters get a warning icon on their card. Opens a side panel showing clusters with pairwise similarity scores. Click any entry in a cluster to view it.
36
- - **Reflect** — finds entries with no graph connections. Opens a side panel listing unconnected entries with content summaries and instructions for creating new links.
37
- - **God Nodes** — opens a side panel showing the most-connected entries (top degree centrality) with edge counts. These are your core concepts.
38
- - **Bridges** — shows entries that connect different categories, ranked by betweenness centrality. Each row includes a `why` explanation of which categories it bridges.
39
- - **Gaps** — lists isolated entries (0-1 edges) grouped by maturity, with `proven` entries listed first as the most concerning gaps.
40
- - **Brief** — displays the cached ~200 token knowledge base summary in a code block plus card sections for core concepts and recent decisions. Suitable for session-start orientation.
41
-
42
- Click a card to open the side panel with rendered markdown content, score details, and related entries.
43
-
44
- ## Search Tab
45
-
46
- Full-text search across all session transcripts.
47
-
48
- **Controls:**
49
-
50
- - Search input with debounce (300ms)
51
- - Role filter chips: All, User, Assistant
52
- - Mode toggle: Ranked (TF-IDF) vs Regex
53
-
54
- **Results show:**
55
-
56
- - Role badge (user/assistant)
57
- - Project name
58
- - Relative timestamp
59
- - Score bar with numeric value
60
- - Excerpt with highlighted matching terms
61
-
62
- Click a result to open the session in the side panel.
63
-
64
- ## Sessions Tab
65
-
66
- Lists sessions from all detected AI coding tools with metadata:
67
-
68
- - Source tool indicator (Claude Code, Cursor, OpenCode, Cline, Continue.dev, Aider)
69
- - Project name
70
- - Git branch (when available)
71
- - Message count
72
- - Date
73
- - Preview of first user message
74
-
75
- Project filter dropdown at the top. Sessions from all tools are merged into a single unified list.
76
-
77
- Click a session to open the side panel with the full conversation rendered as chat bubbles.
78
-
79
- ## Recall Tab
80
-
81
- Scoped search that pre-filters results by category:
82
-
83
- | Scope | What it finds |
84
- | ----------- | ----------------------------------------- |
85
- | `errors` | Stack traces, exceptions, failed commands |
86
- | `plans` | Architecture, TODOs, implementation steps |
87
- | `configs` | Settings, env vars, configuration files |
88
- | `tools` | MCP tool calls, CLI commands |
89
- | `files` | File paths, modifications |
90
- | `decisions` | Trade-offs, rationale, choices |
91
-
92
- Results use the same format as the Search tab.
93
-
94
- ## Side Panel
95
-
96
- - Width: 560px, resizable by dragging the left edge
97
- - Close: X button or press Escape
98
- - Knowledge entries: rendered as markdown via marked + DOMPurify + highlight.js
99
- - **Related entries**: linked entries shown with colored relationship-type pills (related_to, depends_on, supersedes, etc.) — clickable to navigate
100
- - **Score details**: maturity level, access count, decay factor, and maturity multiplier
101
- - Sessions: chat bubbles (user = right/accent, assistant = left/surface)
102
-
103
- ## Theming
104
-
105
- - Toggle: sun/moon button in header
106
- - Persisted in `localStorage('agent-knowledge-theme')`
107
- - MD3 design tokens matching agent-comm and agent-tasks dashboards
108
- - CSS custom properties on `:root`, switched via `data-theme` attribute
109
-
110
- ## Live Reload
111
-
112
- File watcher monitors `src/ui/` for `.html`, `.css`, `.js` changes. On change, broadcasts `{type: "reload"}` via WebSocket. Connected browsers auto-refresh.
113
-
114
- ## Keyboard Shortcuts
115
-
116
- | Shortcut | Action |
117
- | --------------- | ------------------ |
118
- | `/` or `Ctrl+K` | Focus search input |
119
- | `Escape` | Close side panel |
120
-
121
- ## REST API
122
-
123
- | Method | Endpoint | Description |
124
- | ------ | --------------------------------------- | ---------------------------- |
125
- | GET | `/api/knowledge` | List entries |
126
- | GET | `/api/knowledge/search?q=` | Search knowledge |
127
- | GET | `/api/knowledge/:path` | Read entry (with score data) |
128
- | GET | `/api/knowledge/:path/links` | Graph edges for entry |
129
- | GET | `/api/knowledge/consolidate?threshold=` | Duplicate cluster analysis |
130
- | GET | `/api/knowledge/reflect?max_entries=` | Unconnected entries + prompt |
131
- | GET | `/api/knowledge/god-nodes?top_n=` | Most-connected entries |
132
- | GET | `/api/knowledge/bridges?top_n=` | Cross-category connectors |
133
- | GET | `/api/knowledge/gaps?max_entries=` | Isolated entries by maturity |
134
- | GET | `/api/knowledge/brief` | Cached knowledge base brief |
135
- | GET | `/api/sessions` | List sessions |
136
- | GET | `/api/sessions/search?q=&role=&ranked=` | Search sessions |
137
- | GET | `/api/sessions/recall?scope=&q=` | Scoped recall |
138
- | GET | `/api/sessions/:id` | Read session |
139
- | GET | `/api/sessions/:id/summary` | Session summary |
140
- | POST | `/api/knowledge` | Write entry (JSON body) |
141
- | GET | `/health` | Health check |
142
-
143
- ### POST /api/knowledge
144
-
145
- Write a knowledge entry via REST. Runs the same pipeline as the MCP `knowledge(action: "write")` tool: git pull, file write, embedding index, auto-link (cosine > 0.7), git push, duplicate check.
146
-
147
- **Request:**
148
-
149
- ```json
150
- {
151
- "category": "decisions",
152
- "filename": "my-entry.md",
153
- "content": "---\ntitle: My Entry\ntags: [foo]\n---\n\nContent here."
154
- }
155
- ```
156
-
157
- **Response (201):**
158
-
159
- ```json
160
- {
161
- "path": "decisions/my-entry.md",
162
- "git": { "success": true, "message": "pushed" },
163
- "autoLinks": [{ "target": "decisions/related.md", "similarity": 0.82 }],
164
- "duplicateWarnings": []
165
- }
166
- ```
167
-
168
- Valid categories: `projects`, `people`, `decisions`, `workflows`, `notes`. POST is restricted to `/api/` paths; non-API POST returns 405.
169
-
170
- Used by agent-tasks `KnowledgeBridge` to push learning/decision artifacts on task completion.
171
-
172
- ## WebSocket
173
-
174
- Connects to `ws://localhost:3423` on page load.
175
-
176
- **State message** (on connect):
177
-
178
- ```json
179
- {
180
- "type": "state",
181
- "knowledge": [...],
182
- "sessions": [...],
183
- "stats": { "knowledge_entries": 12, "session_count": 247 }
184
- }
185
- ```
186
-
187
- **Reload message** (on file change):
188
-
189
- ```json
190
- { "type": "reload" }
191
- ```
@@ -1,14 +0,0 @@
1
- import { cpSync, copyFileSync } from 'fs';
2
- import { fileURLToPath } from 'url';
3
- import { dirname, join } from 'path';
4
-
5
- const root = join(dirname(fileURLToPath(import.meta.url)), '..');
6
- cpSync(join(root, 'src', 'ui'), join(root, 'dist', 'ui'), { recursive: true });
7
- copyFileSync(
8
- join(root, 'node_modules', 'morphdom', 'dist', 'morphdom-umd.min.js'),
9
- join(root, 'dist', 'ui', 'morphdom.min.js'),
10
- );
11
- copyFileSync(
12
- join(root, 'node_modules', 'vis-network', 'standalone', 'umd', 'vis-network.min.js'),
13
- join(root, 'dist', 'ui', 'vis-network.min.js'),
14
- );