coding-friend-cli 1.37.0 → 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 +7 -2
  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-676YCW6T.js → chunk-776ZY62N.js} +99 -7
  6. package/dist/{chunk-DP6DFQ4G.js → chunk-BXSCYGWE.js} +2 -2
  7. package/dist/{chunk-W6D3J5DX.js → chunk-CGEMETKQ.js} +8 -6
  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-6S7352JG.js → chunk-ONG4KRYP.js} +1 -1
  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-PI4P34KF.js → chunk-RFNKPAJW.js} +3 -1
  14. package/dist/{clean-WEYQZB34.js → clean-YWEMYDE5.js} +2 -2
  15. package/dist/{config-ZMR2AOBB.js → config-NG7SICM4.js} +12 -24
  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-SSRI4JZV.js → host-EV6QIVTI.js} +2 -2
  21. package/dist/index.js +59 -47
  22. package/dist/{init-6MFQWPOP.js → init-KYE5CJMW.js} +115 -12
  23. package/dist/{install-37NN4CQH.js → install-XAFQY5YF.js} +79 -6
  24. package/dist/{learn-OPH3CI67.js → learn-MC4VDHZH.js} +2 -2
  25. package/dist/{mcp-DWKVMNC7.js → mcp-FV6YX3ZT.js} +7 -7
  26. package/dist/{mcp-serve-5GODJ4DJ.js → mcp-serve-PXREYQRZ.js} +2 -2
  27. package/dist/{mcp-serve-learn-OF3ZJUJC.js → mcp-serve-learn-UVXIDOEZ.js} +1 -1
  28. package/dist/{memory-TRDLADUM.js → memory-DF7OUOTV.js} +6 -6
  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-S4WKA4P5.js → session-QK6OZO3X.js} +2 -2
  32. package/dist/{status-YZEOUX46.js → status-FVFTJ6GS.js} +11 -10
  33. package/dist/{statusline-KKFJPTI7.js → statusline-AOZHEQSV.js} +2 -2
  34. package/dist/{uninstall-AVA3J554.js → uninstall-MF6FRUBO.js} +51 -4
  35. package/dist/{update-Q3ACCK4Z.js → update-QNUCSDSA.js} +6 -5
  36. package/dist/{update-check-25SCLHZO.js → update-check-7LKJLJPM.js} +1 -1
  37. package/lib/cf-memory/src/lib/claude-md.ts +82 -70
  38. package/lib/cf-memory/src/lib/status-frame.ts +2 -2
  39. package/lib/cf-memory/src/tools/delete.ts +1 -1
  40. package/lib/cf-memory/src/tools/store.ts +6 -6
  41. package/lib/cf-memory/src/tools/update.ts +5 -11
  42. package/package.json +32 -4
  43. package/lib/cf-memory/README.md +0 -317
  44. package/lib/cf-memory/src/__tests__/claude-md.test.ts +0 -343
  45. package/lib/cf-memory/src/__tests__/daemon-client.test.ts +0 -146
  46. package/lib/cf-memory/src/__tests__/daemon-e2e.test.ts +0 -223
  47. package/lib/cf-memory/src/__tests__/daemon.test.ts +0 -407
  48. package/lib/cf-memory/src/__tests__/dedup.test.ts +0 -103
  49. package/lib/cf-memory/src/__tests__/embeddings.test.ts +0 -292
  50. package/lib/cf-memory/src/__tests__/lazy-install.test.ts +0 -210
  51. package/lib/cf-memory/src/__tests__/markdown-backend.test.ts +0 -450
  52. package/lib/cf-memory/src/__tests__/migration.test.ts +0 -255
  53. package/lib/cf-memory/src/__tests__/migrations.test.ts +0 -288
  54. package/lib/cf-memory/src/__tests__/minisearch-backend.test.ts +0 -262
  55. package/lib/cf-memory/src/__tests__/ollama.test.ts +0 -48
  56. package/lib/cf-memory/src/__tests__/project-id.test.ts +0 -43
  57. package/lib/cf-memory/src/__tests__/schema.test.ts +0 -128
  58. package/lib/cf-memory/src/__tests__/search.test.ts +0 -115
  59. package/lib/cf-memory/src/__tests__/sqlite-lazy-db.test.ts +0 -213
  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 -388
  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
@@ -6,18 +6,18 @@ import {
6
6
  getExistingRules,
7
7
  getMissingRules,
8
8
  logPluginScriptWarning
9
- } from "./chunk-O5ZKLFSL.js";
9
+ } from "./chunk-RCE4OWNX.js";
10
10
  import {
11
11
  isLearnMcpRegistered,
12
12
  registerLearnMcp
13
- } from "./chunk-YIXAQ4R2.js";
13
+ } from "./chunk-6NXZKAOV.js";
14
14
  import {
15
15
  ensureMemoryBuilt,
16
16
  isMemoryInitialized,
17
17
  memoryInitWizard
18
- } from "./chunk-W6D3J5DX.js";
19
- import "./chunk-6S7352JG.js";
20
- import "./chunk-PI4P34KF.js";
18
+ } from "./chunk-CGEMETKQ.js";
19
+ import "./chunk-ONG4KRYP.js";
20
+ import "./chunk-RFNKPAJW.js";
21
21
  import {
22
22
  findStatuslineHookPath,
23
23
  getCurrentAccountEmail,
@@ -28,7 +28,7 @@ import {
28
28
  saveStatuslineConfig,
29
29
  selectStatuslineComponents,
30
30
  writeStatuslineSettings
31
- } from "./chunk-XEKQW4RN.js";
31
+ } from "./chunk-ETTZRJ55.js";
32
32
  import {
33
33
  DEFAULT_CONFIG
34
34
  } from "./chunk-3WIZA5OZ.js";
@@ -40,10 +40,17 @@ import {
40
40
  isMemoryMcpRegistered,
41
41
  memoryConfigMenu,
42
42
  registerMemoryMcp
43
- } from "./chunk-DP6DFQ4G.js";
43
+ } from "./chunk-BXSCYGWE.js";
44
44
  import {
45
45
  getLibPath
46
46
  } from "./chunk-RZRT7NGT.js";
47
+ import {
48
+ deployCodexAgents,
49
+ findCodexAgentSourceDir,
50
+ trustCodexProject,
51
+ writeCodexAgentLimits,
52
+ writeCodexMemoryMcpConfig
53
+ } from "./chunk-5QCGEPQO.js";
47
54
  import {
48
55
  BACK,
49
56
  applyDocsDirChange,
@@ -53,8 +60,9 @@ import {
53
60
  getMergedValue,
54
61
  getScopeLabel,
55
62
  injectBackChoice,
63
+ resolveHostFlags,
56
64
  showConfigHint
57
- } from "./chunk-IKLMHJH6.js";
65
+ } from "./chunk-GIH6E7GJ.js";
58
66
  import {
59
67
  commandExists,
60
68
  run
@@ -68,10 +76,11 @@ import {
68
76
  claudeLocalSettingsPath,
69
77
  claudeProjectSettingsPath,
70
78
  claudeSettingsPath,
79
+ codexConfigTomlPath,
71
80
  globalConfigPath,
72
81
  localConfigPath,
73
82
  resolvePath
74
- } from "./chunk-X2H7JJMR.js";
83
+ } from "./chunk-PLSJW7QJ.js";
75
84
  import {
76
85
  log,
77
86
  printBanner
@@ -699,7 +708,7 @@ async function stepAutoApprove(globalCfg, localCfg) {
699
708
  mergeJson(targetPath, { autoApprove: autoApproveChoice });
700
709
  log.success(`Saved to ${targetPath}`);
701
710
  if (autoApproveChoice) {
702
- const { runDangerousRulesAudit } = await import("./permissions-J46VP6US.js");
711
+ const { runDangerousRulesAudit } = await import("./permissions-2SBACQHV.js");
703
712
  await runDangerousRulesAudit(
704
713
  [
705
714
  claudeProjectSettingsPath(),
@@ -983,7 +992,7 @@ async function initMenu(gitAvailable) {
983
992
  log.success(`Saved to ${targetPath}`);
984
993
  }
985
994
  if (autoApproveChoice) {
986
- const { runDangerousRulesAudit } = await import("./permissions-J46VP6US.js");
995
+ const { runDangerousRulesAudit } = await import("./permissions-2SBACQHV.js");
987
996
  await runDangerousRulesAudit(
988
997
  [
989
998
  claudeProjectSettingsPath(),
@@ -1049,7 +1058,12 @@ async function initMenu(gitAvailable) {
1049
1058
  console.log();
1050
1059
  }
1051
1060
  }
1052
- async function initCommand() {
1061
+ async function initCommand(opts = {}) {
1062
+ const { host } = resolveHostFlags(opts);
1063
+ if (host === "codex") {
1064
+ initCodexCommand(opts);
1065
+ return;
1066
+ }
1053
1067
  _stepIndex = 0;
1054
1068
  console.log();
1055
1069
  printBanner("\u2728 Coding Friend Setup Wizard \u2728");
@@ -1203,6 +1217,95 @@ async function initCommand() {
1203
1217
  "Available commands: /cf-ask, /cf-plan, /cf-design, /cf-fix, /cf-commit, /cf-review, /cf-review-out, /cf-review-in, /cf-ship, /cf-optimize, /cf-scan, /cf-remember, /cf-learn, /cf-teach, /cf-research, /cf-session, /cf-warm, /cf-help"
1204
1218
  );
1205
1219
  }
1220
+ function initCodexCommand(opts) {
1221
+ _stepIndex = 0;
1222
+ console.log();
1223
+ printBanner("\u2728 Coding Friend Codex Setup \u2728");
1224
+ console.log();
1225
+ const gitAvailable = isGitRepo();
1226
+ const globalCfg = readJson(globalConfigPath());
1227
+ const localCfg = readJson(localConfigPath());
1228
+ const docsDir = getDocsDir(globalCfg, localCfg);
1229
+ const memoryDir = join(process.cwd(), docsDir, "memory");
1230
+ ensureDocsFolders(docsDir, [
1231
+ "plans",
1232
+ "memory",
1233
+ "research",
1234
+ "sessions",
1235
+ "reviews",
1236
+ "warm"
1237
+ ]);
1238
+ if (!existsSync(localConfigPath())) {
1239
+ writeJson(localConfigPath(), {});
1240
+ }
1241
+ const agentsMdPath = join(process.cwd(), "AGENTS.md");
1242
+ if (!existsSync(agentsMdPath)) {
1243
+ writeFileSync(agentsMdPath, renderCodexAgentsMd(), "utf8");
1244
+ log.success("Created AGENTS.md.");
1245
+ if (gitAvailable) {
1246
+ ensureGitignoreEntry("AGENTS.md");
1247
+ }
1248
+ } else {
1249
+ log.dim("AGENTS.md already exists; left unchanged.");
1250
+ }
1251
+ writeCodexAgentLimits(codexConfigTomlPath());
1252
+ log.success("Configured Codex agent depth for nested Coding Friend agents.");
1253
+ const projectCodexDir = join(process.cwd(), ".codex");
1254
+ const projectConfigPath = join(projectCodexDir, "config.toml");
1255
+ writeCodexMemoryMcpConfig(memoryDir, projectConfigPath);
1256
+ log.success("Registered coding-friend-memory in project .codex/config.toml.");
1257
+ const agentSource = findCodexAgentSourceDir();
1258
+ if (agentSource) {
1259
+ const copied = deployCodexAgents(
1260
+ agentSource,
1261
+ join(projectCodexDir, "agents")
1262
+ );
1263
+ log.success(`Deployed ${copied} project Codex agent definition(s).`);
1264
+ } else {
1265
+ log.warn(
1266
+ "Codex agent TOMLs were not found locally yet. Install the plugin from Codex, then rerun cf init --agent codex."
1267
+ );
1268
+ }
1269
+ if (opts.trustProject) {
1270
+ trustCodexProject(process.cwd());
1271
+ log.success("Marked this project trusted in ~/.codex/config.toml.");
1272
+ } else {
1273
+ log.dim(
1274
+ "Project trust was not changed. The project-scoped memory MCP only loads once the project is trusted \u2014 run: cf init --agent codex --trust-project"
1275
+ );
1276
+ }
1277
+ console.log();
1278
+ log.congrats("Codex setup complete!");
1279
+ log.dim("Restart Codex CLI or start a new session to use Coding Friend.");
1280
+ }
1281
+ function renderCodexAgentsMd() {
1282
+ return `# Coding Friend
1283
+
1284
+ Use Coding Friend skills with Codex's $skill syntax.
1285
+
1286
+ ## Rules
1287
+
1288
+ 1. Verify before claiming done.
1289
+ 2. Respect .coding-friend/ignore and project privacy boundaries.
1290
+ 3. Use conventional commits without AI attribution.
1291
+ 4. Store durable project knowledge in docs/memory/.
1292
+
1293
+ ## Skills
1294
+
1295
+ $cf-ask, $cf-plan, $cf-review, $cf-review-out, $cf-review-in, $cf-commit, $cf-design, $cf-ship, $cf-fix, $cf-optimize, $cf-scan, $cf-remember, $cf-learn, $cf-teach, $cf-research, $cf-session, $cf-warm, $cf-help
1296
+ `;
1297
+ }
1298
+ function ensureGitignoreEntry(entry) {
1299
+ const gitignorePath = ".gitignore";
1300
+ const existing = existsSync(gitignorePath) ? readFileSync(gitignorePath, "utf8") : "";
1301
+ if (existing.split(/\n/).includes(entry)) return;
1302
+ const next = existing.endsWith("\n") || existing.length === 0 ? `${existing}${entry}
1303
+ ` : `${existing}
1304
+ ${entry}
1305
+ `;
1306
+ writeFileSync(gitignorePath, next, "utf8");
1307
+ log.success(`Added ${entry} to .gitignore.`);
1308
+ }
1206
1309
  export {
1207
1310
  initCommand
1208
1311
  };
@@ -1,24 +1,32 @@
1
1
  import {
2
2
  getLatestVersion,
3
3
  semverCompare
4
- } from "./chunk-676YCW6T.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-DP6DFQ4G.js";
12
+ import "./chunk-BXSCYGWE.js";
13
13
  import "./chunk-RZRT7NGT.js";
14
14
  import {
15
15
  enableMarketplaceAutoUpdate,
16
16
  isMarketplaceRegistered,
17
17
  isPluginDisabled
18
- } from "./chunk-GZT3YPAP.js";
18
+ } from "./chunk-32UAW3NX.js";
19
19
  import {
20
+ deployCodexAgents,
21
+ findCodexAgentSourceDir,
22
+ isCodexMarketplaceRegistered,
23
+ setCodexPluginEnabled
24
+ } from "./chunk-5QCGEPQO.js";
25
+ import {
26
+ checkCodexVersion,
27
+ resolveHostFlags,
20
28
  resolveScope
21
- } from "./chunk-IKLMHJH6.js";
29
+ } from "./chunk-GIH6E7GJ.js";
22
30
  import {
23
31
  commandExists,
24
32
  run
@@ -26,7 +34,7 @@ import {
26
34
  import "./chunk-5UVDWG5L.js";
27
35
  import {
28
36
  devStatePath
29
- } from "./chunk-X2H7JJMR.js";
37
+ } from "./chunk-PLSJW7QJ.js";
30
38
  import {
31
39
  log,
32
40
  printBanner
@@ -36,6 +44,11 @@ import {
36
44
  import { existsSync } from "fs";
37
45
  import chalk from "chalk";
38
46
  async function installCommand(opts = {}) {
47
+ const { host } = resolveHostFlags(opts);
48
+ if (host === "codex") {
49
+ await installCodexCommand();
50
+ return;
51
+ }
39
52
  printBanner("\u2728 Coding Friend Install \u2728");
40
53
  console.log();
41
54
  if (!commandExists("claude")) {
@@ -43,6 +56,7 @@ async function installCommand(opts = {}) {
43
56
  "Claude CLI not found. Install it first: https://docs.anthropic.com/en/docs/claude-code/getting-started"
44
57
  );
45
58
  process.exit(1);
59
+ return;
46
60
  }
47
61
  if (existsSync(devStatePath())) {
48
62
  log.warn("Dev mode is currently active.");
@@ -132,6 +146,65 @@ async function installCommand(opts = {}) {
132
146
  console.log();
133
147
  log.dim("Restart Claude Code (or start a new session) to use the plugin.");
134
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
+ }
135
208
  export {
136
209
  installCommand
137
210
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveLearnDir
3
- } from "./chunk-PI4P34KF.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-W6D3J5DX.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-6S7352JG.js";
18
+ } from "./chunk-ONG4KRYP.js";
19
19
  import {
20
20
  resolveLearnDir,
21
21
  resolveMemoryDir
22
- } from "./chunk-PI4P34KF.js";
22
+ } from "./chunk-RFNKPAJW.js";
23
23
  import "./chunk-3WIZA5OZ.js";
24
24
  import {
25
25
  isMemoryMcpRegistered,
26
26
  registerMemoryMcp
27
- } from "./chunk-DP6DFQ4G.js";
27
+ } from "./chunk-BXSCYGWE.js";
28
28
  import {
29
29
  getLibPath
30
30
  } from "./chunk-RZRT7NGT.js";
31
- import "./chunk-IKLMHJH6.js";
31
+ import "./chunk-GIH6E7GJ.js";
32
32
  import {
33
33
  run
34
34
  } from "./chunk-EVGXUDX4.js";
@@ -37,7 +37,7 @@ 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
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  resolveProjectMemoryDir
3
- } from "./chunk-PI4P34KF.js";
3
+ } from "./chunk-RFNKPAJW.js";
4
4
  import "./chunk-3WIZA5OZ.js";
5
5
  import {
6
6
  getLibPath
7
7
  } from "./chunk-RZRT7NGT.js";
8
8
  import "./chunk-EVGXUDX4.js";
9
9
  import "./chunk-5UVDWG5L.js";
10
- import "./chunk-X2H7JJMR.js";
10
+ import "./chunk-PLSJW7QJ.js";
11
11
  import {
12
12
  log
13
13
  } from "./chunk-NREZK463.js";
@@ -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-W6D3J5DX.js";
18
- import "./chunk-6S7352JG.js";
19
- import "./chunk-PI4P34KF.js";
17
+ } from "./chunk-CGEMETKQ.js";
18
+ import "./chunk-ONG4KRYP.js";
19
+ import "./chunk-RFNKPAJW.js";
20
20
  import "./chunk-3WIZA5OZ.js";
21
- import "./chunk-DP6DFQ4G.js";
21
+ import "./chunk-BXSCYGWE.js";
22
22
  import "./chunk-RZRT7NGT.js";
23
- import "./chunk-IKLMHJH6.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,6 +1,6 @@
1
1
  import {
2
2
  loadConfig
3
- } from "./chunk-PI4P34KF.js";
3
+ } from "./chunk-RFNKPAJW.js";
4
4
  import "./chunk-3WIZA5OZ.js";
5
5
  import "./chunk-EVGXUDX4.js";
6
6
  import {
@@ -11,7 +11,7 @@ import {
11
11
  claudeSessionDir,
12
12
  encodeProjectPath,
13
13
  resolvePath
14
- } from "./chunk-X2H7JJMR.js";
14
+ } from "./chunk-PLSJW7QJ.js";
15
15
  import {
16
16
  log
17
17
  } from "./chunk-NREZK463.js";
@@ -1,43 +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-6S7352JG.js";
13
+ } from "./chunk-ONG4KRYP.js";
14
14
  import {
15
15
  resolveLearnDir,
16
16
  resolveMemoryDir,
17
17
  sanitizeRawConfig
18
- } from "./chunk-PI4P34KF.js";
18
+ } from "./chunk-RFNKPAJW.js";
19
19
  import {
20
20
  getCliVersion,
21
21
  getLatestCliVersion,
22
22
  getLatestVersion,
23
23
  semverCompare
24
- } from "./chunk-676YCW6T.js";
24
+ } from "./chunk-776ZY62N.js";
25
25
  import {
26
26
  getInstalledVersion
27
- } from "./chunk-XEKQW4RN.js";
27
+ } from "./chunk-ETTZRJ55.js";
28
28
  import "./chunk-3WIZA5OZ.js";
29
29
  import "./chunk-667NMPN4.js";
30
30
  import {
31
31
  isMemoryMcpRegistered
32
- } from "./chunk-DP6DFQ4G.js";
32
+ } from "./chunk-BXSCYGWE.js";
33
33
  import {
34
34
  getLibPath
35
35
  } from "./chunk-RZRT7NGT.js";
36
36
  import {
37
37
  detectPluginScope,
38
38
  isPluginDisabled
39
- } from "./chunk-GZT3YPAP.js";
40
- import "./chunk-IKLMHJH6.js";
39
+ } from "./chunk-32UAW3NX.js";
40
+ import "./chunk-5QCGEPQO.js";
41
+ import "./chunk-GIH6E7GJ.js";
41
42
  import "./chunk-EVGXUDX4.js";
42
43
  import {
43
44
  readJson
@@ -47,7 +48,7 @@ import {
47
48
  devStatePath,
48
49
  globalConfigPath,
49
50
  localConfigPath
50
- } from "./chunk-X2H7JJMR.js";
51
+ } from "./chunk-PLSJW7QJ.js";
51
52
  import "./chunk-NREZK463.js";
52
53
 
53
54
  // src/commands/status.ts
@@ -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