digital-ai-testing-mcp 2.0.9 → 2.1.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.
Files changed (139) hide show
  1. package/README.md +27 -31
  2. package/dist/api/browser-inspection.d.ts.map +1 -1
  3. package/dist/api/browser-inspection.js +7 -1
  4. package/dist/api/browser-inspection.js.map +1 -1
  5. package/dist/api/client.d.ts +3 -3
  6. package/dist/api/client.js +4 -4
  7. package/dist/api/client.js.map +1 -1
  8. package/dist/api/projects.js +1 -1
  9. package/dist/api/projects.js.map +1 -1
  10. package/dist/api/reporting.d.ts +16 -2
  11. package/dist/api/reporting.d.ts.map +1 -1
  12. package/dist/api/reporting.js +75 -21
  13. package/dist/api/reporting.js.map +1 -1
  14. package/dist/api/repository.d.ts +8 -0
  15. package/dist/api/repository.d.ts.map +1 -1
  16. package/dist/api/repository.js +20 -9
  17. package/dist/api/repository.js.map +1 -1
  18. package/dist/api/test-requests.d.ts +25 -0
  19. package/dist/api/test-requests.d.ts.map +1 -0
  20. package/dist/api/test-requests.js +40 -0
  21. package/dist/api/test-requests.js.map +1 -0
  22. package/dist/api/usage-reports.d.ts +7 -4
  23. package/dist/api/usage-reports.d.ts.map +1 -1
  24. package/dist/api/usage-reports.js +7 -4
  25. package/dist/api/usage-reports.js.map +1 -1
  26. package/dist/api/virtual-devices.d.ts +37 -0
  27. package/dist/api/virtual-devices.d.ts.map +1 -0
  28. package/dist/api/virtual-devices.js +69 -0
  29. package/dist/api/virtual-devices.js.map +1 -0
  30. package/dist/api/webdriver.d.ts +47 -1
  31. package/dist/api/webdriver.d.ts.map +1 -1
  32. package/dist/api/webdriver.js +157 -13
  33. package/dist/api/webdriver.js.map +1 -1
  34. package/dist/index.js +7 -4
  35. package/dist/index.js.map +1 -1
  36. package/dist/tools/boilerplate-tools.d.ts +9 -0
  37. package/dist/tools/boilerplate-tools.d.ts.map +1 -1
  38. package/dist/tools/boilerplate-tools.js +347 -61
  39. package/dist/tools/boilerplate-tools.js.map +1 -1
  40. package/dist/tools/device-health-tool.d.ts +3 -0
  41. package/dist/tools/device-health-tool.d.ts.map +1 -0
  42. package/dist/tools/device-health-tool.js +175 -0
  43. package/dist/tools/device-health-tool.js.map +1 -0
  44. package/dist/tools/device-tools.d.ts +2 -0
  45. package/dist/tools/device-tools.d.ts.map +1 -1
  46. package/dist/tools/device-tools.js +67 -6
  47. package/dist/tools/device-tools.js.map +1 -1
  48. package/dist/tools/health-tools.d.ts.map +1 -1
  49. package/dist/tools/health-tools.js +3 -0
  50. package/dist/tools/health-tools.js.map +1 -1
  51. package/dist/tools/inspection-tools.d.ts.map +1 -1
  52. package/dist/tools/inspection-tools.js +41 -2
  53. package/dist/tools/inspection-tools.js.map +1 -1
  54. package/dist/tools/meta-tools.d.ts +7 -1
  55. package/dist/tools/meta-tools.d.ts.map +1 -1
  56. package/dist/tools/meta-tools.js +24 -11
  57. package/dist/tools/meta-tools.js.map +1 -1
  58. package/dist/tools/remediation-tools.js +1 -1
  59. package/dist/tools/remediation-tools.js.map +1 -1
  60. package/dist/tools/reporting-tools.d.ts.map +1 -1
  61. package/dist/tools/reporting-tools.js +82 -22
  62. package/dist/tools/reporting-tools.js.map +1 -1
  63. package/dist/tools/repository-tools.js +3 -3
  64. package/dist/tools/repository-tools.js.map +1 -1
  65. package/dist/tools/resources.js +3 -3
  66. package/dist/tools/resources.js.map +1 -1
  67. package/dist/tools/transaction-tools.d.ts.map +1 -1
  68. package/dist/tools/transaction-tools.js +24 -5
  69. package/dist/tools/transaction-tools.js.map +1 -1
  70. package/dist/tools/usage-report-tools.js +1 -1
  71. package/dist/tools/usage-report-tools.js.map +1 -1
  72. package/dist/types/digital-ai.d.ts +2 -0
  73. package/dist/types/digital-ai.d.ts.map +1 -1
  74. package/dist/utils/access-level.d.ts +1 -1
  75. package/dist/utils/access-level.d.ts.map +1 -1
  76. package/dist/utils/api-error.js +1 -1
  77. package/dist/utils/api-error.js.map +1 -1
  78. package/dist/utils/device-health.d.ts +52 -0
  79. package/dist/utils/device-health.d.ts.map +1 -0
  80. package/dist/utils/device-health.js +76 -0
  81. package/dist/utils/device-health.js.map +1 -0
  82. package/dist/utils/device-query.d.ts +6 -0
  83. package/dist/utils/device-query.d.ts.map +1 -0
  84. package/dist/utils/device-query.js +10 -0
  85. package/dist/utils/device-query.js.map +1 -0
  86. package/dist/utils/device-resolver.d.ts.map +1 -1
  87. package/dist/utils/device-resolver.js +2 -1
  88. package/dist/utils/device-resolver.js.map +1 -1
  89. package/dist/utils/download-command.d.ts +1 -1
  90. package/dist/utils/download-command.d.ts.map +1 -1
  91. package/dist/utils/log-view.d.ts +30 -0
  92. package/dist/utils/log-view.d.ts.map +1 -0
  93. package/dist/utils/log-view.js +84 -0
  94. package/dist/utils/log-view.js.map +1 -0
  95. package/dist/utils/path-guard.js +1 -1
  96. package/dist/utils/path-guard.js.map +1 -1
  97. package/dist/utils/performance-comparison.d.ts +1 -1
  98. package/dist/utils/performance-comparison.d.ts.map +1 -1
  99. package/dist/utils/performance-comparison.js +3 -2
  100. package/dist/utils/performance-comparison.js.map +1 -1
  101. package/dist/utils/performance-stats.js +2 -2
  102. package/dist/utils/performance-stats.js.map +1 -1
  103. package/dist/utils/remediation.d.ts +14 -6
  104. package/dist/utils/remediation.d.ts.map +1 -1
  105. package/dist/utils/remediation.js +31 -15
  106. package/dist/utils/remediation.js.map +1 -1
  107. package/dist/utils/test-orchestrator.d.ts +1 -1
  108. package/dist/utils/test-orchestrator.d.ts.map +1 -1
  109. package/dist/utils/test-orchestrator.js +2 -1
  110. package/dist/utils/test-orchestrator.js.map +1 -1
  111. package/dist/utils/tool-annotations.d.ts +5 -0
  112. package/dist/utils/tool-annotations.d.ts.map +1 -1
  113. package/dist/utils/tool-annotations.js +6 -1
  114. package/dist/utils/tool-annotations.js.map +1 -1
  115. package/dist/utils/tool-registry.d.ts +2 -1
  116. package/dist/utils/tool-registry.d.ts.map +1 -1
  117. package/dist/utils/tool-registry.js +2 -1
  118. package/dist/utils/tool-registry.js.map +1 -1
  119. package/dist/utils/toolsets.d.ts +3 -3
  120. package/dist/utils/toolsets.d.ts.map +1 -1
  121. package/dist/utils/toolsets.js +6 -1
  122. package/dist/utils/toolsets.js.map +1 -1
  123. package/dist/utils/upload-command.d.ts +1 -1
  124. package/dist/utils/upload-command.d.ts.map +1 -1
  125. package/dist/utils/usage-report-summary.d.ts +4 -4
  126. package/dist/utils/usage-report-summary.d.ts.map +1 -1
  127. package/dist/utils/usage-report-summary.js +4 -4
  128. package/dist/utils/usage-report-summary.js.map +1 -1
  129. package/dist/utils/version.js +1 -1
  130. package/dist/utils/version.js.map +1 -1
  131. package/package.json +6 -1
  132. package/resources/boilerplate/Android-Native/NodeJS (WebDriver)/wdio-oss.conf.js +2 -2
  133. package/resources/boilerplate/Android-Native/Robot Framework/AndroidNative-oss.robot +51 -0
  134. package/resources/boilerplate/Android-Native/Robot Framework/DigitalAiReport.py +36 -0
  135. package/resources/boilerplate/Android-Native/Robot Framework/pip-oss.txt +2 -0
  136. package/resources/boilerplate/Web/Robot Framework/DigitalAiWebReport.py +36 -0
  137. package/resources/boilerplate/iOS-Native/Robot Framework/DigitalAiReport.py +36 -0
  138. package/resources/boilerplate/iOS-Native/Robot Framework/iOSNative-oss.robot +49 -0
  139. package/resources/boilerplate/iOS-Native/Robot Framework/pip-oss.txt +2 -0
@@ -0,0 +1,69 @@
1
+ import { apiGet } from './client.js';
2
+ import { escapeDeviceQueryValue } from '../utils/device-query.js';
3
+ // Emulator/simulator TEMPLATES (the portal's Virtual Devices page). Idle templates are not devices — list_devices,
4
+ // list_agents and get_agent_devices never show them; they become a device only while a session runs.
5
+ // GET /api/v2/virtual-devices/load is the portal's DevExtreme data source (live 2026-10-16): 200 for Cloud Admin,
6
+ // Project Admin and Project User alike (all saw the same catalog); Bearer auth required (X-API-KEY alone → 401).
7
+ // The record schema differs between platform versions: one tenant returns `imageName` (the exact template name),
8
+ // another only `name`, a debug string like "ModelKey[osVersion=15, model=Samsung S25]", and refuses a sort on
9
+ // `imageName` (500). So no server-side sort or field selector is sent, and both shapes are normalised here.
10
+ // No region or agent fields exist on either; /api/v2/virtual-devices/{id} is 404.
11
+ const PAGE_SIZE = 500;
12
+ const MAX_PAGES = 20;
13
+ const MODEL_KEY_RE = /^ModelKey\[/;
14
+ /**
15
+ * contains(@name, …) when the exact template name is known (the form a client used successfully on a tenant that
16
+ * returns imageName; name matching is case-sensitive); otherwise @model — verified live 2026-10-16:
17
+ * "@os='ios' and @emulator='true' and @model='iPhone 17e'" allocated that simulator.
18
+ */
19
+ export function suggestedDeviceQuery(t) {
20
+ const os = t.os === 'iOS' ? 'ios' : 'android';
21
+ const base = `@os='${os}' and @emulator='true'`;
22
+ if (t.templateName)
23
+ return `${base} and contains(@name,'${escapeDeviceQueryValue(t.templateName)}')`;
24
+ if (t.model)
25
+ return `${base} and @model='${escapeDeviceQueryValue(t.model)}'`;
26
+ return base;
27
+ }
28
+ export function normalizeVirtualDevice(raw) {
29
+ const templateName = raw.imageName || (raw.name && !MODEL_KEY_RE.test(raw.name) ? raw.name : null) || null;
30
+ const osRaw = (raw.os ?? '').toUpperCase();
31
+ const os = osRaw === 'IOS' ? 'iOS' : osRaw === 'ANDROID' ? 'Android' : (raw.os ?? 'unknown');
32
+ const t = {
33
+ id: raw.id,
34
+ templateName,
35
+ os,
36
+ model: raw.deviceModel ?? null,
37
+ osVersion: raw.osVersion ?? null,
38
+ manufacturer: raw.manufacturer ?? null,
39
+ category: raw.category ?? null,
40
+ screen: raw.screenWidth && raw.screenHeight ? `${raw.screenWidth}x${raw.screenHeight}` : null,
41
+ status: raw.status ?? null,
42
+ };
43
+ return { ...t, deviceQuery: suggestedDeviceQuery(t) };
44
+ }
45
+ /** Every template in the catalog, paged (the catalog is small — ~150 on a busy tenant). */
46
+ export async function listVirtualDeviceTemplates() {
47
+ try {
48
+ // Deduped by id: a platform version that ignores `skip` would otherwise return the same page MAX_PAGES times.
49
+ const byId = new Map();
50
+ for (let page = 0; page < MAX_PAGES; page++) {
51
+ const res = await apiGet('/api/v2/virtual-devices/load', {
52
+ jsonQuery: JSON.stringify({ requireTotalCount: true, skip: page * PAGE_SIZE, take: PAGE_SIZE }),
53
+ userData: '{}',
54
+ });
55
+ const rows = Array.isArray(res?.data) ? res.data : [];
56
+ const before = byId.size;
57
+ for (const r of rows)
58
+ byId.set(r.id, r);
59
+ const newRows = byId.size - before;
60
+ if (newRows === 0 || rows.length < PAGE_SIZE || (res.totalCount !== undefined && byId.size >= res.totalCount))
61
+ break;
62
+ }
63
+ return [...byId.values()].map(normalizeVirtualDevice);
64
+ }
65
+ catch (e) {
66
+ throw new Error(`listVirtualDeviceTemplates failed: ${e.message}`);
67
+ }
68
+ }
69
+ //# sourceMappingURL=virtual-devices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtual-devices.js","sourceRoot":"","sources":["../../src/api/virtual-devices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,mHAAmH;AACnH,qGAAqG;AACrG,kHAAkH;AAClH,iHAAiH;AACjH,iHAAiH;AACjH,8GAA8G;AAC9G,4GAA4G;AAC5G,kFAAkF;AAElF,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,SAAS,GAAG,EAAE,CAAC;AA+BrB,MAAM,YAAY,GAAG,aAAa,CAAC;AAEnC;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,CAA+D;IAClG,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9C,MAAM,IAAI,GAAG,QAAQ,EAAE,wBAAwB,CAAC;IAChD,IAAI,CAAC,CAAC,YAAY;QAAE,OAAO,GAAG,IAAI,wBAAwB,sBAAsB,CAAC,CAAC,CAAC,YAAY,CAAC,IA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AK,CAAC,sCAAuC,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;AACH,CAAC"}
@@ -18,6 +18,23 @@ export declare const AUTOMOTIVE_RESOLUTIONS: readonly ["800x480", "1280x720", "1
18
18
  export type AutomotiveResolution = (typeof AUTOMOTIVE_RESOLUTIONS)[number];
19
19
  export declare const INSTRUMENT_CLUSTER_CONTENT: readonly ["Instruction Card", "Map", "Navigation App"];
20
20
  export type InstrumentClusterContent = (typeof INSTRUMENT_CLUSTER_CONTENT)[number];
21
+ /** The platform rejects longer device queries ("Device query length restricted to 255", seen live 2026-10-16). */
22
+ export declare const DEVICE_QUERY_MAX_LENGTH = 255;
23
+ /** Same wording as the platform, plus the length, so the caller can shorten it without a round trip. */
24
+ export declare function deviceQueryLengthError(query: string): string | null;
25
+ /**
26
+ * How long to wait for POST /session. Emulators/simulators boot (and install the app) inside the request: a Java test
27
+ * took 60–130 s for an iOS simulator while the 120 s default timed out (debug-mode intake 2026-10-16). A projection
28
+ * session needs the platform's own failure to arrive (see below). INSPECTION_SESSION_TIMEOUT_MS overrides both.
29
+ */
30
+ export declare function sessionCreateTimeoutMs(query: string, automotiveProjection: boolean, env?: NodeJS.ProcessEnv): number;
31
+ /**
32
+ * digitalai:newSessionWaitTimeout (seconds) — how long the platform waits for a matching free device. Without it the
33
+ * platform kept an unmatchable query waiting 5+ minutes, so our client timed out with no reason; with it the platform
34
+ * answers "No available device matching the query: …" (verified live 2026-10-16, Grid and Appium Server). It is set
35
+ * 15 s under the client timeout so the platform's answer always arrives first.
36
+ */
37
+ export declare function newSessionWaitSeconds(clientTimeoutMs: number): number;
21
38
  export declare function createInspectionSession(opts: InspectionSessionOptions): Promise<InspectionSession>;
22
39
  export declare function quitInspectionSession(handle: string, keepReport?: boolean): Promise<{
23
40
  reportDeleted: boolean;
@@ -53,7 +70,7 @@ export interface FindElementsOptions {
53
70
  budgetMs?: number;
54
71
  }
55
72
  /**
56
- * Attribute enrichment costs 7–8 requests per element. Done one element at a time with no cap, 48 iOS home-screen
73
+ * Attribute enrichment costs 7–9 requests per element. Done one element at a time with no cap, 48 iOS home-screen
57
74
  * icons took 80–160 s (measured live 2026-10-09) — past the ~60 s MCP client timeout. So: a cap, a time budget, and
58
75
  * bounded parallelism (iOS kept low — hammering WebDriverAgent has crashed sessions before). Elements beyond the cap
59
76
  * or budget are still returned, with `enriched: false` and null attributes.
@@ -82,6 +99,29 @@ export declare function swipeScreen(handle: string, startX: number, startY: numb
82
99
  export declare function launchApp(handle: string, packageName: string, activity?: string): Promise<string>;
83
100
  export declare function pressBack(handle: string): Promise<string>;
84
101
  export type AutomotiveAction = 'start' | 'stop' | 'screenshot' | 'tap' | 'dump';
102
+ export type AudioAction = 'play' | 'stop_play' | 'record_start' | 'record_stop';
103
+ export declare const WAV_HEADER_ONLY_BYTES = 44;
104
+ export declare function audioControl(handle: string, action: AudioAction, opts: {
105
+ file?: string;
106
+ durationSeconds?: number;
107
+ recordingName?: string;
108
+ } | undefined, deps: {
109
+ /** Looked up in the session's project — "cloud:<name>" resolves within that project. */
110
+ findRepositoryFile: (uniqueName: string, projectName?: string) => Promise<{
111
+ id: number;
112
+ uniqueName: string;
113
+ size: number;
114
+ } | undefined>;
115
+ sleep?: (ms: number) => Promise<void>;
116
+ }): Promise<{
117
+ message: string;
118
+ recording?: {
119
+ id: number | null;
120
+ name: string;
121
+ size: number | null;
122
+ headerOnly: boolean;
123
+ };
124
+ }>;
85
125
  export declare function automotiveControl(handle: string, action: AutomotiveAction, opts?: {
86
126
  resolution?: AutomotiveResolution;
87
127
  clusterContent?: InstrumentClusterContent;
@@ -148,6 +188,12 @@ export declare function isSameActivity(requested: string, current: string): bool
148
188
  export declare function requireSession(handle: string): InspectionSession;
149
189
  export declare function listActiveSessions(): InspectionSession[];
150
190
  export declare function getPendingReportIds(): number[];
191
+ /**
192
+ * Register the reports that timed-out starts created after the client stopped waiting, so cleanup_inspection_sessions
193
+ * can delete them. Any status counts (the session may still be running or have idled out). A start whose report
194
+ * has not appeared stays pending for the next sweep. Returns the newly tracked report IDs. Never throws.
195
+ */
196
+ export declare function sweepTimedOutStarts(): Promise<number[]>;
151
197
  export declare function deleteAllTrackedReports(): Promise<{
152
198
  deleted: number[];
153
199
  failed: number[];
@@ -1 +1 @@
1
- {"version":3,"file":"webdriver.d.ts","sourceRoot":"","sources":["../../src/api/webdriver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AA8BhE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6HAA6H;IAC7H,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,kFAAkF;IAClF,iBAAiB,CAAC,EAAE,wBAAwB,CAAC;CAC9C;AAED,sFAAsF;AACtF,eAAO,MAAM,sBAAsB,+CAAgD,CAAC;AACpF,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3E,eAAO,MAAM,0BAA0B,wDAAyD,CAAC;AACjG,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnF,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,wBAAwB,GAC7B,OAAO,CAAC,iBAAiB,CAAC,CAmJ5B;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,UAAU,UAAQ,GACjB,OAAO,CAAC;IACT,aAAa,EAAE,OAAO,CAAC;IAC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O,CAAC;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CA0BhG"}
@@ -3,6 +3,7 @@ import { deleteTests, listTests } from './reporting.js';
3
3
  import { getMyAccountInfo } from './users.js';
4
4
  import { getActiveUrl, getActiveAccessKey } from './client.js';
5
5
  import { checkDeleteAllowed } from './access-level.js';
6
+ import { isEmulatorQuery } from '../utils/device-query.js';
6
7
  // In-process session registry — cleared on MCP server restart
7
8
  const sessionRegistry = new Map();
8
9
  // All report IDs created this process lifetime, mapped to the project name they
@@ -28,21 +29,44 @@ function makeClient() {
28
29
  /** Android Auto supports all three; CarPlay supports 800x480 only (platform docs). */
29
30
  export const AUTOMOTIVE_RESOLUTIONS = ['800x480', '1280x720', '1920x1080'];
30
31
  export const INSTRUMENT_CLUSTER_CONTENT = ['Instruction Card', 'Map', 'Navigation App'];
32
+ /** The platform rejects longer device queries ("Device query length restricted to 255", seen live 2026-10-16). */
33
+ export const DEVICE_QUERY_MAX_LENGTH = 255;
34
+ /** Same wording as the platform, plus the length, so the caller can shorten it without a round trip. */
35
+ export function deviceQueryLengthError(query) {
36
+ return query.length > DEVICE_QUERY_MAX_LENGTH
37
+ ? `Device query length restricted to ${DEVICE_QUERY_MAX_LENGTH} characters (this one is ${query.length}, including any region clause). Shorten it — e.g. drop redundant clauses or match a shorter part of the name with contains().`
38
+ : null;
39
+ }
40
+ const DEFAULT_SESSION_CREATE_TIMEOUT_MS = 120_000;
41
+ const LONG_SESSION_CREATE_TIMEOUT_MS = 240_000;
42
+ /**
43
+ * How long to wait for POST /session. Emulators/simulators boot (and install the app) inside the request: a Java test
44
+ * took 60–130 s for an iOS simulator while the 120 s default timed out (debug-mode intake 2026-10-16). A projection
45
+ * session needs the platform's own failure to arrive (see below). INSPECTION_SESSION_TIMEOUT_MS overrides both.
46
+ */
47
+ export function sessionCreateTimeoutMs(query, automotiveProjection, env = process.env) {
48
+ const override = Number(env.INSPECTION_SESSION_TIMEOUT_MS);
49
+ if (Number.isFinite(override) && override > 0)
50
+ return override;
51
+ if (automotiveProjection || isEmulatorQuery(query))
52
+ return LONG_SESSION_CREATE_TIMEOUT_MS;
53
+ return DEFAULT_SESSION_CREATE_TIMEOUT_MS;
54
+ }
55
+ /**
56
+ * digitalai:newSessionWaitTimeout (seconds) — how long the platform waits for a matching free device. Without it the
57
+ * platform kept an unmatchable query waiting 5+ minutes, so our client timed out with no reason; with it the platform
58
+ * answers "No available device matching the query: …" (verified live 2026-10-16, Grid and Appium Server). It is set
59
+ * 15 s under the client timeout so the platform's answer always arrives first.
60
+ */
61
+ export function newSessionWaitSeconds(clientTimeoutMs) {
62
+ return Math.max(10, Math.floor(clientTimeoutMs / 1000) - 15);
63
+ }
31
64
  export async function createInspectionSession(opts) {
32
65
  // getActiveAccessKey (not process.env) — the session must be created with the
33
66
  // active profile's credential so canDeleteReport is derived from the same credential.
34
67
  const accessKey = getActiveAccessKey();
35
68
  if (!accessKey)
36
69
  throw new Error('DIGITAL_AI_ACCESS_KEY not configured');
37
- // Capture the active profile's project — the session's report is created in
38
- // this project's reporter instance and any later delete must scope to it.
39
- let projectName;
40
- try {
41
- projectName = (await getMyAccountInfo()).project?.name;
42
- }
43
- catch {
44
- // Non-fatal — deletes fall back to the default reporter scope
45
- }
46
70
  const platform = opts.platform ?? 'android';
47
71
  let query = opts.deviceQuery ??
48
72
  (platform === 'ios' ? "@os='iOS' and @category='PHONE'" : "@os='android' and @category='PHONE'");
@@ -53,6 +77,18 @@ export async function createInspectionSession(opts) {
53
77
  query = `${query} and @version>='10.0'`;
54
78
  if (opts.region)
55
79
  query = `${query} and @region='${opts.region}'`;
80
+ const tooLong = deviceQueryLengthError(query);
81
+ if (tooLong)
82
+ throw new Error(tooLong);
83
+ // Capture the active profile's project — the session's report is created in
84
+ // this project's reporter instance and any later delete must scope to it.
85
+ let projectName;
86
+ try {
87
+ projectName = (await getMyAccountInfo()).project?.name;
88
+ }
89
+ catch {
90
+ // Non-fatal — deletes fall back to the default reporter scope
91
+ }
56
92
  const desiredCapabilities = {
57
93
  'digitalai:accessKey': accessKey,
58
94
  'digitalai:deviceQuery': query,
@@ -76,6 +112,8 @@ export async function createInspectionSession(opts) {
76
112
  desiredCapabilities['digitalai:automotiveProjection'] = opts.automotiveProjection;
77
113
  if (opts.instrumentCluster)
78
114
  desiredCapabilities['digitalai:instrumentCluster'] = opts.instrumentCluster;
115
+ const timeout = sessionCreateTimeoutMs(query, !!opts.automotiveProjection);
116
+ desiredCapabilities['digitalai:newSessionWaitTimeout'] = newSessionWaitSeconds(timeout);
79
117
  // Dual-protocol session request: the proprietary Grid (JWP) reads
80
118
  // desiredCapabilities; standard Appium Server (W3C) reads capabilities.alwaysMatch
81
119
  // and requires non-standard caps to carry the appium: vendor prefix.
@@ -97,8 +135,7 @@ export async function createInspectionSession(opts) {
97
135
  // A projection session can take longer than the client default: the platform's projection start has its own 60 s
98
136
  // deadline on the device host, and a failed CarPlay start reached the reporter at 125.8 s (live 2026-10-14) — past
99
137
  // the 120 s default, so the client timed out first, never saw the platform's reason, and the failed-start cleanup
100
- // below never ran. Wait long enough to receive the platform's answer.
101
- const timeout = opts.automotiveProjection ? 240_000 : 120_000;
138
+ // below never ran. `timeout` (sessionCreateTimeoutMs, above) waits long enough to receive the platform's answer.
102
139
  res = await client.post('/session', {
103
140
  desiredCapabilities,
104
141
  capabilities: { alwaysMatch, firstMatch: [{}] },
@@ -106,6 +143,17 @@ export async function createInspectionSession(opts) {
106
143
  }
107
144
  catch (e) {
108
145
  const detail = describeWdError(e);
146
+ // Our own client gave up, but the platform did not: it may still be booting an emulator/simulator and will create
147
+ // the session (and its report) seconds or minutes later, unknown to this process. Nothing exists to clean up yet,
148
+ // so the start is remembered and cleanup_inspection_sessions sweeps whatever it left (sweepTimedOutStarts).
149
+ if (/timeout of \d+ms exceeded/i.test(detail)) {
150
+ timedOutStarts.push({ testName, projectName, requestedAt });
151
+ throw new Error(`Session creation failed: no answer from the platform within ${Math.round(timeout / 1000)} s. ` +
152
+ `Emulators/simulators boot and install the app inside this request and can take 60–130 s or more; ` +
153
+ `set INSPECTION_SESSION_TIMEOUT_MS (ms) in the MCP server's environment to wait longer. ` +
154
+ `The platform may still finish this start: the session would then hold the device unattended until its idle ` +
155
+ `timeout (~4 min) and leave a report "${testName}" — run cleanup_inspection_sessions afterwards to delete it.`);
156
+ }
109
157
  // A start that fails after a device was allocated still leaves an "Error" report (UAT 2026-10-10: five of them).
110
158
  const leftover = await cleanUpFailedSessionReport(testName, projectName, requestedAt);
111
159
  // Automotive projection failures have specific causes the generic advice below doesn't cover (UAT 2026-10-10).
@@ -253,7 +301,7 @@ export async function getPageSource(handle) {
253
301
  return res.data.value ?? '';
254
302
  }
255
303
  /**
256
- * Attribute enrichment costs 7–8 requests per element. Done one element at a time with no cap, 48 iOS home-screen
304
+ * Attribute enrichment costs 7–9 requests per element. Done one element at a time with no cap, 48 iOS home-screen
257
305
  * icons took 80–160 s (measured live 2026-10-09) — past the ~60 s MCP client timeout. So: a cap, a time budget, and
258
306
  * bounded parallelism (iOS kept low — hammering WebDriverAgent has crashed sessions before). Elements beyond the cap
259
307
  * or budget are still returned, with `enriched: false` and null attributes.
@@ -356,7 +404,7 @@ export async function findElements(handle, using, value, opts = {}) {
356
404
  // Lightweight single-element lookup: one round trip via the singular /element
357
405
  // route, no attribute enrichment. Returns null when nothing matches ("no such
358
406
  // element" 404). Used by internal helpers (e.g. press_back's nav-bar lookup)
359
- // where the full findElements enrichment (~9 requests/element) is wasteful.
407
+ // where the full findElements enrichment (7–9 requests/element) is wasteful.
360
408
  export async function findFirstElementId(handle, using, value) {
361
409
  const session = requireSession(handle);
362
410
  const client = makeClient();
@@ -705,6 +753,74 @@ function execScript(client, session, script, args, timeoutMs = 30_000) {
705
753
  const path = session.sessionFormat === 'w3c' ? 'execute/sync' : 'execute';
706
754
  return client.post(`/session/${session.gridSessionId}/${path}`, { script, args }, { timeout: timeoutMs });
707
755
  }
756
+ export const WAV_HEADER_ONLY_BYTES = 44;
757
+ const cloudRef = (name) => (name.startsWith('cloud:') ? name : `cloud:${name}`);
758
+ const bareName = (name) => name.replace(/^cloud:/, '');
759
+ export async function audioControl(handle, action, opts = {}, deps) {
760
+ const session = requireSession(handle);
761
+ if (session.platform === 'web')
762
+ throw new Error('audio_control needs a mobile inspection session, not a browser session.');
763
+ if (session.sessionFormat === 'jwp') {
764
+ throw new Error('audio_control is not available on Appium Grid sessions: stopAudioPlay / stopAudioRecording take no arguments, which the Grid cannot run, so playback and recording could be started but never stopped. Use an Appium Server project.');
765
+ }
766
+ const sleep = deps.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
767
+ const client = makeClient();
768
+ const run = (script, args = []) => execScript(client, session, script, args, 60_000);
769
+ try {
770
+ switch (action) {
771
+ case 'play': {
772
+ if (!opts.file)
773
+ throw new Error('play needs file: the repository uniqueName of an audio file (see list_repository_files).');
774
+ const found = await deps.findRepositoryFile(bareName(opts.file), session.projectName);
775
+ if (!found)
776
+ throw new Error(`No repository file named "${bareName(opts.file)}" — upload it with upload_repository_file, or pick one from list_repository_files.`);
777
+ await run('seetest:client.startAudioPlay', [cloudRef(found.uniqueName)]);
778
+ if (!opts.durationSeconds) {
779
+ return { message: `Playing "${found.uniqueName}" into the device's audio input. Call stop_play when done (the platform's own "wait for end" does not block).` };
780
+ }
781
+ await sleep(opts.durationSeconds * 1000);
782
+ await run('seetest:client.stopAudioPlay');
783
+ return { message: `Played "${found.uniqueName}" for ${opts.durationSeconds} s, then stopped.` };
784
+ }
785
+ case 'stop_play':
786
+ await run('seetest:client.stopAudioPlay');
787
+ return { message: 'Playback stopped.' };
788
+ case 'record_start': {
789
+ if (session.audioRecording)
790
+ throw new Error(`A recording ("${session.audioRecording}") is already running — record_stop it first.`);
791
+ const name = bareName(opts.recordingName ?? `mcp-recording-${session.handle}-${Date.now()}.wav`);
792
+ await run('seetest:client.startAudioRecording', [cloudRef(name)]);
793
+ session.audioRecording = name;
794
+ return { message: `Recording the device's audio output to repository file "${name}". Call record_stop to finish.` };
795
+ }
796
+ case 'record_stop': {
797
+ const name = session.audioRecording;
798
+ await run('seetest:client.stopAudioRecording');
799
+ session.audioRecording = undefined;
800
+ if (!name)
801
+ return { message: 'Recording stopped (it was not started through audio_control, so the file name is unknown — check list_repository_files).' };
802
+ let file;
803
+ // The file can take a moment to be indexed — up to 5 lookups, sleeping only BETWEEN them.
804
+ for (let i = 0; i < 5; i++) {
805
+ if (i > 0)
806
+ await sleep(2000);
807
+ file = await deps.findRepositoryFile(name, session.projectName);
808
+ if (file)
809
+ break;
810
+ }
811
+ const headerOnly = !!file && file.size <= WAV_HEADER_ONLY_BYTES;
812
+ const where = file ? `saved as repository file "${name}" (id ${file.id}, ${file.size} bytes) — download_repository_file to fetch it` : `not found in the repository yet under "${name}" — check list_repository_files shortly`;
813
+ return {
814
+ message: `Recording stopped, ${where}.` + (headerOnly ? ' ⚠️ The recording is EMPTY (header only): the device played no sound while recording. Recording captures the device\'s audio OUTPUT — start the media/call that produces sound before record_start.' : ''),
815
+ recording: { id: file?.id ?? null, name, size: file?.size ?? null, headerOnly },
816
+ };
817
+ }
818
+ }
819
+ }
820
+ catch (e) {
821
+ throw new Error(`audio ${action} failed: ${describeWdError(e)}${/Audio line is not configured/i.test(describeWdError(e)) ? ' — this device has no audio line. Pick one with find_available_device(requireAudioLine: true).' : ''}`);
822
+ }
823
+ }
708
824
  export async function automotiveControl(handle, action, opts = {}) {
709
825
  const session = requireSession(handle);
710
826
  if (session.platform === 'web')
@@ -1382,6 +1498,34 @@ export function listActiveSessions() {
1382
1498
  export function getPendingReportIds() {
1383
1499
  return [...allReports.keys()];
1384
1500
  }
1501
+ /** Session starts the client gave up on (POST /session timeout) — the platform may have completed them later. */
1502
+ const timedOutStarts = [];
1503
+ /**
1504
+ * Register the reports that timed-out starts created after the client stopped waiting, so cleanup_inspection_sessions
1505
+ * can delete them. Any status counts (the session may still be running or have idled out). A start whose report
1506
+ * has not appeared stays pending for the next sweep. Returns the newly tracked report IDs. Never throws.
1507
+ */
1508
+ export async function sweepTimedOutStarts() {
1509
+ const found = [];
1510
+ for (const start of [...timedOutStarts]) {
1511
+ try {
1512
+ const batch = await listTests({ limit: 10, filter: [{ property: 'name', operator: '=', value: start.testName }] }, undefined, start.projectName);
1513
+ const ids = (batch.data ?? [])
1514
+ .filter((r) => new Date(r.start_time).getTime() >= start.requestedAt - 15_000 && !allReports.has(r.test_id))
1515
+ .map((r) => r.test_id);
1516
+ for (const id of ids) {
1517
+ allReports.set(id, start.projectName);
1518
+ found.push(id);
1519
+ }
1520
+ if (ids.length > 0)
1521
+ timedOutStarts.splice(timedOutStarts.indexOf(start), 1);
1522
+ }
1523
+ catch {
1524
+ // Reporter unreachable — try again on the next sweep.
1525
+ }
1526
+ }
1527
+ return found;
1528
+ }
1385
1529
  export async function deleteAllTrackedReports() {
1386
1530
  if (allReports.size === 0)
1387
1531
  return { deleted: [], failed: [] };