@cleocode/caamp 2026.10.4 → 2026.10.5
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-3OL6CAMT.js → chunk-E2QFVEIS.js} +18 -6
- package/dist/chunk-E2QFVEIS.js.map +1 -0
- package/dist/{chunk-UIXTFV35.js → chunk-JR6T47PC.js} +45 -7
- package/dist/chunk-JR6T47PC.js.map +1 -0
- package/dist/cli.js +205 -179
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +61 -2
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/{injector-KSFK5LF2.js → injector-Q6KCKS76.js} +4 -2
- package/package.json +7 -7
- package/dist/chunk-3OL6CAMT.js.map +0 -1
- package/dist/chunk-UIXTFV35.js.map +0 -1
- /package/dist/{injector-KSFK5LF2.js.map → injector-Q6KCKS76.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
tokenizeCriteriaValue,
|
|
60
60
|
updateInstructionsSingleOperation,
|
|
61
61
|
validateSkill
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-E2QFVEIS.js";
|
|
63
63
|
import {
|
|
64
64
|
buildSkillsMap,
|
|
65
65
|
checkAllInjections,
|
|
@@ -71,8 +71,9 @@ import {
|
|
|
71
71
|
getRegistryVersion,
|
|
72
72
|
groupByInstructFile,
|
|
73
73
|
injectAll,
|
|
74
|
+
isHomeProject,
|
|
74
75
|
providerSupports
|
|
75
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-JR6T47PC.js";
|
|
76
77
|
import {
|
|
77
78
|
CANONICAL_HOOK_EVENTS,
|
|
78
79
|
buildHookMatrix,
|
|
@@ -451,6 +452,7 @@ function registerAdvancedInstructions(parent) {
|
|
|
451
452
|
},
|
|
452
453
|
data: opts.details ? summary : {
|
|
453
454
|
updatedFiles: summary.updatedFiles,
|
|
455
|
+
...summary.skipped !== void 0 ? { skipped: summary.skipped } : {},
|
|
454
456
|
files: summary.actions.map((entry) => ({
|
|
455
457
|
file: entry.file,
|
|
456
458
|
action: entry.action
|
|
@@ -1207,7 +1209,27 @@ Instruction file status (${scope}):
|
|
|
1207
1209
|
}
|
|
1208
1210
|
|
|
1209
1211
|
// src/commands/instructions/inject.ts
|
|
1212
|
+
import pc5 from "picocolors";
|
|
1213
|
+
|
|
1214
|
+
// src/commands/instructions/home-refusal.ts
|
|
1210
1215
|
import pc4 from "picocolors";
|
|
1216
|
+
var HOME_PROJECT_MESSAGE = "Refusing to write project instruction files in your home directory: providers load them from every ancestor directory, so they would apply to every project under it. Run this inside a project directory, or pass --global for the global instruction files.";
|
|
1217
|
+
function refuseHomeProject(operation, mvi, format) {
|
|
1218
|
+
if (format === "json") {
|
|
1219
|
+
emitJsonError(
|
|
1220
|
+
operation,
|
|
1221
|
+
mvi,
|
|
1222
|
+
ErrorCodes.HOME_INSTRUCTION_FILE,
|
|
1223
|
+
HOME_PROJECT_MESSAGE,
|
|
1224
|
+
ErrorCategories.VALIDATION
|
|
1225
|
+
);
|
|
1226
|
+
} else {
|
|
1227
|
+
console.error(pc4.red(HOME_PROJECT_MESSAGE));
|
|
1228
|
+
}
|
|
1229
|
+
process.exit(1);
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
// src/commands/instructions/inject.ts
|
|
1211
1233
|
function registerInstructionsInject(parent) {
|
|
1212
1234
|
parent.command("inject").description("Inject instruction blocks into all provider files").option(
|
|
1213
1235
|
"-a, --agent <name>",
|
|
@@ -1255,12 +1277,15 @@ function registerInstructionsInject(parent) {
|
|
|
1255
1277
|
ErrorCategories.NOT_FOUND
|
|
1256
1278
|
);
|
|
1257
1279
|
} else {
|
|
1258
|
-
console.error(
|
|
1280
|
+
console.error(pc5.red(message));
|
|
1259
1281
|
}
|
|
1260
1282
|
process.exit(1);
|
|
1261
1283
|
}
|
|
1262
1284
|
const content = opts.content ?? generateInjectionContent();
|
|
1263
1285
|
const scope = opts.global ? "global" : "project";
|
|
1286
|
+
if (scope === "project" && isHomeProject(process.cwd())) {
|
|
1287
|
+
refuseHomeProject(operation, mvi, format);
|
|
1288
|
+
}
|
|
1264
1289
|
const groups = groupByInstructFile(providers);
|
|
1265
1290
|
if (opts.dryRun) {
|
|
1266
1291
|
if (format === "json") {
|
|
@@ -1275,13 +1300,13 @@ function registerInstructionsInject(parent) {
|
|
|
1275
1300
|
}))
|
|
1276
1301
|
});
|
|
1277
1302
|
} else {
|
|
1278
|
-
console.log(
|
|
1303
|
+
console.log(pc5.bold("Dry run - would inject into:\n"));
|
|
1279
1304
|
for (const [file, group] of groups) {
|
|
1280
|
-
console.log(` ${
|
|
1305
|
+
console.log(` ${pc5.bold(file)}: ${group.map((p) => p.id).join(", ")}`);
|
|
1281
1306
|
}
|
|
1282
|
-
console.log(
|
|
1307
|
+
console.log(pc5.dim(`
|
|
1283
1308
|
Scope: ${scope}`));
|
|
1284
|
-
console.log(
|
|
1309
|
+
console.log(pc5.dim(` Content length: ${content.length} chars`));
|
|
1285
1310
|
}
|
|
1286
1311
|
return;
|
|
1287
1312
|
}
|
|
@@ -1305,7 +1330,7 @@ function registerInstructionsInject(parent) {
|
|
|
1305
1330
|
} catch (err) {
|
|
1306
1331
|
if (format === "human") {
|
|
1307
1332
|
console.log(
|
|
1308
|
-
|
|
1333
|
+
pc5.red(` x ${provider.id}: ${err instanceof Error ? err.message : String(err)}`)
|
|
1309
1334
|
);
|
|
1310
1335
|
}
|
|
1311
1336
|
}
|
|
@@ -1324,7 +1349,7 @@ function registerInstructionsInject(parent) {
|
|
|
1324
1349
|
} catch (err) {
|
|
1325
1350
|
const error = err instanceof Error ? err.message : String(err);
|
|
1326
1351
|
failed.push({ provider: provider.id, error });
|
|
1327
|
-
if (format === "human") console.log(
|
|
1352
|
+
if (format === "human") console.log(pc5.red(` x ${provider.id}: ${error}`));
|
|
1328
1353
|
}
|
|
1329
1354
|
}
|
|
1330
1355
|
if (failed.length > 0) process.exitCode = 1;
|
|
@@ -1341,10 +1366,10 @@ function registerInstructionsInject(parent) {
|
|
|
1341
1366
|
});
|
|
1342
1367
|
} else {
|
|
1343
1368
|
for (const [file, action] of results) {
|
|
1344
|
-
const icon = action === "created" ?
|
|
1369
|
+
const icon = action === "created" ? pc5.green("+") : action === "updated" ? pc5.yellow("~") : pc5.blue("^");
|
|
1345
1370
|
console.log(` ${icon} ${file} (${action})`);
|
|
1346
1371
|
}
|
|
1347
|
-
console.log(
|
|
1372
|
+
console.log(pc5.bold(`
|
|
1348
1373
|
${results.size} file(s) processed.`));
|
|
1349
1374
|
}
|
|
1350
1375
|
}
|
|
@@ -1352,7 +1377,7 @@ ${results.size} file(s) processed.`));
|
|
|
1352
1377
|
}
|
|
1353
1378
|
|
|
1354
1379
|
// src/commands/instructions/update.ts
|
|
1355
|
-
import
|
|
1380
|
+
import pc6 from "picocolors";
|
|
1356
1381
|
async function updateGlobal(format) {
|
|
1357
1382
|
const operation = "instructions.update";
|
|
1358
1383
|
const mvi = "standard";
|
|
@@ -1378,17 +1403,17 @@ async function updateGlobal(format) {
|
|
|
1378
1403
|
return;
|
|
1379
1404
|
}
|
|
1380
1405
|
if (result.status === "no-providers") {
|
|
1381
|
-
console.log(
|
|
1406
|
+
console.log(pc6.yellow("No provider installations detected."));
|
|
1382
1407
|
return;
|
|
1383
1408
|
}
|
|
1384
1409
|
for (const file of result.files) {
|
|
1385
|
-
const icon = file.action === "failed" ?
|
|
1410
|
+
const icon = file.action === "failed" ? pc6.red("x") : pc6.green("\u2713");
|
|
1386
1411
|
console.log(` ${icon} ${file.path} (${file.action}${file.error ? `: ${file.error}` : ""})`);
|
|
1387
1412
|
}
|
|
1388
1413
|
for (const finding of result.findings) {
|
|
1389
|
-
console.log(` ${
|
|
1414
|
+
console.log(` ${pc6.red("x")} ${finding.kind}: ${finding.path} \u2014 ${finding.reason}`);
|
|
1390
1415
|
}
|
|
1391
|
-
console.log(
|
|
1416
|
+
console.log(pc6.bold(`
|
|
1392
1417
|
${updated.length} file(s) updated.`));
|
|
1393
1418
|
}
|
|
1394
1419
|
function registerInstructionsUpdate(parent) {
|
|
@@ -1417,6 +1442,7 @@ function registerInstructionsUpdate(parent) {
|
|
|
1417
1442
|
await updateGlobal(format);
|
|
1418
1443
|
return;
|
|
1419
1444
|
}
|
|
1445
|
+
if (isHomeProject(process.cwd())) refuseHomeProject(operation, mvi, format);
|
|
1420
1446
|
const providers = resolveDefaultTargetProviders();
|
|
1421
1447
|
const scope = "project";
|
|
1422
1448
|
const content = generateInjectionContent();
|
|
@@ -1439,12 +1465,12 @@ function registerInstructionsUpdate(parent) {
|
|
|
1439
1465
|
count: { updated: 0, failed: 0 }
|
|
1440
1466
|
});
|
|
1441
1467
|
} else {
|
|
1442
|
-
console.log(
|
|
1468
|
+
console.log(pc6.green("All instruction files are up to date."));
|
|
1443
1469
|
}
|
|
1444
1470
|
return;
|
|
1445
1471
|
}
|
|
1446
1472
|
if (format === "human" && needsUpdate.length > 0) {
|
|
1447
|
-
console.log(
|
|
1473
|
+
console.log(pc6.bold(`${needsUpdate.length} file(s) need updating:
|
|
1448
1474
|
`));
|
|
1449
1475
|
for (const c of needsUpdate) {
|
|
1450
1476
|
console.log(` ${c.file} (${c.status})`);
|
|
@@ -1484,12 +1510,12 @@ function registerInstructionsUpdate(parent) {
|
|
|
1484
1510
|
if (format === "human") {
|
|
1485
1511
|
console.log();
|
|
1486
1512
|
for (const [file, action] of results) {
|
|
1487
|
-
console.log(` ${
|
|
1513
|
+
console.log(` ${pc6.green("\u2713")} ${file} (${action})`);
|
|
1488
1514
|
}
|
|
1489
1515
|
for (const failure of failures) {
|
|
1490
|
-
console.log(` ${
|
|
1516
|
+
console.log(` ${pc6.red("x")} ${failure.provider}: ${failure.error}`);
|
|
1491
1517
|
}
|
|
1492
|
-
console.log(
|
|
1518
|
+
console.log(pc6.bold(`
|
|
1493
1519
|
${results.size} file(s) updated.`));
|
|
1494
1520
|
}
|
|
1495
1521
|
if (format === "json") {
|
|
@@ -2856,7 +2882,7 @@ function registerPiCommands(program2) {
|
|
|
2856
2882
|
// src/commands/providers.ts
|
|
2857
2883
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
2858
2884
|
import { resolveOutputFormat } from "@cleocode/lafs";
|
|
2859
|
-
import
|
|
2885
|
+
import pc7 from "picocolors";
|
|
2860
2886
|
function registerProvidersCommand(program2) {
|
|
2861
2887
|
const providers = program2.command("providers").description("Manage AI agent providers");
|
|
2862
2888
|
providers.command("list").description("List all supported providers").option("--json", "Output as JSON (default)").option("--human", "Output in human-readable format").option("--tier <tier>", "Filter by priority tier (high, medium, low)").action(async (opts) => {
|
|
@@ -2890,20 +2916,20 @@ function registerProvidersCommand(program2) {
|
|
|
2890
2916
|
console.log(JSON.stringify(envelope, null, 2));
|
|
2891
2917
|
return;
|
|
2892
2918
|
}
|
|
2893
|
-
console.log(
|
|
2919
|
+
console.log(pc7.bold(`
|
|
2894
2920
|
CAMP Provider Registry v${getRegistryVersion()}`));
|
|
2895
|
-
console.log(
|
|
2921
|
+
console.log(pc7.dim(`${getProviderCount()} providers
|
|
2896
2922
|
`));
|
|
2897
2923
|
const tiers = ["high", "medium", "low"];
|
|
2898
2924
|
for (const tier of tiers) {
|
|
2899
2925
|
const tierProviders = all.filter((p) => p.priority === tier);
|
|
2900
2926
|
if (tierProviders.length === 0) continue;
|
|
2901
|
-
const tierLabel = tier === "high" ?
|
|
2927
|
+
const tierLabel = tier === "high" ? pc7.green("HIGH") : tier === "medium" ? pc7.yellow("MEDIUM") : pc7.dim("LOW");
|
|
2902
2928
|
console.log(`${tierLabel} priority:`);
|
|
2903
2929
|
for (const p of tierProviders) {
|
|
2904
|
-
const status = p.status === "active" ?
|
|
2930
|
+
const status = p.status === "active" ? pc7.green("active") : p.status === "beta" ? pc7.yellow("beta") : pc7.dim(p.status);
|
|
2905
2931
|
console.log(
|
|
2906
|
-
` ${
|
|
2932
|
+
` ${pc7.bold(p.agentFlag.padEnd(20))} ${p.toolName.padEnd(22)} ${p.vendor.padEnd(16)} [${status}]`
|
|
2907
2933
|
);
|
|
2908
2934
|
}
|
|
2909
2935
|
console.log();
|
|
@@ -2948,19 +2974,19 @@ CAMP Provider Registry v${getRegistryVersion()}`));
|
|
|
2948
2974
|
console.log(JSON.stringify(envelope, null, 2));
|
|
2949
2975
|
return;
|
|
2950
2976
|
}
|
|
2951
|
-
console.log(
|
|
2977
|
+
console.log(pc7.bold(`
|
|
2952
2978
|
Detected ${installed.length} installed providers:
|
|
2953
2979
|
`));
|
|
2954
2980
|
for (const r of installed) {
|
|
2955
2981
|
const methods = r.methods.join(", ");
|
|
2956
|
-
const project = r.projectDetected ?
|
|
2982
|
+
const project = r.projectDetected ? pc7.green(" [project]") : "";
|
|
2957
2983
|
console.log(
|
|
2958
|
-
` ${
|
|
2984
|
+
` ${pc7.green("\u2713")} ${pc7.bold(r.provider.toolName.padEnd(22))} via ${pc7.dim(methods)}${project}`
|
|
2959
2985
|
);
|
|
2960
2986
|
}
|
|
2961
2987
|
const notInstalled = results.filter((r) => !r.installed);
|
|
2962
2988
|
if (notInstalled.length > 0) {
|
|
2963
|
-
console.log(
|
|
2989
|
+
console.log(pc7.dim(`
|
|
2964
2990
|
${notInstalled.length} providers not detected`));
|
|
2965
2991
|
}
|
|
2966
2992
|
console.log();
|
|
@@ -2988,7 +3014,7 @@ Detected ${installed.length} installed providers:
|
|
|
2988
3014
|
id
|
|
2989
3015
|
});
|
|
2990
3016
|
} else {
|
|
2991
|
-
console.error(
|
|
3017
|
+
console.error(pc7.red(message));
|
|
2992
3018
|
}
|
|
2993
3019
|
process.exit(1);
|
|
2994
3020
|
}
|
|
@@ -3004,9 +3030,9 @@ Detected ${installed.length} installed providers:
|
|
|
3004
3030
|
console.log(JSON.stringify(envelope, null, 2));
|
|
3005
3031
|
return;
|
|
3006
3032
|
}
|
|
3007
|
-
console.log(
|
|
3033
|
+
console.log(pc7.bold(`
|
|
3008
3034
|
${provider.toolName}`));
|
|
3009
|
-
console.log(
|
|
3035
|
+
console.log(pc7.dim(`by ${provider.vendor}
|
|
3010
3036
|
`));
|
|
3011
3037
|
console.log(` ID: ${provider.id}`);
|
|
3012
3038
|
console.log(` Flag: --agent ${provider.agentFlag}`);
|
|
@@ -3024,10 +3050,10 @@ ${provider.toolName}`));
|
|
|
3024
3050
|
console.log(` Transports: ${mcp.supportedTransports.join(", ")}`);
|
|
3025
3051
|
console.log(` Headers: ${mcp.supportsHeaders ? "yes" : "no"}`);
|
|
3026
3052
|
} else {
|
|
3027
|
-
console.log(` MCP integration: ${
|
|
3053
|
+
console.log(` MCP integration: ${pc7.dim("(none \u2014 extension-based harness)")}`);
|
|
3028
3054
|
}
|
|
3029
3055
|
console.log();
|
|
3030
|
-
console.log(
|
|
3056
|
+
console.log(pc7.dim(" Paths:"));
|
|
3031
3057
|
console.log(` Global dir: ${provider.pathGlobal}`);
|
|
3032
3058
|
console.log(` Project dir: ${provider.pathProject || "(none)"}`);
|
|
3033
3059
|
if (mcp) {
|
|
@@ -3063,7 +3089,7 @@ ${provider.toolName}`));
|
|
|
3063
3089
|
id: opts.provider
|
|
3064
3090
|
});
|
|
3065
3091
|
} else {
|
|
3066
|
-
console.error(
|
|
3092
|
+
console.error(pc7.red(message));
|
|
3067
3093
|
}
|
|
3068
3094
|
process.exit(1);
|
|
3069
3095
|
}
|
|
@@ -3081,9 +3107,9 @@ ${provider.toolName}`));
|
|
|
3081
3107
|
console.log(JSON.stringify(envelope, null, 2));
|
|
3082
3108
|
return;
|
|
3083
3109
|
}
|
|
3084
|
-
console.log(
|
|
3110
|
+
console.log(pc7.bold("\nProvider Skills Map\n"));
|
|
3085
3111
|
console.log(
|
|
3086
|
-
` ${
|
|
3112
|
+
` ${pc7.bold("Provider".padEnd(22))} ${pc7.bold("Precedence".padEnd(30))} ${pc7.bold("Global Path".padEnd(40))} ${pc7.bold("Project Path")}`
|
|
3087
3113
|
);
|
|
3088
3114
|
console.log(` ${"\u2500".repeat(22)} ${"\u2500".repeat(30)} ${"\u2500".repeat(40)} ${"\u2500".repeat(30)}`);
|
|
3089
3115
|
for (const entry of map) {
|
|
@@ -3091,7 +3117,7 @@ ${provider.toolName}`));
|
|
|
3091
3117
|
` ${entry.toolName.padEnd(22)} ${entry.precedence.padEnd(30)} ${(entry.paths.global ?? "-").padEnd(40)} ${entry.paths.project ?? "-"}`
|
|
3092
3118
|
);
|
|
3093
3119
|
}
|
|
3094
|
-
console.log(
|
|
3120
|
+
console.log(pc7.dim(`
|
|
3095
3121
|
${map.length} providers shown`));
|
|
3096
3122
|
console.log();
|
|
3097
3123
|
});
|
|
@@ -3127,25 +3153,25 @@ ${provider.toolName}`));
|
|
|
3127
3153
|
console.log(JSON.stringify(envelope, null, 2));
|
|
3128
3154
|
return;
|
|
3129
3155
|
}
|
|
3130
|
-
console.log(
|
|
3156
|
+
console.log(pc7.bold(`
|
|
3131
3157
|
CAMP Hook Support (mappings v${getHookMappingsVersion()})
|
|
3132
3158
|
`));
|
|
3133
|
-
console.log(
|
|
3159
|
+
console.log(pc7.dim(` ${CANONICAL_HOOK_EVENTS.length} canonical events defined
|
|
3134
3160
|
`));
|
|
3135
3161
|
console.log(
|
|
3136
|
-
` ${
|
|
3162
|
+
` ${pc7.bold("Provider".padEnd(22))} ${pc7.bold("System".padEnd(10))} ${pc7.bold("Coverage".padEnd(12))} ${pc7.bold("Supported".padEnd(12))} ${pc7.bold("Provider-Only")}`
|
|
3137
3163
|
);
|
|
3138
3164
|
console.log(
|
|
3139
3165
|
` ${"\u2500".repeat(22)} ${"\u2500".repeat(10)} ${"\u2500".repeat(12)} ${"\u2500".repeat(12)} ${"\u2500".repeat(20)}`
|
|
3140
3166
|
);
|
|
3141
3167
|
for (const s of summaries) {
|
|
3142
3168
|
if (!s) continue;
|
|
3143
|
-
const system = s.hookSystem === "none" ?
|
|
3144
|
-
const coverage = s.coverage > 0 ? (s.coverage >= 75 ?
|
|
3169
|
+
const system = s.hookSystem === "none" ? pc7.dim("none") : s.experimental ? pc7.yellow(s.hookSystem + "*") : pc7.green(s.hookSystem);
|
|
3170
|
+
const coverage = s.coverage > 0 ? (s.coverage >= 75 ? pc7.green : s.coverage >= 40 ? pc7.yellow : pc7.dim)(
|
|
3145
3171
|
`${s.coverage}%`
|
|
3146
|
-
) :
|
|
3147
|
-
const supported = s.supportedCount > 0 ? `${s.supportedCount}/${s.totalCanonical}` :
|
|
3148
|
-
const provOnly = s.providerOnly.length > 0 ? String(s.providerOnly.length) :
|
|
3172
|
+
) : pc7.dim("0%");
|
|
3173
|
+
const supported = s.supportedCount > 0 ? `${s.supportedCount}/${s.totalCanonical}` : pc7.dim("0");
|
|
3174
|
+
const provOnly = s.providerOnly.length > 0 ? String(s.providerOnly.length) : pc7.dim("-");
|
|
3149
3175
|
const provider = getProvider(s.providerId);
|
|
3150
3176
|
const name = provider?.toolName ?? s.providerId;
|
|
3151
3177
|
console.log(
|
|
@@ -3154,13 +3180,13 @@ CAMP Hook Support (mappings v${getHookMappingsVersion()})
|
|
|
3154
3180
|
}
|
|
3155
3181
|
const withHooks = summaries.filter((s) => s && s.supportedCount > 0);
|
|
3156
3182
|
console.log(
|
|
3157
|
-
|
|
3183
|
+
pc7.dim(
|
|
3158
3184
|
`
|
|
3159
3185
|
${withHooks.length} providers with hook support, ${summaries.length - withHooks.length} without`
|
|
3160
3186
|
)
|
|
3161
3187
|
);
|
|
3162
3188
|
if (summaries.some((s) => s?.experimental)) {
|
|
3163
|
-
console.log(
|
|
3189
|
+
console.log(pc7.dim(" * = experimental hook system"));
|
|
3164
3190
|
}
|
|
3165
3191
|
console.log();
|
|
3166
3192
|
});
|
|
@@ -3190,22 +3216,22 @@ CAMP Hook Support (mappings v${getHookMappingsVersion()})
|
|
|
3190
3216
|
const p = getProvider(id);
|
|
3191
3217
|
return (p?.toolName ?? id).slice(0, 14);
|
|
3192
3218
|
});
|
|
3193
|
-
console.log(
|
|
3219
|
+
console.log(pc7.bold("\nHook Support Matrix\n"));
|
|
3194
3220
|
const eventCol = "CAAMP Event".padEnd(22);
|
|
3195
|
-
const provCols = providerNames.map((n) =>
|
|
3196
|
-
console.log(` ${
|
|
3221
|
+
const provCols = providerNames.map((n) => pc7.bold(n.padEnd(16))).join("");
|
|
3222
|
+
console.log(` ${pc7.bold(eventCol)} ${provCols}`);
|
|
3197
3223
|
console.log(` ${"\u2500".repeat(22)} ${providerNames.map(() => "\u2500".repeat(16)).join("")}`);
|
|
3198
3224
|
for (const event of matrix.events) {
|
|
3199
3225
|
const cells = matrix.providers.map((id) => {
|
|
3200
3226
|
const m = matrix.matrix[event][id];
|
|
3201
|
-
if (!m?.supported) return
|
|
3202
|
-
return
|
|
3227
|
+
if (!m?.supported) return pc7.dim("\xB7".padEnd(16));
|
|
3228
|
+
return pc7.green((m.nativeName ?? "?").slice(0, 14).padEnd(16));
|
|
3203
3229
|
}).join("");
|
|
3204
3230
|
console.log(` ${event.padEnd(22)} ${cells}`);
|
|
3205
3231
|
}
|
|
3206
3232
|
const commonEvents = getCommonEvents(matrix.providers);
|
|
3207
3233
|
console.log(
|
|
3208
|
-
|
|
3234
|
+
pc7.dim(`
|
|
3209
3235
|
Common events: ${commonEvents.length > 0 ? commonEvents.join(", ") : "none"}`)
|
|
3210
3236
|
);
|
|
3211
3237
|
console.log();
|
|
@@ -3233,7 +3259,7 @@ CAMP Hook Support (mappings v${getHookMappingsVersion()})
|
|
|
3233
3259
|
if (format === "json") {
|
|
3234
3260
|
emitJsonError2(operation, mvi, "E_UNKNOWN_EVENT", msg, "VALIDATION");
|
|
3235
3261
|
} else {
|
|
3236
|
-
console.error(
|
|
3262
|
+
console.error(pc7.red(msg));
|
|
3237
3263
|
}
|
|
3238
3264
|
process.exit(1);
|
|
3239
3265
|
}
|
|
@@ -3253,11 +3279,11 @@ CAMP Hook Support (mappings v${getHookMappingsVersion()})
|
|
|
3253
3279
|
} else {
|
|
3254
3280
|
if (result.supported) {
|
|
3255
3281
|
console.log(`
|
|
3256
|
-
${
|
|
3257
|
-
if (result.notes) console.log(
|
|
3282
|
+
${pc7.green(event)} \u2192 ${pc7.bold(result.native)} (${opts.to})`);
|
|
3283
|
+
if (result.notes) console.log(pc7.dim(` Note: ${result.notes}`));
|
|
3258
3284
|
} else {
|
|
3259
3285
|
console.log(`
|
|
3260
|
-
${
|
|
3286
|
+
${pc7.red(event)} \u2192 ${pc7.dim("not supported")} (${opts.to})`);
|
|
3261
3287
|
}
|
|
3262
3288
|
console.log();
|
|
3263
3289
|
}
|
|
@@ -3283,11 +3309,11 @@ CAMP Hook Support (mappings v${getHookMappingsVersion()})
|
|
|
3283
3309
|
} else {
|
|
3284
3310
|
if (canonical2) {
|
|
3285
3311
|
console.log(`
|
|
3286
|
-
${
|
|
3312
|
+
${pc7.bold(event)} (${opts.from}) \u2192 ${pc7.green(canonical2)}`);
|
|
3287
3313
|
} else {
|
|
3288
3314
|
console.log(
|
|
3289
3315
|
`
|
|
3290
|
-
${
|
|
3316
|
+
${pc7.bold(event)} (${opts.from}) \u2192 ${pc7.dim("no canonical mapping (provider-only event)")}`
|
|
3291
3317
|
);
|
|
3292
3318
|
}
|
|
3293
3319
|
console.log();
|
|
@@ -3300,7 +3326,7 @@ CAMP Hook Support (mappings v${getHookMappingsVersion()})
|
|
|
3300
3326
|
if (format === "json") {
|
|
3301
3327
|
emitJsonError2(operation, mvi, "E_UNKNOWN_EVENT", msg, "VALIDATION");
|
|
3302
3328
|
} else {
|
|
3303
|
-
console.error(
|
|
3329
|
+
console.error(pc7.red(msg));
|
|
3304
3330
|
}
|
|
3305
3331
|
process.exit(1);
|
|
3306
3332
|
}
|
|
@@ -3322,7 +3348,7 @@ CAMP Hook Support (mappings v${getHookMappingsVersion()})
|
|
|
3322
3348
|
);
|
|
3323
3349
|
console.log(JSON.stringify(envelope, null, 2));
|
|
3324
3350
|
} else {
|
|
3325
|
-
console.log(
|
|
3351
|
+
console.log(pc7.bold(`
|
|
3326
3352
|
${event} across providers:
|
|
3327
3353
|
`));
|
|
3328
3354
|
for (const id of allIds) {
|
|
@@ -3330,9 +3356,9 @@ CAMP Hook Support (mappings v${getHookMappingsVersion()})
|
|
|
3330
3356
|
const provider = getProvider(id);
|
|
3331
3357
|
const name = (provider?.toolName ?? id).padEnd(22);
|
|
3332
3358
|
if (native) {
|
|
3333
|
-
console.log(` ${
|
|
3359
|
+
console.log(` ${pc7.green("\u2713")} ${name} ${pc7.bold(native)}`);
|
|
3334
3360
|
} else {
|
|
3335
|
-
console.log(` ${
|
|
3361
|
+
console.log(` ${pc7.dim("\xB7")} ${name} ${pc7.dim("not supported")}`);
|
|
3336
3362
|
}
|
|
3337
3363
|
}
|
|
3338
3364
|
console.log();
|
|
@@ -3388,13 +3414,13 @@ CAMP Hook Support (mappings v${getHookMappingsVersion()})
|
|
|
3388
3414
|
console.log(JSON.stringify(envelope, null, 2));
|
|
3389
3415
|
return;
|
|
3390
3416
|
}
|
|
3391
|
-
console.log(
|
|
3417
|
+
console.log(pc7.bold("\nProvider Capability Matrix\n"));
|
|
3392
3418
|
if (opts.filter) {
|
|
3393
|
-
console.log(
|
|
3419
|
+
console.log(pc7.dim(` Filter: ${opts.filter}
|
|
3394
3420
|
`));
|
|
3395
3421
|
}
|
|
3396
3422
|
console.log(
|
|
3397
|
-
` ${
|
|
3423
|
+
` ${pc7.bold("Provider".padEnd(22))} ${pc7.bold("Skills Precedence".padEnd(20))} ${pc7.bold("Hooks".padEnd(8))} ${pc7.bold("Spawn")}`
|
|
3398
3424
|
);
|
|
3399
3425
|
console.log(` ${"\u2500".repeat(22)} ${"\u2500".repeat(20)} ${"\u2500".repeat(8)} ${"\u2500".repeat(20)}`);
|
|
3400
3426
|
for (const row of matrix) {
|
|
@@ -3404,7 +3430,7 @@ CAMP Hook Support (mappings v${getHookMappingsVersion()})
|
|
|
3404
3430
|
` ${row.toolName.padEnd(22)} ${row.skillsPrecedence.padEnd(20)} ${hooks2.padEnd(8)} ${spawn2}`
|
|
3405
3431
|
);
|
|
3406
3432
|
}
|
|
3407
|
-
console.log(
|
|
3433
|
+
console.log(pc7.dim(`
|
|
3408
3434
|
${matrix.length} providers shown`));
|
|
3409
3435
|
console.log();
|
|
3410
3436
|
});
|
|
@@ -3443,7 +3469,7 @@ function emitJsonError2(operation, mvi, code, message, category, details = {}) {
|
|
|
3443
3469
|
|
|
3444
3470
|
// src/commands/skills/audit.ts
|
|
3445
3471
|
import { existsSync as existsSync9, statSync as statSync2 } from "fs";
|
|
3446
|
-
import
|
|
3472
|
+
import pc8 from "picocolors";
|
|
3447
3473
|
function registerSkillsAudit(parent) {
|
|
3448
3474
|
parent.command("audit").description("Security scan skill files (46+ rules, SARIF output)").argument("[path]", "Path to SKILL.md or directory", ".").option("--sarif", "Output in SARIF format (raw SARIF, not LAFS envelope)").option("--json", "Output as JSON (LAFS envelope)").option("--human", "Output in human-readable format").action(async (path, opts) => {
|
|
3449
3475
|
const operation = "skills.audit";
|
|
@@ -3572,7 +3598,7 @@ function registerSkillsAudit(parent) {
|
|
|
3572
3598
|
outputSuccess(operation, mvi, summary2);
|
|
3573
3599
|
return;
|
|
3574
3600
|
}
|
|
3575
|
-
console.log(
|
|
3601
|
+
console.log(pc8.dim("No SKILL.md files found to scan."));
|
|
3576
3602
|
return;
|
|
3577
3603
|
}
|
|
3578
3604
|
const summary = {
|
|
@@ -3606,21 +3632,21 @@ function registerSkillsAudit(parent) {
|
|
|
3606
3632
|
}
|
|
3607
3633
|
let totalFindings = 0;
|
|
3608
3634
|
for (const result of results) {
|
|
3609
|
-
const icon = result.passed ?
|
|
3635
|
+
const icon = result.passed ? pc8.green("\u2713") : pc8.red("\u2717");
|
|
3610
3636
|
console.log(`
|
|
3611
|
-
${icon} ${
|
|
3637
|
+
${icon} ${pc8.bold(result.file)} (score: ${result.score}/100)`);
|
|
3612
3638
|
if (result.findings.length === 0) {
|
|
3613
|
-
console.log(
|
|
3639
|
+
console.log(pc8.dim(" No issues found."));
|
|
3614
3640
|
continue;
|
|
3615
3641
|
}
|
|
3616
3642
|
totalFindings += result.findings.length;
|
|
3617
3643
|
for (const f of result.findings) {
|
|
3618
|
-
const sev = f.rule.severity === "critical" ?
|
|
3644
|
+
const sev = f.rule.severity === "critical" ? pc8.red(f.rule.severity) : f.rule.severity === "high" ? pc8.red(f.rule.severity) : f.rule.severity === "medium" ? pc8.yellow(f.rule.severity) : pc8.dim(f.rule.severity);
|
|
3619
3645
|
console.log(` ${sev.padEnd(20)} ${f.rule.id} ${f.rule.name}`);
|
|
3620
|
-
console.log(` ${
|
|
3646
|
+
console.log(` ${pc8.dim(`L${f.line}: ${f.context.slice(0, 80)}`)}`);
|
|
3621
3647
|
}
|
|
3622
3648
|
}
|
|
3623
|
-
console.log(
|
|
3649
|
+
console.log(pc8.bold(`
|
|
3624
3650
|
${results.length} file(s) scanned, ${totalFindings} finding(s)`));
|
|
3625
3651
|
if (!allPassed) {
|
|
3626
3652
|
process.exit(1);
|
|
@@ -3629,7 +3655,7 @@ ${results.length} file(s) scanned, ${totalFindings} finding(s)`));
|
|
|
3629
3655
|
}
|
|
3630
3656
|
|
|
3631
3657
|
// src/commands/skills/check.ts
|
|
3632
|
-
import
|
|
3658
|
+
import pc9 from "picocolors";
|
|
3633
3659
|
function registerSkillsCheck(parent) {
|
|
3634
3660
|
parent.command("check").description("Check for available skill updates").option("--json", "Output as JSON (default)").option("--human", "Output in human-readable format").action(async (opts) => {
|
|
3635
3661
|
const operation = "skills.check";
|
|
@@ -3662,12 +3688,12 @@ function registerSkillsCheck(parent) {
|
|
|
3662
3688
|
total: 0
|
|
3663
3689
|
});
|
|
3664
3690
|
} else {
|
|
3665
|
-
console.log(
|
|
3691
|
+
console.log(pc9.dim("No tracked skills."));
|
|
3666
3692
|
}
|
|
3667
3693
|
return;
|
|
3668
3694
|
}
|
|
3669
3695
|
if (format === "human") {
|
|
3670
|
-
console.log(
|
|
3696
|
+
console.log(pc9.dim(`Checking ${entries.length} skill(s) for updates...
|
|
3671
3697
|
`));
|
|
3672
3698
|
}
|
|
3673
3699
|
const skillResults = [];
|
|
@@ -3703,31 +3729,31 @@ function registerSkillsCheck(parent) {
|
|
|
3703
3729
|
for (const r of skillResults) {
|
|
3704
3730
|
let statusLabel;
|
|
3705
3731
|
if (r.hasUpdate) {
|
|
3706
|
-
statusLabel =
|
|
3732
|
+
statusLabel = pc9.yellow("update available");
|
|
3707
3733
|
} else if (r.currentVersion !== "unknown") {
|
|
3708
|
-
statusLabel =
|
|
3734
|
+
statusLabel = pc9.green("up to date");
|
|
3709
3735
|
} else {
|
|
3710
|
-
statusLabel =
|
|
3736
|
+
statusLabel = pc9.dim("unknown");
|
|
3711
3737
|
}
|
|
3712
|
-
console.log(` ${
|
|
3738
|
+
console.log(` ${pc9.bold(r.name.padEnd(30))} ${statusLabel}`);
|
|
3713
3739
|
if (r.currentVersion !== "unknown" || r.latestVersion !== "unknown") {
|
|
3714
3740
|
const current = r.currentVersion !== "unknown" ? r.currentVersion.slice(0, 12) : "?";
|
|
3715
3741
|
const latest = r.latestVersion !== "unknown" ? r.latestVersion : "?";
|
|
3716
3742
|
if (r.hasUpdate) {
|
|
3717
|
-
console.log(` ${
|
|
3743
|
+
console.log(` ${pc9.dim("current:")} ${current} ${pc9.dim("->")} ${pc9.cyan(latest)}`);
|
|
3718
3744
|
} else {
|
|
3719
|
-
console.log(` ${
|
|
3745
|
+
console.log(` ${pc9.dim("version:")} ${current}`);
|
|
3720
3746
|
}
|
|
3721
3747
|
}
|
|
3722
|
-
console.log(` ${
|
|
3723
|
-
console.log(` ${
|
|
3748
|
+
console.log(` ${pc9.dim(`source: ${r.source}`)}`);
|
|
3749
|
+
console.log(` ${pc9.dim(`agents: ${r.agents.join(", ")}`)}`);
|
|
3724
3750
|
console.log();
|
|
3725
3751
|
}
|
|
3726
3752
|
if (updatesAvailable > 0) {
|
|
3727
|
-
console.log(
|
|
3728
|
-
console.log(
|
|
3753
|
+
console.log(pc9.yellow(`${updatesAvailable} update(s) available.`));
|
|
3754
|
+
console.log(pc9.dim("Run `caamp skills update` to update all."));
|
|
3729
3755
|
} else {
|
|
3730
|
-
console.log(
|
|
3756
|
+
console.log(pc9.green("All skills are up to date."));
|
|
3731
3757
|
}
|
|
3732
3758
|
});
|
|
3733
3759
|
}
|
|
@@ -3735,7 +3761,7 @@ function registerSkillsCheck(parent) {
|
|
|
3735
3761
|
// src/commands/skills/find.ts
|
|
3736
3762
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
3737
3763
|
import { resolveOutputFormat as resolveOutputFormat2 } from "@cleocode/lafs";
|
|
3738
|
-
import
|
|
3764
|
+
import pc10 from "picocolors";
|
|
3739
3765
|
var SkillsFindValidationError = class extends Error {
|
|
3740
3766
|
code;
|
|
3741
3767
|
constructor(code, message) {
|
|
@@ -3776,7 +3802,7 @@ function registerSkillsFind(parent) {
|
|
|
3776
3802
|
if (opts.json) {
|
|
3777
3803
|
emitJsonError3(operation, mvi, "E_FORMAT_CONFLICT", message, "VALIDATION");
|
|
3778
3804
|
} else {
|
|
3779
|
-
console.error(
|
|
3805
|
+
console.error(pc10.red(message));
|
|
3780
3806
|
}
|
|
3781
3807
|
process.exit(1);
|
|
3782
3808
|
}
|
|
@@ -3843,19 +3869,19 @@ function registerSkillsFind(parent) {
|
|
|
3843
3869
|
query: query ?? null
|
|
3844
3870
|
});
|
|
3845
3871
|
} else {
|
|
3846
|
-
console.error(
|
|
3872
|
+
console.error(pc10.red(`Recommendation failed: ${message}`));
|
|
3847
3873
|
}
|
|
3848
3874
|
process.exit(1);
|
|
3849
3875
|
}
|
|
3850
3876
|
}
|
|
3851
3877
|
if (!query) {
|
|
3852
|
-
console.log(
|
|
3878
|
+
console.log(pc10.dim("Usage: caamp skills find <query>"));
|
|
3853
3879
|
return;
|
|
3854
3880
|
}
|
|
3855
3881
|
const limit = parseInt(opts.limit, 10);
|
|
3856
3882
|
const client = new MarketplaceClient();
|
|
3857
3883
|
if (format === "human") {
|
|
3858
|
-
console.log(
|
|
3884
|
+
console.log(pc10.dim(`Searching marketplaces for "${query}"...
|
|
3859
3885
|
`));
|
|
3860
3886
|
}
|
|
3861
3887
|
let results;
|
|
@@ -3869,7 +3895,7 @@ function registerSkillsFind(parent) {
|
|
|
3869
3895
|
limit
|
|
3870
3896
|
});
|
|
3871
3897
|
} else {
|
|
3872
|
-
console.error(
|
|
3898
|
+
console.error(pc10.red(`Marketplace search failed: ${message}`));
|
|
3873
3899
|
}
|
|
3874
3900
|
process.exit(1);
|
|
3875
3901
|
}
|
|
@@ -3889,21 +3915,21 @@ function registerSkillsFind(parent) {
|
|
|
3889
3915
|
return;
|
|
3890
3916
|
}
|
|
3891
3917
|
if (results.length === 0) {
|
|
3892
|
-
console.log(
|
|
3918
|
+
console.log(pc10.yellow("No results found."));
|
|
3893
3919
|
return;
|
|
3894
3920
|
}
|
|
3895
|
-
console.log(
|
|
3921
|
+
console.log(pc10.dim(`Found ${results.length} result(s) for "${query}":
|
|
3896
3922
|
`));
|
|
3897
3923
|
results.forEach((skill, index) => {
|
|
3898
3924
|
const num = (index + 1).toString().padStart(2);
|
|
3899
|
-
const stars = skill.stars > 0 ?
|
|
3900
|
-
console.log(` ${
|
|
3901
|
-
console.log(` ${
|
|
3902
|
-
console.log(` ${
|
|
3925
|
+
const stars = skill.stars > 0 ? pc10.yellow(`\u2605 ${formatStars(skill.stars)}`) : "";
|
|
3926
|
+
console.log(` ${pc10.cyan(num)}. ${pc10.bold(skill.scopedName)} ${stars}`);
|
|
3927
|
+
console.log(` ${pc10.dim(skill.description?.slice(0, 80) ?? "")}`);
|
|
3928
|
+
console.log(` ${pc10.dim(`from ${skill.source}`)}`);
|
|
3903
3929
|
console.log();
|
|
3904
3930
|
});
|
|
3905
|
-
console.log(
|
|
3906
|
-
console.log(
|
|
3931
|
+
console.log(pc10.dim("Install with: caamp skills install <name>"));
|
|
3932
|
+
console.log(pc10.dim("Or select by number: caamp skills install <n>"));
|
|
3907
3933
|
});
|
|
3908
3934
|
}
|
|
3909
3935
|
function formatStars(n) {
|
|
@@ -4023,7 +4049,7 @@ function emitJsonError3(operation, mvi, code, message, category, details = {}) {
|
|
|
4023
4049
|
import { existsSync as existsSync10 } from "fs";
|
|
4024
4050
|
import { mkdir, writeFile as writeFile3 } from "fs/promises";
|
|
4025
4051
|
import { join as join6 } from "path";
|
|
4026
|
-
import
|
|
4052
|
+
import pc11 from "picocolors";
|
|
4027
4053
|
function registerSkillsInit(parent) {
|
|
4028
4054
|
parent.command("init").description("Create a new SKILL.md template").argument("[name]", "Skill name").option("-d, --dir <path>", "Output directory", ".").option("--json", "Output as JSON (default)").option("--human", "Output in human-readable format").action(
|
|
4029
4055
|
async (name, opts) => {
|
|
@@ -4063,7 +4089,7 @@ function registerSkillsInit(parent) {
|
|
|
4063
4089
|
}
|
|
4064
4090
|
);
|
|
4065
4091
|
} else {
|
|
4066
|
-
console.error(
|
|
4092
|
+
console.error(pc11.red(message));
|
|
4067
4093
|
}
|
|
4068
4094
|
process.exit(1);
|
|
4069
4095
|
}
|
|
@@ -4102,28 +4128,28 @@ Show example inputs and expected outputs.
|
|
|
4102
4128
|
outputSuccess(operation, mvi, result);
|
|
4103
4129
|
return;
|
|
4104
4130
|
}
|
|
4105
|
-
console.log(
|
|
4106
|
-
console.log(
|
|
4107
|
-
console.log(
|
|
4108
|
-
console.log(
|
|
4109
|
-
console.log(
|
|
4131
|
+
console.log(pc11.green(`\u2713 Created skill template: ${skillDir}/SKILL.md`));
|
|
4132
|
+
console.log(pc11.dim("\nNext steps:"));
|
|
4133
|
+
console.log(pc11.dim(" 1. Edit SKILL.md with your instructions"));
|
|
4134
|
+
console.log(pc11.dim(` 2. Validate: caamp skills validate ${join6(skillDir, "SKILL.md")}`));
|
|
4135
|
+
console.log(pc11.dim(` 3. Install: caamp skills install ${skillDir}`));
|
|
4110
4136
|
}
|
|
4111
4137
|
);
|
|
4112
4138
|
}
|
|
4113
4139
|
|
|
4114
4140
|
// src/commands/skills/install.ts
|
|
4115
|
-
import
|
|
4141
|
+
import pc12 from "picocolors";
|
|
4116
4142
|
function renderProgress(event) {
|
|
4117
4143
|
switch (event.kind) {
|
|
4118
4144
|
case "marketplace-search":
|
|
4119
|
-
console.log(
|
|
4145
|
+
console.log(pc12.dim(`Searching marketplace for ${event.source}...`));
|
|
4120
4146
|
return;
|
|
4121
4147
|
case "marketplace-found":
|
|
4122
|
-
console.log(` Found: ${
|
|
4148
|
+
console.log(` Found: ${pc12.bold(event.name)} by ${event.author} (${pc12.dim(event.repo)})`);
|
|
4123
4149
|
return;
|
|
4124
4150
|
case "catalog-found":
|
|
4125
4151
|
console.log(
|
|
4126
|
-
` Found in catalog: ${
|
|
4152
|
+
` Found in catalog: ${pc12.bold(event.name)} v${event.version} (${pc12.dim(event.category)})`
|
|
4127
4153
|
);
|
|
4128
4154
|
return;
|
|
4129
4155
|
}
|
|
@@ -4174,17 +4200,17 @@ function reportRefusal(err, format, operation, mvi) {
|
|
|
4174
4200
|
emitJsonError(operation, mvi, err.code, err.message, categoryFor(err), details);
|
|
4175
4201
|
}
|
|
4176
4202
|
}
|
|
4177
|
-
console.error(
|
|
4203
|
+
console.error(pc12.red(err.message));
|
|
4178
4204
|
if (scan && err.code === ErrorCodes.SKILL_TRUST_GATE_BLOCKED && format === "human") {
|
|
4179
4205
|
for (const f of scan.findings.slice(0, 5)) {
|
|
4180
4206
|
console.error(
|
|
4181
|
-
|
|
4207
|
+
pc12.dim(` [${f.severity}] ${f.category} ${f.file}:${f.line} \u2014 ${f.description}`)
|
|
4182
4208
|
);
|
|
4183
4209
|
}
|
|
4184
|
-
console.error(
|
|
4210
|
+
console.error(pc12.yellow(" Use --force to override (audited)."));
|
|
4185
4211
|
}
|
|
4186
4212
|
if (err.details.availableSkills && format === "human") {
|
|
4187
|
-
console.log(
|
|
4213
|
+
console.log(pc12.dim(`Available skills: ${err.details.availableSkills.join(", ")}`));
|
|
4188
4214
|
}
|
|
4189
4215
|
process.exit(1);
|
|
4190
4216
|
}
|
|
@@ -4244,7 +4270,7 @@ function registerSkillsInstall(parent) {
|
|
|
4244
4270
|
ErrorCategories.NOT_FOUND
|
|
4245
4271
|
);
|
|
4246
4272
|
}
|
|
4247
|
-
console.error(
|
|
4273
|
+
console.error(pc12.red(message));
|
|
4248
4274
|
process.exit(1);
|
|
4249
4275
|
}
|
|
4250
4276
|
if (opts.profile) {
|
|
@@ -4269,14 +4295,14 @@ function registerSkillsInstall(parent) {
|
|
|
4269
4295
|
ErrorCategories.VALIDATION
|
|
4270
4296
|
);
|
|
4271
4297
|
}
|
|
4272
|
-
console.error(
|
|
4298
|
+
console.error(pc12.red(message));
|
|
4273
4299
|
console.log(
|
|
4274
|
-
|
|
4300
|
+
pc12.dim("Usage: caamp skills install <source> or caamp skills install --profile <name>")
|
|
4275
4301
|
);
|
|
4276
4302
|
process.exit(1);
|
|
4277
4303
|
}
|
|
4278
4304
|
if (format === "human") {
|
|
4279
|
-
console.log(
|
|
4305
|
+
console.log(pc12.dim(`Installing to ${providers.length} provider(s)...`));
|
|
4280
4306
|
}
|
|
4281
4307
|
let result;
|
|
4282
4308
|
try {
|
|
@@ -4309,14 +4335,14 @@ function registerSkillsInstall(parent) {
|
|
|
4309
4335
|
if (format === "json") {
|
|
4310
4336
|
outputSuccess(operation, mvi, summary2);
|
|
4311
4337
|
} else {
|
|
4312
|
-
console.log(
|
|
4313
|
-
\u2713 Installed ${
|
|
4314
|
-
console.log(` Canonical: ${
|
|
4338
|
+
console.log(pc12.green(`
|
|
4339
|
+
\u2713 Installed ${pc12.bold(result.name)}`));
|
|
4340
|
+
console.log(` Canonical: ${pc12.dim(result.canonicalPath)}`);
|
|
4315
4341
|
console.log(` Linked to: ${result.linkedAgents.join(", ")}`);
|
|
4316
4342
|
if (result.errors.length > 0) {
|
|
4317
|
-
console.log(
|
|
4343
|
+
console.log(pc12.yellow("\nWarnings:"));
|
|
4318
4344
|
for (const err of result.errors) {
|
|
4319
|
-
console.log(` ${
|
|
4345
|
+
console.log(` ${pc12.yellow("!")} ${err}`);
|
|
4320
4346
|
}
|
|
4321
4347
|
}
|
|
4322
4348
|
}
|
|
@@ -4338,11 +4364,11 @@ function registerSkillsInstall(parent) {
|
|
|
4338
4364
|
});
|
|
4339
4365
|
console.error(JSON.stringify(envelope, null, 2));
|
|
4340
4366
|
} else {
|
|
4341
|
-
console.log(
|
|
4342
|
-
\u2717 Failed to install ${
|
|
4343
|
-
console.log(
|
|
4367
|
+
console.log(pc12.yellow(`
|
|
4368
|
+
\u2717 Failed to install ${pc12.bold(result.name)}`));
|
|
4369
|
+
console.log(pc12.yellow("Errors:"));
|
|
4344
4370
|
for (const err of result.errors) {
|
|
4345
|
-
console.log(` ${
|
|
4371
|
+
console.log(` ${pc12.yellow("!")} ${err}`);
|
|
4346
4372
|
}
|
|
4347
4373
|
}
|
|
4348
4374
|
process.exit(1);
|
|
@@ -4355,7 +4381,7 @@ async function handleProfileInstall(profileName, providers, isGlobal, format, op
|
|
|
4355
4381
|
if (format === "json") {
|
|
4356
4382
|
emitError(operation, mvi, ErrorCodes.INVALID_INPUT, message, ErrorCategories.VALIDATION);
|
|
4357
4383
|
}
|
|
4358
|
-
console.error(
|
|
4384
|
+
console.error(pc12.red(message));
|
|
4359
4385
|
process.exit(1);
|
|
4360
4386
|
}
|
|
4361
4387
|
const profileSkills = resolveProfile(profileName);
|
|
@@ -4373,16 +4399,16 @@ async function handleProfileInstall(profileName, providers, isGlobal, format, op
|
|
|
4373
4399
|
}
|
|
4374
4400
|
);
|
|
4375
4401
|
}
|
|
4376
|
-
console.error(
|
|
4402
|
+
console.error(pc12.red(message));
|
|
4377
4403
|
const available = listProfiles();
|
|
4378
4404
|
if (available.length > 0) {
|
|
4379
|
-
console.log(
|
|
4405
|
+
console.log(pc12.dim("Available profiles: " + available.join(", ")));
|
|
4380
4406
|
}
|
|
4381
4407
|
process.exit(1);
|
|
4382
4408
|
}
|
|
4383
4409
|
if (format === "human") {
|
|
4384
|
-
console.log(`Installing profile ${
|
|
4385
|
-
console.log(
|
|
4410
|
+
console.log(`Installing profile ${pc12.bold(profileName)} (${profileSkills.length} skill(s))...`);
|
|
4411
|
+
console.log(pc12.dim(`Target: ${providers.length} provider(s)`));
|
|
4386
4412
|
}
|
|
4387
4413
|
const installed = [];
|
|
4388
4414
|
const failed = [];
|
|
@@ -4399,7 +4425,7 @@ async function handleProfileInstall(profileName, providers, isGlobal, format, op
|
|
|
4399
4425
|
);
|
|
4400
4426
|
if (result.success) {
|
|
4401
4427
|
if (format === "human") {
|
|
4402
|
-
console.log(
|
|
4428
|
+
console.log(pc12.green(` + ${name}`));
|
|
4403
4429
|
}
|
|
4404
4430
|
installed.push({
|
|
4405
4431
|
name,
|
|
@@ -4409,7 +4435,7 @@ async function handleProfileInstall(profileName, providers, isGlobal, format, op
|
|
|
4409
4435
|
});
|
|
4410
4436
|
} else {
|
|
4411
4437
|
if (format === "human") {
|
|
4412
|
-
console.log(
|
|
4438
|
+
console.log(pc12.yellow(` ! ${name}: ${result.errors.join(", ")}`));
|
|
4413
4439
|
}
|
|
4414
4440
|
failed.push({
|
|
4415
4441
|
name,
|
|
@@ -4419,7 +4445,7 @@ async function handleProfileInstall(profileName, providers, isGlobal, format, op
|
|
|
4419
4445
|
} catch (err) {
|
|
4420
4446
|
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
4421
4447
|
if (format === "human") {
|
|
4422
|
-
console.log(
|
|
4448
|
+
console.log(pc12.red(` x ${name}: ${errorMsg}`));
|
|
4423
4449
|
}
|
|
4424
4450
|
failed.push({
|
|
4425
4451
|
name,
|
|
@@ -4454,7 +4480,7 @@ async function handleProfileInstall(profileName, providers, isGlobal, format, op
|
|
|
4454
4480
|
} else {
|
|
4455
4481
|
console.log(
|
|
4456
4482
|
`
|
|
4457
|
-
${
|
|
4483
|
+
${pc12.green(`${installed.length} installed`)}, ${failed.length > 0 ? pc12.yellow(`${failed.length} failed`) : "0 failed"}`
|
|
4458
4484
|
);
|
|
4459
4485
|
if (failed.length > 0) {
|
|
4460
4486
|
process.exit(1);
|
|
@@ -4465,7 +4491,7 @@ ${pc11.green(`${installed.length} installed`)}, ${failed.length > 0 ? pc11.yello
|
|
|
4465
4491
|
// src/commands/skills/list.ts
|
|
4466
4492
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
4467
4493
|
import { resolveOutputFormat as resolveOutputFormat3 } from "@cleocode/lafs";
|
|
4468
|
-
import
|
|
4494
|
+
import pc13 from "picocolors";
|
|
4469
4495
|
function registerSkillsList(parent) {
|
|
4470
4496
|
parent.command("list").description("List installed skills").option("-g, --global", "List global skills").option("-a, --agent <name>", "List skills for specific agent").option("--json", "Output as JSON (default)").option("--human", "Output in human-readable format").action(async (opts) => {
|
|
4471
4497
|
const operation = "skills.list";
|
|
@@ -4492,7 +4518,7 @@ function registerSkillsList(parent) {
|
|
|
4492
4518
|
agent: opts.agent
|
|
4493
4519
|
});
|
|
4494
4520
|
} else {
|
|
4495
|
-
console.error(
|
|
4521
|
+
console.error(pc13.red(message));
|
|
4496
4522
|
}
|
|
4497
4523
|
process.exit(1);
|
|
4498
4524
|
}
|
|
@@ -4520,21 +4546,21 @@ function registerSkillsList(parent) {
|
|
|
4520
4546
|
return;
|
|
4521
4547
|
}
|
|
4522
4548
|
if (skills.length === 0) {
|
|
4523
|
-
console.log(
|
|
4549
|
+
console.log(pc13.dim("No skills found."));
|
|
4524
4550
|
return;
|
|
4525
4551
|
}
|
|
4526
|
-
console.log(
|
|
4552
|
+
console.log(pc13.bold(`
|
|
4527
4553
|
${skills.length} skill(s) found:
|
|
4528
4554
|
`));
|
|
4529
4555
|
skills.forEach((skill, index) => {
|
|
4530
4556
|
const num = (index + 1).toString().padStart(2);
|
|
4531
4557
|
console.log(
|
|
4532
|
-
` ${
|
|
4558
|
+
` ${pc13.cyan(num)}. ${pc13.bold(skill.name.padEnd(30))} ${pc13.dim(skill.metadata?.description ?? "")}`
|
|
4533
4559
|
);
|
|
4534
4560
|
});
|
|
4535
|
-
console.log(
|
|
4561
|
+
console.log(pc13.dim(`
|
|
4536
4562
|
Install with: caamp skills install <name>`));
|
|
4537
|
-
console.log(
|
|
4563
|
+
console.log(pc13.dim(`Remove with: caamp skills remove <name>`));
|
|
4538
4564
|
});
|
|
4539
4565
|
}
|
|
4540
4566
|
function buildEnvelope4(operation, mvi, result, error) {
|
|
@@ -4570,7 +4596,7 @@ function emitJsonError4(operation, mvi, code, message, category, details = {}) {
|
|
|
4570
4596
|
}
|
|
4571
4597
|
|
|
4572
4598
|
// src/commands/skills/remove.ts
|
|
4573
|
-
import
|
|
4599
|
+
import pc14 from "picocolors";
|
|
4574
4600
|
function registerSkillsRemove(parent) {
|
|
4575
4601
|
parent.command("remove").description("Remove installed skill(s)").argument("[name]", "Skill name to remove").option("-g, --global", "Remove from global scope").option("-y, --yes", "Skip confirmation").option("--json", "Output as JSON (default)").option("--human", "Output in human-readable format").action(
|
|
4576
4602
|
async (name, opts) => {
|
|
@@ -4620,14 +4646,14 @@ function registerSkillsRemove(parent) {
|
|
|
4620
4646
|
return;
|
|
4621
4647
|
}
|
|
4622
4648
|
if (removed.length > 0) {
|
|
4623
|
-
console.log(
|
|
4649
|
+
console.log(pc14.green(`\u2713 Removed ${pc14.bold(name)} from: ${removed.join(", ")}`));
|
|
4624
4650
|
await removeSkillFromLock(name);
|
|
4625
4651
|
} else {
|
|
4626
|
-
console.log(
|
|
4652
|
+
console.log(pc14.yellow(`Skill ${name} not found in any provider.`));
|
|
4627
4653
|
}
|
|
4628
4654
|
if (result.errors.length > 0) {
|
|
4629
4655
|
for (const err of result.errors) {
|
|
4630
|
-
console.log(
|
|
4656
|
+
console.log(pc14.red(` ${err}`));
|
|
4631
4657
|
}
|
|
4632
4658
|
}
|
|
4633
4659
|
} else {
|
|
@@ -4640,7 +4666,7 @@ function registerSkillsRemove(parent) {
|
|
|
4640
4666
|
count: { removed: 0, total: 0 }
|
|
4641
4667
|
});
|
|
4642
4668
|
} else {
|
|
4643
|
-
console.log(
|
|
4669
|
+
console.log(pc14.dim("No skills installed."));
|
|
4644
4670
|
}
|
|
4645
4671
|
return;
|
|
4646
4672
|
}
|
|
@@ -4653,18 +4679,18 @@ function registerSkillsRemove(parent) {
|
|
|
4653
4679
|
});
|
|
4654
4680
|
return;
|
|
4655
4681
|
}
|
|
4656
|
-
console.log(
|
|
4682
|
+
console.log(pc14.bold("Installed skills:"));
|
|
4657
4683
|
for (const s of skills) {
|
|
4658
4684
|
console.log(` ${s}`);
|
|
4659
4685
|
}
|
|
4660
|
-
console.log(
|
|
4686
|
+
console.log(pc14.dim("\nUse: caamp skills remove <name>"));
|
|
4661
4687
|
}
|
|
4662
4688
|
}
|
|
4663
4689
|
);
|
|
4664
4690
|
}
|
|
4665
4691
|
|
|
4666
4692
|
// src/commands/skills/update.ts
|
|
4667
|
-
import
|
|
4693
|
+
import pc15 from "picocolors";
|
|
4668
4694
|
function registerSkillsUpdate(parent) {
|
|
4669
4695
|
parent.command("update").description("Update all outdated skills").option("-y, --yes", "Skip confirmation").option("--json", "Output as JSON (default)").option("--human", "Output in human-readable format").action(async (opts) => {
|
|
4670
4696
|
const operation = "skills.update";
|
|
@@ -4698,12 +4724,12 @@ function registerSkillsUpdate(parent) {
|
|
|
4698
4724
|
count: { updated: 0, failed: 0, skipped: 0 }
|
|
4699
4725
|
});
|
|
4700
4726
|
} else {
|
|
4701
|
-
console.log(
|
|
4727
|
+
console.log(pc15.dim("No tracked skills to update."));
|
|
4702
4728
|
}
|
|
4703
4729
|
return;
|
|
4704
4730
|
}
|
|
4705
4731
|
if (format === "human") {
|
|
4706
|
-
console.log(
|
|
4732
|
+
console.log(pc15.dim(`Checking ${entries.length} skill(s) for updates...`));
|
|
4707
4733
|
}
|
|
4708
4734
|
const outdated = [];
|
|
4709
4735
|
for (const [name] of entries) {
|
|
@@ -4725,19 +4751,19 @@ function registerSkillsUpdate(parent) {
|
|
|
4725
4751
|
count: { updated: 0, failed: 0, skipped: 0 }
|
|
4726
4752
|
});
|
|
4727
4753
|
} else {
|
|
4728
|
-
console.log(
|
|
4754
|
+
console.log(pc15.green("\nAll skills are up to date."));
|
|
4729
4755
|
}
|
|
4730
4756
|
return;
|
|
4731
4757
|
}
|
|
4732
4758
|
if (format === "human") {
|
|
4733
|
-
console.log(
|
|
4759
|
+
console.log(pc15.yellow(`
|
|
4734
4760
|
${outdated.length} skill(s) have updates available:
|
|
4735
4761
|
`));
|
|
4736
4762
|
for (const skill of outdated) {
|
|
4737
4763
|
const current = skill.currentVersion?.slice(0, 12) ?? "?";
|
|
4738
4764
|
const latest = skill.latestVersion ?? "?";
|
|
4739
4765
|
console.log(
|
|
4740
|
-
` ${
|
|
4766
|
+
` ${pc15.bold(skill.name)} ${pc15.dim(current)} ${pc15.dim("->")} ${pc15.cyan(latest)}`
|
|
4741
4767
|
);
|
|
4742
4768
|
}
|
|
4743
4769
|
}
|
|
@@ -4745,11 +4771,11 @@ ${outdated.length} skill(s) have updates available:
|
|
|
4745
4771
|
const readline = await import("readline");
|
|
4746
4772
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
4747
4773
|
const answer = await new Promise((resolve3) => {
|
|
4748
|
-
rl.question(
|
|
4774
|
+
rl.question(pc15.dim("\nProceed with update? [y/N] "), resolve3);
|
|
4749
4775
|
});
|
|
4750
4776
|
rl.close();
|
|
4751
4777
|
if (answer.toLowerCase() !== "y" && answer.toLowerCase() !== "yes") {
|
|
4752
|
-
console.log(
|
|
4778
|
+
console.log(pc15.dim("Update cancelled."));
|
|
4753
4779
|
return;
|
|
4754
4780
|
}
|
|
4755
4781
|
}
|
|
@@ -4763,7 +4789,7 @@ ${outdated.length} skill(s) have updates available:
|
|
|
4763
4789
|
const entry = tracked[skill.name];
|
|
4764
4790
|
if (!entry) continue;
|
|
4765
4791
|
if (format === "human") {
|
|
4766
|
-
console.log(
|
|
4792
|
+
console.log(pc15.dim(`Updating ${pc15.bold(skill.name)}...`));
|
|
4767
4793
|
}
|
|
4768
4794
|
try {
|
|
4769
4795
|
const parsed = parseSource(entry.source);
|
|
@@ -4785,7 +4811,7 @@ ${outdated.length} skill(s) have updates available:
|
|
|
4785
4811
|
} else {
|
|
4786
4812
|
if (format === "human") {
|
|
4787
4813
|
console.log(
|
|
4788
|
-
|
|
4814
|
+
pc15.yellow(
|
|
4789
4815
|
` Skipped ${skill.name}: source type "${parsed.type}" does not support auto-update`
|
|
4790
4816
|
)
|
|
4791
4817
|
);
|
|
@@ -4797,7 +4823,7 @@ ${outdated.length} skill(s) have updates available:
|
|
|
4797
4823
|
const providers = entry.agents.map((a) => getProvider(a)).filter((p) => p !== void 0);
|
|
4798
4824
|
if (providers.length === 0) {
|
|
4799
4825
|
if (format === "human") {
|
|
4800
|
-
console.log(
|
|
4826
|
+
console.log(pc15.yellow(` Skipped ${skill.name}: no valid providers found`));
|
|
4801
4827
|
}
|
|
4802
4828
|
skipped.push(skill.name);
|
|
4803
4829
|
continue;
|
|
@@ -4824,18 +4850,18 @@ ${outdated.length} skill(s) have updates available:
|
|
|
4824
4850
|
skill.latestVersion
|
|
4825
4851
|
);
|
|
4826
4852
|
if (format === "human") {
|
|
4827
|
-
console.log(
|
|
4853
|
+
console.log(pc15.green(` Updated ${pc15.bold(skill.name)}`));
|
|
4828
4854
|
}
|
|
4829
4855
|
updated.push(skill.name);
|
|
4830
4856
|
} else {
|
|
4831
4857
|
if (format === "human") {
|
|
4832
|
-
console.log(
|
|
4858
|
+
console.log(pc15.red(` Failed to update ${skill.name}: no agents linked`));
|
|
4833
4859
|
}
|
|
4834
4860
|
failed.push({ name: skill.name, error: "no agents linked" });
|
|
4835
4861
|
}
|
|
4836
4862
|
if (installResult.errors.length > 0 && format === "human") {
|
|
4837
4863
|
for (const err of installResult.errors) {
|
|
4838
|
-
console.log(
|
|
4864
|
+
console.log(pc15.yellow(` ${err}`));
|
|
4839
4865
|
}
|
|
4840
4866
|
}
|
|
4841
4867
|
} finally {
|
|
@@ -4844,7 +4870,7 @@ ${outdated.length} skill(s) have updates available:
|
|
|
4844
4870
|
} catch (err) {
|
|
4845
4871
|
const msg = err instanceof Error ? err.message : String(err);
|
|
4846
4872
|
if (format === "human") {
|
|
4847
|
-
console.log(
|
|
4873
|
+
console.log(pc15.red(` Failed to update ${skill.name}: ${msg}`));
|
|
4848
4874
|
}
|
|
4849
4875
|
failed.push({ name: skill.name, error: msg });
|
|
4850
4876
|
}
|
|
@@ -4864,17 +4890,17 @@ ${outdated.length} skill(s) have updates available:
|
|
|
4864
4890
|
}
|
|
4865
4891
|
console.log();
|
|
4866
4892
|
if (updated.length > 0) {
|
|
4867
|
-
console.log(
|
|
4893
|
+
console.log(pc15.green(`Updated ${updated.length} skill(s).`));
|
|
4868
4894
|
}
|
|
4869
4895
|
if (failed.length > 0) {
|
|
4870
|
-
console.log(
|
|
4896
|
+
console.log(pc15.red(`Failed to update ${failed.length} skill(s).`));
|
|
4871
4897
|
}
|
|
4872
4898
|
});
|
|
4873
4899
|
}
|
|
4874
4900
|
|
|
4875
4901
|
// src/commands/skills/validate.ts
|
|
4876
4902
|
import { resolveOutputFormat as resolveOutputFormat4 } from "@cleocode/lafs";
|
|
4877
|
-
import
|
|
4903
|
+
import pc16 from "picocolors";
|
|
4878
4904
|
function registerSkillsValidate(parent) {
|
|
4879
4905
|
parent.command("validate").description("Validate SKILL.md format").argument("[path]", "Path to SKILL.md", "SKILL.md").option("--json", "Output as JSON (default)").option("--human", "Output in human-readable format").action(async (path, opts) => {
|
|
4880
4906
|
const operation = "skills.validate";
|
|
@@ -4914,7 +4940,7 @@ function registerSkillsValidate(parent) {
|
|
|
4914
4940
|
}
|
|
4915
4941
|
);
|
|
4916
4942
|
} else {
|
|
4917
|
-
console.error(
|
|
4943
|
+
console.error(pc16.red(message));
|
|
4918
4944
|
}
|
|
4919
4945
|
process.exit(1);
|
|
4920
4946
|
}
|
|
@@ -4936,12 +4962,12 @@ function registerSkillsValidate(parent) {
|
|
|
4936
4962
|
console.log(JSON.stringify(envelope, null, 2));
|
|
4937
4963
|
} else {
|
|
4938
4964
|
if (result.valid) {
|
|
4939
|
-
console.log(
|
|
4965
|
+
console.log(pc16.green(`\u2713 ${path} is valid`));
|
|
4940
4966
|
} else {
|
|
4941
|
-
console.log(
|
|
4967
|
+
console.log(pc16.red(`\u2717 ${path} has validation errors`));
|
|
4942
4968
|
}
|
|
4943
4969
|
for (const issue of result.issues) {
|
|
4944
|
-
const icon = issue.level === "error" ?
|
|
4970
|
+
const icon = issue.level === "error" ? pc16.red("\u2717") : pc16.yellow("!");
|
|
4945
4971
|
console.log(` ${icon} [${issue.field}] ${issue.message}`);
|
|
4946
4972
|
}
|
|
4947
4973
|
}
|