@ckeditor/ckeditor5-dev-agents 0.0.1 → 62.4.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,44 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { Finding, Target, TaskInstance, TaskSummary } from "../types.js";
6
+ export type RunTaskOptions = {
7
+ instance: TaskInstance;
8
+ target: Target;
9
+ /**
10
+ * An absolute path to the target root.
11
+ */
12
+ root: string;
13
+ /**
14
+ * The base branch, used in the links of the report.
15
+ */
16
+ branch: string;
17
+ /**
18
+ * The date recorded in new findings and fixes, for example `2026-09-28`.
19
+ */
20
+ today: string;
21
+ /**
22
+ * Whether findings fixed in an earlier report pull request are dropped. They are when a published run starts
23
+ * a new report branch, because the previous pull request was already reviewed.
24
+ */
25
+ pruneFixed: boolean;
26
+ /**
27
+ * Receives the progress of the run, the tool calls of the agent, and the messages of `log()` in the hooks.
28
+ */
29
+ log: (message: string) => void;
30
+ };
31
+ export type RunTaskResult = {
32
+ summary: TaskSummary;
33
+ /**
34
+ * Absolute paths of the files changed by kept fixes.
35
+ */
36
+ files: Array<string>;
37
+ open: Array<Finding>;
38
+ };
39
+ /**
40
+ * Judges a bounded batch, applies verified fixes, and writes the state for the caller to publish.
41
+ * Failed units and discarded fixes keep their previous baseline so the next run retries them.
42
+ * Existing open findings remain until a human resolves them or a new report prunes reviewed fixes.
43
+ */
44
+ export declare function runTask(runOptions: RunTaskOptions): Promise<RunTaskResult>;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { Finding, Task, TaskUnit } from "../types.js";
6
+ /**
7
+ * Returns the identity of a finding. Two findings with the same fingerprint are the same claim,
8
+ * so the harness reports it only once.
9
+ */
10
+ export declare function getFingerprint({ task, unit, ruleId, discriminator }: Pick<Finding, "task" | "unit" | "ruleId" | "discriminator">): string;
11
+ /**
12
+ * Returns the full digest of a fingerprint. Its first 12 characters are the `id` of the finding. Longer prefixes
13
+ * resolve collisions between IDs.
14
+ */
15
+ export declare function getFindingId(fingerprint: string): string;
16
+ /**
17
+ * Checks what `judge()` returned and turns it into findings the harness can store.
18
+ * It throws when anything is malformed, because a judge that half-worked must not advance the baseline.
19
+ */
20
+ export declare function validateFindings(findings: unknown, { task, unit, fragment }: {
21
+ task: Pick<Task, "id" | "ruleIds">;
22
+ unit: TaskUnit;
23
+ fragment: string;
24
+ }): Array<Finding>;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import { type TaskResult } from "./runner/runtarget.js";
6
+ export type RunTasksOptions = {
7
+ /**
8
+ * An absolute path to the directory with `tasks/` and `targets/`.
9
+ */
10
+ configPath: string;
11
+ /**
12
+ * An absolute path to a directory inside the checkout to run in. The checkout is prepared by the caller: cloned,
13
+ * with the dependencies installed, and with the base branch checked out.
14
+ */
15
+ cwd: string;
16
+ /**
17
+ * The targets to run. When empty, every target whose `slug` matches the `origin` of the checkout.
18
+ */
19
+ targets: Array<string>;
20
+ /**
21
+ * The tasks to run. When empty, the tasks each target enables.
22
+ */
23
+ tasks: Array<string>;
24
+ /**
25
+ * Set for a published run: a GitHub token that can open pull requests and comment on them in every target.
26
+ * The run commits and pushes the state and the fixes, and opens or updates the report pull requests. Without it,
27
+ * everything stays in the working tree. Pushing uses the credentials of the checkout.
28
+ */
29
+ token?: string;
30
+ author: {
31
+ name: string;
32
+ email: string;
33
+ };
34
+ /**
35
+ * Linked from the comments of published runs.
36
+ */
37
+ buildUrl?: string;
38
+ /**
39
+ * Receives the progress of the run, the tool calls of the agent, and the messages of `log()` in the hooks.
40
+ * Default: `console.log`. The final summary is returned in the result instead.
41
+ */
42
+ log?: (message: string) => void;
43
+ };
44
+ export type TargetResult = {
45
+ target: string;
46
+ branch: string;
47
+ publish: boolean;
48
+ /**
49
+ * Empty when the target has no enabled tasks.
50
+ */
51
+ results: Array<TaskResult>;
52
+ error?: string;
53
+ };
54
+ /**
55
+ * Runs the tasks against the targets in the checkout. The result is not `ok` when a task or a unit failed. Findings
56
+ * never make a run fail.
57
+ */
58
+ export declare function runTasks(options: RunTasksOptions): Promise<{
59
+ ok: boolean;
60
+ targets: Array<TargetResult>;
61
+ }>;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { Decision, Finding, PriorDecision } from "../types.js";
6
+ /**
7
+ * Loads every decision file (`*.yml`) from the directory. A file that cannot be used does not stop
8
+ * the run. It is skipped and reported as a warning, so the finding it was meant to reject is reported again.
9
+ */
10
+ export declare function loadDecisions(decisionsPath: string): Promise<{
11
+ decisions: Array<Decision>;
12
+ warnings: Array<string>;
13
+ }>;
14
+ /**
15
+ * Returns the decisions about the same claim as the finding: the same unit, rule and discriminator.
16
+ */
17
+ export declare function findDecisions(decisions: Array<Decision>, finding: Pick<Finding, "unit" | "ruleId" | "discriminator">): Array<Decision>;
18
+ /**
19
+ * Returns the decisions about the unit, each marked as expired or not. The harness hands them to `judge()`,
20
+ * so a model reads the human reasoning, including the reasoning about content that has changed since.
21
+ */
22
+ export declare function getPriorDecisions(decisions: Array<Decision>, unitKey: string, fragment: string): Array<PriorDecision>;
23
+ /**
24
+ * Renders the decision file that rejects the finding.
25
+ */
26
+ export declare function renderDecision(finding: Finding, reason: string): string;
27
+ /**
28
+ * Returns a readable file name, without the extension, for the decision about the finding, for example
29
+ * `b2-docs-features-tables`.
30
+ */
31
+ export declare function getDecisionFileName({ ruleId, unit, discriminator }: Pick<Finding, "ruleId" | "unit" | "discriminator">): string;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { Decision, Finding } from "../types.js";
6
+ export type TaskState = {
7
+ baseline: Record<string, string>;
8
+ open: Array<Finding>;
9
+ decisions: Array<Decision>;
10
+ warnings: Array<string>;
11
+ };
12
+ /**
13
+ * Reads the state of one task: `baseline.json`, `open.json` and `decisions/*.yml`. Missing files mean
14
+ * an empty state, which is what the first run of a task sees.
15
+ */
16
+ export declare function readTaskState(taskStatePath: string): Promise<TaskState>;
17
+ /**
18
+ * Writes the state of one task. Keys and findings are sorted, so the diff shows only what really changed.
19
+ */
20
+ export declare function writeTaskState(taskStatePath: string, { baseline, open, report }: {
21
+ baseline: Record<string, string>;
22
+ open: Array<Finding>;
23
+ report: string;
24
+ }): Promise<void>;
@@ -0,0 +1,443 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ export type JsonSchema = Record<string, unknown>;
6
+ /**
7
+ * A unit of work of a task, for example one guide or one dependency.
8
+ */
9
+ export type TaskUnit = {
10
+ /**
11
+ * The identity of the unit. It must be unique within the task and stable between runs.
12
+ */
13
+ key: string;
14
+ /**
15
+ * A path relative to the target root. When set, reports link to the file.
16
+ */
17
+ path?: string;
18
+ [key: string]: unknown;
19
+ };
20
+ /**
21
+ * A unit of a task that works on files. Its path is also its key.
22
+ */
23
+ export type FileUnit = TaskUnit & {
24
+ path: string;
25
+ };
26
+ /**
27
+ * What `judge()` returns for every problem it finds.
28
+ */
29
+ export type FindingInput = {
30
+ /**
31
+ * One of the task `ruleIds`.
32
+ */
33
+ ruleId: string;
34
+ /**
35
+ * A short explanation of what is wrong, written for the person who reviews it.
36
+ */
37
+ detail: string;
38
+ /**
39
+ * Tells apart findings of the same rule in the same unit, for example a heading.
40
+ */
41
+ discriminator?: string;
42
+ [key: string]: unknown;
43
+ };
44
+ /**
45
+ * A finding as the harness stores it in `open.json`.
46
+ */
47
+ export type Finding = {
48
+ fingerprint: string;
49
+ /**
50
+ * The short ID shown in the report and used by the `reject` and `dismiss` commands.
51
+ */
52
+ id: string;
53
+ /**
54
+ * The name of the task instance that reported it.
55
+ */
56
+ task: string;
57
+ unit: string;
58
+ ruleId: string;
59
+ discriminator: string;
60
+ detail: string;
61
+ /**
62
+ * The content hash of the unit the finding was made about.
63
+ */
64
+ fragment: string;
65
+ path?: string;
66
+ reportedAt?: string;
67
+ previousDecision?: Pick<Decision, "file" | "fragment" | "finding" | "reason">;
68
+ fix?: AppliedFix;
69
+ [key: string]: unknown;
70
+ };
71
+ /**
72
+ * A fix the harness kept, because the check after it passed.
73
+ */
74
+ export type AppliedFix = {
75
+ /**
76
+ * The files the fix changed, relative to the target root.
77
+ */
78
+ files: Array<string>;
79
+ /**
80
+ * The content hash of the unit after the fix.
81
+ */
82
+ fragment: string;
83
+ fixedAt: string;
84
+ };
85
+ /**
86
+ * A human decision that rejects a finding, read from `decisions/*.yml`.
87
+ */
88
+ export type Decision = {
89
+ file: string;
90
+ unit: string;
91
+ rule: string;
92
+ discriminator: string;
93
+ fragment: string;
94
+ finding: string;
95
+ reason: string;
96
+ };
97
+ /**
98
+ * A decision as `judge()` receives it. `expired` tells whether the content has changed since the decision.
99
+ */
100
+ export type PriorDecision = Omit<Decision, "file"> & {
101
+ expired: boolean;
102
+ };
103
+ export type TaskAgentConfig = {
104
+ /**
105
+ * Any model from the Pi catalog, for example `{ provider: 'anthropic', id: 'claude-sonnet-5' }`.
106
+ */
107
+ model: {
108
+ provider: string;
109
+ id: string;
110
+ };
111
+ /**
112
+ * The API key of the model provider. Required when the task calls `agent.run()`. The standard variables
113
+ * of the providers, such as `ANTHROPIC_API_KEY`, are never used instead.
114
+ */
115
+ apiKey?: string;
116
+ thinkingLevel?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
117
+ /**
118
+ * How long one `agent.run()` may take, in seconds. Default: 1800 (30 minutes).
119
+ */
120
+ timeout?: number;
121
+ /**
122
+ * The system prompt of the agent.
123
+ */
124
+ instructions?: string;
125
+ /**
126
+ * A path to a file with the instructions, relative to the task directory. Used when `instructions` is not set.
127
+ */
128
+ instructionsPath?: string;
129
+ /**
130
+ * Directories with skills (`<name>/SKILL.md`), relative to the task directory.
131
+ */
132
+ skills?: Array<string>;
133
+ /**
134
+ * The tools of the agent while judging. They must be read-only. Default: `read`, `grep`, `find` and `ls`.
135
+ */
136
+ judgeTools?: Array<string>;
137
+ /**
138
+ * The tools of the agent while fixing. Default: the read-only tools, `edit` and `write`.
139
+ */
140
+ fixTools?: Array<string>;
141
+ };
142
+ export type AgentRunOptions = {
143
+ prompt: string;
144
+ /**
145
+ * When set, the agent must return its result through a tool with this schema.
146
+ */
147
+ outputSchema?: JsonSchema;
148
+ };
149
+ export type Agent = {
150
+ run<TOutput = unknown>(options: AgentRunOptions): Promise<{
151
+ /**
152
+ * The structured result, when `outputSchema` was set.
153
+ */
154
+ output: TOutput;
155
+ /**
156
+ * The last text the agent wrote.
157
+ */
158
+ text: string;
159
+ }>;
160
+ };
161
+ export type TaskPhase = "judge" | "fix" | "verify";
162
+ export type TaskOptions = Record<string, any>;
163
+ /**
164
+ * The tools every hook receives in its input. While judging, `repo` can only read.
165
+ */
166
+ export type TaskContext<TOptions extends TaskOptions = TaskOptions> = {
167
+ phase: TaskPhase;
168
+ /**
169
+ * The `defaultOptions` of the task, overridden by the `options` of the target.
170
+ */
171
+ options: TOptions;
172
+ agent: Agent;
173
+ log: (message: string) => void;
174
+ normalise: (text: string) => string;
175
+ hash: (text: string) => string;
176
+ repo: {
177
+ /**
178
+ * An absolute path to the target root. Every path a task uses is relative to it.
179
+ */
180
+ root: string;
181
+ list(patterns: ReadonlyArray<string>, options?: {
182
+ ignore?: ReadonlyArray<string>;
183
+ }): Promise<Array<string>>;
184
+ read(path: string): Promise<string>;
185
+ };
186
+ };
187
+ /**
188
+ * The tools `fix()` and `verify()` receive in their input. They can also change files and run commands.
189
+ */
190
+ export type WritableTaskContext<TOptions extends TaskOptions = TaskOptions> = Omit<TaskContext<TOptions>, "repo"> & {
191
+ repo: TaskContext["repo"] & {
192
+ write(path: string, content: string): Promise<void>;
193
+ remove(path: string): Promise<void>;
194
+ };
195
+ /**
196
+ * Runs a command in the target root. It throws when the command exits with a non-zero code or takes longer
197
+ * than `timeout` milliseconds.
198
+ */
199
+ exec(command: string, args?: Array<string>, options?: {
200
+ timeout?: number;
201
+ }): Promise<{
202
+ output: string;
203
+ }>;
204
+ };
205
+ type MaybePromise<T> = T | Promise<T>;
206
+ export type PrepareInput<TOptions extends TaskOptions = TaskOptions> = TaskContext<TOptions>;
207
+ export type ScopeInput<
208
+ TShared = any,
209
+ TOptions extends TaskOptions = TaskOptions
210
+ > = TaskContext<TOptions> & {
211
+ shared: TShared;
212
+ /**
213
+ * The `include` globs of the task, or of the target, which overrides them.
214
+ */
215
+ include: ReadonlyArray<string>;
216
+ /**
217
+ * The `exclude` globs of the task, or of the target, which overrides them.
218
+ */
219
+ exclude: ReadonlyArray<string>;
220
+ };
221
+ /**
222
+ * The input of `contentHash()` and `payload()`.
223
+ */
224
+ export type UnitInput<
225
+ TShared = any,
226
+ TUnit extends TaskUnit = TaskUnit,
227
+ TOptions extends TaskOptions = TaskOptions
228
+ > = TaskContext<TOptions> & {
229
+ shared: TShared;
230
+ unit: TUnit;
231
+ };
232
+ export type JudgeInput<
233
+ TShared = any,
234
+ TUnit extends TaskUnit = TaskUnit,
235
+ TPayload = any,
236
+ TOptions extends TaskOptions = TaskOptions
237
+ > = UnitInput<TShared, TUnit, TOptions> & {
238
+ payload: TPayload;
239
+ /**
240
+ * The human decisions about the unit, each marked as expired when the content has changed since.
241
+ */
242
+ priorDecisions: Array<PriorDecision>;
243
+ };
244
+ export type FixInput<
245
+ TShared = any,
246
+ TUnit extends TaskUnit = TaskUnit,
247
+ TOptions extends TaskOptions = TaskOptions
248
+ > = WritableTaskContext<TOptions> & {
249
+ shared: TShared;
250
+ unit: TUnit;
251
+ /**
252
+ * The findings about the unit that no decision rejects.
253
+ */
254
+ findings: Array<Finding>;
255
+ };
256
+ export type VerifyInput<
257
+ TShared = any,
258
+ TUnit extends TaskUnit = TaskUnit,
259
+ TOptions extends TaskOptions = TaskOptions
260
+ > = WritableTaskContext<TOptions> & {
261
+ shared: TShared;
262
+ unit: TUnit;
263
+ };
264
+ /**
265
+ * A task. A task is a module in `<config>/tasks/<id>/index.{js,mjs,ts,mts}` that exports it by default.
266
+ */
267
+ export type Task<
268
+ TShared = any,
269
+ TUnit extends TaskUnit = TaskUnit,
270
+ TPayload = any,
271
+ TOptions extends TaskOptions = TaskOptions
272
+ > = {
273
+ /**
274
+ * Must match the directory name. It is part of every fingerprint, so do not rename it.
275
+ */
276
+ id: string;
277
+ title: string;
278
+ /**
279
+ * The rules a finding may refer to.
280
+ */
281
+ ruleIds: ReadonlyArray<string>;
282
+ /**
283
+ * The options the hooks receive as `options`. A target can override each of them.
284
+ */
285
+ defaultOptions?: TOptions;
286
+ /**
287
+ * Globs, relative to the target root, of the files the task works on. Without `scope()`, every matching file is
288
+ * a unit, with the path as its key. A target can override them.
289
+ */
290
+ include?: ReadonlyArray<string>;
291
+ /**
292
+ * Globs of the files to leave out of `include`. A target can override them.
293
+ */
294
+ exclude?: ReadonlyArray<string>;
295
+ /**
296
+ * How many changed units one run judges at most. Default: 100. A target can override it.
297
+ */
298
+ maxUnits?: number;
299
+ /**
300
+ * How many units are judged at the same time. Default: 1. Fixes always run one unit at a time.
301
+ */
302
+ concurrency?: number;
303
+ /**
304
+ * Globs, relative to the target root, of the files `fix()` may change. Setting them enables fixing.
305
+ */
306
+ writes?: ReadonlyArray<string>;
307
+ agent?: TaskAgentConfig;
308
+ /**
309
+ * Runs once. What it returns is passed to every other hook as `shared`.
310
+ */
311
+ prepare?(input: PrepareInput<TOptions>): MaybePromise<TShared>;
312
+ /**
313
+ * Returns the units. Optional when the task sets `include`: then every matching file is a unit.
314
+ */
315
+ scope?(input: ScopeInput<TShared, TOptions>): MaybePromise<Array<TUnit>>;
316
+ /**
317
+ * Returns a string that changes exactly when the result of `judge()` could change. Use `hash()`.
318
+ */
319
+ contentHash(input: UnitInput<TShared, TUnit, TOptions>): MaybePromise<string>;
320
+ /**
321
+ * Returns what `judge()` sees.
322
+ */
323
+ payload(input: UnitInput<TShared, TUnit, TOptions>): MaybePromise<TPayload>;
324
+ judge(input: JudgeInput<TShared, TUnit, TPayload, TOptions>): MaybePromise<Array<FindingInput>>;
325
+ /**
326
+ * Changes the files so the findings no longer apply. Required when `writes` is set.
327
+ */
328
+ fix?(input: FixInput<TShared, TUnit, TOptions>): MaybePromise<void>;
329
+ /**
330
+ * Throws when the fixed unit is broken, for example when the tests fail.
331
+ */
332
+ verify?(input: VerifyInput<TShared, TUnit, TOptions>): MaybePromise<void>;
333
+ };
334
+ /**
335
+ * How a target runs a task. The key in `tasks` names the instance: it identifies its state (`.ai-tasks/<name>/`),
336
+ * its findings, its report branch, and `--task`. Every setting overrides the one of the task.
337
+ */
338
+ export type TargetTaskConfig = {
339
+ /**
340
+ * The task to run. Default: the name of the instance.
341
+ */
342
+ task?: string;
343
+ /**
344
+ * Set to `false` to run the task only when it is requested explicitly. Default: `true`.
345
+ */
346
+ enabled?: boolean;
347
+ include?: Array<string>;
348
+ exclude?: Array<string>;
349
+ maxUnits?: number;
350
+ /**
351
+ * Override single `defaultOptions` of the task. The others keep their defaults.
352
+ */
353
+ options?: TaskOptions;
354
+ };
355
+ /**
356
+ * A target. A target is a module in `<config>/targets/<name>.{js,mjs,ts,mts}` that exports it by default.
357
+ */
358
+ export type TargetConfig = {
359
+ /**
360
+ * The repository on GitHub, for example `ckeditor/ckeditor5`. A run uses the targets whose `slug` matches
361
+ * the `origin` of the checkout it runs in.
362
+ */
363
+ slug: string;
364
+ /**
365
+ * The target root inside the repository. Default: the repository root.
366
+ */
367
+ root?: string;
368
+ tasks: Record<string, TargetTaskConfig>;
369
+ };
370
+ /**
371
+ * A task as a target runs it: under the name of the instance, with the overrides of the target applied.
372
+ */
373
+ export type InstanceTask = Task & {
374
+ include: ReadonlyArray<string>;
375
+ exclude: ReadonlyArray<string>;
376
+ maxUnits: number;
377
+ /**
378
+ * The `defaultOptions` of the task, overridden by the `options` of the target.
379
+ */
380
+ options: TaskOptions;
381
+ };
382
+ export type TaskInstance = {
383
+ task: InstanceTask;
384
+ /**
385
+ * An absolute path to the directory of the task definition.
386
+ */
387
+ directory: string;
388
+ enabled: boolean;
389
+ };
390
+ export type Target = {
391
+ name: string;
392
+ slug: string;
393
+ root: string;
394
+ tasks: Map<string, TaskInstance>;
395
+ };
396
+ /**
397
+ * Something that went wrong in a run without stopping it.
398
+ */
399
+ export type Problem = {
400
+ unit?: string;
401
+ message: string;
402
+ };
403
+ /**
404
+ * What happened in one run of one task against one target.
405
+ */
406
+ export type TaskSummary = {
407
+ task: string;
408
+ title: string;
409
+ units: number;
410
+ changed: number;
411
+ judged: number;
412
+ /**
413
+ * Changed units above `maxUnits`, left for the next runs.
414
+ */
415
+ deferred: number;
416
+ newFindings: number;
417
+ alreadyOpen: number;
418
+ rejected: number;
419
+ /**
420
+ * The findings resolved by kept fixes.
421
+ */
422
+ fixed: number;
423
+ /**
424
+ * The findings whose fix was discarded. They stay open.
425
+ */
426
+ discarded: number;
427
+ changedFiles: number;
428
+ open: number;
429
+ /**
430
+ * The units that could not be processed. They make the run fail.
431
+ */
432
+ errors: number;
433
+ /**
434
+ * The errors, the discarded fixes and the warnings.
435
+ */
436
+ problems: Array<Problem>;
437
+ /**
438
+ * In US dollars, as reported by the model provider.
439
+ */
440
+ cost: number;
441
+ tokens: number;
442
+ };
443
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ /**
6
+ * Runs the read and returns `null` instead of throwing when the file does not exist.
7
+ */
8
+ export declare function readIfExists<T>(read: () => Promise<T>): Promise<T | null>;
9
+ /**
10
+ * Whether a normalized relative path points outside of the directory it is relative to.
11
+ */
12
+ export declare function isOutside(relativePath: string): boolean;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { JsonSchema } from "../types.js";
6
+ /**
7
+ * Returns the JSON Schema of the findings a judge returns, wrapped in an object (`{ findings: [ … ] }`),
8
+ * because structured-output APIs require an object at the top level. Pass it as `outputSchema` to `agent.run()`.
9
+ */
10
+ export declare function findingSchema({ ruleIds }: {
11
+ ruleIds: ReadonlyArray<string>;
12
+ }): JsonSchema;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ import type { Target } from "../types.js";
6
+ export declare function getBlobUrl(target: Pick<Target, "root" | "slug">, branch: string, path: string): string;
7
+ export declare function getHistoryUrl(target: Pick<Target, "root" | "slug">, branch: string, path: string): string;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ /**
6
+ * Compares strings by code units, independently of the locale, so sorted state files are the same on every machine.
7
+ */
8
+ export declare function compare(a: string, b: string): number;
9
+ /**
10
+ * Joins the lines of a text into one line, for example to show a multi-line error in a list.
11
+ */
12
+ export declare function inline(text: string): string;
13
+ /**
14
+ * Returns the message of a thrown value. Hooks of a task may throw anything, for example a string.
15
+ */
16
+ export declare function getErrorMessage(error: unknown): string;
17
+ export declare function plural(count: number, word: string): string;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ /**
6
+ * Normalises prose by folding HTML entities, typographic quotes and dashes, and whitespace.
7
+ * Use only when these differences are irrelevant to the audit; whitespace and entities can be significant in code.
8
+ */
9
+ export declare function normalise(text: string): string;
10
+ /**
11
+ * Returns a short, stable hash of a text. It is what the baseline and the decision files store.
12
+ */
13
+ export declare function hash(text: string): string;