@cleocode/caamp 1.0.4 → 1.1.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 +0 -0
- package/dist/{chunk-HUMRYJPE.js → chunk-KAJJ6L6H.js} +393 -61
- package/dist/chunk-KAJJ6L6H.js.map +1 -0
- package/dist/cli.d.ts +0 -0
- package/dist/cli.js +20 -20
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +270 -86
- package/dist/index.js +17 -1
- package/dist/index.js.map +0 -0
- package/package.json +5 -3
- package/providers/registry.json +0 -0
- package/dist/chunk-HUMRYJPE.js.map +0 -1
package/dist/cli.d.ts
CHANGED
|
File without changes
|
package/dist/cli.js
CHANGED
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
tokenizeCriteriaValue,
|
|
66
66
|
updateInstructionsSingleOperation,
|
|
67
67
|
validateSkill
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-KAJJ6L6H.js";
|
|
69
69
|
|
|
70
70
|
// src/cli.ts
|
|
71
71
|
import { Command } from "commander";
|
|
@@ -120,7 +120,7 @@ function baseMeta(operation, mvi) {
|
|
|
120
120
|
contextVersion: 0
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
|
-
function emitSuccess(operation, result, mvi =
|
|
123
|
+
function emitSuccess(operation, result, mvi = "standard") {
|
|
124
124
|
const envelope = {
|
|
125
125
|
$schema: "https://lafs.dev/schemas/v1/envelope.schema.json",
|
|
126
126
|
_meta: {
|
|
@@ -133,7 +133,7 @@ function emitSuccess(operation, result, mvi = true) {
|
|
|
133
133
|
};
|
|
134
134
|
console.log(JSON.stringify(envelope, null, 2));
|
|
135
135
|
}
|
|
136
|
-
function emitError(operation, error, mvi =
|
|
136
|
+
function emitError(operation, error, mvi = "standard") {
|
|
137
137
|
let envelope;
|
|
138
138
|
if (error instanceof LAFSCommandError) {
|
|
139
139
|
envelope = {
|
|
@@ -362,7 +362,7 @@ async function readTextInput(inlineContent, filePath) {
|
|
|
362
362
|
|
|
363
363
|
// src/commands/advanced/providers.ts
|
|
364
364
|
function registerAdvancedProviders(parent) {
|
|
365
|
-
parent.command("providers").description("Select providers by priority using advanced wrapper logic").option("-a, --agent <name>", "Target specific provider(s)", (v, prev) => [...prev, v], []).option("--all", "Use all registry providers (not only detected)").option("--min-tier <tier>", "Minimum priority tier: high|medium|low", "low").option("--details", "Include full provider objects").action(async (opts) => runLafsCommand("advanced.providers",
|
|
365
|
+
parent.command("providers").description("Select providers by priority using advanced wrapper logic").option("-a, --agent <name>", "Target specific provider(s)", (v, prev) => [...prev, v], []).option("--all", "Use all registry providers (not only detected)").option("--min-tier <tier>", "Minimum priority tier: high|medium|low", "low").option("--details", "Include full provider objects").action(async (opts) => runLafsCommand("advanced.providers", opts.details ? "full" : "standard", async () => {
|
|
366
366
|
const providers = resolveProviders({ all: opts.all, agent: opts.agent });
|
|
367
367
|
const minTier = parsePriority(opts.minTier);
|
|
368
368
|
const selected = selectProvidersByMinimumPriority(providers, minTier);
|
|
@@ -388,7 +388,7 @@ function registerAdvancedProviders(parent) {
|
|
|
388
388
|
|
|
389
389
|
// src/commands/advanced/batch.ts
|
|
390
390
|
function registerAdvancedBatch(parent) {
|
|
391
|
-
parent.command("batch").description("Run rollback-capable batch install for MCP + skills").option("-a, --agent <name>", "Target specific provider(s)", (v, prev) => [...prev, v], []).option("--all", "Use all registry providers (not only detected)").option("--min-tier <tier>", "Minimum priority tier: high|medium|low", "low").option("--mcp-file <path>", "JSON file containing McpBatchOperation[]").option("--skills-file <path>", "JSON file containing SkillBatchOperation[]").option("--project-dir <path>", "Project directory to resolve project-scope paths").option("--details", "Include detailed operation result").action(async (opts) => runLafsCommand("advanced.batch",
|
|
391
|
+
parent.command("batch").description("Run rollback-capable batch install for MCP + skills").option("-a, --agent <name>", "Target specific provider(s)", (v, prev) => [...prev, v], []).option("--all", "Use all registry providers (not only detected)").option("--min-tier <tier>", "Minimum priority tier: high|medium|low", "low").option("--mcp-file <path>", "JSON file containing McpBatchOperation[]").option("--skills-file <path>", "JSON file containing SkillBatchOperation[]").option("--project-dir <path>", "Project directory to resolve project-scope paths").option("--details", "Include detailed operation result").action(async (opts) => runLafsCommand("advanced.batch", opts.details ? "full" : "standard", async () => {
|
|
392
392
|
const baseProviders = resolveProviders({ all: opts.all, agent: opts.agent });
|
|
393
393
|
const minimumPriority = parsePriority(opts.minTier);
|
|
394
394
|
const providers = selectProvidersByMinimumPriority(baseProviders, minimumPriority);
|
|
@@ -448,7 +448,7 @@ function registerAdvancedBatch(parent) {
|
|
|
448
448
|
|
|
449
449
|
// src/commands/advanced/conflicts.ts
|
|
450
450
|
function registerAdvancedConflicts(parent) {
|
|
451
|
-
parent.command("conflicts").description("Preflight MCP conflict detection across providers").requiredOption("--mcp-file <path>", "JSON file containing McpBatchOperation[]").option("-a, --agent <name>", "Target specific provider(s)", (v, prev) => [...prev, v], []).option("--all", "Use all registry providers (not only detected)").option("--min-tier <tier>", "Minimum priority tier: high|medium|low", "low").option("--project-dir <path>", "Project directory to resolve project-scope paths").option("--details", "Include full conflict list").action(async (opts) => runLafsCommand("advanced.conflicts",
|
|
451
|
+
parent.command("conflicts").description("Preflight MCP conflict detection across providers").requiredOption("--mcp-file <path>", "JSON file containing McpBatchOperation[]").option("-a, --agent <name>", "Target specific provider(s)", (v, prev) => [...prev, v], []).option("--all", "Use all registry providers (not only detected)").option("--min-tier <tier>", "Minimum priority tier: high|medium|low", "low").option("--project-dir <path>", "Project directory to resolve project-scope paths").option("--details", "Include full conflict list").action(async (opts) => runLafsCommand("advanced.conflicts", opts.details ? "full" : "standard", async () => {
|
|
452
452
|
const baseProviders = resolveProviders({ all: opts.all, agent: opts.agent });
|
|
453
453
|
const minimumPriority = parsePriority(opts.minTier);
|
|
454
454
|
const providers = selectProvidersByMinimumPriority(baseProviders, minimumPriority);
|
|
@@ -501,7 +501,7 @@ function parsePolicy(value) {
|
|
|
501
501
|
return value;
|
|
502
502
|
}
|
|
503
503
|
function registerAdvancedApply(parent) {
|
|
504
|
-
parent.command("apply").description("Apply MCP operations with configurable conflict policy").requiredOption("--mcp-file <path>", "JSON file containing McpBatchOperation[]").option("--policy <policy>", "Conflict policy: fail|skip|overwrite", "fail").option("-a, --agent <name>", "Target specific provider(s)", (v, prev) => [...prev, v], []).option("--all", "Use all registry providers (not only detected)").option("--min-tier <tier>", "Minimum priority tier: high|medium|low", "low").option("--project-dir <path>", "Project directory to resolve project-scope paths").option("--details", "Include detailed apply result").action(async (opts) => runLafsCommand("advanced.apply",
|
|
504
|
+
parent.command("apply").description("Apply MCP operations with configurable conflict policy").requiredOption("--mcp-file <path>", "JSON file containing McpBatchOperation[]").option("--policy <policy>", "Conflict policy: fail|skip|overwrite", "fail").option("-a, --agent <name>", "Target specific provider(s)", (v, prev) => [...prev, v], []).option("--all", "Use all registry providers (not only detected)").option("--min-tier <tier>", "Minimum priority tier: high|medium|low", "low").option("--project-dir <path>", "Project directory to resolve project-scope paths").option("--details", "Include detailed apply result").action(async (opts) => runLafsCommand("advanced.apply", opts.details ? "full" : "standard", async () => {
|
|
505
505
|
const baseProviders = resolveProviders({ all: opts.all, agent: opts.agent });
|
|
506
506
|
const minimumPriority = parsePriority(opts.minTier);
|
|
507
507
|
const providers = selectProvidersByMinimumPriority(baseProviders, minimumPriority);
|
|
@@ -562,7 +562,7 @@ function registerAdvancedApply(parent) {
|
|
|
562
562
|
|
|
563
563
|
// src/commands/advanced/instructions.ts
|
|
564
564
|
function registerAdvancedInstructions(parent) {
|
|
565
|
-
parent.command("instructions").description("Single-operation instruction update across providers").option("-a, --agent <name>", "Target specific provider(s)", (v, prev) => [...prev, v], []).option("--all", "Use all registry providers (not only detected)").option("--min-tier <tier>", "Minimum priority tier: high|medium|low", "low").option("--scope <scope>", "Instruction scope: project|global", "project").option("--content <text>", "Inline content to inject").option("--content-file <path>", "File containing content to inject").option("--project-dir <path>", "Project directory to resolve project-scope paths").option("--details", "Include detailed per-file actions").action(async (opts) => runLafsCommand("advanced.instructions",
|
|
565
|
+
parent.command("instructions").description("Single-operation instruction update across providers").option("-a, --agent <name>", "Target specific provider(s)", (v, prev) => [...prev, v], []).option("--all", "Use all registry providers (not only detected)").option("--min-tier <tier>", "Minimum priority tier: high|medium|low", "low").option("--scope <scope>", "Instruction scope: project|global", "project").option("--content <text>", "Inline content to inject").option("--content-file <path>", "File containing content to inject").option("--project-dir <path>", "Project directory to resolve project-scope paths").option("--details", "Include detailed per-file actions").action(async (opts) => runLafsCommand("advanced.instructions", opts.details ? "full" : "standard", async () => {
|
|
566
566
|
const minimumPriority = parsePriority(opts.minTier);
|
|
567
567
|
const baseProviders = resolveProviders({ all: opts.all, agent: opts.agent });
|
|
568
568
|
const providers = selectProvidersByMinimumPriority(baseProviders, minimumPriority);
|
|
@@ -618,7 +618,7 @@ function registerAdvancedInstructions(parent) {
|
|
|
618
618
|
|
|
619
619
|
// src/commands/advanced/configure.ts
|
|
620
620
|
function registerAdvancedConfigure(parent) {
|
|
621
|
-
parent.command("configure").description("Configure global + project scope for one provider in one operation").requiredOption("-a, --agent <name>", "Target provider ID or alias").option("--global-mcp-file <path>", "JSON file for global MCP operations").option("--project-mcp-file <path>", "JSON file for project MCP operations").option("--instruction <text>", "Instruction content for both scopes").option("--instruction-file <path>", "Instruction content file for both scopes").option("--instruction-global <text>", "Instruction content for global scope").option("--instruction-global-file <path>", "Instruction content file for global scope").option("--instruction-project <text>", "Instruction content for project scope").option("--instruction-project-file <path>", "Instruction content file for project scope").option("--project-dir <path>", "Project directory to resolve project-scope paths").option("--details", "Include detailed write results").action(async (opts) => runLafsCommand("advanced.configure",
|
|
621
|
+
parent.command("configure").description("Configure global + project scope for one provider in one operation").requiredOption("-a, --agent <name>", "Target provider ID or alias").option("--global-mcp-file <path>", "JSON file for global MCP operations").option("--project-mcp-file <path>", "JSON file for project MCP operations").option("--instruction <text>", "Instruction content for both scopes").option("--instruction-file <path>", "Instruction content file for both scopes").option("--instruction-global <text>", "Instruction content for global scope").option("--instruction-global-file <path>", "Instruction content file for global scope").option("--instruction-project <text>", "Instruction content for project scope").option("--instruction-project-file <path>", "Instruction content file for project scope").option("--project-dir <path>", "Project directory to resolve project-scope paths").option("--details", "Include detailed write results").action(async (opts) => runLafsCommand("advanced.configure", opts.details ? "full" : "standard", async () => {
|
|
622
622
|
const provider = getProvider(opts.agent);
|
|
623
623
|
if (!provider) {
|
|
624
624
|
throw new LAFSCommandError(
|
|
@@ -2183,7 +2183,7 @@ async function cloneGitLabRepo(owner, repo, ref, subPath) {
|
|
|
2183
2183
|
|
|
2184
2184
|
// src/commands/skills/install.ts
|
|
2185
2185
|
function registerSkillsInstall(parent) {
|
|
2186
|
-
parent.command("install").description("Install a skill from GitHub, URL, marketplace, or
|
|
2186
|
+
parent.command("install").description("Install a skill from GitHub, URL, marketplace, or registered skill library").argument("[source]", "Skill source (GitHub URL, owner/repo, @author/name, skill-name)").option("-a, --agent <name>", "Target specific agent(s)", (v, prev) => [...prev, v], []).option("-g, --global", "Install globally").option("-y, --yes", "Skip confirmation").option("--all", "Install to all detected agents").option("--profile <name>", "Install a skill library profile (minimal, core, recommended, full)").option("--json", "Output as JSON (default)").option("--human", "Output in human-readable format").action(async (source, opts) => {
|
|
2187
2187
|
const operation = "skills.install";
|
|
2188
2188
|
const mvi = "standard";
|
|
2189
2189
|
let format;
|
|
@@ -2292,7 +2292,7 @@ function registerSkillsInstall(parent) {
|
|
|
2292
2292
|
}
|
|
2293
2293
|
} else if (parsed.type === "package") {
|
|
2294
2294
|
if (!isCatalogAvailable()) {
|
|
2295
|
-
const message = "
|
|
2295
|
+
const message = "No skill library registered. Register one with registerSkillLibraryFromPath() or set CAAMP_SKILL_LIBRARY env var.";
|
|
2296
2296
|
if (format === "json") {
|
|
2297
2297
|
emitJsonError(operation, mvi, ErrorCodes.INVALID_INPUT, message, ErrorCategories.VALIDATION);
|
|
2298
2298
|
}
|
|
@@ -2303,8 +2303,8 @@ function registerSkillsInstall(parent) {
|
|
|
2303
2303
|
if (catalogSkill) {
|
|
2304
2304
|
localPath = getSkillDir(catalogSkill.name);
|
|
2305
2305
|
skillName = catalogSkill.name;
|
|
2306
|
-
sourceValue =
|
|
2307
|
-
sourceType = "
|
|
2306
|
+
sourceValue = `library:${catalogSkill.name}`;
|
|
2307
|
+
sourceType = "library";
|
|
2308
2308
|
if (format === "human") {
|
|
2309
2309
|
console.log(` Found in catalog: ${pc11.bold(catalogSkill.name)} v${catalogSkill.version} (${pc11.dim(catalogSkill.category)})`);
|
|
2310
2310
|
}
|
|
@@ -2344,7 +2344,7 @@ function registerSkillsInstall(parent) {
|
|
|
2344
2344
|
opts.global ?? false
|
|
2345
2345
|
);
|
|
2346
2346
|
if (result.success) {
|
|
2347
|
-
const isGlobal = sourceType === "package" ? true : opts.global ?? false;
|
|
2347
|
+
const isGlobal = sourceType === "library" || sourceType === "package" ? true : opts.global ?? false;
|
|
2348
2348
|
await recordSkillInstall(
|
|
2349
2349
|
skillName,
|
|
2350
2350
|
sourceValue,
|
|
@@ -2423,7 +2423,7 @@ function registerSkillsInstall(parent) {
|
|
|
2423
2423
|
}
|
|
2424
2424
|
async function handleProfileInstall(profileName, providers, isGlobal, format, operation, mvi) {
|
|
2425
2425
|
if (!isCatalogAvailable()) {
|
|
2426
|
-
const message = "
|
|
2426
|
+
const message = "No skill library registered. Register one with registerSkillLibraryFromPath() or set CAAMP_SKILL_LIBRARY env var.";
|
|
2427
2427
|
if (format === "json") {
|
|
2428
2428
|
emitError2(operation, mvi, ErrorCodes.INVALID_INPUT, message, ErrorCategories.VALIDATION);
|
|
2429
2429
|
}
|
|
@@ -2466,16 +2466,16 @@ async function handleProfileInstall(profileName, providers, isGlobal, format, op
|
|
|
2466
2466
|
}
|
|
2467
2467
|
await recordSkillInstall(
|
|
2468
2468
|
name,
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
"
|
|
2469
|
+
`library:${name}`,
|
|
2470
|
+
`library:${name}`,
|
|
2471
|
+
"library",
|
|
2472
2472
|
result.linkedAgents,
|
|
2473
2473
|
result.canonicalPath,
|
|
2474
2474
|
true
|
|
2475
2475
|
);
|
|
2476
2476
|
installed.push({
|
|
2477
2477
|
name,
|
|
2478
|
-
scopedName:
|
|
2478
|
+
scopedName: `library:${name}`,
|
|
2479
2479
|
canonicalPath: result.canonicalPath,
|
|
2480
2480
|
providers: result.linkedAgents
|
|
2481
2481
|
});
|
|
@@ -2814,7 +2814,7 @@ function registerSkillsFind(parent) {
|
|
|
2814
2814
|
parent.command("find").description("Search marketplace for skills").argument("[query]", "Search query").option("--recommend", "Recommend skills from constraints").option("--top <n>", "Number of recommendation candidates", "3").option("--must-have <term>", "Required criteria term", (value, previous) => [...previous, value], []).option("--prefer <term>", "Preferred criteria term", (value, previous) => [...previous, value], []).option("--exclude <term>", "Excluded criteria term", (value, previous) => [...previous, value], []).option("--details", "Include expanded machine output").option("--human", "Force human-readable output").option("--json", "Output as JSON").option("--select <indexes>", "Pre-select recommendation ranks (comma-separated)").option("-l, --limit <n>", "Max results", "20").action(async (query, opts) => {
|
|
2815
2815
|
const operation = opts.recommend ? "skills.find.recommend" : "skills.find.search";
|
|
2816
2816
|
const details = Boolean(opts.details);
|
|
2817
|
-
const mvi =
|
|
2817
|
+
const mvi = details ? "full" : "standard";
|
|
2818
2818
|
let format;
|
|
2819
2819
|
try {
|
|
2820
2820
|
format = resolveOutputFormat4({
|