claude-launchpad 1.2.2 → 1.3.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/README.md +19 -0
- package/dist/{chunk-KKC42IEO.js → chunk-AR64LWGW.js} +3 -3
- package/dist/{chunk-IXNWBG7U.js → chunk-J765H3HZ.js} +2 -2
- package/dist/{chunk-WZ5CLBFU.js → chunk-UJP5PJTA.js} +2 -2
- package/dist/{chunk-WU3KYYLA.js → chunk-YXPJDIMK.js} +18 -14
- package/dist/chunk-YXPJDIMK.js.map +1 -0
- package/dist/cli.js +25 -46
- package/dist/cli.js.map +1 -1
- package/dist/commands/memory/server.js +10 -11
- package/dist/commands/memory/server.js.map +1 -1
- package/dist/{context-ZCTBWZ3O.js → context-VAXF3EW3.js} +5 -5
- package/dist/{install-7JGAYDND.js → install-M3JWBGMK.js} +5 -5
- package/dist/{pull-2ADXVXJC.js → pull-ZQFCMK46.js} +42 -17
- package/dist/pull-ZQFCMK46.js.map +1 -0
- package/dist/{push-ZFF7WWER.js → push-5ZJNWAE7.js} +6 -6
- package/dist/{require-deps-Q3XEE5A3.js → require-deps-QW2IU6I3.js} +3 -3
- package/dist/{stats-F7WII23A.js → stats-NPXPJNBO.js} +6 -6
- package/dist/{sync-clean-QL3F2FYV.js → sync-clean-JQLVE4WU.js} +2 -2
- package/dist/{sync-status-P5JFNOPR.js → sync-status-IYG7ZYC5.js} +6 -6
- package/dist/{tui-OZUNI5ZC.js → tui-74FMIMUM.js} +207 -39
- package/dist/tui-74FMIMUM.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-WU3KYYLA.js.map +0 -1
- package/dist/pull-2ADXVXJC.js.map +0 -1
- package/dist/tui-OZUNI5ZC.js.map +0 -1
- /package/dist/{chunk-KKC42IEO.js.map → chunk-AR64LWGW.js.map} +0 -0
- /package/dist/{chunk-IXNWBG7U.js.map → chunk-J765H3HZ.js.map} +0 -0
- /package/dist/{chunk-WZ5CLBFU.js.map → chunk-UJP5PJTA.js.map} +0 -0
- /package/dist/{context-ZCTBWZ3O.js.map → context-VAXF3EW3.js.map} +0 -0
- /package/dist/{install-7JGAYDND.js.map → install-M3JWBGMK.js.map} +0 -0
- /package/dist/{push-ZFF7WWER.js.map → push-5ZJNWAE7.js.map} +0 -0
- /package/dist/{require-deps-Q3XEE5A3.js.map → require-deps-QW2IU6I3.js.map} +0 -0
- /package/dist/{stats-F7WII23A.js.map → stats-NPXPJNBO.js.map} +0 -0
- /package/dist/{sync-clean-QL3F2FYV.js.map → sync-clean-JQLVE4WU.js.map} +0 -0
- /package/dist/{sync-status-P5JFNOPR.js.map → sync-status-IYG7ZYC5.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/memory/subcommands/pull.ts"],"sourcesContent":["import { log } from '../../../lib/output.js';\nimport { initStorage } from './init-storage.js';\nimport {\n assertGhAvailable,\n loadSyncConfig,\n readGistFile,\n listGistFiles,\n filenameToProject,\n projectToFilename,\n} from '../utils/gist-transport.js';\nimport { mergeFromRemote, parsePayload } from '../utils/sync-merge.js';\nimport type { MergeResult } from '../types.js';\nimport { detectProject } from '../utils/project.js';\n\ninterface PullOpts {\n readonly all?: boolean;\n}\n\nexport async function runPull(opts: PullOpts): Promise<void> {\n assertGhAvailable();\n\n const syncConfig = loadSyncConfig();\n if (!syncConfig) {\n log.error('No sync gist found. Run `memory push` first.');\n return;\n }\n\n const { requireMemoryDeps } = await import('../utils/require-deps.js');\n await requireMemoryDeps();\n const ctx = initStorage();\n\n try {\n if (opts.all) {\n pullAll(ctx, syncConfig.gistId);\n } else {\n pullProject(ctx, syncConfig.gistId);\n }\n } finally {\n ctx.close();\n }\n}\n\nfunction pullProject(ctx: ReturnType<typeof initStorage>, gistId: string): void {\n const project = detectProject(process.cwd());\n if (!project) {\n log.error('Could not detect project. Run from a project directory or use --all.');\n return;\n }\n\n const filename = projectToFilename(project);\n const payload = parsePayload(readGistFile(gistId, filename));\n if (!payload) {\n log.error(`No memories found for project \"${project}\" in gist.`);\n return;\n }\n\n const localCount = ctx.memoryRepo.count(project);\n if (localCount === 0) {\n log.warn(`No local memories for \"${project}\" — creating fresh database from remote.`);\n }\n\n const result = mergeFromRemote(ctx.memoryRepo, ctx.relationRepo, payload);\n printResult(result, project);\n}\n\nfunction pullAll(ctx: ReturnType<typeof initStorage>, gistId: string): void {\n const files = listGistFiles(gistId);\n const projectFiles = files.filter((f) => filenameToProject(f) !== null);\n\n if (projectFiles.length === 0) {\n log.error('No memory files found in gist.');\n return;\n }\n\n const perProject: { project: string; result: MergeResult }[] = [];\n const skipped: string[] = [];\n let totalInserted = 0;\n let totalUpdated = 0;\n let totalRelations = 0;\n\n for (const filename of projectFiles) {\n const project = filenameToProject(filename);\n if (!project) continue;\n\n // Skip projects not set up on this machine (zero local memories).\n // User must `cd` into the project and run `memory pull` to opt-in to a new project.\n if (ctx.memoryRepo.count(project) === 0) {\n skipped.push(project);\n continue;\n }\n\n const payload = parsePayload(readGistFile(gistId, filename));\n if (!payload) continue;\n const result = mergeFromRemote(ctx.memoryRepo, ctx.relationRepo, payload);\n perProject.push({ project, result });\n totalInserted += result.inserted;\n totalUpdated += result.updated;\n totalRelations += result.relationsAdded;\n }\n\n const changed = perProject.filter((p) => p.result.inserted > 0 || p.result.updated > 0 || p.result.relationsAdded > 0);\n const syncedCount = perProject.length;\n\n log.blank();\n if (syncedCount === 0) {\n log.step('No locally set up projects to sync');\n } else if (changed.length === 0) {\n log.step(`Already in sync (${syncedCount} project${syncedCount === 1 ? '' : 's'})`);\n } else {\n log.step(`Pull complete (${changed.length} of ${syncedCount} projects updated)`);\n for (const { project, result } of changed) {\n const parts: string[] = [];\n if (result.inserted > 0) parts.push(`+${result.inserted} new`);\n if (result.updated > 0) parts.push(`~${result.updated} updated`);\n if (result.relationsAdded > 0) parts.push(`+${result.relationsAdded} relations`);\n log.info(`${project.padEnd(30)} ${parts.join(', ')}`);\n }\n if (totalInserted + totalUpdated + totalRelations > 0) {\n log.blank();\n log.info(`Total: +${totalInserted} new, ~${totalUpdated} updated, +${totalRelations} relations`);\n }\n }\n if (skipped.length > 0) {\n log.blank();\n log.info(`Skipped ${skipped.length} project${skipped.length === 1 ? '' : 's'} not set up on this machine:`);\n for (const project of skipped) log.info(` - ${project}`);\n log.info('Run `memory pull` from a project directory to pull that project for the first time.');\n }\n log.blank();\n}\n\nfunction printResult(result: MergeResult, project: string): void {\n log.blank();\n if (result.inserted === 0 && result.updated === 0 && result.relationsAdded === 0) {\n log.step(`${project}: already in sync`);\n } else {\n log.step(`${project}: pull complete`);\n if (result.inserted > 0) log.info(`Inserted: ${result.inserted}`);\n if (result.updated > 0) log.info(`Updated: ${result.updated}`);\n if (result.relationsAdded > 0) log.info(`Relations: ${result.relationsAdded} added`);\n }\n log.info('Tip: run `memory pull --all` to sync every project in this gist.');\n log.blank();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,eAAsB,QAAQ,MAA+B;AAC3D,oBAAkB;AAElB,QAAM,aAAa,eAAe;AAClC,MAAI,CAAC,YAAY;AACf,QAAI,MAAM,8CAA8C;AACxD;AAAA,EACF;AAEA,QAAM,EAAE,kBAAkB,IAAI,MAAM,OAAO,4BAA0B;AACrE,QAAM,kBAAkB;AACxB,QAAM,MAAM,YAAY;AAExB,MAAI;AACF,QAAI,KAAK,KAAK;AACZ,cAAQ,KAAK,WAAW,MAAM;AAAA,IAChC,OAAO;AACL,kBAAY,KAAK,WAAW,MAAM;AAAA,IACpC;AAAA,EACF,UAAE;AACA,QAAI,MAAM;AAAA,EACZ;AACF;AAEA,SAAS,YAAY,KAAqC,QAAsB;AAC9E,QAAM,UAAU,cAAc,QAAQ,IAAI,CAAC;AAC3C,MAAI,CAAC,SAAS;AACZ,QAAI,MAAM,sEAAsE;AAChF;AAAA,EACF;AAEA,QAAM,WAAW,kBAAkB,OAAO;AAC1C,QAAM,UAAU,aAAa,aAAa,QAAQ,QAAQ,CAAC;AAC3D,MAAI,CAAC,SAAS;AACZ,QAAI,MAAM,kCAAkC,OAAO,YAAY;AAC/D;AAAA,EACF;AAEA,QAAM,aAAa,IAAI,WAAW,MAAM,OAAO;AAC/C,MAAI,eAAe,GAAG;AACpB,QAAI,KAAK,0BAA0B,OAAO,+CAA0C;AAAA,EACtF;AAEA,QAAM,SAAS,gBAAgB,IAAI,YAAY,IAAI,cAAc,OAAO;AACxE,cAAY,QAAQ,OAAO;AAC7B;AAEA,SAAS,QAAQ,KAAqC,QAAsB;AAC1E,QAAM,QAAQ,cAAc,MAAM;AAClC,QAAM,eAAe,MAAM,OAAO,CAAC,MAAM,kBAAkB,CAAC,MAAM,IAAI;AAEtE,MAAI,aAAa,WAAW,GAAG;AAC7B,QAAI,MAAM,gCAAgC;AAC1C;AAAA,EACF;AAEA,QAAM,aAAyD,CAAC;AAChE,QAAM,UAAoB,CAAC;AAC3B,MAAI,gBAAgB;AACpB,MAAI,eAAe;AACnB,MAAI,iBAAiB;AAErB,aAAW,YAAY,cAAc;AACnC,UAAM,UAAU,kBAAkB,QAAQ;AAC1C,QAAI,CAAC,QAAS;AAId,QAAI,IAAI,WAAW,MAAM,OAAO,MAAM,GAAG;AACvC,cAAQ,KAAK,OAAO;AACpB;AAAA,IACF;AAEA,UAAM,UAAU,aAAa,aAAa,QAAQ,QAAQ,CAAC;AAC3D,QAAI,CAAC,QAAS;AACd,UAAM,SAAS,gBAAgB,IAAI,YAAY,IAAI,cAAc,OAAO;AACxE,eAAW,KAAK,EAAE,SAAS,OAAO,CAAC;AACnC,qBAAiB,OAAO;AACxB,oBAAgB,OAAO;AACvB,sBAAkB,OAAO;AAAA,EAC3B;AAEA,QAAM,UAAU,WAAW,OAAO,CAAC,MAAM,EAAE,OAAO,WAAW,KAAK,EAAE,OAAO,UAAU,KAAK,EAAE,OAAO,iBAAiB,CAAC;AACrH,QAAM,cAAc,WAAW;AAE/B,MAAI,MAAM;AACV,MAAI,gBAAgB,GAAG;AACrB,QAAI,KAAK,oCAAoC;AAAA,EAC/C,WAAW,QAAQ,WAAW,GAAG;AAC/B,QAAI,KAAK,oBAAoB,WAAW,WAAW,gBAAgB,IAAI,KAAK,GAAG,GAAG;AAAA,EACpF,OAAO;AACL,QAAI,KAAK,kBAAkB,QAAQ,MAAM,OAAO,WAAW,oBAAoB;AAC/E,eAAW,EAAE,SAAS,OAAO,KAAK,SAAS;AACzC,YAAM,QAAkB,CAAC;AACzB,UAAI,OAAO,WAAW,EAAG,OAAM,KAAK,IAAI,OAAO,QAAQ,MAAM;AAC7D,UAAI,OAAO,UAAU,EAAG,OAAM,KAAK,IAAI,OAAO,OAAO,UAAU;AAC/D,UAAI,OAAO,iBAAiB,EAAG,OAAM,KAAK,IAAI,OAAO,cAAc,YAAY;AAC/E,UAAI,KAAK,GAAG,QAAQ,OAAO,EAAE,CAAC,KAAK,MAAM,KAAK,IAAI,CAAC,EAAE;AAAA,IACvD;AACA,QAAI,gBAAgB,eAAe,iBAAiB,GAAG;AACrD,UAAI,MAAM;AACV,UAAI,KAAK,WAAW,aAAa,UAAU,YAAY,cAAc,cAAc,YAAY;AAAA,IACjG;AAAA,EACF;AACA,MAAI,QAAQ,SAAS,GAAG;AACtB,QAAI,MAAM;AACV,QAAI,KAAK,WAAW,QAAQ,MAAM,WAAW,QAAQ,WAAW,IAAI,KAAK,GAAG,8BAA8B;AAC1G,eAAW,WAAW,QAAS,KAAI,KAAK,OAAO,OAAO,EAAE;AACxD,QAAI,KAAK,qFAAqF;AAAA,EAChG;AACA,MAAI,MAAM;AACZ;AAEA,SAAS,YAAY,QAAqB,SAAuB;AAC/D,MAAI,MAAM;AACV,MAAI,OAAO,aAAa,KAAK,OAAO,YAAY,KAAK,OAAO,mBAAmB,GAAG;AAChF,QAAI,KAAK,GAAG,OAAO,mBAAmB;AAAA,EACxC,OAAO;AACL,QAAI,KAAK,GAAG,OAAO,iBAAiB;AACpC,QAAI,OAAO,WAAW,EAAG,KAAI,KAAK,cAAc,OAAO,QAAQ,EAAE;AACjE,QAAI,OAAO,UAAU,EAAG,KAAI,KAAK,cAAc,OAAO,OAAO,EAAE;AAC/D,QAAI,OAAO,iBAAiB,EAAG,KAAI,KAAK,cAAc,OAAO,cAAc,QAAQ;AAAA,EACrF;AACA,MAAI,KAAK,kEAAkE;AAC3E,MAAI,MAAM;AACZ;","names":[]}
|
|
@@ -18,13 +18,13 @@ import {
|
|
|
18
18
|
} from "./chunk-NAW47BYA.js";
|
|
19
19
|
import {
|
|
20
20
|
initStorage
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-UJP5PJTA.js";
|
|
22
22
|
import "./chunk-V4NXT4KB.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-AR64LWGW.js";
|
|
24
|
+
import "./chunk-J765H3HZ.js";
|
|
25
25
|
import {
|
|
26
26
|
log
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-YXPJDIMK.js";
|
|
28
28
|
|
|
29
29
|
// src/commands/memory/subcommands/push.ts
|
|
30
30
|
import { hostname } from "os";
|
|
@@ -48,7 +48,7 @@ function filterRelations(allRelations, memoryIds) {
|
|
|
48
48
|
}
|
|
49
49
|
async function runPush(opts) {
|
|
50
50
|
assertGhAvailable();
|
|
51
|
-
const { requireMemoryDeps } = await import("./require-deps-
|
|
51
|
+
const { requireMemoryDeps } = await import("./require-deps-QW2IU6I3.js");
|
|
52
52
|
await requireMemoryDeps();
|
|
53
53
|
const ctx = initStorage();
|
|
54
54
|
try {
|
|
@@ -148,4 +148,4 @@ async function confirmCreate() {
|
|
|
148
148
|
export {
|
|
149
149
|
runPush
|
|
150
150
|
};
|
|
151
|
-
//# sourceMappingURL=push-
|
|
151
|
+
//# sourceMappingURL=push-5ZJNWAE7.js.map
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
cwdRequire,
|
|
4
4
|
requireMemoryDeps
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-J765H3HZ.js";
|
|
6
|
+
import "./chunk-YXPJDIMK.js";
|
|
7
7
|
export {
|
|
8
8
|
cwdRequire,
|
|
9
9
|
requireMemoryDeps
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=require-deps-
|
|
11
|
+
//# sourceMappingURL=require-deps-QW2IU6I3.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
initStorage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UJP5PJTA.js";
|
|
5
5
|
import "./chunk-V4NXT4KB.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-AR64LWGW.js";
|
|
7
|
+
import "./chunk-J765H3HZ.js";
|
|
8
8
|
import {
|
|
9
9
|
log
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YXPJDIMK.js";
|
|
11
11
|
|
|
12
12
|
// src/commands/memory/subcommands/stats.ts
|
|
13
13
|
import { existsSync, statSync } from "fs";
|
|
@@ -18,7 +18,7 @@ function formatBytes(bytes) {
|
|
|
18
18
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
19
19
|
}
|
|
20
20
|
async function runStats(opts) {
|
|
21
|
-
const { requireMemoryDeps } = await import("./require-deps-
|
|
21
|
+
const { requireMemoryDeps } = await import("./require-deps-QW2IU6I3.js");
|
|
22
22
|
await requireMemoryDeps();
|
|
23
23
|
const ctx = initStorage(opts.dbPath);
|
|
24
24
|
try {
|
|
@@ -72,4 +72,4 @@ async function runStats(opts) {
|
|
|
72
72
|
export {
|
|
73
73
|
runStats
|
|
74
74
|
};
|
|
75
|
-
//# sourceMappingURL=stats-
|
|
75
|
+
//# sourceMappingURL=stats-NPXPJNBO.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-3UJYOWGF.js";
|
|
10
10
|
import {
|
|
11
11
|
log
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YXPJDIMK.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/memory/subcommands/sync-clean.ts
|
|
15
15
|
import { confirm } from "@inquirer/prompts";
|
|
@@ -50,4 +50,4 @@ async function runSyncClean(project, opts) {
|
|
|
50
50
|
export {
|
|
51
51
|
runSyncClean
|
|
52
52
|
};
|
|
53
|
-
//# sourceMappingURL=sync-clean-
|
|
53
|
+
//# sourceMappingURL=sync-clean-JQLVE4WU.js.map
|
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
import "./chunk-F5PNKQKW.js";
|
|
13
13
|
import {
|
|
14
14
|
initStorage
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UJP5PJTA.js";
|
|
16
16
|
import "./chunk-V4NXT4KB.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-AR64LWGW.js";
|
|
18
|
+
import "./chunk-J765H3HZ.js";
|
|
19
19
|
import {
|
|
20
20
|
log
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-YXPJDIMK.js";
|
|
22
22
|
|
|
23
23
|
// src/commands/memory/subcommands/sync-status.ts
|
|
24
24
|
async function runSyncStatus() {
|
|
@@ -28,7 +28,7 @@ async function runSyncStatus() {
|
|
|
28
28
|
log.error("No sync gist found. Run `memory push` first.");
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
const { requireMemoryDeps } = await import("./require-deps-
|
|
31
|
+
const { requireMemoryDeps } = await import("./require-deps-QW2IU6I3.js");
|
|
32
32
|
await requireMemoryDeps();
|
|
33
33
|
const ctx = initStorage();
|
|
34
34
|
try {
|
|
@@ -67,4 +67,4 @@ async function runSyncStatus() {
|
|
|
67
67
|
export {
|
|
68
68
|
runSyncStatus
|
|
69
69
|
};
|
|
70
|
-
//# sourceMappingURL=sync-status-
|
|
70
|
+
//# sourceMappingURL=sync-status-IYG7ZYC5.js.map
|
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
loadConfig,
|
|
12
12
|
migrate,
|
|
13
13
|
resolveDataDir
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-AR64LWGW.js";
|
|
15
|
+
import "./chunk-J765H3HZ.js";
|
|
16
|
+
import "./chunk-YXPJDIMK.js";
|
|
17
17
|
|
|
18
18
|
// src/commands/memory/dashboard/tui.tsx
|
|
19
19
|
import { render } from "ink";
|
|
@@ -129,7 +129,7 @@ var DashboardDataSource = class {
|
|
|
129
129
|
};
|
|
130
130
|
|
|
131
131
|
// src/commands/memory/dashboard/app.tsx
|
|
132
|
-
import { Box as
|
|
132
|
+
import { Box as Box13, useApp } from "ink";
|
|
133
133
|
|
|
134
134
|
// src/commands/memory/dashboard/hooks/use-dashboard-state.ts
|
|
135
135
|
import { useState, useMemo, useEffect, useCallback } from "react";
|
|
@@ -231,6 +231,7 @@ function useDashboardState(dataSource) {
|
|
|
231
231
|
const [showProjectPicker, setShowProjectPicker] = useState(false);
|
|
232
232
|
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
|
|
233
233
|
const [showPurgeConfirm, setShowPurgeConfirm] = useState(false);
|
|
234
|
+
const [showExpand, setShowExpand] = useState(false);
|
|
234
235
|
useEffect(() => {
|
|
235
236
|
dataSource.refresh();
|
|
236
237
|
setRevision((r) => r + 1);
|
|
@@ -329,6 +330,10 @@ function useDashboardState(dataSource) {
|
|
|
329
330
|
setRevision((r) => r + 1);
|
|
330
331
|
}, [dataSource, currentProject]);
|
|
331
332
|
const cancelPurge = useCallback(() => setShowPurgeConfirm(false), []);
|
|
333
|
+
const expandMemory = useCallback(() => {
|
|
334
|
+
if (selectedMemory) setShowExpand(true);
|
|
335
|
+
}, [selectedMemory]);
|
|
336
|
+
const closeExpand = useCallback(() => setShowExpand(false), []);
|
|
332
337
|
return {
|
|
333
338
|
typeFilter,
|
|
334
339
|
lifespanFilter,
|
|
@@ -342,6 +347,7 @@ function useDashboardState(dataSource) {
|
|
|
342
347
|
showProjectPicker,
|
|
343
348
|
showDeleteConfirm,
|
|
344
349
|
showPurgeConfirm,
|
|
350
|
+
showExpand,
|
|
345
351
|
filteredMemories,
|
|
346
352
|
selectedMemory,
|
|
347
353
|
relations,
|
|
@@ -367,7 +373,9 @@ function useDashboardState(dataSource) {
|
|
|
367
373
|
cancelDelete,
|
|
368
374
|
promptPurge,
|
|
369
375
|
confirmPurge,
|
|
370
|
-
cancelPurge
|
|
376
|
+
cancelPurge,
|
|
377
|
+
expandMemory,
|
|
378
|
+
closeExpand
|
|
371
379
|
};
|
|
372
380
|
}
|
|
373
381
|
function sortMemories(memories, mode) {
|
|
@@ -393,6 +401,7 @@ var TYPE_KEYS = {
|
|
|
393
401
|
};
|
|
394
402
|
function useKeybindings(actions, opts) {
|
|
395
403
|
useInput((input, key) => {
|
|
404
|
+
if (opts.expandOpen) return;
|
|
396
405
|
if (opts.searchActive) {
|
|
397
406
|
if (key.escape) actions.closeSearch();
|
|
398
407
|
return;
|
|
@@ -416,6 +425,7 @@ function useKeybindings(actions, opts) {
|
|
|
416
425
|
if (input === "r") actions.removeMemory();
|
|
417
426
|
if (input === "d") actions.purgeProject();
|
|
418
427
|
if (input === "?") actions.showHelp();
|
|
428
|
+
if (key.return) actions.expandMemory();
|
|
419
429
|
if (input === "q") actions.quit();
|
|
420
430
|
});
|
|
421
431
|
}
|
|
@@ -446,6 +456,7 @@ import { Box, Text } from "ink";
|
|
|
446
456
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
447
457
|
var HINTS = [
|
|
448
458
|
["j/k", "navigate"],
|
|
459
|
+
["Enter", "expand"],
|
|
449
460
|
["/", "search"],
|
|
450
461
|
["p", "projects"],
|
|
451
462
|
["1-5", "type"],
|
|
@@ -549,7 +560,7 @@ var LIFE_COLORS = {
|
|
|
549
560
|
session: "magenta"
|
|
550
561
|
};
|
|
551
562
|
function MemoryList({ memories, selectedIndex, isFocused, height }) {
|
|
552
|
-
const viewportHeight = Math.max(1, height -
|
|
563
|
+
const viewportHeight = Math.max(1, height - 3);
|
|
553
564
|
const scrollOffset = useMemo2(() => {
|
|
554
565
|
if (selectedIndex < 0) return 0;
|
|
555
566
|
if (memories.length <= viewportHeight) return 0;
|
|
@@ -565,6 +576,7 @@ function MemoryList({ memories, selectedIndex, isFocused, height }) {
|
|
|
565
576
|
flexDirection: "column",
|
|
566
577
|
borderStyle: "round",
|
|
567
578
|
borderColor: isFocused ? "cyan" : "gray",
|
|
579
|
+
height,
|
|
568
580
|
children: [
|
|
569
581
|
/* @__PURE__ */ jsx4(Text4, { bold: true, color: isFocused ? "cyan" : "gray", children: label }),
|
|
570
582
|
visible.length === 0 && /* @__PURE__ */ jsx4(Text4, { dimColor: true, children: " No memories found" }),
|
|
@@ -608,8 +620,29 @@ function MemoryRow({ memory, isSelected }) {
|
|
|
608
620
|
|
|
609
621
|
// src/commands/memory/dashboard/components/memory-detail.tsx
|
|
610
622
|
import { Box as Box5, Text as Text5 } from "ink";
|
|
623
|
+
|
|
624
|
+
// src/commands/memory/dashboard/data/wrap.ts
|
|
625
|
+
function wrapContent(content, width) {
|
|
626
|
+
if (width <= 0) return content.split("\n");
|
|
627
|
+
const out = [];
|
|
628
|
+
for (const rawLine of content.split("\n")) {
|
|
629
|
+
if (rawLine.length === 0) {
|
|
630
|
+
out.push("");
|
|
631
|
+
continue;
|
|
632
|
+
}
|
|
633
|
+
for (let i = 0; i < rawLine.length; i += width) {
|
|
634
|
+
out.push(rawLine.slice(i, i + width));
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
return out;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
// src/commands/memory/dashboard/components/memory-detail.tsx
|
|
611
641
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
612
|
-
|
|
642
|
+
var METADATA_ROWS = 18;
|
|
643
|
+
var BORDER_ROWS = 2;
|
|
644
|
+
var MIN_CONTENT_ROWS = 2;
|
|
645
|
+
function MemoryDetail({ memory, relations, isFocused, height, width }) {
|
|
613
646
|
return /* @__PURE__ */ jsxs5(
|
|
614
647
|
Box5,
|
|
615
648
|
{
|
|
@@ -617,16 +650,21 @@ function MemoryDetail({ memory, relations, isFocused }) {
|
|
|
617
650
|
borderStyle: "round",
|
|
618
651
|
borderColor: isFocused ? "blue" : "gray",
|
|
619
652
|
paddingX: 1,
|
|
653
|
+
height,
|
|
620
654
|
children: [
|
|
621
655
|
/* @__PURE__ */ jsx5(Text5, { bold: true, color: isFocused ? "blue" : "gray", children: " Detail " }),
|
|
622
|
-
!memory ? /* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "Select a memory to view details" }) : /* @__PURE__ */ jsx5(DetailContent, { memory, relations })
|
|
656
|
+
!memory ? /* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "Select a memory to view details" }) : /* @__PURE__ */ jsx5(DetailContent, { memory, relations, height, width })
|
|
623
657
|
]
|
|
624
658
|
}
|
|
625
659
|
);
|
|
626
660
|
}
|
|
627
|
-
function DetailContent({ memory, relations }) {
|
|
661
|
+
function DetailContent({ memory, relations, height, width }) {
|
|
628
662
|
const life = computeLifespan(memory);
|
|
629
663
|
const typeColor = TYPE_COLORS[memory.type] ?? "white";
|
|
664
|
+
const relationRows = relations.length > 0 ? relations.length + 2 : 0;
|
|
665
|
+
const contentRows = Math.max(MIN_CONTENT_ROWS, height - METADATA_ROWS - BORDER_ROWS - relationRows);
|
|
666
|
+
const contentWidth = Math.max(10, width - 4);
|
|
667
|
+
const preview = truncateContent(memory.content, contentRows, contentWidth);
|
|
630
668
|
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
|
|
631
669
|
/* @__PURE__ */ jsx5(Text5, { bold: true, children: memory.title ?? "(untitled)" }),
|
|
632
670
|
/* @__PURE__ */ jsx5(Text5, { children: " " }),
|
|
@@ -690,11 +728,30 @@ function DetailContent({ memory, relations }) {
|
|
|
690
728
|
] }),
|
|
691
729
|
/* @__PURE__ */ jsx5(Text5, { children: " " }),
|
|
692
730
|
/* @__PURE__ */ jsx5(Text5, { bold: true, children: "Content" }),
|
|
693
|
-
/* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "\u2500".repeat(40) }),
|
|
694
|
-
/* @__PURE__ */ jsx5(Text5, { children:
|
|
731
|
+
/* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "\u2500".repeat(Math.min(contentWidth, 40)) }),
|
|
732
|
+
preview.lines.map((line, i) => /* @__PURE__ */ jsx5(Text5, { children: line === "" ? " " : line }, `line-${i}`)),
|
|
733
|
+
preview.truncated && /* @__PURE__ */ jsxs5(Text5, { dimColor: true, children: [
|
|
734
|
+
"\u2026 +",
|
|
735
|
+
preview.remainingLines,
|
|
736
|
+
" line",
|
|
737
|
+
preview.remainingLines === 1 ? "" : "s",
|
|
738
|
+
" \xB7 press Enter to view full"
|
|
739
|
+
] }),
|
|
695
740
|
relations.length > 0 && /* @__PURE__ */ jsx5(RelationsList, { relations, memoryId: memory.id })
|
|
696
741
|
] });
|
|
697
742
|
}
|
|
743
|
+
function truncateContent(content, maxRows, wrapWidth) {
|
|
744
|
+
const allLines = wrapContent(content, wrapWidth);
|
|
745
|
+
if (allLines.length <= maxRows) {
|
|
746
|
+
return { lines: allLines, truncated: false, remainingLines: 0 };
|
|
747
|
+
}
|
|
748
|
+
const visible = Math.max(1, maxRows - 1);
|
|
749
|
+
return {
|
|
750
|
+
lines: allLines.slice(0, visible),
|
|
751
|
+
truncated: true,
|
|
752
|
+
remainingLines: allLines.length - visible
|
|
753
|
+
};
|
|
754
|
+
}
|
|
698
755
|
function RelationsList({ relations, memoryId }) {
|
|
699
756
|
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", marginTop: 1, children: [
|
|
700
757
|
/* @__PURE__ */ jsx5(Text5, { bold: true, children: "Relations" }),
|
|
@@ -719,17 +776,22 @@ function RelationsList({ relations, memoryId }) {
|
|
|
719
776
|
import { useMemo as useMemo3 } from "react";
|
|
720
777
|
import { Box as Box6, Text as Text6 } from "ink";
|
|
721
778
|
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
722
|
-
function ProjectList({ memories, activeProject, isFocused }) {
|
|
779
|
+
function ProjectList({ memories, activeProject, isFocused, height }) {
|
|
723
780
|
const rows = useMemo3(() => buildProjectRows(memories), [memories]);
|
|
781
|
+
const visibleRows = Math.max(1, height - 3);
|
|
782
|
+
const truncated = rows.length > visibleRows;
|
|
783
|
+
const displayed = truncated ? rows.slice(0, visibleRows - 1) : rows;
|
|
784
|
+
const hidden = rows.length - displayed.length;
|
|
724
785
|
return /* @__PURE__ */ jsxs6(
|
|
725
786
|
Box6,
|
|
726
787
|
{
|
|
727
788
|
flexDirection: "column",
|
|
728
789
|
borderStyle: "round",
|
|
729
790
|
borderColor: isFocused ? "magenta" : "gray",
|
|
791
|
+
height,
|
|
730
792
|
children: [
|
|
731
793
|
/* @__PURE__ */ jsx6(Text6, { bold: true, color: isFocused ? "magenta" : "gray", children: " Projects " }),
|
|
732
|
-
|
|
794
|
+
displayed.map((row) => {
|
|
733
795
|
const isActive = row.project === activeProject || row.project === void 0 && !activeProject;
|
|
734
796
|
const name = (row.project ?? "All projects").padEnd(20).slice(0, 20);
|
|
735
797
|
const healthColor = row.healthPct > 62 ? "green" : row.healthPct > 32 ? "yellow" : "red";
|
|
@@ -746,7 +808,12 @@ function ProjectList({ memories, activeProject, isFocused }) {
|
|
|
746
808
|
"%"
|
|
747
809
|
] })
|
|
748
810
|
] }, row.project ?? "_all");
|
|
749
|
-
})
|
|
811
|
+
}),
|
|
812
|
+
truncated && /* @__PURE__ */ jsxs6(Text6, { dimColor: true, children: [
|
|
813
|
+
" \u2026 +",
|
|
814
|
+
hidden,
|
|
815
|
+
" more"
|
|
816
|
+
] })
|
|
750
817
|
]
|
|
751
818
|
}
|
|
752
819
|
);
|
|
@@ -837,7 +904,7 @@ import { Box as Box8, Text as Text8, useInput as useInput2 } from "ink";
|
|
|
837
904
|
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
838
905
|
var BINDINGS = [
|
|
839
906
|
["j / k / \u2191\u2193", "Navigate list"],
|
|
840
|
-
["Enter", "
|
|
907
|
+
["Enter", "Expand memory (full content + scroll)"],
|
|
841
908
|
["/", "Search (live filter)"],
|
|
842
909
|
["Esc", "Clear search"],
|
|
843
910
|
["1-5", "Filter by type (0 = all)"],
|
|
@@ -975,11 +1042,91 @@ function PurgeConfirm({ project, memoryCount, onConfirm, onCancel }) {
|
|
|
975
1042
|
] });
|
|
976
1043
|
}
|
|
977
1044
|
|
|
978
|
-
// src/commands/memory/dashboard/
|
|
1045
|
+
// src/commands/memory/dashboard/components/expand-memory.tsx
|
|
1046
|
+
import { useState as useState3, useEffect as useEffect3 } from "react";
|
|
1047
|
+
import { Box as Box12, Text as Text12, useInput as useInput6 } from "ink";
|
|
979
1048
|
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1049
|
+
function ExpandMemory({ memory, relations, onClose }) {
|
|
1050
|
+
const { columns, rows } = useTerminalSize();
|
|
1051
|
+
const [scroll, setScroll] = useState3(0);
|
|
1052
|
+
const contentWidth = Math.max(20, columns - 6);
|
|
1053
|
+
const chromeLines = 7 + (relations.length > 0 ? relations.length + 2 : 0);
|
|
1054
|
+
const viewportLines = Math.max(5, rows - chromeLines);
|
|
1055
|
+
const wrappedLines = wrapContent(memory.content, contentWidth);
|
|
1056
|
+
const totalLines = wrappedLines.length;
|
|
1057
|
+
const maxScroll = Math.max(0, totalLines - viewportLines);
|
|
1058
|
+
useEffect3(() => {
|
|
1059
|
+
setScroll(0);
|
|
1060
|
+
}, [memory.id]);
|
|
1061
|
+
useInput6((input, key) => {
|
|
1062
|
+
if (key.escape || input === "q") {
|
|
1063
|
+
onClose();
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
1066
|
+
if (input === "j" || key.downArrow) setScroll((s) => Math.min(maxScroll, s + 1));
|
|
1067
|
+
if (input === "k" || key.upArrow) setScroll((s) => Math.max(0, s - 1));
|
|
1068
|
+
if (key.pageDown || input === " ") setScroll((s) => Math.min(maxScroll, s + viewportLines));
|
|
1069
|
+
if (key.pageUp) setScroll((s) => Math.max(0, s - viewportLines));
|
|
1070
|
+
if (input === "g") setScroll(0);
|
|
1071
|
+
if (input === "G") setScroll(maxScroll);
|
|
1072
|
+
});
|
|
1073
|
+
const typeColor = TYPE_COLORS[memory.type] ?? "white";
|
|
1074
|
+
const visible = wrappedLines.slice(scroll, scroll + viewportLines);
|
|
1075
|
+
const scrollInfo = totalLines > viewportLines ? ` [${scroll + 1}-${Math.min(totalLines, scroll + viewportLines)}/${totalLines}]` : ` [${totalLines} lines]`;
|
|
1076
|
+
const divider = "\u2500".repeat(Math.min(contentWidth, 80));
|
|
1077
|
+
return /* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", borderStyle: "double", borderColor: "blue", paddingX: 1, children: [
|
|
1078
|
+
/* @__PURE__ */ jsxs12(Text12, { bold: true, children: [
|
|
1079
|
+
/* @__PURE__ */ jsxs12(Text12, { color: typeColor, children: [
|
|
1080
|
+
"[",
|
|
1081
|
+
memory.type,
|
|
1082
|
+
"]"
|
|
1083
|
+
] }),
|
|
1084
|
+
" ",
|
|
1085
|
+
memory.title ?? "(untitled)"
|
|
1086
|
+
] }),
|
|
1087
|
+
/* @__PURE__ */ jsxs12(Text12, { dimColor: true, children: [
|
|
1088
|
+
"id: ",
|
|
1089
|
+
memory.id.slice(0, 8),
|
|
1090
|
+
" | project: ",
|
|
1091
|
+
memory.project ?? "(none)",
|
|
1092
|
+
" | imp: ",
|
|
1093
|
+
memory.importance.toFixed(2),
|
|
1094
|
+
" | updated: ",
|
|
1095
|
+
formatRelativeTime(memory.updatedAt)
|
|
1096
|
+
] }),
|
|
1097
|
+
/* @__PURE__ */ jsx12(Text12, { dimColor: true, children: divider }),
|
|
1098
|
+
visible.map((line, i) => /* @__PURE__ */ jsx12(Text12, { children: line === "" ? " " : line }, `line-${scroll + i}`)),
|
|
1099
|
+
Array.from({ length: Math.max(0, viewportLines - visible.length) }).map((_, i) => /* @__PURE__ */ jsx12(Text12, { children: " " }, `pad-${i}`)),
|
|
1100
|
+
/* @__PURE__ */ jsx12(Text12, { dimColor: true, children: divider }),
|
|
1101
|
+
relations.length > 0 && /* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", children: [
|
|
1102
|
+
/* @__PURE__ */ jsx12(Text12, { bold: true, children: "Relations" }),
|
|
1103
|
+
relations.map((r, i) => {
|
|
1104
|
+
const relColor = RELATION_COLORS[r.relationType] ?? "white";
|
|
1105
|
+
const direction = r.sourceId === memory.id ? "\u2192" : "\u2190";
|
|
1106
|
+
const otherId = r.sourceId === memory.id ? r.targetId : r.sourceId;
|
|
1107
|
+
return /* @__PURE__ */ jsxs12(Text12, { children: [
|
|
1108
|
+
" ",
|
|
1109
|
+
direction,
|
|
1110
|
+
" ",
|
|
1111
|
+
/* @__PURE__ */ jsx12(Text12, { color: relColor, children: r.relationType }),
|
|
1112
|
+
" ",
|
|
1113
|
+
otherId
|
|
1114
|
+
] }, i);
|
|
1115
|
+
})
|
|
1116
|
+
] }),
|
|
1117
|
+
/* @__PURE__ */ jsxs12(Text12, { dimColor: true, children: [
|
|
1118
|
+
totalLines > viewportLines ? "j/k scroll \xB7 space/PgDn page \xB7 g/G top/bottom \xB7 " : "",
|
|
1119
|
+
"q/Esc close",
|
|
1120
|
+
scrollInfo
|
|
1121
|
+
] })
|
|
1122
|
+
] });
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
// src/commands/memory/dashboard/app.tsx
|
|
1126
|
+
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
980
1127
|
function App({ dataSource }) {
|
|
981
1128
|
const { exit } = useApp();
|
|
982
|
-
const { rows, layout } = useTerminalSize();
|
|
1129
|
+
const { columns, rows, layout } = useTerminalSize();
|
|
983
1130
|
const state = useDashboardState(dataSource);
|
|
984
1131
|
useKeybindings({
|
|
985
1132
|
navigateUp: state.navigateUp,
|
|
@@ -996,16 +1143,28 @@ function App({ dataSource }) {
|
|
|
996
1143
|
purgeProject: state.promptPurge,
|
|
997
1144
|
openProjectPicker: () => state.setShowProjectPicker((v) => !v),
|
|
998
1145
|
showHelp: () => state.setShowHelp((v) => !v),
|
|
1146
|
+
expandMemory: state.expandMemory,
|
|
999
1147
|
quit: exit
|
|
1000
1148
|
}, {
|
|
1001
1149
|
searchActive: state.searchActive,
|
|
1002
|
-
pickerOpen: state.showProjectPicker
|
|
1150
|
+
pickerOpen: state.showProjectPicker,
|
|
1151
|
+
expandOpen: state.showExpand
|
|
1003
1152
|
});
|
|
1004
1153
|
if (state.showHelp) {
|
|
1005
|
-
return /* @__PURE__ */
|
|
1154
|
+
return /* @__PURE__ */ jsx13(HelpOverlay, { onClose: () => state.setShowHelp(false) });
|
|
1155
|
+
}
|
|
1156
|
+
if (state.showExpand && state.selectedMemory) {
|
|
1157
|
+
return /* @__PURE__ */ jsx13(
|
|
1158
|
+
ExpandMemory,
|
|
1159
|
+
{
|
|
1160
|
+
memory: state.selectedMemory,
|
|
1161
|
+
relations: state.relations,
|
|
1162
|
+
onClose: state.closeExpand
|
|
1163
|
+
}
|
|
1164
|
+
);
|
|
1006
1165
|
}
|
|
1007
1166
|
if (state.showProjectPicker) {
|
|
1008
|
-
return /* @__PURE__ */
|
|
1167
|
+
return /* @__PURE__ */ jsx13(
|
|
1009
1168
|
ProjectPicker,
|
|
1010
1169
|
{
|
|
1011
1170
|
projects: [...state.projects],
|
|
@@ -1019,7 +1178,7 @@ function App({ dataSource }) {
|
|
|
1019
1178
|
);
|
|
1020
1179
|
}
|
|
1021
1180
|
if (state.showDeleteConfirm && state.selectedMemory) {
|
|
1022
|
-
return /* @__PURE__ */
|
|
1181
|
+
return /* @__PURE__ */ jsx13(
|
|
1023
1182
|
DeleteConfirm,
|
|
1024
1183
|
{
|
|
1025
1184
|
memory: state.selectedMemory,
|
|
@@ -1029,7 +1188,7 @@ function App({ dataSource }) {
|
|
|
1029
1188
|
);
|
|
1030
1189
|
}
|
|
1031
1190
|
if (state.showPurgeConfirm && state.currentProject) {
|
|
1032
|
-
return /* @__PURE__ */
|
|
1191
|
+
return /* @__PURE__ */ jsx13(
|
|
1033
1192
|
PurgeConfirm,
|
|
1034
1193
|
{
|
|
1035
1194
|
project: state.currentProject,
|
|
@@ -1039,11 +1198,17 @@ function App({ dataSource }) {
|
|
|
1039
1198
|
}
|
|
1040
1199
|
);
|
|
1041
1200
|
}
|
|
1042
|
-
const contentHeight = Math.max(4, rows - 6);
|
|
1201
|
+
const contentHeight = Math.max(4, rows - 6 - (state.searchActive ? 1 : 0));
|
|
1043
1202
|
const isNarrow = layout === "narrow";
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1203
|
+
const listWidth = Math.floor(columns * 0.6);
|
|
1204
|
+
const rightWidth = columns - listWidth;
|
|
1205
|
+
const projectsCount = new Set(state.filteredMemories.map((m) => m.project ?? "(none)")).size + 1;
|
|
1206
|
+
const projectListHeight = isNarrow ? 0 : Math.min(Math.max(4, Math.floor(contentHeight / 3)), projectsCount + 3, 12);
|
|
1207
|
+
const listHeight = isNarrow ? Math.max(6, Math.floor(contentHeight * 0.6)) : contentHeight;
|
|
1208
|
+
const detailHeight = isNarrow ? Math.max(6, contentHeight - listHeight) : Math.max(6, contentHeight - projectListHeight);
|
|
1209
|
+
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", children: [
|
|
1210
|
+
/* @__PURE__ */ jsx13(KeybindingBar, {}),
|
|
1211
|
+
/* @__PURE__ */ jsx13(
|
|
1047
1212
|
Header,
|
|
1048
1213
|
{
|
|
1049
1214
|
project: state.currentProject,
|
|
@@ -1054,7 +1219,7 @@ function App({ dataSource }) {
|
|
|
1054
1219
|
layout
|
|
1055
1220
|
}
|
|
1056
1221
|
),
|
|
1057
|
-
state.searchActive && /* @__PURE__ */
|
|
1222
|
+
state.searchActive && /* @__PURE__ */ jsx13(
|
|
1058
1223
|
SearchBar,
|
|
1059
1224
|
{
|
|
1060
1225
|
query: state.searchQuery,
|
|
@@ -1062,41 +1227,44 @@ function App({ dataSource }) {
|
|
|
1062
1227
|
onClose: () => state.setSearchQuery(state.searchQuery)
|
|
1063
1228
|
}
|
|
1064
1229
|
),
|
|
1065
|
-
/* @__PURE__ */
|
|
1066
|
-
/* @__PURE__ */
|
|
1230
|
+
/* @__PURE__ */ jsxs13(Box13, { flexDirection: isNarrow ? "column" : "row", height: isNarrow ? void 0 : contentHeight, children: [
|
|
1231
|
+
/* @__PURE__ */ jsx13(Box13, { width: isNarrow ? "100%" : "60%", children: /* @__PURE__ */ jsx13(
|
|
1067
1232
|
MemoryList,
|
|
1068
1233
|
{
|
|
1069
1234
|
memories: state.filteredMemories,
|
|
1070
1235
|
selectedIndex: state.selectedIndex,
|
|
1071
1236
|
isFocused: state.focusedPane === "list",
|
|
1072
|
-
height:
|
|
1237
|
+
height: listHeight
|
|
1073
1238
|
}
|
|
1074
1239
|
) }),
|
|
1075
|
-
/* @__PURE__ */
|
|
1076
|
-
!isNarrow && /* @__PURE__ */
|
|
1240
|
+
/* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", width: isNarrow ? "100%" : "40%", children: [
|
|
1241
|
+
!isNarrow && /* @__PURE__ */ jsx13(
|
|
1077
1242
|
ProjectList,
|
|
1078
1243
|
{
|
|
1079
1244
|
memories: state.filteredMemories,
|
|
1080
1245
|
activeProject: state.currentProject,
|
|
1081
|
-
isFocused: state.focusedPane === "projects"
|
|
1246
|
+
isFocused: state.focusedPane === "projects",
|
|
1247
|
+
height: projectListHeight
|
|
1082
1248
|
}
|
|
1083
1249
|
),
|
|
1084
|
-
/* @__PURE__ */
|
|
1250
|
+
/* @__PURE__ */ jsx13(
|
|
1085
1251
|
MemoryDetail,
|
|
1086
1252
|
{
|
|
1087
1253
|
memory: state.selectedMemory,
|
|
1088
1254
|
relations: state.relations,
|
|
1089
|
-
isFocused: state.focusedPane === "detail"
|
|
1255
|
+
isFocused: state.focusedPane === "detail",
|
|
1256
|
+
height: detailHeight,
|
|
1257
|
+
width: rightWidth
|
|
1090
1258
|
}
|
|
1091
1259
|
)
|
|
1092
1260
|
] })
|
|
1093
1261
|
] }),
|
|
1094
|
-
/* @__PURE__ */
|
|
1262
|
+
/* @__PURE__ */ jsx13(StatsBar, { stats: state.stats, visible: state.filteredMemories })
|
|
1095
1263
|
] });
|
|
1096
1264
|
}
|
|
1097
1265
|
|
|
1098
1266
|
// src/commands/memory/dashboard/tui.tsx
|
|
1099
|
-
import { jsx as
|
|
1267
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1100
1268
|
async function startTui(options) {
|
|
1101
1269
|
const config = loadConfig(
|
|
1102
1270
|
options?.dbPath ? { dataDir: options.dbPath } : void 0
|
|
@@ -1115,7 +1283,7 @@ async function startTui(options) {
|
|
|
1115
1283
|
);
|
|
1116
1284
|
let shuttingDown = false;
|
|
1117
1285
|
const { waitUntilExit, unmount } = render(
|
|
1118
|
-
/* @__PURE__ */
|
|
1286
|
+
/* @__PURE__ */ jsx14(App, { dataSource })
|
|
1119
1287
|
);
|
|
1120
1288
|
function shutdown() {
|
|
1121
1289
|
if (shuttingDown) return;
|
|
@@ -1138,4 +1306,4 @@ async function startTui(options) {
|
|
|
1138
1306
|
export {
|
|
1139
1307
|
startTui
|
|
1140
1308
|
};
|
|
1141
|
-
//# sourceMappingURL=tui-
|
|
1309
|
+
//# sourceMappingURL=tui-74FMIMUM.js.map
|