@senpi/runtime 3.0.6-dev.runtime-phase-2.20260630134536 → 3.0.6-dev.runtime-phase-2.20260630182800

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.
Files changed (48) hide show
  1. package/dist/cli/senpi-commands.d.ts.map +1 -1
  2. package/dist/cli/senpi-commands.js +4 -0
  3. package/dist/cli/senpi-commands.js.map +1 -1
  4. package/dist/index.d.ts +19 -6
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +0 -3
  7. package/dist/index.js.map +1 -1
  8. package/dist/skills-manager/bootstrap.d.ts +12 -7
  9. package/dist/skills-manager/bootstrap.d.ts.map +1 -1
  10. package/dist/skills-manager/bootstrap.js +31 -20
  11. package/dist/skills-manager/bootstrap.js.map +1 -1
  12. package/dist/skills-manager/clone-groups.d.ts +20 -0
  13. package/dist/skills-manager/clone-groups.d.ts.map +1 -0
  14. package/dist/skills-manager/clone-groups.js +45 -0
  15. package/dist/skills-manager/clone-groups.js.map +1 -0
  16. package/dist/skills-manager/constants.d.ts +5 -33
  17. package/dist/skills-manager/constants.d.ts.map +1 -1
  18. package/dist/skills-manager/constants.js +11 -50
  19. package/dist/skills-manager/constants.js.map +1 -1
  20. package/dist/skills-manager/coordinator.d.ts +26 -119
  21. package/dist/skills-manager/coordinator.d.ts.map +1 -1
  22. package/dist/skills-manager/coordinator.js +145 -346
  23. package/dist/skills-manager/coordinator.js.map +1 -1
  24. package/dist/skills-manager/fetcher.d.ts +23 -2
  25. package/dist/skills-manager/fetcher.d.ts.map +1 -1
  26. package/dist/skills-manager/fetcher.js +36 -6
  27. package/dist/skills-manager/fetcher.js.map +1 -1
  28. package/dist/skills-manager/manifest.d.ts +160 -0
  29. package/dist/skills-manager/manifest.d.ts.map +1 -0
  30. package/dist/skills-manager/manifest.js +185 -0
  31. package/dist/skills-manager/manifest.js.map +1 -0
  32. package/dist/skills-manager/skills-manifest.json +16 -0
  33. package/dist/skills-manager/types.d.ts +61 -30
  34. package/dist/skills-manager/types.d.ts.map +1 -1
  35. package/dist/skills-manager/utils.d.ts +10 -26
  36. package/dist/skills-manager/utils.d.ts.map +1 -1
  37. package/dist/skills-manager/utils.js +18 -34
  38. package/dist/skills-manager/utils.js.map +1 -1
  39. package/dist/skills-manager/version-manager.d.ts +21 -91
  40. package/dist/skills-manager/version-manager.d.ts.map +1 -1
  41. package/dist/skills-manager/version-manager.js +48 -178
  42. package/dist/skills-manager/version-manager.js.map +1 -1
  43. package/dist/skills-manager/writer.d.ts +12 -1
  44. package/dist/skills-manager/writer.d.ts.map +1 -1
  45. package/dist/skills-manager/writer.js +50 -4
  46. package/dist/skills-manager/writer.js.map +1 -1
  47. package/openclaw.plugin.json +18 -6
  48. package/package.json +3 -2
@@ -0,0 +1,16 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "defaults": {
4
+ "repo": "https://github.com/Senpi-ai/senpi-skills",
5
+ "branch": "main"
6
+ },
7
+ "skills": [
8
+ { "name": "senpi-trading-runtime", "branch": "strategy-v2", "maxMajor": 3 },
9
+ { "name": "senpi-strategy-author", "branch": "strategy-v2", "maxMajor": 1 },
10
+ { "name": "senpi-strategy-discover", "branch": "strategy-v2", "maxMajor": 2 },
11
+ { "name": "senpi-strategy-ops", "branch": "strategy-v2", "maxMajor": 2 },
12
+ { "name": "senpi-portfolio", "branch": "strategy-v2", "maxMajor": 1 },
13
+ { "name": "senpi-smart-money", "branch": "strategy-v2", "maxMajor": 1 },
14
+ { "name": "senpi-trader-research", "branch": "strategy-v2", "maxMajor": 1 }
15
+ ]
16
+ }
@@ -1,4 +1,26 @@
1
1
  export type SkillUpdateKind = "none" | "patch" | "minor" | "major" | "unknown";
2
+ /**
3
+ * Per-skill source override. Lets an operator/QA point one skill at a
4
+ * different repo/branch/path than the manifest declares — e.g. testing a skill
5
+ * on a feature branch without editing the checked-in manifest.
6
+ *
7
+ * A per-skill `branch` override **beats** the global `SENPI_SKILLS_BRANCH`
8
+ * env knob (per-skill intent wins over the force-all knob); only the
9
+ * `SENPI_SKILLS_BRANCH_<NAME>` per-skill env var outranks it. See
10
+ * `resolveSkillSource` for the full precedence.
11
+ */
12
+ export interface SkillSourceOverride {
13
+ repo?: string;
14
+ branch?: string;
15
+ /** Pin to a commit SHA, or `"latest"` to track the branch tip. */
16
+ commit?: string;
17
+ path?: string;
18
+ /**
19
+ * Auto-update major-version ceiling for this skill (overrides the manifest).
20
+ * See {@link import("./manifest.js").SkillManifestEntry.maxMajor}.
21
+ */
22
+ maxMajor?: number;
23
+ }
2
24
  /** Minimal logger interface accepted throughout the skills-manager package. */
3
25
  export interface LoggerLike {
4
26
  info(...args: unknown[]): void;
@@ -21,7 +43,21 @@ export interface RawSkillsManagerConfig {
21
43
  * `DEFAULT_SKILLS_DIRS` when omitted, null, an empty array, or wrong-typed.
22
44
  */
23
45
  skillsDir?: string | string[];
46
+ /**
47
+ * @deprecated Ignored. The managed skill set is defined solely by the
48
+ * manifest (`skills-manifest.json`). This field is tolerated for backward
49
+ * compatibility with existing configs but no longer affects which skills are
50
+ * managed. Use `overrides` to retarget a skill's source, or `enabled: false`
51
+ * to disable the manager.
52
+ */
24
53
  skills?: string[];
54
+ /**
55
+ * Per-skill source overrides keyed by skill name. Optional. Each entry may
56
+ * override `repo`, `branch`, and/or `path` for that skill (e.g.
57
+ * `{ "senpi-strategy-ops": { "branch": "strategy-v2" } }`). The global
58
+ * `SENPI_SKILLS_BRANCH` env var still takes precedence over these.
59
+ */
60
+ overrides?: Record<string, SkillSourceOverride>;
25
61
  }
26
62
  /** Resolved config — all fields have safe defaults filled in. */
27
63
  export interface SkillsManagerConfig {
@@ -36,16 +72,19 @@ export interface SkillsManagerConfig {
36
72
  */
37
73
  skillsDir: string[];
38
74
  /**
39
- * Skill names this coordinator manages.
40
- *
41
- * Resolution rules in `resolveSkillsManagerConfig`:
42
- * - Field omitted in raw config → defaults to `DEFAULT_MANAGED_SKILLS`
43
- * (currently `["senpi-trading-runtime"]`).
44
- * - Explicit non-empty array → uses those names.
45
- * - Explicit empty array `[]` → discovery mode: scan subdirs under
46
- * `skillsDir`.
75
+ * @deprecated Ignored by the coordinator. The managed skill set is the
76
+ * manifest set (`getManifestSkillNames`), full stop. Still resolved here
77
+ * (defaults to the manifest names) for backward-compatible config shape, but
78
+ * nothing reads it to define the set. To disable the manager use
79
+ * `enabled: false`; to retarget a skill's source use `overrides`.
47
80
  */
48
81
  skills: string[];
82
+ /**
83
+ * Per-skill source overrides (repo/branch/path), keyed by skill name.
84
+ * Always present after resolution (defaults to `{}`). See
85
+ * {@link SkillSourceOverride}.
86
+ */
87
+ overrides: Record<string, SkillSourceOverride>;
49
88
  }
50
89
  /** Per-skill state persisted across gateway restarts. */
51
90
  export interface SkillState {
@@ -64,9 +103,6 @@ export interface SkillState {
64
103
  */
65
104
  latestVersion: string | null;
66
105
  lastCheckedAt: string | null;
67
- lastAppliedVersion: string | null;
68
- /** Dedup key: if remote major version matches this, skip re-notification. */
69
- lastNotifiedMajorVersion: string | null;
70
106
  consecutiveFailures: number;
71
107
  lastFailureAt: string | null;
72
108
  lastFailureReason: string | null;
@@ -97,29 +133,19 @@ export interface SkillSnapshot {
97
133
  lastCheckedAt: string | null;
98
134
  consecutiveFailures: number;
99
135
  lastFailureReason: string | null;
136
+ /**
137
+ * True when the latest observed remote major exceeds the installed major —
138
+ * i.e. a major upgrade is available but not yet installed (gated unless the
139
+ * skill's `maxMajor` ceiling authorizes it). Surfaced by `senpi skills status`
140
+ * so pending majors are visible without notifications.
141
+ */
142
+ majorPending: boolean;
100
143
  }
101
144
  /** Result of a version check for a single skill. */
102
145
  export interface SkillVersionInfo {
103
146
  localVersion: string | null;
104
147
  remoteVersion: string | null;
105
148
  updateKind: SkillUpdateKind;
106
- /**
107
- * Short description parsed from the **remote** SKILL.md frontmatter (the
108
- * version the user is being notified about), surfaced back to the
109
- * coordinator so notification text can include an "About:" line that
110
- * reflects the upcoming version rather than the potentially-stale local
111
- * copy.
112
- *
113
- * Null when:
114
- * - The remote fetch returned 404 (skill not in the remote repo).
115
- * - The remote SKILL.md is present but its frontmatter has no
116
- * `description` field.
117
- *
118
- * Optional in the interface for backward compatibility with injected
119
- * test deps that only return version data; the real `checkSkillVersion`
120
- * always populates it (possibly null) on every return path.
121
- */
122
- remoteDescription?: string | null;
123
149
  }
124
150
  /** Injectable overrides used in unit tests to avoid network and git calls. */
125
151
  export interface SkillsUpdateCoordinatorDeps {
@@ -130,7 +156,7 @@ export interface SkillsUpdateCoordinatorDeps {
130
156
  * `skillsDirs` is the search-path array from the resolved config; the real
131
157
  * `checkSkillVersion` tries each in order when reading SKILL.md.
132
158
  */
133
- checkSkillVersion?: (skillsDirs: readonly string[], skillName: string, rawBaseUrl: string, logger?: LoggerLike) => Promise<SkillVersionInfo>;
159
+ checkSkillVersion?: (skillsDirs: readonly string[], skillName: string, rawBaseUrl: string, logger?: LoggerLike, remotePath?: string) => Promise<SkillVersionInfo>;
134
160
  /**
135
161
  * Override clone + install — receives the list of skill names that need
136
162
  * updating and the config. Defaults to real cloneSkillsRepo + installSkill.
@@ -138,13 +164,18 @@ export interface SkillsUpdateCoordinatorDeps {
138
164
  cloneAndInstall?: (skills: string[], config: SkillsManagerConfig) => Promise<Map<string, string | null>>;
139
165
  /** Override bootstrap — avoids real git clone in unit tests. */
140
166
  bootstrapSkillsIfNeeded?: (config: SkillsManagerConfig, logger: LoggerLike) => Promise<void>;
167
+ /**
168
+ * Override the managed skill set. **Test-only seam** — production always
169
+ * uses the manifest (`getManifestSkillNames`). Lets unit tests drive the set
170
+ * without a fixture manifest on disk.
171
+ */
172
+ listManagedSkills?: () => string[];
141
173
  }
142
174
  /** Constructor options for {@link SkillsUpdateCoordinator}. */
143
175
  export interface SkillsUpdateCoordinatorOptions {
144
176
  config: SkillsManagerConfig;
145
177
  stateDir: string;
146
178
  logger: LoggerLike;
147
- notify: (message: string) => Promise<void>;
148
179
  deps?: SkillsUpdateCoordinatorDeps;
149
180
  }
150
181
  /**
@@ -1 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AC,gBAAgB,CAAC,CAAC;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,CAChB,MAAM,EAAE,MAAM,EAAE,EAChB,MAAM,EAAE,mBAAmB,KACxB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IACzC,gEAAgE;IAChE,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7F;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;CACpC;AAED,+DAA+D;AAC/D,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,mBAAmB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,CAAC,EAAE,2BAA2B,CAAC;CACpC;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAC/B;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACzC;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -1,17 +1,19 @@
1
1
  import type { RawSkillsManagerConfig, SkillsManagerConfig, SkillsManagerState, SkillState } from "./types.js";
2
2
  /**
3
3
  * Canonical default list of managed skill names when the user omits the
4
- * `skills` field. Kept in sync with the JSON Schema default in
5
- * `openclaw.plugin.json` (configSchema.properties.skillsManager.default.skills).
4
+ * `skills` field — sourced from the **manifest** (`skills-manifest.json`), the
5
+ * single source of truth for the managed set. No longer a hardcoded list.
6
6
  *
7
7
  * Semantics for the resolved `skills` array:
8
- * - Field omitted entirely → defaults to this list. New installs and partial
9
- * configs like `{ enabled: true }` get the canonical skill bootstrapped
10
- * automatically without requiring users to repeat the array in JSON.
8
+ * - Field omitted entirely → defaults to the manifest skill set. Partial
9
+ * configs like `{ enabled: true }` get every manifest skill bootstrapped
10
+ * automatically without repeating the array in JSON.
11
11
  * - Field present and non-empty → use the provided names (filtered for
12
- * non-empty strings).
13
- * - Field present and explicitly empty (`"skills": []`) → discovery mode:
14
- * scan subdirs under `skillsDir`.
12
+ * non-empty strings) as a subset/override; each still resolves its source
13
+ * (repo/branch/path) from the manifest.
14
+ * - Field present and explicitly empty (`"skills": []`) → legacy discovery
15
+ * mode: scan subdirs under `skillsDir`. Retained for backward compatibility;
16
+ * the manifest is the preferred source.
15
17
  */
16
18
  export declare const DEFAULT_MANAGED_SKILLS: readonly string[];
17
19
  /**
@@ -43,24 +45,6 @@ export declare function createDefaultSkillsManagerState(): SkillsManagerState;
43
45
  export declare function createDefaultSkillState(name: string): SkillState;
44
46
  /** Formats an unknown thrown value as a short string for log messages. */
45
47
  export declare function formatErr(e: unknown): string;
46
- /**
47
- * Parse a positive integer from an env-var string, falling back to the
48
- * supplied default on anything unparseable, zero, or negative.
49
- *
50
- * Used to load numeric env-overridable constants in `constants.ts` (e.g.
51
- * `TELEGRAM_NOTIFICATION_BUDGET_CHARS`) without throwing at module load
52
- * time when the env var is bogus — matches the rest of `constants.ts`'s
53
- * "default wins on bad input, never crash startup" style.
54
- *
55
- * Examples:
56
- * parseEnvPositiveInt("8000", 4000) // 8000 (valid override)
57
- * parseEnvPositiveInt("abc", 4000) // 4000 (unparseable → default)
58
- * parseEnvPositiveInt("0", 4000) // 4000 (zero → default)
59
- * parseEnvPositiveInt("-100", 4000) // 4000 (negative → default)
60
- * parseEnvPositiveInt("", 4000) // 4000 (empty → default)
61
- * parseEnvPositiveInt(undefined, 4000) // 4000 (unset → default)
62
- */
63
- export declare function parseEnvPositiveInt(envValue: string | undefined, defaultValue: number): number;
64
48
  /**
65
49
  * Normalise the raw `skillsDir` value into a non-empty `string[]` (the
66
50
  * "search path" form used internally).
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/skills-manager/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAA8B,CAAC;AAEnF;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,CAAC,EAAE,sBAAsB,GAAG,IAAI,GACpC,mBAAmB,CAcrB;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,IAAI,kBAAkB,CAEpE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAYhE;AAED,0EAA0E;AAC1E,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAE5C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAI9F;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAc3D"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/skills-manager/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAA4B,CAAC;AAEjF;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,CAAC,EAAE,sBAAsB,GAAG,IAAI,GACpC,mBAAmB,CAqBrB;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,IAAI,kBAAkB,CAEpE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAUhE;AAED,0EAA0E;AAC1E,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAE5C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAc3D"}
@@ -1,19 +1,22 @@
1
1
  import { DEFAULT_SKILLS_DIRS } from "./constants.js";
2
+ import { getManifestSkillNames } from "./manifest.js";
2
3
  /**
3
4
  * Canonical default list of managed skill names when the user omits the
4
- * `skills` field. Kept in sync with the JSON Schema default in
5
- * `openclaw.plugin.json` (configSchema.properties.skillsManager.default.skills).
5
+ * `skills` field — sourced from the **manifest** (`skills-manifest.json`), the
6
+ * single source of truth for the managed set. No longer a hardcoded list.
6
7
  *
7
8
  * Semantics for the resolved `skills` array:
8
- * - Field omitted entirely → defaults to this list. New installs and partial
9
- * configs like `{ enabled: true }` get the canonical skill bootstrapped
10
- * automatically without requiring users to repeat the array in JSON.
9
+ * - Field omitted entirely → defaults to the manifest skill set. Partial
10
+ * configs like `{ enabled: true }` get every manifest skill bootstrapped
11
+ * automatically without repeating the array in JSON.
11
12
  * - Field present and non-empty → use the provided names (filtered for
12
- * non-empty strings).
13
- * - Field present and explicitly empty (`"skills": []`) → discovery mode:
14
- * scan subdirs under `skillsDir`.
13
+ * non-empty strings) as a subset/override; each still resolves its source
14
+ * (repo/branch/path) from the manifest.
15
+ * - Field present and explicitly empty (`"skills": []`) → legacy discovery
16
+ * mode: scan subdirs under `skillsDir`. Retained for backward compatibility;
17
+ * the manifest is the preferred source.
15
18
  */
16
- export const DEFAULT_MANAGED_SKILLS = ["senpi-trading-runtime"];
19
+ export const DEFAULT_MANAGED_SKILLS = getManifestSkillNames();
17
20
  /**
18
21
  * Parses and normalises the raw `skillsManager` config block from the plugin
19
22
  * config into a fully-resolved {@link SkillsManagerConfig}.
@@ -37,6 +40,12 @@ export function resolveSkillsManagerConfig(value) {
37
40
  skills: Array.isArray(raw.skills)
38
41
  ? raw.skills.filter((s) => typeof s === "string" && s.length > 0)
39
42
  : [...DEFAULT_MANAGED_SKILLS],
43
+ // Per-skill source overrides — pass through when a plain object, else {}.
44
+ overrides: raw.overrides !== null &&
45
+ typeof raw.overrides === "object" &&
46
+ !Array.isArray(raw.overrides)
47
+ ? raw.overrides
48
+ : {},
40
49
  };
41
50
  }
42
51
  /**
@@ -62,8 +71,6 @@ export function createDefaultSkillState(name) {
62
71
  installedVersion: null,
63
72
  latestVersion: null,
64
73
  lastCheckedAt: null,
65
- lastAppliedVersion: null,
66
- lastNotifiedMajorVersion: null,
67
74
  consecutiveFailures: 0,
68
75
  lastFailureAt: null,
69
76
  lastFailureReason: null,
@@ -73,29 +80,6 @@ export function createDefaultSkillState(name) {
73
80
  export function formatErr(e) {
74
81
  return e instanceof Error ? e.message : String(e);
75
82
  }
76
- /**
77
- * Parse a positive integer from an env-var string, falling back to the
78
- * supplied default on anything unparseable, zero, or negative.
79
- *
80
- * Used to load numeric env-overridable constants in `constants.ts` (e.g.
81
- * `TELEGRAM_NOTIFICATION_BUDGET_CHARS`) without throwing at module load
82
- * time when the env var is bogus — matches the rest of `constants.ts`'s
83
- * "default wins on bad input, never crash startup" style.
84
- *
85
- * Examples:
86
- * parseEnvPositiveInt("8000", 4000) // 8000 (valid override)
87
- * parseEnvPositiveInt("abc", 4000) // 4000 (unparseable → default)
88
- * parseEnvPositiveInt("0", 4000) // 4000 (zero → default)
89
- * parseEnvPositiveInt("-100", 4000) // 4000 (negative → default)
90
- * parseEnvPositiveInt("", 4000) // 4000 (empty → default)
91
- * parseEnvPositiveInt(undefined, 4000) // 4000 (unset → default)
92
- */
93
- export function parseEnvPositiveInt(envValue, defaultValue) {
94
- if (envValue === undefined || envValue === "")
95
- return defaultValue;
96
- const n = parseInt(envValue, 10);
97
- return Number.isFinite(n) && n > 0 ? n : defaultValue;
98
- }
99
83
  /**
100
84
  * Normalise the raw `skillsDir` value into a non-empty `string[]` (the
101
85
  * "search path" form used internally).
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/skills-manager/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAQrD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAsB,CAAC,uBAAuB,CAAC,CAAC;AAEnF;;;;;;;;;GASG;AACH,MAAM,UAAU,0BAA0B,CACxC,KAAqC;IAErC,MAAM,GAAG,GAAG,KAAK,IAAI,EAAE,CAAC;IACxB,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC;QAClC,SAAS,EAAE,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC;QAC5C,4DAA4D;QAC5D,sEAAsE;QACtE,uEAAuE;QACvE,6BAA6B;QAC7B,oEAAoE;QACpE,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;YAC/B,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;YACjE,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC;KAChC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,+BAA+B;IAC7C,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AACxB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAY;IAClD,OAAO;QACL,IAAI;QACJ,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,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CAAC,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,KAAK;aACnB,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;aACjD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC/B,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,QAAQ,CAAC;IAC3C,CAAC;IACD,2EAA2E;IAC3E,4EAA4E;IAC5E,OAAO,CAAC,GAAG,mBAAmB,CAAC,CAAC;AAClC,CAAC;AAED,+EAA+E;AAC/E,+EAA+E;AAC/E,qEAAqE;AACrE,2EAA2E;AAC3E,4EAA4E;AAC5E,4EAA4E;AAC5E,mEAAmE;AACnE,SAAS,MAAM,CAAC,KAAc,EAAE,QAAiB;IAC/C,OAAO,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;AACvD,CAAC"}
@@ -26,111 +26,41 @@ export declare function normalizeVersion(v: string): string;
26
26
  * Returns null when the frontmatter block is absent or the field is missing.
27
27
  */
28
28
  export declare function parseSkillMdVersion(content: string): string | null;
29
- /**
30
- * Extract the `description` value from a SKILL.md YAML frontmatter block.
31
- *
32
- * Skill descriptions can be authored a few different ways. This helper
33
- * handles the real-world shapes that appear in the senpi-skills repo today:
34
- *
35
- * 1. Single-line, double-quoted:
36
- * description: "Configure, deploy, ..."
37
- * 2. Single-line, single-quoted or unquoted:
38
- * description: Manage runtimes ...
39
- * 3. YAML block scalar (folded or literal, optional chomping indicator):
40
- * description: >
41
- * A short summary
42
- * continues on this line.
43
- * description: >- # strip trailing newlines (this PR's senpi-skills repo)
44
- * A short summary
45
- * description: | # literal — preserves newlines (collapsed to spaces here)
46
- * A short summary
47
- * description: |+ # keep trailing newlines (same handling)
48
- *
49
- * The block scalar header is `[>|][-+]?` per the YAML 1.2 spec:
50
- * `>` = folded, `|` = literal; `-` strips trailing newlines,
51
- * `+` keeps them, no indicator clips. For notification rendering we
52
- * always collapse to a single line joined by spaces, so the chomping
53
- * indicator only affects whether we match the block-scalar branch.
54
- *
55
- * Returns null when the field is absent or the frontmatter block is missing.
56
- *
57
- * Note: kept as a regex extractor rather than introducing a full YAML
58
- * parse here — `parseSkillMdVersion` uses the same approach, and skill
59
- * frontmatters are constrained enough that the regex covers the shapes we
60
- * actually encounter. If we ever adopt a full YAML parser for this file,
61
- * both helpers should switch together.
62
- */
63
- export declare function parseSkillMdDescription(content: string): string | null;
64
- /**
65
- * Read both the installed version and description for a skill from its local
66
- * SKILL.md. Shared core for `readLocalVersion` and `readLocalDescription` so a
67
- * tick that needs both pays a single file read per dir rather than two.
68
- *
69
- * Multi-dir search path: tries each entry in order and returns the first
70
- * readable SKILL.md's parsed fields. Either field may be null if absent in
71
- * the frontmatter — that's distinct from "no SKILL.md found at all" (which
72
- * returns nulls only after every dir has been tried).
73
- */
74
- export declare function readLocalSkillMetadata(skillsDir: string | readonly string[], skillName: string, logger?: LoggerLike): Promise<{
75
- version: string | null;
76
- description: string | null;
77
- }>;
78
29
  /**
79
30
  * Read the installed version for a skill from its local SKILL.md.
80
31
  *
81
- * Accepts either a single dir (legacy callers) or an array of dirs (new
32
+ * Accepts either a single dir (legacy callers) or an array of dirs (the
82
33
  * multi-dir search path). When given an array, tries each entry in order and
83
- * returns the first non-null match — this mirrors the documented behaviour
84
- * that `skillsDir[0]` is the *primary* (writes go here) and the remaining
85
- * entries are read-only fallbacks scanned during version checks.
86
- *
87
- * Returns null when no readable SKILL.md is found across any of the
88
- * candidate dirs, or when the version field is absent. Logs a warning per
89
- * dir for unexpected errors (anything other than ENOENT).
34
+ * returns the first readable SKILL.md's parsed version — this mirrors the
35
+ * documented behaviour that `skillsDir[0]` is the *primary* (writes go here)
36
+ * and the remaining entries are read-only fallbacks scanned during version
37
+ * checks.
38
+ *
39
+ * The first readable SKILL.md wins even if its version field is absent — a
40
+ * present-but-versionless file is meaningful state (skill predates versioning),
41
+ * not a "not found" signal that should let the next dir override it. Returns
42
+ * null when no readable SKILL.md is found across any candidate dir, or when the
43
+ * version field is absent. Logs a warning per dir for unexpected errors
44
+ * (anything other than ENOENT).
90
45
  */
91
46
  export declare function readLocalVersion(skillsDir: string | readonly string[], skillName: string, logger?: LoggerLike): Promise<string | null>;
92
47
  /**
93
- * Read the installed description for a skill from its local SKILL.md.
94
- * Multi-dir search path semantics identical to `readLocalVersion`.
95
- *
96
- * Returns null when no readable SKILL.md is found across any of the
97
- * candidate dirs, or when the description field is absent.
98
- */
99
- export declare function readLocalDescription(skillsDir: string | readonly string[], skillName: string, logger?: LoggerLike): Promise<string | null>;
100
- /**
101
- * Fetch the remote SKILL.md for a skill and return both the version and the
102
- * description in one network round-trip.
103
- *
104
- * Notification text uses the description from the **remote** SKILL.md (not
105
- * the local one) so the "About:" line reflects the version the user is being
106
- * asked about — a description on disk for v1.x may be stale relative to the
107
- * v2.0.0 the major-update notification is announcing.
48
+ * Fetch the remote SKILL.md for a skill and return its version.
108
49
  *
109
- * Returns null fields when the skill does not exist in the remote repo
110
- * (HTTP 404) — that's a legitimate state ("skill removed or not yet
111
- * published"), not an error, so it should not pollute failure counters.
112
- * Both fields may also be null when the remote SKILL.md is present but
113
- * its frontmatter omits the corresponding field.
50
+ * Returns null when the skill does not exist in the remote repo (HTTP 404) —
51
+ * that's a legitimate state ("skill removed or not yet published"), not an
52
+ * error, so it should not pollute failure counters. Also null when the remote
53
+ * SKILL.md is present but its frontmatter omits the version field.
114
54
  *
115
55
  * Throws on transient/operational failures (network errors, timeouts, 5xx
116
56
  * responses, body-parse failures) so the caller's failure-recording path can
117
57
  * fire.
118
58
  *
59
+ * @param remotePath Subdirectory inside the repo holding the skill (manifest
60
+ * `path`); defaults to the skill name (monorepo convention).
119
61
  * @param fetchImpl Injectable for unit testing — defaults to global `fetch`.
120
62
  */
121
- export declare function fetchRemoteSkillMetadata(skillName: string, rawBaseUrl?: string, fetchImpl?: typeof fetch): Promise<{
122
- version: string | null;
123
- description: string | null;
124
- }>;
125
- /**
126
- * Fetch the remote SKILL.md for a skill and return its version.
127
- *
128
- * Thin wrapper over {@link fetchRemoteSkillMetadata} kept for backward
129
- * compatibility with callers (and tests) that only need the version field.
130
- * New code that wants both version + description in a single round-trip
131
- * should call `fetchRemoteSkillMetadata` directly.
132
- */
133
- export declare function fetchRemoteVersion(skillName: string, rawBaseUrl?: string, fetchImpl?: typeof fetch): Promise<string | null>;
63
+ export declare function fetchRemoteVersion(skillName: string, rawBaseUrl?: string, fetchImpl?: typeof fetch, remotePath?: string): Promise<string | null>;
134
64
  /**
135
65
  * Compare the local and remote versions for a skill and return a classified diff.
136
66
  *
@@ -142,5 +72,5 @@ export declare function fetchRemoteVersion(skillName: string, rawBaseUrl?: strin
142
72
  * - Remote version is absent or unparseable → "unknown", caller should log and
143
73
  * skip.
144
74
  */
145
- export declare function checkSkillVersion(skillsDir: string | readonly string[], skillName: string, rawBaseUrl?: string, fetchImpl?: typeof fetch, logger?: LoggerLike): Promise<SkillVersionInfo>;
75
+ export declare function checkSkillVersion(skillsDir: string | readonly string[], skillName: string, rawBaseUrl?: string, fetchImpl?: typeof fetch, logger?: LoggerLike, remotePath?: string): Promise<SkillVersionInfo>;
146
76
  //# sourceMappingURL=version-manager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version-manager.d.ts","sourceRoot":"","sources":["../../src/skills-manager/version-manager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAmB,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGhF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EA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,IAAI,CAAC,CAExB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,EACrC,SAAS,EAAE,MAAM,EACjB,UAAU,GAAE,MAA4B,EACxC,SAAS,GAAE,OAAO,KAAa,EAC/B,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,gBAAgB,CAAC,CAgD3B"}
1
+ {"version":3,"file":"version-manager.d.ts","sourceRoot":"","sources":["../../src/skills-manager/version-manager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAmB,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGhF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMlE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,EACrC,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAoBxB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,UAAU,GAAE,MAA4B,EACxC,SAAS,GAAE,OAAO,KAAa,EAC/B,UAAU,GAAE,MAAkB,GAC7B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAoCxB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,EACrC,SAAS,EAAE,MAAM,EACjB,UAAU,GAAE,MAA4B,EACxC,SAAS,GAAE,OAAO,KAAa,EAC/B,MAAM,CAAC,EAAE,UAAU,EACnB,UAAU,GAAE,MAAkB,GAC7B,OAAO,CAAC,gBAAgB,CAAC,CAyC3B"}