ccski 1.0.0 → 1.0.2
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/cli.mjs +4460 -231
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{registry-DGrbpgs5.mjs → registry-ChUc2356.mjs} +61 -24
- package/dist/registry-ChUc2356.mjs.map +1 -0
- package/package.json +4 -4
- package/dist/registry-DGrbpgs5.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -13,6 +13,8 @@ interface SkillMetadata {
|
|
|
13
13
|
name: string;
|
|
14
14
|
/** Skill description (from frontmatter) */
|
|
15
15
|
description: string;
|
|
16
|
+
/** Whether the skill is disabled (.SKILL.md) */
|
|
17
|
+
disabled?: boolean;
|
|
16
18
|
/** Location type */
|
|
17
19
|
location: SkillLocation;
|
|
18
20
|
/** Absolute path to skill directory */
|
|
@@ -254,11 +256,14 @@ interface DiscoveryOptions {
|
|
|
254
256
|
skipPlugins?: boolean;
|
|
255
257
|
/** Whether to scan built-in directories (.agent/.claude). Defaults to true. */
|
|
256
258
|
scanDefaultDirs?: boolean;
|
|
259
|
+
/** Include disabled skills (.SKILL.md) in results */
|
|
260
|
+
includeDisabled?: boolean;
|
|
257
261
|
}
|
|
258
262
|
interface ScanOptions {
|
|
259
263
|
location?: SkillLocation;
|
|
260
264
|
recursive?: boolean;
|
|
261
265
|
diagnostics: DiscoveryDiagnostics;
|
|
266
|
+
includeDisabled?: boolean;
|
|
262
267
|
}
|
|
263
268
|
/**
|
|
264
269
|
* Scan a single skill directory and return found skills
|
|
@@ -266,7 +271,8 @@ interface ScanOptions {
|
|
|
266
271
|
declare function scanSkillDirectory(dirPath: string, {
|
|
267
272
|
location,
|
|
268
273
|
recursive,
|
|
269
|
-
diagnostics
|
|
274
|
+
diagnostics,
|
|
275
|
+
includeDisabled
|
|
270
276
|
}: ScanOptions): SkillMetadata[];
|
|
271
277
|
/**
|
|
272
278
|
* Discover all skills from standard directories
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types/skill.ts","../src/types/errors.ts","../src/types/schemas.ts","../src/core/parser.ts","../src/core/discovery.ts","../src/core/plugins.ts","../src/core/registry.ts"],"sourcesContent":[],"mappings":";;;;;;AAGY,KAAA,aAAA,GAAa,MAAA,GAAA,SAAA,GAAA,QAAA;AAKzB;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types/skill.ts","../src/types/errors.ts","../src/types/schemas.ts","../src/core/parser.ts","../src/core/discovery.ts","../src/core/plugins.ts","../src/core/registry.ts"],"sourcesContent":[],"mappings":";;;;;;AAGY,KAAA,aAAA,GAAa,MAAA,GAAA,SAAA,GAAA,QAAA;AAKzB;AA4BA;AAUA;AASiB,UA/CA,aAAA,CA+CW;EAYX;;;;EChEJ;EAaA,QAAA,CAAA,EAAA,OAAA;EAaA;EAeA,QAAA,ED5BD,aC4BiB;EAchB;;;;ECrDA;;;;;;;;;;;;;;AAQA,UFuBI,KAAA,SAAc,aEhB7B,CAAA;;;;;;;;;AAP4B,UFiCb,gBAAA,CEjCa;EAYjB,IAAA,EAAA,MAAA;;;;;;;UF8BI,WAAA;;;;;;;;;;AEtBjB;AACY,UFiCK,gBAAA,CEjC4B;EACjC,OAAA,EAAA,MAAA;WFkCD,eAAe;;;;;;;AAlEd,cCAC,UAAA,SAAmB,KAAA,CDAP;EAKR,SAAA,WAAa,EAAA,MAQlB,EAAA;EAoBK,WAAM,CAAA,OAAA,EAAQ,MAAA,EAAA,WAAa,CAAA,EAAA,MAAA,EAAA;AAU5C;AASA;AAYA;;cCnDa,kBAAA,SAA2B,UAAA;;EAb3B,WAAA,CAAA,SAAW,EAAA,MAAQ,EAAK,WAAA,CAAA,EAAA,MAAA,EAAA;AAarC;AAaA;AAeA;AAcA;cA7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EAea,OAAA,CAAA,CAAA,EAAA,IAAA;EAcA;;;YK6BD;EJlFC;;;sBIyFS;;;;;;;;sBAyDA;EJlJa;;AAQnC;;;;;;;gBI6JgB;IJ7Jc,kBAAA,EAAA,MAAA,EAAA;IAAA,aAAA,EAAA,MAAA,EAAA;IAYjB,QAAA,EAAA,MAAA,EAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as CcskiError, C as PluginEntrySchema, H as SkillNotFoundError, S as InstalledPluginsSchema, U as ValidationError, V as ParseError, a as discoverSkills, b as parseSkillFile, i as SKILL_DIRECTORIES, o as loadSkill, s as scanSkillDirectory, t as SkillRegistry, w as SkillFrontmatterSchema, x as validateSkillFile, z as AmbiguousSkillNameError } from "./registry-ChUc2356.mjs";
|
|
2
2
|
|
|
3
3
|
export { AmbiguousSkillNameError, CcskiError, InstalledPluginsSchema, ParseError, PluginEntrySchema, SKILL_DIRECTORIES, SkillFrontmatterSchema, SkillNotFoundError, SkillRegistry, ValidationError, discoverSkills, loadSkill, parseSkillFile, scanSkillDirectory, validateSkillFile };
|
|
@@ -12293,20 +12293,38 @@ function setColorEnabled(enabled) {
|
|
|
12293
12293
|
colorEnabled = enabled;
|
|
12294
12294
|
colors = createColors({ useColor: colorEnabled });
|
|
12295
12295
|
}
|
|
12296
|
+
const applyTone = (colorFn) => (text) => colorEnabled ? colorFn(text) : text;
|
|
12297
|
+
const tone = {
|
|
12298
|
+
primary: applyTone((text) => colors.blue(text)),
|
|
12299
|
+
accent: applyTone((text) => colors.magenta(text)),
|
|
12300
|
+
info: applyTone((text) => colors.cyan(text)),
|
|
12301
|
+
success: applyTone((text) => colors.green(text)),
|
|
12302
|
+
warning: applyTone((text) => colors.yellow(text)),
|
|
12303
|
+
danger: applyTone((text) => colors.red(text)),
|
|
12304
|
+
muted: applyTone((text) => colors.dim(text)),
|
|
12305
|
+
bold: applyTone((text) => colors.bold(text)),
|
|
12306
|
+
underline: applyTone((text) => colors.underline(text))
|
|
12307
|
+
};
|
|
12296
12308
|
function highlight$1(text, query) {
|
|
12297
12309
|
if (!colorEnabled) return text;
|
|
12298
12310
|
const escaped = escapeRegExp$1(query);
|
|
12299
12311
|
const regex$1 = new RegExp(escaped, "gi");
|
|
12300
|
-
return text.replace(regex$1, (match) =>
|
|
12312
|
+
return text.replace(regex$1, (match) => tone.bold(tone.success(match)));
|
|
12301
12313
|
}
|
|
12302
12314
|
function dim(text) {
|
|
12303
|
-
return
|
|
12315
|
+
return tone.muted(text);
|
|
12304
12316
|
}
|
|
12305
12317
|
function success(text) {
|
|
12306
|
-
return
|
|
12318
|
+
return tone.success(text);
|
|
12307
12319
|
}
|
|
12308
12320
|
function error(text) {
|
|
12309
|
-
return
|
|
12321
|
+
return tone.danger(text);
|
|
12322
|
+
}
|
|
12323
|
+
function warn(text) {
|
|
12324
|
+
return tone.warning(text);
|
|
12325
|
+
}
|
|
12326
|
+
function heading(text) {
|
|
12327
|
+
return tone.underline(tone.bold(tone.accent(text)));
|
|
12310
12328
|
}
|
|
12311
12329
|
function escapeRegExp$1(value) {
|
|
12312
12330
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -12328,28 +12346,29 @@ function formatBytes(bytes) {
|
|
|
12328
12346
|
}
|
|
12329
12347
|
function renderList(items) {
|
|
12330
12348
|
if (items.length === 0) return "";
|
|
12331
|
-
const titleWidth = Math.max(...items.map((item) =>
|
|
12349
|
+
const titleWidth = Math.max(...items.map((item) => displayWidth(item.title)));
|
|
12332
12350
|
return items.map((item) => {
|
|
12333
12351
|
const title = padAnsi(item.title, titleWidth);
|
|
12352
|
+
const coloredTitle = item.color ? item.color(title) : tone.primary(title);
|
|
12334
12353
|
const meta = item.meta ? ` ${dim(item.meta)}` : "";
|
|
12354
|
+
const badge = item.badge ? ` ${item.badge}` : "";
|
|
12335
12355
|
const wrapWidth = Math.max(20, Math.min(process.stdout?.columns ?? 80, 120) - 4);
|
|
12336
|
-
|
|
12356
|
+
return `- ${coloredTitle}${badge}${meta}${item.description ? "\n " + wrap(item.description, {
|
|
12337
12357
|
width: wrapWidth,
|
|
12338
12358
|
indent: "",
|
|
12339
12359
|
newline: "\n",
|
|
12340
12360
|
trim: true,
|
|
12341
12361
|
cut: false
|
|
12342
|
-
}).replace(/\n/g, "\n ") : ""
|
|
12343
|
-
return `- ${colors.blue(title)}${meta}${description}`;
|
|
12362
|
+
}).replace(/\n/g, "\n ") : ""}`;
|
|
12344
12363
|
}).join("\n\n");
|
|
12345
12364
|
}
|
|
12346
12365
|
function padAnsi(value, width) {
|
|
12347
|
-
const length =
|
|
12366
|
+
const length = displayWidth(value);
|
|
12348
12367
|
if (length >= width) return value;
|
|
12349
12368
|
return value + " ".repeat(width - length);
|
|
12350
12369
|
}
|
|
12351
|
-
function
|
|
12352
|
-
return value.replace(/\x1b\[[0-9;]*m/g, "")
|
|
12370
|
+
function displayWidth(value) {
|
|
12371
|
+
return stringWidth(value.replace(/\x1b\[[0-9;]*m/g, ""));
|
|
12353
12372
|
}
|
|
12354
12373
|
|
|
12355
12374
|
//#endregion
|
|
@@ -12384,7 +12403,7 @@ function determineLocation(dirPath) {
|
|
|
12384
12403
|
if (normalizedPath.startsWith(join(home, ".agent")) || normalizedPath.startsWith(join(home, ".claude"))) return "user";
|
|
12385
12404
|
return "user";
|
|
12386
12405
|
}
|
|
12387
|
-
function collectSkillDirectories(root, recursive, diagnostics, accumulator) {
|
|
12406
|
+
function collectSkillDirectories(root, recursive, diagnostics, accumulator, includeDisabled) {
|
|
12388
12407
|
diagnostics.scannedDirectories.push(root);
|
|
12389
12408
|
if (!existsSync(root)) return;
|
|
12390
12409
|
let entries;
|
|
@@ -12398,21 +12417,37 @@ function collectSkillDirectories(root, recursive, diagnostics, accumulator) {
|
|
|
12398
12417
|
for (const entry of entries) {
|
|
12399
12418
|
if (!entry.isDirectory()) continue;
|
|
12400
12419
|
const skillDir = join(root, entry.name);
|
|
12401
|
-
|
|
12402
|
-
|
|
12420
|
+
const skillFilePath = join(skillDir, "SKILL.md");
|
|
12421
|
+
const disabledFilePath = join(skillDir, ".SKILL.md");
|
|
12422
|
+
if (existsSync(skillFilePath) || includeDisabled && existsSync(disabledFilePath)) accumulator.add(skillDir);
|
|
12423
|
+
if (recursive) collectSkillDirectories(skillDir, true, diagnostics, accumulator, includeDisabled);
|
|
12403
12424
|
}
|
|
12404
12425
|
}
|
|
12405
12426
|
/**
|
|
12406
12427
|
* Scan a single skill directory and return found skills
|
|
12407
12428
|
*/
|
|
12408
|
-
function scanSkillDirectory(dirPath, { location, recursive = true, diagnostics }) {
|
|
12429
|
+
function scanSkillDirectory(dirPath, { location, recursive = true, diagnostics, includeDisabled = false }) {
|
|
12409
12430
|
const skills = [];
|
|
12410
12431
|
const skillDirectories = /* @__PURE__ */ new Set();
|
|
12411
|
-
collectSkillDirectories(dirPath, recursive, diagnostics, skillDirectories);
|
|
12432
|
+
collectSkillDirectories(dirPath, recursive, diagnostics, skillDirectories, includeDisabled);
|
|
12412
12433
|
for (const skillDir of skillDirectories) {
|
|
12413
12434
|
const skillFilePath = join(skillDir, "SKILL.md");
|
|
12414
|
-
|
|
12415
|
-
|
|
12435
|
+
const disabledFilePath = join(skillDir, ".SKILL.md");
|
|
12436
|
+
const hasSkill = existsSync(skillFilePath);
|
|
12437
|
+
const hasDisabled = includeDisabled && existsSync(disabledFilePath);
|
|
12438
|
+
if (hasSkill && hasDisabled) diagnostics.conflicts.push(`Both SKILL.md and .SKILL.md found in ${skillDir}.`);
|
|
12439
|
+
const candidates = [];
|
|
12440
|
+
if (hasSkill) candidates.push({
|
|
12441
|
+
path: skillFilePath,
|
|
12442
|
+
disabled: false
|
|
12443
|
+
});
|
|
12444
|
+
if (hasDisabled) candidates.push({
|
|
12445
|
+
path: disabledFilePath,
|
|
12446
|
+
disabled: true
|
|
12447
|
+
});
|
|
12448
|
+
if (candidates.length === 0) continue;
|
|
12449
|
+
for (const candidate of candidates) try {
|
|
12450
|
+
const parsed = parseSkillFile(candidate.path);
|
|
12416
12451
|
const resources = checkBundledResources(skillDir);
|
|
12417
12452
|
const skillLocation = location ?? determineLocation(skillDir);
|
|
12418
12453
|
skills.push({
|
|
@@ -12420,11 +12455,12 @@ function scanSkillDirectory(dirPath, { location, recursive = true, diagnostics }
|
|
|
12420
12455
|
description: parsed.frontmatter.description,
|
|
12421
12456
|
location: skillLocation,
|
|
12422
12457
|
path: skillDir,
|
|
12458
|
+
disabled: candidate.disabled,
|
|
12423
12459
|
...resources
|
|
12424
12460
|
});
|
|
12425
12461
|
} catch (error$1) {
|
|
12426
|
-
console.warn(colors.yellow(`Warning: Failed to parse ${
|
|
12427
|
-
diagnostics.warnings.push(`Failed to parse ${
|
|
12462
|
+
console.warn(colors.yellow(`Warning: Failed to parse ${candidate.path}: ${error$1 instanceof Error ? error$1.message : String(error$1)}`));
|
|
12463
|
+
diagnostics.warnings.push(`Failed to parse ${candidate.path}: ${error$1 instanceof Error ? error$1.message : String(error$1)}`);
|
|
12428
12464
|
}
|
|
12429
12465
|
}
|
|
12430
12466
|
return skills;
|
|
@@ -12445,7 +12481,8 @@ function discoverSkills(options = {}) {
|
|
|
12445
12481
|
for (const dir of directories) {
|
|
12446
12482
|
const skills = scanSkillDirectory(dir.startsWith("/") ? dir : resolve(process.cwd(), dir), {
|
|
12447
12483
|
diagnostics,
|
|
12448
|
-
recursive: true
|
|
12484
|
+
recursive: true,
|
|
12485
|
+
includeDisabled: options.includeDisabled === true
|
|
12449
12486
|
});
|
|
12450
12487
|
for (const skill of skills) if (!skillMap.has(skill.name)) skillMap.set(skill.name, skill);
|
|
12451
12488
|
else {
|
|
@@ -12462,7 +12499,7 @@ function discoverSkills(options = {}) {
|
|
|
12462
12499
|
* Load full skill content
|
|
12463
12500
|
*/
|
|
12464
12501
|
function loadSkill(metadata) {
|
|
12465
|
-
const parsed = parseSkillFile(join(metadata.path, "SKILL.md"));
|
|
12502
|
+
const parsed = parseSkillFile(join(metadata.path, metadata.disabled ? ".SKILL.md" : "SKILL.md"));
|
|
12466
12503
|
return {
|
|
12467
12504
|
...metadata,
|
|
12468
12505
|
content: parsed.fullContent,
|
|
@@ -13292,5 +13329,5 @@ var SkillRegistry = class {
|
|
|
13292
13329
|
};
|
|
13293
13330
|
|
|
13294
13331
|
//#endregion
|
|
13295
|
-
export {
|
|
13296
|
-
//# sourceMappingURL=registry-
|
|
13332
|
+
export { intersectionType as A, CcskiError as B, PluginEntrySchema as C, custom as D, booleanType as E, recordType as F, __require as G, SkillNotFoundError as H, stringType as I, __toESM as K, unionType as L, numberType as M, objectType as N, discriminatedUnionType as O, optionalType as P, unknownType as R, InstalledPluginsSchema as S, arrayType as T, ValidationError as U, ParseError as V, __commonJS as W, tone as _, discoverSkills as a, parseSkillFile as b, colors as c, formatBytes as d, heading as f, success as g, setColorEnabled as h, SKILL_DIRECTORIES as i, literalType as j, enumType as k, dim as l, renderList as m, containsCaseInsensitive as n, loadSkill as o, highlight$1 as p, rankStrings as r, scanSkillDirectory as s, SkillRegistry as t, error as u, warn as v, SkillFrontmatterSchema as w, validateSkillFile as x, wrap as y, AmbiguousSkillNameError as z };
|
|
13333
|
+
//# sourceMappingURL=registry-ChUc2356.mjs.map
|