skilld 1.7.1 → 1.7.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/_chunks/prefix.mjs
CHANGED
|
@@ -43,15 +43,15 @@ function parseSkillInput(input) {
|
|
|
43
43
|
}
|
|
44
44
|
if (trimmed.startsWith("@")) {
|
|
45
45
|
const rest = trimmed.slice(1);
|
|
46
|
-
|
|
47
|
-
if (slashIdx === -1) return {
|
|
46
|
+
if (rest.indexOf("/") === -1) return {
|
|
48
47
|
type: "curator",
|
|
49
48
|
handle: rest
|
|
50
49
|
};
|
|
50
|
+
const { name, tag } = splitPackageTag(trimmed);
|
|
51
51
|
return {
|
|
52
|
-
type: "
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
type: "bare",
|
|
53
|
+
package: name,
|
|
54
|
+
tag
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
const gitSource = parseGitSkillInput(trimmed);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefix.mjs","names":[],"sources":["../../src/core/prefix.ts"],"sourcesContent":["/**\n * Prefix-based input parser for `skilld add`\n *\n * All sources require an explicit prefix:\n * npm:vue → package skill from registry\n * crate:serde → Rust crate from crates.io\n * gh:owner/repo → git skill\n * github:o/r → git skill (alias)\n * @handle → curator's skills\n * @handle/coll → specific collection\n *\n * Bare names (no prefix) are deprecated but still resolve as npm: with a warning.\n */\n\nimport type { GitSkillSource } from '../sources/git-skills.ts'\nimport { parseGitSkillInput } from '../sources/git-skills.ts'\n\nexport type SkillSource\n = | { type: 'npm', package: string, tag?: string }\n | { type: 'crate', package: string, version?: string }\n | { type: 'git', source: GitSkillSource }\n | { type: 'curator', handle: string }\n | { type: 'collection', handle: string, name: string }\n | { type: 'bare', package: string, tag?: string }\n\n/**\n * Parse a single CLI input token into a typed SkillSource.\n *\n * Does NOT emit deprecation warnings; callers handle that for `bare` type.\n */\nexport function parseSkillInput(input: string): SkillSource {\n const trimmed = input.trim()\n\n // npm: prefix → package skill\n if (trimmed.startsWith('npm:')) {\n const rest = trimmed.slice(4)\n const { name, tag } = splitPackageTag(rest)\n return { type: 'npm', package: name, tag }\n }\n\n // crate: prefix → Rust crate from crates.io\n if (trimmed.startsWith('crate:')) {\n const rest = trimmed.slice(6).trim()\n const atIdx = rest.indexOf('@')\n const name = (atIdx === -1 ? rest : rest.slice(0, atIdx)).toLowerCase()\n const version = atIdx === -1 ? undefined : rest.slice(atIdx + 1) || undefined\n return { type: 'crate', package: name, version }\n }\n\n // gh: or github: prefix → git skill\n if (trimmed.startsWith('gh:') || trimmed.startsWith('github:')) {\n const rest = trimmed.startsWith('gh:') ? trimmed.slice(3) : trimmed.slice(7)\n const gitSource = parseGitSkillInput(rest)\n if (gitSource)\n return { type: 'git', source: gitSource }\n // If gh: prefix used but can't parse as git, treat as github shorthand\n if (/^[\\w.-]+\\/[\\w.-]+/.test(rest)) {\n const [owner, repo] = rest.split('/')\n return { type: 'git', source: { type: 'github', owner, repo } }\n }\n // Invalid gh: input, fall through to bare\n return { type: 'bare', package: rest }\n }\n\n // @handle or @
|
|
1
|
+
{"version":3,"file":"prefix.mjs","names":[],"sources":["../../src/core/prefix.ts"],"sourcesContent":["/**\n * Prefix-based input parser for `skilld add`\n *\n * All sources require an explicit prefix:\n * npm:vue → package skill from registry\n * crate:serde → Rust crate from crates.io\n * gh:owner/repo → git skill\n * github:o/r → git skill (alias)\n * @handle → curator's skills\n * @handle/coll → specific collection\n *\n * Bare names (no prefix) are deprecated but still resolve as npm: with a warning.\n */\n\nimport type { GitSkillSource } from '../sources/git-skills.ts'\nimport { parseGitSkillInput } from '../sources/git-skills.ts'\n\nexport type SkillSource\n = | { type: 'npm', package: string, tag?: string }\n | { type: 'crate', package: string, version?: string }\n | { type: 'git', source: GitSkillSource }\n | { type: 'curator', handle: string }\n | { type: 'collection', handle: string, name: string }\n | { type: 'bare', package: string, tag?: string }\n\n/**\n * Parse a single CLI input token into a typed SkillSource.\n *\n * Does NOT emit deprecation warnings; callers handle that for `bare` type.\n */\nexport function parseSkillInput(input: string): SkillSource {\n const trimmed = input.trim()\n\n // npm: prefix → package skill\n if (trimmed.startsWith('npm:')) {\n const rest = trimmed.slice(4)\n const { name, tag } = splitPackageTag(rest)\n return { type: 'npm', package: name, tag }\n }\n\n // crate: prefix → Rust crate from crates.io\n if (trimmed.startsWith('crate:')) {\n const rest = trimmed.slice(6).trim()\n const atIdx = rest.indexOf('@')\n const name = (atIdx === -1 ? rest : rest.slice(0, atIdx)).toLowerCase()\n const version = atIdx === -1 ? undefined : rest.slice(atIdx + 1) || undefined\n return { type: 'crate', package: name, version }\n }\n\n // gh: or github: prefix → git skill\n if (trimmed.startsWith('gh:') || trimmed.startsWith('github:')) {\n const rest = trimmed.startsWith('gh:') ? trimmed.slice(3) : trimmed.slice(7)\n const gitSource = parseGitSkillInput(rest)\n if (gitSource)\n return { type: 'git', source: gitSource }\n // If gh: prefix used but can't parse as git, treat as github shorthand\n if (/^[\\w.-]+\\/[\\w.-]+/.test(rest)) {\n const [owner, repo] = rest.split('/')\n return { type: 'git', source: { type: 'github', owner, repo } }\n }\n // Invalid gh: input, fall through to bare\n return { type: 'bare', package: rest }\n }\n\n // @handle (curator) or @scope/pkg (npm scoped package)\n if (trimmed.startsWith('@')) {\n const rest = trimmed.slice(1)\n const slashIdx = rest.indexOf('/')\n if (slashIdx === -1) {\n return { type: 'curator', handle: rest }\n }\n // @scope/pkg → treat as npm scoped package (bare, deprecated form)\n // Collections must be installed via npm:@handle/coll or a future prefix.\n const { name, tag } = splitPackageTag(trimmed)\n return { type: 'bare', package: name, tag }\n }\n\n // Try existing git detection (SSH, URLs, local paths, owner/repo shorthand)\n const gitSource = parseGitSkillInput(trimmed)\n if (gitSource)\n return { type: 'git', source: gitSource }\n\n // Bare name (deprecated) → resolves as npm\n const { name, tag } = splitPackageTag(trimmed)\n return { type: 'bare', package: name, tag }\n}\n\n/**\n * Parse multiple CLI input tokens, classifying each.\n */\nexport function parseSkillInputs(inputs: string[]): SkillSource[] {\n return inputs.map(parseSkillInput)\n}\n\n/**\n * Resolve a CLI input to the bare package/skill name used for lookup in the lockfile.\n * Strips `npm:` / `gh:` prefixes. Returns null for curator/collection (not addressable\n * as a single skill name).\n */\nexport function resolveSkillName(input: string): string | null {\n const source = parseSkillInput(input)\n switch (source.type) {\n case 'npm':\n case 'bare':\n return source.package\n case 'crate':\n return `crate:${source.package}`\n case 'git':\n if (source.source.type === 'github' && source.source.repo)\n return source.source.repo\n return null\n case 'curator':\n case 'collection':\n return null\n default: {\n const _exhaustive: never = source\n throw new Error(`Unhandled SkillSource type: ${JSON.stringify(_exhaustive)}`)\n }\n }\n}\n\n/**\n * Map a lockfile/identity package name to the storage-safe name used for\n * cache directories and symlinks. `crate:serde` → `@skilld-crate/serde`;\n * other names pass through unchanged.\n */\nexport function toStoragePackageName(identityName: string): string {\n if (identityName.startsWith('crate:'))\n return `@skilld-crate/${identityName.slice('crate:'.length)}`\n return identityName\n}\n\n/**\n * Split \"package@tag\" into name and optional tag.\n * Handles scoped packages: \"@scope/pkg@tag\"\n */\nfunction splitPackageTag(spec: string): { name: string, tag?: string } {\n // Scoped: @scope/pkg@tag → find the @ after the scope\n if (spec.startsWith('@')) {\n const slashIdx = spec.indexOf('/')\n if (slashIdx !== -1) {\n const afterSlash = spec.indexOf('@', slashIdx)\n if (afterSlash !== -1)\n return { name: spec.slice(0, afterSlash), tag: spec.slice(afterSlash + 1) || undefined }\n }\n return { name: spec }\n }\n // Unscoped: pkg@tag\n const atIdx = spec.indexOf('@')\n if (atIdx !== -1)\n return { name: spec.slice(0, atIdx), tag: spec.slice(atIdx + 1) || undefined }\n return { name: spec }\n}\n"],"mappings":";;;;;AA8BA,SAAgB;GACd,MAAM;GAGN,SAAI;GAEF;GACA;;KAAsB,QAAS,WAAA,SAAA,EAAA;QAAM,OAAA,QAAA,MAAA,EAAA,CAAA,MAAA;QAAK,QAAA,KAAA,QAAA,IAAA;;GAI5C,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A,QAAgB,EAAA,IAA8C,KAAA;EAErE;QACQ,EAAA,MAAA,MAAW;;AAGf,SAAI,oBACF,GAAA,wBAAO,GAAA,mBAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skilld",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.7.
|
|
4
|
+
"version": "1.7.2",
|
|
5
5
|
"description": "Generate AI agent skills from npm package documentation",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"node": ">=22.6.0"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@clack/prompts": "^1.
|
|
52
|
+
"@clack/prompts": "^1.3.0",
|
|
53
53
|
"@huggingface/transformers": "^4.2.0",
|
|
54
|
-
"@mariozechner/pi-ai": "^0.
|
|
54
|
+
"@mariozechner/pi-ai": "^0.71.0",
|
|
55
55
|
"@mdream/crawl": "^1.1.0",
|
|
56
56
|
"citty": "^0.2.2",
|
|
57
57
|
"consola": "^3.4.2",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"sqlite-vec": "^0.1.9",
|
|
74
74
|
"std-env": "^4.1.0",
|
|
75
75
|
"tinyglobby": "^0.2.16",
|
|
76
|
-
"typebox": "^1.1.
|
|
76
|
+
"typebox": "^1.1.36",
|
|
77
77
|
"typescript": "6.0.2",
|
|
78
78
|
"unagent": "^0.0.8",
|
|
79
79
|
"unist-util-visit": "^5.1.0"
|