@scalebrowser/sdk 0.9.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -3
- package/README.md +4 -1
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +48 -32
- package/dist/index.d.ts +48 -32
- package/dist/index.js +9 -9
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,13 +3,53 @@
|
|
|
3
3
|
The Node/TypeScript SDK for the Scalebrowser daemon.
|
|
4
4
|
|
|
5
5
|
This file starts at 0.5.0, the oldest release still on npm when it was written
|
|
6
|
-
(2026-09-09). What came before
|
|
7
|
-
|
|
8
|
-
that had been kept all along.
|
|
6
|
+
(2026-09-09). What came before was never published as release notes, and
|
|
7
|
+
reconstructing it here would look like a record that had been kept all along.
|
|
9
8
|
|
|
10
9
|
The daemon and the SDK version independently. An SDK release names the daemon
|
|
11
10
|
version it was tested against wherever that matters.
|
|
12
11
|
|
|
12
|
+
## 1.1.0 (2026-10-04)
|
|
13
|
+
|
|
14
|
+
Three fields the daemon has sent since 0.20.0 now have types. All three are
|
|
15
|
+
optional, so code written against 1.0.0 compiles unchanged.
|
|
16
|
+
|
|
17
|
+
- `Profile.timezone_country`: the country the profile's clock places it in,
|
|
18
|
+
`null` for a zone the daemon has no country for. Read the country from here,
|
|
19
|
+
not from the language: Chrome sends the list of its interface language, so a
|
|
20
|
+
profile in Vienna sends `de-DE`.
|
|
21
|
+
- `Account.plan_required`: the account has no active plan, and choosing one is
|
|
22
|
+
the only remedy. The daemon enrols the machine by itself on its next check
|
|
23
|
+
after that.
|
|
24
|
+
- `Account.trial_available`: together with `plan_required`, the account still
|
|
25
|
+
has its free trial.
|
|
26
|
+
|
|
27
|
+
## 1.0.0 (2026-09-27)
|
|
28
|
+
|
|
29
|
+
The library works as in 0.9.0. What changes is the promise: from this release
|
|
30
|
+
on, a breaking change to the client or its types arrives only as a new major
|
|
31
|
+
version, with the reason written in this file.
|
|
32
|
+
|
|
33
|
+
- The source is public at https://github.com/blackdiamond-labs/scalebrowser-node.
|
|
34
|
+
npm builds every release from a tagged commit there and publishes it with a
|
|
35
|
+
provenance attestation, so anyone can check which commit and which workflow
|
|
36
|
+
run produced the package.
|
|
37
|
+
- The documentation comments you see in your editor no longer carry internal
|
|
38
|
+
planning references, and the video preset types are documented in English.
|
|
39
|
+
|
|
40
|
+
## 0.9.0 (2026-09-20)
|
|
41
|
+
|
|
42
|
+
- `checkProxy` answers the exit's operator (`asn`), its timezone (`timezone`)
|
|
43
|
+
and the kind of network it sits on (`exit_class`: `datacenter`,
|
|
44
|
+
`residential`, `mobile` or `unknown`).
|
|
45
|
+
- `is_mobile` is derived from `exit_class` and has three states: `true`,
|
|
46
|
+
`false`, and `null` for "could not be classified". Before, it was `false` on
|
|
47
|
+
every answer, genuinely mobile exits included.
|
|
48
|
+
- A proxy row carries `last_timezone`, the zone a profile on
|
|
49
|
+
`geo_mode: "follow_exit"` adopts at its next start.
|
|
50
|
+
- The exit-address view names the IPv6 `/64` in use as `current_v6` when the
|
|
51
|
+
daemon measures IPv6; `current` holds the IPv4 address with its `v4:` prefix.
|
|
52
|
+
|
|
13
53
|
## 0.8.1 (2026-09-16)
|
|
14
54
|
|
|
15
55
|
The published `package.json` no longer lists a `smoke` script. It pointed at a
|
package/README.md
CHANGED
|
@@ -15,7 +15,10 @@ npm install @scalebrowser/sdk
|
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Ships dual ESM + CJS with full type declarations, and needs Node ≥ 18. The SDK
|
|
18
|
-
is MIT-licensed
|
|
18
|
+
is MIT-licensed, and its source is public at
|
|
19
|
+
[blackdiamond-labs/scalebrowser-node](https://github.com/blackdiamond-labs/scalebrowser-node):
|
|
20
|
+
npm builds every release there and publishes it with a provenance attestation.
|
|
21
|
+
The daemon it talks to is a separate, licensed product.
|
|
19
22
|
|
|
20
23
|
## Quickstart
|
|
21
24
|
|
package/dist/index.cjs
CHANGED
|
@@ -17,22 +17,22 @@ var ErrorCode = {
|
|
|
17
17
|
/** Retired: the removed Methode-D (VM) tier produced this. Reserved (never reused)
|
|
18
18
|
* to match the server's append-only code contract; never returned now. */
|
|
19
19
|
VmProvisionFailed: 4007,
|
|
20
|
-
/** The subscription's abo-wide concurrent-browser allowance is used up
|
|
20
|
+
/** The subscription's abo-wide concurrent-browser allowance is used up.
|
|
21
21
|
* Distinct from Capacity (4003 = this machine is full, wait): the caller's move
|
|
22
22
|
* is to stop a running browser anywhere or upgrade the plan. */
|
|
23
23
|
ConcurrencyLimit: 4008,
|
|
24
24
|
Unauthorized: 4010,
|
|
25
|
-
/** No account is connected to this machine, so nothing may run
|
|
25
|
+
/** No account is connected to this machine, so nothing may run.
|
|
26
26
|
* Distinct from Unauthorized (4010 = the daemon's own bearer token is wrong, so
|
|
27
27
|
* re-read the token): 4011 means the machine needs to be signed in, and no token
|
|
28
28
|
* a client holds can substitute for that. Connect it in the desktop app. */
|
|
29
29
|
NotSignedIn: 4011,
|
|
30
|
-
/** This ONE profile is open on another machine of the same account
|
|
30
|
+
/** This ONE profile is open on another machine of the same account.
|
|
31
31
|
* Distinct from ConcurrencyLimit (4008 = the plan is full, buy more or free any
|
|
32
32
|
* browser): the caller's move here costs nothing. Close it on that machine, or
|
|
33
33
|
* take it over from the app running there. */
|
|
34
34
|
ProfileInUse: 4012,
|
|
35
|
-
/** The exit address this start drew belongs to another profile
|
|
35
|
+
/** The exit address this start drew belongs to another profile.
|
|
36
36
|
* Distinct from ProxyGeo (4002 = wrong country or wrong kind of exit, so change
|
|
37
37
|
* the proxy): here the proxy is fine and the address is simply spoken for. Wait
|
|
38
38
|
* for a term to run out, let the daemon draw again, or turn exclusivity off for
|
|
@@ -1217,7 +1217,7 @@ var CdpSession = class _CdpSession {
|
|
|
1217
1217
|
});
|
|
1218
1218
|
return executionContextId;
|
|
1219
1219
|
}
|
|
1220
|
-
// ── Humanized trusted input (routes through the daemon
|
|
1220
|
+
// ── Humanized trusted input (routes through the daemon) ────────────────────
|
|
1221
1221
|
humanizeMove(x, y, opts = {}) {
|
|
1222
1222
|
return this.#input({ action: "move", x, y, width: opts.width });
|
|
1223
1223
|
}
|
|
@@ -1595,7 +1595,7 @@ var ScalebrowserClient = class extends ClientCore {
|
|
|
1595
1595
|
signal
|
|
1596
1596
|
});
|
|
1597
1597
|
}
|
|
1598
|
-
// ── Exit-address exclusivity
|
|
1598
|
+
// ── Exit-address exclusivity ────────────────────────────────────────────────
|
|
1599
1599
|
/** Which exit addresses this profile owns, and how far the rule reaches.
|
|
1600
1600
|
*
|
|
1601
1601
|
* `scope` is `'machine'` while this computer has no account key. That is the
|
|
@@ -1607,14 +1607,14 @@ var ScalebrowserClient = class extends ClientCore {
|
|
|
1607
1607
|
signal
|
|
1608
1608
|
});
|
|
1609
1609
|
}
|
|
1610
|
-
// ── Session bundles
|
|
1610
|
+
// ── Session bundles ─────────────────────────────────────────────────────────
|
|
1611
1611
|
exportSession(profileId, body) {
|
|
1612
1612
|
return this.request("POST", `/v1/profiles/${enc(profileId)}/session/export`, body);
|
|
1613
1613
|
}
|
|
1614
1614
|
importSession(profileId, body) {
|
|
1615
1615
|
return this.request("POST", `/v1/profiles/${enc(profileId)}/session/import`, body);
|
|
1616
1616
|
}
|
|
1617
|
-
// ── Trusted input
|
|
1617
|
+
// ── Trusted input ──────────────────────────────────────────────────────────
|
|
1618
1618
|
sendInput(profileId, body) {
|
|
1619
1619
|
return this.request("POST", `/v1/profiles/${enc(profileId)}/input`, body);
|
|
1620
1620
|
}
|
|
@@ -1738,7 +1738,7 @@ var PROXY_KINDS = ["http", "socks5", "gateway"];
|
|
|
1738
1738
|
var ROTATIONS = ["sticky", "rotating"];
|
|
1739
1739
|
|
|
1740
1740
|
// src/index.ts
|
|
1741
|
-
var VERSION = "
|
|
1741
|
+
var VERSION = "1.1.0";
|
|
1742
1742
|
|
|
1743
1743
|
exports.ApiError = ApiError;
|
|
1744
1744
|
exports.CdpError = CdpError;
|
package/dist/index.d.cts
CHANGED
|
@@ -423,19 +423,19 @@ interface ShareStatus extends ShareLinkLocal {
|
|
|
423
423
|
* UNION of the Rust route shapes, never one serde struct (create/delete answer
|
|
424
424
|
* the bare `Profile`, list/get the flattened `ProfileView`).
|
|
425
425
|
*/
|
|
426
|
-
/** `RuntimeState
|
|
426
|
+
/** `RuntimeState`. */
|
|
427
427
|
type RuntimeState = 'stopped' | 'starting' | 'running' | 'crashed';
|
|
428
428
|
declare const RUNTIME_STATES: readonly RuntimeState[];
|
|
429
|
-
/** `GeoMode
|
|
429
|
+
/** `GeoMode`. Default `follow_exit`. */
|
|
430
430
|
type GeoMode = 'strict_expected' | 'follow_exit' | 'off';
|
|
431
431
|
declare const GEO_MODES: readonly GeoMode[];
|
|
432
|
-
/** `ProxyKind
|
|
432
|
+
/** `ProxyKind`. */
|
|
433
433
|
type ProxyKind = 'http' | 'socks5' | 'gateway';
|
|
434
434
|
declare const PROXY_KINDS: readonly ProxyKind[];
|
|
435
|
-
/** `Rotation
|
|
435
|
+
/** `Rotation`. */
|
|
436
436
|
type Rotation = 'sticky' | 'rotating';
|
|
437
437
|
declare const ROTATIONS: readonly Rotation[];
|
|
438
|
-
/** `SessionKind
|
|
438
|
+
/** `SessionKind`. */
|
|
439
439
|
type SessionKind = 'cookies' | 'local_storage' | 'indexed_db' | 'service_worker';
|
|
440
440
|
type OsFamily = 'windows' | 'macos' | 'linux';
|
|
441
441
|
/** How protected a profile is right now, decided by the daemon WITHOUT starting a
|
|
@@ -467,7 +467,7 @@ interface Profile {
|
|
|
467
467
|
expected_country: string | null;
|
|
468
468
|
/**
|
|
469
469
|
* Whether this profile claims its exit address for itself, so no other profile of
|
|
470
|
-
* the account starts on it
|
|
470
|
+
* the account starts on it. On for a new profile. Turn it off for a
|
|
471
471
|
* provider that hands out ONE address on purpose, a residential line you pay for
|
|
472
472
|
* or a whitelisted office address, where the rule would refuse every start after
|
|
473
473
|
* the first.
|
|
@@ -486,6 +486,14 @@ interface Profile {
|
|
|
486
486
|
* Additive; a daemon predating the credential vault simply omits it.
|
|
487
487
|
*/
|
|
488
488
|
platforms?: string[];
|
|
489
|
+
/**
|
|
490
|
+
* The country the persona's clock places it in (`persona.timezone`), `null` for
|
|
491
|
+
* a zone outside the daemon's cohort table. Never read the country out of the
|
|
492
|
+
* language: Chrome sends the list of its UI language, so a profile in Vienna
|
|
493
|
+
* speaks `de-DE` and one in Stockholm `en-US`. Additive; present on list/get
|
|
494
|
+
* (`ProfileView`), absent where `protection` is.
|
|
495
|
+
*/
|
|
496
|
+
timezone_country?: string | null;
|
|
489
497
|
}
|
|
490
498
|
interface Group {
|
|
491
499
|
id: string;
|
|
@@ -534,7 +542,7 @@ interface Preset {
|
|
|
534
542
|
config: PresetConfig;
|
|
535
543
|
created_at: number;
|
|
536
544
|
}
|
|
537
|
-
/**
|
|
545
|
+
/** What lies behind the page: a gradient, a colour, an image, or nothing. */
|
|
538
546
|
type VideoBackground = {
|
|
539
547
|
kind: 'gradient';
|
|
540
548
|
colors: string[];
|
|
@@ -547,7 +555,7 @@ type VideoBackground = {
|
|
|
547
555
|
} | {
|
|
548
556
|
kind: 'none';
|
|
549
557
|
};
|
|
550
|
-
/** Intro
|
|
558
|
+
/** Intro and outro. `hold_result` holds the last frame instead of a card. */
|
|
551
559
|
type VideoCard = {
|
|
552
560
|
style: 'title_card';
|
|
553
561
|
seconds: number;
|
|
@@ -555,7 +563,7 @@ type VideoCard = {
|
|
|
555
563
|
style: 'hold_result';
|
|
556
564
|
seconds: number;
|
|
557
565
|
};
|
|
558
|
-
/**
|
|
566
|
+
/** Where the finished video goes. */
|
|
559
567
|
type VideoDestination = {
|
|
560
568
|
kind: 'local';
|
|
561
569
|
} | {
|
|
@@ -564,7 +572,7 @@ type VideoDestination = {
|
|
|
564
572
|
download: boolean;
|
|
565
573
|
passcode: boolean;
|
|
566
574
|
};
|
|
567
|
-
/**
|
|
575
|
+
/** An additional output with its own dimensions. Objects, never bare strings. */
|
|
568
576
|
interface ExtraOutput {
|
|
569
577
|
preset: ExportPresetName;
|
|
570
578
|
width?: number | null;
|
|
@@ -573,16 +581,16 @@ interface ExtraOutput {
|
|
|
573
581
|
colors?: number | null;
|
|
574
582
|
max_bytes?: number | null;
|
|
575
583
|
}
|
|
576
|
-
/**
|
|
584
|
+
/** Background music, by media id, with its level. */
|
|
577
585
|
interface MusicBed {
|
|
578
586
|
media_id: string;
|
|
579
587
|
gain_db: number;
|
|
580
588
|
}
|
|
581
589
|
/**
|
|
582
|
-
*
|
|
590
|
+
* The recipe of a video: everything about the FORM, nothing about the content.
|
|
583
591
|
*
|
|
584
|
-
*
|
|
585
|
-
*
|
|
592
|
+
* Steps, length, title and narration come from the request, never from here;
|
|
593
|
+
* the only free text field is `ai_label.text`.
|
|
586
594
|
*/
|
|
587
595
|
interface VideoPresetConfig {
|
|
588
596
|
output: {
|
|
@@ -602,7 +610,7 @@ interface VideoPresetConfig {
|
|
|
602
610
|
scale: number;
|
|
603
611
|
style: 'arrow_dark' | 'arrow_light' | 'dot' | 'touch';
|
|
604
612
|
click: 'ripple' | 'ring' | 'none';
|
|
605
|
-
/** `null`
|
|
613
|
+
/** `null` keeps the pointer visible forever. */
|
|
606
614
|
hide_after_ms: number | null;
|
|
607
615
|
loop: boolean;
|
|
608
616
|
};
|
|
@@ -614,7 +622,7 @@ interface VideoPresetConfig {
|
|
|
614
622
|
zoom_scope: 'canvas' | 'card';
|
|
615
623
|
};
|
|
616
624
|
audio: {
|
|
617
|
-
/** `"<
|
|
625
|
+
/** `"<provider>:<voice>"`, or `null` for a silent video. */
|
|
618
626
|
voice: string | null;
|
|
619
627
|
language: string;
|
|
620
628
|
subtitles: 'burned' | 'file' | 'off';
|
|
@@ -866,7 +874,7 @@ interface SessionImportBody {
|
|
|
866
874
|
bundle: string;
|
|
867
875
|
}
|
|
868
876
|
/**
|
|
869
|
-
* Trusted-input payload (`POST /v1/profiles/:id/input
|
|
877
|
+
* Trusted-input payload (`POST /v1/profiles/:id/input`). Only
|
|
870
878
|
* `action` and `humanize` are fixed by the API contract; the per-action
|
|
871
879
|
* coordinate fields below are the SDK's assumption about the daemon's input
|
|
872
880
|
* layer.
|
|
@@ -1218,7 +1226,7 @@ type LifecycleEvent = {
|
|
|
1218
1226
|
* notices this connection fell behind. `dropped` counts what it skipped.
|
|
1219
1227
|
*/
|
|
1220
1228
|
/**
|
|
1221
|
-
* The exit-address guard's verdict for one running profile
|
|
1229
|
+
* The exit-address guard's verdict for one running profile.
|
|
1222
1230
|
*
|
|
1223
1231
|
* The whole state, like every other live row here: a display rebuilt from
|
|
1224
1232
|
* parts is what makes it confidently wrong, and the one frame that matters
|
|
@@ -1257,7 +1265,7 @@ type StreamedEvent = LifecycleEvent & {
|
|
|
1257
1265
|
};
|
|
1258
1266
|
|
|
1259
1267
|
/**
|
|
1260
|
-
* Live lifecycle event stream (`GET /v1/events
|
|
1268
|
+
* Live lifecycle event stream (`GET /v1/events`).
|
|
1261
1269
|
*
|
|
1262
1270
|
* Read as `text/event-stream` over `fetch` (so the Bearer header is attached, which
|
|
1263
1271
|
* the browser `EventSource` cannot do that) and reconnect with backoff. A
|
|
@@ -1417,7 +1425,7 @@ interface Account {
|
|
|
1417
1425
|
* machine connected to an account"; `signed_in` does. */
|
|
1418
1426
|
licensed: boolean;
|
|
1419
1427
|
/** Whether an account is connected to this machine. One without an account
|
|
1420
|
-
* starts no browser
|
|
1428
|
+
* starts no browser. */
|
|
1421
1429
|
signed_in: boolean;
|
|
1422
1430
|
plan?: string;
|
|
1423
1431
|
status?: string;
|
|
@@ -1434,6 +1442,14 @@ interface Account {
|
|
|
1434
1442
|
/** Unix seconds; when the cached entitlement stops being valid. */
|
|
1435
1443
|
expires_at?: number;
|
|
1436
1444
|
permits_launch: boolean;
|
|
1445
|
+
/** The control plane refused this machine because the account has no active
|
|
1446
|
+
* plan. Choosing one on the pricing page is the only remedy; the daemon
|
|
1447
|
+
* enrols the machine by itself on its next check after that. Absent when
|
|
1448
|
+
* false. */
|
|
1449
|
+
plan_required?: boolean;
|
|
1450
|
+
/** With `plan_required`: the control plane said this account still has its
|
|
1451
|
+
* free trial. Absent when false. */
|
|
1452
|
+
trial_available?: boolean;
|
|
1437
1453
|
}
|
|
1438
1454
|
interface HealthStatus {
|
|
1439
1455
|
status: string;
|
|
@@ -1482,7 +1498,7 @@ interface ExitRuleStatus {
|
|
|
1482
1498
|
interface ScalebrowserClientOptions {
|
|
1483
1499
|
/** Daemon base URL. Default `http://127.0.0.1:8787`. */
|
|
1484
1500
|
baseUrl?: string;
|
|
1485
|
-
/** Bearer token
|
|
1501
|
+
/** Bearer token. */
|
|
1486
1502
|
token?: string | null;
|
|
1487
1503
|
/** Injectable `fetch` (for testing / custom agents). Default `globalThis.fetch`. */
|
|
1488
1504
|
fetch?: FetchLike;
|
|
@@ -1638,7 +1654,7 @@ interface CreateProfileBody {
|
|
|
1638
1654
|
*/
|
|
1639
1655
|
type UpdateProfileBody = Omit<Partial<CreateProfileBody>, "seed" | "persona_country"> & {
|
|
1640
1656
|
/**
|
|
1641
|
-
* Turn the exit-address rule off for this profile
|
|
1657
|
+
* Turn the exit-address rule off for this profile. Deliberately not
|
|
1642
1658
|
* part of `CreateProfileBody`: a new profile always claims its address, and
|
|
1643
1659
|
* switching that off is a later, deliberate act for a setup that needs it.
|
|
1644
1660
|
*/
|
|
@@ -1652,7 +1668,7 @@ interface StartProfileResult {
|
|
|
1652
1668
|
cdp_ws: string;
|
|
1653
1669
|
/** DevTools TCP port, parsed from `cdp_ws` (`null` if the URL has none). */
|
|
1654
1670
|
debug_port: number | null;
|
|
1655
|
-
/** Effective headless state of this launch
|
|
1671
|
+
/** Effective headless state of this launch. */
|
|
1656
1672
|
headless: boolean;
|
|
1657
1673
|
pid: number | null;
|
|
1658
1674
|
started_at: number;
|
|
@@ -1704,7 +1720,7 @@ type UpdateProxyBody = Partial<CreateProxyBody>;
|
|
|
1704
1720
|
* Result of `POST /v1/proxies/:id/check` (health + geo).
|
|
1705
1721
|
*
|
|
1706
1722
|
* CONTRACT ASSUMPTION: the daemon returns the freshly-checked exit identity plus
|
|
1707
|
-
* the JA4↔JA4T coherence verdict
|
|
1723
|
+
* the JA4↔JA4T coherence verdict. Fields beyond the persisted `Proxy`
|
|
1708
1724
|
* columns (`ja4`, `ja4t`, `ja4t_mismatch`, `warnings`) are optional; if the
|
|
1709
1725
|
* daemon only echoes the updated `Proxy`, the JA4 verdict is simply absent.
|
|
1710
1726
|
*/
|
|
@@ -2425,7 +2441,7 @@ declare class VideosApi extends ClientCore {
|
|
|
2425
2441
|
}
|
|
2426
2442
|
|
|
2427
2443
|
/**
|
|
2428
|
-
* Direct-CDP driver
|
|
2444
|
+
* Direct-CDP driver: a minimal, nodriver-style Chrome
|
|
2429
2445
|
* DevTools Protocol client over a raw websocket. This is the recommended SDK
|
|
2430
2446
|
* driver plane: it is NOT the Playwright/Puppeteer control plane (which is a
|
|
2431
2447
|
* detection vector independent of patch quality). We never call `Runtime.enable`
|
|
@@ -2565,7 +2581,7 @@ interface CdpConnectOptions {
|
|
|
2565
2581
|
declare function openCdpSession(url: string, options?: CdpConnectOptions): Promise<CdpSession>;
|
|
2566
2582
|
|
|
2567
2583
|
/**
|
|
2568
|
-
* Dashboard/SDK metrics
|
|
2584
|
+
* Dashboard/SDK metrics. The daemon serves `GET /v1/metrics`
|
|
2569
2585
|
* from a background sampler; each null-able figure is disambiguated by
|
|
2570
2586
|
* {@link Metrics.availability} (`measured` vs `unsupported` vs `unavailable`).
|
|
2571
2587
|
* Against an old daemon without the endpoint (404) the client falls back to
|
|
@@ -2827,22 +2843,22 @@ declare const ErrorCode: {
|
|
|
2827
2843
|
/** Retired: the removed Methode-D (VM) tier produced this. Reserved (never reused)
|
|
2828
2844
|
* to match the server's append-only code contract; never returned now. */
|
|
2829
2845
|
readonly VmProvisionFailed: 4007;
|
|
2830
|
-
/** The subscription's abo-wide concurrent-browser allowance is used up
|
|
2846
|
+
/** The subscription's abo-wide concurrent-browser allowance is used up.
|
|
2831
2847
|
* Distinct from Capacity (4003 = this machine is full, wait): the caller's move
|
|
2832
2848
|
* is to stop a running browser anywhere or upgrade the plan. */
|
|
2833
2849
|
readonly ConcurrencyLimit: 4008;
|
|
2834
2850
|
readonly Unauthorized: 4010;
|
|
2835
|
-
/** No account is connected to this machine, so nothing may run
|
|
2851
|
+
/** No account is connected to this machine, so nothing may run.
|
|
2836
2852
|
* Distinct from Unauthorized (4010 = the daemon's own bearer token is wrong, so
|
|
2837
2853
|
* re-read the token): 4011 means the machine needs to be signed in, and no token
|
|
2838
2854
|
* a client holds can substitute for that. Connect it in the desktop app. */
|
|
2839
2855
|
readonly NotSignedIn: 4011;
|
|
2840
|
-
/** This ONE profile is open on another machine of the same account
|
|
2856
|
+
/** This ONE profile is open on another machine of the same account.
|
|
2841
2857
|
* Distinct from ConcurrencyLimit (4008 = the plan is full, buy more or free any
|
|
2842
2858
|
* browser): the caller's move here costs nothing. Close it on that machine, or
|
|
2843
2859
|
* take it over from the app running there. */
|
|
2844
2860
|
readonly ProfileInUse: 4012;
|
|
2845
|
-
/** The exit address this start drew belongs to another profile
|
|
2861
|
+
/** The exit address this start drew belongs to another profile.
|
|
2846
2862
|
* Distinct from ProxyGeo (4002 = wrong country or wrong kind of exit, so change
|
|
2847
2863
|
* the proxy): here the proxy is fine and the address is simply spoken for. Wait
|
|
2848
2864
|
* for a term to run out, let the daemon draw again, or turn exclusivity off for
|
|
@@ -2891,7 +2907,7 @@ declare function errorMessage(err: unknown): string;
|
|
|
2891
2907
|
/**
|
|
2892
2908
|
* `@scalebrowser/sdk`: the official Node/TypeScript SDK for the Scalebrowser
|
|
2893
2909
|
* daemon. A typed REST client plus a direct-CDP driver plane (nodriver-style,
|
|
2894
|
-
* NOT Playwright
|
|
2910
|
+
* NOT Playwright).
|
|
2895
2911
|
*
|
|
2896
2912
|
* ```ts
|
|
2897
2913
|
* import { ScalebrowserClient } from '@scalebrowser/sdk';
|
|
@@ -2905,6 +2921,6 @@ declare function errorMessage(err: unknown): string;
|
|
|
2905
2921
|
* ```
|
|
2906
2922
|
*/
|
|
2907
2923
|
|
|
2908
|
-
declare const VERSION = "
|
|
2924
|
+
declare const VERSION = "1.1.0";
|
|
2909
2925
|
|
|
2910
2926
|
export { type Account, type ActivitySnapshot, type AgentRun, ApiError, type ApiErrorBody, type ArtifactBytes, type ArtifactPutResult, type AttachOptions, type AudioStatus, type AuditDetectorReport, type AuditReport, type AuditStatus, type AuditVerdict, type BindInboxBody, type BlockedExport, type CdpConnectOptions, CdpError, type CdpEvent, CdpSession, type Chapter, type ClickOptions, type CodecsStatus, type Connection, type CreateGroupBody, type CreateInboxBody, type CreatePresetBody, type CreateTasksBody, type CreateTasksResult, DEFAULT_CAPACITY, type DeleteInterruptionRuleParams, type EffectiveInterruptionLock, ErrorCode, type ErrorCodeValue, type EvaluateOptions, type ExitClaim, type ExitRuleStatus, type ExitScope, type ExitStatus, type ExportPresetName, type ExtraOutput, type FetchLike, GEO_MODES, type GeoMode, type GoalSource, type Group, type HealthStatus, type Inbox, type InboxBinding, type InboxBindings, type InboxChannel, type InputClient, type InterruptionChoice, type InterruptionLock, type InterruptionLockRow, type InterruptionLockView, type InterruptionRuleRow, type LaunchHandle, type ListRunsParams, type ListStepsParams, type ListTasksParams, type ListVideosParams, type MediaAsset, type MediaKind, type MusicBed, type NarrationLine, type NavigateOptions, NetworkError, type OsFamily, type OutcomeSource, PROXY_KINDS, type PasskeyRow, type PatchTaskBody, type PersonaConstraintOptions, type Preset, type PresetConfig, type PresetConstraints, type PreviewHidden, type PreviewMoment, type Profile, type ProfileActivity, type ProfileMemory, type ProfileTask, type ProtectionLevel, type ProtectionStatus, type Proxy, type ProxyKind, type ProxyRow, type ProxyUsage, ROTATIONS, RUNTIME_STATES, type ReadyStatus, type Recording, type RecordingKind, type RecordingState, type RemoteStatus, type RenderProgress, type RenderRequestBody, type RenderStage, type RevealCookiesBody, type RevealCookiesResult, type RevealedCookie, type Rotation, type RunActor, type RunOutcome, type RunStep, type RuntimeState, ScalebrowserClient, type ScalebrowserClientOptions, ScalebrowserError, type ScrollOptions, type SecretBindingMode, type SecretDeleteResult, type SecretKind, type SecretListResult, type SecretOrigin, type SecretPatchBody, type SecretRow, type SecretRunBody, type SecretRunMention, type SecretRunResult, type SecretScrubResult, type SecretState, type SessionExportBody, type SessionExportResult, type SessionImportBody, type SessionKind, type SetInterruptionLockBody, type SetInterruptionRuleBody, type ShareLinkLocal, type ShareStatus, type ShotFocus, type ShotIntent, type StepKind, type StepTarget, type StreamHandlers, type StreamParams, type StreamStatus, type TaskState, type TimestampState, type TranscriptWord, type TrustedInputBody, type TtsProviderView, type TtsVerifyResult, type UpdateGroupBody, type UpdateInboxBody, type UpdatePresetBody, VERSION, type Video, type VideoAccessGrant, type VideoAssetName, type VideoAssets, type VideoBackground, type VideoCard, type VideoDestination, type VideoFlags, type VideoPreset, type VideoPresetClip, type VideoPresetClipBody, type VideoPresetClipProgress, type VideoPresetClipStarted, type VideoPresetConfig, type VideoPresetPreview, type VideoPresetPreviewBody, type VideoState, type VideosPage, type VideosStorage, type WriteMemoryBody, deriveMetricsFromProfiles, errorMessage, eventStream, openCdpSession, parseSseFrame, subscribeEvents };
|
package/dist/index.d.ts
CHANGED
|
@@ -423,19 +423,19 @@ interface ShareStatus extends ShareLinkLocal {
|
|
|
423
423
|
* UNION of the Rust route shapes, never one serde struct (create/delete answer
|
|
424
424
|
* the bare `Profile`, list/get the flattened `ProfileView`).
|
|
425
425
|
*/
|
|
426
|
-
/** `RuntimeState
|
|
426
|
+
/** `RuntimeState`. */
|
|
427
427
|
type RuntimeState = 'stopped' | 'starting' | 'running' | 'crashed';
|
|
428
428
|
declare const RUNTIME_STATES: readonly RuntimeState[];
|
|
429
|
-
/** `GeoMode
|
|
429
|
+
/** `GeoMode`. Default `follow_exit`. */
|
|
430
430
|
type GeoMode = 'strict_expected' | 'follow_exit' | 'off';
|
|
431
431
|
declare const GEO_MODES: readonly GeoMode[];
|
|
432
|
-
/** `ProxyKind
|
|
432
|
+
/** `ProxyKind`. */
|
|
433
433
|
type ProxyKind = 'http' | 'socks5' | 'gateway';
|
|
434
434
|
declare const PROXY_KINDS: readonly ProxyKind[];
|
|
435
|
-
/** `Rotation
|
|
435
|
+
/** `Rotation`. */
|
|
436
436
|
type Rotation = 'sticky' | 'rotating';
|
|
437
437
|
declare const ROTATIONS: readonly Rotation[];
|
|
438
|
-
/** `SessionKind
|
|
438
|
+
/** `SessionKind`. */
|
|
439
439
|
type SessionKind = 'cookies' | 'local_storage' | 'indexed_db' | 'service_worker';
|
|
440
440
|
type OsFamily = 'windows' | 'macos' | 'linux';
|
|
441
441
|
/** How protected a profile is right now, decided by the daemon WITHOUT starting a
|
|
@@ -467,7 +467,7 @@ interface Profile {
|
|
|
467
467
|
expected_country: string | null;
|
|
468
468
|
/**
|
|
469
469
|
* Whether this profile claims its exit address for itself, so no other profile of
|
|
470
|
-
* the account starts on it
|
|
470
|
+
* the account starts on it. On for a new profile. Turn it off for a
|
|
471
471
|
* provider that hands out ONE address on purpose, a residential line you pay for
|
|
472
472
|
* or a whitelisted office address, where the rule would refuse every start after
|
|
473
473
|
* the first.
|
|
@@ -486,6 +486,14 @@ interface Profile {
|
|
|
486
486
|
* Additive; a daemon predating the credential vault simply omits it.
|
|
487
487
|
*/
|
|
488
488
|
platforms?: string[];
|
|
489
|
+
/**
|
|
490
|
+
* The country the persona's clock places it in (`persona.timezone`), `null` for
|
|
491
|
+
* a zone outside the daemon's cohort table. Never read the country out of the
|
|
492
|
+
* language: Chrome sends the list of its UI language, so a profile in Vienna
|
|
493
|
+
* speaks `de-DE` and one in Stockholm `en-US`. Additive; present on list/get
|
|
494
|
+
* (`ProfileView`), absent where `protection` is.
|
|
495
|
+
*/
|
|
496
|
+
timezone_country?: string | null;
|
|
489
497
|
}
|
|
490
498
|
interface Group {
|
|
491
499
|
id: string;
|
|
@@ -534,7 +542,7 @@ interface Preset {
|
|
|
534
542
|
config: PresetConfig;
|
|
535
543
|
created_at: number;
|
|
536
544
|
}
|
|
537
|
-
/**
|
|
545
|
+
/** What lies behind the page: a gradient, a colour, an image, or nothing. */
|
|
538
546
|
type VideoBackground = {
|
|
539
547
|
kind: 'gradient';
|
|
540
548
|
colors: string[];
|
|
@@ -547,7 +555,7 @@ type VideoBackground = {
|
|
|
547
555
|
} | {
|
|
548
556
|
kind: 'none';
|
|
549
557
|
};
|
|
550
|
-
/** Intro
|
|
558
|
+
/** Intro and outro. `hold_result` holds the last frame instead of a card. */
|
|
551
559
|
type VideoCard = {
|
|
552
560
|
style: 'title_card';
|
|
553
561
|
seconds: number;
|
|
@@ -555,7 +563,7 @@ type VideoCard = {
|
|
|
555
563
|
style: 'hold_result';
|
|
556
564
|
seconds: number;
|
|
557
565
|
};
|
|
558
|
-
/**
|
|
566
|
+
/** Where the finished video goes. */
|
|
559
567
|
type VideoDestination = {
|
|
560
568
|
kind: 'local';
|
|
561
569
|
} | {
|
|
@@ -564,7 +572,7 @@ type VideoDestination = {
|
|
|
564
572
|
download: boolean;
|
|
565
573
|
passcode: boolean;
|
|
566
574
|
};
|
|
567
|
-
/**
|
|
575
|
+
/** An additional output with its own dimensions. Objects, never bare strings. */
|
|
568
576
|
interface ExtraOutput {
|
|
569
577
|
preset: ExportPresetName;
|
|
570
578
|
width?: number | null;
|
|
@@ -573,16 +581,16 @@ interface ExtraOutput {
|
|
|
573
581
|
colors?: number | null;
|
|
574
582
|
max_bytes?: number | null;
|
|
575
583
|
}
|
|
576
|
-
/**
|
|
584
|
+
/** Background music, by media id, with its level. */
|
|
577
585
|
interface MusicBed {
|
|
578
586
|
media_id: string;
|
|
579
587
|
gain_db: number;
|
|
580
588
|
}
|
|
581
589
|
/**
|
|
582
|
-
*
|
|
590
|
+
* The recipe of a video: everything about the FORM, nothing about the content.
|
|
583
591
|
*
|
|
584
|
-
*
|
|
585
|
-
*
|
|
592
|
+
* Steps, length, title and narration come from the request, never from here;
|
|
593
|
+
* the only free text field is `ai_label.text`.
|
|
586
594
|
*/
|
|
587
595
|
interface VideoPresetConfig {
|
|
588
596
|
output: {
|
|
@@ -602,7 +610,7 @@ interface VideoPresetConfig {
|
|
|
602
610
|
scale: number;
|
|
603
611
|
style: 'arrow_dark' | 'arrow_light' | 'dot' | 'touch';
|
|
604
612
|
click: 'ripple' | 'ring' | 'none';
|
|
605
|
-
/** `null`
|
|
613
|
+
/** `null` keeps the pointer visible forever. */
|
|
606
614
|
hide_after_ms: number | null;
|
|
607
615
|
loop: boolean;
|
|
608
616
|
};
|
|
@@ -614,7 +622,7 @@ interface VideoPresetConfig {
|
|
|
614
622
|
zoom_scope: 'canvas' | 'card';
|
|
615
623
|
};
|
|
616
624
|
audio: {
|
|
617
|
-
/** `"<
|
|
625
|
+
/** `"<provider>:<voice>"`, or `null` for a silent video. */
|
|
618
626
|
voice: string | null;
|
|
619
627
|
language: string;
|
|
620
628
|
subtitles: 'burned' | 'file' | 'off';
|
|
@@ -866,7 +874,7 @@ interface SessionImportBody {
|
|
|
866
874
|
bundle: string;
|
|
867
875
|
}
|
|
868
876
|
/**
|
|
869
|
-
* Trusted-input payload (`POST /v1/profiles/:id/input
|
|
877
|
+
* Trusted-input payload (`POST /v1/profiles/:id/input`). Only
|
|
870
878
|
* `action` and `humanize` are fixed by the API contract; the per-action
|
|
871
879
|
* coordinate fields below are the SDK's assumption about the daemon's input
|
|
872
880
|
* layer.
|
|
@@ -1218,7 +1226,7 @@ type LifecycleEvent = {
|
|
|
1218
1226
|
* notices this connection fell behind. `dropped` counts what it skipped.
|
|
1219
1227
|
*/
|
|
1220
1228
|
/**
|
|
1221
|
-
* The exit-address guard's verdict for one running profile
|
|
1229
|
+
* The exit-address guard's verdict for one running profile.
|
|
1222
1230
|
*
|
|
1223
1231
|
* The whole state, like every other live row here: a display rebuilt from
|
|
1224
1232
|
* parts is what makes it confidently wrong, and the one frame that matters
|
|
@@ -1257,7 +1265,7 @@ type StreamedEvent = LifecycleEvent & {
|
|
|
1257
1265
|
};
|
|
1258
1266
|
|
|
1259
1267
|
/**
|
|
1260
|
-
* Live lifecycle event stream (`GET /v1/events
|
|
1268
|
+
* Live lifecycle event stream (`GET /v1/events`).
|
|
1261
1269
|
*
|
|
1262
1270
|
* Read as `text/event-stream` over `fetch` (so the Bearer header is attached, which
|
|
1263
1271
|
* the browser `EventSource` cannot do that) and reconnect with backoff. A
|
|
@@ -1417,7 +1425,7 @@ interface Account {
|
|
|
1417
1425
|
* machine connected to an account"; `signed_in` does. */
|
|
1418
1426
|
licensed: boolean;
|
|
1419
1427
|
/** Whether an account is connected to this machine. One without an account
|
|
1420
|
-
* starts no browser
|
|
1428
|
+
* starts no browser. */
|
|
1421
1429
|
signed_in: boolean;
|
|
1422
1430
|
plan?: string;
|
|
1423
1431
|
status?: string;
|
|
@@ -1434,6 +1442,14 @@ interface Account {
|
|
|
1434
1442
|
/** Unix seconds; when the cached entitlement stops being valid. */
|
|
1435
1443
|
expires_at?: number;
|
|
1436
1444
|
permits_launch: boolean;
|
|
1445
|
+
/** The control plane refused this machine because the account has no active
|
|
1446
|
+
* plan. Choosing one on the pricing page is the only remedy; the daemon
|
|
1447
|
+
* enrols the machine by itself on its next check after that. Absent when
|
|
1448
|
+
* false. */
|
|
1449
|
+
plan_required?: boolean;
|
|
1450
|
+
/** With `plan_required`: the control plane said this account still has its
|
|
1451
|
+
* free trial. Absent when false. */
|
|
1452
|
+
trial_available?: boolean;
|
|
1437
1453
|
}
|
|
1438
1454
|
interface HealthStatus {
|
|
1439
1455
|
status: string;
|
|
@@ -1482,7 +1498,7 @@ interface ExitRuleStatus {
|
|
|
1482
1498
|
interface ScalebrowserClientOptions {
|
|
1483
1499
|
/** Daemon base URL. Default `http://127.0.0.1:8787`. */
|
|
1484
1500
|
baseUrl?: string;
|
|
1485
|
-
/** Bearer token
|
|
1501
|
+
/** Bearer token. */
|
|
1486
1502
|
token?: string | null;
|
|
1487
1503
|
/** Injectable `fetch` (for testing / custom agents). Default `globalThis.fetch`. */
|
|
1488
1504
|
fetch?: FetchLike;
|
|
@@ -1638,7 +1654,7 @@ interface CreateProfileBody {
|
|
|
1638
1654
|
*/
|
|
1639
1655
|
type UpdateProfileBody = Omit<Partial<CreateProfileBody>, "seed" | "persona_country"> & {
|
|
1640
1656
|
/**
|
|
1641
|
-
* Turn the exit-address rule off for this profile
|
|
1657
|
+
* Turn the exit-address rule off for this profile. Deliberately not
|
|
1642
1658
|
* part of `CreateProfileBody`: a new profile always claims its address, and
|
|
1643
1659
|
* switching that off is a later, deliberate act for a setup that needs it.
|
|
1644
1660
|
*/
|
|
@@ -1652,7 +1668,7 @@ interface StartProfileResult {
|
|
|
1652
1668
|
cdp_ws: string;
|
|
1653
1669
|
/** DevTools TCP port, parsed from `cdp_ws` (`null` if the URL has none). */
|
|
1654
1670
|
debug_port: number | null;
|
|
1655
|
-
/** Effective headless state of this launch
|
|
1671
|
+
/** Effective headless state of this launch. */
|
|
1656
1672
|
headless: boolean;
|
|
1657
1673
|
pid: number | null;
|
|
1658
1674
|
started_at: number;
|
|
@@ -1704,7 +1720,7 @@ type UpdateProxyBody = Partial<CreateProxyBody>;
|
|
|
1704
1720
|
* Result of `POST /v1/proxies/:id/check` (health + geo).
|
|
1705
1721
|
*
|
|
1706
1722
|
* CONTRACT ASSUMPTION: the daemon returns the freshly-checked exit identity plus
|
|
1707
|
-
* the JA4↔JA4T coherence verdict
|
|
1723
|
+
* the JA4↔JA4T coherence verdict. Fields beyond the persisted `Proxy`
|
|
1708
1724
|
* columns (`ja4`, `ja4t`, `ja4t_mismatch`, `warnings`) are optional; if the
|
|
1709
1725
|
* daemon only echoes the updated `Proxy`, the JA4 verdict is simply absent.
|
|
1710
1726
|
*/
|
|
@@ -2425,7 +2441,7 @@ declare class VideosApi extends ClientCore {
|
|
|
2425
2441
|
}
|
|
2426
2442
|
|
|
2427
2443
|
/**
|
|
2428
|
-
* Direct-CDP driver
|
|
2444
|
+
* Direct-CDP driver: a minimal, nodriver-style Chrome
|
|
2429
2445
|
* DevTools Protocol client over a raw websocket. This is the recommended SDK
|
|
2430
2446
|
* driver plane: it is NOT the Playwright/Puppeteer control plane (which is a
|
|
2431
2447
|
* detection vector independent of patch quality). We never call `Runtime.enable`
|
|
@@ -2565,7 +2581,7 @@ interface CdpConnectOptions {
|
|
|
2565
2581
|
declare function openCdpSession(url: string, options?: CdpConnectOptions): Promise<CdpSession>;
|
|
2566
2582
|
|
|
2567
2583
|
/**
|
|
2568
|
-
* Dashboard/SDK metrics
|
|
2584
|
+
* Dashboard/SDK metrics. The daemon serves `GET /v1/metrics`
|
|
2569
2585
|
* from a background sampler; each null-able figure is disambiguated by
|
|
2570
2586
|
* {@link Metrics.availability} (`measured` vs `unsupported` vs `unavailable`).
|
|
2571
2587
|
* Against an old daemon without the endpoint (404) the client falls back to
|
|
@@ -2827,22 +2843,22 @@ declare const ErrorCode: {
|
|
|
2827
2843
|
/** Retired: the removed Methode-D (VM) tier produced this. Reserved (never reused)
|
|
2828
2844
|
* to match the server's append-only code contract; never returned now. */
|
|
2829
2845
|
readonly VmProvisionFailed: 4007;
|
|
2830
|
-
/** The subscription's abo-wide concurrent-browser allowance is used up
|
|
2846
|
+
/** The subscription's abo-wide concurrent-browser allowance is used up.
|
|
2831
2847
|
* Distinct from Capacity (4003 = this machine is full, wait): the caller's move
|
|
2832
2848
|
* is to stop a running browser anywhere or upgrade the plan. */
|
|
2833
2849
|
readonly ConcurrencyLimit: 4008;
|
|
2834
2850
|
readonly Unauthorized: 4010;
|
|
2835
|
-
/** No account is connected to this machine, so nothing may run
|
|
2851
|
+
/** No account is connected to this machine, so nothing may run.
|
|
2836
2852
|
* Distinct from Unauthorized (4010 = the daemon's own bearer token is wrong, so
|
|
2837
2853
|
* re-read the token): 4011 means the machine needs to be signed in, and no token
|
|
2838
2854
|
* a client holds can substitute for that. Connect it in the desktop app. */
|
|
2839
2855
|
readonly NotSignedIn: 4011;
|
|
2840
|
-
/** This ONE profile is open on another machine of the same account
|
|
2856
|
+
/** This ONE profile is open on another machine of the same account.
|
|
2841
2857
|
* Distinct from ConcurrencyLimit (4008 = the plan is full, buy more or free any
|
|
2842
2858
|
* browser): the caller's move here costs nothing. Close it on that machine, or
|
|
2843
2859
|
* take it over from the app running there. */
|
|
2844
2860
|
readonly ProfileInUse: 4012;
|
|
2845
|
-
/** The exit address this start drew belongs to another profile
|
|
2861
|
+
/** The exit address this start drew belongs to another profile.
|
|
2846
2862
|
* Distinct from ProxyGeo (4002 = wrong country or wrong kind of exit, so change
|
|
2847
2863
|
* the proxy): here the proxy is fine and the address is simply spoken for. Wait
|
|
2848
2864
|
* for a term to run out, let the daemon draw again, or turn exclusivity off for
|
|
@@ -2891,7 +2907,7 @@ declare function errorMessage(err: unknown): string;
|
|
|
2891
2907
|
/**
|
|
2892
2908
|
* `@scalebrowser/sdk`: the official Node/TypeScript SDK for the Scalebrowser
|
|
2893
2909
|
* daemon. A typed REST client plus a direct-CDP driver plane (nodriver-style,
|
|
2894
|
-
* NOT Playwright
|
|
2910
|
+
* NOT Playwright).
|
|
2895
2911
|
*
|
|
2896
2912
|
* ```ts
|
|
2897
2913
|
* import { ScalebrowserClient } from '@scalebrowser/sdk';
|
|
@@ -2905,6 +2921,6 @@ declare function errorMessage(err: unknown): string;
|
|
|
2905
2921
|
* ```
|
|
2906
2922
|
*/
|
|
2907
2923
|
|
|
2908
|
-
declare const VERSION = "
|
|
2924
|
+
declare const VERSION = "1.1.0";
|
|
2909
2925
|
|
|
2910
2926
|
export { type Account, type ActivitySnapshot, type AgentRun, ApiError, type ApiErrorBody, type ArtifactBytes, type ArtifactPutResult, type AttachOptions, type AudioStatus, type AuditDetectorReport, type AuditReport, type AuditStatus, type AuditVerdict, type BindInboxBody, type BlockedExport, type CdpConnectOptions, CdpError, type CdpEvent, CdpSession, type Chapter, type ClickOptions, type CodecsStatus, type Connection, type CreateGroupBody, type CreateInboxBody, type CreatePresetBody, type CreateTasksBody, type CreateTasksResult, DEFAULT_CAPACITY, type DeleteInterruptionRuleParams, type EffectiveInterruptionLock, ErrorCode, type ErrorCodeValue, type EvaluateOptions, type ExitClaim, type ExitRuleStatus, type ExitScope, type ExitStatus, type ExportPresetName, type ExtraOutput, type FetchLike, GEO_MODES, type GeoMode, type GoalSource, type Group, type HealthStatus, type Inbox, type InboxBinding, type InboxBindings, type InboxChannel, type InputClient, type InterruptionChoice, type InterruptionLock, type InterruptionLockRow, type InterruptionLockView, type InterruptionRuleRow, type LaunchHandle, type ListRunsParams, type ListStepsParams, type ListTasksParams, type ListVideosParams, type MediaAsset, type MediaKind, type MusicBed, type NarrationLine, type NavigateOptions, NetworkError, type OsFamily, type OutcomeSource, PROXY_KINDS, type PasskeyRow, type PatchTaskBody, type PersonaConstraintOptions, type Preset, type PresetConfig, type PresetConstraints, type PreviewHidden, type PreviewMoment, type Profile, type ProfileActivity, type ProfileMemory, type ProfileTask, type ProtectionLevel, type ProtectionStatus, type Proxy, type ProxyKind, type ProxyRow, type ProxyUsage, ROTATIONS, RUNTIME_STATES, type ReadyStatus, type Recording, type RecordingKind, type RecordingState, type RemoteStatus, type RenderProgress, type RenderRequestBody, type RenderStage, type RevealCookiesBody, type RevealCookiesResult, type RevealedCookie, type Rotation, type RunActor, type RunOutcome, type RunStep, type RuntimeState, ScalebrowserClient, type ScalebrowserClientOptions, ScalebrowserError, type ScrollOptions, type SecretBindingMode, type SecretDeleteResult, type SecretKind, type SecretListResult, type SecretOrigin, type SecretPatchBody, type SecretRow, type SecretRunBody, type SecretRunMention, type SecretRunResult, type SecretScrubResult, type SecretState, type SessionExportBody, type SessionExportResult, type SessionImportBody, type SessionKind, type SetInterruptionLockBody, type SetInterruptionRuleBody, type ShareLinkLocal, type ShareStatus, type ShotFocus, type ShotIntent, type StepKind, type StepTarget, type StreamHandlers, type StreamParams, type StreamStatus, type TaskState, type TimestampState, type TranscriptWord, type TrustedInputBody, type TtsProviderView, type TtsVerifyResult, type UpdateGroupBody, type UpdateInboxBody, type UpdatePresetBody, VERSION, type Video, type VideoAccessGrant, type VideoAssetName, type VideoAssets, type VideoBackground, type VideoCard, type VideoDestination, type VideoFlags, type VideoPreset, type VideoPresetClip, type VideoPresetClipBody, type VideoPresetClipProgress, type VideoPresetClipStarted, type VideoPresetConfig, type VideoPresetPreview, type VideoPresetPreviewBody, type VideoState, type VideosPage, type VideosStorage, type WriteMemoryBody, deriveMetricsFromProfiles, errorMessage, eventStream, openCdpSession, parseSseFrame, subscribeEvents };
|
package/dist/index.js
CHANGED
|
@@ -11,22 +11,22 @@ var ErrorCode = {
|
|
|
11
11
|
/** Retired: the removed Methode-D (VM) tier produced this. Reserved (never reused)
|
|
12
12
|
* to match the server's append-only code contract; never returned now. */
|
|
13
13
|
VmProvisionFailed: 4007,
|
|
14
|
-
/** The subscription's abo-wide concurrent-browser allowance is used up
|
|
14
|
+
/** The subscription's abo-wide concurrent-browser allowance is used up.
|
|
15
15
|
* Distinct from Capacity (4003 = this machine is full, wait): the caller's move
|
|
16
16
|
* is to stop a running browser anywhere or upgrade the plan. */
|
|
17
17
|
ConcurrencyLimit: 4008,
|
|
18
18
|
Unauthorized: 4010,
|
|
19
|
-
/** No account is connected to this machine, so nothing may run
|
|
19
|
+
/** No account is connected to this machine, so nothing may run.
|
|
20
20
|
* Distinct from Unauthorized (4010 = the daemon's own bearer token is wrong, so
|
|
21
21
|
* re-read the token): 4011 means the machine needs to be signed in, and no token
|
|
22
22
|
* a client holds can substitute for that. Connect it in the desktop app. */
|
|
23
23
|
NotSignedIn: 4011,
|
|
24
|
-
/** This ONE profile is open on another machine of the same account
|
|
24
|
+
/** This ONE profile is open on another machine of the same account.
|
|
25
25
|
* Distinct from ConcurrencyLimit (4008 = the plan is full, buy more or free any
|
|
26
26
|
* browser): the caller's move here costs nothing. Close it on that machine, or
|
|
27
27
|
* take it over from the app running there. */
|
|
28
28
|
ProfileInUse: 4012,
|
|
29
|
-
/** The exit address this start drew belongs to another profile
|
|
29
|
+
/** The exit address this start drew belongs to another profile.
|
|
30
30
|
* Distinct from ProxyGeo (4002 = wrong country or wrong kind of exit, so change
|
|
31
31
|
* the proxy): here the proxy is fine and the address is simply spoken for. Wait
|
|
32
32
|
* for a term to run out, let the daemon draw again, or turn exclusivity off for
|
|
@@ -1211,7 +1211,7 @@ var CdpSession = class _CdpSession {
|
|
|
1211
1211
|
});
|
|
1212
1212
|
return executionContextId;
|
|
1213
1213
|
}
|
|
1214
|
-
// ── Humanized trusted input (routes through the daemon
|
|
1214
|
+
// ── Humanized trusted input (routes through the daemon) ────────────────────
|
|
1215
1215
|
humanizeMove(x, y, opts = {}) {
|
|
1216
1216
|
return this.#input({ action: "move", x, y, width: opts.width });
|
|
1217
1217
|
}
|
|
@@ -1589,7 +1589,7 @@ var ScalebrowserClient = class extends ClientCore {
|
|
|
1589
1589
|
signal
|
|
1590
1590
|
});
|
|
1591
1591
|
}
|
|
1592
|
-
// ── Exit-address exclusivity
|
|
1592
|
+
// ── Exit-address exclusivity ────────────────────────────────────────────────
|
|
1593
1593
|
/** Which exit addresses this profile owns, and how far the rule reaches.
|
|
1594
1594
|
*
|
|
1595
1595
|
* `scope` is `'machine'` while this computer has no account key. That is the
|
|
@@ -1601,14 +1601,14 @@ var ScalebrowserClient = class extends ClientCore {
|
|
|
1601
1601
|
signal
|
|
1602
1602
|
});
|
|
1603
1603
|
}
|
|
1604
|
-
// ── Session bundles
|
|
1604
|
+
// ── Session bundles ─────────────────────────────────────────────────────────
|
|
1605
1605
|
exportSession(profileId, body) {
|
|
1606
1606
|
return this.request("POST", `/v1/profiles/${enc(profileId)}/session/export`, body);
|
|
1607
1607
|
}
|
|
1608
1608
|
importSession(profileId, body) {
|
|
1609
1609
|
return this.request("POST", `/v1/profiles/${enc(profileId)}/session/import`, body);
|
|
1610
1610
|
}
|
|
1611
|
-
// ── Trusted input
|
|
1611
|
+
// ── Trusted input ──────────────────────────────────────────────────────────
|
|
1612
1612
|
sendInput(profileId, body) {
|
|
1613
1613
|
return this.request("POST", `/v1/profiles/${enc(profileId)}/input`, body);
|
|
1614
1614
|
}
|
|
@@ -1732,6 +1732,6 @@ var PROXY_KINDS = ["http", "socks5", "gateway"];
|
|
|
1732
1732
|
var ROTATIONS = ["sticky", "rotating"];
|
|
1733
1733
|
|
|
1734
1734
|
// src/index.ts
|
|
1735
|
-
var VERSION = "
|
|
1735
|
+
var VERSION = "1.1.0";
|
|
1736
1736
|
|
|
1737
1737
|
export { ApiError, CdpError, CdpSession, DEFAULT_CAPACITY, ErrorCode, GEO_MODES, NetworkError, PROXY_KINDS, ROTATIONS, RUNTIME_STATES, ScalebrowserClient, ScalebrowserError, VERSION, deriveMetricsFromProfiles, errorMessage, eventStream, openCdpSession, parseSseFrame, subscribeEvents };
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalebrowser/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Official Node/TypeScript SDK for the Scalebrowser daemon: typed REST client plus a direct-CDP driver plane (nodriver-style, not Playwright).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://scalebrowser.net",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/blackdiamond-labs/scalebrowser.git"
|
|
11
|
-
"directory": "sdks/node"
|
|
10
|
+
"url": "git+https://github.com/blackdiamond-labs/scalebrowser-node.git"
|
|
12
11
|
},
|
|
13
12
|
"bugs": {
|
|
14
13
|
"email": "support@scalebrowser.net"
|