@opencode/plugin-browser 2.0.31 → 2.1.0
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/dist/connection.d.ts +113 -113
- package/dist/rpc.d.ts +628 -628
- package/dist/tools.d.ts +112 -112
- package/package.json +6 -6
package/dist/connection.d.ts
CHANGED
|
@@ -4,81 +4,80 @@ import { Tool } from "@opencode/schema/tool";
|
|
|
4
4
|
import { Effect } from "effect";
|
|
5
5
|
import { Browser } from "./rpc.js";
|
|
6
6
|
export type Connection = Effect.Success<ReturnType<typeof make>>;
|
|
7
|
-
export declare const make: (ctx: Pick<Context, "
|
|
7
|
+
export declare const make: (ctx: Pick<Context, "agent" | "event" | "location" | "rpc" | "session">) => Effect.Effect<{
|
|
8
8
|
target: (sessionID: string & import("effect/Brand").Brand<"SessionID">, action: {
|
|
9
9
|
readonly type: "tabs.list";
|
|
10
10
|
} | {
|
|
11
|
-
readonly type: "tabs.open";
|
|
12
|
-
readonly url?: string | undefined;
|
|
13
|
-
readonly focus?: boolean | undefined;
|
|
14
|
-
} | {
|
|
15
|
-
readonly type: "tabs.focus";
|
|
16
11
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
12
|
+
readonly type: "back";
|
|
17
13
|
} | {
|
|
18
|
-
readonly type: "tabs.close";
|
|
19
14
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
15
|
+
readonly ref: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
16
|
+
readonly type: "check";
|
|
17
|
+
readonly checked: boolean;
|
|
20
18
|
} | {
|
|
21
|
-
readonly type: "preview";
|
|
22
|
-
readonly path: string;
|
|
23
|
-
} | {
|
|
24
|
-
readonly type: "navigate";
|
|
25
|
-
readonly url: string;
|
|
26
19
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
20
|
+
readonly ref: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
21
|
+
readonly type: "click";
|
|
22
|
+
readonly button?: "left" | "middle" | "right" | undefined;
|
|
23
|
+
readonly count?: 1 | 2 | undefined;
|
|
24
|
+
readonly modifiers?: readonly ("Alt" | "Control" | "Meta" | "Shift")[] | undefined;
|
|
27
25
|
} | {
|
|
28
|
-
readonly type: "back";
|
|
29
26
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
27
|
+
readonly type: "console";
|
|
28
|
+
readonly level?: "debug" | "error" | "info" | "warning" | undefined;
|
|
29
|
+
readonly limit?: number | undefined;
|
|
30
30
|
} | {
|
|
31
|
-
readonly type: "forward";
|
|
32
31
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
32
|
+
readonly fileID: string & import("effect/Brand").Brand<"Browser.FileID">;
|
|
33
|
+
readonly type: "cpu.analyze";
|
|
34
|
+
readonly limit?: number | undefined;
|
|
33
35
|
} | {
|
|
34
|
-
readonly type: "reload";
|
|
35
36
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
37
|
+
readonly type: "cpu.start";
|
|
36
38
|
} | {
|
|
37
|
-
readonly type: "stop";
|
|
38
39
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
40
|
+
readonly type: "cpu.stop";
|
|
39
41
|
} | {
|
|
40
|
-
readonly type: "frames";
|
|
41
42
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
43
|
+
readonly type: "dialog";
|
|
44
|
+
readonly action: "accept" | "dismiss" | "get";
|
|
45
|
+
readonly promptText?: string | undefined;
|
|
42
46
|
} | {
|
|
43
|
-
readonly type: "snapshot";
|
|
44
47
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
45
|
-
readonly
|
|
46
|
-
readonly
|
|
47
|
-
readonly
|
|
48
|
-
readonly frameID?: string | undefined;
|
|
48
|
+
readonly type: "drag";
|
|
49
|
+
readonly from: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
50
|
+
readonly to: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
49
51
|
} | {
|
|
50
|
-
readonly type: "find";
|
|
51
|
-
readonly text: string;
|
|
52
52
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
53
53
|
readonly frameID?: string | undefined;
|
|
54
|
-
} | {
|
|
55
54
|
readonly type: "evaluate";
|
|
56
|
-
readonly script: string;
|
|
57
|
-
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
58
55
|
readonly ref?: (string & import("effect/Brand").Brand<"Browser.Ref">) | undefined;
|
|
59
|
-
readonly
|
|
56
|
+
readonly script: string;
|
|
60
57
|
} | {
|
|
61
|
-
readonly
|
|
58
|
+
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
62
59
|
readonly ref: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
60
|
+
readonly type: "files.drop";
|
|
61
|
+
readonly paths: readonly string[];
|
|
62
|
+
} | {
|
|
63
63
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
64
|
-
readonly
|
|
65
|
-
readonly
|
|
66
|
-
readonly modifiers?: readonly ("Alt" | "Control" | "Meta" | "Shift")[] | undefined;
|
|
64
|
+
readonly fileID: string & import("effect/Brand").Brand<"Browser.FileID">;
|
|
65
|
+
readonly type: "files.get";
|
|
67
66
|
} | {
|
|
68
|
-
readonly type: "hover";
|
|
69
|
-
readonly ref: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
70
67
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
68
|
+
readonly type: "files.list";
|
|
71
69
|
} | {
|
|
72
|
-
readonly type: "drag";
|
|
73
|
-
readonly from: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
74
|
-
readonly to: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
75
70
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
71
|
+
readonly ref: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
72
|
+
readonly type: "files.upload";
|
|
73
|
+
readonly paths: readonly string[];
|
|
76
74
|
} | {
|
|
75
|
+
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
76
|
+
readonly ref: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
77
77
|
readonly type: "fill";
|
|
78
78
|
readonly text: string;
|
|
79
|
-
readonly ref: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
80
|
-
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
81
79
|
} | {
|
|
80
|
+
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
82
81
|
readonly type: "fill_form";
|
|
83
82
|
readonly fields: readonly ({
|
|
84
83
|
readonly ref: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
@@ -93,142 +92,143 @@ export declare const make: (ctx: Pick<Context, "location" | "rpc" | "agent" | "s
|
|
|
93
92
|
readonly type: "check";
|
|
94
93
|
readonly checked: boolean;
|
|
95
94
|
})[];
|
|
96
|
-
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
97
95
|
} | {
|
|
98
|
-
readonly type: "select";
|
|
99
|
-
readonly values: readonly string[];
|
|
100
|
-
readonly ref: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
101
96
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
97
|
+
readonly frameID?: string | undefined;
|
|
98
|
+
readonly type: "find";
|
|
99
|
+
readonly text: string;
|
|
102
100
|
} | {
|
|
103
|
-
readonly type: "check";
|
|
104
|
-
readonly checked: boolean;
|
|
105
|
-
readonly ref: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
106
101
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
102
|
+
readonly type: "forward";
|
|
107
103
|
} | {
|
|
108
|
-
readonly type: "press";
|
|
109
|
-
readonly key: string;
|
|
110
104
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
105
|
+
readonly type: "frames";
|
|
111
106
|
} | {
|
|
112
|
-
readonly type: "scroll";
|
|
113
107
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
114
|
-
readonly
|
|
115
|
-
readonly
|
|
108
|
+
readonly type: "heap.compare";
|
|
109
|
+
readonly before: string & import("effect/Brand").Brand<"Browser.FileID">;
|
|
110
|
+
readonly after: string & import("effect/Brand").Brand<"Browser.FileID">;
|
|
111
|
+
readonly limit?: number | undefined;
|
|
116
112
|
} | {
|
|
117
|
-
readonly type: "wait";
|
|
118
113
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
119
|
-
readonly
|
|
120
|
-
readonly
|
|
121
|
-
readonly
|
|
122
|
-
readonly
|
|
114
|
+
readonly fileID: string & import("effect/Brand").Brand<"Browser.FileID">;
|
|
115
|
+
readonly type: "heap.object";
|
|
116
|
+
readonly id: number;
|
|
117
|
+
readonly limit?: number | undefined;
|
|
123
118
|
} | {
|
|
124
|
-
readonly type: "screenshot";
|
|
125
119
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
126
|
-
readonly
|
|
127
|
-
readonly
|
|
128
|
-
readonly
|
|
129
|
-
readonly
|
|
130
|
-
readonly maxWidth?: number | undefined;
|
|
120
|
+
readonly fileID: string & import("effect/Brand").Brand<"Browser.FileID">;
|
|
121
|
+
readonly type: "heap.query";
|
|
122
|
+
readonly name?: string | undefined;
|
|
123
|
+
readonly limit?: number | undefined;
|
|
131
124
|
} | {
|
|
132
|
-
readonly type: "dialog";
|
|
133
|
-
readonly action: "get" | "accept" | "dismiss";
|
|
134
125
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
135
|
-
readonly
|
|
126
|
+
readonly type: "heap.snapshot";
|
|
136
127
|
} | {
|
|
137
|
-
readonly type: "files.upload";
|
|
138
|
-
readonly paths: readonly string[];
|
|
139
|
-
readonly ref: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
140
128
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
129
|
+
readonly fileID: string & import("effect/Brand").Brand<"Browser.FileID">;
|
|
130
|
+
readonly type: "heap.summary";
|
|
131
|
+
readonly limit?: number | undefined;
|
|
141
132
|
} | {
|
|
142
|
-
readonly type: "files.drop";
|
|
143
|
-
readonly paths: readonly string[];
|
|
144
|
-
readonly ref: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
145
133
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
134
|
+
readonly ref: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
135
|
+
readonly type: "hover";
|
|
146
136
|
} | {
|
|
147
|
-
readonly type: "files.list";
|
|
148
137
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
138
|
+
readonly type: "lighthouse";
|
|
149
139
|
} | {
|
|
150
|
-
readonly type: "files.get";
|
|
151
|
-
readonly fileID: string & import("effect/Brand").Brand<"Browser.FileID">;
|
|
152
140
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
141
|
+
readonly type: "navigate";
|
|
142
|
+
readonly url: string;
|
|
153
143
|
} | {
|
|
154
|
-
readonly type: "console";
|
|
155
144
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
156
|
-
readonly
|
|
157
|
-
readonly
|
|
145
|
+
readonly type: "network.get";
|
|
146
|
+
readonly id: string;
|
|
147
|
+
readonly includeBody?: boolean | undefined;
|
|
148
|
+
readonly maxBodyChars?: number | undefined;
|
|
158
149
|
} | {
|
|
159
|
-
readonly type: "network.list";
|
|
160
150
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
161
|
-
readonly
|
|
162
|
-
readonly resourceType?: "websocket" | "image" | "media" | "document" | "other" | "stylesheet" | "font" | "script" | "xhr" | "fetch" | "eventsource" | "manifest" | undefined;
|
|
151
|
+
readonly type: "network.list";
|
|
163
152
|
readonly urlContains?: string | undefined;
|
|
153
|
+
readonly resourceType?: "document" | "eventsource" | "fetch" | "font" | "image" | "manifest" | "media" | "other" | "script" | "stylesheet" | "websocket" | "xhr" | undefined;
|
|
154
|
+
readonly limit?: number | undefined;
|
|
164
155
|
} | {
|
|
165
|
-
readonly id: string;
|
|
166
|
-
readonly type: "network.get";
|
|
167
156
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
168
|
-
readonly
|
|
169
|
-
readonly
|
|
157
|
+
readonly type: "press";
|
|
158
|
+
readonly key: string;
|
|
159
|
+
} | {
|
|
160
|
+
readonly type: "preview";
|
|
161
|
+
readonly path: string;
|
|
170
162
|
} | {
|
|
171
|
-
readonly type: "trace.start";
|
|
172
163
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
173
|
-
readonly
|
|
164
|
+
readonly type: "reload";
|
|
174
165
|
} | {
|
|
175
|
-
readonly type: "trace.stop";
|
|
176
166
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
167
|
+
readonly type: "screenshot";
|
|
168
|
+
readonly ref?: (string & import("effect/Brand").Brand<"Browser.Ref">) | undefined;
|
|
169
|
+
readonly fullPage?: boolean | undefined;
|
|
170
|
+
readonly format?: "jpeg" | "png" | "webp" | undefined;
|
|
171
|
+
readonly quality?: number | undefined;
|
|
172
|
+
readonly maxWidth?: number | undefined;
|
|
177
173
|
} | {
|
|
178
|
-
readonly type: "trace.analyze";
|
|
179
174
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
180
|
-
readonly
|
|
181
|
-
readonly
|
|
175
|
+
readonly type: "scroll";
|
|
176
|
+
readonly deltaX?: number | undefined;
|
|
177
|
+
readonly deltaY: number;
|
|
182
178
|
} | {
|
|
183
|
-
readonly type: "cpu.start";
|
|
184
179
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
180
|
+
readonly ref: string & import("effect/Brand").Brand<"Browser.Ref">;
|
|
181
|
+
readonly type: "select";
|
|
182
|
+
readonly values: readonly string[];
|
|
185
183
|
} | {
|
|
186
|
-
readonly type: "cpu.stop";
|
|
187
184
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
185
|
+
readonly frameID?: string | undefined;
|
|
186
|
+
readonly type: "snapshot";
|
|
187
|
+
readonly ref?: (string & import("effect/Brand").Brand<"Browser.Ref">) | undefined;
|
|
188
|
+
readonly depth?: number | undefined;
|
|
189
|
+
readonly boxes?: boolean | undefined;
|
|
188
190
|
} | {
|
|
189
|
-
readonly type: "cpu.analyze";
|
|
190
191
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
191
|
-
readonly
|
|
192
|
-
readonly limit?: number | undefined;
|
|
192
|
+
readonly type: "stop";
|
|
193
193
|
} | {
|
|
194
|
-
readonly type: "heap.snapshot";
|
|
195
194
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
195
|
+
readonly type: "tabs.close";
|
|
196
196
|
} | {
|
|
197
|
-
readonly type: "heap.summary";
|
|
198
197
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
199
|
-
readonly
|
|
200
|
-
|
|
198
|
+
readonly type: "tabs.focus";
|
|
199
|
+
} | {
|
|
200
|
+
readonly type: "tabs.open";
|
|
201
|
+
readonly url?: string | undefined;
|
|
202
|
+
readonly focus?: boolean | undefined;
|
|
201
203
|
} | {
|
|
202
|
-
readonly type: "heap.query";
|
|
203
204
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
204
205
|
readonly fileID: string & import("effect/Brand").Brand<"Browser.FileID">;
|
|
205
|
-
readonly
|
|
206
|
+
readonly type: "trace.analyze";
|
|
206
207
|
readonly limit?: number | undefined;
|
|
207
208
|
} | {
|
|
208
|
-
readonly id: number;
|
|
209
|
-
readonly type: "heap.object";
|
|
210
209
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
211
|
-
readonly
|
|
212
|
-
readonly
|
|
210
|
+
readonly type: "trace.start";
|
|
211
|
+
readonly durationMs?: number | undefined;
|
|
213
212
|
} | {
|
|
214
|
-
readonly type: "heap.compare";
|
|
215
|
-
readonly before: string & import("effect/Brand").Brand<"Browser.FileID">;
|
|
216
|
-
readonly after: string & import("effect/Brand").Brand<"Browser.FileID">;
|
|
217
213
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
218
|
-
readonly
|
|
214
|
+
readonly type: "trace.stop";
|
|
219
215
|
} | {
|
|
220
|
-
readonly type: "lighthouse";
|
|
221
216
|
readonly tabID: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
217
|
+
readonly frameID?: string | undefined;
|
|
218
|
+
readonly type: "wait";
|
|
219
|
+
readonly condition: "load" | "text" | "textGone";
|
|
220
|
+
readonly text?: string | undefined;
|
|
221
|
+
readonly timeoutMs?: number | undefined;
|
|
222
222
|
}) => Effect.Effect<{
|
|
223
223
|
tab: {
|
|
224
224
|
readonly id: string & import("effect/Brand").Brand<"Browser.TabID">;
|
|
225
|
-
readonly title: string;
|
|
226
225
|
readonly url: string;
|
|
227
|
-
readonly
|
|
226
|
+
readonly title: string;
|
|
228
227
|
readonly loading: boolean;
|
|
228
|
+
readonly loadError?: string | undefined;
|
|
229
229
|
readonly canGoBack: boolean;
|
|
230
230
|
readonly canGoForward: boolean;
|
|
231
|
-
readonly
|
|
231
|
+
readonly generation: number;
|
|
232
232
|
} | undefined;
|
|
233
233
|
inspect: () => Effect.Effect<{
|
|
234
234
|
readonly resources: readonly string[];
|