@pi-oxide/extension-js 0.10.2 → 0.10.3

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.
@@ -1,7 +0,0 @@
1
- export {};
2
- declare global {
3
- interface Window {
4
- __jsNotebookSetLogLevel?: (level: string) => void;
5
- __jsNotebookContentScriptInjected?: boolean;
6
- }
7
- }
package/generated.d.ts DELETED
@@ -1,251 +0,0 @@
1
- export type TreeSnapshot = {
2
- version: string;
3
- url: string | null;
4
- title: string | null;
5
- viewport: {
6
- width: number;
7
- height: number;
8
- scrollX: number;
9
- scrollY: number;
10
- } | null;
11
- nodes: SemanticNode[];
12
- outline?: OutlineNode[];
13
- };
14
- export type SemanticNode = {
15
- refId: string;
16
- role: string;
17
- name?: string;
18
- description?: string;
19
- tag: string;
20
- id?: string;
21
- classes?: string[];
22
- value?: string;
23
- placeholder?: string;
24
- href?: string;
25
- states: Record<string, boolean | undefined>;
26
- inputType?: string;
27
- rect?: {
28
- x: number;
29
- y: number;
30
- width: number;
31
- height: number;
32
- top: number;
33
- right: number;
34
- bottom: number;
35
- left: number;
36
- };
37
- inViewport: boolean;
38
- visible: boolean;
39
- path?: string;
40
- };
41
- export type OutlineNode = {
42
- role: string;
43
- name: string;
44
- ref_id: string;
45
- };
46
- export type CommandParams = FetchParams | SleepParams | PageClickParams | PageDblClickParams | PageFillParams | PageTypeParams | PagePressParams | PageSelectParams | PageCheckParams | PageHoverParams | PageScrollParams | PageScrollToParams | PageGotoParams | PageFindParams | PageWaitForParams | PageExtractParams | PageAppendParams | PageWaitParams | StorageGetParams | StorageSetParams | StorageDeleteParams | DomSnapshotParams | DomFormatParams | TabClickParams | TabFillParams | TabEvaluateParams | TabBackParams | TabWaitForLoadParams | TabScrollToParams | TabTypeParams | TabPressParams | TabSelectParams | TabCheckParams | TabHoverParams | TabUnhoverParams | TabScrollParams | TabDblClickParams | FsWriteParams | FsPathParams | FsCopyParams | FsUpdateParams | FsHashParams | FsReadRangeParams;
47
- export type AsyncCommand = {
48
- call_id: number;
49
- action: string;
50
- params: CommandParams;
51
- };
52
- export type CellError = {
53
- kind: "compile";
54
- message: string;
55
- line: number | null;
56
- } | {
57
- kind: "runtime";
58
- message: string;
59
- line: number | null;
60
- } | {
61
- kind: "fuel_exhausted";
62
- } | {
63
- kind: "internal";
64
- message: string;
65
- };
66
- export type CellStatus = "done" | "async_pending";
67
- export type DomSnapshotParams = {
68
- interactive_only: boolean;
69
- max_nodes: bigint;
70
- };
71
- export type DomFormatParams = {
72
- snapshot: TreeSnapshot;
73
- format?: string;
74
- };
75
- export type FetchParams = {
76
- url: string;
77
- method: string;
78
- headers: Record<string, string>;
79
- body: string | null;
80
- timeout: bigint;
81
- };
82
- export type FsCopyParams = {
83
- from: string;
84
- to: string;
85
- };
86
- export type FsHashParams = {
87
- path: string;
88
- algo: string;
89
- };
90
- export type FsPathParams = {
91
- path: string;
92
- };
93
- export type FsReadRangeParams = {
94
- path: string;
95
- offset: bigint;
96
- len: number;
97
- };
98
- export type FsUpdateParams = {
99
- path: string;
100
- offset: bigint;
101
- data: string;
102
- };
103
- export type FsWriteParams = {
104
- path: string;
105
- data: string;
106
- };
107
- export type PageAppendParams = {
108
- refId: string;
109
- label: string;
110
- text: string;
111
- };
112
- export type PageCheckParams = {
113
- refId: string;
114
- checked: boolean;
115
- };
116
- export type PageClickParams = {
117
- refId: string;
118
- label: string;
119
- };
120
- export type PageDblClickParams = {
121
- refId: string;
122
- label: string;
123
- };
124
- export type PageExtractParams = {
125
- fields: string[];
126
- };
127
- export type PageFillParams = {
128
- refId: string;
129
- label: string;
130
- value: string;
131
- };
132
- export type PageFindParams = {
133
- selector: string;
134
- };
135
- export type PageGotoParams = {
136
- url: string;
137
- };
138
- export type PageHoverParams = {
139
- refId: string;
140
- };
141
- export type PagePressParams = {
142
- key: string;
143
- };
144
- export type PageScrollParams = {
145
- direction: string;
146
- amount: number;
147
- };
148
- export type PageScrollToParams = {
149
- refId: string;
150
- };
151
- export type PageSelectParams = {
152
- refId: string;
153
- value: string;
154
- };
155
- export type PageTypeParams = {
156
- refId: string;
157
- label: string;
158
- text: string;
159
- };
160
- export type PageWaitForParams = {
161
- selector: string;
162
- timeout: bigint;
163
- };
164
- export type PageWaitParams = {
165
- duration: bigint;
166
- };
167
- export type RunResult = {
168
- stdout: string[];
169
- stderr: string[];
170
- result: string | null;
171
- error: CellError | null;
172
- commands: CommandParams[];
173
- fuel_exhausted: boolean;
174
- execution_count: number;
175
- status: CellStatus;
176
- pending_commands: AsyncCommand[];
177
- };
178
- export type SleepParams = {
179
- duration: bigint;
180
- };
181
- export type StorageDeleteParams = {
182
- key: string;
183
- };
184
- export type StorageGetParams = {
185
- key: string;
186
- };
187
- export type StorageSetParams = {
188
- key: string;
189
- value: string;
190
- };
191
- export type TabBackParams = {
192
- tabId: bigint;
193
- };
194
- export type TabCheckParams = {
195
- tabId: bigint;
196
- refId: string;
197
- checked: boolean;
198
- };
199
- export type TabClickParams = {
200
- tabId: bigint;
201
- refId: string;
202
- };
203
- export type TabDblClickParams = {
204
- tabId: bigint;
205
- refId: string;
206
- };
207
- export type TabEvaluateParams = {
208
- tabId: bigint;
209
- script: string;
210
- };
211
- export type TabFillParams = {
212
- tabId: bigint;
213
- refId: string;
214
- value: string;
215
- };
216
- export type TabHoverParams = {
217
- tabId: bigint;
218
- refId: string;
219
- };
220
- export type TabPressParams = {
221
- tabId: bigint;
222
- key: string;
223
- };
224
- export type TabScrollParams = {
225
- tabId: bigint;
226
- direction: string;
227
- amount: number;
228
- };
229
- export type TabScrollToParams = {
230
- tabId: bigint;
231
- x: number;
232
- y: number;
233
- refId: string | null;
234
- };
235
- export type TabSelectParams = {
236
- tabId: bigint;
237
- refId: string;
238
- value: string;
239
- };
240
- export type TabTypeParams = {
241
- tabId: bigint;
242
- refId: string;
243
- text: string;
244
- };
245
- export type TabUnhoverParams = {
246
- tabId: bigint;
247
- };
248
- export type TabWaitForLoadParams = {
249
- tabId: bigint;
250
- timeout: bigint;
251
- };
package/logger.d.ts DELETED
@@ -1,16 +0,0 @@
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/runner.d.ts DELETED
@@ -1,17 +0,0 @@
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 isValidMainThreadAction(action: string): boolean;
13
- export declare function normalizeParams(action: string, params: unknown): unknown;
14
- export declare function executeMainThreadCommand(command: Command, relaySignal?: AbortSignal): Promise<AsyncResponse>;
15
- export declare function getActiveTabId(): number | null;
16
- export declare function initExtensionListeners(): void;
17
- export declare function removeExtensionListeners(): void;