@skild/core 0.11.0 → 0.13.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/dist/index.d.ts +6 -2
- package/dist/index.js +22 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ declare class SkildError extends Error {
|
|
|
5
5
|
constructor(code: SkildErrorCode, message: string, details?: Record<string, unknown>);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
declare const PLATFORMS: readonly ["claude", "codex", "copilot", "antigravity", "opencode", "cursor", "windsurf"];
|
|
8
|
+
declare const PLATFORMS: readonly ["claude", "codex", "copilot", "antigravity", "opencode", "cursor", "windsurf", "agents"];
|
|
9
9
|
type Platform = (typeof PLATFORMS)[number];
|
|
10
10
|
type InstallScope = 'global' | 'project';
|
|
11
11
|
type SourceType = 'local' | 'github-url' | 'degit-shorthand' | 'registry';
|
|
@@ -112,6 +112,9 @@ interface GlobalConfig {
|
|
|
112
112
|
schemaVersion: 1;
|
|
113
113
|
defaultPlatform: Platform;
|
|
114
114
|
defaultScope: InstallScope;
|
|
115
|
+
push?: {
|
|
116
|
+
defaultRepo?: string;
|
|
117
|
+
};
|
|
115
118
|
}
|
|
116
119
|
interface RegistryAuth {
|
|
117
120
|
schemaVersion: 1;
|
|
@@ -126,6 +129,7 @@ interface RegistryAuth {
|
|
|
126
129
|
}
|
|
127
130
|
|
|
128
131
|
declare function loadOrCreateGlobalConfig(): GlobalConfig;
|
|
132
|
+
declare function saveGlobalConfig(config: GlobalConfig): void;
|
|
129
133
|
declare function loadRegistryAuth(): RegistryAuth | null;
|
|
130
134
|
declare function saveRegistryAuth(auth: RegistryAuth): void;
|
|
131
135
|
declare function clearRegistryAuth(): void;
|
|
@@ -251,4 +255,4 @@ declare function uninstallSkill(name: string, options?: InstallOptions & {
|
|
|
251
255
|
}): void;
|
|
252
256
|
declare function updateSkill(name?: string, options?: UpdateOptions): Promise<InstallRecord[]>;
|
|
253
257
|
|
|
254
|
-
export { DEFAULT_REGISTRY_URL, type DependencySourceType, type GlobalConfig, type InstallOptions, type InstallRecord, type InstallScope, type InstalledDependency, type ListOptions, type Lockfile, PLATFORMS, type Platform, type RegistryAuth, SkildError, type SkillFrontmatter, type SkillValidationIssue, type SkillValidationResult, type UpdateOptions, assertValidAlias, canonicalNameToInstallDirName, clearRegistryAuth, deriveChildSource, downloadAndExtractTarball, fetchWithTimeout, getSkillInfo, getSkillInstallDir, getSkillsDir, initSkill, installRegistrySkill, installSkill, isValidAlias, listAllSkills, listSkills, loadOrCreateGlobalConfig, loadRegistryAuth, materializeSourceToDir, materializeSourceToTemp, normalizeAlias, parseRegistrySpecifier, parseSkillFrontmatter, readSkillMd, resolveRegistryAlias, resolveRegistryUrl, resolveRegistryVersion, saveRegistryAuth, searchRegistrySkills, splitCanonicalName, stripSourceRef, toDegitPath, uninstallSkill, updateSkill, validateSkill, validateSkillDir };
|
|
258
|
+
export { DEFAULT_REGISTRY_URL, type DependencySourceType, type GlobalConfig, type InstallOptions, type InstallRecord, type InstallScope, type InstalledDependency, type ListOptions, type Lockfile, PLATFORMS, type Platform, type RegistryAuth, SkildError, type SkillFrontmatter, type SkillValidationIssue, type SkillValidationResult, type UpdateOptions, assertValidAlias, canonicalNameToInstallDirName, clearRegistryAuth, deriveChildSource, downloadAndExtractTarball, fetchWithTimeout, getSkillInfo, getSkillInstallDir, getSkillsDir, initSkill, installRegistrySkill, installSkill, isValidAlias, listAllSkills, listSkills, loadOrCreateGlobalConfig, loadRegistryAuth, materializeSourceToDir, materializeSourceToTemp, normalizeAlias, parseRegistrySpecifier, parseSkillFrontmatter, readSkillMd, resolveRegistryAlias, resolveRegistryUrl, resolveRegistryVersion, saveGlobalConfig, saveRegistryAuth, searchRegistrySkills, splitCanonicalName, stripSourceRef, toDegitPath, uninstallSkill, updateSkill, validateSkill, validateSkillDir };
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var SkildError = class extends Error {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
// src/types.ts
|
|
13
|
-
var PLATFORMS = ["claude", "codex", "copilot", "antigravity", "opencode", "cursor", "windsurf"];
|
|
13
|
+
var PLATFORMS = ["claude", "codex", "copilot", "antigravity", "opencode", "cursor", "windsurf", "agents"];
|
|
14
14
|
|
|
15
15
|
// src/storage.ts
|
|
16
16
|
import fs2 from "fs";
|
|
@@ -51,6 +51,8 @@ function getSkillsDir(platform, scope) {
|
|
|
51
51
|
return scope === "project" ? path.join(getProjectDir(), ".cursor", "skills") : path.join(getHomeDir(), ".cursor", "skills");
|
|
52
52
|
case "windsurf":
|
|
53
53
|
return scope === "project" ? path.join(getProjectDir(), ".windsurf", "skills") : path.join(getHomeDir(), ".windsurf", "skills");
|
|
54
|
+
case "agents":
|
|
55
|
+
return scope === "project" ? path.join(getProjectDir(), ".agents", "skills") : path.join(getHomeDir(), ".agents", "skills");
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
function getProjectSkildDir() {
|
|
@@ -124,18 +126,30 @@ function sanitizeLockfile(lockfile) {
|
|
|
124
126
|
);
|
|
125
127
|
return { ...lockfile, entries };
|
|
126
128
|
}
|
|
129
|
+
var GLOBAL_CONFIG_DEFAULTS = {
|
|
130
|
+
schemaVersion: 1,
|
|
131
|
+
defaultPlatform: PLATFORMS[0],
|
|
132
|
+
defaultScope: "global"
|
|
133
|
+
};
|
|
134
|
+
function applyGlobalConfigDefaults(existing) {
|
|
135
|
+
if (!existing) return { ...GLOBAL_CONFIG_DEFAULTS };
|
|
136
|
+
return {
|
|
137
|
+
...GLOBAL_CONFIG_DEFAULTS,
|
|
138
|
+
...existing,
|
|
139
|
+
push: existing.push ? { ...existing.push } : void 0
|
|
140
|
+
};
|
|
141
|
+
}
|
|
127
142
|
function loadOrCreateGlobalConfig() {
|
|
128
143
|
const filePath = getGlobalConfigPath();
|
|
129
144
|
const existing = readJsonFile(filePath);
|
|
130
|
-
if (existing) return existing;
|
|
131
|
-
const created =
|
|
132
|
-
schemaVersion: 1,
|
|
133
|
-
defaultPlatform: PLATFORMS[0],
|
|
134
|
-
defaultScope: "global"
|
|
135
|
-
};
|
|
145
|
+
if (existing) return applyGlobalConfigDefaults(existing);
|
|
146
|
+
const created = applyGlobalConfigDefaults();
|
|
136
147
|
writeJsonFile(filePath, created);
|
|
137
148
|
return created;
|
|
138
149
|
}
|
|
150
|
+
function saveGlobalConfig(config) {
|
|
151
|
+
writeJsonFile(getGlobalConfigPath(), applyGlobalConfigDefaults(config));
|
|
152
|
+
}
|
|
139
153
|
function loadRegistryAuth() {
|
|
140
154
|
return readJsonFile(getGlobalRegistryAuthPath());
|
|
141
155
|
}
|
|
@@ -1371,6 +1385,7 @@ export {
|
|
|
1371
1385
|
resolveRegistryAlias,
|
|
1372
1386
|
resolveRegistryUrl,
|
|
1373
1387
|
resolveRegistryVersion,
|
|
1388
|
+
saveGlobalConfig,
|
|
1374
1389
|
saveRegistryAuth,
|
|
1375
1390
|
searchRegistrySkills,
|
|
1376
1391
|
splitCanonicalName,
|