skillfit 0.15.2 → 0.16.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/CHANGELOG.md +39 -0
- package/README.md +33 -25
- package/README.zh-CN.md +33 -25
- package/benches/code-review/ground-truth/r1.md +3 -3
- package/benches/code-review/verifiers/seeded-bugs.mjs +25 -10
- package/dist/agents/mcp-probe.js +138 -13
- package/dist/bench/authoring.js +10 -2
- package/dist/cli/definition.js +28 -10
- package/dist/cli/doctor.js +33 -14
- package/dist/cli/eval-report.js +1 -1
- package/dist/cli/main.js +53 -6
- package/dist/cli/mcp.js +23 -7
- package/dist/cli/report.js +4 -1
- package/dist/composition.js +16 -0
- package/dist/configuration/bundle.js +150 -47
- package/dist/configuration/install.js +109 -23
- package/dist/configuration/lock.js +28 -0
- package/dist/configuration/mcp-write.js +311 -0
- package/dist/configuration/uninstall.js +241 -0
- package/dist/configuration/upstream.js +3 -0
- package/dist/evaluation/records/session.js +16 -8
- package/docs/README.md +7 -7
- package/docs/guides/experiment-workflow.md +25 -0
- package/docs/guides/selectable-codex.md +35 -4
- package/docs/maintainers/architecture.md +1 -1
- package/docs/reference/eval-component.md +2 -2
- package/docs/schemas/doctor-report.schema.json +92 -0
- package/package.json +1 -1
- package/skills/skillfit/SKILL.md +18 -15
- package/tools/verify/recipes/0.11.0-feature-smoke.mjs +140 -491
- package/tools/verify/recipes/release-feature-smoke.mjs +8 -4
package/dist/cli/definition.js
CHANGED
|
@@ -3,13 +3,13 @@ import { DEFAULT_EVAL_TRIALS } from "./eval.js";
|
|
|
3
3
|
// Help and parseArgs declarations share this CLI-owned source.
|
|
4
4
|
const TITLE = `skillfit ${VERSION} — evidence-driven configuration for AI coding agents`;
|
|
5
5
|
const option = (text) => text;
|
|
6
|
-
const agent = option(" --agent <id> Target agent: claude-code | codex | kimi-code (default:
|
|
6
|
+
const agent = option(" --agent <id> Target/source agent: claude-code | codex | kimi-code (default: detected; bundle: codex)");
|
|
7
7
|
const judgeAgent = option(" --judge-agent <id> Drive a paired eval's blind judge (prefer a different family than --agent)");
|
|
8
8
|
const mode = option(" --mode <mode> Eval mode: inject (default) | installed (paired complete Skill) | trigger (single arm)");
|
|
9
9
|
const baselineSkill = option(" --baseline-skill <path> With --mode installed, compare a previous Skill version against the target");
|
|
10
10
|
const request = option(" --request <path> Version 1 Skill revision request (JSON output; excludes positional eval options)");
|
|
11
11
|
const planSha = option(" --plan-sha <hash> Confirm an eval/calibration/self-test dry-run plan (also needs --run-group)");
|
|
12
|
-
const json = option(" --json Machine output for bench check/self-test/list/show/edit/remove, report, eval and calibration");
|
|
12
|
+
const json = option(" --json Machine output for doctor, bench check/self-test/list/show/edit/remove, report, eval and calibration");
|
|
13
13
|
const spendingBudget = option(" --spending-budget <file> Eval/calibration/drafting: input, cachedInput, uncachedInput, output, durationSeconds stop lines");
|
|
14
14
|
const executorTimeout = option(" --executor-timeout-seconds <n|none> Eval/calibration/drafting: executor deadline (integer 1–3600; none requires Token-only budget)");
|
|
15
15
|
const pairOrder = option(" --pair-order <order> Paired eval: baseline-first (default) | balanced");
|
|
@@ -28,16 +28,22 @@ const trials = option(` --trials <n> Repetitions per condition for eval
|
|
|
28
28
|
const maxCalls = option(" --max-calls <n> Call ceiling for eval / bench check --calibrate / bench add --decompose\n Also controls baseline calibration repetitions");
|
|
29
29
|
const profile = option(' --profile <name> Profile for install (default: "recommended")');
|
|
30
30
|
const profilePath = option(" --profile-path <dir> Install a portable profile from a local directory");
|
|
31
|
-
const skill = option(" --skill <name> With
|
|
31
|
+
const skill = option(" --skill <name> With uninstall, select a managed Skill (repeatable)\n With bundle export/setup codex, include or select a Skill (repeatable)");
|
|
32
|
+
const server = option(" --server <name> With mcp check, select a named server from the Agent configuration");
|
|
33
|
+
const from = option(" --from <path> With mcp apply, read a validated probe spec without starting the server");
|
|
34
|
+
const remove = option(" --remove With mcp apply, remove the selected managed MCP entry");
|
|
32
35
|
const all = option(" --all With setup codex, select all catalog Skills (not an efficacy recommendation)");
|
|
33
36
|
const starter = option(" --starter With setup codex, select the legacy 13-Skill set (not evaluated as a set)");
|
|
34
37
|
const list = option(" --list With setup codex, list choices without downloading");
|
|
35
38
|
const noRules = option(" --no-rules With setup codex, skip the global AGENTS.md block");
|
|
39
|
+
const rules = option(" --rules With uninstall, remove the managed AGENTS.md rules block");
|
|
40
|
+
const allowSymlinkRoot = option(" --allow-symlink-root <dir> With bundle export, approve a specific Skill symlink source root (repeatable)");
|
|
41
|
+
const mcpExport = option(" --mcp <name> With bundle export, include a credential-free JSON MCP declaration (repeatable)");
|
|
36
42
|
const minSessions = option(" --min-sessions <n> With bundle export, default selection needs this many sessions (default: 2)");
|
|
37
43
|
const upstreamLock = option(" --upstream-lock <path> With bundle export, fetch listed GitHub Skills at pinned commits during setup");
|
|
38
|
-
const project = option(" --project
|
|
44
|
+
const project = option(" --project With install/uninstall/mcp selection, use current-project instead of user-level config");
|
|
39
45
|
const dryRun = option(" --dry-run Print the plan without writing anything");
|
|
40
|
-
const strict = option(" --strict With install --dry-run,
|
|
46
|
+
const strict = option(" --strict With doctor, exit 1 on FAIL findings; with install --dry-run, fail on conflicts");
|
|
41
47
|
const yes = option(" --yes Non-interactive mode (CI-friendly)");
|
|
42
48
|
const help = option(" --help, -h Show help");
|
|
43
49
|
const versionFlag = option(" --version, -v Show version");
|
|
@@ -49,14 +55,17 @@ function page(usage, options, extra = "") {
|
|
|
49
55
|
export const USAGE = `${TITLE}
|
|
50
56
|
|
|
51
57
|
Usage:
|
|
52
|
-
skillfit doctor [--agent <id>]
|
|
58
|
+
skillfit doctor [--agent <id>] [--json] [--strict] Inspect current agent configuration health
|
|
53
59
|
skillfit report [--agent <id>] [--json] Skill usage receipts from local session history (read-only)
|
|
54
60
|
skillfit eval <target-path> [options] A/B-test a Skill, rules, or MCP setup against a bench
|
|
55
61
|
skillfit mcp check <spec.json> Handshake with a stdio or Streamable HTTP MCP server and audit its tool catalog
|
|
62
|
+
skillfit mcp check --agent <id> --server <name> [--project] [--dry-run] Select a server from existing Agent configuration
|
|
63
|
+
skillfit mcp apply --agent <id> --server <name> (--from <probe.json> | --remove) [--project] [--dry-run] [--yes] Apply one managed JSON MCP entry without contacting it
|
|
56
64
|
skillfit bench <subcommand> [options] Scaffold, inspect, edit and validate tasks
|
|
57
65
|
skillfit install [options] Inspect or apply a managed configuration profile
|
|
66
|
+
skillfit uninstall [options] Remove selected managed Skills or AGENTS.md rules
|
|
58
67
|
skillfit setup codex [options] Select verified upstream Skills and global Codex guidance
|
|
59
|
-
skillfit bundle export <dir> [options] Export
|
|
68
|
+
skillfit bundle export <dir> [options] Export Codex/Kimi rules, Skills and safe MCP declarations
|
|
60
69
|
|
|
61
70
|
Run skillfit <command> --help for that command's options.
|
|
62
71
|
${common}
|
|
@@ -64,7 +73,7 @@ ${common}
|
|
|
64
73
|
Docs: https://github.com/remote-controlled-man/skillfit
|
|
65
74
|
`;
|
|
66
75
|
const COMMAND_HELP = {
|
|
67
|
-
doctor: page(" skillfit doctor [--agent <id>]
|
|
76
|
+
doctor: page(" skillfit doctor [--agent <id>] [--json] [--strict] Inspect current agent configuration health", [agent, json, strict].join("\n")),
|
|
68
77
|
report: page(` skillfit report [--agent <id>] [--json] Skill usage receipts from local session history (read-only)
|
|
69
78
|
skillfit report eval <summary-or-run-dir> Read paired, calibration or trigger reports (read-only)
|
|
70
79
|
skillfit report eval <summary-or-run-dir> --json Return a typed saved-evidence report for an Agent
|
|
@@ -93,7 +102,10 @@ const COMMAND_HELP = {
|
|
|
93
102
|
dryRun,
|
|
94
103
|
yes,
|
|
95
104
|
].join("\n")),
|
|
96
|
-
mcp: page(
|
|
105
|
+
mcp: page(` skillfit mcp check <spec.json> Handshake with a stdio or Streamable HTTP MCP server and audit its tool catalog
|
|
106
|
+
skillfit mcp check --agent <id> --server <name> [--project] [--dry-run] Select a server from existing Agent configuration
|
|
107
|
+
skillfit mcp apply --agent <id> --server <name> (--from <probe.json> | --remove) [--project] [--dry-run] [--yes] Apply one managed JSON MCP entry without contacting it`, [agent, server, project, from, remove, dryRun, yes].join("\n")),
|
|
108
|
+
uninstall: page(" skillfit uninstall --agent <id> (--skill <name> ... | --rules) [--project] [--dry-run] [--yes]", [agent, skill, rules, project, dryRun, yes].join("\n")),
|
|
97
109
|
bench: page(` skillfit bench init [dir] [--kind output|command] Scaffold a text-output or code-editing case
|
|
98
110
|
skillfit bench check [path-or-name] [--json] Validate a local/bundled bench offline
|
|
99
111
|
skillfit bench self-test <path-or-name> [--json] Check declared synthetic controls through the paired pipeline; zero model calls
|
|
@@ -158,7 +170,7 @@ bench add --from-commit options:
|
|
|
158
170
|
`),
|
|
159
171
|
install: page(" skillfit install [options] Inspect or apply a managed configuration profile", [agent, profile, profilePath, project, dryRun, strict, yes].join("\n")),
|
|
160
172
|
setup: page(" skillfit setup codex [options] Select verified upstream Skills and global Codex guidance", [skill, all, starter, list, noRules, dryRun, yes].join("\n")),
|
|
161
|
-
bundle: page(" skillfit bundle export <dir> [options] Export
|
|
173
|
+
bundle: page(" skillfit bundle export <dir> [options] Export Codex/Kimi rules, Skills and safe MCP declarations", [agent, skill, allowSymlinkRoot, mcpExport, minSessions, upstreamLock, dryRun, yes].join("\n")),
|
|
162
174
|
};
|
|
163
175
|
export function helpFor(command) {
|
|
164
176
|
return COMMAND_HELP[command];
|
|
@@ -191,6 +203,9 @@ export const CLI_OPTIONS = {
|
|
|
191
203
|
profile: { type: "string" },
|
|
192
204
|
"profile-path": { type: "string" },
|
|
193
205
|
skill: { type: "string", multiple: true },
|
|
206
|
+
"allow-symlink-root": { type: "string", multiple: true },
|
|
207
|
+
server: { type: "string" },
|
|
208
|
+
mcp: { type: "string", multiple: true },
|
|
194
209
|
all: { type: "boolean", default: false },
|
|
195
210
|
starter: { type: "boolean", default: false },
|
|
196
211
|
list: { type: "boolean", default: false },
|
|
@@ -206,6 +221,8 @@ export const CLI_OPTIONS = {
|
|
|
206
221
|
"prompt-file": { type: "string" },
|
|
207
222
|
freeze: { type: "boolean", default: false },
|
|
208
223
|
"from-commit": { type: "string" },
|
|
224
|
+
from: { type: "string" },
|
|
225
|
+
remove: { type: "boolean", default: false },
|
|
209
226
|
include: { type: "string", multiple: true },
|
|
210
227
|
"source-dir": { type: "string" },
|
|
211
228
|
"verifier-cmd": { type: "string" },
|
|
@@ -222,6 +239,7 @@ export const CLI_OPTIONS = {
|
|
|
222
239
|
json: { type: "boolean", default: false },
|
|
223
240
|
"dry-run": { type: "boolean", default: false },
|
|
224
241
|
project: { type: "boolean", default: false },
|
|
242
|
+
rules: { type: "boolean", default: false },
|
|
225
243
|
strict: { type: "boolean", default: false },
|
|
226
244
|
yes: { type: "boolean", default: false },
|
|
227
245
|
help: { type: "boolean", short: "h", default: false },
|
package/dist/cli/doctor.js
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { agentIds } from "../agents/matrix.js";
|
|
2
2
|
import { collectDoctorReport } from "../agents/health.js";
|
|
3
3
|
export { collectDoctorReport } from "../agents/health.js";
|
|
4
|
+
function summarizeDoctorReport(report) {
|
|
5
|
+
const checks = { total: 0, PASS: 0, WARN: 0, FAIL: 0, INFO: 0 };
|
|
6
|
+
for (const agent of report.health) {
|
|
7
|
+
for (const section of agent.sections) {
|
|
8
|
+
for (const item of section.checks) {
|
|
9
|
+
checks[item.status]++;
|
|
10
|
+
checks.total++;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
agents: {
|
|
16
|
+
detected: report.detection.filter((entry) => entry.detected).length,
|
|
17
|
+
total: report.detection.length,
|
|
18
|
+
},
|
|
19
|
+
checks,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
4
22
|
export function formatDoctorReport(report) {
|
|
5
23
|
const lines = [
|
|
6
24
|
"skillfit doctor — read-only configuration health report",
|
|
@@ -30,28 +48,29 @@ export function formatDoctorReport(report) {
|
|
|
30
48
|
}
|
|
31
49
|
}
|
|
32
50
|
}
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
for (const agent of report.health) {
|
|
36
|
-
for (const section of agent.sections) {
|
|
37
|
-
for (const item of section.checks) {
|
|
38
|
-
counts[item.status]++;
|
|
39
|
-
total++;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const detected = report.detection.filter((entry) => entry.detected).length;
|
|
44
|
-
lines.push("", "Summary", "=======", `${detected}/${report.detection.length} agents detected — ${total} checks: ${counts.PASS} PASS, ${counts.WARN} WARN, ${counts.FAIL} FAIL, ${counts.INFO} INFO`, "Findings are advisory: skillfit doctor is read-only and always exits 0.");
|
|
51
|
+
const summary = summarizeDoctorReport(report);
|
|
52
|
+
lines.push("", "Summary", "=======", `${summary.agents.detected}/${summary.agents.total} agents detected — ${summary.checks.total} checks: ${summary.checks.PASS} PASS, ${summary.checks.WARN} WARN, ${summary.checks.FAIL} FAIL, ${summary.checks.INFO} INFO`, "Findings are advisory by default; skillfit doctor is read-only. Use --strict to exit 1 on FAIL.");
|
|
45
53
|
return lines.join("\n");
|
|
46
54
|
}
|
|
55
|
+
export function formatDoctorReportJson(report) {
|
|
56
|
+
return JSON.stringify({
|
|
57
|
+
schemaVersion: 1,
|
|
58
|
+
kind: "skillfit.doctor-report",
|
|
59
|
+
...report,
|
|
60
|
+
summary: summarizeDoctorReport(report),
|
|
61
|
+
}, null, 2);
|
|
62
|
+
}
|
|
47
63
|
export async function runDoctor(args = {}) {
|
|
48
64
|
if (args.agent !== undefined && !agentIds().includes(args.agent)) {
|
|
49
65
|
console.error(`Unknown agent "${args.agent}". Known agents: ${agentIds().join(", ")}`);
|
|
50
|
-
// A usage error, not a finding. Findings are advisory
|
|
66
|
+
// A usage error, not a finding. Findings are advisory by default, but an unrecognised
|
|
51
67
|
// --agent means the health check never ran, and exiting 0 there lets CI read a typo as a clean
|
|
52
68
|
// bill of health. 2 is this CLI's usage-error code.
|
|
53
69
|
process.exitCode = 2;
|
|
54
70
|
return;
|
|
55
71
|
}
|
|
56
|
-
|
|
72
|
+
const report = collectDoctorReport({ agent: args.agent });
|
|
73
|
+
if (args.strict && summarizeDoctorReport(report).checks.FAIL > 0)
|
|
74
|
+
process.exitCode = 1;
|
|
75
|
+
console.log(args.json ? formatDoctorReportJson(report) : formatDoctorReport(report));
|
|
57
76
|
}
|
package/dist/cli/eval-report.js
CHANGED
|
@@ -177,7 +177,7 @@ export function renderEvalMarkdown(report) {
|
|
|
177
177
|
lines.push("- None");
|
|
178
178
|
else
|
|
179
179
|
lines.push(...report.warnings.map((warning) => `- ${escapeMarkdown(warning)}`));
|
|
180
|
-
lines.push("", "The verdict follows [the skillfit metrics protocol](https://github.com/remote-controlled-man/skillfit/blob/main/docs/metrics.md). Review the pinned manifest before comparing runs.", "");
|
|
180
|
+
lines.push("", "The verdict follows [the skillfit metrics protocol](https://github.com/remote-controlled-man/skillfit/blob/main/docs/reference/metrics.md). Review the pinned manifest before comparing runs.", "");
|
|
181
181
|
return lines.join("\n");
|
|
182
182
|
}
|
|
183
183
|
export async function runEvalReport(inputPath, log = console.log, options = {}) {
|
package/dist/cli/main.js
CHANGED
|
@@ -17,7 +17,7 @@ import { parseSpendingBudget } from "../evaluation/execution/budget.js";
|
|
|
17
17
|
import { runEvalReport } from "./eval-report.js";
|
|
18
18
|
import { componentError, runEvalComponent } from "./eval-component.js";
|
|
19
19
|
import { readEvaluationReport } from "./evaluation-report.js";
|
|
20
|
-
import { runInstall } from "../composition.js";
|
|
20
|
+
import { runInstall, runMcpApply, runUninstall } from "../composition.js";
|
|
21
21
|
import { runMcpCheck } from "./mcp.js";
|
|
22
22
|
import { runReport } from "./report.js";
|
|
23
23
|
import { runCodexSetup } from "../composition.js";
|
|
@@ -219,7 +219,7 @@ async function main() {
|
|
|
219
219
|
}
|
|
220
220
|
switch (command) {
|
|
221
221
|
case "doctor":
|
|
222
|
-
await runDoctor(common);
|
|
222
|
+
await runDoctor({ ...common, json: values.json ?? false, strict: values.strict ?? false });
|
|
223
223
|
return;
|
|
224
224
|
case "report":
|
|
225
225
|
if (positionals[1] === "eval") {
|
|
@@ -347,12 +347,42 @@ async function main() {
|
|
|
347
347
|
return;
|
|
348
348
|
}
|
|
349
349
|
case "mcp": {
|
|
350
|
-
|
|
351
|
-
|
|
350
|
+
const specPath = positionals[2];
|
|
351
|
+
const server = values.server;
|
|
352
|
+
if (positionals[1] === "apply") {
|
|
353
|
+
if (!values.agent ||
|
|
354
|
+
!server ||
|
|
355
|
+
(!values.from && !values.remove) ||
|
|
356
|
+
(values.from !== undefined && values.remove)) {
|
|
357
|
+
console.error("Usage: skillfit mcp apply --agent <id> --server <name> (--from <probe.json> | --remove) [--project] [--dry-run] [--yes]");
|
|
358
|
+
process.exitCode = 2;
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
await runMcpApply({
|
|
362
|
+
...common,
|
|
363
|
+
agent: values.agent,
|
|
364
|
+
server,
|
|
365
|
+
from: values.from,
|
|
366
|
+
remove: values.remove ?? false,
|
|
367
|
+
project: values.project ?? false,
|
|
368
|
+
});
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
if (positionals[1] !== "check" ||
|
|
372
|
+
(specPath !== undefined && server !== undefined) ||
|
|
373
|
+
(specPath === undefined && (!values.agent || !server))) {
|
|
374
|
+
console.error("Usage: skillfit mcp check <spec.json> [--dry-run]\n" +
|
|
375
|
+
" skillfit mcp check --agent <id> --server <name> [--project] [--dry-run]");
|
|
352
376
|
process.exitCode = 2;
|
|
353
377
|
return;
|
|
354
378
|
}
|
|
355
|
-
await runMcpCheck({
|
|
379
|
+
await runMcpCheck({
|
|
380
|
+
specPath,
|
|
381
|
+
agent: values.agent,
|
|
382
|
+
server,
|
|
383
|
+
project: values.project ?? false,
|
|
384
|
+
dryRun: values["dry-run"] ?? false,
|
|
385
|
+
});
|
|
356
386
|
return;
|
|
357
387
|
}
|
|
358
388
|
case "install":
|
|
@@ -364,6 +394,20 @@ async function main() {
|
|
|
364
394
|
strict: values.strict ?? false,
|
|
365
395
|
});
|
|
366
396
|
return;
|
|
397
|
+
case "uninstall":
|
|
398
|
+
if (!values.agent || (!values.skill?.length && !values.rules)) {
|
|
399
|
+
console.error("Usage: skillfit uninstall --agent <id> (--skill <name> ... | --rules) [--project] [--dry-run] [--yes]");
|
|
400
|
+
process.exitCode = 2;
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
await runUninstall({
|
|
404
|
+
...common,
|
|
405
|
+
agent: values.agent,
|
|
406
|
+
skills: values.skill,
|
|
407
|
+
rules: values.rules ?? false,
|
|
408
|
+
project: values.project ?? false,
|
|
409
|
+
});
|
|
410
|
+
return;
|
|
367
411
|
case "setup":
|
|
368
412
|
if (positionals[1] !== "codex") {
|
|
369
413
|
console.error("Usage: skillfit setup codex [--list | --starter | --all | --skill <name> ...] [--no-rules] [--dry-run] [--yes]");
|
|
@@ -383,13 +427,16 @@ async function main() {
|
|
|
383
427
|
return;
|
|
384
428
|
case "bundle": {
|
|
385
429
|
if (positionals[1] !== "export" || !positionals[2]) {
|
|
386
|
-
console.error("Usage: skillfit bundle export <dir> [--skill <name> ...] [--upstream-lock <path>] [--min-sessions <n>] [--dry-run] [--yes]");
|
|
430
|
+
console.error("Usage: skillfit bundle export <dir> [--agent codex|kimi-code] [--skill <name> ...] [--allow-symlink-root <dir> ...] [--mcp <name> ...] [--upstream-lock <path>] [--min-sessions <n>] [--dry-run] [--yes]");
|
|
387
431
|
process.exitCode = 2;
|
|
388
432
|
return;
|
|
389
433
|
}
|
|
390
434
|
await runBundleExport({
|
|
391
435
|
outputDir: positionals[2],
|
|
436
|
+
agent: values.agent,
|
|
392
437
|
skillNames: values.skill,
|
|
438
|
+
allowedSkillLinkRoots: values["allow-symlink-root"],
|
|
439
|
+
mcpServerNames: values.mcp,
|
|
393
440
|
minSessions: values["min-sessions"] === undefined ? undefined : Number(values["min-sessions"]),
|
|
394
441
|
upstreamLockPath: values["upstream-lock"],
|
|
395
442
|
dryRun: values["dry-run"] ?? false,
|
package/dist/cli/mcp.js
CHANGED
|
@@ -1,20 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { homedir } from "node:os";
|
|
2
|
+
import { loadMcpProbeSpec, probeMcp, renderMcpProbe, selectAgentMcpProbe, } from "../agents/mcp-probe.js";
|
|
2
3
|
export async function runMcpCheck(options) {
|
|
3
4
|
const log = options.log ?? ((message) => console.log(message));
|
|
4
|
-
|
|
5
|
+
if (options.specPath !== undefined && options.server !== undefined)
|
|
6
|
+
throw new Error("Choose either an MCP probe spec path or --server selection, not both.");
|
|
7
|
+
if (options.specPath === undefined && (!options.agent || !options.server))
|
|
8
|
+
throw new Error("Real-config MCP checks require both --agent and --server.");
|
|
9
|
+
const selected = options.specPath === undefined
|
|
10
|
+
? selectAgentMcpProbe({
|
|
11
|
+
agent: options.agent,
|
|
12
|
+
server: options.server,
|
|
13
|
+
project: options.project ?? false,
|
|
14
|
+
homeDir: options.homeDir ?? homedir(),
|
|
15
|
+
cwd: options.cwd ?? process.cwd(),
|
|
16
|
+
env: options.env ?? process.env,
|
|
17
|
+
})
|
|
18
|
+
: null;
|
|
19
|
+
const spec = selected?.spec ?? loadMcpProbeSpec(options.specPath);
|
|
5
20
|
if (options.dryRun) {
|
|
6
21
|
const target = spec.transport === "http"
|
|
7
22
|
? `Endpoint : ${new URL(spec.url).origin}${new URL(spec.url).pathname} (query withheld)`
|
|
8
23
|
: `Command : ${spec.command} (${spec.args.length} argument(s); values withheld)`;
|
|
9
|
-
|
|
24
|
+
const lines = [
|
|
10
25
|
"MCP check plan (dry run)",
|
|
11
26
|
`Server : ${spec.name}`,
|
|
12
27
|
`Transport: ${spec.transport}`,
|
|
13
28
|
target,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
29
|
+
];
|
|
30
|
+
if (selected)
|
|
31
|
+
lines.push(`Source : ${selected.sourcePath}`, `Scope : ${selected.scope}`);
|
|
32
|
+
lines.push("Checks : initialize handshake, capabilities, tools/list, unique names, descriptions, input schemas, annotations", "Tool calls: none", "Dry run — the server was not contacted.");
|
|
33
|
+
log(lines.join("\n"));
|
|
18
34
|
return null;
|
|
19
35
|
}
|
|
20
36
|
const result = await probeMcp(spec);
|
package/dist/cli/report.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getAgent } from "../agents/matrix.js";
|
|
1
2
|
import { collectReceipts } from "../usage/receipts.js";
|
|
2
3
|
const OTHER_READS_SHOWN = 8;
|
|
3
4
|
function pad(text, width) {
|
|
@@ -19,6 +20,8 @@ function renderAgent(receipt, lines) {
|
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
22
|
lines.push(`${receipt.agentId} — ${receipt.sessionsFound} session(s), ${receipt.transcriptsRead} transcript(s)`);
|
|
23
|
+
const nativeSignal = getAgent(receipt.agentId).sessions?.skillToolName;
|
|
24
|
+
lines.push(` signal: ${nativeSignal ? `native ${nativeSignal} invocation events` : "registered SKILL.md read commands; not native Skill events"}`);
|
|
22
25
|
const installed = new Set(receipt.installed);
|
|
23
26
|
const installedFired = receipt.skills.filter((skill) => installed.has(skill.name));
|
|
24
27
|
const rows = installed.size === 0
|
|
@@ -84,7 +87,7 @@ export function renderReceipts(receipts) {
|
|
|
84
87
|
const never = [...installed].filter((name) => !firedNames.has(name)).sort();
|
|
85
88
|
lines.push(`Overall: ${installed.size} installed skill(s), ${fired.length} observed firing, ${never.length} with no observed fire in retained history.`);
|
|
86
89
|
if (never.length > 0) {
|
|
87
|
-
lines.push("Treat this as a prioritization signal, not proof of uselessness: install dates are unavailable.
|
|
90
|
+
lines.push("Treat this as a prioritization signal, not proof of uselessness: install dates are unavailable.", "Preview a bounded trigger check with: skillfit eval <skill> --mode trigger --dry-run. Trigger observations are not task-quality outcomes or evidence of benefit.");
|
|
88
91
|
}
|
|
89
92
|
return lines.join("\n");
|
|
90
93
|
}
|
package/dist/composition.js
CHANGED
|
@@ -8,6 +8,8 @@ import * as evaluation from "./evaluation/application/evaluation.js";
|
|
|
8
8
|
import { readEvaluation as read } from "./evaluation/application/read.js";
|
|
9
9
|
import { runBenchSelfTest as selfTest, } from "./evaluation/application/self-test.js";
|
|
10
10
|
import { runInstall as install } from "./configuration/install.js";
|
|
11
|
+
import { runUninstall as uninstall } from "./configuration/uninstall.js";
|
|
12
|
+
import { runMcpApply as mcpApply } from "./configuration/mcp-write.js";
|
|
11
13
|
import { runBundleExport as bundle } from "./configuration/bundle.js";
|
|
12
14
|
import { runCodexSetup as setup } from "./configuration/setup.js";
|
|
13
15
|
export function executeEvalPlan(...args) {
|
|
@@ -37,6 +39,20 @@ export function runInstall(options) {
|
|
|
37
39
|
log: options.log ?? console.log,
|
|
38
40
|
});
|
|
39
41
|
}
|
|
42
|
+
export function runUninstall(options) {
|
|
43
|
+
return uninstall({
|
|
44
|
+
...options,
|
|
45
|
+
confirm: options.confirm ?? confirm,
|
|
46
|
+
log: options.log ?? console.log,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export function runMcpApply(options) {
|
|
50
|
+
return mcpApply({
|
|
51
|
+
...options,
|
|
52
|
+
confirm: options.confirm ?? confirm,
|
|
53
|
+
log: options.log ?? console.log,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
40
56
|
export function runBundleExport(options) {
|
|
41
57
|
return bundle({
|
|
42
58
|
...options,
|