@scalebrowser/sdk 1.1.0 → 1.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/CHANGELOG.md +80 -0
- package/README.md +97 -11
- package/dist/index.cjs +1623 -866
- package/dist/index.d.cts +3321 -792
- package/dist/index.d.ts +3321 -792
- package/dist/index.js +1623 -866
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,86 @@ reconstructing it here would look like a record that had been kept all along.
|
|
|
9
9
|
The daemon and the SDK version independently. An SDK release names the daemon
|
|
10
10
|
version it was tested against wherever that matters.
|
|
11
11
|
|
|
12
|
+
## 1.3.0 (2026-11-05)
|
|
13
|
+
|
|
14
|
+
Tested against daemon 0.26.0. Nothing is removed or renamed: every change adds a
|
|
15
|
+
method, a field or a value to a union. A daemon up to 0.25.x answers the new
|
|
16
|
+
workflow, table and plan routes with 404 or leaves the new fields out.
|
|
17
|
+
|
|
18
|
+
- **Plans**: an account without a subscription is on `free` now, and
|
|
19
|
+
`enterprise` is a plan too (`Account.plan`). `Account` gains `profile_limit` and
|
|
20
|
+
`workflow_limit` (absent when the plan has no cap) and `workflows_local`.
|
|
21
|
+
- `ErrorCode.PlanLimit` (4014): the plan itself stops an action, for example a
|
|
22
|
+
fourth profile on Free, a schedule on Free or a workflow over the plan's
|
|
23
|
+
number. The error body's `plan_limit` names the limit, the allowed number, the
|
|
24
|
+
plan and whether the 7-day trial is still open. `ApiError.reason` carries the
|
|
25
|
+
case where one numeric code covers several.
|
|
26
|
+
- **Workflows**, the whole surface the app's workflow editor uses, about ninety
|
|
27
|
+
methods: create, edit, rename and delete (`createWorkflow`, `editWorkflow`,
|
|
28
|
+
`renameWorkflow`, `deleteWorkflow`, `workflowDeletePreview`), versions and
|
|
29
|
+
publishing (`saveWorkflowVersion`, `publishWorkflow`, `listWorkflowVersions`,
|
|
30
|
+
`diffWorkflow`, `revertWorkflow`, `adoptWorkflowVersion`, `undoWorkflowBatch`),
|
|
31
|
+
runs (`startWorkflowRun`, `listWorkflowRuns`, `getWorkflowRun`,
|
|
32
|
+
`listWorkflowRunSteps`, `cancelWorkflowRun`, `forkWorkflowRun`,
|
|
33
|
+
`previewWorkflowRunFork`, `decideWorkflowRun`, run files), approvals
|
|
34
|
+
(`listWorkflowApprovals`, `decideWorkflowApproval`, the approval webhook),
|
|
35
|
+
triggers and switches (`workflowHooks`, `rotateWorkflowHook`,
|
|
36
|
+
`listWorkflowFires`, `listWorkflowSwitches`, `setWorkflowSwitch`,
|
|
37
|
+
`emergencyStopWorkflows`), variables, file access, repairs, readiness, usage,
|
|
38
|
+
the queue, node types and the settings schema, templates
|
|
39
|
+
(`workflowTemplates`, `instantiateTemplate`), sharing (`shareWorkflow`,
|
|
40
|
+
`importSharedWorkflow`, `revokeWorkflowShare`) and the machines a workflow runs
|
|
41
|
+
on (`workflowMachines`, `cancelWorkflowForward`).
|
|
42
|
+
- **Tables**: `createTable`, `listTables`, `getTable`, `updateTable`, `editTable`,
|
|
43
|
+
`listTableRows`, `countTableRows`, `importTable`, `exportTable`, the trash
|
|
44
|
+
(`listTableTrash`, `restoreTables`) and `deleteTable`.
|
|
45
|
+
- **Google Sheets**: `connectGoogle`, `listGoogleConnections`, `linkSheet` and
|
|
46
|
+
`disconnectGoogle`.
|
|
47
|
+
- **Model sources for the AI steps**: `listAiSources`, `createAiSource`,
|
|
48
|
+
`updateAiSource`, `checkAiSource`, `deleteAiSource`, `getAiSettings`,
|
|
49
|
+
`putAiSettings` and `listAiInvocations`.
|
|
50
|
+
- **White label**: `agencyClients`, `setAgencyDistribution`, `setAgencyAiKey`,
|
|
51
|
+
`setClientBriefMode`, `wlSharing` and `setWlSharing`.
|
|
52
|
+
- A run, an activity and an agent run can now name `workflow` as their actor
|
|
53
|
+
(`RunActor`), and `workflows` is a tool group (`ToolGroupId`).
|
|
54
|
+
|
|
55
|
+
- `revealInbox(profileId, { vault_password })`: the profile's bound mailbox for a
|
|
56
|
+
script, with every message, the code candidates in it and each link with its
|
|
57
|
+
full address. Behind the vault password, because a sign-in link IS the account.
|
|
58
|
+
- `listPendingInterruptions(profileId, { targetId })`: what waits in a tab right
|
|
59
|
+
now. Operator locks and standing rules answer what they decide first, and those
|
|
60
|
+
come back under `already_answered`.
|
|
61
|
+
- `respondInterruption(profileId, { interruption_id, choice })`: answer one the
|
|
62
|
+
way its own button would. A kind an operator lock decides is refused with 409.
|
|
63
|
+
- `LifecycleEvent` lacked three events the daemon sends: `concurrency_rejected`,
|
|
64
|
+
`secret_changed` (the whole entry as `SecretRow`, never a value) and
|
|
65
|
+
`secret_gone`. A test compares the union with the daemon's own list, so a new
|
|
66
|
+
event can no longer be missing here.
|
|
67
|
+
- `WorkflowSyncView.unsent` (`UnsentChange[]`): what this machine could not send
|
|
68
|
+
to its other machines, with the workflow, its size and since when. The daemon
|
|
69
|
+
now splits a large saved version into parts, so only a change above about 8 MB
|
|
70
|
+
lands here. Optional: a daemon up to 0.24.0 does not send it.
|
|
71
|
+
|
|
72
|
+
## 1.2.0 (2026-10-22)
|
|
73
|
+
|
|
74
|
+
Two fixes in the CDP driver, both measured against a real browser, and three
|
|
75
|
+
methods for routes the daemon serves since 0.24.0. Nothing is removed or renamed.
|
|
76
|
+
|
|
77
|
+
- `navigate()` waited for the load by reading `document.readyState` in the
|
|
78
|
+
page's own world. A page that wraps that getter saw two reads with no script of
|
|
79
|
+
its own on the stack. The wait now reads from an isolated world.
|
|
80
|
+
- `evaluate(expr, { isolated: true })` kept the id of its isolated world across a
|
|
81
|
+
navigation, so every isolated read after a page change failed with
|
|
82
|
+
`Cannot find context with specified id`. It now asks for the world of the
|
|
83
|
+
current document on every call.
|
|
84
|
+
- `revealRequest(profileId, seq, { vault_password })`: what a recorded request
|
|
85
|
+
carried (the full address with its query, every header value and, on request,
|
|
86
|
+
the body), behind the vault password. `seq` is the number the agent's
|
|
87
|
+
`net_capture` tool lists.
|
|
88
|
+
- `getAgentTools()` and `setAgentToolGroup(group, enabled)`: which optional MCP tool
|
|
89
|
+
groups agents on this machine see.
|
|
90
|
+
- The README lists every method of the client.
|
|
91
|
+
|
|
12
92
|
## 1.1.0 (2026-10-04)
|
|
13
93
|
|
|
14
94
|
Three fields the daemon has sent since 0.20.0 now have types. All three are
|
package/README.md
CHANGED
|
@@ -62,10 +62,13 @@ try {
|
|
|
62
62
|
|
|
63
63
|
Every `/v1` endpoint is a typed method on `ScalebrowserClient`:
|
|
64
64
|
|
|
65
|
-
- **Profiles**: `listProfiles`, `
|
|
66
|
-
`deleteProfile`, `startProfile`, `stopProfile
|
|
65
|
+
- **Profiles**: `listProfiles`, `listProfileIds`, `countProfiles`, `getProfile`,
|
|
66
|
+
`createProfile`, `updateProfile`, `deleteProfile`, `startProfile`, `stopProfile`.
|
|
67
|
+
`releaseProfile` drops an agent's lease without its handle (the operator's way
|
|
68
|
+
out), and `takeoverProfile` asks for a profile that is open on another machine
|
|
69
|
+
of your account
|
|
67
70
|
- **Bulk**: `bulkCreateProfiles`, `bulkStart`, `bulkStop`, `bulkDelete`,
|
|
68
|
-
`bulkAssignProxy`
|
|
71
|
+
`bulkAssignProxy`, `bulkAssignExtensions`
|
|
69
72
|
- **Groups / Presets**: `listGroups`/`createGroup`/`getGroup`/`updateGroup`/`deleteGroup`,
|
|
70
73
|
`listPresets`/`createPreset`/`getPreset`/`updatePreset`/`deletePreset`,
|
|
71
74
|
`getPersonaConstraints`. A preset is `config` (what the profiles do:
|
|
@@ -78,34 +81,114 @@ Every `/v1` endpoint is a typed method on `ScalebrowserClient`:
|
|
|
78
81
|
it; pass `id` to reuse an existing proxy's stored credentials). Credentials
|
|
79
82
|
are write-only, never returned
|
|
80
83
|
- **Extensions**: `listExtensions`, `attachExtension`, `detachExtension`, plus
|
|
81
|
-
the daemon-wide library (`
|
|
82
|
-
`deleteLibraryExtension`). An attached package IS loaded into the browser at
|
|
84
|
+
the daemon-wide library (`listLibraryExtensions`, `uploadExtension`,
|
|
85
|
+
`getLibraryExtension`, `deleteLibraryExtension`, `deleteLibraryExtensionVersion`). An attached package IS loaded into the browser at
|
|
83
86
|
launch, under the canonical Web-Store id its own key derives
|
|
84
|
-
- **Credentials**: `listCredentials`, `putCredential`, `
|
|
85
|
-
(needs the vault password), `exportCredentials`,
|
|
87
|
+
- **Credentials**: `listCredentials`, `putCredential`, `deleteCredential`,
|
|
88
|
+
`revealCredential` (needs the vault password), `exportCredentials`,
|
|
89
|
+
`importCredentials`. The vault password itself: `vaultStatus`, `setVaultPassword`
|
|
90
|
+
- **Secret layer**: `getSecretLayer`, `setSecretLayer`, `listSecrets`,
|
|
91
|
+
`updateSecret`, `deleteSecret`. `scrubText` filters a text you hold against a
|
|
92
|
+
profile's values, and `runWithSecrets` runs a command with named values in its
|
|
93
|
+
environment, so no value crosses a socket
|
|
86
94
|
- **Cookies**: `revealCookies`, the one route a cookie VALUE leaves through,
|
|
87
95
|
behind the same vault password
|
|
96
|
+
- **Recorded requests**: `revealRequest`, the one route what a request carried (query,
|
|
97
|
+
header values, body) leaves through, behind the same vault password
|
|
88
98
|
- **Sessions**: `exportSession`, `importSession`
|
|
89
99
|
- **Mailboxes**: `listInboxes`, `createInbox`, `updateInbox`, `deleteInbox`,
|
|
90
100
|
`getInboxBindings`, `bindInbox`, `unbindInbox`, which is where a profile's
|
|
91
|
-
confirmation codes arrive
|
|
101
|
+
confirmation codes arrive. `revealInbox` reads them: every message, the code
|
|
102
|
+
candidates in it and each link with its full address, behind the vault password
|
|
103
|
+
because a sign-in link IS the account
|
|
92
104
|
- **Passkeys**: `listPasskeys`, `deletePasskey`. Metadata only: the private key
|
|
93
105
|
has no field and no endpoint
|
|
94
106
|
- **Agent runs**: `listRuns`, `getRun`, `listRunSteps`, `getRunShot`,
|
|
95
107
|
`getActivity`. Read-only, all of it
|
|
96
108
|
- **Interruptions**: `listInterruptionLocks`, `setInterruptionLock`,
|
|
97
109
|
`listInterruptionRules`, `setInterruptionRule`, `deleteInterruptionRule`: who
|
|
98
|
-
may answer when the browser asks something
|
|
110
|
+
may answer when the browser asks something. `listPendingInterruptions` shows what
|
|
111
|
+
waits in a tab right now and `respondInterruption` answers it; a kind an
|
|
112
|
+
operator lock decides is refused (409)
|
|
99
113
|
- **Artifacts**: `putArtifact` (hand the daemon a file to upload later),
|
|
100
114
|
`getArtifact` (fetch a screenshot, download or saved PDF as bytes)
|
|
115
|
+
- **Tasks and memory**: `listTasks`, `createTasks`, `cancelTask`, `deleteTask`,
|
|
116
|
+
plus a profile's standing instructions for agents, its `PROFILE.md`:
|
|
117
|
+
`getProfileMemory`, `putProfileMemory`, `deleteProfileMemory`
|
|
118
|
+
- **Videos**: `listVideos`, `getVideo`, `renameVideo`, `deleteVideo`,
|
|
119
|
+
`cancelVideo`, `rerenderVideo`, `videoAccess`, `downloadVideoFile`,
|
|
120
|
+
`videosStorage`; recordings with `listRecordings`, `getRecording`,
|
|
121
|
+
`deleteRecordingRaw`, `renderRecording`; public links with `share`,
|
|
122
|
+
`shareStatus`, `revokeShare`
|
|
123
|
+
- **Video presets**: `listVideoPresets`, `getVideoPreset`, `createVideoPreset`,
|
|
124
|
+
`updateVideoPreset`, `duplicateVideoPreset`, `deleteVideoPreset`, and a look
|
|
125
|
+
at an unsaved config with `previewVideoPreset`, `previewVideoPresetClip`,
|
|
126
|
+
`downloadVideoPresetClip`. The files a preset points at: `listMedia`,
|
|
127
|
+
`uploadMedia`, `deleteMedia`, `mediaFile`. Narration keys: `listTtsProviders`,
|
|
128
|
+
`putTtsProvider`, `verifyTtsProvider`, `deleteTtsProvider`. Encoders:
|
|
129
|
+
`getCodecs`, `setCodecEnabled`
|
|
130
|
+
- **Fingerprint audit**: `startAudit` drives the profile's running browser through
|
|
131
|
+
the external detector pages, `getAudit` reads the state and the last report
|
|
132
|
+
- **Exit addresses**: `getExitStatus` (which addresses a profile owns), and the
|
|
133
|
+
machine's rule that one address belongs to one profile: `getExitRule`,
|
|
134
|
+
`setExitRule`
|
|
135
|
+
- **Machine settings**: `getRemoteAccess`, `setRemoteAccess` (may a chat service
|
|
136
|
+
reach this machine's browsers), `getAgentTools`, `setAgentToolGroup` (which
|
|
137
|
+
optional MCP tool groups agents see), `getConnection` (which installation
|
|
138
|
+
answered: its data directory and its binary)
|
|
101
139
|
- **Input**: `sendInput`
|
|
140
|
+
- **Workflows**: `listWorkflows`, `getWorkflow`, `createWorkflow`, `editWorkflow`,
|
|
141
|
+
`renameWorkflow`, `deleteWorkflow`, `workflowDeletePreview`, `extractWorkflow`.
|
|
142
|
+
`extractWorkflow` moves a part of the draft into a workflow of its own
|
|
143
|
+
- **Workflow versions**: `listWorkflowVersions`, `getWorkflowVersion`,
|
|
144
|
+
`saveWorkflowVersion`, `publishWorkflow`, `diffWorkflow`, `revertWorkflow`,
|
|
145
|
+
`adoptWorkflowVersion`, `undoWorkflowBatch`. Saving, publishing and going back
|
|
146
|
+
- **Workflow runs**: `startWorkflowRun`, `listWorkflowRuns`, `getWorkflowRun`,
|
|
147
|
+
`listWorkflowRunSteps`, `listWorkflowRunFiles`, `getWorkflowRunFile`,
|
|
148
|
+
`cancelWorkflowRun`, `forkWorkflowRun`, `previewWorkflowRunFork`,
|
|
149
|
+
`decideWorkflowRun`, `getWorkflowQueue`, `getWorkflowUsage`,
|
|
150
|
+
`getWorkflowReadiness`. A fork runs again from a chosen step and keeps the outputs
|
|
151
|
+
before it
|
|
152
|
+
- **Approvals**: `listWorkflowApprovals`, `decideWorkflowApproval`,
|
|
153
|
+
`getApprovalWebhook`, `setApprovalWebhook`. Steps that wait for a person
|
|
154
|
+
- **Triggers and switches**: `workflowHooks`, `rotateWorkflowHook`,
|
|
155
|
+
`listWorkflowFires`, `listWorkflowSwitches`, `setWorkflowSwitch`,
|
|
156
|
+
`emergencyStopWorkflows`. Schedules and webhooks need a paid plan (4014 on Free)
|
|
157
|
+
- **Variables and files**: `listWorkflowVariables`, `setWorkflowVariable`,
|
|
158
|
+
`revealWorkflowVariable`, `getWorkflowFileAccess`, `setWorkflowFileAccess`,
|
|
159
|
+
`grantWorkflowFolder`, `ungrantWorkflowFolder`, `listWorkflowFastDomains`,
|
|
160
|
+
`putWorkflowFastDomain`, `deleteWorkflowFastDomain`. A secret variable is shown
|
|
161
|
+
again only through `revealWorkflowVariable`, behind the vault password
|
|
162
|
+
- **Repairs**: `listWorkflowRepairs`, `getWorkflowRepair`, `revertWorkflowRepair`,
|
|
163
|
+
`getWorkflowRepairMetrics`. The fixes the repair made when a step broke
|
|
164
|
+
- **Building blocks**: `listNodeTypes`, `getNodeType`, `getWorkflowSettingsSchema`,
|
|
165
|
+
`getWorkflowReferenceSources`, `workflowTemplates`, `instantiateTemplate`
|
|
166
|
+
- **Sharing and machines**: `shareWorkflow`, `importSharedWorkflow`,
|
|
167
|
+
`revokeWorkflowShare`, `workflowMachines`, `cancelWorkflowForward`.
|
|
168
|
+
`workflowMachines` names the machine each profile lives on; a start sent there can
|
|
169
|
+
be cancelled
|
|
170
|
+
- **Tables**: `countTableRows`, `createTable`, `deleteTable`, `editTable`,
|
|
171
|
+
`exportTable`, `getTable`, `importTable`, `listTableRows`, `listTableTrash`,
|
|
172
|
+
`listTables`, `restoreTables`, `updateTable`. The data a workflow reads and
|
|
173
|
+
writes, with a trash
|
|
174
|
+
- **Google Sheets**: `connectGoogle`, `disconnectGoogle`, `linkSheet`,
|
|
175
|
+
`listGoogleConnections`. Linked with Google's own picker; on Free only through
|
|
176
|
+
your own Google Cloud project
|
|
177
|
+
- **Model sources**: `checkAiSource`, `createAiSource`, `deleteAiSource`,
|
|
178
|
+
`getAiSettings`, `listAiInvocations`, `listAiSources`, `putAiSettings`,
|
|
179
|
+
`updateAiSource`. The keys and models behind the AI steps
|
|
180
|
+
- **White label**: `agencyClients`, `setAgencyAiKey`, `setAgencyDistribution`,
|
|
181
|
+
`setClientBriefMode`, `setWlSharing`, `wlSharing`. For an Enterprise agency and
|
|
182
|
+
its clients
|
|
102
183
|
- **Metrics / Account / Health**: `getMetrics`, `getAccount`, `health`, `ready`.
|
|
103
184
|
The first two answer 404 on a daemon without them, which the SDK treats as
|
|
104
185
|
information rather than as an error: metrics are then derived from profile
|
|
105
186
|
state, and the account reads `licensed: false`, which is what "self-hosted, no
|
|
106
187
|
control plane" means
|
|
107
188
|
|
|
108
|
-
|
|
189
|
+
`setToken` swaps the bearer token on a live client.
|
|
190
|
+
|
|
191
|
+
Errors map to typed exceptions carrying the daemon's numeric code (4001–4014; 4014 is a plan limit, with `plan_limit` in its body):
|
|
109
192
|
|
|
110
193
|
```ts
|
|
111
194
|
import { ApiError, ErrorCode } from '@scalebrowser/sdk';
|
|
@@ -140,7 +223,10 @@ for await (const e of sb.events()) {
|
|
|
140
223
|
`CdpSession` (returned by `connectCdp` / `launch`) gives you:
|
|
141
224
|
|
|
142
225
|
- `send<T>(method, params?)`: raw CDP command, awaited by id (concurrent-safe)
|
|
143
|
-
- `navigate(url, { wait, timeout })`, `evaluate<T>(expr, { isolated })
|
|
226
|
+
- `navigate(url, { wait, timeout })`, `evaluate<T>(expr, { isolated })`. The
|
|
227
|
+
wait for the load reads from an isolated world, so a page that watches its own
|
|
228
|
+
`document.readyState` sees no foreign read; `isolated: true` asks for the world
|
|
229
|
+
of the document that is loaded now, on every call
|
|
144
230
|
- `createIsolatedWorld(frameId?, worldName?)`
|
|
145
231
|
- `attachToPage({ targetId?, create?, url? })`
|
|
146
232
|
- `on(method, cb)` / `events()`: CDP event subscription scoped to the session
|