@allurereport/plugin-agent 3.10.0 → 3.11.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/README.md +85 -79
- package/dist/capabilities.d.ts +99 -0
- package/dist/capabilities.js +173 -0
- package/dist/errors.d.ts +9 -0
- package/dist/errors.js +15 -0
- package/dist/guidance.d.ts +4 -5
- package/dist/guidance.js +194 -57
- package/dist/harness.d.ts +68 -4
- package/dist/harness.js +45 -17
- package/dist/index.d.ts +9 -1
- package/dist/index.js +9 -0
- package/dist/inline-expectations.d.ts +23 -0
- package/dist/inline-expectations.js +186 -0
- package/dist/invalid-output.d.ts +58 -0
- package/dist/invalid-output.js +238 -0
- package/dist/model.d.ts +34 -0
- package/dist/model.js +8 -1
- package/dist/paths.d.ts +3 -0
- package/dist/paths.js +10 -0
- package/dist/plugin.js +847 -136
- package/dist/query.d.ts +193 -0
- package/dist/query.js +175 -0
- package/dist/selection.d.ts +42 -0
- package/dist/selection.js +141 -0
- package/dist/state.d.ts +15 -0
- package/dist/state.js +83 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -27,14 +27,13 @@ When enabled, the plugin writes:
|
|
|
27
27
|
- `manifest/run.json`, `manifest/tests.jsonl`, and `manifest/findings.jsonl` for machine-readable review
|
|
28
28
|
- copied run logs and other artifacts under `artifacts/`
|
|
29
29
|
- `AGENTS.md` with guidance for consuming the directory
|
|
30
|
-
- `manifest/expected.json` when
|
|
31
|
-
- `project/docs/allure-agent-mode.md` when the project has a guide at `docs/allure-agent-mode.md`
|
|
30
|
+
- `manifest/expected.json` when inline flags, `--expectations <file>`, or plugin options provide expectations
|
|
32
31
|
|
|
33
32
|
If no output directory is configured, the plugin does nothing.
|
|
34
33
|
|
|
35
34
|
The plugin stays read-only by design. A separate harness layer can consume the
|
|
36
35
|
generated manifests, plan enrichment work, and decide whether a rerun is ready to
|
|
37
|
-
accept.
|
|
36
|
+
accept.
|
|
38
37
|
|
|
39
38
|
## Verification Standard
|
|
40
39
|
|
|
@@ -42,19 +41,34 @@ accept. See [the enrichment loop guide](../../docs/agent_enrichment_loop.md).
|
|
|
42
41
|
- Use `allure agent` for smoke checks too, even when the change is small or mechanical.
|
|
43
42
|
- Only skip agent mode when it is impossible or when you are debugging agent mode itself.
|
|
44
43
|
|
|
45
|
-
##
|
|
44
|
+
## CLI Capability Workflow
|
|
46
45
|
|
|
47
|
-
The
|
|
46
|
+
The installed CLI help is the local contract for agent mode. When an agent needs
|
|
47
|
+
to choose supported commands or flags, detect the local CLI surface first:
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
```shell
|
|
50
|
+
allure --version
|
|
51
|
+
allure agent capabilities --json
|
|
52
|
+
allure agent --help
|
|
53
|
+
allure agent query --help
|
|
54
|
+
allure agent select --help
|
|
55
|
+
allure agent latest --help
|
|
56
|
+
allure agent state-dir --help
|
|
57
|
+
```
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
`
|
|
57
|
-
|
|
59
|
+
`allure agent capabilities --json` is the structured local contract for agents.
|
|
60
|
+
`allure agent --help` includes the human-readable command task map. Each
|
|
61
|
+
agent-mode command names the loop it supports, the problem signal that calls for
|
|
62
|
+
it, and the task the agent should perform with it. For example, `allure agent
|
|
63
|
+
latest` belongs to output recovery, `allure agent state-dir` belongs to tooling
|
|
64
|
+
diagnosis, `allure agent query` belongs to output inspection,
|
|
65
|
+
`allure agent select` belongs to rerun planning, and `--rerun-*` belongs to
|
|
66
|
+
focused retry loops.
|
|
67
|
+
|
|
68
|
+
Every generated run includes an `AGENTS.md` playbook with the same stable
|
|
69
|
+
artifact-reading order, command task map, workflow guidance, and remediation
|
|
70
|
+
rules. Reusable skills and common knowledge files should not hard-code
|
|
71
|
+
version-specific flags; they should ask the local CLI when support is unclear.
|
|
58
72
|
|
|
59
73
|
## Install
|
|
60
74
|
|
|
@@ -90,30 +104,28 @@ The preferred CLI entrypoint is:
|
|
|
90
104
|
npx allure agent -- npm test
|
|
91
105
|
```
|
|
92
106
|
|
|
93
|
-
You can provide
|
|
107
|
+
You can provide compact inline expectations for the common review path:
|
|
94
108
|
|
|
95
109
|
```shell
|
|
96
110
|
npx allure agent \
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
111
|
+
--goal "Review feature A" \
|
|
112
|
+
--expect-tests 3 \
|
|
113
|
+
--expect-label feature=feature-a \
|
|
114
|
+
--expect-step-containing "validate feature A" \
|
|
115
|
+
--expect-steps 1 \
|
|
116
|
+
-- npm test
|
|
100
117
|
```
|
|
101
118
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
You can also enable the plugin through lower-level environment variables when you need direct env control:
|
|
119
|
+
Use an explicit expectations file and output directory when inline flags become awkward or you need deterministic paths:
|
|
105
120
|
|
|
106
121
|
```shell
|
|
107
|
-
|
|
122
|
+
npx allure agent \
|
|
123
|
+
--output ./out/agent-report \
|
|
124
|
+
--expectations ./out/agent-expected.yaml \
|
|
125
|
+
-- npm test
|
|
108
126
|
```
|
|
109
127
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
```shell
|
|
113
|
-
ALLURE_AGENT_OUTPUT=./out/agent-report \
|
|
114
|
-
ALLURE_AGENT_EXPECTATIONS=./out/agent-expected.yaml \
|
|
115
|
-
npx allure run -- npm test
|
|
116
|
-
```
|
|
128
|
+
That command uses an agent-only profile by default, so configured presentation and export plugins such as Awesome, Dashboard, or TestOps are ignored for that run.
|
|
117
129
|
|
|
118
130
|
## Options
|
|
119
131
|
|
|
@@ -121,19 +133,14 @@ The plugin accepts the following options:
|
|
|
121
133
|
|
|
122
134
|
| Option | Description | Type | Default |
|
|
123
135
|
|--------|-------------|------|---------|
|
|
124
|
-
| `outputDir` | Directory where the markdown report will be written. Relative paths are resolved from the `allure` process working directory | `string` |
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
|
129
|
-
|
|
130
|
-
| `
|
|
131
|
-
| `
|
|
132
|
-
| `ALLURE_AGENT_COMMAND` | The executed command string recorded in `manifest/run.json` and `index.md` |
|
|
133
|
-
| `ALLURE_AGENT_NAME` | Optional agent identifier recorded in `manifest/run.json` |
|
|
134
|
-
| `ALLURE_AGENT_LOOP_ID` | Optional loop identifier recorded in `manifest/run.json` |
|
|
135
|
-
| `ALLURE_AGENT_TASK_ID` | Optional task identifier recorded in `manifest/run.json` |
|
|
136
|
-
| `ALLURE_AGENT_CONVERSATION_ID` | Optional conversation identifier recorded in `manifest/run.json` |
|
|
136
|
+
| `outputDir` | Directory where the markdown report will be written. Relative paths are resolved from the `allure` process working directory | `string` | none |
|
|
137
|
+
| `expectationsPath` | Path to a YAML or JSON file describing expected and forbidden test scope | `string` | none |
|
|
138
|
+
| `expectations` | Inline expectations object. Use either `expectationsPath` or `expectations`, not both | `AgentExpectationsInput` | none |
|
|
139
|
+
| `command` | Executed command string recorded in `manifest/run.json` and `index.md` | `string` | none |
|
|
140
|
+
| `agentName` | Optional agent identifier recorded in `manifest/run.json` | `string` | none |
|
|
141
|
+
| `loopId` | Optional loop identifier recorded in `manifest/run.json` | `string` | none |
|
|
142
|
+
| `taskId` | Optional task identifier recorded in `manifest/run.json` | `string` | expectations task id |
|
|
143
|
+
| `conversationId` | Optional conversation identifier recorded in `manifest/run.json` | `string` | none |
|
|
137
144
|
|
|
138
145
|
## Manifest Contract
|
|
139
146
|
|
|
@@ -148,8 +155,7 @@ The plugin emits a hybrid output:
|
|
|
148
155
|
- `manifest/test-events.jsonl`
|
|
149
156
|
- `manifest/tests.jsonl`
|
|
150
157
|
- `manifest/findings.jsonl`
|
|
151
|
-
- `manifest/expected.json` when
|
|
152
|
-
- `project/docs/allure-agent-mode.md` when the project guide is available
|
|
158
|
+
- `manifest/expected.json` when expectations are provided
|
|
153
159
|
|
|
154
160
|
`index.md` is the landing page for the run. It includes run identity, expected scope,
|
|
155
161
|
advisory check summary, process logs, and grouped test links.
|
|
@@ -162,10 +168,20 @@ Each test markdown file includes:
|
|
|
162
168
|
- retry history
|
|
163
169
|
- advisory findings and rerun guidance when evidence is weak
|
|
164
170
|
|
|
171
|
+
## Expectations
|
|
172
|
+
|
|
173
|
+
The preferred `allure agent` workflow uses inline flags:
|
|
174
|
+
|
|
175
|
+
- `--goal <text>` records the review intent.
|
|
176
|
+
- `--expect-tests <count>` checks visible logical test count.
|
|
177
|
+
- `--expect-label name=value`, `--expect-env <id>`, `--expect-test "<fullName>"`, and `--expect-prefix <prefix>` define expected scope. For a newly added test, use `--expect-test "<fullName>"` so a missing reported test becomes an explicit finding.
|
|
178
|
+
- `--expect-step-containing <text>`, `--expect-steps <count>`, `--expect-attachments <count>`, and `--expect-attachment <name|name=value|content-type=value>` define evidence expectations per evidence-target logical test.
|
|
179
|
+
|
|
180
|
+
The plugin normalizes inline expectations into `manifest/expected.json`.
|
|
181
|
+
|
|
165
182
|
## Expectations File
|
|
166
183
|
|
|
167
|
-
When `
|
|
168
|
-
it into `manifest/expected.json`, and compares the run against it.
|
|
184
|
+
When `--expectations <file>` or the plugin `expectationsPath` option is set, the plugin accepts YAML or JSON, normalizes it into `manifest/expected.json`, and compares the run against it.
|
|
169
185
|
|
|
170
186
|
Expected top-level fields:
|
|
171
187
|
|
|
@@ -173,6 +189,7 @@ Expected top-level fields:
|
|
|
173
189
|
goal: Validate feature A
|
|
174
190
|
task_id: feature-a
|
|
175
191
|
expected:
|
|
192
|
+
test_count: 3
|
|
176
193
|
environments:
|
|
177
194
|
- default
|
|
178
195
|
full_names:
|
|
@@ -197,23 +214,27 @@ notes:
|
|
|
197
214
|
Selectors are advisory. The plugin does not fail the run; it records findings in
|
|
198
215
|
markdown and `manifest/findings.jsonl`.
|
|
199
216
|
|
|
200
|
-
##
|
|
217
|
+
## Agent Workflow Pattern
|
|
201
218
|
|
|
202
|
-
|
|
219
|
+
Use the smallest workflow that matches the task. For the common change-validation path:
|
|
203
220
|
|
|
204
|
-
1. Run tests with `allure agent -- <command>`.
|
|
221
|
+
1. Run tests with `allure agent --goal <text> --expect-test "<fullName>" --expect-label name=value --expect-step-containing <text> -- <command>`.
|
|
205
222
|
2. Watch `manifest/run.json` and `manifest/test-events.jsonl` while the run is active.
|
|
206
223
|
3. Review `index.md` plus the manifest files.
|
|
207
224
|
4. If evidence is weak, add steps, attachments, labels, or parameters.
|
|
208
|
-
5. Rerun the same scope with the same expectations
|
|
225
|
+
5. Rerun the same scope with the same expectations.
|
|
209
226
|
6. Accept the run or iterate based on advisory findings.
|
|
210
227
|
|
|
228
|
+
When a prior agent run already captured failed tests, prefer
|
|
229
|
+
`allure agent --rerun-latest --rerun-preset failed -- <command>` or
|
|
230
|
+
`allure agent --rerun-from <output-dir> --rerun-preset failed -- <command>`
|
|
231
|
+
instead of spending context reconstructing runner-specific test names.
|
|
232
|
+
|
|
211
233
|
For small mechanical test changes, use a scoped agent-mode run for the smoke check
|
|
212
234
|
too. Plain runner commands should be reserved for cases where agent mode is
|
|
213
235
|
impossible or when you are debugging agent mode itself.
|
|
214
236
|
|
|
215
|
-
For grouped coverage reviews, prefer one
|
|
216
|
-
file per scope instead of trying to review a whole command matrix from a single run.
|
|
237
|
+
For grouped coverage reviews, prefer one scoped expectation set per group instead of trying to review a whole command matrix from a single run.
|
|
217
238
|
|
|
218
239
|
## Test Enrichment Best Practices
|
|
219
240
|
|
|
@@ -246,25 +267,12 @@ When agent output does not fully model runner-visible failures:
|
|
|
246
267
|
- treat the review as partial when suite-load, import, or setup failures are visible outside logical test files
|
|
247
268
|
- keep console-only conclusions provisional until the missing modeling is understood
|
|
248
269
|
|
|
249
|
-
## Project Guide
|
|
250
|
-
|
|
251
|
-
Projects using the skills flow should keep a short root `AGENTS.md` and a deeper
|
|
252
|
-
`docs/allure-agent-mode.md`.
|
|
253
|
-
|
|
254
|
-
`AGENTS.md` should route all test-related work to the deeper guide. The deeper guide
|
|
255
|
-
should explain:
|
|
256
|
-
|
|
257
|
-
- the feature-delivery loop
|
|
258
|
-
- the metadata-enrichment loop
|
|
259
|
-
- per-run temp expectations and output paths
|
|
260
|
-
- meaningful evidence rules
|
|
261
|
-
- minimal metadata rules
|
|
262
|
-
- future loops like flaky, known-issue, mute, and quality gates
|
|
263
|
-
|
|
264
270
|
## Copyable Agent Instructions
|
|
265
271
|
|
|
266
272
|
The generated `AGENTS.md` already contains this guidance for each run. If you want
|
|
267
|
-
the same policy in a
|
|
273
|
+
the same stable policy in a reusable skill or agent prompt, keep version-specific
|
|
274
|
+
CLI details out of that reusable body and make agents inspect local CLI help when
|
|
275
|
+
support is unclear:
|
|
268
276
|
|
|
269
277
|
```md
|
|
270
278
|
## Allure Agent Mode Instructions
|
|
@@ -273,15 +281,13 @@ the same policy in a project-level skill or agent prompt, you can start with:
|
|
|
273
281
|
- Use `allure agent` for smoke checks too, even when the change is small or mechanical.
|
|
274
282
|
- Only skip agent mode when it is impossible or when you are debugging agent mode itself.
|
|
275
283
|
- After each agent-mode test run, print the `index.md` path from that run's output directory so users can open the run overview quickly.
|
|
276
|
-
- Use `allure agent
|
|
277
|
-
- Use `allure agent
|
|
278
|
-
- Use `allure agent
|
|
279
|
-
- Use `allure agent --
|
|
280
|
-
- Use
|
|
281
|
-
-
|
|
282
|
-
-
|
|
283
|
-
- Generate or refresh `ALLURE_AGENT_EXPECTATIONS` before each targeted rerun.
|
|
284
|
-
- Run tests with `ALLURE_AGENT_OUTPUT` and review `manifest/run.json`, `manifest/test-events.jsonl`, `index.md`, `manifest/tests.jsonl`, and `manifest/findings.jsonl`.
|
|
284
|
+
- Use `allure --version`, `allure agent capabilities --json`, and `allure agent --help` before choosing flags when the local CLI surface is unknown.
|
|
285
|
+
- Use `allure agent latest` to print the newest output directory and `index.md` path when `--output` was omitted.
|
|
286
|
+
- Use `allure agent latest`, `state-dir`, `query`, `select`, and `--rerun-*` according to their loop/task/problem mapping instead of treating them as interchangeable helper commands.
|
|
287
|
+
- Use `allure agent query --latest summary|tests|findings|test` or `allure agent query --from <output-dir> ...` to inspect prior output as focused JSON before manually opening raw manifests.
|
|
288
|
+
- Use `allure agent select --from <output-dir> --output <file>` when you want the CLI to write the test plan and print a short summary with the file path, source output, preset, and selected count.
|
|
289
|
+
- When rerunning previous failures, use `allure agent --rerun-latest --rerun-preset failed -- <command>` or `allure agent --rerun-from <output-dir> --rerun-preset failed -- <command>` instead of manually rebuilding runner-specific test names.
|
|
290
|
+
- Run tests with `allure agent` and review `manifest/run.json`, `manifest/test-events.jsonl`, `index.md`, `manifest/tests.jsonl`, and `manifest/findings.jsonl`.
|
|
285
291
|
- Enrich only the intended tests. Add real steps for real setup, actions, and assertions.
|
|
286
292
|
- Attach only real runtime evidence such as payloads, responses, screenshots, DOM snapshots, diffs, logs, or traces.
|
|
287
293
|
- Keep metadata minimal. Add labels or severity only when scope review, debugging, or quality policy uses them.
|
|
@@ -303,7 +309,7 @@ import {
|
|
|
303
309
|
```
|
|
304
310
|
|
|
305
311
|
- `buildAgentExpectations(...)` converts a goal plus target/forbidden selectors into
|
|
306
|
-
the
|
|
312
|
+
the expectations shape accepted by inline flags, expectations files, and the plugin expectations option.
|
|
307
313
|
- `loadAgentOutput(...)` reads `manifest/run.json`, `manifest/tests.jsonl`, and
|
|
308
314
|
`manifest/findings.jsonl`.
|
|
309
315
|
- `planAgentEnrichmentReview(...)` maps `check_name` values to enrichment actions
|
|
@@ -325,5 +331,5 @@ The enrichment loop should add only real runtime evidence:
|
|
|
325
331
|
Avoid dummy enrichment such as empty wrapper steps, placeholder `"passed"` text
|
|
326
332
|
attachments, or labels that are never used downstream.
|
|
327
333
|
|
|
328
|
-
For
|
|
329
|
-
|
|
334
|
+
For remediation mapping and JS/Vitest examples based on the existing sandbox
|
|
335
|
+
tests, inspect the package tests and generated run `AGENTS.md` guidance.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export declare const AGENT_CAPABILITIES_SCHEMA = "allure-agent-capabilities/v1";
|
|
2
|
+
export declare const createAgentCapabilities: () => {
|
|
3
|
+
readonly schema: "allure-agent-capabilities/v1";
|
|
4
|
+
readonly commands: {
|
|
5
|
+
readonly help: {
|
|
6
|
+
readonly supported: true;
|
|
7
|
+
readonly usage: "allure --version; allure agent --help; allure agent capabilities";
|
|
8
|
+
readonly output: readonly ["human", "json"];
|
|
9
|
+
};
|
|
10
|
+
readonly run: {
|
|
11
|
+
readonly supported: true;
|
|
12
|
+
readonly usage: "allure agent [options] -- <command>";
|
|
13
|
+
readonly options: readonly ["--config", "--cwd", "--output", "--expectations", "--goal", "--task-id", "--expect-tests", "--expect-label", "--expect-env", "--expect-test", "--expect-prefix", "--expect-step-containing", "--forbid-label", "--expect-steps", "--expect-attachments", "--expect-attachment", "--environment", "--environment-name", "--silent", "--rerun-from", "--rerun-latest", "--rerun-preset", "--rerun-environment", "--rerun-label"];
|
|
14
|
+
};
|
|
15
|
+
readonly latest: {
|
|
16
|
+
readonly supported: true;
|
|
17
|
+
readonly usage: "allure agent latest [--cwd <dir>]";
|
|
18
|
+
readonly output: readonly ["agent output: <dir>", "agent index: <dir>/index.md"];
|
|
19
|
+
};
|
|
20
|
+
readonly stateDir: {
|
|
21
|
+
readonly supported: true;
|
|
22
|
+
readonly usage: "allure agent state-dir [--cwd <dir>]";
|
|
23
|
+
readonly environmentVariable: "ALLURE_AGENT_STATE_DIR";
|
|
24
|
+
};
|
|
25
|
+
readonly select: {
|
|
26
|
+
readonly supported: true;
|
|
27
|
+
readonly usage: "allure agent select (--latest | --from <output-dir>) [options]";
|
|
28
|
+
readonly presets: readonly ["review", "failed", "unsuccessful", "all"];
|
|
29
|
+
readonly filters: readonly ["environment", "label"];
|
|
30
|
+
readonly output: readonly ["stdout-testplan-json", "file-testplan-json", "file-summary"];
|
|
31
|
+
};
|
|
32
|
+
readonly query: {
|
|
33
|
+
readonly supported: true;
|
|
34
|
+
readonly usage: "allure agent query (--latest | --from <output-dir>) [summary|tests|findings|test] [options]";
|
|
35
|
+
readonly views: readonly ["summary", "tests", "findings", "test"];
|
|
36
|
+
readonly filters: readonly ["status", "environment", "label", "severity", "category", "check", "test"];
|
|
37
|
+
readonly output: readonly ["json"];
|
|
38
|
+
};
|
|
39
|
+
readonly rerun: {
|
|
40
|
+
readonly supported: true;
|
|
41
|
+
readonly usage: "allure agent (--rerun-latest | --rerun-from <output-dir>) [filters] -- <command>";
|
|
42
|
+
readonly presets: readonly ["review", "failed", "unsuccessful", "all"];
|
|
43
|
+
readonly filters: readonly ["environment", "label"];
|
|
44
|
+
readonly transport: "ALLURE_TESTPLAN_PATH";
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
readonly expectations: {
|
|
48
|
+
readonly inline: {
|
|
49
|
+
readonly supported: true;
|
|
50
|
+
readonly goal: true;
|
|
51
|
+
readonly taskId: true;
|
|
52
|
+
readonly expected: {
|
|
53
|
+
readonly testCount: true;
|
|
54
|
+
readonly labels: true;
|
|
55
|
+
readonly environments: true;
|
|
56
|
+
readonly fullNames: true;
|
|
57
|
+
readonly fullNamePrefixes: true;
|
|
58
|
+
};
|
|
59
|
+
readonly forbidden: {
|
|
60
|
+
readonly labels: true;
|
|
61
|
+
readonly environments: false;
|
|
62
|
+
readonly fullNames: false;
|
|
63
|
+
readonly fullNamePrefixes: false;
|
|
64
|
+
};
|
|
65
|
+
readonly evidence: {
|
|
66
|
+
readonly stepNameContains: true;
|
|
67
|
+
readonly minSteps: true;
|
|
68
|
+
readonly minAttachments: true;
|
|
69
|
+
readonly attachmentFilters: readonly ["name", "content-type"];
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
readonly file: {
|
|
73
|
+
readonly supported: true;
|
|
74
|
+
readonly formats: readonly ["yaml", "json"];
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
readonly output: {
|
|
78
|
+
readonly automaticTempDirectory: true;
|
|
79
|
+
readonly explicitOutputOption: "--output <dir>";
|
|
80
|
+
readonly schema: "allure-agent-output/v1";
|
|
81
|
+
readonly files: readonly ["index.md", "AGENTS.md", "manifest/run.json", "manifest/test-events.jsonl", "manifest/tests.jsonl", "manifest/findings.jsonl", "manifest/expected.json", "tests/<environment>/<slug>.md", "artifacts/global/"];
|
|
82
|
+
};
|
|
83
|
+
readonly unsupported: {
|
|
84
|
+
readonly discovery: true;
|
|
85
|
+
readonly configureIntegration: true;
|
|
86
|
+
readonly executionSignal: true;
|
|
87
|
+
readonly compare: true;
|
|
88
|
+
readonly flaky: true;
|
|
89
|
+
readonly duplicates: true;
|
|
90
|
+
readonly stale: true;
|
|
91
|
+
readonly suppressions: true;
|
|
92
|
+
readonly observe: true;
|
|
93
|
+
readonly interrupt: true;
|
|
94
|
+
readonly localAgentService: true;
|
|
95
|
+
readonly expectationControls: readonly ["--expect-evidence"];
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export declare const AGENT_TASK_MAP_HELP = "Agent task map:\n allure --version\n allure agent --help\n allure agent capabilities\n Setup and capability detection. Use when the local CLI surface is unknown,\n generated guidance may be stale, or an agent needs supported flags without\n guessing.\n\n allure agent --goal ... -- <command>\n Run a test command with runtime evidence, scope expectations, and\n agent-readable artifacts for review, debugging, smoke checks, or validation.\n\n allure agent latest\n Recover the newest agent output directory and index.md when --output was\n omitted or a follow-up task needs the previous run.\n\n allure agent state-dir\n Show where project-scoped latest-run pointers are stored. Useful when\n latest cannot find a run or CI/sandbox state looks wrong.\n\n allure agent select --latest\n allure agent select --from <output-dir>\n Inspect/filter prior results and write an Allure test plan before rerun.\n\n allure agent query --latest summary\n allure agent query --from <output-dir> tests\n allure agent query --from <output-dir> findings\n Inspect prior agent output as focused JSON without manually loading raw\n manifests. Use for summaries, filtered test lists, findings, or one test.\n\n allure agent --rerun-latest -- <command>\n allure agent --rerun-from <output-dir> -- <command>\n Rerun the failed, unsuccessful, or selected tests from prior agent output\n through Allure test plan support.\n\nEnvironment:\n ALLURE_AGENT_STATE_DIR=<dir>\n Override the project-scoped state directory. Useful in CI, sandboxes, or\n multi-job setups that need a deterministic shared state location.\n";
|
|
99
|
+
export declare const isAgentTaskMapHelpRequest: (args: string[]) => boolean;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
export const AGENT_CAPABILITIES_SCHEMA = "allure-agent-capabilities/v1";
|
|
2
|
+
export const createAgentCapabilities = () => ({
|
|
3
|
+
schema: AGENT_CAPABILITIES_SCHEMA,
|
|
4
|
+
commands: {
|
|
5
|
+
help: {
|
|
6
|
+
supported: true,
|
|
7
|
+
usage: "allure --version; allure agent --help; allure agent capabilities",
|
|
8
|
+
output: ["human", "json"],
|
|
9
|
+
},
|
|
10
|
+
run: {
|
|
11
|
+
supported: true,
|
|
12
|
+
usage: "allure agent [options] -- <command>",
|
|
13
|
+
options: [
|
|
14
|
+
"--config",
|
|
15
|
+
"--cwd",
|
|
16
|
+
"--output",
|
|
17
|
+
"--expectations",
|
|
18
|
+
"--goal",
|
|
19
|
+
"--task-id",
|
|
20
|
+
"--expect-tests",
|
|
21
|
+
"--expect-label",
|
|
22
|
+
"--expect-env",
|
|
23
|
+
"--expect-test",
|
|
24
|
+
"--expect-prefix",
|
|
25
|
+
"--expect-step-containing",
|
|
26
|
+
"--forbid-label",
|
|
27
|
+
"--expect-steps",
|
|
28
|
+
"--expect-attachments",
|
|
29
|
+
"--expect-attachment",
|
|
30
|
+
"--environment",
|
|
31
|
+
"--environment-name",
|
|
32
|
+
"--silent",
|
|
33
|
+
"--rerun-from",
|
|
34
|
+
"--rerun-latest",
|
|
35
|
+
"--rerun-preset",
|
|
36
|
+
"--rerun-environment",
|
|
37
|
+
"--rerun-label",
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
latest: {
|
|
41
|
+
supported: true,
|
|
42
|
+
usage: "allure agent latest [--cwd <dir>]",
|
|
43
|
+
output: ["agent output: <dir>", "agent index: <dir>/index.md"],
|
|
44
|
+
},
|
|
45
|
+
stateDir: {
|
|
46
|
+
supported: true,
|
|
47
|
+
usage: "allure agent state-dir [--cwd <dir>]",
|
|
48
|
+
environmentVariable: "ALLURE_AGENT_STATE_DIR",
|
|
49
|
+
},
|
|
50
|
+
select: {
|
|
51
|
+
supported: true,
|
|
52
|
+
usage: "allure agent select (--latest | --from <output-dir>) [options]",
|
|
53
|
+
presets: ["review", "failed", "unsuccessful", "all"],
|
|
54
|
+
filters: ["environment", "label"],
|
|
55
|
+
output: ["stdout-testplan-json", "file-testplan-json", "file-summary"],
|
|
56
|
+
},
|
|
57
|
+
query: {
|
|
58
|
+
supported: true,
|
|
59
|
+
usage: "allure agent query (--latest | --from <output-dir>) [summary|tests|findings|test] [options]",
|
|
60
|
+
views: ["summary", "tests", "findings", "test"],
|
|
61
|
+
filters: ["status", "environment", "label", "severity", "category", "check", "test"],
|
|
62
|
+
output: ["json"],
|
|
63
|
+
},
|
|
64
|
+
rerun: {
|
|
65
|
+
supported: true,
|
|
66
|
+
usage: "allure agent (--rerun-latest | --rerun-from <output-dir>) [filters] -- <command>",
|
|
67
|
+
presets: ["review", "failed", "unsuccessful", "all"],
|
|
68
|
+
filters: ["environment", "label"],
|
|
69
|
+
transport: "ALLURE_TESTPLAN_PATH",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
expectations: {
|
|
73
|
+
inline: {
|
|
74
|
+
supported: true,
|
|
75
|
+
goal: true,
|
|
76
|
+
taskId: true,
|
|
77
|
+
expected: {
|
|
78
|
+
testCount: true,
|
|
79
|
+
labels: true,
|
|
80
|
+
environments: true,
|
|
81
|
+
fullNames: true,
|
|
82
|
+
fullNamePrefixes: true,
|
|
83
|
+
},
|
|
84
|
+
forbidden: {
|
|
85
|
+
labels: true,
|
|
86
|
+
environments: false,
|
|
87
|
+
fullNames: false,
|
|
88
|
+
fullNamePrefixes: false,
|
|
89
|
+
},
|
|
90
|
+
evidence: {
|
|
91
|
+
stepNameContains: true,
|
|
92
|
+
minSteps: true,
|
|
93
|
+
minAttachments: true,
|
|
94
|
+
attachmentFilters: ["name", "content-type"],
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
file: {
|
|
98
|
+
supported: true,
|
|
99
|
+
formats: ["yaml", "json"],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
output: {
|
|
103
|
+
automaticTempDirectory: true,
|
|
104
|
+
explicitOutputOption: "--output <dir>",
|
|
105
|
+
schema: "allure-agent-output/v1",
|
|
106
|
+
files: [
|
|
107
|
+
"index.md",
|
|
108
|
+
"AGENTS.md",
|
|
109
|
+
"manifest/run.json",
|
|
110
|
+
"manifest/test-events.jsonl",
|
|
111
|
+
"manifest/tests.jsonl",
|
|
112
|
+
"manifest/findings.jsonl",
|
|
113
|
+
"manifest/expected.json",
|
|
114
|
+
"tests/<environment>/<slug>.md",
|
|
115
|
+
"artifacts/global/",
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
unsupported: {
|
|
119
|
+
discovery: true,
|
|
120
|
+
configureIntegration: true,
|
|
121
|
+
executionSignal: true,
|
|
122
|
+
compare: true,
|
|
123
|
+
flaky: true,
|
|
124
|
+
duplicates: true,
|
|
125
|
+
stale: true,
|
|
126
|
+
suppressions: true,
|
|
127
|
+
observe: true,
|
|
128
|
+
interrupt: true,
|
|
129
|
+
localAgentService: true,
|
|
130
|
+
expectationControls: ["--expect-evidence"],
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
export const AGENT_TASK_MAP_HELP = `Agent task map:
|
|
134
|
+
allure --version
|
|
135
|
+
allure agent --help
|
|
136
|
+
allure agent capabilities
|
|
137
|
+
Setup and capability detection. Use when the local CLI surface is unknown,
|
|
138
|
+
generated guidance may be stale, or an agent needs supported flags without
|
|
139
|
+
guessing.
|
|
140
|
+
|
|
141
|
+
allure agent --goal ... -- <command>
|
|
142
|
+
Run a test command with runtime evidence, scope expectations, and
|
|
143
|
+
agent-readable artifacts for review, debugging, smoke checks, or validation.
|
|
144
|
+
|
|
145
|
+
allure agent latest
|
|
146
|
+
Recover the newest agent output directory and index.md when --output was
|
|
147
|
+
omitted or a follow-up task needs the previous run.
|
|
148
|
+
|
|
149
|
+
allure agent state-dir
|
|
150
|
+
Show where project-scoped latest-run pointers are stored. Useful when
|
|
151
|
+
latest cannot find a run or CI/sandbox state looks wrong.
|
|
152
|
+
|
|
153
|
+
allure agent select --latest
|
|
154
|
+
allure agent select --from <output-dir>
|
|
155
|
+
Inspect/filter prior results and write an Allure test plan before rerun.
|
|
156
|
+
|
|
157
|
+
allure agent query --latest summary
|
|
158
|
+
allure agent query --from <output-dir> tests
|
|
159
|
+
allure agent query --from <output-dir> findings
|
|
160
|
+
Inspect prior agent output as focused JSON without manually loading raw
|
|
161
|
+
manifests. Use for summaries, filtered test lists, findings, or one test.
|
|
162
|
+
|
|
163
|
+
allure agent --rerun-latest -- <command>
|
|
164
|
+
allure agent --rerun-from <output-dir> -- <command>
|
|
165
|
+
Rerun the failed, unsuccessful, or selected tests from prior agent output
|
|
166
|
+
through Allure test plan support.
|
|
167
|
+
|
|
168
|
+
Environment:
|
|
169
|
+
ALLURE_AGENT_STATE_DIR=<dir>
|
|
170
|
+
Override the project-scoped state directory. Useful in CI, sandboxes, or
|
|
171
|
+
multi-job setups that need a deterministic shared state location.
|
|
172
|
+
`;
|
|
173
|
+
export const isAgentTaskMapHelpRequest = (args) => args.length === 2 && args[0] === "agent" && (args[1] === "--help" || args[1] === "-h");
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class AgentUsageError extends Error {
|
|
2
|
+
constructor(message: string);
|
|
3
|
+
}
|
|
4
|
+
export declare class AgentExpectationUsageError extends AgentUsageError {
|
|
5
|
+
readonly sourceOption?: string;
|
|
6
|
+
constructor(message: string, sourceOption?: string);
|
|
7
|
+
}
|
|
8
|
+
export declare const isAgentUsageError: (error: unknown) => error is AgentUsageError;
|
|
9
|
+
export declare const isAgentExpectationUsageError: (error: unknown) => error is AgentExpectationUsageError;
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class AgentUsageError extends Error {
|
|
2
|
+
constructor(message) {
|
|
3
|
+
super(message);
|
|
4
|
+
this.name = "AgentUsageError";
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class AgentExpectationUsageError extends AgentUsageError {
|
|
8
|
+
constructor(message, sourceOption) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = "AgentExpectationUsageError";
|
|
11
|
+
this.sourceOption = sourceOption;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export const isAgentUsageError = (error) => error instanceof AgentUsageError;
|
|
15
|
+
export const isAgentExpectationUsageError = (error) => error instanceof AgentExpectationUsageError;
|