@fungi.computer/oyster 0.2.0 → 0.3.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/README.md +376 -72
- package/dist/agents.d.ts +3 -2
- package/dist/agents.js +4 -2
- package/dist/app-builds.d.ts +81 -8
- package/dist/app-builds.js +210 -60
- package/dist/app-storage.d.ts +3 -3
- package/dist/approval-capability.d.ts +5 -0
- package/dist/approval-capability.js +46 -0
- package/dist/approval-home.d.ts +51 -0
- package/dist/approval-home.js +226 -0
- package/dist/apps/catalog.d.ts +335 -0
- package/dist/apps/catalog.js +46 -0
- package/dist/apps/gate.d.ts +20 -6
- package/dist/apps/gate.js +42 -16
- package/dist/apps/index.d.ts +3 -1
- package/dist/apps/index.js +3 -1
- package/dist/apps/installation.d.ts +132 -51
- package/dist/apps/installation.js +176 -70
- package/dist/apps/permissions.d.ts +247 -0
- package/dist/apps/permissions.js +255 -0
- package/dist/boot-capability-route.d.ts +15 -0
- package/dist/boot-capability-route.js +196 -0
- package/dist/boot-capability.d.ts +103 -0
- package/dist/boot-capability.js +141 -0
- package/dist/boot-construction.d.ts +12 -0
- package/dist/boot-construction.js +175 -0
- package/dist/boot-gate.d.ts +267 -0
- package/dist/boot-gate.js +236 -0
- package/dist/boot-host-script.d.ts +2 -0
- package/dist/boot-host-script.js +1 -0
- package/dist/boot-mount.d.ts +21 -0
- package/dist/boot-mount.js +65 -0
- package/dist/browser/boot.d.ts +73 -0
- package/dist/browser/boot.js +502 -0
- package/dist/browser/browser.d.ts +104 -0
- package/dist/browser/browser.js +374 -0
- package/dist/browser/capability-source.d.ts +76 -0
- package/dist/browser/capability-source.js +338 -0
- package/dist/browser/cdp-client.d.ts +56 -0
- package/dist/browser/cdp-client.js +184 -0
- package/dist/browser/errors.d.ts +79 -0
- package/dist/browser/errors.js +32 -0
- package/dist/browser/index.d.ts +16 -0
- package/dist/browser/index.js +14 -0
- package/dist/browser/lease-registry.d.ts +61 -0
- package/dist/browser/lease-registry.js +101 -0
- package/dist/browser/operations.d.ts +225 -0
- package/dist/browser/operations.js +137 -0
- package/dist/browser/page.d.ts +25 -0
- package/dist/browser/page.js +172 -0
- package/dist/browser/quick-reads.d.ts +29 -0
- package/dist/browser/quick-reads.js +160 -0
- package/dist/browser/sessions.d.ts +52 -0
- package/dist/browser/sessions.js +118 -0
- package/dist/browser/url-policy.d.ts +18 -0
- package/dist/browser/url-policy.js +58 -0
- package/dist/build/app-imports.d.ts +12 -0
- package/dist/build/app-imports.js +105 -0
- package/dist/build/build-policy.d.ts +5 -3
- package/dist/build/build-policy.js +5 -3
- package/dist/build/candidate-builder.d.ts +1 -1
- package/dist/build/candidate-cli.mjs +8375 -334
- package/dist/build/local-build.d.ts +2 -0
- package/dist/build/local-build.js +28 -6
- package/dist/build/snapshot-package-store.d.ts +1 -1
- package/dist/build/snapshot-package-store.js +7 -2
- package/dist/build/workspace-build.d.ts +92 -5
- package/dist/build/workspace-build.js +93 -19
- package/dist/build.d.ts +1 -1
- package/dist/build.js +1 -1
- package/dist/catalog-frame.js +1 -1
- package/dist/cloudflare.d.ts +13 -3
- package/dist/cloudflare.js +102 -4
- package/dist/frame-binding-wire-script.js +1 -1
- package/dist/frame-binding-wire.js +4 -2
- package/dist/git-auth.d.ts +0 -2
- package/dist/git-auth.js +0 -2
- package/dist/git.d.ts +0 -1
- package/dist/git.js +0 -2
- package/dist/host.d.ts +39 -13
- package/dist/host.js +268 -142
- package/dist/index.d.ts +25 -15
- package/dist/index.js +39 -16
- package/dist/install-release-cli.d.ts +2 -0
- package/dist/install-release-cli.js +46 -0
- package/dist/installation-client.d.ts +43 -0
- package/dist/installation-client.js +178 -0
- package/dist/installation-execution.d.ts +11 -0
- package/dist/installation-execution.js +184 -0
- package/dist/installation-operations.d.ts +1437 -0
- package/dist/installation-operations.js +664 -0
- package/dist/installation-store-generation.d.ts +3 -0
- package/dist/installation-store-generation.js +16 -0
- package/dist/instance-id.d.ts +10 -0
- package/dist/instance-id.js +10 -0
- package/dist/instance-refusal.d.ts +11 -0
- package/dist/instance-refusal.js +21 -0
- package/dist/internal/delivery.js +4 -2
- package/dist/internal/host-gate.js +7 -1
- package/dist/internal/registry-installations.js +4 -4
- package/dist/keys.d.ts +5 -1
- package/dist/keys.js +10 -2
- package/dist/machine-link/authority.d.ts +89 -0
- package/dist/machine-link/authority.js +37 -0
- package/dist/machine-link/client.d.ts +66 -0
- package/dist/machine-link/client.js +94 -0
- package/dist/machine-link/delivery.d.ts +18 -0
- package/dist/machine-link/delivery.js +55 -0
- package/dist/machine-link/enrollment.d.ts +111 -0
- package/dist/machine-link/enrollment.js +286 -0
- package/dist/machine-link/fences.d.ts +37 -0
- package/dist/machine-link/fences.js +166 -0
- package/dist/machine-link/home.d.ts +20 -0
- package/dist/machine-link/home.js +24 -0
- package/dist/machine-link/host.d.ts +43 -0
- package/dist/machine-link/host.js +189 -0
- package/dist/machine-link/index.d.ts +15 -0
- package/dist/machine-link/index.js +15 -0
- package/dist/machine-link/link.d.ts +48 -0
- package/dist/machine-link/link.js +223 -0
- package/dist/machine-link/presence.d.ts +10 -0
- package/dist/machine-link/presence.js +25 -0
- package/dist/machine-link/workers.d.ts +6 -0
- package/dist/machine-link/workers.js +6 -0
- package/dist/mcp-owner.d.ts +2 -2
- package/dist/mcp-owner.js +41 -33
- package/dist/mcp.d.ts +15 -3
- package/dist/mcp.js +146 -25
- package/dist/pack.d.ts +14 -3
- package/dist/pack.js +44 -19
- package/dist/page/app-access.d.ts +7 -0
- package/dist/page/app-access.js +75 -0
- package/dist/page/boot-host.js +57 -0
- package/dist/page/capabilities.d.ts +3 -3
- package/dist/page/capabilities.js +16 -12
- package/dist/page/computer-handles.d.ts +3 -3
- package/dist/page/computer-target.d.ts +3 -0
- package/dist/page/computer-target.js +9 -0
- package/dist/page/mount.d.ts +23 -3
- package/dist/page/mount.js +152 -16
- package/dist/page-assets.d.ts +22 -0
- package/dist/page-assets.js +28 -0
- package/dist/page-script.d.ts +3 -0
- package/dist/page-script.js +5 -4
- package/dist/release.d.ts +13 -6
- package/dist/release.js +10 -7
- package/dist/root-data.d.ts +16 -6
- package/dist/root-data.js +2 -2
- package/dist/source/index.d.ts +1 -1
- package/dist/source/team-source.d.ts +20 -8
- package/dist/source/team-source.js +39 -10
- package/dist/source/template-seed.d.ts +2 -2
- package/dist/standalone/agent-mail.d.ts +24 -0
- package/dist/standalone/agent-mail.js +62 -0
- package/dist/standalone/agent-store.d.ts +9 -0
- package/dist/standalone/agent-store.js +30 -0
- package/dist/standalone/agents.d.ts +68 -9
- package/dist/standalone/agents.js +428 -56
- package/dist/standalone/app-builds-binding.d.ts +20 -2
- package/dist/standalone/app-builds-binding.js +147 -23
- package/dist/standalone/app-set.d.ts +5 -2
- package/dist/standalone/app-set.js +174 -143
- package/dist/standalone/browser.d.ts +11 -0
- package/dist/standalone/browser.js +72 -0
- package/dist/standalone/builds.d.ts +13 -4
- package/dist/standalone/builds.js +28 -44
- package/dist/standalone/computer-egress.d.ts +2 -0
- package/dist/standalone/computer-egress.js +13 -4
- package/dist/standalone/computer-fleet.d.ts +43 -0
- package/dist/standalone/computer-fleet.js +200 -0
- package/dist/standalone/computer.d.ts +44 -9
- package/dist/standalone/computer.js +129 -22
- package/dist/standalone/install-apps-cli.js +43 -6
- package/dist/standalone/instance.d.ts +2 -2
- package/dist/standalone/instance.js +8 -11
- package/dist/standalone/machine-link.d.ts +354 -0
- package/dist/standalone/machine-link.js +368 -0
- package/dist/standalone/media.d.ts +2 -2
- package/dist/standalone/media.js +19 -16
- package/dist/standalone/preview.d.ts +2 -2
- package/dist/standalone/preview.js +37 -10
- package/dist/standalone/registry.d.ts +149 -9
- package/dist/standalone/registry.js +299 -8
- package/dist/standalone/worker.d.ts +19 -5
- package/dist/standalone/worker.js +90 -54
- package/dist/standalone/workflow-binding.d.ts +18 -22
- package/dist/standalone/workflow-binding.js +18 -18
- package/dist/standalone/workflow-control.d.ts +4 -0
- package/dist/standalone/workflow-control.js +40 -0
- package/dist/standalone/workflow-events.d.ts +2 -2
- package/dist/standalone/workflow-events.js +9 -10
- package/dist/standalone/workflow-git-capture.js +4 -3
- package/dist/standalone/workflow-host.d.ts +162 -161
- package/dist/standalone/workflow-host.js +101 -21
- package/dist/standalone/workflow-node-capture.js +11 -4
- package/dist/standalone/workflow-schedules.d.ts +5 -2
- package/dist/standalone/workflow-schedules.js +9 -10
- package/dist/standalone/workflow-trigger-host.d.ts +65 -5
- package/dist/standalone/workflow-trigger-host.js +2 -2
- package/dist/standalone/workflow-webhooks.d.ts +22 -0
- package/dist/standalone/workflow-webhooks.js +39 -0
- package/dist/standalone/workflows.d.ts +140 -43
- package/dist/standalone/workflows.js +198 -39
- package/dist/storage-frame.d.ts +6 -6
- package/dist/testing/capabilities.js +14 -3
- package/dist/testing/installation.js +26 -2
- package/dist/testing/worker.js +1 -1
- package/dist/testing/workers-runtime.d.ts +8 -2
- package/dist/testing/workers-runtime.js +20 -2
- package/dist/webhook-abuse.d.ts +25 -0
- package/dist/webhook-abuse.js +54 -0
- package/dist/webhook-custody.d.ts +144 -0
- package/dist/webhook-custody.js +222 -0
- package/dist/webhook-ingress.d.ts +36 -0
- package/dist/webhook-ingress.js +146 -0
- package/dist/webhooks.d.ts +111 -0
- package/dist/webhooks.js +189 -0
- package/dist/workers-git.d.ts +12 -17
- package/dist/workers-git.js +60 -52
- package/dist/workers.d.ts +224 -13
- package/dist/workers.js +351 -51
- package/dist/workflow-agent-authority.d.ts +8 -0
- package/dist/workflow-agent-authority.js +42 -0
- package/dist/workflows.d.ts +66 -0
- package/dist/workflows.js +97 -0
- package/docs/api/README.md +63 -37
- package/docs/api/agents.md +17 -0
- package/docs/api/app-storage.md +1 -1
- package/docs/api/apps.md +1394 -543
- package/docs/api/browser/boot.md +132 -0
- package/docs/api/browser.md +1440 -0
- package/docs/api/build-contract.md +38 -25
- package/docs/api/build.md +263 -84
- package/docs/api/cloudflare.md +93 -7
- package/docs/api/git.md +3 -13
- package/docs/api/host.md +944 -118
- package/docs/api/index.md +320 -18
- package/docs/api/keys.md +24 -1
- package/docs/api/mcp.md +59 -12
- package/docs/api/modules.md +33 -40
- package/docs/api/pack.md +57 -8
- package/docs/api/page/mount.md +92 -4
- package/docs/api/workers-git.md +103 -24
- package/docs/api/workers.md +1581 -244
- package/docs/site/agent-quickstart.mdx +28 -14
- package/examples/standalone/worker.ts +3 -1
- package/examples/standalone/wrangler.jsonc +2 -0
- package/package.json +73 -71
- package/dist/installation-consent.d.ts +0 -81
- package/dist/installation-consent.js +0 -84
- package/dist/shell/app-directory.d.ts +0 -542
- package/dist/shell/app-directory.js +0 -196
- package/dist/shell/browser-actions.d.ts +0 -7
- package/dist/shell/browser-actions.js +0 -56
- package/dist/shell/command-host.d.ts +0 -112
- package/dist/shell/command-host.js +0 -502
- package/dist/shell/commands.d.ts +0 -25
- package/dist/shell/commands.js +0 -78
- package/dist/shell/index.d.ts +0 -8
- package/dist/shell/index.js +0 -8
- package/dist/shell/keys.d.ts +0 -41
- package/dist/shell/keys.js +0 -134
- package/dist/shell/shell-module.d.ts +0 -55
- package/dist/shell/shell-module.js +0 -86
- package/dist/shell/window-manager.d.ts +0 -128
- package/dist/shell/window-manager.js +0 -730
- package/dist/shell/workbench-contract.d.ts +0 -68
- package/dist/shell/workbench-directory.d.ts +0 -332
- package/dist/shell/workbench-directory.js +0 -35
- package/dist/shell/workbench-host-types.d.ts +0 -96
- package/dist/shell/workbench-host-types.js +0 -1
- package/dist/shell/workbench-host.d.ts +0 -34
- package/dist/shell/workbench-host.js +0 -352
- package/dist/shell/workbench-model.d.ts +0 -194
- package/dist/shell/workbench-model.js +0 -53
- package/dist/shell/workbench.d.ts +0 -4
- package/dist/shell/workbench.js +0 -2
- package/docs/api/shell/app-directory.md +0 -599
- package/docs/api/shell/command-host.md +0 -224
- package/docs/api/shell/commands.md +0 -197
- package/docs/api/shell/keys.md +0 -183
- package/docs/api/shell/shell-module.md +0 -204
- package/docs/api/shell/window-manager.md +0 -267
- package/docs/api/shell/workbench-directory.md +0 -119
- package/docs/api/shell/workbench.md +0 -205
- package/docs/api/shell.md +0 -1915
- /package/dist/{shell/workbench-contract.js → page/boot-host.d.ts} +0 -0
|
@@ -0,0 +1,1440 @@
|
|
|
1
|
+
<!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
|
|
2
|
+
|
|
3
|
+
[**@fungi.computer/oyster**](README.md)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
[@fungi.computer/oyster](modules.md) / browser
|
|
8
|
+
|
|
9
|
+
# browser
|
|
10
|
+
|
|
11
|
+
## Classes
|
|
12
|
+
|
|
13
|
+
### CloudBrowserUrlDenied
|
|
14
|
+
|
|
15
|
+
The target URL failed policy before any provider call was made.
|
|
16
|
+
|
|
17
|
+
#### Extends
|
|
18
|
+
|
|
19
|
+
- `YieldableError`\<`this`\> & `object` & `Readonly`\<\{ `reason`: \|
|
|
20
|
+
`"invalid_url"` \| `"unsupported_scheme"` \| `"credentials_in_url"` \|
|
|
21
|
+
`"not_public"` \| `"dns_unavailable"`; `message`: `string`; \}\>
|
|
22
|
+
|
|
23
|
+
#### Constructors
|
|
24
|
+
|
|
25
|
+
##### Constructor
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
new CloudBrowserUrlDenied(args): CloudBrowserUrlDenied;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
###### Parameters
|
|
32
|
+
|
|
33
|
+
| Parameter | Type |
|
|
34
|
+
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
35
|
+
| `args` | \{ `reason`: \| `"invalid_url"` \| `"unsupported_scheme"` \| `"credentials_in_url"` \| `"not_public"` \| `"dns_unavailable"`; `message`: `string`; \} |
|
|
36
|
+
| `args.reason` | \| `"invalid_url"` \| `"unsupported_scheme"` \| `"credentials_in_url"` \| `"not_public"` \| `"dns_unavailable"` |
|
|
37
|
+
| `args.message` | `string` |
|
|
38
|
+
|
|
39
|
+
###### Returns
|
|
40
|
+
|
|
41
|
+
[`CloudBrowserUrlDenied`](#cloudbrowserurldenied)
|
|
42
|
+
|
|
43
|
+
###### Inherited from
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
Data.TaggedError(
|
|
47
|
+
"CloudBrowserUrlDenied",
|
|
48
|
+
)<{
|
|
49
|
+
readonly reason:
|
|
50
|
+
| "invalid_url"
|
|
51
|
+
| "unsupported_scheme"
|
|
52
|
+
| "credentials_in_url"
|
|
53
|
+
| "not_public"
|
|
54
|
+
| "dns_unavailable";
|
|
55
|
+
readonly message: string;
|
|
56
|
+
}>.constructor
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
#### Properties
|
|
60
|
+
|
|
61
|
+
##### reason
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
readonly reason:
|
|
65
|
+
| "invalid_url"
|
|
66
|
+
| "unsupported_scheme"
|
|
67
|
+
| "credentials_in_url"
|
|
68
|
+
| "not_public"
|
|
69
|
+
| "dns_unavailable";
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
###### Inherited from
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
Data.TaggedError("CloudBrowserUrlDenied").reason;
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
##### message
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
message: string;
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
###### Inherited from
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
Data.TaggedError("CloudBrowserUrlDenied").message;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
### CloudBrowserUpstreamError
|
|
93
|
+
|
|
94
|
+
The provider (Cloudflare Browser Run) answered with a failure.
|
|
95
|
+
|
|
96
|
+
#### Extends
|
|
97
|
+
|
|
98
|
+
- `YieldableError`\<`this`\> & `object` & `Readonly`\<\{ `op`: `string`;
|
|
99
|
+
`status`: `number` \| `null`; `message`: `string`; \}\>
|
|
100
|
+
|
|
101
|
+
#### Constructors
|
|
102
|
+
|
|
103
|
+
##### Constructor
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
new CloudBrowserUpstreamError(args): CloudBrowserUpstreamError;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
###### Parameters
|
|
110
|
+
|
|
111
|
+
| Parameter | Type |
|
|
112
|
+
| -------------- | ------------------------------------------------------------------------ |
|
|
113
|
+
| `args` | \{ `op`: `string`; `status`: `number` \| `null`; `message`: `string`; \} |
|
|
114
|
+
| `args.op` | `string` |
|
|
115
|
+
| `args.status` | `number` \| `null` |
|
|
116
|
+
| `args.message` | `string` |
|
|
117
|
+
|
|
118
|
+
###### Returns
|
|
119
|
+
|
|
120
|
+
[`CloudBrowserUpstreamError`](#cloudbrowserupstreamerror)
|
|
121
|
+
|
|
122
|
+
###### Inherited from
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
Data.TaggedError(
|
|
126
|
+
"CloudBrowserUpstreamError",
|
|
127
|
+
)<{
|
|
128
|
+
readonly op: string;
|
|
129
|
+
readonly status: number | null;
|
|
130
|
+
readonly message: string;
|
|
131
|
+
}>.constructor
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### Properties
|
|
135
|
+
|
|
136
|
+
##### op
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
readonly op: string;
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
###### Inherited from
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
Data.TaggedError("CloudBrowserUpstreamError").op;
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
##### status
|
|
149
|
+
|
|
150
|
+
```ts
|
|
151
|
+
readonly status: number | null;
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
###### Inherited from
|
|
155
|
+
|
|
156
|
+
```ts
|
|
157
|
+
Data.TaggedError("CloudBrowserUpstreamError").status;
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
##### message
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
message: string;
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
###### Inherited from
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
Data.TaggedError("CloudBrowserUpstreamError").message;
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
### CloudBrowserTimeout
|
|
175
|
+
|
|
176
|
+
A call did not complete within its deadline.
|
|
177
|
+
|
|
178
|
+
#### Extends
|
|
179
|
+
|
|
180
|
+
- `YieldableError`\<`this`\> & `object` & `Readonly`\<\{ `op`: `string`;
|
|
181
|
+
`timeoutMs`: `number`; \}\>
|
|
182
|
+
|
|
183
|
+
#### Constructors
|
|
184
|
+
|
|
185
|
+
##### Constructor
|
|
186
|
+
|
|
187
|
+
```ts
|
|
188
|
+
new CloudBrowserTimeout(args): CloudBrowserTimeout;
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
###### Parameters
|
|
192
|
+
|
|
193
|
+
| Parameter | Type |
|
|
194
|
+
| ---------------- | -------------------------------------------- |
|
|
195
|
+
| `args` | \{ `op`: `string`; `timeoutMs`: `number`; \} |
|
|
196
|
+
| `args.op` | `string` |
|
|
197
|
+
| `args.timeoutMs` | `number` |
|
|
198
|
+
|
|
199
|
+
###### Returns
|
|
200
|
+
|
|
201
|
+
[`CloudBrowserTimeout`](#cloudbrowsertimeout)
|
|
202
|
+
|
|
203
|
+
###### Inherited from
|
|
204
|
+
|
|
205
|
+
```ts
|
|
206
|
+
Data.TaggedError(
|
|
207
|
+
"CloudBrowserTimeout",
|
|
208
|
+
)<{
|
|
209
|
+
readonly op: string;
|
|
210
|
+
readonly timeoutMs: number;
|
|
211
|
+
}>.constructor
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
#### Properties
|
|
215
|
+
|
|
216
|
+
##### op
|
|
217
|
+
|
|
218
|
+
```ts
|
|
219
|
+
readonly op: string;
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
###### Inherited from
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
Data.TaggedError("CloudBrowserTimeout").op;
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
##### timeoutMs
|
|
229
|
+
|
|
230
|
+
```ts
|
|
231
|
+
readonly timeoutMs: number;
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
###### Inherited from
|
|
235
|
+
|
|
236
|
+
```ts
|
|
237
|
+
Data.TaggedError("CloudBrowserTimeout").timeoutMs;
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
### CloudBrowserLeaseNotFound
|
|
243
|
+
|
|
244
|
+
The named lease is not held by this (teamId, agentId, sessionId).
|
|
245
|
+
|
|
246
|
+
#### Extends
|
|
247
|
+
|
|
248
|
+
- `YieldableError`\<`this`\> & `object` & `Readonly`\<\{ `leaseId`: `string`;
|
|
249
|
+
\}\>
|
|
250
|
+
|
|
251
|
+
#### Constructors
|
|
252
|
+
|
|
253
|
+
##### Constructor
|
|
254
|
+
|
|
255
|
+
```ts
|
|
256
|
+
new CloudBrowserLeaseNotFound(args): CloudBrowserLeaseNotFound;
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
###### Parameters
|
|
260
|
+
|
|
261
|
+
| Parameter | Type |
|
|
262
|
+
| -------------- | -------------------------- |
|
|
263
|
+
| `args` | \{ `leaseId`: `string`; \} |
|
|
264
|
+
| `args.leaseId` | `string` |
|
|
265
|
+
|
|
266
|
+
###### Returns
|
|
267
|
+
|
|
268
|
+
[`CloudBrowserLeaseNotFound`](#cloudbrowserleasenotfound)
|
|
269
|
+
|
|
270
|
+
###### Inherited from
|
|
271
|
+
|
|
272
|
+
```ts
|
|
273
|
+
Data.TaggedError(
|
|
274
|
+
"CloudBrowserLeaseNotFound",
|
|
275
|
+
)<{
|
|
276
|
+
readonly leaseId: string;
|
|
277
|
+
}>.constructor
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
#### Properties
|
|
281
|
+
|
|
282
|
+
##### leaseId
|
|
283
|
+
|
|
284
|
+
```ts
|
|
285
|
+
readonly leaseId: string;
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
###### Inherited from
|
|
289
|
+
|
|
290
|
+
```ts
|
|
291
|
+
Data.TaggedError("CloudBrowserLeaseNotFound").leaseId;
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
### CloudBrowserLeasePaused
|
|
297
|
+
|
|
298
|
+
A member was asked to take over; the Agent cannot drive it until "Done".
|
|
299
|
+
|
|
300
|
+
#### Extends
|
|
301
|
+
|
|
302
|
+
- `YieldableError`\<`this`\> & `object` & `Readonly`\<\{ `leaseId`: `string`;
|
|
303
|
+
\}\>
|
|
304
|
+
|
|
305
|
+
#### Constructors
|
|
306
|
+
|
|
307
|
+
##### Constructor
|
|
308
|
+
|
|
309
|
+
```ts
|
|
310
|
+
new CloudBrowserLeasePaused(args): CloudBrowserLeasePaused;
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
###### Parameters
|
|
314
|
+
|
|
315
|
+
| Parameter | Type |
|
|
316
|
+
| -------------- | -------------------------- |
|
|
317
|
+
| `args` | \{ `leaseId`: `string`; \} |
|
|
318
|
+
| `args.leaseId` | `string` |
|
|
319
|
+
|
|
320
|
+
###### Returns
|
|
321
|
+
|
|
322
|
+
[`CloudBrowserLeasePaused`](#cloudbrowserleasepaused)
|
|
323
|
+
|
|
324
|
+
###### Inherited from
|
|
325
|
+
|
|
326
|
+
```ts
|
|
327
|
+
Data.TaggedError(
|
|
328
|
+
"CloudBrowserLeasePaused",
|
|
329
|
+
)<{
|
|
330
|
+
readonly leaseId: string;
|
|
331
|
+
}>.constructor
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
#### Properties
|
|
335
|
+
|
|
336
|
+
##### leaseId
|
|
337
|
+
|
|
338
|
+
```ts
|
|
339
|
+
readonly leaseId: string;
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
###### Inherited from
|
|
343
|
+
|
|
344
|
+
```ts
|
|
345
|
+
Data.TaggedError("CloudBrowserLeasePaused").leaseId;
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
### CloudBrowserCapacityExceeded
|
|
351
|
+
|
|
352
|
+
The Team has no more concurrent leases available right now.
|
|
353
|
+
|
|
354
|
+
#### Extends
|
|
355
|
+
|
|
356
|
+
- `YieldableError`\<`this`\> & `object` & `Readonly`\<\{ `teamId`: `string`;
|
|
357
|
+
`limit`: `number`; \}\>
|
|
358
|
+
|
|
359
|
+
#### Constructors
|
|
360
|
+
|
|
361
|
+
##### Constructor
|
|
362
|
+
|
|
363
|
+
```ts
|
|
364
|
+
new CloudBrowserCapacityExceeded(args): CloudBrowserCapacityExceeded;
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
###### Parameters
|
|
368
|
+
|
|
369
|
+
| Parameter | Type |
|
|
370
|
+
| ------------- | -------------------------------------------- |
|
|
371
|
+
| `args` | \{ `teamId`: `string`; `limit`: `number`; \} |
|
|
372
|
+
| `args.teamId` | `string` |
|
|
373
|
+
| `args.limit` | `number` |
|
|
374
|
+
|
|
375
|
+
###### Returns
|
|
376
|
+
|
|
377
|
+
[`CloudBrowserCapacityExceeded`](#cloudbrowsercapacityexceeded)
|
|
378
|
+
|
|
379
|
+
###### Inherited from
|
|
380
|
+
|
|
381
|
+
```ts
|
|
382
|
+
Data.TaggedError(
|
|
383
|
+
"CloudBrowserCapacityExceeded",
|
|
384
|
+
)<{
|
|
385
|
+
readonly teamId: string;
|
|
386
|
+
readonly limit: number;
|
|
387
|
+
}>.constructor
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
#### Properties
|
|
391
|
+
|
|
392
|
+
##### teamId
|
|
393
|
+
|
|
394
|
+
```ts
|
|
395
|
+
readonly teamId: string;
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
###### Inherited from
|
|
399
|
+
|
|
400
|
+
```ts
|
|
401
|
+
Data.TaggedError("CloudBrowserCapacityExceeded").teamId;
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
##### limit
|
|
405
|
+
|
|
406
|
+
```ts
|
|
407
|
+
readonly limit: number;
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
###### Inherited from
|
|
411
|
+
|
|
412
|
+
```ts
|
|
413
|
+
Data.TaggedError("CloudBrowserCapacityExceeded").limit;
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
### CloudBrowserCreditDenied
|
|
419
|
+
|
|
420
|
+
The Team has no credit to start or continue a lease.
|
|
421
|
+
|
|
422
|
+
#### Extends
|
|
423
|
+
|
|
424
|
+
- `YieldableError`\<`this`\> & `object` & `Readonly`\<\{ `teamId`: `string`;
|
|
425
|
+
\}\>
|
|
426
|
+
|
|
427
|
+
#### Constructors
|
|
428
|
+
|
|
429
|
+
##### Constructor
|
|
430
|
+
|
|
431
|
+
```ts
|
|
432
|
+
new CloudBrowserCreditDenied(args): CloudBrowserCreditDenied;
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
###### Parameters
|
|
436
|
+
|
|
437
|
+
| Parameter | Type |
|
|
438
|
+
| ------------- | ------------------------- |
|
|
439
|
+
| `args` | \{ `teamId`: `string`; \} |
|
|
440
|
+
| `args.teamId` | `string` |
|
|
441
|
+
|
|
442
|
+
###### Returns
|
|
443
|
+
|
|
444
|
+
[`CloudBrowserCreditDenied`](#cloudbrowsercreditdenied)
|
|
445
|
+
|
|
446
|
+
###### Inherited from
|
|
447
|
+
|
|
448
|
+
```ts
|
|
449
|
+
Data.TaggedError(
|
|
450
|
+
"CloudBrowserCreditDenied",
|
|
451
|
+
)<{
|
|
452
|
+
readonly teamId: string;
|
|
453
|
+
}>.constructor
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
#### Properties
|
|
457
|
+
|
|
458
|
+
##### teamId
|
|
459
|
+
|
|
460
|
+
```ts
|
|
461
|
+
readonly teamId: string;
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
###### Inherited from
|
|
465
|
+
|
|
466
|
+
```ts
|
|
467
|
+
Data.TaggedError("CloudBrowserCreditDenied").teamId;
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
---
|
|
471
|
+
|
|
472
|
+
### CloudBrowserUnavailable
|
|
473
|
+
|
|
474
|
+
No backend is configured (credentials absent, or the feature is paused).
|
|
475
|
+
|
|
476
|
+
#### Extends
|
|
477
|
+
|
|
478
|
+
- `YieldableError`\<`this`\> & `object` & `Readonly`\<\{ `reason`: `"paused"` \|
|
|
479
|
+
`"unconfigured"`; \}\>
|
|
480
|
+
|
|
481
|
+
#### Constructors
|
|
482
|
+
|
|
483
|
+
##### Constructor
|
|
484
|
+
|
|
485
|
+
```ts
|
|
486
|
+
new CloudBrowserUnavailable(args): CloudBrowserUnavailable;
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
###### Parameters
|
|
490
|
+
|
|
491
|
+
| Parameter | Type |
|
|
492
|
+
| ------------- | ----------------------------------------------- |
|
|
493
|
+
| `args` | \{ `reason`: `"paused"` \| `"unconfigured"`; \} |
|
|
494
|
+
| `args.reason` | `"paused"` \| `"unconfigured"` |
|
|
495
|
+
|
|
496
|
+
###### Returns
|
|
497
|
+
|
|
498
|
+
[`CloudBrowserUnavailable`](#cloudbrowserunavailable)
|
|
499
|
+
|
|
500
|
+
###### Inherited from
|
|
501
|
+
|
|
502
|
+
```ts
|
|
503
|
+
Data.TaggedError(
|
|
504
|
+
"CloudBrowserUnavailable",
|
|
505
|
+
)<{
|
|
506
|
+
readonly reason: "unconfigured" | "paused";
|
|
507
|
+
}>.constructor
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
#### Properties
|
|
511
|
+
|
|
512
|
+
##### reason
|
|
513
|
+
|
|
514
|
+
```ts
|
|
515
|
+
readonly reason: "paused" | "unconfigured";
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
###### Inherited from
|
|
519
|
+
|
|
520
|
+
```ts
|
|
521
|
+
Data.TaggedError("CloudBrowserUnavailable").reason;
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
## Type Aliases
|
|
525
|
+
|
|
526
|
+
### BrowserMeter
|
|
527
|
+
|
|
528
|
+
```ts
|
|
529
|
+
type BrowserMeter = Readonly<{
|
|
530
|
+
hold: (input) => Promise<void>;
|
|
531
|
+
start: (input) => Promise<void>;
|
|
532
|
+
settle: (input) => Promise<void>;
|
|
533
|
+
release: (input) => Promise<void>;
|
|
534
|
+
}>;
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
One metered execution (a lease or a Quick Read), driven only by `createBrowser`.
|
|
538
|
+
`maxMs` is the execution's own ceiling: the hold covers it and settlement never
|
|
539
|
+
exceeds it.
|
|
540
|
+
|
|
541
|
+
---
|
|
542
|
+
|
|
543
|
+
### BrowserEvent
|
|
544
|
+
|
|
545
|
+
```ts
|
|
546
|
+
type BrowserEvent = Readonly<{
|
|
547
|
+
kind:
|
|
548
|
+
| "reap_close_failed"
|
|
549
|
+
| "reap_settle_failed"
|
|
550
|
+
| "settle_failed"
|
|
551
|
+
| "open_cleanup_failed"
|
|
552
|
+
| "read_release_failed"
|
|
553
|
+
| "teardown_failed"
|
|
554
|
+
| "teardown_abandoned";
|
|
555
|
+
teamId: string;
|
|
556
|
+
executionId: string;
|
|
557
|
+
cause: unknown;
|
|
558
|
+
}>;
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
Code-only observations; never a URL, page text, token or provider body.
|
|
562
|
+
|
|
563
|
+
---
|
|
564
|
+
|
|
565
|
+
### BrowserHost
|
|
566
|
+
|
|
567
|
+
```ts
|
|
568
|
+
type BrowserHost = Readonly<{
|
|
569
|
+
sessions: BrowserSessions;
|
|
570
|
+
quickReads: QuickReads | null;
|
|
571
|
+
meter: (owner) => BrowserMeter;
|
|
572
|
+
report: (event) => void;
|
|
573
|
+
}>;
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
The ONE host port for config, billing and provider egress.
|
|
577
|
+
|
|
578
|
+
---
|
|
579
|
+
|
|
580
|
+
### BrowserLimits
|
|
581
|
+
|
|
582
|
+
```ts
|
|
583
|
+
type BrowserLimits = Readonly<{
|
|
584
|
+
maxConcurrentPerTeam: number;
|
|
585
|
+
maxLifetimeMs: number;
|
|
586
|
+
idleTimeoutMs: number;
|
|
587
|
+
navigationTimeoutMs?: number;
|
|
588
|
+
closeConfirmMs?: number;
|
|
589
|
+
quickReadTimeoutMs?: number;
|
|
590
|
+
now?: () => number;
|
|
591
|
+
}>;
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
`@fungi.computer/oyster/browser`: the one agent browser for the Hub and a
|
|
595
|
+
standalone Oyster. A host builds the port from a provider (`browserRunSessions`
|
|
596
|
+
or `bindingSessions`, plus Browser Run Quick Reads when it has them), its
|
|
597
|
+
required metering owner and an event sink; `createBrowser` owns lease ownership,
|
|
598
|
+
egress policy and billing order; `browserCapabilitySource` is the agent's
|
|
599
|
+
`cloudBrowser` tool. Raw CDP stays internal to this directory.
|
|
600
|
+
|
|
601
|
+
---
|
|
602
|
+
|
|
603
|
+
### BrowserMemberAction
|
|
604
|
+
|
|
605
|
+
```ts
|
|
606
|
+
type BrowserMemberAction =
|
|
607
|
+
| Readonly<{
|
|
608
|
+
kind: "screenshot";
|
|
609
|
+
}>
|
|
610
|
+
| Readonly<{
|
|
611
|
+
kind: "click";
|
|
612
|
+
x: number;
|
|
613
|
+
y: number;
|
|
614
|
+
}>
|
|
615
|
+
| Readonly<{
|
|
616
|
+
kind: "type";
|
|
617
|
+
text: string;
|
|
618
|
+
}>
|
|
619
|
+
| Readonly<{
|
|
620
|
+
kind: "scroll";
|
|
621
|
+
deltaX: number;
|
|
622
|
+
deltaY: number;
|
|
623
|
+
}>
|
|
624
|
+
| Readonly<{
|
|
625
|
+
kind: "resume";
|
|
626
|
+
}>;
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
What a Team member may do to a lease an Agent handed off.
|
|
630
|
+
|
|
631
|
+
---
|
|
632
|
+
|
|
633
|
+
### Browser
|
|
634
|
+
|
|
635
|
+
```ts
|
|
636
|
+
type Browser = Readonly<{
|
|
637
|
+
quickReads: boolean;
|
|
638
|
+
call: (owner, op, signal) => Promise<CloudBrowserOperationResult>;
|
|
639
|
+
handoff: (owner, leaseId) => void;
|
|
640
|
+
member: (teamId, leaseId, action, signal) => Promise<BinaryResult | null>;
|
|
641
|
+
}>;
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
`@fungi.computer/oyster/browser`: the one agent browser for the Hub and a
|
|
645
|
+
standalone Oyster. A host builds the port from a provider (`browserRunSessions`
|
|
646
|
+
or `bindingSessions`, plus Browser Run Quick Reads when it has them), its
|
|
647
|
+
required metering owner and an event sink; `createBrowser` owns lease ownership,
|
|
648
|
+
egress policy and billing order; `browserCapabilitySource` is the agent's
|
|
649
|
+
`cloudBrowser` tool. Raw CDP stays internal to this directory.
|
|
650
|
+
|
|
651
|
+
---
|
|
652
|
+
|
|
653
|
+
### SaveBrowserFile
|
|
654
|
+
|
|
655
|
+
```ts
|
|
656
|
+
type SaveBrowserFile = (input) => Promise<
|
|
657
|
+
Readonly<{
|
|
658
|
+
computerId: string;
|
|
659
|
+
path: string;
|
|
660
|
+
bytes: number;
|
|
661
|
+
}>
|
|
662
|
+
>;
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
The host's door for screenshot/PDF bytes: a named path on a Computer the Agent
|
|
666
|
+
is attached to. The model only ever receives the saved byte count.
|
|
667
|
+
|
|
668
|
+
#### Parameters
|
|
669
|
+
|
|
670
|
+
| Parameter | Type |
|
|
671
|
+
| --------- | ------------------------------------------------------------------------------------------------------------- |
|
|
672
|
+
| `input` | `Readonly`\<\{ `computerId`: `string`; `path`: `string`; `bytes`: `Uint8Array`; `contentType`: `string`; \}\> |
|
|
673
|
+
|
|
674
|
+
#### Returns
|
|
675
|
+
|
|
676
|
+
`Promise`\<`Readonly`\<\{ `computerId`: `string`; `path`: `string`; `bytes`:
|
|
677
|
+
`number`; \}\>\>
|
|
678
|
+
|
|
679
|
+
---
|
|
680
|
+
|
|
681
|
+
### AgentBrowserDoor
|
|
682
|
+
|
|
683
|
+
```ts
|
|
684
|
+
type AgentBrowserDoor = Readonly<{
|
|
685
|
+
call: (owner, op, signal) => Promise<CloudBrowserOperationResult>;
|
|
686
|
+
handoff: (owner, leaseId) => Promise<void>;
|
|
687
|
+
}>;
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
The agent-facing slice of `Browser`, possibly behind a host RPC hop.
|
|
691
|
+
|
|
692
|
+
---
|
|
693
|
+
|
|
694
|
+
### CdpSocket
|
|
695
|
+
|
|
696
|
+
```ts
|
|
697
|
+
type CdpSocket = Readonly<{
|
|
698
|
+
send: (data) => void;
|
|
699
|
+
close: (code?, reason?) => void;
|
|
700
|
+
addEventListener: (type, listener) => void;
|
|
701
|
+
}>;
|
|
702
|
+
```
|
|
703
|
+
|
|
704
|
+
The minimal WebSocket surface this client drives (a fake in tests). A real
|
|
705
|
+
`WebSocket`'s `addEventListener` structurally satisfies this: the listener
|
|
706
|
+
accepts any platform `Event` and `readCdpMessage` parses a message's `data`.
|
|
707
|
+
|
|
708
|
+
---
|
|
709
|
+
|
|
710
|
+
### HttpFetch
|
|
711
|
+
|
|
712
|
+
```ts
|
|
713
|
+
type HttpFetch = (url, init?) => Promise<Response>;
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
The one fetch shape the module calls: global `fetch` or a binding's.
|
|
717
|
+
|
|
718
|
+
#### Parameters
|
|
719
|
+
|
|
720
|
+
| Parameter | Type |
|
|
721
|
+
| --------- | ------------- |
|
|
722
|
+
| `url` | `string` |
|
|
723
|
+
| `init?` | `RequestInit` |
|
|
724
|
+
|
|
725
|
+
#### Returns
|
|
726
|
+
|
|
727
|
+
`Promise`\<`Response`\>
|
|
728
|
+
|
|
729
|
+
---
|
|
730
|
+
|
|
731
|
+
### CloudBrowserFailure
|
|
732
|
+
|
|
733
|
+
```ts
|
|
734
|
+
type CloudBrowserFailure =
|
|
735
|
+
| CloudBrowserUrlDenied
|
|
736
|
+
| CloudBrowserUpstreamError
|
|
737
|
+
| CloudBrowserTimeout
|
|
738
|
+
| CloudBrowserLeaseNotFound
|
|
739
|
+
| CloudBrowserLeasePaused
|
|
740
|
+
| CloudBrowserCapacityExceeded
|
|
741
|
+
| CloudBrowserCreditDenied
|
|
742
|
+
| CloudBrowserUnavailable;
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
Every typed failure the browser module throws; nothing else escapes it.
|
|
746
|
+
|
|
747
|
+
---
|
|
748
|
+
|
|
749
|
+
### LeaseOwner
|
|
750
|
+
|
|
751
|
+
```ts
|
|
752
|
+
type LeaseOwner = Readonly<{
|
|
753
|
+
teamId: string;
|
|
754
|
+
agentId: string;
|
|
755
|
+
sessionId: string;
|
|
756
|
+
}>;
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
The one place that binds a cloud-browser lease to the (teamId, agentId,
|
|
760
|
+
sessionId) that opened it, enforces the per-Team concurrent cap, and times
|
|
761
|
+
leases out. The provider (`sessions.ts`) only knows CDP connections; it has no
|
|
762
|
+
idea which Team or Session owns one. This registry is in-process (one Hub
|
|
763
|
+
instance): see the report for why a durable, cross-instance counter (the
|
|
764
|
+
`TeamDO`-backed shape Computer admission uses) is the better home for this
|
|
765
|
+
long-term.
|
|
766
|
+
|
|
767
|
+
---
|
|
768
|
+
|
|
769
|
+
### MarkdownInput
|
|
770
|
+
|
|
771
|
+
```ts
|
|
772
|
+
type MarkdownInput = z.output<typeof markdownInputSchema>;
|
|
773
|
+
```
|
|
774
|
+
|
|
775
|
+
Parsed `markdown` input.
|
|
776
|
+
|
|
777
|
+
---
|
|
778
|
+
|
|
779
|
+
### MarkdownResult
|
|
780
|
+
|
|
781
|
+
```ts
|
|
782
|
+
type MarkdownResult = z.output<typeof markdownResultSchema>;
|
|
783
|
+
```
|
|
784
|
+
|
|
785
|
+
Parsed `markdown` output.
|
|
786
|
+
|
|
787
|
+
---
|
|
788
|
+
|
|
789
|
+
### LinksResult
|
|
790
|
+
|
|
791
|
+
```ts
|
|
792
|
+
type LinksResult = z.output<typeof linksResultSchema>;
|
|
793
|
+
```
|
|
794
|
+
|
|
795
|
+
Parsed `links` output.
|
|
796
|
+
|
|
797
|
+
---
|
|
798
|
+
|
|
799
|
+
### ScrapeInput
|
|
800
|
+
|
|
801
|
+
```ts
|
|
802
|
+
type ScrapeInput = z.output<typeof scrapeInputSchema>;
|
|
803
|
+
```
|
|
804
|
+
|
|
805
|
+
Parsed `scrape` input.
|
|
806
|
+
|
|
807
|
+
---
|
|
808
|
+
|
|
809
|
+
### ScrapeResult
|
|
810
|
+
|
|
811
|
+
```ts
|
|
812
|
+
type ScrapeResult = z.output<typeof scrapeResultSchema>;
|
|
813
|
+
```
|
|
814
|
+
|
|
815
|
+
Parsed `scrape` output.
|
|
816
|
+
|
|
817
|
+
---
|
|
818
|
+
|
|
819
|
+
### ExtractInput
|
|
820
|
+
|
|
821
|
+
```ts
|
|
822
|
+
type ExtractInput = z.output<typeof extractInputSchema>;
|
|
823
|
+
```
|
|
824
|
+
|
|
825
|
+
Parsed `extract` input.
|
|
826
|
+
|
|
827
|
+
---
|
|
828
|
+
|
|
829
|
+
### ExtractResult
|
|
830
|
+
|
|
831
|
+
```ts
|
|
832
|
+
type ExtractResult = z.output<typeof extractResultSchema>;
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
Parsed `extract` output.
|
|
836
|
+
|
|
837
|
+
---
|
|
838
|
+
|
|
839
|
+
### OpenResult
|
|
840
|
+
|
|
841
|
+
```ts
|
|
842
|
+
type OpenResult = z.output<typeof openResultSchema>;
|
|
843
|
+
```
|
|
844
|
+
|
|
845
|
+
Parsed `open` output.
|
|
846
|
+
|
|
847
|
+
---
|
|
848
|
+
|
|
849
|
+
### NavigateResult
|
|
850
|
+
|
|
851
|
+
```ts
|
|
852
|
+
type NavigateResult = z.output<typeof navigateResultSchema>;
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
Parsed `navigate` output.
|
|
856
|
+
|
|
857
|
+
---
|
|
858
|
+
|
|
859
|
+
### SnapshotResult
|
|
860
|
+
|
|
861
|
+
```ts
|
|
862
|
+
type SnapshotResult = z.output<typeof snapshotResultSchema>;
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
Parsed `snapshot` output.
|
|
866
|
+
|
|
867
|
+
---
|
|
868
|
+
|
|
869
|
+
### BinaryResult
|
|
870
|
+
|
|
871
|
+
```ts
|
|
872
|
+
type BinaryResult = Readonly<{
|
|
873
|
+
leaseId: string;
|
|
874
|
+
bytes: Uint8Array;
|
|
875
|
+
contentType: string;
|
|
876
|
+
}>;
|
|
877
|
+
```
|
|
878
|
+
|
|
879
|
+
Raw bytes never cross the Mycelium boundary; only a byte count does.
|
|
880
|
+
|
|
881
|
+
---
|
|
882
|
+
|
|
883
|
+
### CloudBrowserOperation
|
|
884
|
+
|
|
885
|
+
```ts
|
|
886
|
+
type CloudBrowserOperation =
|
|
887
|
+
| Readonly<{
|
|
888
|
+
kind: "markdown";
|
|
889
|
+
input: MarkdownInput;
|
|
890
|
+
}>
|
|
891
|
+
| Readonly<{
|
|
892
|
+
kind: "links";
|
|
893
|
+
url: string;
|
|
894
|
+
}>
|
|
895
|
+
| Readonly<{
|
|
896
|
+
kind: "scrape";
|
|
897
|
+
input: ScrapeInput;
|
|
898
|
+
}>
|
|
899
|
+
| Readonly<{
|
|
900
|
+
kind: "extract";
|
|
901
|
+
input: ExtractInput;
|
|
902
|
+
}>
|
|
903
|
+
| Readonly<{
|
|
904
|
+
kind: "open";
|
|
905
|
+
url: string | null;
|
|
906
|
+
}>
|
|
907
|
+
| Readonly<{
|
|
908
|
+
kind: "navigate";
|
|
909
|
+
leaseId: string;
|
|
910
|
+
url: string;
|
|
911
|
+
}>
|
|
912
|
+
| Readonly<{
|
|
913
|
+
kind: "snapshot";
|
|
914
|
+
leaseId: string;
|
|
915
|
+
}>
|
|
916
|
+
| Readonly<{
|
|
917
|
+
kind: "click";
|
|
918
|
+
leaseId: string;
|
|
919
|
+
x: number;
|
|
920
|
+
y: number;
|
|
921
|
+
}>
|
|
922
|
+
| Readonly<{
|
|
923
|
+
kind: "type";
|
|
924
|
+
leaseId: string;
|
|
925
|
+
text: string;
|
|
926
|
+
}>
|
|
927
|
+
| Readonly<{
|
|
928
|
+
kind: "press";
|
|
929
|
+
leaseId: string;
|
|
930
|
+
key: string;
|
|
931
|
+
}>
|
|
932
|
+
| Readonly<{
|
|
933
|
+
kind: "scroll";
|
|
934
|
+
leaseId: string;
|
|
935
|
+
deltaX: number;
|
|
936
|
+
deltaY: number;
|
|
937
|
+
}>
|
|
938
|
+
| Readonly<{
|
|
939
|
+
kind: "screenshot";
|
|
940
|
+
leaseId: string;
|
|
941
|
+
}>
|
|
942
|
+
| Readonly<{
|
|
943
|
+
kind: "pdf";
|
|
944
|
+
leaseId: string;
|
|
945
|
+
}>
|
|
946
|
+
| Readonly<{
|
|
947
|
+
kind: "close";
|
|
948
|
+
leaseId: string;
|
|
949
|
+
}>;
|
|
950
|
+
```
|
|
951
|
+
|
|
952
|
+
Every call the agent tool can make. `markdown`/`links`/`scrape`/`extract` are
|
|
953
|
+
stateless Quick Reads (absent on a host without them); `open`..`close` share one
|
|
954
|
+
driven session keyed by `leaseId`. "screenshot"/"pdf" return raw bytes here;
|
|
955
|
+
`capability-source.ts` saves them through the host's door and hands the model
|
|
956
|
+
only a byte count.
|
|
957
|
+
|
|
958
|
+
---
|
|
959
|
+
|
|
960
|
+
### CloudBrowserAck
|
|
961
|
+
|
|
962
|
+
```ts
|
|
963
|
+
type CloudBrowserAck = Readonly<{
|
|
964
|
+
leaseId: string;
|
|
965
|
+
}>;
|
|
966
|
+
```
|
|
967
|
+
|
|
968
|
+
Acknowledgement of one driven input step.
|
|
969
|
+
|
|
970
|
+
---
|
|
971
|
+
|
|
972
|
+
### CloudBrowserClosed
|
|
973
|
+
|
|
974
|
+
```ts
|
|
975
|
+
type CloudBrowserClosed = Readonly<{
|
|
976
|
+
leaseId: string;
|
|
977
|
+
closed: true;
|
|
978
|
+
provider: "closed" | "closing";
|
|
979
|
+
}>;
|
|
980
|
+
```
|
|
981
|
+
|
|
982
|
+
Acknowledgement that a lease closed.
|
|
983
|
+
|
|
984
|
+
---
|
|
985
|
+
|
|
986
|
+
### CloudBrowserOperationResult
|
|
987
|
+
|
|
988
|
+
```ts
|
|
989
|
+
type CloudBrowserOperationResult =
|
|
990
|
+
| MarkdownResult
|
|
991
|
+
| LinksResult
|
|
992
|
+
| ScrapeResult
|
|
993
|
+
| ExtractResult
|
|
994
|
+
| OpenResult
|
|
995
|
+
| NavigateResult
|
|
996
|
+
| SnapshotResult
|
|
997
|
+
| CloudBrowserAck
|
|
998
|
+
| BinaryResult
|
|
999
|
+
| CloudBrowserClosed;
|
|
1000
|
+
```
|
|
1001
|
+
|
|
1002
|
+
What one `CloudBrowserOperation` returns, before the agent tool shapes it.
|
|
1003
|
+
|
|
1004
|
+
---
|
|
1005
|
+
|
|
1006
|
+
### BrowserRunQuickReadsConfig
|
|
1007
|
+
|
|
1008
|
+
```ts
|
|
1009
|
+
type BrowserRunQuickReadsConfig = Readonly<{
|
|
1010
|
+
accountId: string;
|
|
1011
|
+
apiToken: string;
|
|
1012
|
+
fetch?: HttpFetch;
|
|
1013
|
+
}>;
|
|
1014
|
+
```
|
|
1015
|
+
|
|
1016
|
+
The Browser Run account and API token a host's Quick Reads use.
|
|
1017
|
+
|
|
1018
|
+
---
|
|
1019
|
+
|
|
1020
|
+
### QuickRead
|
|
1021
|
+
|
|
1022
|
+
```ts
|
|
1023
|
+
type QuickRead<Result> = Readonly<{
|
|
1024
|
+
result: Result;
|
|
1025
|
+
browserMs: number | null;
|
|
1026
|
+
}>;
|
|
1027
|
+
```
|
|
1028
|
+
|
|
1029
|
+
A read's result and the browser time the provider reports for it, if any.
|
|
1030
|
+
|
|
1031
|
+
#### Type Parameters
|
|
1032
|
+
|
|
1033
|
+
| Type Parameter |
|
|
1034
|
+
| -------------- |
|
|
1035
|
+
| `Result` |
|
|
1036
|
+
|
|
1037
|
+
---
|
|
1038
|
+
|
|
1039
|
+
### QuickReads
|
|
1040
|
+
|
|
1041
|
+
```ts
|
|
1042
|
+
type QuickReads = Readonly<{
|
|
1043
|
+
markdown: (url, maxChars, signal) => Promise<QuickRead<MarkdownResult>>;
|
|
1044
|
+
links: (url, signal) => Promise<QuickRead<LinksResult>>;
|
|
1045
|
+
scrape: (url, selectors, signal) => Promise<QuickRead<ScrapeResult>>;
|
|
1046
|
+
extract: (url, prompt, signal) => Promise<QuickRead<ExtractResult>>;
|
|
1047
|
+
}>;
|
|
1048
|
+
```
|
|
1049
|
+
|
|
1050
|
+
The stateless half of the host port; only `browserRunQuickReads` builds one. The
|
|
1051
|
+
caller (`browser.ts`) owns the deadline through `signal`.
|
|
1052
|
+
|
|
1053
|
+
---
|
|
1054
|
+
|
|
1055
|
+
### BrowserSessions
|
|
1056
|
+
|
|
1057
|
+
```ts
|
|
1058
|
+
type BrowserSessions = Readonly<{}>;
|
|
1059
|
+
```
|
|
1060
|
+
|
|
1061
|
+
The provider half of the host port. Built only by the two functions below. Each
|
|
1062
|
+
step is separate so `createBrowser` owns a provider session id from the moment
|
|
1063
|
+
it exists, including when its CDP connect then fails.
|
|
1064
|
+
|
|
1065
|
+
---
|
|
1066
|
+
|
|
1067
|
+
### BrowserBinding
|
|
1068
|
+
|
|
1069
|
+
```ts
|
|
1070
|
+
type BrowserBinding = Readonly<{
|
|
1071
|
+
fetch: HttpFetch;
|
|
1072
|
+
}>;
|
|
1073
|
+
```
|
|
1074
|
+
|
|
1075
|
+
A Workers BROWSER binding (`Fetcher`), reduced to the call this module makes.
|
|
1076
|
+
|
|
1077
|
+
---
|
|
1078
|
+
|
|
1079
|
+
### CdpConnect
|
|
1080
|
+
|
|
1081
|
+
```ts
|
|
1082
|
+
type CdpConnect = (url, headers, signal) => Promise<CdpSocket>;
|
|
1083
|
+
```
|
|
1084
|
+
|
|
1085
|
+
Opens the CDP WebSocket for one provider session URL.
|
|
1086
|
+
|
|
1087
|
+
#### Parameters
|
|
1088
|
+
|
|
1089
|
+
| Parameter | Type |
|
|
1090
|
+
| --------- | -------------------------------------------- |
|
|
1091
|
+
| `url` | `string` |
|
|
1092
|
+
| `headers` | `Readonly`\<`Record`\<`string`, `string`\>\> |
|
|
1093
|
+
| `signal` | `AbortSignal` |
|
|
1094
|
+
|
|
1095
|
+
#### Returns
|
|
1096
|
+
|
|
1097
|
+
`Promise`\<[`CdpSocket`](#cdpsocket)\>
|
|
1098
|
+
|
|
1099
|
+
## Variables
|
|
1100
|
+
|
|
1101
|
+
### CLOUD\_BROWSER\_DESCRIPTIONS
|
|
1102
|
+
|
|
1103
|
+
```ts
|
|
1104
|
+
const CLOUD_BROWSER_DESCRIPTIONS: Readonly<{
|
|
1105
|
+
module: string;
|
|
1106
|
+
markdown: "Render a JavaScript page and return it as markdown, truncated to maxChars (default 20000).";
|
|
1107
|
+
links: "Render a page and return up to 500 links found on it.";
|
|
1108
|
+
scrape: "Render a page and return matched elements for up to 10 CSS selectors, bounded to 64 KiB.";
|
|
1109
|
+
extract: "Render a page and extract structured data matching a prompt.";
|
|
1110
|
+
open: "Open a driven browser session, optionally navigating to a URL, and return its leaseId.";
|
|
1111
|
+
navigate: "Navigate an open session's page to a URL.";
|
|
1112
|
+
snapshot: "Read an open session's page as a bounded accessibility-tree text summary.";
|
|
1113
|
+
click: "Click at a viewport pixel coordinate in an open session.";
|
|
1114
|
+
type: "Insert text at the current focus in an open session.";
|
|
1115
|
+
press: 'Press one key (e.g. "Enter", "Tab") in an open session.';
|
|
1116
|
+
scroll: "Scroll an open session's page by a pixel delta.";
|
|
1117
|
+
screenshot: "Capture a PNG screenshot of an open session's page and save it to a Computer path; returns the saved byte count, never the bytes.";
|
|
1118
|
+
pdf: "Render an open session's page to PDF and save it to a Computer path; returns the saved byte count, never the bytes.";
|
|
1119
|
+
handoff: "Ask a Team member to take over an open session for a login or captcha; a card appears in the conversation and the run continues once they finish.";
|
|
1120
|
+
close: "End a driven session and release its lease.";
|
|
1121
|
+
}>;
|
|
1122
|
+
```
|
|
1123
|
+
|
|
1124
|
+
The one source of truth for every `cloudBrowser` description: the module itself
|
|
1125
|
+
and each operation. `cloud-browser-descriptions.test.ts` imports this and
|
|
1126
|
+
asserts every entry stays under 1000 characters (the acceptance criterion in
|
|
1127
|
+
`issues/retained-features-v1/02-*.md`); the guard right below repeats that check
|
|
1128
|
+
at import time so a regression fails fast either way.
|
|
1129
|
+
|
|
1130
|
+
---
|
|
1131
|
+
|
|
1132
|
+
### cloudBrowserBounds
|
|
1133
|
+
|
|
1134
|
+
```ts
|
|
1135
|
+
const cloudBrowserBounds: Readonly<{
|
|
1136
|
+
maxChars: 50000;
|
|
1137
|
+
defaultMarkdownChars: 20000;
|
|
1138
|
+
maxLinks: 500;
|
|
1139
|
+
maxSelectors: 10;
|
|
1140
|
+
maxScrapeBytes: number;
|
|
1141
|
+
maxSnapshotBytes: number;
|
|
1142
|
+
maxScreenshotBytes: number;
|
|
1143
|
+
maxPdfBytes: number;
|
|
1144
|
+
}>;
|
|
1145
|
+
```
|
|
1146
|
+
|
|
1147
|
+
The module's fixed output bounds (characters, links, selectors, bytes).
|
|
1148
|
+
|
|
1149
|
+
---
|
|
1150
|
+
|
|
1151
|
+
### markdownInputSchema
|
|
1152
|
+
|
|
1153
|
+
```ts
|
|
1154
|
+
const markdownInputSchema: ZodObject<
|
|
1155
|
+
{
|
|
1156
|
+
url: ZodURL;
|
|
1157
|
+
maxChars: ZodDefault<ZodNumber>;
|
|
1158
|
+
},
|
|
1159
|
+
$strict
|
|
1160
|
+
>;
|
|
1161
|
+
```
|
|
1162
|
+
|
|
1163
|
+
Input of `markdown`: a URL and a character bound.
|
|
1164
|
+
|
|
1165
|
+
---
|
|
1166
|
+
|
|
1167
|
+
### markdownResultSchema
|
|
1168
|
+
|
|
1169
|
+
```ts
|
|
1170
|
+
const markdownResultSchema: ZodObject<
|
|
1171
|
+
{
|
|
1172
|
+
url: ZodString;
|
|
1173
|
+
text: ZodString;
|
|
1174
|
+
truncated: ZodBoolean;
|
|
1175
|
+
},
|
|
1176
|
+
$strict
|
|
1177
|
+
>;
|
|
1178
|
+
```
|
|
1179
|
+
|
|
1180
|
+
Output of `markdown`: the page text, possibly truncated.
|
|
1181
|
+
|
|
1182
|
+
---
|
|
1183
|
+
|
|
1184
|
+
### linksResultSchema
|
|
1185
|
+
|
|
1186
|
+
```ts
|
|
1187
|
+
const linksResultSchema: ZodObject<
|
|
1188
|
+
{
|
|
1189
|
+
url: ZodString;
|
|
1190
|
+
links: ZodArray<ZodString>;
|
|
1191
|
+
truncated: ZodBoolean;
|
|
1192
|
+
},
|
|
1193
|
+
$strict
|
|
1194
|
+
>;
|
|
1195
|
+
```
|
|
1196
|
+
|
|
1197
|
+
Output of `links`: bare URL strings, bounded.
|
|
1198
|
+
|
|
1199
|
+
---
|
|
1200
|
+
|
|
1201
|
+
### scrapeInputSchema
|
|
1202
|
+
|
|
1203
|
+
```ts
|
|
1204
|
+
const scrapeInputSchema: ZodObject<
|
|
1205
|
+
{
|
|
1206
|
+
url: ZodURL;
|
|
1207
|
+
selectors: ZodArray<ZodString>;
|
|
1208
|
+
},
|
|
1209
|
+
$strict
|
|
1210
|
+
>;
|
|
1211
|
+
```
|
|
1212
|
+
|
|
1213
|
+
Input of `scrape`: a URL and up to ten CSS selectors.
|
|
1214
|
+
|
|
1215
|
+
---
|
|
1216
|
+
|
|
1217
|
+
### scrapeResultSchema
|
|
1218
|
+
|
|
1219
|
+
```ts
|
|
1220
|
+
const scrapeResultSchema: ZodObject<
|
|
1221
|
+
{
|
|
1222
|
+
url: ZodString;
|
|
1223
|
+
result: ZodArray<
|
|
1224
|
+
ZodObject<
|
|
1225
|
+
{
|
|
1226
|
+
selector: ZodString;
|
|
1227
|
+
elements: ZodArray<
|
|
1228
|
+
ZodObject<
|
|
1229
|
+
{
|
|
1230
|
+
text: ZodString;
|
|
1231
|
+
html: ZodString;
|
|
1232
|
+
},
|
|
1233
|
+
$strict
|
|
1234
|
+
>
|
|
1235
|
+
>;
|
|
1236
|
+
},
|
|
1237
|
+
$strict
|
|
1238
|
+
>
|
|
1239
|
+
>;
|
|
1240
|
+
truncated: ZodBoolean;
|
|
1241
|
+
},
|
|
1242
|
+
$strict
|
|
1243
|
+
>;
|
|
1244
|
+
```
|
|
1245
|
+
|
|
1246
|
+
Output of `scrape`: matched elements per selector, bounded.
|
|
1247
|
+
|
|
1248
|
+
---
|
|
1249
|
+
|
|
1250
|
+
### extractInputSchema
|
|
1251
|
+
|
|
1252
|
+
```ts
|
|
1253
|
+
const extractInputSchema: ZodObject<
|
|
1254
|
+
{
|
|
1255
|
+
url: ZodURL;
|
|
1256
|
+
prompt: ZodString;
|
|
1257
|
+
},
|
|
1258
|
+
$strict
|
|
1259
|
+
>;
|
|
1260
|
+
```
|
|
1261
|
+
|
|
1262
|
+
Input of `extract`: a URL and a prompt.
|
|
1263
|
+
|
|
1264
|
+
---
|
|
1265
|
+
|
|
1266
|
+
### extractResultSchema
|
|
1267
|
+
|
|
1268
|
+
```ts
|
|
1269
|
+
const extractResultSchema: ZodObject<
|
|
1270
|
+
{
|
|
1271
|
+
url: ZodString;
|
|
1272
|
+
result: ZodJSONSchema;
|
|
1273
|
+
},
|
|
1274
|
+
$strict
|
|
1275
|
+
>;
|
|
1276
|
+
```
|
|
1277
|
+
|
|
1278
|
+
Output of `extract`: JSON-safe structured data.
|
|
1279
|
+
|
|
1280
|
+
---
|
|
1281
|
+
|
|
1282
|
+
### openResultSchema
|
|
1283
|
+
|
|
1284
|
+
```ts
|
|
1285
|
+
const openResultSchema: ZodObject<
|
|
1286
|
+
{
|
|
1287
|
+
leaseId: ZodString;
|
|
1288
|
+
url: ZodNullable<ZodString>;
|
|
1289
|
+
},
|
|
1290
|
+
$strict
|
|
1291
|
+
>;
|
|
1292
|
+
```
|
|
1293
|
+
|
|
1294
|
+
Output of `open`: the new lease and its first URL.
|
|
1295
|
+
|
|
1296
|
+
---
|
|
1297
|
+
|
|
1298
|
+
### navigateResultSchema
|
|
1299
|
+
|
|
1300
|
+
```ts
|
|
1301
|
+
const navigateResultSchema: ZodObject<
|
|
1302
|
+
{
|
|
1303
|
+
leaseId: ZodString;
|
|
1304
|
+
url: ZodString;
|
|
1305
|
+
status: ZodNullable<ZodNumber>;
|
|
1306
|
+
title: ZodNullable<ZodString>;
|
|
1307
|
+
},
|
|
1308
|
+
$strict
|
|
1309
|
+
>;
|
|
1310
|
+
```
|
|
1311
|
+
|
|
1312
|
+
Output of `navigate`: the page's location after load.
|
|
1313
|
+
|
|
1314
|
+
---
|
|
1315
|
+
|
|
1316
|
+
### snapshotResultSchema
|
|
1317
|
+
|
|
1318
|
+
```ts
|
|
1319
|
+
const snapshotResultSchema: ZodObject<
|
|
1320
|
+
{
|
|
1321
|
+
leaseId: ZodString;
|
|
1322
|
+
tree: ZodString;
|
|
1323
|
+
truncated: ZodBoolean;
|
|
1324
|
+
},
|
|
1325
|
+
$strict
|
|
1326
|
+
>;
|
|
1327
|
+
```
|
|
1328
|
+
|
|
1329
|
+
Output of `snapshot`: a bounded accessibility-tree summary.
|
|
1330
|
+
|
|
1331
|
+
## Functions
|
|
1332
|
+
|
|
1333
|
+
### createBrowser()
|
|
1334
|
+
|
|
1335
|
+
```ts
|
|
1336
|
+
function createBrowser(host, limits): Browser;
|
|
1337
|
+
```
|
|
1338
|
+
|
|
1339
|
+
`@fungi.computer/oyster/browser`: the one agent browser for the Hub and a
|
|
1340
|
+
standalone Oyster. A host builds the port from a provider (`browserRunSessions`
|
|
1341
|
+
or `bindingSessions`, plus Browser Run Quick Reads when it has them), its
|
|
1342
|
+
required metering owner and an event sink; `createBrowser` owns lease ownership,
|
|
1343
|
+
egress policy and billing order; `browserCapabilitySource` is the agent's
|
|
1344
|
+
`cloudBrowser` tool. Raw CDP stays internal to this directory.
|
|
1345
|
+
|
|
1346
|
+
#### Parameters
|
|
1347
|
+
|
|
1348
|
+
| Parameter | Type |
|
|
1349
|
+
| --------- | --------------------------------- |
|
|
1350
|
+
| `host` | [`BrowserHost`](#browserhost) |
|
|
1351
|
+
| `limits` | [`BrowserLimits`](#browserlimits) |
|
|
1352
|
+
|
|
1353
|
+
#### Returns
|
|
1354
|
+
|
|
1355
|
+
[`Browser`](#browser)
|
|
1356
|
+
|
|
1357
|
+
---
|
|
1358
|
+
|
|
1359
|
+
### browserCapabilitySource()
|
|
1360
|
+
|
|
1361
|
+
```ts
|
|
1362
|
+
function browserCapabilitySource(deps): CapabilitySource;
|
|
1363
|
+
```
|
|
1364
|
+
|
|
1365
|
+
Compose the `cloudBrowser` source for one Session, on either host. `browser` is
|
|
1366
|
+
the module's lease door (in-process, or the Hub's egress RPC); `saveFile` is the
|
|
1367
|
+
host's Computer bytes writer and `requestHandoff` its "needs you" card. A host
|
|
1368
|
+
without one passes `null` and the matching operations are not offered. A lease
|
|
1369
|
+
needs a Session identity, so a session-free host (e.g. the MCP execute path)
|
|
1370
|
+
gets no module at all.
|
|
1371
|
+
|
|
1372
|
+
#### Parameters
|
|
1373
|
+
|
|
1374
|
+
| Parameter | Type |
|
|
1375
|
+
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1376
|
+
| `deps` | `Readonly`\<\{ `identity`: () => \| `Readonly`\<\{ `teamId`: `string`; `agentId`: `string`; \}\> \| `null`; `browser`: [`AgentBrowserDoor`](#agentbrowserdoor); `quickReads`: `boolean`; `saveFile`: [`SaveBrowserFile`](#savebrowserfile) \| `null`; `requestHandoff`: ((`sessionId`, `reason`) => `void`) \| `null`; \}\> |
|
|
1377
|
+
|
|
1378
|
+
#### Returns
|
|
1379
|
+
|
|
1380
|
+
`CapabilitySource`
|
|
1381
|
+
|
|
1382
|
+
---
|
|
1383
|
+
|
|
1384
|
+
### browserRunQuickReads()
|
|
1385
|
+
|
|
1386
|
+
```ts
|
|
1387
|
+
function browserRunQuickReads(config): QuickReads;
|
|
1388
|
+
```
|
|
1389
|
+
|
|
1390
|
+
Browser Run's REST Quick Actions as a host's `QuickReads`.
|
|
1391
|
+
|
|
1392
|
+
#### Parameters
|
|
1393
|
+
|
|
1394
|
+
| Parameter | Type |
|
|
1395
|
+
| --------- | ----------------------------------------------------------- |
|
|
1396
|
+
| `config` | [`BrowserRunQuickReadsConfig`](#browserrunquickreadsconfig) |
|
|
1397
|
+
|
|
1398
|
+
#### Returns
|
|
1399
|
+
|
|
1400
|
+
[`QuickReads`](#quickreads)
|
|
1401
|
+
|
|
1402
|
+
---
|
|
1403
|
+
|
|
1404
|
+
### browserRunSessions()
|
|
1405
|
+
|
|
1406
|
+
```ts
|
|
1407
|
+
function browserRunSessions(config): BrowserSessions;
|
|
1408
|
+
```
|
|
1409
|
+
|
|
1410
|
+
Cloudflare Browser Run over REST with an account token (Hub, any celld host).
|
|
1411
|
+
|
|
1412
|
+
#### Parameters
|
|
1413
|
+
|
|
1414
|
+
| Parameter | Type |
|
|
1415
|
+
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1416
|
+
| `config` | `Readonly`\<\{ `accountId`: `string`; `apiToken`: `string`; `fetch?`: [`HttpFetch`](#httpfetch); `connect?`: [`CdpConnect`](#cdpconnect); \}\> |
|
|
1417
|
+
|
|
1418
|
+
#### Returns
|
|
1419
|
+
|
|
1420
|
+
[`BrowserSessions`](#browsersessions)
|
|
1421
|
+
|
|
1422
|
+
---
|
|
1423
|
+
|
|
1424
|
+
### bindingSessions()
|
|
1425
|
+
|
|
1426
|
+
```ts
|
|
1427
|
+
function bindingSessions(binding): BrowserSessions;
|
|
1428
|
+
```
|
|
1429
|
+
|
|
1430
|
+
A standalone Oyster's own Workers BROWSER binding.
|
|
1431
|
+
|
|
1432
|
+
#### Parameters
|
|
1433
|
+
|
|
1434
|
+
| Parameter | Type |
|
|
1435
|
+
| --------- | ----------------------------------- |
|
|
1436
|
+
| `binding` | [`BrowserBinding`](#browserbinding) |
|
|
1437
|
+
|
|
1438
|
+
#### Returns
|
|
1439
|
+
|
|
1440
|
+
[`BrowserSessions`](#browsersessions)
|