clementine-agent 1.18.107 → 1.18.109
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/agent/skill-store.d.ts +41 -35
- package/dist/agent/skill-store.js +339 -174
- package/dist/cli/dashboard.js +212 -52
- package/dist/types.d.ts +82 -48
- package/package.json +1 -1
|
@@ -1,57 +1,63 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Skill store — Phase A
|
|
2
|
+
* Skill store — Phase A / A.5 of the Skills-First redesign.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* disk; Phase B adds editing + testing; Phase C wires runtime invocation.
|
|
4
|
+
* Anthropic-compatible skill loader. Walks two skill directories and
|
|
5
|
+
* accepts both layouts:
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* 1. **Folder form** (Anthropic spec): <dir>/<skill-name>/SKILL.md
|
|
8
|
+
* A capital-S SKILL.md is the entry point. Sibling .md files and
|
|
9
|
+
* a scripts/ subdirectory are surfaced as bundled files.
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* 2. **Flat form** (Clementine legacy): <dir>/<skill-name>.md
|
|
12
|
+
* A single .md file with frontmatter + body. Bundled files
|
|
13
|
+
* unsupported. Used by the 12 pre-redesign skill files we already
|
|
14
|
+
* have on disk.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* `legacy` and the dashboard shows a migration badge.
|
|
16
|
+
* Discovery directories (per-project wins on name collision):
|
|
17
|
+
* - global: $CLEMENTINE_HOME/vault/00-System/skills/
|
|
18
|
+
* - per-project: <work_dir>/.clementine/skills/
|
|
20
19
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
20
|
+
* Phase A is read-only. Phase B adds editing + a "Test this skill"
|
|
21
|
+
* runner. Phase C wires runtime invocation. Phase E migrates legacy
|
|
22
|
+
* crons → folder-form skills.
|
|
24
23
|
*/
|
|
25
|
-
import type { Skill, SkillScope, CronJobDefinition } from '../types.js';
|
|
24
|
+
import type { Skill, SkillScope, SkillValidationWarning, CronJobDefinition } from '../types.js';
|
|
25
|
+
/** Run Anthropic-spec validations on a parsed skill. Errors are spec
|
|
26
|
+
* violations (skill would be rejected by the Anthropic API); warnings
|
|
27
|
+
* are best-practice hints (still loadable). Findings render in the
|
|
28
|
+
* dashboard's detail pane. */
|
|
29
|
+
export declare function validateSkill(skill: Skill): SkillValidationWarning[];
|
|
26
30
|
interface ParseResult {
|
|
27
31
|
skill: Skill;
|
|
28
32
|
/** Set when the file existed but couldn't be parsed (bad YAML, etc.).
|
|
29
|
-
* We still surface the
|
|
30
|
-
* can
|
|
33
|
+
* We still surface the skill with synthesized frontmatter so the
|
|
34
|
+
* dashboard can render the offending file with an error banner. */
|
|
31
35
|
parseError?: string;
|
|
32
36
|
}
|
|
33
|
-
/** Parse a
|
|
34
|
-
* frontmatter is malformed — the dashboard renders the parse error
|
|
35
|
-
* in-pane so the user can fix it without leaving the UI. */
|
|
37
|
+
/** Parse a flat-form skill file (single .md). */
|
|
36
38
|
export declare function parseSkillFile(filePath: string, scope: SkillScope): ParseResult;
|
|
39
|
+
/** Parse a folder-form skill (Anthropic spec: <name>/SKILL.md plus optional
|
|
40
|
+
* bundled files). The folder name is the canonical skill identifier. */
|
|
41
|
+
export declare function parseSkillFolder(folderPath: string, scope: SkillScope): ParseResult;
|
|
37
42
|
export interface ListSkillsOptions {
|
|
38
|
-
/** Optional per-project work_dir to
|
|
39
|
-
*
|
|
43
|
+
/** Optional per-project work_dir to scan. Per-project skills shadow
|
|
44
|
+
* global ones with the same identifier. */
|
|
40
45
|
projectWorkDir?: string;
|
|
41
|
-
/** Optional cron jobs
|
|
42
|
-
* usedByTriggers field on each skill via the existing skills[] array
|
|
43
|
-
* on CronJobDefinition (Phase A's join). */
|
|
46
|
+
/** Optional cron jobs for the usedByTriggers join (via skills[]). */
|
|
44
47
|
jobs?: CronJobDefinition[];
|
|
45
48
|
}
|
|
46
|
-
/** Top-level discovery API.
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
+
/** Top-level discovery API. Merges global + per-project pools, with
|
|
50
|
+
* per-project taking precedence. Populates usedByTriggers when jobs
|
|
51
|
+
* are passed. Returned list is sorted alphabetically by name. */
|
|
49
52
|
export declare function listSkills(opts?: ListSkillsOptions): Skill[];
|
|
50
|
-
/** Get
|
|
51
|
-
*
|
|
53
|
+
/** Get one skill by name, applying per-project precedence. Returns
|
|
54
|
+
* null when neither pool has the skill. */
|
|
52
55
|
export declare function getSkill(name: string, opts?: ListSkillsOptions): Skill | null;
|
|
53
|
-
/**
|
|
54
|
-
*
|
|
56
|
+
/** Read one bundled file's contents — used by Phase B's preview pane.
|
|
57
|
+
* Defends against directory traversal: rejects paths that escape the
|
|
58
|
+
* skill folder. */
|
|
59
|
+
export declare function readBundledFile(skill: Skill, relPath: string): string | null;
|
|
60
|
+
/** Diagnostics for the dashboard — expose where the loader looked. */
|
|
55
61
|
export declare function _skillDirsForDiagnostics(workDir?: string): {
|
|
56
62
|
global: string;
|
|
57
63
|
project: string | null;
|