@testsprite/testsprite-cli 0.6.0 → 0.8.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.
Files changed (96) hide show
  1. package/README.md +52 -31
  2. package/dist/commands/agent.js +91 -45
  3. package/dist/commands/ci.d.ts +88 -0
  4. package/dist/commands/ci.js +429 -0
  5. package/dist/commands/doctor.d.ts +1 -1
  6. package/dist/commands/doctor.js +104 -8
  7. package/dist/commands/init.js +8 -0
  8. package/dist/commands/project.d.ts +78 -0
  9. package/dist/commands/project.js +429 -5
  10. package/dist/commands/schedule.d.ts +120 -0
  11. package/dist/commands/schedule.js +487 -0
  12. package/dist/commands/test.d.ts +176 -2
  13. package/dist/commands/test.js +2235 -609
  14. package/dist/commands/testlist.d.ts +88 -0
  15. package/dist/commands/testlist.js +753 -0
  16. package/dist/commands/tunnel.d.ts +72 -0
  17. package/dist/commands/tunnel.js +367 -0
  18. package/dist/index.js +113 -40
  19. package/dist/lib/agent-targets.d.ts +13 -4
  20. package/dist/lib/agent-targets.js +11 -2
  21. package/dist/lib/conflict-reason.d.ts +30 -0
  22. package/dist/lib/conflict-reason.js +45 -0
  23. package/dist/lib/credentials.js +42 -1
  24. package/dist/lib/cron.d.ts +40 -0
  25. package/dist/lib/cron.js +190 -0
  26. package/dist/lib/dry-run/samples.d.ts +9 -0
  27. package/dist/lib/dry-run/samples.js +293 -55
  28. package/dist/lib/errors.d.ts +9 -0
  29. package/dist/lib/errors.js +11 -0
  30. package/dist/lib/gh-output.d.ts +33 -1
  31. package/dist/lib/gh-output.js +97 -27
  32. package/dist/lib/http.d.ts +119 -0
  33. package/dist/lib/http.js +243 -2
  34. package/dist/lib/interrupt.d.ts +38 -13
  35. package/dist/lib/interrupt.js +130 -15
  36. package/dist/lib/junit-report.d.ts +20 -2
  37. package/dist/lib/junit-report.js +38 -5
  38. package/dist/lib/local-target.d.ts +95 -0
  39. package/dist/lib/local-target.js +184 -0
  40. package/dist/lib/plan-poll.d.ts +171 -0
  41. package/dist/lib/plan-poll.js +442 -0
  42. package/dist/lib/plans.types.d.ts +130 -0
  43. package/dist/lib/plans.types.js +31 -0
  44. package/dist/lib/poll-support.d.ts +26 -0
  45. package/dist/lib/poll-support.js +65 -0
  46. package/dist/lib/poll.d.ts +1 -0
  47. package/dist/lib/poll.js +2 -40
  48. package/dist/lib/proxy.d.ts +16 -0
  49. package/dist/lib/proxy.js +19 -1
  50. package/dist/lib/response-schemas.d.ts +20 -0
  51. package/dist/lib/response-schemas.js +55 -1
  52. package/dist/lib/run-progress.d.ts +41 -0
  53. package/dist/lib/run-progress.js +56 -0
  54. package/dist/lib/runs.types.d.ts +32 -3
  55. package/dist/lib/secret-file.d.ts +15 -0
  56. package/dist/lib/secret-file.js +82 -0
  57. package/dist/lib/target-url-preflight.d.ts +91 -0
  58. package/dist/lib/target-url-preflight.js +259 -0
  59. package/dist/lib/target-url.d.ts +63 -9
  60. package/dist/lib/target-url.js +283 -62
  61. package/dist/lib/telemetry.d.ts +11 -0
  62. package/dist/lib/telemetry.js +1 -0
  63. package/dist/lib/testlist.types.d.ts +77 -0
  64. package/dist/lib/testlist.types.js +9 -0
  65. package/dist/lib/ticker.d.ts +8 -0
  66. package/dist/lib/ticker.js +3 -0
  67. package/dist/lib/tunnel-session.d.ts +129 -0
  68. package/dist/lib/tunnel-session.js +232 -0
  69. package/dist/lib/tunnel.types.d.ts +54 -0
  70. package/dist/lib/tunnel.types.js +8 -0
  71. package/dist/lib/v3-advisory.d.ts +35 -22
  72. package/dist/lib/v3-advisory.js +44 -24
  73. package/dist/lib/wait-exit.d.ts +29 -0
  74. package/dist/lib/wait-exit.js +103 -0
  75. package/dist/vendor/tunnel-client/client.d.ts +83 -0
  76. package/dist/vendor/tunnel-client/client.js +871 -0
  77. package/dist/vendor/tunnel-client/config.d.ts +41 -0
  78. package/dist/vendor/tunnel-client/config.js +42 -0
  79. package/dist/vendor/tunnel-client/index.d.ts +9 -0
  80. package/dist/vendor/tunnel-client/index.js +9 -0
  81. package/dist/vendor/tunnel-client/lodash-lite.d.ts +14 -0
  82. package/dist/vendor/tunnel-client/lodash-lite.js +24 -0
  83. package/dist/vendor/tunnel-client/protocol.d.ts +60 -0
  84. package/dist/vendor/tunnel-client/protocol.js +143 -0
  85. package/dist/vendor/tunnel-client/types.d.ts +96 -0
  86. package/dist/vendor/tunnel-client/types.js +10 -0
  87. package/dist/vendor/tunnel-client/ws-compat.d.ts +206 -0
  88. package/dist/vendor/tunnel-client/ws-compat.js +316 -0
  89. package/dist/version-guard.d.ts +10 -7
  90. package/dist/version-guard.js +37 -9
  91. package/dist/version.d.ts +1 -1
  92. package/dist/version.js +1 -1
  93. package/package.json +2 -1
  94. package/skills/testsprite-onboard.skill.md +60 -4
  95. package/skills/testsprite-verify.codex.md +22 -16
  96. package/skills/testsprite-verify.skill.md +27 -18
@@ -0,0 +1,259 @@
1
+ /**
2
+ * Pre-charge reachability preflight for a caller-supplied `--target-url`.
3
+ *
4
+ * A blocked-run analysis measured 1,003 blocked-with-URL CLI runs: 26%
5
+ * pointed at a third-party tunnel host (`*.trycloudflare.com`, `*.loca.lt`,
6
+ * ngrok), 55.5% of those were blocked, and every one of them was charged
7
+ * anyway — the run row and its credit spend happen before the Lambda ever
8
+ * discovers the target is dead. This probe runs BEFORE the trigger POST so
9
+ * an obviously-doomed run never gets a run row or a charge.
10
+ *
11
+ * **Honest limitation** (this must also be stated in `--help` and the PR
12
+ * body): the probe below runs from wherever this CLI process runs — the
13
+ * caller's laptop, a CI runner — while the actual test executes from a
14
+ * Lambda inside AWS. Reachability from one is not proof of reachability
15
+ * from the other. That asymmetry is why the refusal set is deliberately
16
+ * narrow (only the failure classes that analysis actually measured — a
17
+ * broader rule would not have prevented a single one of those 1,003 runs), why
18
+ * every ambiguous signal downgrades to a warning instead of a hard block,
19
+ * and why `--skip-preflight` exists as a full opt-out (zero network calls).
20
+ *
21
+ * Two injectable seams, mirroring the MCP plugin's `checkPortListening`
22
+ * shape (a cheap first check, then an HTTP-level fallback for the signal
23
+ * the first check can't see) rather than inventing a new one:
24
+ * - `dnsLookup` — a raw DNS resolution. Deliberately separate from the
25
+ * HTTP probe below: `proxy.ts` installs a proxy dispatcher that only
26
+ * `fetch()` honours, never a raw socket/DNS call, so behind a
27
+ * configured HTTP(S) proxy this step can fail locally (the real
28
+ * resolution happens at the proxy) even though the target is reachable
29
+ * — hence the proxy carve-out downgrades a negative *failure* result
30
+ * here. A resolved address landing in the private/loopback/link-local/
31
+ * metadata range is a different kind of signal (DNS rebinding, not
32
+ * ambiguity about where resolution happens) and always refuses — see
33
+ * the resolved-address check below.
34
+ * - `fetchImpl` — the actual HTTP probe (proxy-aware once a proxy
35
+ * dispatcher is installed), used for the 502/503/504 gateway-error
36
+ * signal a DNS/TCP-level check cannot see at all. Runs with
37
+ * `redirect: 'manual'`: a 3xx is treated as a live/reachable signal
38
+ * (a real app 302ing to a login page is healthy) but is never
39
+ * followed — the redirect target is unvalidated by everything above
40
+ * (`assertNotLocal` only ever inspected the literal `--target-url`
41
+ * string; the resolved-address check only covers *this* URL's host),
42
+ * so following it would hand an attacker-controlled Location header a
43
+ * live SSRF primitive running on the caller's machine or CI runner.
44
+ */
45
+ import * as dns from 'node:dns';
46
+ import { isIP } from 'node:net';
47
+ import { ApiError } from './errors.js';
48
+ import { isProxyAgentActive } from './proxy.js';
49
+ import { disallowedIpReason } from './target-url.js';
50
+ /** ~8s, matching the MCP plugin's `checkPortListening` TCP-probe budget. */
51
+ const PREFLIGHT_TIMEOUT_MS = 8_000;
52
+ const GATEWAY_ERROR_STATUSES = new Set([502, 503, 504]);
53
+ /** Pulls the string addresses out of a `dns.lookup` result, whether it's a
54
+ * single `{ address, family }` object (the no-options default) or an array
55
+ * of them (the `{ all: true }` shape the real default below requests, so a
56
+ * dual-stack host's A *and* AAAA records are both checked). */
57
+ function resolvedAddresses(lookupResult) {
58
+ const records = Array.isArray(lookupResult) ? lookupResult : [lookupResult];
59
+ return records
60
+ .map(r => r?.address)
61
+ .filter((a) => typeof a === 'string');
62
+ }
63
+ /**
64
+ * True when `err` (or a `cause` nested inside it — including an
65
+ * `AggregateError`'s `.errors[]`, the shape undici throws for a dual-stack
66
+ * host where one address family connects and the other refuses) carries
67
+ * one of `codes` as its `code`.
68
+ */
69
+ function errorHasCode(err, codes) {
70
+ const top = err?.code;
71
+ if (typeof top === 'string' && codes.includes(top))
72
+ return true;
73
+ const cause = err?.cause;
74
+ const causeCode = cause?.code;
75
+ if (typeof causeCode === 'string' && codes.includes(causeCode))
76
+ return true;
77
+ const aggErrors = cause?.errors;
78
+ if (Array.isArray(aggErrors)) {
79
+ return aggErrors.some(e => {
80
+ const code = e?.code;
81
+ return typeof code === 'string' && codes.includes(code);
82
+ });
83
+ }
84
+ return false;
85
+ }
86
+ function isTimeoutError(err) {
87
+ const name = err?.name;
88
+ return name === 'AbortError' || name === 'TimeoutError';
89
+ }
90
+ /** Strips the `[...]` bracket notation the WHATWG `URL.hostname` getter uses for IPv6 literals. */
91
+ function bareHost(hostname) {
92
+ return hostname.startsWith('[') && hostname.endsWith(']') ? hostname.slice(1, -1) : hostname;
93
+ }
94
+ /**
95
+ * Probe `rawUrl` for the narrow refusal set described in the module
96
+ * docstring. Pure decision function — never throws for a network failure
97
+ * (every reachable failure classifies to `warn` or `refuse`); a malformed
98
+ * URL degrades to `warn` rather than crashing (callers validate the URL
99
+ * shape via `assertNotLocal` before this runs).
100
+ */
101
+ export async function probeTargetUrl(rawUrl, deps = {}) {
102
+ const proxied = deps.proxyActive ?? isProxyAgentActive();
103
+ let parsed;
104
+ try {
105
+ parsed = new URL(rawUrl);
106
+ }
107
+ catch {
108
+ return { verdict: 'warn', reason: 'could not parse --target-url for the reachability probe' };
109
+ }
110
+ const host = bareHost(parsed.hostname);
111
+ // Step 1 — DNS. Skipped for a literal IP host (nothing to resolve, and
112
+ // dns.lookup on a literal is a needless round trip through the resolver).
113
+ if (isIP(host) === 0) {
114
+ const dnsLookup = deps.dnsLookup ?? ((hostname) => dns.promises.lookup(hostname, { all: true }));
115
+ let lookupResult;
116
+ try {
117
+ lookupResult = await dnsLookup(host);
118
+ }
119
+ catch (err) {
120
+ const code = err?.code;
121
+ if (code === 'ENOTFOUND' || code === 'EAI_NONAME') {
122
+ if (proxied) {
123
+ return {
124
+ verdict: 'warn',
125
+ reason: `DNS lookup for "${host}" failed locally (${code}) — not conclusive behind a configured proxy`,
126
+ };
127
+ }
128
+ return {
129
+ verdict: 'refuse',
130
+ reason: `--target-url host "${host}" does not resolve (${code})`,
131
+ };
132
+ }
133
+ // Anything else (e.g. EAI_AGAIN — a transient resolver hiccup) is
134
+ // ambiguous, not a confirmed dead target — warn, never refuse.
135
+ return {
136
+ verdict: 'warn',
137
+ reason: `DNS lookup for "${host}" failed (${typeof code === 'string' ? code : 'unknown error'})`,
138
+ };
139
+ }
140
+ // DNS rebinding: a public-looking hostname (e.g. an attacker-controlled
141
+ // domain, or a tunnel host with attacker-influenced DNS) whose A/AAAA
142
+ // record actually points at a private, loopback, link-local, or
143
+ // metadata-service address. `assertNotLocal` never catches this — it
144
+ // only ever inspected the literal `--target-url` *string*, and this
145
+ // hostname passed that check honestly (it doesn't LOOK private). Unlike
146
+ // the DNS-failure branch above, there is no proxy carve-out: resolving
147
+ // locally to a private address is a security signal, not an ambiguous
148
+ // "can't tell from here" result, and a false positive has a documented
149
+ // escape hatch (`--skip-preflight`) rather than a broken workflow.
150
+ for (const address of resolvedAddresses(lookupResult)) {
151
+ const blocked = disallowedIpReason(address);
152
+ if (blocked !== undefined) {
153
+ return {
154
+ verdict: 'refuse',
155
+ reason: `--target-url host "${host}" resolves to ${address} (${blocked.reason})`,
156
+ };
157
+ }
158
+ }
159
+ }
160
+ // Step 2 — HTTP probe. Runs through the global `fetch`, which picks up
161
+ // the proxy dispatcher `proxy.ts` installs at startup when one is
162
+ // configured — so this step (unlike the DNS step above) is proxy-aware
163
+ // by construction, not just proxy-tolerant.
164
+ const fetchImpl = deps.fetchImpl ?? fetch;
165
+ try {
166
+ const resp = await fetchImpl(rawUrl, {
167
+ method: 'GET',
168
+ // Never follow — see the module docstring. A 3xx is reachability
169
+ // proof on its own (handled immediately below); the redirect target
170
+ // is unvalidated and must not be dereferenced.
171
+ redirect: 'manual',
172
+ signal: AbortSignal.timeout(PREFLIGHT_TIMEOUT_MS),
173
+ });
174
+ // Never read the body — only the status matters here. Cancel it so the
175
+ // connection is released promptly instead of buffering a full page.
176
+ void resp.body?.cancel().catch(() => undefined);
177
+ if (resp.status >= 300 && resp.status < 400) {
178
+ // A redirect is a live-server signal (e.g. a real app 302ing an
179
+ // unauthenticated GET to a login page) — reachable, not refused. The
180
+ // Location header is deliberately never inspected or dereferenced.
181
+ return { verdict: 'ok' };
182
+ }
183
+ if (GATEWAY_ERROR_STATUSES.has(resp.status)) {
184
+ if (proxied) {
185
+ return {
186
+ verdict: 'warn',
187
+ reason: `--target-url responded HTTP ${resp.status} — not conclusive behind a configured proxy`,
188
+ };
189
+ }
190
+ return {
191
+ verdict: 'refuse',
192
+ reason: `--target-url responded HTTP ${resp.status} (gateway error — the target is unreachable)`,
193
+ };
194
+ }
195
+ if (resp.status >= 400) {
196
+ return { verdict: 'warn', reason: `--target-url responded HTTP ${resp.status}` };
197
+ }
198
+ return { verdict: 'ok' };
199
+ }
200
+ catch (err) {
201
+ if (errorHasCode(err, ['ECONNREFUSED'])) {
202
+ if (proxied) {
203
+ return {
204
+ verdict: 'warn',
205
+ reason: 'connection to --target-url was refused — not conclusive behind a configured proxy',
206
+ };
207
+ }
208
+ return { verdict: 'refuse', reason: 'connection to --target-url was refused (ECONNREFUSED)' };
209
+ }
210
+ if (isTimeoutError(err)) {
211
+ return {
212
+ verdict: 'warn',
213
+ reason: `--target-url did not respond within ${PREFLIGHT_TIMEOUT_MS / 1000}s`,
214
+ };
215
+ }
216
+ // TLS errors and anything else unclassified: warn only — the refusal
217
+ // set stays narrow to exactly what that analysis measured.
218
+ return {
219
+ verdict: 'warn',
220
+ reason: `could not reach --target-url (${err instanceof Error ? err.message : String(err)})`,
221
+ };
222
+ }
223
+ }
224
+ /** Shared wording so `--help` and every refuse/warn message agree on the escape hatch. */
225
+ const SKIP_HINT = 'Skip this check entirely with --skip-preflight.';
226
+ /**
227
+ * Run the preflight and either throw (refuse), print an `[advisory]` line
228
+ * (warn), or no-op (ok / skipped). This is the call-site integration point
229
+ * — wired at all four `--target-url` trigger paths, after `assertNotLocal`
230
+ * and before the trigger POST.
231
+ *
232
+ * `skipPreflight: true` makes this a pure no-op with ZERO network calls —
233
+ * neither `dnsLookup` nor `fetchImpl` is invoked.
234
+ */
235
+ export async function assertTargetUrlReachable(targetUrl, opts, deps, stderrFn) {
236
+ if (opts.skipPreflight === true)
237
+ return;
238
+ const outcome = await probeTargetUrl(targetUrl, deps);
239
+ if (outcome.verdict === 'refuse') {
240
+ throw ApiError.fromEnvelope({
241
+ error: {
242
+ code: 'VALIDATION_ERROR',
243
+ message: `--target-url is not reachable: ${outcome.reason}.`,
244
+ nextAction: 'This CLI probes reachability from where the CLI runs, not from the Lambda that ' +
245
+ 'executes the test — a false positive is possible (e.g. an IP allowlist that permits ' +
246
+ `the Lambda but not this machine). If you're confident the target is reachable from the ` +
247
+ `test runner, retry with --skip-preflight. ${SKIP_HINT}`,
248
+ requestId: 'local',
249
+ details: { field: 'targetUrl', reason: 'target-unreachable', probeReason: outcome.reason },
250
+ },
251
+ });
252
+ }
253
+ if (outcome.verdict === 'warn') {
254
+ stderrFn(`[advisory] --target-url may not be reachable (${outcome.reason}); proceeding anyway ` +
255
+ `(the CLI probes from where it runs, not from the Lambda that executes the test, so this ` +
256
+ `is not conclusive). ${SKIP_HINT}`);
257
+ }
258
+ }
259
+ //# sourceMappingURL=target-url-preflight.js.map
@@ -2,24 +2,78 @@
2
2
  * CLI-side pre-flight guard for `--target-url`.
3
3
  *
4
4
  * Defense-in-depth: the backend is the trust boundary and performs DNS
5
- * resolution. This guard does **string/literal-only** checks to give a
6
- * fast, friendly error before sending the request. It cannot detect
7
- * DNS rebinding (a public hostname that resolves to a private IP) — the
8
- * backend catches that.
5
+ * resolution. `assertNotLocal` below does **literal-only** checks
6
+ * to give a fast, friendly error before sending the request — it cannot by
7
+ * itself detect DNS rebinding (a public hostname that resolves to a private
8
+ * IP). That gap is closed one layer up: `target-url-preflight.ts` reuses
9
+ * `disallowedIpReason` (exported below) against the actually-*resolved*
10
+ * address before probing, so the same range list guards both the literal
11
+ * string and the DNS answer — not two drifting copies of it.
9
12
  *
10
13
  * CLI-side target-url guard (exit 5 on any rejection):
11
14
  * - Reject non-http(s) schemes
12
- * - Reject `localhost`, `127.0.0.0/8`, `0.0.0.0`, and IPv6 loopback/unspecified (`::1`, `::`)
15
+ * - Reject `localhost`, `127.0.0.0/8`, `0.0.0.0/8`, and IPv6 loopback/unspecified (`::1`, `::`)
13
16
  * - Reject `169.254.0.0/16` link-local and the `169.254.169.254` metadata address
14
17
  * - Reject RFC1918 literal IPv4 (10.x, 172.16-31.x, 192.168.x)
15
- * - Reject IPv4-mapped IPv6 (`::ffff:…`), IPv6 link-local (`fe80::/10`), unique-local (`fc00::/7`)
16
- * - Hostnames that resolve to private IPs are the backend's concern.
18
+ * - Reject carrier-grade NAT (`100.64.0.0/10`), multicast (`224.0.0.0/4`),
19
+ * and class E / limited broadcast (`240.0.0.0/4`)
20
+ * - Decode and re-classify the low 32 bits of standard embedded-IPv4 forms:
21
+ * IPv4-mapped/translated, RFC 6052 NAT64 (`64:ff9b::/96`), and deprecated
22
+ * IPv4-compatible (`::/96`); public embedded IPv4 addresses stay allowed
23
+ * - Reject RFC 8215's NAT64 local-use range (`64:ff9b:1::/48`) wholesale
24
+ * - Reject IPv6 link-local (`fe80::/10`), unique-local (`fc00::/7`), and
25
+ * deprecated site-local (`fec0::/10`)
17
26
  */
18
27
  /**
19
28
  * Throws a local `VALIDATION_ERROR` (exit 5) when `rawUrl` is a
20
- * disallowed target — localhost, RFC1918 literal IP, link-local, or
21
- * metadata-service address. Also rejects non-http(s) schemes.
29
+ * disallowed target — localhost or a private/reserved literal IP. Also rejects
30
+ * non-http(s) schemes.
22
31
  *
23
32
  * Silently returns on allowed URLs.
24
33
  */
25
34
  export declare function assertNotLocal(rawUrl: string): void;
35
+ /**
36
+ * One disallowed-address classification: the human-readable reason (used
37
+ * verbatim in the rejection message — unchanged wording, not a new
38
+ * classification) plus a `hintKind` telling `assertNotLocal` which hint, if
39
+ * any, is honest to attach:
40
+ * - `'loopback'` — exactly the host set `--local-host` accepts
41
+ * (`localhost`, `127.0.0.1`, `::1`) plus the two unspecified addresses
42
+ * (`0.0.0.0`, `::`), which `--local`'s default dial also reaches because
43
+ * binding to "all interfaces" includes the loopback one; hint `--local`.
44
+ * - `'loopback-other'` — the REST of `127.0.0.0/8` (e.g. `127.0.0.2`). This
45
+ * is loopback-range and unreachable from outside the machine, same as
46
+ * `'loopback'` above, but `--local-host` cannot dial it by name — an app
47
+ * bound only to `127.0.0.2` does not answer on `127.0.0.1`. Hinting
48
+ * `--local` here would recommend a command that cannot reach the address
49
+ * it was just told about, so this gets no hint (a caller who reads the
50
+ * reason can rebind their dev server onto `127.0.0.1` and get `--local`
51
+ * to work, but that's their call to make, not a claim this code asserts).
52
+ * - `'private'` — `--local` can never reach this class even in principle;
53
+ * hint that plainly, with no tunnel suggestion.
54
+ * - `'undecided'` — the address genuinely cannot be decoded safely (currently
55
+ * RFC 8215's `/48` NAT64 local-use range, whose embedded bit position differs
56
+ * from the `/96` well-known prefix), so neither hint is knowably true.
57
+ *
58
+ * `target-url-preflight.ts` uses only `.reason` and is unaffected by this
59
+ * field's addition.
60
+ */
61
+ export interface DisallowedIpClassification {
62
+ reason: string;
63
+ hintKind: 'loopback' | 'loopback-other' | 'private' | 'undecided';
64
+ }
65
+ /**
66
+ * Classify a bare IP-address literal — IPv4 dotted form, or IPv6 optionally
67
+ * wrapped in the `[...]` bracket notation `URL.hostname` uses — against the
68
+ * private/loopback/link-local/metadata blocklist. Returns the disallowed
69
+ * classification, or `undefined` when the address is allowed.
70
+ *
71
+ * This is the single source of truth for the range list: `assertNotLocal`
72
+ * calls it for the literal `--target-url` string above, and the reachability
73
+ * preflight (`target-url-preflight.ts`) calls it again for a DNS-*resolved*
74
+ * address — a public-looking hostname whose A/AAAA record actually points
75
+ * at a private or metadata IP (DNS rebinding) is a distinct bypass from a
76
+ * literal private IP typed on the command line, and both need the same
77
+ * range list, not two drifting copies of it.
78
+ */
79
+ export declare function disallowedIpReason(host: string): DisallowedIpClassification | undefined;