coding-friend-cli 1.33.1 → 1.34.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/{chunk-LK6HFD35.js → chunk-AZ6AK5M4.js} +22 -10
- package/dist/chunk-CZDXMFEZ.js +118 -0
- package/dist/{chunk-OYPOADCX.js → chunk-DHH6SRXV.js} +0 -1
- package/dist/{chunk-G2P43ZK2.js → chunk-FAANBGCB.js} +78 -150
- package/dist/chunk-FI5HEQ43.js +85 -0
- package/dist/{chunk-UGTNIFBH.js → chunk-G4QGJEV7.js} +1 -1
- package/dist/{chunk-XOHLBLN2.js → chunk-LXZ47XCD.js} +1 -1
- package/dist/{chunk-NZKIYVIK.js → chunk-QCKIBJF6.js} +1 -1
- package/dist/{chunk-OV4AUDXL.js → config-44VQBNMS.js} +5 -78
- package/dist/{dev-S6VZUD33.js → dev-QXVERU42.js} +2 -2
- package/dist/{host-Y4N4PI4N.js → host-6IBKKCPA.js} +2 -2
- package/dist/index.js +26 -26
- package/dist/{init-HS4EXSXW.js → init-KY3ZPEWP.js} +7 -19
- package/dist/{install-FKL6WLIG.js → install-22BLHQ6D.js} +3 -3
- package/dist/{mcp-BD2K7OL6.js → mcp-OGZAZZRF.js} +70 -15
- package/dist/{memory-FZMACIGE.js → memory-JM45DEIX.js} +5 -4
- package/dist/{session-RHXTVNRU.js → session-RCEE6P35.js} +2 -2
- package/dist/{status-V2A7RSSM.js → status-NMSVOSC4.js} +84 -7
- package/dist/{statusline-MLLKBHHR.js → statusline-GKVAX7GR.js} +2 -2
- package/dist/{update-G5HZINBK.js → update-P5ZR2JVQ.js} +3 -3
- package/package.json +1 -1
- package/dist/config-2OJTBZU2.js +0 -22
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_CONFIG
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DHH6SRXV.js";
|
|
4
4
|
import {
|
|
5
5
|
globalConfigPath,
|
|
6
6
|
localConfigPath,
|
|
@@ -66,11 +66,6 @@ var MemoryConfigSchema = z.object({
|
|
|
66
66
|
autoCapture: z.boolean().optional(),
|
|
67
67
|
autoStart: z.boolean().optional()
|
|
68
68
|
});
|
|
69
|
-
var CodexConfigSchema = z.strictObject({
|
|
70
|
-
enabled: z.boolean().optional(),
|
|
71
|
-
modes: z.array(z.enum(["QUICK", "STANDARD", "DEEP"])).optional(),
|
|
72
|
-
effort: z.enum(["minimal", "low", "medium", "high", "xhigh"]).optional()
|
|
73
|
-
});
|
|
74
69
|
var ConfigSchema = z.strictObject({
|
|
75
70
|
language: z.string().optional(),
|
|
76
71
|
docsDir: z.string().optional(),
|
|
@@ -79,8 +74,7 @@ var ConfigSchema = z.strictObject({
|
|
|
79
74
|
memory: MemoryConfigSchema.optional(),
|
|
80
75
|
autoApprove: z.boolean().optional(),
|
|
81
76
|
autoApproveIgnore: z.array(z.string()).optional(),
|
|
82
|
-
autoApproveAllowExtra: z.array(z.string()).optional()
|
|
83
|
-
codex: CodexConfigSchema.optional()
|
|
77
|
+
autoApproveAllowExtra: z.array(z.string()).optional()
|
|
84
78
|
});
|
|
85
79
|
var KNOWN_KEYS = [
|
|
86
80
|
"language",
|
|
@@ -90,8 +84,7 @@ var KNOWN_KEYS = [
|
|
|
90
84
|
"memory",
|
|
91
85
|
"autoApprove",
|
|
92
86
|
"autoApproveIgnore",
|
|
93
|
-
"autoApproveAllowExtra"
|
|
94
|
-
"codex"
|
|
87
|
+
"autoApproveAllowExtra"
|
|
95
88
|
];
|
|
96
89
|
function suggestKey(unknown) {
|
|
97
90
|
let best = null;
|
|
@@ -160,6 +153,24 @@ function stripPath(obj, path) {
|
|
|
160
153
|
}
|
|
161
154
|
delete current[String(path[path.length - 1])];
|
|
162
155
|
}
|
|
156
|
+
function sanitizeRawConfig(raw) {
|
|
157
|
+
const result = ConfigSchema.safeParse(raw);
|
|
158
|
+
if (result.success) {
|
|
159
|
+
return result.data;
|
|
160
|
+
}
|
|
161
|
+
const unknownKeys = [];
|
|
162
|
+
for (const issue of result.error.issues) {
|
|
163
|
+
if (issue.code === "unrecognized_keys") {
|
|
164
|
+
const keys = issue.keys ?? [];
|
|
165
|
+
unknownKeys.push(...keys);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const keyList = unknownKeys.length > 0 ? `: ${unknownKeys.join(", ")}` : "";
|
|
169
|
+
log.warn(
|
|
170
|
+
`sanitizeRawConfig: unrecognized config keys${keyList} \u2014 returning raw config`
|
|
171
|
+
);
|
|
172
|
+
return raw;
|
|
173
|
+
}
|
|
163
174
|
function loadConfig() {
|
|
164
175
|
const global = readJson(globalConfigPath());
|
|
165
176
|
const local = readJson(localConfigPath());
|
|
@@ -196,6 +207,7 @@ function resolveMemoryDir(explicitPath) {
|
|
|
196
207
|
}
|
|
197
208
|
|
|
198
209
|
export {
|
|
210
|
+
sanitizeRawConfig,
|
|
199
211
|
loadConfig,
|
|
200
212
|
resolveDocsDir,
|
|
201
213
|
resolveMemoryDir
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import {
|
|
2
|
+
detectMemoryMcpState
|
|
3
|
+
} from "./chunk-FI5HEQ43.js";
|
|
4
|
+
|
|
5
|
+
// src/lib/mcp-health.ts
|
|
6
|
+
async function checkMemoryMcpHealth(deps) {
|
|
7
|
+
const checks = [];
|
|
8
|
+
const mcpJson = deps.readMcpJson();
|
|
9
|
+
const state = detectMemoryMcpState(mcpJson, deps.pathExists);
|
|
10
|
+
if (state.kind === "npx") {
|
|
11
|
+
checks.push({ label: "Config (.mcp.json)", ok: true });
|
|
12
|
+
} else if (state.kind === "none") {
|
|
13
|
+
checks.push({
|
|
14
|
+
label: "Config (.mcp.json)",
|
|
15
|
+
ok: false,
|
|
16
|
+
detail: "coding-friend-memory not configured",
|
|
17
|
+
fix: 'Run "cf memory mcp" to add the MCP entry'
|
|
18
|
+
});
|
|
19
|
+
} else {
|
|
20
|
+
const detail = state.kind === "stale" ? `Stale path: ${state.path}` : `Absolute path (legacy): ${state.path}`;
|
|
21
|
+
checks.push({
|
|
22
|
+
label: "Config (.mcp.json)",
|
|
23
|
+
ok: false,
|
|
24
|
+
detail,
|
|
25
|
+
fix: 'Run "cf memory mcp" to update to the npx format'
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const distExists = deps.pathExists(deps.memoryDistPath);
|
|
29
|
+
checks.push({
|
|
30
|
+
label: "Package built",
|
|
31
|
+
ok: distExists,
|
|
32
|
+
...distExists ? {} : {
|
|
33
|
+
detail: "cf-memory not built",
|
|
34
|
+
fix: 'Run "cf memory init" to build'
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
let daemonRunning = false;
|
|
38
|
+
let daemonCheckError;
|
|
39
|
+
try {
|
|
40
|
+
daemonRunning = await deps.isDaemonRunning();
|
|
41
|
+
} catch (err) {
|
|
42
|
+
daemonCheckError = err instanceof Error ? err.message : String(err);
|
|
43
|
+
}
|
|
44
|
+
checks.push({
|
|
45
|
+
label: "Daemon status",
|
|
46
|
+
ok: daemonRunning,
|
|
47
|
+
...daemonRunning ? {} : {
|
|
48
|
+
warn: true,
|
|
49
|
+
detail: daemonCheckError ? `check failed: ${daemonCheckError}` : "stopped (starts automatically on MCP connect)"
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const ok = checks.every((c) => c.ok || c.warn === true);
|
|
53
|
+
return { checks, ok };
|
|
54
|
+
}
|
|
55
|
+
async function checkLearnMcpHealth(deps) {
|
|
56
|
+
const checks = [];
|
|
57
|
+
const mcpJson = deps.readMcpJson();
|
|
58
|
+
const servers = mcpJson?.mcpServers;
|
|
59
|
+
const hasEntry = servers != null && typeof servers === "object" && !Array.isArray(servers) && "coding-friend-learn" in servers;
|
|
60
|
+
checks.push({
|
|
61
|
+
label: "Config (.mcp.json)",
|
|
62
|
+
ok: hasEntry,
|
|
63
|
+
...hasEntry ? {} : {
|
|
64
|
+
detail: "coding-friend-learn not configured",
|
|
65
|
+
fix: 'Run "cf mcp" to print the config snippet and add it'
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
const distExists = deps.pathExists(deps.learnMcpDistPath);
|
|
69
|
+
checks.push({
|
|
70
|
+
label: "Package built",
|
|
71
|
+
ok: distExists,
|
|
72
|
+
...distExists ? {} : {
|
|
73
|
+
detail: "learn-mcp not built",
|
|
74
|
+
fix: 'Run "cf mcp" to install and build'
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
const mdFiles = deps.listMdFiles(deps.docsDir);
|
|
78
|
+
const hasDocs = mdFiles.length > 0;
|
|
79
|
+
checks.push({
|
|
80
|
+
label: "Docs directory",
|
|
81
|
+
ok: hasDocs,
|
|
82
|
+
...hasDocs ? {} : {
|
|
83
|
+
detail: `No .md files found in ${deps.docsDir}`,
|
|
84
|
+
fix: 'Run "/cf-learn" to generate docs'
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
const ok = checks.every((c) => c.ok || c.warn === true);
|
|
88
|
+
return { checks, ok };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// src/lib/fs-utils.ts
|
|
92
|
+
import { readdirSync } from "fs";
|
|
93
|
+
import { join } from "path";
|
|
94
|
+
function listMdFilesRecursive(dir, maxDepth = 15) {
|
|
95
|
+
try {
|
|
96
|
+
const results = [];
|
|
97
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
98
|
+
if (entry.isDirectory()) {
|
|
99
|
+
if (maxDepth > 0) {
|
|
100
|
+
results.push(
|
|
101
|
+
...listMdFilesRecursive(join(dir, entry.name), maxDepth - 1)
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
} else if (entry.name.endsWith(".md") && entry.name !== "README.md") {
|
|
105
|
+
results.push(entry.name);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return results;
|
|
109
|
+
} catch {
|
|
110
|
+
return [];
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export {
|
|
115
|
+
checkMemoryMcpHealth,
|
|
116
|
+
checkLearnMcpHealth,
|
|
117
|
+
listMdFilesRecursive
|
|
118
|
+
};
|
|
@@ -22,7 +22,6 @@ var ALL_COMPONENT_IDS = STATUSLINE_COMPONENTS.map((c) => c.id);
|
|
|
22
22
|
var DEFAULT_CONFIG = {
|
|
23
23
|
language: "en",
|
|
24
24
|
docsDir: "docs",
|
|
25
|
-
codex: { enabled: false, modes: ["STANDARD", "DEEP"], effort: "medium" },
|
|
26
25
|
learn: {
|
|
27
26
|
language: "en",
|
|
28
27
|
outputDir: "docs/learn",
|