agent-knowledge 1.3.10 → 1.3.12
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/dist/ui/app.js +88 -54
- package/dist/ui/render-panel.js +1 -1
- package/dist/ui/render-sessions.js +2 -2
- package/dist/ui/ui-utils.js +2 -1
- package/package.json +1 -1
package/dist/ui/app.js
CHANGED
|
@@ -26,54 +26,57 @@
|
|
|
26
26
|
|
|
27
27
|
// ── DOM refs ───────────────────────────────────────────────────────────────
|
|
28
28
|
const $ = K.$;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
29
|
+
function _buildEl() {
|
|
30
|
+
return {
|
|
31
|
+
tabs: {
|
|
32
|
+
knowledge: $('tab-knowledge'),
|
|
33
|
+
search: $('tab-search'),
|
|
34
|
+
sessions: $('tab-sessions'),
|
|
35
|
+
embeddings: $('tab-embeddings'),
|
|
36
|
+
},
|
|
37
|
+
views: {
|
|
38
|
+
knowledge: $('view-knowledge'),
|
|
39
|
+
search: $('view-search'),
|
|
40
|
+
sessions: $('view-sessions'),
|
|
41
|
+
embeddings: $('view-embeddings'),
|
|
42
|
+
},
|
|
43
|
+
knowledgeGrid: $('knowledge-grid'),
|
|
44
|
+
knowledgeEmpty: $('knowledge-empty'),
|
|
45
|
+
knowledgeCategories: $('knowledge-categories'),
|
|
46
|
+
knowledgeSearchInput: $('knowledge-search-input'),
|
|
47
|
+
knowledgeSearchResults: $('knowledge-search-results'),
|
|
48
|
+
btnConsolidate: $('btn-consolidate'),
|
|
49
|
+
btnReflect: $('btn-reflect'),
|
|
50
|
+
searchInput: $('search-input'),
|
|
51
|
+
searchResults: $('search-results'),
|
|
52
|
+
searchEmpty: $('search-empty'),
|
|
53
|
+
searchRoleFilters: $('search-role-filters'),
|
|
54
|
+
modeRanked: $('mode-ranked'),
|
|
55
|
+
modeSemantic: $('mode-semantic'),
|
|
56
|
+
modeRegex: $('mode-regex'),
|
|
57
|
+
sessionsList: $('sessions-list'),
|
|
58
|
+
sessionsEmpty: $('sessions-empty'),
|
|
59
|
+
sessionProjectFilter: $('session-project-filter'),
|
|
60
|
+
searchScopes: $('search-scopes'),
|
|
61
|
+
sidePanel: $('side-panel'),
|
|
62
|
+
panelTitle: $('panel-title'),
|
|
63
|
+
panelBody: $('panel-body'),
|
|
64
|
+
panelClose: $('panel-close'),
|
|
65
|
+
connectionStatus: $('connection-status'),
|
|
66
|
+
statKnowledge: $('stat-knowledge'),
|
|
67
|
+
statSessions: $('stat-sessions'),
|
|
68
|
+
statVectors: $('stat-vectors'),
|
|
69
|
+
embeddingsStatsGrid: $('embedding-stats-grid'),
|
|
70
|
+
embeddingsEmpty: $('embeddings-empty'),
|
|
71
|
+
embeddingsStatus: $('embeddings-status'),
|
|
72
|
+
themeToggle: $('theme-toggle'),
|
|
73
|
+
version: $('version'),
|
|
74
|
+
loadingOverlay: $('loading-overlay'),
|
|
75
|
+
toastContainer: $('toast-container'),
|
|
76
|
+
contentWrapper: $('content-wrapper'),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
let el = _buildEl();
|
|
77
80
|
|
|
78
81
|
// Expose state and el for module access
|
|
79
82
|
K._state = state;
|
|
@@ -485,6 +488,7 @@
|
|
|
485
488
|
// ── Init ───────────────────────────────────────────────────────────────────
|
|
486
489
|
|
|
487
490
|
async function init() {
|
|
491
|
+
el = _buildEl();
|
|
488
492
|
K.initTheme();
|
|
489
493
|
bindEvents();
|
|
490
494
|
K.initSessionScroll(state, el);
|
|
@@ -522,17 +526,44 @@
|
|
|
522
526
|
options = options || {};
|
|
523
527
|
K._baseUrl = options.baseUrl || '';
|
|
524
528
|
K._wsUrl = options.wsUrl || null;
|
|
525
|
-
|
|
529
|
+
|
|
530
|
+
var shadow = container.attachShadow({ mode: 'open' });
|
|
531
|
+
|
|
532
|
+
if (options.cssUrl) {
|
|
526
533
|
var link = document.createElement('link');
|
|
527
|
-
link.id = 'ak-plugin-css';
|
|
528
534
|
link.rel = 'stylesheet';
|
|
529
535
|
link.href = options.cssUrl;
|
|
530
|
-
|
|
536
|
+
shadow.appendChild(link);
|
|
531
537
|
}
|
|
538
|
+
|
|
539
|
+
var fonts = document.createElement('link');
|
|
540
|
+
fonts.rel = 'stylesheet';
|
|
541
|
+
fonts.href =
|
|
542
|
+
'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap';
|
|
543
|
+
shadow.appendChild(fonts);
|
|
544
|
+
var icons = document.createElement('link');
|
|
545
|
+
icons.rel = 'stylesheet';
|
|
546
|
+
icons.href =
|
|
547
|
+
'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap';
|
|
548
|
+
shadow.appendChild(icons);
|
|
549
|
+
|
|
550
|
+
var pluginStyle = document.createElement('style');
|
|
551
|
+
pluginStyle.textContent =
|
|
552
|
+
':host { display:block; width:100%; height:100%; overflow:hidden; }' +
|
|
553
|
+
'.ak-wrapper { font-family:var(--font-sans); font-size:14px; color:var(--text); background:var(--bg); line-height:1.5; width:100%; height:100%; overflow:hidden; display:flex; flex-direction:column; }';
|
|
554
|
+
shadow.appendChild(pluginStyle);
|
|
555
|
+
|
|
532
556
|
if (typeof K._template === 'function') {
|
|
533
|
-
|
|
557
|
+
var wrapper = document.createElement('div');
|
|
558
|
+
wrapper.className = 'ak-wrapper';
|
|
559
|
+
wrapper.setAttribute('data-theme', 'dark');
|
|
560
|
+
wrapper.innerHTML = K._template();
|
|
561
|
+
shadow.appendChild(wrapper);
|
|
534
562
|
}
|
|
563
|
+
|
|
564
|
+
K._root = shadow;
|
|
535
565
|
init();
|
|
566
|
+
K.initPanelResize();
|
|
536
567
|
};
|
|
537
568
|
|
|
538
569
|
K.unmount = function () {
|
|
@@ -545,10 +576,13 @@
|
|
|
545
576
|
wsRetry = null;
|
|
546
577
|
}
|
|
547
578
|
state.connected = false;
|
|
548
|
-
|
|
549
|
-
if (cssLink) cssLink.remove();
|
|
579
|
+
K._root = document;
|
|
550
580
|
};
|
|
551
581
|
|
|
582
|
+
var _params = new URLSearchParams(location.search);
|
|
583
|
+
if (_params.get('baseUrl')) K._baseUrl = _params.get('baseUrl');
|
|
584
|
+
if (_params.get('wsUrl')) K._wsUrl = _params.get('wsUrl');
|
|
585
|
+
|
|
552
586
|
// Start (standalone mode)
|
|
553
587
|
if (typeof K._template !== 'function') {
|
|
554
588
|
if (document.readyState === 'loading') {
|
package/dist/ui/render-panel.js
CHANGED
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
// ── Panel resize ──────────────────────────────────────────────────────────
|
|
306
306
|
|
|
307
307
|
function initPanelResize() {
|
|
308
|
-
const panel =
|
|
308
|
+
const panel = K._root.getElementById('side-panel');
|
|
309
309
|
if (!panel) return;
|
|
310
310
|
const handle = document.createElement('div');
|
|
311
311
|
handle.className = 'panel-resize-handle';
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
// ── Loading indicator ─────────────────────────────────────────────────────
|
|
51
51
|
|
|
52
52
|
function showLoadingIndicator(el, show) {
|
|
53
|
-
let indicator =
|
|
53
|
+
let indicator = K._root.getElementById('sessions-load-more');
|
|
54
54
|
if (show) {
|
|
55
55
|
if (!indicator) {
|
|
56
56
|
indicator = document.createElement('div');
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
// ── Scroll-based pagination ───────────────────────────────────────────────
|
|
70
70
|
|
|
71
71
|
function initSessionScroll(state, el) {
|
|
72
|
-
const content =
|
|
72
|
+
const content = K._root.getElementById('content');
|
|
73
73
|
if (!content) return;
|
|
74
74
|
content.addEventListener('scroll', () => {
|
|
75
75
|
if (state.sessions.loading || state.sessions.allLoaded) return;
|
package/dist/ui/ui-utils.js
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
window.Knowledge = window.Knowledge || {};
|
|
6
6
|
window.Knowledge._baseUrl = '';
|
|
7
7
|
window.Knowledge._wsUrl = null;
|
|
8
|
+
window.Knowledge._root = document;
|
|
8
9
|
|
|
9
10
|
// ── DOM helper ──────────────────────────────────────────────────────────────
|
|
10
11
|
|
|
11
|
-
const $ = (id) =>
|
|
12
|
+
const $ = (id) => window.Knowledge._root.getElementById(id);
|
|
12
13
|
|
|
13
14
|
// ── Escape HTML ─────────────────────────────────────────────────────────────
|
|
14
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-knowledge",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.12",
|
|
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",
|