reskill 1.17.1 → 1.18.1
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/commands/find.d.ts +1 -0
- package/dist/cli/commands/find.d.ts.map +1 -1
- package/dist/cli/commands/publish.d.ts +10 -0
- package/dist/cli/commands/publish.d.ts.map +1 -1
- package/dist/cli/index.js +37 -18
- package/dist/core/skill-manager.d.ts +6 -1
- package/dist/core/skill-manager.d.ts.map +1 -1
- package/dist/index.js +14 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/find.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/find.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAcpC,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA0ED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAwCnF;AAMD,eAAO,MAAM,WAAW,SAWH,CAAC;AAEtB,eAAe,WAAW,CAAC"}
|
|
@@ -27,6 +27,16 @@ export declare function buildPublishSkillName(name: string, registry: string, _u
|
|
|
27
27
|
* @internal Exported for testing
|
|
28
28
|
*/
|
|
29
29
|
export declare function isBlockedPublicRegistry(registryUrl: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Check authentication
|
|
32
|
+
*
|
|
33
|
+
* Token resolution: --token CLI flag > RESKILL_TOKEN env > ~/.reskillrc
|
|
34
|
+
*
|
|
35
|
+
* @internal Exported for testing
|
|
36
|
+
*/
|
|
37
|
+
export declare function checkAuth(registry: string, dryRun: boolean, cliToken?: string): {
|
|
38
|
+
token: string;
|
|
39
|
+
} | null;
|
|
30
40
|
/**
|
|
31
41
|
* Parse user's confirmation answer
|
|
32
42
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/publish.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/publish.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuDpC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAcR;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAYpE;AAqBD;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,EACf,QAAQ,CAAC,EAAE,MAAM,GAChB;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAsB1B;AAkLD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAI1D;AAoBD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,CAyBnE;AA0TD,eAAO,MAAM,cAAc,SAcH,CAAC;AAEzB,eAAe,cAAc,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -4305,14 +4305,17 @@ class RegistryResolver {
|
|
|
4305
4305
|
*
|
|
4306
4306
|
* Resolution order:
|
|
4307
4307
|
* 1. Explicit CLI override (options.registry)
|
|
4308
|
-
* 2. Scoped skills → getRegistryUrl(scope)
|
|
4308
|
+
* 2. Scoped skills → getRegistryUrl(scope, scopeRegistries from skills.json)
|
|
4309
4309
|
* 3. Unscoped skills → lock file registry (O(1), no network)
|
|
4310
4310
|
* 4. Unscoped skills → probe skills.json registries (non-git-host, network)
|
|
4311
4311
|
* 5. Default → PUBLIC_REGISTRY
|
|
4312
4312
|
*/ async resolveRegistryUrl(ref, explicitRegistry) {
|
|
4313
4313
|
if (explicitRegistry) return explicitRegistry;
|
|
4314
4314
|
const parsed = parseSkillIdentifier(ref);
|
|
4315
|
-
if (parsed.scope)
|
|
4315
|
+
if (parsed.scope) {
|
|
4316
|
+
const scopeRegistries = this.getScopeRegistriesFromConfig();
|
|
4317
|
+
return getRegistryUrl(parsed.scope, scopeRegistries);
|
|
4318
|
+
}
|
|
4316
4319
|
// Fast path: lock file has registry URL
|
|
4317
4320
|
const locked = this.lockManager.get(parsed.name);
|
|
4318
4321
|
if (locked?.registry) return locked.registry;
|
|
@@ -4344,6 +4347,15 @@ class RegistryResolver {
|
|
|
4344
4347
|
return gitHostPatterns.some((pattern)=>normalizedUrl.includes(pattern));
|
|
4345
4348
|
}
|
|
4346
4349
|
/**
|
|
4350
|
+
* Extract @scope-prefixed entries from skills.json registries
|
|
4351
|
+
* so users can configure custom scope→registry mappings declaratively.
|
|
4352
|
+
*/ getScopeRegistriesFromConfig() {
|
|
4353
|
+
const registries = this.config.getRegistries();
|
|
4354
|
+
const scopeRegistries = {};
|
|
4355
|
+
for (const [name, url] of Object.entries(registries))if (name.startsWith('@')) scopeRegistries[name] = url;
|
|
4356
|
+
return scopeRegistries;
|
|
4357
|
+
}
|
|
4358
|
+
/**
|
|
4347
4359
|
* Derive a registry name from a URL for storing in skills.json.registries.
|
|
4348
4360
|
* Returns null for git hosts (already in DEFAULT_REGISTRIES).
|
|
4349
4361
|
*/ deriveRegistryName(registryUrl) {
|
|
@@ -6579,8 +6591,15 @@ class AuthManager {
|
|
|
6579
6591
|
return;
|
|
6580
6592
|
}
|
|
6581
6593
|
const registry = resolveRegistryForSearch(options.registry);
|
|
6594
|
+
// Resolve auth token: --token flag > RESKILL_TOKEN env > ~/.reskillrc
|
|
6595
|
+
let token = options.token;
|
|
6596
|
+
if (!token) {
|
|
6597
|
+
const authManager = new AuthManager();
|
|
6598
|
+
token = authManager.getToken(registry) ?? void 0;
|
|
6599
|
+
}
|
|
6582
6600
|
const client = new RegistryClient({
|
|
6583
|
-
registry
|
|
6601
|
+
registry,
|
|
6602
|
+
token
|
|
6584
6603
|
});
|
|
6585
6604
|
try {
|
|
6586
6605
|
const { items, total } = await client.search(query, {
|
|
@@ -6600,7 +6619,7 @@ class AuthManager {
|
|
|
6600
6619
|
// ============================================================================
|
|
6601
6620
|
// Command Definition
|
|
6602
6621
|
// ============================================================================
|
|
6603
|
-
const findCommand = new __WEBPACK_EXTERNAL_MODULE_commander__.Command('find').alias('search').description('Search for skills in the registry').argument('<query>', 'Search query').option('-r, --registry <url>', 'Registry URL (or set RESKILL_REGISTRY env var, or defaults.publishRegistry in skills.json)').option('-l, --limit <n>', 'Maximum number of results', '10').option('-j, --json', 'Output as JSON').action(findAction);
|
|
6622
|
+
const findCommand = new __WEBPACK_EXTERNAL_MODULE_commander__.Command('find').alias('search').description('Search for skills in the registry').argument('<query>', 'Search query').option('-r, --registry <url>', 'Registry URL (or set RESKILL_REGISTRY env var, or defaults.publishRegistry in skills.json)').option('-l, --limit <n>', 'Maximum number of results', '10').option('-j, --json', 'Output as JSON').option('-t, --token <token>', 'Auth token for registry API requests (for CI/CD)').action(findAction);
|
|
6604
6623
|
/**
|
|
6605
6624
|
* Group path utilities — normalization, slug generation, and validation.
|
|
6606
6625
|
*
|
|
@@ -9106,7 +9125,15 @@ class SkillValidator {
|
|
|
9106
9125
|
}
|
|
9107
9126
|
/**
|
|
9108
9127
|
* Check authentication
|
|
9109
|
-
|
|
9128
|
+
*
|
|
9129
|
+
* Token resolution: --token CLI flag > RESKILL_TOKEN env > ~/.reskillrc
|
|
9130
|
+
*
|
|
9131
|
+
* @internal Exported for testing
|
|
9132
|
+
*/ function checkAuth(registry, dryRun, cliToken) {
|
|
9133
|
+
// --token flag takes highest priority
|
|
9134
|
+
if (cliToken) return {
|
|
9135
|
+
token: cliToken
|
|
9136
|
+
};
|
|
9110
9137
|
const authManager = new AuthManager();
|
|
9111
9138
|
const token = authManager.getToken(registry);
|
|
9112
9139
|
if (!token) {
|
|
@@ -9117,7 +9144,7 @@ class SkillValidator {
|
|
|
9117
9144
|
logger_logger.error('Authentication required');
|
|
9118
9145
|
logger_logger.newline();
|
|
9119
9146
|
logger_logger.log('You must be logged in to publish skills.');
|
|
9120
|
-
logger_logger.log("Run 'reskill login' to authenticate
|
|
9147
|
+
logger_logger.log("Run 'reskill login' to authenticate, or pass --token <token>.");
|
|
9121
9148
|
process.exit(1);
|
|
9122
9149
|
}
|
|
9123
9150
|
return {
|
|
@@ -9376,7 +9403,7 @@ async function publishAction(skillPath, options) {
|
|
|
9376
9403
|
try {
|
|
9377
9404
|
// 1. Check authentication (skip for dry-run)
|
|
9378
9405
|
// Note: checkAuth exits the process if not authenticated (unless dry-run)
|
|
9379
|
-
checkAuth(registry, options.dryRun || false);
|
|
9406
|
+
const authResult = checkAuth(registry, options.dryRun || false, options.token);
|
|
9380
9407
|
// 2. Load skill
|
|
9381
9408
|
const skill = validator.loadSkill(absolutePath);
|
|
9382
9409
|
// 2.5. Check version - prompt if missing and not in --yes/--dry-run mode
|
|
@@ -9476,16 +9503,8 @@ async function publishAction(skillPath, options) {
|
|
|
9476
9503
|
return;
|
|
9477
9504
|
}
|
|
9478
9505
|
}
|
|
9479
|
-
// 10. Get auth token
|
|
9480
|
-
const
|
|
9481
|
-
const token = authManager.getToken(registry);
|
|
9482
|
-
if (!token) {
|
|
9483
|
-
logger_logger.error('Authentication required');
|
|
9484
|
-
logger_logger.newline();
|
|
9485
|
-
logger_logger.log('You must be logged in to publish skills.');
|
|
9486
|
-
logger_logger.log("Run 'reskill login' to authenticate.");
|
|
9487
|
-
process.exit(1);
|
|
9488
|
-
}
|
|
9506
|
+
// 10. Get auth token (already resolved by checkAuth in step 1)
|
|
9507
|
+
const token = authResult?.token;
|
|
9489
9508
|
// 11. Actually publish
|
|
9490
9509
|
logger_logger.newline();
|
|
9491
9510
|
logger_logger.log(`Publishing to ${registry}...`);
|
|
@@ -9541,7 +9560,7 @@ async function publishAction(skillPath, options) {
|
|
|
9541
9560
|
// ============================================================================
|
|
9542
9561
|
// Command Definition
|
|
9543
9562
|
// ============================================================================
|
|
9544
|
-
const publishCommand = new __WEBPACK_EXTERNAL_MODULE_commander__.Command('publish').alias('pub').description('Publish a skill to the registry').argument('[path]', 'Path to skill directory', '.').option('-r, --registry <url>', 'Registry URL (or set RESKILL_REGISTRY env var, or defaults.publishRegistry in skills.json)').option('-t, --tag <tag>', 'Git tag to publish').option('--access <level>', 'Access level: public or restricted', 'public').option('-n, --dry-run', 'Validate without publishing').option('-y, --yes', 'Skip confirmation prompts').option('-g, --group <path>', 'Publish skill into a group (e.g., "kanyun/frontend")').action(publishAction);
|
|
9563
|
+
const publishCommand = new __WEBPACK_EXTERNAL_MODULE_commander__.Command('publish').alias('pub').description('Publish a skill to the registry').argument('[path]', 'Path to skill directory', '.').option('-r, --registry <url>', 'Registry URL (or set RESKILL_REGISTRY env var, or defaults.publishRegistry in skills.json)').option('-t, --tag <tag>', 'Git tag to publish').option('--access <level>', 'Access level: public or restricted', 'public').option('-n, --dry-run', 'Validate without publishing').option('-y, --yes', 'Skip confirmation prompts').option('-g, --group <path>', 'Publish skill into a group (e.g., "kanyun/frontend")').option('--token <token>', 'Auth token for registry API requests (for CI/CD)').action(publishAction);
|
|
9545
9564
|
/**
|
|
9546
9565
|
* uninstall command - Uninstall one or more skills
|
|
9547
9566
|
*/ const uninstallCommand = new __WEBPACK_EXTERNAL_MODULE_commander__.Command('uninstall').alias('un').alias('remove').alias('rm').description('Uninstall one or more skills').argument('<skills...>', 'Skill names to uninstall').option('-g, --global', 'Uninstall from global installation (~/.claude/skills)').option('-y, --yes', 'Skip confirmation prompts').action(async (skillNames, options)=>{
|
|
@@ -118,7 +118,7 @@ export declare class SkillManager {
|
|
|
118
118
|
*
|
|
119
119
|
* Resolution order:
|
|
120
120
|
* 1. Explicit CLI override (options.registry)
|
|
121
|
-
* 2. Scoped skills → getRegistryUrl(scope)
|
|
121
|
+
* 2. Scoped skills → getRegistryUrl(scope, scopeRegistries from skills.json)
|
|
122
122
|
* 3. Unscoped skills → lock file registry (O(1), no network)
|
|
123
123
|
* 4. Unscoped skills → probe skills.json registries (non-git-host, network)
|
|
124
124
|
* 5. Default → PUBLIC_REGISTRY
|
|
@@ -129,6 +129,11 @@ export declare class SkillManager {
|
|
|
129
129
|
* Git hosts are not skill registries and should be skipped during probe.
|
|
130
130
|
*/
|
|
131
131
|
private isGitHostRegistry;
|
|
132
|
+
/**
|
|
133
|
+
* Extract @scope-prefixed entries from skills.json registries
|
|
134
|
+
* so users can configure custom scope→registry mappings declaratively.
|
|
135
|
+
*/
|
|
136
|
+
private getScopeRegistriesFromConfig;
|
|
132
137
|
/**
|
|
133
138
|
* Derive a registry name from a URL for storing in skills.json.registries.
|
|
134
139
|
* Returns null for git hosts (already in DEFAULT_REGISTRIES).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-manager.d.ts","sourceRoot":"","sources":["../../src/core/skill-manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,c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W,uBAAuB;IA2ErC;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,0BAA0B;IAyBlC;;;OAGG;IACH,OAAO,CAAC,cAAc;IAQtB;;;;;OAKG;YACW,wBAAwB;IA0FtC;;;;;;;OAOG;IACG,sBAAsB,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAWpD;;OAEG;IACH,qBAAqB,IAAI,WAAW;IAQpC;;OAEG;IACH,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG;QAAE,KAAK,EAAE,SAAS,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE;IAenF;;OAEG;IACH,gBAAgB,IAAI,SAAS,EAAE;IAI/B;;OAEG;IACH,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC;CAyBtF;AAED,eAAe,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4690,14 +4690,17 @@ class RegistryResolver {
|
|
|
4690
4690
|
*
|
|
4691
4691
|
* Resolution order:
|
|
4692
4692
|
* 1. Explicit CLI override (options.registry)
|
|
4693
|
-
* 2. Scoped skills → getRegistryUrl(scope)
|
|
4693
|
+
* 2. Scoped skills → getRegistryUrl(scope, scopeRegistries from skills.json)
|
|
4694
4694
|
* 3. Unscoped skills → lock file registry (O(1), no network)
|
|
4695
4695
|
* 4. Unscoped skills → probe skills.json registries (non-git-host, network)
|
|
4696
4696
|
* 5. Default → PUBLIC_REGISTRY
|
|
4697
4697
|
*/ async resolveRegistryUrl(ref, explicitRegistry) {
|
|
4698
4698
|
if (explicitRegistry) return explicitRegistry;
|
|
4699
4699
|
const parsed = parseSkillIdentifier(ref);
|
|
4700
|
-
if (parsed.scope)
|
|
4700
|
+
if (parsed.scope) {
|
|
4701
|
+
const scopeRegistries = this.getScopeRegistriesFromConfig();
|
|
4702
|
+
return getRegistryUrl(parsed.scope, scopeRegistries);
|
|
4703
|
+
}
|
|
4701
4704
|
// Fast path: lock file has registry URL
|
|
4702
4705
|
const locked = this.lockManager.get(parsed.name);
|
|
4703
4706
|
if (locked?.registry) return locked.registry;
|
|
@@ -4729,6 +4732,15 @@ class RegistryResolver {
|
|
|
4729
4732
|
return gitHostPatterns.some((pattern)=>normalizedUrl.includes(pattern));
|
|
4730
4733
|
}
|
|
4731
4734
|
/**
|
|
4735
|
+
* Extract @scope-prefixed entries from skills.json registries
|
|
4736
|
+
* so users can configure custom scope→registry mappings declaratively.
|
|
4737
|
+
*/ getScopeRegistriesFromConfig() {
|
|
4738
|
+
const registries = this.config.getRegistries();
|
|
4739
|
+
const scopeRegistries = {};
|
|
4740
|
+
for (const [name, url] of Object.entries(registries))if (name.startsWith('@')) scopeRegistries[name] = url;
|
|
4741
|
+
return scopeRegistries;
|
|
4742
|
+
}
|
|
4743
|
+
/**
|
|
4732
4744
|
* Derive a registry name from a URL for storing in skills.json.registries.
|
|
4733
4745
|
* Returns null for git hosts (already in DEFAULT_REGISTRIES).
|
|
4734
4746
|
*/ deriveRegistryName(registryUrl) {
|