claude-launchpad 1.16.0 → 1.17.0
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/{chunk-IPGNXDJF.js → chunk-IIOY56ZE.js} +2 -2
- package/dist/{chunk-DLDVXHI3.js → chunk-JKDFOKHD.js} +2 -2
- package/dist/{chunk-U2TFIUGE.js → chunk-KYGWNN5F.js} +38 -7
- package/dist/chunk-KYGWNN5F.js.map +1 -0
- package/dist/{chunk-IDH3M4EI.js → chunk-MRW63LDL.js} +6 -1
- package/dist/chunk-MRW63LDL.js.map +1 -0
- package/dist/{chunk-LCKV24Q3.js → chunk-ROQI7RKM.js} +4 -4
- package/dist/{chunk-MX3T2VEX.js → chunk-ULECXQFX.js} +3 -3
- package/dist/{chunk-7KB5YGQZ.js → chunk-YLIV5WBW.js} +2 -2
- package/dist/cli.js +69 -29
- package/dist/cli.js.map +1 -1
- package/dist/commands/memory/server.js +5 -5
- package/dist/{context-3GHG7KW6.js → context-K5B43NEI.js} +7 -7
- package/dist/{doctor-EKGJ2YAO.js → doctor-ESIQYNE4.js} +5 -5
- package/dist/{install-543ZKMXX.js → install-VREFJNLF.js} +9 -7
- package/dist/install-VREFJNLF.js.map +1 -0
- package/dist/{pull-ULSZEVCR.js → pull-H6ARY6DG.js} +9 -9
- package/dist/{push-JXCWX4NY.js → push-JDHT6AMD.js} +9 -9
- package/dist/{require-deps-AEDO5YRM.js → require-deps-GVBWF5PB.js} +3 -3
- package/dist/{stats-63L7C24W.js → stats-TWIVFA4I.js} +8 -8
- package/dist/{sync-QTJ6BXQ4.js → sync-WG7OOWOX.js} +5 -5
- package/dist/{sync-clean-OJEK4XH4.js → sync-clean-GQUFTYG2.js} +3 -3
- package/dist/{sync-status-EAX527SC.js → sync-status-B3DKLET4.js} +9 -9
- package/dist/{tui-BS4XXLOC.js → tui-ZINEA7TI.js} +166 -47
- package/dist/tui-ZINEA7TI.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-IDH3M4EI.js.map +0 -1
- package/dist/chunk-U2TFIUGE.js.map +0 -1
- package/dist/install-543ZKMXX.js.map +0 -1
- package/dist/tui-BS4XXLOC.js.map +0 -1
- /package/dist/{chunk-IPGNXDJF.js.map → chunk-IIOY56ZE.js.map} +0 -0
- /package/dist/{chunk-DLDVXHI3.js.map → chunk-JKDFOKHD.js.map} +0 -0
- /package/dist/{chunk-LCKV24Q3.js.map → chunk-ROQI7RKM.js.map} +0 -0
- /package/dist/{chunk-MX3T2VEX.js.map → chunk-ULECXQFX.js.map} +0 -0
- /package/dist/{chunk-7KB5YGQZ.js.map → chunk-YLIV5WBW.js.map} +0 -0
- /package/dist/{context-3GHG7KW6.js.map → context-K5B43NEI.js.map} +0 -0
- /package/dist/{doctor-EKGJ2YAO.js.map → doctor-ESIQYNE4.js.map} +0 -0
- /package/dist/{pull-ULSZEVCR.js.map → pull-H6ARY6DG.js.map} +0 -0
- /package/dist/{push-JXCWX4NY.js.map → push-JDHT6AMD.js.map} +0 -0
- /package/dist/{require-deps-AEDO5YRM.js.map → require-deps-GVBWF5PB.js.map} +0 -0
- /package/dist/{stats-63L7C24W.js.map → stats-TWIVFA4I.js.map} +0 -0
- /package/dist/{sync-QTJ6BXQ4.js.map → sync-WG7OOWOX.js.map} +0 -0
- /package/dist/{sync-clean-OJEK4XH4.js.map → sync-clean-GQUFTYG2.js.map} +0 -0
- /package/dist/{sync-status-EAX527SC.js.map → sync-status-B3DKLET4.js.map} +0 -0
|
@@ -5,19 +5,19 @@ import {
|
|
|
5
5
|
} from "./chunk-HSGSTSVN.js";
|
|
6
6
|
import {
|
|
7
7
|
migrate
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ULECXQFX.js";
|
|
9
9
|
import {
|
|
10
10
|
MemoryRepo
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MRW63LDL.js";
|
|
12
12
|
import {
|
|
13
13
|
DEFAULT_DECAY_PARAMS,
|
|
14
14
|
closeDatabase,
|
|
15
15
|
createDatabase,
|
|
16
16
|
loadConfig,
|
|
17
17
|
resolveDataDir
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-JKDFOKHD.js";
|
|
19
|
+
import "./chunk-YLIV5WBW.js";
|
|
20
|
+
import "./chunk-KYGWNN5F.js";
|
|
21
21
|
|
|
22
22
|
// src/commands/memory/dashboard/tui.tsx
|
|
23
23
|
import { render } from "ink";
|
|
@@ -31,6 +31,7 @@ var DashboardDataSource = class {
|
|
|
31
31
|
#searchRepo;
|
|
32
32
|
#dbPath;
|
|
33
33
|
#cachedMemories = [];
|
|
34
|
+
#relationsByMemory = /* @__PURE__ */ new Map();
|
|
34
35
|
constructor(memoryRepo, relationRepo, searchRepo, dataDir) {
|
|
35
36
|
this.#memoryRepo = memoryRepo;
|
|
36
37
|
this.#relationRepo = relationRepo;
|
|
@@ -40,6 +41,15 @@ var DashboardDataSource = class {
|
|
|
40
41
|
/** Re-query all memories from DB and cache them. Excludes soft-deleted (importance=0). */
|
|
41
42
|
refresh() {
|
|
42
43
|
this.#cachedMemories = this.#memoryRepo.getAll().filter((m) => m.importance > 0);
|
|
44
|
+
const byMemory = /* @__PURE__ */ new Map();
|
|
45
|
+
for (const r of this.#relationRepo.getAll()) {
|
|
46
|
+
for (const id of /* @__PURE__ */ new Set([r.sourceId, r.targetId])) {
|
|
47
|
+
const list = byMemory.get(id) ?? [];
|
|
48
|
+
list.push(r);
|
|
49
|
+
byMemory.set(id, list);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
this.#relationsByMemory = byMemory;
|
|
43
53
|
}
|
|
44
54
|
/** Return cached memories, optionally filtered by type, project, or FTS query. */
|
|
45
55
|
getMemories(filter) {
|
|
@@ -69,7 +79,7 @@ var DashboardDataSource = class {
|
|
|
69
79
|
return m?.title ?? void 0;
|
|
70
80
|
}
|
|
71
81
|
getRelationsForMemory(id) {
|
|
72
|
-
return this.#
|
|
82
|
+
return this.#relationsByMemory.get(id) ?? [];
|
|
73
83
|
}
|
|
74
84
|
/** Compute aggregate stats from cached data + DB queries. */
|
|
75
85
|
getStats() {
|
|
@@ -102,9 +112,23 @@ var DashboardDataSource = class {
|
|
|
102
112
|
onChange();
|
|
103
113
|
});
|
|
104
114
|
}
|
|
105
|
-
/**
|
|
115
|
+
/** Soft-delete a memory; returns a snapshot for undo (null if not found). */
|
|
106
116
|
deleteMemory(id) {
|
|
107
|
-
|
|
117
|
+
const snapshot = this.#memoryRepo.getById(id);
|
|
118
|
+
if (!snapshot) return null;
|
|
119
|
+
this.#memoryRepo.softDelete(id);
|
|
120
|
+
return snapshot;
|
|
121
|
+
}
|
|
122
|
+
/** Undo a soft delete using the snapshot taken at delete time. */
|
|
123
|
+
restoreMemory(snapshot) {
|
|
124
|
+
return this.#memoryRepo.restoreImportance(snapshot.id, snapshot.importance, snapshot.baseImportance);
|
|
125
|
+
}
|
|
126
|
+
/** Curation edits from the TUI: explicit re-rate re-anchors the decay base. */
|
|
127
|
+
updateMemory(id, updates) {
|
|
128
|
+
return this.#memoryRepo.updateContent(id, {
|
|
129
|
+
...updates.importance !== void 0 ? { importance: updates.importance } : {},
|
|
130
|
+
...updates.tags !== void 0 ? { tags: updates.tags } : {}
|
|
131
|
+
});
|
|
108
132
|
}
|
|
109
133
|
/** Count memories for a project (unfiltered). */
|
|
110
134
|
countByProject(project) {
|
|
@@ -137,7 +161,7 @@ var DashboardDataSource = class {
|
|
|
137
161
|
};
|
|
138
162
|
|
|
139
163
|
// src/commands/memory/dashboard/app.tsx
|
|
140
|
-
import { Box as
|
|
164
|
+
import { Box as Box14, Text as Text14, useApp } from "ink";
|
|
141
165
|
|
|
142
166
|
// src/commands/memory/dashboard/hooks/use-dashboard-state.ts
|
|
143
167
|
import { useState, useMemo, useEffect, useCallback } from "react";
|
|
@@ -239,6 +263,10 @@ function useDashboardState(dataSource) {
|
|
|
239
263
|
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
|
|
240
264
|
const [showPurgeConfirm, setShowPurgeConfirm] = useState(false);
|
|
241
265
|
const [showExpand, setShowExpand] = useState(false);
|
|
266
|
+
const [showTagEditor, setShowTagEditor] = useState(false);
|
|
267
|
+
const [tagDraft, setTagDraft] = useState("");
|
|
268
|
+
const [lastDeleted, setLastDeleted] = useState(null);
|
|
269
|
+
const [notice, setNotice] = useState(null);
|
|
242
270
|
useEffect(() => {
|
|
243
271
|
dataSource.refresh();
|
|
244
272
|
setRevision((r) => r + 1);
|
|
@@ -254,12 +282,9 @@ function useDashboardState(dataSource) {
|
|
|
254
282
|
}, [dataSource, revision]);
|
|
255
283
|
const filteredMemories = useMemo(() => {
|
|
256
284
|
void revision;
|
|
257
|
-
const raw = dataSource.getMemories({ type: typeFilter, project: currentProject });
|
|
285
|
+
const raw = dataSource.getMemories({ type: typeFilter, project: currentProject, query: searchQuery || void 0 });
|
|
258
286
|
const withLife = lifespanFilter ? raw.filter((m) => computeLifespan(m).status === lifespanFilter) : raw;
|
|
259
|
-
|
|
260
|
-
(m) => (m.title?.toLowerCase().includes(searchQuery.toLowerCase()) ?? false) || m.content.toLowerCase().includes(searchQuery.toLowerCase()) || m.tags.some((t) => t.toLowerCase().includes(searchQuery.toLowerCase()))
|
|
261
|
-
) : withLife;
|
|
262
|
-
return sortMemories(withSearch, sortMode);
|
|
287
|
+
return sortMemories(withLife, sortMode);
|
|
263
288
|
}, [dataSource, revision, typeFilter, lifespanFilter, searchQuery, currentProject, sortMode]);
|
|
264
289
|
const clampedIndex = Math.max(0, Math.min(selectedIndex, Math.max(0, filteredMemories.length - 1)));
|
|
265
290
|
const selectedMemory = filteredMemories[clampedIndex];
|
|
@@ -321,12 +346,48 @@ function useDashboardState(dataSource) {
|
|
|
321
346
|
}, [selectedMemory]);
|
|
322
347
|
const confirmDelete = useCallback(() => {
|
|
323
348
|
if (!selectedMemory) return;
|
|
324
|
-
dataSource.deleteMemory(selectedMemory.id);
|
|
349
|
+
const snapshot = dataSource.deleteMemory(selectedMemory.id);
|
|
350
|
+
if (snapshot) {
|
|
351
|
+
setLastDeleted(snapshot);
|
|
352
|
+
setNotice(`Deleted "${snapshot.title ?? snapshot.id.slice(0, 8)}" \u2014 press u to undo`);
|
|
353
|
+
}
|
|
325
354
|
setShowDeleteConfirm(false);
|
|
326
355
|
setSelectedIndex((i) => Math.max(0, i - 1));
|
|
327
356
|
dataSource.refresh();
|
|
328
357
|
setRevision((r) => r + 1);
|
|
329
358
|
}, [dataSource, selectedMemory]);
|
|
359
|
+
const undoDelete = useCallback(() => {
|
|
360
|
+
if (!lastDeleted) return;
|
|
361
|
+
const ok = dataSource.restoreMemory(lastDeleted);
|
|
362
|
+
setNotice(ok ? `Restored "${lastDeleted.title ?? lastDeleted.id.slice(0, 8)}"` : `Could not restore "${lastDeleted.title ?? lastDeleted.id.slice(0, 8)}" \u2014 it was purged or removed by sync`);
|
|
363
|
+
setLastDeleted(null);
|
|
364
|
+
dataSource.refresh();
|
|
365
|
+
setRevision((r) => r + 1);
|
|
366
|
+
}, [dataSource, lastDeleted]);
|
|
367
|
+
const adjustImportance = useCallback((delta) => {
|
|
368
|
+
if (!selectedMemory) return;
|
|
369
|
+
const next = Math.min(1, Math.max(0.05, Math.round((selectedMemory.importance + delta) * 100) / 100));
|
|
370
|
+
dataSource.updateMemory(selectedMemory.id, { importance: next });
|
|
371
|
+
setNotice(`Importance ${next.toFixed(2)} (re-anchored)`);
|
|
372
|
+
dataSource.refresh();
|
|
373
|
+
setRevision((r) => r + 1);
|
|
374
|
+
}, [dataSource, selectedMemory]);
|
|
375
|
+
const openTagEditor = useCallback(() => {
|
|
376
|
+
if (!selectedMemory) return;
|
|
377
|
+
setTagDraft(selectedMemory.tags.join(", "));
|
|
378
|
+
setShowTagEditor(true);
|
|
379
|
+
}, [selectedMemory]);
|
|
380
|
+
const submitTags = useCallback(() => {
|
|
381
|
+
if (selectedMemory) {
|
|
382
|
+
const tags = tagDraft.split(",").map((t) => t.trim()).filter(Boolean);
|
|
383
|
+
dataSource.updateMemory(selectedMemory.id, { tags });
|
|
384
|
+
setNotice(`Tags updated (${tags.length})`);
|
|
385
|
+
dataSource.refresh();
|
|
386
|
+
setRevision((r) => r + 1);
|
|
387
|
+
}
|
|
388
|
+
setShowTagEditor(false);
|
|
389
|
+
}, [dataSource, selectedMemory, tagDraft]);
|
|
390
|
+
const cancelTagEditor = useCallback(() => setShowTagEditor(false), []);
|
|
330
391
|
const cancelDelete = useCallback(() => setShowDeleteConfirm(false), []);
|
|
331
392
|
const promptPurge = useCallback(() => {
|
|
332
393
|
if (currentProject) setShowPurgeConfirm(true);
|
|
@@ -351,6 +412,11 @@ function useDashboardState(dataSource) {
|
|
|
351
412
|
searchQuery,
|
|
352
413
|
searchActive,
|
|
353
414
|
currentProject,
|
|
415
|
+
showTagEditor,
|
|
416
|
+
tagDraft,
|
|
417
|
+
setTagDraft,
|
|
418
|
+
notice,
|
|
419
|
+
lastDeleted,
|
|
354
420
|
sortMode,
|
|
355
421
|
showHelp,
|
|
356
422
|
showProjectPicker,
|
|
@@ -385,7 +451,12 @@ function useDashboardState(dataSource) {
|
|
|
385
451
|
confirmPurge,
|
|
386
452
|
cancelPurge,
|
|
387
453
|
expandMemory,
|
|
388
|
-
closeExpand
|
|
454
|
+
closeExpand,
|
|
455
|
+
undoDelete,
|
|
456
|
+
adjustImportance,
|
|
457
|
+
openTagEditor,
|
|
458
|
+
submitTags,
|
|
459
|
+
cancelTagEditor
|
|
389
460
|
};
|
|
390
461
|
}
|
|
391
462
|
function sortMemories(memories, mode) {
|
|
@@ -412,6 +483,10 @@ var TYPE_KEYS = {
|
|
|
412
483
|
function useKeybindings(actions, opts) {
|
|
413
484
|
useInput((input, key) => {
|
|
414
485
|
if (opts.modalOpen) return;
|
|
486
|
+
if (opts.tagEditorOpen) {
|
|
487
|
+
if (key.escape) actions.cancelTagEditor();
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
415
490
|
if (opts.expandOpen) return;
|
|
416
491
|
if (opts.searchActive) {
|
|
417
492
|
if (key.escape) actions.closeSearch();
|
|
@@ -434,6 +509,10 @@ function useKeybindings(actions, opts) {
|
|
|
434
509
|
if (input === "[" || key.leftArrow) actions.cycleProjectPrev();
|
|
435
510
|
if (input === "r" || input === "d") actions.removeMemory();
|
|
436
511
|
if (input === "X") actions.purgeProject();
|
|
512
|
+
if (input === "u") actions.undoDelete();
|
|
513
|
+
if (input === "+" || input === "=") actions.adjustImportanceUp();
|
|
514
|
+
if (input === "-") actions.adjustImportanceDown();
|
|
515
|
+
if (input === "t") actions.openTagEditor();
|
|
437
516
|
if (input === "?") actions.showHelp();
|
|
438
517
|
if (key.return) actions.expandMemory();
|
|
439
518
|
if (input === "q") actions.quit();
|
|
@@ -473,12 +552,15 @@ var HINTS = [
|
|
|
473
552
|
["l", "life"],
|
|
474
553
|
["s", "sort"],
|
|
475
554
|
["d", "delete"],
|
|
476
|
-
["
|
|
555
|
+
["u", "undo"],
|
|
556
|
+
["t", "tags"],
|
|
557
|
+
["+/-", "rate"],
|
|
558
|
+
["X", "purge"],
|
|
477
559
|
["?", "help"],
|
|
478
560
|
["q", "quit"]
|
|
479
561
|
];
|
|
480
562
|
function KeybindingBar() {
|
|
481
|
-
return /* @__PURE__ */ jsx(Box, { children: HINTS.map(([key, label], i) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
563
|
+
return /* @__PURE__ */ jsx(Box, { overflow: "hidden", children: HINTS.map(([key, label], i) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
482
564
|
i > 0 && /* @__PURE__ */ jsx(Text, { dimColor: true, children: " " }),
|
|
483
565
|
/* @__PURE__ */ jsx(Text, { color: "cyan", children: key }),
|
|
484
566
|
/* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
@@ -739,6 +821,10 @@ function DetailContent({ memory, relations, height, width, resolveTitle }) {
|
|
|
739
821
|
/* @__PURE__ */ jsx5(Text5, { bold: true, children: "Content" }),
|
|
740
822
|
/* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "\u2500".repeat(Math.min(contentWidth, 40)) }),
|
|
741
823
|
preview.lines.map((line, i) => /* @__PURE__ */ jsx5(Text5, { children: line === "" ? " " : line }, `line-${i}`)),
|
|
824
|
+
memory.context && /* @__PURE__ */ jsxs5(Text5, { dimColor: true, wrap: "truncate", children: [
|
|
825
|
+
"ctx: ",
|
|
826
|
+
memory.context.slice(0, 120)
|
|
827
|
+
] }),
|
|
742
828
|
preview.truncated && /* @__PURE__ */ jsxs5(Text5, { dimColor: true, children: [
|
|
743
829
|
"\u2026 +",
|
|
744
830
|
preview.remainingLines,
|
|
@@ -922,7 +1008,10 @@ var BINDINGS = [
|
|
|
922
1008
|
["s", "Cycle sort mode"],
|
|
923
1009
|
["p", "Open project picker"],
|
|
924
1010
|
["[ / ]", "Previous / next project"],
|
|
925
|
-
["d / r", "Delete selected memory"],
|
|
1011
|
+
["d / r", "Delete selected memory (soft \u2014 u restores)"],
|
|
1012
|
+
["u", "Undo last delete"],
|
|
1013
|
+
["t", "Edit tags of selected memory"],
|
|
1014
|
+
["+ / -", "Raise / lower importance (re-anchors decay)"],
|
|
926
1015
|
["X", "Purge all memories for current project"],
|
|
927
1016
|
["?", "Show this help"],
|
|
928
1017
|
["q", "Quit"]
|
|
@@ -1132,8 +1221,20 @@ function ExpandMemory({ memory, relations, onClose, resolveTitle }) {
|
|
|
1132
1221
|
] });
|
|
1133
1222
|
}
|
|
1134
1223
|
|
|
1135
|
-
// src/commands/memory/dashboard/
|
|
1224
|
+
// src/commands/memory/dashboard/components/tag-editor.tsx
|
|
1225
|
+
import { Box as Box13, Text as Text13 } from "ink";
|
|
1226
|
+
import TextInput2 from "ink-text-input";
|
|
1136
1227
|
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1228
|
+
function TagEditor({ value, onChange, onSubmit }) {
|
|
1229
|
+
return /* @__PURE__ */ jsxs13(Box13, { children: [
|
|
1230
|
+
/* @__PURE__ */ jsx13(Text13, { color: "cyan", children: "Tags (comma-separated): " }),
|
|
1231
|
+
/* @__PURE__ */ jsx13(TextInput2, { value, onChange, onSubmit }),
|
|
1232
|
+
/* @__PURE__ */ jsx13(Text13, { dimColor: true, children: " (Enter save \xB7 Esc cancel)" })
|
|
1233
|
+
] });
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
// src/commands/memory/dashboard/app.tsx
|
|
1237
|
+
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1137
1238
|
function App({ dataSource }) {
|
|
1138
1239
|
const { exit } = useApp();
|
|
1139
1240
|
const { columns, rows, layout } = useTerminalSize();
|
|
@@ -1153,18 +1254,24 @@ function App({ dataSource }) {
|
|
|
1153
1254
|
openProjectPicker: () => state.setShowProjectPicker((v) => !v),
|
|
1154
1255
|
showHelp: () => state.setShowHelp((v) => !v),
|
|
1155
1256
|
expandMemory: state.expandMemory,
|
|
1257
|
+
undoDelete: state.undoDelete,
|
|
1258
|
+
adjustImportanceUp: () => state.adjustImportance(0.1),
|
|
1259
|
+
adjustImportanceDown: () => state.adjustImportance(-0.1),
|
|
1260
|
+
openTagEditor: state.openTagEditor,
|
|
1261
|
+
cancelTagEditor: state.cancelTagEditor,
|
|
1156
1262
|
quit: exit
|
|
1157
1263
|
}, {
|
|
1158
1264
|
searchActive: state.searchActive,
|
|
1159
1265
|
pickerOpen: state.showProjectPicker,
|
|
1160
1266
|
expandOpen: state.showExpand,
|
|
1161
|
-
modalOpen: state.showDeleteConfirm || state.showPurgeConfirm || state.showHelp
|
|
1267
|
+
modalOpen: state.showDeleteConfirm || state.showPurgeConfirm || state.showHelp,
|
|
1268
|
+
tagEditorOpen: state.showTagEditor
|
|
1162
1269
|
});
|
|
1163
1270
|
if (state.showHelp) {
|
|
1164
|
-
return /* @__PURE__ */
|
|
1271
|
+
return /* @__PURE__ */ jsx14(HelpOverlay, { onClose: () => state.setShowHelp(false) });
|
|
1165
1272
|
}
|
|
1166
1273
|
if (state.showExpand && state.selectedMemory) {
|
|
1167
|
-
return /* @__PURE__ */
|
|
1274
|
+
return /* @__PURE__ */ jsx14(
|
|
1168
1275
|
ExpandMemory,
|
|
1169
1276
|
{
|
|
1170
1277
|
memory: state.selectedMemory,
|
|
@@ -1175,7 +1282,7 @@ function App({ dataSource }) {
|
|
|
1175
1282
|
);
|
|
1176
1283
|
}
|
|
1177
1284
|
if (state.showProjectPicker) {
|
|
1178
|
-
return /* @__PURE__ */
|
|
1285
|
+
return /* @__PURE__ */ jsx14(
|
|
1179
1286
|
ProjectPicker,
|
|
1180
1287
|
{
|
|
1181
1288
|
projects: [...state.projects],
|
|
@@ -1189,7 +1296,7 @@ function App({ dataSource }) {
|
|
|
1189
1296
|
);
|
|
1190
1297
|
}
|
|
1191
1298
|
if (state.showDeleteConfirm && state.selectedMemory) {
|
|
1192
|
-
return /* @__PURE__ */
|
|
1299
|
+
return /* @__PURE__ */ jsx14(
|
|
1193
1300
|
DeleteConfirm,
|
|
1194
1301
|
{
|
|
1195
1302
|
memory: state.selectedMemory,
|
|
@@ -1199,7 +1306,7 @@ function App({ dataSource }) {
|
|
|
1199
1306
|
);
|
|
1200
1307
|
}
|
|
1201
1308
|
if (state.showPurgeConfirm && state.currentProject) {
|
|
1202
|
-
return /* @__PURE__ */
|
|
1309
|
+
return /* @__PURE__ */ jsx14(
|
|
1203
1310
|
PurgeConfirm,
|
|
1204
1311
|
{
|
|
1205
1312
|
project: state.currentProject,
|
|
@@ -1217,9 +1324,9 @@ function App({ dataSource }) {
|
|
|
1217
1324
|
const projectListHeight = isNarrow ? 0 : Math.min(Math.max(4, Math.floor(contentHeight / 3)), projectsCount + 3, 12);
|
|
1218
1325
|
const listHeight = isNarrow ? Math.max(6, Math.floor(contentHeight * 0.6)) : contentHeight;
|
|
1219
1326
|
const detailHeight = isNarrow ? Math.max(6, contentHeight - listHeight) : Math.max(6, contentHeight - projectListHeight);
|
|
1220
|
-
return /* @__PURE__ */
|
|
1221
|
-
/* @__PURE__ */
|
|
1222
|
-
/* @__PURE__ */
|
|
1327
|
+
return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", children: [
|
|
1328
|
+
/* @__PURE__ */ jsx14(KeybindingBar, {}),
|
|
1329
|
+
/* @__PURE__ */ jsx14(
|
|
1223
1330
|
Header,
|
|
1224
1331
|
{
|
|
1225
1332
|
project: state.currentProject,
|
|
@@ -1230,7 +1337,19 @@ function App({ dataSource }) {
|
|
|
1230
1337
|
layout
|
|
1231
1338
|
}
|
|
1232
1339
|
),
|
|
1233
|
-
state.
|
|
1340
|
+
state.showTagEditor && /* @__PURE__ */ jsx14(
|
|
1341
|
+
TagEditor,
|
|
1342
|
+
{
|
|
1343
|
+
value: state.tagDraft,
|
|
1344
|
+
onChange: state.setTagDraft,
|
|
1345
|
+
onSubmit: state.submitTags
|
|
1346
|
+
}
|
|
1347
|
+
),
|
|
1348
|
+
state.notice && !state.searchActive && !state.showTagEditor && /* @__PURE__ */ jsxs14(Text14, { dimColor: true, children: [
|
|
1349
|
+
" ",
|
|
1350
|
+
state.notice
|
|
1351
|
+
] }),
|
|
1352
|
+
state.searchActive && /* @__PURE__ */ jsx14(
|
|
1234
1353
|
SearchBar,
|
|
1235
1354
|
{
|
|
1236
1355
|
query: state.searchQuery,
|
|
@@ -1238,8 +1357,8 @@ function App({ dataSource }) {
|
|
|
1238
1357
|
onSubmit: state.submitSearch
|
|
1239
1358
|
}
|
|
1240
1359
|
),
|
|
1241
|
-
/* @__PURE__ */
|
|
1242
|
-
/* @__PURE__ */
|
|
1360
|
+
/* @__PURE__ */ jsxs14(Box14, { flexDirection: isNarrow ? "column" : "row", height: isNarrow ? void 0 : contentHeight, children: [
|
|
1361
|
+
/* @__PURE__ */ jsx14(Box14, { width: isNarrow ? "100%" : "60%", children: /* @__PURE__ */ jsx14(
|
|
1243
1362
|
MemoryList,
|
|
1244
1363
|
{
|
|
1245
1364
|
memories: state.filteredMemories,
|
|
@@ -1248,8 +1367,8 @@ function App({ dataSource }) {
|
|
|
1248
1367
|
height: listHeight
|
|
1249
1368
|
}
|
|
1250
1369
|
) }),
|
|
1251
|
-
/* @__PURE__ */
|
|
1252
|
-
!isNarrow && /* @__PURE__ */
|
|
1370
|
+
/* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", width: isNarrow ? "100%" : "40%", children: [
|
|
1371
|
+
!isNarrow && /* @__PURE__ */ jsx14(
|
|
1253
1372
|
ProjectList,
|
|
1254
1373
|
{
|
|
1255
1374
|
memories: state.filteredMemories,
|
|
@@ -1258,7 +1377,7 @@ function App({ dataSource }) {
|
|
|
1258
1377
|
height: projectListHeight
|
|
1259
1378
|
}
|
|
1260
1379
|
),
|
|
1261
|
-
/* @__PURE__ */
|
|
1380
|
+
/* @__PURE__ */ jsx14(
|
|
1262
1381
|
MemoryDetail,
|
|
1263
1382
|
{
|
|
1264
1383
|
memory: state.selectedMemory,
|
|
@@ -1271,14 +1390,14 @@ function App({ dataSource }) {
|
|
|
1271
1390
|
)
|
|
1272
1391
|
] })
|
|
1273
1392
|
] }),
|
|
1274
|
-
/* @__PURE__ */
|
|
1393
|
+
/* @__PURE__ */ jsx14(StatsBar, { stats: state.stats, visible: state.filteredMemories })
|
|
1275
1394
|
] });
|
|
1276
1395
|
}
|
|
1277
1396
|
|
|
1278
1397
|
// src/commands/memory/dashboard/components/error-boundary.tsx
|
|
1279
1398
|
import React6 from "react";
|
|
1280
|
-
import { Box as
|
|
1281
|
-
import { jsx as
|
|
1399
|
+
import { Box as Box15, Text as Text15, useApp as useApp2, useInput as useInput7 } from "ink";
|
|
1400
|
+
import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1282
1401
|
function CrashScreen({
|
|
1283
1402
|
message
|
|
1284
1403
|
}) {
|
|
@@ -1286,17 +1405,17 @@ function CrashScreen({
|
|
|
1286
1405
|
useInput7((input) => {
|
|
1287
1406
|
if (input === "q") exit();
|
|
1288
1407
|
});
|
|
1289
|
-
return /* @__PURE__ */
|
|
1290
|
-
|
|
1408
|
+
return /* @__PURE__ */ jsxs15(
|
|
1409
|
+
Box15,
|
|
1291
1410
|
{
|
|
1292
1411
|
flexDirection: "column",
|
|
1293
1412
|
borderStyle: "round",
|
|
1294
1413
|
borderColor: "red",
|
|
1295
1414
|
padding: 1,
|
|
1296
1415
|
children: [
|
|
1297
|
-
/* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1416
|
+
/* @__PURE__ */ jsx15(Text15, { bold: true, color: "red", children: "Dashboard crashed" }),
|
|
1417
|
+
/* @__PURE__ */ jsx15(Text15, { children: message }),
|
|
1418
|
+
/* @__PURE__ */ jsx15(Text15, { dimColor: true, children: "Your data is untouched. Press q to quit." })
|
|
1300
1419
|
]
|
|
1301
1420
|
}
|
|
1302
1421
|
);
|
|
@@ -1308,14 +1427,14 @@ var DashboardErrorBoundary = class extends React6.Component {
|
|
|
1308
1427
|
}
|
|
1309
1428
|
render() {
|
|
1310
1429
|
if (this.state.error) {
|
|
1311
|
-
return /* @__PURE__ */
|
|
1430
|
+
return /* @__PURE__ */ jsx15(CrashScreen, { message: this.state.error.message });
|
|
1312
1431
|
}
|
|
1313
1432
|
return this.props.children;
|
|
1314
1433
|
}
|
|
1315
1434
|
};
|
|
1316
1435
|
|
|
1317
1436
|
// src/commands/memory/dashboard/tui.tsx
|
|
1318
|
-
import { jsx as
|
|
1437
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1319
1438
|
async function startTui(options) {
|
|
1320
1439
|
const config = loadConfig(
|
|
1321
1440
|
options?.dbPath ? { dataDir: options.dbPath } : void 0
|
|
@@ -1334,7 +1453,7 @@ async function startTui(options) {
|
|
|
1334
1453
|
);
|
|
1335
1454
|
let shuttingDown = false;
|
|
1336
1455
|
const { waitUntilExit, unmount } = render(
|
|
1337
|
-
/* @__PURE__ */
|
|
1456
|
+
/* @__PURE__ */ jsx16(DashboardErrorBoundary, { children: /* @__PURE__ */ jsx16(App, { dataSource }) })
|
|
1338
1457
|
);
|
|
1339
1458
|
function shutdown() {
|
|
1340
1459
|
if (shuttingDown) return;
|
|
@@ -1357,4 +1476,4 @@ async function startTui(options) {
|
|
|
1357
1476
|
export {
|
|
1358
1477
|
startTui
|
|
1359
1478
|
};
|
|
1360
|
-
//# sourceMappingURL=tui-
|
|
1479
|
+
//# sourceMappingURL=tui-ZINEA7TI.js.map
|