@xopcai/xopc 0.0.434 → 0.0.436
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/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CmxICTM4.js → automations-page-BjbM15eY.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-R6YNDdAO.js → automations-workspace-CqurzLYX.js} +2 -2
- package/dist/gateway/static/root/assets/{chat-page-BJ8PlDjZ.js → chat-page--wcFhTjW.js} +30 -30
- package/dist/gateway/static/root/assets/{index-DWQ4LbBn.js → index-C4moZbZv.js} +4 -4
- package/dist/gateway/static/root/assets/{personal-page-l9_vYfdJ.js → personal-page-BhuT79Wd.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-BbyV8EiG.js → project-detail-page-CuugOYfe.js} +1 -1
- package/dist/gateway/static/root/assets/{route-preload-BWpw9qxc.js → route-preload-BQapekpy.js} +2 -2
- package/dist/gateway/static/root/assets/{settings-page-XJXcnE1_.js → settings-page-CedwaHM0.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-DvX9JoEd.js → task-detail-page-_Og3plZL.js} +1 -1
- package/dist/gateway/static/root/index.html +3 -3
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/external-tools/cliProvider.js +2 -2
- package/dist/src/agent/external-tools/composio-provider.js +2 -2
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/service.js +1 -1
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
- package/dist/src/agent/tool-manuals/computer.js +1 -1
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/automations/api/routes.js +2 -2
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/write.js +1 -1
- package/dist/src/automations/configuration-conversation.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/computer/broker.d.ts +5 -0
- package/dist/src/computer/broker.js +33 -9
- package/dist/src/computer/diagnostics.d.ts +340 -0
- package/dist/src/computer/diagnostics.js +4 -0
- package/dist/src/computer/errors.d.ts +340 -0
- package/dist/src/computer/errors.js +121 -4
- package/dist/src/computer/evaluation.d.ts +186 -0
- package/dist/src/computer/model-adapter.js +47 -20
- package/dist/src/computer/runtime.d.ts +170 -0
- package/dist/src/computer/runtime.js +36 -8
- package/dist/src/computer/stability-diagnostics.d.ts +23 -0
- package/dist/src/computer/stability-diagnostics.js +71 -0
- package/dist/src/computer/validation-diagnostics.d.ts +9 -0
- package/dist/src/computer/validation-diagnostics.js +54 -0
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/execution-environments/local-worktree-manager.js +1 -1
- package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/imports/importService.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/realtime/runtime.js +13 -5
- package/dist/src/realtime/writer.d.ts +7 -0
- package/dist/src/realtime/writer.js +96 -30
- package/dist/src/runtime-tools/archive.js +1 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,175 @@
|
|
|
1
1
|
import type { ComputerWindow } from '@xopcai/computer-control-contract';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
export declare const ComputerValidationSchema: z.ZodObject<{
|
|
4
|
+
action: z.ZodEnum<{
|
|
5
|
+
type: "type";
|
|
6
|
+
key: "key";
|
|
7
|
+
unknown: "unknown";
|
|
8
|
+
answer: "answer";
|
|
9
|
+
wait: "wait";
|
|
10
|
+
typeText: "typeText";
|
|
11
|
+
batch: "batch";
|
|
12
|
+
terminate: "terminate";
|
|
13
|
+
activate: "activate";
|
|
14
|
+
showMenu: "showMenu";
|
|
15
|
+
click: "click";
|
|
16
|
+
drag: "drag";
|
|
17
|
+
setValue: "setValue";
|
|
18
|
+
pressKeys: "pressKeys";
|
|
19
|
+
scroll: "scroll";
|
|
20
|
+
activateSequence: "activateSequence";
|
|
21
|
+
interact: "interact";
|
|
22
|
+
takeover: "takeover";
|
|
23
|
+
finished: "finished";
|
|
24
|
+
button_plan: "button_plan";
|
|
25
|
+
activate_sequence: "activate_sequence";
|
|
26
|
+
show_menu: "show_menu";
|
|
27
|
+
set_value: "set_value";
|
|
28
|
+
left_click: "left_click";
|
|
29
|
+
right_click: "right_click";
|
|
30
|
+
double_click: "double_click";
|
|
31
|
+
hscroll: "hscroll";
|
|
32
|
+
}>;
|
|
33
|
+
stage: z.ZodEnum<{
|
|
34
|
+
plan: "plan";
|
|
35
|
+
schema: "schema";
|
|
36
|
+
converted_action: "converted_action";
|
|
37
|
+
typing_target: "typing_target";
|
|
38
|
+
keyboard: "keyboard";
|
|
39
|
+
}>;
|
|
40
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
41
|
+
path: z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
42
|
+
reason: "reason";
|
|
43
|
+
keys: "keys";
|
|
44
|
+
value: "value";
|
|
45
|
+
name: "name";
|
|
46
|
+
time: "time";
|
|
47
|
+
from: "from";
|
|
48
|
+
action: "action";
|
|
49
|
+
when: "when";
|
|
50
|
+
label: "label";
|
|
51
|
+
text: "text";
|
|
52
|
+
kind: "kind";
|
|
53
|
+
status: "status";
|
|
54
|
+
durationMs: "durationMs";
|
|
55
|
+
role: "role";
|
|
56
|
+
to: "to";
|
|
57
|
+
actions: "actions";
|
|
58
|
+
count: "count";
|
|
59
|
+
x: "x";
|
|
60
|
+
y: "y";
|
|
61
|
+
point: "point";
|
|
62
|
+
arguments: "arguments";
|
|
63
|
+
ref: "ref";
|
|
64
|
+
button: "button";
|
|
65
|
+
deltaX: "deltaX";
|
|
66
|
+
deltaY: "deltaY";
|
|
67
|
+
refs: "refs";
|
|
68
|
+
pixels: "pixels";
|
|
69
|
+
steps: "steps";
|
|
70
|
+
coordinate: "coordinate";
|
|
71
|
+
unknown_field: "unknown_field";
|
|
72
|
+
proposal: "proposal";
|
|
73
|
+
claimedSuccess: "claimedSuccess";
|
|
74
|
+
}>, z.ZodNumber]>>;
|
|
75
|
+
code: z.ZodEnum<{
|
|
76
|
+
custom: "custom";
|
|
77
|
+
invalid_type: "invalid_type";
|
|
78
|
+
unrecognized_keys: "unrecognized_keys";
|
|
79
|
+
invalid_union: "invalid_union";
|
|
80
|
+
invalid_value: "invalid_value";
|
|
81
|
+
invalid_format: "invalid_format";
|
|
82
|
+
too_big: "too_big";
|
|
83
|
+
too_small: "too_small";
|
|
84
|
+
not_multiple_of: "not_multiple_of";
|
|
85
|
+
missing_point: "missing_point";
|
|
86
|
+
outside_frame: "outside_frame";
|
|
87
|
+
editable_target_missing: "editable_target_missing";
|
|
88
|
+
editable_target_ambiguous: "editable_target_ambiguous";
|
|
89
|
+
invalid_context: "invalid_context";
|
|
90
|
+
unsupported_key: "unsupported_key";
|
|
91
|
+
plan_not_grounded: "plan_not_grounded";
|
|
92
|
+
}>;
|
|
93
|
+
action: z.ZodEnum<{
|
|
94
|
+
type: "type";
|
|
95
|
+
key: "key";
|
|
96
|
+
unknown: "unknown";
|
|
97
|
+
answer: "answer";
|
|
98
|
+
wait: "wait";
|
|
99
|
+
typeText: "typeText";
|
|
100
|
+
batch: "batch";
|
|
101
|
+
terminate: "terminate";
|
|
102
|
+
activate: "activate";
|
|
103
|
+
showMenu: "showMenu";
|
|
104
|
+
click: "click";
|
|
105
|
+
drag: "drag";
|
|
106
|
+
setValue: "setValue";
|
|
107
|
+
pressKeys: "pressKeys";
|
|
108
|
+
scroll: "scroll";
|
|
109
|
+
activateSequence: "activateSequence";
|
|
110
|
+
interact: "interact";
|
|
111
|
+
takeover: "takeover";
|
|
112
|
+
finished: "finished";
|
|
113
|
+
button_plan: "button_plan";
|
|
114
|
+
activate_sequence: "activate_sequence";
|
|
115
|
+
show_menu: "show_menu";
|
|
116
|
+
set_value: "set_value";
|
|
117
|
+
left_click: "left_click";
|
|
118
|
+
right_click: "right_click";
|
|
119
|
+
double_click: "double_click";
|
|
120
|
+
hscroll: "hscroll";
|
|
121
|
+
}>;
|
|
122
|
+
}, z.core.$strict>>;
|
|
123
|
+
}, z.core.$strict>;
|
|
124
|
+
export declare const ComputerStabilitySchema: z.ZodObject<{
|
|
125
|
+
stage: z.ZodEnum<{
|
|
126
|
+
initial_capture: "initial_capture";
|
|
127
|
+
pre_dispatch: "pre_dispatch";
|
|
128
|
+
post_action: "post_action";
|
|
129
|
+
}>;
|
|
130
|
+
samples: z.ZodNumber;
|
|
131
|
+
action: z.ZodOptional<z.ZodEnum<{
|
|
132
|
+
type: "type";
|
|
133
|
+
key: "key";
|
|
134
|
+
unknown: "unknown";
|
|
135
|
+
answer: "answer";
|
|
136
|
+
wait: "wait";
|
|
137
|
+
typeText: "typeText";
|
|
138
|
+
batch: "batch";
|
|
139
|
+
terminate: "terminate";
|
|
140
|
+
activate: "activate";
|
|
141
|
+
showMenu: "showMenu";
|
|
142
|
+
click: "click";
|
|
143
|
+
drag: "drag";
|
|
144
|
+
setValue: "setValue";
|
|
145
|
+
pressKeys: "pressKeys";
|
|
146
|
+
scroll: "scroll";
|
|
147
|
+
activateSequence: "activateSequence";
|
|
148
|
+
interact: "interact";
|
|
149
|
+
takeover: "takeover";
|
|
150
|
+
finished: "finished";
|
|
151
|
+
button_plan: "button_plan";
|
|
152
|
+
activate_sequence: "activate_sequence";
|
|
153
|
+
show_menu: "show_menu";
|
|
154
|
+
set_value: "set_value";
|
|
155
|
+
left_click: "left_click";
|
|
156
|
+
right_click: "right_click";
|
|
157
|
+
double_click: "double_click";
|
|
158
|
+
hscroll: "hscroll";
|
|
159
|
+
}>>;
|
|
160
|
+
changes: z.ZodArray<z.ZodEnum<{
|
|
161
|
+
window_identity: "window_identity";
|
|
162
|
+
window_geometry: "window_geometry";
|
|
163
|
+
image_dimensions: "image_dimensions";
|
|
164
|
+
accessibility_structure: "accessibility_structure";
|
|
165
|
+
accessibility_text: "accessibility_text";
|
|
166
|
+
accessibility_state: "accessibility_state";
|
|
167
|
+
accessibility_geometry: "accessibility_geometry";
|
|
168
|
+
visual_or_unexposed_state: "visual_or_unexposed_state";
|
|
169
|
+
deadline: "deadline";
|
|
170
|
+
}>>;
|
|
171
|
+
changedElementIndices: z.ZodArray<z.ZodNumber>;
|
|
172
|
+
}, z.core.$strict>;
|
|
3
173
|
export declare const ComputerDiagnosticSchema: z.ZodObject<{
|
|
4
174
|
errorCode: z.ZodString;
|
|
5
175
|
phase: z.ZodEnum<{
|
|
@@ -17,6 +187,176 @@ export declare const ComputerDiagnosticSchema: z.ZodObject<{
|
|
|
17
187
|
invalid_envelope: "invalid_envelope";
|
|
18
188
|
output_limit: "output_limit";
|
|
19
189
|
}>>;
|
|
190
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
191
|
+
action: z.ZodEnum<{
|
|
192
|
+
type: "type";
|
|
193
|
+
key: "key";
|
|
194
|
+
unknown: "unknown";
|
|
195
|
+
answer: "answer";
|
|
196
|
+
wait: "wait";
|
|
197
|
+
typeText: "typeText";
|
|
198
|
+
batch: "batch";
|
|
199
|
+
terminate: "terminate";
|
|
200
|
+
activate: "activate";
|
|
201
|
+
showMenu: "showMenu";
|
|
202
|
+
click: "click";
|
|
203
|
+
drag: "drag";
|
|
204
|
+
setValue: "setValue";
|
|
205
|
+
pressKeys: "pressKeys";
|
|
206
|
+
scroll: "scroll";
|
|
207
|
+
activateSequence: "activateSequence";
|
|
208
|
+
interact: "interact";
|
|
209
|
+
takeover: "takeover";
|
|
210
|
+
finished: "finished";
|
|
211
|
+
button_plan: "button_plan";
|
|
212
|
+
activate_sequence: "activate_sequence";
|
|
213
|
+
show_menu: "show_menu";
|
|
214
|
+
set_value: "set_value";
|
|
215
|
+
left_click: "left_click";
|
|
216
|
+
right_click: "right_click";
|
|
217
|
+
double_click: "double_click";
|
|
218
|
+
hscroll: "hscroll";
|
|
219
|
+
}>;
|
|
220
|
+
stage: z.ZodEnum<{
|
|
221
|
+
plan: "plan";
|
|
222
|
+
schema: "schema";
|
|
223
|
+
converted_action: "converted_action";
|
|
224
|
+
typing_target: "typing_target";
|
|
225
|
+
keyboard: "keyboard";
|
|
226
|
+
}>;
|
|
227
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
228
|
+
path: z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
229
|
+
reason: "reason";
|
|
230
|
+
keys: "keys";
|
|
231
|
+
value: "value";
|
|
232
|
+
name: "name";
|
|
233
|
+
time: "time";
|
|
234
|
+
from: "from";
|
|
235
|
+
action: "action";
|
|
236
|
+
when: "when";
|
|
237
|
+
label: "label";
|
|
238
|
+
text: "text";
|
|
239
|
+
kind: "kind";
|
|
240
|
+
status: "status";
|
|
241
|
+
durationMs: "durationMs";
|
|
242
|
+
role: "role";
|
|
243
|
+
to: "to";
|
|
244
|
+
actions: "actions";
|
|
245
|
+
count: "count";
|
|
246
|
+
x: "x";
|
|
247
|
+
y: "y";
|
|
248
|
+
point: "point";
|
|
249
|
+
arguments: "arguments";
|
|
250
|
+
ref: "ref";
|
|
251
|
+
button: "button";
|
|
252
|
+
deltaX: "deltaX";
|
|
253
|
+
deltaY: "deltaY";
|
|
254
|
+
refs: "refs";
|
|
255
|
+
pixels: "pixels";
|
|
256
|
+
steps: "steps";
|
|
257
|
+
coordinate: "coordinate";
|
|
258
|
+
unknown_field: "unknown_field";
|
|
259
|
+
proposal: "proposal";
|
|
260
|
+
claimedSuccess: "claimedSuccess";
|
|
261
|
+
}>, z.ZodNumber]>>;
|
|
262
|
+
code: z.ZodEnum<{
|
|
263
|
+
custom: "custom";
|
|
264
|
+
invalid_type: "invalid_type";
|
|
265
|
+
unrecognized_keys: "unrecognized_keys";
|
|
266
|
+
invalid_union: "invalid_union";
|
|
267
|
+
invalid_value: "invalid_value";
|
|
268
|
+
invalid_format: "invalid_format";
|
|
269
|
+
too_big: "too_big";
|
|
270
|
+
too_small: "too_small";
|
|
271
|
+
not_multiple_of: "not_multiple_of";
|
|
272
|
+
missing_point: "missing_point";
|
|
273
|
+
outside_frame: "outside_frame";
|
|
274
|
+
editable_target_missing: "editable_target_missing";
|
|
275
|
+
editable_target_ambiguous: "editable_target_ambiguous";
|
|
276
|
+
invalid_context: "invalid_context";
|
|
277
|
+
unsupported_key: "unsupported_key";
|
|
278
|
+
plan_not_grounded: "plan_not_grounded";
|
|
279
|
+
}>;
|
|
280
|
+
action: z.ZodEnum<{
|
|
281
|
+
type: "type";
|
|
282
|
+
key: "key";
|
|
283
|
+
unknown: "unknown";
|
|
284
|
+
answer: "answer";
|
|
285
|
+
wait: "wait";
|
|
286
|
+
typeText: "typeText";
|
|
287
|
+
batch: "batch";
|
|
288
|
+
terminate: "terminate";
|
|
289
|
+
activate: "activate";
|
|
290
|
+
showMenu: "showMenu";
|
|
291
|
+
click: "click";
|
|
292
|
+
drag: "drag";
|
|
293
|
+
setValue: "setValue";
|
|
294
|
+
pressKeys: "pressKeys";
|
|
295
|
+
scroll: "scroll";
|
|
296
|
+
activateSequence: "activateSequence";
|
|
297
|
+
interact: "interact";
|
|
298
|
+
takeover: "takeover";
|
|
299
|
+
finished: "finished";
|
|
300
|
+
button_plan: "button_plan";
|
|
301
|
+
activate_sequence: "activate_sequence";
|
|
302
|
+
show_menu: "show_menu";
|
|
303
|
+
set_value: "set_value";
|
|
304
|
+
left_click: "left_click";
|
|
305
|
+
right_click: "right_click";
|
|
306
|
+
double_click: "double_click";
|
|
307
|
+
hscroll: "hscroll";
|
|
308
|
+
}>;
|
|
309
|
+
}, z.core.$strict>>;
|
|
310
|
+
}, z.core.$strict>>;
|
|
311
|
+
stability: z.ZodOptional<z.ZodObject<{
|
|
312
|
+
stage: z.ZodEnum<{
|
|
313
|
+
initial_capture: "initial_capture";
|
|
314
|
+
pre_dispatch: "pre_dispatch";
|
|
315
|
+
post_action: "post_action";
|
|
316
|
+
}>;
|
|
317
|
+
samples: z.ZodNumber;
|
|
318
|
+
action: z.ZodOptional<z.ZodEnum<{
|
|
319
|
+
type: "type";
|
|
320
|
+
key: "key";
|
|
321
|
+
unknown: "unknown";
|
|
322
|
+
answer: "answer";
|
|
323
|
+
wait: "wait";
|
|
324
|
+
typeText: "typeText";
|
|
325
|
+
batch: "batch";
|
|
326
|
+
terminate: "terminate";
|
|
327
|
+
activate: "activate";
|
|
328
|
+
showMenu: "showMenu";
|
|
329
|
+
click: "click";
|
|
330
|
+
drag: "drag";
|
|
331
|
+
setValue: "setValue";
|
|
332
|
+
pressKeys: "pressKeys";
|
|
333
|
+
scroll: "scroll";
|
|
334
|
+
activateSequence: "activateSequence";
|
|
335
|
+
interact: "interact";
|
|
336
|
+
takeover: "takeover";
|
|
337
|
+
finished: "finished";
|
|
338
|
+
button_plan: "button_plan";
|
|
339
|
+
activate_sequence: "activate_sequence";
|
|
340
|
+
show_menu: "show_menu";
|
|
341
|
+
set_value: "set_value";
|
|
342
|
+
left_click: "left_click";
|
|
343
|
+
right_click: "right_click";
|
|
344
|
+
double_click: "double_click";
|
|
345
|
+
hscroll: "hscroll";
|
|
346
|
+
}>>;
|
|
347
|
+
changes: z.ZodArray<z.ZodEnum<{
|
|
348
|
+
window_identity: "window_identity";
|
|
349
|
+
window_geometry: "window_geometry";
|
|
350
|
+
image_dimensions: "image_dimensions";
|
|
351
|
+
accessibility_structure: "accessibility_structure";
|
|
352
|
+
accessibility_text: "accessibility_text";
|
|
353
|
+
accessibility_state: "accessibility_state";
|
|
354
|
+
accessibility_geometry: "accessibility_geometry";
|
|
355
|
+
visual_or_unexposed_state: "visual_or_unexposed_state";
|
|
356
|
+
deadline: "deadline";
|
|
357
|
+
}>>;
|
|
358
|
+
changedElementIndices: z.ZodArray<z.ZodNumber>;
|
|
359
|
+
}, z.core.$strict>>;
|
|
20
360
|
httpStatus: z.ZodOptional<z.ZodNumber>;
|
|
21
361
|
requestId: z.ZodOptional<z.ZodString>;
|
|
22
362
|
serviceErrorCode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1,5 +1,120 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/computer/errors.ts
|
|
3
|
+
const ValidationActionSchema = z.enum([
|
|
4
|
+
"unknown",
|
|
5
|
+
"activate",
|
|
6
|
+
"activate_sequence",
|
|
7
|
+
"batch",
|
|
8
|
+
"show_menu",
|
|
9
|
+
"set_value",
|
|
10
|
+
"left_click",
|
|
11
|
+
"right_click",
|
|
12
|
+
"double_click",
|
|
13
|
+
"type",
|
|
14
|
+
"key",
|
|
15
|
+
"scroll",
|
|
16
|
+
"hscroll",
|
|
17
|
+
"wait",
|
|
18
|
+
"terminate",
|
|
19
|
+
"answer",
|
|
20
|
+
"interact",
|
|
21
|
+
"showMenu",
|
|
22
|
+
"click",
|
|
23
|
+
"drag",
|
|
24
|
+
"setValue",
|
|
25
|
+
"typeText",
|
|
26
|
+
"pressKeys",
|
|
27
|
+
"activateSequence",
|
|
28
|
+
"finished",
|
|
29
|
+
"takeover",
|
|
30
|
+
"button_plan"
|
|
31
|
+
]);
|
|
32
|
+
const ComputerValidationSchema = z.object({
|
|
33
|
+
action: ValidationActionSchema,
|
|
34
|
+
stage: z.enum([
|
|
35
|
+
"schema",
|
|
36
|
+
"converted_action",
|
|
37
|
+
"typing_target",
|
|
38
|
+
"keyboard",
|
|
39
|
+
"plan"
|
|
40
|
+
]),
|
|
41
|
+
issues: z.array(z.object({
|
|
42
|
+
path: z.array(z.union([z.enum([
|
|
43
|
+
"unknown_field",
|
|
44
|
+
"name",
|
|
45
|
+
"arguments",
|
|
46
|
+
"proposal",
|
|
47
|
+
"action",
|
|
48
|
+
"kind",
|
|
49
|
+
"actions",
|
|
50
|
+
"refs",
|
|
51
|
+
"ref",
|
|
52
|
+
"text",
|
|
53
|
+
"coordinate",
|
|
54
|
+
"keys",
|
|
55
|
+
"pixels",
|
|
56
|
+
"time",
|
|
57
|
+
"status",
|
|
58
|
+
"point",
|
|
59
|
+
"x",
|
|
60
|
+
"y",
|
|
61
|
+
"button",
|
|
62
|
+
"count",
|
|
63
|
+
"from",
|
|
64
|
+
"to",
|
|
65
|
+
"deltaX",
|
|
66
|
+
"deltaY",
|
|
67
|
+
"durationMs",
|
|
68
|
+
"claimedSuccess",
|
|
69
|
+
"reason",
|
|
70
|
+
"steps",
|
|
71
|
+
"label",
|
|
72
|
+
"when",
|
|
73
|
+
"role",
|
|
74
|
+
"value"
|
|
75
|
+
]), z.number().int().min(0).max(16384)])).max(10),
|
|
76
|
+
code: z.enum([
|
|
77
|
+
"invalid_type",
|
|
78
|
+
"invalid_value",
|
|
79
|
+
"invalid_union",
|
|
80
|
+
"unrecognized_keys",
|
|
81
|
+
"too_small",
|
|
82
|
+
"too_big",
|
|
83
|
+
"invalid_format",
|
|
84
|
+
"not_multiple_of",
|
|
85
|
+
"custom",
|
|
86
|
+
"missing_point",
|
|
87
|
+
"outside_frame",
|
|
88
|
+
"editable_target_missing",
|
|
89
|
+
"editable_target_ambiguous",
|
|
90
|
+
"invalid_context",
|
|
91
|
+
"unsupported_key",
|
|
92
|
+
"plan_not_grounded"
|
|
93
|
+
]),
|
|
94
|
+
action: ValidationActionSchema
|
|
95
|
+
}).strict()).max(4)
|
|
96
|
+
}).strict();
|
|
97
|
+
const ComputerStabilitySchema = z.object({
|
|
98
|
+
stage: z.enum([
|
|
99
|
+
"initial_capture",
|
|
100
|
+
"pre_dispatch",
|
|
101
|
+
"post_action"
|
|
102
|
+
]),
|
|
103
|
+
samples: z.number().int().min(1).max(6),
|
|
104
|
+
action: ValidationActionSchema.optional(),
|
|
105
|
+
changes: z.array(z.enum([
|
|
106
|
+
"window_identity",
|
|
107
|
+
"window_geometry",
|
|
108
|
+
"image_dimensions",
|
|
109
|
+
"accessibility_structure",
|
|
110
|
+
"accessibility_text",
|
|
111
|
+
"accessibility_state",
|
|
112
|
+
"accessibility_geometry",
|
|
113
|
+
"visual_or_unexposed_state",
|
|
114
|
+
"deadline"
|
|
115
|
+
])).max(9),
|
|
116
|
+
changedElementIndices: z.array(z.number().int().nonnegative().max(16384)).max(8)
|
|
117
|
+
}).strict();
|
|
3
118
|
const ComputerDiagnosticSchema = z.object({
|
|
4
119
|
errorCode: z.string().regex(/^COMPUTER_[A-Z_0-9]+$/).max(100),
|
|
5
120
|
phase: z.enum([
|
|
@@ -17,6 +132,8 @@ const ComputerDiagnosticSchema = z.object({
|
|
|
17
132
|
"invalid_envelope",
|
|
18
133
|
"output_limit"
|
|
19
134
|
]).optional(),
|
|
135
|
+
validation: ComputerValidationSchema.optional(),
|
|
136
|
+
stability: ComputerStabilitySchema.optional(),
|
|
20
137
|
httpStatus: z.number().int().min(100).max(599).optional(),
|
|
21
138
|
requestId: z.string().regex(/^(?:[a-f0-9]{32}|[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12})$/i).optional(),
|
|
22
139
|
serviceErrorCode: z.enum([
|
|
@@ -39,7 +156,7 @@ var ComputerOperationError = class extends Error {
|
|
|
39
156
|
};
|
|
40
157
|
/** Only typed, bounded diagnostics cross the endpoint transport; never forward raw exceptions. */
|
|
41
158
|
function computerDiagnostic(error) {
|
|
42
|
-
if (!(error instanceof Error) || error.message.length >
|
|
159
|
+
if (!(error instanceof Error) || error.message.length > 4096) return;
|
|
43
160
|
try {
|
|
44
161
|
return ComputerDiagnosticSchema.safeParse(JSON.parse(error.message)).data;
|
|
45
162
|
} catch {
|
|
@@ -133,7 +250,7 @@ function computerRecovery(code) {
|
|
|
133
250
|
case "COMPUTER_SEMANTIC_ACTION_UNSUPPORTED": return "The native element reference or action is unavailable for this window. No automatic coordinate fallback. Reopen and observe fresh evidence before choosing a different action; never reuse an old reference or replay an uncertain input.";
|
|
134
251
|
case "COMPUTER_SEMANTIC_ACTION_UNCONFIRMED": return "The native action returned uncertain execution evidence. Inspect the application before continuing. Do not repeat it or fall back to coordinates; its effect may already have occurred.";
|
|
135
252
|
case "COMPUTER_INVALID_MODEL_OUTPUT":
|
|
136
|
-
case "COMPUTER_EXPECTED_SINGLE_ACTION": return "The GUI model returned an invalid action after bounded format correction. No input from this prediction was dispatched. Report validationReason and diagnosticId; do not guess coordinates, replay the action or change providers.";
|
|
253
|
+
case "COMPUTER_EXPECTED_SINGLE_ACTION": return "The GUI model returned an invalid action after bounded format correction. No input from this prediction was dispatched. Report validationReason, validation (action, stage and field issues) and diagnosticId; do not guess coordinates, replay the action or change providers.";
|
|
137
254
|
case "COMPUTER_MODEL_HTTP_400": return "The configured model service rejected the request. No input was dispatched from this model request. Report serviceErrorCode, requestId and diagnosticId; check the model request format and input/output limits before reopening. Do not automatically retry or change providers.";
|
|
138
255
|
case "COMPUTER_RELEASE_UNCONFIRMED": return "Desktop release was not confirmed. Do not switch to other tools. Stop desktop control locally or restore the endpoint connection, then call close again to confirm release.";
|
|
139
256
|
case "COMPUTER_DRIVER_CLEANUP_UNCONFIRMED": return "The private desktop driver did not confirm shutdown. The old grant is revoked and a new driver cannot start. Stop desktop control locally and confirm cleanup before reopening; never replay the previous input.";
|
|
@@ -143,7 +260,7 @@ function computerRecovery(code) {
|
|
|
143
260
|
case "COMPUTER_MODEL_HTTP_429": return "The configured model service is rate-limited. No input was dispatched from this model request. Check the service quota and retry only after it resets; do not automatically change providers.";
|
|
144
261
|
case "COMPUTER_MODEL_HTTP_409": return "The pinned model deployment changed. No input was dispatched from this model request. Refresh the model catalog and reopen after reviewing the configured screenshot recipient.";
|
|
145
262
|
case "COMPUTER_OBSERVATION_CHANGED": return "No input was dispatched. Observe the changed window and re-plan with fresh evidence; the old proposed action was discarded.";
|
|
146
|
-
case "COMPUTER_UI_UNSTABLE": return "
|
|
263
|
+
case "COMPUTER_UI_UNSTABLE": return "Report stability.stage, changes and samples with diagnosticId. initial_capture means no stable observation was obtained; pre_dispatch means the proposed input was not dispatched and rescue is exhausted; post_action means an input completed but its resulting view did not settle. Check receipts and completedInputs for earlier inputs; do not replay them. Wait for a local state change before reopening; never reuse old coordinates.";
|
|
147
264
|
case "COMPUTER_NO_PROGRESS": return "Repeated inputs produced no observed progress. Inspect the actual outcome and change the plan; do not keep clicking or repeat a potentially submitted action.";
|
|
148
265
|
case "COMPUTER_INVALID_INPUT": return "Read tool_manual(computer_use) and use only the fields documented for this operation. Start with discover; open requires appRef, mode and prepare.";
|
|
149
266
|
case "COMPUTER_APP_INSTANCE_AMBIGUOUS": return "Multiple processes for this app are running. Ask the user to keep the intended app instance open; do not guess a process.";
|
|
@@ -166,4 +283,4 @@ function computerRecovery(code) {
|
|
|
166
283
|
}
|
|
167
284
|
}
|
|
168
285
|
//#endregion
|
|
169
|
-
export { ComputerDiagnosticSchema, ComputerOperationError, ComputerRecoverySchema, ComputerTargetError, computerDiagnostic, computerRecovery, computerRecoveryDirective };
|
|
286
|
+
export { ComputerDiagnosticSchema, ComputerOperationError, ComputerRecoverySchema, ComputerStabilitySchema, ComputerTargetError, ComputerValidationSchema, computerDiagnostic, computerRecovery, computerRecoveryDirective };
|