@bctrl/sdk 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -0
- package/dist/agents/browser-use/index.d.ts +1 -0
- package/dist/agents/browser-use/index.js +9 -0
- package/dist/agents/browser-use/namespace.d.ts +39 -0
- package/dist/agents/browser-use/namespace.js +93 -0
- package/dist/agents/index.d.ts +2 -0
- package/dist/agents/index.js +17 -0
- package/dist/agents/stagehand/core.d.ts +93 -0
- package/dist/agents/stagehand/core.js +144 -0
- package/dist/agents/stagehand/index.d.ts +3 -0
- package/dist/agents/stagehand/index.js +24 -0
- package/dist/agents/stagehand/namespace.d.ts +51 -0
- package/dist/agents/stagehand/namespace.js +65 -0
- package/dist/ai-credentials/client.d.ts +12 -0
- package/dist/ai-credentials/client.js +70 -0
- package/dist/ai-credentials/index.d.ts +1 -0
- package/dist/ai-credentials/index.js +1 -0
- package/dist/base/event-binding.d.ts +7 -0
- package/dist/base/event-binding.js +23 -0
- package/dist/base/types.d.ts +109 -0
- package/dist/base/types.js +4 -0
- package/dist/bctrl.d.ts +37 -0
- package/dist/bctrl.js +77 -0
- package/dist/browser-extensions/client.d.ts +15 -0
- package/dist/browser-extensions/client.js +72 -0
- package/dist/browser-extensions/index.d.ts +2 -0
- package/dist/browser-extensions/index.js +1 -0
- package/dist/browser-profiles/client.d.ts +11 -0
- package/dist/browser-profiles/client.js +63 -0
- package/dist/browser-profiles/index.d.ts +1 -0
- package/dist/browser-profiles/index.js +1 -0
- package/dist/captcha/index.d.ts +1 -0
- package/dist/captcha/index.js +1 -0
- package/dist/captcha/namespace.d.ts +34 -0
- package/dist/captcha/namespace.js +41 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +1 -0
- package/dist/client/rpc.d.ts +83 -0
- package/dist/client/rpc.js +354 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.js +28 -0
- package/dist/constants/browser.d.ts +2 -0
- package/dist/constants/browser.js +1 -0
- package/dist/contracts/agent-tools.d.ts +45 -0
- package/dist/contracts/agent-tools.js +31 -0
- package/dist/contracts/automation.d.ts +265 -0
- package/dist/contracts/automation.js +109 -0
- package/dist/contracts/browser-management.d.ts +179 -0
- package/dist/contracts/browser-management.js +95 -0
- package/dist/contracts/browser-use.d.ts +136 -0
- package/dist/contracts/browser-use.js +93 -0
- package/dist/contracts/captcha.d.ts +114 -0
- package/dist/contracts/captcha.js +40 -0
- package/dist/contracts/desktop.d.ts +223 -0
- package/dist/contracts/desktop.js +121 -0
- package/dist/contracts/drivers/playwright.d.ts +2008 -0
- package/dist/contracts/drivers/playwright.js +2033 -0
- package/dist/contracts/drivers/puppeteer.d.ts +1221 -0
- package/dist/contracts/drivers/puppeteer.js +941 -0
- package/dist/contracts/drivers/selenium.d.ts +156 -0
- package/dist/contracts/drivers/selenium.js +61 -0
- package/dist/contracts/drivers/stagehand.d.ts +155 -0
- package/dist/contracts/drivers/stagehand.js +7 -0
- package/dist/contracts/extensions.d.ts +13 -0
- package/dist/contracts/extensions.js +9 -0
- package/dist/contracts/index.d.ts +13 -0
- package/dist/contracts/index.js +13 -0
- package/dist/contracts/public-api.d.ts +360 -0
- package/dist/contracts/public-api.js +17 -0
- package/dist/contracts/runtime.d.ts +81 -0
- package/dist/contracts/runtime.js +16 -0
- package/dist/contracts/stagehand.d.ts +253 -0
- package/dist/contracts/stagehand.js +145 -0
- package/dist/contracts/storage.d.ts +51 -0
- package/dist/contracts/storage.js +56 -0
- package/dist/contracts/vault.d.ts +119 -0
- package/dist/contracts/vault.js +112 -0
- package/dist/contracts/version.d.ts +3 -0
- package/dist/contracts/version.js +16 -0
- package/dist/desktop.d.ts +2 -0
- package/dist/desktop.js +3 -0
- package/dist/drivers/desktop/index.d.ts +65 -0
- package/dist/drivers/desktop/index.js +68 -0
- package/dist/drivers/desktop/session.d.ts +313 -0
- package/dist/drivers/desktop/session.js +432 -0
- package/dist/drivers/playwright/event-emitter.d.ts +160 -0
- package/dist/drivers/playwright/event-emitter.js +297 -0
- package/dist/drivers/playwright/generated/api-request-context.d.ts +137 -0
- package/dist/drivers/playwright/generated/api-request-context.js +154 -0
- package/dist/drivers/playwright/generated/api-response.d.ts +119 -0
- package/dist/drivers/playwright/generated/api-response.js +123 -0
- package/dist/drivers/playwright/generated/browser-context.d.ts +284 -0
- package/dist/drivers/playwright/generated/browser-context.js +458 -0
- package/dist/drivers/playwright/generated/browser.d.ts +120 -0
- package/dist/drivers/playwright/generated/browser.js +151 -0
- package/dist/drivers/playwright/generated/clock.d.ts +80 -0
- package/dist/drivers/playwright/generated/clock.js +94 -0
- package/dist/drivers/playwright/generated/console-message.d.ts +94 -0
- package/dist/drivers/playwright/generated/console-message.js +89 -0
- package/dist/drivers/playwright/generated/coverage.d.ts +57 -0
- package/dist/drivers/playwright/generated/coverage.js +66 -0
- package/dist/drivers/playwright/generated/dialog.d.ts +79 -0
- package/dist/drivers/playwright/generated/dialog.js +80 -0
- package/dist/drivers/playwright/generated/element-handle.d.ts +399 -0
- package/dist/drivers/playwright/generated/element-handle.js +501 -0
- package/dist/drivers/playwright/generated/frame-locator.d.ts +34 -0
- package/dist/drivers/playwright/generated/frame-locator.js +63 -0
- package/dist/drivers/playwright/generated/frame.d.ts +557 -0
- package/dist/drivers/playwright/generated/frame.js +634 -0
- package/dist/drivers/playwright/generated/js-handle.d.ts +72 -0
- package/dist/drivers/playwright/generated/js-handle.js +92 -0
- package/dist/drivers/playwright/generated/keyboard.d.ts +103 -0
- package/dist/drivers/playwright/generated/keyboard.js +113 -0
- package/dist/drivers/playwright/generated/locator.d.ts +795 -0
- package/dist/drivers/playwright/generated/locator.js +974 -0
- package/dist/drivers/playwright/generated/mouse.d.ts +97 -0
- package/dist/drivers/playwright/generated/mouse.js +109 -0
- package/dist/drivers/playwright/generated/page.d.ts +762 -0
- package/dist/drivers/playwright/generated/page.js +988 -0
- package/dist/drivers/playwright/generated/touchscreen.d.ts +34 -0
- package/dist/drivers/playwright/generated/touchscreen.js +37 -0
- package/dist/drivers/playwright/generated/tracing.d.ts +78 -0
- package/dist/drivers/playwright/generated/tracing.js +80 -0
- package/dist/drivers/playwright/generated/worker.d.ts +53 -0
- package/dist/drivers/playwright/generated/worker.js +59 -0
- package/dist/drivers/playwright/index.d.ts +19 -0
- package/dist/drivers/playwright/index.js +20 -0
- package/dist/drivers/playwright/remote-base.d.ts +62 -0
- package/dist/drivers/playwright/remote-base.js +86 -0
- package/dist/drivers/playwright/types.d.ts +148 -0
- package/dist/drivers/playwright/types.js +8 -0
- package/dist/drivers/puppeteer/errors.d.ts +50 -0
- package/dist/drivers/puppeteer/errors.js +71 -0
- package/dist/drivers/puppeteer/event-emitter.d.ts +145 -0
- package/dist/drivers/puppeteer/event-emitter.js +259 -0
- package/dist/drivers/puppeteer/generated/accessibility.d.ts +77 -0
- package/dist/drivers/puppeteer/generated/accessibility.js +74 -0
- package/dist/drivers/puppeteer/generated/browser-context.d.ts +116 -0
- package/dist/drivers/puppeteer/generated/browser-context.js +168 -0
- package/dist/drivers/puppeteer/generated/browser.d.ts +169 -0
- package/dist/drivers/puppeteer/generated/browser.js +246 -0
- package/dist/drivers/puppeteer/generated/console-message.d.ts +54 -0
- package/dist/drivers/puppeteer/generated/console-message.js +69 -0
- package/dist/drivers/puppeteer/generated/coverage.d.ts +49 -0
- package/dist/drivers/puppeteer/generated/coverage.js +57 -0
- package/dist/drivers/puppeteer/generated/dialog.d.ts +46 -0
- package/dist/drivers/puppeteer/generated/dialog.js +60 -0
- package/dist/drivers/puppeteer/generated/element-handle.d.ts +261 -0
- package/dist/drivers/puppeteer/generated/element-handle.js +341 -0
- package/dist/drivers/puppeteer/generated/file-chooser.d.ts +34 -0
- package/dist/drivers/puppeteer/generated/file-chooser.js +43 -0
- package/dist/drivers/puppeteer/generated/frame.d.ts +221 -0
- package/dist/drivers/puppeteer/generated/frame.js +302 -0
- package/dist/drivers/puppeteer/generated/http-request.d.ts +195 -0
- package/dist/drivers/puppeteer/generated/http-request.js +243 -0
- package/dist/drivers/puppeteer/generated/http-response.d.ts +142 -0
- package/dist/drivers/puppeteer/generated/http-response.js +169 -0
- package/dist/drivers/puppeteer/generated/js-handle.d.ts +104 -0
- package/dist/drivers/puppeteer/generated/js-handle.js +125 -0
- package/dist/drivers/puppeteer/generated/keyboard.d.ts +79 -0
- package/dist/drivers/puppeteer/generated/keyboard.js +89 -0
- package/dist/drivers/puppeteer/generated/locator.d.ts +141 -0
- package/dist/drivers/puppeteer/generated/locator.js +164 -0
- package/dist/drivers/puppeteer/generated/mouse.d.ts +74 -0
- package/dist/drivers/puppeteer/generated/mouse.js +94 -0
- package/dist/drivers/puppeteer/generated/page.d.ts +604 -0
- package/dist/drivers/puppeteer/generated/page.js +776 -0
- package/dist/drivers/puppeteer/generated/target.d.ts +105 -0
- package/dist/drivers/puppeteer/generated/target.js +123 -0
- package/dist/drivers/puppeteer/generated/touchscreen.d.ts +87 -0
- package/dist/drivers/puppeteer/generated/touchscreen.js +103 -0
- package/dist/drivers/puppeteer/generated/tracing.d.ts +38 -0
- package/dist/drivers/puppeteer/generated/tracing.js +43 -0
- package/dist/drivers/puppeteer/generated/web-worker.d.ts +63 -0
- package/dist/drivers/puppeteer/generated/web-worker.js +73 -0
- package/dist/drivers/puppeteer/index.d.ts +21 -0
- package/dist/drivers/puppeteer/index.js +23 -0
- package/dist/drivers/puppeteer/remote-base.d.ts +57 -0
- package/dist/drivers/puppeteer/remote-base.js +79 -0
- package/dist/drivers/puppeteer/types.d.ts +178 -0
- package/dist/drivers/puppeteer/types.js +8 -0
- package/dist/drivers/selenium/driver.d.ts +28 -0
- package/dist/drivers/selenium/driver.js +169 -0
- package/dist/drivers/selenium/element.d.ts +34 -0
- package/dist/drivers/selenium/element.js +73 -0
- package/dist/drivers/selenium/index.d.ts +3 -0
- package/dist/drivers/selenium/index.js +5 -0
- package/dist/drivers/selenium/types.d.ts +2 -0
- package/dist/drivers/selenium/types.js +12 -0
- package/dist/drivers/stagehand/generated/context.d.ts +127 -0
- package/dist/drivers/stagehand/generated/context.js +153 -0
- package/dist/drivers/stagehand/generated/locator.d.ts +324 -0
- package/dist/drivers/stagehand/generated/locator.js +368 -0
- package/dist/drivers/stagehand/generated/page.d.ts +377 -0
- package/dist/drivers/stagehand/generated/page.js +439 -0
- package/dist/drivers/stagehand/generated/response.d.ts +197 -0
- package/dist/drivers/stagehand/generated/response.js +232 -0
- package/dist/drivers/stagehand/index.d.ts +5 -0
- package/dist/drivers/stagehand/index.js +8 -0
- package/dist/drivers/stagehand/types.d.ts +1 -0
- package/dist/drivers/stagehand/types.js +7 -0
- package/dist/errors.d.ts +47 -0
- package/dist/errors.js +157 -0
- package/dist/extensions/client.d.ts +47 -0
- package/dist/extensions/client.js +154 -0
- package/dist/extensions/index.d.ts +1 -0
- package/dist/extensions/index.js +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +23 -0
- package/dist/internal/dev-client.d.ts +5 -0
- package/dist/internal/dev-client.js +9 -0
- package/dist/internal/rpc-targets.d.ts +17 -0
- package/dist/internal/rpc-targets.js +58 -0
- package/dist/internal/serialization.d.ts +32 -0
- package/dist/internal/serialization.js +42 -0
- package/dist/internal/transport.d.ts +24 -0
- package/dist/internal/transport.js +29 -0
- package/dist/playwright.d.ts +1 -0
- package/dist/playwright.js +2 -0
- package/dist/puppeteer.d.ts +1 -0
- package/dist/puppeteer.js +2 -0
- package/dist/selenium.d.ts +1 -0
- package/dist/selenium.js +2 -0
- package/dist/stagehand.d.ts +1 -0
- package/dist/stagehand.js +2 -0
- package/dist/storage/client.d.ts +151 -0
- package/dist/storage/client.js +329 -0
- package/dist/storage/index.d.ts +2 -0
- package/dist/storage/index.js +4 -0
- package/dist/telemetry.d.ts +18 -0
- package/dist/telemetry.js +93 -0
- package/dist/updates/client.d.ts +8 -0
- package/dist/updates/client.js +128 -0
- package/dist/updates/index.d.ts +1 -0
- package/dist/updates/index.js +1 -0
- package/dist/utils/http.d.ts +39 -0
- package/dist/utils/http.js +88 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/logger.d.ts +27 -0
- package/dist/utils/logger.js +74 -0
- package/dist/utils/schema.d.ts +17 -0
- package/dist/utils/schema.js +31 -0
- package/dist/utils/url.d.ts +5 -0
- package/dist/utils/url.js +7 -0
- package/dist/vault/client.d.ts +43 -0
- package/dist/vault/client.js +123 -0
- package/dist/vault/index.d.ts +1 -0
- package/dist/vault/index.js +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +4 -0
- package/dist/workspaces/browser-runtime.d.ts +251 -0
- package/dist/workspaces/browser-runtime.js +1025 -0
- package/dist/workspaces/client.d.ts +48 -0
- package/dist/workspaces/client.js +222 -0
- package/dist/workspaces/index.d.ts +2 -0
- package/dist/workspaces/index.js +2 -0
- package/dist/workspaces/runtime-event-pump.d.ts +65 -0
- package/dist/workspaces/runtime-event-pump.js +716 -0
- package/package.json +56 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AUTOMATION_ALIAS_REGEX: RegExp;
|
|
3
|
+
export declare const AutomationCallOptionsSchema: z.ZodObject<{
|
|
4
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
logs: z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
off: "off";
|
|
8
|
+
capture: "capture";
|
|
9
|
+
}>>;
|
|
10
|
+
scriptId: z.ZodOptional<z.ZodString>;
|
|
11
|
+
scriptName: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
export declare const AutomationCallRequestSchema: z.ZodObject<{
|
|
14
|
+
call: z.ZodString;
|
|
15
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
16
|
+
args: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
17
|
+
as: z.ZodOptional<z.ZodString>;
|
|
18
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
logs: z.ZodOptional<z.ZodEnum<{
|
|
22
|
+
off: "off";
|
|
23
|
+
capture: "capture";
|
|
24
|
+
}>>;
|
|
25
|
+
scriptId: z.ZodOptional<z.ZodString>;
|
|
26
|
+
scriptName: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strict>>;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
export type AutomationCallRequest = z.infer<typeof AutomationCallRequestSchema>;
|
|
30
|
+
export declare const AutomationBindingTypeSchema: z.ZodEnum<{
|
|
31
|
+
page: "page";
|
|
32
|
+
context: "context";
|
|
33
|
+
handle: "handle";
|
|
34
|
+
subscription: "subscription";
|
|
35
|
+
}>;
|
|
36
|
+
export type AutomationBindingType = z.infer<typeof AutomationBindingTypeSchema>;
|
|
37
|
+
export declare const AutomationResolvedSchema: z.ZodObject<{
|
|
38
|
+
sessionId: z.ZodString;
|
|
39
|
+
call: z.ZodString;
|
|
40
|
+
target: z.ZodString;
|
|
41
|
+
method: z.ZodString;
|
|
42
|
+
ref: z.ZodNullable<z.ZodString>;
|
|
43
|
+
pageId: z.ZodNullable<z.ZodString>;
|
|
44
|
+
contextId: z.ZodNullable<z.ZodString>;
|
|
45
|
+
handleId: z.ZodNullable<z.ZodString>;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
export type AutomationResolved = z.infer<typeof AutomationResolvedSchema>;
|
|
48
|
+
export declare const AutomationBindingSchema: z.ZodObject<{
|
|
49
|
+
alias: z.ZodString;
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
type: z.ZodEnum<{
|
|
52
|
+
page: "page";
|
|
53
|
+
context: "context";
|
|
54
|
+
handle: "handle";
|
|
55
|
+
subscription: "subscription";
|
|
56
|
+
}>;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
export type AutomationBinding = z.infer<typeof AutomationBindingSchema>;
|
|
59
|
+
export declare const AutomationErrorCodeSchema: z.ZodEnum<{
|
|
60
|
+
UNKNOWN_CALL: "UNKNOWN_CALL";
|
|
61
|
+
UNKNOWN_REF: "UNKNOWN_REF";
|
|
62
|
+
INVALID_ARGS: "INVALID_ARGS";
|
|
63
|
+
CAPABILITY_NOT_AVAILABLE: "CAPABILITY_NOT_AVAILABLE";
|
|
64
|
+
TIMEOUT: "TIMEOUT";
|
|
65
|
+
SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
|
|
66
|
+
DRIVER_NOT_CONNECTED: "DRIVER_NOT_CONNECTED";
|
|
67
|
+
SUBSCRIPTION_CURSOR_CONFLICT: "SUBSCRIPTION_CURSOR_CONFLICT";
|
|
68
|
+
SUBSCRIPTION_GONE: "SUBSCRIPTION_GONE";
|
|
69
|
+
}>;
|
|
70
|
+
export type AutomationErrorCode = z.infer<typeof AutomationErrorCodeSchema>;
|
|
71
|
+
export declare const AutomationFixSchema: z.ZodObject<{
|
|
72
|
+
title: z.ZodString;
|
|
73
|
+
command: z.ZodOptional<z.ZodString>;
|
|
74
|
+
example: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, z.core.$strict>;
|
|
76
|
+
export type AutomationFix = z.infer<typeof AutomationFixSchema>;
|
|
77
|
+
export declare const AutomationDiagnosticSchema: z.ZodObject<{
|
|
78
|
+
id: z.ZodString;
|
|
79
|
+
code: z.ZodOptional<z.ZodString>;
|
|
80
|
+
category: z.ZodOptional<z.ZodEnum<{
|
|
81
|
+
"arg-shape": "arg-shape";
|
|
82
|
+
semantic: "semantic";
|
|
83
|
+
runtime: "runtime";
|
|
84
|
+
}>>;
|
|
85
|
+
call: z.ZodOptional<z.ZodString>;
|
|
86
|
+
driver: z.ZodOptional<z.ZodString>;
|
|
87
|
+
closest: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
88
|
+
expected: z.ZodOptional<z.ZodString>;
|
|
89
|
+
received: z.ZodOptional<z.ZodString>;
|
|
90
|
+
docsUrl: z.ZodOptional<z.ZodString>;
|
|
91
|
+
fixes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
92
|
+
title: z.ZodString;
|
|
93
|
+
command: z.ZodOptional<z.ZodString>;
|
|
94
|
+
example: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, z.core.$strict>>>;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
export type AutomationDiagnostic = z.infer<typeof AutomationDiagnosticSchema>;
|
|
98
|
+
export declare const AutomationErrorSchema: z.ZodObject<{
|
|
99
|
+
code: z.ZodEnum<{
|
|
100
|
+
UNKNOWN_CALL: "UNKNOWN_CALL";
|
|
101
|
+
UNKNOWN_REF: "UNKNOWN_REF";
|
|
102
|
+
INVALID_ARGS: "INVALID_ARGS";
|
|
103
|
+
CAPABILITY_NOT_AVAILABLE: "CAPABILITY_NOT_AVAILABLE";
|
|
104
|
+
TIMEOUT: "TIMEOUT";
|
|
105
|
+
SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
|
|
106
|
+
DRIVER_NOT_CONNECTED: "DRIVER_NOT_CONNECTED";
|
|
107
|
+
SUBSCRIPTION_CURSOR_CONFLICT: "SUBSCRIPTION_CURSOR_CONFLICT";
|
|
108
|
+
SUBSCRIPTION_GONE: "SUBSCRIPTION_GONE";
|
|
109
|
+
}>;
|
|
110
|
+
message: z.ZodString;
|
|
111
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
112
|
+
diagnostic: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
id: z.ZodString;
|
|
114
|
+
code: z.ZodOptional<z.ZodString>;
|
|
115
|
+
category: z.ZodOptional<z.ZodEnum<{
|
|
116
|
+
"arg-shape": "arg-shape";
|
|
117
|
+
semantic: "semantic";
|
|
118
|
+
runtime: "runtime";
|
|
119
|
+
}>>;
|
|
120
|
+
call: z.ZodOptional<z.ZodString>;
|
|
121
|
+
driver: z.ZodOptional<z.ZodString>;
|
|
122
|
+
closest: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
123
|
+
expected: z.ZodOptional<z.ZodString>;
|
|
124
|
+
received: z.ZodOptional<z.ZodString>;
|
|
125
|
+
docsUrl: z.ZodOptional<z.ZodString>;
|
|
126
|
+
fixes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
127
|
+
title: z.ZodString;
|
|
128
|
+
command: z.ZodOptional<z.ZodString>;
|
|
129
|
+
example: z.ZodOptional<z.ZodString>;
|
|
130
|
+
}, z.core.$strict>>>;
|
|
131
|
+
}, z.core.$strict>>;
|
|
132
|
+
}, z.core.$strict>;
|
|
133
|
+
export type AutomationError = z.infer<typeof AutomationErrorSchema>;
|
|
134
|
+
export declare const AutomationSuccessResponseSchema: z.ZodObject<{
|
|
135
|
+
ok: z.ZodLiteral<true>;
|
|
136
|
+
result: z.ZodUnknown;
|
|
137
|
+
resolved: z.ZodObject<{
|
|
138
|
+
sessionId: z.ZodString;
|
|
139
|
+
call: z.ZodString;
|
|
140
|
+
target: z.ZodString;
|
|
141
|
+
method: z.ZodString;
|
|
142
|
+
ref: z.ZodNullable<z.ZodString>;
|
|
143
|
+
pageId: z.ZodNullable<z.ZodString>;
|
|
144
|
+
contextId: z.ZodNullable<z.ZodString>;
|
|
145
|
+
handleId: z.ZodNullable<z.ZodString>;
|
|
146
|
+
}, z.core.$strict>;
|
|
147
|
+
binding: z.ZodOptional<z.ZodObject<{
|
|
148
|
+
alias: z.ZodString;
|
|
149
|
+
id: z.ZodString;
|
|
150
|
+
type: z.ZodEnum<{
|
|
151
|
+
page: "page";
|
|
152
|
+
context: "context";
|
|
153
|
+
handle: "handle";
|
|
154
|
+
subscription: "subscription";
|
|
155
|
+
}>;
|
|
156
|
+
}, z.core.$strict>>;
|
|
157
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
158
|
+
deprecatedAlias: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, z.core.$strict>>;
|
|
160
|
+
}, z.core.$strict>;
|
|
161
|
+
export type AutomationSuccessResponse = z.infer<typeof AutomationSuccessResponseSchema>;
|
|
162
|
+
export declare const AutomationErrorResponseSchema: z.ZodObject<{
|
|
163
|
+
ok: z.ZodLiteral<false>;
|
|
164
|
+
error: z.ZodObject<{
|
|
165
|
+
code: z.ZodEnum<{
|
|
166
|
+
UNKNOWN_CALL: "UNKNOWN_CALL";
|
|
167
|
+
UNKNOWN_REF: "UNKNOWN_REF";
|
|
168
|
+
INVALID_ARGS: "INVALID_ARGS";
|
|
169
|
+
CAPABILITY_NOT_AVAILABLE: "CAPABILITY_NOT_AVAILABLE";
|
|
170
|
+
TIMEOUT: "TIMEOUT";
|
|
171
|
+
SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
|
|
172
|
+
DRIVER_NOT_CONNECTED: "DRIVER_NOT_CONNECTED";
|
|
173
|
+
SUBSCRIPTION_CURSOR_CONFLICT: "SUBSCRIPTION_CURSOR_CONFLICT";
|
|
174
|
+
SUBSCRIPTION_GONE: "SUBSCRIPTION_GONE";
|
|
175
|
+
}>;
|
|
176
|
+
message: z.ZodString;
|
|
177
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
178
|
+
diagnostic: z.ZodOptional<z.ZodObject<{
|
|
179
|
+
id: z.ZodString;
|
|
180
|
+
code: z.ZodOptional<z.ZodString>;
|
|
181
|
+
category: z.ZodOptional<z.ZodEnum<{
|
|
182
|
+
"arg-shape": "arg-shape";
|
|
183
|
+
semantic: "semantic";
|
|
184
|
+
runtime: "runtime";
|
|
185
|
+
}>>;
|
|
186
|
+
call: z.ZodOptional<z.ZodString>;
|
|
187
|
+
driver: z.ZodOptional<z.ZodString>;
|
|
188
|
+
closest: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
189
|
+
expected: z.ZodOptional<z.ZodString>;
|
|
190
|
+
received: z.ZodOptional<z.ZodString>;
|
|
191
|
+
docsUrl: z.ZodOptional<z.ZodString>;
|
|
192
|
+
fixes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
193
|
+
title: z.ZodString;
|
|
194
|
+
command: z.ZodOptional<z.ZodString>;
|
|
195
|
+
example: z.ZodOptional<z.ZodString>;
|
|
196
|
+
}, z.core.$strict>>>;
|
|
197
|
+
}, z.core.$strict>>;
|
|
198
|
+
}, z.core.$strict>;
|
|
199
|
+
}, z.core.$strict>;
|
|
200
|
+
export type AutomationErrorResponse = z.infer<typeof AutomationErrorResponseSchema>;
|
|
201
|
+
export declare const AutomationResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
202
|
+
ok: z.ZodLiteral<true>;
|
|
203
|
+
result: z.ZodUnknown;
|
|
204
|
+
resolved: z.ZodObject<{
|
|
205
|
+
sessionId: z.ZodString;
|
|
206
|
+
call: z.ZodString;
|
|
207
|
+
target: z.ZodString;
|
|
208
|
+
method: z.ZodString;
|
|
209
|
+
ref: z.ZodNullable<z.ZodString>;
|
|
210
|
+
pageId: z.ZodNullable<z.ZodString>;
|
|
211
|
+
contextId: z.ZodNullable<z.ZodString>;
|
|
212
|
+
handleId: z.ZodNullable<z.ZodString>;
|
|
213
|
+
}, z.core.$strict>;
|
|
214
|
+
binding: z.ZodOptional<z.ZodObject<{
|
|
215
|
+
alias: z.ZodString;
|
|
216
|
+
id: z.ZodString;
|
|
217
|
+
type: z.ZodEnum<{
|
|
218
|
+
page: "page";
|
|
219
|
+
context: "context";
|
|
220
|
+
handle: "handle";
|
|
221
|
+
subscription: "subscription";
|
|
222
|
+
}>;
|
|
223
|
+
}, z.core.$strict>>;
|
|
224
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
225
|
+
deprecatedAlias: z.ZodOptional<z.ZodString>;
|
|
226
|
+
}, z.core.$strict>>;
|
|
227
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
228
|
+
ok: z.ZodLiteral<false>;
|
|
229
|
+
error: z.ZodObject<{
|
|
230
|
+
code: z.ZodEnum<{
|
|
231
|
+
UNKNOWN_CALL: "UNKNOWN_CALL";
|
|
232
|
+
UNKNOWN_REF: "UNKNOWN_REF";
|
|
233
|
+
INVALID_ARGS: "INVALID_ARGS";
|
|
234
|
+
CAPABILITY_NOT_AVAILABLE: "CAPABILITY_NOT_AVAILABLE";
|
|
235
|
+
TIMEOUT: "TIMEOUT";
|
|
236
|
+
SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
|
|
237
|
+
DRIVER_NOT_CONNECTED: "DRIVER_NOT_CONNECTED";
|
|
238
|
+
SUBSCRIPTION_CURSOR_CONFLICT: "SUBSCRIPTION_CURSOR_CONFLICT";
|
|
239
|
+
SUBSCRIPTION_GONE: "SUBSCRIPTION_GONE";
|
|
240
|
+
}>;
|
|
241
|
+
message: z.ZodString;
|
|
242
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
243
|
+
diagnostic: z.ZodOptional<z.ZodObject<{
|
|
244
|
+
id: z.ZodString;
|
|
245
|
+
code: z.ZodOptional<z.ZodString>;
|
|
246
|
+
category: z.ZodOptional<z.ZodEnum<{
|
|
247
|
+
"arg-shape": "arg-shape";
|
|
248
|
+
semantic: "semantic";
|
|
249
|
+
runtime: "runtime";
|
|
250
|
+
}>>;
|
|
251
|
+
call: z.ZodOptional<z.ZodString>;
|
|
252
|
+
driver: z.ZodOptional<z.ZodString>;
|
|
253
|
+
closest: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
254
|
+
expected: z.ZodOptional<z.ZodString>;
|
|
255
|
+
received: z.ZodOptional<z.ZodString>;
|
|
256
|
+
docsUrl: z.ZodOptional<z.ZodString>;
|
|
257
|
+
fixes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
258
|
+
title: z.ZodString;
|
|
259
|
+
command: z.ZodOptional<z.ZodString>;
|
|
260
|
+
example: z.ZodOptional<z.ZodString>;
|
|
261
|
+
}, z.core.$strict>>>;
|
|
262
|
+
}, z.core.$strict>>;
|
|
263
|
+
}, z.core.$strict>;
|
|
264
|
+
}, z.core.$strict>]>;
|
|
265
|
+
export type AutomationResponse = z.infer<typeof AutomationResponseSchema>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const AUTOMATION_ALIAS_REGEX = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;
|
|
3
|
+
export const AutomationCallOptionsSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
timeoutMs: z.number().int().positive().max(10 * 60 * 1000).optional(),
|
|
6
|
+
dryRun: z.boolean().optional(),
|
|
7
|
+
logs: z.enum(['off', 'capture']).optional(),
|
|
8
|
+
scriptId: z.string().min(1).optional(),
|
|
9
|
+
scriptName: z.string().min(1).optional(),
|
|
10
|
+
})
|
|
11
|
+
.strict();
|
|
12
|
+
export const AutomationCallRequestSchema = z
|
|
13
|
+
.object({
|
|
14
|
+
call: z.string().min(1),
|
|
15
|
+
ref: z.string().min(1).optional(),
|
|
16
|
+
args: z.array(z.unknown()).optional(),
|
|
17
|
+
as: z.string().regex(AUTOMATION_ALIAS_REGEX).optional(),
|
|
18
|
+
options: AutomationCallOptionsSchema.optional(),
|
|
19
|
+
})
|
|
20
|
+
.strict();
|
|
21
|
+
export const AutomationBindingTypeSchema = z.enum([
|
|
22
|
+
'page',
|
|
23
|
+
'context',
|
|
24
|
+
'handle',
|
|
25
|
+
'subscription',
|
|
26
|
+
]);
|
|
27
|
+
export const AutomationResolvedSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
sessionId: z.string(),
|
|
30
|
+
call: z.string(),
|
|
31
|
+
target: z.string(),
|
|
32
|
+
method: z.string(),
|
|
33
|
+
ref: z.string().nullable(),
|
|
34
|
+
pageId: z.string().nullable(),
|
|
35
|
+
contextId: z.string().nullable(),
|
|
36
|
+
handleId: z.string().nullable(),
|
|
37
|
+
})
|
|
38
|
+
.strict();
|
|
39
|
+
export const AutomationBindingSchema = z
|
|
40
|
+
.object({
|
|
41
|
+
alias: z.string().regex(AUTOMATION_ALIAS_REGEX),
|
|
42
|
+
id: z.string(),
|
|
43
|
+
type: AutomationBindingTypeSchema,
|
|
44
|
+
})
|
|
45
|
+
.strict();
|
|
46
|
+
export const AutomationErrorCodeSchema = z.enum([
|
|
47
|
+
'UNKNOWN_CALL',
|
|
48
|
+
'UNKNOWN_REF',
|
|
49
|
+
'INVALID_ARGS',
|
|
50
|
+
'CAPABILITY_NOT_AVAILABLE',
|
|
51
|
+
'TIMEOUT',
|
|
52
|
+
'SESSION_NOT_FOUND',
|
|
53
|
+
'DRIVER_NOT_CONNECTED',
|
|
54
|
+
'SUBSCRIPTION_CURSOR_CONFLICT',
|
|
55
|
+
'SUBSCRIPTION_GONE',
|
|
56
|
+
]);
|
|
57
|
+
export const AutomationFixSchema = z
|
|
58
|
+
.object({
|
|
59
|
+
title: z.string(),
|
|
60
|
+
command: z.string().optional(),
|
|
61
|
+
example: z.string().optional(),
|
|
62
|
+
})
|
|
63
|
+
.strict();
|
|
64
|
+
export const AutomationDiagnosticSchema = z
|
|
65
|
+
.object({
|
|
66
|
+
id: z.string(),
|
|
67
|
+
code: z.string().optional(),
|
|
68
|
+
category: z.enum(['arg-shape', 'semantic', 'runtime']).optional(),
|
|
69
|
+
call: z.string().optional(),
|
|
70
|
+
driver: z.string().optional(),
|
|
71
|
+
closest: z.array(z.string()).max(5).optional(),
|
|
72
|
+
expected: z.string().optional(),
|
|
73
|
+
received: z.string().optional(),
|
|
74
|
+
docsUrl: z.string().url().optional(),
|
|
75
|
+
fixes: z.array(AutomationFixSchema).optional(),
|
|
76
|
+
})
|
|
77
|
+
.strict();
|
|
78
|
+
export const AutomationErrorSchema = z
|
|
79
|
+
.object({
|
|
80
|
+
code: AutomationErrorCodeSchema,
|
|
81
|
+
message: z.string(),
|
|
82
|
+
hint: z.string().optional(),
|
|
83
|
+
diagnostic: AutomationDiagnosticSchema.optional(),
|
|
84
|
+
})
|
|
85
|
+
.strict();
|
|
86
|
+
export const AutomationSuccessResponseSchema = z
|
|
87
|
+
.object({
|
|
88
|
+
ok: z.literal(true),
|
|
89
|
+
result: z.unknown(),
|
|
90
|
+
resolved: AutomationResolvedSchema,
|
|
91
|
+
binding: AutomationBindingSchema.optional(),
|
|
92
|
+
meta: z
|
|
93
|
+
.object({
|
|
94
|
+
deprecatedAlias: z.string().optional(),
|
|
95
|
+
})
|
|
96
|
+
.strict()
|
|
97
|
+
.optional(),
|
|
98
|
+
})
|
|
99
|
+
.strict();
|
|
100
|
+
export const AutomationErrorResponseSchema = z
|
|
101
|
+
.object({
|
|
102
|
+
ok: z.literal(false),
|
|
103
|
+
error: AutomationErrorSchema,
|
|
104
|
+
})
|
|
105
|
+
.strict();
|
|
106
|
+
export const AutomationResponseSchema = z.union([
|
|
107
|
+
AutomationSuccessResponseSchema,
|
|
108
|
+
AutomationErrorResponseSchema,
|
|
109
|
+
]);
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const BrowserProxySchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodEnum<{
|
|
4
|
+
http: "http";
|
|
5
|
+
socks5: "socks5";
|
|
6
|
+
}>;
|
|
7
|
+
host: z.ZodString;
|
|
8
|
+
port: z.ZodNumber;
|
|
9
|
+
username: z.ZodOptional<z.ZodString>;
|
|
10
|
+
password: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export type BrowserProxy = z.infer<typeof BrowserProxySchema>;
|
|
13
|
+
export declare const SessionProxySchema: z.ZodObject<{
|
|
14
|
+
type: z.ZodEnum<{
|
|
15
|
+
http: "http";
|
|
16
|
+
socks5: "socks5";
|
|
17
|
+
}>;
|
|
18
|
+
host: z.ZodString;
|
|
19
|
+
port: z.ZodNumber;
|
|
20
|
+
username: z.ZodOptional<z.ZodString>;
|
|
21
|
+
password: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
export type SessionProxy = BrowserProxy;
|
|
24
|
+
export declare const SessionStartOptionsSchema: z.ZodObject<{
|
|
25
|
+
humanize: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
humanizePersonaId: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
proxy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
28
|
+
type: z.ZodEnum<{
|
|
29
|
+
http: "http";
|
|
30
|
+
socks5: "socks5";
|
|
31
|
+
}>;
|
|
32
|
+
host: z.ZodString;
|
|
33
|
+
port: z.ZodNumber;
|
|
34
|
+
username: z.ZodOptional<z.ZodString>;
|
|
35
|
+
password: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strict>>>;
|
|
37
|
+
storage: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
defaultWorkspace: z.ZodOptional<z.ZodString>;
|
|
39
|
+
allowedWorkspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
40
|
+
}, z.core.$strict>>;
|
|
41
|
+
solveCaptchas: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
+
vault: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
44
|
+
deny: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
45
|
+
allowRawReads: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type SessionStartOptions = z.infer<typeof SessionStartOptionsSchema>;
|
|
49
|
+
export declare const ProfileSchema: z.ZodObject<{
|
|
50
|
+
id: z.ZodUUID;
|
|
51
|
+
name: z.ZodOptional<z.ZodString>;
|
|
52
|
+
createdAt: z.ZodString;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export declare const ProfileCreateOptionsSchema: z.ZodObject<{
|
|
55
|
+
name: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export declare const ProfileListOptionsSchema: z.ZodObject<{
|
|
58
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
name: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
export declare const ProfileListResultSchema: z.ZodObject<{
|
|
62
|
+
profiles: z.ZodArray<z.ZodObject<{
|
|
63
|
+
id: z.ZodUUID;
|
|
64
|
+
name: z.ZodOptional<z.ZodString>;
|
|
65
|
+
createdAt: z.ZodString;
|
|
66
|
+
}, z.core.$strip>>;
|
|
67
|
+
totalCount: z.ZodNumber;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export type Profile = z.infer<typeof ProfileSchema>;
|
|
70
|
+
export type ProfileCreateOptions = z.infer<typeof ProfileCreateOptionsSchema>;
|
|
71
|
+
export type ProfileListOptions = z.infer<typeof ProfileListOptionsSchema>;
|
|
72
|
+
export type ProfileListResult = z.infer<typeof ProfileListResultSchema>;
|
|
73
|
+
export declare const ProfileStartRequestSchema: z.ZodObject<{
|
|
74
|
+
humanize: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
proxy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
76
|
+
type: z.ZodEnum<{
|
|
77
|
+
http: "http";
|
|
78
|
+
socks5: "socks5";
|
|
79
|
+
}>;
|
|
80
|
+
host: z.ZodString;
|
|
81
|
+
port: z.ZodNumber;
|
|
82
|
+
username: z.ZodOptional<z.ZodString>;
|
|
83
|
+
password: z.ZodOptional<z.ZodString>;
|
|
84
|
+
}, z.core.$strict>>>;
|
|
85
|
+
storage: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
defaultWorkspace: z.ZodOptional<z.ZodString>;
|
|
87
|
+
allowedWorkspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
88
|
+
}, z.core.$strict>>;
|
|
89
|
+
}, z.core.$strict>;
|
|
90
|
+
export type ProfileStartRequest = z.infer<typeof ProfileStartRequestSchema>;
|
|
91
|
+
export declare const ProfileConnectRequestSchema: z.ZodObject<{
|
|
92
|
+
driver: z.ZodOptional<z.ZodEnum<{
|
|
93
|
+
selenium: "selenium";
|
|
94
|
+
stagehand: "stagehand";
|
|
95
|
+
puppeteer: "puppeteer";
|
|
96
|
+
playwright: "playwright";
|
|
97
|
+
}>>;
|
|
98
|
+
}, z.core.$strict>;
|
|
99
|
+
export type ProfileConnectRequest = z.infer<typeof ProfileConnectRequestSchema>;
|
|
100
|
+
export declare const ProfileStopResponseSchema: z.ZodObject<{
|
|
101
|
+
profileId: z.ZodString;
|
|
102
|
+
stopped: z.ZodBoolean;
|
|
103
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
export type ProfileStopResponse = z.infer<typeof ProfileStopResponseSchema>;
|
|
106
|
+
export declare const ProfileLifecycleStatusSchema: z.ZodObject<{
|
|
107
|
+
profileId: z.ZodString;
|
|
108
|
+
name: z.ZodString;
|
|
109
|
+
status: z.ZodEnum<{
|
|
110
|
+
stopped: "stopped";
|
|
111
|
+
running: "running";
|
|
112
|
+
}>;
|
|
113
|
+
browserRunning: z.ZodBoolean;
|
|
114
|
+
hostStatus: z.ZodNullable<z.ZodString>;
|
|
115
|
+
currentDriver: z.ZodNullable<z.ZodString>;
|
|
116
|
+
activeSessionId: z.ZodNullable<z.ZodString>;
|
|
117
|
+
defaultContextId: z.ZodNullable<z.ZodString>;
|
|
118
|
+
defaultPageId: z.ZodNullable<z.ZodString>;
|
|
119
|
+
createdAt: z.ZodString;
|
|
120
|
+
updatedAt: z.ZodNullable<z.ZodString>;
|
|
121
|
+
lastUsedAt: z.ZodNullable<z.ZodString>;
|
|
122
|
+
}, z.core.$strict>;
|
|
123
|
+
export type ProfileLifecycleStatus = z.infer<typeof ProfileLifecycleStatusSchema>;
|
|
124
|
+
export declare const SessionStartRequestSchema: z.ZodObject<{
|
|
125
|
+
humanize: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
humanizePersonaId: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
proxy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
128
|
+
type: z.ZodEnum<{
|
|
129
|
+
http: "http";
|
|
130
|
+
socks5: "socks5";
|
|
131
|
+
}>;
|
|
132
|
+
host: z.ZodString;
|
|
133
|
+
port: z.ZodNumber;
|
|
134
|
+
username: z.ZodOptional<z.ZodString>;
|
|
135
|
+
password: z.ZodOptional<z.ZodString>;
|
|
136
|
+
}, z.core.$strict>>>;
|
|
137
|
+
storage: z.ZodOptional<z.ZodObject<{
|
|
138
|
+
defaultWorkspace: z.ZodOptional<z.ZodString>;
|
|
139
|
+
allowedWorkspaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
140
|
+
}, z.core.$strict>>;
|
|
141
|
+
solveCaptchas: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
+
vault: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
144
|
+
deny: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
145
|
+
allowRawReads: z.ZodOptional<z.ZodBoolean>;
|
|
146
|
+
}, z.core.$strip>>;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
export type SessionStartRequest = z.infer<typeof SessionStartRequestSchema>;
|
|
149
|
+
export declare const SessionStartResponseSchema: z.ZodObject<{
|
|
150
|
+
id: z.ZodUUID;
|
|
151
|
+
status: z.ZodEnum<{
|
|
152
|
+
stopped: "stopped";
|
|
153
|
+
active: "active";
|
|
154
|
+
}>;
|
|
155
|
+
storageWorkspace: z.ZodOptional<z.ZodString>;
|
|
156
|
+
}, z.core.$strict>;
|
|
157
|
+
export type SessionStartResponse = z.infer<typeof SessionStartResponseSchema>;
|
|
158
|
+
export declare const SessionConnectRequestSchema: z.ZodObject<{
|
|
159
|
+
driver: z.ZodOptional<z.ZodEnum<{
|
|
160
|
+
selenium: "selenium";
|
|
161
|
+
stagehand: "stagehand";
|
|
162
|
+
puppeteer: "puppeteer";
|
|
163
|
+
playwright: "playwright";
|
|
164
|
+
}>>;
|
|
165
|
+
}, z.core.$strict>;
|
|
166
|
+
export type SessionConnectRequest = z.infer<typeof SessionConnectRequestSchema>;
|
|
167
|
+
export declare const SessionConnectResponseSchema: z.ZodObject<{
|
|
168
|
+
id: z.ZodUUID;
|
|
169
|
+
currentDriver: z.ZodEnum<{
|
|
170
|
+
selenium: "selenium";
|
|
171
|
+
stagehand: "stagehand";
|
|
172
|
+
puppeteer: "puppeteer";
|
|
173
|
+
playwright: "playwright";
|
|
174
|
+
}>;
|
|
175
|
+
defaultContextId: z.ZodOptional<z.ZodUUID>;
|
|
176
|
+
defaultPageId: z.ZodOptional<z.ZodUUID>;
|
|
177
|
+
storageWorkspace: z.ZodOptional<z.ZodString>;
|
|
178
|
+
}, z.core.$strict>;
|
|
179
|
+
export type SessionConnectResponse = z.infer<typeof SessionConnectResponseSchema>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BrowserDriverSchema } from './runtime.js';
|
|
3
|
+
import { SessionStoragePolicySchema } from './storage.js';
|
|
4
|
+
import { VaultSessionPolicySchema } from './vault.js';
|
|
5
|
+
export const BrowserProxySchema = z
|
|
6
|
+
.object({
|
|
7
|
+
type: z.enum(['http', 'socks5']),
|
|
8
|
+
host: z.string().min(1),
|
|
9
|
+
port: z.number().int().positive(),
|
|
10
|
+
username: z.string().min(1).optional(),
|
|
11
|
+
password: z.string().min(1).optional(),
|
|
12
|
+
})
|
|
13
|
+
.strict();
|
|
14
|
+
export const SessionProxySchema = BrowserProxySchema;
|
|
15
|
+
export const SessionStartOptionsSchema = z.object({
|
|
16
|
+
humanize: z.boolean().optional(),
|
|
17
|
+
humanizePersonaId: z.number().int().min(0).max(124).optional(),
|
|
18
|
+
proxy: SessionProxySchema.nullable().optional(),
|
|
19
|
+
storage: SessionStoragePolicySchema.optional(),
|
|
20
|
+
solveCaptchas: z.boolean().optional(),
|
|
21
|
+
vault: VaultSessionPolicySchema.optional(),
|
|
22
|
+
});
|
|
23
|
+
export const ProfileSchema = z.object({
|
|
24
|
+
id: z.uuid(),
|
|
25
|
+
name: z.string().optional(),
|
|
26
|
+
createdAt: z.string(),
|
|
27
|
+
});
|
|
28
|
+
export const ProfileCreateOptionsSchema = z.object({
|
|
29
|
+
name: z.string().optional(),
|
|
30
|
+
});
|
|
31
|
+
export const ProfileListOptionsSchema = z.object({
|
|
32
|
+
page: z.number().int().positive().optional(),
|
|
33
|
+
name: z.string().optional(),
|
|
34
|
+
});
|
|
35
|
+
export const ProfileListResultSchema = z.object({
|
|
36
|
+
profiles: z.array(ProfileSchema),
|
|
37
|
+
totalCount: z.number().int().nonnegative(),
|
|
38
|
+
});
|
|
39
|
+
export const ProfileStartRequestSchema = z
|
|
40
|
+
.object({
|
|
41
|
+
humanize: z.boolean().optional(),
|
|
42
|
+
proxy: BrowserProxySchema.nullable().optional(),
|
|
43
|
+
storage: SessionStoragePolicySchema.optional(),
|
|
44
|
+
})
|
|
45
|
+
.strict();
|
|
46
|
+
export const ProfileConnectRequestSchema = z
|
|
47
|
+
.object({
|
|
48
|
+
driver: BrowserDriverSchema.optional(),
|
|
49
|
+
})
|
|
50
|
+
.strict();
|
|
51
|
+
export const ProfileStopResponseSchema = z
|
|
52
|
+
.object({
|
|
53
|
+
profileId: z.string(),
|
|
54
|
+
stopped: z.boolean(),
|
|
55
|
+
sessionId: z.string().optional(),
|
|
56
|
+
})
|
|
57
|
+
.strict();
|
|
58
|
+
export const ProfileLifecycleStatusSchema = z
|
|
59
|
+
.object({
|
|
60
|
+
profileId: z.string(),
|
|
61
|
+
name: z.string(),
|
|
62
|
+
status: z.enum(['running', 'stopped']),
|
|
63
|
+
browserRunning: z.boolean(),
|
|
64
|
+
hostStatus: z.string().nullable(),
|
|
65
|
+
currentDriver: z.string().nullable(),
|
|
66
|
+
activeSessionId: z.string().nullable(),
|
|
67
|
+
defaultContextId: z.string().nullable(),
|
|
68
|
+
defaultPageId: z.string().nullable(),
|
|
69
|
+
createdAt: z.string(),
|
|
70
|
+
updatedAt: z.string().nullable(),
|
|
71
|
+
lastUsedAt: z.string().nullable(),
|
|
72
|
+
})
|
|
73
|
+
.strict();
|
|
74
|
+
export const SessionStartRequestSchema = SessionStartOptionsSchema;
|
|
75
|
+
export const SessionStartResponseSchema = z
|
|
76
|
+
.object({
|
|
77
|
+
id: z.uuid(),
|
|
78
|
+
status: z.enum(['active', 'stopped']),
|
|
79
|
+
storageWorkspace: z.string().optional(),
|
|
80
|
+
})
|
|
81
|
+
.strict();
|
|
82
|
+
export const SessionConnectRequestSchema = z
|
|
83
|
+
.object({
|
|
84
|
+
driver: BrowserDriverSchema.optional(),
|
|
85
|
+
})
|
|
86
|
+
.strict();
|
|
87
|
+
export const SessionConnectResponseSchema = z
|
|
88
|
+
.object({
|
|
89
|
+
id: z.uuid(),
|
|
90
|
+
currentDriver: BrowserDriverSchema,
|
|
91
|
+
defaultContextId: z.uuid().optional(),
|
|
92
|
+
defaultPageId: z.uuid().optional(),
|
|
93
|
+
storageWorkspace: z.string().optional(),
|
|
94
|
+
})
|
|
95
|
+
.strict();
|