claude-launchpad 1.7.2 → 1.8.1
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 -1
- package/dist/{chunk-XL4ZMHA7.js → chunk-COGKNJJB.js} +14 -20
- package/dist/chunk-COGKNJJB.js.map +1 -0
- package/dist/{chunk-XJZZJEXT.js → chunk-H2E7QMF4.js} +2 -2
- package/dist/{chunk-UHZ2B7BE.js → chunk-IY3Z54UK.js} +166 -117
- package/dist/chunk-IY3Z54UK.js.map +1 -0
- package/dist/{chunk-N4GESFQC.js → chunk-RDID5P4K.js} +2 -2
- package/dist/{chunk-VLB5TDFF.js → chunk-THDBKJAV.js} +3 -3
- package/dist/cli.js +124 -32
- package/dist/cli.js.map +1 -1
- package/dist/commands/memory/server.js +3 -3
- package/dist/{context-USZJ232G.js → context-BCTOCTZD.js} +5 -5
- package/dist/{install-FUXDR2HU.js → install-L23C4YWJ.js} +58 -5
- package/dist/install-L23C4YWJ.js.map +1 -0
- package/dist/{pull-IZB5D5FC.js → pull-5KYLJ6TH.js} +7 -7
- package/dist/{push-IUNXSJZ5.js → push-UOVLT5HO.js} +7 -7
- package/dist/{require-deps-Z3CV2I3V.js → require-deps-T2QOGQQ3.js} +3 -3
- package/dist/{stats-FMKE3T6J.js → stats-GL7P24U7.js} +6 -6
- package/dist/{sync-clean-33V4VWRI.js → sync-clean-7RNYS7EH.js} +3 -3
- package/dist/{sync-status-5GMPSUQF.js → sync-status-ULZCMBQJ.js} +14 -9
- package/dist/sync-status-ULZCMBQJ.js.map +1 -0
- package/dist/{tui-7YXGNXCP.js → tui-UGBWF2WT.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-UHZ2B7BE.js.map +0 -1
- package/dist/chunk-XL4ZMHA7.js.map +0 -1
- package/dist/install-FUXDR2HU.js.map +0 -1
- package/dist/sync-status-5GMPSUQF.js.map +0 -1
- /package/dist/{chunk-XJZZJEXT.js.map → chunk-H2E7QMF4.js.map} +0 -0
- /package/dist/{chunk-N4GESFQC.js.map → chunk-RDID5P4K.js.map} +0 -0
- /package/dist/{chunk-VLB5TDFF.js.map → chunk-THDBKJAV.js.map} +0 -0
- /package/dist/{context-USZJ232G.js.map → context-BCTOCTZD.js.map} +0 -0
- /package/dist/{pull-IZB5D5FC.js.map → pull-5KYLJ6TH.js.map} +0 -0
- /package/dist/{push-IUNXSJZ5.js.map → push-UOVLT5HO.js.map} +0 -0
- /package/dist/{require-deps-Z3CV2I3V.js.map → require-deps-T2QOGQQ3.js.map} +0 -0
- /package/dist/{stats-FMKE3T6J.js.map → stats-GL7P24U7.js.map} +0 -0
- /package/dist/{sync-clean-33V4VWRI.js.map → sync-clean-7RNYS7EH.js.map} +0 -0
- /package/dist/{tui-7YXGNXCP.js.map → tui-UGBWF2WT.js.map} +0 -0
|
@@ -26,9 +26,9 @@ import {
|
|
|
26
26
|
loadConfig,
|
|
27
27
|
migrate,
|
|
28
28
|
resolveDataDir
|
|
29
|
-
} from "../../chunk-
|
|
30
|
-
import "../../chunk-
|
|
31
|
-
import "../../chunk-
|
|
29
|
+
} from "../../chunk-THDBKJAV.js";
|
|
30
|
+
import "../../chunk-H2E7QMF4.js";
|
|
31
|
+
import "../../chunk-IY3Z54UK.js";
|
|
32
32
|
|
|
33
33
|
// src/commands/memory/server.ts
|
|
34
34
|
import { createRequire } from "module";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-NAW47BYA.js";
|
|
11
11
|
import {
|
|
12
12
|
initStorage
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-RDID5P4K.js";
|
|
14
14
|
import "./chunk-DXDOVWOA.js";
|
|
15
15
|
import {
|
|
16
16
|
DEFAULT_DECAY_PARAMS,
|
|
@@ -28,9 +28,9 @@ import {
|
|
|
28
28
|
RECENCY_HALF_LIFE,
|
|
29
29
|
TYPE_INJECTION_BONUS,
|
|
30
30
|
estimateTokens
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
31
|
+
} from "./chunk-THDBKJAV.js";
|
|
32
|
+
import "./chunk-H2E7QMF4.js";
|
|
33
|
+
import "./chunk-IY3Z54UK.js";
|
|
34
34
|
|
|
35
35
|
// src/commands/memory/subcommands/context.ts
|
|
36
36
|
import { readFileSync, writeFileSync } from "fs";
|
|
@@ -503,4 +503,4 @@ async function runContext(opts) {
|
|
|
503
503
|
export {
|
|
504
504
|
runContext
|
|
505
505
|
};
|
|
506
|
-
//# sourceMappingURL=context-
|
|
506
|
+
//# sourceMappingURL=context-BCTOCTZD.js.map
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
loadConfig,
|
|
6
6
|
migrate,
|
|
7
7
|
resolveDataDir
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-THDBKJAV.js";
|
|
9
|
+
import "./chunk-H2E7QMF4.js";
|
|
10
10
|
import {
|
|
11
11
|
getMemoryPlacement,
|
|
12
12
|
log,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
readSettingsLocalJson,
|
|
15
15
|
writeSettingsJson,
|
|
16
16
|
writeSettingsLocalJson
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-IY3Z54UK.js";
|
|
18
18
|
|
|
19
19
|
// src/commands/memory/subcommands/install.ts
|
|
20
20
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -28,10 +28,41 @@ function isGhAuthenticated() {
|
|
|
28
28
|
return false;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
+
function isClaudeCliOnPath() {
|
|
32
|
+
try {
|
|
33
|
+
execSync("claude --version", { stdio: "pipe", timeout: 5e3 });
|
|
34
|
+
return true;
|
|
35
|
+
} catch {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function isGhOnPath() {
|
|
40
|
+
try {
|
|
41
|
+
execSync("gh --version", { stdio: "pipe", timeout: 5e3 });
|
|
42
|
+
return true;
|
|
43
|
+
} catch {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function preflight() {
|
|
48
|
+
if (!isClaudeCliOnPath()) {
|
|
49
|
+
log.error("The `claude` CLI was not found on PATH.");
|
|
50
|
+
log.blank();
|
|
51
|
+
log.info("The knowledge base installs as a Claude Code MCP server, so the CLI is required.");
|
|
52
|
+
log.info("Install: https://docs.claude.com/en/docs/claude-code");
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
if (!isGhOnPath()) {
|
|
56
|
+
log.warn("The GitHub CLI (`gh`) was not found on PATH \u2014 cross-device memory sync will be disabled.");
|
|
57
|
+
log.info("Install later for sync: https://cli.github.com/ then `gh auth login`.");
|
|
58
|
+
log.blank();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
31
61
|
async function runInstall(opts) {
|
|
32
62
|
log.blank();
|
|
33
63
|
log.step("Setting up your knowledge base");
|
|
34
64
|
log.blank();
|
|
65
|
+
preflight();
|
|
35
66
|
await ensureNativeDeps();
|
|
36
67
|
const placement = await getMemoryPlacement(process.cwd());
|
|
37
68
|
const config = loadConfig(opts.dbPath ? { dataDir: opts.dbPath } : void 0);
|
|
@@ -48,6 +79,7 @@ async function runInstall(opts) {
|
|
|
48
79
|
await configureSettings(process.cwd(), placement);
|
|
49
80
|
log.step("[3/5] Enabling memory tools...");
|
|
50
81
|
const mcpScope = placement === "local" ? "local" : "project";
|
|
82
|
+
await ensureAllowedMcpServerIncludesMemory(process.cwd(), placement);
|
|
51
83
|
const registered = registerMcpServer(mcpScope);
|
|
52
84
|
if (registered) {
|
|
53
85
|
log.success("Memory tools available in Claude Code");
|
|
@@ -97,6 +129,9 @@ async function configureSettings(projectDir, placement) {
|
|
|
97
129
|
const read = placement === "local" ? readSettingsLocalJson : readSettingsJson;
|
|
98
130
|
const write = placement === "local" ? writeSettingsLocalJson : writeSettingsJson;
|
|
99
131
|
const settings = await read(projectDir);
|
|
132
|
+
if (settings === null) {
|
|
133
|
+
throw new Error("settings.json is unreadable; repair or remove it before installing memory.");
|
|
134
|
+
}
|
|
100
135
|
log.info("Built-in auto-memory disabled (replaced by knowledge base)");
|
|
101
136
|
const baseHooks = settings["hooks"] ?? {};
|
|
102
137
|
const withPull = addSessionStartPullHook(baseHooks);
|
|
@@ -181,7 +216,7 @@ function addToolPermissions(settings) {
|
|
|
181
216
|
};
|
|
182
217
|
}
|
|
183
218
|
async function ensureNativeDeps() {
|
|
184
|
-
const { cwdRequire } = await import("./require-deps-
|
|
219
|
+
const { cwdRequire } = await import("./require-deps-T2QOGQQ3.js");
|
|
185
220
|
try {
|
|
186
221
|
cwdRequire("better-sqlite3");
|
|
187
222
|
return;
|
|
@@ -201,6 +236,24 @@ async function ensureNativeDeps() {
|
|
|
201
236
|
process.exit(1);
|
|
202
237
|
}
|
|
203
238
|
}
|
|
239
|
+
async function ensureAllowedMcpServerIncludesMemory(projectDir, placement) {
|
|
240
|
+
const read = placement === "local" ? readSettingsLocalJson : readSettingsJson;
|
|
241
|
+
const write = placement === "local" ? writeSettingsLocalJson : writeSettingsJson;
|
|
242
|
+
const settings = await read(projectDir);
|
|
243
|
+
if (settings === null) return;
|
|
244
|
+
const existing = settings.allowedMcpServers;
|
|
245
|
+
if (!Array.isArray(existing)) return;
|
|
246
|
+
const list = existing;
|
|
247
|
+
const hasMemory = list.some((e) => e && typeof e === "object" && e.serverName === "agentic-memory");
|
|
248
|
+
if (hasMemory) return;
|
|
249
|
+
const updated = {
|
|
250
|
+
...settings,
|
|
251
|
+
allowedMcpServers: [{ serverName: "agentic-memory" }, ...list]
|
|
252
|
+
};
|
|
253
|
+
await write(projectDir, updated);
|
|
254
|
+
const target = placement === "local" ? "settings.local.json" : "settings.json";
|
|
255
|
+
log.info(`Added agentic-memory to allowedMcpServers in ${target}`);
|
|
256
|
+
}
|
|
204
257
|
function registerMcpServer(scope) {
|
|
205
258
|
try {
|
|
206
259
|
const existing = execSync("claude mcp list", { stdio: "pipe", timeout: 1e4, encoding: "utf-8" });
|
|
@@ -308,4 +361,4 @@ export {
|
|
|
308
361
|
detectExistingSetup,
|
|
309
362
|
runInstall
|
|
310
363
|
};
|
|
311
|
-
//# sourceMappingURL=install-
|
|
364
|
+
//# sourceMappingURL=install-L23C4YWJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/memory/subcommands/install.ts"],"sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { execSync } from 'node:child_process';\nimport { createDatabase, closeDatabase } from '../storage/database.js';\nimport { migrate } from '../storage/migrator.js';\nimport { loadConfig, resolveDataDir } from '../config.js';\nimport { readSettingsJson, writeSettingsJson, readSettingsLocalJson, writeSettingsLocalJson } from '../../../lib/settings.js';\nimport { getMemoryPlacement } from '../../../lib/memory-placement.js';\nimport { log } from '../../../lib/output.js';\nimport type { MemoryPlacement } from '../../../types/index.js';\n\nfunction isGhAuthenticated(): boolean {\n try {\n execSync('gh auth status', { stdio: 'pipe', timeout: 5000 });\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isClaudeCliOnPath(): boolean {\n try {\n execSync('claude --version', { stdio: 'pipe', timeout: 5000 });\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isGhOnPath(): boolean {\n try {\n execSync('gh --version', { stdio: 'pipe', timeout: 5000 });\n return true;\n } catch {\n return false;\n }\n}\n\nfunction preflight(): void {\n if (!isClaudeCliOnPath()) {\n log.error('The `claude` CLI was not found on PATH.');\n log.blank();\n log.info('The knowledge base installs as a Claude Code MCP server, so the CLI is required.');\n log.info('Install: https://docs.claude.com/en/docs/claude-code');\n process.exit(1);\n }\n if (!isGhOnPath()) {\n log.warn('The GitHub CLI (`gh`) was not found on PATH — cross-device memory sync will be disabled.');\n log.info('Install later for sync: https://cli.github.com/ then `gh auth login`.');\n log.blank();\n }\n}\n\ninterface InstallOpts {\n readonly dbPath?: string;\n}\n\nexport async function runInstall(opts: InstallOpts): Promise<void> {\n log.blank();\n log.step('Setting up your knowledge base');\n log.blank();\n\n // Preflight: `claude` CLI is hard-required; `gh` is a soft warning for sync.\n preflight();\n\n // Step 0: Ensure native deps are installed globally\n await ensureNativeDeps();\n\n // Prompt for placement before any config writes\n const placement = await getMemoryPlacement(process.cwd());\n\n const config = loadConfig(opts.dbPath ? { dataDir: opts.dbPath } : undefined);\n const dataDir = resolveDataDir(config.dataDir);\n\n // Step 1: Database\n log.step('[1/5] Creating knowledge base...');\n if (!existsSync(dataDir)) {\n mkdirSync(dataDir, { recursive: true });\n }\n const db = createDatabase({ dataDir });\n migrate(db);\n closeDatabase(db);\n log.success(`Knowledge base created at ${dataDir}/memory.db`);\n\n // Step 2: Configure Claude Code settings\n log.step('[2/5] Connecting to Claude Code...');\n await configureSettings(process.cwd(), placement);\n\n // Step 3: Register MCP server (project scope for shared, local scope for local)\n log.step('[3/5] Enabling memory tools...');\n const mcpScope = placement === \"local\" ? \"local\" : \"project\";\n // Must run BEFORE `claude mcp add` — otherwise the add silently fails with \"not allowed by policy\"\n await ensureAllowedMcpServerIncludesMemory(process.cwd(), placement);\n const registered = registerMcpServer(mcpScope);\n if (registered) {\n log.success('Memory tools available in Claude Code');\n } else {\n log.warn('Could not enable memory tools automatically.');\n log.info(`Run: claude mcp add --scope ${mcpScope} agentic-memory -- npx claude-launchpad memory serve`);\n }\n\n // Step 4: CLAUDE.md + skills\n log.step('[4/5] Adding instructions...');\n const guidanceAdded = injectClaudeMdGuidance(process.cwd(), placement);\n if (guidanceAdded) {\n const label = placement === \"local\" ? \".claude/CLAUDE.md\" : \"CLAUDE.md\";\n log.success(`${label} updated with memory instructions`);\n }\n if (placement === \"shared\") {\n const skillsInstalled = installSkills(process.cwd());\n if (skillsInstalled > 0) {\n log.success(`Installed ${skillsInstalled} skill(s) to .claude/skills/`);\n }\n }\n\n log.blank();\n log.success('Knowledge base is ready. Claude will now remember across sessions.');\n log.info('Restart your Claude Code session to activate.');\n\n // Sync guidance\n if (isGhAuthenticated()) {\n log.info('Cross-device sync available. Run `memory push` to back up, or it auto-syncs each session.');\n } else {\n log.blank();\n log.info('Recommended: install the GitHub CLI for cross-device memory sync:');\n log.step(' https://cli.github.com/');\n log.step(' gh auth login');\n }\n log.blank();\n}\n\nexport function detectExistingSetup(projectDir: string): MemoryPlacement | null {\n // Check local CLAUDE.md\n try {\n const localClaude = readFileSync(join(projectDir, '.claude', 'CLAUDE.md'), 'utf-8');\n if (localClaude.includes('## Memory') || localClaude.includes('agentic-memory')) return \"local\";\n } catch { /* not found */ }\n\n // Check root CLAUDE.md\n try {\n const rootClaude = readFileSync(join(projectDir, 'CLAUDE.md'), 'utf-8');\n if (rootClaude.includes('## Memory (agentic-memory)')) return \"shared\";\n } catch { /* not found */ }\n\n return null;\n}\n\nasync function configureSettings(projectDir: string, placement: MemoryPlacement): Promise<void> {\n const read = placement === \"local\" ? readSettingsLocalJson : readSettingsJson;\n const write = placement === \"local\" ? writeSettingsLocalJson : writeSettingsJson;\n const settings = await read(projectDir);\n if (settings === null) {\n throw new Error(\"settings.json is unreadable; repair or remove it before installing memory.\");\n }\n\n // Disable built-in auto-memory\n log.info('Built-in auto-memory disabled (replaced by knowledge base)');\n\n // Build hooks immutably — always add sync hooks (they fail silently without gh)\n const baseHooks = (settings['hooks'] ?? {}) as Record<string, unknown[]>;\n const withPull = addSessionStartPullHook(baseHooks);\n const withContext = addSessionStartHook(withPull);\n const withPush = addSessionEndPushHook(withContext);\n\n // Build permissions immutably\n const withPermissions = addToolPermissions(settings);\n\n const updated = {\n ...withPermissions,\n autoMemoryEnabled: false,\n hooks: withPush,\n };\n\n await write(projectDir, updated);\n const target = placement === \"local\" ? \"settings.local.json\" : \"settings.json\";\n log.success(`Claude Code configured in ${target}`);\n}\n\nfunction addSessionStartPullHook(hooks: Record<string, unknown[]>): Record<string, unknown[]> {\n const sessionStartHooks = (hooks['SessionStart'] ?? []) as Record<string, unknown>[];\n const alreadyHooked = sessionStartHooks.some((h) => {\n const innerHooks = h['hooks'] as Record<string, unknown>[] | undefined;\n return innerHooks?.some(\n ih => typeof ih['command'] === 'string' && (ih['command'] as string).includes('memory pull'),\n );\n });\n\n if (alreadyHooked) return hooks;\n\n // Insert at the beginning so pull runs before context injection\n const entry = {\n matcher: 'startup',\n hooks: [{ type: 'command', command: 'claude-launchpad memory pull -y 2>/dev/null; exit 0' }],\n };\n log.info('Session start: memories will auto-pull from GitHub Gist');\n return { ...hooks, SessionStart: [entry, ...sessionStartHooks] };\n}\n\nfunction addSessionStartHook(hooks: Record<string, unknown[]>): Record<string, unknown[]> {\n const sessionStartHooks = (hooks['SessionStart'] ?? []) as Record<string, unknown>[];\n const hookCommand = 'npx claude-launchpad memory context --json 2>/dev/null; exit 0';\n\n const alreadyHooked = sessionStartHooks.some((h) => {\n const innerHooks = h['hooks'] as Record<string, unknown>[] | undefined;\n return innerHooks?.some(\n ih => typeof ih['command'] === 'string' && (ih['command'] as string).includes('claude-launchpad memory context'),\n );\n });\n\n if (alreadyHooked) return hooks;\n\n const entry = {\n matcher: 'startup|resume',\n hooks: [{ type: 'command', command: hookCommand }],\n };\n log.info('Session start: Claude will recall relevant context automatically');\n return { ...hooks, SessionStart: [...sessionStartHooks, entry] };\n}\n\nfunction addSessionEndPushHook(hooks: Record<string, unknown[]>): Record<string, unknown[]> {\n const sessionEndHooks = (hooks['SessionEnd'] ?? []) as Record<string, unknown>[];\n const alreadyHooked = sessionEndHooks.some((h) => {\n const innerHooks = h['hooks'] as Record<string, unknown>[] | undefined;\n return innerHooks?.some(\n ih => typeof ih['command'] === 'string' && (ih['command'] as string).includes('memory push'),\n );\n });\n\n if (alreadyHooked) return hooks;\n\n const entry = {\n hooks: [{ type: 'command', command: 'nohup claude-launchpad memory push -y </dev/null >/dev/null 2>&1 & exit 0' }],\n };\n log.info('Session end: memories will auto-push to GitHub Gist');\n return { ...hooks, SessionEnd: [...sessionEndHooks, entry] };\n}\n\nfunction addToolPermissions(settings: Record<string, unknown>): Record<string, unknown> {\n const permissions = (settings['permissions'] ?? {}) as Record<string, unknown>;\n const allowList = (permissions['allow'] ?? []) as readonly string[];\n\n const memoryTools = [\n 'mcp__agentic-memory__memory_store',\n 'mcp__agentic-memory__memory_search',\n 'mcp__agentic-memory__memory_recent',\n 'mcp__agentic-memory__memory_forget',\n 'mcp__agentic-memory__memory_relate',\n 'mcp__agentic-memory__memory_stats',\n 'mcp__agentic-memory__memory_update',\n ];\n\n const missing = memoryTools.filter((t) => !allowList.includes(t));\n if (missing.length === 0) return settings;\n\n log.info(`${missing.length} memory tools auto-approved`);\n return {\n ...settings,\n permissions: { ...permissions, allow: [...allowList, ...missing] },\n };\n}\n\nasync function ensureNativeDeps(): Promise<void> {\n const { cwdRequire } = await import('../utils/require-deps.js');\n try {\n cwdRequire('better-sqlite3');\n return;\n } catch {\n // Not installed — install globally\n }\n\n log.step('Installing required database libraries...');\n try {\n execSync('npm install -g better-sqlite3 sqlite-vec', { stdio: 'pipe', timeout: 120000 });\n log.success('Database libraries installed');\n } catch {\n log.error('Could not install database libraries automatically.');\n log.blank();\n log.info('Install manually:');\n log.step(' npm install -g better-sqlite3 sqlite-vec');\n log.blank();\n log.info('Requires a C++ compiler (Xcode on macOS, build-essential on Linux).');\n process.exit(1);\n }\n}\n\nasync function ensureAllowedMcpServerIncludesMemory(\n projectDir: string,\n placement: MemoryPlacement,\n): Promise<void> {\n const read = placement === \"local\" ? readSettingsLocalJson : readSettingsJson;\n const write = placement === \"local\" ? writeSettingsLocalJson : writeSettingsJson;\n const settings = await read(projectDir);\n if (settings === null) return;\n const existing = settings.allowedMcpServers as unknown;\n // No allowlist configured — nothing to patch; Claude Code trusts any added server by default.\n if (!Array.isArray(existing)) return;\n\n const list = existing as Array<{ serverName?: unknown }>;\n const hasMemory = list.some((e) => e && typeof e === \"object\" && e.serverName === \"agentic-memory\");\n if (hasMemory) return;\n\n const updated = {\n ...settings,\n allowedMcpServers: [{ serverName: \"agentic-memory\" }, ...list],\n };\n await write(projectDir, updated);\n const target = placement === \"local\" ? \"settings.local.json\" : \"settings.json\";\n log.info(`Added agentic-memory to allowedMcpServers in ${target}`);\n}\n\nfunction registerMcpServer(scope: \"project\" | \"local\"): boolean {\n try {\n const existing = execSync('claude mcp list', { stdio: 'pipe', timeout: 10000, encoding: 'utf-8' });\n if (existing.includes('agentic-memory')) {\n log.info('Memory tools already registered');\n return true;\n }\n execSync(\n `claude mcp add --scope ${scope} agentic-memory -- npx claude-launchpad memory serve`,\n { stdio: 'pipe', timeout: 10000 },\n );\n return true;\n } catch {\n return false;\n }\n}\n\nconst MEMORY_GUIDANCE = `\n## Memory (agentic-memory)\nThis project uses **agentic-memory** for persistent memory across sessions.\n- **DO NOT** use the built-in auto-memory system (~/.claude/projects/*/memory/)\n- Memory context is **automatically injected** at session start via SessionStart hook - no need to call memory_recent manually\n- Use \\`memory_search\\` to find specific memories by keyword\n- Use \\`memory_store\\` to save decisions, gotchas, and learnings worth remembering\n- Use \\`memory_stats\\` to check memory health\n- **STORE IMMEDIATELY** when: a dependency strategy changes, an architecture decision is made, a convention is established, a bug pattern is discovered, or a feature is killed/added\n`;\n\nfunction injectClaudeMdGuidance(projectDir: string, placement: MemoryPlacement): boolean {\n const claudeMdPath = placement === \"local\"\n ? join(projectDir, '.claude', 'CLAUDE.md')\n : join(projectDir, 'CLAUDE.md');\n\n let content = '';\n try {\n content = readFileSync(claudeMdPath, 'utf-8');\n } catch {\n if (placement !== \"local\") return false;\n // Create local .claude/CLAUDE.md\n mkdirSync(join(projectDir, '.claude'), { recursive: true });\n content = '# Local Claude Config\\n';\n }\n\n if (content.includes('## Memory (agentic-memory)')) {\n return false;\n }\n\n const updated = content.trimEnd() + '\\n' + MEMORY_GUIDANCE;\n writeFileSync(claudeMdPath, updated, 'utf-8');\n return true;\n}\n\nconst MIGRATE_MEMORY_SKILL = `---\nname: lp-migrate-memory\ndescription: Migrate legacy Claude Code auto-memory files (~/.claude/projects/*/memory/*.md) into agentic-memory. Use when setting up agentic-memory on a project that already has built-in memories.\nallowed-tools: Read, Glob, Grep, mcp__agentic-memory__memory_store, mcp__agentic-memory__memory_search\n---\n\n# Migrate Legacy Claude Code Memories\n\nMigrate memory files from Claude Code's built-in auto-memory system into agentic-memory.\n\n## Steps\n\n1. **Find legacy memory files** for this project:\n - Scan \\`~/.claude/projects/*/memory/*.md\\` for directories whose slug matches the current project path\n - The slug format is the absolute path with \\`/\\` replaced by \\`-\\` and leading \\`-\\` (e.g. \\`-Users-john-projects-myapp\\`)\n - Also check \\`~/.claude/projects/*/memory/team/*.md\\` for team memories\n\n2. **For each memory file found**, read it and parse:\n - YAML frontmatter: \\`name\\`, \\`description\\`, \\`type\\` (user/feedback/project/reference)\n - Body content (everything after the frontmatter closing \\`---\\`)\n - Skip \\`MEMORY.md\\` (it's just an index file, not a memory)\n\n3. **Before storing**, check for duplicates:\n - Call \\`memory_search\\` with the memory description or first 100 chars of content\n - If a close match exists (same topic), skip it and report\n\n4. **Map types and store** each memory via \\`memory_store\\`:\n - \\`user\\` -> type: \\`semantic\\`, tags: [\\`user\\`, \\`migrated\\`], importance: 0.7\n - \\`feedback\\` -> type: \\`semantic\\`, tags: [\\`feedback\\`, \\`migrated\\`], importance: 0.8\n - \\`project\\` -> type: \\`semantic\\`, tags: [\\`project\\`, \\`migrated\\`], importance: 0.6\n - \\`reference\\` -> type: \\`semantic\\`, tags: [\\`reference\\`, \\`migrated\\`], importance: 0.5\n - Use the frontmatter \\`name\\` as the title\n - Use the body content as the memory content\n - Set source: \\`import\\`\n - Adjust importance up/down based on the content (decisions and gotchas deserve higher importance)\n\n5. **Report results**: list what was migrated, what was skipped (duplicates), and what failed\n\n## Important\n\n- Do NOT delete the original files - the user can do that manually after verifying\n- Do NOT migrate content that is purely derived from code (architecture, file structure) - it belongs in CLAUDE.md, not memory\n- If unsure about a memory's value, migrate it anyway - the decay system will naturally prune low-value memories over time\n`;\n\nconst SKILLS: Readonly<Record<string, string>> = {\n 'lp-migrate-memory': MIGRATE_MEMORY_SKILL,\n};\n\nfunction installSkills(projectDir: string): number {\n const skillsDir = join(projectDir, '.claude', 'skills');\n let installed = 0;\n\n for (const [name, content] of Object.entries(SKILLS)) {\n const skillDir = join(skillsDir, name);\n const skillPath = join(skillDir, 'SKILL.md');\n\n if (existsSync(skillPath)) continue;\n\n mkdirSync(skillDir, { recursive: true });\n writeFileSync(skillPath, content.trimStart(), 'utf-8');\n installed++;\n }\n\n return installed;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,WAAW,cAAc,qBAAqB;AACnE,SAAS,YAAY;AACrB,SAAS,gBAAgB;AASzB,SAAS,oBAA6B;AACpC,MAAI;AACF,aAAS,kBAAkB,EAAE,OAAO,QAAQ,SAAS,IAAK,CAAC;AAC3D,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,oBAA6B;AACpC,MAAI;AACF,aAAS,oBAAoB,EAAE,OAAO,QAAQ,SAAS,IAAK,CAAC;AAC7D,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,aAAsB;AAC7B,MAAI;AACF,aAAS,gBAAgB,EAAE,OAAO,QAAQ,SAAS,IAAK,CAAC;AACzD,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,YAAkB;AACzB,MAAI,CAAC,kBAAkB,GAAG;AACxB,QAAI,MAAM,yCAAyC;AACnD,QAAI,MAAM;AACV,QAAI,KAAK,kFAAkF;AAC3F,QAAI,KAAK,sDAAsD;AAC/D,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,MAAI,CAAC,WAAW,GAAG;AACjB,QAAI,KAAK,+FAA0F;AACnG,QAAI,KAAK,uEAAuE;AAChF,QAAI,MAAM;AAAA,EACZ;AACF;AAMA,eAAsB,WAAW,MAAkC;AACjE,MAAI,MAAM;AACV,MAAI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AQ;AACN,QAAI,cAAc,QAAS,QAAO;AAElC,cAAU,KAAK,YAAY,SAAS,GAAG,EAAE,WAAW,KAAK,CAAC;AAC1D,cAAU;AAAA,EACZ;AAEA,MAAI,QAAQ,SAAS,4BAA4B,GAAG;AAClD,WAAO;AAAA,EACT;AAEA,QAAM,UAAU,QAAQ,QAAQ,IAAI,OAAO;AAC3C,gBAAc,cAAc,SAAS,OAAO;AAC5C,SAAO;AACT;AAEA,IAAM,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6C7B,IAAM,SAA2C;AAAA,EAC/C,qBAAqB;AACvB;AAEA,SAAS,cAAc,YAA4B;AACjD,QAAM,YAAY,KAAK,YAAY,WAAW,QAAQ;AACtD,MAAI,YAAY;AAEhB,aAAW,CAAC,MAAM,OAAO,KAAK,OAAO,QAAQ,MAAM,GAAG;AACpD,UAAM,WAAW,KAAK,WAAW,IAAI;AACrC,UAAM,YAAY,KAAK,UAAU,UAAU;AAE3C,QAAI,WAAW,SAAS,EAAG;AAE3B,cAAU,UAAU,EAAE,WAAW,KAAK,CAAC;AACvC,kBAAc,WAAW,QAAQ,UAAU,GAAG,OAAO;AACrD;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -10,20 +10,20 @@ import {
|
|
|
10
10
|
loadSyncConfig,
|
|
11
11
|
projectToFilename,
|
|
12
12
|
readGistFile
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-COGKNJJB.js";
|
|
14
14
|
import "./chunk-YZ53W47Z.js";
|
|
15
15
|
import {
|
|
16
16
|
detectProject
|
|
17
17
|
} from "./chunk-NAW47BYA.js";
|
|
18
18
|
import {
|
|
19
19
|
initStorage
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-RDID5P4K.js";
|
|
21
21
|
import "./chunk-DXDOVWOA.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-THDBKJAV.js";
|
|
23
|
+
import "./chunk-H2E7QMF4.js";
|
|
24
24
|
import {
|
|
25
25
|
log
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-IY3Z54UK.js";
|
|
27
27
|
|
|
28
28
|
// src/commands/memory/subcommands/pull.ts
|
|
29
29
|
async function runPull(opts) {
|
|
@@ -33,7 +33,7 @@ async function runPull(opts) {
|
|
|
33
33
|
log.error("No sync gist found. Run `memory push` first.");
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
const { requireMemoryDeps } = await import("./require-deps-
|
|
36
|
+
const { requireMemoryDeps } = await import("./require-deps-T2QOGQQ3.js");
|
|
37
37
|
await requireMemoryDeps();
|
|
38
38
|
const ctx = initStorage();
|
|
39
39
|
try {
|
|
@@ -137,4 +137,4 @@ function printResult(result, project) {
|
|
|
137
137
|
export {
|
|
138
138
|
runPull
|
|
139
139
|
};
|
|
140
|
-
//# sourceMappingURL=pull-
|
|
140
|
+
//# sourceMappingURL=pull-5KYLJ6TH.js.map
|
|
@@ -12,20 +12,20 @@ import {
|
|
|
12
12
|
projectToFilename,
|
|
13
13
|
readGistFile,
|
|
14
14
|
updateGistFiles
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-COGKNJJB.js";
|
|
16
16
|
import "./chunk-YZ53W47Z.js";
|
|
17
17
|
import {
|
|
18
18
|
detectProject
|
|
19
19
|
} from "./chunk-NAW47BYA.js";
|
|
20
20
|
import {
|
|
21
21
|
initStorage
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-RDID5P4K.js";
|
|
23
23
|
import "./chunk-DXDOVWOA.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-THDBKJAV.js";
|
|
25
|
+
import "./chunk-H2E7QMF4.js";
|
|
26
26
|
import {
|
|
27
27
|
log
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-IY3Z54UK.js";
|
|
29
29
|
|
|
30
30
|
// src/commands/memory/subcommands/push.ts
|
|
31
31
|
import { hostname } from "os";
|
|
@@ -50,7 +50,7 @@ function filterRelations(allRelations, memoryIds) {
|
|
|
50
50
|
}
|
|
51
51
|
async function runPush(opts) {
|
|
52
52
|
assertGhAvailable();
|
|
53
|
-
const { requireMemoryDeps } = await import("./require-deps-
|
|
53
|
+
const { requireMemoryDeps } = await import("./require-deps-T2QOGQQ3.js");
|
|
54
54
|
await requireMemoryDeps();
|
|
55
55
|
const ctx = initStorage();
|
|
56
56
|
try {
|
|
@@ -171,4 +171,4 @@ async function confirmCreate() {
|
|
|
171
171
|
export {
|
|
172
172
|
runPush
|
|
173
173
|
};
|
|
174
|
-
//# sourceMappingURL=push-
|
|
174
|
+
//# sourceMappingURL=push-UOVLT5HO.js.map
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
cwdRequire,
|
|
4
4
|
requireMemoryDeps
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-H2E7QMF4.js";
|
|
6
|
+
import "./chunk-IY3Z54UK.js";
|
|
7
7
|
export {
|
|
8
8
|
cwdRequire,
|
|
9
9
|
requireMemoryDeps
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=require-deps-
|
|
11
|
+
//# sourceMappingURL=require-deps-T2QOGQQ3.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
initStorage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RDID5P4K.js";
|
|
5
5
|
import "./chunk-DXDOVWOA.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-THDBKJAV.js";
|
|
7
|
+
import "./chunk-H2E7QMF4.js";
|
|
8
8
|
import {
|
|
9
9
|
log
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IY3Z54UK.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-T2QOGQQ3.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-GL7P24U7.js.map
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
listGistFiles,
|
|
7
7
|
loadSyncConfig,
|
|
8
8
|
projectToFilename
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-COGKNJJB.js";
|
|
10
10
|
import {
|
|
11
11
|
log
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IY3Z54UK.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-7RNYS7EH.js.map
|
|
@@ -8,17 +8,17 @@ import {
|
|
|
8
8
|
listGistFiles,
|
|
9
9
|
loadSyncConfig,
|
|
10
10
|
readGistFile
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-COGKNJJB.js";
|
|
12
12
|
import "./chunk-YZ53W47Z.js";
|
|
13
13
|
import {
|
|
14
14
|
initStorage
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-RDID5P4K.js";
|
|
16
16
|
import "./chunk-DXDOVWOA.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-THDBKJAV.js";
|
|
18
|
+
import "./chunk-H2E7QMF4.js";
|
|
19
19
|
import {
|
|
20
20
|
log
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-IY3Z54UK.js";
|
|
22
22
|
|
|
23
23
|
// src/commands/memory/subcommands/sync-status.ts
|
|
24
24
|
async function runSyncStatus() {
|
|
@@ -28,19 +28,24 @@ 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-T2QOGQQ3.js");
|
|
32
32
|
await requireMemoryDeps();
|
|
33
33
|
const ctx = initStorage();
|
|
34
34
|
try {
|
|
35
35
|
const localCounts = ctx.memoryRepo.projectCounts();
|
|
36
|
+
const localTombstoneIds = new Set(ctx.memoryRepo.getAllTombstones().map((t) => t.id));
|
|
36
37
|
const remoteFiles = listGistFiles(syncConfig.gistId);
|
|
37
|
-
const remoteProjects = remoteFiles.map((f) => filenameToProject(f)).filter((p) => p !== null);
|
|
38
38
|
const remoteCounts = /* @__PURE__ */ new Map();
|
|
39
39
|
for (const file of remoteFiles) {
|
|
40
40
|
const project = filenameToProject(file);
|
|
41
41
|
if (!project) continue;
|
|
42
42
|
const payload = parsePayload(readGistFile(syncConfig.gistId, file));
|
|
43
|
-
|
|
43
|
+
if (!payload) {
|
|
44
|
+
remoteCounts.set(project, 0);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
const mergeable = payload.memories.filter((m) => !localTombstoneIds.has(m.id)).length;
|
|
48
|
+
remoteCounts.set(project, mergeable);
|
|
44
49
|
}
|
|
45
50
|
const allProjects = /* @__PURE__ */ new Set([...localCounts.keys(), ...remoteCounts.keys()]);
|
|
46
51
|
log.blank();
|
|
@@ -67,4 +72,4 @@ async function runSyncStatus() {
|
|
|
67
72
|
export {
|
|
68
73
|
runSyncStatus
|
|
69
74
|
};
|
|
70
|
-
//# sourceMappingURL=sync-status-
|
|
75
|
+
//# sourceMappingURL=sync-status-ULZCMBQJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/memory/subcommands/sync-status.ts"],"sourcesContent":["import { log } from '../../../lib/output.js';\nimport { initStorage } from './init-storage.js';\nimport {\n assertGhAvailable,\n loadSyncConfig,\n listGistFiles,\n filenameToProject,\n readGistFile,\n} from '../utils/gist-transport.js';\nimport { parsePayload } from '../utils/sync-merge.js';\n\nexport async function runSyncStatus(): 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 const localCounts = ctx.memoryRepo.projectCounts();\n const localTombstoneIds = new Set(ctx.memoryRepo.getAllTombstones().map((t) => t.id));\n const remoteFiles = listGistFiles(syncConfig.gistId);\n\n // Cosmetic display only: a local tombstone may still be resurrected by a newer remote\n // updated_at, but mergeFromRemote handles that. Excluding tombstoned ids here keeps\n // the reported delta close to what `pull --all` actually ingests most of the time.\n const remoteCounts = new Map<string, number>();\n for (const file of remoteFiles) {\n const project = filenameToProject(file);\n if (!project) continue;\n const payload = parsePayload(readGistFile(syncConfig.gistId, file));\n if (!payload) {\n remoteCounts.set(project, 0);\n continue;\n }\n const mergeable = payload.memories.filter((m) => !localTombstoneIds.has(m.id)).length;\n remoteCounts.set(project, mergeable);\n }\n\n const allProjects = new Set([...localCounts.keys(), ...remoteCounts.keys()]);\n\n log.blank();\n log.step('Sync status');\n log.info(`Gist: ${syncConfig.gistId}`);\n log.blank();\n\n if (allProjects.size === 0) {\n log.info('No projects found locally or remotely.');\n } else {\n log.info('Project Local Remote');\n log.info('─────────────────────────────── ───── ──────');\n for (const project of [...allProjects].sort()) {\n const local = localCounts.get(project) ?? 0;\n const remote = remoteCounts.get(project) ?? 0;\n const name = project.length > 33 ? project.slice(0, 30) + '...' : project;\n log.info(`${name.padEnd(33)} ${String(local).padStart(5)} ${String(remote).padStart(6)}`);\n }\n }\n log.blank();\n } finally {\n ctx.close();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAWA,eAAsB,gBAA+B;AACnD,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,UAAM,cAAc,IAAI,WAAW,cAAc;AACjD,UAAM,oBAAoB,IAAI,IAAI,IAAI,WAAW,iBAAiB,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;AACpF,UAAM,cAAc,cAAc,WAAW,MAAM;AAKnD,UAAM,eAAe,oBAAI,IAAoB;AAC7C,eAAW,QAAQ,aAAa;AAC9B,YAAM,UAAU,kBAAkB,IAAI;AACtC,UAAI,CAAC,QAAS;AACd,YAAM,UAAU,aAAa,aAAa,WAAW,QAAQ,IAAI,CAAC;AAClE,UAAI,CAAC,SAAS;AACZ,qBAAa,IAAI,SAAS,CAAC;AAC3B;AAAA,MACF;AACA,YAAM,YAAY,QAAQ,SAAS,OAAO,CAAC,MAAM,CAAC,kBAAkB,IAAI,EAAE,EAAE,CAAC,EAAE;AAC/E,mBAAa,IAAI,SAAS,SAAS;AAAA,IACrC;AAEA,UAAM,cAAc,oBAAI,IAAI,CAAC,GAAG,YAAY,KAAK,GAAG,GAAG,aAAa,KAAK,CAAC,CAAC;AAE3E,QAAI,MAAM;AACV,QAAI,KAAK,aAAa;AACtB,QAAI,KAAK,SAAS,WAAW,MAAM,EAAE;AACrC,QAAI,MAAM;AAEV,QAAI,YAAY,SAAS,GAAG;AAC1B,UAAI,KAAK,wCAAwC;AAAA,IACnD,OAAO;AACL,UAAI,KAAK,gDAAgD;AACzD,UAAI,KAAK,kQAAgD;AACzD,iBAAW,WAAW,CAAC,GAAG,WAAW,EAAE,KAAK,GAAG;AAC7C,cAAM,QAAQ,YAAY,IAAI,OAAO,KAAK;AAC1C,cAAM,SAAS,aAAa,IAAI,OAAO,KAAK;AAC5C,cAAM,OAAO,QAAQ,SAAS,KAAK,QAAQ,MAAM,GAAG,EAAE,IAAI,QAAQ;AAClE,YAAI,KAAK,GAAG,KAAK,OAAO,EAAE,CAAC,IAAI,OAAO,KAAK,EAAE,SAAS,CAAC,CAAC,KAAK,OAAO,MAAM,EAAE,SAAS,CAAC,CAAC,EAAE;AAAA,MAC3F;AAAA,IACF;AACA,QAAI,MAAM;AAAA,EACZ,UAAE;AACA,QAAI,MAAM;AAAA,EACZ;AACF;","names":[]}
|
|
@@ -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-THDBKJAV.js";
|
|
15
|
+
import "./chunk-H2E7QMF4.js";
|
|
16
|
+
import "./chunk-IY3Z54UK.js";
|
|
17
17
|
|
|
18
18
|
// src/commands/memory/dashboard/tui.tsx
|
|
19
19
|
import { render } from "ink";
|
|
@@ -1306,4 +1306,4 @@ async function startTui(options) {
|
|
|
1306
1306
|
export {
|
|
1307
1307
|
startTui
|
|
1308
1308
|
};
|
|
1309
|
-
//# sourceMappingURL=tui-
|
|
1309
|
+
//# sourceMappingURL=tui-UGBWF2WT.js.map
|
package/package.json
CHANGED