@crosshands/contract 0.1.2
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/LICENSE +21 -0
- package/dist/context.d.ts +19 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +82 -0
- package/dist/context.js.map +1 -0
- package/dist/errors.d.ts +164 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +65 -0
- package/dist/errors.js.map +1 -0
- package/dist/generate-schemas.d.ts +2 -0
- package/dist/generate-schemas.d.ts.map +1 -0
- package/dist/generate-schemas.js +8 -0
- package/dist/generate-schemas.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/json-schema.d.ts +306 -0
- package/dist/json-schema.d.ts.map +1 -0
- package/dist/json-schema.js +15 -0
- package/dist/json-schema.js.map +1 -0
- package/dist/operations.d.ts +2115 -0
- package/dist/operations.d.ts.map +1 -0
- package/dist/operations.js +205 -0
- package/dist/operations.js.map +1 -0
- package/dist/provider.d.ts +135 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +56 -0
- package/dist/provider.js.map +1 -0
- package/dist/schemas.d.ts +499 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +138 -0
- package/dist/schemas.js.map +1 -0
- package/dist/versions.d.ts +31 -0
- package/dist/versions.d.ts.map +1 -0
- package/dist/versions.js +28 -0
- package/dist/versions.js.map +1 -0
- package/package.json +39 -0
- package/schemas/contract.json +7572 -0
- package/src/context.ts +107 -0
- package/src/errors.ts +82 -0
- package/src/generate-schemas.ts +9 -0
- package/src/index.ts +7 -0
- package/src/json-schema.ts +17 -0
- package/src/operations.ts +224 -0
- package/src/provider.ts +82 -0
- package/src/schemas.ts +161 -0
- package/src/versions.ts +46 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const InteractionContextTokenSchema: z.ZodString;
|
|
3
|
+
export declare const ProcessIdentitySchema: z.ZodObject<{
|
|
4
|
+
pid: z.ZodNumber;
|
|
5
|
+
startedAt: z.ZodISODateTime;
|
|
6
|
+
executableId: z.ZodString;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export declare const WindowIdentitySchema: z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
ownerPid: z.ZodNumber;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export declare const ReferenceBindingsSchema: z.ZodObject<{
|
|
13
|
+
brokerGeneration: z.ZodString;
|
|
14
|
+
providerGeneration: z.ZodString;
|
|
15
|
+
graphicalSessionId: z.ZodString;
|
|
16
|
+
process: z.ZodObject<{
|
|
17
|
+
pid: z.ZodNumber;
|
|
18
|
+
startedAt: z.ZodISODateTime;
|
|
19
|
+
executableId: z.ZodString;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
appId: z.ZodString;
|
|
22
|
+
window: z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
ownerPid: z.ZodNumber;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
snapshotId: z.ZodString;
|
|
27
|
+
desktopEpoch: z.ZodNumber;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
export type ReferenceBindings = z.infer<typeof ReferenceBindingsSchema>;
|
|
30
|
+
export declare const InteractionContextSchema: z.ZodObject<{
|
|
31
|
+
brokerGeneration: z.ZodString;
|
|
32
|
+
providerGeneration: z.ZodString;
|
|
33
|
+
graphicalSessionId: z.ZodString;
|
|
34
|
+
process: z.ZodObject<{
|
|
35
|
+
pid: z.ZodNumber;
|
|
36
|
+
startedAt: z.ZodISODateTime;
|
|
37
|
+
executableId: z.ZodString;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
appId: z.ZodString;
|
|
40
|
+
window: z.ZodObject<{
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
ownerPid: z.ZodNumber;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
snapshotId: z.ZodString;
|
|
45
|
+
desktopEpoch: z.ZodNumber;
|
|
46
|
+
token: z.ZodString;
|
|
47
|
+
issuedAt: z.ZodISODateTime;
|
|
48
|
+
expiresAt: z.ZodISODateTime;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
export type InteractionContext = z.infer<typeof InteractionContextSchema>;
|
|
51
|
+
export declare const TargetReferenceSchema: z.ZodObject<{
|
|
52
|
+
brokerGeneration: z.ZodString;
|
|
53
|
+
providerGeneration: z.ZodString;
|
|
54
|
+
graphicalSessionId: z.ZodString;
|
|
55
|
+
process: z.ZodObject<{
|
|
56
|
+
pid: z.ZodNumber;
|
|
57
|
+
startedAt: z.ZodISODateTime;
|
|
58
|
+
executableId: z.ZodString;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
appId: z.ZodString;
|
|
61
|
+
window: z.ZodObject<{
|
|
62
|
+
id: z.ZodString;
|
|
63
|
+
ownerPid: z.ZodNumber;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
snapshotId: z.ZodString;
|
|
66
|
+
desktopEpoch: z.ZodNumber;
|
|
67
|
+
ref: z.ZodString;
|
|
68
|
+
kind: z.ZodEnum<{
|
|
69
|
+
window: "window";
|
|
70
|
+
app: "app";
|
|
71
|
+
element: "element";
|
|
72
|
+
}>;
|
|
73
|
+
contextToken: z.ZodString;
|
|
74
|
+
expiresAt: z.ZodISODateTime;
|
|
75
|
+
}, z.core.$strict>;
|
|
76
|
+
export type TargetReference = z.infer<typeof TargetReferenceSchema>;
|
|
77
|
+
export declare const AppInfoSchema: z.ZodObject<{
|
|
78
|
+
id: z.ZodString;
|
|
79
|
+
name: z.ZodString;
|
|
80
|
+
bundleId: z.ZodNullable<z.ZodString>;
|
|
81
|
+
pid: z.ZodNumber;
|
|
82
|
+
isRunning: z.ZodBoolean;
|
|
83
|
+
}, z.core.$strict>;
|
|
84
|
+
export declare const WindowInfoSchema: z.ZodObject<{
|
|
85
|
+
id: z.ZodString;
|
|
86
|
+
appId: z.ZodString;
|
|
87
|
+
title: z.ZodString;
|
|
88
|
+
index: z.ZodNumber;
|
|
89
|
+
bounds: z.ZodObject<{
|
|
90
|
+
x: z.ZodNumber;
|
|
91
|
+
y: z.ZodNumber;
|
|
92
|
+
width: z.ZodNumber;
|
|
93
|
+
height: z.ZodNumber;
|
|
94
|
+
}, z.core.$strict>;
|
|
95
|
+
minimized: z.ZodBoolean;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
export declare const ScreenshotSchema: z.ZodObject<{
|
|
98
|
+
format: z.ZodLiteral<"png">;
|
|
99
|
+
width: z.ZodNumber;
|
|
100
|
+
height: z.ZodNumber;
|
|
101
|
+
scale: z.ZodNumber;
|
|
102
|
+
data: z.ZodOptional<z.ZodString>;
|
|
103
|
+
path: z.ZodOptional<z.ZodString>;
|
|
104
|
+
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
105
|
+
}, z.core.$strict>;
|
|
106
|
+
export declare const SnapshotSchema: z.ZodObject<{
|
|
107
|
+
id: z.ZodString;
|
|
108
|
+
app: z.ZodObject<{
|
|
109
|
+
id: z.ZodString;
|
|
110
|
+
name: z.ZodString;
|
|
111
|
+
bundleId: z.ZodNullable<z.ZodString>;
|
|
112
|
+
pid: z.ZodNumber;
|
|
113
|
+
isRunning: z.ZodBoolean;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
window: z.ZodObject<{
|
|
116
|
+
id: z.ZodString;
|
|
117
|
+
appId: z.ZodString;
|
|
118
|
+
title: z.ZodString;
|
|
119
|
+
index: z.ZodNumber;
|
|
120
|
+
bounds: z.ZodObject<{
|
|
121
|
+
x: z.ZodNumber;
|
|
122
|
+
y: z.ZodNumber;
|
|
123
|
+
width: z.ZodNumber;
|
|
124
|
+
height: z.ZodNumber;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
minimized: z.ZodBoolean;
|
|
127
|
+
}, z.core.$strict>;
|
|
128
|
+
treeText: z.ZodString;
|
|
129
|
+
elementCount: z.ZodNumber;
|
|
130
|
+
focusedElementRef: z.ZodNullable<z.ZodString>;
|
|
131
|
+
desktopEpoch: z.ZodNumber;
|
|
132
|
+
}, z.core.$strict>;
|
|
133
|
+
export declare const MutationOutcomeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
134
|
+
state: z.ZodLiteral<"verified">;
|
|
135
|
+
evidence: z.ZodOptional<z.ZodUnknown>;
|
|
136
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
137
|
+
state: z.ZodLiteral<"indeterminate">;
|
|
138
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
139
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
140
|
+
state: z.ZodLiteral<"failed">;
|
|
141
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
142
|
+
code: z.ZodEnum<{
|
|
143
|
+
app_not_found: "app_not_found";
|
|
144
|
+
app_unavailable: "app_unavailable";
|
|
145
|
+
app_blocked: "app_blocked";
|
|
146
|
+
window_not_found: "window_not_found";
|
|
147
|
+
window_unavailable: "window_unavailable";
|
|
148
|
+
window_not_focused: "window_not_focused";
|
|
149
|
+
permission_denied: "permission_denied";
|
|
150
|
+
stale_target: "stale_target";
|
|
151
|
+
element_not_found: "element_not_found";
|
|
152
|
+
element_not_clickable: "element_not_clickable";
|
|
153
|
+
action_not_supported: "action_not_supported";
|
|
154
|
+
value_not_settable: "value_not_settable";
|
|
155
|
+
invalid_argument: "invalid_argument";
|
|
156
|
+
timeout: "timeout";
|
|
157
|
+
unsupported_capability: "unsupported_capability";
|
|
158
|
+
provider_unavailable: "provider_unavailable";
|
|
159
|
+
provider_crashed: "provider_crashed";
|
|
160
|
+
version_incompatible: "version_incompatible";
|
|
161
|
+
interaction_context_invalid: "interaction_context_invalid";
|
|
162
|
+
interaction_context_expired: "interaction_context_expired";
|
|
163
|
+
session_unavailable: "session_unavailable";
|
|
164
|
+
screenshot_failed: "screenshot_failed";
|
|
165
|
+
accessibility_error: "accessibility_error";
|
|
166
|
+
}>;
|
|
167
|
+
message: z.ZodString;
|
|
168
|
+
retry: z.ZodBoolean;
|
|
169
|
+
remediation: z.ZodString;
|
|
170
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
171
|
+
}, z.core.$strict>>;
|
|
172
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
173
|
+
state: z.ZodLiteral<"not_attempted">;
|
|
174
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
175
|
+
code: z.ZodEnum<{
|
|
176
|
+
app_not_found: "app_not_found";
|
|
177
|
+
app_unavailable: "app_unavailable";
|
|
178
|
+
app_blocked: "app_blocked";
|
|
179
|
+
window_not_found: "window_not_found";
|
|
180
|
+
window_unavailable: "window_unavailable";
|
|
181
|
+
window_not_focused: "window_not_focused";
|
|
182
|
+
permission_denied: "permission_denied";
|
|
183
|
+
stale_target: "stale_target";
|
|
184
|
+
element_not_found: "element_not_found";
|
|
185
|
+
element_not_clickable: "element_not_clickable";
|
|
186
|
+
action_not_supported: "action_not_supported";
|
|
187
|
+
value_not_settable: "value_not_settable";
|
|
188
|
+
invalid_argument: "invalid_argument";
|
|
189
|
+
timeout: "timeout";
|
|
190
|
+
unsupported_capability: "unsupported_capability";
|
|
191
|
+
provider_unavailable: "provider_unavailable";
|
|
192
|
+
provider_crashed: "provider_crashed";
|
|
193
|
+
version_incompatible: "version_incompatible";
|
|
194
|
+
interaction_context_invalid: "interaction_context_invalid";
|
|
195
|
+
interaction_context_expired: "interaction_context_expired";
|
|
196
|
+
session_unavailable: "session_unavailable";
|
|
197
|
+
screenshot_failed: "screenshot_failed";
|
|
198
|
+
accessibility_error: "accessibility_error";
|
|
199
|
+
}>;
|
|
200
|
+
message: z.ZodString;
|
|
201
|
+
retry: z.ZodBoolean;
|
|
202
|
+
remediation: z.ZodString;
|
|
203
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
204
|
+
}, z.core.$strict>>;
|
|
205
|
+
}, z.core.$strict>], "state">;
|
|
206
|
+
export type MutationOutcome = z.infer<typeof MutationOutcomeSchema>;
|
|
207
|
+
export declare const SnapshotResultSchema: z.ZodObject<{
|
|
208
|
+
context: z.ZodObject<{
|
|
209
|
+
brokerGeneration: z.ZodString;
|
|
210
|
+
providerGeneration: z.ZodString;
|
|
211
|
+
graphicalSessionId: z.ZodString;
|
|
212
|
+
process: z.ZodObject<{
|
|
213
|
+
pid: z.ZodNumber;
|
|
214
|
+
startedAt: z.ZodISODateTime;
|
|
215
|
+
executableId: z.ZodString;
|
|
216
|
+
}, z.core.$strict>;
|
|
217
|
+
appId: z.ZodString;
|
|
218
|
+
window: z.ZodObject<{
|
|
219
|
+
id: z.ZodString;
|
|
220
|
+
ownerPid: z.ZodNumber;
|
|
221
|
+
}, z.core.$strict>;
|
|
222
|
+
snapshotId: z.ZodString;
|
|
223
|
+
desktopEpoch: z.ZodNumber;
|
|
224
|
+
token: z.ZodString;
|
|
225
|
+
issuedAt: z.ZodISODateTime;
|
|
226
|
+
expiresAt: z.ZodISODateTime;
|
|
227
|
+
}, z.core.$strict>;
|
|
228
|
+
snapshot: z.ZodObject<{
|
|
229
|
+
id: z.ZodString;
|
|
230
|
+
app: z.ZodObject<{
|
|
231
|
+
id: z.ZodString;
|
|
232
|
+
name: z.ZodString;
|
|
233
|
+
bundleId: z.ZodNullable<z.ZodString>;
|
|
234
|
+
pid: z.ZodNumber;
|
|
235
|
+
isRunning: z.ZodBoolean;
|
|
236
|
+
}, z.core.$strict>;
|
|
237
|
+
window: z.ZodObject<{
|
|
238
|
+
id: z.ZodString;
|
|
239
|
+
appId: z.ZodString;
|
|
240
|
+
title: z.ZodString;
|
|
241
|
+
index: z.ZodNumber;
|
|
242
|
+
bounds: z.ZodObject<{
|
|
243
|
+
x: z.ZodNumber;
|
|
244
|
+
y: z.ZodNumber;
|
|
245
|
+
width: z.ZodNumber;
|
|
246
|
+
height: z.ZodNumber;
|
|
247
|
+
}, z.core.$strict>;
|
|
248
|
+
minimized: z.ZodBoolean;
|
|
249
|
+
}, z.core.$strict>;
|
|
250
|
+
treeText: z.ZodString;
|
|
251
|
+
elementCount: z.ZodNumber;
|
|
252
|
+
focusedElementRef: z.ZodNullable<z.ZodString>;
|
|
253
|
+
desktopEpoch: z.ZodNumber;
|
|
254
|
+
}, z.core.$strict>;
|
|
255
|
+
screenshot: z.ZodNullable<z.ZodObject<{
|
|
256
|
+
format: z.ZodLiteral<"png">;
|
|
257
|
+
width: z.ZodNumber;
|
|
258
|
+
height: z.ZodNumber;
|
|
259
|
+
scale: z.ZodNumber;
|
|
260
|
+
data: z.ZodOptional<z.ZodString>;
|
|
261
|
+
path: z.ZodOptional<z.ZodString>;
|
|
262
|
+
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
263
|
+
}, z.core.$strict>>;
|
|
264
|
+
issues: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
265
|
+
code: z.ZodEnum<{
|
|
266
|
+
app_not_found: "app_not_found";
|
|
267
|
+
app_unavailable: "app_unavailable";
|
|
268
|
+
app_blocked: "app_blocked";
|
|
269
|
+
window_not_found: "window_not_found";
|
|
270
|
+
window_unavailable: "window_unavailable";
|
|
271
|
+
window_not_focused: "window_not_focused";
|
|
272
|
+
permission_denied: "permission_denied";
|
|
273
|
+
stale_target: "stale_target";
|
|
274
|
+
element_not_found: "element_not_found";
|
|
275
|
+
element_not_clickable: "element_not_clickable";
|
|
276
|
+
action_not_supported: "action_not_supported";
|
|
277
|
+
value_not_settable: "value_not_settable";
|
|
278
|
+
invalid_argument: "invalid_argument";
|
|
279
|
+
timeout: "timeout";
|
|
280
|
+
unsupported_capability: "unsupported_capability";
|
|
281
|
+
provider_unavailable: "provider_unavailable";
|
|
282
|
+
provider_crashed: "provider_crashed";
|
|
283
|
+
version_incompatible: "version_incompatible";
|
|
284
|
+
interaction_context_invalid: "interaction_context_invalid";
|
|
285
|
+
interaction_context_expired: "interaction_context_expired";
|
|
286
|
+
session_unavailable: "session_unavailable";
|
|
287
|
+
screenshot_failed: "screenshot_failed";
|
|
288
|
+
accessibility_error: "accessibility_error";
|
|
289
|
+
}>;
|
|
290
|
+
message: z.ZodString;
|
|
291
|
+
retry: z.ZodBoolean;
|
|
292
|
+
remediation: z.ZodString;
|
|
293
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
294
|
+
}, z.core.$strict>>>;
|
|
295
|
+
}, z.core.$strict>;
|
|
296
|
+
export declare const MutationResultSchema: z.ZodObject<{
|
|
297
|
+
outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
298
|
+
state: z.ZodLiteral<"verified">;
|
|
299
|
+
evidence: z.ZodOptional<z.ZodUnknown>;
|
|
300
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
301
|
+
state: z.ZodLiteral<"indeterminate">;
|
|
302
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
303
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
304
|
+
state: z.ZodLiteral<"failed">;
|
|
305
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
306
|
+
code: z.ZodEnum<{
|
|
307
|
+
app_not_found: "app_not_found";
|
|
308
|
+
app_unavailable: "app_unavailable";
|
|
309
|
+
app_blocked: "app_blocked";
|
|
310
|
+
window_not_found: "window_not_found";
|
|
311
|
+
window_unavailable: "window_unavailable";
|
|
312
|
+
window_not_focused: "window_not_focused";
|
|
313
|
+
permission_denied: "permission_denied";
|
|
314
|
+
stale_target: "stale_target";
|
|
315
|
+
element_not_found: "element_not_found";
|
|
316
|
+
element_not_clickable: "element_not_clickable";
|
|
317
|
+
action_not_supported: "action_not_supported";
|
|
318
|
+
value_not_settable: "value_not_settable";
|
|
319
|
+
invalid_argument: "invalid_argument";
|
|
320
|
+
timeout: "timeout";
|
|
321
|
+
unsupported_capability: "unsupported_capability";
|
|
322
|
+
provider_unavailable: "provider_unavailable";
|
|
323
|
+
provider_crashed: "provider_crashed";
|
|
324
|
+
version_incompatible: "version_incompatible";
|
|
325
|
+
interaction_context_invalid: "interaction_context_invalid";
|
|
326
|
+
interaction_context_expired: "interaction_context_expired";
|
|
327
|
+
session_unavailable: "session_unavailable";
|
|
328
|
+
screenshot_failed: "screenshot_failed";
|
|
329
|
+
accessibility_error: "accessibility_error";
|
|
330
|
+
}>;
|
|
331
|
+
message: z.ZodString;
|
|
332
|
+
retry: z.ZodBoolean;
|
|
333
|
+
remediation: z.ZodString;
|
|
334
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
335
|
+
}, z.core.$strict>>;
|
|
336
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
337
|
+
state: z.ZodLiteral<"not_attempted">;
|
|
338
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
339
|
+
code: z.ZodEnum<{
|
|
340
|
+
app_not_found: "app_not_found";
|
|
341
|
+
app_unavailable: "app_unavailable";
|
|
342
|
+
app_blocked: "app_blocked";
|
|
343
|
+
window_not_found: "window_not_found";
|
|
344
|
+
window_unavailable: "window_unavailable";
|
|
345
|
+
window_not_focused: "window_not_focused";
|
|
346
|
+
permission_denied: "permission_denied";
|
|
347
|
+
stale_target: "stale_target";
|
|
348
|
+
element_not_found: "element_not_found";
|
|
349
|
+
element_not_clickable: "element_not_clickable";
|
|
350
|
+
action_not_supported: "action_not_supported";
|
|
351
|
+
value_not_settable: "value_not_settable";
|
|
352
|
+
invalid_argument: "invalid_argument";
|
|
353
|
+
timeout: "timeout";
|
|
354
|
+
unsupported_capability: "unsupported_capability";
|
|
355
|
+
provider_unavailable: "provider_unavailable";
|
|
356
|
+
provider_crashed: "provider_crashed";
|
|
357
|
+
version_incompatible: "version_incompatible";
|
|
358
|
+
interaction_context_invalid: "interaction_context_invalid";
|
|
359
|
+
interaction_context_expired: "interaction_context_expired";
|
|
360
|
+
session_unavailable: "session_unavailable";
|
|
361
|
+
screenshot_failed: "screenshot_failed";
|
|
362
|
+
accessibility_error: "accessibility_error";
|
|
363
|
+
}>;
|
|
364
|
+
message: z.ZodString;
|
|
365
|
+
retry: z.ZodBoolean;
|
|
366
|
+
remediation: z.ZodString;
|
|
367
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
368
|
+
}, z.core.$strict>>;
|
|
369
|
+
}, z.core.$strict>], "state">;
|
|
370
|
+
freshState: z.ZodOptional<z.ZodObject<{
|
|
371
|
+
context: z.ZodObject<{
|
|
372
|
+
brokerGeneration: z.ZodString;
|
|
373
|
+
providerGeneration: z.ZodString;
|
|
374
|
+
graphicalSessionId: z.ZodString;
|
|
375
|
+
process: z.ZodObject<{
|
|
376
|
+
pid: z.ZodNumber;
|
|
377
|
+
startedAt: z.ZodISODateTime;
|
|
378
|
+
executableId: z.ZodString;
|
|
379
|
+
}, z.core.$strict>;
|
|
380
|
+
appId: z.ZodString;
|
|
381
|
+
window: z.ZodObject<{
|
|
382
|
+
id: z.ZodString;
|
|
383
|
+
ownerPid: z.ZodNumber;
|
|
384
|
+
}, z.core.$strict>;
|
|
385
|
+
snapshotId: z.ZodString;
|
|
386
|
+
desktopEpoch: z.ZodNumber;
|
|
387
|
+
token: z.ZodString;
|
|
388
|
+
issuedAt: z.ZodISODateTime;
|
|
389
|
+
expiresAt: z.ZodISODateTime;
|
|
390
|
+
}, z.core.$strict>;
|
|
391
|
+
snapshot: z.ZodObject<{
|
|
392
|
+
id: z.ZodString;
|
|
393
|
+
app: z.ZodObject<{
|
|
394
|
+
id: z.ZodString;
|
|
395
|
+
name: z.ZodString;
|
|
396
|
+
bundleId: z.ZodNullable<z.ZodString>;
|
|
397
|
+
pid: z.ZodNumber;
|
|
398
|
+
isRunning: z.ZodBoolean;
|
|
399
|
+
}, z.core.$strict>;
|
|
400
|
+
window: z.ZodObject<{
|
|
401
|
+
id: z.ZodString;
|
|
402
|
+
appId: z.ZodString;
|
|
403
|
+
title: z.ZodString;
|
|
404
|
+
index: z.ZodNumber;
|
|
405
|
+
bounds: z.ZodObject<{
|
|
406
|
+
x: z.ZodNumber;
|
|
407
|
+
y: z.ZodNumber;
|
|
408
|
+
width: z.ZodNumber;
|
|
409
|
+
height: z.ZodNumber;
|
|
410
|
+
}, z.core.$strict>;
|
|
411
|
+
minimized: z.ZodBoolean;
|
|
412
|
+
}, z.core.$strict>;
|
|
413
|
+
treeText: z.ZodString;
|
|
414
|
+
elementCount: z.ZodNumber;
|
|
415
|
+
focusedElementRef: z.ZodNullable<z.ZodString>;
|
|
416
|
+
desktopEpoch: z.ZodNumber;
|
|
417
|
+
}, z.core.$strict>;
|
|
418
|
+
screenshot: z.ZodNullable<z.ZodObject<{
|
|
419
|
+
format: z.ZodLiteral<"png">;
|
|
420
|
+
width: z.ZodNumber;
|
|
421
|
+
height: z.ZodNumber;
|
|
422
|
+
scale: z.ZodNumber;
|
|
423
|
+
data: z.ZodOptional<z.ZodString>;
|
|
424
|
+
path: z.ZodOptional<z.ZodString>;
|
|
425
|
+
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
426
|
+
}, z.core.$strict>>;
|
|
427
|
+
issues: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
428
|
+
code: z.ZodEnum<{
|
|
429
|
+
app_not_found: "app_not_found";
|
|
430
|
+
app_unavailable: "app_unavailable";
|
|
431
|
+
app_blocked: "app_blocked";
|
|
432
|
+
window_not_found: "window_not_found";
|
|
433
|
+
window_unavailable: "window_unavailable";
|
|
434
|
+
window_not_focused: "window_not_focused";
|
|
435
|
+
permission_denied: "permission_denied";
|
|
436
|
+
stale_target: "stale_target";
|
|
437
|
+
element_not_found: "element_not_found";
|
|
438
|
+
element_not_clickable: "element_not_clickable";
|
|
439
|
+
action_not_supported: "action_not_supported";
|
|
440
|
+
value_not_settable: "value_not_settable";
|
|
441
|
+
invalid_argument: "invalid_argument";
|
|
442
|
+
timeout: "timeout";
|
|
443
|
+
unsupported_capability: "unsupported_capability";
|
|
444
|
+
provider_unavailable: "provider_unavailable";
|
|
445
|
+
provider_crashed: "provider_crashed";
|
|
446
|
+
version_incompatible: "version_incompatible";
|
|
447
|
+
interaction_context_invalid: "interaction_context_invalid";
|
|
448
|
+
interaction_context_expired: "interaction_context_expired";
|
|
449
|
+
session_unavailable: "session_unavailable";
|
|
450
|
+
screenshot_failed: "screenshot_failed";
|
|
451
|
+
accessibility_error: "accessibility_error";
|
|
452
|
+
}>;
|
|
453
|
+
message: z.ZodString;
|
|
454
|
+
retry: z.ZodBoolean;
|
|
455
|
+
remediation: z.ZodString;
|
|
456
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
457
|
+
}, z.core.$strict>>>;
|
|
458
|
+
}, z.core.$strict>>;
|
|
459
|
+
}, z.core.$strict>;
|
|
460
|
+
export declare const ProviderCapabilitiesSchema: z.ZodObject<{
|
|
461
|
+
platform: z.ZodEnum<{
|
|
462
|
+
darwin: "darwin";
|
|
463
|
+
win32: "win32";
|
|
464
|
+
linux: "linux";
|
|
465
|
+
}>;
|
|
466
|
+
provider: z.ZodString;
|
|
467
|
+
providerVersion: z.ZodString;
|
|
468
|
+
operations: z.ZodRecord<z.ZodString, z.ZodBoolean>;
|
|
469
|
+
permissions: z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
470
|
+
unknown: "unknown";
|
|
471
|
+
granted: "granted";
|
|
472
|
+
denied: "denied";
|
|
473
|
+
not_required: "not_required";
|
|
474
|
+
}>>;
|
|
475
|
+
}, z.core.$strict>;
|
|
476
|
+
export declare const ProviderHandshakeSchema: z.ZodObject<{
|
|
477
|
+
provider: z.ZodString;
|
|
478
|
+
generation: z.ZodString;
|
|
479
|
+
graphicalSessionId: z.ZodString;
|
|
480
|
+
providerProtocol: z.ZodNumber;
|
|
481
|
+
publicContract: z.ZodString;
|
|
482
|
+
capabilities: z.ZodObject<{
|
|
483
|
+
platform: z.ZodEnum<{
|
|
484
|
+
darwin: "darwin";
|
|
485
|
+
win32: "win32";
|
|
486
|
+
linux: "linux";
|
|
487
|
+
}>;
|
|
488
|
+
provider: z.ZodString;
|
|
489
|
+
providerVersion: z.ZodString;
|
|
490
|
+
operations: z.ZodRecord<z.ZodString, z.ZodBoolean>;
|
|
491
|
+
permissions: z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
492
|
+
unknown: "unknown";
|
|
493
|
+
granted: "granted";
|
|
494
|
+
denied: "denied";
|
|
495
|
+
not_required: "not_required";
|
|
496
|
+
}>>;
|
|
497
|
+
}, z.core.$strict>;
|
|
498
|
+
}, z.core.$strict>;
|
|
499
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAQvB,eAAO,MAAM,6BAA6B,aAA+C,CAAA;AAEzF,eAAO,MAAM,qBAAqB;;;;kBAMvB,CAAA;AAEX,eAAO,MAAM,oBAAoB;;;kBAKtB,CAAA;AAEX,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;kBAWzB,CAAA;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;kBAI1B,CAAA;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;kBAKvB,CAAA;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,eAAO,MAAM,aAAa;;;;;;kBAQf,CAAA;AAEX,eAAO,MAAM,gBAAgB;;;;;;;;;;;;kBAgBlB,CAAA;AAEX,eAAO,MAAM,gBAAgB;;;;;;;;kBAazB,CAAA;AAEJ,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;kBAUhB,CAAA;AAEX,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAShC,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAOtB,CAAA;AAEX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAKtB,CAAA;AAEX,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;kBAQ5B,CAAA;AAEX,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;kBASzB,CAAA"}
|
package/dist/schemas.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SerializedComputerErrorSchema } from './errors.js';
|
|
3
|
+
const FiniteNumberSchema = z.number().finite();
|
|
4
|
+
const NonNegativeIntegerSchema = z.number().int().nonnegative();
|
|
5
|
+
const PositiveIntegerSchema = z.number().int().positive();
|
|
6
|
+
const IdentifierSchema = z.string().min(1).max(512);
|
|
7
|
+
export const InteractionContextTokenSchema = z.string().regex(/^ctx_[A-Za-z0-9_-]{32,}$/);
|
|
8
|
+
export const ProcessIdentitySchema = z
|
|
9
|
+
.object({
|
|
10
|
+
pid: PositiveIntegerSchema,
|
|
11
|
+
startedAt: z.iso.datetime(),
|
|
12
|
+
executableId: IdentifierSchema
|
|
13
|
+
})
|
|
14
|
+
.strict();
|
|
15
|
+
export const WindowIdentitySchema = z
|
|
16
|
+
.object({
|
|
17
|
+
id: IdentifierSchema,
|
|
18
|
+
ownerPid: PositiveIntegerSchema
|
|
19
|
+
})
|
|
20
|
+
.strict();
|
|
21
|
+
export const ReferenceBindingsSchema = z
|
|
22
|
+
.object({
|
|
23
|
+
brokerGeneration: IdentifierSchema,
|
|
24
|
+
providerGeneration: IdentifierSchema,
|
|
25
|
+
graphicalSessionId: IdentifierSchema,
|
|
26
|
+
process: ProcessIdentitySchema,
|
|
27
|
+
appId: IdentifierSchema,
|
|
28
|
+
window: WindowIdentitySchema,
|
|
29
|
+
snapshotId: IdentifierSchema,
|
|
30
|
+
desktopEpoch: NonNegativeIntegerSchema
|
|
31
|
+
})
|
|
32
|
+
.strict();
|
|
33
|
+
export const InteractionContextSchema = ReferenceBindingsSchema.extend({
|
|
34
|
+
token: InteractionContextTokenSchema,
|
|
35
|
+
issuedAt: z.iso.datetime(),
|
|
36
|
+
expiresAt: z.iso.datetime()
|
|
37
|
+
}).strict();
|
|
38
|
+
export const TargetReferenceSchema = ReferenceBindingsSchema.extend({
|
|
39
|
+
ref: IdentifierSchema,
|
|
40
|
+
kind: z.enum(['app', 'window', 'element']),
|
|
41
|
+
contextToken: InteractionContextTokenSchema,
|
|
42
|
+
expiresAt: z.iso.datetime()
|
|
43
|
+
}).strict();
|
|
44
|
+
export const AppInfoSchema = z
|
|
45
|
+
.object({
|
|
46
|
+
id: IdentifierSchema,
|
|
47
|
+
name: z.string().min(1),
|
|
48
|
+
bundleId: z.string().min(1).nullable(),
|
|
49
|
+
pid: PositiveIntegerSchema,
|
|
50
|
+
isRunning: z.boolean()
|
|
51
|
+
})
|
|
52
|
+
.strict();
|
|
53
|
+
export const WindowInfoSchema = z
|
|
54
|
+
.object({
|
|
55
|
+
id: IdentifierSchema,
|
|
56
|
+
appId: IdentifierSchema,
|
|
57
|
+
title: z.string(),
|
|
58
|
+
index: NonNegativeIntegerSchema,
|
|
59
|
+
bounds: z
|
|
60
|
+
.object({
|
|
61
|
+
x: FiniteNumberSchema,
|
|
62
|
+
y: FiniteNumberSchema,
|
|
63
|
+
width: z.number().finite().positive(),
|
|
64
|
+
height: z.number().finite().positive()
|
|
65
|
+
})
|
|
66
|
+
.strict(),
|
|
67
|
+
minimized: z.boolean()
|
|
68
|
+
})
|
|
69
|
+
.strict();
|
|
70
|
+
export const ScreenshotSchema = z
|
|
71
|
+
.object({
|
|
72
|
+
format: z.literal('png'),
|
|
73
|
+
width: PositiveIntegerSchema,
|
|
74
|
+
height: PositiveIntegerSchema,
|
|
75
|
+
scale: z.number().finite().positive(),
|
|
76
|
+
data: z.string().min(1).optional(),
|
|
77
|
+
path: z.string().min(1).optional(),
|
|
78
|
+
expiresAt: z.iso.datetime().optional()
|
|
79
|
+
})
|
|
80
|
+
.strict()
|
|
81
|
+
.refine((value) => value.data !== undefined || value.path !== undefined, {
|
|
82
|
+
message: 'Screenshot must include data or path'
|
|
83
|
+
});
|
|
84
|
+
export const SnapshotSchema = z
|
|
85
|
+
.object({
|
|
86
|
+
id: IdentifierSchema,
|
|
87
|
+
app: AppInfoSchema,
|
|
88
|
+
window: WindowInfoSchema,
|
|
89
|
+
treeText: z.string(),
|
|
90
|
+
elementCount: NonNegativeIntegerSchema,
|
|
91
|
+
focusedElementRef: z.string().nullable(),
|
|
92
|
+
desktopEpoch: NonNegativeIntegerSchema
|
|
93
|
+
})
|
|
94
|
+
.strict();
|
|
95
|
+
export const MutationOutcomeSchema = z.discriminatedUnion('state', [
|
|
96
|
+
z.object({ state: z.literal('verified'), evidence: z.unknown().optional() }).strict(),
|
|
97
|
+
z.object({ state: z.literal('indeterminate'), reason: z.string().optional() }).strict(),
|
|
98
|
+
z
|
|
99
|
+
.object({ state: z.literal('failed'), error: SerializedComputerErrorSchema.optional() })
|
|
100
|
+
.strict(),
|
|
101
|
+
z
|
|
102
|
+
.object({ state: z.literal('not_attempted'), error: SerializedComputerErrorSchema.optional() })
|
|
103
|
+
.strict()
|
|
104
|
+
]);
|
|
105
|
+
export const SnapshotResultSchema = z
|
|
106
|
+
.object({
|
|
107
|
+
context: InteractionContextSchema,
|
|
108
|
+
snapshot: SnapshotSchema,
|
|
109
|
+
screenshot: ScreenshotSchema.nullable(),
|
|
110
|
+
issues: z.array(SerializedComputerErrorSchema).default([])
|
|
111
|
+
})
|
|
112
|
+
.strict();
|
|
113
|
+
export const MutationResultSchema = z
|
|
114
|
+
.object({
|
|
115
|
+
outcome: MutationOutcomeSchema,
|
|
116
|
+
freshState: SnapshotResultSchema.optional()
|
|
117
|
+
})
|
|
118
|
+
.strict();
|
|
119
|
+
export const ProviderCapabilitiesSchema = z
|
|
120
|
+
.object({
|
|
121
|
+
platform: z.enum(['darwin', 'win32', 'linux']),
|
|
122
|
+
provider: IdentifierSchema,
|
|
123
|
+
providerVersion: z.string().min(1),
|
|
124
|
+
operations: z.record(z.string(), z.boolean()),
|
|
125
|
+
permissions: z.record(z.string(), z.enum(['granted', 'denied', 'unknown', 'not_required']))
|
|
126
|
+
})
|
|
127
|
+
.strict();
|
|
128
|
+
export const ProviderHandshakeSchema = z
|
|
129
|
+
.object({
|
|
130
|
+
provider: IdentifierSchema,
|
|
131
|
+
generation: IdentifierSchema,
|
|
132
|
+
graphicalSessionId: IdentifierSchema,
|
|
133
|
+
providerProtocol: PositiveIntegerSchema,
|
|
134
|
+
publicContract: z.string().min(1),
|
|
135
|
+
capabilities: ProviderCapabilitiesSchema
|
|
136
|
+
})
|
|
137
|
+
.strict();
|
|
138
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAE3D,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAA;AAC9C,MAAM,wBAAwB,GAAG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E,gBAAgB;IAC1B,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;IAC7C,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;CAC5F,CAAC;KACD,MAAM,EAAE,CAAA;AAEX,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,QAAQ,EAAE,gBAAgB;IAC1B,UAAU,EAAE,gBAAgB;IAC5B,kBAAkB,EAAE,gBAAgB;IACpC,gBAAgB,EAAE,qBAAqB;IACvC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,YAAY,EAAE,0BAA0B;CACzC,CAAC;KACD,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createComputerError } from './errors.js';
|
|
2
|
+
export declare const CONTRACT_VERSIONS: {
|
|
3
|
+
readonly product: "0.1.2";
|
|
4
|
+
readonly publicContract: "1.1.0";
|
|
5
|
+
readonly brokerControl: 1;
|
|
6
|
+
readonly providerProtocol: 1;
|
|
7
|
+
readonly mcpProtocol: "2025-11-25";
|
|
8
|
+
};
|
|
9
|
+
export type ContractVersions = {
|
|
10
|
+
product: string;
|
|
11
|
+
publicContract: string;
|
|
12
|
+
brokerControl: number;
|
|
13
|
+
providerProtocol: number;
|
|
14
|
+
mcpProtocol: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const COMPATIBLE_VERSIONS: {
|
|
17
|
+
readonly product: readonly ["0.1.2"];
|
|
18
|
+
readonly publicContract: readonly ["1.1.0"];
|
|
19
|
+
readonly brokerControl: readonly [1];
|
|
20
|
+
readonly providerProtocol: readonly [1];
|
|
21
|
+
readonly mcpProtocol: readonly ["2025-11-25"];
|
|
22
|
+
};
|
|
23
|
+
export type VersionNegotiationResult = {
|
|
24
|
+
ok: true;
|
|
25
|
+
versions: typeof CONTRACT_VERSIONS;
|
|
26
|
+
} | {
|
|
27
|
+
ok: false;
|
|
28
|
+
error: ReturnType<typeof createComputerError>;
|
|
29
|
+
};
|
|
30
|
+
export declare function negotiateVersionHandshake(remote: ContractVersions): VersionNegotiationResult;
|
|
31
|
+
//# sourceMappingURL=versions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../src/versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEjD,eAAO,MAAM,iBAAiB;;;;;;CAMpB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;IACxB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,mBAAmB;;;;;;CAMtB,CAAA;AAEV,MAAM,MAAM,wBAAwB,GAChC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,OAAO,iBAAiB,CAAA;CAAE,GAChD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAA;CAAE,CAAA;AAEhE,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,gBAAgB,GAAG,wBAAwB,CAe5F"}
|