@pi-oxide/extension-js 0.1.0 → 0.2.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/content-script.d.ts +44 -0
- package/extension_js.js +99 -161
- package/extension_js_bg.wasm.d.ts +55 -0
- package/generated.d.ts +208 -0
- package/index.d.ts +92 -0
- package/index.js +5646 -0
- package/logger.d.ts +16 -0
- package/package.json +14 -5
- package/runner.d.ts +16 -0
- package/schemas.d.ts +505 -0
- package/tool-registry.d.ts +58 -0
- package/worker-Dt6N4Sxn.js +3 -0
package/logger.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type LogLevel = "debug" | "info" | "warn" | "error" | "none";
|
|
2
|
+
export declare function setLogLevel(level: LogLevel): void;
|
|
3
|
+
export declare function getLogLevel(): LogLevel;
|
|
4
|
+
export declare function registerWasmSetLogLevel(fn: (level: number) => void): void;
|
|
5
|
+
export declare class Logger {
|
|
6
|
+
private namespace;
|
|
7
|
+
constructor(namespace?: string);
|
|
8
|
+
private log;
|
|
9
|
+
debug(event: string, ...rest: unknown[]): void;
|
|
10
|
+
info(event: string, ...rest: unknown[]): void;
|
|
11
|
+
warn(event: string, ...rest: unknown[]): void;
|
|
12
|
+
error(event: string, ...rest: unknown[]): void;
|
|
13
|
+
child(namespace: string): Logger;
|
|
14
|
+
timer(event: string, metadata?: Record<string, unknown>, level?: LogLevel): (finishMetadata?: Record<string, unknown>) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const logger: Logger;
|
package/package.json
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-oxide/extension-js",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"license": "LicenseRef-PiccoloNotebook-Fair-BYOK-1.0",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"types": "index.d.ts",
|
|
6
8
|
"files": [
|
|
7
|
-
"
|
|
9
|
+
"index.js",
|
|
10
|
+
"index.d.ts",
|
|
11
|
+
"worker-*.js",
|
|
8
12
|
"extension_js.js",
|
|
9
|
-
"extension_js.d.ts"
|
|
13
|
+
"extension_js.d.ts",
|
|
14
|
+
"extension_js_bg.wasm",
|
|
15
|
+
"extension_js_bg.wasm.d.ts",
|
|
16
|
+
"*.d.ts"
|
|
10
17
|
],
|
|
11
|
-
"
|
|
12
|
-
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"zod": "^3.23.8",
|
|
20
|
+
"@pi-oxide/dom-semantic-tree": "^0.1.1"
|
|
21
|
+
},
|
|
13
22
|
"sideEffects": [
|
|
14
23
|
"./snippets/*"
|
|
15
24
|
]
|
package/runner.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AsyncResponse, Command } from './tool-registry.js';
|
|
2
|
+
|
|
3
|
+
export { type Command, setRunnerAbortController } from './tool-registry.js';
|
|
4
|
+
declare global {
|
|
5
|
+
interface Window {
|
|
6
|
+
__hostHandlers?: Record<string, HostHandler>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
type HostHandler<T = unknown, R = unknown> = (params: T) => Promise<R>;
|
|
10
|
+
export declare function registerHostHandler<T, R>(action: string, handler: (params: T) => Promise<R>): void;
|
|
11
|
+
export declare function registerHostHandlers(handlers: Record<string, HostHandler>): void;
|
|
12
|
+
export declare function normalizeParams(action: string, params: unknown): unknown;
|
|
13
|
+
export declare function executeMainThreadCommand(command: Command): Promise<AsyncResponse>;
|
|
14
|
+
export declare function getActiveTabId(): number | null;
|
|
15
|
+
export declare function initExtensionListeners(): void;
|
|
16
|
+
export declare function removeExtensionListeners(): void;
|
package/schemas.d.ts
ADDED
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export declare const StorageGetParamsSchema: z.ZodObject<{
|
|
4
|
+
key: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
key: string;
|
|
7
|
+
}, {
|
|
8
|
+
key: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const StorageSetParamsSchema: z.ZodObject<{
|
|
11
|
+
key: z.ZodString;
|
|
12
|
+
value: z.ZodString;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
key: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}, {
|
|
17
|
+
key: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const StorageDeleteParamsSchema: z.ZodObject<{
|
|
21
|
+
key: z.ZodString;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
key: string;
|
|
24
|
+
}, {
|
|
25
|
+
key: string;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const StorageListParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
28
|
+
export declare const StorageSetManyParamsSchema: z.ZodObject<{
|
|
29
|
+
items: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
items: Record<string, unknown>;
|
|
32
|
+
}, {
|
|
33
|
+
items: Record<string, unknown>;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const StorageGetManyParamsSchema: z.ZodObject<{
|
|
36
|
+
keys: z.ZodArray<z.ZodString, "many">;
|
|
37
|
+
defaults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
keys: string[];
|
|
40
|
+
defaults?: Record<string, unknown> | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
keys: string[];
|
|
43
|
+
defaults?: Record<string, unknown> | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const StorageGetAllParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
46
|
+
export declare const StorageDeleteManyParamsSchema: z.ZodObject<{
|
|
47
|
+
keys: z.ZodArray<z.ZodString, "many">;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
keys: string[];
|
|
50
|
+
}, {
|
|
51
|
+
keys: string[];
|
|
52
|
+
}>;
|
|
53
|
+
export declare const StorageClearParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
54
|
+
export declare const ClipboardReadParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
55
|
+
export declare const ClipboardWriteParamsSchema: z.ZodUnion<[z.ZodTuple<[z.ZodUnion<[z.ZodObject<{
|
|
56
|
+
text: z.ZodString;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
text: string;
|
|
59
|
+
}, {
|
|
60
|
+
text: string;
|
|
61
|
+
}>, z.ZodString]>], null>, z.ZodObject<{
|
|
62
|
+
text: z.ZodOptional<z.ZodString>;
|
|
63
|
+
value: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
value?: string | undefined;
|
|
66
|
+
text?: string | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
value?: string | undefined;
|
|
69
|
+
text?: string | undefined;
|
|
70
|
+
}>]>;
|
|
71
|
+
export declare const FetchParamsSchema: z.ZodObject<{
|
|
72
|
+
url: z.ZodString;
|
|
73
|
+
method: z.ZodDefault<z.ZodString>;
|
|
74
|
+
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
75
|
+
body: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
76
|
+
timeout: z.ZodDefault<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, bigint, number | bigint>>;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
url: string;
|
|
79
|
+
method: string;
|
|
80
|
+
headers: Record<string, string>;
|
|
81
|
+
body: string | null;
|
|
82
|
+
timeout: bigint;
|
|
83
|
+
}, {
|
|
84
|
+
url: string;
|
|
85
|
+
method?: string | undefined;
|
|
86
|
+
headers?: Record<string, string> | undefined;
|
|
87
|
+
body?: string | null | undefined;
|
|
88
|
+
timeout?: number | bigint | undefined;
|
|
89
|
+
}>;
|
|
90
|
+
export declare const SleepParamsSchema: z.ZodObject<{
|
|
91
|
+
duration: z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, bigint, number | bigint>;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
duration: bigint;
|
|
94
|
+
}, {
|
|
95
|
+
duration: number | bigint;
|
|
96
|
+
}>;
|
|
97
|
+
export declare const PageUrlParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
98
|
+
export declare const PageTitleParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
99
|
+
export declare const PageGotoParamsSchema: z.ZodObject<{
|
|
100
|
+
url: z.ZodString;
|
|
101
|
+
}, "strip", z.ZodTypeAny, {
|
|
102
|
+
url: string;
|
|
103
|
+
}, {
|
|
104
|
+
url: string;
|
|
105
|
+
}>;
|
|
106
|
+
export declare const PageBackParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
107
|
+
export declare const PageForwardParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
108
|
+
export declare const PageReloadParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
109
|
+
export declare const PageWaitParamsSchema: z.ZodObject<{
|
|
110
|
+
duration: z.ZodDefault<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, bigint, number | bigint>>;
|
|
111
|
+
}, "strip", z.ZodTypeAny, {
|
|
112
|
+
duration: bigint;
|
|
113
|
+
}, {
|
|
114
|
+
duration?: number | bigint | undefined;
|
|
115
|
+
}>;
|
|
116
|
+
export declare const PageClickParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
117
|
+
export declare const PageFillParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
118
|
+
export declare const PageTypeParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
119
|
+
export declare const PageAppendParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
120
|
+
export declare const PagePressParamsSchema: z.ZodObject<{
|
|
121
|
+
key: z.ZodString;
|
|
122
|
+
}, "strip", z.ZodTypeAny, {
|
|
123
|
+
key: string;
|
|
124
|
+
}, {
|
|
125
|
+
key: string;
|
|
126
|
+
}>;
|
|
127
|
+
export declare const PageSelectParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
128
|
+
export declare const PageCheckParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
129
|
+
export declare const PageHoverParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
130
|
+
export declare const PageUnhoverParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
131
|
+
export declare const PageScrollParamsSchema: z.ZodObject<{
|
|
132
|
+
direction: z.ZodDefault<z.ZodString>;
|
|
133
|
+
amount: z.ZodDefault<z.ZodNumber>;
|
|
134
|
+
}, "strip", z.ZodTypeAny, {
|
|
135
|
+
direction: string;
|
|
136
|
+
amount: number;
|
|
137
|
+
}, {
|
|
138
|
+
direction?: string | undefined;
|
|
139
|
+
amount?: number | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
export declare const PageScrollToParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
142
|
+
export declare const PageDblClickParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
143
|
+
export declare const PageFindParamsSchema: z.ZodObject<{
|
|
144
|
+
selector: z.ZodString;
|
|
145
|
+
}, "strip", z.ZodTypeAny, {
|
|
146
|
+
selector: string;
|
|
147
|
+
}, {
|
|
148
|
+
selector: string;
|
|
149
|
+
}>;
|
|
150
|
+
export declare const PageWaitForParamsSchema: z.ZodObject<{
|
|
151
|
+
selector: z.ZodString;
|
|
152
|
+
timeout: z.ZodDefault<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, bigint, number | bigint>>;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
timeout: bigint;
|
|
155
|
+
selector: string;
|
|
156
|
+
}, {
|
|
157
|
+
selector: string;
|
|
158
|
+
timeout?: number | bigint | undefined;
|
|
159
|
+
}>;
|
|
160
|
+
export declare const PageExtractParamsSchema: z.ZodObject<{
|
|
161
|
+
fields: z.ZodArray<z.ZodString, "many">;
|
|
162
|
+
}, "strip", z.ZodTypeAny, {
|
|
163
|
+
fields: string[];
|
|
164
|
+
}, {
|
|
165
|
+
fields: string[];
|
|
166
|
+
}>;
|
|
167
|
+
export declare const PageCloseParamsSchema: z.ZodUnion<[z.ZodNumber, z.ZodArray<z.ZodUnknown, "many">, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
168
|
+
export declare const PageActiveTabParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
169
|
+
export declare const TabQueryParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
170
|
+
export declare const TabCreateParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
171
|
+
export declare const TabActivateParamsSchema: z.ZodUnion<[z.ZodNumber, z.ZodArray<z.ZodUnknown, "many">, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
172
|
+
export declare const TabCloseParamsSchema: z.ZodUnion<[z.ZodNumber, z.ZodArray<z.ZodUnknown, "many">, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
173
|
+
export declare const TabExecuteScriptParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
174
|
+
export declare const TabClickParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
175
|
+
export declare const TabFillParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
176
|
+
export declare const TabScrollToParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
177
|
+
export declare const TabTypeParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
178
|
+
export declare const TabPressParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
179
|
+
export declare const TabSelectParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
180
|
+
export declare const TabCheckParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
181
|
+
export declare const TabHoverParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
182
|
+
export declare const TabUnhoverParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
183
|
+
export declare const TabScrollParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
184
|
+
export declare const TabDblClickParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
185
|
+
export declare const TabEvaluateParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
186
|
+
export declare const TabBackParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
187
|
+
export declare const TabWaitForLoadParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
188
|
+
export declare const TabFetchParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
189
|
+
export declare const TabSnapshotParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
190
|
+
export declare const TabSnapshotTextParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
191
|
+
export declare const TabSnapshotDataParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
192
|
+
export declare const SidepanelClickParamsSchema: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
193
|
+
export declare const SidepanelDblClickParamsSchema: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
194
|
+
export declare const SidepanelFillParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
195
|
+
export declare const SidepanelTypeParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
196
|
+
export declare const SidepanelPressParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
197
|
+
export declare const SidepanelSelectParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
198
|
+
export declare const SidepanelCheckParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
199
|
+
export declare const SidepanelHoverParamsSchema: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
200
|
+
export declare const SidepanelUnhoverParamsSchema: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
201
|
+
export declare const SidepanelScrollParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
202
|
+
export declare const SidepanelScrollToParamsSchema: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
203
|
+
export declare const SidepanelAppendParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
204
|
+
export declare const SidepanelUrlParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
205
|
+
export declare const SidepanelTitleParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
206
|
+
export declare const SidepanelWaitParamsSchema: z.ZodObject<{
|
|
207
|
+
duration: z.ZodDefault<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, bigint, number | bigint>>;
|
|
208
|
+
}, "strip", z.ZodTypeAny, {
|
|
209
|
+
duration: bigint;
|
|
210
|
+
}, {
|
|
211
|
+
duration?: number | bigint | undefined;
|
|
212
|
+
}>;
|
|
213
|
+
export declare const SidepanelSnapshotParamsSchema: z.ZodObject<{
|
|
214
|
+
interactive_only: z.ZodDefault<z.ZodBoolean>;
|
|
215
|
+
max_nodes: z.ZodDefault<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, bigint, number | bigint>>;
|
|
216
|
+
}, "strip", z.ZodTypeAny, {
|
|
217
|
+
interactive_only: boolean;
|
|
218
|
+
max_nodes: bigint;
|
|
219
|
+
}, {
|
|
220
|
+
interactive_only?: boolean | undefined;
|
|
221
|
+
max_nodes?: number | bigint | undefined;
|
|
222
|
+
}>;
|
|
223
|
+
export declare const SidepanelSnapshotTextParamsSchema: z.ZodObject<{
|
|
224
|
+
interactive_only: z.ZodDefault<z.ZodBoolean>;
|
|
225
|
+
max_nodes: z.ZodDefault<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, bigint, number | bigint>>;
|
|
226
|
+
}, "strip", z.ZodTypeAny, {
|
|
227
|
+
interactive_only: boolean;
|
|
228
|
+
max_nodes: bigint;
|
|
229
|
+
}, {
|
|
230
|
+
interactive_only?: boolean | undefined;
|
|
231
|
+
max_nodes?: number | bigint | undefined;
|
|
232
|
+
}>;
|
|
233
|
+
export declare const SidepanelSnapshotDataParamsSchema: z.ZodObject<{
|
|
234
|
+
interactive_only: z.ZodDefault<z.ZodBoolean>;
|
|
235
|
+
max_nodes: z.ZodDefault<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, bigint, number | bigint>>;
|
|
236
|
+
}, "strip", z.ZodTypeAny, {
|
|
237
|
+
interactive_only: boolean;
|
|
238
|
+
max_nodes: bigint;
|
|
239
|
+
}, {
|
|
240
|
+
interactive_only?: boolean | undefined;
|
|
241
|
+
max_nodes?: number | bigint | undefined;
|
|
242
|
+
}>;
|
|
243
|
+
export declare const DomSnapshotParamsSchema: z.ZodObject<{
|
|
244
|
+
interactive_only: z.ZodDefault<z.ZodBoolean>;
|
|
245
|
+
max_nodes: z.ZodDefault<z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, bigint, number | bigint>>;
|
|
246
|
+
}, "strip", z.ZodTypeAny, {
|
|
247
|
+
interactive_only: boolean;
|
|
248
|
+
max_nodes: bigint;
|
|
249
|
+
}, {
|
|
250
|
+
interactive_only?: boolean | undefined;
|
|
251
|
+
max_nodes?: number | bigint | undefined;
|
|
252
|
+
}>;
|
|
253
|
+
export declare const DomFormatParamsSchema: z.ZodObject<{
|
|
254
|
+
snapshot: z.ZodUnknown;
|
|
255
|
+
format: z.ZodOptional<z.ZodString>;
|
|
256
|
+
}, "strip", z.ZodTypeAny, {
|
|
257
|
+
snapshot?: unknown;
|
|
258
|
+
format?: string | undefined;
|
|
259
|
+
}, {
|
|
260
|
+
snapshot?: unknown;
|
|
261
|
+
format?: string | undefined;
|
|
262
|
+
}>;
|
|
263
|
+
export declare const PageSnapshotParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
264
|
+
export declare const PageSnapshotTextParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
265
|
+
export declare const PageSnapshotDataParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
266
|
+
export declare const FsPathParamsSchema: z.ZodObject<{
|
|
267
|
+
path: z.ZodString;
|
|
268
|
+
}, "strip", z.ZodTypeAny, {
|
|
269
|
+
path: string;
|
|
270
|
+
}, {
|
|
271
|
+
path: string;
|
|
272
|
+
}>;
|
|
273
|
+
export declare const FsCopyParamsSchema: z.ZodObject<{
|
|
274
|
+
from: z.ZodString;
|
|
275
|
+
to: z.ZodString;
|
|
276
|
+
}, "strip", z.ZodTypeAny, {
|
|
277
|
+
from: string;
|
|
278
|
+
to: string;
|
|
279
|
+
}, {
|
|
280
|
+
from: string;
|
|
281
|
+
to: string;
|
|
282
|
+
}>;
|
|
283
|
+
export declare const FsWriteParamsSchema: z.ZodObject<{
|
|
284
|
+
path: z.ZodString;
|
|
285
|
+
data: z.ZodString;
|
|
286
|
+
}, "strip", z.ZodTypeAny, {
|
|
287
|
+
path: string;
|
|
288
|
+
data: string;
|
|
289
|
+
}, {
|
|
290
|
+
path: string;
|
|
291
|
+
data: string;
|
|
292
|
+
}>;
|
|
293
|
+
export declare const FsReadRangeParamsSchema: z.ZodObject<{
|
|
294
|
+
path: z.ZodString;
|
|
295
|
+
offset: z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, bigint, number | bigint>;
|
|
296
|
+
len: z.ZodNumber;
|
|
297
|
+
}, "strip", z.ZodTypeAny, {
|
|
298
|
+
path: string;
|
|
299
|
+
offset: bigint;
|
|
300
|
+
len: number;
|
|
301
|
+
}, {
|
|
302
|
+
path: string;
|
|
303
|
+
offset: number | bigint;
|
|
304
|
+
len: number;
|
|
305
|
+
}>;
|
|
306
|
+
export declare const FsUpdateParamsSchema: z.ZodObject<{
|
|
307
|
+
path: z.ZodString;
|
|
308
|
+
offset: z.ZodEffects<z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, bigint, number | bigint>;
|
|
309
|
+
data: z.ZodString;
|
|
310
|
+
}, "strip", z.ZodTypeAny, {
|
|
311
|
+
path: string;
|
|
312
|
+
data: string;
|
|
313
|
+
offset: bigint;
|
|
314
|
+
}, {
|
|
315
|
+
path: string;
|
|
316
|
+
data: string;
|
|
317
|
+
offset: number | bigint;
|
|
318
|
+
}>;
|
|
319
|
+
export declare const FsHashParamsSchema: z.ZodObject<{
|
|
320
|
+
path: z.ZodString;
|
|
321
|
+
algo: z.ZodDefault<z.ZodString>;
|
|
322
|
+
}, "strip", z.ZodTypeAny, {
|
|
323
|
+
path: string;
|
|
324
|
+
algo: string;
|
|
325
|
+
}, {
|
|
326
|
+
path: string;
|
|
327
|
+
algo?: string | undefined;
|
|
328
|
+
}>;
|
|
329
|
+
export declare const ChromeRuntimeSendMessageParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
330
|
+
export declare const ChromeTabsQueryParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
331
|
+
export declare const ChromeTabsCreateParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
332
|
+
export declare const ChromeTabsUpdateParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
333
|
+
export declare const ChromeTabsRemoveParamsSchema: z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
334
|
+
export declare const ChromeTabsGetParamsSchema: z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
335
|
+
export declare const ChromeTabsReloadParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
336
|
+
export declare const ChromeTabsSendMessageParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
337
|
+
export declare const ChromeAlarmsCreateParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
338
|
+
export declare const ChromeAlarmsClearParamsSchema: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
339
|
+
export declare const ChromeActionSetBadgeTextParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
340
|
+
export declare const ChromeActionSetBadgeBackgroundColorParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
341
|
+
export declare const ChromeActionSetTitleParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
342
|
+
export declare const ChromeActionSetIconParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
343
|
+
export declare const ChromeContextMenusCreateParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
344
|
+
export declare const ChromeContextMenusRemoveParamsSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
345
|
+
export declare const ChromeWindowsGetAllParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
346
|
+
export declare const ChromeWindowsCreateParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
347
|
+
export declare const ChromeWindowsUpdateParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
348
|
+
export declare const ChromeWindowsRemoveParamsSchema: z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
349
|
+
export declare const ChromeSidePanelSetOptionsParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
350
|
+
export declare const ChromeCookiesGetParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
351
|
+
export declare const ChromeCookiesSetParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
352
|
+
export declare const ChromeCookiesRemoveParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
353
|
+
export declare const ChromeCookiesGetAllParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
354
|
+
export declare const ChromeBookmarksSearchParamsSchema: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
355
|
+
export declare const ChromeBookmarksCreateParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
356
|
+
export declare const ChromeBookmarksRemoveParamsSchema: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
357
|
+
export declare const ChromeHistorySearchParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
358
|
+
export declare const ChromeHistoryDeleteUrlParamsSchema: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
359
|
+
export declare const ChromeNotificationsCreateParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
360
|
+
export declare const ChromeNotificationsClearParamsSchema: z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
361
|
+
export declare const ChromeScriptingExecuteScriptParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
362
|
+
export declare const ChromeTabGroupsQueryParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
363
|
+
export declare const ChromeTabGroupsGetParamsSchema: z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
364
|
+
export declare const ChromeTabGroupsUpdateParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
365
|
+
export declare const ChromeTabsGroupParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
366
|
+
export declare const ChromeTabsUngroupParamsSchema: z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
367
|
+
export declare const ChromeSessionsGetRecentlyClosedParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
368
|
+
export declare const ChromeSessionsRestoreParamsSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
369
|
+
export declare const ChromeSessionsGetDevicesParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
370
|
+
export declare const ChromeDownloadsDownloadParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
371
|
+
export declare const ChromeDownloadsSearchParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
372
|
+
export declare const ChromeDownloadsEraseParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
373
|
+
export declare const ChromeDownloadsPauseParamsSchema: z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
374
|
+
export declare const ChromeDownloadsResumeParamsSchema: z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
375
|
+
export declare const ChromeDownloadsCancelParamsSchema: z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
376
|
+
export declare const ChromeDownloadsOpenParamsSchema: z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
377
|
+
export declare const ChromeDownloadsShowParamsSchema: z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
378
|
+
export declare const ChromeSystemCpuGetInfoParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
379
|
+
export declare const ChromeSystemMemoryGetInfoParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
380
|
+
export declare const ChromeSystemStorageGetInfoParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
381
|
+
export declare const HostCallParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
382
|
+
export declare const FetchValueSchema: z.ZodObject<{
|
|
383
|
+
status: z.ZodNumber;
|
|
384
|
+
ok: z.ZodBoolean;
|
|
385
|
+
headers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
386
|
+
body: z.ZodString;
|
|
387
|
+
}, "strip", z.ZodTypeAny, {
|
|
388
|
+
status: number;
|
|
389
|
+
headers: Record<string, string>;
|
|
390
|
+
body: string;
|
|
391
|
+
ok: boolean;
|
|
392
|
+
}, {
|
|
393
|
+
status: number;
|
|
394
|
+
headers: Record<string, string>;
|
|
395
|
+
body: string;
|
|
396
|
+
ok: boolean;
|
|
397
|
+
}>;
|
|
398
|
+
export declare const DomSnapshotValueSchema: z.ZodObject<{
|
|
399
|
+
data: z.ZodUnknown;
|
|
400
|
+
text: z.ZodString;
|
|
401
|
+
}, "strip", z.ZodTypeAny, {
|
|
402
|
+
text: string;
|
|
403
|
+
data?: unknown;
|
|
404
|
+
}, {
|
|
405
|
+
text: string;
|
|
406
|
+
data?: unknown;
|
|
407
|
+
}>;
|
|
408
|
+
export declare const SnapshotNodeSchema: z.ZodObject<{
|
|
409
|
+
refId: z.ZodNumber;
|
|
410
|
+
role: z.ZodString;
|
|
411
|
+
tag: z.ZodString;
|
|
412
|
+
name: z.ZodOptional<z.ZodString>;
|
|
413
|
+
}, "strip", z.ZodTypeAny, {
|
|
414
|
+
refId: number;
|
|
415
|
+
role: string;
|
|
416
|
+
tag: string;
|
|
417
|
+
name?: string | undefined;
|
|
418
|
+
}, {
|
|
419
|
+
refId: number;
|
|
420
|
+
role: string;
|
|
421
|
+
tag: string;
|
|
422
|
+
name?: string | undefined;
|
|
423
|
+
}>;
|
|
424
|
+
export declare const SnapshotResultSchema: z.ZodObject<{
|
|
425
|
+
text: z.ZodString;
|
|
426
|
+
nodes: z.ZodArray<z.ZodObject<{
|
|
427
|
+
refId: z.ZodNumber;
|
|
428
|
+
role: z.ZodString;
|
|
429
|
+
tag: z.ZodString;
|
|
430
|
+
name: z.ZodOptional<z.ZodString>;
|
|
431
|
+
}, "strip", z.ZodTypeAny, {
|
|
432
|
+
refId: number;
|
|
433
|
+
role: string;
|
|
434
|
+
tag: string;
|
|
435
|
+
name?: string | undefined;
|
|
436
|
+
}, {
|
|
437
|
+
refId: number;
|
|
438
|
+
role: string;
|
|
439
|
+
tag: string;
|
|
440
|
+
name?: string | undefined;
|
|
441
|
+
}>, "many">;
|
|
442
|
+
url: z.ZodString;
|
|
443
|
+
title: z.ZodString;
|
|
444
|
+
viewport: z.ZodObject<{
|
|
445
|
+
width: z.ZodNumber;
|
|
446
|
+
height: z.ZodNumber;
|
|
447
|
+
}, "strip", z.ZodTypeAny, {
|
|
448
|
+
width: number;
|
|
449
|
+
height: number;
|
|
450
|
+
}, {
|
|
451
|
+
width: number;
|
|
452
|
+
height: number;
|
|
453
|
+
}>;
|
|
454
|
+
}, "strip", z.ZodTypeAny, {
|
|
455
|
+
text: string;
|
|
456
|
+
url: string;
|
|
457
|
+
nodes: {
|
|
458
|
+
refId: number;
|
|
459
|
+
role: string;
|
|
460
|
+
tag: string;
|
|
461
|
+
name?: string | undefined;
|
|
462
|
+
}[];
|
|
463
|
+
title: string;
|
|
464
|
+
viewport: {
|
|
465
|
+
width: number;
|
|
466
|
+
height: number;
|
|
467
|
+
};
|
|
468
|
+
}, {
|
|
469
|
+
text: string;
|
|
470
|
+
url: string;
|
|
471
|
+
nodes: {
|
|
472
|
+
refId: number;
|
|
473
|
+
role: string;
|
|
474
|
+
tag: string;
|
|
475
|
+
name?: string | undefined;
|
|
476
|
+
}[];
|
|
477
|
+
title: string;
|
|
478
|
+
viewport: {
|
|
479
|
+
width: number;
|
|
480
|
+
height: number;
|
|
481
|
+
};
|
|
482
|
+
}>;
|
|
483
|
+
export declare const ChromeTabSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
484
|
+
export declare const ChromeTabArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
485
|
+
export declare const ChromeWindowSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
486
|
+
export declare const ChromeWindowArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
487
|
+
export declare const ChromeCookieSchema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
488
|
+
export declare const ChromeCookieArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
489
|
+
export declare const ChromeBookmarkArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
490
|
+
export declare const ChromeHistoryArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
491
|
+
export declare const ChromeScriptResultSchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
492
|
+
export declare const ChromeNotificationIdSchema: z.ZodString;
|
|
493
|
+
export declare const ChromeNotificationClearSchema: z.ZodBoolean;
|
|
494
|
+
export declare const ChromeMenuItemIdSchema: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
495
|
+
export declare const ChromeAlarmsClearSchema: z.ZodBoolean;
|
|
496
|
+
export declare const ChromeTabGroupSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
497
|
+
export declare const ChromeTabGroupArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
498
|
+
export declare const ChromeSessionArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
499
|
+
export declare const ChromeDeviceArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
500
|
+
export declare const ChromeDownloadSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
501
|
+
export declare const ChromeDownloadArraySchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
502
|
+
export declare const ChromeDownloadIdSchema: z.ZodNumber;
|
|
503
|
+
export declare const ChromeSystemCpuInfoSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
504
|
+
export declare const ChromeSystemMemoryInfoSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
505
|
+
export declare const ChromeSystemStorageInfoSchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export interface Command {
|
|
4
|
+
action: string;
|
|
5
|
+
params: unknown;
|
|
6
|
+
call_id?: number;
|
|
7
|
+
runId?: string;
|
|
8
|
+
}
|
|
9
|
+
export type AsyncError = {
|
|
10
|
+
message: string;
|
|
11
|
+
code: string;
|
|
12
|
+
category?: string;
|
|
13
|
+
};
|
|
14
|
+
export type AsyncResponse<T = unknown> = {
|
|
15
|
+
ok: true;
|
|
16
|
+
value: T;
|
|
17
|
+
} | {
|
|
18
|
+
ok: false;
|
|
19
|
+
error: AsyncError;
|
|
20
|
+
};
|
|
21
|
+
export interface ToolDocParam {
|
|
22
|
+
name: string;
|
|
23
|
+
type: string;
|
|
24
|
+
required: boolean;
|
|
25
|
+
description: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ToolDoc {
|
|
28
|
+
action: string;
|
|
29
|
+
namespace: string;
|
|
30
|
+
description: string;
|
|
31
|
+
params: ToolDocParam[];
|
|
32
|
+
returns: {
|
|
33
|
+
type: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
errorCode: string;
|
|
37
|
+
errorCategory?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ToolDefinition<P, R> {
|
|
40
|
+
action: string;
|
|
41
|
+
namespace: string;
|
|
42
|
+
description: string;
|
|
43
|
+
params: z.ZodSchema<P>;
|
|
44
|
+
returns: z.ZodSchema<R>;
|
|
45
|
+
handler: (params: P) => Promise<R>;
|
|
46
|
+
paramTypes: ToolDocParam[];
|
|
47
|
+
returnType?: string;
|
|
48
|
+
returnDoc: string;
|
|
49
|
+
errorCode: string;
|
|
50
|
+
errorCategory?: string;
|
|
51
|
+
}
|
|
52
|
+
export declare function setRunnerAbortController(controller: AbortController | null): void;
|
|
53
|
+
export declare function throwIfAborted(): void;
|
|
54
|
+
export declare function registerTool<P, R>(tool: ToolDefinition<P, R>): void;
|
|
55
|
+
export declare function getTool(action: string): ToolDefinition<unknown, unknown> | undefined;
|
|
56
|
+
export declare function clearRegistry(): void;
|
|
57
|
+
export declare function dispatchTool(action: string, params: unknown): Promise<AsyncResponse>;
|
|
58
|
+
export declare function listTools(): ToolDoc[];
|