@skild/core 0.1.1 → 0.1.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/index.d.ts +8 -1
- package/dist/index.js +12 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -103,7 +103,14 @@ interface ListedSkill {
|
|
|
103
103
|
hasSkillMd: boolean;
|
|
104
104
|
record?: InstallRecord | null;
|
|
105
105
|
}
|
|
106
|
+
interface ListedSkillWithContext extends ListedSkill {
|
|
107
|
+
platform: Platform;
|
|
108
|
+
scope: InstallScope;
|
|
109
|
+
}
|
|
106
110
|
declare function listSkills(options?: ListOptions): ListedSkill[];
|
|
111
|
+
declare function listAllSkills(options?: {
|
|
112
|
+
scope?: InstallScope;
|
|
113
|
+
}): ListedSkillWithContext[];
|
|
107
114
|
declare function getSkillInfo(name: string, options?: ListOptions): InstallRecord;
|
|
108
115
|
declare function validateSkill(nameOrPath: string, options?: {
|
|
109
116
|
platform?: Platform;
|
|
@@ -114,4 +121,4 @@ declare function uninstallSkill(name: string, options?: InstallOptions & {
|
|
|
114
121
|
}): void;
|
|
115
122
|
declare function updateSkill(name?: string, options?: UpdateOptions): Promise<InstallRecord[]>;
|
|
116
123
|
|
|
117
|
-
export { type GlobalConfig, type InstallOptions, type InstallRecord, type InstallScope, type ListOptions, type Lockfile, PLATFORMS, type Platform, SkildError, type SkillFrontmatter, type SkillValidationIssue, type SkillValidationResult, type UpdateOptions, getSkillInfo, getSkillInstallDir, getSkillsDir, initSkill, installSkill, listSkills, loadOrCreateGlobalConfig, uninstallSkill, updateSkill, validateSkill, validateSkillDir };
|
|
124
|
+
export { type GlobalConfig, type InstallOptions, type InstallRecord, type InstallScope, type ListOptions, type Lockfile, PLATFORMS, type Platform, SkildError, type SkillFrontmatter, type SkillValidationIssue, type SkillValidationResult, type UpdateOptions, getSkillInfo, getSkillInstallDir, getSkillsDir, initSkill, installSkill, listAllSkills, listSkills, loadOrCreateGlobalConfig, uninstallSkill, updateSkill, validateSkill, validateSkillDir };
|
package/dist/index.js
CHANGED
|
@@ -436,7 +436,7 @@ function listSkills(options = {}) {
|
|
|
436
436
|
const { platform, scope } = resolvePlatformAndScope(options);
|
|
437
437
|
const skillsDir = getSkillsDir(platform, scope);
|
|
438
438
|
if (!fs6.existsSync(skillsDir)) return [];
|
|
439
|
-
const entries = fs6.readdirSync(skillsDir, { withFileTypes: true }).filter((e) => e.isDirectory());
|
|
439
|
+
const entries = fs6.readdirSync(skillsDir, { withFileTypes: true }).filter((e) => e.isDirectory() && !e.name.startsWith("."));
|
|
440
440
|
return entries.map((e) => {
|
|
441
441
|
const dir = path7.join(skillsDir, e.name);
|
|
442
442
|
const hasSkillMd = fs6.existsSync(path7.join(dir, "SKILL.md"));
|
|
@@ -444,6 +444,16 @@ function listSkills(options = {}) {
|
|
|
444
444
|
return { name: e.name, installDir: dir, hasSkillMd, record };
|
|
445
445
|
}).sort((a, b) => a.name.localeCompare(b.name));
|
|
446
446
|
}
|
|
447
|
+
function listAllSkills(options = {}) {
|
|
448
|
+
const scope = options.scope || loadOrCreateGlobalConfig().defaultScope;
|
|
449
|
+
return PLATFORMS.flatMap(
|
|
450
|
+
(platform) => listSkills({ platform, scope }).map((s) => ({
|
|
451
|
+
...s,
|
|
452
|
+
platform,
|
|
453
|
+
scope
|
|
454
|
+
}))
|
|
455
|
+
);
|
|
456
|
+
}
|
|
447
457
|
function getSkillInfo(name, options = {}) {
|
|
448
458
|
const { platform, scope } = resolvePlatformAndScope(options);
|
|
449
459
|
const installDir = getSkillInstallDir(platform, scope, name);
|
|
@@ -495,6 +505,7 @@ export {
|
|
|
495
505
|
getSkillsDir,
|
|
496
506
|
initSkill,
|
|
497
507
|
installSkill,
|
|
508
|
+
listAllSkills,
|
|
498
509
|
listSkills,
|
|
499
510
|
loadOrCreateGlobalConfig,
|
|
500
511
|
uninstallSkill,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skild/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Skild core library (headless) for installing, validating, and managing Agent Skills locally.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"directory": "packages/core"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
|
-
"build": "tsup src/index.ts --format esm --dts --clean",
|
|
41
|
+
"build": "tsup src/index.ts --format esm --dts --clean --silent",
|
|
42
42
|
"dev": "tsup src/index.ts --format esm --watch",
|
|
43
43
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
44
44
|
}
|