@devicecloud.dev/dcd 5.11.1 → 5.12.0-beta.1
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/dist/commands/artifacts.d.ts +2 -2
- package/dist/commands/artifacts.js +10 -3
- package/dist/commands/cloud.d.ts +2 -2
- package/dist/commands/cloud.js +3 -0
- package/dist/commands/device.js +35 -2
- package/dist/config/flags/output.flags.d.ts +2 -2
- package/dist/config/flags/output.flags.js +2 -2
- package/dist/constants.d.ts +2 -2
- package/dist/gateways/device-gateway.d.ts +20 -1
- package/dist/gateways/device-gateway.js +37 -2
- package/dist/mcp/bridge.d.ts +0 -2
- package/dist/mcp/bridge.js +3 -9
- package/dist/mcp/tools/download-artifacts.js +1 -1
- package/dist/services/report-download.service.d.ts +7 -0
- package/dist/services/report-download.service.js +19 -0
- package/package.json +1 -1
|
@@ -19,11 +19,11 @@ export declare const artifactsCommand: import("citty").CommandDef<{
|
|
|
19
19
|
};
|
|
20
20
|
readonly report: {
|
|
21
21
|
readonly type: "string";
|
|
22
|
-
readonly description: "Download a test report in the specified format (options:
|
|
22
|
+
readonly description: "Download a test report in the specified format (options: junit, html, html-detailed, allure). allure and html-detailed are deprecated and will be removed on 7 December 2026.";
|
|
23
23
|
};
|
|
24
24
|
readonly 'allure-path': {
|
|
25
25
|
readonly type: "string";
|
|
26
|
-
readonly description: "Custom file path for downloaded Allure report (default: ./report.html)";
|
|
26
|
+
readonly description: "Custom file path for downloaded Allure report (default: ./report.html). Deprecated: Allure reports will be removed on 7 December 2026.";
|
|
27
27
|
};
|
|
28
28
|
readonly 'html-path': {
|
|
29
29
|
readonly type: "string";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { defineCommand } from 'citty';
|
|
2
2
|
import { apiFlags } from '../config/flags/api.flags.js';
|
|
3
3
|
import { jsonFlag } from '../config/flags/output.flags.js';
|
|
4
|
-
import { ReportDownloadService, } from '../services/report-download.service.js';
|
|
4
|
+
import { ReportDownloadService, reportFormatDeprecation, } from '../services/report-download.service.js';
|
|
5
5
|
import { resolveAuth } from '../utils/auth.js';
|
|
6
6
|
import { CliError, logger, validateEnum } from '../utils/cli.js';
|
|
7
7
|
import { resolveApiUrl } from '../utils/config-store.js';
|
|
8
|
+
import { ui } from '../utils/ui.js';
|
|
8
9
|
const DOWNLOAD_OPTIONS = ['ALL', 'FAILED'];
|
|
9
10
|
const REPORT_OPTIONS = ['allure', 'html', 'html-detailed', 'junit'];
|
|
10
11
|
export const artifactsCommand = defineCommand({
|
|
@@ -34,11 +35,11 @@ export const artifactsCommand = defineCommand({
|
|
|
34
35
|
},
|
|
35
36
|
report: {
|
|
36
37
|
type: 'string',
|
|
37
|
-
description: 'Download a test report in the specified format (options:
|
|
38
|
+
description: 'Download a test report in the specified format (options: junit, html, html-detailed, allure). allure and html-detailed are deprecated and will be removed on 7 December 2026.',
|
|
38
39
|
},
|
|
39
40
|
'allure-path': {
|
|
40
41
|
type: 'string',
|
|
41
|
-
description: 'Custom file path for downloaded Allure report (default: ./report.html)',
|
|
42
|
+
description: 'Custom file path for downloaded Allure report (default: ./report.html). Deprecated: Allure reports will be removed on 7 December 2026.',
|
|
42
43
|
},
|
|
43
44
|
'html-path': {
|
|
44
45
|
type: 'string',
|
|
@@ -64,6 +65,12 @@ export const artifactsCommand = defineCommand({
|
|
|
64
65
|
const json = Boolean(args.json);
|
|
65
66
|
// Success lines are dropped under --json; warnings stay on stderr.
|
|
66
67
|
const log = json ? undefined : (m) => logger.log(m);
|
|
68
|
+
// This command fetches no notices and submits nothing, so neither the
|
|
69
|
+
// deprecation notice nor the API's submit warning reaches it.
|
|
70
|
+
const deprecation = reportFormatDeprecation(report);
|
|
71
|
+
if (deprecation) {
|
|
72
|
+
process.stderr.write(`${ui.deprecation(deprecation)}\n`);
|
|
73
|
+
}
|
|
67
74
|
const auth = await resolveAuth({ apiKeyFlag });
|
|
68
75
|
if (downloadArtifacts && report) {
|
|
69
76
|
throw new CliError('--download-artifacts cannot also be provided when using --report (flags are mutually exclusive).');
|
package/dist/commands/cloud.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare const cloudCommand: import("citty").CommandDef<{
|
|
|
31
31
|
};
|
|
32
32
|
readonly 'allure-path': {
|
|
33
33
|
readonly type: "string";
|
|
34
|
-
readonly description: "Custom file path for downloaded Allure report (requires --report allure, default: ./report.html)";
|
|
34
|
+
readonly description: "Custom file path for downloaded Allure report (requires --report allure, default: ./report.html). Deprecated: Allure reports will be removed on 7 December 2026.";
|
|
35
35
|
};
|
|
36
36
|
readonly 'html-path': {
|
|
37
37
|
readonly type: "string";
|
|
@@ -76,7 +76,7 @@ export declare const cloudCommand: import("citty").CommandDef<{
|
|
|
76
76
|
readonly report: {
|
|
77
77
|
readonly type: "string";
|
|
78
78
|
readonly alias: ["format"];
|
|
79
|
-
readonly description: "Generate and download test reports in the specified format (options:
|
|
79
|
+
readonly description: "Generate and download test reports in the specified format (options: junit, html, html-detailed, allure). allure and html-detailed are deprecated and will be removed on 7 December 2026: from that date html-detailed gives the standard HTML report and allure gives none, and runs still run.";
|
|
80
80
|
};
|
|
81
81
|
readonly branch: {
|
|
82
82
|
readonly type: "string";
|
package/dist/commands/cloud.js
CHANGED
|
@@ -349,6 +349,9 @@ export const cloudCommand = defineCommand({
|
|
|
349
349
|
// As requested ('default' when not passed), not as the API resolves
|
|
350
350
|
// it: the gpu1 retirement notice is aimed at runs that ask for gpu1.
|
|
351
351
|
runner_type: runnerType,
|
|
352
|
+
// As passed (undefined without --report): the allure and
|
|
353
|
+
// html-detailed retirement notices are gated on it.
|
|
354
|
+
report,
|
|
352
355
|
cli_version: cliVersion,
|
|
353
356
|
ci_provider: ciContext.provider,
|
|
354
357
|
ci_wrapper_version: ciContext.wrapperVersion,
|
package/dist/commands/device.js
CHANGED
|
@@ -4,7 +4,7 @@ import * as path from 'node:path';
|
|
|
4
4
|
import { resolve as resolvePath } from 'node:path';
|
|
5
5
|
import { apiFlags } from '../config/flags/api.flags.js';
|
|
6
6
|
import { jsonFlag } from '../config/flags/output.flags.js';
|
|
7
|
-
import { DeviceApiError, DeviceGateway } from '../gateways/device-gateway.js';
|
|
7
|
+
import { DeviceApiError, DeviceGateway, START_RECOVERY_WINDOW_MS, startOutcomeUnknown, } from '../gateways/device-gateway.js';
|
|
8
8
|
import { ENDED_STATES, } from '../types/domain/device-session.types.js';
|
|
9
9
|
import { platformOfAppFile, uploadLocalApp } from '../utils/app-upload.js';
|
|
10
10
|
import { refreshAuth, resolveAuth } from '../utils/auth.js';
|
|
@@ -135,6 +135,31 @@ async function resolveApp(ctx, app) {
|
|
|
135
135
|
});
|
|
136
136
|
return { binaryUploadId };
|
|
137
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* A start that got no answer, or a proxy's 5xx in the API's place, may still
|
|
140
|
+
* have made a session, which is billed while it runs. Someone who just runs
|
|
141
|
+
* `dcd device start` again would have two. So name the sessions started in
|
|
142
|
+
* the last couple of minutes, and say to check before starting again.
|
|
143
|
+
*/
|
|
144
|
+
async function failedStartError(ctx, error) {
|
|
145
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
146
|
+
const status = error instanceof DeviceApiError ? error.status : 502;
|
|
147
|
+
const head = 'Starting the session failed, but the request may still have started a session, and a session is billed while it runs.';
|
|
148
|
+
// What to do first: a network error's message runs to a dozen lines.
|
|
149
|
+
const failed = (advice, session = null) => new DeviceApiError(`${head} ${advice}\n\nThe error: ${reason}`, status, null, session);
|
|
150
|
+
const minutes = START_RECOVERY_WINDOW_MS / 60_000;
|
|
151
|
+
const recent = await DeviceGateway.recentlyStarted(ctx.apiUrl, ctx.auth);
|
|
152
|
+
if (recent === null) {
|
|
153
|
+
return failed('Check for one with `dcd device list` before you start another.');
|
|
154
|
+
}
|
|
155
|
+
if (recent.length === 0) {
|
|
156
|
+
return failed(`No session was started in the last ${minutes} minutes, so it is safe to start one again.`);
|
|
157
|
+
}
|
|
158
|
+
const listed = recent
|
|
159
|
+
.map((s) => `${s.id} (${s.client_label ?? 'no label'}, ${s.state}, started ${s.created_at})`)
|
|
160
|
+
.join(', ');
|
|
161
|
+
return failed(`Open sessions started in the last ${minutes} minutes: ${listed}. If one is yours, use it instead of starting another; check it with \`dcd device status <id>\`. Otherwise stop it with \`dcd device stop <id>\`.`, recent.length === 1 ? recent[0] : null);
|
|
162
|
+
}
|
|
138
163
|
function parsePositiveInt(value, flag) {
|
|
139
164
|
if (value === undefined || value === '')
|
|
140
165
|
return undefined;
|
|
@@ -265,7 +290,15 @@ const startSub = defineCommand({
|
|
|
265
290
|
if (ttl)
|
|
266
291
|
body.maxDurationMin = ttl;
|
|
267
292
|
ctx.progress(ui.running(`Starting ${platform} device session…`));
|
|
268
|
-
let
|
|
293
|
+
let session;
|
|
294
|
+
try {
|
|
295
|
+
({ session } = await DeviceGateway.start(ctx.apiUrl, ctx.auth, body));
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
if (!startOutcomeUnknown(error))
|
|
299
|
+
throw error;
|
|
300
|
+
throw await failedStartError(ctx, error);
|
|
301
|
+
}
|
|
269
302
|
ctx.progress(ui.success(`Session ${session.id} started`));
|
|
270
303
|
// The session exists and bills from here on: every later failure must
|
|
271
304
|
// still name it, so the caller can stop it.
|
|
@@ -20,7 +20,7 @@ export declare const outputFlags: {
|
|
|
20
20
|
};
|
|
21
21
|
readonly 'allure-path': {
|
|
22
22
|
readonly type: "string";
|
|
23
|
-
readonly description: "Custom file path for downloaded Allure report (requires --report allure, default: ./report.html)";
|
|
23
|
+
readonly description: "Custom file path for downloaded Allure report (requires --report allure, default: ./report.html). Deprecated: Allure reports will be removed on 7 December 2026.";
|
|
24
24
|
};
|
|
25
25
|
readonly 'html-path': {
|
|
26
26
|
readonly type: "string";
|
|
@@ -65,6 +65,6 @@ export declare const outputFlags: {
|
|
|
65
65
|
readonly report: {
|
|
66
66
|
readonly type: "string";
|
|
67
67
|
readonly alias: ["format"];
|
|
68
|
-
readonly description: "Generate and download test reports in the specified format (options:
|
|
68
|
+
readonly description: "Generate and download test reports in the specified format (options: junit, html, html-detailed, allure). allure and html-detailed are deprecated and will be removed on 7 December 2026: from that date html-detailed gives the standard HTML report and allure gives none, and runs still run.";
|
|
69
69
|
};
|
|
70
70
|
};
|
|
@@ -20,7 +20,7 @@ export const outputFlags = {
|
|
|
20
20
|
},
|
|
21
21
|
'allure-path': {
|
|
22
22
|
type: 'string',
|
|
23
|
-
description: 'Custom file path for downloaded Allure report (requires --report allure, default: ./report.html)',
|
|
23
|
+
description: 'Custom file path for downloaded Allure report (requires --report allure, default: ./report.html). Deprecated: Allure reports will be removed on 7 December 2026.',
|
|
24
24
|
},
|
|
25
25
|
'html-path': {
|
|
26
26
|
type: 'string',
|
|
@@ -65,6 +65,6 @@ export const outputFlags = {
|
|
|
65
65
|
report: {
|
|
66
66
|
type: 'string',
|
|
67
67
|
alias: ['format'],
|
|
68
|
-
description: 'Generate and download test reports in the specified format (options:
|
|
68
|
+
description: 'Generate and download test reports in the specified format (options: junit, html, html-detailed, allure). allure and html-detailed are deprecated and will be removed on 7 December 2026: from that date html-detailed gives the standard HTML report and allure gives none, and runs still run.',
|
|
69
69
|
},
|
|
70
70
|
};
|
package/dist/constants.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare const flags: {
|
|
|
17
17
|
};
|
|
18
18
|
readonly 'allure-path': {
|
|
19
19
|
readonly type: "string";
|
|
20
|
-
readonly description: "Custom file path for downloaded Allure report (requires --report allure, default: ./report.html)";
|
|
20
|
+
readonly description: "Custom file path for downloaded Allure report (requires --report allure, default: ./report.html). Deprecated: Allure reports will be removed on 7 December 2026.";
|
|
21
21
|
};
|
|
22
22
|
readonly 'html-path': {
|
|
23
23
|
readonly type: "string";
|
|
@@ -62,7 +62,7 @@ export declare const flags: {
|
|
|
62
62
|
readonly report: {
|
|
63
63
|
readonly type: "string";
|
|
64
64
|
readonly alias: ["format"];
|
|
65
|
-
readonly description: "Generate and download test reports in the specified format (options:
|
|
65
|
+
readonly description: "Generate and download test reports in the specified format (options: junit, html, html-detailed, allure). allure and html-detailed are deprecated and will be removed on 7 December 2026: from that date html-detailed gives the standard HTML report and allure gives none, and runs still run.";
|
|
66
66
|
};
|
|
67
67
|
readonly branch: {
|
|
68
68
|
readonly type: "string";
|
|
@@ -8,10 +8,24 @@ import type { DeviceArtifactsPage, DeviceBundleUploadUrls, DeviceFlowBundle, Dev
|
|
|
8
8
|
*/
|
|
9
9
|
export declare class DeviceApiError extends Error {
|
|
10
10
|
code: null | string;
|
|
11
|
+
/**
|
|
12
|
+
* The API itself answered (its `{ statusCode, message }` envelope), not a
|
|
13
|
+
* proxy in front of it. A proxy's 502 can come after the API did the work.
|
|
14
|
+
*/
|
|
15
|
+
fromApi: boolean;
|
|
11
16
|
session: DeviceSession | null;
|
|
12
17
|
status: number;
|
|
13
|
-
constructor(message: string, status: number, code: null | string, session: DeviceSession | null);
|
|
18
|
+
constructor(message: string, status: number, code: null | string, session: DeviceSession | null, fromApi?: boolean);
|
|
14
19
|
}
|
|
20
|
+
/** How recent an open session must be to count as one a failed start may have made. */
|
|
21
|
+
export declare const START_RECOVERY_WINDOW_MS: number;
|
|
22
|
+
/**
|
|
23
|
+
* Whether a failed start may still have made a session: no answer arrived
|
|
24
|
+
* (the connection failed, or the reply was unreadable), or a proxy answered
|
|
25
|
+
* with a 5xx in the API's place. The API's own errors are refusals made
|
|
26
|
+
* before any session exists.
|
|
27
|
+
*/
|
|
28
|
+
export declare function startOutcomeUnknown(error: unknown): boolean;
|
|
15
29
|
/** The Agent Devices session API (dcd docs/device-v1-plan.md, section 4.1). */
|
|
16
30
|
export declare const DeviceGateway: {
|
|
17
31
|
artifacts(baseUrl: string, auth: AuthContext, id: string, before?: string): Promise<DeviceArtifactsPage>;
|
|
@@ -49,6 +63,11 @@ export declare const DeviceGateway: {
|
|
|
49
63
|
session: DeviceSession;
|
|
50
64
|
}>;
|
|
51
65
|
models(baseUrl: string, auth: AuthContext): Promise<DeviceCatalogue>;
|
|
66
|
+
/**
|
|
67
|
+
* The open sessions started in the last START_RECOVERY_WINDOW_MS: the ones
|
|
68
|
+
* a start that got no answer may have made. Null when they can't be read.
|
|
69
|
+
*/
|
|
70
|
+
recentlyStarted(baseUrl: string, auth: AuthContext, now?: number): Promise<DeviceSession[] | null>;
|
|
52
71
|
registerBundle(baseUrl: string, auth: AuthContext, body: {
|
|
53
72
|
backblaze: boolean;
|
|
54
73
|
bytes: number;
|
|
@@ -7,16 +7,35 @@ import { ApiGateway } from './api-gateway.js';
|
|
|
7
7
|
*/
|
|
8
8
|
export class DeviceApiError extends Error {
|
|
9
9
|
code;
|
|
10
|
+
/**
|
|
11
|
+
* The API itself answered (its `{ statusCode, message }` envelope), not a
|
|
12
|
+
* proxy in front of it. A proxy's 502 can come after the API did the work.
|
|
13
|
+
*/
|
|
14
|
+
fromApi;
|
|
10
15
|
session;
|
|
11
16
|
status;
|
|
12
|
-
constructor(message, status, code, session) {
|
|
17
|
+
constructor(message, status, code, session, fromApi = false) {
|
|
13
18
|
super(message);
|
|
14
19
|
this.name = 'DeviceApiError';
|
|
15
20
|
this.status = status;
|
|
16
21
|
this.code = code;
|
|
17
22
|
this.session = session;
|
|
23
|
+
this.fromApi = fromApi;
|
|
18
24
|
}
|
|
19
25
|
}
|
|
26
|
+
/** How recent an open session must be to count as one a failed start may have made. */
|
|
27
|
+
export const START_RECOVERY_WINDOW_MS = 2 * 60 * 1000;
|
|
28
|
+
/**
|
|
29
|
+
* Whether a failed start may still have made a session: no answer arrived
|
|
30
|
+
* (the connection failed, or the reply was unreadable), or a proxy answered
|
|
31
|
+
* with a 5xx in the API's place. The API's own errors are refusals made
|
|
32
|
+
* before any session exists.
|
|
33
|
+
*/
|
|
34
|
+
export function startOutcomeUnknown(error) {
|
|
35
|
+
if (!(error instanceof DeviceApiError))
|
|
36
|
+
return true;
|
|
37
|
+
return error.status >= 500 && !error.fromApi;
|
|
38
|
+
}
|
|
20
39
|
/**
|
|
21
40
|
* The API's error envelope: `{ statusCode, message, error? }`, where `error`
|
|
22
41
|
* is either Nest's status text or a machine code such as LIVE_NOT_FOUND.
|
|
@@ -48,7 +67,10 @@ async function toDeviceApiError(res, path) {
|
|
|
48
67
|
`Wait for that with \`dcd device human ${name} --wait\`.`;
|
|
49
68
|
}
|
|
50
69
|
const session = body.session && typeof body.session === 'object' ? body.session : null;
|
|
51
|
-
|
|
70
|
+
// Nest's envelope always has a numeric statusCode. Railway's proxy answers
|
|
71
|
+
// `{ status, code, message }`, or a page that isn't JSON at all.
|
|
72
|
+
const fromApi = typeof body.statusCode === 'number';
|
|
73
|
+
return new DeviceApiError(message, res.status, code, session, fromApi);
|
|
52
74
|
}
|
|
53
75
|
async function request(baseUrl, auth, method, path, body) {
|
|
54
76
|
const url = `${baseUrl}${path}`;
|
|
@@ -115,6 +137,19 @@ export const DeviceGateway = {
|
|
|
115
137
|
models(baseUrl, auth) {
|
|
116
138
|
return request(baseUrl, auth, 'GET', '/device/models');
|
|
117
139
|
},
|
|
140
|
+
/**
|
|
141
|
+
* The open sessions started in the last START_RECOVERY_WINDOW_MS: the ones
|
|
142
|
+
* a start that got no answer may have made. Null when they can't be read.
|
|
143
|
+
*/
|
|
144
|
+
async recentlyStarted(baseUrl, auth, now = Date.now()) {
|
|
145
|
+
try {
|
|
146
|
+
const { sessions } = await DeviceGateway.list(baseUrl, auth);
|
|
147
|
+
return sessions.filter((s) => now - Date.parse(s.created_at) <= START_RECOVERY_WINDOW_MS);
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
},
|
|
118
153
|
registerBundle(baseUrl, auth, body) {
|
|
119
154
|
return request(baseUrl, auth, 'POST', '/device/bundles', body);
|
|
120
155
|
},
|
package/dist/mcp/bridge.d.ts
CHANGED
|
@@ -29,8 +29,6 @@ export declare function resolveLocalInputs(name: string, args: Record<string, un
|
|
|
29
29
|
apiUrl: string;
|
|
30
30
|
auth: AuthContext;
|
|
31
31
|
}): Promise<Record<string, unknown>>;
|
|
32
|
-
/** How recent an open session must be to count as one a failed start may have made. */
|
|
33
|
-
export declare const START_RECOVERY_WINDOW_MS: number;
|
|
34
32
|
/**
|
|
35
33
|
* What to tell the agent when a start_device call failed without an answer
|
|
36
34
|
* (the connection dropped, or the server never replied). The request may
|
package/dist/mcp/bridge.js
CHANGED
|
@@ -22,7 +22,7 @@ import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/
|
|
|
22
22
|
import { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';
|
|
23
23
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
24
24
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
25
|
-
import { DeviceGateway } from '../gateways/device-gateway.js';
|
|
25
|
+
import { DeviceGateway, START_RECOVERY_WINDOW_MS } from '../gateways/device-gateway.js';
|
|
26
26
|
import { processDependencies, readTestYamlFileAsJson } from '../services/execution-plan.utils.js';
|
|
27
27
|
import { computeCommonRoot } from '../services/flow-paths.js';
|
|
28
28
|
import { uploadLocalApp } from '../utils/app-upload.js';
|
|
@@ -139,8 +139,6 @@ export async function resolveLocalInputs(name, args, ctx) {
|
|
|
139
139
|
}
|
|
140
140
|
return args;
|
|
141
141
|
}
|
|
142
|
-
/** How recent an open session must be to count as one a failed start may have made. */
|
|
143
|
-
export const START_RECOVERY_WINDOW_MS = 2 * 60 * 1000;
|
|
144
142
|
/**
|
|
145
143
|
* What to tell the agent when a start_device call failed without an answer
|
|
146
144
|
* (the connection dropped, or the server never replied). The request may
|
|
@@ -150,12 +148,8 @@ export const START_RECOVERY_WINDOW_MS = 2 * 60 * 1000;
|
|
|
150
148
|
*/
|
|
151
149
|
export async function explainFailedStart(message, ctx, now = Date.now()) {
|
|
152
150
|
const head = `start_device failed: ${message}. The request may still have started a session, and a session is billed while it runs.`;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const { sessions } = await DeviceGateway.list(ctx.apiUrl, ctx.auth);
|
|
156
|
-
recent = sessions.filter((s) => now - Date.parse(s.created_at) <= START_RECOVERY_WINDOW_MS);
|
|
157
|
-
}
|
|
158
|
-
catch {
|
|
151
|
+
const recent = await DeviceGateway.recentlyStarted(ctx.apiUrl, ctx.auth, now);
|
|
152
|
+
if (recent === null) {
|
|
159
153
|
return `${head} Call list_devices to check for one before you call start_device again.`;
|
|
160
154
|
}
|
|
161
155
|
if (recent.length === 0) {
|
|
@@ -30,7 +30,7 @@ export function registerDownloadArtifacts(server) {
|
|
|
30
30
|
report: z
|
|
31
31
|
.enum(['junit', 'allure', 'html'])
|
|
32
32
|
.optional()
|
|
33
|
-
.describe('Also download a formatted report of this type'),
|
|
33
|
+
.describe('Also download a formatted report of this type. allure is deprecated and will be removed on 7 December 2026; prefer junit or html.'),
|
|
34
34
|
reportPath: z
|
|
35
35
|
.string()
|
|
36
36
|
.optional()
|
|
@@ -17,6 +17,13 @@ export interface ReportDownloadOptions extends DownloadOptions {
|
|
|
17
17
|
junitPath?: string;
|
|
18
18
|
reportType: 'allure' | 'html' | 'html-detailed' | 'junit';
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* The report formats retired on 7 December 2026, and what each one
|
|
22
|
+
* does from that date. `dcd cloud` users are told by the API's submit message
|
|
23
|
+
* and a notice; `dcd artifacts` fetches neither, so it prints this itself.
|
|
24
|
+
* The values stay valid after the date: a run that asks for one must not fail.
|
|
25
|
+
*/
|
|
26
|
+
export declare function reportFormatDeprecation(report: string | undefined): string | undefined;
|
|
20
27
|
/** What one download attempt did; failures are warned about, not thrown. */
|
|
21
28
|
export interface DownloadResult {
|
|
22
29
|
error?: string;
|
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
import * as path from 'node:path';
|
|
2
2
|
import { ApiGateway } from '../gateways/api-gateway.js';
|
|
3
3
|
import { refreshAuth } from '../utils/auth.js';
|
|
4
|
+
/**
|
|
5
|
+
* The report formats retired on 7 December 2026, and what each one
|
|
6
|
+
* does from that date. `dcd cloud` users are told by the API's submit message
|
|
7
|
+
* and a notice; `dcd artifacts` fetches neither, so it prints this itself.
|
|
8
|
+
* The values stay valid after the date: a run that asks for one must not fail.
|
|
9
|
+
*/
|
|
10
|
+
export function reportFormatDeprecation(report) {
|
|
11
|
+
switch (report) {
|
|
12
|
+
case 'allure': {
|
|
13
|
+
return '--report allure is deprecated and will be removed on 7 December 2026. From that date runs get no Allure report. Use --report html or --report junit instead.';
|
|
14
|
+
}
|
|
15
|
+
case 'html-detailed': {
|
|
16
|
+
return '--report html-detailed is deprecated and will be removed on 7 December 2026. From that date it gives the standard HTML report. Use --report html instead.';
|
|
17
|
+
}
|
|
18
|
+
default: {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
4
23
|
/**
|
|
5
24
|
* Service for downloading test artifacts and reports
|
|
6
25
|
*/
|