Read skills from the global and workspace .agents/skills directories
- Discover skill directories under ~/.agents/skills and each workspace''s .agents/skills; a directory qualifies with a full skill.manifest.json or just a SKILL.md, whose manifest is derived (frontmatter name or the directory name). Paths resolve per platform on Windows, macOS, and Linux. - Sync at startup for every organization and again when the Skills page opens; skills the org already carries are skipped, and one broken directory cannot block the rest. - AGENTCOMPANY_NEW_SKILLS_ROOT points tests at a temporary library (overriding USERPROFILE crashes Electron on Windows).
This commit is contained in:
1 parent
256e0680c6
commit
2d43950123
14 files changed
+303
-12
No files matched your search
@@ -16,12 +16,12 @@ export interface SkillManifest {
|
||||
outputs: unknown;
|
||||
}
|
||||
|
||||
export function loadSkillManifest(directoryPath: string, requestedVersion: string): SkillManifest {
|
||||
export function loadSkillManifest(directoryPath: string, requestedVersion?: string): SkillManifest {
|
||||
const manifestPath = join(directoryPath, "skill.manifest.json");
|
||||
if (!existsSync(manifestPath)) throw new Error("skill.manifest.json is required.");
|
||||
const raw = JSON.parse(readFileSync(manifestPath, "utf8")) as Record<string, unknown>;
|
||||
const manifest = normalizeManifest(raw);
|
||||
if (manifest.version !== requestedVersion) {
|
||||
if (requestedVersion !== undefined && manifest.version !== requestedVersion) {
|
||||
throw new Error("Skill manifest version must match the requested version.");
|
||||
}
|
||||
verifyDeclaredFile(directoryPath, manifest.entrypoint);
|
||||
|
||||
Reference in new issue
Block a user