@cleocode/caamp 2026.9.19 → 2026.9.21

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/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { PackageArtifactBudgets, PackageArtifactRequirement, PackageArtifactFile
3
3
  import { WorktreeHandle } from '@cleocode/cant';
4
4
  import { PlatformPaths, SystemInfo } from '@cleocode/paths';
5
5
  export { PlatformPaths, SystemInfo } from '@cleocode/paths';
6
+ import { SkillGateScanResult, SkillGatePolicyDecision, SkillGateFederationResult, SkillGateFederationInput } from '@cleocode/contracts';
6
7
 
7
8
  /**
8
9
  * Priority tier identifier stored in registry.json.
@@ -123,6 +124,62 @@ type RegistryHookCatalog = 'canonical' | 'pi';
123
124
  * @public
124
125
  */
125
126
  type SpawnMechanism = 'native' | 'native-child-process' | 'mcp' | 'cli' | 'api';
127
+ /**
128
+ * Whether a provider exposes a structured-question ("ask the human") tool.
129
+ *
130
+ * - `native` — the harness ships a built-in tool that renders selectable options.
131
+ * - `none` — verified absent from the harness's built-in tool set.
132
+ * - `unknown` — not verified from docs or source; never guessed.
133
+ *
134
+ * @public
135
+ */
136
+ type AskToolStatus = 'native' | 'none' | 'unknown';
137
+ /**
138
+ * Registry record of a provider's structured-question tool.
139
+ *
140
+ * @remarks
141
+ * Data only. `source` says where the fact was verified so a stale entry can be
142
+ * re-checked; `caveat` records availability limits (mode gates, subagent
143
+ * restrictions). When `toolName` is `null` the agent uses
144
+ * {@link HitlRequestFallback} instead.
145
+ *
146
+ * @public
147
+ */
148
+ interface ProviderAskTool {
149
+ /** Verification status of the ask tool. */
150
+ status: AskToolStatus;
151
+ /** Exact tool name the model calls, or `null` when none is known. */
152
+ toolName: string | null;
153
+ /** Availability limits, or `null` when none are known. */
154
+ caveat: string | null;
155
+ /** Where the fact was verified (doc URL, source path, or binary inspected). */
156
+ source: string;
157
+ }
158
+ /**
159
+ * Fallback when a provider has no (known) ask tool: the agent emits ONE LAFS
160
+ * envelope with this operation carrying the payload fields, then stops.
161
+ *
162
+ * @public
163
+ */
164
+ interface HitlRequestFallback {
165
+ /** LAFS operation name of the envelope. */
166
+ operation: 'hitl.request';
167
+ /** Payload fields the envelope `data` carries. */
168
+ fields: readonly ['question', 'options', 'recommended'];
169
+ /** Shape of each option entry. */
170
+ optionFields: readonly ['label', 'description'];
171
+ }
172
+ /**
173
+ * Resolved ask-tool answer for one provider.
174
+ *
175
+ * @public
176
+ */
177
+ interface ResolvedProviderAskTool extends ProviderAskTool {
178
+ /** Canonical provider id (aliases resolved). */
179
+ providerId: string;
180
+ /** The `hitl.request` fallback; use it whenever `toolName` is `null`. */
181
+ fallback: HitlRequestFallback;
182
+ }
126
183
 
127
184
  /**
128
185
  * SkillLibrary interface - SDK standard contract for skill libraries.
@@ -3160,14 +3217,82 @@ declare function withFileLock<T>(targetPath: string, fn: () => Promise<T>, optio
3160
3217
  * @public
3161
3218
  */
3162
3219
  declare function assertNotTornRead(filePath: string, content: string, sizeOnDisk: number): void;
3220
+ /**
3221
+ * A JSON config file could not be parsed, so it was left untouched.
3222
+ *
3223
+ * @remarks
3224
+ * Thrown by {@link updateJsonConfigFile} instead of treating the file as empty.
3225
+ * The pre-T12385 provider adapters caught the parse error and started from
3226
+ * `{}`, so a torn read of `~/.claude/settings.json` (Claude Code rewriting it
3227
+ * at the same moment) replaced the user's permissions, env, model and hooks
3228
+ * with CLEO's entries alone.
3229
+ *
3230
+ * @example
3231
+ * ```typescript
3232
+ * try {
3233
+ * await updateJsonConfigFile(path, (config) => false);
3234
+ * } catch (err) {
3235
+ * if (err instanceof JsonConfigParseError) console.error(err.filePath);
3236
+ * }
3237
+ * ```
3238
+ *
3239
+ * @public
3240
+ */
3241
+ declare class JsonConfigParseError extends Error {
3242
+ /** Path of the file that failed to parse. */
3243
+ readonly filePath: string;
3244
+ /**
3245
+ * @param filePath - Path of the file that failed to parse
3246
+ * @param reason - Parser message
3247
+ */
3248
+ constructor(filePath: string, reason: string);
3249
+ }
3250
+ /**
3251
+ * Read-modify-write a JSON object file under the cross-process lock, writing
3252
+ * atomically, and never replacing an unparseable file.
3253
+ *
3254
+ * @remarks
3255
+ * Composes the two existing primitives — {@link withFileLock} and core's
3256
+ * `writeFileAtomic` — for provider config files such as
3257
+ * `~/.claude/settings.json` that the provider itself also rewrites (T12385):
3258
+ *
3259
+ * - The whole read → mutate → write cycle holds the `<file>.lock` guard, so
3260
+ * two CLEO writers cannot both read the pre-state and clobber each other.
3261
+ * - The write is tmp-then-rename, so a concurrent reader (including the
3262
+ * provider) sees the whole old file or the whole new one.
3263
+ * - A missing file starts from `{}`. A file that exists but is empty on read
3264
+ * while non-empty on disk, is not valid JSON, or is not a JSON object throws
3265
+ * ({@link assertNotTornRead} / {@link JsonConfigParseError}) and the file is
3266
+ * left byte-identical.
3267
+ *
3268
+ * @param filePath - JSON file to update
3269
+ * @param mutate - Edits the parsed object in place; returns `true` when it
3270
+ * changed something that must be written
3271
+ * @returns Whether the file was written
3272
+ * @throws {@link JsonConfigParseError} when the existing file cannot be parsed
3273
+ * as a JSON object; the file is not modified
3274
+ *
3275
+ * @example
3276
+ * ```typescript
3277
+ * const wrote = await updateJsonConfigFile(settingsPath, (settings) => {
3278
+ * if (settings.enabled === true) return false;
3279
+ * settings.enabled = true;
3280
+ * return true;
3281
+ * });
3282
+ * ```
3283
+ *
3284
+ * @public
3285
+ */
3286
+ declare function updateJsonConfigFile(filePath: string, mutate: (config: Record<string, unknown>) => boolean): Promise<boolean>;
3163
3287
 
3164
3288
  /**
3165
3289
  * Skill installer - canonical + symlink model
3166
3290
  *
3167
- * Skills are stored once in a canonical location (`~/.cleo/skills/<name>/`
3168
- * per architecture-v3 §1, with legacy `~/.local/share/agents/skills/` as a
3169
- * read-only fallback for one release cycle) and symlinked to each target
3170
- * agent's skills directory.
3291
+ * Skills are stored once in a canonical location (`<cleoHome>/skills/<name>/`,
3292
+ * the platform data dir from `resolveSkillsRoot()`; T12598) and linked to each
3293
+ * target agent's skills directory. Every link is verified to resolve after it
3294
+ * is written; where a link cannot be created or does not resolve (Windows
3295
+ * without Developer Mode, filesystems without symlinks) the skill is copied.
3171
3296
  *
3172
3297
  * @task T9659
3173
3298
  * @epic T9571
@@ -3287,6 +3412,76 @@ interface SkillInstallResult {
3287
3412
  /** Whether at least one agent was successfully linked. */
3288
3413
  success: boolean;
3289
3414
  }
3415
+ /**
3416
+ * Move a fully staged entry onto `targetPath` without ever deleting the entry
3417
+ * it replaces before the replacement is in place.
3418
+ *
3419
+ * @remarks
3420
+ * T12383. The previous installer ran `rm -rf <target>` and only then copied
3421
+ * the new source; when the copy failed (for instance because the "source" was
3422
+ * the unresolved string `library:<name>`) the installed skill was gone.
3423
+ *
3424
+ * The swap moves the current entry aside to a hidden sibling, renames the
3425
+ * staged entry into place, then deletes the set-aside copy. If the second
3426
+ * rename fails, the set-aside copy is renamed back, so a failure at any step
3427
+ * leaves the original entry where it was. POSIX offers no portable atomic
3428
+ * exchange of two directories, so the path is absent for the span of one
3429
+ * `rename(2)` — but no step discards data that has not already been superseded
3430
+ * on disk.
3431
+ *
3432
+ * When a concurrent installer occupies the path between the two renames, the
3433
+ * swap retries a bounded number of times; the last writer wins, as before.
3434
+ *
3435
+ * @param stagedPath - A complete replacement, on the same filesystem as `targetPath`
3436
+ * @param targetPath - The path to replace (need not exist)
3437
+ * @throws The underlying filesystem error when the swap cannot complete; the
3438
+ * original entry is restored before the error propagates
3439
+ *
3440
+ * @example
3441
+ * ```typescript
3442
+ * const staged = await stageSkillCopy("/tmp/my-skill", target);
3443
+ * await swapIntoPlace(staged, target);
3444
+ * ```
3445
+ *
3446
+ * @public
3447
+ */
3448
+ declare function swapIntoPlace(stagedPath: string, targetPath: string): Promise<void>;
3449
+ /**
3450
+ * Copy `sourcePath` into a hidden staging sibling of `targetPath`.
3451
+ *
3452
+ * @remarks
3453
+ * Nothing at `targetPath` is touched. If the copy fails the partial staging
3454
+ * directory is removed and the error propagates.
3455
+ *
3456
+ * @param sourcePath - Directory to copy
3457
+ * @param targetPath - Path the staged copy will later replace
3458
+ * @returns Absolute path of the complete staged copy
3459
+ * @throws The copy error (e.g. `ENOENT` when `sourcePath` does not exist)
3460
+ *
3461
+ * @example
3462
+ * ```typescript
3463
+ * const staged = await stageSkillCopy("/tmp/my-skill", "/home/u/.cleo/skills/my-skill");
3464
+ * ```
3465
+ *
3466
+ * @public
3467
+ */
3468
+ declare function stageSkillCopy(sourcePath: string, targetPath: string): Promise<string>;
3469
+ /**
3470
+ * Replace the directory at `targetPath` with a copy of `sourcePath`, staging
3471
+ * the copy completely before anything existing is moved.
3472
+ *
3473
+ * @param sourcePath - Directory to copy
3474
+ * @param targetPath - Directory to replace (need not exist)
3475
+ * @throws When the copy or the swap fails; the existing directory is kept
3476
+ *
3477
+ * @example
3478
+ * ```typescript
3479
+ * await replaceDirectoryFromSource("/tmp/my-skill", "/home/u/.pi/agent/skills/my-skill");
3480
+ * ```
3481
+ *
3482
+ * @public
3483
+ */
3484
+ declare function replaceDirectoryFromSource(sourcePath: string, targetPath: string): Promise<void>;
3290
3485
  /**
3291
3486
  * Heuristic source-type classifier for installs that don't carry an explicit
3292
3487
  * `source_type`.
@@ -5450,6 +5645,82 @@ interface EnsureProviderInstructionFileResult {
5450
5645
  * @public
5451
5646
  */
5452
5647
  declare function ensureProviderInstructionFile(providerId: string, projectDir: string, options: EnsureProviderInstructionFileOptions): Promise<EnsureProviderInstructionFileResult>;
5648
+ /**
5649
+ * Options for {@link ensureProviderRuleFile}.
5650
+ *
5651
+ * @public
5652
+ */
5653
+ interface EnsureProviderRuleFileOptions {
5654
+ /** File path relative to the project directory (e.g. `.cursor/rules/cleo.mdc`). */
5655
+ relativePath: string;
5656
+ /**
5657
+ * Text the file must begin with (e.g. MDC frontmatter). When set, CAAMP owns
5658
+ * the whole file: its content is exactly the preamble followed by one CAAMP
5659
+ * block. When omitted, only the CAAMP block is managed and every byte outside
5660
+ * it is preserved.
5661
+ * @defaultValue `undefined`
5662
+ */
5663
+ preamble?: string;
5664
+ /** Update the file only when it already exists; never create it. @defaultValue `false` */
5665
+ onlyIfExists?: boolean;
5666
+ /**
5667
+ * `@` references to write. Defaults to the provider's registry
5668
+ * `instructionReferences`.
5669
+ * @defaultValue Registry `instructionReferences` for the provider
5670
+ */
5671
+ references?: string[];
5672
+ }
5673
+ /**
5674
+ * Result of {@link ensureProviderRuleFile}.
5675
+ *
5676
+ * @public
5677
+ */
5678
+ interface EnsureProviderRuleFileResult {
5679
+ /** Absolute path of the rule file. */
5680
+ filePath: string;
5681
+ /** Action taken. */
5682
+ action: CaampInjectionAction;
5683
+ /** Provider ID. */
5684
+ providerId: string;
5685
+ }
5686
+ /**
5687
+ * Ensure a provider's auxiliary rule file (one that is not its registry
5688
+ * `instructFile`) carries the CAAMP-managed reference block.
5689
+ *
5690
+ * @remarks
5691
+ * ADR-064: every provider instruction write goes through CAAMP. Some providers
5692
+ * read extra rule files beside their primary instruction file — Cursor reads
5693
+ * `.cursor/rules/*.mdc` and the legacy `.cursorrules` — and the adapters used
5694
+ * to write those with raw `writeFileSync` and a local copy of the references
5695
+ * (T12385). This writes them the way {@link inject} writes instruction files:
5696
+ * under the cross-process lock, atomically, with a torn-read guard, and with
5697
+ * references from the registry.
5698
+ *
5699
+ * The block carries references, not embedded sources: these files sit beside
5700
+ * the provider's primary instruction file, which
5701
+ * {@link ensureProviderInstructionFile} already fills with the self-contained
5702
+ * delivery, so embedding here would load the protocol twice.
5703
+ *
5704
+ * A file managed without a preamble that predates CAAMP markers has its bare
5705
+ * reference lines replaced by the block rather than duplicated.
5706
+ *
5707
+ * @param providerId - Provider ID from the registry
5708
+ * @param projectDir - Absolute project directory
5709
+ * @param options - Target path, optional preamble, create policy, references
5710
+ * @returns The result, or `null` when `onlyIfExists` is set and the file is absent
5711
+ * @throws Error if the provider ID is not in the registry, or on a torn read
5712
+ *
5713
+ * @example
5714
+ * ```typescript
5715
+ * await ensureProviderRuleFile("cursor", "/project", {
5716
+ * relativePath: ".cursor/rules/cleo.mdc",
5717
+ * preamble: "---\nalwaysApply: true\n---\n",
5718
+ * });
5719
+ * ```
5720
+ *
5721
+ * @public
5722
+ */
5723
+ declare function ensureProviderRuleFile(providerId: string, projectDir: string, options: EnsureProviderRuleFileOptions): Promise<EnsureProviderRuleFileResult | null>;
5453
5724
  /**
5454
5725
  * Ensure instruction files for multiple providers at once.
5455
5726
  *
@@ -7377,6 +7648,47 @@ declare function getProviderCapabilities(idOrAlias: string): ProviderCapabilitie
7377
7648
  * @public
7378
7649
  */
7379
7650
  declare function providerSupportsById(idOrAlias: string, capabilityPath: string): boolean;
7651
+ /**
7652
+ * The fallback every agent uses when its provider has no known ask tool: emit
7653
+ * ONE LAFS envelope `hitl.request` with `{question, options[{label,
7654
+ * description}], recommended}` in `data`, then stop.
7655
+ *
7656
+ * @public
7657
+ */
7658
+ declare const HITL_REQUEST_FALLBACK: HitlRequestFallback;
7659
+ /**
7660
+ * Structured-question ("ask the human") tool per provider id.
7661
+ *
7662
+ * @remarks
7663
+ * DATA, keyed by the canonical id in `providers/registry.json`; every registry
7664
+ * provider has an entry (a test enforces it). Only verified names are
7665
+ * recorded — anything not found in docs or source is `unknown`, never
7666
+ * invented. Researched 2026-09-27 for T12482.
7667
+ *
7668
+ * @public
7669
+ */
7670
+ declare const PROVIDER_ASK_TOOLS: Readonly<Record<string, ProviderAskTool>>;
7671
+ /**
7672
+ * Resolve the structured-question tool for a provider, with the
7673
+ * `hitl.request` fallback attached.
7674
+ *
7675
+ * @remarks
7676
+ * Canonical ids are looked up directly (no registry load); anything else is
7677
+ * alias-resolved through the registry. An id with no entry resolves to
7678
+ * `unknown` so callers always get an answer and a fallback.
7679
+ *
7680
+ * @param idOrAlias - Provider ID or alias (e.g. `"claude"`)
7681
+ * @returns The ask-tool record, its canonical provider id and the fallback
7682
+ *
7683
+ * @example
7684
+ * ```typescript
7685
+ * getProviderAskTool('claude').toolName; // "AskUserQuestion"
7686
+ * getProviderAskTool('aider').toolName; // null -> use fallback (hitl.request)
7687
+ * ```
7688
+ *
7689
+ * @public
7690
+ */
7691
+ declare function getProviderAskTool(idOrAlias: string): ResolvedProviderAskTool;
7380
7692
 
7381
7693
  /**
7382
7694
  * Spawn adapter interface for provider-neutral subagent orchestration.
@@ -8214,6 +8526,372 @@ declare function discoverSkill(skillDir: string): Promise<SkillEntry | null>;
8214
8526
  */
8215
8527
  declare function discoverSkills(rootDir: string): Promise<SkillEntry[]>;
8216
8528
 
8529
+ /**
8530
+ * Shared LAFS utilities for CAAMP commands
8531
+ *
8532
+ * Provides standardized LAFS envelope creation, error handling, and format resolution
8533
+ * to ensure all commands follow the LAFS (Language-Agnostic Format Specification) protocol.
8534
+ *
8535
+ * @module lafs
8536
+ * @requires @cleocode/lafs
8537
+ * @requires ../logger.js
8538
+ */
8539
+
8540
+ /**
8541
+ * Common error codes for consistency.
8542
+ *
8543
+ * @public
8544
+ */
8545
+ declare const ErrorCodes: {
8546
+ readonly FORMAT_CONFLICT: "E_FORMAT_CONFLICT";
8547
+ readonly INVALID_JSON: "E_INVALID_JSON";
8548
+ readonly SKILL_NOT_FOUND: "E_SKILL_NOT_FOUND";
8549
+ readonly PROVIDER_NOT_FOUND: "E_PROVIDER_NOT_FOUND";
8550
+ readonly MCP_SERVER_NOT_FOUND: "E_MCP_SERVER_NOT_FOUND";
8551
+ readonly FILE_NOT_FOUND: "E_FILE_NOT_FOUND";
8552
+ readonly INVALID_INPUT: "E_INVALID_INPUT";
8553
+ readonly INVALID_CONSTRAINT: "E_INVALID_CONSTRAINT";
8554
+ readonly INVALID_FORMAT: "E_INVALID_FORMAT";
8555
+ readonly INSTALL_FAILED: "E_INSTALL_FAILED";
8556
+ readonly SKILL_TRUST_GATE_BLOCKED: "E_SKILL_TRUST_GATE_BLOCKED";
8557
+ /** The skill security gate could not be loaded, so the install was refused (T12384). */
8558
+ readonly SKILL_GATE_UNAVAILABLE: "E_SKILL_GATE_UNAVAILABLE";
8559
+ readonly FEDERATION_UNKNOWN_SOURCE_INTERACTIVE_REQUIRED: "E_FEDERATION_UNKNOWN_SOURCE_INTERACTIVE_REQUIRED";
8560
+ readonly FEDERATION_CHECKSUM_MISMATCH: "E_FEDERATION_CHECKSUM_MISMATCH";
8561
+ readonly REMOVE_FAILED: "E_REMOVE_FAILED";
8562
+ readonly UPDATE_FAILED: "E_UPDATE_FAILED";
8563
+ readonly VALIDATION_FAILED: "E_VALIDATION_FAILED";
8564
+ readonly AUDIT_FAILED: "E_AUDIT_FAILED";
8565
+ readonly NETWORK_ERROR: "E_NETWORK_ERROR";
8566
+ readonly FILE_SYSTEM_ERROR: "E_FILE_SYSTEM_ERROR";
8567
+ readonly PERMISSION_DENIED: "E_PERMISSION_DENIED";
8568
+ readonly INTERNAL_ERROR: "E_INTERNAL_ERROR";
8569
+ };
8570
+
8571
+ /**
8572
+ * Gated skill install pipeline — the one library entry point every skill
8573
+ * install goes through, from `caamp skills install` and from `cleo tools skill
8574
+ * install` alike.
8575
+ *
8576
+ * Before T12384 the pipeline (resolve → fetch → security gate → copy → link →
8577
+ * record) lived inside the Commander action in `commands/skills/install.ts`,
8578
+ * where CLEO could not reach it. CLEO therefore called the bare `installSkill`
8579
+ * primitive, which has no gate, and passed it the literal string
8580
+ * `library:<name>` as a filesystem path (T12383). The caamp copy of the gate
8581
+ * also failed OPEN: when `@cleocode/core` could not be loaded it logged a
8582
+ * warning and installed anyway.
8583
+ *
8584
+ * This module fixes all three:
8585
+ *
8586
+ * - {@link resolveSkillSource} turns any accepted source string — a registered
8587
+ * library id (`library:<name>` or a bare name), a local path, a GitHub or
8588
+ * GitLab repo/URL, a marketplace `@author/name` — into a real local
8589
+ * directory, or throws. It never hands an identifier to the copier.
8590
+ * - {@link runSkillInstallGate} runs the federation checksum gate and the
8591
+ * skills-guard scan and FAILS CLOSED: if the gate's modules cannot be loaded,
8592
+ * the install is refused.
8593
+ * - {@link installSkillFromSource} / {@link installResolvedSkill} are the only
8594
+ * functions that should place a skill. Both gate before any filesystem
8595
+ * write, and the underlying copier stages the new copy before replacing the
8596
+ * old one.
8597
+ *
8598
+ * @task T12383
8599
+ * @task T12384
8600
+ */
8601
+
8602
+ /**
8603
+ * Error codes raised by the gated install pipeline.
8604
+ *
8605
+ * @remarks
8606
+ * Values are drawn from caamp's LAFS {@link ErrorCodes} table so CLI envelopes
8607
+ * and library callers report the same code for the same refusal.
8608
+ *
8609
+ * @public
8610
+ */
8611
+ type SkillInstallErrorCode = typeof ErrorCodes.SKILL_NOT_FOUND | typeof ErrorCodes.INVALID_INPUT | typeof ErrorCodes.INVALID_FORMAT | typeof ErrorCodes.NETWORK_ERROR | typeof ErrorCodes.SKILL_TRUST_GATE_BLOCKED | typeof ErrorCodes.SKILL_GATE_UNAVAILABLE | typeof ErrorCodes.FEDERATION_CHECKSUM_MISMATCH | typeof ErrorCodes.FEDERATION_UNKNOWN_SOURCE_INTERACTIVE_REQUIRED;
8612
+ /**
8613
+ * Structured detail attached to a {@link SkillInstallError}.
8614
+ *
8615
+ * @public
8616
+ */
8617
+ interface SkillInstallErrorDetails {
8618
+ /** Scan result when the refusal came from the skills-guard scan. */
8619
+ scan?: SkillGateScanResult;
8620
+ /** Federation gate result when the refusal came from the checksum/source gate. */
8621
+ federation?: SkillGateFederationResult;
8622
+ /** Skill names the registered library does offer, when a lookup missed. */
8623
+ availableSkills?: string[];
8624
+ /** Underlying error message, when the refusal wraps another failure. */
8625
+ cause?: string;
8626
+ }
8627
+ /**
8628
+ * A skill install that was refused before anything was written.
8629
+ *
8630
+ * @remarks
8631
+ * Every refusal from this module is thrown as this type, so callers can map
8632
+ * `code` to an envelope and trust that the installed copy was not touched.
8633
+ *
8634
+ * @example
8635
+ * ```typescript
8636
+ * try {
8637
+ * await installSkillFromSource("owner/repo", { providers, isGlobal: true });
8638
+ * } catch (err) {
8639
+ * if (err instanceof SkillInstallError) console.error(err.code, err.message);
8640
+ * }
8641
+ * ```
8642
+ *
8643
+ * @public
8644
+ */
8645
+ declare class SkillInstallError extends Error {
8646
+ /** Machine-readable refusal code. */
8647
+ readonly code: SkillInstallErrorCode;
8648
+ /** Structured context for the refusal. */
8649
+ readonly details: SkillInstallErrorDetails;
8650
+ /**
8651
+ * @param code - Refusal code
8652
+ * @param message - Human-readable reason
8653
+ * @param details - Structured context
8654
+ */
8655
+ constructor(code: SkillInstallErrorCode, message: string, details?: SkillInstallErrorDetails);
8656
+ }
8657
+ /**
8658
+ * A skill source resolved to a real local directory.
8659
+ *
8660
+ * @public
8661
+ */
8662
+ interface ResolvedSkillSource {
8663
+ /** Absolute path of the directory to install from. */
8664
+ localPath: string;
8665
+ /** Name the skill is installed under. */
8666
+ skillName: string;
8667
+ /** Provenance string recorded for the install (e.g. `library:ct-foo`, a GitHub URL). */
8668
+ sourceValue: string;
8669
+ /** Classified source type. */
8670
+ sourceType: SourceType;
8671
+ /** Removes any temporary checkout; absent for sources that live on disk already. */
8672
+ cleanup?: () => Promise<void>;
8673
+ }
8674
+ /**
8675
+ * A resolution step worth telling a human about.
8676
+ *
8677
+ * @remarks
8678
+ * The library does not print; a CLI renders these (e.g. in `--human` mode).
8679
+ *
8680
+ * @public
8681
+ */
8682
+ type SkillSourceProgress = {
8683
+ readonly kind: 'marketplace-search';
8684
+ readonly source: string;
8685
+ } | {
8686
+ readonly kind: 'marketplace-found';
8687
+ readonly name: string;
8688
+ readonly author: string;
8689
+ readonly repo: string;
8690
+ } | {
8691
+ readonly kind: 'catalog-found';
8692
+ readonly name: string;
8693
+ readonly version: string;
8694
+ readonly category: string;
8695
+ };
8696
+ /**
8697
+ * Resolve a skill source string to a real local directory.
8698
+ *
8699
+ * @remarks
8700
+ * Accepted forms:
8701
+ *
8702
+ * - `library:<name>` (or `<package>:<name>`) and bare `<name>` — looked up in
8703
+ * the registered skill library ({@link catalog}).
8704
+ * - An absolute, `./`, `../` or `~` path — used as is (the name comes from its
8705
+ * `SKILL.md` when present).
8706
+ * - `owner/repo[/path]`, a GitHub URL or a GitLab URL — cloned to a temporary
8707
+ * directory; call `cleanup` when done.
8708
+ * - `@author/name` — looked up in the skill marketplace, then cloned.
8709
+ *
8710
+ * Anything else is refused. An identifier is never returned as `localPath`,
8711
+ * which is the T12383 defect: `library:<name>` used to reach `cp()` verbatim.
8712
+ *
8713
+ * @param source - Source string as typed by the user or stored in a lock row
8714
+ * @param onProgress - Optional sink for human-facing resolution events
8715
+ * @returns The resolved local source
8716
+ * @throws {@link SkillInstallError} when the source cannot be resolved
8717
+ *
8718
+ * @example
8719
+ * ```typescript
8720
+ * const resolved = await resolveSkillSource("library:ct-cleo");
8721
+ * try {
8722
+ * console.log(resolved.localPath);
8723
+ * } finally {
8724
+ * await resolved.cleanup?.();
8725
+ * }
8726
+ * ```
8727
+ *
8728
+ * @public
8729
+ */
8730
+ declare function resolveSkillSource(source: string, onProgress?: (event: SkillSourceProgress) => void): Promise<ResolvedSkillSource>;
8731
+ /**
8732
+ * The `@cleocode/core` functions the gate calls.
8733
+ *
8734
+ * @remarks
8735
+ * Loaded lazily because core depends on caamp at build time; a static import
8736
+ * of these modules would put core's whole skills graph on caamp's startup
8737
+ * path. Typed against the shared `@cleocode/contracts` gate shapes, which
8738
+ * mirror core's types structurally, so core's functions are assignable here.
8739
+ *
8740
+ * @public
8741
+ */
8742
+ interface SkillGateModules {
8743
+ /** Skills-guard static scan. */
8744
+ scanSkill: (skillPath: string, source: string) => SkillGateScanResult;
8745
+ /** INSTALL_POLICY decision over a scan result. */
8746
+ shouldAllowInstall: (result: SkillGateScanResult, force: boolean) => SkillGatePolicyDecision;
8747
+ /** Federation first-install and checksum gate. */
8748
+ evaluateFederationInstallGate: (opts: SkillGateFederationInput) => SkillGateFederationResult;
8749
+ /** Audit writer for operator `force` bypasses. */
8750
+ recordTrustBypass: (result: SkillGateScanResult, reason: string | null) => object;
8751
+ }
8752
+ /**
8753
+ * Options for {@link runSkillInstallGate}.
8754
+ *
8755
+ * @public
8756
+ */
8757
+ interface SkillInstallGateOptions {
8758
+ /** Operator override of a `block` scan decision (audited). Never overrides `ask` or a checksum mismatch. */
8759
+ force?: boolean;
8760
+ /** Approve a first install from an unverified federation source (non-interactive contexts). */
8761
+ allowNewSource?: boolean;
8762
+ /** Checksum the artefact must match, when the source declares one. */
8763
+ expectedChecksum?: string | null;
8764
+ }
8765
+ /**
8766
+ * What the gate decided, for callers that report it.
8767
+ *
8768
+ * @public
8769
+ */
8770
+ interface SkillInstallGateReport {
8771
+ /** The skills-guard scan of the staged source. */
8772
+ scan: SkillGateScanResult;
8773
+ /** The install-policy decision (always `allow` when this returns). */
8774
+ decision: SkillGatePolicyDecision;
8775
+ /** The federation gate result (always `allow` when this returns). */
8776
+ federation: SkillGateFederationResult;
8777
+ /** Whether an operator `force` bypass was used and audited. */
8778
+ bypassed: boolean;
8779
+ }
8780
+ /**
8781
+ * Run the federation checksum gate and the skills-guard scan over a resolved
8782
+ * source. Fails closed.
8783
+ *
8784
+ * @remarks
8785
+ * Order matters: the federation gate runs first, so a checksum mismatch or an
8786
+ * unapproved federation source is refused before the scanner reads the bytes.
8787
+ * Both run before any filesystem write.
8788
+ *
8789
+ * Unlike the pre-T12384 caamp CLI gate, a failure to load the gate's modules is
8790
+ * a refusal (`E_SKILL_GATE_UNAVAILABLE`), not a skipped check.
8791
+ *
8792
+ * @param source - The resolved source to vet
8793
+ * @param options - Operator overrides
8794
+ * @returns The gate report when the install may proceed
8795
+ * @throws {@link SkillInstallError} when the install is refused or the gate is unavailable
8796
+ *
8797
+ * @example
8798
+ * ```typescript
8799
+ * const report = await runSkillInstallGate(resolved, { force: false });
8800
+ * console.log(report.scan.verdict);
8801
+ * ```
8802
+ *
8803
+ * @public
8804
+ */
8805
+ declare function runSkillInstallGate(source: ResolvedSkillSource, options?: SkillInstallGateOptions): Promise<SkillInstallGateReport>;
8806
+ /**
8807
+ * Options for {@link installSkillFromSource} and {@link installResolvedSkill}.
8808
+ *
8809
+ * @public
8810
+ */
8811
+ interface GatedSkillInstallOptions extends SkillInstallGateOptions {
8812
+ /** Providers to link the skill into. */
8813
+ providers: Provider[];
8814
+ /** Global (`true`) or project scope. */
8815
+ isGlobal: boolean;
8816
+ /** Project directory for project scope. */
8817
+ projectDir?: string;
8818
+ /** Provenance sink forwarded to the canonical installer. */
8819
+ recordRow?: InstallSkillOptions['recordRow'];
8820
+ /** Record the install in the CAAMP lock file. @defaultValue false */
8821
+ recordLock?: boolean;
8822
+ /** Override the name the skill installs under. */
8823
+ skillName?: string;
8824
+ /** Sink for human-facing resolution events (used by {@link installSkillFromSource}). */
8825
+ onProgress?: (event: SkillSourceProgress) => void;
8826
+ }
8827
+ /**
8828
+ * Result of a gated install.
8829
+ *
8830
+ * @public
8831
+ */
8832
+ interface GatedSkillInstallResult extends SkillInstallResult {
8833
+ /** Provenance string recorded for the install. */
8834
+ sourceValue: string;
8835
+ /** Classified source type. */
8836
+ sourceType: SourceType;
8837
+ /** The gate's report. */
8838
+ gate: SkillInstallGateReport;
8839
+ }
8840
+ /**
8841
+ * Gate and install an already-resolved source.
8842
+ *
8843
+ * @remarks
8844
+ * Use this when the caller has a checkout in hand (for example an update that
8845
+ * cloned the source itself). The gate runs first; on refusal nothing is
8846
+ * written. The canonical copy is staged before it replaces the installed one
8847
+ * (T12383), so a failure part-way through keeps the installed skill.
8848
+ *
8849
+ * Does not call `source.cleanup` — the caller owns the checkout.
8850
+ *
8851
+ * @param source - Resolved source
8852
+ * @param options - Targets, scope, provenance and gate overrides
8853
+ * @returns The install result, including the gate report
8854
+ * @throws {@link SkillInstallError} when the gate refuses the install
8855
+ *
8856
+ * @example
8857
+ * ```typescript
8858
+ * const result = await installResolvedSkill(
8859
+ * { localPath: "/tmp/co/skill", skillName: "demo", sourceValue: "owner/repo", sourceType: "github" },
8860
+ * { providers, isGlobal: true },
8861
+ * );
8862
+ * ```
8863
+ *
8864
+ * @public
8865
+ */
8866
+ declare function installResolvedSkill(source: ResolvedSkillSource, options: GatedSkillInstallOptions): Promise<GatedSkillInstallResult>;
8867
+ /**
8868
+ * Resolve, gate and install a skill from any accepted source string.
8869
+ *
8870
+ * @remarks
8871
+ * The single entry point for installing a skill (T12384). Resolution turns the
8872
+ * source into a real directory ({@link resolveSkillSource}); the gate vets it
8873
+ * and fails closed ({@link runSkillInstallGate}); the installer stages the new
8874
+ * copy before replacing the old one. Temporary checkouts are always removed.
8875
+ *
8876
+ * @param source - `library:<name>`, a bare library name, a local path,
8877
+ * `owner/repo`, a GitHub/GitLab URL, or `@author/name`
8878
+ * @param options - Targets, scope, provenance and gate overrides
8879
+ * @returns The install result, including the gate report
8880
+ * @throws {@link SkillInstallError} when the source cannot be resolved or the gate refuses it
8881
+ *
8882
+ * @example
8883
+ * ```typescript
8884
+ * const result = await installSkillFromSource("library:ct-cleo", {
8885
+ * providers: getInstalledProviders(),
8886
+ * isGlobal: true,
8887
+ * });
8888
+ * console.log(result.linkedAgents);
8889
+ * ```
8890
+ *
8891
+ * @public
8892
+ */
8893
+ declare function installSkillFromSource(source: string, options: GatedSkillInstallOptions): Promise<GatedSkillInstallResult>;
8894
+
8217
8895
  /**
8218
8896
  * Skill integrity checking
8219
8897
  *
@@ -9153,4 +9831,4 @@ declare function parseSource(input: string): ParsedSource;
9153
9831
  */
9154
9832
  declare function isMarketplaceScoped(input: string): boolean;
9155
9833
 
9156
- export { type AuditFinding, type AuditResult, type AuditRule, type AuditSeverity, type BatchInstallOptions, type BatchInstallResult, type BlockInsertPosition, CANONICAL_HOOK_EVENTS, CLEO_ARTIFACT_BUDGETS, CLEO_ARTIFACT_REQUIREMENTS, 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, EmbeddedDeliveryDowngradeError, type EnsureProviderInstructionFileOptions, type EnsureProviderInstructionFileResult, type ExclusivityMode, type FileLockOptions, type GlobalInstructionOptions, 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 NormalizeResult, 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 ReconcileResult, type RegistryHarnessKind, type RegistryHookCatalog, type RegistryHookFormat, type RemoveMcpServerOptions, type RemoveMcpServerResult, type RepairResult, 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 SyncGlobalInstructionsOptions, type TransportType, type ValidateCantProfileResult, type ValidationIssue, type ValidationResult, type WriteAgentFileOptions, type WriteAgentFileResult, _resetPlatformPathsCache, assertCleoShippedBuildShape, assertNotTornRead, blockPattern, buildBlock, buildHookMatrix, buildInjectionContent, buildLibraryFromFiles, buildSkillsMap, catalog, checkAllInjections, checkAllSkillIntegrity, checkAllSkillUpdates, checkGlobalInstructionStaleness, checkInjection, checkSkillIntegrity, checkSkillUpdate, classifyPackageFilesEntry, 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, 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, instructionFileCascade, isCaampOwnedSkill, isEmbeddedDelivery, isExclusivityMode, isMarketplaceScoped, isQuiet, isVerbose, listAllMcpServers, listCanonicalSkills, listMcpServers, loadLibraryFromModule, mergeBlockBodies, normalizeMarkers, normalizeRecommendationCriteria, parseBlocks, parseCaampBlocks, parseInjectionContent, parseSkillFile, parseSource, providerSupports, providerSupportsById, rankSkills, readConfig, recommendSkills, reconcile, recordSkillInstall, registerSkillLibrary, registerSkillLibraryFromPath, removeConfig, removeInjection, removeMcpServer, removeMcpServerFromAll, removeSkill, removeSkillFromLock, repairContent, repairInstructionFiles, resetDetectionCache, resetExclusivityModeOverride, resetRegistry, resolveAlias, resolveDefaultTargetProviders, resolveGlobalInstructionPath, resolveInstructionDelivery, resolveMcpConfigPath, resolveNativeEvent, resolveProviderSkillsDirs, resolveRegistryTemplatePath, scanDirectory, scanFile, scoreSkillRecommendation, searchSkills, selectProvidersByMinimumPriority, setExclusivityMode, setQuiet, setVerbose, shouldOverrideSkill, supportsHook, syncGlobalInstructions, toCanonical, toNative, toNativeBatch, toSarif, tokenizeCriteriaValue, translateToAll, updateInstructionsSingleOperation, validateInstructionIntegrity, validatePackageArtifact, validateRecommendationCriteria, validateSkill, withFileLock, writeAgentFileToAllProviders, writeConfig };
9834
+ export { type AskToolStatus, type AuditFinding, type AuditResult, type AuditRule, type AuditSeverity, type BatchInstallOptions, type BatchInstallResult, type BlockInsertPosition, CANONICAL_HOOK_EVENTS, CLEO_ARTIFACT_BUDGETS, CLEO_ARTIFACT_REQUIREMENTS, 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, EmbeddedDeliveryDowngradeError, type EnsureProviderInstructionFileOptions, type EnsureProviderInstructionFileResult, type EnsureProviderRuleFileOptions, type EnsureProviderRuleFileResult, type ExclusivityMode, type FileLockOptions, type GatedSkillInstallOptions, type GatedSkillInstallResult, type GlobalInstructionOptions, type GlobalOptions, HITL_REQUEST_FALLBACK, HOOK_CATEGORIES, type Harness, type HarnessScope, type HitlRequestFallback, 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, JsonConfigParseError, 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 NormalizeResult, type NormalizedHookEvent, type NormalizedRecommendationCriteria, PROVIDER_ASK_TOOLS, type ParsedSource, PiHarness, PiRequiredError, type Provider, type ProviderAskTool, 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 ReconcileResult, type RegistryHarnessKind, type RegistryHookCatalog, type RegistryHookFormat, type RemoveMcpServerOptions, type RemoveMcpServerResult, type RepairResult, type ResolveDefaultTargetProvidersOptions, type ResolvedProviderAskTool, type ResolvedSkillSource, type SkillBatchOperation, type SkillEntry, type SkillGateModules, SkillInstallError, type SkillInstallErrorCode, type SkillInstallErrorDetails, type SkillInstallGateOptions, type SkillInstallGateReport, 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 SkillSourceProgress, type SkillsPrecedence, type SourceType, type SpawnAdapter, type SpawnMechanism, type SpawnOptions, type SpawnResult, type SubagentHandle, type SubagentResult, type SubagentTask, type SyncGlobalInstructionsOptions, type TransportType, type ValidateCantProfileResult, type ValidationIssue, type ValidationResult, type WriteAgentFileOptions, type WriteAgentFileResult, _resetPlatformPathsCache, assertCleoShippedBuildShape, assertNotTornRead, blockPattern, buildBlock, buildHookMatrix, buildInjectionContent, buildLibraryFromFiles, buildSkillsMap, catalog, checkAllInjections, checkAllSkillIntegrity, checkAllSkillUpdates, checkGlobalInstructionStaleness, checkInjection, checkSkillIntegrity, checkSkillUpdate, classifyPackageFilesEntry, clearRegisteredLibrary, dedupeFile, dedupeFiles, deepMerge, detectAllProviders, detectMcpInstallations, detectProjectProviders, detectProvider, discoverSkill, discoverSkills, ensureAllProviderInstructionFiles, ensureDir, ensureProviderInstructionFile, ensureProviderRuleFile, formatSkillRecommendations, generateInjectionContent, generateSkillsSection, getAgentsConfigPath, getAgentsHome, getAgentsInstructFile, getAgentsLinksDir, getAgentsMcpDir, getAgentsMcpServersPath, getAgentsSpecDir, getAgentsWikiDir, getAllCanonicalEvents, getAllHarnesses, getAllProviders, getCanonicalEvent, getCanonicalEventsByCategory, getCommonEvents, getCommonHookEvents, getEffectiveSkillsPaths, getExclusivityMode, getHarnessFor, getHookConfigPath, getHookMappingsVersion, getHookSupport, getHookSystemType, getInstalledProviders, getInstructionFiles, getLockFilePath, getMappedProviderIds, getNestedValue, getPlatformLocations, getPlatformPaths, getPrimaryHarness, getPrimaryProvider, getProjectAgentsDir, getProvider, getProviderAgentFolder, getProviderAskTool, 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, installResolvedSkill, installSkill, installSkillFromSource, instructionFileCascade, isCaampOwnedSkill, isEmbeddedDelivery, isExclusivityMode, isMarketplaceScoped, isQuiet, isVerbose, listAllMcpServers, listCanonicalSkills, listMcpServers, loadLibraryFromModule, mergeBlockBodies, normalizeMarkers, normalizeRecommendationCriteria, parseBlocks, parseCaampBlocks, parseInjectionContent, parseSkillFile, parseSource, providerSupports, providerSupportsById, rankSkills, readConfig, recommendSkills, reconcile, recordSkillInstall, registerSkillLibrary, registerSkillLibraryFromPath, removeConfig, removeInjection, removeMcpServer, removeMcpServerFromAll, removeSkill, removeSkillFromLock, repairContent, repairInstructionFiles, replaceDirectoryFromSource, resetDetectionCache, resetExclusivityModeOverride, resetRegistry, resolveAlias, resolveDefaultTargetProviders, resolveGlobalInstructionPath, resolveInstructionDelivery, resolveMcpConfigPath, resolveNativeEvent, resolveProviderSkillsDirs, resolveRegistryTemplatePath, resolveSkillSource, runSkillInstallGate, scanDirectory, scanFile, scoreSkillRecommendation, searchSkills, selectProvidersByMinimumPriority, setExclusivityMode, setQuiet, setVerbose, shouldOverrideSkill, stageSkillCopy, supportsHook, swapIntoPlace, syncGlobalInstructions, toCanonical, toNative, toNativeBatch, toSarif, tokenizeCriteriaValue, translateToAll, updateInstructionsSingleOperation, updateJsonConfigFile, validateInstructionIntegrity, validatePackageArtifact, validateRecommendationCriteria, validateSkill, withFileLock, writeAgentFileToAllProviders, writeConfig };