@cleocode/caamp 2026.5.82 → 2026.5.84

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.
@@ -24,8 +24,8 @@ import {
24
24
  toNative,
25
25
  toNativeBatch,
26
26
  translateToAll
27
- } from "./chunk-SV33CE5X.js";
28
- import "./chunk-OCI4RYI5.js";
27
+ } from "./chunk-QKC2JRSG.js";
28
+ import "./chunk-H5YXR2DC.js";
29
29
  export {
30
30
  CANONICAL_HOOK_EVENTS,
31
31
  HOOK_CATEGORIES,
@@ -53,4 +53,4 @@ export {
53
53
  toNativeBatch,
54
54
  translateToAll
55
55
  };
56
- //# sourceMappingURL=hooks-5EXBKPII.js.map
56
+ //# sourceMappingURL=hooks-ZN3C4WCK.js.map
package/dist/index.d.ts CHANGED
@@ -2,6 +2,205 @@ import { WorktreeHandle } from '@cleocode/cant';
2
2
  import { PlatformPaths, SystemInfo } from '@cleocode/paths';
3
3
  export { PlatformPaths, SystemInfo } from '@cleocode/paths';
4
4
 
5
+ /**
6
+ * `cleo skills doctor bridge` — single bridge symlink + per-skill symlink removal.
7
+ *
8
+ * @remarks
9
+ * Implements the canonical discovery topology described in
10
+ * `docs/architecture/SG-CLEO-SKILLS-architecture-v3.md` §1:
11
+ *
12
+ * - `~/.cleo/skills/<name>/` is the per-user install root (Sphere A + B).
13
+ * - `~/.claude/skills/agents-shared/<name>` is a symlink INTO `~/.cleo/skills/`
14
+ * for each installed skill — Claude Code's hardcoded discovery mount.
15
+ * - `~/.agents/skills` is the SINGLE bridge symlink → `~/.claude/skills/agents-shared`
16
+ * used by every non-Claude harness (Cursor, Aider, Codeium, etc.).
17
+ *
18
+ * The bridge command takes a host machine from any pre-v3 state and:
19
+ *
20
+ * 1. Ensures `~/.claude/skills/agents-shared/` exists (mkdir -p).
21
+ * 2. Creates a symlink under `agents-shared/` for every skill currently in
22
+ * `~/.cleo/skills/` whose target is missing or wrong.
23
+ * 3. Atomically replaces `~/.agents/skills` with a symlink to
24
+ * `~/.claude/skills/agents-shared`. If the existing `~/.agents/skills` is a
25
+ * REAL directory with contents, the command refuses without `--force` and
26
+ * backs up to `~/.cleo/backups/agents-skills-pre-bridge-YYYYMMDD-HHmmss/`
27
+ * when `--force` is supplied.
28
+ * 4. Rips per-skill symlinks under `~/.claude/skills/*` that point OUTSIDE
29
+ * `agents-shared/` (orphans from the old per-skill fan-out model).
30
+ *
31
+ * The handler is pure-functional with a dependency-injected `homeDir` so it
32
+ * can be exercised against tmpfs fixtures in unit tests without touching the
33
+ * real user environment.
34
+ *
35
+ * @see {@link docs/architecture/SG-CLEO-SKILLS-architecture-v3.md} §1
36
+ * @task T9655
37
+ * @epic T9571
38
+ * @public
39
+ */
40
+
41
+ /**
42
+ * One symlink that was created (or would be created in `--dry-run`).
43
+ *
44
+ * @public
45
+ */
46
+ interface BridgeSymlinkRecord {
47
+ /** Skill basename, e.g. `ct-orchestrator`. */
48
+ name: string;
49
+ /** Absolute path of the symlink under `~/.claude/skills/agents-shared/`. */
50
+ linkPath: string;
51
+ /** Absolute path of the symlink target inside `~/.cleo/skills/`. */
52
+ target: string;
53
+ }
54
+ /**
55
+ * One per-skill symlink that was removed (or would be removed in `--dry-run`).
56
+ *
57
+ * @public
58
+ */
59
+ interface PerSkillSymlinkRemoval {
60
+ /** Absolute path of the symlink that was removed. */
61
+ linkPath: string;
62
+ /** Resolved target the symlink pointed at, or `null` when unreadable. */
63
+ previousTarget: string | null;
64
+ }
65
+ /**
66
+ * LAFS-shaped result payload emitted by {@link runDoctorBridge}.
67
+ *
68
+ * @public
69
+ */
70
+ interface DoctorBridgeResult {
71
+ /** Whether this run materially changed disk state. `false` on idempotent re-runs. */
72
+ bridgeCreated: boolean;
73
+ /**
74
+ * Whether `~/.agents/skills` is now a symlink to `~/.claude/skills/agents-shared`.
75
+ *
76
+ * @remarks
77
+ * Always `true` after a successful run. `false` only when `--dry-run` was
78
+ * requested and the bridge had to be created.
79
+ */
80
+ bridgeSymlinkActive: boolean;
81
+ /** Symlinks created under `~/.claude/skills/agents-shared/` (or planned in dry-run). */
82
+ perSkillSymlinksCreated: BridgeSymlinkRecord[];
83
+ /** Per-skill symlinks under `~/.claude/skills/*` that were removed (or planned). */
84
+ perSkillSymlinksRemoved: PerSkillSymlinkRemoval[];
85
+ /**
86
+ * Absolute backup path when the existing `~/.agents/skills` real dir was
87
+ * relocated to make room for the bridge symlink. `null` when no backup was
88
+ * needed.
89
+ */
90
+ backupPath: string | null;
91
+ /** `true` when `--dry-run` was passed and no disk state was mutated. */
92
+ dryRun: boolean;
93
+ /** Resolved skills root, e.g. `~/.cleo/skills`. */
94
+ skillsRoot: string;
95
+ /** Resolved bridge target, e.g. `~/.claude/skills/agents-shared`. */
96
+ bridgeTarget: string;
97
+ /** Resolved bridge symlink path, e.g. `~/.agents/skills`. */
98
+ bridgePath: string;
99
+ }
100
+ /**
101
+ * Dependency-injected options accepted by {@link runDoctorBridge}.
102
+ *
103
+ * @public
104
+ */
105
+ interface DoctorBridgeOptions {
106
+ /**
107
+ * Override the home directory. Defaults to {@link homedir}.
108
+ *
109
+ * @remarks
110
+ * Tests pass a tmpfs root so the bridge logic can be exercised end-to-end
111
+ * without touching the real user environment.
112
+ */
113
+ homeDir?: string;
114
+ /**
115
+ * Allow the command to clobber an existing real `~/.agents/skills` directory.
116
+ *
117
+ * @remarks
118
+ * When `false` (the default) and `~/.agents/skills` is a non-empty real
119
+ * directory, the command refuses with `E_AGENTS_SKILLS_REAL_DIR` to preserve
120
+ * user data. When `true`, the directory is moved to
121
+ * `~/.cleo/backups/agents-skills-pre-bridge-<ts>/` before the bridge symlink
122
+ * is created.
123
+ *
124
+ * @defaultValue `false`
125
+ */
126
+ force?: boolean;
127
+ /**
128
+ * Plan-only mode. When `true`, no disk state is mutated; the result still
129
+ * lists what WOULD happen.
130
+ *
131
+ * @defaultValue `false`
132
+ */
133
+ dryRun?: boolean;
134
+ }
135
+ /**
136
+ * Error thrown when {@link runDoctorBridge} refuses to clobber a real
137
+ * `~/.agents/skills` directory and `--force` was not passed.
138
+ *
139
+ * @public
140
+ */
141
+ declare class AgentsSkillsRealDirError extends Error {
142
+ /** LAFS error code surfaced by the CLI. */
143
+ readonly code: "E_AGENTS_SKILLS_REAL_DIR";
144
+ /** Resolved path of the offending real directory. */
145
+ readonly agentsSkillsPath: string;
146
+ /** Number of immediate entries in the offending directory. */
147
+ readonly entryCount: number;
148
+ /**
149
+ * Construct an `AgentsSkillsRealDirError`.
150
+ *
151
+ * @param agentsSkillsPath - Path to the real `~/.agents/skills` directory.
152
+ * @param entryCount - Number of entries inside the directory.
153
+ */
154
+ constructor(agentsSkillsPath: string, entryCount: number);
155
+ }
156
+ /**
157
+ * Generate a deterministic backup-suffix timestamp `YYYYMMDD-HHmmss` (UTC).
158
+ *
159
+ * @remarks
160
+ * Pulled out as a helper so callers (and tests) can deterministically compute
161
+ * the expected backup path without re-implementing the format. The string is
162
+ * UTC so backups taken on different machines round-trip identically.
163
+ *
164
+ * @returns Timestamp suffix string for backup directory naming.
165
+ */
166
+ declare function buildBackupTimestamp(): string;
167
+ /**
168
+ * Execute the bridge flow described in the module docblock.
169
+ *
170
+ * @remarks
171
+ * Order of operations:
172
+ *
173
+ * 1. Ensure `~/.claude/skills/agents-shared/` exists.
174
+ * 2. For each skill in `~/.cleo/skills/`, ensure
175
+ * `~/.claude/skills/agents-shared/<name>` → `~/.cleo/skills/<name>` exists.
176
+ * 3. Rip every per-skill entry under `~/.claude/skills/` that is a symlink
177
+ * pointing OUTSIDE `agents-shared/` — those are orphans from the old
178
+ * per-skill fan-out model and must be deleted.
179
+ * 4. Replace `~/.agents/skills` with a symlink to `~/.claude/skills/agents-shared`.
180
+ * If it is currently a real directory, refuse unless `options.force` is
181
+ * `true`, in which case back up to
182
+ * `~/.cleo/backups/agents-skills-pre-bridge-<ts>/` first.
183
+ *
184
+ * Idempotency invariant: re-running on a fully-bridged tree returns
185
+ * `{ bridgeCreated: false, bridgeSymlinkActive: true, perSkillSymlinksCreated: [], perSkillSymlinksRemoved: [], backupPath: null }`.
186
+ *
187
+ * @param options - Dependency-injected options (homeDir / force / dry-run).
188
+ * @returns Materialized {@link DoctorBridgeResult} reflecting the run.
189
+ * @throws AgentsSkillsRealDirError when `~/.agents/skills` is a non-empty real
190
+ * directory and `options.force` is not set.
191
+ *
192
+ * @example
193
+ * ```typescript
194
+ * import { runDoctorBridge } from '@cleocode/caamp';
195
+ *
196
+ * const result = await runDoctorBridge({ homeDir: '/tmp/test-home' });
197
+ * console.log(result.perSkillSymlinksCreated.length); // # of new bridge symlinks
198
+ * ```
199
+ *
200
+ * @public
201
+ */
202
+ declare function runDoctorBridge(options?: DoctorBridgeOptions): Promise<DoctorBridgeResult>;
203
+
5
204
  /**
6
205
  * Priority tier identifier stored in registry.json.
7
206
  *
@@ -3002,10 +3201,103 @@ declare function removeConfig(filePath: string, format: ConfigFormat, key: strin
3002
3201
  /**
3003
3202
  * Skill installer - canonical + symlink model
3004
3203
  *
3005
- * Skills are stored once in a canonical location (.agents/skills/<name>/)
3006
- * and symlinked to each target agent's skills directory.
3204
+ * Skills are stored once in a canonical location (`~/.cleo/skills/<name>/`
3205
+ * per architecture-v3 §1, with legacy `~/.local/share/agents/skills/` as a
3206
+ * read-only fallback for one release cycle) and symlinked to each target
3207
+ * agent's skills directory.
3208
+ *
3209
+ * @task T9659
3210
+ * @epic T9571
3211
+ * @saga T9560
3007
3212
  */
3008
3213
 
3214
+ /**
3215
+ * Source-type discriminator emitted with {@link SkillRowData}.
3216
+ *
3217
+ * @remarks
3218
+ * Mirrors the `source_type` column on the `skills` table defined in
3219
+ * architecture-v3 §4. Kept as a local string-literal union (NOT a
3220
+ * `@cleocode/core` import) so caamp stays free of a circular dep on core —
3221
+ * the dispatch layer in `packages/cleo/` is responsible for plugging the
3222
+ * `upsertSkillRow` callback that consumes this shape.
3223
+ *
3224
+ * @public
3225
+ */
3226
+ type SkillRowSourceType = 'canonical' | 'user' | 'community' | 'agent-created';
3227
+ /**
3228
+ * Provenance payload emitted by {@link installSkill} after a successful copy.
3229
+ *
3230
+ * @remarks
3231
+ * The CAAMP installer ONLY emits this shape — it never writes to
3232
+ * `skills.db` directly. The dispatch layer in `packages/cleo/` (where it's
3233
+ * legal to import from `@cleocode/core`) plugs an `upsertSkillRow` callback
3234
+ * via {@link InstallSkillOptions.recordRow}. This keeps caamp free of a
3235
+ * `@cleocode/core` dependency (mirrors the migration callback pattern
3236
+ * established by T9653 — see `migration.ts`).
3237
+ *
3238
+ * @public
3239
+ */
3240
+ interface SkillRowData {
3241
+ /** Skill folder basename (matches `skills.name` column). */
3242
+ name: string;
3243
+ /** Resolved canonical install path under `~/.cleo/skills/<name>/`. */
3244
+ installPath: string;
3245
+ /** Source URL or identifier (matches `skills.source_url`). */
3246
+ sourceUrl: string | null;
3247
+ /**
3248
+ * Source provenance discriminator (matches `skills.source_type`).
3249
+ *
3250
+ * @remarks
3251
+ * Set to `'canonical'` for skills whose name appears in the bundled
3252
+ * Sphere A manifest; `'community'` for marketplace / GitHub-clone installs;
3253
+ * `'user'` for everything else (local-path installs, library installs).
3254
+ * Architecture-v3 §4 enumerates the full set.
3255
+ */
3256
+ sourceType: SkillRowSourceType;
3257
+ }
3258
+ /**
3259
+ * Optional knobs accepted by {@link installSkill}.
3260
+ *
3261
+ * @remarks
3262
+ * Encoded as an interface so future T-STORE follow-ups (e.g. `pinned`,
3263
+ * `version`) can be added without churning the call sites.
3264
+ *
3265
+ * @public
3266
+ */
3267
+ interface InstallSkillOptions {
3268
+ /**
3269
+ * Per-install sink invoked after a successful canonical copy.
3270
+ *
3271
+ * @remarks
3272
+ * Caamp NEVER imports `@cleocode/core` directly — the dispatch layer in
3273
+ * `packages/cleo/` plugs `upsertSkillRow` here so installs are recorded
3274
+ * to `~/.cleo/skills.db`. Defaults to a no-op when omitted. May be sync
3275
+ * or async; thrown errors propagate to the caller.
3276
+ */
3277
+ recordRow?: (row: SkillRowData) => Promise<void> | void;
3278
+ /**
3279
+ * Explicit `sourceUrl` to record on the row.
3280
+ *
3281
+ * @remarks
3282
+ * When omitted, falls back to the `sourcePath` argument. Callers that
3283
+ * resolve a library or marketplace identifier (e.g. `library:ct-foo` or
3284
+ * `https://github.com/owner/repo`) BEFORE copying to a tmpdir should set
3285
+ * this so the row preserves the original provenance string instead of
3286
+ * the disposable filesystem path.
3287
+ */
3288
+ sourceUrl?: string | null;
3289
+ /**
3290
+ * Explicit `sourceType` to record on the row.
3291
+ *
3292
+ * @remarks
3293
+ * When omitted, the type is heuristically inferred from
3294
+ * {@link InstallSkillOptions.sourceUrl} (or `sourcePath` as a fallback)
3295
+ * via {@link inferSkillSourceType}. Dispatch-layer callers that know the
3296
+ * authoritative provenance (e.g. catalog → `'canonical'`, GitHub URL →
3297
+ * `'community'`) SHOULD set this explicitly to bypass the heuristic.
3298
+ */
3299
+ sourceType?: SkillRowSourceType;
3300
+ }
3009
3301
  /**
3010
3302
  * Result of installing a skill to the canonical location and linking to agents.
3011
3303
  *
@@ -3032,6 +3324,29 @@ interface SkillInstallResult {
3032
3324
  /** Whether at least one agent was successfully linked. */
3033
3325
  success: boolean;
3034
3326
  }
3327
+ /**
3328
+ * Heuristic source-type classifier for installs that don't carry an explicit
3329
+ * `source_type`.
3330
+ *
3331
+ * @remarks
3332
+ * Pure string inspection — keeps the installer free of network calls and
3333
+ * filesystem reads. The dispatch layer can ALWAYS override the result by
3334
+ * passing an explicit row through {@link InstallSkillOptions.recordRow}.
3335
+ *
3336
+ * Classification rules:
3337
+ *
3338
+ * 1. `library:<name>` → `'canonical'` (installed from the bundled Sphere A
3339
+ * skill library — `packages/skills/skills/`).
3340
+ * 2. `github.com` / `gitlab.com` / scoped `@author/name` → `'community'`.
3341
+ * 3. Anything else (local paths, opaque values) → `'user'`.
3342
+ *
3343
+ * @param sourceUrl - The source identifier passed to {@link installSkill}.
3344
+ * `null` is treated as `'user'`.
3345
+ * @returns The inferred source-type discriminator.
3346
+ *
3347
+ * @public
3348
+ */
3349
+ declare function inferSkillSourceType(sourceUrl: string | null | undefined): SkillRowSourceType;
3035
3350
  /**
3036
3351
  * Install a skill from a local path to the canonical location and link to agents.
3037
3352
  *
@@ -3039,24 +3354,45 @@ interface SkillInstallResult {
3039
3354
  * Copies the skill directory to the canonical skills directory and creates symlinks
3040
3355
  * (or copies on Windows) from each provider's skills directory to the canonical path.
3041
3356
  *
3357
+ * **T9659** — when `options.recordRow` is supplied, the callback is invoked
3358
+ * with a {@link SkillRowData} payload after the canonical copy lands and
3359
+ * BEFORE provider linking. This is the integration seam that the cleo
3360
+ * dispatch layer uses to plug `upsertSkillRow` from
3361
+ * `@cleocode/core/store/skills-db` into `~/.cleo/skills.db`. The row is
3362
+ * recorded regardless of whether subsequent provider linking succeeds — the
3363
+ * canonical install is itself the durable artefact.
3364
+ *
3042
3365
  * @param sourcePath - Local path to the skill directory to install
3043
3366
  * @param skillName - Name for the installed skill
3044
3367
  * @param providers - Target providers to link the skill to
3045
3368
  * @param isGlobal - Whether to link to global or project skill directories
3046
3369
  * @param projectDir - Project directory (defaults to `process.cwd()`)
3370
+ * @param options - Optional callbacks (incl. `recordRow` for `skills.db`)
3047
3371
  * @returns Install result with linked agents and any errors
3048
3372
  *
3049
3373
  * @example
3050
3374
  * ```typescript
3051
- * const result = await installSkill("/tmp/my-skill", "my-skill", providers, true, "/my/project");
3052
- * if (result.success) {
3053
- * console.log(`Linked to: ${result.linkedAgents.join(", ")}`);
3054
- * }
3375
+ * const result = await installSkill(
3376
+ * "/tmp/my-skill",
3377
+ * "my-skill",
3378
+ * providers,
3379
+ * true,
3380
+ * "/my/project",
3381
+ * {
3382
+ * recordRow: async (row) => upsertSkillRow({
3383
+ * name: row.name,
3384
+ * installPath: row.installPath,
3385
+ * sourceType: row.sourceType,
3386
+ * sourceUrl: row.sourceUrl,
3387
+ * installedAt: new Date().toISOString(),
3388
+ * }),
3389
+ * },
3390
+ * );
3055
3391
  * ```
3056
3392
  *
3057
3393
  * @public
3058
3394
  */
3059
- declare function installSkill(sourcePath: string, skillName: string, providers: Provider[], isGlobal: boolean, projectDir?: string): Promise<SkillInstallResult>;
3395
+ declare function installSkill(sourcePath: string, skillName: string, providers: Provider[], isGlobal: boolean, projectDir?: string, options?: InstallSkillOptions): Promise<SkillInstallResult>;
3060
3396
  /**
3061
3397
  * Remove a skill from the canonical location and all agent symlinks.
3062
3398
  *
@@ -5630,20 +5966,73 @@ declare function getAgentsHome(): string;
5630
5966
  * @public
5631
5967
  */
5632
5968
  declare function getProjectAgentsDir(projectRoot?: string): string;
5969
+ /**
5970
+ * Reset the cached deprecation-warning flag.
5971
+ *
5972
+ * @remarks
5973
+ * Test-only seam. Production code should never call this.
5974
+ *
5975
+ * @internal
5976
+ */
5977
+ declare function _resetLegacySkillsWarning(): void;
5978
+ /**
5979
+ * Returns the canonical user-machine skills install root.
5980
+ *
5981
+ * @remarks
5982
+ * Per architecture-v3 §1 the new SSoT for ALL installed skills is
5983
+ * `~/.cleo/skills/` (replacing the legacy XDG path
5984
+ * `~/.local/share/agents/skills/`). This resolver implements the migration
5985
+ * contract: it ALWAYS returns the new SSoT when it exists, falls through to
5986
+ * the legacy path as a read-only fallback for one release cycle, and
5987
+ * defaults to the new SSoT on a fresh install so first-write lands in the
5988
+ * correct location.
5989
+ *
5990
+ * Resolution order:
5991
+ *
5992
+ * 1. `~/.cleo/skills/` (new SSoT — preferred). Returned when it exists.
5993
+ * 2. `getAgentsHome()/skills` (legacy XDG via `AGENTS_HOME` /
5994
+ * `~/.local/share/agents/skills/`). Returned when the new SSoT is missing
5995
+ * but the legacy directory exists. Emits a one-shot stderr deprecation
5996
+ * warning so the user is prompted to migrate.
5997
+ * 3. `~/.cleo/skills/` (new SSoT) on a fresh install when neither exists,
5998
+ * so first-write creates the correct directory.
5999
+ *
6000
+ * **Test override:** when the `AGENTS_HOME` env var is set explicitly (the
6001
+ * primary test seam used by `skills-installer.test.ts`), the resolver SKIPS
6002
+ * step 1 and returns `getAgentsHome()/skills` directly. This preserves the
6003
+ * existing test surface (tmpdirs via `AGENTS_HOME`) while production paths
6004
+ * resolve through the new SSoT chain.
6005
+ *
6006
+ * @returns Absolute path to the resolved canonical skills directory
6007
+ *
6008
+ * @example
6009
+ * ```typescript
6010
+ * const dir = getCanonicalSkillsRoot();
6011
+ * // Fresh install: "/home/user/.cleo/skills"
6012
+ * // Legacy install + warning: "/home/user/.local/share/agents/skills"
6013
+ * // Test (AGENTS_HOME=/tmp/foo): "/tmp/foo/skills"
6014
+ * ```
6015
+ *
6016
+ * @task T9659
6017
+ * @public
6018
+ */
6019
+ declare function getCanonicalSkillsRoot(): string;
5633
6020
  /**
5634
6021
  * Returns the canonical skills storage directory path.
5635
6022
  *
5636
6023
  * @remarks
5637
6024
  * Skills are stored once in this canonical directory and symlinked into
5638
6025
  * provider-specific locations. This is the single source of truth for
5639
- * installed skill files.
6026
+ * installed skill files. **T9659 — this now delegates to
6027
+ * {@link getCanonicalSkillsRoot} so the SSoT is `~/.cleo/skills/` with the
6028
+ * legacy XDG path as a read-only fallback per architecture-v3 §1.**
5640
6029
  *
5641
6030
  * @returns The absolute path to the canonical skills directory
5642
6031
  *
5643
6032
  * @example
5644
6033
  * ```typescript
5645
6034
  * const dir = getCanonicalSkillsDir();
5646
- * // e.g., "/home/user/.local/share/caamp/skills"
6035
+ * // e.g., "/home/user/.cleo/skills" (new SSoT)
5647
6036
  * ```
5648
6037
  *
5649
6038
  * @public
@@ -8331,4 +8720,4 @@ declare function parseSource(input: string): ParsedSource;
8331
8720
  */
8332
8721
  declare function isMarketplaceScoped(input: string): boolean;
8333
8722
 
8334
- export { type AuditFinding, type AuditResult, type AuditRule, type AuditSeverity, type BatchInstallOptions, type BatchInstallResult, CANONICAL_HOOK_EVENTS, type CaampBlock, type CaampLockFile, type CanonicalEventDefinition, type CanonicalHookEvent, type CantProfileCounts, type CantProfileEntry, type CantValidationDiagnostic, type ConfigFormat, type CrossProviderMatrix, type CtDispatchMatrix, type CtManifest, type CtManifestSkill, type CtProfileDefinition, type CtSkillEntry, type CtValidationIssue, type CtValidationResult, DEFAULT_EXCLUSIVITY_MODE, type DedupeResult, type DetectionCacheOptions, type DetectionResult, EXCLUSIVITY_MODE_ENV_VAR, type EnsureProviderInstructionFileOptions, type EnsureProviderInstructionFileResult, type ExclusivityMode, type GlobalOptions, HOOK_CATEGORIES, type Harness, type HarnessScope, type HookCategory, type HookEvent, type HookHandlerType, type HookMapping, type HookSupportResult, type HookSystemType, type InjectionCheckResult, type InjectionStatus, type InjectionTemplate, type InstallMcpServerOptions, type InstallMcpServerResult, type InstructionUpdateSummary, type KnownProviderAgentFolderId, type LockEntry, MarketplaceClient, type MarketplaceResult, type MarketplaceSearchResult, type MarketplaceSkill, type McpConfigFormat, type McpDetectionEntry, type McpScope, type McpServerConfig, type McpServerEntriesByProvider, type McpServerEntry, type McpTransportType, type NormalizedHookEvent, type NormalizedRecommendationCriteria, type ParsedSource, PiHarness, PiRequiredError, type Provider, type ProviderCapabilities, type ProviderHarnessCapability, type ProviderHookProfile, type ProviderHookSummary, type ProviderHooksCapability, type ProviderMcpCapability, type ProviderPriority, type ProviderSkillsCapability, type ProviderSpawnCapability, type ProviderStatus, RECOMMENDATION_ERROR_CODES, type RankedSkillRecommendation, type RecommendSkillsResult, type RecommendationCriteriaInput, type RecommendationErrorCode, type RecommendationOptions, type RecommendationReason, type RecommendationReasonCode, type RecommendationScoreBreakdown, type RecommendationValidationIssue, type RecommendationValidationResult, type RecommendationWeights, type RegistryHarnessKind, type RegistryHookCatalog, type RegistryHookFormat, type RemoveMcpServerOptions, type RemoveMcpServerResult, type ResolveDefaultTargetProvidersOptions, type SkillBatchOperation, type SkillEntry, type SkillInstallResult, type SkillIntegrityResult, type SkillIntegrityStatus, type SkillLibrary, type SkillLibraryDispatchMatrix, type SkillLibraryEntry, type SkillLibraryManifest, type SkillLibraryManifestSkill, type SkillLibraryProfile, type SkillLibraryValidationIssue, type SkillLibraryValidationResult, type SkillMetadata, type SkillsPrecedence, type SourceType, type SpawnAdapter, type SpawnMechanism, type SpawnOptions, type SpawnResult, type SubagentHandle, type SubagentResult, type SubagentTask, type TransportType, type ValidateCantProfileResult, type ValidationIssue, type ValidationResult, type WriteAgentFileOptions, type WriteAgentFileResult, _resetPlatformPathsCache, buildHookMatrix, buildInjectionContent, buildLibraryFromFiles, buildSkillsMap, catalog, checkAllInjections, checkAllSkillIntegrity, checkAllSkillUpdates, checkInjection, checkSkillIntegrity, checkSkillUpdate, clearRegisteredLibrary, dedupeFile, dedupeFiles, deepMerge, detectAllProviders, detectMcpInstallations, detectProjectProviders, detectProvider, discoverSkill, discoverSkills, ensureAllProviderInstructionFiles, ensureDir, ensureProviderInstructionFile, formatSkillRecommendations, generateInjectionContent, generateSkillsSection, getAgentsConfigPath, getAgentsHome, getAgentsInstructFile, getAgentsLinksDir, getAgentsMcpDir, getAgentsMcpServersPath, getAgentsSpecDir, getAgentsWikiDir, getAllCanonicalEvents, getAllHarnesses, getAllProviders, getCanonicalEvent, getCanonicalEventsByCategory, getCanonicalSkillsDir, getCommonEvents, getCommonHookEvents, getEffectiveSkillsPaths, getExclusivityMode, getHarnessFor, getHookConfigPath, getHookMappingsVersion, getHookSupport, getHookSystemType, getInstalledProviders, getInstructionFiles, getLockFilePath, getMappedProviderIds, getNestedValue, getPlatformLocations, getPlatformPaths, getPrimaryHarness, getPrimaryProvider, getProjectAgentsDir, getProvider, getProviderAgentFolder, getProviderCapabilities, getProviderCount, getProviderHookProfile, getProviderInstructionReferences, getProviderOnlyEvents, getProviderSummary, getProvidersByHookEvent, getProvidersByInstructFile, getProvidersByPriority, getProvidersBySkillsPrecedence, getProvidersBySpawnCapability, getProvidersByStatus, getProvidersForEvent, getRegistryVersion, getSpawnCapableProviders, getSupportedEvents, getSystemInfo, getTrackedSkills, getUnsupportedEvents, groupByInstructFile, inject, injectAll, installBatchWithRollback, installMcpServer, installSkill, isCaampOwnedSkill, isExclusivityMode, isMarketplaceScoped, isQuiet, isVerbose, listAllMcpServers, listCanonicalSkills, listMcpServers, loadLibraryFromModule, normalizeRecommendationCriteria, parseCaampBlocks, parseInjectionContent, parseSkillFile, parseSource, providerSupports, providerSupportsById, rankSkills, readConfig, recommendSkills, recordSkillInstall, registerSkillLibrary, registerSkillLibraryFromPath, removeConfig, removeInjection, removeMcpServer, removeMcpServerFromAll, removeSkill, removeSkillFromLock, resetDetectionCache, resetExclusivityModeOverride, resolveAlias, resolveDefaultTargetProviders, resolveMcpConfigPath, resolveNativeEvent, resolveProviderSkillsDirs, resolveRegistryTemplatePath, scanDirectory, scanFile, scoreSkillRecommendation, searchSkills, selectProvidersByMinimumPriority, setExclusivityMode, setQuiet, setVerbose, shouldOverrideSkill, supportsHook, toCanonical, toNative, toNativeBatch, toSarif, tokenizeCriteriaValue, translateToAll, updateInstructionsSingleOperation, validateInstructionIntegrity, validateRecommendationCriteria, validateSkill, writeAgentFileToAllProviders, writeConfig };
8723
+ export { AgentsSkillsRealDirError, type AuditFinding, type AuditResult, type AuditRule, type AuditSeverity, type BatchInstallOptions, type BatchInstallResult, type BridgeSymlinkRecord, CANONICAL_HOOK_EVENTS, type CaampBlock, type CaampLockFile, type CanonicalEventDefinition, type CanonicalHookEvent, type CantProfileCounts, type CantProfileEntry, type CantValidationDiagnostic, type ConfigFormat, type CrossProviderMatrix, type CtDispatchMatrix, type CtManifest, type CtManifestSkill, type CtProfileDefinition, type CtSkillEntry, type CtValidationIssue, type CtValidationResult, DEFAULT_EXCLUSIVITY_MODE, type DedupeResult, type DetectionCacheOptions, type DetectionResult, type DoctorBridgeOptions, type DoctorBridgeResult, EXCLUSIVITY_MODE_ENV_VAR, type EnsureProviderInstructionFileOptions, type EnsureProviderInstructionFileResult, type ExclusivityMode, type GlobalOptions, HOOK_CATEGORIES, type Harness, type HarnessScope, type HookCategory, type HookEvent, type HookHandlerType, type HookMapping, type HookSupportResult, type HookSystemType, type InjectionCheckResult, type InjectionStatus, type InjectionTemplate, type InstallMcpServerOptions, type InstallMcpServerResult, type InstallSkillOptions, type InstructionUpdateSummary, type KnownProviderAgentFolderId, type LockEntry, MarketplaceClient, type MarketplaceResult, type MarketplaceSearchResult, type MarketplaceSkill, type McpConfigFormat, type McpDetectionEntry, type McpScope, type McpServerConfig, type McpServerEntriesByProvider, type McpServerEntry, type McpTransportType, type NormalizedHookEvent, type NormalizedRecommendationCriteria, type ParsedSource, type PerSkillSymlinkRemoval, PiHarness, PiRequiredError, type Provider, type ProviderCapabilities, type ProviderHarnessCapability, type ProviderHookProfile, type ProviderHookSummary, type ProviderHooksCapability, type ProviderMcpCapability, type ProviderPriority, type ProviderSkillsCapability, type ProviderSpawnCapability, type ProviderStatus, RECOMMENDATION_ERROR_CODES, type RankedSkillRecommendation, type RecommendSkillsResult, type RecommendationCriteriaInput, type RecommendationErrorCode, type RecommendationOptions, type RecommendationReason, type RecommendationReasonCode, type RecommendationScoreBreakdown, type RecommendationValidationIssue, type RecommendationValidationResult, type RecommendationWeights, type RegistryHarnessKind, type RegistryHookCatalog, type RegistryHookFormat, type RemoveMcpServerOptions, type RemoveMcpServerResult, type ResolveDefaultTargetProvidersOptions, type SkillBatchOperation, type SkillEntry, type SkillInstallResult, type SkillIntegrityResult, type SkillIntegrityStatus, type SkillLibrary, type SkillLibraryDispatchMatrix, type SkillLibraryEntry, type SkillLibraryManifest, type SkillLibraryManifestSkill, type SkillLibraryProfile, type SkillLibraryValidationIssue, type SkillLibraryValidationResult, type SkillMetadata, type SkillRowData, type SkillRowSourceType, type SkillsPrecedence, type SourceType, type SpawnAdapter, type SpawnMechanism, type SpawnOptions, type SpawnResult, type SubagentHandle, type SubagentResult, type SubagentTask, type TransportType, type ValidateCantProfileResult, type ValidationIssue, type ValidationResult, type WriteAgentFileOptions, type WriteAgentFileResult, _resetLegacySkillsWarning, _resetPlatformPathsCache, buildBackupTimestamp, buildHookMatrix, buildInjectionContent, buildLibraryFromFiles, buildSkillsMap, catalog, checkAllInjections, checkAllSkillIntegrity, checkAllSkillUpdates, checkInjection, checkSkillIntegrity, checkSkillUpdate, clearRegisteredLibrary, dedupeFile, dedupeFiles, deepMerge, detectAllProviders, detectMcpInstallations, detectProjectProviders, detectProvider, discoverSkill, discoverSkills, ensureAllProviderInstructionFiles, ensureDir, ensureProviderInstructionFile, formatSkillRecommendations, generateInjectionContent, generateSkillsSection, getAgentsConfigPath, getAgentsHome, getAgentsInstructFile, getAgentsLinksDir, getAgentsMcpDir, getAgentsMcpServersPath, getAgentsSpecDir, getAgentsWikiDir, getAllCanonicalEvents, getAllHarnesses, getAllProviders, getCanonicalEvent, getCanonicalEventsByCategory, getCanonicalSkillsDir, getCanonicalSkillsRoot, getCommonEvents, getCommonHookEvents, getEffectiveSkillsPaths, getExclusivityMode, getHarnessFor, getHookConfigPath, getHookMappingsVersion, getHookSupport, getHookSystemType, getInstalledProviders, getInstructionFiles, getLockFilePath, getMappedProviderIds, getNestedValue, getPlatformLocations, getPlatformPaths, getPrimaryHarness, getPrimaryProvider, getProjectAgentsDir, getProvider, getProviderAgentFolder, getProviderCapabilities, getProviderCount, getProviderHookProfile, getProviderInstructionReferences, getProviderOnlyEvents, getProviderSummary, getProvidersByHookEvent, getProvidersByInstructFile, getProvidersByPriority, getProvidersBySkillsPrecedence, getProvidersBySpawnCapability, getProvidersByStatus, getProvidersForEvent, getRegistryVersion, getSpawnCapableProviders, getSupportedEvents, getSystemInfo, getTrackedSkills, getUnsupportedEvents, groupByInstructFile, inferSkillSourceType, inject, injectAll, installBatchWithRollback, installMcpServer, installSkill, isCaampOwnedSkill, isExclusivityMode, isMarketplaceScoped, isQuiet, isVerbose, listAllMcpServers, listCanonicalSkills, listMcpServers, loadLibraryFromModule, normalizeRecommendationCriteria, parseCaampBlocks, parseInjectionContent, parseSkillFile, parseSource, providerSupports, providerSupportsById, rankSkills, readConfig, recommendSkills, recordSkillInstall, registerSkillLibrary, registerSkillLibraryFromPath, removeConfig, removeInjection, removeMcpServer, removeMcpServerFromAll, removeSkill, removeSkillFromLock, resetDetectionCache, resetExclusivityModeOverride, resolveAlias, resolveDefaultTargetProviders, resolveMcpConfigPath, resolveNativeEvent, resolveProviderSkillsDirs, resolveRegistryTemplatePath, runDoctorBridge, scanDirectory, scanFile, scoreSkillRecommendation, searchSkills, selectProvidersByMinimumPriority, setExclusivityMode, setQuiet, setVerbose, shouldOverrideSkill, supportsHook, toCanonical, toNative, toNativeBatch, toSarif, tokenizeCriteriaValue, translateToAll, updateInstructionsSingleOperation, validateInstructionIntegrity, validateRecommendationCriteria, validateSkill, writeAgentFileToAllProviders, writeConfig };
package/dist/index.js CHANGED
@@ -1,10 +1,12 @@
1
1
  import {
2
+ AgentsSkillsRealDirError,
2
3
  DEFAULT_EXCLUSIVITY_MODE,
3
4
  EXCLUSIVITY_MODE_ENV_VAR,
4
5
  MarketplaceClient,
5
6
  PiHarness,
6
7
  PiRequiredError,
7
8
  RECOMMENDATION_ERROR_CODES,
9
+ buildBackupTimestamp,
8
10
  buildLibraryFromFiles,
9
11
  catalog_exports,
10
12
  checkAllSkillUpdates,
@@ -26,6 +28,7 @@ import {
26
28
  getNestedValue,
27
29
  getPrimaryHarness,
28
30
  getTrackedSkills,
31
+ inferSkillSourceType,
29
32
  installBatchWithRollback,
30
33
  installMcpServer,
31
34
  installSkill,
@@ -56,6 +59,7 @@ import {
56
59
  resetExclusivityModeOverride,
57
60
  resolveDefaultTargetProviders,
58
61
  resolveMcpConfigPath,
62
+ runDoctorBridge,
59
63
  scanDirectory,
60
64
  scanFile,
61
65
  scoreSkillRecommendation,
@@ -70,7 +74,7 @@ import {
70
74
  validateRecommendationCriteria,
71
75
  validateSkill,
72
76
  writeConfig
73
- } from "./chunk-4W35AEYA.js";
77
+ } from "./chunk-QSJSM57K.js";
74
78
  import {
75
79
  buildInjectionContent,
76
80
  buildSkillsMap,
@@ -110,7 +114,7 @@ import {
110
114
  removeInjection,
111
115
  resolveAlias,
112
116
  writeAgentFileToAllProviders
113
- } from "./chunk-OPUPNLUJ.js";
117
+ } from "./chunk-PGETUTYZ.js";
114
118
  import {
115
119
  CANONICAL_HOOK_EVENTS,
116
120
  HOOK_CATEGORIES,
@@ -136,8 +140,9 @@ import {
136
140
  toNative,
137
141
  toNativeBatch,
138
142
  translateToAll
139
- } from "./chunk-SV33CE5X.js";
143
+ } from "./chunk-QKC2JRSG.js";
140
144
  import {
145
+ _resetLegacySkillsWarning,
141
146
  _resetPlatformPathsCache,
142
147
  getAgentsConfigPath,
143
148
  getAgentsHome,
@@ -148,6 +153,7 @@ import {
148
153
  getAgentsSpecDir,
149
154
  getAgentsWikiDir,
150
155
  getCanonicalSkillsDir,
156
+ getCanonicalSkillsRoot,
151
157
  getLockFilePath,
152
158
  getPlatformLocations,
153
159
  getPlatformPaths,
@@ -155,7 +161,7 @@ import {
155
161
  getSystemInfo,
156
162
  resolveProviderSkillsDirs,
157
163
  resolveRegistryTemplatePath
158
- } from "./chunk-OCI4RYI5.js";
164
+ } from "./chunk-H5YXR2DC.js";
159
165
 
160
166
  // src/core/skills/integrity.ts
161
167
  import { existsSync, lstatSync, readlinkSync } from "fs";
@@ -273,7 +279,7 @@ function shouldOverrideSkill(skillName, incomingSource, existingEntry) {
273
279
  return true;
274
280
  }
275
281
  async function validateInstructionIntegrity(providers, projectDir, scope, expectedContent) {
276
- const { checkAllInjections: checkAllInjections2 } = await import("./injector-F4EHB3CZ.js");
282
+ const { checkAllInjections: checkAllInjections2 } = await import("./injector-QPOIJVOR.js");
277
283
  const results = await checkAllInjections2(providers, projectDir, scope, expectedContent);
278
284
  const issues = [];
279
285
  for (const result of results) {
@@ -300,6 +306,7 @@ async function validateInstructionIntegrity(providers, projectDir, scope, expect
300
306
  return issues;
301
307
  }
302
308
  export {
309
+ AgentsSkillsRealDirError,
303
310
  CANONICAL_HOOK_EVENTS,
304
311
  DEFAULT_EXCLUSIVITY_MODE,
305
312
  EXCLUSIVITY_MODE_ENV_VAR,
@@ -308,7 +315,9 @@ export {
308
315
  PiHarness,
309
316
  PiRequiredError,
310
317
  RECOMMENDATION_ERROR_CODES,
318
+ _resetLegacySkillsWarning,
311
319
  _resetPlatformPathsCache,
320
+ buildBackupTimestamp,
312
321
  buildHookMatrix,
313
322
  buildInjectionContent,
314
323
  buildLibraryFromFiles,
@@ -350,6 +359,7 @@ export {
350
359
  getCanonicalEvent,
351
360
  getCanonicalEventsByCategory,
352
361
  getCanonicalSkillsDir,
362
+ getCanonicalSkillsRoot,
353
363
  getCommonEvents,
354
364
  getCommonHookEvents,
355
365
  getEffectiveSkillsPaths,
@@ -391,6 +401,7 @@ export {
391
401
  getTrackedSkills,
392
402
  getUnsupportedEvents,
393
403
  groupByInstructFile,
404
+ inferSkillSourceType,
394
405
  inject,
395
406
  injectAll,
396
407
  installBatchWithRollback,
@@ -432,6 +443,7 @@ export {
432
443
  resolveNativeEvent,
433
444
  resolveProviderSkillsDirs,
434
445
  resolveRegistryTemplatePath,
446
+ runDoctorBridge,
435
447
  scanDirectory,
436
448
  scanFile,
437
449
  scoreSkillRecommendation,