coding-friend-cli 1.21.0 → 1.21.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/dist/index.js CHANGED
@@ -100,43 +100,43 @@ Memory subcommands:
100
100
  memory mcp Show MCP server setup instructions`
101
101
  );
102
102
  memory.command("status").description("Show memory system status").action(async () => {
103
- const { memoryStatusCommand } = await import("./memory-PDENAODU.js");
103
+ const { memoryStatusCommand } = await import("./memory-27ZSRPM7.js");
104
104
  await memoryStatusCommand();
105
105
  });
106
106
  memory.command("search").description("Search memories by query").argument("<query>", "search query").action(async (query) => {
107
- const { memorySearchCommand } = await import("./memory-PDENAODU.js");
107
+ const { memorySearchCommand } = await import("./memory-27ZSRPM7.js");
108
108
  await memorySearchCommand(query);
109
109
  });
110
110
  memory.command("list").description(
111
111
  "List memories in current project, or all projects with --projects"
112
112
  ).option("--projects", "List all project databases with size and metadata").action(async (opts) => {
113
- const { memoryListCommand } = await import("./memory-PDENAODU.js");
113
+ const { memoryListCommand } = await import("./memory-27ZSRPM7.js");
114
114
  await memoryListCommand(opts);
115
115
  });
116
116
  memory.command("init").description(
117
117
  "Initialize memory system \u2014 interactive wizard (first time) or config menu"
118
118
  ).action(async () => {
119
- const { memoryInitCommand } = await import("./memory-PDENAODU.js");
119
+ const { memoryInitCommand } = await import("./memory-27ZSRPM7.js");
120
120
  await memoryInitCommand();
121
121
  });
122
122
  memory.command("config").description("Configure memory system settings").action(async () => {
123
- const { memoryConfigCommand } = await import("./memory-PDENAODU.js");
123
+ const { memoryConfigCommand } = await import("./memory-27ZSRPM7.js");
124
124
  await memoryConfigCommand();
125
125
  });
126
126
  memory.command("start-daemon").description("Start the memory daemon (Tier 2 \u2014 MiniSearch)").action(async () => {
127
- const { memoryStartDaemonCommand } = await import("./memory-PDENAODU.js");
127
+ const { memoryStartDaemonCommand } = await import("./memory-27ZSRPM7.js");
128
128
  await memoryStartDaemonCommand();
129
129
  });
130
130
  memory.command("stop-daemon").description("Stop the memory daemon").action(async () => {
131
- const { memoryStopDaemonCommand } = await import("./memory-PDENAODU.js");
131
+ const { memoryStopDaemonCommand } = await import("./memory-27ZSRPM7.js");
132
132
  await memoryStopDaemonCommand();
133
133
  });
134
134
  memory.command("rebuild").description("Rebuild the daemon search index").action(async () => {
135
- const { memoryRebuildCommand } = await import("./memory-PDENAODU.js");
135
+ const { memoryRebuildCommand } = await import("./memory-27ZSRPM7.js");
136
136
  await memoryRebuildCommand();
137
137
  });
138
138
  memory.command("mcp").description("Show MCP server setup instructions").action(async () => {
139
- const { memoryMcpCommand } = await import("./memory-PDENAODU.js");
139
+ const { memoryMcpCommand } = await import("./memory-27ZSRPM7.js");
140
140
  await memoryMcpCommand();
141
141
  });
142
142
  memory.command("rm").description("Remove a project database").option("--project-id <id>", "Project ID to remove").option("--all", "Remove all project databases").option(
@@ -144,7 +144,7 @@ memory.command("rm").description("Remove a project database").option("--project-
144
144
  "Remove orphaned projects (source dir missing or 0 memories)"
145
145
  ).action(
146
146
  async (opts) => {
147
- const { memoryRmCommand } = await import("./memory-PDENAODU.js");
147
+ const { memoryRmCommand } = await import("./memory-27ZSRPM7.js");
148
148
  await memoryRmCommand(opts);
149
149
  }
150
150
  );
@@ -346,6 +346,29 @@ function getDbPath(memoryDir) {
346
346
  }
347
347
  }
348
348
  var em = chalk.hex("#10b981");
349
+ async function ensureSqliteDepsIfNeeded(mcpDir) {
350
+ const config = loadConfig();
351
+ const tier = config.memory?.tier ?? "auto";
352
+ if (tier === "markdown" || tier === "lite") return true;
353
+ const { ensureDeps, areSqliteDepsAvailable } = await import(join(mcpDir, "dist/lib/lazy-install.js"));
354
+ if (areSqliteDepsAvailable()) return true;
355
+ log.step("Installing SQLite dependencies...");
356
+ const installed = await ensureDeps({
357
+ onProgress: (msg) => log.step(msg)
358
+ });
359
+ if (!installed) {
360
+ log.error("Failed to install SQLite dependencies.");
361
+ log.dim(
362
+ "Ensure you have a C++ compiler installed (Xcode CLT on macOS, build-essential on Linux)."
363
+ );
364
+ log.dim(
365
+ 'Memory will fall back to a lower tier. You can retry later with "cf memory init".'
366
+ );
367
+ return false;
368
+ }
369
+ log.success("Dependencies installed.");
370
+ return true;
371
+ }
349
372
  async function memoryInitCommand() {
350
373
  const memoryDir = getMemoryDir();
351
374
  const mcpDir = getLibPath("cf-memory");
@@ -359,6 +382,7 @@ async function memoryInitCommand() {
359
382
  log.dim('To re-import memories, run "cf memory rebuild".');
360
383
  console.log();
361
384
  await memoryConfigMenu({ exitLabel: "Done" });
385
+ await ensureSqliteDepsIfNeeded(mcpDir);
362
386
  return;
363
387
  }
364
388
  console.log();
@@ -414,26 +438,8 @@ async function memoryInitCommand() {
414
438
  );
415
439
  return;
416
440
  }
417
- log.step("Installing SQLite dependencies...");
418
- const { ensureDeps, areSqliteDepsAvailable } = await import(join(mcpDir, "dist/lib/lazy-install.js"));
419
- if (areSqliteDepsAvailable()) {
420
- log.info("SQLite dependencies already installed.");
421
- } else {
422
- const installed = await ensureDeps({
423
- onProgress: (msg) => log.step(msg)
424
- });
425
- if (!installed) {
426
- log.error("Failed to install SQLite dependencies.");
427
- log.dim(
428
- "Ensure you have a C++ compiler installed (Xcode CLT on macOS, build-essential on Linux)."
429
- );
430
- log.dim(
431
- 'Memory will fall back to a lower tier. You can retry later with "cf memory init".'
432
- );
433
- return;
434
- }
435
- log.success("Dependencies installed.");
436
- }
441
+ const depsOk = await ensureSqliteDepsIfNeeded(mcpDir);
442
+ if (!depsOk) return;
437
443
  if (!existsSync(memoryDir)) {
438
444
  log.info(
439
445
  "No memory directory found. Memories will be indexed as they're created."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coding-friend-cli",
3
- "version": "1.21.0",
3
+ "version": "1.21.1",
4
4
  "description": "CLI for coding-friend — host learning docs, setup MCP server, initialize projects",
5
5
  "type": "module",
6
6
  "bin": {