@ckeditor/ckeditor5-dev-agents 0.0.0-stage → 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.
package/LICENSE.md ADDED
@@ -0,0 +1,32 @@
1
+ Software License Agreement
2
+ ==========================
3
+
4
+ Copyright (c) 2003-2026, [CKSource](http://cksource.com) Holding sp. z o.o. All rights reserved.
5
+
6
+ Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
7
+
8
+ Sources of Intellectual Property Included in CKEditor
9
+ -----------------------------------------------------
10
+
11
+ Where not otherwise indicated, all CKEditor content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, CKEditor will incorporate work done by developers outside of CKSource with their express permission.
12
+
13
+ The following libraries are included in CKEditor under the [BSD-2-Clause license](https://opensource.org/licenses/BSD-2-Clause):
14
+
15
+ * entities - Copyright (c) Felix Böhm.
16
+
17
+ The following libraries are included in CKEditor under the [ISC license](https://opensource.org/licenses/ISC):
18
+
19
+ * yaml - Copyright Eemeli Aro <eemeli@gmail.com>.
20
+
21
+ The following libraries are included in CKEditor under the [MIT license](https://opensource.org/licenses/MIT):
22
+
23
+ * @earendil-works/pi-ai - Copyright (c) 2025 Mario Zechner.
24
+ * @earendil-works/pi-coding-agent - Copyright (c) 2025 Mario Zechner.
25
+ * @octokit/rest - Copyright (c) 2012 Cloud9 IDE, Inc. (Mike de Boer) and Copyright (c) 2017-2018 Octokit contributors.
26
+ * simple-git - Copyright (c) 2022 Steve King.
27
+ * upath - Copyright(c) 2014-2020 Angelos Pikoulas (agelos.pikoulas@gmail.com).
28
+
29
+ Trademarks
30
+ ----------
31
+
32
+ **CKEditor** is a trademark of [CKSource](http://cksource.com) Holding sp. z o.o. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
package/README.md CHANGED
@@ -1,3 +1,296 @@
1
- # Temporary Holding Version
1
+ CKEditor 5 agents
2
+ =================
2
3
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
4
+ [![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-dev-agents.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-agents)
5
+ [![CircleCI](https://circleci.com/gh/ckeditor/ckeditor5-dev.svg?style=shield)](https://app.circleci.com/pipelines/github/ckeditor/ckeditor5-dev?branch=master)
6
+
7
+ A framework for running recurring AI agent tasks against repositories. The results of every run arrive as a pull request against the repository, where a human reviews them.
8
+
9
+ ## How a run works
10
+
11
+ For every target and every task enabled in it:
12
+
13
+ 1. The task lists its **units** and returns a **content hash** for each of them. Units whose hash matches the baseline from the previous run are skipped. Of the changed units, the run takes at most `maxUnits` (100 by default). The others are left for the next runs.
14
+ 2. **Judge.** The task returns the findings of every taken unit. Up to `concurrency` units are judged at the same time. An agent used here has read-only tools.
15
+ 3. **Fix** (tasks with `writes` only). Then, one unit at a time, the task changes files to resolve its findings. A fix may change several files matching `writes`. An agent used here can edit files.
16
+ 4. **Check.** Only files matching `writes` may change. `verify()`, if defined, runs first and must pass. The harness then hashes all units and judges every affected unit again. This must not introduce findings or undo an earlier accepted fix, and at least one finding of the fixed unit must be gone. Otherwise, the harness restores the files and Git staging state from before the fix. An affected unit skipped by the baseline or deferred by `maxUnits` is judged before and after the fix; these extra checks do not advance its baseline.
17
+ 5. Findings that are already open, or rejected by a human decision that still holds, are dropped. The rest are recorded, and the state is written to `<target root>/.ai-tasks/<task>/`.
18
+
19
+ Kept fixes and the state stay in the working tree. That is where a **local run** ends: nothing is committed or pushed, and `git diff` shows the result. A **published run** (`--publish`) goes on, on its own report branch per task: it commits and pushes once, opens or updates the report pull request, comments with a summary, and checks out the base branch again.
20
+
21
+ A human is involved only in the pull request, after everything was judged, fixed and checked. Findings never fail a run. A run fails when a task or a unit could not be processed, or publishing failed. A publishing failure preserves the task summary and does not stop the remaining tasks.
22
+
23
+ While a run works, it logs its progress: the targets and tasks, the units being judged and fixed, and the tool calls of the agent. At the end, the command prints one block per task:
24
+
25
+ ```
26
+ Task name · repository (master) · local
27
+ Units 304 in scope · 304 changed · 100 judged · 204 left for the next runs
28
+ Findings 26 new · 0 already open · 0 rejected
29
+ Fixes 13 fixed · 0 discarded
30
+ Files 12 changed
31
+ Open 13
32
+ Cost $0.84 · 412000 tokens · 6 min 12 s
33
+ Problems none
34
+ ```
35
+
36
+ ## Running
37
+
38
+ ```bash
39
+ # Local run in the current checkout: every target of the checkout, the tasks each one enables.
40
+ ckeditor5-dev-agents --config ai-tasks
41
+
42
+ # Local run of one task (even if the target disables it).
43
+ ckeditor5-dev-agents --config ai-tasks --task my-task
44
+
45
+ # Published run: commit, push, and open or update the report pull requests.
46
+ AI_TASKS_GITHUB_TOKEN=… ckeditor5-dev-agents --config ai-tasks --publish
47
+ ```
48
+
49
+ | Argument | Description |
50
+ | --- | --- |
51
+ | `--config <path>` | The directory with `tasks/` and `targets/`. Default: `ai-tasks`. |
52
+ | `--cwd <path>` | A directory inside the checkout to run in. Default: the current directory. |
53
+ | `--target <name>` | The targets to run, repeatable or comma-separated. Default: the targets whose `slug` matches the `origin` of the checkout. |
54
+ | `--task <id>` | The tasks to run, repeatable or comma-separated. Default: the tasks each target enables. |
55
+ | `--publish` | Commit and push the state and the fixes, and open or update the report pull requests. |
56
+
57
+ | Environment variable | Description |
58
+ | --- | --- |
59
+ | `AI_TASKS_GITHUB_TOKEN` | Published runs only. A token that can open pull requests and comment on them. Pushing uses the credentials of the checkout. |
60
+ | `AI_TASKS_GIT_NAME`, `AI_TASKS_GIT_EMAIL` | The author of the commits of published runs. Default: `CKEditor AI Tasks <ai-tasks@users.noreply.github.com>`. |
61
+ | `AI_TASKS_BUILD_URL` | Optional. A link to the CI build, added to the run comments. |
62
+
63
+ The report pull requests of a published run target the checked-out branch. Publishing fails with a clear message, and does not try to fix it, when:
64
+
65
+ * `HEAD` is detached: check out the base branch.
66
+ * The working tree has uncommitted changes: publishing switches branches.
67
+ * The checkout is shallow: merging the base branch into an open report branch needs the history. Configure the checkout in CI to fetch the whole history.
68
+ * A `.gitignore` file ignores the state of a task in `<target root>/.ai-tasks/`: publishing commits it.
69
+
70
+ To undo a local run, reset the working tree from the repository root: `git checkout -- .`, and `git clean -fd -- <root>/.ai-tasks` for the `root` of every target.
71
+
72
+ The package runs only from the command line. What it exports is for task and target modules: `defineTask()`, `defineTarget()`, `findingSchema()` and their types.
73
+
74
+ ## Configuration
75
+
76
+ ```
77
+ ai-tasks/
78
+ ├── tasks/
79
+ │ └── <id>/
80
+ │ ├── index.js The task.
81
+ │ ├── INSTRUCTIONS.md
82
+ │ └── skills/ Optional skills of the agent (`<name>/SKILL.md`), read only when the agent needs them.
83
+ └── targets/
84
+ └── <name>.js One file per repository.
85
+ ```
86
+
87
+ Task and target modules may be `.js`, `.mjs`, `.ts` or `.mts` files that export their definition by default. Use `.mjs` or `.mts` when the `package.json` of the project does not set `"type": "module"`.
88
+
89
+ A task defines everything about the work: what it works on, its options, and its hooks. A target says where it runs. Every setting of a task can be overridden by a target.
90
+
91
+ ### A task
92
+
93
+ Every hook receives one object. Destructure what the hook needs.
94
+
95
+ ```js
96
+ import { defineTask, findingSchema } from '@ckeditor/ckeditor5-dev-agents';
97
+
98
+ const RULE_IDS = [ 'R1' ];
99
+
100
+ export default defineTask( {
101
+ // Must match the directory name. Targets run the task under this name unless they name the instance otherwise,
102
+ // and that name is part of every fingerprint, so do not rename it.
103
+ id: 'my-task',
104
+ title: 'My task',
105
+
106
+ // The rules a finding may refer to.
107
+ ruleIds: RULE_IDS,
108
+
109
+ // The files the task works on. Without `scope()`, every matching file is a unit, with its path as the key.
110
+ include: [ 'docs/**/*.md' ],
111
+ exclude: [ 'docs/api/**' ],
112
+
113
+ // Optional. How many changed units one run judges at most. Default: 100.
114
+ maxUnits: 100,
115
+
116
+ // Optional. The hooks receive them as `options`. A target can override each of them.
117
+ defaultOptions: {
118
+ threshold: 10
119
+ },
120
+
121
+ // Optional. The agent that `agent.run()` runs.
122
+ agent: {
123
+ model: { provider: 'anthropic', id: 'claude-sonnet-5' },
124
+ apiKey: process.env.MY_TASK_API_KEY,
125
+ instructionsPath: 'INSTRUCTIONS.md',
126
+ skills: [ 'skills' ]
127
+ },
128
+
129
+ // Optional. The files `fix()` may change. Setting them enables fixing.
130
+ writes: [ 'docs/**/*.md' ],
131
+
132
+ async contentHash( { repo, hash, normalise, unit } ) {
133
+ return hash( normalise( await repo.read( unit.path ) ) );
134
+ },
135
+
136
+ async payload( { unit } ) {
137
+ return { path: unit.path };
138
+ },
139
+
140
+ async judge( { agent, options, payload, priorDecisions } ) {
141
+ const { output } = await agent.run( {
142
+ prompt: `Check \`${ payload.path }\` with the threshold of ${ options.threshold }. ` +
143
+ `Human decisions about it: ${ JSON.stringify( priorDecisions ) }`,
144
+ outputSchema: findingSchema( { ruleIds: RULE_IDS } )
145
+ } );
146
+
147
+ return output.findings;
148
+ },
149
+
150
+ async fix( { agent, unit, findings } ) {
151
+ await agent.run( { prompt: `Fix these findings in \`${ unit.path }\`: ${ JSON.stringify( findings ) }` } );
152
+ }
153
+ } );
154
+ ```
155
+
156
+ `defineTask()` returns the task unchanged. It only helps with types, in TypeScript and in JavaScript files alike: every hook gets its input typed without annotations. `options` is inferred from `defaultOptions`, `shared` from what `prepare()` returns, `payload` from what `payload()` returns, and `unit` from what `scope()` returns. A task without `scope()` gets `FileUnit` units, with a `path`. A plain object typed as `Task<Shared, Unit, Payload, Options>` works too.
157
+
158
+ | Member | Description |
159
+ | --- | --- |
160
+ | `id`, `title`, `ruleIds` | Required. |
161
+ | `include`, `exclude` | The globs of the files the task works on, relative to the target root. Required without `scope()`. |
162
+ | `maxUnits` | Optional. How many changed units one run initially selects, as an integer of 1 or more. Fix validation may judge additional affected units. Default: 100. |
163
+ | `defaultOptions` | Optional. The options the hooks receive as `options`. |
164
+ | `prepare( tools )` | Optional. Runs once. What it returns is passed to every other hook as `shared`. |
165
+ | `scope( { shared, include, exclude, …tools } )` | Optional. Returns the units, when they are not files: `[ { key, path?, … } ]`. `key` must be unique and stable. `path` makes reports link to the file. |
166
+ | `contentHash( { shared, unit, …tools } )` | Returns a string that changes exactly when the result of `judge()` could change. |
167
+ | `payload( { shared, unit, …tools } )` | Returns what `judge()` sees. |
168
+ | `judge( { shared, unit, payload, priorDecisions, …tools } )` | Returns the findings: `[ { ruleId, detail, discriminator?, … } ]`. `priorDecisions` are the human decisions about the unit, each marked as `expired` when the content has changed since. |
169
+ | `fix( { shared, unit, findings, …writable tools } )` | Optional, requires `writes`. Changes the files so the `findings` (those no decision rejects) no longer apply. |
170
+ | `verify( { shared, unit, …writable tools } )` | Optional, requires `fix()`. Throws when the fixed unit is broken, for example when the tests fail. |
171
+ | `writes` | Optional. Globs of the files `fix()` may change, relative to the target root and without a leading `./`. A fix may change several of them, for example the unit and the files that refer to it. |
172
+ | `concurrency` | Optional. How many units are judged at the same time, as an integer of 1 or more. Default: 1. Fixes always run one unit at a time, after every unit is judged. |
173
+ | `agent` | Optional. See below. |
174
+
175
+ ### A target
176
+
177
+ ```js
178
+ import { defineTarget } from '@ckeditor/ckeditor5-dev-agents';
179
+
180
+ export default defineTarget( {
181
+ // The repository on GitHub. A run in a checkout of it uses this target, and the report pull requests go there.
182
+ slug: 'ckeditor/ckeditor5',
183
+
184
+ // The target root inside the repository. Tasks see paths relative to it, and the state lives in `<root>/.ai-tasks/`.
185
+ root: '.',
186
+
187
+ tasks: {
188
+ // Runs the `my-task` task with its own settings.
189
+ 'my-task': {},
190
+
191
+ // Runs the same task again, on other files and with another option.
192
+ 'my-task-api': {
193
+ task: 'my-task',
194
+ include: [ 'docs/api/**/*.md' ],
195
+ exclude: [],
196
+ options: { threshold: 5 }
197
+ }
198
+ }
199
+ } );
200
+ ```
201
+
202
+ The key of an entry names the instance. It identifies everything a run keeps apart: the state in `.ai-tasks/<name>/`, the findings and their IDs, the report branch, and `--task`. An entry accepts:
203
+
204
+ | Setting | Description |
205
+ | --- | --- |
206
+ | `task` | The task to run. Default: the name of the entry. |
207
+ | `enabled` | Set to `false` to run the instance only when it is requested with `--task`. Default: `true`. |
208
+ | `include`, `exclude`, `maxUnits` | Replace the ones of the task. |
209
+ | `options` | Override single `defaultOptions` of the task. The others keep their defaults. |
210
+
211
+ Keep these rules in mind:
212
+
213
+ * **`key`, `contentHash()` and `payload()` are three different things.** `key` is identity. `contentHash()` defines what counts as a change. `payload()` is what the judge sees, and it is often larger than the unit.
214
+ * **`contentHash()` must cover everything `judge()` reads.** If a finding depends on something outside the unit, hash that too. Otherwise the finding goes stale silently.
215
+ * **Normalise text only when the task ignores those differences.** `normalise()` folds whitespace, entities and typography. Hash source code or other whitespace-sensitive content directly so meaningful changes are judged again.
216
+ * **The instructions of a task are not part of the hash.** Changing them re-judges nothing. Delete `baseline.json` to re-judge everything.
217
+ * **Keep `shared` valid across fixes.** `prepare()` runs once. Read changing file content through `repo` in later hooks; the harness may temporarily restore earlier content to compare an affected unit before and after a fix. It restores files and the Git index, but does not roll back objects returned by `prepare()`.
218
+ * **Throw when a unit cannot be judged.** It keeps its old baseline entry, so the next run tries again.
219
+
220
+ ### The tools
221
+
222
+ Next to their own data, all hooks receive these tools. In TypeScript, the input types are `PrepareInput`, `ScopeInput`, `UnitInput` (for `contentHash()` and `payload()`), `JudgeInput`, `FixInput` and `VerifyInput`.
223
+
224
+ | Tool | Description |
225
+ | --- | --- |
226
+ | `repo.list( globs, { ignore } )` | The files matching the arrays of globs, relative to the target root, sorted. |
227
+ | `repo.read( path )` | The content of a file relative to the target root. |
228
+ | `repo.write( path, content )`, `repo.remove( path )` | In `fix()` and `verify()` only. |
229
+ | `exec( command, args, { timeout } )` | In `fix()` and `verify()` only. Runs a command in the target root and throws when it fails or takes longer than `timeout` milliseconds. |
230
+ | `agent.run( { prompt, outputSchema } )` | Runs the agent of the task. With `outputSchema`, the agent must return its result through a tool with that schema, and `output` holds it. |
231
+ | `normalise( text )`, `hash( text )` | Text normalisation and a short, stable hash. |
232
+ | `options` | The task options from the target config. |
233
+ | `phase` | `judge`, `fix` or `verify`. |
234
+ | `log( message )` | Writes to the run log. |
235
+
236
+ ### The agent
237
+
238
+ `agent.run()` runs a [Pi](https://pi.dev) agent session. Every run is a new session configured only by the task, so a task behaves the same on every machine. Nothing is read from `~/.pi`, `AGENTS.md` files are not loaded, and nothing is persisted.
239
+
240
+ The framework is not tied to a provider. Every task chooses its own model and provides its own API key, so tasks in the same project can use different providers, models, and keys. The standard variables of the providers, such as `ANTHROPIC_API_KEY`, are never read.
241
+
242
+ | Option | Description |
243
+ | --- | --- |
244
+ | `model` | Required. `{ provider, id }` of any model from the Pi catalog, for example `{ provider: 'anthropic', id: 'claude-sonnet-5' }`. |
245
+ | `apiKey` | Required when the task calls `agent.run()`. The API key of the provider. The task decides where it comes from, for example `process.env.MY_TASK_API_KEY`. |
246
+ | `thinkingLevel` | Optional. `off`, `minimal`, `low`, `medium`, `high` or `xhigh`. |
247
+ | `timeout` | Optional. How long one `agent.run()` may take, in seconds. A run that takes longer is aborted and the unit is retried on the next run. Default: 1800 (30 minutes). |
248
+ | `instructions`, `instructionsPath` | The system prompt, as text or as a path relative to the task directory. |
249
+ | `skills` | Directories with skills, relative to the task directory. The agent reads a skill only when it needs it. Every `agent.run()` is a new session, so put rules needed for every unit in the instructions instead: they cost no extra step and are cached by the provider. |
250
+ | `judgeTools` | The tools while judging. Only read-only tools are allowed. Default: `read`, `grep`, `find`, `ls`. |
251
+ | `fixTools` | The tools while fixing. Default: the read-only tools, `edit` and `write`. Add `bash` if the fix must run commands. Unknown tool names are rejected when the task is loaded. |
252
+
253
+ The agent works in the target root. Instructions and the skill inventory are loaded once per task phase and reused across its sessions. Usage includes sessions that fail or time out.
254
+
255
+ ## The state
256
+
257
+ Every task keeps its state in the target repository, in `<target root>/.ai-tasks/<task>/`:
258
+
259
+ | File | Description |
260
+ | --- | --- |
261
+ | `baseline.json` | Unit key → the hash of what was judged. A unit is judged again only when its hash changes. |
262
+ | `open.json` | The findings. **The source of truth** of the report. A run only adds to it. The `reject` and `dismiss` commands remove findings. |
263
+ | `report.md` | The human-readable report, generated from `open.json` on every run. Do not edit it. |
264
+ | `decisions/*.yml` | Rejected findings, one per file. |
265
+
266
+ A finding is identified by its fingerprint: `task|unit|rule|discriminator`, with literal pipes and backslashes escaped, where `task` is the name of the instance. A finding with the same fingerprint as an open one is never reported twice. Its 12-character `id`, shown in `report.md` and stored next to the fingerprint in `open.json`, is derived from it. A fixed finding stays in `open.json` with its `fix` until the report pull request is merged, and the next report branch starts without it. After a local run, it stays until you commit or reset the working tree.
267
+
268
+ Report branches are named `ai-tasks/<task>/<target>/<branch>`. While the report pull request is open, the next runs continue its branch and merge the base branch into it first.
269
+
270
+ ## Reviewing a report pull request
271
+
272
+ Every finding in `report.md` has a short ID, for example `[3fdb55a802c1]`. Longer prefixes of the full finding hash are also accepted; an ambiguous prefix produces a list of full IDs to choose from. For every finding:
273
+
274
+ * **Keep the fix** if it is right. Edit it in the pull request if it needs a change.
275
+ * **Reject the finding** if it is wrong. Check out the report branch and run:
276
+
277
+ ```bash
278
+ ckeditor5-dev-agents reject 3fdb55a802c1 --reason "This is intended."
279
+ ```
280
+
281
+ It writes a decision file to `.ai-tasks/<task>/decisions/`, removes the finding from `open.json`, restores every file of its fix from the base branch, and regenerates `report.md`. Commit and push the result. The decision holds for as long as the unit hashes to its `fragment`, and expires by itself when the judged content changes. If the finding comes back then, the report shows the previous claim and the answer. Every decision about a unit is also passed to `judge()`.
282
+ * **Dismiss the finding**: `ckeditor5-dev-agents dismiss 3fdb55a802c1` does the same, without a decision. The finding may be reported again once the judged content changes. Reverting its fix changes the content, so the next run judges and fixes a dismissed finding with a fix again.
283
+
284
+ A fix may share files with other fixes, for example when the fixes of two units changed the same file. Restoring those files undoes the other fixes too, so the command stops, lists them, and asks to re-run with `--force`. With `--force`, every affected fix is undone completely: its findings stay open, and the next run judges and fixes them again.
285
+
286
+ The commands also work after a local run. There, they restore the files from `HEAD`. When the files of the fix have no uncommitted changes, for example because the fix was already undone by hand, they restore nothing and say so. Both accept `--config`, `--cwd`, `--target` and `--task`, and neither commits anything.
287
+
288
+ Reverting a fix by hand, without rejecting the finding, means the task finds the problem and fixes it again on a later run. Merge the pull request to record the state on the base branch.
289
+
290
+ ## Changelog
291
+
292
+ See the [`CHANGELOG.md`](https://github.com/ckeditor/ckeditor5-dev/blob/master/CHANGELOG.md) file.
293
+
294
+ ## License
295
+
296
+ Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file.
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
5
+ * For licensing, see LICENSE.md.
6
+ */
7
+
8
+ import { runCli } from '../dist/cli.js';
9
+
10
+ process.exitCode = await runCli( process.argv.slice( 2 ) );
@@ -0,0 +1,37 @@
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 { Agent, TaskAgentConfig } from "../types.js";
6
+ export type AgentUsage = {
7
+ cost: number;
8
+ tokens: number;
9
+ };
10
+ export type CreateAgentOptions = {
11
+ taskId: string;
12
+ config: TaskAgentConfig | undefined;
13
+ /**
14
+ * An absolute path to the task directory. Paths in `config` are relative to it.
15
+ */
16
+ taskDirectory: string;
17
+ /**
18
+ * The working directory of the agent: the target root.
19
+ */
20
+ cwd: string;
21
+ tools: ReadonlyArray<string>;
22
+ usage: AgentUsage;
23
+ /**
24
+ * Receives the progress of the agent: the tools it calls.
25
+ */
26
+ log: (message: string) => void;
27
+ /**
28
+ * Receives problems that do not stop the run, for example a skill that cannot be loaded. They are also logged.
29
+ */
30
+ warn: (message: string) => void;
31
+ };
32
+ /**
33
+ * Creates the `agent` of one phase of a task. Every `run()` starts a new in-memory Pi session that is configured only
34
+ * by the task: its instructions, skills, tools and model. The API key comes from the task config (`agent.apiKey`),
35
+ * never from the environment of the process.
36
+ */
37
+ export declare function createAgent(options: CreateAgentOptions): Agent;
package/dist/cli.d.ts ADDED
@@ -0,0 +1,36 @@
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 RunTasksOptions } from "./runtasks.js";
6
+ import { type ResolveFindingOptions } from "./commands/resolvefinding.js";
7
+ /**
8
+ * Parses the arguments of the `ckeditor5-dev-agents` command:
9
+ *
10
+ * * `--config <path>`: the directory with `tasks/` and `targets/`. Default: `ai-tasks`.
11
+ * * `--cwd <path>`: a directory inside the checkout to run in. Default: the current directory.
12
+ * * `--target <name>`: the targets to run (repeatable or comma-separated). Default: the targets of the checkout.
13
+ * * `--task <id>`: the tasks to run (repeatable or comma-separated). Default: the tasks each target enables.
14
+ * * `--publish`: commit and push the state and the fixes, and open or update the report pull requests.
15
+ *
16
+ * Paths are relative to the current directory.
17
+ */
18
+ export declare function parseArguments(cliArguments: Array<string>, { cwd, env }?: {
19
+ cwd?: string;
20
+ env?: NodeJS.ProcessEnv;
21
+ }): RunTasksOptions;
22
+ /**
23
+ * Parses the arguments of the `reject` and `dismiss` commands:
24
+ *
25
+ * * `ckeditor5-dev-agents reject <id> --reason "…"`: the finding is wrong. A decision records why.
26
+ * * `ckeditor5-dev-agents dismiss <id>`: the finding is dropped without a decision.
27
+ *
28
+ * Both accept `--force` (continue when other fixes change the same files), `--config`, `--cwd`, `--target` and `--task`.
29
+ */
30
+ export declare function parseResolveArguments(cliArguments: Array<string>, { cwd }?: {
31
+ cwd?: string;
32
+ }): ResolveFindingOptions;
33
+ /**
34
+ * Runs the `ckeditor5-dev-agents` command. Returns the exit code.
35
+ */
36
+ export declare function runCli(cliArguments: Array<string>): Promise<number>;