cyber-agentkit 0.0.0-stage → 1.0.0

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.
@@ -0,0 +1,724 @@
1
+ import { n as harnessIds, t as HarnessId } from "./harness-id-BgKL-x6C.js";
2
+ import { A as FoundSkill, C as defaultLayer, D as ReferenceCode, E as userReferencesDir, M as skillsIn, N as Platform, O as ReferenceWarning, S as SkillDefaults, T as referenceLayers, _ as ReferenceLayer, a as ReferenceTrace, b as ReferencePlugin, c as ReferenceTraceSection, d as referenceNames, f as resolveReference, g as SectionSource, h as MergeOperation, i as ReferenceStatus, j as skillName, k as ReferenceWarningCode, l as ResolveOptions, m as parseReferenceName, n as ExtendsStep, o as ReferenceTraceContribution, p as ReferenceName, r as OperationSource, s as ReferenceTraceLayer, t as AmbiguousCause, u as ResolvedReference, v as ReferenceLayerOptions, w as projectReferencesDir, x as ReferenceTier, y as ReferenceLayers } from "./resolve-reference-Cis-Ye6T.js";
3
+ //#region src/harness/harness-environment.d.ts
4
+ /**
5
+ * The parts of the running process a harness query depends on. Every field defaults to the
6
+ * current process, so callers pass them only to inspect another environment (or in tests).
7
+ */
8
+ interface HarnessEnvironment {
9
+ /** Defaults to `process.env`. */
10
+ readonly env?: Readonly<Record<string, string | undefined>>;
11
+ /** Defaults to `os.homedir()`. */
12
+ readonly homedir?: string;
13
+ /** The project directory, for project-scoped settings. Defaults to `process.cwd()`. */
14
+ readonly cwd?: string;
15
+ /** Defaults to `process.platform`. */
16
+ readonly platform?: Platform;
17
+ }
18
+ //#endregion
19
+ //#region src/dependencies/plugin-dependencies.d.ts
20
+ /** One plugin another plugin declares it needs. */
21
+ interface PluginDependency {
22
+ readonly name: string;
23
+ /** The marketplace to resolve it in. Absent: the declaring plugin's own marketplace (E-DEP-1). */
24
+ readonly marketplace?: string;
25
+ /** The version the declaring plugin asked for. Reported, never compared. */
26
+ readonly version?: string;
27
+ }
28
+ /**
29
+ * Read the `dependencies` array of a Claude Code `plugin.json`: `"name"`, `"name@marketplace"`, or
30
+ * `{ name, marketplace, version }` entries (E-DEP-1, E-CC-X1). Entries of any other shape are skipped.
31
+ */
32
+ export declare function declaredPluginDependencies(manifest: unknown): PluginDependency[];
33
+ interface PluginDependenciesRead {
34
+ readonly dependencies: readonly PluginDependency[];
35
+ /** The manifest the list came from; the last one tried when none declares any. */
36
+ readonly path: string;
37
+ /** Set when the manifest exists but could not be parsed. */
38
+ readonly error?: string;
39
+ }
40
+ /**
41
+ * Read what the plugin at `pluginRoot` declares: `dependencies` under `extensions["io.github.cyber-uni.plugin-manager"]`,
42
+ * else under `extensions["org.cyberuni.universal-plugin"]` in the root `plugin.json`, else `dependencies` in
43
+ * `.claude-plugin/plugin.json` (E-DEP-1, E-DEP-6, E-DEP-7).
44
+ */
45
+ export declare function readPluginDependencies(pluginRoot: string): Promise<PluginDependenciesRead>;
46
+ type DependencyState = 'enabled' | 'disabled' | 'installed' | 'missing' | 'unknown';
47
+ interface CheckedDependency extends PluginDependency {
48
+ readonly state: DependencyState;
49
+ /** The `<plugin>@<marketplace>` install the state was read from. */
50
+ readonly id?: string;
51
+ }
52
+ interface PluginDependencyCheck {
53
+ readonly harness: HarnessId;
54
+ /** Whether the harness's manifest can declare dependencies (`supportsPluginDependencies`). */
55
+ readonly supported: boolean;
56
+ /** Whether the harness installs missing dependencies by itself. Only Claude Code does (E-DEP-2). */
57
+ readonly autoResolved: boolean;
58
+ readonly dependencies: readonly CheckedDependency[];
59
+ /** What to do next, in order. Empty when nothing is missing or disabled. */
60
+ readonly steps: readonly string[];
61
+ /** Set when the declaring manifest could not be read. */
62
+ readonly error?: string;
63
+ readonly research: readonly string[];
64
+ }
65
+ interface CheckPluginDependenciesOptions extends HarnessEnvironment {
66
+ /** The plugin whose manifest declares the dependencies. */
67
+ readonly pluginRoot?: string;
68
+ /** Dependencies already read; used instead of `pluginRoot`. */
69
+ readonly dependencies?: readonly PluginDependency[];
70
+ }
71
+ /**
72
+ * Check which declared dependencies the harness has installed and enabled, and return the steps
73
+ * that settle the rest. Nothing is installed.
74
+ */
75
+ export declare function checkPluginDependencies(harness: HarnessId, options?: CheckPluginDependenciesOptions): Promise<PluginDependencyCheck>;
76
+ //#endregion
77
+ //#region src/detection/detect-harness.d.ts
78
+ /**
79
+ * One environment variable `detectHarness()` found set, and which harness it points to.
80
+ */
81
+ interface HarnessEvidence {
82
+ readonly harness: HarnessId;
83
+ /** The environment variable name. */
84
+ readonly signal: string;
85
+ readonly description: string;
86
+ /** The claim ID in `.research/harness-detection/evidence.md` that backs this signal. */
87
+ readonly research: string;
88
+ }
89
+ interface HarnessDetectionResult {
90
+ /** The detected harness, or `unknown` when no harness or more than one harness matched. */
91
+ readonly harness: HarnessId | 'unknown';
92
+ /** Every signal that was found set, including ones that did not settle the answer. */
93
+ readonly evidence: readonly HarnessEvidence[];
94
+ /**
95
+ * Harnesses whose signals were found. More than one means nested harnesses (one launched from
96
+ * another's shell inherits its variables), which the environment cannot order, so `harness` is
97
+ * `unknown`.
98
+ */
99
+ readonly candidates: readonly HarnessId[];
100
+ }
101
+ interface DetectHarnessOptions {
102
+ /** The environment to inspect. Defaults to `process.env`. */
103
+ readonly env?: Readonly<Record<string, string | undefined>>;
104
+ }
105
+ /**
106
+ * Detect which AI agent harness this process is running under, from its environment.
107
+ *
108
+ * Reports `unknown` rather than guessing: when no rule matches, and when rules for more than one
109
+ * harness match.
110
+ */
111
+ export declare function detectHarness(options?: DetectHarnessOptions): HarnessDetectionResult;
112
+ //#endregion
113
+ //#region src/headless/headless-invocation.d.ts
114
+ /** How to run a harness on one prompt with no user present. */
115
+ type HeadlessInvocation = HeadlessMode | HeadlessUnavailable;
116
+ interface HeadlessMode {
117
+ readonly harness: HarnessId;
118
+ readonly supported: true;
119
+ /** The command to run. */
120
+ readonly executable: string;
121
+ /** The arguments that put the harness in one-shot mode, such as `['-p']` or `['exec']`. */
122
+ readonly oneShot: readonly string[];
123
+ /**
124
+ * The flag whose value is the prompt. When absent, the prompt is the last positional argument.
125
+ */
126
+ readonly promptFlag?: string;
127
+ /** The flag that selects the model. */
128
+ readonly modelFlag: string;
129
+ readonly permission: HeadlessPermission;
130
+ /** The output formats it can print. The first is the default. */
131
+ readonly outputFormats: readonly HeadlessOutputFormat[];
132
+ /** Where a run's transcript is kept, or `undefined` when the vendor does not say. */
133
+ readonly transcript?: HeadlessTranscript;
134
+ /** The exit codes the vendor documents. A code the list does not name means failure. */
135
+ readonly exitCodes: readonly HeadlessExitCode[];
136
+ /** The claim IDs in `.research/harness-detection/evidence.md` that back these facts. */
137
+ readonly research: readonly string[];
138
+ }
139
+ interface HeadlessUnavailable {
140
+ readonly harness: HarnessId;
141
+ /** `false` when the harness has no headless mode; `'unknown'` when its facts are not verified. */
142
+ readonly supported: false | 'unknown';
143
+ readonly reason: string;
144
+ readonly research: readonly string[];
145
+ }
146
+ interface HeadlessPermission {
147
+ /** The flag that takes a permission or approval mode, when there is one. */
148
+ readonly flag?: string;
149
+ /** The values `flag` accepts. */
150
+ readonly values: readonly string[];
151
+ /** The arguments that let a run edit files and run commands without asking anyone. */
152
+ readonly unattended: readonly string[];
153
+ }
154
+ interface HeadlessOutputFormat {
155
+ /** The harness's own name for the format. */
156
+ readonly name: string;
157
+ /** The arguments that select it; empty for the default. */
158
+ readonly args: readonly string[];
159
+ /** Where token usage and cost appear, or `undefined` when the vendor does not document it. */
160
+ readonly usage?: HeadlessUsage;
161
+ }
162
+ interface HeadlessUsage {
163
+ /** The `type` of the event or message that carries usage; absent when the output is one object. */
164
+ readonly event?: string;
165
+ /** The field that holds token counts, as a dotted path. */
166
+ readonly tokens: string;
167
+ /** The field that holds the cost in US dollars, when the harness reports one. */
168
+ readonly costUsd?: string;
169
+ /** `last`: the final event holds the run's total. `sum`: add the field across every such event. */
170
+ readonly accumulate: 'last' | 'sum';
171
+ }
172
+ interface HeadlessTranscript {
173
+ /** The path, with `~` for the home directory and `<placeholders>` for the varying parts. */
174
+ readonly path: string;
175
+ /** The environment variable that moves the base directory the path starts from. */
176
+ readonly baseDirEnv?: string;
177
+ /** The arguments that keep a run from writing a transcript at all. */
178
+ readonly disable?: readonly string[];
179
+ }
180
+ interface HeadlessExitCode {
181
+ readonly code: number;
182
+ readonly meaning: string;
183
+ }
184
+ /**
185
+ * How to run a harness non-interactively on one prompt: the command, how to choose the model and
186
+ * permission mode, the output formats and where usage appears in them, the transcript location,
187
+ * and the exit codes.
188
+ *
189
+ * Returns `supported: false` for Copilot in VS Code, which documents no headless mode (E-VSC-H1).
190
+ * Returns `supported: 'unknown'` for OpenCode, Kilo Code, Cline, Crush, OpenHands, and the Auggie
191
+ * CLI: each has a one-shot mode, but the research read it only through a summarizing fetch or from
192
+ * source (E-OC-H1, E-KILO-H1, E-CLINE-H1, E-CRUSH-H1, E-OH-H1, E-AUG-H1).
193
+ */
194
+ export declare function headlessInvocation(harness: HarnessId): HeadlessInvocation;
195
+ interface HeadlessCommandOptions {
196
+ readonly prompt: string;
197
+ readonly model?: string;
198
+ /** A value for the permission flag, or `'unattended'` for a run nobody watches. */
199
+ readonly permission?: string;
200
+ /** The name of one of the harness's output formats. */
201
+ readonly outputFormat?: string;
202
+ }
203
+ interface HeadlessCommand {
204
+ readonly executable: string;
205
+ readonly args: readonly string[];
206
+ }
207
+ /**
208
+ * The command line for one headless run, built from `headlessInvocation()`. It does not run it.
209
+ *
210
+ * Returns `undefined` when the harness's headless mode is not supported or not verified. Throws
211
+ * when `outputFormat` names a format the harness lacks, or `permission` names a mode the harness
212
+ * has no flag for.
213
+ */
214
+ export declare function headlessCommand(harness: HarnessId, options: HeadlessCommandOptions): HeadlessCommand | undefined;
215
+ //#endregion
216
+ //#region src/managed-policy/managed-policy-locations.d.ts
217
+ /**
218
+ * Where a piece of managed (organization-enforced) policy lives.
219
+ *
220
+ * - `file` / `directory`: on the local disk; a caller can read it.
221
+ * - `macos-managed-preferences`: a macOS managed-preferences domain delivered by MDM.
222
+ * - `windows-registry`: a Windows registry key delivered by MDM or Group Policy.
223
+ * - `server`: held by the vendor or the organization and fetched at runtime; not readable locally.
224
+ */
225
+ type ManagedPolicyKind = 'file' | 'directory' | 'macos-managed-preferences' | 'windows-registry' | 'server';
226
+ interface ManagedPolicyLocation {
227
+ readonly kind: ManagedPolicyKind;
228
+ /** A path, preference domain, registry key, or, for `server`, a description of where it is held. */
229
+ readonly location: string;
230
+ readonly description: string;
231
+ /** The claim ID in `.research/harness-detection/evidence.md` that backs this location. */
232
+ readonly research: string;
233
+ }
234
+ interface ManagedPolicyOptions {
235
+ /** Defaults to `process.platform`. */
236
+ readonly platform?: Platform;
237
+ /** Used for `%ProgramFiles%` / `%ProgramData%` on Windows. Defaults to `process.env`. */
238
+ readonly env?: Readonly<Record<string, string | undefined>>;
239
+ }
240
+ /**
241
+ * List where a harness keeps managed policy on the given platform, most authoritative first where
242
+ * the vendor documents an order. Server-side locations are included so a caller knows the local
243
+ * files are not the whole picture.
244
+ */
245
+ export declare function managedPolicyLocations(harness: HarnessId, options?: ManagedPolicyOptions): readonly ManagedPolicyLocation[];
246
+ //#endregion
247
+ //#region src/plugins/enabled-plugins.d.ts
248
+ /** The settings scope a plugin's enabled state came from. */
249
+ type PluginScope = 'managed' | 'local' | 'project' | 'user';
250
+ interface PluginEnablement {
251
+ /** The key the harness uses, `<plugin>@<marketplace>`. */
252
+ readonly id: string;
253
+ readonly enabled: boolean;
254
+ /** The scope whose value won. */
255
+ readonly scope: PluginScope;
256
+ /** The file the winning value was read from. */
257
+ readonly source: string;
258
+ }
259
+ interface EnabledPluginSource {
260
+ readonly scope: PluginScope;
261
+ readonly path: string;
262
+ /** `false` when the file does not exist. */
263
+ readonly found: boolean;
264
+ /** Set when the file exists but could not be parsed; its entries are then ignored. */
265
+ readonly error?: string;
266
+ }
267
+ interface EnabledPluginsResult {
268
+ readonly harness: HarnessId;
269
+ /** `false` when the harness keeps no readable record of enabled plugins. */
270
+ readonly supported: boolean;
271
+ /** Each plugin with an explicit entry, resolved across scopes. */
272
+ readonly plugins: readonly PluginEnablement[];
273
+ /** The files consulted, highest precedence first. */
274
+ readonly sources: readonly EnabledPluginSource[];
275
+ /**
276
+ * Sources that can also decide a plugin's state but that this package does not read, such as
277
+ * MDM or server-managed policy. When non-empty, `plugins` may not be the whole answer.
278
+ */
279
+ readonly unread: readonly string[];
280
+ /** The claim IDs in `.research/harness-detection/evidence.md` behind the resolution. */
281
+ readonly research: readonly string[];
282
+ }
283
+ interface EnabledPluginsOptions extends HarnessEnvironment {
284
+ /**
285
+ * Read the managed settings file from here instead of the harness's documented location.
286
+ * Useful when policy is staged elsewhere, and in tests.
287
+ */
288
+ readonly managedSettingsPath?: string;
289
+ }
290
+ /**
291
+ * Read which plugins a harness has enabled, from the settings files it keeps on disk.
292
+ *
293
+ * Only plugins with an explicit entry are reported; a plugin with no entry falls back to a
294
+ * harness- or plugin-defined default this package does not know. See `unread` for policy sources
295
+ * that may override what the files say.
296
+ */
297
+ export declare function enabledPlugins(harness: HarnessId, options?: EnabledPluginsOptions): Promise<EnabledPluginsResult>;
298
+ //#endregion
299
+ //#region src/plugins/installed-plugins.d.ts
300
+ interface InstalledPlugin {
301
+ /**
302
+ * `<plugin>@<marketplace>`, the key `enabledPlugins()` reports. A Copilot CLI direct install
303
+ * has no marketplace, so its id is the bare plugin name (E-COPILOT-P11).
304
+ */
305
+ readonly id: string;
306
+ /** The absolute folder the harness loads the plugin from. */
307
+ readonly path: string;
308
+ readonly version?: string;
309
+ /** The install scope, for harnesses that record one. */
310
+ readonly scope?: PluginScope;
311
+ /** The project a project- or local-scoped install belongs to. */
312
+ readonly projectPath?: string;
313
+ /** The claim IDs in `.research/harness-detection/evidence.md` behind this entry. */
314
+ readonly research: readonly string[];
315
+ }
316
+ interface InstalledPluginSource {
317
+ readonly path: string;
318
+ /** `false` when the file or folder does not exist. */
319
+ readonly found: boolean;
320
+ /** Set when it exists but could not be read; nothing is reported from it. */
321
+ readonly error?: string;
322
+ }
323
+ interface InstalledPluginsResult {
324
+ readonly harness: HarnessId;
325
+ /** `false` when this package has no verified install record for the harness. */
326
+ readonly supported: boolean;
327
+ /** One entry per install. Claude Code can install one plugin at several scopes. */
328
+ readonly plugins: readonly InstalledPlugin[];
329
+ /** The ids of installed plugins whose folder cannot be determined without guessing. */
330
+ readonly unresolved: readonly string[];
331
+ /** The files or folders consulted. */
332
+ readonly sources: readonly InstalledPluginSource[];
333
+ /** Installs the harness can load that this package does not read. */
334
+ readonly unread: readonly string[];
335
+ /** The claim IDs in `.research/harness-detection/evidence.md` behind the resolution. */
336
+ readonly research: readonly string[];
337
+ }
338
+ /**
339
+ * Map each plugin a harness has installed to the folder it is loaded from. Join the result with
340
+ * `enabledPlugins()` by `id` to find an enabled plugin's folder.
341
+ */
342
+ export declare function installedPlugins(harness: HarnessId, environment?: HarnessEnvironment): Promise<InstalledPluginsResult>;
343
+ //#endregion
344
+ //#region src/plugins/package-dependencies.d.ts
345
+ /**
346
+ * Includes `devDependencies` — a plugin can supply a project's testing or release workflow.
347
+ * Transitive dependencies are excluded: only what the manifest declares.
348
+ */
349
+ export declare function declaredDependencies(manifest: unknown): string[];
350
+ /**
351
+ * Anchored at the declaring manifest (required for pnpm's isolation), then falls back to a
352
+ * `node_modules` walk — an `exports` map without a `./package.json` entry blocks the first.
353
+ */
354
+ export declare function packageDir(pkg: string, fromManifest: string): string | undefined;
355
+ //#endregion
356
+ //#region src/plugins/plugin-dependencies.d.ts
357
+ /**
358
+ * Whether a harness lets a plugin declare other plugins it depends on. Only Claude Code does, via
359
+ * `dependencies` in `plugin.json` (E-CC-X1). The other harnesses' manifests have no such field
360
+ * (E-CUR-X1, E-CODEX-X1, E-COPILOT-X1, E-OC-X1, E-KILO-X1, E-GEM-P4, E-QWEN-P3, E-VSC-X1,
361
+ * E-CLINE-X1, E-CRUSH-X1, E-OH-X1, E-AUG-X1).
362
+ */
363
+ export declare function supportsPluginDependencies(harness: HarnessId): boolean;
364
+ //#endregion
365
+ //#region src/plugins/plugin-manifest.d.ts
366
+ /**
367
+ * Where a plugin keeps its manifest, relative to its root: the Agent Plugins `plugin.json` at the
368
+ * root (E-VSC-P2, E-COPILOT-P8), then each harness's own folder (E-CODEX-P4, E-CUR-P4, E-COPILOT-P8).
369
+ */
370
+ export declare const pluginManifestPaths: readonly string[];
371
+ /**
372
+ * The `name` in the first plugin manifest a folder holds, or `undefined` when it holds none: then
373
+ * the folder is not a plugin, whatever its `package.json` says.
374
+ */
375
+ export declare function pluginManifestName(root: string): string | undefined;
376
+ //#endregion
377
+ //#region src/plugins/plugin-storage.d.ts
378
+ /**
379
+ * - `plugin-cache`: installed plugin copies, one folder per marketplace, plugin, and version.
380
+ * - `installed-plugins`: installed plugin folders not split by version.
381
+ * - `local-plugins`: a folder the harness scans for plugins under development.
382
+ * - `marketplaces`: marketplace checkouts.
383
+ * - `install-record`: the file that records which plugins are installed.
384
+ * - `enabled-record`: the user-level file that records which plugins are enabled.
385
+ */
386
+ type PluginStorageKind = 'plugin-cache' | 'installed-plugins' | 'local-plugins' | 'marketplaces' | 'install-record' | 'enabled-record';
387
+ interface PluginStorageLocation {
388
+ readonly kind: PluginStorageKind;
389
+ readonly path: string;
390
+ readonly description: string;
391
+ /** The claim ID in `.research/harness-detection/evidence.md` that backs this location. */
392
+ readonly research: string;
393
+ }
394
+ interface PluginStorage {
395
+ readonly harness: HarnessId;
396
+ /** The harness's user-level config directory, after any override environment variable. */
397
+ readonly configDir: string;
398
+ readonly locations: readonly PluginStorageLocation[];
399
+ }
400
+ /**
401
+ * Where a harness keeps plugins at the user level. Paths are computed, not checked: a location may
402
+ * not exist until the first plugin is installed.
403
+ */
404
+ export declare function pluginStorage(harness: HarnessId, environment?: HarnessEnvironment): PluginStorage;
405
+ //#endregion
406
+ //#region src/references/load-reference.d.ts
407
+ /** `referenceLayers`' options, with the machine's own home directory, platform, and environment by default. */
408
+ type LoadReferenceOptions = Omit<ReferenceLayerOptions, 'home' | 'platform'> & {
409
+ home?: string | undefined;
410
+ platform?: Platform | undefined;
411
+ };
412
+ /**
413
+ * Resolves one reference for `root` the way `reference show` does, returning the full record: every
414
+ * field `show` prints with `--metadata` and `--trace`. A name that is not a reference name comes back
415
+ * `invalid`, and one no contribution answers `missing`; neither throws.
416
+ */
417
+ export declare function loadReference(name: string, options: LoadReferenceOptions): Promise<ResolvedReference>;
418
+ //#endregion
419
+ //#region src/references/reference-catalog.d.ts
420
+ /** One row per name. */
421
+ type ReferenceListRow = {
422
+ name: string;
423
+ description: string;
424
+ status: ReferenceStatus;
425
+ /** When `ambiguous`: each `<plugin>/<name>`, and each skill's default as `default of <skill>`. */
426
+ options?: string[];
427
+ };
428
+ /** One row per name per layer holding it, with the outcome that contribution gets. */
429
+ type ReferenceListLayerRow = {
430
+ name: string;
431
+ tier: ReferenceTier;
432
+ plugin?: string;
433
+ skill?: string;
434
+ path: string;
435
+ description: string;
436
+ outcome: string;
437
+ /** A contribution with `extends` and no body. */
438
+ selection?: boolean;
439
+ /** A skill's default: the `default` step reaches it when this skill loads the name. */
440
+ reachedBy?: string;
441
+ };
442
+ type ReferenceListing = {
443
+ references: ReferenceListRow[];
444
+ layers: ReferenceListLayerRow[];
445
+ /** Why some skills' defaults are not listed: no harness detected, or one whose skill folders are not verified. */
446
+ defaults?: string;
447
+ warnings: ReferenceWarning[];
448
+ };
449
+ type ListOptions = ResolveOptions & {
450
+ /** Keep only names matching this pattern: `*` stands for any run of characters, everything else is literal and case-sensitive. */
451
+ pattern?: string | undefined;
452
+ };
453
+ type Source$2 = ReferenceLayers | readonly ReferenceLayer[];
454
+ /**
455
+ * One row per name, with its description and, when not `found`, its status and options; and one row
456
+ * per name per layer holding it, and per installed skill holding a default of it. A name only skills'
457
+ * defaults hold resolves as the first such skill loads it. A `pattern` keeps only the names it matches exactly.
458
+ */
459
+ export declare function listReferences(source: Source$2, options?: ListOptions): ReferenceListing;
460
+ type MatchKind = 'name' | 'prefix' | 'close name' | 'description' | 'heading' | 'body';
461
+ type SearchMatch = {
462
+ name: string;
463
+ description: string;
464
+ match: MatchKind;
465
+ /** The tier of the highest contribution whose text the document holds. */
466
+ tier: ReferenceTier;
467
+ plugin?: string;
468
+ skill?: string;
469
+ /** A match found as this skill loads the name, its default joined. */
470
+ loadedBy?: string;
471
+ };
472
+ type ReferenceSearch = {
473
+ matches: SearchMatch[];
474
+ /** Why some skills' defaults are not searched: no harness detected, or one whose skill folders are not verified. */
475
+ defaults?: string;
476
+ };
477
+ /**
478
+ * Every name resolves the way `show` would, and each skill's default as its skill loads it; a name
479
+ * no extends orders is searched once per plugin, as the qualified name `show` would need, and a name
480
+ * a `remove` turned off is left out.
481
+ */
482
+ export declare function searchReferences(query: string, source: Source$2, options?: ResolveOptions): ReferenceSearch;
483
+ //#endregion
484
+ //#region src/references/reference-interface.d.ts
485
+ /** `one`: the implementation is named `<id>`. `many`: each is named `<id>.<key>`. */
486
+ type InterfaceCardinality = 'one' | 'many';
487
+ /** The machine-readable part of an interface document, read from its `interface:` frontmatter. */
488
+ type ReferenceInterface = {
489
+ id: string;
490
+ cardinality: InterfaceCardinality;
491
+ version: number;
492
+ /** The versions the owner's consumers accept; `[version]` when the document names none. */
493
+ versions: number[];
494
+ /** The implementation's top-level sections, in order. Every one is optional. Heading text is API. */
495
+ sections: string[];
496
+ };
497
+ /** One `implements:` value, `<id>@<version>`. */
498
+ type ImplementsEntry = {
499
+ id: string;
500
+ version: number;
501
+ };
502
+ type InterfaceCheck = 'interface found' | 'version' | 'name' | 'order' | 'interface' | 'compose';
503
+ type InterfaceCheckFailure = {
504
+ check: InterfaceCheck;
505
+ /** The interface id the failure is about, when the document names one. */
506
+ interface?: string;
507
+ message: string;
508
+ };
509
+ //#endregion
510
+ //#region src/references/reference-check.d.ts
511
+ type ReferenceCheckKind = 'interface' | 'implementation' | 'none';
512
+ /** A failed check, named by the check; a name not `found` fails with its status code. */
513
+ type ReferenceCheckFailure = {
514
+ check: InterfaceCheck | ReferenceCode;
515
+ /** The interface id the failure is about, when the document names one. */
516
+ interface?: string;
517
+ message: string;
518
+ };
519
+ type ReferenceCheckEntry = {
520
+ name: string;
521
+ kind: ReferenceCheckKind;
522
+ /** `passed` and `failed` are about the composed document; the others mean none was composed. */
523
+ status: 'passed' | 'failed' | 'missing' | 'ambiguous' | 'invalid';
524
+ failures: ReferenceCheckFailure[];
525
+ /** For an implementation: the listed sections it marks `**Unsupported.**` or leaves out. */
526
+ unsupported: string[];
527
+ /** Checked as this skill loads the name, its default joined. */
528
+ loadedBy?: string;
529
+ };
530
+ type CheckOptions = ResolveOptions & {
531
+ /** The references to check; every interface document and implementation found when omitted. */
532
+ names?: readonly string[] | undefined;
533
+ };
534
+ type Source$1 = ReferenceLayers | readonly ReferenceLayer[];
535
+ /**
536
+ * Checks each named reference, or, with no names, every interface document and implementation found.
537
+ * A name several plugins hold is also checked as each `<plugin>/<name>`, so each author sees their own
538
+ * result, and each skill's default as its skill loads it.
539
+ */
540
+ export declare function checkReferences(source: Source$1, options?: CheckOptions): ReferenceCheckEntry[];
541
+ //#endregion
542
+ //#region src/references/reference-implementations.d.ts
543
+ type ReferenceImplementation = {
544
+ /** What a consumer loads: the name as it resolved, `<plugin>/<name>` when no extends orders the plugins holding it. */
545
+ pin: string;
546
+ description: string;
547
+ /** The listed sections it marks `**Unsupported.**` or leaves out, in the interface's order. */
548
+ unsupported: string[];
549
+ name: string;
550
+ /** The tier of the highest contribution whose text it holds. */
551
+ tier: ReferenceTier;
552
+ version: number;
553
+ };
554
+ type ExcludedImplementation = {
555
+ name: string;
556
+ reasons: string[];
557
+ };
558
+ type ReferenceImplementations = {
559
+ interface: string;
560
+ cardinality: InterfaceCardinality;
561
+ /** The versions an implementation must declare to be listed. */
562
+ accept: number[];
563
+ implementations: ReferenceImplementation[];
564
+ excluded: ExcludedImplementation[];
565
+ warnings: ReferenceWarning[];
566
+ };
567
+ type ImplementationsOptions = ResolveOptions & {
568
+ /** The versions the consumer knows; the interface's own `versions` when omitted. */
569
+ accept?: readonly number[] | undefined;
570
+ };
571
+ type Source = ReferenceLayers | readonly ReferenceLayer[];
572
+ /**
573
+ * The implementations of interface `id` a consumer may load, each checked as `check` would on its
574
+ * composed document, and every candidate left out with why. A candidate is a name in the interface's
575
+ * namespace (`<id>` or `<id>.<key>`) or a reference that declares `implements: <id>@<n>`. A skill's
576
+ * default is never listed: it has no qualified name to pin. An unknown interface throws.
577
+ */
578
+ export declare function referenceImplementations(id: string, source: Source, options?: ImplementationsOptions): ReferenceImplementations;
579
+ //#endregion
580
+ //#region src/references/reference-where.d.ts
581
+ /** A file a customization or a selection of the name is written to. */
582
+ type ReferenceWherePlace = {
583
+ scope: 'project' | 'user';
584
+ /** The project path is relative to the root; the user path is shown as the command displays it. */
585
+ path: string;
586
+ reaches: string;
587
+ /** `used`, `shadowed by ...`, or `not used (...)` when the file exists; `empty` when it does not. */
588
+ status: string;
589
+ /** The heading paths of the document below it, which a section operation can target. */
590
+ sections: string[];
591
+ };
592
+ type ReferenceWhereReport = {
593
+ name: string;
594
+ status: ReferenceStatus;
595
+ places: ReferenceWherePlace[];
596
+ /** When `ambiguous`: the options a selection written to a place chooses between. */
597
+ options?: string[];
598
+ /** Every layer checked, highest first; a plugin's or a default contribution is read-only. */
599
+ layers: ReferenceTraceLayer[];
600
+ warnings: ReferenceWarning[];
601
+ };
602
+ type WhereOptions = {
603
+ /** Absolute; a project write goes to its `.agents/references/`, and a project path is shown relative to it. */
604
+ root: string;
605
+ /** How a path outside the project is shown, such as with the home directory collapsed to `~`. */
606
+ display?: ((path: string) => string) | undefined;
607
+ };
608
+ /** The project and user files a customization of `name` is written to, with the document below each. */
609
+ export declare function whereReference(input: string | ReferenceName, source: ReferenceLayers | readonly ReferenceLayer[], { root, display }: WhereOptions): ReferenceWhereReport;
610
+ //#endregion
611
+ //#region src/skills/harness-skill-folders.d.ts
612
+ /**
613
+ * The harnesses whose skill folders are verified: project, user, machine-wide admin, and plugin
614
+ * skills (`.research/skill-resolution`, `.research/machine-wide-content`). Any other harness reads
615
+ * folders this library does not know, so its skills' defaults are not listed.
616
+ */
617
+ export declare const skillFoldersVerified: readonly HarnessId[];
618
+ type Env = Readonly<Record<string, string | undefined>>;
619
+ type SkillFolderOptions = {
620
+ /** The project folders, nearest first, up to the repository root. */
621
+ chain: readonly string[];
622
+ home: string;
623
+ platform: Platform;
624
+ env?: Env | undefined;
625
+ };
626
+ /**
627
+ * The machine-wide admin skill folders: Claude Code's enterprise `<managed dir>/.claude/skills`
628
+ * (E-MW-CC-2), Codex's ADMIN scope `/etc/codex/skills` (E-MW-CODEX-1; its Windows folder is
629
+ * inferred, so it is left out), and OpenCode's `skill` and `skills` under its system folder
630
+ * (E-MW-OC-1, E-MW-OC-2).
631
+ */
632
+ export declare function adminSkillFolders(harness: HarnessId, platform: Platform, env?: Env): string[];
633
+ /**
634
+ * The project, user, and admin folders a harness reads skills from, each holding skill folders one
635
+ * level down; `undefined` when the harness's skill folders are not verified.
636
+ */
637
+ export declare function harnessSkillFolders(harness: HarnessId, { chain, home, platform, env }: SkillFolderOptions): string[] | undefined;
638
+ /**
639
+ * The folders a plugin's skills sit in: `skills/` under its root, and what a manifest `skills` field
640
+ * lists, which adds to `skills/` in Claude Code (E-SR-CC-1) and replaces it in Cursor, Codex, and
641
+ * Copilot CLI (E-SR-CUR-2, E-SR-CODEX-2, E-SR-COPILOT-2). Gemini CLI has no such field (E-SR-GEM-1),
642
+ * and OpenCode plugins ship no skills (E-SR-OC-3). A root holding `SKILL.md` is itself a skill
643
+ * (E-SR-CC-1, E-SR-CUR-1); the caller checks the root.
644
+ */
645
+ export declare function pluginSkillFolders(harness: HarnessId, root: string): string[];
646
+ //#endregion
647
+ //#region src/skills/skill-invocation.d.ts
648
+ interface PluginSkill {
649
+ /** The plugin's `name`. */
650
+ readonly plugin: string;
651
+ /** The skill's frontmatter `name`, which every harness uses as the skill segment. */
652
+ readonly skill: string;
653
+ }
654
+ interface SkillInvocation {
655
+ /** What a user types to invoke the skill: a slash command, or for Codex a `$` mention. */
656
+ readonly text: string;
657
+ /** Whether the text names the plugin, so same-named skills from two plugins stay distinct. */
658
+ readonly namespaced: boolean;
659
+ /**
660
+ * The claim ID that backs this form, in `.research/harness-detection/evidence.md`, or in
661
+ * `.research/skill-resolution/evidence.md` for an `E-SR-` ID.
662
+ */
663
+ readonly research: string;
664
+ }
665
+ /**
666
+ * How a user invokes a plugin's skill in a harness.
667
+ *
668
+ * Claude Code, Codex, and Copilot in VS Code namespace by plugin; elsewhere two plugins' skills with
669
+ * the same name collide. Codex names a plugin skill `<plugin>:<skill>`, and its `$` mention takes the
670
+ * whole name (E-SR-CODEX-5, E-SR-CODEX-18). Copilot CLI lists `<plugin>:<skill>` only while two
671
+ * enabled plugins share the name (E-SR-COPILOT-8); whether that form can be typed is not verified,
672
+ * so it returns the bare `/<skill>`.
673
+ *
674
+ * Kilo Code returns `/<skill>` in both the CLI and the VS Code extension; when a custom command or
675
+ * MCP prompt has the same name, the skill is typed `/<skill>:skill` instead (E-KILO-S3).
676
+ *
677
+ * OpenCode returns `/<skill>` too, but when a built-in (`init`, `review`), config command, or MCP
678
+ * prompt has the same name, that one wins and the skill has no command (E-OC-S3).
679
+ *
680
+ * Returns `undefined` for Gemini CLI, Qwen Code, and Crush, which document no typed form: the model
681
+ * loads a skill through a tool call when its description matches the task (E-GEM-S2, E-QWEN-S1,
682
+ * E-CRUSH-S1). Crush can also list a skill in its command
683
+ * palette, which is picked, not typed (E-CRUSH-S2). OpenHands triggers skills from the model too;
684
+ * only a plugin's commands take a `/<plugin>:<command>` form (E-OH-S2, E-OH-S3).
685
+ *
686
+ * Also returns `undefined` for the Auggie CLI: a plugin skill's internal name is `<plugin>:<skill>`,
687
+ * but what the user types for it is not confirmed (E-AUG-S3).
688
+ */
689
+ export declare function skillInvocation(harness: HarnessId, { plugin, skill }: PluginSkill): SkillInvocation | undefined;
690
+ //#endregion
691
+ //#region src/skills/skills-directories.d.ts
692
+ interface SkillsDirectories {
693
+ /** Directories relative to the project root, in the order the source lists them. */
694
+ readonly project: readonly string[];
695
+ /** Directories relative to the home directory, in the order the source lists them. */
696
+ readonly user: readonly string[];
697
+ /**
698
+ * The claim IDs that back these directories, in `.research/harness-detection/evidence.md`, or in
699
+ * `.research/skill-resolution/evidence.md` for an `E-SR-` ID.
700
+ */
701
+ readonly research: readonly string[];
702
+ /**
703
+ * Set when an environment variable moves the user directories: when it names a folder other than
704
+ * the default, `user` is not read, and `<that folder>/<skills>` is read instead.
705
+ */
706
+ readonly relocatedBy?: {
707
+ readonly variable: string;
708
+ readonly skills: string;
709
+ };
710
+ }
711
+ /**
712
+ * The directories a harness reads skills from, as its vendor documents them.
713
+ *
714
+ * Lists project and user directories read by default. Admin, bundled, and plugin skills are left
715
+ * out. Copilot CLI reads its user directories only while `COPILOT_HOME` is the default `~/.copilot`;
716
+ * set elsewhere, it reads `$COPILOT_HOME/skills` instead (`relocatedBy`, E-SR-COPILOT-9). Cline's `.agents/skills` rests on its source, which its docs do not yet name (E-CLINE-S3).
717
+ *
718
+ * Returns `undefined` where the directories are not confirmed: Qwen Code, whose source names the
719
+ * `.agents` root but not the directory under it (E-QWEN-S1); and Crush and OpenHands, where no
720
+ * directory is recorded.
721
+ */
722
+ export declare function skillsDirectories(harness: HarnessId): SkillsDirectories | undefined;
723
+ //#endregion
724
+ export { type AmbiguousCause, type CheckOptions, type CheckPluginDependenciesOptions, type CheckedDependency, type DependencyState, type DetectHarnessOptions, type EnabledPluginSource, type EnabledPluginsOptions, type EnabledPluginsResult, type ExcludedImplementation, type ExtendsStep, type FoundSkill, type HarnessDetectionResult, type HarnessEnvironment, type HarnessEvidence, type HarnessId, type HeadlessCommand, type HeadlessCommandOptions, type HeadlessExitCode, type HeadlessInvocation, type HeadlessMode, type HeadlessOutputFormat, type HeadlessPermission, type HeadlessTranscript, type HeadlessUnavailable, type HeadlessUsage, type ImplementationsOptions, type ImplementsEntry, type InstalledPlugin, type InstalledPluginSource, type InstalledPluginsResult, type InterfaceCardinality, type InterfaceCheck, type InterfaceCheckFailure, type ListOptions, type LoadReferenceOptions, type ManagedPolicyKind, type ManagedPolicyLocation, type ManagedPolicyOptions, type MatchKind, type MergeOperation, type OperationSource, type Platform, type PluginDependenciesRead, type PluginDependency, type PluginDependencyCheck, type PluginEnablement, type PluginScope, type PluginSkill, type PluginStorage, type PluginStorageKind, type PluginStorageLocation, type ReferenceCheckEntry, type ReferenceCheckFailure, type ReferenceCheckKind, type ReferenceCode, type ReferenceImplementation, type ReferenceImplementations, type ReferenceInterface, type ReferenceLayer, type ReferenceLayerOptions, type ReferenceLayers, type ReferenceListLayerRow, type ReferenceListRow, type ReferenceListing, type ReferenceName, type ReferencePlugin, type ReferenceSearch, type ReferenceStatus, type ReferenceTier, type ReferenceTrace, type ReferenceTraceContribution, type ReferenceTraceLayer, type ReferenceTraceSection, type ReferenceWarning, type ReferenceWarningCode, type ReferenceWherePlace, type ReferenceWhereReport, type ResolveOptions, type ResolvedReference, type SearchMatch, type SectionSource, type SkillDefaults, type SkillFolderOptions, type SkillInvocation, type SkillsDirectories, type WhereOptions, defaultLayer, harnessIds, parseReferenceName, projectReferencesDir, referenceLayers, referenceNames, resolveReference, skillName, skillsIn, userReferencesDir };