@testsprite/testsprite-cli 0.15.0 → 0.17.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 +53 -141
- package/dist/commands/agent.d.ts +12 -4
- package/dist/commands/agent.js +55 -65
- package/dist/commands/auth.d.ts +6 -10
- package/dist/commands/auth.js +44 -56
- package/dist/commands/ci.d.ts +23 -100
- package/dist/commands/ci.js +297 -489
- package/dist/commands/completion.js +2 -1
- package/dist/commands/conversation.d.ts +27 -0
- package/dist/commands/conversation.js +702 -0
- package/dist/commands/doctor.d.ts +5 -1
- package/dist/commands/doctor.js +130 -34
- package/dist/commands/init.d.ts +4 -45
- package/dist/commands/init.js +116 -68
- package/dist/commands/project-env.d.ts +62 -2
- package/dist/commands/project-env.js +426 -53
- package/dist/commands/project-sign-in.d.ts +0 -48
- package/dist/commands/project-sign-in.js +1 -224
- package/dist/commands/project.d.ts +15 -186
- package/dist/commands/project.js +93 -921
- package/dist/commands/result.d.ts +10 -0
- package/dist/commands/result.js +215 -0
- package/dist/commands/schedule.d.ts +0 -29
- package/dist/commands/schedule.js +47 -97
- package/dist/commands/test.d.ts +315 -1824
- package/dist/commands/test.js +1962 -13733
- package/dist/commands/testlist.d.ts +128 -5
- package/dist/commands/testlist.js +269 -329
- package/dist/commands/tunnel.d.ts +2 -2
- package/dist/commands/tunnel.js +43 -41
- package/dist/commands/usage.d.ts +12 -45
- package/dist/commands/usage.js +51 -131
- package/dist/index.js +189 -108
- package/dist/lib/agent-detect.js +9 -5
- package/dist/lib/agent-targets.d.ts +21 -2
- package/dist/lib/agent-targets.js +88 -11
- package/dist/lib/args.d.ts +13 -0
- package/dist/lib/args.js +49 -0
- package/dist/lib/basic-auth.d.ts +3 -0
- package/dist/lib/basic-auth.js +15 -0
- package/dist/lib/billing-refusal.js +4 -3
- package/dist/lib/ci-linkage.d.ts +4 -82
- package/dist/lib/ci-linkage.js +4 -157
- package/dist/lib/ci-run.js +1 -1
- package/dist/lib/client-factory.d.ts +10 -2
- package/dist/lib/client-factory.js +38 -26
- package/dist/lib/commit-signal.d.ts +65 -0
- package/dist/lib/commit-signal.js +305 -0
- package/dist/lib/concurrency-limiter.d.ts +6 -0
- package/dist/lib/concurrency-limiter.js +29 -0
- package/dist/lib/config.js +10 -5
- package/dist/lib/conflict-reason.d.ts +31 -4
- package/dist/lib/conflict-reason.js +38 -4
- package/dist/lib/conversation/answers.d.ts +9 -0
- package/dist/lib/conversation/answers.js +49 -0
- package/dist/lib/conversation/api.d.ts +71 -0
- package/dist/lib/conversation/api.js +150 -0
- package/dist/lib/conversation/change.d.ts +31 -0
- package/dist/lib/conversation/change.js +124 -0
- package/dist/lib/conversation/context.d.ts +19 -0
- package/dist/lib/conversation/context.js +70 -0
- package/dist/lib/conversation/environment.d.ts +15 -0
- package/dist/lib/conversation/environment.js +33 -0
- package/dist/lib/conversation/follow.d.ts +24 -0
- package/dist/lib/conversation/follow.js +42 -0
- package/dist/lib/conversation/render.d.ts +33 -0
- package/dist/lib/conversation/render.js +315 -0
- package/dist/lib/conversation/title.d.ts +2 -0
- package/dist/lib/conversation/title.js +18 -0
- package/dist/lib/conversation/types.d.ts +156 -0
- package/dist/lib/conversation/types.js +6 -0
- package/dist/lib/credentials.js +67 -11
- package/dist/lib/cron.d.ts +1 -1
- package/dist/lib/cron.js +2 -2
- package/dist/lib/dispatch-stop.d.ts +20 -0
- package/dist/lib/dispatch-stop.js +30 -0
- package/dist/lib/download.d.ts +71 -0
- package/dist/lib/download.js +274 -0
- package/dist/lib/dry-run/fetch.d.ts +10 -0
- package/dist/lib/dry-run/fetch.js +20 -0
- package/dist/lib/dry-run/samples.d.ts +6 -34
- package/dist/lib/dry-run/samples.js +389 -751
- package/dist/lib/environment-tunnel.d.ts +16 -26
- package/dist/lib/environment-tunnel.js +161 -157
- package/dist/lib/errors.d.ts +20 -4
- package/dist/lib/errors.js +36 -16
- package/dist/lib/facade.d.ts +7 -29
- package/dist/lib/facade.js +7 -36
- package/dist/lib/failing-fe-resolver.d.ts +13 -58
- package/dist/lib/failing-fe-resolver.js +47 -132
- package/dist/lib/first-suite-hint.d.ts +16 -22
- package/dist/lib/first-suite-hint.js +38 -47
- package/dist/lib/gh-output.d.ts +76 -21
- package/dist/lib/gh-output.js +171 -90
- package/dist/lib/git-utils.d.ts +56 -0
- package/dist/lib/git-utils.js +212 -0
- package/dist/lib/github-context.d.ts +2 -0
- package/dist/lib/github-context.js +40 -8
- package/dist/lib/history-retention.d.ts +6 -2
- package/dist/lib/history-retention.js +10 -7
- package/dist/lib/http.d.ts +58 -134
- package/dist/lib/http.js +352 -271
- package/dist/lib/interrupt.d.ts +14 -8
- package/dist/lib/interrupt.js +28 -10
- package/dist/lib/junit-report.d.ts +60 -4
- package/dist/lib/junit-report.js +209 -32
- package/dist/lib/local-target.d.ts +3 -3
- package/dist/lib/local-target.js +3 -3
- package/dist/lib/output.d.ts +0 -29
- package/dist/lib/output.js +10 -33
- package/dist/lib/pagination.d.ts +2 -5
- package/dist/lib/pagination.js +2 -5
- package/dist/lib/presigned-url.d.ts +22 -0
- package/dist/lib/presigned-url.js +90 -0
- package/dist/lib/prompt.js +36 -2
- package/dist/lib/proxy.js +2 -1
- package/dist/lib/redact.d.ts +2 -2
- package/dist/lib/redact.js +3 -4
- package/dist/lib/removed-commands.d.ts +18 -0
- package/dist/lib/removed-commands.js +154 -0
- package/dist/lib/render-error.d.ts +31 -6
- package/dist/lib/render-error.js +88 -25
- package/dist/lib/response-schemas.d.ts +38 -30
- package/dist/lib/response-schemas.js +210 -207
- package/dist/lib/result/api.d.ts +24 -0
- package/dist/lib/result/api.js +28 -0
- package/dist/lib/result/evidence.d.ts +71 -0
- package/dist/lib/result/evidence.js +420 -0
- package/dist/lib/result/render.d.ts +20 -0
- package/dist/lib/result/render.js +194 -0
- package/dist/lib/result/types.d.ts +122 -0
- package/dist/lib/result/types.js +19 -0
- package/dist/lib/run-output.d.ts +275 -0
- package/dist/lib/run-output.js +227 -0
- package/dist/lib/run-render.d.ts +101 -0
- package/dist/lib/run-render.js +183 -0
- package/dist/lib/run-wait.d.ts +192 -0
- package/dist/lib/run-wait.js +452 -0
- package/dist/lib/runs.types.d.ts +134 -367
- package/dist/lib/runs.types.js +0 -14
- package/dist/lib/secret-file.d.ts +1 -1
- package/dist/lib/secret-file.js +11 -2
- package/dist/lib/skill-nudge.d.ts +7 -27
- package/dist/lib/skill-nudge.js +9 -37
- package/dist/lib/target-path.d.ts +15 -0
- package/dist/lib/target-path.js +35 -0
- package/dist/lib/target-url-advisory.d.ts +19 -0
- package/dist/lib/target-url-advisory.js +31 -0
- package/dist/lib/target-url-preflight.d.ts +9 -0
- package/dist/lib/target-url-preflight.js +214 -106
- package/dist/lib/target-url.d.ts +1 -1
- package/dist/lib/target-url.js +6 -16
- package/dist/lib/telemetry.d.ts +32 -12
- package/dist/lib/telemetry.js +39 -8
- package/dist/lib/terminal-text.d.ts +41 -0
- package/dist/lib/terminal-text.js +127 -0
- package/dist/lib/testlist.types.d.ts +16 -8
- package/dist/lib/testlist.types.js +1 -1
- package/dist/lib/text-equality.d.ts +2 -0
- package/dist/lib/text-equality.js +5 -0
- package/dist/lib/text-file.d.ts +16 -0
- package/dist/lib/text-file.js +41 -0
- package/dist/lib/text-table.d.ts +46 -0
- package/dist/lib/text-table.js +72 -4
- package/dist/lib/ticker.d.ts +9 -2
- package/dist/lib/ticker.js +16 -3
- package/dist/lib/transport-failure.d.ts +22 -0
- package/dist/lib/transport-failure.js +126 -0
- package/dist/lib/tunnel-session.d.ts +7 -1
- package/dist/lib/tunnel-session.js +22 -9
- package/dist/lib/update-check.js +3 -2
- package/dist/lib/url-template.d.ts +43 -0
- package/dist/lib/url-template.js +151 -0
- package/dist/lib/validate.d.ts +0 -64
- package/dist/lib/validate.js +2 -131
- package/dist/lib/version-notice.js +4 -3
- package/dist/lib/wait-exit.d.ts +37 -2
- package/dist/lib/wait-exit.js +88 -30
- package/dist/lib/workspace-status.js +10 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -4
- package/skills/testsprite-ci.skill.md +48 -18
- package/skills/testsprite-onboard.skill.md +66 -151
- package/skills/testsprite-verify.codex.md +54 -56
- package/skills/testsprite-verify.skill.md +194 -358
- package/dist/lib/browser.d.ts +0 -6
- package/dist/lib/browser.js +0 -54
- package/dist/lib/bundle.d.ts +0 -234
- package/dist/lib/bundle.js +0 -781
- package/dist/lib/deprecate.d.ts +0 -10
- package/dist/lib/deprecate.js +0 -13
- package/dist/lib/flaky.d.ts +0 -91
- package/dist/lib/flaky.js +0 -71
- package/dist/lib/plan-poll.d.ts +0 -171
- package/dist/lib/plan-poll.js +0 -441
- package/dist/lib/plans.types.d.ts +0 -130
- package/dist/lib/plans.types.js +0 -31
- package/dist/lib/poll.d.ts +0 -100
- package/dist/lib/poll.js +0 -290
- package/dist/lib/rate-throttle.d.ts +0 -49
- package/dist/lib/rate-throttle.js +0 -75
- package/dist/lib/run-progress.d.ts +0 -41
- package/dist/lib/run-progress.js +0 -56
- package/dist/lib/v3-advisory.d.ts +0 -55
- package/dist/lib/v3-advisory.js +0 -74
- package/schemas/plan.schema.json +0 -61
package/dist/lib/render-error.js
CHANGED
|
@@ -1,30 +1,48 @@
|
|
|
1
|
+
import { isSecretKey, REDACTED } from './redact.js';
|
|
2
|
+
import { cancelCommand, waitCommand } from './run-render.js';
|
|
3
|
+
import { jsonForTerminal, terminalSafe, terminalSafeLine } from './terminal-text.js';
|
|
4
|
+
/**
|
|
5
|
+
* Record on an interrupt that it cut a run wait short, and which results the
|
|
6
|
+
* wait was still following. The envelope's hint is built from them, so it
|
|
7
|
+
* names the same launches as the stderr line the command prints, and says what
|
|
8
|
+
* cancelling stops where the command only joined a run.
|
|
9
|
+
*/
|
|
10
|
+
export function markRunWaitInterrupt(err, waitedRuns) {
|
|
11
|
+
err.runWaitContext = true;
|
|
12
|
+
err.waitedRuns = waitedRuns;
|
|
13
|
+
}
|
|
1
14
|
/**
|
|
2
15
|
* Build the `INTERRUPTED` envelope from whatever the interrupted command
|
|
3
|
-
* attached to the error. A tunnel run attaches `tunnelDetach
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
16
|
+
* attached to the error. A tunnel run attaches `tunnelDetach`, which carries
|
|
17
|
+
* its own `nextAction` so the envelope never contradicts the text line the
|
|
18
|
+
* catch block already printed. Otherwise a run wait gets the run-detach story
|
|
19
|
+
* (`run wait` / `run cancel`, naming the launches when they are known) and
|
|
20
|
+
* any other request gets the generic check-state hint.
|
|
8
21
|
*/
|
|
9
22
|
export function buildInterruptEnvelope(err) {
|
|
10
|
-
const { tunnelDetach
|
|
23
|
+
const { tunnelDetach } = err;
|
|
24
|
+
const waitedRuns = err.waitedRuns ?? [];
|
|
25
|
+
const wait = waitCommand(waitedRuns);
|
|
26
|
+
const cancel = cancelCommand(waitedRuns);
|
|
11
27
|
const nextAction = tunnelDetach?.nextAction ??
|
|
12
|
-
planDetach?.nextAction ??
|
|
13
28
|
(err.runWaitContext
|
|
14
|
-
?
|
|
15
|
-
'
|
|
16
|
-
|
|
29
|
+
? wait && cancel
|
|
30
|
+
? 'The server-side run keeps executing and billing. ' +
|
|
31
|
+
`Re-attach with: ${wait}, or stop it with: ${cancel}.`
|
|
32
|
+
: 'The server-side run (if any) keeps executing and billing. ' +
|
|
33
|
+
'Re-attach with: testsprite run wait <run-id>, or stop it with: testsprite run cancel <run-id> ' +
|
|
34
|
+
'(the partial JSON on stdout carries the runId when the backend reports one).'
|
|
17
35
|
: 'The request was interrupted. Check the current state before retrying; ' +
|
|
18
36
|
'a multi-item command may have processed some items.');
|
|
19
37
|
const details = { signal: err.signal };
|
|
20
38
|
if (tunnelDetach) {
|
|
21
|
-
|
|
39
|
+
// Keep native execution and result IDs when the command knows them.
|
|
40
|
+
Object.assign(details, {
|
|
41
|
+
...(tunnelDetach.runId ? { runId: tunnelDetach.runId } : {}),
|
|
42
|
+
...(tunnelDetach.resultId ? { resultId: tunnelDetach.resultId } : {}),
|
|
43
|
+
});
|
|
22
44
|
details.cancelOutcome = tunnelDetach.cancel;
|
|
23
45
|
}
|
|
24
|
-
else if (planDetach) {
|
|
25
|
-
details.projectId = planDetach.projectId;
|
|
26
|
-
details.stagesRemaining = planDetach.stagesRemaining;
|
|
27
|
-
}
|
|
28
46
|
return {
|
|
29
47
|
error: { code: 'INTERRUPTED', message: err.message, nextAction, requestId: 'local', details },
|
|
30
48
|
};
|
|
@@ -64,22 +82,40 @@ const GLOBAL_FLAG_ARITY = {
|
|
|
64
82
|
* first calling outputError (should not happen for parse errors).
|
|
65
83
|
* fallbackMsg: err.message from CommanderError, used when pendingMsg is null.
|
|
66
84
|
* mode: the output mode resolved from --output (or argv fallback).
|
|
85
|
+
* removedPointer: where a removed command or option went: a line after the
|
|
86
|
+
* message in text, the `nextAction` in JSON. It takes the place
|
|
87
|
+
* of Commander's "(Did you mean …?)" line, which names a
|
|
88
|
+
* similarly spelled command that is not the replacement.
|
|
67
89
|
*/
|
|
68
|
-
export function renderCommanderError(pendingMsg, fallbackMsg, mode) {
|
|
69
|
-
const rawMsg = (pendingMsg ?? fallbackMsg).trim();
|
|
90
|
+
export function renderCommanderError(pendingMsg, fallbackMsg, mode, removedPointer) {
|
|
91
|
+
const rawMsg = withoutSuggestion((pendingMsg ?? fallbackMsg).trim(), removedPointer);
|
|
70
92
|
if (mode === 'json') {
|
|
71
|
-
return (
|
|
93
|
+
return (jsonForTerminal({
|
|
72
94
|
error: {
|
|
73
95
|
code: 'VALIDATION_ERROR',
|
|
74
96
|
message: rawMsg,
|
|
75
|
-
nextAction: 'Run testsprite --help or testsprite <command> --help for usage.',
|
|
97
|
+
nextAction: removedPointer ?? 'Run testsprite --help or testsprite <command> --help for usage.',
|
|
76
98
|
requestId: 'local',
|
|
77
99
|
},
|
|
78
|
-
},
|
|
100
|
+
}, 2) + '\n');
|
|
79
101
|
}
|
|
80
|
-
// Text mode: emit the buffered message as
|
|
81
|
-
//
|
|
82
|
-
|
|
102
|
+
// Text mode: emit the buffered message as formatted by Commander (or
|
|
103
|
+
// rephrased by rephraseUnknownOption), its lines kept and any control
|
|
104
|
+
// character an argument carried removed. Synthesize when null. A removed
|
|
105
|
+
// command's pointer follows on a line of its own.
|
|
106
|
+
if (removedPointer === undefined)
|
|
107
|
+
return terminalSafe(pendingMsg ?? `${rawMsg}\n`);
|
|
108
|
+
return `${terminalSafe(rawMsg)}\n${removedPointer}\n`;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The message without the suggestion line Commander ends it with, when a
|
|
112
|
+
* removal pointer follows. Only a line that ends the message is dropped, so
|
|
113
|
+
* the same text inside a quoted argument stays.
|
|
114
|
+
*/
|
|
115
|
+
function withoutSuggestion(message, removedPointer) {
|
|
116
|
+
return removedPointer === undefined
|
|
117
|
+
? message
|
|
118
|
+
: message.replace(/\n\(Did you mean [^\n]*\?\)$/, '');
|
|
83
119
|
}
|
|
84
120
|
/**
|
|
85
121
|
* Text-mode rendering for the `AMBIGUOUS_ORG` conflict (`details.candidates[]`
|
|
@@ -104,7 +140,7 @@ export function renderAmbiguousOrgCandidates(candidates) {
|
|
|
104
140
|
const { projectId, orgId } = candidate;
|
|
105
141
|
if (typeof projectId !== 'string' || typeof orgId !== 'string')
|
|
106
142
|
continue;
|
|
107
|
-
lines.push(` candidate: project ${projectId} (org ${orgId})`);
|
|
143
|
+
lines.push(` candidate: project ${terminalSafeLine(projectId)} (org ${terminalSafeLine(orgId)})`);
|
|
108
144
|
}
|
|
109
145
|
if (lines.length === 0)
|
|
110
146
|
return [];
|
|
@@ -118,12 +154,39 @@ export function renderTunnelBindingLimitIds(details) {
|
|
|
118
154
|
const ids = details.filter((value) => typeof value === 'string');
|
|
119
155
|
if (ids.length === 0)
|
|
120
156
|
return [];
|
|
121
|
-
const lines = ids.slice(0, 20).map(id => ` tunnel: ${id}`);
|
|
157
|
+
const lines = ids.slice(0, 20).map(id => ` tunnel: ${terminalSafeLine(id)}`);
|
|
122
158
|
if (ids.length > 20)
|
|
123
159
|
lines.push(` … and ${ids.length - 20} more`);
|
|
124
160
|
lines.push(' hint: testsprite tunnel list · testsprite tunnel stop <client-id> · testsprite tunnel stop --all --confirm');
|
|
125
161
|
return lines;
|
|
126
162
|
}
|
|
163
|
+
/** A URL with a user or password before its host. */
|
|
164
|
+
const URL_WITH_CREDENTIALS_RE = /^[a-z][a-z0-9+.-]*:\/\/[^/?#]*@/i;
|
|
165
|
+
/**
|
|
166
|
+
* Commander quotes the whole token in "unknown option '--password=hunter2'".
|
|
167
|
+
* A flag this CLI no longer registers can still arrive with a secret from an
|
|
168
|
+
* older script, so the value is hidden before the message is buffered. So is
|
|
169
|
+
* a URL that carries credentials (`https://user:password@host`), whatever the
|
|
170
|
+
* flag is called.
|
|
171
|
+
*
|
|
172
|
+
* The value runs to the quote Commander closes the token with, which is the
|
|
173
|
+
* last `'` in the message: all Commander adds after it is its "(Did you mean
|
|
174
|
+
* …?)" line, and an option name holds no quote. A quote or a line break
|
|
175
|
+
* inside the value therefore never ends what is hidden.
|
|
176
|
+
*/
|
|
177
|
+
export function redactUnknownOptionValue(raw) {
|
|
178
|
+
const token = /unknown option '(--[^='\s]+)=/.exec(raw);
|
|
179
|
+
if (token === null)
|
|
180
|
+
return raw;
|
|
181
|
+
const valueStart = token.index + token[0].length;
|
|
182
|
+
const closingQuote = raw.lastIndexOf("'");
|
|
183
|
+
if (closingQuote <= valueStart)
|
|
184
|
+
return raw;
|
|
185
|
+
if (!isSecretKey(token[1].slice(2)) &&
|
|
186
|
+
!URL_WITH_CREDENTIALS_RE.test(raw.slice(valueStart, closingQuote)))
|
|
187
|
+
return raw;
|
|
188
|
+
return `${raw.slice(0, valueStart)}${REDACTED}${raw.slice(closingQuote)}`;
|
|
189
|
+
}
|
|
127
190
|
export function rephraseUnknownOption(raw) {
|
|
128
191
|
// Commander emits: "error: unknown option '--foo'"
|
|
129
192
|
const match = /unknown option\s+'--([^']+)'/.exec(raw);
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
* runtime validation, so a drifted or partial server response surfaced as
|
|
6
6
|
* `undefined` output or an opaque TypeError deep inside a command. These
|
|
7
7
|
* schemas are wired (opt-in, via `RequestOptions.schema`) into the typed
|
|
8
|
-
* HttpClient helpers
|
|
9
|
-
*
|
|
10
|
-
* `
|
|
11
|
-
*
|
|
12
|
-
* `get`/`post`/`put`/`patch`/`delete` caller stays
|
|
8
|
+
* HttpClient helpers (the run, test-list, tunnel and execution-report calls), and —
|
|
9
|
+
* for the account surfaces below — the `client.get` call sites that own a
|
|
10
|
+
* `/me` or usage read, plus the `client.get` call sites that
|
|
11
|
+
* own the `project get` / `project list` reads. Every other generic
|
|
12
|
+
* `get`/`post`/`put`/`patch`/`delete` caller stays
|
|
13
|
+
* schema-free and opt-in.
|
|
13
14
|
*
|
|
14
15
|
* Resilience rules (additive server changes must never hard-fail the CLI):
|
|
15
16
|
*
|
|
@@ -22,12 +23,12 @@
|
|
|
22
23
|
* the poll continues; renderers print the raw value), so a new server enum
|
|
23
24
|
* member must degrade gracefully, never reject the whole response.
|
|
24
25
|
* 3. REQUIRED-nullable interface fields use `v.nullish(inner, null)`: the wire
|
|
25
|
-
* may omit a nullable field entirely (real fixture evidence:
|
|
26
|
-
*
|
|
26
|
+
* may omit a nullable field entirely (real fixture evidence: poll bodies
|
|
27
|
+
* that omit `error`), and
|
|
27
28
|
* every consumer already null-checks these, so absence normalizes to
|
|
28
29
|
* `null` instead of failing. OPTIONAL interface fields (`?`) use
|
|
29
30
|
* `v.optional` with NO default so presence/absence semantics that commands
|
|
30
|
-
* branch on (e.g. `
|
|
31
|
+
* branch on (e.g. `RunResponse.runId`) survive
|
|
31
32
|
* validation byte-identically.
|
|
32
33
|
*
|
|
33
34
|
* Each schema is annotated `v.GenericSchema<unknown, T>` against the
|
|
@@ -36,29 +37,36 @@
|
|
|
36
37
|
import * as v from 'valibot';
|
|
37
38
|
import type { MeResponse } from '../commands/auth.js';
|
|
38
39
|
import type { UsageResponse } from '../commands/usage.js';
|
|
39
|
-
import type {
|
|
40
|
+
import type { BatchRunFreshResponse, ProjectRunResponse, CancelRunResponse, RunResponse, TriggerRunResponse, ExecutionReport, ExecutionReportResponse } from './runs.types.js';
|
|
40
41
|
import type { CliTestListRunResponse } from './testlist.types.js';
|
|
42
|
+
import type { ResultDetail, ResultList } from './result/types.js';
|
|
41
43
|
import type { TunnelListResponse, TunnelMintResponse, TunnelStatusResponse } from './tunnel.types.js';
|
|
44
|
+
import type { CliProject } from '../commands/project.js';
|
|
45
|
+
import type { Page } from './pagination.js';
|
|
46
|
+
/**
|
|
47
|
+
* GET /projects/{id} and the rows of GET /projects. Optional fields stay
|
|
48
|
+
* absent when omitted. The renderer-consumed environment fields are typed so
|
|
49
|
+
* a drifted value cannot throw in the text renderer.
|
|
50
|
+
*/
|
|
51
|
+
export declare const CLI_PROJECT_SCHEMA: v.GenericSchema<unknown, CliProject>;
|
|
52
|
+
/** GET /projects page; an omitted `nextToken` normalizes to the terminal `null` cursor. */
|
|
53
|
+
export declare const CLI_PROJECT_LIST_SCHEMA: v.GenericSchema<unknown, Page<CliProject>>;
|
|
42
54
|
/** Mirrors `RunResponse` (runs.types.ts): `GET /api/cli/v1/runs/{runId}`. */
|
|
43
55
|
export declare const RUN_RESPONSE_SCHEMA: v.GenericSchema<unknown, RunResponse>;
|
|
44
56
|
/** Mirrors `CancelRunResponse` (runs.types.ts): the run envelope plus cancel metadata. */
|
|
45
57
|
export declare const CANCEL_RUN_RESPONSE_SCHEMA: v.GenericSchema<unknown, CancelRunResponse>;
|
|
46
58
|
/** Mirrors `TriggerRunResponse` (runs.types.ts): `POST /tests/{testId}/runs`. */
|
|
47
59
|
export declare const TRIGGER_RUN_RESPONSE_SCHEMA: v.GenericSchema<unknown, TriggerRunResponse>;
|
|
48
|
-
/**
|
|
49
|
-
export declare const
|
|
50
|
-
/** Mirrors `BatchRerunResponse` (runs.types.ts): `POST /tests/batch/rerun`. */
|
|
51
|
-
export declare const BATCH_RERUN_RESPONSE_SCHEMA: v.GenericSchema<unknown, BatchRerunResponse>;
|
|
60
|
+
/** Modern project launch; never accept a legacy batch envelope. */
|
|
61
|
+
export declare const PROJECT_RUN_RESPONSE_SCHEMA: v.GenericSchema<unknown, ProjectRunResponse>;
|
|
52
62
|
/** Mirrors `BatchRunFreshResponse` (runs.types.ts): `POST /tests/batch/run`. */
|
|
53
63
|
export declare const BATCH_RUN_FRESH_RESPONSE_SCHEMA: v.GenericSchema<unknown, BatchRunFreshResponse>;
|
|
54
64
|
/**
|
|
55
65
|
* `POST /api/cli/v1/testlist/{listId}/run`. Mirrors the batch-run-fresh shape so
|
|
56
|
-
* the `--wait`
|
|
57
|
-
* carry the in-flight `
|
|
66
|
+
* the `--wait` path uses whole-execution result listings; `conflicts[]` additionally
|
|
67
|
+
* carry the in-flight `currentResultId`, and `reason` marks a nothing-dispatched run.
|
|
58
68
|
*/
|
|
59
69
|
export declare const TESTLIST_RUN_RESPONSE_SCHEMA: v.GenericSchema<unknown, CliTestListRunResponse>;
|
|
60
|
-
/** Mirrors `ListRunsResponse` (runs.types.ts): `GET /tests/{testId}/runs`. */
|
|
61
|
-
export declare const LIST_RUNS_RESPONSE_SCHEMA: v.GenericSchema<unknown, ListRunsResponse>;
|
|
62
70
|
/**
|
|
63
71
|
* Minimal `/me` identity core, as read by `doctor`'s connectivity check.
|
|
64
72
|
*
|
|
@@ -70,13 +78,11 @@ export declare const LIST_RUNS_RESPONSE_SCHEMA: v.GenericSchema<unknown, ListRun
|
|
|
70
78
|
* a connectivity probe must not fail on a partial identity projection.
|
|
71
79
|
*
|
|
72
80
|
* `commands/doctor.ts` aliases its `MeIdentity` to this type so the two cannot
|
|
73
|
-
* drift
|
|
81
|
+
* drift.
|
|
74
82
|
*/
|
|
75
83
|
export interface MeIdentityWire {
|
|
76
84
|
userId?: string;
|
|
77
85
|
keyId?: string;
|
|
78
|
-
/** Authoritative per-user V3 routing bit; older backends omit it. */
|
|
79
|
-
v3Enabled?: boolean;
|
|
80
86
|
/**
|
|
81
87
|
* Account-wide organization membership list (mirrors `CliOrgSummary` in
|
|
82
88
|
* `lib/org-render.ts`). Optional/absent-safe: omitted on a server-side
|
|
@@ -103,7 +109,7 @@ export interface MeIdentityWire {
|
|
|
103
109
|
export declare const ME_IDENTITY_SCHEMA: v.GenericSchema<unknown, MeIdentityWire>;
|
|
104
110
|
/**
|
|
105
111
|
* Mirrors `MeResponse` (commands/auth.ts): the full `GET /me` projection read
|
|
106
|
-
* by `auth
|
|
112
|
+
* by `auth status` (and, through it, `setup`).
|
|
107
113
|
*
|
|
108
114
|
* `scopes` is required and array-typed on purpose — this is the shape drift
|
|
109
115
|
* that actually bites today. `runWhoami` renders `m.scopes.join(', ')` and
|
|
@@ -112,24 +118,22 @@ export declare const ME_IDENTITY_SCHEMA: v.GenericSchema<unknown, MeIdentityWire
|
|
|
112
118
|
* of a typed envelope. Every `/me` fixture in the suite supplies it
|
|
113
119
|
* (`auth.test.ts`, `init.test.ts`, `usage.test.ts`, `cli.subprocess.test.ts`,
|
|
114
120
|
* `test/mock-backend/fixtures.ts`), so requiring it matches observed wire
|
|
115
|
-
* reality; `email` / `displayName`
|
|
121
|
+
* reality; `email` / `displayName` are the genuinely absent-safe
|
|
116
122
|
* ones and stay `v.optional` with no default (rule 3, optional branch).
|
|
117
123
|
*
|
|
118
|
-
* `
|
|
124
|
+
* `setup` calls this through `runWhoami` inside a try/catch that falls back to
|
|
119
125
|
* a placeholder identity, so a drifted `/me` degrades the setup summary
|
|
120
|
-
* instead of failing the whole `
|
|
126
|
+
* instead of failing the whole `setup`.
|
|
121
127
|
*/
|
|
122
128
|
export declare const ME_RESPONSE_SCHEMA: v.GenericSchema<unknown, MeResponse>;
|
|
123
129
|
/**
|
|
124
|
-
* Mirrors `UsageResponse` (commands/usage.ts): the
|
|
130
|
+
* Mirrors `UsageResponse` (commands/usage.ts): the wallet projection the
|
|
125
131
|
* `usage` command reads off the same `GET /me` body.
|
|
126
132
|
*
|
|
127
133
|
* `renderUsage` prints `userId`/`keyId`/`env` unconditionally as its "identity
|
|
128
|
-
* block", so those three are required
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* gated on `!== undefined`, so they stay optional with no default. `scopes`
|
|
132
|
-
* rides along as an unknown extra key and is preserved by `looseObject`.
|
|
134
|
+
* block", so those three are required. `activeOrg`, `organizations` and `org`
|
|
135
|
+
* are best-effort enrichments every renderer branch gates on `!== undefined`,
|
|
136
|
+
* and ride along (with `scopes`) as extra keys preserved by `looseObject`.
|
|
133
137
|
*/
|
|
134
138
|
export declare const USAGE_RESPONSE_SCHEMA: v.GenericSchema<unknown, UsageResponse>;
|
|
135
139
|
/**
|
|
@@ -150,3 +154,7 @@ export declare const TUNNEL_LIST_RESPONSE_SCHEMA: v.GenericSchema<unknown, Tunne
|
|
|
150
154
|
export declare const EXECUTION_REPORT_SCHEMA: v.GenericSchema<unknown, ExecutionReport>;
|
|
151
155
|
/** Mirrors `ExecutionReportResponse`: `report`/`markdown` only travel with `ready: true`. */
|
|
152
156
|
export declare const EXECUTION_REPORT_RESPONSE_SCHEMA: v.GenericSchema<unknown, ExecutionReportResponse>;
|
|
157
|
+
/** Mirrors `ResultList` (result/types.ts): `GET /results?run=…` or `?test=…`. */
|
|
158
|
+
export declare const RESULT_LIST_SCHEMA: v.GenericSchema<unknown, ResultList>;
|
|
159
|
+
/** Mirrors `ResultDetail` (result/types.ts): `GET /results/{resultId}`. */
|
|
160
|
+
export declare const RESULT_DETAIL_SCHEMA: v.GenericSchema<unknown, ResultDetail>;
|