@ephemushroom/opencode-claude-mem 0.7.1 → 0.7.2
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/cli.js +68 -3
- package/dist/tui.js +24 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -400,8 +400,30 @@ function bulletRow(icon, iconColor, value, theme, labelColor = theme.text) {
|
|
|
400
400
|
label(labelColor, decodeEntities(value))
|
|
401
401
|
]);
|
|
402
402
|
}
|
|
403
|
+
function leftClick(action) {
|
|
404
|
+
let pressed = false;
|
|
405
|
+
return {
|
|
406
|
+
onMouseDown(event) {
|
|
407
|
+
pressed = event.button === 0;
|
|
408
|
+
},
|
|
409
|
+
onMouseDrag() {
|
|
410
|
+
pressed = false;
|
|
411
|
+
},
|
|
412
|
+
onMouseOut() {
|
|
413
|
+
pressed = false;
|
|
414
|
+
},
|
|
415
|
+
onMouseUp(event) {
|
|
416
|
+
const clicked = pressed && event.button === 0;
|
|
417
|
+
pressed = false;
|
|
418
|
+
if (clicked) {
|
|
419
|
+
event.stopPropagation();
|
|
420
|
+
action();
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
}
|
|
403
425
|
function recentRow(icon, iconColor, title, age, theme, onSelect) {
|
|
404
|
-
return box({ flexDirection: "column", ...onSelect ?
|
|
426
|
+
return box({ flexDirection: "column", ...onSelect ? leftClick(onSelect) : {} }, [
|
|
405
427
|
bulletRow(icon, iconColor, title, theme),
|
|
406
428
|
...age ? [box({ paddingLeft: 2 }, [label(theme.textMuted, age)])] : []
|
|
407
429
|
]);
|
|
@@ -450,7 +472,7 @@ function expandedRows(view, theme, onSelect) {
|
|
|
450
472
|
}
|
|
451
473
|
function buildMemNodes(view, theme, collapsed, onToggle, onSelect) {
|
|
452
474
|
const summary = summaryLine(view);
|
|
453
|
-
const header = box({ flexDirection: "row", gap: 1,
|
|
475
|
+
const header = box({ flexDirection: "row", gap: 1, ...leftClick(onToggle) }, [
|
|
454
476
|
text({ fg: theme.text, flexShrink: 0 }, collapsed ? "\u25B6" : "\u25BC"),
|
|
455
477
|
text({ fg: theme.info, attributes: 1, flexShrink: 0 }, "Memory"),
|
|
456
478
|
collapsed ? text({ fg: toneColor(summary.tone, theme) }, summary.label) : label(theme.textMuted, view.project)
|
|
@@ -674,7 +696,9 @@ var cli_default = define({
|
|
|
674
696
|
});
|
|
675
697
|
return;
|
|
676
698
|
}
|
|
677
|
-
return
|
|
699
|
+
return new Promise((closed) => {
|
|
700
|
+
ctx.ui.dialog.show(() => renderDetail(ctx, solid, detail), closed);
|
|
701
|
+
});
|
|
678
702
|
}).catch(() => {}).finally(() => {
|
|
679
703
|
opening = false;
|
|
680
704
|
});
|
|
@@ -739,6 +763,47 @@ function themeFromResolved(resolved) {
|
|
|
739
763
|
borderSubtle: resolved.border.base
|
|
740
764
|
};
|
|
741
765
|
}
|
|
766
|
+
function renderDetail(ctx, solid, detail) {
|
|
767
|
+
ctx.ui.dialog.set({ size: "xlarge", centered: true });
|
|
768
|
+
const panel = solid.createElement("box");
|
|
769
|
+
solid.setProp(panel, "flexDirection", "column");
|
|
770
|
+
solid.setProp(panel, "padding", 1);
|
|
771
|
+
solid.setProp(panel, "gap", 1);
|
|
772
|
+
const header = solid.createElement("box");
|
|
773
|
+
solid.setProp(header, "flexDirection", "row");
|
|
774
|
+
solid.setProp(header, "gap", 2);
|
|
775
|
+
const title = solid.createElement("text");
|
|
776
|
+
solid.setProp(title, "fg", ctx.theme.text.base);
|
|
777
|
+
solid.setProp(title, "attributes", 1);
|
|
778
|
+
solid.setProp(title, "flexGrow", 1);
|
|
779
|
+
solid.setProp(title, "wrapMode", "none");
|
|
780
|
+
solid.setProp(title, "truncate", true);
|
|
781
|
+
solid.insert(title, detail.title);
|
|
782
|
+
solid.insert(header, title);
|
|
783
|
+
const close = solid.createElement("text");
|
|
784
|
+
solid.setProp(close, "fg", ctx.theme.text.muted);
|
|
785
|
+
solid.setProp(close, "flexShrink", 0);
|
|
786
|
+
solid.setProp(close, "onMouseUp", (event) => {
|
|
787
|
+
if (event.button === 0) {
|
|
788
|
+
ctx.ui.dialog.clear();
|
|
789
|
+
}
|
|
790
|
+
});
|
|
791
|
+
solid.insert(close, "esc close");
|
|
792
|
+
solid.insert(header, close);
|
|
793
|
+
solid.insert(panel, header);
|
|
794
|
+
const body = solid.createElement("scrollbox");
|
|
795
|
+
solid.setProp(body, "scrollX", false);
|
|
796
|
+
const sizeBody = (height) => solid.setProp(body, "maxHeight", Math.max(1, Math.floor(height * 0.75) - 4));
|
|
797
|
+
sizeBody(ctx.renderer.height);
|
|
798
|
+
solid.onResize((_width, height) => sizeBody(height));
|
|
799
|
+
const message = solid.createElement("text");
|
|
800
|
+
solid.setProp(message, "fg", ctx.theme.text.base);
|
|
801
|
+
solid.setProp(message, "wrapMode", "word");
|
|
802
|
+
solid.insert(message, detail.message);
|
|
803
|
+
solid.insert(body, message);
|
|
804
|
+
solid.insert(panel, body);
|
|
805
|
+
return panel;
|
|
806
|
+
}
|
|
742
807
|
function materializeNode(node, solid) {
|
|
743
808
|
const element = solid.createElement(node.kind);
|
|
744
809
|
for (const [name, value] of Object.entries(node.props)) {
|
package/dist/tui.js
CHANGED
|
@@ -400,8 +400,30 @@ function bulletRow(icon, iconColor, value, theme, labelColor = theme.text) {
|
|
|
400
400
|
label(labelColor, decodeEntities(value))
|
|
401
401
|
]);
|
|
402
402
|
}
|
|
403
|
+
function leftClick(action) {
|
|
404
|
+
let pressed = false;
|
|
405
|
+
return {
|
|
406
|
+
onMouseDown(event) {
|
|
407
|
+
pressed = event.button === 0;
|
|
408
|
+
},
|
|
409
|
+
onMouseDrag() {
|
|
410
|
+
pressed = false;
|
|
411
|
+
},
|
|
412
|
+
onMouseOut() {
|
|
413
|
+
pressed = false;
|
|
414
|
+
},
|
|
415
|
+
onMouseUp(event) {
|
|
416
|
+
const clicked = pressed && event.button === 0;
|
|
417
|
+
pressed = false;
|
|
418
|
+
if (clicked) {
|
|
419
|
+
event.stopPropagation();
|
|
420
|
+
action();
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
}
|
|
403
425
|
function recentRow(icon, iconColor, title, age, theme, onSelect) {
|
|
404
|
-
return box({ flexDirection: "column", ...onSelect ?
|
|
426
|
+
return box({ flexDirection: "column", ...onSelect ? leftClick(onSelect) : {} }, [
|
|
405
427
|
bulletRow(icon, iconColor, title, theme),
|
|
406
428
|
...age ? [box({ paddingLeft: 2 }, [label(theme.textMuted, age)])] : []
|
|
407
429
|
]);
|
|
@@ -450,7 +472,7 @@ function expandedRows(view, theme, onSelect) {
|
|
|
450
472
|
}
|
|
451
473
|
function buildMemNodes(view, theme, collapsed, onToggle, onSelect) {
|
|
452
474
|
const summary = summaryLine(view);
|
|
453
|
-
const header = box({ flexDirection: "row", gap: 1,
|
|
475
|
+
const header = box({ flexDirection: "row", gap: 1, ...leftClick(onToggle) }, [
|
|
454
476
|
text({ fg: theme.text, flexShrink: 0 }, collapsed ? "\u25B6" : "\u25BC"),
|
|
455
477
|
text({ fg: theme.info, attributes: 1, flexShrink: 0 }, "Memory"),
|
|
456
478
|
collapsed ? text({ fg: toneColor(summary.tone, theme) }, summary.label) : label(theme.textMuted, view.project)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ephemushroom/opencode-claude-mem",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Claude-Mem for OpenCode: capture through the official claude-mem plugin, memory tools and the Memory sidebar in one package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|