@scalebrowser/sdk 0.8.1 → 1.0.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 +28 -3
- package/README.md +4 -1
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +80 -34
- package/dist/index.d.ts +80 -34
- package/dist/index.js +9 -9
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,13 +3,38 @@
|
|
|
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.0.0 (2026-09-27)
|
|
13
|
+
|
|
14
|
+
The library works as in 0.9.0. What changes is the promise: from this release
|
|
15
|
+
on, a breaking change to the client or its types arrives only as a new major
|
|
16
|
+
version, with the reason written in this file.
|
|
17
|
+
|
|
18
|
+
- The source is public at https://github.com/blackdiamond-labs/scalebrowser-node.
|
|
19
|
+
npm builds every release from a tagged commit there and publishes it with a
|
|
20
|
+
provenance attestation, so anyone can check which commit and which workflow
|
|
21
|
+
run produced the package.
|
|
22
|
+
- The documentation comments you see in your editor no longer carry internal
|
|
23
|
+
planning references, and the video preset types are documented in English.
|
|
24
|
+
|
|
25
|
+
## 0.9.0 (2026-09-20)
|
|
26
|
+
|
|
27
|
+
- `checkProxy` answers the exit's operator (`asn`), its timezone (`timezone`)
|
|
28
|
+
and the kind of network it sits on (`exit_class`: `datacenter`,
|
|
29
|
+
`residential`, `mobile` or `unknown`).
|
|
30
|
+
- `is_mobile` is derived from `exit_class` and has three states: `true`,
|
|
31
|
+
`false`, and `null` for "could not be classified". Before, it was `false` on
|
|
32
|
+
every answer, genuinely mobile exits included.
|
|
33
|
+
- A proxy row carries `last_timezone`, the zone a profile on
|
|
34
|
+
`geo_mode: "follow_exit"` adopts at its next start.
|
|
35
|
+
- The exit-address view names the IPv6 `/64` in use as `current_v6` when the
|
|
36
|
+
daemon measures IPv6; `current` holds the IPv4 address with its `v4:` prefix.
|
|
37
|
+
|
|
13
38
|
## 0.8.1 (2026-09-16)
|
|
14
39
|
|
|
15
40
|
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 = "0.
|
|
1741
|
+
var VERSION = "1.0.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.
|
|
@@ -534,7 +534,7 @@ interface Preset {
|
|
|
534
534
|
config: PresetConfig;
|
|
535
535
|
created_at: number;
|
|
536
536
|
}
|
|
537
|
-
/**
|
|
537
|
+
/** What lies behind the page: a gradient, a colour, an image, or nothing. */
|
|
538
538
|
type VideoBackground = {
|
|
539
539
|
kind: 'gradient';
|
|
540
540
|
colors: string[];
|
|
@@ -547,7 +547,7 @@ type VideoBackground = {
|
|
|
547
547
|
} | {
|
|
548
548
|
kind: 'none';
|
|
549
549
|
};
|
|
550
|
-
/** Intro
|
|
550
|
+
/** Intro and outro. `hold_result` holds the last frame instead of a card. */
|
|
551
551
|
type VideoCard = {
|
|
552
552
|
style: 'title_card';
|
|
553
553
|
seconds: number;
|
|
@@ -555,7 +555,7 @@ type VideoCard = {
|
|
|
555
555
|
style: 'hold_result';
|
|
556
556
|
seconds: number;
|
|
557
557
|
};
|
|
558
|
-
/**
|
|
558
|
+
/** Where the finished video goes. */
|
|
559
559
|
type VideoDestination = {
|
|
560
560
|
kind: 'local';
|
|
561
561
|
} | {
|
|
@@ -564,7 +564,7 @@ type VideoDestination = {
|
|
|
564
564
|
download: boolean;
|
|
565
565
|
passcode: boolean;
|
|
566
566
|
};
|
|
567
|
-
/**
|
|
567
|
+
/** An additional output with its own dimensions. Objects, never bare strings. */
|
|
568
568
|
interface ExtraOutput {
|
|
569
569
|
preset: ExportPresetName;
|
|
570
570
|
width?: number | null;
|
|
@@ -573,16 +573,16 @@ interface ExtraOutput {
|
|
|
573
573
|
colors?: number | null;
|
|
574
574
|
max_bytes?: number | null;
|
|
575
575
|
}
|
|
576
|
-
/**
|
|
576
|
+
/** Background music, by media id, with its level. */
|
|
577
577
|
interface MusicBed {
|
|
578
578
|
media_id: string;
|
|
579
579
|
gain_db: number;
|
|
580
580
|
}
|
|
581
581
|
/**
|
|
582
|
-
*
|
|
582
|
+
* The recipe of a video: everything about the FORM, nothing about the content.
|
|
583
583
|
*
|
|
584
|
-
*
|
|
585
|
-
*
|
|
584
|
+
* Steps, length, title and narration come from the request, never from here;
|
|
585
|
+
* the only free text field is `ai_label.text`.
|
|
586
586
|
*/
|
|
587
587
|
interface VideoPresetConfig {
|
|
588
588
|
output: {
|
|
@@ -602,7 +602,7 @@ interface VideoPresetConfig {
|
|
|
602
602
|
scale: number;
|
|
603
603
|
style: 'arrow_dark' | 'arrow_light' | 'dot' | 'touch';
|
|
604
604
|
click: 'ripple' | 'ring' | 'none';
|
|
605
|
-
/** `null`
|
|
605
|
+
/** `null` keeps the pointer visible forever. */
|
|
606
606
|
hide_after_ms: number | null;
|
|
607
607
|
loop: boolean;
|
|
608
608
|
};
|
|
@@ -614,7 +614,7 @@ interface VideoPresetConfig {
|
|
|
614
614
|
zoom_scope: 'canvas' | 'card';
|
|
615
615
|
};
|
|
616
616
|
audio: {
|
|
617
|
-
/** `"<
|
|
617
|
+
/** `"<provider>:<voice>"`, or `null` for a silent video. */
|
|
618
618
|
voice: string | null;
|
|
619
619
|
language: string;
|
|
620
620
|
subtitles: 'burned' | 'file' | 'off';
|
|
@@ -771,6 +771,18 @@ interface Proxy {
|
|
|
771
771
|
* address stays reserved for a profile.
|
|
772
772
|
*/
|
|
773
773
|
last_asn: string | null;
|
|
774
|
+
/**
|
|
775
|
+
* The IANA timezone the geo probe reported for the exit, for example
|
|
776
|
+
* `"America/Chicago"`, or `null` when it reported none.
|
|
777
|
+
*
|
|
778
|
+
* Written by the same check that writes `last_asn`, and cleared with it when
|
|
779
|
+
* the endpoint changes. It is not decoration: a profile on
|
|
780
|
+
* `geo_mode: "follow_exit"` adopts THIS zone at every start when the country's
|
|
781
|
+
* cohort knows it, instead of the country's canonical one, so a US proxy
|
|
782
|
+
* exiting in Tulsa leaves the profile on `America/Chicago` rather than
|
|
783
|
+
* `America/New_York`.
|
|
784
|
+
*/
|
|
785
|
+
last_timezone: string | null;
|
|
774
786
|
last_check_at: number | null;
|
|
775
787
|
healthy: boolean | null;
|
|
776
788
|
/** Round-trip latency of the last health check, in ms. */
|
|
@@ -854,7 +866,7 @@ interface SessionImportBody {
|
|
|
854
866
|
bundle: string;
|
|
855
867
|
}
|
|
856
868
|
/**
|
|
857
|
-
* Trusted-input payload (`POST /v1/profiles/:id/input
|
|
869
|
+
* Trusted-input payload (`POST /v1/profiles/:id/input`). Only
|
|
858
870
|
* `action` and `humanize` are fixed by the API contract; the per-action
|
|
859
871
|
* coordinate fields below are the SDK's assumption about the daemon's input
|
|
860
872
|
* layer.
|
|
@@ -954,8 +966,15 @@ interface ExitStatus {
|
|
|
954
966
|
enabled: boolean;
|
|
955
967
|
/** Derived from the newest claim, not from configuration. */
|
|
956
968
|
scope: ExitScope;
|
|
957
|
-
/** The address in use, when one is claimed. */
|
|
969
|
+
/** The IPv4 address in use, when one is claimed. Carries its `v4:` prefix. */
|
|
958
970
|
current: string | null;
|
|
971
|
+
/**
|
|
972
|
+
* The IPv6 `/64` in use, when the daemon measures v6 (`[exit] probe_url_v6`)
|
|
973
|
+
* and the exit answered over it. `null` is the ordinary case and says nothing
|
|
974
|
+
* about the exit: without that setting the guard never asks.
|
|
975
|
+
*/
|
|
976
|
+
current_v6: string | null;
|
|
977
|
+
/** How many addresses this profile owns. Both families count. */
|
|
959
978
|
owned: number;
|
|
960
979
|
claims: ExitClaim[];
|
|
961
980
|
/** Set when the profile has no proxy and is therefore exempt. */
|
|
@@ -1199,7 +1218,7 @@ type LifecycleEvent = {
|
|
|
1199
1218
|
* notices this connection fell behind. `dropped` counts what it skipped.
|
|
1200
1219
|
*/
|
|
1201
1220
|
/**
|
|
1202
|
-
* The exit-address guard's verdict for one running profile
|
|
1221
|
+
* The exit-address guard's verdict for one running profile.
|
|
1203
1222
|
*
|
|
1204
1223
|
* The whole state, like every other live row here: a display rebuilt from
|
|
1205
1224
|
* parts is what makes it confidently wrong, and the one frame that matters
|
|
@@ -1238,7 +1257,7 @@ type StreamedEvent = LifecycleEvent & {
|
|
|
1238
1257
|
};
|
|
1239
1258
|
|
|
1240
1259
|
/**
|
|
1241
|
-
* Live lifecycle event stream (`GET /v1/events
|
|
1260
|
+
* Live lifecycle event stream (`GET /v1/events`).
|
|
1242
1261
|
*
|
|
1243
1262
|
* Read as `text/event-stream` over `fetch` (so the Bearer header is attached, which
|
|
1244
1263
|
* the browser `EventSource` cannot do that) and reconnect with backoff. A
|
|
@@ -1398,7 +1417,7 @@ interface Account {
|
|
|
1398
1417
|
* machine connected to an account"; `signed_in` does. */
|
|
1399
1418
|
licensed: boolean;
|
|
1400
1419
|
/** Whether an account is connected to this machine. One without an account
|
|
1401
|
-
* starts no browser
|
|
1420
|
+
* starts no browser. */
|
|
1402
1421
|
signed_in: boolean;
|
|
1403
1422
|
plan?: string;
|
|
1404
1423
|
status?: string;
|
|
@@ -1463,7 +1482,7 @@ interface ExitRuleStatus {
|
|
|
1463
1482
|
interface ScalebrowserClientOptions {
|
|
1464
1483
|
/** Daemon base URL. Default `http://127.0.0.1:8787`. */
|
|
1465
1484
|
baseUrl?: string;
|
|
1466
|
-
/** Bearer token
|
|
1485
|
+
/** Bearer token. */
|
|
1467
1486
|
token?: string | null;
|
|
1468
1487
|
/** Injectable `fetch` (for testing / custom agents). Default `globalThis.fetch`. */
|
|
1469
1488
|
fetch?: FetchLike;
|
|
@@ -1619,7 +1638,7 @@ interface CreateProfileBody {
|
|
|
1619
1638
|
*/
|
|
1620
1639
|
type UpdateProfileBody = Omit<Partial<CreateProfileBody>, "seed" | "persona_country"> & {
|
|
1621
1640
|
/**
|
|
1622
|
-
* Turn the exit-address rule off for this profile
|
|
1641
|
+
* Turn the exit-address rule off for this profile. Deliberately not
|
|
1623
1642
|
* part of `CreateProfileBody`: a new profile always claims its address, and
|
|
1624
1643
|
* switching that off is a later, deliberate act for a setup that needs it.
|
|
1625
1644
|
*/
|
|
@@ -1633,7 +1652,7 @@ interface StartProfileResult {
|
|
|
1633
1652
|
cdp_ws: string;
|
|
1634
1653
|
/** DevTools TCP port, parsed from `cdp_ws` (`null` if the URL has none). */
|
|
1635
1654
|
debug_port: number | null;
|
|
1636
|
-
/** Effective headless state of this launch
|
|
1655
|
+
/** Effective headless state of this launch. */
|
|
1637
1656
|
headless: boolean;
|
|
1638
1657
|
pid: number | null;
|
|
1639
1658
|
started_at: number;
|
|
@@ -1685,7 +1704,7 @@ type UpdateProxyBody = Partial<CreateProxyBody>;
|
|
|
1685
1704
|
* Result of `POST /v1/proxies/:id/check` (health + geo).
|
|
1686
1705
|
*
|
|
1687
1706
|
* CONTRACT ASSUMPTION: the daemon returns the freshly-checked exit identity plus
|
|
1688
|
-
* the JA4↔JA4T coherence verdict
|
|
1707
|
+
* the JA4↔JA4T coherence verdict. Fields beyond the persisted `Proxy`
|
|
1689
1708
|
* columns (`ja4`, `ja4t`, `ja4t_mismatch`, `warnings`) are optional; if the
|
|
1690
1709
|
* daemon only echoes the updated `Proxy`, the JA4 verdict is simply absent.
|
|
1691
1710
|
*/
|
|
@@ -1693,7 +1712,34 @@ interface ProxyCheckResult {
|
|
|
1693
1712
|
healthy: boolean;
|
|
1694
1713
|
exit_ip: string | null;
|
|
1695
1714
|
country: string | null;
|
|
1696
|
-
/**
|
|
1715
|
+
/**
|
|
1716
|
+
* The operator string the geo probe answered with, e.g.
|
|
1717
|
+
* `"AS21928 T-Mobile USA, Inc."`; `null` when it reported none. Same value the
|
|
1718
|
+
* check persists as `Proxy.last_asn`.
|
|
1719
|
+
*/
|
|
1720
|
+
asn?: string | null;
|
|
1721
|
+
/**
|
|
1722
|
+
* The IANA timezone of the exit, e.g. `"America/Chicago"`; `null` when the
|
|
1723
|
+
* probe reported none. Same value the check persists as `Proxy.last_timezone`,
|
|
1724
|
+
* and the one a `follow_exit` profile adopts at its next start.
|
|
1725
|
+
*/
|
|
1726
|
+
timezone?: string | null;
|
|
1727
|
+
/**
|
|
1728
|
+
* What kind of network the exit sits on, derived from `asn` against the
|
|
1729
|
+
* daemon's own dataset. `"unknown"` means unproven, never safe: it is what you
|
|
1730
|
+
* get with no dataset installed and with an ASN the dataset does not know.
|
|
1731
|
+
* A datacenter exit is the single biggest real-world tell.
|
|
1732
|
+
*/
|
|
1733
|
+
exit_class?: "datacenter" | "residential" | "mobile" | "unknown";
|
|
1734
|
+
/**
|
|
1735
|
+
* Whether the exit is a mobile/carrier network, the best case for anti-detect.
|
|
1736
|
+
*
|
|
1737
|
+
* SINCE 2026-09-18 this is derived from `exit_class` and answers three states:
|
|
1738
|
+
* `true`, `false`, and `null` for "could not be classified". Before that it
|
|
1739
|
+
* mirrored a flag of the geo lookup that the configured endpoint never sets, so
|
|
1740
|
+
* it was structurally `false` on every answer, including genuinely mobile
|
|
1741
|
+
* exits. Treat a `null` as unknown, not as "no".
|
|
1742
|
+
*/
|
|
1697
1743
|
is_mobile?: boolean | null;
|
|
1698
1744
|
ja4?: string | null;
|
|
1699
1745
|
ja4t?: string | null;
|
|
@@ -2379,7 +2425,7 @@ declare class VideosApi extends ClientCore {
|
|
|
2379
2425
|
}
|
|
2380
2426
|
|
|
2381
2427
|
/**
|
|
2382
|
-
* Direct-CDP driver
|
|
2428
|
+
* Direct-CDP driver: a minimal, nodriver-style Chrome
|
|
2383
2429
|
* DevTools Protocol client over a raw websocket. This is the recommended SDK
|
|
2384
2430
|
* driver plane: it is NOT the Playwright/Puppeteer control plane (which is a
|
|
2385
2431
|
* detection vector independent of patch quality). We never call `Runtime.enable`
|
|
@@ -2519,7 +2565,7 @@ interface CdpConnectOptions {
|
|
|
2519
2565
|
declare function openCdpSession(url: string, options?: CdpConnectOptions): Promise<CdpSession>;
|
|
2520
2566
|
|
|
2521
2567
|
/**
|
|
2522
|
-
* Dashboard/SDK metrics
|
|
2568
|
+
* Dashboard/SDK metrics. The daemon serves `GET /v1/metrics`
|
|
2523
2569
|
* from a background sampler; each null-able figure is disambiguated by
|
|
2524
2570
|
* {@link Metrics.availability} (`measured` vs `unsupported` vs `unavailable`).
|
|
2525
2571
|
* Against an old daemon without the endpoint (404) the client falls back to
|
|
@@ -2781,22 +2827,22 @@ declare const ErrorCode: {
|
|
|
2781
2827
|
/** Retired: the removed Methode-D (VM) tier produced this. Reserved (never reused)
|
|
2782
2828
|
* to match the server's append-only code contract; never returned now. */
|
|
2783
2829
|
readonly VmProvisionFailed: 4007;
|
|
2784
|
-
/** The subscription's abo-wide concurrent-browser allowance is used up
|
|
2830
|
+
/** The subscription's abo-wide concurrent-browser allowance is used up.
|
|
2785
2831
|
* Distinct from Capacity (4003 = this machine is full, wait): the caller's move
|
|
2786
2832
|
* is to stop a running browser anywhere or upgrade the plan. */
|
|
2787
2833
|
readonly ConcurrencyLimit: 4008;
|
|
2788
2834
|
readonly Unauthorized: 4010;
|
|
2789
|
-
/** No account is connected to this machine, so nothing may run
|
|
2835
|
+
/** No account is connected to this machine, so nothing may run.
|
|
2790
2836
|
* Distinct from Unauthorized (4010 = the daemon's own bearer token is wrong, so
|
|
2791
2837
|
* re-read the token): 4011 means the machine needs to be signed in, and no token
|
|
2792
2838
|
* a client holds can substitute for that. Connect it in the desktop app. */
|
|
2793
2839
|
readonly NotSignedIn: 4011;
|
|
2794
|
-
/** This ONE profile is open on another machine of the same account
|
|
2840
|
+
/** This ONE profile is open on another machine of the same account.
|
|
2795
2841
|
* Distinct from ConcurrencyLimit (4008 = the plan is full, buy more or free any
|
|
2796
2842
|
* browser): the caller's move here costs nothing. Close it on that machine, or
|
|
2797
2843
|
* take it over from the app running there. */
|
|
2798
2844
|
readonly ProfileInUse: 4012;
|
|
2799
|
-
/** The exit address this start drew belongs to another profile
|
|
2845
|
+
/** The exit address this start drew belongs to another profile.
|
|
2800
2846
|
* Distinct from ProxyGeo (4002 = wrong country or wrong kind of exit, so change
|
|
2801
2847
|
* the proxy): here the proxy is fine and the address is simply spoken for. Wait
|
|
2802
2848
|
* for a term to run out, let the daemon draw again, or turn exclusivity off for
|
|
@@ -2845,7 +2891,7 @@ declare function errorMessage(err: unknown): string;
|
|
|
2845
2891
|
/**
|
|
2846
2892
|
* `@scalebrowser/sdk`: the official Node/TypeScript SDK for the Scalebrowser
|
|
2847
2893
|
* daemon. A typed REST client plus a direct-CDP driver plane (nodriver-style,
|
|
2848
|
-
* NOT Playwright
|
|
2894
|
+
* NOT Playwright).
|
|
2849
2895
|
*
|
|
2850
2896
|
* ```ts
|
|
2851
2897
|
* import { ScalebrowserClient } from '@scalebrowser/sdk';
|
|
@@ -2859,6 +2905,6 @@ declare function errorMessage(err: unknown): string;
|
|
|
2859
2905
|
* ```
|
|
2860
2906
|
*/
|
|
2861
2907
|
|
|
2862
|
-
declare const VERSION = "0.
|
|
2908
|
+
declare const VERSION = "1.0.0";
|
|
2863
2909
|
|
|
2864
2910
|
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.
|
|
@@ -534,7 +534,7 @@ interface Preset {
|
|
|
534
534
|
config: PresetConfig;
|
|
535
535
|
created_at: number;
|
|
536
536
|
}
|
|
537
|
-
/**
|
|
537
|
+
/** What lies behind the page: a gradient, a colour, an image, or nothing. */
|
|
538
538
|
type VideoBackground = {
|
|
539
539
|
kind: 'gradient';
|
|
540
540
|
colors: string[];
|
|
@@ -547,7 +547,7 @@ type VideoBackground = {
|
|
|
547
547
|
} | {
|
|
548
548
|
kind: 'none';
|
|
549
549
|
};
|
|
550
|
-
/** Intro
|
|
550
|
+
/** Intro and outro. `hold_result` holds the last frame instead of a card. */
|
|
551
551
|
type VideoCard = {
|
|
552
552
|
style: 'title_card';
|
|
553
553
|
seconds: number;
|
|
@@ -555,7 +555,7 @@ type VideoCard = {
|
|
|
555
555
|
style: 'hold_result';
|
|
556
556
|
seconds: number;
|
|
557
557
|
};
|
|
558
|
-
/**
|
|
558
|
+
/** Where the finished video goes. */
|
|
559
559
|
type VideoDestination = {
|
|
560
560
|
kind: 'local';
|
|
561
561
|
} | {
|
|
@@ -564,7 +564,7 @@ type VideoDestination = {
|
|
|
564
564
|
download: boolean;
|
|
565
565
|
passcode: boolean;
|
|
566
566
|
};
|
|
567
|
-
/**
|
|
567
|
+
/** An additional output with its own dimensions. Objects, never bare strings. */
|
|
568
568
|
interface ExtraOutput {
|
|
569
569
|
preset: ExportPresetName;
|
|
570
570
|
width?: number | null;
|
|
@@ -573,16 +573,16 @@ interface ExtraOutput {
|
|
|
573
573
|
colors?: number | null;
|
|
574
574
|
max_bytes?: number | null;
|
|
575
575
|
}
|
|
576
|
-
/**
|
|
576
|
+
/** Background music, by media id, with its level. */
|
|
577
577
|
interface MusicBed {
|
|
578
578
|
media_id: string;
|
|
579
579
|
gain_db: number;
|
|
580
580
|
}
|
|
581
581
|
/**
|
|
582
|
-
*
|
|
582
|
+
* The recipe of a video: everything about the FORM, nothing about the content.
|
|
583
583
|
*
|
|
584
|
-
*
|
|
585
|
-
*
|
|
584
|
+
* Steps, length, title and narration come from the request, never from here;
|
|
585
|
+
* the only free text field is `ai_label.text`.
|
|
586
586
|
*/
|
|
587
587
|
interface VideoPresetConfig {
|
|
588
588
|
output: {
|
|
@@ -602,7 +602,7 @@ interface VideoPresetConfig {
|
|
|
602
602
|
scale: number;
|
|
603
603
|
style: 'arrow_dark' | 'arrow_light' | 'dot' | 'touch';
|
|
604
604
|
click: 'ripple' | 'ring' | 'none';
|
|
605
|
-
/** `null`
|
|
605
|
+
/** `null` keeps the pointer visible forever. */
|
|
606
606
|
hide_after_ms: number | null;
|
|
607
607
|
loop: boolean;
|
|
608
608
|
};
|
|
@@ -614,7 +614,7 @@ interface VideoPresetConfig {
|
|
|
614
614
|
zoom_scope: 'canvas' | 'card';
|
|
615
615
|
};
|
|
616
616
|
audio: {
|
|
617
|
-
/** `"<
|
|
617
|
+
/** `"<provider>:<voice>"`, or `null` for a silent video. */
|
|
618
618
|
voice: string | null;
|
|
619
619
|
language: string;
|
|
620
620
|
subtitles: 'burned' | 'file' | 'off';
|
|
@@ -771,6 +771,18 @@ interface Proxy {
|
|
|
771
771
|
* address stays reserved for a profile.
|
|
772
772
|
*/
|
|
773
773
|
last_asn: string | null;
|
|
774
|
+
/**
|
|
775
|
+
* The IANA timezone the geo probe reported for the exit, for example
|
|
776
|
+
* `"America/Chicago"`, or `null` when it reported none.
|
|
777
|
+
*
|
|
778
|
+
* Written by the same check that writes `last_asn`, and cleared with it when
|
|
779
|
+
* the endpoint changes. It is not decoration: a profile on
|
|
780
|
+
* `geo_mode: "follow_exit"` adopts THIS zone at every start when the country's
|
|
781
|
+
* cohort knows it, instead of the country's canonical one, so a US proxy
|
|
782
|
+
* exiting in Tulsa leaves the profile on `America/Chicago` rather than
|
|
783
|
+
* `America/New_York`.
|
|
784
|
+
*/
|
|
785
|
+
last_timezone: string | null;
|
|
774
786
|
last_check_at: number | null;
|
|
775
787
|
healthy: boolean | null;
|
|
776
788
|
/** Round-trip latency of the last health check, in ms. */
|
|
@@ -854,7 +866,7 @@ interface SessionImportBody {
|
|
|
854
866
|
bundle: string;
|
|
855
867
|
}
|
|
856
868
|
/**
|
|
857
|
-
* Trusted-input payload (`POST /v1/profiles/:id/input
|
|
869
|
+
* Trusted-input payload (`POST /v1/profiles/:id/input`). Only
|
|
858
870
|
* `action` and `humanize` are fixed by the API contract; the per-action
|
|
859
871
|
* coordinate fields below are the SDK's assumption about the daemon's input
|
|
860
872
|
* layer.
|
|
@@ -954,8 +966,15 @@ interface ExitStatus {
|
|
|
954
966
|
enabled: boolean;
|
|
955
967
|
/** Derived from the newest claim, not from configuration. */
|
|
956
968
|
scope: ExitScope;
|
|
957
|
-
/** The address in use, when one is claimed. */
|
|
969
|
+
/** The IPv4 address in use, when one is claimed. Carries its `v4:` prefix. */
|
|
958
970
|
current: string | null;
|
|
971
|
+
/**
|
|
972
|
+
* The IPv6 `/64` in use, when the daemon measures v6 (`[exit] probe_url_v6`)
|
|
973
|
+
* and the exit answered over it. `null` is the ordinary case and says nothing
|
|
974
|
+
* about the exit: without that setting the guard never asks.
|
|
975
|
+
*/
|
|
976
|
+
current_v6: string | null;
|
|
977
|
+
/** How many addresses this profile owns. Both families count. */
|
|
959
978
|
owned: number;
|
|
960
979
|
claims: ExitClaim[];
|
|
961
980
|
/** Set when the profile has no proxy and is therefore exempt. */
|
|
@@ -1199,7 +1218,7 @@ type LifecycleEvent = {
|
|
|
1199
1218
|
* notices this connection fell behind. `dropped` counts what it skipped.
|
|
1200
1219
|
*/
|
|
1201
1220
|
/**
|
|
1202
|
-
* The exit-address guard's verdict for one running profile
|
|
1221
|
+
* The exit-address guard's verdict for one running profile.
|
|
1203
1222
|
*
|
|
1204
1223
|
* The whole state, like every other live row here: a display rebuilt from
|
|
1205
1224
|
* parts is what makes it confidently wrong, and the one frame that matters
|
|
@@ -1238,7 +1257,7 @@ type StreamedEvent = LifecycleEvent & {
|
|
|
1238
1257
|
};
|
|
1239
1258
|
|
|
1240
1259
|
/**
|
|
1241
|
-
* Live lifecycle event stream (`GET /v1/events
|
|
1260
|
+
* Live lifecycle event stream (`GET /v1/events`).
|
|
1242
1261
|
*
|
|
1243
1262
|
* Read as `text/event-stream` over `fetch` (so the Bearer header is attached, which
|
|
1244
1263
|
* the browser `EventSource` cannot do that) and reconnect with backoff. A
|
|
@@ -1398,7 +1417,7 @@ interface Account {
|
|
|
1398
1417
|
* machine connected to an account"; `signed_in` does. */
|
|
1399
1418
|
licensed: boolean;
|
|
1400
1419
|
/** Whether an account is connected to this machine. One without an account
|
|
1401
|
-
* starts no browser
|
|
1420
|
+
* starts no browser. */
|
|
1402
1421
|
signed_in: boolean;
|
|
1403
1422
|
plan?: string;
|
|
1404
1423
|
status?: string;
|
|
@@ -1463,7 +1482,7 @@ interface ExitRuleStatus {
|
|
|
1463
1482
|
interface ScalebrowserClientOptions {
|
|
1464
1483
|
/** Daemon base URL. Default `http://127.0.0.1:8787`. */
|
|
1465
1484
|
baseUrl?: string;
|
|
1466
|
-
/** Bearer token
|
|
1485
|
+
/** Bearer token. */
|
|
1467
1486
|
token?: string | null;
|
|
1468
1487
|
/** Injectable `fetch` (for testing / custom agents). Default `globalThis.fetch`. */
|
|
1469
1488
|
fetch?: FetchLike;
|
|
@@ -1619,7 +1638,7 @@ interface CreateProfileBody {
|
|
|
1619
1638
|
*/
|
|
1620
1639
|
type UpdateProfileBody = Omit<Partial<CreateProfileBody>, "seed" | "persona_country"> & {
|
|
1621
1640
|
/**
|
|
1622
|
-
* Turn the exit-address rule off for this profile
|
|
1641
|
+
* Turn the exit-address rule off for this profile. Deliberately not
|
|
1623
1642
|
* part of `CreateProfileBody`: a new profile always claims its address, and
|
|
1624
1643
|
* switching that off is a later, deliberate act for a setup that needs it.
|
|
1625
1644
|
*/
|
|
@@ -1633,7 +1652,7 @@ interface StartProfileResult {
|
|
|
1633
1652
|
cdp_ws: string;
|
|
1634
1653
|
/** DevTools TCP port, parsed from `cdp_ws` (`null` if the URL has none). */
|
|
1635
1654
|
debug_port: number | null;
|
|
1636
|
-
/** Effective headless state of this launch
|
|
1655
|
+
/** Effective headless state of this launch. */
|
|
1637
1656
|
headless: boolean;
|
|
1638
1657
|
pid: number | null;
|
|
1639
1658
|
started_at: number;
|
|
@@ -1685,7 +1704,7 @@ type UpdateProxyBody = Partial<CreateProxyBody>;
|
|
|
1685
1704
|
* Result of `POST /v1/proxies/:id/check` (health + geo).
|
|
1686
1705
|
*
|
|
1687
1706
|
* CONTRACT ASSUMPTION: the daemon returns the freshly-checked exit identity plus
|
|
1688
|
-
* the JA4↔JA4T coherence verdict
|
|
1707
|
+
* the JA4↔JA4T coherence verdict. Fields beyond the persisted `Proxy`
|
|
1689
1708
|
* columns (`ja4`, `ja4t`, `ja4t_mismatch`, `warnings`) are optional; if the
|
|
1690
1709
|
* daemon only echoes the updated `Proxy`, the JA4 verdict is simply absent.
|
|
1691
1710
|
*/
|
|
@@ -1693,7 +1712,34 @@ interface ProxyCheckResult {
|
|
|
1693
1712
|
healthy: boolean;
|
|
1694
1713
|
exit_ip: string | null;
|
|
1695
1714
|
country: string | null;
|
|
1696
|
-
/**
|
|
1715
|
+
/**
|
|
1716
|
+
* The operator string the geo probe answered with, e.g.
|
|
1717
|
+
* `"AS21928 T-Mobile USA, Inc."`; `null` when it reported none. Same value the
|
|
1718
|
+
* check persists as `Proxy.last_asn`.
|
|
1719
|
+
*/
|
|
1720
|
+
asn?: string | null;
|
|
1721
|
+
/**
|
|
1722
|
+
* The IANA timezone of the exit, e.g. `"America/Chicago"`; `null` when the
|
|
1723
|
+
* probe reported none. Same value the check persists as `Proxy.last_timezone`,
|
|
1724
|
+
* and the one a `follow_exit` profile adopts at its next start.
|
|
1725
|
+
*/
|
|
1726
|
+
timezone?: string | null;
|
|
1727
|
+
/**
|
|
1728
|
+
* What kind of network the exit sits on, derived from `asn` against the
|
|
1729
|
+
* daemon's own dataset. `"unknown"` means unproven, never safe: it is what you
|
|
1730
|
+
* get with no dataset installed and with an ASN the dataset does not know.
|
|
1731
|
+
* A datacenter exit is the single biggest real-world tell.
|
|
1732
|
+
*/
|
|
1733
|
+
exit_class?: "datacenter" | "residential" | "mobile" | "unknown";
|
|
1734
|
+
/**
|
|
1735
|
+
* Whether the exit is a mobile/carrier network, the best case for anti-detect.
|
|
1736
|
+
*
|
|
1737
|
+
* SINCE 2026-09-18 this is derived from `exit_class` and answers three states:
|
|
1738
|
+
* `true`, `false`, and `null` for "could not be classified". Before that it
|
|
1739
|
+
* mirrored a flag of the geo lookup that the configured endpoint never sets, so
|
|
1740
|
+
* it was structurally `false` on every answer, including genuinely mobile
|
|
1741
|
+
* exits. Treat a `null` as unknown, not as "no".
|
|
1742
|
+
*/
|
|
1697
1743
|
is_mobile?: boolean | null;
|
|
1698
1744
|
ja4?: string | null;
|
|
1699
1745
|
ja4t?: string | null;
|
|
@@ -2379,7 +2425,7 @@ declare class VideosApi extends ClientCore {
|
|
|
2379
2425
|
}
|
|
2380
2426
|
|
|
2381
2427
|
/**
|
|
2382
|
-
* Direct-CDP driver
|
|
2428
|
+
* Direct-CDP driver: a minimal, nodriver-style Chrome
|
|
2383
2429
|
* DevTools Protocol client over a raw websocket. This is the recommended SDK
|
|
2384
2430
|
* driver plane: it is NOT the Playwright/Puppeteer control plane (which is a
|
|
2385
2431
|
* detection vector independent of patch quality). We never call `Runtime.enable`
|
|
@@ -2519,7 +2565,7 @@ interface CdpConnectOptions {
|
|
|
2519
2565
|
declare function openCdpSession(url: string, options?: CdpConnectOptions): Promise<CdpSession>;
|
|
2520
2566
|
|
|
2521
2567
|
/**
|
|
2522
|
-
* Dashboard/SDK metrics
|
|
2568
|
+
* Dashboard/SDK metrics. The daemon serves `GET /v1/metrics`
|
|
2523
2569
|
* from a background sampler; each null-able figure is disambiguated by
|
|
2524
2570
|
* {@link Metrics.availability} (`measured` vs `unsupported` vs `unavailable`).
|
|
2525
2571
|
* Against an old daemon without the endpoint (404) the client falls back to
|
|
@@ -2781,22 +2827,22 @@ declare const ErrorCode: {
|
|
|
2781
2827
|
/** Retired: the removed Methode-D (VM) tier produced this. Reserved (never reused)
|
|
2782
2828
|
* to match the server's append-only code contract; never returned now. */
|
|
2783
2829
|
readonly VmProvisionFailed: 4007;
|
|
2784
|
-
/** The subscription's abo-wide concurrent-browser allowance is used up
|
|
2830
|
+
/** The subscription's abo-wide concurrent-browser allowance is used up.
|
|
2785
2831
|
* Distinct from Capacity (4003 = this machine is full, wait): the caller's move
|
|
2786
2832
|
* is to stop a running browser anywhere or upgrade the plan. */
|
|
2787
2833
|
readonly ConcurrencyLimit: 4008;
|
|
2788
2834
|
readonly Unauthorized: 4010;
|
|
2789
|
-
/** No account is connected to this machine, so nothing may run
|
|
2835
|
+
/** No account is connected to this machine, so nothing may run.
|
|
2790
2836
|
* Distinct from Unauthorized (4010 = the daemon's own bearer token is wrong, so
|
|
2791
2837
|
* re-read the token): 4011 means the machine needs to be signed in, and no token
|
|
2792
2838
|
* a client holds can substitute for that. Connect it in the desktop app. */
|
|
2793
2839
|
readonly NotSignedIn: 4011;
|
|
2794
|
-
/** This ONE profile is open on another machine of the same account
|
|
2840
|
+
/** This ONE profile is open on another machine of the same account.
|
|
2795
2841
|
* Distinct from ConcurrencyLimit (4008 = the plan is full, buy more or free any
|
|
2796
2842
|
* browser): the caller's move here costs nothing. Close it on that machine, or
|
|
2797
2843
|
* take it over from the app running there. */
|
|
2798
2844
|
readonly ProfileInUse: 4012;
|
|
2799
|
-
/** The exit address this start drew belongs to another profile
|
|
2845
|
+
/** The exit address this start drew belongs to another profile.
|
|
2800
2846
|
* Distinct from ProxyGeo (4002 = wrong country or wrong kind of exit, so change
|
|
2801
2847
|
* the proxy): here the proxy is fine and the address is simply spoken for. Wait
|
|
2802
2848
|
* for a term to run out, let the daemon draw again, or turn exclusivity off for
|
|
@@ -2845,7 +2891,7 @@ declare function errorMessage(err: unknown): string;
|
|
|
2845
2891
|
/**
|
|
2846
2892
|
* `@scalebrowser/sdk`: the official Node/TypeScript SDK for the Scalebrowser
|
|
2847
2893
|
* daemon. A typed REST client plus a direct-CDP driver plane (nodriver-style,
|
|
2848
|
-
* NOT Playwright
|
|
2894
|
+
* NOT Playwright).
|
|
2849
2895
|
*
|
|
2850
2896
|
* ```ts
|
|
2851
2897
|
* import { ScalebrowserClient } from '@scalebrowser/sdk';
|
|
@@ -2859,6 +2905,6 @@ declare function errorMessage(err: unknown): string;
|
|
|
2859
2905
|
* ```
|
|
2860
2906
|
*/
|
|
2861
2907
|
|
|
2862
|
-
declare const VERSION = "0.
|
|
2908
|
+
declare const VERSION = "1.0.0";
|
|
2863
2909
|
|
|
2864
2910
|
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 = "0.
|
|
1735
|
+
var VERSION = "1.0.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": "0.
|
|
3
|
+
"version": "1.0.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"
|