@agentstorm/platform-protocol 0.2.5
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 +671 -0
- package/README.md +12 -0
- package/dist/agent-attention-notification.d.ts +43 -0
- package/dist/agent-attention-notification.js +141 -0
- package/dist/agent-deep-link.d.ts +8 -0
- package/dist/agent-deep-link.js +49 -0
- package/dist/agent-labels.d.ts +7 -0
- package/dist/agent-labels.js +11 -0
- package/dist/agent-lifecycle.d.ts +3 -0
- package/dist/agent-lifecycle.js +8 -0
- package/dist/agent-state-bucket.d.ts +14 -0
- package/dist/agent-state-bucket.js +41 -0
- package/dist/agent-title-limits.d.ts +2 -0
- package/dist/agent-title-limits.js +2 -0
- package/dist/agent-types.d.ts +451 -0
- package/dist/agent-types.js +22 -0
- package/dist/binary-frames/demux.d.ts +11 -0
- package/dist/binary-frames/demux.js +23 -0
- package/dist/binary-frames/file-transfer.d.ts +51 -0
- package/dist/binary-frames/file-transfer.js +108 -0
- package/dist/binary-frames/index.d.ts +4 -0
- package/dist/binary-frames/index.js +4 -0
- package/dist/binary-frames/terminal.d.ts +35 -0
- package/dist/binary-frames/terminal.js +100 -0
- package/dist/branch-slug.d.ts +14 -0
- package/dist/branch-slug.js +49 -0
- package/dist/browser-automation/capabilities.d.ts +7 -0
- package/dist/browser-automation/capabilities.js +31 -0
- package/dist/browser-automation/rpc-schemas.d.ts +1112 -0
- package/dist/browser-automation/rpc-schemas.js +462 -0
- package/dist/chat/rpc-schemas.d.ts +158 -0
- package/dist/chat/rpc-schemas.js +103 -0
- package/dist/chat/types.d.ts +30 -0
- package/dist/chat/types.js +22 -0
- package/dist/client-capabilities.d.ts +11 -0
- package/dist/client-capabilities.js +25 -0
- package/dist/connection-offer.d.ts +36 -0
- package/dist/connection-offer.js +53 -0
- package/dist/daemon-endpoints.d.ts +47 -0
- package/dist/daemon-endpoints.js +201 -0
- package/dist/error-utils.d.ts +11 -0
- package/dist/error-utils.js +27 -0
- package/dist/forge-manifest.d.ts +66 -0
- package/dist/forge-manifest.js +92 -0
- package/dist/generated/validation/ws-outbound.aot.d.ts +2 -0
- package/dist/generated/validation/ws-outbound.aot.js +65207 -0
- package/dist/git-remote.d.ts +33 -0
- package/dist/git-remote.js +94 -0
- package/dist/host-connection-schema.d.ts +11 -0
- package/dist/host-connection-schema.js +9 -0
- package/dist/literal-union.d.ts +2 -0
- package/dist/literal-union.js +2 -0
- package/dist/loop/rpc-schemas.d.ts +636 -0
- package/dist/loop/rpc-schemas.js +163 -0
- package/dist/messages.d.ts +40580 -0
- package/dist/messages.js +4999 -0
- package/dist/paseo-config-schema.d.ts +138 -0
- package/dist/paseo-config-schema.js +98 -0
- package/dist/path-utils.d.ts +2 -0
- package/dist/path-utils.js +16 -0
- package/dist/provider-config.d.ts +126 -0
- package/dist/provider-config.js +110 -0
- package/dist/provider-icon-names.d.ts +5 -0
- package/dist/provider-icon-names.js +52 -0
- package/dist/provider-manifest.d.ts +35 -0
- package/dist/provider-manifest.js +254 -0
- package/dist/schedule/cadence.d.ts +6 -0
- package/dist/schedule/cadence.js +28 -0
- package/dist/schedule/cron-expression.d.ts +13 -0
- package/dist/schedule/cron-expression.js +97 -0
- package/dist/schedule/rpc-schemas.d.ts +624 -0
- package/dist/schedule/rpc-schemas.js +155 -0
- package/dist/schedule/types.d.ts +222 -0
- package/dist/schedule/types.js +78 -0
- package/dist/terminal-activity.d.ts +21 -0
- package/dist/terminal-activity.js +25 -0
- package/dist/terminal-input-mode.d.ts +30 -0
- package/dist/terminal-input-mode.js +180 -0
- package/dist/terminal-key-input.d.ts +13 -0
- package/dist/terminal-key-input.js +210 -0
- package/dist/terminal-profiles.d.ts +6 -0
- package/dist/terminal-profiles.js +28 -0
- package/dist/terminal-snapshot.d.ts +3 -0
- package/dist/terminal-snapshot.js +178 -0
- package/dist/terminal-stream-protocol.d.ts +2 -0
- package/dist/terminal-stream-protocol.js +2 -0
- package/dist/terminal-subscription-key.d.ts +2 -0
- package/dist/terminal-subscription-key.js +9 -0
- package/dist/tool-call-display.d.ts +11 -0
- package/dist/tool-call-display.js +135 -0
- package/dist/tool-name-normalization.d.ts +9 -0
- package/dist/tool-name-normalization.js +82 -0
- package/dist/validation/ws-outbound-schema-metadata.d.ts +7570 -0
- package/dist/validation/ws-outbound-schema-metadata.js +3 -0
- package/dist/validation/ws-outbound.d.ts +12 -0
- package/dist/validation/ws-outbound.js +8 -0
- package/package.json +32 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const BrowserAutomationErrorCodeSchema = z.enum([
|
|
3
|
+
"browser_disabled",
|
|
4
|
+
"browser_no_host",
|
|
5
|
+
"browser_tab_not_found",
|
|
6
|
+
"browser_tab_closed",
|
|
7
|
+
"browser_timeout",
|
|
8
|
+
"screenshot_no_frame",
|
|
9
|
+
"browser_denied",
|
|
10
|
+
"browser_unsupported",
|
|
11
|
+
"browser_stale_ref",
|
|
12
|
+
"browser_unknown_error",
|
|
13
|
+
]);
|
|
14
|
+
const BROWSER_AUTOMATION_BROWSER_ID_PATTERN = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|\d{13,}-[0-9a-f]+)$/i;
|
|
15
|
+
const BROWSER_AUTOMATION_BROWSER_ID_MESSAGE = "browserId must be a real id returned by browser_new_tab or browser_list_tabs";
|
|
16
|
+
const BROWSER_AUTOMATION_WAIT_CONDITION_MESSAGE = "browser_wait requires exactly one of text or url";
|
|
17
|
+
export const BROWSER_AUTOMATION_COMMAND_NAMES = [
|
|
18
|
+
"list_tabs",
|
|
19
|
+
"new_tab",
|
|
20
|
+
"snapshot",
|
|
21
|
+
"click",
|
|
22
|
+
"fill",
|
|
23
|
+
"wait",
|
|
24
|
+
"type",
|
|
25
|
+
"keypress",
|
|
26
|
+
"navigate",
|
|
27
|
+
"back",
|
|
28
|
+
"forward",
|
|
29
|
+
"reload",
|
|
30
|
+
"screenshot",
|
|
31
|
+
"upload",
|
|
32
|
+
"select",
|
|
33
|
+
"hover",
|
|
34
|
+
"drag",
|
|
35
|
+
"logs",
|
|
36
|
+
"evaluate",
|
|
37
|
+
"scroll",
|
|
38
|
+
"resize",
|
|
39
|
+
"close_tab",
|
|
40
|
+
];
|
|
41
|
+
export const BrowserAutomationCommandNameSchema = z.enum(BROWSER_AUTOMATION_COMMAND_NAMES);
|
|
42
|
+
export const BrowserAutomationBrowserIdSchema = z
|
|
43
|
+
.string({ error: () => BROWSER_AUTOMATION_BROWSER_ID_MESSAGE })
|
|
44
|
+
.min(1, BROWSER_AUTOMATION_BROWSER_ID_MESSAGE)
|
|
45
|
+
.regex(BROWSER_AUTOMATION_BROWSER_ID_PATTERN, BROWSER_AUTOMATION_BROWSER_ID_MESSAGE);
|
|
46
|
+
const BrowserAutomationTabTargetSchema = z
|
|
47
|
+
.object({
|
|
48
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
49
|
+
})
|
|
50
|
+
.strict();
|
|
51
|
+
const BrowserAutomationRefSchema = z.string().regex(/^@e\d+$/);
|
|
52
|
+
const BrowserAutomationMouseButtonSchema = z.enum(["left", "right", "middle"]);
|
|
53
|
+
const BrowserAutomationInputModifierSchema = z.enum(["Alt", "Control", "Meta", "Shift"]);
|
|
54
|
+
const BrowserAutomationHttpUrlSchema = z
|
|
55
|
+
.string()
|
|
56
|
+
.url()
|
|
57
|
+
.refine((value) => {
|
|
58
|
+
const protocol = new URL(value).protocol;
|
|
59
|
+
return protocol === "http:" || protocol === "https:";
|
|
60
|
+
}, "URL must use http or https");
|
|
61
|
+
export const BrowserAutomationListTabsCommandSchema = z.object({
|
|
62
|
+
command: z.literal("list_tabs"),
|
|
63
|
+
args: z.object({}).strict().default({}),
|
|
64
|
+
});
|
|
65
|
+
export const BrowserAutomationNewTabCommandSchema = z.object({
|
|
66
|
+
command: z.literal("new_tab"),
|
|
67
|
+
args: z
|
|
68
|
+
.object({
|
|
69
|
+
url: BrowserAutomationHttpUrlSchema.optional(),
|
|
70
|
+
})
|
|
71
|
+
.strict()
|
|
72
|
+
.default({}),
|
|
73
|
+
});
|
|
74
|
+
export const BrowserAutomationSnapshotCommandSchema = z.object({
|
|
75
|
+
command: z.literal("snapshot"),
|
|
76
|
+
args: BrowserAutomationTabTargetSchema,
|
|
77
|
+
});
|
|
78
|
+
export const BrowserAutomationClickCommandSchema = z.object({
|
|
79
|
+
command: z.literal("click"),
|
|
80
|
+
args: BrowserAutomationTabTargetSchema.extend({
|
|
81
|
+
ref: BrowserAutomationRefSchema,
|
|
82
|
+
button: BrowserAutomationMouseButtonSchema.default("left"),
|
|
83
|
+
doubleClick: z.boolean().default(false),
|
|
84
|
+
modifiers: z.array(BrowserAutomationInputModifierSchema).default([]),
|
|
85
|
+
}),
|
|
86
|
+
});
|
|
87
|
+
export const BrowserAutomationFillCommandSchema = z.object({
|
|
88
|
+
command: z.literal("fill"),
|
|
89
|
+
args: BrowserAutomationTabTargetSchema.extend({
|
|
90
|
+
ref: BrowserAutomationRefSchema,
|
|
91
|
+
value: z.string(),
|
|
92
|
+
}),
|
|
93
|
+
});
|
|
94
|
+
export const BrowserAutomationWaitCommandSchema = z.object({
|
|
95
|
+
command: z.literal("wait"),
|
|
96
|
+
args: BrowserAutomationTabTargetSchema.extend({
|
|
97
|
+
text: z.string().min(1).optional(),
|
|
98
|
+
url: z.string().min(1).optional(),
|
|
99
|
+
timeoutMs: z.number().int().positive().max(30000).optional(),
|
|
100
|
+
}).refine((args) => Number(Boolean(args.text)) + Number(Boolean(args.url)) === 1, {
|
|
101
|
+
message: BROWSER_AUTOMATION_WAIT_CONDITION_MESSAGE,
|
|
102
|
+
}),
|
|
103
|
+
});
|
|
104
|
+
export const BrowserAutomationTypeCommandSchema = z.object({
|
|
105
|
+
command: z.literal("type"),
|
|
106
|
+
args: BrowserAutomationTabTargetSchema.extend({
|
|
107
|
+
ref: BrowserAutomationRefSchema.optional(),
|
|
108
|
+
text: z.string(),
|
|
109
|
+
}),
|
|
110
|
+
});
|
|
111
|
+
export const BrowserAutomationKeypressCommandSchema = z.object({
|
|
112
|
+
command: z.literal("keypress"),
|
|
113
|
+
args: BrowserAutomationTabTargetSchema.extend({
|
|
114
|
+
ref: BrowserAutomationRefSchema.optional(),
|
|
115
|
+
key: z.string().min(1),
|
|
116
|
+
}),
|
|
117
|
+
});
|
|
118
|
+
export const BrowserAutomationNavigateCommandSchema = z.object({
|
|
119
|
+
command: z.literal("navigate"),
|
|
120
|
+
args: BrowserAutomationTabTargetSchema.extend({
|
|
121
|
+
url: BrowserAutomationHttpUrlSchema,
|
|
122
|
+
}),
|
|
123
|
+
});
|
|
124
|
+
export const BrowserAutomationBackCommandSchema = z.object({
|
|
125
|
+
command: z.literal("back"),
|
|
126
|
+
args: BrowserAutomationTabTargetSchema,
|
|
127
|
+
});
|
|
128
|
+
export const BrowserAutomationForwardCommandSchema = z.object({
|
|
129
|
+
command: z.literal("forward"),
|
|
130
|
+
args: BrowserAutomationTabTargetSchema,
|
|
131
|
+
});
|
|
132
|
+
export const BrowserAutomationReloadCommandSchema = z.object({
|
|
133
|
+
command: z.literal("reload"),
|
|
134
|
+
args: BrowserAutomationTabTargetSchema,
|
|
135
|
+
});
|
|
136
|
+
export const BrowserAutomationScreenshotCommandSchema = z.object({
|
|
137
|
+
command: z.literal("screenshot"),
|
|
138
|
+
args: BrowserAutomationTabTargetSchema.extend({
|
|
139
|
+
fullPage: z.boolean().default(false),
|
|
140
|
+
}),
|
|
141
|
+
});
|
|
142
|
+
export const BrowserAutomationUploadCommandSchema = z.object({
|
|
143
|
+
command: z.literal("upload"),
|
|
144
|
+
args: BrowserAutomationTabTargetSchema.extend({
|
|
145
|
+
ref: BrowserAutomationRefSchema,
|
|
146
|
+
filePaths: z.array(z.string().min(1)).min(1),
|
|
147
|
+
}),
|
|
148
|
+
});
|
|
149
|
+
export const BrowserAutomationSelectCommandSchema = z.object({
|
|
150
|
+
command: z.literal("select"),
|
|
151
|
+
args: BrowserAutomationTabTargetSchema.extend({
|
|
152
|
+
ref: BrowserAutomationRefSchema,
|
|
153
|
+
value: z.string(),
|
|
154
|
+
}),
|
|
155
|
+
});
|
|
156
|
+
export const BrowserAutomationHoverCommandSchema = z.object({
|
|
157
|
+
command: z.literal("hover"),
|
|
158
|
+
args: BrowserAutomationTabTargetSchema.extend({
|
|
159
|
+
ref: BrowserAutomationRefSchema,
|
|
160
|
+
}),
|
|
161
|
+
});
|
|
162
|
+
export const BrowserAutomationDragCommandSchema = z.object({
|
|
163
|
+
command: z.literal("drag"),
|
|
164
|
+
args: BrowserAutomationTabTargetSchema.extend({
|
|
165
|
+
sourceRef: BrowserAutomationRefSchema,
|
|
166
|
+
targetRef: BrowserAutomationRefSchema,
|
|
167
|
+
}),
|
|
168
|
+
});
|
|
169
|
+
export const BrowserAutomationLogsCommandSchema = z.object({
|
|
170
|
+
command: z.literal("logs"),
|
|
171
|
+
args: BrowserAutomationTabTargetSchema.extend({
|
|
172
|
+
maxEntries: z.number().int().positive().max(200).default(50),
|
|
173
|
+
}),
|
|
174
|
+
});
|
|
175
|
+
export const BrowserAutomationEvaluateCommandSchema = z.object({
|
|
176
|
+
command: z.literal("evaluate"),
|
|
177
|
+
args: BrowserAutomationTabTargetSchema.extend({
|
|
178
|
+
function: z.string().min(1),
|
|
179
|
+
ref: BrowserAutomationRefSchema.optional(),
|
|
180
|
+
}),
|
|
181
|
+
});
|
|
182
|
+
export const BrowserAutomationScrollCommandSchema = z.object({
|
|
183
|
+
command: z.literal("scroll"),
|
|
184
|
+
args: BrowserAutomationTabTargetSchema.extend({
|
|
185
|
+
ref: BrowserAutomationRefSchema.optional(),
|
|
186
|
+
deltaX: z.number(),
|
|
187
|
+
deltaY: z.number(),
|
|
188
|
+
}),
|
|
189
|
+
});
|
|
190
|
+
export const BrowserAutomationResizeCommandSchema = z.object({
|
|
191
|
+
command: z.literal("resize"),
|
|
192
|
+
args: BrowserAutomationTabTargetSchema.extend({
|
|
193
|
+
width: z.number().int().positive(),
|
|
194
|
+
height: z.number().int().positive(),
|
|
195
|
+
}),
|
|
196
|
+
});
|
|
197
|
+
export const BrowserAutomationCloseTabCommandSchema = z.object({
|
|
198
|
+
command: z.literal("close_tab"),
|
|
199
|
+
args: BrowserAutomationTabTargetSchema,
|
|
200
|
+
});
|
|
201
|
+
export const BrowserAutomationCommandSchema = z.discriminatedUnion("command", [
|
|
202
|
+
BrowserAutomationListTabsCommandSchema,
|
|
203
|
+
BrowserAutomationNewTabCommandSchema,
|
|
204
|
+
BrowserAutomationSnapshotCommandSchema,
|
|
205
|
+
BrowserAutomationClickCommandSchema,
|
|
206
|
+
BrowserAutomationFillCommandSchema,
|
|
207
|
+
BrowserAutomationWaitCommandSchema,
|
|
208
|
+
BrowserAutomationTypeCommandSchema,
|
|
209
|
+
BrowserAutomationKeypressCommandSchema,
|
|
210
|
+
BrowserAutomationNavigateCommandSchema,
|
|
211
|
+
BrowserAutomationBackCommandSchema,
|
|
212
|
+
BrowserAutomationForwardCommandSchema,
|
|
213
|
+
BrowserAutomationReloadCommandSchema,
|
|
214
|
+
BrowserAutomationScreenshotCommandSchema,
|
|
215
|
+
BrowserAutomationUploadCommandSchema,
|
|
216
|
+
BrowserAutomationSelectCommandSchema,
|
|
217
|
+
BrowserAutomationHoverCommandSchema,
|
|
218
|
+
BrowserAutomationDragCommandSchema,
|
|
219
|
+
BrowserAutomationLogsCommandSchema,
|
|
220
|
+
BrowserAutomationEvaluateCommandSchema,
|
|
221
|
+
BrowserAutomationScrollCommandSchema,
|
|
222
|
+
BrowserAutomationResizeCommandSchema,
|
|
223
|
+
BrowserAutomationCloseTabCommandSchema,
|
|
224
|
+
]);
|
|
225
|
+
export const BrowserAutomationTabInfoSchema = z.object({
|
|
226
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
227
|
+
workspaceId: z.string().min(1).optional(),
|
|
228
|
+
url: z.string(),
|
|
229
|
+
title: z.string(),
|
|
230
|
+
isActive: z.boolean().default(false),
|
|
231
|
+
isLoading: z.boolean().default(false),
|
|
232
|
+
canGoBack: z.boolean().optional(),
|
|
233
|
+
canGoForward: z.boolean().optional(),
|
|
234
|
+
});
|
|
235
|
+
export const BrowserAutomationListTabsResultSchema = z.object({
|
|
236
|
+
command: z.literal("list_tabs"),
|
|
237
|
+
tabs: z.array(BrowserAutomationTabInfoSchema),
|
|
238
|
+
});
|
|
239
|
+
export const BrowserAutomationNewTabResultSchema = z.object({
|
|
240
|
+
command: z.literal("new_tab"),
|
|
241
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
242
|
+
workspaceId: z.string().min(1),
|
|
243
|
+
url: z.string().min(1),
|
|
244
|
+
});
|
|
245
|
+
export const BrowserAutomationSnapshotStatsSchema = z
|
|
246
|
+
.object({
|
|
247
|
+
nodeCount: z.number().int().nonnegative(),
|
|
248
|
+
refCount: z.number().int().nonnegative(),
|
|
249
|
+
textLength: z.number().int().nonnegative(),
|
|
250
|
+
iframeCount: z.number().int().nonnegative().optional(),
|
|
251
|
+
maxDepth: z.number().int().nonnegative().optional(),
|
|
252
|
+
})
|
|
253
|
+
.strict();
|
|
254
|
+
export const BrowserAutomationSnapshotResultSchema = z.object({
|
|
255
|
+
command: z.literal("snapshot"),
|
|
256
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
257
|
+
workspaceId: z.string().min(1).optional(),
|
|
258
|
+
url: z.string(),
|
|
259
|
+
title: z.string(),
|
|
260
|
+
format: z.literal("aria-yaml"),
|
|
261
|
+
snapshot: z.string(),
|
|
262
|
+
truncated: z.boolean(),
|
|
263
|
+
stats: BrowserAutomationSnapshotStatsSchema,
|
|
264
|
+
});
|
|
265
|
+
export const BrowserAutomationClickResultSchema = z.object({
|
|
266
|
+
command: z.literal("click"),
|
|
267
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
268
|
+
ref: BrowserAutomationRefSchema,
|
|
269
|
+
x: z.number().optional(),
|
|
270
|
+
y: z.number().optional(),
|
|
271
|
+
});
|
|
272
|
+
export const BrowserAutomationFillResultSchema = z.object({
|
|
273
|
+
command: z.literal("fill"),
|
|
274
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
275
|
+
ref: BrowserAutomationRefSchema,
|
|
276
|
+
});
|
|
277
|
+
export const BrowserAutomationWaitResultSchema = z.object({
|
|
278
|
+
command: z.literal("wait"),
|
|
279
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
280
|
+
matched: z.enum(["text", "url"]),
|
|
281
|
+
});
|
|
282
|
+
export const BrowserAutomationTypeResultSchema = z.object({
|
|
283
|
+
command: z.literal("type"),
|
|
284
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
285
|
+
ref: BrowserAutomationRefSchema.optional(),
|
|
286
|
+
x: z.number().optional(),
|
|
287
|
+
y: z.number().optional(),
|
|
288
|
+
});
|
|
289
|
+
export const BrowserAutomationKeypressResultSchema = z.object({
|
|
290
|
+
command: z.literal("keypress"),
|
|
291
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
292
|
+
key: z.string().min(1),
|
|
293
|
+
ref: BrowserAutomationRefSchema.optional(),
|
|
294
|
+
x: z.number().optional(),
|
|
295
|
+
y: z.number().optional(),
|
|
296
|
+
});
|
|
297
|
+
export const BrowserAutomationNavigateResultSchema = z.object({
|
|
298
|
+
command: z.literal("navigate"),
|
|
299
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
300
|
+
url: z.string().min(1),
|
|
301
|
+
});
|
|
302
|
+
export const BrowserAutomationBackResultSchema = z.object({
|
|
303
|
+
command: z.literal("back"),
|
|
304
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
305
|
+
});
|
|
306
|
+
export const BrowserAutomationForwardResultSchema = z.object({
|
|
307
|
+
command: z.literal("forward"),
|
|
308
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
309
|
+
});
|
|
310
|
+
export const BrowserAutomationReloadResultSchema = z.object({
|
|
311
|
+
command: z.literal("reload"),
|
|
312
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
313
|
+
});
|
|
314
|
+
export const BrowserAutomationScreenshotResultSchema = z.object({
|
|
315
|
+
command: z.literal("screenshot"),
|
|
316
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
317
|
+
mimeType: z.literal("image/png"),
|
|
318
|
+
dataBase64: z.string().min(1),
|
|
319
|
+
width: z.number().int().nonnegative(),
|
|
320
|
+
height: z.number().int().nonnegative(),
|
|
321
|
+
});
|
|
322
|
+
export const BrowserAutomationUploadResultSchema = z.object({
|
|
323
|
+
command: z.literal("upload"),
|
|
324
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
325
|
+
ref: BrowserAutomationRefSchema,
|
|
326
|
+
filePaths: z.array(z.string().min(1)).min(1),
|
|
327
|
+
});
|
|
328
|
+
export const BrowserAutomationSelectResultSchema = z.object({
|
|
329
|
+
command: z.literal("select"),
|
|
330
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
331
|
+
ref: BrowserAutomationRefSchema,
|
|
332
|
+
value: z.string(),
|
|
333
|
+
});
|
|
334
|
+
export const BrowserAutomationHoverResultSchema = z.object({
|
|
335
|
+
command: z.literal("hover"),
|
|
336
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
337
|
+
ref: BrowserAutomationRefSchema,
|
|
338
|
+
x: z.number().optional(),
|
|
339
|
+
y: z.number().optional(),
|
|
340
|
+
});
|
|
341
|
+
export const BrowserAutomationDragResultSchema = z.object({
|
|
342
|
+
command: z.literal("drag"),
|
|
343
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
344
|
+
sourceRef: BrowserAutomationRefSchema,
|
|
345
|
+
targetRef: BrowserAutomationRefSchema,
|
|
346
|
+
sourceX: z.number().optional(),
|
|
347
|
+
sourceY: z.number().optional(),
|
|
348
|
+
targetX: z.number().optional(),
|
|
349
|
+
targetY: z.number().optional(),
|
|
350
|
+
});
|
|
351
|
+
export const BrowserAutomationConsoleLogEntrySchema = z.object({
|
|
352
|
+
level: z.string(),
|
|
353
|
+
message: z.string(),
|
|
354
|
+
source: z.string().optional(),
|
|
355
|
+
line: z.number().int().optional(),
|
|
356
|
+
timestamp: z.number(),
|
|
357
|
+
});
|
|
358
|
+
export const BrowserAutomationNetworkLogEntrySchema = z.object({
|
|
359
|
+
url: z.string(),
|
|
360
|
+
method: z.string().optional(),
|
|
361
|
+
status: z.number().int().optional(),
|
|
362
|
+
type: z.string().optional(),
|
|
363
|
+
startTime: z.number(),
|
|
364
|
+
duration: z.number(),
|
|
365
|
+
transferSize: z.number().optional(),
|
|
366
|
+
});
|
|
367
|
+
export const BrowserAutomationLogsResultSchema = z.object({
|
|
368
|
+
command: z.literal("logs"),
|
|
369
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
370
|
+
console: z.array(BrowserAutomationConsoleLogEntrySchema),
|
|
371
|
+
network: z.array(BrowserAutomationNetworkLogEntrySchema),
|
|
372
|
+
});
|
|
373
|
+
export const BrowserAutomationEvaluateResultSchema = z.object({
|
|
374
|
+
command: z.literal("evaluate"),
|
|
375
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
376
|
+
resultJson: z.string(),
|
|
377
|
+
truncated: z.boolean(),
|
|
378
|
+
});
|
|
379
|
+
export const BrowserAutomationScrollResultSchema = z.object({
|
|
380
|
+
command: z.literal("scroll"),
|
|
381
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
382
|
+
ref: BrowserAutomationRefSchema.optional(),
|
|
383
|
+
deltaX: z.number(),
|
|
384
|
+
deltaY: z.number(),
|
|
385
|
+
x: z.number().optional(),
|
|
386
|
+
y: z.number().optional(),
|
|
387
|
+
});
|
|
388
|
+
export const BrowserAutomationResizeResultSchema = z.object({
|
|
389
|
+
command: z.literal("resize"),
|
|
390
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
391
|
+
width: z.number().int().positive(),
|
|
392
|
+
height: z.number().int().positive(),
|
|
393
|
+
});
|
|
394
|
+
export const BrowserAutomationCloseTabResultSchema = z.object({
|
|
395
|
+
command: z.literal("close_tab"),
|
|
396
|
+
browserId: BrowserAutomationBrowserIdSchema,
|
|
397
|
+
});
|
|
398
|
+
export const BrowserAutomationResultSchema = z.discriminatedUnion("command", [
|
|
399
|
+
BrowserAutomationListTabsResultSchema,
|
|
400
|
+
BrowserAutomationNewTabResultSchema,
|
|
401
|
+
BrowserAutomationSnapshotResultSchema,
|
|
402
|
+
BrowserAutomationClickResultSchema,
|
|
403
|
+
BrowserAutomationFillResultSchema,
|
|
404
|
+
BrowserAutomationWaitResultSchema,
|
|
405
|
+
BrowserAutomationTypeResultSchema,
|
|
406
|
+
BrowserAutomationKeypressResultSchema,
|
|
407
|
+
BrowserAutomationNavigateResultSchema,
|
|
408
|
+
BrowserAutomationBackResultSchema,
|
|
409
|
+
BrowserAutomationForwardResultSchema,
|
|
410
|
+
BrowserAutomationReloadResultSchema,
|
|
411
|
+
BrowserAutomationScreenshotResultSchema,
|
|
412
|
+
BrowserAutomationUploadResultSchema,
|
|
413
|
+
BrowserAutomationSelectResultSchema,
|
|
414
|
+
BrowserAutomationHoverResultSchema,
|
|
415
|
+
BrowserAutomationDragResultSchema,
|
|
416
|
+
BrowserAutomationLogsResultSchema,
|
|
417
|
+
BrowserAutomationEvaluateResultSchema,
|
|
418
|
+
BrowserAutomationScrollResultSchema,
|
|
419
|
+
BrowserAutomationResizeResultSchema,
|
|
420
|
+
BrowserAutomationCloseTabResultSchema,
|
|
421
|
+
]);
|
|
422
|
+
export const BrowserAutomationErrorSchema = z.object({
|
|
423
|
+
code: BrowserAutomationErrorCodeSchema,
|
|
424
|
+
message: z.string().min(1),
|
|
425
|
+
retryable: z.boolean().default(false),
|
|
426
|
+
});
|
|
427
|
+
export const BrowserAutomationDialogEventSchema = z.object({
|
|
428
|
+
type: z.enum(["alert", "confirm", "prompt", "beforeunload"]),
|
|
429
|
+
message: z.string(),
|
|
430
|
+
defaultValue: z.string().optional(),
|
|
431
|
+
action: z.enum(["accepted", "dismissed"]),
|
|
432
|
+
promptText: z.string().optional(),
|
|
433
|
+
timestamp: z.number(),
|
|
434
|
+
});
|
|
435
|
+
export const BrowserAutomationExecuteRequestSchema = z
|
|
436
|
+
.object({
|
|
437
|
+
type: z.literal("browser.automation.execute.request"),
|
|
438
|
+
requestId: z.string().min(1),
|
|
439
|
+
agentId: z.string().min(1).optional(),
|
|
440
|
+
cwd: z.string().min(1).optional(),
|
|
441
|
+
workspaceId: z.string().min(1).optional(),
|
|
442
|
+
command: BrowserAutomationCommandSchema,
|
|
443
|
+
})
|
|
444
|
+
.strict();
|
|
445
|
+
export const BrowserAutomationExecuteResponseSchema = z.object({
|
|
446
|
+
type: z.literal("browser.automation.execute.response"),
|
|
447
|
+
payload: z.discriminatedUnion("ok", [
|
|
448
|
+
z.object({
|
|
449
|
+
requestId: z.string().min(1),
|
|
450
|
+
ok: z.literal(true),
|
|
451
|
+
result: BrowserAutomationResultSchema,
|
|
452
|
+
dialogs: z.array(BrowserAutomationDialogEventSchema).optional(),
|
|
453
|
+
}),
|
|
454
|
+
z.object({
|
|
455
|
+
requestId: z.string().min(1),
|
|
456
|
+
ok: z.literal(false),
|
|
457
|
+
error: BrowserAutomationErrorSchema,
|
|
458
|
+
dialogs: z.array(BrowserAutomationDialogEventSchema).optional(),
|
|
459
|
+
}),
|
|
460
|
+
]),
|
|
461
|
+
});
|
|
462
|
+
//# sourceMappingURL=rpc-schemas.js.map
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ChatCreateRequestSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"chat/create">;
|
|
4
|
+
requestId: z.ZodString;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const ChatListRequestSchema: z.ZodObject<{
|
|
9
|
+
type: z.ZodLiteral<"chat/list">;
|
|
10
|
+
requestId: z.ZodString;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export declare const ChatInspectRequestSchema: z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"chat/inspect">;
|
|
14
|
+
requestId: z.ZodString;
|
|
15
|
+
room: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const ChatDeleteRequestSchema: z.ZodObject<{
|
|
18
|
+
type: z.ZodLiteral<"chat/delete">;
|
|
19
|
+
requestId: z.ZodString;
|
|
20
|
+
room: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export declare const ChatPostRequestSchema: z.ZodObject<{
|
|
23
|
+
type: z.ZodLiteral<"chat/post">;
|
|
24
|
+
requestId: z.ZodString;
|
|
25
|
+
room: z.ZodString;
|
|
26
|
+
body: z.ZodString;
|
|
27
|
+
authorAgentId: z.ZodOptional<z.ZodString>;
|
|
28
|
+
replyToMessageId: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export declare const ChatReadRequestSchema: z.ZodObject<{
|
|
31
|
+
type: z.ZodLiteral<"chat/read">;
|
|
32
|
+
requestId: z.ZodString;
|
|
33
|
+
room: z.ZodString;
|
|
34
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
since: z.ZodOptional<z.ZodString>;
|
|
36
|
+
authorAgentId: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export declare const ChatWaitRequestSchema: z.ZodObject<{
|
|
39
|
+
type: z.ZodLiteral<"chat/wait">;
|
|
40
|
+
requestId: z.ZodString;
|
|
41
|
+
room: z.ZodString;
|
|
42
|
+
afterMessageId: z.ZodOptional<z.ZodString>;
|
|
43
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export declare const ChatCreateResponseSchema: z.ZodObject<{
|
|
46
|
+
type: z.ZodLiteral<"chat/create/response">;
|
|
47
|
+
payload: z.ZodObject<{
|
|
48
|
+
requestId: z.ZodString;
|
|
49
|
+
room: z.ZodNullable<z.ZodObject<{
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
purpose: z.ZodNullable<z.ZodString>;
|
|
53
|
+
createdAt: z.ZodString;
|
|
54
|
+
updatedAt: z.ZodString;
|
|
55
|
+
messageCount: z.ZodNumber;
|
|
56
|
+
lastMessageAt: z.ZodNullable<z.ZodString>;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
error: z.ZodNullable<z.ZodString>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
export declare const ChatListResponseSchema: z.ZodObject<{
|
|
62
|
+
type: z.ZodLiteral<"chat/list/response">;
|
|
63
|
+
payload: z.ZodObject<{
|
|
64
|
+
requestId: z.ZodString;
|
|
65
|
+
rooms: z.ZodArray<z.ZodObject<{
|
|
66
|
+
id: z.ZodString;
|
|
67
|
+
name: z.ZodString;
|
|
68
|
+
purpose: z.ZodNullable<z.ZodString>;
|
|
69
|
+
createdAt: z.ZodString;
|
|
70
|
+
updatedAt: z.ZodString;
|
|
71
|
+
messageCount: z.ZodNumber;
|
|
72
|
+
lastMessageAt: z.ZodNullable<z.ZodString>;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
error: z.ZodNullable<z.ZodString>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
|
+
export declare const ChatInspectResponseSchema: z.ZodObject<{
|
|
78
|
+
type: z.ZodLiteral<"chat/inspect/response">;
|
|
79
|
+
payload: z.ZodObject<{
|
|
80
|
+
requestId: z.ZodString;
|
|
81
|
+
room: z.ZodNullable<z.ZodObject<{
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
purpose: z.ZodNullable<z.ZodString>;
|
|
85
|
+
createdAt: z.ZodString;
|
|
86
|
+
updatedAt: z.ZodString;
|
|
87
|
+
messageCount: z.ZodNumber;
|
|
88
|
+
lastMessageAt: z.ZodNullable<z.ZodString>;
|
|
89
|
+
}, z.core.$strip>>;
|
|
90
|
+
error: z.ZodNullable<z.ZodString>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export declare const ChatDeleteResponseSchema: z.ZodObject<{
|
|
94
|
+
type: z.ZodLiteral<"chat/delete/response">;
|
|
95
|
+
payload: z.ZodObject<{
|
|
96
|
+
requestId: z.ZodString;
|
|
97
|
+
room: z.ZodNullable<z.ZodObject<{
|
|
98
|
+
id: z.ZodString;
|
|
99
|
+
name: z.ZodString;
|
|
100
|
+
purpose: z.ZodNullable<z.ZodString>;
|
|
101
|
+
createdAt: z.ZodString;
|
|
102
|
+
updatedAt: z.ZodString;
|
|
103
|
+
messageCount: z.ZodNumber;
|
|
104
|
+
lastMessageAt: z.ZodNullable<z.ZodString>;
|
|
105
|
+
}, z.core.$strip>>;
|
|
106
|
+
error: z.ZodNullable<z.ZodString>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
export declare const ChatPostResponseSchema: z.ZodObject<{
|
|
110
|
+
type: z.ZodLiteral<"chat/post/response">;
|
|
111
|
+
payload: z.ZodObject<{
|
|
112
|
+
requestId: z.ZodString;
|
|
113
|
+
message: z.ZodNullable<z.ZodObject<{
|
|
114
|
+
id: z.ZodString;
|
|
115
|
+
roomId: z.ZodString;
|
|
116
|
+
authorAgentId: z.ZodString;
|
|
117
|
+
body: z.ZodString;
|
|
118
|
+
replyToMessageId: z.ZodNullable<z.ZodString>;
|
|
119
|
+
mentionAgentIds: z.ZodArray<z.ZodString>;
|
|
120
|
+
createdAt: z.ZodString;
|
|
121
|
+
}, z.core.$strip>>;
|
|
122
|
+
error: z.ZodNullable<z.ZodString>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
export declare const ChatReadResponseSchema: z.ZodObject<{
|
|
126
|
+
type: z.ZodLiteral<"chat/read/response">;
|
|
127
|
+
payload: z.ZodObject<{
|
|
128
|
+
requestId: z.ZodString;
|
|
129
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
130
|
+
id: z.ZodString;
|
|
131
|
+
roomId: z.ZodString;
|
|
132
|
+
authorAgentId: z.ZodString;
|
|
133
|
+
body: z.ZodString;
|
|
134
|
+
replyToMessageId: z.ZodNullable<z.ZodString>;
|
|
135
|
+
mentionAgentIds: z.ZodArray<z.ZodString>;
|
|
136
|
+
createdAt: z.ZodString;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
error: z.ZodNullable<z.ZodString>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
export declare const ChatWaitResponseSchema: z.ZodObject<{
|
|
142
|
+
type: z.ZodLiteral<"chat/wait/response">;
|
|
143
|
+
payload: z.ZodObject<{
|
|
144
|
+
requestId: z.ZodString;
|
|
145
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
146
|
+
id: z.ZodString;
|
|
147
|
+
roomId: z.ZodString;
|
|
148
|
+
authorAgentId: z.ZodString;
|
|
149
|
+
body: z.ZodString;
|
|
150
|
+
replyToMessageId: z.ZodNullable<z.ZodString>;
|
|
151
|
+
mentionAgentIds: z.ZodArray<z.ZodString>;
|
|
152
|
+
createdAt: z.ZodString;
|
|
153
|
+
}, z.core.$strip>>;
|
|
154
|
+
timedOut: z.ZodBoolean;
|
|
155
|
+
error: z.ZodNullable<z.ZodString>;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
}, z.core.$strip>;
|
|
158
|
+
//# sourceMappingURL=rpc-schemas.d.ts.map
|