@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
|
@@ -5,7 +5,7 @@ import { VERSION } from '../version.js';
|
|
|
5
5
|
* `testsprite-onboard` codex contribution — a single always-on line. Kept here
|
|
6
6
|
* (not in a `*.codex.md` asset) because it is one line; see {@link CodexContribution}.
|
|
7
7
|
*/
|
|
8
|
-
export const ONBOARD_CODEX_LINE = '**First-time setup:** if this repo has no TestSprite tests yet, seed a *broad* first suite across its main user flows — not just one test — each with a concrete, observable assertion, before reporting setup as done.
|
|
8
|
+
export const ONBOARD_CODEX_LINE = '**First-time setup:** if this repo has no TestSprite tests yet, seed a *broad* first suite across its main user flows — not just one test — each with a concrete, observable assertion, before reporting setup as done. Ask the project\'s agent with `testsprite plan --project <id> "<the main user flows>"`, review what it proposes, then `testsprite apply`.';
|
|
9
9
|
/**
|
|
10
10
|
* `testsprite-ci` codex contribution — one always-on line; the full onboarding
|
|
11
11
|
* flow lives in the own-file body and the docs.
|
|
@@ -21,13 +21,13 @@ export const CI_CODEX_LINE = '**CI gate:** to run TestSprite on every pull reque
|
|
|
21
21
|
export const SKILLS = {
|
|
22
22
|
'testsprite-verify': {
|
|
23
23
|
name: 'testsprite-verify',
|
|
24
|
-
description:
|
|
24
|
+
description: "TestSprite verification loop — after finishing a feature or fix in a TestSprite-tested repo, use the `testsprite` CLI to run the relevant TestSprite tests against the change and inspect any failure artifacts before reporting the work as done. Use whenever code has changed outside docs/config and is about to be reported complete — by running an existing test that covers the change, or by asking the project's agent for a new one (`testsprite plan`, then `testsprite apply`) and running it to a terminal verdict.",
|
|
25
25
|
bodyFile: 'testsprite-verify.skill.md',
|
|
26
26
|
codex: { kind: 'full', file: 'testsprite-verify.codex.md' },
|
|
27
27
|
},
|
|
28
28
|
'testsprite-onboard': {
|
|
29
29
|
name: 'testsprite-onboard',
|
|
30
|
-
description: 'Stand up a complete, runnable TestSprite test suite for the current repo at first use — create a project (with a target URL and auth),
|
|
30
|
+
description: 'Stand up a complete, runnable TestSprite test suite for the current repo at first use — create a project (with a target URL and auth), have the project\'s agent plan a coherent set of tests (`testsprite plan`, then `testsprite apply`), and smoke-run a few to a green verdict so the user has something worth running. Use ONLY when a repo has no TestSprite tests yet (a fresh project), right after `testsprite setup`, or when the user asks to "set up / bootstrap / seed tests". This is first-run setup, NOT change verification — once a project already has tests, use the testsprite-verify skill instead.',
|
|
31
31
|
bodyFile: 'testsprite-onboard.skill.md',
|
|
32
32
|
codex: { kind: 'line', text: ONBOARD_CODEX_LINE },
|
|
33
33
|
},
|
|
@@ -58,11 +58,53 @@ export const SKILL_DESCRIPTION = SKILLS['testsprite-verify'].description;
|
|
|
58
58
|
// ---------------------------------------------------------------------------
|
|
59
59
|
// Wrappers
|
|
60
60
|
// ---------------------------------------------------------------------------
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
/**
|
|
62
|
+
* True when `value` can be emitted as a YAML plain scalar without changing its
|
|
63
|
+
* meaning. Anything else (notably a `: ` sequence, as in
|
|
64
|
+
* `` `on: deployment_status` ``) must be quoted, or YAML readers parse it as
|
|
65
|
+
* nested mapping syntax and reject the whole frontmatter block.
|
|
66
|
+
*/
|
|
67
|
+
function isPlainScalarSafe(value) {
|
|
68
|
+
if (value === '' || value !== value.trim())
|
|
69
|
+
return false;
|
|
70
|
+
// Leading indicators reserve a scalar's first character (also applies to
|
|
71
|
+
// characters YAML reserves only at the start, like backtick and `%`).
|
|
72
|
+
if (/^[-?:,[\]{}#&*!|>'"%@`]/.test(value))
|
|
73
|
+
return false;
|
|
74
|
+
// `: ` starts a mapping value, ` #` starts a comment, and a trailing `:`
|
|
75
|
+
// is read as an empty value.
|
|
76
|
+
if (/:\s/.test(value) || /\s#/.test(value) || value.endsWith(':'))
|
|
77
|
+
return false;
|
|
78
|
+
// Control characters (newlines, tabs) cannot appear in a single-line scalar.
|
|
79
|
+
// eslint-disable-next-line no-control-regex
|
|
80
|
+
if (/[\x00-\x1f\x7f]/.test(value))
|
|
81
|
+
return false;
|
|
82
|
+
// A plain scalar resolving to a non-string type (boolean, null, number,
|
|
83
|
+
// timestamp) would violate this helper's string contract, so quote it.
|
|
84
|
+
if (/^(?:~|null|true|false|yes|no|on|off)$/i.test(value))
|
|
85
|
+
return false;
|
|
86
|
+
if (/^[-+]?(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|\d[\d_]*(?:\.[\d_]*)?(?:[eE][-+]?\d+)?|\.(?:inf|nan))$/i.test(value)) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
if (/^\d{4}-\d{1,2}-\d{1,2}(?:$|[Tt ])/.test(value))
|
|
90
|
+
return false;
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Emit a frontmatter scalar: unchanged when a plain scalar is safe, otherwise a
|
|
95
|
+
* double-quoted YAML string (JSON escapes are a subset of YAML's). Keeps the
|
|
96
|
+
* verify/onboard renders byte-identical while making any description safe.
|
|
97
|
+
*/
|
|
98
|
+
export function yamlScalar(value) {
|
|
99
|
+
return isPlainScalarSafe(value) ? value : JSON.stringify(value);
|
|
63
100
|
}
|
|
64
|
-
function
|
|
65
|
-
|
|
101
|
+
function wrapSkill(name, description, body, quote = true) {
|
|
102
|
+
const value = quote ? yamlScalar(description) : description;
|
|
103
|
+
return `---\nname: ${name}\ndescription: ${value}\n---\n\n${body}\n`;
|
|
104
|
+
}
|
|
105
|
+
function wrapMdc(_name, description, body, quote = true) {
|
|
106
|
+
const value = quote ? yamlScalar(description) : description;
|
|
107
|
+
return `---\ndescription: ${value}\nalwaysApply: false\n---\n\n${body}\n`;
|
|
66
108
|
}
|
|
67
109
|
/**
|
|
68
110
|
* Windsurf (Cascade) reads workspace rules from `.windsurf/rules/*.md` with YAML
|
|
@@ -72,8 +114,9 @@ function wrapMdc(_name, description, body) {
|
|
|
72
114
|
* relevant — exactly the on-demand activation these skills want. (The other
|
|
73
115
|
* triggers are `always_on`, `manual`, and `glob`.)
|
|
74
116
|
*/
|
|
75
|
-
function wrapWindsurf(_name, description, body) {
|
|
76
|
-
|
|
117
|
+
function wrapWindsurf(_name, description, body, quote = true) {
|
|
118
|
+
const value = quote ? yamlScalar(description) : description;
|
|
119
|
+
return `---\ntrigger: model_decision\ndescription: ${value}\n---\n\n${body}\n`;
|
|
77
120
|
}
|
|
78
121
|
/**
|
|
79
122
|
* GitHub Copilot reads path-specific custom instructions from
|
|
@@ -84,8 +127,9 @@ function wrapWindsurf(_name, description, body) {
|
|
|
84
127
|
* (there is no on-demand "model decides" mode for Copilot instruction files, so
|
|
85
128
|
* always-apply is the correct idiom). `description` is surfaced in Copilot's UI.
|
|
86
129
|
*/
|
|
87
|
-
function wrapCopilot(_name, description, body) {
|
|
88
|
-
|
|
130
|
+
function wrapCopilot(_name, description, body, quote = true) {
|
|
131
|
+
const value = quote ? yamlScalar(description) : description;
|
|
132
|
+
return `---\ndescription: ${value}\napplyTo: '**'\n---\n\n${body}\n`;
|
|
89
133
|
}
|
|
90
134
|
// ---------------------------------------------------------------------------
|
|
91
135
|
// Landing paths
|
|
@@ -390,6 +434,39 @@ export function renderOwnFileWithMarker(target, skill, markerLine, body) {
|
|
|
390
434
|
const resolvedBody = body !== undefined ? body : ownFileBodyFor(target, skill);
|
|
391
435
|
return injectMarkerLine(spec.wrap(skillSpec.name, skillSpec.description, resolvedBody), markerLine);
|
|
392
436
|
}
|
|
437
|
+
/**
|
|
438
|
+
* Render an own-file artifact the way v0.15.0 did: the description interpolated
|
|
439
|
+
* as an unquoted plain scalar. Kept only so install/status can recognise those
|
|
440
|
+
* files as pristine-but-outdated instead of user edits — never written.
|
|
441
|
+
*/
|
|
442
|
+
export function renderLegacyOwnFileWithMarker(target, skill, markerLine, body) {
|
|
443
|
+
const spec = TARGETS[target];
|
|
444
|
+
if (spec.mode !== 'own-file') {
|
|
445
|
+
throw new Error(`renderLegacyOwnFileWithMarker: ${target} is not an own-file target`);
|
|
446
|
+
}
|
|
447
|
+
const skillSpec = SKILLS[skill];
|
|
448
|
+
if (!skillSpec)
|
|
449
|
+
throw new Error(`unknown skill: ${skill}`);
|
|
450
|
+
const resolvedBody = body !== undefined ? body : ownFileBodyFor(target, skill);
|
|
451
|
+
return injectMarkerLine(spec.wrap(skillSpec.name, skillSpec.description, resolvedBody, false), markerLine);
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* True when `content` is exactly what v0.15.0 wrote for this (target, skill):
|
|
455
|
+
* the marker's hash still matches the canonical body, but the bytes only match
|
|
456
|
+
* the legacy unquoted render. Such files are stale installs, not user edits, so
|
|
457
|
+
* a plain `agent install` may repair them without `--force`.
|
|
458
|
+
*/
|
|
459
|
+
export function isLegacyOwnFileRender(target, skill, content, body) {
|
|
460
|
+
if (TARGETS[target].mode !== 'own-file')
|
|
461
|
+
return false;
|
|
462
|
+
const marker = parseSkillMarker(content);
|
|
463
|
+
if (marker === null)
|
|
464
|
+
return false;
|
|
465
|
+
const resolvedBody = body !== undefined ? body : ownFileBodyFor(target, skill);
|
|
466
|
+
if (marker.hash12 !== bodyHash12(resolvedBody))
|
|
467
|
+
return false;
|
|
468
|
+
return content === renderLegacyOwnFileWithMarker(target, skill, marker.line, resolvedBody);
|
|
469
|
+
}
|
|
393
470
|
/**
|
|
394
471
|
* The exact bytes to write for one skill on one target.
|
|
395
472
|
*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Argument, Command } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the formatted argument label matching Commander's display convention:
|
|
4
|
+
* `<name>` for required arguments, `[name]` for optional arguments, with `...`
|
|
5
|
+
* appended for variadic arguments.
|
|
6
|
+
*/
|
|
7
|
+
export declare function formatArgumentName(arg: Argument): string;
|
|
8
|
+
/**
|
|
9
|
+
* Validates positional arguments on a Commander command before its action executes.
|
|
10
|
+
* Rejects any empty string or whitespace-only positional argument (including variadics)
|
|
11
|
+
* with exit 5 VALIDATION_ERROR.
|
|
12
|
+
*/
|
|
13
|
+
export declare function validatePositionalArgs(command: Command): void;
|
package/dist/lib/args.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { localValidationError } from './errors.js';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the formatted argument label matching Commander's display convention:
|
|
4
|
+
* `<name>` for required arguments, `[name]` for optional arguments, with `...`
|
|
5
|
+
* appended for variadic arguments.
|
|
6
|
+
*/
|
|
7
|
+
export function formatArgumentName(arg) {
|
|
8
|
+
const name = arg.name() + (arg.variadic ? '...' : '');
|
|
9
|
+
return arg.required ? `<${name}>` : `[${name}]`;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Validates positional arguments on a Commander command before its action executes.
|
|
13
|
+
* Rejects any empty string or whitespace-only positional argument (including variadics)
|
|
14
|
+
* with exit 5 VALIDATION_ERROR.
|
|
15
|
+
*/
|
|
16
|
+
export function validatePositionalArgs(command) {
|
|
17
|
+
const registeredArgs = command.registeredArguments;
|
|
18
|
+
if (!registeredArgs || registeredArgs.length === 0) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const processedArgs = command.processedArgs;
|
|
22
|
+
if (!processedArgs || processedArgs.length === 0) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
for (let i = 0; i < registeredArgs.length; i++) {
|
|
26
|
+
const argDef = registeredArgs[i];
|
|
27
|
+
if (!argDef) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const val = processedArgs[i];
|
|
31
|
+
if (val === undefined) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
const argLabel = formatArgumentName(argDef);
|
|
35
|
+
if (typeof val === 'string') {
|
|
36
|
+
if (val.trim().length === 0) {
|
|
37
|
+
throw localValidationError(argLabel, 'cannot be empty or whitespace-only', undefined, 'argument');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else if (Array.isArray(val)) {
|
|
41
|
+
for (const item of val) {
|
|
42
|
+
if (typeof item === 'string' && item.trim().length === 0) {
|
|
43
|
+
throw localValidationError(argLabel, 'cannot be empty or whitespace-only', undefined, 'argument');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=args.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Return the RFC 7617 token, accepting raw UTF-8 pairs and existing base64 credentials. */
|
|
2
|
+
export declare function basicAuthToken(credential: string): string | null;
|
|
3
|
+
export declare const BASIC_AUTH_FORMAT = "Basic auth requires username:password or its base64 encoding.";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Return the RFC 7617 token, accepting raw UTF-8 pairs and existing base64 credentials. */
|
|
2
|
+
export function basicAuthToken(credential) {
|
|
3
|
+
const raw = credential.includes(':');
|
|
4
|
+
const token = raw ? '' : credential.trim().replace(/^basic[ \t]+/i, '');
|
|
5
|
+
const pair = raw ? Buffer.from(credential, 'utf8') : Buffer.from(token, 'base64');
|
|
6
|
+
if (!pair.includes(0x3a) || pair.some(byte => byte < 0x20 || byte === 0x7f))
|
|
7
|
+
return null;
|
|
8
|
+
const encoded = pair.toString('base64');
|
|
9
|
+
// Buffer.from silently skips invalid characters and accepts partial padding.
|
|
10
|
+
if (!raw && token !== encoded && token !== encoded.replace(/=+$/, ''))
|
|
11
|
+
return null;
|
|
12
|
+
return encoded;
|
|
13
|
+
}
|
|
14
|
+
export const BASIC_AUTH_FORMAT = 'Basic auth requires username:password or its base64 encoding.';
|
|
15
|
+
//# sourceMappingURL=basic-auth.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { resolvePortalBase } from './facade.js';
|
|
2
|
+
import { terminalSafeLine } from './terminal-text.js';
|
|
2
3
|
function hasPlaceholder(url) {
|
|
3
4
|
return (/^(undefined|null)$/i.test(url.hostname) || /\/(?:undefined|null)(?:\/|$)/i.test(url.pathname));
|
|
4
5
|
}
|
|
@@ -72,15 +73,15 @@ export function resolveBillingLinks(input) {
|
|
|
72
73
|
const orgId = safeOrgId(input.orgId);
|
|
73
74
|
const billing = (foundBilling !== undefined ? rebaseOntoOverride(foundBilling) : undefined) ??
|
|
74
75
|
(base
|
|
75
|
-
? `${base}${orgId ? `/dashboard-v3/o/${orgId}` : '/dashboard'}/settings/billing`
|
|
76
|
+
? `${base}${orgId ? `/dashboard-v3/o/${orgId}` : '/dashboard-v3'}/settings/billing`
|
|
76
77
|
: orgId
|
|
77
78
|
? `/dashboard-v3/o/${orgId}/settings/billing`
|
|
78
|
-
: '/dashboard/settings/billing');
|
|
79
|
+
: '/dashboard-v3/settings/billing');
|
|
79
80
|
return { pricing, billing };
|
|
80
81
|
}
|
|
81
82
|
/** One ` label: value` line, aligned like the CLI's other key/value output. */
|
|
82
83
|
function fact(label, value) {
|
|
83
|
-
return ` ${`${label}:`.padEnd(11)}${value}`;
|
|
84
|
+
return ` ${`${label}:`.padEnd(11)}${terminalSafeLine(value)}`;
|
|
84
85
|
}
|
|
85
86
|
function safeOrgId(value) {
|
|
86
87
|
return typeof value === 'string' &&
|
package/dist/lib/ci-linkage.d.ts
CHANGED
|
@@ -1,90 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* repo actually RECEIVES GitHub Deployment events. Those records are written by
|
|
6
|
-
* whatever deploys the app — Vercel's own GitHub App writes a `deployment` plus
|
|
7
|
-
* a `deployment_status`, GitHub broadcasts the event, and every subscriber
|
|
8
|
-
* (our workflow, the TestSprite GitHub App) sees the same one.
|
|
9
|
-
*
|
|
10
|
-
* When the deploy platform is not git-linked to the repo, nothing is ever
|
|
11
|
-
* written, so nothing ever fires — with no error anywhere. Measured on a real
|
|
12
|
-
* repo: the app deploys fine on Vercel while the repo's Deployments list is
|
|
13
|
-
* empty, which would leave a scaffolded gate permanently silent. This module
|
|
14
|
-
* turns that invisible state into a verdict.
|
|
15
|
-
*
|
|
16
|
-
* Pure functions only: the `gh`/`git` subprocess calls live in `commands/ci.ts`
|
|
17
|
-
* so this stays trivially testable.
|
|
18
|
-
*/
|
|
19
|
-
/** One GitHub Deployment record, reduced to what the verdict needs. */
|
|
20
|
-
export interface DeploymentRecord {
|
|
21
|
-
/** GitHub's environment label — "Preview", "Production", "preview", … */
|
|
22
|
-
environment: string;
|
|
23
|
-
/** ISO timestamp the record was created. */
|
|
24
|
-
createdAt: string;
|
|
25
|
-
/** Login that wrote the record (`vercel[bot]`, a user, a CI app). */
|
|
26
|
-
creator: string | null;
|
|
27
|
-
}
|
|
28
|
-
export type LinkageStatus =
|
|
29
|
-
/** Recent records exist — events reach this repo, a gate will fire. */
|
|
30
|
-
'linked'
|
|
31
|
-
/** Records exist but all are old — the link may have been removed since. */
|
|
32
|
-
| 'stale'
|
|
33
|
-
/** Records exist but none for a preview environment — a PR gate never fires. */
|
|
34
|
-
| 'production-only'
|
|
35
|
-
/** No records at all — either not linked, or linked and never deployed. */
|
|
36
|
-
| 'none';
|
|
37
|
-
export interface LinkageVerdict {
|
|
38
|
-
status: LinkageStatus;
|
|
39
|
-
/**
|
|
40
|
-
* Whether a deployment-gated workflow is safe to scaffold. Only `linked`
|
|
41
|
-
* qualifies: every other status means the gate would be silent or partial,
|
|
42
|
-
* which is the failure this check exists to prevent.
|
|
43
|
-
*/
|
|
44
|
-
ok: boolean;
|
|
45
|
-
/** One-line human explanation, ready to print. */
|
|
46
|
-
detail: string;
|
|
47
|
-
/**
|
|
48
|
-
* Timestamp of the record the verdict is ABOUT — the newest preview record
|
|
49
|
-
* for `linked`/`stale`, the newest record overall for `production-only` —
|
|
50
|
-
* or null when there are none.
|
|
51
|
-
*/
|
|
52
|
-
lastDeployAt: string | null;
|
|
53
|
-
/** Distinct creators seen, newest first — names who is writing the events. */
|
|
54
|
-
creators: string[];
|
|
55
|
-
/** Whether any record targets a preview environment. */
|
|
56
|
-
hasPreview: boolean;
|
|
57
|
-
}
|
|
58
|
-
/** "3 days ago" / "5 months ago", for the human line. */
|
|
59
|
-
export declare function describeAge(iso: string, now: Date): string;
|
|
60
|
-
/**
|
|
61
|
-
* Turn a repo's deployment history into a verdict.
|
|
62
|
-
*
|
|
63
|
-
* Deliberately NOT Vercel-specific on the success path: the event is the same
|
|
64
|
-
* whoever writes it, so a repo fed by Netlify, a self-hosted pipeline, or a
|
|
65
|
-
* hand-rolled `gh api` call reads as linked just the same. The creator is
|
|
66
|
-
* reported, not required.
|
|
67
|
-
*
|
|
68
|
-
* `records` may be in any order; the newest is picked here.
|
|
69
|
-
*/
|
|
70
|
-
export declare function classifyLinkage(records: readonly DeploymentRecord[], now: Date): LinkageVerdict;
|
|
71
|
-
/**
|
|
72
|
-
* Whether a string is safe to use as an `owner/repo` slug in a `gh api` path.
|
|
73
|
-
* The character class matches what GitHub itself allows in owner/repo names,
|
|
74
|
-
* but admits `.`/`..` — which as path SEGMENTS would make `repos/../../…`
|
|
75
|
-
* resolve to a different endpoint — so those are refused explicitly.
|
|
2
|
+
* Whether a string is a GitHub `owner/repo` slug. The character class matches
|
|
3
|
+
* what GitHub itself allows in owner/repo names, but admits `.`/`..`, which
|
|
4
|
+
* are path segments rather than names, so those are refused explicitly.
|
|
76
5
|
*/
|
|
77
6
|
export declare function isValidRepoSlug(slug: string): boolean;
|
|
78
7
|
/**
|
|
79
8
|
* `owner/repo` from a git remote URL. Handles the three shapes a cloned repo
|
|
80
9
|
* actually carries — SSH (`git@github.com:o/r.git`), HTTPS, and the `ssh://`
|
|
81
|
-
* form — and returns null for anything not on github.com
|
|
82
|
-
* Bitbucket remote has no GitHub Deployments to read.
|
|
10
|
+
* form — and returns null for anything not on github.com.
|
|
83
11
|
*/
|
|
84
12
|
export declare function parseRepoSlug(remoteUrl: string): string | null;
|
|
85
|
-
/**
|
|
86
|
-
* Reduce `gh api .../deployments` output to `DeploymentRecord`s. Tolerates the
|
|
87
|
-
* field being absent or oddly typed: a diagnosis must not crash on a payload
|
|
88
|
-
* shape change, it should just report what it could read.
|
|
89
|
-
*/
|
|
90
|
-
export declare function parseDeploymentsPayload(raw: string): DeploymentRecord[];
|
package/dist/lib/ci-linkage.js
CHANGED
|
@@ -1,126 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* repo actually RECEIVES GitHub Deployment events. Those records are written by
|
|
6
|
-
* whatever deploys the app — Vercel's own GitHub App writes a `deployment` plus
|
|
7
|
-
* a `deployment_status`, GitHub broadcasts the event, and every subscriber
|
|
8
|
-
* (our workflow, the TestSprite GitHub App) sees the same one.
|
|
9
|
-
*
|
|
10
|
-
* When the deploy platform is not git-linked to the repo, nothing is ever
|
|
11
|
-
* written, so nothing ever fires — with no error anywhere. Measured on a real
|
|
12
|
-
* repo: the app deploys fine on Vercel while the repo's Deployments list is
|
|
13
|
-
* empty, which would leave a scaffolded gate permanently silent. This module
|
|
14
|
-
* turns that invisible state into a verdict.
|
|
15
|
-
*
|
|
16
|
-
* Pure functions only: the `gh`/`git` subprocess calls live in `commands/ci.ts`
|
|
17
|
-
* so this stays trivially testable.
|
|
18
|
-
*/
|
|
19
|
-
/** How old the newest deployment may be before the link looks abandoned. */
|
|
20
|
-
const STALE_AFTER_DAYS = 90;
|
|
21
|
-
/** GitHub labels Vercel previews "Preview"; other platforms vary in case. */
|
|
22
|
-
function isPreviewEnvironment(environment) {
|
|
23
|
-
const env = environment.toLowerCase();
|
|
24
|
-
return env.includes('preview') || env.includes('staging');
|
|
25
|
-
}
|
|
26
|
-
function daysBetween(fromIso, now) {
|
|
27
|
-
const then = new Date(fromIso).getTime();
|
|
28
|
-
if (Number.isNaN(then))
|
|
29
|
-
return Number.POSITIVE_INFINITY;
|
|
30
|
-
return (now.getTime() - then) / 86_400_000;
|
|
31
|
-
}
|
|
32
|
-
/** "3 days ago" / "5 months ago", for the human line. */
|
|
33
|
-
export function describeAge(iso, now) {
|
|
34
|
-
const days = daysBetween(iso, now);
|
|
35
|
-
if (!Number.isFinite(days))
|
|
36
|
-
return 'at an unknown time';
|
|
37
|
-
if (days < 1)
|
|
38
|
-
return 'today';
|
|
39
|
-
if (days < 2)
|
|
40
|
-
return 'yesterday';
|
|
41
|
-
if (days < 45)
|
|
42
|
-
return `${Math.round(days)} days ago`;
|
|
43
|
-
return `${Math.round(days / 30)} months ago`;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Turn a repo's deployment history into a verdict.
|
|
47
|
-
*
|
|
48
|
-
* Deliberately NOT Vercel-specific on the success path: the event is the same
|
|
49
|
-
* whoever writes it, so a repo fed by Netlify, a self-hosted pipeline, or a
|
|
50
|
-
* hand-rolled `gh api` call reads as linked just the same. The creator is
|
|
51
|
-
* reported, not required.
|
|
52
|
-
*
|
|
53
|
-
* `records` may be in any order; the newest is picked here.
|
|
54
|
-
*/
|
|
55
|
-
export function classifyLinkage(records, now) {
|
|
56
|
-
if (records.length === 0) {
|
|
57
|
-
return {
|
|
58
|
-
status: 'none',
|
|
59
|
-
ok: false,
|
|
60
|
-
// The two causes are indistinguishable from GitHub's side — we cannot
|
|
61
|
-
// query another App's installations — so the verdict names both rather
|
|
62
|
-
// than guessing. `ci connect` resolves either one the same way.
|
|
63
|
-
detail: 'No deployment events on this repo. Either the deploy platform is not linked to it, ' +
|
|
64
|
-
'or it is linked and has not deployed yet — a deployment-gated workflow would never fire.',
|
|
65
|
-
lastDeployAt: null,
|
|
66
|
-
creators: [],
|
|
67
|
-
hasPreview: false,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
const sorted = [...records].sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
71
|
-
const creators = [...new Set(sorted.map(r => r.creator).filter((c) => !!c))];
|
|
72
|
-
// Classify per environment, never off the newest record overall. A repo that
|
|
73
|
-
// deploys production daily but whose last preview is months old would
|
|
74
|
-
// otherwise read as freshly `linked` — and a gate scaffolded on that verdict
|
|
75
|
-
// never fires, which is the exact silent failure this classifier exists to
|
|
76
|
-
// catch. (Boundary this accepts: a repo whose whole fetched page is
|
|
77
|
-
// production deploys newer than its last preview reads `production-only`
|
|
78
|
-
// rather than `stale` — both mean "no PR gate", not worth paging for.)
|
|
79
|
-
const previews = sorted.filter(r => isPreviewEnvironment(r.environment));
|
|
80
|
-
if (previews.length === 0) {
|
|
81
|
-
const newest = sorted[0];
|
|
82
|
-
const age = describeAge(newest.createdAt, now);
|
|
83
|
-
const by = newest.creator ? ` by ${newest.creator}` : '';
|
|
84
|
-
return {
|
|
85
|
-
status: 'production-only',
|
|
86
|
-
ok: false,
|
|
87
|
-
// A PR gate keys on preview deployments; production-only records mean the
|
|
88
|
-
// workflow would fire on releases and never on a pull request.
|
|
89
|
-
detail: `Only production deployment events on this repo (newest ${age}${by}), none for a preview environment. ` +
|
|
90
|
-
'A PR gate keys on preview deployments — enable preview deployments on your deploy platform.',
|
|
91
|
-
lastDeployAt: newest.createdAt,
|
|
92
|
-
creators,
|
|
93
|
-
hasPreview: false,
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
const newestPreview = previews[0];
|
|
97
|
-
const age = describeAge(newestPreview.createdAt, now);
|
|
98
|
-
const by = newestPreview.creator ? ` by ${newestPreview.creator}` : '';
|
|
99
|
-
if (daysBetween(newestPreview.createdAt, now) > STALE_AFTER_DAYS) {
|
|
100
|
-
return {
|
|
101
|
-
status: 'stale',
|
|
102
|
-
ok: false,
|
|
103
|
-
detail: `Preview deployment events exist, but the newest is from ${age}${by}. ` +
|
|
104
|
-
'The link may have been removed since — push a commit and re-check before relying on a gate.',
|
|
105
|
-
lastDeployAt: newestPreview.createdAt,
|
|
106
|
-
creators,
|
|
107
|
-
hasPreview: true,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
return {
|
|
111
|
-
status: 'linked',
|
|
112
|
-
ok: true,
|
|
113
|
-
detail: `Preview deployment events reach this repo (newest preview ${age}${by}).`,
|
|
114
|
-
lastDeployAt: newestPreview.createdAt,
|
|
115
|
-
creators,
|
|
116
|
-
hasPreview: true,
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Whether a string is safe to use as an `owner/repo` slug in a `gh api` path.
|
|
121
|
-
* The character class matches what GitHub itself allows in owner/repo names,
|
|
122
|
-
* but admits `.`/`..` — which as path SEGMENTS would make `repos/../../…`
|
|
123
|
-
* resolve to a different endpoint — so those are refused explicitly.
|
|
2
|
+
* Whether a string is a GitHub `owner/repo` slug. The character class matches
|
|
3
|
+
* what GitHub itself allows in owner/repo names, but admits `.`/`..`, which
|
|
4
|
+
* are path segments rather than names, so those are refused explicitly.
|
|
124
5
|
*/
|
|
125
6
|
export function isValidRepoSlug(slug) {
|
|
126
7
|
if (!/^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/.test(slug))
|
|
@@ -130,8 +11,7 @@ export function isValidRepoSlug(slug) {
|
|
|
130
11
|
/**
|
|
131
12
|
* `owner/repo` from a git remote URL. Handles the three shapes a cloned repo
|
|
132
13
|
* actually carries — SSH (`git@github.com:o/r.git`), HTTPS, and the `ssh://`
|
|
133
|
-
* form — and returns null for anything not on github.com
|
|
134
|
-
* Bitbucket remote has no GitHub Deployments to read.
|
|
14
|
+
* form — and returns null for anything not on github.com.
|
|
135
15
|
*/
|
|
136
16
|
export function parseRepoSlug(remoteUrl) {
|
|
137
17
|
const url = remoteUrl.trim();
|
|
@@ -145,37 +25,4 @@ export function parseRepoSlug(remoteUrl) {
|
|
|
145
25
|
return null;
|
|
146
26
|
return isValidRepoSlug(slug) ? slug : null;
|
|
147
27
|
}
|
|
148
|
-
/**
|
|
149
|
-
* Reduce `gh api .../deployments` output to `DeploymentRecord`s. Tolerates the
|
|
150
|
-
* field being absent or oddly typed: a diagnosis must not crash on a payload
|
|
151
|
-
* shape change, it should just report what it could read.
|
|
152
|
-
*/
|
|
153
|
-
export function parseDeploymentsPayload(raw) {
|
|
154
|
-
let parsed;
|
|
155
|
-
try {
|
|
156
|
-
parsed = JSON.parse(raw);
|
|
157
|
-
}
|
|
158
|
-
catch {
|
|
159
|
-
return [];
|
|
160
|
-
}
|
|
161
|
-
if (!Array.isArray(parsed))
|
|
162
|
-
return [];
|
|
163
|
-
return (parsed
|
|
164
|
-
.filter((row) => row !== null && typeof row === 'object')
|
|
165
|
-
.map(row => {
|
|
166
|
-
const creator = row.creator;
|
|
167
|
-
const login = creator !== null && typeof creator === 'object'
|
|
168
|
-
? creator.login
|
|
169
|
-
: undefined;
|
|
170
|
-
return {
|
|
171
|
-
environment: typeof row.environment === 'string' ? row.environment : '',
|
|
172
|
-
createdAt: typeof row.created_at === 'string' ? row.created_at : '',
|
|
173
|
-
creator: typeof login === 'string' ? login : null,
|
|
174
|
-
};
|
|
175
|
-
})
|
|
176
|
-
// A row without a PARSEABLE timestamp can't be aged or ordered — one NaN
|
|
177
|
-
// in the sort comparator would make the whole ordering implementation-
|
|
178
|
-
// defined — so it is dropped rather than silently treated as epoch.
|
|
179
|
-
.filter(r => Number.isFinite(new Date(r.createdAt).getTime())));
|
|
180
|
-
}
|
|
181
28
|
//# sourceMappingURL=ci-linkage.js.map
|
package/dist/lib/ci-run.js
CHANGED
|
@@ -4,7 +4,7 @@ import { resolveWaitFailure } from './wait-exit.js';
|
|
|
4
4
|
export function resolveCiRunFailure(summary, accepted, opts,
|
|
5
5
|
/** The batch's `conflicts[]`, with their reasons, when the caller has them. */
|
|
6
6
|
conflicts = []) {
|
|
7
|
-
const missing = summary.
|
|
7
|
+
const missing = summary.results.filter(row => row.status === 'not_found');
|
|
8
8
|
if (missing.length > 0) {
|
|
9
9
|
return new CLIError(`Tests not found: ${missing.map(row => row.testId).join(', ')}`, 4);
|
|
10
10
|
}
|
|
@@ -10,14 +10,15 @@
|
|
|
10
10
|
* impl. Doing that once here is safer than three near-copies.
|
|
11
11
|
*
|
|
12
12
|
* The factory is intentionally narrow: it only takes the HTTP-relevant
|
|
13
|
-
* deps. Per-command deps (auth's `prompt`, test's `
|
|
13
|
+
* deps. Per-command deps (auth's `prompt`, test's `createTunnelClient`) stay
|
|
14
14
|
* with the command.
|
|
15
15
|
*/
|
|
16
|
+
import type { Command } from 'commander';
|
|
16
17
|
import { type Config } from './config.js';
|
|
17
18
|
import type { DebugEvent, FetchImpl, HttpClientOptions } from './http.js';
|
|
18
19
|
import { HttpClient } from './http.js';
|
|
19
20
|
import { type ShutdownHandle } from './interrupt.js';
|
|
20
|
-
import type
|
|
21
|
+
import { type OutputMode } from './output.js';
|
|
21
22
|
export interface CommonOptions {
|
|
22
23
|
profile: string;
|
|
23
24
|
output: OutputMode;
|
|
@@ -167,6 +168,13 @@ export declare function assertValidApiKeyHeaderValue(apiKey: string): void;
|
|
|
167
168
|
* would have silently changed timeout behaviour depending on the command.
|
|
168
169
|
*/
|
|
169
170
|
export declare function parseRequestTimeoutFlag(raw: string | undefined): number | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* The global flags as a command reads them (`--profile`, `--output`,
|
|
173
|
+
* `--dry-run`, `--endpoint-url`, `--debug`, `--verbose`, `--request-timeout`).
|
|
174
|
+
* An invalid `--output` or `--request-timeout` is a validation error (exit 5),
|
|
175
|
+
* never a silent fall-back.
|
|
176
|
+
*/
|
|
177
|
+
export declare function resolveCommonOptions(command: Command, env?: NodeJS.ProcessEnv): CommonOptions;
|
|
170
178
|
export declare function makeHttpClient(opts: CommonOptions, deps?: ClientFactoryDeps): HttpClient;
|
|
171
179
|
export type HttpClientFactory = (overrides?: Pick<HttpClientOptions, 'requestTimeoutMs' | 'shutdownSignal'>) => HttpClient;
|
|
172
180
|
/** Resolve the profile once so related requests share an identity and endpoint. */
|