camofox-browser 2.1.1 → 2.4.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/CHANGELOG.md +126 -0
- package/README.md +304 -33
- package/dist/src/cli/commands/content.d.ts.map +1 -1
- package/dist/src/cli/commands/content.js +37 -0
- package/dist/src/cli/commands/content.js.map +1 -1
- package/dist/src/cli/commands/core.d.ts.map +1 -1
- package/dist/src/cli/commands/core.js +21 -4
- package/dist/src/cli/commands/core.js.map +1 -1
- package/dist/src/cli/commands/interaction.d.ts.map +1 -1
- package/dist/src/cli/commands/interaction.js +5 -14
- package/dist/src/cli/commands/interaction.js.map +1 -1
- package/dist/src/cli/commands/navigation.d.ts.map +1 -1
- package/dist/src/cli/commands/navigation.js +12 -6
- package/dist/src/cli/commands/navigation.js.map +1 -1
- package/dist/src/cli/commands/server.d.ts.map +1 -1
- package/dist/src/cli/commands/server.js +9 -3
- package/dist/src/cli/commands/server.js.map +1 -1
- package/dist/src/cli/commands/session.d.ts.map +1 -1
- package/dist/src/cli/commands/session.js +23 -5
- package/dist/src/cli/commands/session.js.map +1 -1
- package/dist/src/cli/server/manager.d.ts +1 -0
- package/dist/src/cli/server/manager.d.ts.map +1 -1
- package/dist/src/cli/server/manager.js +7 -12
- package/dist/src/cli/server/manager.js.map +1 -1
- package/dist/src/middleware/lifecycle-activity.d.ts +9 -0
- package/dist/src/middleware/lifecycle-activity.d.ts.map +1 -0
- package/dist/src/middleware/lifecycle-activity.js +21 -0
- package/dist/src/middleware/lifecycle-activity.js.map +1 -0
- package/dist/src/openapi/spec.d.ts +4 -0
- package/dist/src/openapi/spec.d.ts.map +1 -0
- package/dist/src/openapi/spec.js +730 -0
- package/dist/src/openapi/spec.js.map +1 -0
- package/dist/src/routes/core.d.ts.map +1 -1
- package/dist/src/routes/core.js +428 -53
- package/dist/src/routes/core.js.map +1 -1
- package/dist/src/routes/docs.d.ts +3 -0
- package/dist/src/routes/docs.d.ts.map +1 -0
- package/dist/src/routes/docs.js +23 -0
- package/dist/src/routes/docs.js.map +1 -0
- package/dist/src/routes/openclaw.d.ts.map +1 -1
- package/dist/src/routes/openclaw.js +244 -90
- package/dist/src/routes/openclaw.js.map +1 -1
- package/dist/src/server.js +55 -4
- package/dist/src/server.js.map +1 -1
- package/dist/src/services/context-pool.d.ts +19 -3
- package/dist/src/services/context-pool.d.ts.map +1 -1
- package/dist/src/services/context-pool.js +248 -65
- package/dist/src/services/context-pool.js.map +1 -1
- package/dist/src/services/download.d.ts +2 -0
- package/dist/src/services/download.d.ts.map +1 -1
- package/dist/src/services/download.js +110 -80
- package/dist/src/services/download.js.map +1 -1
- package/dist/src/services/lifecycle-controller.d.ts +40 -0
- package/dist/src/services/lifecycle-controller.d.ts.map +1 -0
- package/dist/src/services/lifecycle-controller.js +106 -0
- package/dist/src/services/lifecycle-controller.js.map +1 -0
- package/dist/src/services/resource-extractor.d.ts +1 -0
- package/dist/src/services/resource-extractor.d.ts.map +1 -1
- package/dist/src/services/resource-extractor.js +7 -0
- package/dist/src/services/resource-extractor.js.map +1 -1
- package/dist/src/services/session.d.ts +84 -2
- package/dist/src/services/session.d.ts.map +1 -1
- package/dist/src/services/session.js +349 -47
- package/dist/src/services/session.js.map +1 -1
- package/dist/src/services/structured-extractor.d.ts +39 -0
- package/dist/src/services/structured-extractor.d.ts.map +1 -0
- package/dist/src/services/structured-extractor.js +487 -0
- package/dist/src/services/structured-extractor.js.map +1 -0
- package/dist/src/services/tab.d.ts +30 -3
- package/dist/src/services/tab.d.ts.map +1 -1
- package/dist/src/services/tab.js +872 -124
- package/dist/src/services/tab.js.map +1 -1
- package/dist/src/services/tracing.d.ts +7 -0
- package/dist/src/services/tracing.d.ts.map +1 -1
- package/dist/src/services/tracing.js +162 -19
- package/dist/src/services/tracing.js.map +1 -1
- package/dist/src/services/vnc.d.ts.map +1 -1
- package/dist/src/services/vnc.js +5 -3
- package/dist/src/services/vnc.js.map +1 -1
- package/dist/src/services/youtube.js +1 -1
- package/dist/src/services/youtube.js.map +1 -1
- package/dist/src/types.d.ts +71 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/config.d.ts +79 -3
- package/dist/src/utils/config.d.ts.map +1 -1
- package/dist/src/utils/config.js +145 -3
- package/dist/src/utils/config.js.map +1 -1
- package/dist/src/utils/presets.d.ts.map +1 -1
- package/dist/src/utils/presets.js +3 -1
- package/dist/src/utils/presets.js.map +1 -1
- package/dist/src/utils/proxy-profiles.d.ts +18 -0
- package/dist/src/utils/proxy-profiles.d.ts.map +1 -0
- package/dist/src/utils/proxy-profiles.js +197 -0
- package/dist/src/utils/proxy-profiles.js.map +1 -0
- package/dist/src/utils/sidecar-version.d.ts +12 -0
- package/dist/src/utils/sidecar-version.d.ts.map +1 -0
- package/dist/src/utils/sidecar-version.js +63 -0
- package/dist/src/utils/sidecar-version.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/openclaw.plugin.json +39 -0
- package/package.json +16 -4
- package/plugin.ts +949 -0
|
@@ -0,0 +1,730 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.openapiSpec = void 0;
|
|
7
|
+
exports.buildOpenapiSpec = buildOpenapiSpec;
|
|
8
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
10
|
+
/**
|
|
11
|
+
* OpenAPI 3.1.0 specification for Camofox Browser API
|
|
12
|
+
*
|
|
13
|
+
* This spec documents the current route surface for core and OpenClaw endpoints.
|
|
14
|
+
* It provides a maintainable, realistic subset covering the documented API surface.
|
|
15
|
+
*/
|
|
16
|
+
// Read version from package.json, probing both src and dist paths
|
|
17
|
+
const PKG_VERSION = (() => {
|
|
18
|
+
// Probe plausible paths for package.json (works from both src/openapi/spec.ts and dist/src/openapi/spec.js)
|
|
19
|
+
const possiblePaths = [
|
|
20
|
+
(0, node_path_1.resolve)(__dirname, '../../../package.json'), // From dist/src/openapi/spec.js
|
|
21
|
+
(0, node_path_1.resolve)(__dirname, '../../package.json'), // From src/openapi/spec.ts (via src root)
|
|
22
|
+
];
|
|
23
|
+
for (const pkgPath of possiblePaths) {
|
|
24
|
+
try {
|
|
25
|
+
if (node_fs_1.default.existsSync(pkgPath)) {
|
|
26
|
+
const raw = node_fs_1.default.readFileSync(pkgPath, 'utf8');
|
|
27
|
+
const pkg = JSON.parse(raw);
|
|
28
|
+
if (typeof pkg.version === 'string' && pkg.version.trim().length > 0) {
|
|
29
|
+
return pkg.version;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// Try next path
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
throw new Error('Unable to resolve server version from package.json');
|
|
38
|
+
})();
|
|
39
|
+
function buildOpenapiSpec(serverUrl = '.') {
|
|
40
|
+
return {
|
|
41
|
+
openapi: '3.1.0',
|
|
42
|
+
info: {
|
|
43
|
+
title: 'Camofox Browser API',
|
|
44
|
+
version: PKG_VERSION,
|
|
45
|
+
description: 'Camofox is a fingerprint-resistant browser automation server powered by Camoufox. ' +
|
|
46
|
+
'It provides both a core REST API and OpenClaw-compatible endpoints for browser automation tasks.',
|
|
47
|
+
license: {
|
|
48
|
+
name: 'MIT',
|
|
49
|
+
url: 'https://github.com/redf0x1/camofox-browser/blob/main/LICENSE',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
servers: [
|
|
53
|
+
{
|
|
54
|
+
url: serverUrl,
|
|
55
|
+
description: 'Current server origin',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
paths: {
|
|
59
|
+
'/health': {
|
|
60
|
+
get: {
|
|
61
|
+
summary: 'Health check',
|
|
62
|
+
description: 'Returns server health status and basic statistics',
|
|
63
|
+
tags: ['Core'],
|
|
64
|
+
responses: {
|
|
65
|
+
'200': {
|
|
66
|
+
description: 'Server is healthy',
|
|
67
|
+
content: {
|
|
68
|
+
'application/json': {
|
|
69
|
+
schema: {
|
|
70
|
+
type: 'object',
|
|
71
|
+
properties: {
|
|
72
|
+
ok: { type: 'boolean' },
|
|
73
|
+
running: { type: 'boolean' },
|
|
74
|
+
engine: { type: 'string', example: 'camoufox' },
|
|
75
|
+
version: { type: 'string' },
|
|
76
|
+
browserConnected: { type: 'boolean' },
|
|
77
|
+
poolSize: { type: 'number' },
|
|
78
|
+
activeUserIds: { type: 'array', items: { type: 'string' } },
|
|
79
|
+
profileDirsTotal: { type: 'number' },
|
|
80
|
+
},
|
|
81
|
+
required: ['ok', 'running', 'engine', 'version', 'browserConnected', 'poolSize', 'activeUserIds', 'profileDirsTotal'],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
'500': {
|
|
87
|
+
description: 'Server error',
|
|
88
|
+
content: {
|
|
89
|
+
'application/json': {
|
|
90
|
+
schema: {
|
|
91
|
+
type: 'object',
|
|
92
|
+
properties: {
|
|
93
|
+
ok: { type: 'boolean', enum: [false] },
|
|
94
|
+
error: { type: 'string' },
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
'/presets': {
|
|
104
|
+
get: {
|
|
105
|
+
summary: 'List available presets',
|
|
106
|
+
description: 'Returns all available browser context presets',
|
|
107
|
+
tags: ['Core'],
|
|
108
|
+
responses: {
|
|
109
|
+
'200': {
|
|
110
|
+
description: 'Map of preset names to preset configurations',
|
|
111
|
+
content: {
|
|
112
|
+
'application/json': {
|
|
113
|
+
schema: {
|
|
114
|
+
type: 'object',
|
|
115
|
+
properties: {
|
|
116
|
+
presets: {
|
|
117
|
+
type: 'object',
|
|
118
|
+
additionalProperties: {
|
|
119
|
+
type: 'object',
|
|
120
|
+
properties: {
|
|
121
|
+
locale: { type: 'string' },
|
|
122
|
+
timezoneId: { type: 'string' },
|
|
123
|
+
geolocation: { $ref: '#/components/schemas/GeolocationConfig' },
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
required: ['presets'],
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
'/tabs': {
|
|
137
|
+
get: {
|
|
138
|
+
summary: 'List tabs for a user',
|
|
139
|
+
description: 'Returns all active tabs for the specified user',
|
|
140
|
+
tags: ['Core'],
|
|
141
|
+
parameters: [
|
|
142
|
+
{
|
|
143
|
+
name: 'userId',
|
|
144
|
+
in: 'query',
|
|
145
|
+
schema: { type: 'string' },
|
|
146
|
+
required: false,
|
|
147
|
+
description: 'User ID to filter tabs',
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
responses: {
|
|
151
|
+
'200': {
|
|
152
|
+
description: 'List of tabs',
|
|
153
|
+
content: {
|
|
154
|
+
'application/json': {
|
|
155
|
+
schema: {
|
|
156
|
+
type: 'object',
|
|
157
|
+
properties: {
|
|
158
|
+
running: { type: 'boolean' },
|
|
159
|
+
tabs: {
|
|
160
|
+
type: 'array',
|
|
161
|
+
items: {
|
|
162
|
+
type: 'object',
|
|
163
|
+
properties: {
|
|
164
|
+
targetId: { type: 'string' },
|
|
165
|
+
tabId: { type: 'string' },
|
|
166
|
+
url: { type: 'string' },
|
|
167
|
+
title: { type: 'string' },
|
|
168
|
+
listItemId: { type: 'string' },
|
|
169
|
+
},
|
|
170
|
+
required: ['targetId', 'tabId', 'url', 'title', 'listItemId'],
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
required: ['running', 'tabs'],
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
'500': {
|
|
180
|
+
description: 'Server error',
|
|
181
|
+
content: {
|
|
182
|
+
'application/json': {
|
|
183
|
+
schema: {
|
|
184
|
+
type: 'object',
|
|
185
|
+
properties: {
|
|
186
|
+
error: { type: 'string' },
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
'/tabs/{tabId}/navigate': {
|
|
196
|
+
post: {
|
|
197
|
+
summary: 'Navigate tab to URL',
|
|
198
|
+
description: 'Navigate the specified tab to a URL, macro, or search query. Either url or macro is required.',
|
|
199
|
+
tags: ['Core'],
|
|
200
|
+
security: [{ bearerAuth: [] }],
|
|
201
|
+
parameters: [
|
|
202
|
+
{
|
|
203
|
+
name: 'tabId',
|
|
204
|
+
in: 'path',
|
|
205
|
+
required: true,
|
|
206
|
+
schema: { type: 'string' },
|
|
207
|
+
description: 'Tab ID',
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
requestBody: {
|
|
211
|
+
required: true,
|
|
212
|
+
content: {
|
|
213
|
+
'application/json': {
|
|
214
|
+
schema: {
|
|
215
|
+
type: 'object',
|
|
216
|
+
properties: {
|
|
217
|
+
userId: { type: 'string' },
|
|
218
|
+
url: { type: 'string' },
|
|
219
|
+
macro: { type: 'string' },
|
|
220
|
+
query: { type: 'string' },
|
|
221
|
+
},
|
|
222
|
+
required: ['userId'],
|
|
223
|
+
anyOf: [
|
|
224
|
+
{ required: ['url'] },
|
|
225
|
+
{ required: ['macro'] },
|
|
226
|
+
],
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
responses: {
|
|
232
|
+
'200': {
|
|
233
|
+
description: 'Navigation successful',
|
|
234
|
+
content: {
|
|
235
|
+
'application/json': {
|
|
236
|
+
schema: {
|
|
237
|
+
type: 'object',
|
|
238
|
+
properties: {
|
|
239
|
+
ok: { type: 'boolean' },
|
|
240
|
+
url: { type: 'string' },
|
|
241
|
+
},
|
|
242
|
+
required: ['ok', 'url'],
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
'403': {
|
|
248
|
+
description: 'Forbidden - Invalid or missing API key',
|
|
249
|
+
content: {
|
|
250
|
+
'application/json': {
|
|
251
|
+
schema: {
|
|
252
|
+
type: 'object',
|
|
253
|
+
properties: {
|
|
254
|
+
error: { type: 'string', enum: ['Forbidden'] },
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
'/tabs/{tabId}/snapshot': {
|
|
264
|
+
get: {
|
|
265
|
+
summary: 'Get page snapshot',
|
|
266
|
+
description: 'Returns a text snapshot of the current page',
|
|
267
|
+
tags: ['Core'],
|
|
268
|
+
parameters: [
|
|
269
|
+
{
|
|
270
|
+
name: 'tabId',
|
|
271
|
+
in: 'path',
|
|
272
|
+
required: true,
|
|
273
|
+
schema: { type: 'string' },
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
name: 'userId',
|
|
277
|
+
in: 'query',
|
|
278
|
+
required: true,
|
|
279
|
+
schema: { type: 'string' },
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: 'offset',
|
|
283
|
+
in: 'query',
|
|
284
|
+
schema: { type: 'string' },
|
|
285
|
+
},
|
|
286
|
+
],
|
|
287
|
+
responses: {
|
|
288
|
+
'200': {
|
|
289
|
+
description: 'Snapshot retrieved',
|
|
290
|
+
content: {
|
|
291
|
+
'application/json': {
|
|
292
|
+
schema: {
|
|
293
|
+
type: 'object',
|
|
294
|
+
properties: {
|
|
295
|
+
url: { type: 'string' },
|
|
296
|
+
snapshot: { type: 'string' },
|
|
297
|
+
refsCount: { type: 'number' },
|
|
298
|
+
offset: { type: 'number' },
|
|
299
|
+
truncated: { type: 'boolean' },
|
|
300
|
+
totalChars: { type: 'number' },
|
|
301
|
+
hasMore: { type: 'boolean' },
|
|
302
|
+
nextOffset: {
|
|
303
|
+
anyOf: [{ type: 'number' }, { enum: [null] }],
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
required: ['url', 'snapshot', 'refsCount', 'offset', 'truncated', 'totalChars', 'hasMore', 'nextOffset'],
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
'/tabs/{tabId}/click': {
|
|
315
|
+
post: {
|
|
316
|
+
summary: 'Click element',
|
|
317
|
+
description: 'Click an element by ref or selector. Either ref or selector is required.',
|
|
318
|
+
tags: ['Core'],
|
|
319
|
+
security: [{ bearerAuth: [] }],
|
|
320
|
+
parameters: [
|
|
321
|
+
{
|
|
322
|
+
name: 'tabId',
|
|
323
|
+
in: 'path',
|
|
324
|
+
required: true,
|
|
325
|
+
schema: { type: 'string' },
|
|
326
|
+
},
|
|
327
|
+
],
|
|
328
|
+
requestBody: {
|
|
329
|
+
required: true,
|
|
330
|
+
content: {
|
|
331
|
+
'application/json': {
|
|
332
|
+
schema: {
|
|
333
|
+
type: 'object',
|
|
334
|
+
properties: {
|
|
335
|
+
userId: { type: 'string' },
|
|
336
|
+
ref: { type: 'string' },
|
|
337
|
+
selector: { type: 'string' },
|
|
338
|
+
},
|
|
339
|
+
required: ['userId'],
|
|
340
|
+
anyOf: [
|
|
341
|
+
{ required: ['ref'] },
|
|
342
|
+
{ required: ['selector'] },
|
|
343
|
+
],
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
responses: {
|
|
349
|
+
'200': {
|
|
350
|
+
description: 'Click successful',
|
|
351
|
+
content: {
|
|
352
|
+
'application/json': {
|
|
353
|
+
schema: {
|
|
354
|
+
type: 'object',
|
|
355
|
+
properties: {
|
|
356
|
+
ok: { type: 'boolean' },
|
|
357
|
+
url: { type: 'string' },
|
|
358
|
+
downloads: {
|
|
359
|
+
type: 'array',
|
|
360
|
+
items: {
|
|
361
|
+
type: 'object',
|
|
362
|
+
properties: {
|
|
363
|
+
id: { type: 'string' },
|
|
364
|
+
filename: { type: 'string' },
|
|
365
|
+
status: { type: 'string' },
|
|
366
|
+
size: { type: 'number' },
|
|
367
|
+
},
|
|
368
|
+
required: ['id', 'filename', 'status', 'size'],
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
required: ['ok', 'url'],
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
'403': {
|
|
378
|
+
description: 'Forbidden - Invalid or missing API key',
|
|
379
|
+
content: {
|
|
380
|
+
'application/json': {
|
|
381
|
+
schema: {
|
|
382
|
+
type: 'object',
|
|
383
|
+
properties: {
|
|
384
|
+
error: { type: 'string', enum: ['Forbidden'] },
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
'/tabs/open': {
|
|
394
|
+
post: {
|
|
395
|
+
summary: 'Open new tab (OpenClaw)',
|
|
396
|
+
description: 'Create a new browser tab with optional URL and configuration',
|
|
397
|
+
tags: ['OpenClaw'],
|
|
398
|
+
security: [{ bearerAuth: [] }],
|
|
399
|
+
requestBody: {
|
|
400
|
+
required: true,
|
|
401
|
+
content: {
|
|
402
|
+
'application/json': {
|
|
403
|
+
schema: {
|
|
404
|
+
type: 'object',
|
|
405
|
+
properties: {
|
|
406
|
+
url: { type: 'string' },
|
|
407
|
+
userId: { type: 'string' },
|
|
408
|
+
listItemId: { type: 'string' },
|
|
409
|
+
proxyProfile: { type: 'string' },
|
|
410
|
+
proxy: {
|
|
411
|
+
type: 'object',
|
|
412
|
+
properties: {
|
|
413
|
+
host: { type: 'string' },
|
|
414
|
+
port: { type: 'string' },
|
|
415
|
+
username: { type: 'string' },
|
|
416
|
+
password: { type: 'string' },
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
geoMode: { type: 'string', enum: ['explicit-wins', 'proxy-locked'] },
|
|
420
|
+
},
|
|
421
|
+
required: ['url', 'userId'],
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
responses: {
|
|
427
|
+
'200': {
|
|
428
|
+
description: 'Tab created and navigated',
|
|
429
|
+
content: {
|
|
430
|
+
'application/json': {
|
|
431
|
+
schema: {
|
|
432
|
+
type: 'object',
|
|
433
|
+
properties: {
|
|
434
|
+
ok: { type: 'boolean' },
|
|
435
|
+
targetId: { type: 'string' },
|
|
436
|
+
tabId: { type: 'string' },
|
|
437
|
+
url: { type: 'string' },
|
|
438
|
+
title: { type: 'string' },
|
|
439
|
+
},
|
|
440
|
+
required: ['ok', 'targetId', 'tabId', 'url', 'title'],
|
|
441
|
+
},
|
|
442
|
+
},
|
|
443
|
+
},
|
|
444
|
+
},
|
|
445
|
+
'400': {
|
|
446
|
+
description: 'Bad request - Missing required fields or invalid URL',
|
|
447
|
+
content: {
|
|
448
|
+
'application/json': {
|
|
449
|
+
schema: {
|
|
450
|
+
type: 'object',
|
|
451
|
+
properties: {
|
|
452
|
+
error: { type: 'string' },
|
|
453
|
+
},
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
},
|
|
457
|
+
},
|
|
458
|
+
'403': {
|
|
459
|
+
description: 'Forbidden - Invalid or missing API key',
|
|
460
|
+
content: {
|
|
461
|
+
'application/json': {
|
|
462
|
+
schema: {
|
|
463
|
+
type: 'object',
|
|
464
|
+
properties: {
|
|
465
|
+
error: { type: 'string', enum: ['Forbidden'] },
|
|
466
|
+
},
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
},
|
|
470
|
+
},
|
|
471
|
+
'409': {
|
|
472
|
+
description: 'Conflict - No canonical profile or session profile conflict',
|
|
473
|
+
content: {
|
|
474
|
+
'application/json': {
|
|
475
|
+
schema: {
|
|
476
|
+
type: 'object',
|
|
477
|
+
properties: {
|
|
478
|
+
error: { type: 'string' },
|
|
479
|
+
message: { type: 'string' },
|
|
480
|
+
},
|
|
481
|
+
},
|
|
482
|
+
},
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
'429': {
|
|
486
|
+
description: 'Too many tabs - Maximum tabs per session reached',
|
|
487
|
+
content: {
|
|
488
|
+
'application/json': {
|
|
489
|
+
schema: {
|
|
490
|
+
type: 'object',
|
|
491
|
+
properties: {
|
|
492
|
+
error: { type: 'string', enum: ['Maximum tabs per session reached'] },
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
},
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
},
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
'/navigate': {
|
|
502
|
+
post: {
|
|
503
|
+
summary: 'Navigate (OpenClaw)',
|
|
504
|
+
description: 'Navigate to a URL, macro, or search query. Either url or macro is required.',
|
|
505
|
+
tags: ['OpenClaw'],
|
|
506
|
+
security: [{ bearerAuth: [] }],
|
|
507
|
+
requestBody: {
|
|
508
|
+
required: true,
|
|
509
|
+
content: {
|
|
510
|
+
'application/json': {
|
|
511
|
+
schema: {
|
|
512
|
+
type: 'object',
|
|
513
|
+
properties: {
|
|
514
|
+
targetId: { type: 'string' },
|
|
515
|
+
url: { type: 'string' },
|
|
516
|
+
macro: { type: 'string' },
|
|
517
|
+
query: { type: 'string' },
|
|
518
|
+
userId: { type: 'string' },
|
|
519
|
+
},
|
|
520
|
+
required: ['targetId', 'userId'],
|
|
521
|
+
anyOf: [
|
|
522
|
+
{ required: ['url'] },
|
|
523
|
+
{ required: ['macro'] },
|
|
524
|
+
],
|
|
525
|
+
},
|
|
526
|
+
},
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
responses: {
|
|
530
|
+
'200': {
|
|
531
|
+
description: 'Navigation successful',
|
|
532
|
+
content: {
|
|
533
|
+
'application/json': {
|
|
534
|
+
schema: {
|
|
535
|
+
type: 'object',
|
|
536
|
+
properties: {
|
|
537
|
+
ok: { type: 'boolean' },
|
|
538
|
+
targetId: { type: 'string' },
|
|
539
|
+
url: { type: 'string' },
|
|
540
|
+
},
|
|
541
|
+
required: ['ok', 'targetId', 'url'],
|
|
542
|
+
},
|
|
543
|
+
},
|
|
544
|
+
},
|
|
545
|
+
},
|
|
546
|
+
'403': {
|
|
547
|
+
description: 'Forbidden - Invalid or missing API key',
|
|
548
|
+
content: {
|
|
549
|
+
'application/json': {
|
|
550
|
+
schema: {
|
|
551
|
+
type: 'object',
|
|
552
|
+
properties: {
|
|
553
|
+
error: { type: 'string', enum: ['Forbidden'] },
|
|
554
|
+
},
|
|
555
|
+
},
|
|
556
|
+
},
|
|
557
|
+
},
|
|
558
|
+
},
|
|
559
|
+
},
|
|
560
|
+
},
|
|
561
|
+
},
|
|
562
|
+
'/stop': {
|
|
563
|
+
post: {
|
|
564
|
+
summary: 'Stop server (OpenClaw)',
|
|
565
|
+
description: 'Stop the browser server and close all sessions',
|
|
566
|
+
tags: ['OpenClaw'],
|
|
567
|
+
security: [{ adminKey: [] }],
|
|
568
|
+
responses: {
|
|
569
|
+
'200': {
|
|
570
|
+
description: 'Server stopped successfully',
|
|
571
|
+
content: {
|
|
572
|
+
'application/json': {
|
|
573
|
+
schema: {
|
|
574
|
+
type: 'object',
|
|
575
|
+
properties: {
|
|
576
|
+
ok: { type: 'boolean' },
|
|
577
|
+
stopped: { type: 'boolean' },
|
|
578
|
+
profile: { type: 'string', example: 'camoufox' },
|
|
579
|
+
},
|
|
580
|
+
required: ['ok', 'stopped', 'profile'],
|
|
581
|
+
},
|
|
582
|
+
},
|
|
583
|
+
},
|
|
584
|
+
},
|
|
585
|
+
'403': {
|
|
586
|
+
description: 'Forbidden - Invalid or missing admin key',
|
|
587
|
+
content: {
|
|
588
|
+
'application/json': {
|
|
589
|
+
schema: {
|
|
590
|
+
type: 'object',
|
|
591
|
+
properties: {
|
|
592
|
+
error: { type: 'string', enum: ['Forbidden'] },
|
|
593
|
+
},
|
|
594
|
+
},
|
|
595
|
+
},
|
|
596
|
+
},
|
|
597
|
+
},
|
|
598
|
+
'500': {
|
|
599
|
+
description: 'Server error',
|
|
600
|
+
content: {
|
|
601
|
+
'application/json': {
|
|
602
|
+
schema: {
|
|
603
|
+
type: 'object',
|
|
604
|
+
properties: {
|
|
605
|
+
ok: { type: 'boolean', enum: [false] },
|
|
606
|
+
error: { type: 'string' },
|
|
607
|
+
},
|
|
608
|
+
},
|
|
609
|
+
},
|
|
610
|
+
},
|
|
611
|
+
},
|
|
612
|
+
},
|
|
613
|
+
},
|
|
614
|
+
},
|
|
615
|
+
'/snapshot': {
|
|
616
|
+
get: {
|
|
617
|
+
summary: 'Get snapshot (OpenClaw)',
|
|
618
|
+
description: 'Get a text snapshot of the current page',
|
|
619
|
+
tags: ['OpenClaw'],
|
|
620
|
+
parameters: [
|
|
621
|
+
{
|
|
622
|
+
name: 'targetId',
|
|
623
|
+
in: 'query',
|
|
624
|
+
required: true,
|
|
625
|
+
schema: { type: 'string' },
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
name: 'userId',
|
|
629
|
+
in: 'query',
|
|
630
|
+
required: true,
|
|
631
|
+
schema: { type: 'string' },
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
name: 'format',
|
|
635
|
+
in: 'query',
|
|
636
|
+
schema: { type: 'string' },
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
name: 'offset',
|
|
640
|
+
in: 'query',
|
|
641
|
+
schema: { type: 'string' },
|
|
642
|
+
},
|
|
643
|
+
],
|
|
644
|
+
responses: {
|
|
645
|
+
'200': {
|
|
646
|
+
description: 'Snapshot retrieved',
|
|
647
|
+
content: {
|
|
648
|
+
'application/json': {
|
|
649
|
+
schema: {
|
|
650
|
+
type: 'object',
|
|
651
|
+
properties: {
|
|
652
|
+
ok: { type: 'boolean' },
|
|
653
|
+
format: { type: 'string', enum: ['aria'] },
|
|
654
|
+
targetId: { type: 'string' },
|
|
655
|
+
url: { type: 'string' },
|
|
656
|
+
snapshot: { type: 'string' },
|
|
657
|
+
refsCount: { type: 'number' },
|
|
658
|
+
offset: { type: 'number' },
|
|
659
|
+
truncated: { type: 'boolean' },
|
|
660
|
+
totalChars: { type: 'number' },
|
|
661
|
+
hasMore: { type: 'boolean' },
|
|
662
|
+
nextOffset: {
|
|
663
|
+
anyOf: [{ type: 'number' }, { enum: [null] }],
|
|
664
|
+
},
|
|
665
|
+
},
|
|
666
|
+
required: ['ok', 'format', 'targetId', 'url', 'snapshot', 'refsCount', 'offset', 'truncated', 'totalChars', 'hasMore', 'nextOffset'],
|
|
667
|
+
},
|
|
668
|
+
},
|
|
669
|
+
},
|
|
670
|
+
},
|
|
671
|
+
},
|
|
672
|
+
},
|
|
673
|
+
},
|
|
674
|
+
},
|
|
675
|
+
components: {
|
|
676
|
+
securitySchemes: {
|
|
677
|
+
bearerAuth: {
|
|
678
|
+
type: 'http',
|
|
679
|
+
scheme: 'bearer',
|
|
680
|
+
description: 'API key passed as Bearer token in Authorization header',
|
|
681
|
+
},
|
|
682
|
+
adminKey: {
|
|
683
|
+
type: 'apiKey',
|
|
684
|
+
in: 'header',
|
|
685
|
+
name: 'X-Admin-Key',
|
|
686
|
+
description: 'Admin key for privileged operations',
|
|
687
|
+
},
|
|
688
|
+
},
|
|
689
|
+
schemas: {
|
|
690
|
+
GeolocationConfig: {
|
|
691
|
+
type: 'object',
|
|
692
|
+
properties: {
|
|
693
|
+
latitude: { type: 'number' },
|
|
694
|
+
longitude: { type: 'number' },
|
|
695
|
+
},
|
|
696
|
+
required: ['latitude', 'longitude'],
|
|
697
|
+
},
|
|
698
|
+
ViewportConfig: {
|
|
699
|
+
type: 'object',
|
|
700
|
+
properties: {
|
|
701
|
+
width: { type: 'number' },
|
|
702
|
+
height: { type: 'number' },
|
|
703
|
+
},
|
|
704
|
+
required: ['width', 'height'],
|
|
705
|
+
},
|
|
706
|
+
TabState: {
|
|
707
|
+
type: 'object',
|
|
708
|
+
properties: {
|
|
709
|
+
tabId: { type: 'string' },
|
|
710
|
+
url: { type: 'string' },
|
|
711
|
+
title: { type: 'string' },
|
|
712
|
+
toolCalls: { type: 'number' },
|
|
713
|
+
},
|
|
714
|
+
},
|
|
715
|
+
},
|
|
716
|
+
},
|
|
717
|
+
tags: [
|
|
718
|
+
{
|
|
719
|
+
name: 'Core',
|
|
720
|
+
description: 'Core Camofox Browser API endpoints',
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
name: 'OpenClaw',
|
|
724
|
+
description: 'OpenClaw-compatible browser automation endpoints',
|
|
725
|
+
},
|
|
726
|
+
],
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
exports.openapiSpec = buildOpenapiSpec();
|
|
730
|
+
//# sourceMappingURL=spec.js.map
|