@testsprite/testsprite-cli 0.12.0 → 0.14.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 (113) hide show
  1. package/README.md +59 -49
  2. package/dist/commands/agent.js +16 -13
  3. package/dist/commands/auth.d.ts +19 -0
  4. package/dist/commands/auth.js +60 -24
  5. package/dist/commands/ci.d.ts +86 -1
  6. package/dist/commands/ci.js +436 -5
  7. package/dist/commands/doctor.d.ts +2 -0
  8. package/dist/commands/doctor.js +34 -20
  9. package/dist/commands/init.js +14 -11
  10. package/dist/commands/project-env.d.ts +11 -1
  11. package/dist/commands/project-env.js +408 -70
  12. package/dist/commands/project-sign-in.d.ts +60 -0
  13. package/dist/commands/project-sign-in.js +289 -0
  14. package/dist/commands/project.d.ts +14 -5
  15. package/dist/commands/project.js +110 -70
  16. package/dist/commands/schedule.d.ts +14 -0
  17. package/dist/commands/schedule.js +193 -15
  18. package/dist/commands/test.d.ts +123 -44
  19. package/dist/commands/test.js +2993 -636
  20. package/dist/commands/testlist.d.ts +10 -5
  21. package/dist/commands/testlist.js +217 -47
  22. package/dist/commands/tunnel.d.ts +26 -3
  23. package/dist/commands/tunnel.js +221 -18
  24. package/dist/commands/usage.d.ts +3 -0
  25. package/dist/commands/usage.js +12 -5
  26. package/dist/index.js +39 -50
  27. package/dist/lib/agent-targets.d.ts +3 -3
  28. package/dist/lib/agent-targets.js +2 -2
  29. package/dist/lib/billing-refusal.d.ts +43 -0
  30. package/dist/lib/billing-refusal.js +171 -0
  31. package/dist/lib/bundle.d.ts +5 -0
  32. package/dist/lib/bundle.js +43 -13
  33. package/dist/lib/ci-linkage.d.ts +90 -0
  34. package/dist/lib/ci-linkage.js +181 -0
  35. package/dist/lib/client-factory.d.ts +16 -2
  36. package/dist/lib/client-factory.js +37 -6
  37. package/dist/lib/config.d.ts +17 -0
  38. package/dist/lib/config.js +20 -1
  39. package/dist/lib/conflict-reason.d.ts +27 -3
  40. package/dist/lib/conflict-reason.js +53 -4
  41. package/dist/lib/credentials.js +56 -14
  42. package/dist/lib/dry-run/samples.d.ts +13 -1
  43. package/dist/lib/dry-run/samples.js +104 -7
  44. package/dist/lib/environment-tunnel.d.ts +109 -0
  45. package/dist/lib/environment-tunnel.js +465 -0
  46. package/dist/lib/errors.d.ts +18 -11
  47. package/dist/lib/errors.js +123 -14
  48. package/dist/lib/failing-fe-resolver.d.ts +1 -1
  49. package/dist/lib/failing-fe-resolver.js +3 -3
  50. package/dist/lib/gh-output.d.ts +1 -0
  51. package/dist/lib/gh-output.js +16 -4
  52. package/dist/lib/history-retention.d.ts +8 -0
  53. package/dist/lib/history-retention.js +24 -0
  54. package/dist/lib/http.d.ts +39 -19
  55. package/dist/lib/http.js +46 -24
  56. package/dist/lib/interrupt.d.ts +21 -13
  57. package/dist/lib/interrupt.js +32 -21
  58. package/dist/lib/junit-report.d.ts +18 -4
  59. package/dist/lib/junit-report.js +23 -5
  60. package/dist/lib/local-target.d.ts +14 -4
  61. package/dist/lib/local-target.js +48 -13
  62. package/dist/lib/output.js +15 -1
  63. package/dist/lib/plan-poll.d.ts +11 -11
  64. package/dist/lib/plan-poll.js +15 -16
  65. package/dist/lib/plans.types.d.ts +9 -9
  66. package/dist/lib/plans.types.js +3 -3
  67. package/dist/lib/poll.d.ts +2 -2
  68. package/dist/lib/poll.js +9 -3
  69. package/dist/lib/redact.d.ts +38 -0
  70. package/dist/lib/redact.js +140 -0
  71. package/dist/lib/render-error.d.ts +21 -5
  72. package/dist/lib/render-error.js +44 -0
  73. package/dist/lib/response-schemas.d.ts +54 -12
  74. package/dist/lib/response-schemas.js +88 -7
  75. package/dist/lib/runs.types.d.ts +68 -11
  76. package/dist/lib/secret-file.js +72 -14
  77. package/dist/lib/skill-nudge.d.ts +6 -1
  78. package/dist/lib/skill-nudge.js +32 -5
  79. package/dist/lib/target-url-preflight.d.ts +6 -4
  80. package/dist/lib/target-url-preflight.js +64 -51
  81. package/dist/lib/target-url.js +11 -11
  82. package/dist/lib/telemetry.d.ts +10 -8
  83. package/dist/lib/telemetry.js +24 -17
  84. package/dist/lib/testlist.types.d.ts +1 -0
  85. package/dist/lib/ticker.d.ts +9 -0
  86. package/dist/lib/ticker.js +111 -4
  87. package/dist/lib/tunnel-session.d.ts +16 -4
  88. package/dist/lib/tunnel-session.js +7 -5
  89. package/dist/lib/tunnel.types.d.ts +12 -2
  90. package/dist/lib/tunnel.types.js +2 -2
  91. package/dist/lib/v3-advisory.js +0 -1
  92. package/dist/lib/wait-exit.d.ts +8 -0
  93. package/dist/lib/wait-exit.js +76 -4
  94. package/dist/lib/workspace-status.d.ts +23 -0
  95. package/dist/lib/workspace-status.js +15 -0
  96. package/dist/vendor/tunnel-client/client.d.ts +15 -8
  97. package/dist/vendor/tunnel-client/client.js +477 -407
  98. package/dist/vendor/tunnel-client/config.d.ts +5 -5
  99. package/dist/vendor/tunnel-client/config.js +5 -5
  100. package/dist/vendor/tunnel-client/index.d.ts +4 -4
  101. package/dist/vendor/tunnel-client/index.js +4 -4
  102. package/dist/vendor/tunnel-client/types.d.ts +19 -34
  103. package/dist/vendor/tunnel-client/types.js +1 -0
  104. package/dist/vendor/tunnel-client/ws-compat.d.ts +13 -3
  105. package/dist/vendor/tunnel-client/ws-compat.js +70 -12
  106. package/dist/version-guard.d.ts +7 -1
  107. package/dist/version-guard.js +19 -1
  108. package/dist/version.d.ts +1 -1
  109. package/dist/version.js +1 -1
  110. package/package.json +4 -4
  111. package/skills/testsprite-onboard.skill.md +8 -8
  112. package/skills/testsprite-verify.codex.md +59 -57
  113. package/skills/testsprite-verify.skill.md +53 -38
@@ -0,0 +1,60 @@
1
+ import { Command } from 'commander';
2
+ import { type CommonOptions } from '../lib/client-factory.js';
3
+ import { ApiError } from '../lib/errors.js';
4
+ import type { CliProjectEnvironment } from './project-env.js';
5
+ import type { ProjectDeps } from './project.js';
6
+ export interface CliProjectSignInResponse {
7
+ projectId: string;
8
+ environment: CliProjectEnvironment;
9
+ signIn: {
10
+ mode: string;
11
+ account: {
12
+ username: string | null;
13
+ passwordSet: boolean;
14
+ } | null;
15
+ otp: {
16
+ channels: Array<'email' | 'sms'>;
17
+ email: string | null;
18
+ phone: string | null;
19
+ } | null;
20
+ manual: {
21
+ sessionReuseTtlSeconds: number;
22
+ hasValidSession: boolean;
23
+ needsReauth: boolean;
24
+ reason: 'never' | 'expired' | null;
25
+ capturedAt: string | null;
26
+ expiresAt: string | null;
27
+ } | null;
28
+ };
29
+ nextAction: string | null;
30
+ }
31
+ export interface CliProjectSignInSetResponse extends CliProjectSignInResponse {
32
+ changed: boolean;
33
+ }
34
+ export type SignInMode = 'public' | 'account' | 'otp' | 'manual';
35
+ type GetOptions = CommonOptions & {
36
+ projectId: string;
37
+ env?: string;
38
+ };
39
+ type SetOptions = GetOptions & {
40
+ mode?: string;
41
+ username?: string;
42
+ password?: string;
43
+ passwordFile?: string;
44
+ sessionTtl?: string;
45
+ idempotencyKey?: string;
46
+ };
47
+ export declare function signInValidationError(message: string, reason?: string): ApiError;
48
+ export declare function parseSignInMode(raw: string | undefined, flag: string): SignInMode;
49
+ export declare function parseSessionTtl(raw: string): number;
50
+ export declare function validateSignInFlags(mode: SignInMode | undefined, opts: {
51
+ username?: string;
52
+ password?: string;
53
+ passwordFile?: string;
54
+ sessionTtl?: string;
55
+ otpChannel?: string[];
56
+ }, requireAccountPair: boolean): void;
57
+ export declare function runSignInGet(opts: GetOptions, deps?: ProjectDeps): Promise<CliProjectSignInResponse>;
58
+ export declare function runSignInSet(opts: SetOptions, deps?: ProjectDeps): Promise<CliProjectSignInSetResponse>;
59
+ export declare function createProjectSignInCommand(deps?: ProjectDeps): Command;
60
+ export {};
@@ -0,0 +1,289 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import { Command } from 'commander';
3
+ import { emitDryRunBanner, makeHttpClient, parseRequestTimeoutFlag, } from '../lib/client-factory.js';
4
+ import { resolveProfileName } from '../lib/config.js';
5
+ import { ApiError, InterruptError } from '../lib/errors.js';
6
+ import { GLOBAL_OPTS_HINT, Output, resolveOutputMode } from '../lib/output.js';
7
+ import { readSecretFileGuarded } from '../lib/secret-file.js';
8
+ import { assertIdempotencyKey } from '../lib/validate.js';
9
+ export function signInValidationError(message, reason = 'invalid_sign_in_flags') {
10
+ return ApiError.fromEnvelope({
11
+ error: {
12
+ code: 'VALIDATION_ERROR',
13
+ message: 'Invalid request.',
14
+ nextAction: message,
15
+ requestId: 'local',
16
+ details: { reason },
17
+ },
18
+ });
19
+ }
20
+ export function parseSignInMode(raw, flag) {
21
+ const aliases = {
22
+ public: 'public',
23
+ account: 'account',
24
+ otp: 'otp',
25
+ manual: 'manual',
26
+ none: 'public',
27
+ credentials: 'account',
28
+ sso: 'manual',
29
+ };
30
+ if (raw === undefined && flag === '--mode')
31
+ throw signInValidationError('--mode is required: public, account or manual (otp can only be chosen with `project env create --sign-in otp`)');
32
+ const key = raw?.toLowerCase();
33
+ const mode = key !== undefined && Object.hasOwn(aliases, key) ? aliases[key] : undefined;
34
+ if (!mode)
35
+ throw signInValidationError(`${flag} must be one of: public, account, otp, manual, none, credentials, sso.`);
36
+ return mode;
37
+ }
38
+ export function parseSessionTtl(raw) {
39
+ if (raw === 'never')
40
+ return -1;
41
+ if (!/^[1-9]\d*$/.test(raw) || Number(raw) > 2_592_000)
42
+ throw signInValidationError('--session-ttl must be an integer from 1 to 2592000 seconds, or never.');
43
+ return Number(raw);
44
+ }
45
+ export function validateSignInFlags(mode, opts, requireAccountPair) {
46
+ if (opts.password !== undefined && opts.passwordFile !== undefined)
47
+ throw signInValidationError('--password and --password-file are mutually exclusive.');
48
+ if (opts.username !== undefined && !opts.username.trim())
49
+ throw signInValidationError('--username must not be empty or whitespace-only.');
50
+ if (opts.password !== undefined && !opts.password.trim())
51
+ throw signInValidationError('--password must not be empty or whitespace-only.');
52
+ if (mode !== undefined && mode !== 'account') {
53
+ if (opts.username !== undefined)
54
+ throw signInValidationError('--username is only valid with account sign-in.');
55
+ if (opts.password !== undefined)
56
+ throw signInValidationError('--password is only valid with account sign-in.');
57
+ if (opts.passwordFile !== undefined)
58
+ throw signInValidationError('--password-file is only valid with account sign-in.');
59
+ }
60
+ if (requireAccountPair && mode === 'account') {
61
+ if (opts.username === undefined)
62
+ throw signInValidationError('--username is required with --sign-in account.');
63
+ if (opts.password === undefined && opts.passwordFile === undefined)
64
+ throw signInValidationError('--password or --password-file is required with --sign-in account.');
65
+ }
66
+ if (opts.sessionTtl !== undefined && mode !== 'manual')
67
+ throw signInValidationError('--session-ttl is only valid with manual sign-in.');
68
+ if (opts.otpChannel !== undefined && mode !== 'otp')
69
+ throw signInValidationError('--otp-channel is only valid with --sign-in otp.');
70
+ if (opts.sessionTtl !== undefined)
71
+ parseSessionTtl(opts.sessionTtl);
72
+ }
73
+ function commonOptions(command, env) {
74
+ const globals = command.optsWithGlobals();
75
+ return {
76
+ profile: resolveProfileName(globals.profile, env),
77
+ output: resolveOutputMode(globals.output),
78
+ endpointUrl: globals.endpointUrl,
79
+ debug: globals.debug ?? false,
80
+ verbose: globals.verbose ?? false,
81
+ dryRun: globals.dryRun ?? false,
82
+ requestTimeoutMs: parseRequestTimeoutFlag(globals.requestTimeout),
83
+ };
84
+ }
85
+ function stderrOf(deps) {
86
+ return deps.stderr ?? (line => process.stderr.write(`${line}\n`));
87
+ }
88
+ function pathFor(projectId) {
89
+ return `/projects/${encodeURIComponent(projectId)}/sign-in`;
90
+ }
91
+ function clientFor(opts, deps) {
92
+ return makeHttpClient(opts, {
93
+ env: deps.env,
94
+ credentialsPath: deps.credentialsPath,
95
+ fetchImpl: deps.fetchImpl,
96
+ stderr: deps.stderr,
97
+ });
98
+ }
99
+ function ttlText(seconds) {
100
+ if (seconds === -1)
101
+ return 'never expires';
102
+ if (seconds % 86400 === 0)
103
+ return `${seconds / 86400}d`;
104
+ if (seconds % 3600 === 0)
105
+ return `${seconds / 3600}h`;
106
+ if (seconds % 60 === 0)
107
+ return `${seconds / 60}m`;
108
+ return `${seconds}s`;
109
+ }
110
+ function renderText(result) {
111
+ const { environment, signIn } = result;
112
+ const labels = {
113
+ public: 'No sign-in',
114
+ account: 'Test account credentials',
115
+ otp: 'OTP (one-time password) login',
116
+ manual: 'SSO: log in once in a live browser, runs reuse the session',
117
+ };
118
+ const lines = [
119
+ `Environment ${environment.name}${environment.isDefault ? ' (default)' : ''} — ${environment.url}`,
120
+ `Sign-in ${signIn.mode}${labels[signIn.mode] ? ` — ${labels[signIn.mode]}` : ''}`,
121
+ ];
122
+ if (signIn.mode === 'account' && signIn.account)
123
+ lines.push(`Username ${signIn.account.username}`, `Password ${signIn.account.passwordSet ? 'set' : 'not set'}`);
124
+ if (signIn.mode === 'otp' && signIn.otp) {
125
+ lines.push(`Channels ${signIn.otp.channels.join(', ')}`);
126
+ if (signIn.otp.email)
127
+ lines.push(`Inbox ${signIn.otp.email}`);
128
+ if (signIn.otp.phone)
129
+ lines.push(`Phone ${signIn.otp.phone}`);
130
+ }
131
+ if (signIn.mode === 'manual') {
132
+ const manual = signIn.manual;
133
+ let session = 'none captured yet — runs will NOT be signed in until someone logs in once';
134
+ if (manual?.hasValidSession) {
135
+ session =
136
+ manual.expiresAt && manual.sessionReuseTtlSeconds !== -1
137
+ ? `valid until ${manual.expiresAt}`
138
+ : 'valid (never expires)';
139
+ if (manual.capturedAt)
140
+ session += ` — captured ${manual.capturedAt}`;
141
+ }
142
+ else if (manual?.reason === 'expired') {
143
+ session = `expired ${manual.expiresAt ?? '(expiration unknown)'} — runs will NOT be signed in until someone logs in again`;
144
+ }
145
+ lines.push(`Session ${session}`);
146
+ if (manual)
147
+ lines.push(`Session TTL ${ttlText(manual.sessionReuseTtlSeconds)}`);
148
+ }
149
+ if (result.nextAction)
150
+ lines.push(`Next ${result.nextAction}`);
151
+ return lines.join('\n');
152
+ }
153
+ function dryRunResponse(projectId, mode = 'public') {
154
+ return {
155
+ projectId,
156
+ environment: {
157
+ id: 'env_dryrun',
158
+ name: 'default',
159
+ url: 'https://app.example.com',
160
+ isDefault: true,
161
+ authMode: mode,
162
+ hasCredentials: mode === 'account',
163
+ username: mode === 'account' ? 'qa@example.com' : null,
164
+ enableOtp: mode === 'otp',
165
+ updatedAt: '2026-09-25T00:00:00.000Z',
166
+ },
167
+ signIn: {
168
+ mode,
169
+ account: mode === 'account' ? { username: 'qa@example.com', passwordSet: true } : null,
170
+ otp: mode === 'otp' ? { channels: ['email'], email: 'dryrun@inbox.example', phone: null } : null,
171
+ manual: mode === 'manual'
172
+ ? {
173
+ sessionReuseTtlSeconds: 3600,
174
+ hasValidSession: false,
175
+ needsReauth: true,
176
+ reason: 'never',
177
+ capturedAt: null,
178
+ expiresAt: null,
179
+ }
180
+ : null,
181
+ },
182
+ nextAction: mode === 'manual' ? 'Log in once in the Portal.' : null,
183
+ };
184
+ }
185
+ function redactSecret(value, secret) {
186
+ if (typeof value === 'string')
187
+ return value.split(secret).join('[REDACTED]');
188
+ if (Array.isArray(value))
189
+ return value.map(item => redactSecret(item, secret));
190
+ if (value !== null && typeof value === 'object') {
191
+ return Object.fromEntries(Object.entries(value).map(([key, item]) => [
192
+ key.split(secret).join('[REDACTED]'),
193
+ redactSecret(item, secret),
194
+ ]));
195
+ }
196
+ return value;
197
+ }
198
+ export async function runSignInGet(opts, deps = {}) {
199
+ if (opts.env !== undefined && !opts.env.trim())
200
+ throw signInValidationError('--env must not be empty or whitespace-only.');
201
+ const out = new Output(opts.output, { stdout: deps.stdout, stderr: deps.stderr });
202
+ if (opts.dryRun) {
203
+ emitDryRunBanner(stderrOf(deps));
204
+ const sample = dryRunResponse(opts.projectId);
205
+ out.print(sample, data => renderText(data));
206
+ return sample;
207
+ }
208
+ const result = await clientFor(opts, deps).get(pathFor(opts.projectId), opts.env === undefined ? {} : { query: { environment: opts.env } });
209
+ out.print(result, data => renderText(data));
210
+ return result;
211
+ }
212
+ export async function runSignInSet(opts, deps = {}) {
213
+ if (opts.env !== undefined && !opts.env.trim())
214
+ throw signInValidationError('--env must not be empty or whitespace-only.');
215
+ const mode = parseSignInMode(opts.mode, '--mode');
216
+ validateSignInFlags(mode, opts, false);
217
+ assertIdempotencyKey(opts.idempotencyKey);
218
+ const out = new Output(opts.output, { stdout: deps.stdout, stderr: deps.stderr });
219
+ const stderr = stderrOf(deps);
220
+ const key = opts.idempotencyKey ?? `cli-proj-signin-set-${randomUUID()}`;
221
+ if (opts.idempotencyKey === undefined && (opts.output === 'json' || opts.verbose || opts.debug))
222
+ stderr(`idempotency-key: ${key}`);
223
+ if (opts.dryRun) {
224
+ emitDryRunBanner(stderr);
225
+ const sample = { ...dryRunResponse(opts.projectId, mode), changed: mode !== 'otp' };
226
+ out.print(sample, data => renderText(data));
227
+ return sample;
228
+ }
229
+ const password = opts.passwordFile === undefined
230
+ ? opts.password
231
+ : readSecretFileGuarded('password-file', opts.passwordFile);
232
+ const body = { mode };
233
+ if (opts.env !== undefined)
234
+ body.environment = opts.env;
235
+ if (opts.username !== undefined)
236
+ body.username = opts.username;
237
+ if (password !== undefined)
238
+ body.password = password;
239
+ if (opts.sessionTtl !== undefined)
240
+ body.sessionReuseTtlSeconds = parseSessionTtl(opts.sessionTtl);
241
+ try {
242
+ const result = await clientFor(opts, deps).put(pathFor(opts.projectId), { body, headers: { 'idempotency-key': key } });
243
+ out.print(result, data => renderText(data));
244
+ return result;
245
+ }
246
+ catch (err) {
247
+ if (err instanceof InterruptError)
248
+ throw err;
249
+ if (err instanceof ApiError && password) {
250
+ throw new ApiError({
251
+ code: err.code,
252
+ message: redactSecret(err.message, password),
253
+ nextAction: redactSecret(err.nextAction, password),
254
+ requestId: err.requestId,
255
+ details: redactSecret(err.details, password),
256
+ }, err.httpStatus, err.retryAfterMs);
257
+ }
258
+ if (err instanceof Error && password)
259
+ err.message = redactSecret(err.message, password);
260
+ throw err;
261
+ }
262
+ }
263
+ export function createProjectSignInCommand(deps = {}) {
264
+ const group = new Command('sign-in').description('Inspect or change how an environment signs in to the app under test.');
265
+ group
266
+ .command('get <project-id>')
267
+ .description('Show the environment sign-in mode, credentials status, OTP channels, or SSO session.')
268
+ .option('--env <name>', 'environment name (defaults to the project default)')
269
+ .addHelpText('after', GLOBAL_OPTS_HINT)
270
+ .action(async (projectId, flags, command) => {
271
+ await runSignInGet({ ...commonOptions(command, deps.env), projectId, env: flags.env }, deps);
272
+ });
273
+ group
274
+ .command('set <project-id>')
275
+ .description('Set the sign-in mode; choose OTP when creating a new environment.')
276
+ .option('--mode <mode>', 'required: public, account, otp, or manual (aliases: none, credentials, sso)')
277
+ .option('--env <name>', 'environment name (defaults to the project default)')
278
+ .option('--username <user>', 'test-account username (account only)')
279
+ .option('--password <pw>', 'test-account password (prefer --password-file; account only)')
280
+ .option('--password-file <path>', 'read the test-account password from a file (account only)')
281
+ .option('--session-ttl <seconds|never>', 'SSO session reuse lifetime: 1–2592000 seconds or never (manual only)')
282
+ .option('--idempotency-key <token>', 'opaque idempotency token. Defaults to a UUIDv4 minted per invocation.')
283
+ .addHelpText('after', GLOBAL_OPTS_HINT)
284
+ .action(async (projectId, flags, command) => {
285
+ await runSignInSet({ ...commonOptions(command, deps.env), projectId, ...flags }, deps);
286
+ });
287
+ return group;
288
+ }
289
+ //# sourceMappingURL=project-sign-in.js.map
@@ -43,6 +43,9 @@ export interface CliProject {
43
43
  * (see the `project create --type backend` note in CLAUDE.md).
44
44
  */
45
45
  targetUrl?: string | null;
46
+ /** Absent on older servers, V2 projects, or when the environment read failed. */
47
+ defaultEnvironment?: string | null;
48
+ environmentCount?: number;
46
49
  /** Present only when the stored project target is local to the developer machine. */
47
50
  originMode?: 'local';
48
51
  /**
@@ -68,7 +71,7 @@ export interface ProjectDeps {
68
71
  stdout?: (line: string) => void;
69
72
  stderr?: (line: string) => void;
70
73
  localPortProbeDeps?: LocalPortProbeDeps;
71
- /** Graceful-detach coordinator (DEV-331); tests inject their own. */
74
+ /** Graceful-detach coordinator; tests inject their own. */
72
75
  shutdown?: ShutdownHandle;
73
76
  }
74
77
  type CommonOptions = FactoryCommonOptions;
@@ -158,6 +161,12 @@ export interface CliUpdateProjectResponse {
158
161
  updatedFields?: string[];
159
162
  /** Absent-safe: not guaranteed on every backend response. */
160
163
  updatedAt?: string;
164
+ /** Present on servers that report which default environment was edited. */
165
+ environment?: {
166
+ name: string;
167
+ isDefault: true;
168
+ };
169
+ effects?: string[];
161
170
  }
162
171
  /** Resolve the updated project's id regardless of which field name the backend used. */
163
172
  export declare function resolveUpdatedProjectId(r: CliUpdateProjectResponse): string | undefined;
@@ -268,20 +277,20 @@ declare const DOC_ROLES: {
268
277
  };
269
278
  type DocRoleFlag = keyof typeof DOC_ROLES;
270
279
  type DocRoleWire = (typeof DOC_ROLES)[DocRoleFlag];
271
- /** `POST /projects/{id}/docs/upload-url` response (V3-A facade). */
280
+ /** `POST /projects/{id}/docs/upload-url` response (docs facade). */
272
281
  export interface CliDocsUploadUrlResponse {
273
282
  uploadUrl: string;
274
283
  s3Key: string;
275
284
  expiresInSeconds: number;
276
285
  }
277
- /** `POST /projects/{id}/docs` (register) response (V3-A facade). */
286
+ /** `POST /projects/{id}/docs` (register) response (docs facade). */
278
287
  export interface CliDocsRegisterResponse {
279
288
  resourceId: string;
280
289
  displayName: string;
281
290
  docRole: DocRoleWire | null;
282
291
  processStatus: string;
283
292
  }
284
- /** Success result — the JSON-mode stdout shape (piece V3-D scope item 3). */
293
+ /** Success result — the JSON-mode stdout shape. */
285
294
  export interface CliDocsUploadResult {
286
295
  resourceId: string;
287
296
  displayName: string;
@@ -313,7 +322,7 @@ interface DocsUploadOptions extends CommonOptions {
313
322
  * source so plan generation has inputs to feed on (closes the API-project
314
323
  * cold start at `no_processed_inputs`).
315
324
  *
316
- * Three-step flow against the V3-A facade routes:
325
+ * Three-step flow against the docs facade routes:
317
326
  *
318
327
  * 1. `POST /projects/{id}/docs/upload-url` — mints a one-hour presigned
319
328
  * S3 PUT URL plus the S3 key to register afterwards.