feat(skills): usage stats, source filtering, archived skills, provenance, pin toggle (#386)
This commit is contained in:
@@ -39,10 +39,13 @@ export const PROVIDER_ENV_MAP: Record<string, { api_key_env: string; base_url_en
|
||||
|
||||
// --- Types ---
|
||||
|
||||
export type SkillSource = 'builtin' | 'hub' | 'local'
|
||||
|
||||
export interface SkillInfo {
|
||||
name: string
|
||||
description: string
|
||||
enabled: boolean
|
||||
source?: SkillSource
|
||||
}
|
||||
|
||||
export interface SkillCategory {
|
||||
|
||||
@@ -574,3 +574,20 @@ export async function importProfile(archivePath: string, name?: string): Promise
|
||||
throw new Error(`Failed to import profile: ${err.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pin or unpin a skill via hermes curator
|
||||
*/
|
||||
export async function pinSkill(name: string, pinned: boolean): Promise<string> {
|
||||
const subcmd = pinned ? 'pin' : 'unpin'
|
||||
try {
|
||||
const { stdout, stderr } = await execFileAsync(HERMES_BIN, ['curator', subcmd, name], {
|
||||
timeout: 15000,
|
||||
...execOpts,
|
||||
})
|
||||
return stdout || stderr
|
||||
} catch (err: any) {
|
||||
logger.error(err, `Hermes CLI: curator ${subcmd} failed`)
|
||||
throw new Error(`Failed to ${subcmd} skill: ${err.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user