cyber-agentkit 1.2.0 → 2.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.
@@ -1,246 +0,0 @@
1
- import { t as HarnessId } from "./harness-id-BgKL-x6C.js";
2
- //#region src/harness/platform.d.ts
3
- /**
4
- * An operating-system platform, spelled as `process.platform` reports it.
5
- *
6
- * The queries branch on `darwin`, `linux`, and `win32`; every other platform follows the POSIX
7
- * (`linux`) layout. The union lists every value Node.js reports, so `process.platform` is assignable
8
- * to it, but it is declared here rather than as `NodeJS.Platform` so the published types do not
9
- * depend on `@types/node`.
10
- */
11
- type Platform = 'aix' | 'android' | 'cygwin' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'netbsd' | 'openbsd' | 'sunos' | 'win32';
12
- //#endregion
13
- //#region src/skills/skill-folder.d.ts
14
- /**
15
- * The `name` in a skill folder's `SKILL.md`, else the folder's own name; `undefined` when the folder
16
- * holds no `SKILL.md`. A package manager may link a skill under another folder name, such as pnpm's
17
- * `pnpm-<package>-<skill>` (E-PM-PNPM-4), so the folder name is only a fallback.
18
- */
19
- declare function skillName(folder: string): string | undefined;
20
- type FoundSkill = {
21
- /** The `name` its `SKILL.md` gives. */
22
- name: string;
23
- /** The folder, with symlinks resolved. */
24
- folder: string;
25
- };
26
- /**
27
- * The skills in each folder: the folder itself when it holds a `SKILL.md`, else each skill directly
28
- * under it, one level deep. A symlinked skill folder is followed, since pnpm and `npx skills` link
29
- * skills rather than copy them (E-PM-SK-2, E-PM-SK-7); one real folder reached twice is listed once.
30
- */
31
- declare function skillsIn(folders: readonly string[]): FoundSkill[];
32
- //#endregion
33
- //#region src/references/reference-warning.d.ts
34
- /**
35
- * A fault that never stops a name from resolving. The `code` is stable; the `message` is for a
36
- * person and is not a contract.
37
- */
38
- type ReferenceWarning = {
39
- code: ReferenceWarningCode;
40
- message: string;
41
- };
42
- type ReferenceWarningCode = 'frontmatter-invalid' | 'merge-unknown' | 'marker-unknown' | 'marker-unmatched' | 'heading-repeated' | 'remove-body-ignored' | 'extends-invalid' | 'extends-self' | 'extends-step-missing' | 'extends-all-missing' | 'extends-not-used' | 'default-not-selected' | 'default-folder-missing' | 'default-in-tier' | 'file-ignored' | 'format-mismatch' | 'selection-invalid' | 'interface-not-composed' | 'interface-check';
43
- /** The code of a name that is not `found`. */
44
- type ReferenceCode = 'reference-missing' | 'reference-ambiguous' | 'reference-invalid';
45
- //#endregion
46
- //#region src/references/reference-layers.d.ts
47
- /** Where a contribution lives. Listed highest first; the stack (plugins and `default`) is ordered by `extends`. */
48
- type ReferenceTier = 'managed' | 'project' | 'user' | 'plugin' | 'default';
49
- type ReferenceLayer = {
50
- tier: ReferenceTier;
51
- /** The folder read for contributions. */
52
- dir: string;
53
- /** The plugin tier: the plugin's manifest `name`, which a qualified `<plugin>/<name>` uses. */
54
- plugin?: string | undefined;
55
- /** The default tier: the skill's `SKILL.md` `name`. */
56
- skill?: string | undefined;
57
- /** Set when the layer is never read, and why: policy held in MDM, a plugin with no install folder. */
58
- skipped?: string | undefined;
59
- /**
60
- * An `assets/` layer: a file is `<name>.<ext>` with no `.default` marker, read as written. Nothing in it
61
- * merges or extends; the highest layer holding the name answers whole.
62
- */
63
- whole?: boolean | undefined;
64
- /** Raised on every name resolved through this layer, such as a `--default` folder that does not exist. */
65
- warning?: ReferenceWarning | undefined;
66
- };
67
- type ReferenceFolder = 'references' | 'assets';
68
- type ReferenceLayerOptions = {
69
- root: string;
70
- home: string;
71
- platform: Platform;
72
- /**
73
- * The plugin running the resolver. Its `references/` is the first plugin layer, and its install,
74
- * when a harness has it enabled, is not read a second time.
75
- */
76
- plugin?: ReferencePlugin | undefined;
77
- /** The calling skill's folder: its `references/<name>.default.md` forms the `default` tier. */
78
- defaultSkill?: string | undefined;
79
- /** The folder every tier reads: `references` (the default), or `assets` for an assets call. */
80
- folder?: ReferenceFolder | undefined;
81
- /** Detects the harness and reads its settings. Defaults to `process.env`. */
82
- env?: Readonly<Record<string, string | undefined>>;
83
- };
84
- type ReferencePlugin = {
85
- /** Its manifest `name`, which a qualified `<plugin>/<name>` uses. */
86
- name: string;
87
- /** The plugin root, which holds its `references/`. */
88
- root: string;
89
- };
90
- type ReferenceLayers = {
91
- /** Highest first: managed, project (nearest first), user, plugin, default. */
92
- layers: ReferenceLayer[];
93
- /** The harnesses detected, whose managed folders and enabled plugins were read. */
94
- harnesses: readonly HarnessId[];
95
- /** The installed skills that hold a default, which `list`, `search`, and `check` reach. */
96
- skills?: SkillDefaults | undefined;
97
- };
98
- /** The installed skills holding a default contribution, found in the skill folders the detected harnesses read. */
99
- type SkillDefaults = {
100
- skills: FoundSkill[];
101
- /** Why some skills' defaults are not listed: no harness detected, or one whose skill folders are not verified. */
102
- unverified?: string | undefined;
103
- };
104
- declare function projectReferencesDir(root: string): string;
105
- declare function userReferencesDir(home: string): string;
106
- /** The `default` tier for the skill at `folder`; a folder that does not exist warns and adds no contribution. */
107
- declare function defaultLayer(folder: string): ReferenceLayer;
108
- declare function referenceLayers({ root, home, platform, plugin, defaultSkill, folder, env }: ReferenceLayerOptions): Promise<ReferenceLayers>;
109
- //#endregion
110
- //#region src/references/reference-document.d.ts
111
- /**
112
- * How a contribution applies over what is below it. `replace` puts it in place of everything below;
113
- * `patch` keeps what is below and puts each section's text in place of the text it matches;
114
- * `combine` keeps what is below and adds each section's text after the text it matches; `remove`
115
- * drops what is below.
116
- */
117
- type MergeOperation = 'replace' | 'patch' | 'combine' | 'remove';
118
- /** Which contribution supplied a section's text, and how. */
119
- type SectionSource = {
120
- contribution: string;
121
- operation: MergeOperation;
122
- };
123
- //#endregion
124
- //#region src/references/reference-format.d.ts
125
- /** The format of a reference file: `markdown`, or the extension of a data file. */
126
- type ReferenceFormat = 'markdown' | 'json' | 'yaml' | 'toml' | 'txt';
127
- //#endregion
128
- //#region src/references/reference-name.d.ts
129
- type ReferenceName = {
130
- /** As asked. */
131
- raw: string;
132
- /** The bare name. */
133
- name: string;
134
- /** The plugin a qualified `<plugin>/<name>` asks for, by its manifest's `name`. */
135
- plugin?: string | undefined;
136
- /** Why the value is not a reference name. Set only on an invalid one; nothing is read for it. */
137
- invalid?: string | undefined;
138
- };
139
- /**
140
- * Rejects rather than sanitizes — silently answering a different question is how untrusted input
141
- * reads a file outside a layer. The plugin qualifier is only ever compared with plugin names, never
142
- * joined into a path. A bad name comes back `invalid`, never thrown, so the other names still resolve.
143
- */
144
- declare function parseReferenceName(value: string): ReferenceName;
145
- //#endregion
146
- //#region src/references/resolve-reference.d.ts
147
- type ReferenceStatus = 'found' | 'missing' | 'ambiguous' | 'invalid';
148
- /** Why an ambiguous name's contributions cannot be put in one order. */
149
- type AmbiguousCause = 'unordered' | 'cycle' | 'repeat';
150
- /** Where a contribution's operation came from: its own `merge`, a step's key, or the default `patch`. */
151
- type OperationSource = 'contribution' | 'step' | 'default';
152
- /** One layer checked, as the trace reports it. */
153
- type ReferenceTraceLayer = {
154
- tier: ReferenceTier;
155
- plugin?: string;
156
- skill?: string;
157
- /** The file matched, or the folder checked when none matched. */
158
- path: string;
159
- /** The file that answered, relative to the folder: `<name>.md`, `<name>/README.md`, `<name>.default.md`, or the same with a data extension. */
160
- file?: string;
161
- /** Its frontmatter as written. */
162
- frontmatter?: Record<string, unknown>;
163
- operation?: MergeOperation;
164
- operationFrom?: OperationSource;
165
- /** `used`; `shadowed by ...`; `not used (...)`; `not read (...)`; `ambiguous`; or `missing`. */
166
- outcome: string;
167
- /** Set when its `extends` was written but did not build the stack, and why. */
168
- extendsOutcome?: string;
169
- description?: string;
170
- /** A contribution with `extends` and no body: it picks the stack and changes nothing else. */
171
- selection?: boolean;
172
- /** A contribution with no body, which changes nothing unless it is a `remove`. */
173
- empty?: boolean;
174
- };
175
- type ReferenceTraceContribution = {
176
- tier: ReferenceTier;
177
- plugin?: string;
178
- skill?: string;
179
- path: string;
180
- operation: MergeOperation;
181
- };
182
- type ReferenceTraceSection = {
183
- /** The heading path, such as `Review > Checklist`. */
184
- path: string;
185
- /** The contributions that supplied its text, bottom first, each with the operation it applied. */
186
- contributions: SectionSource[];
187
- /** Set on a section a `remove` dropped: the contribution that dropped it. */
188
- removedBy?: string;
189
- };
190
- type ReferenceTrace = {
191
- /** The plugins and `default` the name builds on, bottom first. */
192
- stack: string[];
193
- /** What built the stack: the contribution whose `extends` was used, a plugin's own `extends`, or `none`. */
194
- builtBy: string;
195
- /** The contributions whose text the document holds, bottom first. */
196
- contributions: ReferenceTraceContribution[];
197
- sections: ReferenceTraceSection[];
198
- /** Every layer checked, highest first. */
199
- layers: ReferenceTraceLayer[];
200
- /** The harnesses detected, whose managed folders and enabled plugins were read. */
201
- harnesses: string[];
202
- };
203
- /** A name resolved, with every field: the command prints a subset. A bad name is a status, never thrown. */
204
- type ResolvedReference = {
205
- name: string;
206
- status: ReferenceStatus;
207
- /** Set when not `found`. */
208
- code?: ReferenceCode;
209
- /** Why it is not `found`, for a person. */
210
- message?: string;
211
- content?: string;
212
- /** Set when `found`: `markdown`, or the format of the data file that answered whole. */
213
- format?: ReferenceFormat;
214
- /** The composed frontmatter, key by key with the higher contribution winning, without `merge` and `extends`. */
215
- metadata?: Record<string, unknown>;
216
- /** When `ambiguous`: each `<plugin>/<name>`, and `default` when the skill has one. */
217
- options?: string[];
218
- cause?: AmbiguousCause;
219
- /** When a `remove` turned the name off: that contribution. */
220
- removedBy?: string;
221
- warnings: ReferenceWarning[];
222
- trace: ReferenceTrace;
223
- };
224
- type ResolveOptions = {
225
- /** How a path is shown in a label or a warning — the command collapses the home directory. */
226
- display?: (path: string) => string;
227
- /** A file read as absent, so `delete --dry-run` can report what answers once it is gone. */
228
- without?: string | undefined;
229
- /** Read only the layers below this folder, so `where` can report the document below a file it would write. */
230
- below?: string | undefined;
231
- };
232
- /** One `extends` entry: a plugin or `default`, with the keys to use for it in place of its own. */
233
- type ExtendsStep = {
234
- target: string;
235
- merge?: MergeOperation;
236
- extends?: ExtendsStep[];
237
- };
238
- type Source = ReferenceLayers | readonly ReferenceLayer[];
239
- /**
240
- * Resolves one name: reads each layer, puts the contributions in one order (the stack under the
241
- * user, project, and managed tiers), and composes them bottom first, each with its operation.
242
- */
243
- declare function resolveReference(input: string | ReferenceName, source: Source, { display, without, below }?: ResolveOptions): ResolvedReference;
244
- declare function referenceNames(source: Source): string[];
245
- //#endregion
246
- export { FoundSkill as A, defaultLayer as C, ReferenceCode as D, userReferencesDir as E, skillsIn as M, Platform as N, ReferenceWarning as O, SkillDefaults as S, referenceLayers as T, ReferenceLayer as _, ReferenceTrace as a, ReferencePlugin as b, ReferenceTraceSection as c, referenceNames as d, resolveReference as f, SectionSource as g, MergeOperation as h, ReferenceStatus as i, skillName as j, ReferenceWarningCode as k, ResolveOptions as l, parseReferenceName as m, ExtendsStep as n, ReferenceTraceContribution as o, ReferenceName as p, OperationSource as r, ReferenceTraceLayer as s, AmbiguousCause as t, ResolvedReference as u, ReferenceLayerOptions as v, projectReferencesDir as w, ReferenceTier as x, ReferenceLayers as y };