agent-knowledge 1.3.8 → 1.3.10
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/agent-desk-plugin.json +19 -0
- package/dist/ui/app.js +43 -8
- package/dist/ui/index.html +1 -0
- package/dist/ui/template.js +173 -0
- package/dist/ui/ui-utils.js +3 -1
- package/package.json +2 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "agent-knowledge",
|
|
3
|
+
"name": "Knowledge",
|
|
4
|
+
"icon": "psychology",
|
|
5
|
+
"version": "1.3.9",
|
|
6
|
+
"description": "Knowledge base — entries, sessions, search, graph relationships",
|
|
7
|
+
"ui": "./dist/ui/app.js",
|
|
8
|
+
"css": "./dist/ui/styles.css",
|
|
9
|
+
"uiFiles": [
|
|
10
|
+
"ui-utils.js",
|
|
11
|
+
"render-knowledge.js",
|
|
12
|
+
"render-search.js",
|
|
13
|
+
"render-sessions.js",
|
|
14
|
+
"render-panel.js",
|
|
15
|
+
"template.js",
|
|
16
|
+
"app.js"
|
|
17
|
+
],
|
|
18
|
+
"position": 3
|
|
19
|
+
}
|
package/dist/ui/app.js
CHANGED
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
|
|
102
102
|
function wsConnect() {
|
|
103
103
|
const proto = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
104
|
-
ws = new WebSocket(`${proto}://${location.host}`);
|
|
104
|
+
ws = new WebSocket(`${proto}://${K._wsUrl || location.host}`);
|
|
105
105
|
|
|
106
106
|
ws.addEventListener('open', () => {
|
|
107
107
|
state.connected = true;
|
|
@@ -516,14 +516,49 @@
|
|
|
516
516
|
}, 5000);
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
-
//
|
|
520
|
-
|
|
521
|
-
|
|
519
|
+
// ── Plugin mount / unmount ─────────────────────────────────────────────────
|
|
520
|
+
|
|
521
|
+
K.mount = function (container, options) {
|
|
522
|
+
options = options || {};
|
|
523
|
+
K._baseUrl = options.baseUrl || '';
|
|
524
|
+
K._wsUrl = options.wsUrl || null;
|
|
525
|
+
if (options.cssUrl && !document.getElementById('ak-plugin-css')) {
|
|
526
|
+
var link = document.createElement('link');
|
|
527
|
+
link.id = 'ak-plugin-css';
|
|
528
|
+
link.rel = 'stylesheet';
|
|
529
|
+
link.href = options.cssUrl;
|
|
530
|
+
document.head.appendChild(link);
|
|
531
|
+
}
|
|
532
|
+
if (typeof K._template === 'function') {
|
|
533
|
+
container.innerHTML = K._template();
|
|
534
|
+
}
|
|
535
|
+
init();
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
K.unmount = function () {
|
|
539
|
+
if (ws) {
|
|
540
|
+
ws.close();
|
|
541
|
+
ws = null;
|
|
542
|
+
}
|
|
543
|
+
if (wsRetry) {
|
|
544
|
+
clearTimeout(wsRetry);
|
|
545
|
+
wsRetry = null;
|
|
546
|
+
}
|
|
547
|
+
state.connected = false;
|
|
548
|
+
var cssLink = document.getElementById('ak-plugin-css');
|
|
549
|
+
if (cssLink) cssLink.remove();
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
// Start (standalone mode)
|
|
553
|
+
if (typeof K._template !== 'function') {
|
|
554
|
+
if (document.readyState === 'loading') {
|
|
555
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
556
|
+
init();
|
|
557
|
+
K.initPanelResize();
|
|
558
|
+
});
|
|
559
|
+
} else {
|
|
522
560
|
init();
|
|
523
561
|
K.initPanelResize();
|
|
524
|
-
}
|
|
525
|
-
} else {
|
|
526
|
-
init();
|
|
527
|
-
K.initPanelResize();
|
|
562
|
+
}
|
|
528
563
|
}
|
|
529
564
|
})();
|
package/dist/ui/index.html
CHANGED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/* agent-knowledge — HTML template for plugin mount */
|
|
2
|
+
(function () {
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
var K = window.Knowledge;
|
|
6
|
+
|
|
7
|
+
K._template = function () {
|
|
8
|
+
return (
|
|
9
|
+
'<header role="banner">' +
|
|
10
|
+
'<div class="header-left">' +
|
|
11
|
+
'<span class="material-symbols-outlined brand-icon">psychology</span>' +
|
|
12
|
+
'<h1>agent-knowledge</h1>' +
|
|
13
|
+
'<span class="version" id="version">v1.0.0</span>' +
|
|
14
|
+
'<span id="connection-status" class="status-badge disconnected" role="status" aria-live="polite">Connecting</span>' +
|
|
15
|
+
'</div>' +
|
|
16
|
+
'<div class="header-right">' +
|
|
17
|
+
'<div class="stats" id="stats" aria-live="polite" aria-atomic="true">' +
|
|
18
|
+
'<span class="stat-badge" id="stat-knowledge" title="Knowledge entries">' +
|
|
19
|
+
'<span class="material-symbols-outlined stat-icon">folder</span>' +
|
|
20
|
+
'<span class="stat-value">0</span>' +
|
|
21
|
+
'</span>' +
|
|
22
|
+
'<span class="stat-badge" id="stat-sessions" title="Sessions">' +
|
|
23
|
+
'<span class="material-symbols-outlined stat-icon">history</span>' +
|
|
24
|
+
'<span class="stat-value">0</span>' +
|
|
25
|
+
'</span>' +
|
|
26
|
+
'<span class="stat-badge" id="stat-vectors" title="Vector embeddings">' +
|
|
27
|
+
'<span class="material-symbols-outlined stat-icon">neurology</span>' +
|
|
28
|
+
'<span class="stat-value">0</span>' +
|
|
29
|
+
'</span>' +
|
|
30
|
+
'</div>' +
|
|
31
|
+
'<button id="theme-toggle" class="icon-btn" title="Toggle theme" aria-label="Toggle theme">' +
|
|
32
|
+
'<span class="material-symbols-outlined theme-icon">dark_mode</span>' +
|
|
33
|
+
'</button>' +
|
|
34
|
+
'</div>' +
|
|
35
|
+
'</header>' +
|
|
36
|
+
'<nav class="tab-bar" role="tablist" aria-label="Main navigation">' +
|
|
37
|
+
'<button id="tab-knowledge" class="tab active" role="tab" aria-selected="true" aria-controls="view-knowledge" data-view="knowledge">' +
|
|
38
|
+
'<span class="material-symbols-outlined tab-icon">folder</span> Knowledge' +
|
|
39
|
+
'</button>' +
|
|
40
|
+
'<button id="tab-search" class="tab" role="tab" aria-selected="false" aria-controls="view-search" data-view="search">' +
|
|
41
|
+
'<span class="material-symbols-outlined tab-icon">search</span> Search' +
|
|
42
|
+
'</button>' +
|
|
43
|
+
'<button id="tab-sessions" class="tab" role="tab" aria-selected="false" aria-controls="view-sessions" data-view="sessions">' +
|
|
44
|
+
'<span class="material-symbols-outlined tab-icon">history</span> Sessions' +
|
|
45
|
+
'</button>' +
|
|
46
|
+
'<button id="tab-embeddings" class="tab" role="tab" aria-selected="false" aria-controls="view-embeddings" data-view="embeddings">' +
|
|
47
|
+
'<span class="material-symbols-outlined tab-icon">neurology</span> Embeddings' +
|
|
48
|
+
'</button>' +
|
|
49
|
+
'</nav>' +
|
|
50
|
+
'<div class="content-wrapper" id="content-wrapper">' +
|
|
51
|
+
'<main id="content">' +
|
|
52
|
+
'<section id="view-knowledge" class="view active" role="tabpanel" aria-labelledby="tab-knowledge">' +
|
|
53
|
+
'<div class="view-header">' +
|
|
54
|
+
'<h2><span class="material-symbols-outlined view-icon">folder</span>Knowledge Base</h2>' +
|
|
55
|
+
'<div class="view-actions">' +
|
|
56
|
+
'<button id="btn-consolidate" class="header-action-btn" title="Scan for duplicate entries">' +
|
|
57
|
+
'<span class="material-symbols-outlined">content_copy</span>Duplicates' +
|
|
58
|
+
'</button>' +
|
|
59
|
+
'<button id="btn-reflect" class="header-action-btn" title="Find unconnected entries">' +
|
|
60
|
+
'<span class="material-symbols-outlined">psychology</span>Reflect' +
|
|
61
|
+
'</button>' +
|
|
62
|
+
'</div>' +
|
|
63
|
+
'</div>' +
|
|
64
|
+
'<div class="filter-chips" id="knowledge-categories" role="group" aria-label="Filter by category">' +
|
|
65
|
+
'<button class="chip active" data-category="all"><span class="material-symbols-outlined chip-icon">select_all</span>All</button>' +
|
|
66
|
+
'<button class="chip" data-category="projects"><span class="material-symbols-outlined chip-icon">code</span>Projects</button>' +
|
|
67
|
+
'<button class="chip" data-category="people"><span class="material-symbols-outlined chip-icon">group</span>People</button>' +
|
|
68
|
+
'<button class="chip" data-category="decisions"><span class="material-symbols-outlined chip-icon">gavel</span>Decisions</button>' +
|
|
69
|
+
'<button class="chip" data-category="workflows"><span class="material-symbols-outlined chip-icon">account_tree</span>Workflows</button>' +
|
|
70
|
+
'<button class="chip" data-category="notes"><span class="material-symbols-outlined chip-icon">sticky_note_2</span>Notes</button>' +
|
|
71
|
+
'</div>' +
|
|
72
|
+
'<div class="search-bar knowledge-search-bar">' +
|
|
73
|
+
'<span class="material-symbols-outlined search-input-icon">search</span>' +
|
|
74
|
+
'<input type="search" id="knowledge-search-input" class="search-input" placeholder="Search knowledge entries..." autocomplete="off" aria-label="Search knowledge entries" />' +
|
|
75
|
+
'</div>' +
|
|
76
|
+
'<div id="knowledge-search-results" class="results-list" style="display:none"></div>' +
|
|
77
|
+
'<div id="knowledge-grid" class="card-grid"></div>' +
|
|
78
|
+
'<div id="knowledge-empty" class="empty-state hidden">' +
|
|
79
|
+
'<span class="material-symbols-outlined empty-icon">folder_off</span>' +
|
|
80
|
+
'<div class="empty-text">No knowledge entries found</div>' +
|
|
81
|
+
'<div class="empty-hint">Entries will appear here when added via the knowledge MCP tools</div>' +
|
|
82
|
+
'</div>' +
|
|
83
|
+
'</section>' +
|
|
84
|
+
'<section id="view-search" class="view" role="tabpanel" aria-labelledby="tab-search" hidden>' +
|
|
85
|
+
'<div class="view-header">' +
|
|
86
|
+
'<h2><span class="material-symbols-outlined view-icon">search</span>Search Sessions</h2>' +
|
|
87
|
+
'</div>' +
|
|
88
|
+
'<div class="search-bar">' +
|
|
89
|
+
'<span class="material-symbols-outlined search-input-icon">search</span>' +
|
|
90
|
+
'<input type="search" id="search-input" class="search-input" placeholder="Search sessions..." autocomplete="off" aria-label="Search sessions" />' +
|
|
91
|
+
'</div>' +
|
|
92
|
+
'<div class="search-controls">' +
|
|
93
|
+
'<div class="filter-chips" id="search-role-filters" role="group" aria-label="Filter by role">' +
|
|
94
|
+
'<button class="chip active" data-role="all">All</button>' +
|
|
95
|
+
'<button class="chip" data-role="user"><span class="material-symbols-outlined chip-icon">person</span>User</button>' +
|
|
96
|
+
'<button class="chip" data-role="assistant"><span class="material-symbols-outlined chip-icon">smart_toy</span>Assistant</button>' +
|
|
97
|
+
'</div>' +
|
|
98
|
+
'<div class="mode-toggle" role="group" aria-label="Search mode">' +
|
|
99
|
+
'<button class="mode-btn active" id="mode-ranked" data-mode="ranked" title="TF-IDF ranked search">' +
|
|
100
|
+
'<span class="material-symbols-outlined">sort</span>Ranked' +
|
|
101
|
+
'</button>' +
|
|
102
|
+
'<button class="mode-btn" id="mode-semantic" data-mode="semantic" title="Hybrid semantic + TF-IDF search">' +
|
|
103
|
+
'<span class="material-symbols-outlined">neurology</span>Semantic' +
|
|
104
|
+
'</button>' +
|
|
105
|
+
'<button class="mode-btn" id="mode-regex" data-mode="regex" title="Regular expression search">' +
|
|
106
|
+
'<span class="material-symbols-outlined">code</span>Regex' +
|
|
107
|
+
'</button>' +
|
|
108
|
+
'</div>' +
|
|
109
|
+
'<div class="filter-chips" id="search-scopes" role="group" aria-label="Filter by scope">' +
|
|
110
|
+
'<button class="chip active" data-scope="all">All</button>' +
|
|
111
|
+
'<button class="chip" data-scope="errors"><span class="material-symbols-outlined chip-icon">error</span>Errors</button>' +
|
|
112
|
+
'<button class="chip" data-scope="plans"><span class="material-symbols-outlined chip-icon">checklist</span>Plans</button>' +
|
|
113
|
+
'<button class="chip" data-scope="configs"><span class="material-symbols-outlined chip-icon">settings</span>Configs</button>' +
|
|
114
|
+
'<button class="chip" data-scope="tools"><span class="material-symbols-outlined chip-icon">build</span>Tools</button>' +
|
|
115
|
+
'<button class="chip" data-scope="files"><span class="material-symbols-outlined chip-icon">description</span>Files</button>' +
|
|
116
|
+
'<button class="chip" data-scope="decisions"><span class="material-symbols-outlined chip-icon">gavel</span>Decisions</button>' +
|
|
117
|
+
'</div>' +
|
|
118
|
+
'</div>' +
|
|
119
|
+
'<div id="search-results" class="results-list"></div>' +
|
|
120
|
+
'<div id="search-empty" class="empty-state">' +
|
|
121
|
+
'<span class="material-symbols-outlined empty-icon">manage_search</span>' +
|
|
122
|
+
'<div class="empty-text">Search across session transcripts</div>' +
|
|
123
|
+
'<div class="empty-hint">Enter a query above to find matching messages</div>' +
|
|
124
|
+
'</div>' +
|
|
125
|
+
'</section>' +
|
|
126
|
+
'<section id="view-sessions" class="view" role="tabpanel" aria-labelledby="tab-sessions" hidden>' +
|
|
127
|
+
'<div class="view-header">' +
|
|
128
|
+
'<h2><span class="material-symbols-outlined view-icon">history</span>Sessions</h2>' +
|
|
129
|
+
'<div class="view-actions">' +
|
|
130
|
+
'<select id="session-project-filter" class="filter-select" aria-label="Filter by project">' +
|
|
131
|
+
'<option value="">All projects</option>' +
|
|
132
|
+
'</select>' +
|
|
133
|
+
'</div>' +
|
|
134
|
+
'</div>' +
|
|
135
|
+
'<div id="sessions-list" class="sessions-list"></div>' +
|
|
136
|
+
'<div id="sessions-empty" class="empty-state hidden">' +
|
|
137
|
+
'<span class="material-symbols-outlined empty-icon">event_busy</span>' +
|
|
138
|
+
'<div class="empty-text">No sessions found</div>' +
|
|
139
|
+
'<div class="empty-hint">Sessions will appear here once indexed</div>' +
|
|
140
|
+
'</div>' +
|
|
141
|
+
'</section>' +
|
|
142
|
+
'<section id="view-embeddings" class="view" role="tabpanel" aria-labelledby="tab-embeddings" hidden>' +
|
|
143
|
+
'<div class="view-header">' +
|
|
144
|
+
'<h2><span class="material-symbols-outlined view-icon">neurology</span>Embeddings</h2>' +
|
|
145
|
+
'</div>' +
|
|
146
|
+
'<div id="embeddings-status" class="embeddings-dashboard">' +
|
|
147
|
+
'<div class="embedding-stats-grid" id="embedding-stats-grid"></div>' +
|
|
148
|
+
'</div>' +
|
|
149
|
+
'<div id="embeddings-empty" class="empty-state">' +
|
|
150
|
+
'<span class="material-symbols-outlined empty-icon">neurology</span>' +
|
|
151
|
+
'<div class="empty-text">Vector index not initialized</div>' +
|
|
152
|
+
'<div class="empty-hint">Embeddings are generated automatically on server startup</div>' +
|
|
153
|
+
'</div>' +
|
|
154
|
+
'</section>' +
|
|
155
|
+
'</main>' +
|
|
156
|
+
'<aside id="side-panel" class="side-panel" role="complementary" aria-label="Detail view" hidden>' +
|
|
157
|
+
'<div class="panel-header">' +
|
|
158
|
+
'<div class="panel-title" id="panel-title"></div>' +
|
|
159
|
+
'<button id="panel-close" class="icon-btn" title="Close panel" aria-label="Close panel">' +
|
|
160
|
+
'<span class="material-symbols-outlined">close</span>' +
|
|
161
|
+
'</button>' +
|
|
162
|
+
'</div>' +
|
|
163
|
+
'<div class="panel-body" id="panel-body"></div>' +
|
|
164
|
+
'</aside>' +
|
|
165
|
+
'</div>' +
|
|
166
|
+
'<div id="loading-overlay" class="loading-overlay" aria-label="Loading">' +
|
|
167
|
+
'<div class="loading-spinner"></div>' +
|
|
168
|
+
'<div class="loading-text">Connecting to agent-knowledge...</div>' +
|
|
169
|
+
'</div>' +
|
|
170
|
+
'<div id="toast-container" class="toast-container" aria-live="polite"></div>'
|
|
171
|
+
);
|
|
172
|
+
};
|
|
173
|
+
})();
|
package/dist/ui/ui-utils.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
window.Knowledge = window.Knowledge || {};
|
|
6
|
+
window.Knowledge._baseUrl = '';
|
|
7
|
+
window.Knowledge._wsUrl = null;
|
|
6
8
|
|
|
7
9
|
// ── DOM helper ──────────────────────────────────────────────────────────────
|
|
8
10
|
|
|
@@ -134,7 +136,7 @@
|
|
|
134
136
|
// ── API helper ──────────────────────────────────────────────────────────────
|
|
135
137
|
|
|
136
138
|
async function api(path) {
|
|
137
|
-
const res = await fetch(
|
|
139
|
+
const res = await fetch(`${window.Knowledge._baseUrl}/api${path}`);
|
|
138
140
|
if (!res.ok) throw new Error(`API ${res.status}: ${res.statusText}`);
|
|
139
141
|
return res.json();
|
|
140
142
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-knowledge",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.10",
|
|
4
4
|
"description": "Cross-session memory and recall for AI agents — git-synced knowledge base, knowledge graph, confidence scoring, hybrid semantic+TF-IDF search, auto-distillation with secrets scrubbing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"files": [
|
|
26
26
|
"dist/",
|
|
27
27
|
"scripts/",
|
|
28
|
+
"agent-desk-plugin.json",
|
|
28
29
|
"docs/*.md",
|
|
29
30
|
"README.md",
|
|
30
31
|
"CHANGELOG.md",
|