coding-friend-cli 1.36.4 → 1.38.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.
Files changed (71) hide show
  1. package/README.md +8 -3
  2. package/dist/{chunk-GZT3YPAP.js → chunk-32UAW3NX.js} +1 -1
  3. package/dist/chunk-5QCGEPQO.js +238 -0
  4. package/dist/{chunk-YIXAQ4R2.js → chunk-6NXZKAOV.js} +1 -1
  5. package/dist/{chunk-XHP3EBR3.js → chunk-776ZY62N.js} +112 -4
  6. package/dist/{chunk-N4WZWRCI.js → chunk-BXSCYGWE.js} +85 -37
  7. package/dist/{chunk-AK6RMCAC.js → chunk-CGEMETKQ.js} +44 -30
  8. package/dist/{chunk-XEKQW4RN.js → chunk-ETTZRJ55.js} +1 -1
  9. package/dist/{chunk-IKLMHJH6.js → chunk-GIH6E7GJ.js} +62 -1
  10. package/dist/{chunk-56YJWGAN.js → chunk-ONG4KRYP.js} +60 -47
  11. package/dist/{chunk-X2H7JJMR.js → chunk-PLSJW7QJ.js} +29 -1
  12. package/dist/{chunk-O5ZKLFSL.js → chunk-RCE4OWNX.js} +1 -1
  13. package/dist/{chunk-K4WSC62G.js → chunk-RFNKPAJW.js} +42 -2
  14. package/dist/{clean-Q4VU662V.js → clean-YWEMYDE5.js} +3 -2
  15. package/dist/{config-CTTHWJH5.js → config-NG7SICM4.js} +15 -27
  16. package/dist/{dev-IGHMMEP4.js → dev-PTBNMKZT.js} +3 -3
  17. package/dist/{disable-HL5OEURT.js → disable-MO7AXYYF.js} +20 -3
  18. package/dist/{enable-CZIOCKKJ.js → enable-4GXLQEHD.js} +20 -3
  19. package/dist/{guide-CO2V4ZLZ.js → guide-HCR43LJN.js} +1 -1
  20. package/dist/{host-NCJMUSME.js → host-EV6QIVTI.js} +3 -3
  21. package/dist/index.js +62 -48
  22. package/dist/{init-UABKVDVT.js → init-KYE5CJMW.js} +135 -17
  23. package/dist/{install-R2HDM3N4.js → install-XAFQY5YF.js} +80 -5
  24. package/dist/{learn-K64AUUFB.js → learn-MC4VDHZH.js} +2 -2
  25. package/dist/{mcp-OMQFSJP4.js → mcp-FV6YX3ZT.js} +24 -24
  26. package/dist/{mcp-serve-3FEPFVVQ.js → mcp-serve-PXREYQRZ.js} +10 -1
  27. package/dist/{mcp-serve-learn-OF3ZJUJC.js → mcp-serve-learn-UVXIDOEZ.js} +1 -1
  28. package/dist/{memory-Y6GNALG3.js → memory-DF7OUOTV.js} +7 -7
  29. package/dist/{permission-I3OFJUYA.js → permission-VISPGMUK.js} +38 -4
  30. package/dist/{permissions-J46VP6US.js → permissions-2SBACQHV.js} +2 -2
  31. package/dist/{session-Q2DLQPYP.js → session-QK6OZO3X.js} +3 -2
  32. package/dist/{status-ML4XEDYL.js → status-FVFTJ6GS.js} +18 -14
  33. package/dist/{statusline-KKFJPTI7.js → statusline-AOZHEQSV.js} +2 -2
  34. package/dist/{uninstall-ASLHT3MH.js → uninstall-MF6FRUBO.js} +64 -3
  35. package/dist/{update-DIOH45TE.js → update-QNUCSDSA.js} +7 -4
  36. package/dist/{update-check-25SCLHZO.js → update-check-7LKJLJPM.js} +1 -1
  37. package/lib/cf-memory/src/backends/sqlite/index.ts +142 -85
  38. package/lib/cf-memory/src/lib/claude-md.ts +82 -70
  39. package/lib/cf-memory/src/lib/status-frame.ts +2 -2
  40. package/lib/cf-memory/src/tools/delete.ts +1 -1
  41. package/lib/cf-memory/src/tools/store.ts +6 -6
  42. package/lib/cf-memory/src/tools/update.ts +5 -11
  43. package/package.json +32 -4
  44. package/lib/cf-memory/README.md +0 -317
  45. package/lib/cf-memory/src/__tests__/claude-md.test.ts +0 -343
  46. package/lib/cf-memory/src/__tests__/daemon-client.test.ts +0 -146
  47. package/lib/cf-memory/src/__tests__/daemon-e2e.test.ts +0 -223
  48. package/lib/cf-memory/src/__tests__/daemon.test.ts +0 -407
  49. package/lib/cf-memory/src/__tests__/dedup.test.ts +0 -103
  50. package/lib/cf-memory/src/__tests__/embeddings.test.ts +0 -292
  51. package/lib/cf-memory/src/__tests__/lazy-install.test.ts +0 -210
  52. package/lib/cf-memory/src/__tests__/markdown-backend.test.ts +0 -450
  53. package/lib/cf-memory/src/__tests__/migration.test.ts +0 -255
  54. package/lib/cf-memory/src/__tests__/migrations.test.ts +0 -288
  55. package/lib/cf-memory/src/__tests__/minisearch-backend.test.ts +0 -262
  56. package/lib/cf-memory/src/__tests__/ollama.test.ts +0 -48
  57. package/lib/cf-memory/src/__tests__/project-id.test.ts +0 -43
  58. package/lib/cf-memory/src/__tests__/schema.test.ts +0 -128
  59. package/lib/cf-memory/src/__tests__/search.test.ts +0 -115
  60. package/lib/cf-memory/src/__tests__/status-frame.test.ts +0 -136
  61. package/lib/cf-memory/src/__tests__/temporal-decay.test.ts +0 -54
  62. package/lib/cf-memory/src/__tests__/tier.test.ts +0 -367
  63. package/lib/cf-memory/src/__tests__/tools.test.ts +0 -83
  64. package/lib/cf-memory/vitest.config.ts +0 -7
  65. package/lib/learn-host/.prettierignore +0 -4
  66. package/lib/learn-host/.prettierrc +0 -8
  67. package/lib/learn-host/README.md +0 -113
  68. package/lib/learn-host/eslint.config.mjs +0 -6
  69. package/lib/learn-mcp/README.md +0 -187
  70. package/lib/learn-mcp/src/__tests__/docs.test.ts +0 -117
  71. package/lib/learn-mcp/vitest.config.ts +0 -8
@@ -1,22 +1,32 @@
1
1
  import {
2
2
  getLatestVersion,
3
3
  semverCompare
4
- } from "./chunk-XHP3EBR3.js";
4
+ } from "./chunk-776ZY62N.js";
5
5
  import {
6
6
  getInstalledVersion
7
- } from "./chunk-XEKQW4RN.js";
7
+ } from "./chunk-ETTZRJ55.js";
8
8
  import "./chunk-3WIZA5OZ.js";
9
9
  import {
10
10
  ensureShellCompletion
11
11
  } from "./chunk-667NMPN4.js";
12
+ import "./chunk-BXSCYGWE.js";
13
+ import "./chunk-RZRT7NGT.js";
12
14
  import {
13
15
  enableMarketplaceAutoUpdate,
14
16
  isMarketplaceRegistered,
15
17
  isPluginDisabled
16
- } from "./chunk-GZT3YPAP.js";
18
+ } from "./chunk-32UAW3NX.js";
17
19
  import {
20
+ deployCodexAgents,
21
+ findCodexAgentSourceDir,
22
+ isCodexMarketplaceRegistered,
23
+ setCodexPluginEnabled
24
+ } from "./chunk-5QCGEPQO.js";
25
+ import {
26
+ checkCodexVersion,
27
+ resolveHostFlags,
18
28
  resolveScope
19
- } from "./chunk-IKLMHJH6.js";
29
+ } from "./chunk-GIH6E7GJ.js";
20
30
  import {
21
31
  commandExists,
22
32
  run
@@ -24,7 +34,7 @@ import {
24
34
  import "./chunk-5UVDWG5L.js";
25
35
  import {
26
36
  devStatePath
27
- } from "./chunk-X2H7JJMR.js";
37
+ } from "./chunk-PLSJW7QJ.js";
28
38
  import {
29
39
  log,
30
40
  printBanner
@@ -34,6 +44,11 @@ import {
34
44
  import { existsSync } from "fs";
35
45
  import chalk from "chalk";
36
46
  async function installCommand(opts = {}) {
47
+ const { host } = resolveHostFlags(opts);
48
+ if (host === "codex") {
49
+ await installCodexCommand();
50
+ return;
51
+ }
37
52
  printBanner("\u2728 Coding Friend Install \u2728");
38
53
  console.log();
39
54
  if (!commandExists("claude")) {
@@ -41,6 +56,7 @@ async function installCommand(opts = {}) {
41
56
  "Claude CLI not found. Install it first: https://docs.anthropic.com/en/docs/claude-code/getting-started"
42
57
  );
43
58
  process.exit(1);
59
+ return;
44
60
  }
45
61
  if (existsSync(devStatePath())) {
46
62
  log.warn("Dev mode is currently active.");
@@ -130,6 +146,65 @@ async function installCommand(opts = {}) {
130
146
  console.log();
131
147
  log.dim("Restart Claude Code (or start a new session) to use the plugin.");
132
148
  }
149
+ async function installCodexCommand() {
150
+ printBanner("\u2728 Coding Friend Codex Install \u2728");
151
+ console.log();
152
+ if (!commandExists("codex")) {
153
+ log.error(
154
+ "Codex CLI not found. Install it first: https://developers.openai.com/codex"
155
+ );
156
+ process.exit(1);
157
+ return;
158
+ }
159
+ const version = checkCodexVersion();
160
+ if (!version.ok) {
161
+ log.error(
162
+ `Codex CLI ${version.actual ? `v${version.actual}` : "version"} is unsupported. Coding Friend requires Codex CLI >= ${version.min}.`
163
+ );
164
+ log.dim("Upgrade Codex, then rerun: cf install --agent codex");
165
+ process.exit(1);
166
+ return;
167
+ }
168
+ if (isCodexMarketplaceRegistered()) {
169
+ log.success("Codex marketplace already registered.");
170
+ } else {
171
+ log.step("Adding coding-friend Codex marketplace...");
172
+ const result = run("codex", [
173
+ "plugin",
174
+ "marketplace",
175
+ "add",
176
+ "dinhanhthi/coding-friend"
177
+ ]);
178
+ if (result === null && !isCodexMarketplaceRegistered()) {
179
+ log.error(
180
+ "Failed to add Codex marketplace. Try manually: codex plugin marketplace add dinhanhthi/coding-friend"
181
+ );
182
+ process.exit(1);
183
+ return;
184
+ }
185
+ log.success("Codex marketplace registered.");
186
+ }
187
+ setCodexPluginEnabled(true);
188
+ log.success("Codex plugin enablement recorded in ~/.codex/config.toml.");
189
+ const agentSource = findCodexAgentSourceDir();
190
+ if (agentSource) {
191
+ const copied = deployCodexAgents(agentSource);
192
+ log.success(`Deployed ${copied} Codex agent definition(s).`);
193
+ } else {
194
+ log.warn(
195
+ "Codex agent TOMLs were not found locally yet. Install the plugin from Codex, then run cf init --agent codex to deploy project agents."
196
+ );
197
+ }
198
+ console.log();
199
+ log.info("One manual Codex step remains:");
200
+ console.log(
201
+ ` ${chalk.cyan("codex")} \u2192 ${chalk.cyan("/plugins")} \u2192 install ${chalk.bold("coding-friend")}`
202
+ );
203
+ log.dim(
204
+ "Codex CLI v0.130.0 exposes marketplace registration but not scriptable plugin install."
205
+ );
206
+ log.dim("Run cf update --agent codex for on-demand plugin updates.");
207
+ }
133
208
  export {
134
209
  installCommand
135
210
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveLearnDir
3
- } from "./chunk-K4WSC62G.js";
3
+ } from "./chunk-RFNKPAJW.js";
4
4
  import "./chunk-3WIZA5OZ.js";
5
5
  import {
6
6
  commandExists,
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-5UVDWG5L.js";
14
14
  import {
15
15
  globalConfigPath
16
- } from "./chunk-X2H7JJMR.js";
16
+ } from "./chunk-PLSJW7QJ.js";
17
17
  import {
18
18
  log,
19
19
  printBanner
@@ -4,31 +4,31 @@ import {
4
4
  import {
5
5
  isLearnMcpRegistered,
6
6
  registerLearnMcp
7
- } from "./chunk-YIXAQ4R2.js";
7
+ } from "./chunk-6NXZKAOV.js";
8
8
  import {
9
9
  ensureMemoryBuilt,
10
10
  printMemoryMcpConfig
11
- } from "./chunk-AK6RMCAC.js";
11
+ } from "./chunk-CGEMETKQ.js";
12
12
  import {
13
13
  checkLearnMcpHealth,
14
14
  checkMemoryMcpHealth,
15
15
  detectMemoryMcpState,
16
16
  printHealthSection,
17
17
  warnStaleMcpJson
18
- } from "./chunk-56YJWGAN.js";
19
- import {
20
- getMemoryMcpStatus,
21
- writeMemoryMcpEntry
22
- } from "./chunk-N4WZWRCI.js";
18
+ } from "./chunk-ONG4KRYP.js";
23
19
  import {
24
20
  resolveLearnDir,
25
21
  resolveMemoryDir
26
- } from "./chunk-K4WSC62G.js";
22
+ } from "./chunk-RFNKPAJW.js";
23
+ import "./chunk-3WIZA5OZ.js";
24
+ import {
25
+ isMemoryMcpRegistered,
26
+ registerMemoryMcp
27
+ } from "./chunk-BXSCYGWE.js";
27
28
  import {
28
29
  getLibPath
29
30
  } from "./chunk-RZRT7NGT.js";
30
- import "./chunk-3WIZA5OZ.js";
31
- import "./chunk-IKLMHJH6.js";
31
+ import "./chunk-GIH6E7GJ.js";
32
32
  import {
33
33
  run
34
34
  } from "./chunk-EVGXUDX4.js";
@@ -37,19 +37,18 @@ import {
37
37
  } from "./chunk-5UVDWG5L.js";
38
38
  import {
39
39
  globalConfigPath
40
- } from "./chunk-X2H7JJMR.js";
40
+ } from "./chunk-PLSJW7QJ.js";
41
41
  import {
42
42
  log,
43
43
  printBanner
44
44
  } from "./chunk-NREZK463.js";
45
45
 
46
46
  // src/commands/mcp.ts
47
- import { confirm } from "@inquirer/prompts";
48
47
  import { existsSync } from "fs";
49
48
  import { join } from "path";
50
49
  import chalk from "chalk";
51
50
  async function mcpCommand() {
52
- warnStaleMcpJson(resolveMemoryDir());
51
+ warnStaleMcpJson();
53
52
  const globalCfg = readJson(globalConfigPath());
54
53
  const learnDir = resolveLearnDir(globalCfg);
55
54
  const learnMcpDir = getLibPath("learn-mcp");
@@ -124,17 +123,17 @@ async function mcpCommand() {
124
123
  learnMcpDistPath
125
124
  });
126
125
  printHealthSection(learnHealth);
127
- const memoryMcpStatus = getMemoryMcpStatus();
128
- if (memoryMcpStatus.configured) {
129
- log.dim("coding-friend-memory: already in .mcp.json");
126
+ if (isMemoryMcpRegistered()) {
127
+ log.dim("coding-friend-memory: already registered (user scope)");
128
+ log.dim(
129
+ " (If it points to an old path, run: claude mcp remove --scope user coding-friend-memory && cf mcp)"
130
+ );
130
131
  } else {
131
- const addMemoryMcp = await confirm({
132
- message: "coding-friend-memory not found in this project's .mcp.json. Add it now? (project-scoped \u2014 writes to .mcp.json)",
133
- default: true
134
- });
135
- if (addMemoryMcp) {
136
- const memoryDir = resolveMemoryDir();
137
- writeMemoryMcpEntry(memoryDir);
132
+ const registered = registerMemoryMcp();
133
+ if (registered) {
134
+ log.success(
135
+ "Registered coding-friend-memory (user scope). Restart Claude Code to activate."
136
+ );
138
137
  }
139
138
  }
140
139
  console.log();
@@ -169,7 +168,8 @@ async function printMemoryMcp() {
169
168
  readMcpJson: () => readJson(localMcpPath),
170
169
  pathExists: existsSync,
171
170
  isDaemonRunning,
172
- memoryDistPath
171
+ memoryDistPath,
172
+ isRegistered: isMemoryMcpRegistered
173
173
  });
174
174
  printHealthSection(memoryHealth);
175
175
  }
@@ -1,6 +1,13 @@
1
+ import {
2
+ resolveProjectMemoryDir
3
+ } from "./chunk-RFNKPAJW.js";
4
+ import "./chunk-3WIZA5OZ.js";
1
5
  import {
2
6
  getLibPath
3
7
  } from "./chunk-RZRT7NGT.js";
8
+ import "./chunk-EVGXUDX4.js";
9
+ import "./chunk-5UVDWG5L.js";
10
+ import "./chunk-PLSJW7QJ.js";
4
11
  import {
5
12
  log
6
13
  } from "./chunk-NREZK463.js";
@@ -9,9 +16,11 @@ import {
9
16
  import { spawn } from "child_process";
10
17
  import { join } from "path";
11
18
  async function mcpServeCommand(memoryDir) {
19
+ const resolvedDir = memoryDir ?? resolveProjectMemoryDir(process.env.CLAUDE_PROJECT_DIR ?? process.cwd());
20
+ log.dim(`memory dir: ${resolvedDir}`);
12
21
  const mcpDir = getLibPath("cf-memory");
13
22
  const serverPath = join(mcpDir, "dist", "index.js");
14
- const child = spawn("node", [serverPath, memoryDir], {
23
+ const child = spawn("node", [serverPath, resolvedDir], {
15
24
  stdio: "inherit"
16
25
  });
17
26
  child.on("error", (err) => {
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-5UVDWG5L.js";
10
10
  import {
11
11
  globalConfigPath
12
- } from "./chunk-X2H7JJMR.js";
12
+ } from "./chunk-PLSJW7QJ.js";
13
13
  import {
14
14
  log
15
15
  } from "./chunk-NREZK463.js";
@@ -14,16 +14,16 @@ import {
14
14
  memoryStopDaemonCommand,
15
15
  printMemoryMcpConfig,
16
16
  refreshMemoryAfterUpdate
17
- } from "./chunk-AK6RMCAC.js";
18
- import "./chunk-56YJWGAN.js";
19
- import "./chunk-N4WZWRCI.js";
20
- import "./chunk-K4WSC62G.js";
21
- import "./chunk-RZRT7NGT.js";
17
+ } from "./chunk-CGEMETKQ.js";
18
+ import "./chunk-ONG4KRYP.js";
19
+ import "./chunk-RFNKPAJW.js";
22
20
  import "./chunk-3WIZA5OZ.js";
23
- import "./chunk-IKLMHJH6.js";
21
+ import "./chunk-BXSCYGWE.js";
22
+ import "./chunk-RZRT7NGT.js";
23
+ import "./chunk-GIH6E7GJ.js";
24
24
  import "./chunk-EVGXUDX4.js";
25
25
  import "./chunk-5UVDWG5L.js";
26
- import "./chunk-X2H7JJMR.js";
26
+ import "./chunk-PLSJW7QJ.js";
27
27
  import "./chunk-NREZK463.js";
28
28
  export {
29
29
  ensureMemoryBuilt,
@@ -8,13 +8,14 @@ import {
8
8
  groupByCategory,
9
9
  logPluginScriptWarning,
10
10
  runDangerousRulesAudit
11
- } from "./chunk-O5ZKLFSL.js";
11
+ } from "./chunk-RCE4OWNX.js";
12
12
  import {
13
13
  askScope,
14
14
  formatScopeLabel,
15
15
  getMergedValue,
16
- getScopeLabel
17
- } from "./chunk-IKLMHJH6.js";
16
+ getScopeLabel,
17
+ resolveHostFlags
18
+ } from "./chunk-GIH6E7GJ.js";
18
19
  import "./chunk-EVGXUDX4.js";
19
20
  import {
20
21
  mergeJson,
@@ -26,7 +27,7 @@ import {
26
27
  claudeSettingsPath,
27
28
  globalConfigPath,
28
29
  localConfigPath
29
- } from "./chunk-X2H7JJMR.js";
30
+ } from "./chunk-PLSJW7QJ.js";
30
31
  import {
31
32
  log,
32
33
  printBanner
@@ -212,6 +213,11 @@ async function autoApproveFlow() {
212
213
  }
213
214
  }
214
215
  async function permissionCommand(opts) {
216
+ const { host } = resolveHostFlags(opts);
217
+ if (host === "codex") {
218
+ codexPermissionCommand(opts);
219
+ return;
220
+ }
215
221
  printBanner("\u2728 Coding Friend Permissions \u2728");
216
222
  console.log();
217
223
  const {
@@ -303,6 +309,34 @@ async function permissionCommand(opts) {
303
309
  `Done \u2014 added ${toAdd.length}, removed ${toRemove.length} rules in ${settingsLabel}.`
304
310
  );
305
311
  }
312
+ function codexPermissionCommand(opts) {
313
+ printBanner("\u2728 Coding Friend Codex Permissions \u2728");
314
+ console.log();
315
+ if (opts.enableAutoApprove && opts.disableAutoApprove) {
316
+ log.error(
317
+ "Use only one Codex auto-approve flag: --enable-auto-approve or --disable-auto-approve."
318
+ );
319
+ process.exit(1);
320
+ return;
321
+ }
322
+ const nextValue = opts.enableAutoApprove ? true : opts.disableAutoApprove ? false : void 0;
323
+ if (nextValue === void 0) {
324
+ const cfg = readJson(localConfigPath());
325
+ const current = cfg?.autoApproveCodex === true;
326
+ log.info(`Codex auto-approve is ${current ? "enabled" : "disabled"}.`);
327
+ log.dim(
328
+ "Use --enable-auto-approve or --disable-auto-approve to change it."
329
+ );
330
+ return;
331
+ }
332
+ mergeJson(localConfigPath(), { autoApproveCodex: nextValue });
333
+ log.success(
334
+ `Codex auto-approve ${nextValue ? "enabled" : "disabled"} in .coding-friend/config.json.`
335
+ );
336
+ log.dim(
337
+ "Codex v1 auto-approve is deterministic-only; unknown actions defer to Codex native approval."
338
+ );
339
+ }
306
340
  export {
307
341
  permissionCommand
308
342
  };
@@ -15,9 +15,9 @@ import {
15
15
  logPluginScriptWarning,
16
16
  runDangerousRulesAudit,
17
17
  stripDangerousRules
18
- } from "./chunk-O5ZKLFSL.js";
18
+ } from "./chunk-RCE4OWNX.js";
19
19
  import "./chunk-5UVDWG5L.js";
20
- import "./chunk-X2H7JJMR.js";
20
+ import "./chunk-PLSJW7QJ.js";
21
21
  export {
22
22
  DANGEROUS_RULE_PATTERNS,
23
23
  PERMISSION_RULES,
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  loadConfig
3
- } from "./chunk-K4WSC62G.js";
3
+ } from "./chunk-RFNKPAJW.js";
4
4
  import "./chunk-3WIZA5OZ.js";
5
+ import "./chunk-EVGXUDX4.js";
5
6
  import {
6
7
  readJson,
7
8
  writeJson
@@ -10,7 +11,7 @@ import {
10
11
  claudeSessionDir,
11
12
  encodeProjectPath,
12
13
  resolvePath
13
- } from "./chunk-X2H7JJMR.js";
14
+ } from "./chunk-PLSJW7QJ.js";
14
15
  import {
15
16
  log
16
17
  } from "./chunk-NREZK463.js";
@@ -1,41 +1,44 @@
1
1
  import {
2
2
  getExistingRules
3
- } from "./chunk-O5ZKLFSL.js";
3
+ } from "./chunk-RCE4OWNX.js";
4
4
  import {
5
5
  listMdFilesRecursive
6
6
  } from "./chunk-2DTXVMPQ.js";
7
7
  import {
8
8
  isLearnMcpRegistered
9
- } from "./chunk-YIXAQ4R2.js";
9
+ } from "./chunk-6NXZKAOV.js";
10
10
  import {
11
11
  checkLearnMcpHealth,
12
12
  checkMemoryMcpHealth
13
- } from "./chunk-56YJWGAN.js";
14
- import "./chunk-N4WZWRCI.js";
13
+ } from "./chunk-ONG4KRYP.js";
15
14
  import {
16
15
  resolveLearnDir,
17
16
  resolveMemoryDir,
18
17
  sanitizeRawConfig
19
- } from "./chunk-K4WSC62G.js";
20
- import {
21
- getLibPath
22
- } from "./chunk-RZRT7NGT.js";
18
+ } from "./chunk-RFNKPAJW.js";
23
19
  import {
24
20
  getCliVersion,
25
21
  getLatestCliVersion,
26
22
  getLatestVersion,
27
23
  semverCompare
28
- } from "./chunk-XHP3EBR3.js";
24
+ } from "./chunk-776ZY62N.js";
29
25
  import {
30
26
  getInstalledVersion
31
- } from "./chunk-XEKQW4RN.js";
27
+ } from "./chunk-ETTZRJ55.js";
32
28
  import "./chunk-3WIZA5OZ.js";
33
29
  import "./chunk-667NMPN4.js";
30
+ import {
31
+ isMemoryMcpRegistered
32
+ } from "./chunk-BXSCYGWE.js";
33
+ import {
34
+ getLibPath
35
+ } from "./chunk-RZRT7NGT.js";
34
36
  import {
35
37
  detectPluginScope,
36
38
  isPluginDisabled
37
- } from "./chunk-GZT3YPAP.js";
38
- import "./chunk-IKLMHJH6.js";
39
+ } from "./chunk-32UAW3NX.js";
40
+ import "./chunk-5QCGEPQO.js";
41
+ import "./chunk-GIH6E7GJ.js";
39
42
  import "./chunk-EVGXUDX4.js";
40
43
  import {
41
44
  readJson
@@ -45,7 +48,7 @@ import {
45
48
  devStatePath,
46
49
  globalConfigPath,
47
50
  localConfigPath
48
- } from "./chunk-X2H7JJMR.js";
51
+ } from "./chunk-PLSJW7QJ.js";
49
52
  import "./chunk-NREZK463.js";
50
53
 
51
54
  // src/commands/status.ts
@@ -250,7 +253,8 @@ async function statusCommand() {
250
253
  readMcpJson: () => readJson(localMcpPath),
251
254
  pathExists: existsSync,
252
255
  isDaemonRunning: memIsDaemonRunning,
253
- memoryDistPath
256
+ memoryDistPath,
257
+ isRegistered: isMemoryMcpRegistered
254
258
  });
255
259
  let memHasIssues = false;
256
260
  for (const check of memHealth.checks) {
@@ -8,7 +8,7 @@ import {
8
8
  saveStatuslineConfig,
9
9
  selectStatuslineComponents,
10
10
  writeStatuslineSettings
11
- } from "./chunk-XEKQW4RN.js";
11
+ } from "./chunk-ETTZRJ55.js";
12
12
  import {
13
13
  ALL_COMPONENT_IDS
14
14
  } from "./chunk-3WIZA5OZ.js";
@@ -16,7 +16,7 @@ import {
16
16
  commandExists
17
17
  } from "./chunk-EVGXUDX4.js";
18
18
  import "./chunk-5UVDWG5L.js";
19
- import "./chunk-X2H7JJMR.js";
19
+ import "./chunk-PLSJW7QJ.js";
20
20
  import {
21
21
  log,
22
22
  printBanner
@@ -2,13 +2,24 @@ import {
2
2
  hasShellCompletion,
3
3
  removeShellCompletion
4
4
  } from "./chunk-667NMPN4.js";
5
+ import {
6
+ removeMemoryMcpEntry
7
+ } from "./chunk-BXSCYGWE.js";
8
+ import "./chunk-RZRT7NGT.js";
5
9
  import {
6
10
  isMarketplaceRegistered,
7
11
  isPluginInstalled
8
- } from "./chunk-GZT3YPAP.js";
12
+ } from "./chunk-32UAW3NX.js";
13
+ import {
14
+ CODEX_MARKETPLACE_NAME,
15
+ removeCodexMemoryMcpConfig,
16
+ removeDeployedCodexAgents,
17
+ setCodexPluginEnabled
18
+ } from "./chunk-5QCGEPQO.js";
9
19
  import {
20
+ resolveHostFlags,
10
21
  resolveScope
11
- } from "./chunk-IKLMHJH6.js";
22
+ } from "./chunk-GIH6E7GJ.js";
12
23
  import {
13
24
  commandExists,
14
25
  run
@@ -24,7 +35,7 @@ import {
24
35
  marketplaceCachePath,
25
36
  marketplaceClonePath,
26
37
  memoryDepsDir
27
- } from "./chunk-X2H7JJMR.js";
38
+ } from "./chunk-PLSJW7QJ.js";
28
39
  import {
29
40
  log,
30
41
  printBanner
@@ -124,6 +135,11 @@ async function uninstallScoped(scope) {
124
135
  log.dim("Restart Claude Code to complete the uninstall.");
125
136
  }
126
137
  async function uninstallCommand(opts = {}) {
138
+ const { host } = resolveHostFlags(opts);
139
+ if (host === "codex") {
140
+ uninstallCodexCommand(opts);
141
+ return;
142
+ }
127
143
  console.log();
128
144
  printBanner("\u{1F44B} Coding Friend Uninstall \u{1F44B}", { color: chalk.red });
129
145
  if (!commandExists("claude")) {
@@ -144,6 +160,16 @@ async function uninstallCommand(opts = {}) {
144
160
  );
145
161
  if (scope === "project" || scope === "local") {
146
162
  await uninstallScoped(scope);
163
+ if (scope === "project") {
164
+ const migrationResult = removeMemoryMcpEntry();
165
+ if (migrationResult.removed) {
166
+ if (migrationResult.fileDeleted) {
167
+ log.success("Removed legacy project-scope coding-friend-memory from .mcp.json (file deleted \u2014 was empty).");
168
+ } else {
169
+ log.success("Removed legacy project-scope coding-friend-memory from .mcp.json");
170
+ }
171
+ }
172
+ }
147
173
  return;
148
174
  }
149
175
  const detection = detect();
@@ -281,6 +307,41 @@ async function uninstallCommand(opts = {}) {
281
307
  log.dim("To also remove the CLI tool globally, run:");
282
308
  console.log(` ${chalk.bold("npm uninstall -g coding-friend-cli")}`);
283
309
  }
310
+ function uninstallCodexCommand(opts) {
311
+ console.log();
312
+ printBanner("\u{1F44B} Coding Friend Codex Uninstall \u{1F44B}", { color: chalk.red });
313
+ setCodexPluginEnabled(false);
314
+ log.success("Disabled coding-friend in ~/.codex/config.toml.");
315
+ const removedAgents = removeDeployedCodexAgents();
316
+ if (removedAgents > 0) {
317
+ log.success(
318
+ `Removed ${removedAgents} deployed Coding Friend agent definition(s) from ~/.codex/agents/.`
319
+ );
320
+ }
321
+ if (removeCodexMemoryMcpConfig()) {
322
+ log.success(
323
+ "Removed coding-friend-memory registration from ~/.codex/config.toml."
324
+ );
325
+ }
326
+ if (opts.removeMarketplace) {
327
+ if (!commandExists("codex")) {
328
+ log.warn("Codex CLI not found; could not remove marketplace via CLI.");
329
+ } else {
330
+ const result = run("codex", [
331
+ "plugin",
332
+ "marketplace",
333
+ "remove",
334
+ CODEX_MARKETPLACE_NAME
335
+ ]);
336
+ if (result === null) {
337
+ log.warn("Could not remove Codex marketplace registration.");
338
+ } else {
339
+ log.success("Removed Codex marketplace registration.");
340
+ }
341
+ }
342
+ }
343
+ log.dim("Restart Codex CLI for the change to take effect.");
344
+ }
284
345
  export {
285
346
  uninstallCommand
286
347
  };
@@ -4,14 +4,17 @@ import {
4
4
  getLatestVersion,
5
5
  semverCompare,
6
6
  updateCommand
7
- } from "./chunk-XHP3EBR3.js";
8
- import "./chunk-XEKQW4RN.js";
7
+ } from "./chunk-776ZY62N.js";
8
+ import "./chunk-ETTZRJ55.js";
9
9
  import "./chunk-3WIZA5OZ.js";
10
10
  import "./chunk-667NMPN4.js";
11
- import "./chunk-IKLMHJH6.js";
11
+ import "./chunk-BXSCYGWE.js";
12
+ import "./chunk-RZRT7NGT.js";
13
+ import "./chunk-5QCGEPQO.js";
14
+ import "./chunk-GIH6E7GJ.js";
12
15
  import "./chunk-EVGXUDX4.js";
13
16
  import "./chunk-5UVDWG5L.js";
14
- import "./chunk-X2H7JJMR.js";
17
+ import "./chunk-PLSJW7QJ.js";
15
18
  import "./chunk-NREZK463.js";
16
19
  export {
17
20
  getCliVersion,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-EVGXUDX4.js";
4
4
  import {
5
5
  globalConfigDir
6
- } from "./chunk-X2H7JJMR.js";
6
+ } from "./chunk-PLSJW7QJ.js";
7
7
  import {
8
8
  log
9
9
  } from "./chunk-NREZK463.js";