coding-friend-cli 1.39.0 → 1.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/{chunk-ODW27NAC.js → chunk-B44ROTV6.js} +10 -10
- package/dist/{chunk-ZGIUKUL2.js → chunk-CZW36H3D.js} +39 -7
- package/dist/{chunk-FQUIO5BW.js → chunk-E4NBTQXR.js} +13 -7
- package/dist/{chunk-IV5OPG34.js → chunk-IYBIIRH4.js} +29 -1
- package/dist/{chunk-GTOEIGDM.js → chunk-KCBMCHSA.js} +295 -44
- package/dist/{chunk-463QKRBN.js → chunk-KG6HYBGD.js} +23 -7
- package/dist/{chunk-WJHQUCOF.js → chunk-KTUPGMIV.js} +111 -15
- package/dist/{chunk-7JQZRMOG.js → chunk-NIMO4VJW.js} +37 -6
- package/dist/{chunk-OFEC6OVI.js → chunk-OBCNHQFA.js} +42 -2
- package/dist/{chunk-4CPUWHIN.js → chunk-Q2QDSYQT.js} +1 -1
- package/dist/{chunk-JSH6BMVZ.js → chunk-RG3EMZH6.js} +11 -1
- package/dist/{chunk-2EY7VVFT.js → chunk-SUYE5S2W.js} +1 -1
- package/dist/{chunk-YPW67OGP.js → chunk-TFF47F7P.js} +1 -1
- package/dist/{chunk-ZZNTNIM4.js → chunk-TN3Y75WG.js} +2 -2
- package/dist/{chunk-VMODQCSL.js → chunk-Z5XTSF7L.js} +5 -5
- package/dist/{clean-LPWEBJJ5.js → clean-PKSSS662.js} +3 -3
- package/dist/{config-VNSC2NAY.js → config-2CH4GI2L.js} +47 -26
- package/dist/{dev-NRTDUQAR.js → dev-HWKNWOZY.js} +7 -7
- package/dist/{disable-NROSQUHR.js → disable-DCGVIHKG.js} +22 -8
- package/dist/{enable-26FFJGX5.js → enable-YYWJDOYB.js} +21 -8
- package/dist/{guide-HCLEOAGR.js → guide-45EIK76P.js} +1 -1
- package/dist/{host-2JOPHLN3.js → host-GZJSMJSF.js} +7 -7
- package/dist/index.js +67 -46
- package/dist/{init-MHHII5EP.js → init-TUBWQCBQ.js} +236 -53
- package/dist/{install-OEFJLAWA.js → install-45O5ICBA.js} +68 -11
- package/dist/{learn-SSNBBDY3.js → learn-AJT7Z6F7.js} +5 -5
- package/dist/{mcp-J5VO3OH7.js → mcp-JGBZMNWL.js} +26 -13
- package/dist/{mcp-serve-55DSE2J4.js → mcp-serve-SHS5MQRW.js} +5 -5
- package/dist/{mcp-serve-learn-EDBWNL4I.js → mcp-serve-learn-HXZZ3DUI.js} +6 -6
- package/dist/{memory-CDZKWOFL.js → memory-4NVLWOFS.js} +10 -10
- package/dist/{permission-DPKPA2HU.js → permission-L5QMNMID.js} +25 -25
- package/dist/{session-YWJDLNBP.js → session-GBHL5TH3.js} +3 -3
- package/dist/{status-4WMIQL7L.js → status-KQQJNSEZ.js} +33 -15
- package/dist/{statusline-R5BNYK3H.js → statusline-B7PXP3AQ.js} +3 -3
- package/dist/{uninstall-EV7362NK.js → uninstall-6QKNGLKK.js} +38 -13
- package/dist/{update-YQBBAIIF.js → update-YJ363TBU.js} +11 -11
- package/dist/{update-check-EJSGVGO6.js → update-check-5JZUJGUM.js} +1 -1
- package/package.json +1 -1
- package/dist/permissions-HZYUVKCY.js +0 -38
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
afterAutoApproveEnabled,
|
|
2
3
|
applyPermissions,
|
|
3
4
|
buildLearnDirRules,
|
|
4
5
|
cleanupStalePluginRules,
|
|
@@ -6,14 +7,14 @@ import {
|
|
|
6
7
|
getExistingRules,
|
|
7
8
|
getMissingRules,
|
|
8
9
|
logPluginScriptWarning
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KG6HYBGD.js";
|
|
10
11
|
import {
|
|
11
12
|
ensureMemoryBuilt,
|
|
12
13
|
isMemoryInitialized,
|
|
13
14
|
memoryInitWizard
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-B44ROTV6.js";
|
|
16
|
+
import "./chunk-TFF47F7P.js";
|
|
17
|
+
import "./chunk-E4NBTQXR.js";
|
|
17
18
|
import {
|
|
18
19
|
findStatuslineHookPath,
|
|
19
20
|
getCurrentAccountEmail,
|
|
@@ -24,14 +25,14 @@ import {
|
|
|
24
25
|
saveStatuslineConfig,
|
|
25
26
|
selectStatuslineComponents,
|
|
26
27
|
writeStatuslineSettings
|
|
27
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-Q2QDSYQT.js";
|
|
28
29
|
import {
|
|
29
30
|
DEFAULT_CONFIG
|
|
30
31
|
} from "./chunk-3WIZA5OZ.js";
|
|
31
32
|
import {
|
|
32
33
|
isLearnMcpRegistered,
|
|
33
34
|
registerLearnMcp
|
|
34
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-NIMO4VJW.js";
|
|
35
36
|
import {
|
|
36
37
|
ensureShellCompletion,
|
|
37
38
|
hasShellCompletion
|
|
@@ -40,17 +41,18 @@ import {
|
|
|
40
41
|
isMemoryMcpRegistered,
|
|
41
42
|
memoryConfigMenu,
|
|
42
43
|
registerMemoryMcp
|
|
43
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-CZW36H3D.js";
|
|
44
45
|
import {
|
|
45
46
|
deployCodexAgents,
|
|
46
47
|
findCodexAgentSourceDir,
|
|
47
48
|
trustCodexProject,
|
|
48
49
|
writeCodexAgentLimits,
|
|
49
50
|
writeCodexMemoryMcpConfig
|
|
50
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-RG3EMZH6.js";
|
|
51
52
|
import {
|
|
53
|
+
isAgyPluginInstalled,
|
|
52
54
|
isOmpAgentInstalled
|
|
53
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-KCBMCHSA.js";
|
|
54
56
|
import {
|
|
55
57
|
BACK,
|
|
56
58
|
applyDocsDirChange,
|
|
@@ -62,23 +64,22 @@ import {
|
|
|
62
64
|
injectBackChoice,
|
|
63
65
|
resolveHostFlags,
|
|
64
66
|
showConfigHint
|
|
65
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-Z5XTSF7L.js";
|
|
66
68
|
import {
|
|
67
69
|
getLibPath
|
|
68
|
-
} from "./chunk-
|
|
69
|
-
import "./chunk-
|
|
70
|
-
import {
|
|
71
|
-
commandExists,
|
|
72
|
-
run
|
|
73
|
-
} from "./chunk-EVGXUDX4.js";
|
|
70
|
+
} from "./chunk-TN3Y75WG.js";
|
|
71
|
+
import "./chunk-OBCNHQFA.js";
|
|
74
72
|
import {
|
|
75
73
|
mergeJson,
|
|
76
74
|
readJson,
|
|
77
75
|
writeJson
|
|
78
76
|
} from "./chunk-5UVDWG5L.js";
|
|
77
|
+
import {
|
|
78
|
+
commandExists,
|
|
79
|
+
run
|
|
80
|
+
} from "./chunk-EVGXUDX4.js";
|
|
79
81
|
import {
|
|
80
82
|
claudeLocalSettingsPath,
|
|
81
|
-
claudeProjectSettingsPath,
|
|
82
83
|
claudeSettingsPath,
|
|
83
84
|
codexConfigTomlPath,
|
|
84
85
|
globalConfigPath,
|
|
@@ -86,7 +87,7 @@ import {
|
|
|
86
87
|
ompProjectDir,
|
|
87
88
|
ompProjectMcpJsonPath,
|
|
88
89
|
resolvePath
|
|
89
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-IYBIIRH4.js";
|
|
90
91
|
import {
|
|
91
92
|
log,
|
|
92
93
|
printBanner
|
|
@@ -699,10 +700,10 @@ async function stepAutoApprove(globalCfg, localCfg) {
|
|
|
699
700
|
const scopeLabel = getScopeLabel("autoApprove", globalCfg, localCfg);
|
|
700
701
|
printStepHeader(
|
|
701
702
|
`Auto-approve ${formatScopeLabel(scopeLabel)}${currentValue !== void 0 ? ` (${currentValue})` : ""}`,
|
|
702
|
-
"
|
|
703
|
+
"Same `autoApprove` key for Claude (LLM classifier), Antigravity, and Codex (deterministic)."
|
|
703
704
|
);
|
|
704
705
|
const autoApproveChoice = await confirm({
|
|
705
|
-
message: "Enable auto-approve? (
|
|
706
|
+
message: "Enable auto-approve? (Claude: LLM classifier; Antigravity/Codex: deterministic rules, no LLM)",
|
|
706
707
|
default: currentValue ?? false
|
|
707
708
|
});
|
|
708
709
|
const scope = await askScope();
|
|
@@ -714,20 +715,10 @@ async function stepAutoApprove(globalCfg, localCfg) {
|
|
|
714
715
|
mergeJson(targetPath, { autoApprove: autoApproveChoice });
|
|
715
716
|
log.success(`Saved to ${targetPath}`);
|
|
716
717
|
if (autoApproveChoice) {
|
|
717
|
-
|
|
718
|
-
await runDangerousRulesAudit(
|
|
719
|
-
[
|
|
720
|
-
claudeProjectSettingsPath(),
|
|
721
|
-
claudeLocalSettingsPath(),
|
|
722
|
-
claudeSettingsPath()
|
|
723
|
-
],
|
|
718
|
+
await afterAutoApproveEnabled(
|
|
724
719
|
log,
|
|
725
720
|
(message) => confirm({ message, default: true })
|
|
726
721
|
);
|
|
727
|
-
log.dim(
|
|
728
|
-
"Tip: Fine-tune with autoApproveAllowExtra / autoApproveIgnore in config.json"
|
|
729
|
-
);
|
|
730
|
-
log.dim("Docs: https://cf.dinhanhthi.com/docs/reference/auto-approve/");
|
|
731
722
|
}
|
|
732
723
|
}
|
|
733
724
|
async function stepPlanDocs(globalCfg, localCfg) {
|
|
@@ -988,7 +979,7 @@ async function initMenu(gitAvailable) {
|
|
|
988
979
|
}
|
|
989
980
|
case "autoApprove": {
|
|
990
981
|
const autoApproveChoice = await confirm({
|
|
991
|
-
message: "Enable auto-approve? (
|
|
982
|
+
message: "Enable auto-approve? (Claude: LLM classifier; Antigravity/Codex: deterministic rules, no LLM)",
|
|
992
983
|
default: autoApproveVal ?? false
|
|
993
984
|
});
|
|
994
985
|
const autoApproveTargetScope = await askScope();
|
|
@@ -998,22 +989,10 @@ async function initMenu(gitAvailable) {
|
|
|
998
989
|
log.success(`Saved to ${targetPath}`);
|
|
999
990
|
}
|
|
1000
991
|
if (autoApproveChoice) {
|
|
1001
|
-
|
|
1002
|
-
await runDangerousRulesAudit(
|
|
1003
|
-
[
|
|
1004
|
-
claudeProjectSettingsPath(),
|
|
1005
|
-
claudeLocalSettingsPath(),
|
|
1006
|
-
claudeSettingsPath()
|
|
1007
|
-
],
|
|
992
|
+
await afterAutoApproveEnabled(
|
|
1008
993
|
log,
|
|
1009
994
|
(message) => confirm({ message, default: true })
|
|
1010
995
|
);
|
|
1011
|
-
log.dim(
|
|
1012
|
-
"Tip: Fine-tune with autoApproveAllowExtra / autoApproveIgnore in config.json"
|
|
1013
|
-
);
|
|
1014
|
-
log.dim(
|
|
1015
|
-
"Docs: https://cf.dinhanhthi.com/docs/reference/auto-approve/"
|
|
1016
|
-
);
|
|
1017
996
|
}
|
|
1018
997
|
break;
|
|
1019
998
|
}
|
|
@@ -1067,13 +1046,17 @@ async function initMenu(gitAvailable) {
|
|
|
1067
1046
|
async function initCommand(opts = {}) {
|
|
1068
1047
|
const { host } = resolveHostFlags(opts);
|
|
1069
1048
|
if (host === "codex") {
|
|
1070
|
-
initCodexCommand(opts);
|
|
1049
|
+
await initCodexCommand(opts);
|
|
1071
1050
|
return;
|
|
1072
1051
|
}
|
|
1073
1052
|
if (host === "omp") {
|
|
1074
1053
|
initOmpCommand(opts);
|
|
1075
1054
|
return;
|
|
1076
1055
|
}
|
|
1056
|
+
if (host === "agy") {
|
|
1057
|
+
await initAgyCommand();
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1077
1060
|
_stepIndex = 0;
|
|
1078
1061
|
console.log();
|
|
1079
1062
|
printBanner("\u2728 Coding Friend Setup Wizard \u2728");
|
|
@@ -1227,16 +1210,31 @@ async function initCommand(opts = {}) {
|
|
|
1227
1210
|
"Available commands: /cf-ask, /cf-plan, /cf-later-do, /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-checkpoint, /cf-checkpoint-from, /cf-help"
|
|
1228
1211
|
);
|
|
1229
1212
|
}
|
|
1230
|
-
function initCodexCommand(opts) {
|
|
1213
|
+
async function initCodexCommand(opts) {
|
|
1231
1214
|
_stepIndex = 0;
|
|
1232
1215
|
console.log();
|
|
1233
1216
|
printBanner("\u2728 Coding Friend Codex Setup \u2728");
|
|
1234
1217
|
console.log();
|
|
1218
|
+
showConfigHint();
|
|
1235
1219
|
const gitAvailable = isGitRepo();
|
|
1236
|
-
|
|
1237
|
-
|
|
1220
|
+
if (!gitAvailable) {
|
|
1221
|
+
log.warn("Not inside a git repo -- git-related steps will be skipped.");
|
|
1222
|
+
console.log();
|
|
1223
|
+
}
|
|
1224
|
+
const proceed = await confirm({
|
|
1225
|
+
message: "Run Codex setup wizard?",
|
|
1226
|
+
default: true
|
|
1227
|
+
});
|
|
1228
|
+
if (!proceed) {
|
|
1229
|
+
log.dim("Init cancelled. Run `cf init --agent codex` anytime to resume.");
|
|
1230
|
+
return;
|
|
1231
|
+
}
|
|
1232
|
+
let globalCfg = readJson(globalConfigPath());
|
|
1233
|
+
let localCfg = readJson(localConfigPath());
|
|
1234
|
+
await stepDocsDir(globalCfg, localCfg);
|
|
1235
|
+
globalCfg = readJson(globalConfigPath());
|
|
1236
|
+
localCfg = readJson(localConfigPath());
|
|
1238
1237
|
const docsDir = getDocsDir(globalCfg, localCfg);
|
|
1239
|
-
const memoryDir = join(process.cwd(), docsDir, "memory");
|
|
1240
1238
|
ensureDocsFolders(docsDir, [
|
|
1241
1239
|
"plans",
|
|
1242
1240
|
"memory",
|
|
@@ -1245,6 +1243,28 @@ function initCodexCommand(opts) {
|
|
|
1245
1243
|
"reviews",
|
|
1246
1244
|
"warm"
|
|
1247
1245
|
]);
|
|
1246
|
+
if (gitAvailable) {
|
|
1247
|
+
await stepGitignore(docsDir);
|
|
1248
|
+
} else {
|
|
1249
|
+
printStepHeader(
|
|
1250
|
+
`Configure .gitignore ${chalk.dim("[skipped]")}`,
|
|
1251
|
+
"Keeps AI-generated docs and config out of your git history."
|
|
1252
|
+
);
|
|
1253
|
+
log.dim("Skipped \u2014 not inside a git repo.");
|
|
1254
|
+
}
|
|
1255
|
+
await stepDocsLanguage(globalCfg, localCfg);
|
|
1256
|
+
globalCfg = readJson(globalConfigPath());
|
|
1257
|
+
localCfg = readJson(localConfigPath());
|
|
1258
|
+
await stepLearnConfig(globalCfg);
|
|
1259
|
+
log.dim(
|
|
1260
|
+
"Learn MCP is not registered into Codex config (no dedicated Codex writer). Settings are saved to Coding Friend config."
|
|
1261
|
+
);
|
|
1262
|
+
globalCfg = readJson(globalConfigPath());
|
|
1263
|
+
localCfg = readJson(localConfigPath());
|
|
1264
|
+
await stepAutoApprove(globalCfg, localCfg);
|
|
1265
|
+
globalCfg = readJson(globalConfigPath());
|
|
1266
|
+
localCfg = readJson(localConfigPath());
|
|
1267
|
+
await stepPrivacyBlock(globalCfg, localCfg);
|
|
1248
1268
|
if (!existsSync(localConfigPath())) {
|
|
1249
1269
|
writeJson(localConfigPath(), {});
|
|
1250
1270
|
}
|
|
@@ -1260,6 +1280,7 @@ function initCodexCommand(opts) {
|
|
|
1260
1280
|
}
|
|
1261
1281
|
writeCodexAgentLimits(codexConfigTomlPath());
|
|
1262
1282
|
log.success("Configured Codex agent depth for nested Coding Friend agents.");
|
|
1283
|
+
const memoryDir = join(process.cwd(), docsDir, "memory");
|
|
1263
1284
|
const projectCodexDir = join(process.cwd(), ".codex");
|
|
1264
1285
|
const projectConfigPath = join(projectCodexDir, "config.toml");
|
|
1265
1286
|
writeCodexMemoryMcpConfig(memoryDir, projectConfigPath);
|
|
@@ -1288,6 +1309,133 @@ function initCodexCommand(opts) {
|
|
|
1288
1309
|
log.congrats("Codex setup complete!");
|
|
1289
1310
|
log.dim("Restart Codex CLI or start a new session to use Coding Friend.");
|
|
1290
1311
|
}
|
|
1312
|
+
async function initAgyCommand() {
|
|
1313
|
+
_stepIndex = 0;
|
|
1314
|
+
console.log();
|
|
1315
|
+
printBanner("\u2728 Coding Friend Antigravity Setup (beta) \u2728");
|
|
1316
|
+
console.log();
|
|
1317
|
+
showConfigHint();
|
|
1318
|
+
if (!isAgyPluginInstalled()) {
|
|
1319
|
+
log.warn(
|
|
1320
|
+
"Antigravity plugin is not installed. Run: cf install --agent agy"
|
|
1321
|
+
);
|
|
1322
|
+
log.dim(
|
|
1323
|
+
"Learn/memory MCP cannot be written into the plugin until it is installed."
|
|
1324
|
+
);
|
|
1325
|
+
console.log();
|
|
1326
|
+
}
|
|
1327
|
+
const gitAvailable = isGitRepo();
|
|
1328
|
+
if (!gitAvailable) {
|
|
1329
|
+
log.warn("Not inside a git repo -- git-related steps will be skipped.");
|
|
1330
|
+
console.log();
|
|
1331
|
+
}
|
|
1332
|
+
const proceed = await confirm({
|
|
1333
|
+
message: "Run Antigravity setup wizard?",
|
|
1334
|
+
default: true
|
|
1335
|
+
});
|
|
1336
|
+
if (!proceed) {
|
|
1337
|
+
log.dim("Init cancelled. Run `cf init --agent agy` anytime to resume.");
|
|
1338
|
+
return;
|
|
1339
|
+
}
|
|
1340
|
+
let globalCfg = readJson(globalConfigPath());
|
|
1341
|
+
let localCfg = readJson(localConfigPath());
|
|
1342
|
+
await stepDocsDir(globalCfg, localCfg);
|
|
1343
|
+
globalCfg = readJson(globalConfigPath());
|
|
1344
|
+
localCfg = readJson(localConfigPath());
|
|
1345
|
+
const docsDir = getDocsDir(globalCfg, localCfg);
|
|
1346
|
+
ensureDocsFolders(docsDir, [
|
|
1347
|
+
"plans",
|
|
1348
|
+
"memory",
|
|
1349
|
+
"research",
|
|
1350
|
+
"sessions",
|
|
1351
|
+
"reviews",
|
|
1352
|
+
"warm"
|
|
1353
|
+
]);
|
|
1354
|
+
if (gitAvailable) {
|
|
1355
|
+
await stepGitignore(docsDir);
|
|
1356
|
+
} else {
|
|
1357
|
+
printStepHeader(
|
|
1358
|
+
`Configure .gitignore ${chalk.dim("[skipped]")}`,
|
|
1359
|
+
"Keeps AI-generated docs and config out of your git history."
|
|
1360
|
+
);
|
|
1361
|
+
log.dim("Skipped \u2014 not inside a git repo.");
|
|
1362
|
+
}
|
|
1363
|
+
await stepDocsLanguage(globalCfg, localCfg);
|
|
1364
|
+
globalCfg = readJson(globalConfigPath());
|
|
1365
|
+
localCfg = readJson(localConfigPath());
|
|
1366
|
+
const { outputDir } = await stepLearnConfig(globalCfg);
|
|
1367
|
+
if (isAgyPluginInstalled()) {
|
|
1368
|
+
if (isLearnMcpRegistered("agy")) {
|
|
1369
|
+
log.dim(
|
|
1370
|
+
"coding-friend-learn: already registered in plugin mcp_config.json"
|
|
1371
|
+
);
|
|
1372
|
+
} else {
|
|
1373
|
+
const registered = registerLearnMcp(outputDir, "agy");
|
|
1374
|
+
if (registered) {
|
|
1375
|
+
log.success(
|
|
1376
|
+
"Registered CF Learn MCP in the Antigravity plugin mcp_config.json."
|
|
1377
|
+
);
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
if (isMemoryMcpRegistered("agy")) {
|
|
1381
|
+
log.dim(
|
|
1382
|
+
"coding-friend-memory: already registered in plugin mcp_config.json"
|
|
1383
|
+
);
|
|
1384
|
+
} else {
|
|
1385
|
+
const registered = registerMemoryMcp("agy");
|
|
1386
|
+
if (registered) {
|
|
1387
|
+
log.success(
|
|
1388
|
+
"Registered coding-friend-memory in the Antigravity plugin mcp_config.json."
|
|
1389
|
+
);
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
globalCfg = readJson(globalConfigPath());
|
|
1394
|
+
localCfg = readJson(localConfigPath());
|
|
1395
|
+
await stepAutoApprove(globalCfg, localCfg);
|
|
1396
|
+
globalCfg = readJson(globalConfigPath());
|
|
1397
|
+
localCfg = readJson(localConfigPath());
|
|
1398
|
+
await stepPrivacyBlock(globalCfg, localCfg);
|
|
1399
|
+
if (!existsSync(localConfigPath())) {
|
|
1400
|
+
writeJson(localConfigPath(), {});
|
|
1401
|
+
}
|
|
1402
|
+
const agentsMdPath = join(process.cwd(), "AGENTS.md");
|
|
1403
|
+
if (!existsSync(agentsMdPath)) {
|
|
1404
|
+
writeFileSync(agentsMdPath, renderAgyAgentsMd(), "utf8");
|
|
1405
|
+
log.success("Created AGENTS.md.");
|
|
1406
|
+
} else {
|
|
1407
|
+
log.dim("AGENTS.md already exists; left unchanged.");
|
|
1408
|
+
}
|
|
1409
|
+
if (!isAgyPluginInstalled()) {
|
|
1410
|
+
log.warn(
|
|
1411
|
+
"Antigravity plugin is not installed. Run: cf install --agent agy"
|
|
1412
|
+
);
|
|
1413
|
+
}
|
|
1414
|
+
console.log();
|
|
1415
|
+
log.congrats("Antigravity setup complete!");
|
|
1416
|
+
log.dim(
|
|
1417
|
+
"Restart Antigravity or start a new `agy` session to use Coding Friend."
|
|
1418
|
+
);
|
|
1419
|
+
}
|
|
1420
|
+
async function stepPrivacyBlock(globalCfg, localCfg) {
|
|
1421
|
+
const currentValue = getMergedValue("privacyBlock", globalCfg, localCfg);
|
|
1422
|
+
const scopeLabel = getScopeLabel("privacyBlock", globalCfg, localCfg);
|
|
1423
|
+
const enabledByDefault = currentValue !== false;
|
|
1424
|
+
printStepHeader(
|
|
1425
|
+
`Privacy-block ${formatScopeLabel(scopeLabel)}${currentValue !== void 0 ? ` (${currentValue})` : ""}`,
|
|
1426
|
+
"Deny reads of .env, keys, and similar secrets on PreToolUse."
|
|
1427
|
+
);
|
|
1428
|
+
const enabled = await confirm({
|
|
1429
|
+
message: "Keep privacy-block enabled? (deny .env / credentials / keys)",
|
|
1430
|
+
default: enabledByDefault
|
|
1431
|
+
});
|
|
1432
|
+
const scope = await askScope();
|
|
1433
|
+
if (scope === "back") {
|
|
1434
|
+
log.dim("Skipped privacy-block.");
|
|
1435
|
+
return;
|
|
1436
|
+
}
|
|
1437
|
+
writeToScope(scope, { privacyBlock: enabled });
|
|
1438
|
+
}
|
|
1291
1439
|
function initOmpCommand(_opts) {
|
|
1292
1440
|
_stepIndex = 0;
|
|
1293
1441
|
console.log();
|
|
@@ -1314,10 +1462,33 @@ function initOmpCommand(_opts) {
|
|
|
1314
1462
|
}
|
|
1315
1463
|
log.dim("Restart omp or start a new session to use Coding Friend.");
|
|
1316
1464
|
}
|
|
1317
|
-
|
|
1465
|
+
var AGENTS_MD_SKILLS = [
|
|
1466
|
+
"cf-ask",
|
|
1467
|
+
"cf-plan",
|
|
1468
|
+
"cf-later-do",
|
|
1469
|
+
"cf-review",
|
|
1470
|
+
"cf-review-out",
|
|
1471
|
+
"cf-review-in",
|
|
1472
|
+
"cf-commit",
|
|
1473
|
+
"cf-design",
|
|
1474
|
+
"cf-ship",
|
|
1475
|
+
"cf-fix",
|
|
1476
|
+
"cf-optimize",
|
|
1477
|
+
"cf-scan",
|
|
1478
|
+
"cf-remember",
|
|
1479
|
+
"cf-learn",
|
|
1480
|
+
"cf-teach",
|
|
1481
|
+
"cf-research",
|
|
1482
|
+
"cf-session",
|
|
1483
|
+
"cf-warm",
|
|
1484
|
+
"cf-checkpoint",
|
|
1485
|
+
"cf-checkpoint-from",
|
|
1486
|
+
"cf-help"
|
|
1487
|
+
];
|
|
1488
|
+
function renderAgentsMd(intro, skillPrefix) {
|
|
1318
1489
|
return `# Coding Friend
|
|
1319
1490
|
|
|
1320
|
-
|
|
1491
|
+
${intro}
|
|
1321
1492
|
|
|
1322
1493
|
## Rules
|
|
1323
1494
|
|
|
@@ -1328,9 +1499,21 @@ Use Coding Friend skills with Codex's $skill syntax.
|
|
|
1328
1499
|
|
|
1329
1500
|
## Skills
|
|
1330
1501
|
|
|
1331
|
-
$
|
|
1502
|
+
${AGENTS_MD_SKILLS.map((name) => `${skillPrefix}${name}`).join(", ")}
|
|
1332
1503
|
`;
|
|
1333
1504
|
}
|
|
1505
|
+
function renderCodexAgentsMd() {
|
|
1506
|
+
return renderAgentsMd(
|
|
1507
|
+
"Use Coding Friend skills with Codex's $skill syntax.",
|
|
1508
|
+
"$"
|
|
1509
|
+
);
|
|
1510
|
+
}
|
|
1511
|
+
function renderAgyAgentsMd() {
|
|
1512
|
+
return renderAgentsMd(
|
|
1513
|
+
"Use Coding Friend skills with Antigravity slash commands (`/cf-*`).",
|
|
1514
|
+
"/"
|
|
1515
|
+
);
|
|
1516
|
+
}
|
|
1334
1517
|
function ensureGitignoreEntry(entry) {
|
|
1335
1518
|
const gitignorePath = ".gitignore";
|
|
1336
1519
|
const existing = existsSync(gitignorePath) ? readFileSync(gitignorePath, "utf8") : "";
|
|
@@ -1,49 +1,55 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getLatestVersion,
|
|
3
3
|
semverCompare
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KTUPGMIV.js";
|
|
5
5
|
import {
|
|
6
6
|
getInstalledVersion
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Q2QDSYQT.js";
|
|
8
8
|
import "./chunk-3WIZA5OZ.js";
|
|
9
9
|
import {
|
|
10
10
|
ensureShellCompletion
|
|
11
11
|
} from "./chunk-667NMPN4.js";
|
|
12
12
|
import {
|
|
13
13
|
registerMemoryMcp
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CZW36H3D.js";
|
|
15
15
|
import {
|
|
16
16
|
enableMarketplaceAutoUpdate,
|
|
17
17
|
isMarketplaceRegistered,
|
|
18
18
|
isPluginDisabled
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-SUYE5S2W.js";
|
|
20
20
|
import {
|
|
21
21
|
deployCodexAgents,
|
|
22
22
|
findCodexAgentSourceDir,
|
|
23
23
|
isCodexMarketplaceRegistered,
|
|
24
24
|
setCodexPluginEnabled
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-RG3EMZH6.js";
|
|
26
26
|
import {
|
|
27
|
+
deployAgyPlugin,
|
|
27
28
|
deployOmpAgents,
|
|
29
|
+
resolveAgyPluginSource,
|
|
30
|
+
setAgyPluginEnabled,
|
|
31
|
+
validateAgyPlugin,
|
|
28
32
|
writeOmpExtensionEntry
|
|
29
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-KCBMCHSA.js";
|
|
30
34
|
import {
|
|
31
35
|
resolveHostFlags,
|
|
32
36
|
resolveScope
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
37
|
+
} from "./chunk-Z5XTSF7L.js";
|
|
38
|
+
import "./chunk-TN3Y75WG.js";
|
|
35
39
|
import {
|
|
40
|
+
checkAgyVersion,
|
|
36
41
|
checkCodexVersion,
|
|
37
42
|
checkOmpVersion
|
|
38
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-OBCNHQFA.js";
|
|
44
|
+
import "./chunk-5UVDWG5L.js";
|
|
39
45
|
import {
|
|
40
46
|
commandExists,
|
|
41
47
|
run
|
|
42
48
|
} from "./chunk-EVGXUDX4.js";
|
|
43
|
-
import "./chunk-5UVDWG5L.js";
|
|
44
49
|
import {
|
|
50
|
+
agyPluginDir,
|
|
45
51
|
devStatePath
|
|
46
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-IYBIIRH4.js";
|
|
47
53
|
import {
|
|
48
54
|
log,
|
|
49
55
|
printBanner
|
|
@@ -60,6 +66,9 @@ async function installCommand(opts = {}) {
|
|
|
60
66
|
} else if (host === "omp") {
|
|
61
67
|
await installOmpCommand(opts);
|
|
62
68
|
return;
|
|
69
|
+
} else if (host === "agy") {
|
|
70
|
+
await installAgyCommand();
|
|
71
|
+
return;
|
|
63
72
|
}
|
|
64
73
|
printBanner("\u2728 Coding Friend Install \u2728");
|
|
65
74
|
console.log();
|
|
@@ -248,6 +257,54 @@ async function installOmpCommand(opts = {}) {
|
|
|
248
257
|
log.dim("Skills inherit from ~/.claude \u2014 no extra skill install needed.");
|
|
249
258
|
log.dim("Restart omp (or start a new session) to pick up agents and MCP.");
|
|
250
259
|
}
|
|
260
|
+
var AGY_INSTALL_URL = "https://antigravity.google/";
|
|
261
|
+
async function installAgyCommand() {
|
|
262
|
+
printBanner("\u2728 Coding Friend Antigravity Install (beta) \u2728");
|
|
263
|
+
console.log();
|
|
264
|
+
if (!commandExists("agy")) {
|
|
265
|
+
log.error(`agy CLI not found. Install it first: ${AGY_INSTALL_URL}`);
|
|
266
|
+
process.exit(1);
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
const version = checkAgyVersion();
|
|
270
|
+
if (!version.ok) {
|
|
271
|
+
log.error(
|
|
272
|
+
`agy CLI ${version.actual ? `v${version.actual}` : "version"} is unsupported. Coding Friend requires agy CLI >= ${version.min}. Install or upgrade: ${AGY_INSTALL_URL}`
|
|
273
|
+
);
|
|
274
|
+
process.exit(1);
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
try {
|
|
278
|
+
const source = resolveAgyPluginSource();
|
|
279
|
+
log.step(`Installing Antigravity plugin (${source.kind} source)...`);
|
|
280
|
+
const { files } = deployAgyPlugin(source.path);
|
|
281
|
+
log.success(`Deployed ${files} Antigravity plugin file(s).`);
|
|
282
|
+
} catch (error) {
|
|
283
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
284
|
+
log.error(detail);
|
|
285
|
+
process.exit(1);
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
registerMemoryMcp("agy");
|
|
289
|
+
setAgyPluginEnabled(true);
|
|
290
|
+
const validation = validateAgyPlugin(agyPluginDir());
|
|
291
|
+
if (validation.stdout.trim()) {
|
|
292
|
+
console.log(validation.stdout.trimEnd());
|
|
293
|
+
}
|
|
294
|
+
if (validation.status !== 0) {
|
|
295
|
+
log.warn(
|
|
296
|
+
"agy plugin validate reported issues. Plugin files are still installed."
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
console.log();
|
|
300
|
+
log.success("Installed for Antigravity (beta).");
|
|
301
|
+
log.dim(
|
|
302
|
+
"Restart Antigravity (or start a new `agy` session) to pick up the plugin."
|
|
303
|
+
);
|
|
304
|
+
log.dim(
|
|
305
|
+
"Note: autoApprove in config enables Claude Code (LLM classifier), Antigravity, and Codex (deterministic rules)."
|
|
306
|
+
);
|
|
307
|
+
}
|
|
251
308
|
export {
|
|
252
309
|
installCommand
|
|
253
310
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveLearnDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-E4NBTQXR.js";
|
|
4
4
|
import "./chunk-3WIZA5OZ.js";
|
|
5
|
+
import {
|
|
6
|
+
readJson
|
|
7
|
+
} from "./chunk-5UVDWG5L.js";
|
|
5
8
|
import {
|
|
6
9
|
commandExists,
|
|
7
10
|
run,
|
|
8
11
|
runWithStderr,
|
|
9
12
|
streamExec
|
|
10
13
|
} from "./chunk-EVGXUDX4.js";
|
|
11
|
-
import {
|
|
12
|
-
readJson
|
|
13
|
-
} from "./chunk-5UVDWG5L.js";
|
|
14
14
|
import {
|
|
15
15
|
globalConfigPath
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-IYBIIRH4.js";
|
|
17
17
|
import {
|
|
18
18
|
log,
|
|
19
19
|
printBanner
|
|
@@ -4,42 +4,45 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
ensureMemoryBuilt,
|
|
6
6
|
printMemoryMcpConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-B44ROTV6.js";
|
|
8
8
|
import {
|
|
9
9
|
checkLearnMcpHealth,
|
|
10
10
|
checkMemoryMcpHealth,
|
|
11
11
|
detectMemoryMcpState,
|
|
12
12
|
printHealthSection,
|
|
13
13
|
warnStaleMcpJson
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TFF47F7P.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveLearnDir,
|
|
17
17
|
resolveMemoryDir
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-E4NBTQXR.js";
|
|
19
19
|
import "./chunk-3WIZA5OZ.js";
|
|
20
20
|
import {
|
|
21
21
|
isLearnMcpRegistered,
|
|
22
22
|
registerLearnMcp
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-NIMO4VJW.js";
|
|
24
24
|
import {
|
|
25
25
|
isMemoryMcpRegistered,
|
|
26
26
|
registerMemoryMcp
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-GTOEIGDM.js";
|
|
29
|
-
import "./chunk-VMODQCSL.js";
|
|
27
|
+
} from "./chunk-CZW36H3D.js";
|
|
30
28
|
import {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
isAgyPluginInstalled,
|
|
30
|
+
readAgyMcpConfig
|
|
31
|
+
} from "./chunk-KCBMCHSA.js";
|
|
32
|
+
import "./chunk-Z5XTSF7L.js";
|
|
34
33
|
import {
|
|
35
|
-
|
|
36
|
-
} from "./chunk-
|
|
34
|
+
getLibPath
|
|
35
|
+
} from "./chunk-TN3Y75WG.js";
|
|
36
|
+
import "./chunk-OBCNHQFA.js";
|
|
37
37
|
import {
|
|
38
38
|
readJson
|
|
39
39
|
} from "./chunk-5UVDWG5L.js";
|
|
40
|
+
import {
|
|
41
|
+
run
|
|
42
|
+
} from "./chunk-EVGXUDX4.js";
|
|
40
43
|
import {
|
|
41
44
|
globalConfigPath
|
|
42
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-IYBIIRH4.js";
|
|
43
46
|
import {
|
|
44
47
|
log,
|
|
45
48
|
printBanner
|
|
@@ -140,6 +143,16 @@ async function mcpCommand() {
|
|
|
140
143
|
}
|
|
141
144
|
console.log();
|
|
142
145
|
await printMemoryMcp();
|
|
146
|
+
printAgyMcpStatus();
|
|
147
|
+
}
|
|
148
|
+
function printAgyMcpStatus() {
|
|
149
|
+
if (!isAgyPluginInstalled()) return;
|
|
150
|
+
console.log();
|
|
151
|
+
printBanner("Antigravity MCP");
|
|
152
|
+
const cfg = readAgyMcpConfig();
|
|
153
|
+
const servers = cfg?.mcpServers ?? {};
|
|
154
|
+
const status = "coding-friend-memory" in servers ? "registered" : "not registered";
|
|
155
|
+
log.info(`coding-friend-memory: ${status} in plugin mcp_config.json`);
|
|
143
156
|
}
|
|
144
157
|
async function printMemoryMcp() {
|
|
145
158
|
const memoryDir = resolveMemoryDir();
|