agent-knowledge 1.1.4 → 1.1.6
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/README.md +2 -2
- package/dist/ui/app.js +139 -0
- package/package.json +1 -1
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
|
**Cross-session memory and recall for AI coding assistants** -- works with Claude Code, Cursor, OpenCode, Cline, Continue.dev, and Aider out of the box. Git-synced knowledge base, hybrid semantic+TF-IDF search, auto-distillation with secrets scrubbing.
|
|
@@ -196,7 +196,7 @@ graph LR
|
|
|
196
196
|
## Testing
|
|
197
197
|
|
|
198
198
|
```bash
|
|
199
|
-
npm test # Run all
|
|
199
|
+
npm test # Run all 295 tests
|
|
200
200
|
npm run test:watch # Watch mode
|
|
201
201
|
npm run lint # Type-check (tsc --noEmit)
|
|
202
202
|
```
|
package/dist/ui/app.js
CHANGED
|
@@ -1006,6 +1006,145 @@
|
|
|
1006
1006
|
});
|
|
1007
1007
|
}
|
|
1008
1008
|
|
|
1009
|
+
// Theme sync from parent (agent-desk) via executeJavaScript
|
|
1010
|
+
window.addEventListener('message', (event) => {
|
|
1011
|
+
if (!event.data || event.data.type !== 'theme-sync') return;
|
|
1012
|
+
const colors = event.data.colors;
|
|
1013
|
+
if (!colors) return;
|
|
1014
|
+
|
|
1015
|
+
// Contrast enforcement: ensure text is readable against background
|
|
1016
|
+
function ensureContrast(bg, fg) {
|
|
1017
|
+
const lum = (hex) => {
|
|
1018
|
+
if (!hex || hex.charAt(0) !== '#' || hex.length < 7) return 0.5;
|
|
1019
|
+
const r = parseInt(hex.slice(1, 3), 16) / 255;
|
|
1020
|
+
const g = parseInt(hex.slice(3, 5), 16) / 255;
|
|
1021
|
+
const b = parseInt(hex.slice(5, 7), 16) / 255;
|
|
1022
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
1023
|
+
};
|
|
1024
|
+
const bgLum = lum(bg);
|
|
1025
|
+
return bgLum < 0.5 ? (lum(fg) < 0.4 ? '#e0e0e0' : fg) : lum(fg) > 0.6 ? '#333333' : fg;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
const root = document.documentElement;
|
|
1029
|
+
const bgColor = colors.bg || null;
|
|
1030
|
+
|
|
1031
|
+
// Core backgrounds
|
|
1032
|
+
if (colors.bg) root.style.setProperty('--bg', colors.bg);
|
|
1033
|
+
if (colors.bgSurface) root.style.setProperty('--bg-surface', colors.bgSurface);
|
|
1034
|
+
if (colors.bgElevated) root.style.setProperty('--bg-elevated', colors.bgElevated);
|
|
1035
|
+
if (colors.bgHover) root.style.setProperty('--bg-hover', colors.bgHover);
|
|
1036
|
+
if (colors.bgInset) root.style.setProperty('--bg-inset', colors.bgInset);
|
|
1037
|
+
|
|
1038
|
+
// Borders
|
|
1039
|
+
if (colors.border) root.style.setProperty('--border', colors.border);
|
|
1040
|
+
if (colors.borderLight) root.style.setProperty('--border-light', colors.borderLight);
|
|
1041
|
+
|
|
1042
|
+
// Text colors (with contrast enforcement)
|
|
1043
|
+
if (colors.text)
|
|
1044
|
+
root.style.setProperty(
|
|
1045
|
+
'--text',
|
|
1046
|
+
bgColor ? ensureContrast(bgColor, colors.text) : colors.text,
|
|
1047
|
+
);
|
|
1048
|
+
if (colors.textSecondary)
|
|
1049
|
+
root.style.setProperty(
|
|
1050
|
+
'--text-secondary',
|
|
1051
|
+
bgColor ? ensureContrast(bgColor, colors.textSecondary) : colors.textSecondary,
|
|
1052
|
+
);
|
|
1053
|
+
if (colors.textMuted)
|
|
1054
|
+
root.style.setProperty(
|
|
1055
|
+
'--text-muted',
|
|
1056
|
+
bgColor ? ensureContrast(bgColor, colors.textMuted) : colors.textMuted,
|
|
1057
|
+
);
|
|
1058
|
+
if (colors.textDim)
|
|
1059
|
+
root.style.setProperty(
|
|
1060
|
+
'--text-dim',
|
|
1061
|
+
bgColor ? ensureContrast(bgColor, colors.textDim) : colors.textDim,
|
|
1062
|
+
);
|
|
1063
|
+
|
|
1064
|
+
// Accent colors
|
|
1065
|
+
if (colors.accent) root.style.setProperty('--accent', colors.accent);
|
|
1066
|
+
if (colors.accentHover) root.style.setProperty('--accent-hover', colors.accentHover);
|
|
1067
|
+
if (colors.accentDim) root.style.setProperty('--accent-dim', colors.accentDim);
|
|
1068
|
+
if (colors.accentSolid) root.style.setProperty('--accent-solid', colors.accentSolid);
|
|
1069
|
+
if (colors.accentGlow) root.style.setProperty('--accent-glow', colors.accentGlow);
|
|
1070
|
+
|
|
1071
|
+
// Semantic colors
|
|
1072
|
+
if (colors.green) root.style.setProperty('--green', colors.green);
|
|
1073
|
+
if (colors.greenDim) root.style.setProperty('--green-dim', colors.greenDim);
|
|
1074
|
+
if (colors.yellow) root.style.setProperty('--yellow', colors.yellow);
|
|
1075
|
+
if (colors.yellowDim) root.style.setProperty('--yellow-dim', colors.yellowDim);
|
|
1076
|
+
if (colors.orange) root.style.setProperty('--orange', colors.orange);
|
|
1077
|
+
if (colors.orangeDim) root.style.setProperty('--orange-dim', colors.orangeDim);
|
|
1078
|
+
if (colors.red) root.style.setProperty('--red', colors.red);
|
|
1079
|
+
if (colors.redDim) root.style.setProperty('--red-dim', colors.redDim);
|
|
1080
|
+
if (colors.purple) root.style.setProperty('--purple', colors.purple);
|
|
1081
|
+
if (colors.purpleDim) root.style.setProperty('--purple-dim', colors.purpleDim);
|
|
1082
|
+
if (colors.blue) root.style.setProperty('--blue', colors.blue);
|
|
1083
|
+
if (colors.blueDim) root.style.setProperty('--blue-dim', colors.blueDim);
|
|
1084
|
+
|
|
1085
|
+
// Focus ring
|
|
1086
|
+
if (colors.focusRing) root.style.setProperty('--focus-ring', colors.focusRing);
|
|
1087
|
+
|
|
1088
|
+
// Shadows (adapt for dark/light)
|
|
1089
|
+
if (colors.isDark !== undefined) {
|
|
1090
|
+
if (colors.isDark) {
|
|
1091
|
+
root.style.setProperty(
|
|
1092
|
+
'--shadow-1',
|
|
1093
|
+
'0px 1px 2px 0px rgba(0,0,0,0.6), 0px 1px 3px 1px rgba(0,0,0,0.3)',
|
|
1094
|
+
);
|
|
1095
|
+
root.style.setProperty(
|
|
1096
|
+
'--shadow-2',
|
|
1097
|
+
'0px 1px 2px 0px rgba(0,0,0,0.6), 0px 2px 6px 2px rgba(0,0,0,0.3)',
|
|
1098
|
+
);
|
|
1099
|
+
root.style.setProperty(
|
|
1100
|
+
'--shadow-3',
|
|
1101
|
+
'0px 1px 3px 0px rgba(0,0,0,0.6), 0px 4px 8px 3px rgba(0,0,0,0.3)',
|
|
1102
|
+
);
|
|
1103
|
+
root.style.setProperty(
|
|
1104
|
+
'--shadow-hover',
|
|
1105
|
+
'0px 2px 4px 0px rgba(0,0,0,0.5), 0px 4px 12px 4px rgba(0,0,0,0.3)',
|
|
1106
|
+
);
|
|
1107
|
+
root.style.setProperty(
|
|
1108
|
+
'--shadow-panel',
|
|
1109
|
+
'-2px 0px 8px 0px rgba(0,0,0,0.6), -4px 0px 16px 2px rgba(0,0,0,0.3)',
|
|
1110
|
+
);
|
|
1111
|
+
} else {
|
|
1112
|
+
root.style.setProperty(
|
|
1113
|
+
'--shadow-1',
|
|
1114
|
+
'0px 1px 2px 0px rgba(0,0,0,0.3), 0px 1px 3px 1px rgba(0,0,0,0.15)',
|
|
1115
|
+
);
|
|
1116
|
+
root.style.setProperty(
|
|
1117
|
+
'--shadow-2',
|
|
1118
|
+
'0px 1px 2px 0px rgba(0,0,0,0.3), 0px 2px 6px 2px rgba(0,0,0,0.15)',
|
|
1119
|
+
);
|
|
1120
|
+
root.style.setProperty(
|
|
1121
|
+
'--shadow-3',
|
|
1122
|
+
'0px 1px 3px 0px rgba(0,0,0,0.3), 0px 4px 8px 3px rgba(0,0,0,0.15)',
|
|
1123
|
+
);
|
|
1124
|
+
root.style.setProperty(
|
|
1125
|
+
'--shadow-hover',
|
|
1126
|
+
'0px 2px 4px 0px rgba(0,0,0,0.25), 0px 4px 12px 4px rgba(0,0,0,0.15)',
|
|
1127
|
+
);
|
|
1128
|
+
root.style.setProperty(
|
|
1129
|
+
'--shadow-panel',
|
|
1130
|
+
'-2px 0px 8px 0px rgba(0,0,0,0.3), -4px 0px 16px 2px rgba(0,0,0,0.15)',
|
|
1131
|
+
);
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
// Apply theme attribute and hide the toggle (agent-desk controls the theme)
|
|
1136
|
+
if (colors.isDark !== undefined) {
|
|
1137
|
+
const theme = colors.isDark ? 'dark' : 'light';
|
|
1138
|
+
document.documentElement.setAttribute('data-theme', theme);
|
|
1139
|
+
localStorage.setItem('agent-knowledge-theme', theme);
|
|
1140
|
+
const icon = el.themeToggle.querySelector('.theme-icon');
|
|
1141
|
+
if (icon) icon.textContent = theme === 'dark' ? 'light_mode' : 'dark_mode';
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
// Hide the local theme toggle — agent-desk controls the theme
|
|
1145
|
+
if (el.themeToggle) el.themeToggle.style.display = 'none';
|
|
1146
|
+
});
|
|
1147
|
+
|
|
1009
1148
|
// Start
|
|
1010
1149
|
if (document.readyState === 'loading') {
|
|
1011
1150
|
document.addEventListener('DOMContentLoaded', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-knowledge",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Cross-session memory and recall for AI agents — git-synced knowledge base, hybrid semantic+TF-IDF search, auto-distillation with secrets scrubbing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|