@testdriverai/mcp 7.11.5-test → 7.11.7-canary
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/ai/skills/testdriver-client/SKILL.md +4 -0
- package/ai/skills/testdriver-find/SKILL.md +1 -1
- package/ai/skills/testdriver:client/SKILL.md +4 -0
- package/ai/skills/testdriver:find/SKILL.md +1 -1
- package/docs/_data/examples-manifest.json +46 -46
- package/docs/v7/client.mdx +4 -0
- package/docs/v7/examples/ai.mdx +1 -1
- package/docs/v7/examples/assert.mdx +1 -1
- package/docs/v7/examples/chrome-extension.mdx +1 -1
- package/docs/v7/examples/element-not-found.mdx +1 -1
- package/docs/v7/examples/findall-coffee-icons.mdx +1 -1
- package/docs/v7/examples/hover-image.mdx +1 -1
- package/docs/v7/examples/hover-text-with-description.mdx +1 -1
- package/docs/v7/examples/hover-text.mdx +1 -1
- package/docs/v7/examples/installer.mdx +1 -1
- package/docs/v7/examples/launch-vscode-linux.mdx +1 -1
- package/docs/v7/examples/parse.mdx +1 -1
- package/docs/v7/examples/press-keys.mdx +1 -1
- package/docs/v7/examples/scroll-keyboard.mdx +1 -1
- package/docs/v7/examples/scroll.mdx +1 -1
- package/docs/v7/examples/type.mdx +1 -1
- package/docs/v7/find.mdx +1 -1
- package/mcp-server/dist/core/actions.d.ts +68 -7
- package/mcp-server/dist/core/actions.js +153 -91
- package/mcp-server/dist/server.mjs +1102 -993
- package/mcp-server/src/core/actions.ts +204 -100
- package/mcp-server/src/server.ts +206 -63
- package/package.json +1 -1
- package/sdk.js +11 -3
|
@@ -125,6 +125,10 @@ const testdriver = new TestDriver(apiKey, options)
|
|
|
125
125
|
Cache key for element finding operations. If provided, enables caching tied to this key.
|
|
126
126
|
</ParamField>
|
|
127
127
|
|
|
128
|
+
<ParamField path="verify" type="boolean" default="false">
|
|
129
|
+
Global default for AI verification of located elements. When `true`, every `find()` runs a second AI check to confirm the returned coordinates actually match the requested element (catching hallucinated or incorrect positions), at the cost of extra latency. Can be overridden per call via `find(description, { verify: true | false })`.
|
|
130
|
+
</ParamField>
|
|
131
|
+
|
|
128
132
|
<ParamField path="dashcam" type="boolean" default="true">
|
|
129
133
|
Enable or disable Dashcam video recording
|
|
130
134
|
</ParamField>
|
|
@@ -54,7 +54,7 @@ const element = await testdriver.find(description, options)
|
|
|
54
54
|
</ParamField>
|
|
55
55
|
|
|
56
56
|
<ParamField path="verify" type="boolean" default={false}>
|
|
57
|
-
Enable AI verification of the located element. When `true`, a second AI call checks that the coordinates returned actually correspond to the requested element, catching hallucinated or incorrect positions. Disabled by default for lower latency.
|
|
57
|
+
Enable AI verification of the located element. When `true`, a second AI call checks that the coordinates returned actually correspond to the requested element, catching hallucinated or incorrect positions. Disabled by default for lower latency. Defaults to the global `verify` option set on the SDK constructor when not specified per call.
|
|
58
58
|
</ParamField>
|
|
59
59
|
|
|
60
60
|
<ParamField path="ai" type="object">
|
|
@@ -121,6 +121,10 @@ const testdriver = new TestDriver(apiKey, options)
|
|
|
121
121
|
Cache key for element finding operations. If provided, enables caching tied to this key.
|
|
122
122
|
</ParamField>
|
|
123
123
|
|
|
124
|
+
<ParamField path="verify" type="boolean" default="false">
|
|
125
|
+
Global default for AI verification of located elements. When `true`, every `find()` runs a second AI check to confirm the returned coordinates actually match the requested element (catching hallucinated or incorrect positions), at the cost of extra latency. Can be overridden per call via `find(description, { verify: true | false })`.
|
|
126
|
+
</ParamField>
|
|
127
|
+
|
|
124
128
|
<ParamField path="dashcam" type="boolean" default="true">
|
|
125
129
|
Enable or disable Dashcam video recording
|
|
126
130
|
</ParamField>
|
|
@@ -54,7 +54,7 @@ const element = await testdriver.find(description, options)
|
|
|
54
54
|
</ParamField>
|
|
55
55
|
|
|
56
56
|
<ParamField path="verify" type="boolean" default={false}>
|
|
57
|
-
Enable AI verification of the located element. When `true`, a second AI call checks that the coordinates returned actually correspond to the requested element, catching hallucinated or incorrect positions. Disabled by default for lower latency.
|
|
57
|
+
Enable AI verification of the located element. When `true`, a second AI call checks that the coordinates returned actually correspond to the requested element, catching hallucinated or incorrect positions. Disabled by default for lower latency. Defaults to the global `verify` option set on the SDK constructor when not specified per call.
|
|
58
58
|
</ParamField>
|
|
59
59
|
|
|
60
60
|
<ParamField path="ai" type="object">
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
"$schema": "./examples-manifest.schema.json",
|
|
3
3
|
"examples": {
|
|
4
4
|
"assert.test.mjs": {
|
|
5
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
6
|
-
"lastUpdated": "2026-07-
|
|
5
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d5bb3e5d15d75eac0d7e",
|
|
6
|
+
"lastUpdated": "2026-07-15T00:35:07.257Z"
|
|
7
7
|
},
|
|
8
8
|
"drag-and-drop.test.mjs": {
|
|
9
9
|
"url": "https://console.testdriver.ai/runs/69a62b3aaa712ecd3dea730a/69a62b42fc0ac3cc632a918b",
|
|
10
10
|
"lastUpdated": "2026-03-03T00:32:25.275Z"
|
|
11
11
|
},
|
|
12
12
|
"exec-pwsh.test.mjs": {
|
|
13
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
14
|
-
"lastUpdated": "2026-07-
|
|
13
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d4e3823fc6a1246b8e52",
|
|
14
|
+
"lastUpdated": "2026-07-15T00:38:21.897Z"
|
|
15
15
|
},
|
|
16
16
|
"match-image.test.mjs": {
|
|
17
17
|
"url": "https://console-test.testdriver.ai/runs/69c8738614b73310c7839412/69c8738c14b73310c783941d",
|
|
@@ -22,88 +22,88 @@
|
|
|
22
22
|
"lastUpdated": "2026-03-03T00:32:25.282Z"
|
|
23
23
|
},
|
|
24
24
|
"hover-text-with-description.test.mjs": {
|
|
25
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
26
|
-
"lastUpdated": "2026-07-
|
|
25
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d5133e5d15d75eac0d2a",
|
|
26
|
+
"lastUpdated": "2026-07-15T00:39:07.525Z"
|
|
27
27
|
},
|
|
28
28
|
"windows-installer.test.mjs": {
|
|
29
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
30
|
-
"lastUpdated": "2026-07-
|
|
29
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d5142274a992c42745e2",
|
|
30
|
+
"lastUpdated": "2026-07-15T00:57:11.884Z"
|
|
31
31
|
},
|
|
32
32
|
"exec-output.test.mjs": {
|
|
33
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
34
|
-
"lastUpdated": "2026-07-
|
|
33
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d5162274a992c42745e4",
|
|
34
|
+
"lastUpdated": "2026-07-15T00:46:13.121Z"
|
|
35
35
|
},
|
|
36
36
|
"chrome-extension.test.mjs": {
|
|
37
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
38
|
-
"lastUpdated": "2026-07-
|
|
37
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d4e13e5d15d75eac0d1c",
|
|
38
|
+
"lastUpdated": "2026-07-15T00:38:19.595Z"
|
|
39
39
|
},
|
|
40
40
|
"launch-vscode-linux.test.mjs": {
|
|
41
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
42
|
-
"lastUpdated": "2026-07-
|
|
41
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d4fb2274a992c42745e0",
|
|
42
|
+
"lastUpdated": "2026-07-15T00:45:45.182Z"
|
|
43
43
|
},
|
|
44
44
|
"hover-image.test.mjs": {
|
|
45
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
46
|
-
"lastUpdated": "2026-07-
|
|
45
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d52c823fc6a1246b8e58",
|
|
46
|
+
"lastUpdated": "2026-07-15T00:32:44.332Z"
|
|
47
47
|
},
|
|
48
48
|
"installer.test.mjs": {
|
|
49
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
50
|
-
"lastUpdated": "2026-07-
|
|
49
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d55d3e5d15d75eac0d4e",
|
|
50
|
+
"lastUpdated": "2026-07-15T00:33:33.466Z"
|
|
51
51
|
},
|
|
52
52
|
"type.test.mjs": {
|
|
53
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
54
|
-
"lastUpdated": "2026-07-
|
|
53
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d58c2274a992c4274611",
|
|
54
|
+
"lastUpdated": "2026-07-15T00:48:10.956Z"
|
|
55
55
|
},
|
|
56
56
|
"press-keys.test.mjs": {
|
|
57
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
58
|
-
"replayUrl": "https://console-test.testdriver.ai/replay/
|
|
59
|
-
"embedUrl": "https://console-test.testdriver.ai/replay/
|
|
60
|
-
"lastUpdated": "2026-07-
|
|
57
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d5a33e5d15d75eac0d77",
|
|
58
|
+
"replayUrl": "https://console-test.testdriver.ai/replay/6a56dc8e3e5d15d75eac0df0?share=ZM6rTCmGwCpC1YtUtOcbhw",
|
|
59
|
+
"embedUrl": "https://console-test.testdriver.ai/replay/6a56dc8e3e5d15d75eac0df0?share=ZM6rTCmGwCpC1YtUtOcbhw&embed=true",
|
|
60
|
+
"lastUpdated": "2026-07-15T01:04:19.595Z"
|
|
61
61
|
},
|
|
62
62
|
"scroll-keyboard.test.mjs": {
|
|
63
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
64
|
-
"lastUpdated": "2026-07-
|
|
63
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d5eb3e5d15d75eac0d8a",
|
|
64
|
+
"lastUpdated": "2026-07-15T00:49:44.110Z"
|
|
65
65
|
},
|
|
66
66
|
"scroll.test.mjs": {
|
|
67
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
68
|
-
"lastUpdated": "2026-07-
|
|
67
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d6092274a992c427463d",
|
|
68
|
+
"lastUpdated": "2026-07-15T00:43:20.527Z"
|
|
69
69
|
},
|
|
70
70
|
"scroll-until-image.test.mjs": {
|
|
71
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
72
|
-
"lastUpdated": "2026-07-
|
|
71
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d5ec2274a992c4274634",
|
|
72
|
+
"lastUpdated": "2026-07-15T00:35:57.105Z"
|
|
73
73
|
},
|
|
74
74
|
"prompt.test.mjs": {
|
|
75
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
76
|
-
"lastUpdated": "2026-07-
|
|
75
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d5ee3e5d15d75eac0d8b",
|
|
76
|
+
"lastUpdated": "2026-07-15T00:49:48.454Z"
|
|
77
77
|
},
|
|
78
78
|
"focus-window.test.mjs": {
|
|
79
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
80
|
-
"lastUpdated": "2026-07-
|
|
79
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d5f02274a992c4274636",
|
|
80
|
+
"lastUpdated": "2026-07-15T00:49:50.238Z"
|
|
81
81
|
},
|
|
82
82
|
"captcha-api.test.mjs": {
|
|
83
83
|
"url": "https://console.testdriver.ai/runs/698f7df69e27ce1528d7d087/698f7fb0d3b320ad547d9d44",
|
|
84
84
|
"lastUpdated": "2026-02-13T19:55:05.951Z"
|
|
85
85
|
},
|
|
86
86
|
"element-not-found.test.mjs": {
|
|
87
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
88
|
-
"lastUpdated": "2026-07-
|
|
87
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d61f2274a992c4274641",
|
|
88
|
+
"lastUpdated": "2026-07-15T00:43:45.295Z"
|
|
89
89
|
},
|
|
90
90
|
"formatted-logging.test.mjs": {
|
|
91
91
|
"url": "https://console-test.testdriver.ai/runs/69c8738614b73310c7839412/69c873a714b73310c7839450",
|
|
92
92
|
"lastUpdated": "2026-03-29T00:36:10.628Z"
|
|
93
93
|
},
|
|
94
94
|
"hover-text.test.mjs": {
|
|
95
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
96
|
-
"lastUpdated": "2026-07-
|
|
95
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d64d2274a992c4274643",
|
|
96
|
+
"lastUpdated": "2026-07-15T00:44:32.621Z"
|
|
97
97
|
},
|
|
98
98
|
"no-provision.test.mjs": {
|
|
99
99
|
"url": "https://console.testdriver.ai/runs/69a62b3aaa712ecd3dea730a/69a62b7706a177a05bccd1cf",
|
|
100
100
|
"lastUpdated": "2026-03-03T00:32:25.279Z"
|
|
101
101
|
},
|
|
102
102
|
"ai.test.mjs": {
|
|
103
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
104
|
-
"replayUrl": "https://console-test.testdriver.ai/replay/
|
|
105
|
-
"embedUrl": "https://console-test.testdriver.ai/replay/
|
|
106
|
-
"lastUpdated": "2026-07-
|
|
103
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d6352274a992c4274642",
|
|
104
|
+
"replayUrl": "https://console-test.testdriver.ai/replay/6a56df942274a992c42746d5?share=ONWSkyWjk3x2rtVjANyiA",
|
|
105
|
+
"embedUrl": "https://console-test.testdriver.ai/replay/6a56df942274a992c42746d5?share=ONWSkyWjk3x2rtVjANyiA&embed=true",
|
|
106
|
+
"lastUpdated": "2026-07-15T01:17:14.431Z"
|
|
107
107
|
},
|
|
108
108
|
"popup-loading.test.mjs": {
|
|
109
109
|
"url": "https://console.testdriver.ai/runs/698bc89f7140c3fa7daaca8d/698bca7f7140c3fa7daacbf7",
|
|
@@ -138,12 +138,12 @@
|
|
|
138
138
|
"lastUpdated": "2026-02-13T19:55:05.953Z"
|
|
139
139
|
},
|
|
140
140
|
"findall-coffee-icons.test.mjs": {
|
|
141
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
142
|
-
"lastUpdated": "2026-07-
|
|
141
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d5d32274a992c427462d",
|
|
142
|
+
"lastUpdated": "2026-07-15T00:35:31.546Z"
|
|
143
143
|
},
|
|
144
144
|
"parse.test.mjs": {
|
|
145
|
-
"url": "https://console-test.testdriver.ai/runs/
|
|
146
|
-
"lastUpdated": "2026-07-
|
|
145
|
+
"url": "https://console-test.testdriver.ai/runs/6a56d4cad5a17ea4b9190265/6a56d6653e5d15d75eac0d95",
|
|
146
|
+
"lastUpdated": "2026-07-15T00:44:55.714Z"
|
|
147
147
|
},
|
|
148
148
|
"flake-diffthreshold-001.test.mjs": {
|
|
149
149
|
"url": "https://console.testdriver.ai/runs/69a62b3aaa712ecd3dea730a/69a62bcafc0ac3cc632a91aa",
|
package/docs/v7/client.mdx
CHANGED
|
@@ -126,6 +126,10 @@ const testdriver = new TestDriver(apiKey, options)
|
|
|
126
126
|
Cache key for element finding operations. If provided, enables caching tied to this key.
|
|
127
127
|
</ParamField>
|
|
128
128
|
|
|
129
|
+
<ParamField path="verify" type="boolean" default="false">
|
|
130
|
+
Global default for AI verification of located elements. When `true`, every `find()` runs a second AI check to confirm the returned coordinates actually match the requested element (catching hallucinated or incorrect positions), at the cost of extra latency. Can be overridden per call via `find(description, { verify: true | false })`.
|
|
131
|
+
</ParamField>
|
|
132
|
+
|
|
129
133
|
<ParamField path="dashcam" type="boolean" default="true">
|
|
130
134
|
Enable or disable Dashcam video recording
|
|
131
135
|
</ParamField>
|
package/docs/v7/examples/ai.mdx
CHANGED
|
@@ -17,7 +17,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
17
17
|
|
|
18
18
|
{/* ai.test.mjs output */}
|
|
19
19
|
<iframe
|
|
20
|
-
src="https://console-test.testdriver.ai/replay/
|
|
20
|
+
src="https://console-test.testdriver.ai/replay/6a56df942274a992c42746d5?share=ONWSkyWjk3x2rtVjANyiA&embed=true"
|
|
21
21
|
width="100%"
|
|
22
22
|
height="600"
|
|
23
23
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* assert.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/6a56d5bb3e5d15d75eac0d7e/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* chrome-extension.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/6a56d4e13e5d15d75eac0d1c/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* element-not-found.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/6a56d61f2274a992c4274641/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -18,7 +18,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
18
18
|
|
|
19
19
|
{/* findall-coffee-icons.test.mjs output */}
|
|
20
20
|
<iframe
|
|
21
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
21
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/6a56d5d32274a992c427462d/replay"
|
|
22
22
|
width="100%"
|
|
23
23
|
height="600"
|
|
24
24
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* hover-image.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/6a56d52c823fc6a1246b8e58/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -18,7 +18,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
18
18
|
|
|
19
19
|
{/* hover-text-with-description.test.mjs output */}
|
|
20
20
|
<iframe
|
|
21
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
21
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/6a56d5133e5d15d75eac0d2a/replay"
|
|
22
22
|
width="100%"
|
|
23
23
|
height="600"
|
|
24
24
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* hover-text.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/6a56d64d2274a992c4274643/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* installer.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/6a56d55d3e5d15d75eac0d4e/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* launch-vscode-linux.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/6a56d4fb2274a992c42745e0/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -18,7 +18,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
18
18
|
|
|
19
19
|
{/* parse.test.mjs output */}
|
|
20
20
|
<iframe
|
|
21
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
21
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/6a56d6653e5d15d75eac0d95/replay"
|
|
22
22
|
width="100%"
|
|
23
23
|
height="600"
|
|
24
24
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* press-keys.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://console-test.testdriver.ai/replay/
|
|
15
|
+
src="https://console-test.testdriver.ai/replay/6a56dc8e3e5d15d75eac0df0?share=ZM6rTCmGwCpC1YtUtOcbhw&embed=true"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* scroll-keyboard.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/6a56d5eb3e5d15d75eac0d8a/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* scroll.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/6a56d6092274a992c427463d/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
|
@@ -12,7 +12,7 @@ Watch this test execute in a real sandbox environment:
|
|
|
12
12
|
|
|
13
13
|
{/* type.test.mjs output */}
|
|
14
14
|
<iframe
|
|
15
|
-
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/
|
|
15
|
+
src="https://api-test.testdriver.ai/api/v1/testdriver/testcase/6a56d58c2274a992c4274611/replay"
|
|
16
16
|
width="100%"
|
|
17
17
|
height="390"
|
|
18
18
|
style={{ border: "1px solid #333", borderRadius: "8px" }}
|
package/docs/v7/find.mdx
CHANGED
|
@@ -55,7 +55,7 @@ const element = await testdriver.find(description, options)
|
|
|
55
55
|
</ParamField>
|
|
56
56
|
|
|
57
57
|
<ParamField path="verify" type="boolean" default={false}>
|
|
58
|
-
Enable AI verification of the located element. When `true`, a second AI call checks that the coordinates returned actually correspond to the requested element, catching hallucinated or incorrect positions. Disabled by default for lower latency.
|
|
58
|
+
Enable AI verification of the located element. When `true`, a second AI call checks that the coordinates returned actually correspond to the requested element, catching hallucinated or incorrect positions. Disabled by default for lower latency. Defaults to the global `verify` option set on the [SDK constructor](/v7/client) when not specified per call.
|
|
59
59
|
</ParamField>
|
|
60
60
|
|
|
61
61
|
<ParamField path="ai" type="object">
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* mirroring how the stdio MCP server has always behaved.
|
|
19
19
|
*/
|
|
20
20
|
import { SessionStartInputSchema, type SessionStartInput } from "../provision-types.js";
|
|
21
|
-
import { type SessionState } from "../session.js";
|
|
21
|
+
import { SessionManager, type SessionState } from "../session.js";
|
|
22
22
|
export { SessionStartInputSchema, type SessionStartInput };
|
|
23
23
|
export interface ActionImage {
|
|
24
24
|
kind: "screenshot" | "cropped";
|
|
@@ -44,14 +44,75 @@ export declare class NoActiveSessionError extends Error {
|
|
|
44
44
|
constructor(code: "NO_SESSION" | "SESSION_EXPIRED", message: string, expiredSessionId?: string);
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
47
|
+
* The mutable state a single sandbox session needs: the live SDK handle, the
|
|
48
|
+
* element-ref map from `find`/`findall`, the "last screenshot" `check` diffs
|
|
49
|
+
* against, the adapter recovery hook, the in-flight reconnect promise, and the
|
|
50
|
+
* session-lifecycle manager.
|
|
51
|
+
*
|
|
52
|
+
* This used to be a bag of module-level singletons ("single sandbox per
|
|
53
|
+
* process"). That is correct for hosts that ARE one-session-per-process — eve
|
|
54
|
+
* (each durable turn is its own recycled process) and the stdio MCP server — but
|
|
55
|
+
* the Streamable-HTTP MCP server is one long-lived process serving *concurrent*
|
|
56
|
+
* clients, where shared singletons let one client's tool call read another
|
|
57
|
+
* client's sandbox. So the state moves into {@link CoreContext} and is resolved
|
|
58
|
+
* per async call via {@link als}.
|
|
59
|
+
*/
|
|
60
|
+
export interface CoreContext {
|
|
61
|
+
sdk: any;
|
|
62
|
+
lastScreenshotBase64: string | null;
|
|
63
|
+
reconnectResolver: ReconnectResolver | null;
|
|
64
|
+
/** In-flight reconnect, so concurrent actions in one context share one rebuild. */
|
|
65
|
+
reconnecting: Promise<void> | null;
|
|
66
|
+
/** Stored element instances from `find`/`findall`, addressable by ref. */
|
|
67
|
+
elementRefs: Map<string, {
|
|
68
|
+
element: any;
|
|
69
|
+
description: string;
|
|
70
|
+
coords: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
centerX: number;
|
|
74
|
+
centerY: number;
|
|
75
|
+
};
|
|
76
|
+
}>;
|
|
77
|
+
/** Session lifecycle for THIS context. */
|
|
78
|
+
sessions: SessionManager;
|
|
79
|
+
/**
|
|
80
|
+
* Opaque per-connection scratch space for adapters (e.g. the MCP server's
|
|
81
|
+
* image store). mcp-core doesn't read this; it just guarantees each isolated
|
|
82
|
+
* context gets its own object, so adapter-side per-connection state rides along
|
|
83
|
+
* with the same AsyncLocalStorage isolation instead of needing a second one.
|
|
84
|
+
*/
|
|
85
|
+
adapter: Record<string, unknown>;
|
|
86
|
+
}
|
|
87
|
+
/** Build a fresh, empty context. Callers that want isolation mint one per connection. */
|
|
88
|
+
export declare function createCoreContext(): CoreContext;
|
|
89
|
+
/**
|
|
90
|
+
* Run `fn` with `context` as the active {@link CoreContext}, isolating every
|
|
91
|
+
* action's state (sdk, element refs, session, recovery hook) for the duration.
|
|
92
|
+
* The HTTP MCP server wraps each connection's request handling in this so
|
|
93
|
+
* concurrent clients never share a sandbox. Hosts that don't call this keep
|
|
94
|
+
* using {@link globalContext} exactly as before.
|
|
95
|
+
*/
|
|
96
|
+
export declare function runInContext<T>(context: CoreContext, fn: () => T): T;
|
|
97
|
+
/** Build an isolated context whose SessionManager is its own (not the global). */
|
|
98
|
+
export declare function createIsolatedContext(): CoreContext;
|
|
99
|
+
/** The active context's adapter scratch space (see {@link CoreContext.adapter}). */
|
|
100
|
+
export declare function getAdapterState(): Record<string, unknown>;
|
|
101
|
+
/** The active context's current session (null when none). Adapters use this for
|
|
102
|
+
* read-only lookups (e.g. the MCP server's testFile/expiry) that must resolve
|
|
103
|
+
* the caller's own session, not a process-global one. */
|
|
104
|
+
export declare function getCurrentSession(): SessionState | null;
|
|
105
|
+
/** Time remaining (ms) on a session in the active context. */
|
|
106
|
+
export declare function getSessionTimeRemaining(sessionId: string): number;
|
|
107
|
+
/**
|
|
108
|
+
* Optional adapter-supplied recovery hook. When the SDK is missing or stale at
|
|
109
|
+
* action time, {@link requireActiveSession} calls this to obtain the params
|
|
110
|
+
* needed to rebuild the connection from the still-alive sandbox, then reconnects
|
|
111
|
+
* before throwing NO_SESSION.
|
|
51
112
|
*
|
|
52
113
|
* Why a hook instead of mcp-core owning the handle: the durable facts (sandbox
|
|
53
114
|
* id, config) and the API key must survive a host process recycle, but this
|
|
54
|
-
*
|
|
115
|
+
* context's state does NOT — it resets on the very recycle we're recovering
|
|
55
116
|
* from. So the *durable owner* (eve's per-session state) registers a resolver
|
|
56
117
|
* that reads its own durable store and re-resolves the key per call. Hosts with
|
|
57
118
|
* one long-lived process (stdio MCP server, CLI) register nothing: the resolver
|
|
@@ -60,7 +121,7 @@ export declare class NoActiveSessionError extends Error {
|
|
|
60
121
|
*
|
|
61
122
|
* The resolver returns `null` when it has nothing to recover from (no sandbox
|
|
62
123
|
* provisioned this session), in which case we fall through to the normal throw.
|
|
63
|
-
* It is re-registered each step by the adapter (
|
|
124
|
+
* It is re-registered each step by the adapter (context state resets on recycle),
|
|
64
125
|
* so a stale closure can't outlive the process it was bound to.
|
|
65
126
|
*/
|
|
66
127
|
export type ReconnectResolver = () => Promise<ReconnectParams | null>;
|