agent-knowledge 1.3.9 → 1.3.11

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.
@@ -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
@@ -522,17 +522,44 @@
522
522
  options = options || {};
523
523
  K._baseUrl = options.baseUrl || '';
524
524
  K._wsUrl = options.wsUrl || null;
525
- if (options.cssUrl && !document.getElementById('ak-plugin-css')) {
525
+
526
+ var shadow = container.attachShadow({ mode: 'open' });
527
+
528
+ if (options.cssUrl) {
526
529
  var link = document.createElement('link');
527
- link.id = 'ak-plugin-css';
528
530
  link.rel = 'stylesheet';
529
531
  link.href = options.cssUrl;
530
- document.head.appendChild(link);
532
+ shadow.appendChild(link);
531
533
  }
534
+
535
+ var fonts = document.createElement('link');
536
+ fonts.rel = 'stylesheet';
537
+ fonts.href =
538
+ 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap';
539
+ shadow.appendChild(fonts);
540
+ var icons = document.createElement('link');
541
+ icons.rel = 'stylesheet';
542
+ icons.href =
543
+ 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap';
544
+ shadow.appendChild(icons);
545
+
546
+ var pluginStyle = document.createElement('style');
547
+ pluginStyle.textContent =
548
+ ':host { display:block; width:100%; height:100%; overflow:hidden; }' +
549
+ '.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; }' +
550
+ '.ak-wrapper #app { height:100%; }';
551
+ shadow.appendChild(pluginStyle);
552
+
532
553
  if (typeof K._template === 'function') {
533
- container.innerHTML = K._template();
554
+ var wrapper = document.createElement('div');
555
+ wrapper.className = 'theme-dark ak-wrapper';
556
+ wrapper.innerHTML = K._template();
557
+ shadow.appendChild(wrapper);
534
558
  }
559
+
560
+ K._root = shadow;
535
561
  init();
562
+ K.initPanelResize();
536
563
  };
537
564
 
538
565
  K.unmount = function () {
@@ -545,10 +572,13 @@
545
572
  wsRetry = null;
546
573
  }
547
574
  state.connected = false;
548
- var cssLink = document.getElementById('ak-plugin-css');
549
- if (cssLink) cssLink.remove();
575
+ K._root = document;
550
576
  };
551
577
 
578
+ var _params = new URLSearchParams(location.search);
579
+ if (_params.get('baseUrl')) K._baseUrl = _params.get('baseUrl');
580
+ if (_params.get('wsUrl')) K._wsUrl = _params.get('wsUrl');
581
+
552
582
  // Start (standalone mode)
553
583
  if (typeof K._template !== 'function') {
554
584
  if (document.readyState === 'loading') {
@@ -305,7 +305,7 @@
305
305
  // ── Panel resize ──────────────────────────────────────────────────────────
306
306
 
307
307
  function initPanelResize() {
308
- const panel = document.getElementById('side-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 = document.getElementById('sessions-load-more');
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 = document.getElementById('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;
@@ -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) => document.getElementById(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.9",
3
+ "version": "1.3.11",
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",