@scalebrowser/sdk 0.6.0 → 0.7.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/dist/index.cjs +34 -1
- package/dist/index.d.cts +179 -16
- package/dist/index.d.ts +179 -16
- package/dist/index.js +34 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -294,6 +294,17 @@ var ControlApi = class extends ClientCore {
|
|
|
294
294
|
throw err;
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
+
/**
|
|
298
|
+
* Which installation answered: its data directory and its binary.
|
|
299
|
+
*
|
|
300
|
+
* `health()` tells you something is there. This tells you WHAT, and the two are
|
|
301
|
+
* different questions whenever a machine holds more than one installation. The
|
|
302
|
+
* data directory is the identity; the address is not, because a port is a
|
|
303
|
+
* preference and a stale `runtime.json` can name one that moved.
|
|
304
|
+
*/
|
|
305
|
+
getConnection(signal) {
|
|
306
|
+
return this.request("GET", "/v1/connection", void 0, { signal });
|
|
307
|
+
}
|
|
297
308
|
/** "Is the daemon alive?" Public, needs no token. */
|
|
298
309
|
health(signal) {
|
|
299
310
|
return this.request("GET", "/health", void 0, { signal });
|
|
@@ -1524,6 +1535,7 @@ var ScalebrowserClient = class extends ClientCore {
|
|
|
1524
1535
|
);
|
|
1525
1536
|
}
|
|
1526
1537
|
// ── Proxies (credentials write-only) ────────────────────────────────────────
|
|
1538
|
+
/** The list carries `used_by` per row; `getProxy` below does not. */
|
|
1527
1539
|
listProxies(signal) {
|
|
1528
1540
|
return this.request("GET", "/v1/proxies", void 0, { signal });
|
|
1529
1541
|
}
|
|
@@ -1615,6 +1627,27 @@ var ScalebrowserClient = class extends ClientCore {
|
|
|
1615
1627
|
async setRemoteAccess(enabled, signal) {
|
|
1616
1628
|
return this.request("PUT", "/v1/remote", { enabled }, { signal });
|
|
1617
1629
|
}
|
|
1630
|
+
// ── Exit-address exclusivity (the machine's own switch) ─────────────────────
|
|
1631
|
+
/**
|
|
1632
|
+
* Does one exit address belong to one profile on this machine?
|
|
1633
|
+
*
|
|
1634
|
+
* Local like the remote-access switch above, and here for the same reason: on
|
|
1635
|
+
* a headless install there is no UI to click, and setting up fifty machines by
|
|
1636
|
+
* hand is not setting them up.
|
|
1637
|
+
*/
|
|
1638
|
+
async getExitRule(signal) {
|
|
1639
|
+
return this.request("GET", "/v1/exit-rule", void 0, { signal });
|
|
1640
|
+
}
|
|
1641
|
+
/**
|
|
1642
|
+
* Turn the exit-address rule on or off for this machine.
|
|
1643
|
+
*
|
|
1644
|
+
* Off means two of your profiles can leave over the same address. Reach for it
|
|
1645
|
+
* when the provider hands out ONE address on purpose; a per-profile switch
|
|
1646
|
+
* exists for the narrower case (`updateProfile` with `exit_exclusive`).
|
|
1647
|
+
*/
|
|
1648
|
+
async setExitRule(enabled, signal) {
|
|
1649
|
+
return this.request("PUT", "/v1/exit-rule", { enabled }, { signal });
|
|
1650
|
+
}
|
|
1618
1651
|
// ── Events (SSE) ───────────────────────────────────────────────────────────
|
|
1619
1652
|
/** Subscribe to lifecycle events. Returns an unsubscribe function. */
|
|
1620
1653
|
subscribeEvents(handlers) {
|
|
@@ -1689,7 +1722,7 @@ var PROXY_KINDS = ["http", "socks5", "gateway"];
|
|
|
1689
1722
|
var ROTATIONS = ["sticky", "rotating"];
|
|
1690
1723
|
|
|
1691
1724
|
// src/index.ts
|
|
1692
|
-
var VERSION = "0.
|
|
1725
|
+
var VERSION = "0.7.0";
|
|
1693
1726
|
|
|
1694
1727
|
exports.ApiError = ApiError;
|
|
1695
1728
|
exports.CdpError = CdpError;
|
package/dist/index.d.cts
CHANGED
|
@@ -384,13 +384,20 @@ interface ShareLinkLocal {
|
|
|
384
384
|
/**
|
|
385
385
|
* Wire types: a 1:1 mirror of the daemon's serialized domain model
|
|
386
386
|
* (`crates/core/src/model.rs`, `persona.rs`, `events.rs`) and the endpoint
|
|
387
|
-
* contract in `docs/features/api.md`.
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
*
|
|
391
|
-
*
|
|
387
|
+
* contract in `docs/features/api.md`.
|
|
388
|
+
*
|
|
389
|
+
* THIS IS THE SOURCE, and since 2026-09-09 it is the only one on the TypeScript
|
|
390
|
+
* side: `web-ui/src/api/types.ts` re-exports these files through the
|
|
391
|
+
* `@scalebrowser/wire/*` alias instead of keeping a second copy (Decision 022).
|
|
392
|
+
* Before that the same 160 declarations stood twice, and each header named the
|
|
393
|
+
* other as the truth. The Python SDK
|
|
394
|
+
* (`sdks/python/src/scalebrowser/models*.py`) still carries the shapes by hand,
|
|
392
395
|
* deliberately without a gate; a TS↔pydantic comparator is its own tool.
|
|
393
396
|
*
|
|
397
|
+
* These files import nothing but each other, and that is load-bearing rather
|
|
398
|
+
* than tidy: the web-ui pulls them into a BROWSER bundle. A guard in
|
|
399
|
+
* `web-ui/src/test/sdk-type-mirror.test.ts` holds the property.
|
|
400
|
+
*
|
|
394
401
|
* All Rust enums serialize `snake_case` (serde `rename_all`). Timestamps are
|
|
395
402
|
* unix seconds (`number`, Rust `i64`). The truth for any disagreement is the
|
|
396
403
|
* UNION of the Rust route shapes, never one serde struct (create/delete answer
|
|
@@ -442,6 +449,16 @@ interface Profile {
|
|
|
442
449
|
proxy_id: string | null;
|
|
443
450
|
geo_mode: GeoMode;
|
|
444
451
|
expected_country: string | null;
|
|
452
|
+
/**
|
|
453
|
+
* Whether this profile claims its exit address for itself, so no other profile of
|
|
454
|
+
* the account starts on it (DEC-017). On for a new profile. Turn it off for a
|
|
455
|
+
* provider that hands out ONE address on purpose, a residential line you pay for
|
|
456
|
+
* or a whitelisted office address, where the rule would refuse every start after
|
|
457
|
+
* the first.
|
|
458
|
+
*
|
|
459
|
+
* Additive: a daemon predating it omits the field.
|
|
460
|
+
*/
|
|
461
|
+
exit_exclusive?: boolean;
|
|
445
462
|
data_dir: string;
|
|
446
463
|
created_at: number;
|
|
447
464
|
last_open_at: number | null;
|
|
@@ -718,12 +735,54 @@ interface Proxy {
|
|
|
718
735
|
host: string;
|
|
719
736
|
port: number;
|
|
720
737
|
rotation: Rotation;
|
|
738
|
+
/**
|
|
739
|
+
* The operator's own name for this row, or `null` if they never gave one.
|
|
740
|
+
*
|
|
741
|
+
* The only field that tells two rows of one provider pool apart: kind, host,
|
|
742
|
+
* port and rotation are identical across a bought gateway, and the session tag
|
|
743
|
+
* that actually differs sits in the write-only username. Do not fall back to
|
|
744
|
+
* `last_exit_ip` for identity; the health check wrote it hours or days ago and
|
|
745
|
+
* a rotating exit no longer has that address.
|
|
746
|
+
*/
|
|
747
|
+
label: string | null;
|
|
721
748
|
last_exit_ip: string | null;
|
|
722
749
|
last_country: string | null;
|
|
750
|
+
/**
|
|
751
|
+
* The operator string the geo probe answered with, for example
|
|
752
|
+
* `"AS21928 T-Mobile USA, Inc."`. Part of the same measurement as the fields
|
|
753
|
+
* around it: one check writes them, an endpoint change clears them together.
|
|
754
|
+
* The daemon derives the address kind from it, which decides how long an
|
|
755
|
+
* address stays reserved for a profile.
|
|
756
|
+
*/
|
|
757
|
+
last_asn: string | null;
|
|
723
758
|
last_check_at: number | null;
|
|
724
759
|
healthy: boolean | null;
|
|
760
|
+
/** Round-trip latency of the last health check, in ms. */
|
|
761
|
+
last_latency_ms: number | null;
|
|
762
|
+
/**
|
|
763
|
+
* The row holds credentials that could not be decrypted (a database restored
|
|
764
|
+
* without its master key). Every launch through it fails closed, so a screen
|
|
765
|
+
* that shows only `healthy` paints such a row green while nothing can use it.
|
|
766
|
+
* Omitted by the daemon when false.
|
|
767
|
+
*/
|
|
768
|
+
credentials_unreadable?: boolean;
|
|
725
769
|
created_at: number;
|
|
726
770
|
}
|
|
771
|
+
/**
|
|
772
|
+
* Who depends on one proxy, as `GET /v1/proxies` reports it per row.
|
|
773
|
+
*
|
|
774
|
+
* `count` is exact, `names` holds at most three. A proxy shared by a fleet must
|
|
775
|
+
* not drag every profile name into the listing, so showing the names without the
|
|
776
|
+
* count would turn "three of forty" into "these three".
|
|
777
|
+
*/
|
|
778
|
+
interface ProxyUsage {
|
|
779
|
+
count: number;
|
|
780
|
+
names: string[];
|
|
781
|
+
}
|
|
782
|
+
/** A row of the proxy LIST: the proxy plus who uses it. The single GET has no `used_by`. */
|
|
783
|
+
interface ProxyRow extends Proxy {
|
|
784
|
+
used_by: ProxyUsage;
|
|
785
|
+
}
|
|
727
786
|
/** Per-detector outcome; `skip` means the page could not be evaluated, NOT a pass. */
|
|
728
787
|
type AuditVerdict = 'pass' | 'warn' | 'fail' | 'skip' | 'error';
|
|
729
788
|
interface AuditDetectorReport {
|
|
@@ -889,7 +948,8 @@ interface ExitStatus {
|
|
|
889
948
|
/**
|
|
890
949
|
* The per-profile task list and the profile's own durable memory.
|
|
891
950
|
*
|
|
892
|
-
*
|
|
951
|
+
* One of the files that ARE the contract; the web-ui reads them through
|
|
952
|
+
* `@scalebrowser/wire/*` rather than keeping a copy (Decision 022).
|
|
893
953
|
*/
|
|
894
954
|
/**
|
|
895
955
|
* Where a task stands.
|
|
@@ -1218,8 +1278,8 @@ declare function eventStream(params: StreamParams): AsyncIterableIterator<Lifecy
|
|
|
1218
1278
|
* What the browser asks (interruptions), the bytes that go in and out
|
|
1219
1279
|
* (artifacts), and what the licence says (account).
|
|
1220
1280
|
*
|
|
1221
|
-
*
|
|
1222
|
-
*
|
|
1281
|
+
* One of the files that ARE the contract; the web-ui reads them through
|
|
1282
|
+
* `@scalebrowser/wire/*` rather than keeping a copy (Decision 022).
|
|
1223
1283
|
*/
|
|
1224
1284
|
/** What an operator has taken out of an agent's hands. */
|
|
1225
1285
|
type InterruptionLock = 'always_block' | 'always_allow' | 'agent_decides';
|
|
@@ -1291,6 +1351,32 @@ interface ArtifactBytes {
|
|
|
1291
1351
|
/** Parsed out of `Content-Disposition`, when the daemon sent one. */
|
|
1292
1352
|
filename: string | null;
|
|
1293
1353
|
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Which installation this daemon is: the data directory it serves and the binary
|
|
1356
|
+
* it runs from.
|
|
1357
|
+
*
|
|
1358
|
+
* One machine can hold several installations, and they are told apart by their
|
|
1359
|
+
* data directory, never by their address. A port is a preference: the desktop app
|
|
1360
|
+
* takes the first free one from 8787, and a `runtime.json` left behind by an
|
|
1361
|
+
* earlier daemon can name a port that something else now holds. Ask this before
|
|
1362
|
+
* assuming the daemon you reached is the one you meant.
|
|
1363
|
+
*/
|
|
1364
|
+
interface Connection {
|
|
1365
|
+
/** The address the native API is bound to, as resolved. */
|
|
1366
|
+
native_addr: string;
|
|
1367
|
+
/** The data directory, in a form suitable for showing or for a command line. */
|
|
1368
|
+
data_dir: string;
|
|
1369
|
+
/**
|
|
1370
|
+
* The same directory, in the form two daemons compare. Case is folded on
|
|
1371
|
+
* Windows and links are resolved, so do not show this one to anybody; compare
|
|
1372
|
+
* it with another daemon's value and nothing else.
|
|
1373
|
+
*/
|
|
1374
|
+
data_dir_key: string;
|
|
1375
|
+
/** Absolute path of the running binary, for a client that launches it over stdio. */
|
|
1376
|
+
executable?: string;
|
|
1377
|
+
/** The AdsPower-compatible adapter's address, when that adapter is enabled. */
|
|
1378
|
+
adspower_addr?: string;
|
|
1379
|
+
}
|
|
1294
1380
|
/**
|
|
1295
1381
|
* Licence state, for display.
|
|
1296
1382
|
*
|
|
@@ -1344,6 +1430,27 @@ interface RemoteStatus {
|
|
|
1344
1430
|
* whatever the switch says. */
|
|
1345
1431
|
ready: boolean;
|
|
1346
1432
|
}
|
|
1433
|
+
/**
|
|
1434
|
+
* What `GET /v1/exit-rule` answers: the machine's own exit-address exclusivity
|
|
1435
|
+
* switch.
|
|
1436
|
+
*
|
|
1437
|
+
* On by default. Turn it off for a provider that hands out ONE address on
|
|
1438
|
+
* purpose, a residential line you pay for or a whitelisted office address, where
|
|
1439
|
+
* the rule would refuse every start after the first.
|
|
1440
|
+
*/
|
|
1441
|
+
interface ExitRuleStatus {
|
|
1442
|
+
/** Does the rule apply on this machine? */
|
|
1443
|
+
enabled: boolean;
|
|
1444
|
+
/** Did a person decide this, or is the configured default still standing? */
|
|
1445
|
+
explicit: boolean;
|
|
1446
|
+
/**
|
|
1447
|
+
* How many profiles switched the rule off for themselves.
|
|
1448
|
+
*
|
|
1449
|
+
* A global "on" reads as "every profile is separated", and that stops being
|
|
1450
|
+
* true the moment one profile has its own switch off.
|
|
1451
|
+
*/
|
|
1452
|
+
profiles_opted_out: number;
|
|
1453
|
+
}
|
|
1347
1454
|
|
|
1348
1455
|
interface ScalebrowserClientOptions {
|
|
1349
1456
|
/** Daemon base URL. Default `http://127.0.0.1:8787`. */
|
|
@@ -1411,6 +1518,15 @@ declare class ControlApi extends ClientCore {
|
|
|
1411
1518
|
* connected or permitted. Same shape of tolerance as {@link getMetrics}.
|
|
1412
1519
|
*/
|
|
1413
1520
|
getAccount(signal?: AbortSignal): Promise<Account>;
|
|
1521
|
+
/**
|
|
1522
|
+
* Which installation answered: its data directory and its binary.
|
|
1523
|
+
*
|
|
1524
|
+
* `health()` tells you something is there. This tells you WHAT, and the two are
|
|
1525
|
+
* different questions whenever a machine holds more than one installation. The
|
|
1526
|
+
* data directory is the identity; the address is not, because a port is a
|
|
1527
|
+
* preference and a stale `runtime.json` can name one that moved.
|
|
1528
|
+
*/
|
|
1529
|
+
getConnection(signal?: AbortSignal): Promise<Connection>;
|
|
1414
1530
|
/** "Is the daemon alive?" Public, needs no token. */
|
|
1415
1531
|
health(signal?: AbortSignal): Promise<HealthStatus>;
|
|
1416
1532
|
/** "Can it serve?" Local facts only; the control plane is deliberately not consulted. */
|
|
@@ -1453,6 +1569,21 @@ interface CreateProfileBody {
|
|
|
1453
1569
|
host_mode?: HostMode;
|
|
1454
1570
|
geo_mode?: GeoMode;
|
|
1455
1571
|
expected_country?: string | null;
|
|
1572
|
+
/**
|
|
1573
|
+
* Draw the identity for this region (ISO-3166 alpha-2, e.g. `"DE"`): language,
|
|
1574
|
+
* timezone and speech voices come out of one row of the model together. Omit to
|
|
1575
|
+
* draw unconstrained, weighted the way the population is.
|
|
1576
|
+
*
|
|
1577
|
+
* This is not `expected_country`, which only checks the exit and never touches
|
|
1578
|
+
* the identity. And it is a starting value, not a promise: under the default
|
|
1579
|
+
* `geo_mode` the launch rewrites the region to the country the profile really
|
|
1580
|
+
* exits in, which is its proxy's, or with no proxy the machine's own. The
|
|
1581
|
+
* daemon refuses the pairings where that collision is already known.
|
|
1582
|
+
*
|
|
1583
|
+
* Set only at create. A region the model cannot draw is a 400 listing the ones
|
|
1584
|
+
* it can.
|
|
1585
|
+
*/
|
|
1586
|
+
persona_country?: string;
|
|
1456
1587
|
group_id?: string | null;
|
|
1457
1588
|
proxy_id?: string | null;
|
|
1458
1589
|
}
|
|
@@ -1461,7 +1592,14 @@ interface CreateProfileBody {
|
|
|
1461
1592
|
* time (C4/C5): a DIFFERING `host_mode` is refused with 400, an unchanged echo is
|
|
1462
1593
|
* accepted. Changing a tier requires delete + recreate.
|
|
1463
1594
|
*/
|
|
1464
|
-
type UpdateProfileBody = Omit<Partial<CreateProfileBody>, "host_mode" | "seed"
|
|
1595
|
+
type UpdateProfileBody = Omit<Partial<CreateProfileBody>, "host_mode" | "seed" | "persona_country"> & {
|
|
1596
|
+
/**
|
|
1597
|
+
* Turn the exit-address rule off for this profile (DEC-017). Deliberately not
|
|
1598
|
+
* part of `CreateProfileBody`: a new profile always claims its address, and
|
|
1599
|
+
* switching that off is a later, deliberate act for a setup that needs it.
|
|
1600
|
+
*/
|
|
1601
|
+
exit_exclusive?: boolean;
|
|
1602
|
+
};
|
|
1465
1603
|
interface StartProfileBody {
|
|
1466
1604
|
headless?: boolean;
|
|
1467
1605
|
}
|
|
@@ -1510,6 +1648,12 @@ interface CreateProxyBody {
|
|
|
1510
1648
|
username?: string | null;
|
|
1511
1649
|
password?: string | null;
|
|
1512
1650
|
rotation?: Rotation;
|
|
1651
|
+
/**
|
|
1652
|
+
* The operator's own name for the row. Trimmed by the daemon; a blank string is
|
|
1653
|
+
* stored as null. On an update the field carries three states: omit the key to
|
|
1654
|
+
* leave the name alone, send `null` to clear it, send a string to set it.
|
|
1655
|
+
*/
|
|
1656
|
+
label?: string | null;
|
|
1513
1657
|
}
|
|
1514
1658
|
type UpdateProxyBody = Partial<CreateProxyBody>;
|
|
1515
1659
|
/**
|
|
@@ -1646,9 +1790,10 @@ declare class ExtensionsApi extends ClientCore {
|
|
|
1646
1790
|
* The account layer: mailboxes, passkeys and the one door a cookie value leaves
|
|
1647
1791
|
* through.
|
|
1648
1792
|
*
|
|
1649
|
-
*
|
|
1650
|
-
*
|
|
1651
|
-
* it is a REST-only route deliberately kept off
|
|
1793
|
+
* One of the files that ARE the contract; the web-ui reads them through
|
|
1794
|
+
* `@scalebrowser/wire/*` rather than keeping a copy (Decision 022). The cookie
|
|
1795
|
+
* reveal has no UI counterpart: it is a REST-only route deliberately kept off
|
|
1796
|
+
* every screen.
|
|
1652
1797
|
*/
|
|
1653
1798
|
/** One configured mailbox. The password is never sent back. */
|
|
1654
1799
|
interface Inbox {
|
|
@@ -2051,7 +2196,8 @@ declare class TasksApi extends ClientCore {
|
|
|
2051
2196
|
* the live event stream carries them, and the run list describes the same rows.
|
|
2052
2197
|
* A second copy would let the two drift apart while both looked right.
|
|
2053
2198
|
*
|
|
2054
|
-
*
|
|
2199
|
+
* One of the files that ARE the contract; the web-ui reads them through
|
|
2200
|
+
* `@scalebrowser/wire/*` rather than keeping a copy (Decision 022).
|
|
2055
2201
|
*/
|
|
2056
2202
|
|
|
2057
2203
|
/** Who made the outcome claim. `derived` means nobody did. */
|
|
@@ -2511,7 +2657,8 @@ declare class ScalebrowserClient extends ClientCore {
|
|
|
2511
2657
|
* drifts the moment that model changes and every create 400s.
|
|
2512
2658
|
*/
|
|
2513
2659
|
getPersonaConstraints(signal?: AbortSignal): Promise<PersonaConstraintOptions>;
|
|
2514
|
-
|
|
2660
|
+
/** The list carries `used_by` per row; `getProxy` below does not. */
|
|
2661
|
+
listProxies(signal?: AbortSignal): Promise<ProxyRow[]>;
|
|
2515
2662
|
getProxy(id: string, signal?: AbortSignal): Promise<Proxy>;
|
|
2516
2663
|
createProxy(body: CreateProxyBody): Promise<Proxy>;
|
|
2517
2664
|
updateProxy(id: string, body: UpdateProxyBody): Promise<Proxy>;
|
|
@@ -2549,6 +2696,22 @@ declare class ScalebrowserClient extends ClientCore {
|
|
|
2549
2696
|
getRemoteAccess(signal?: AbortSignal): Promise<RemoteStatus>;
|
|
2550
2697
|
/** Turn remote access on or off for this machine. */
|
|
2551
2698
|
setRemoteAccess(enabled: boolean, signal?: AbortSignal): Promise<RemoteStatus>;
|
|
2699
|
+
/**
|
|
2700
|
+
* Does one exit address belong to one profile on this machine?
|
|
2701
|
+
*
|
|
2702
|
+
* Local like the remote-access switch above, and here for the same reason: on
|
|
2703
|
+
* a headless install there is no UI to click, and setting up fifty machines by
|
|
2704
|
+
* hand is not setting them up.
|
|
2705
|
+
*/
|
|
2706
|
+
getExitRule(signal?: AbortSignal): Promise<ExitRuleStatus>;
|
|
2707
|
+
/**
|
|
2708
|
+
* Turn the exit-address rule on or off for this machine.
|
|
2709
|
+
*
|
|
2710
|
+
* Off means two of your profiles can leave over the same address. Reach for it
|
|
2711
|
+
* when the provider hands out ONE address on purpose; a per-profile switch
|
|
2712
|
+
* exists for the narrower case (`updateProfile` with `exit_exclusive`).
|
|
2713
|
+
*/
|
|
2714
|
+
setExitRule(enabled: boolean, signal?: AbortSignal): Promise<ExitRuleStatus>;
|
|
2552
2715
|
/** Subscribe to lifecycle events. Returns an unsubscribe function. */
|
|
2553
2716
|
subscribeEvents(handlers: StreamHandlers): () => void;
|
|
2554
2717
|
/** `for await (const event of client.events())` over lifecycle events. */
|
|
@@ -2661,6 +2824,6 @@ declare function errorMessage(err: unknown): string;
|
|
|
2661
2824
|
* ```
|
|
2662
2825
|
*/
|
|
2663
2826
|
|
|
2664
|
-
declare const VERSION = "0.
|
|
2827
|
+
declare const VERSION = "0.7.0";
|
|
2665
2828
|
|
|
2666
|
-
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 CdpConnectOptions, CdpError, type CdpEvent, CdpSession, type Chapter, type ClickOptions, type CodecsStatus, type CreateGroupBody, type CreateInboxBody, type CreatePresetBody, type CreateTasksBody, type CreateTasksResult, DEFAULT_CAPACITY, type DeleteInterruptionRuleParams, type EffectiveInterruptionLock, ErrorCode, type ErrorCodeValue, type EvaluateOptions, type ExitClaim, type ExitScope, type ExitStatus, type ExportPresetName, type ExtraOutput, type FetchLike, GEO_MODES, type GeoMode, type GoalSource, type Group, HOST_MODES, type HealthStatus, type HostMode, 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, 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 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 };
|
|
2829
|
+
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 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, HOST_MODES, type HealthStatus, type HostMode, 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 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
|
@@ -384,13 +384,20 @@ interface ShareLinkLocal {
|
|
|
384
384
|
/**
|
|
385
385
|
* Wire types: a 1:1 mirror of the daemon's serialized domain model
|
|
386
386
|
* (`crates/core/src/model.rs`, `persona.rs`, `events.rs`) and the endpoint
|
|
387
|
-
* contract in `docs/features/api.md`.
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
*
|
|
391
|
-
*
|
|
387
|
+
* contract in `docs/features/api.md`.
|
|
388
|
+
*
|
|
389
|
+
* THIS IS THE SOURCE, and since 2026-09-09 it is the only one on the TypeScript
|
|
390
|
+
* side: `web-ui/src/api/types.ts` re-exports these files through the
|
|
391
|
+
* `@scalebrowser/wire/*` alias instead of keeping a second copy (Decision 022).
|
|
392
|
+
* Before that the same 160 declarations stood twice, and each header named the
|
|
393
|
+
* other as the truth. The Python SDK
|
|
394
|
+
* (`sdks/python/src/scalebrowser/models*.py`) still carries the shapes by hand,
|
|
392
395
|
* deliberately without a gate; a TS↔pydantic comparator is its own tool.
|
|
393
396
|
*
|
|
397
|
+
* These files import nothing but each other, and that is load-bearing rather
|
|
398
|
+
* than tidy: the web-ui pulls them into a BROWSER bundle. A guard in
|
|
399
|
+
* `web-ui/src/test/sdk-type-mirror.test.ts` holds the property.
|
|
400
|
+
*
|
|
394
401
|
* All Rust enums serialize `snake_case` (serde `rename_all`). Timestamps are
|
|
395
402
|
* unix seconds (`number`, Rust `i64`). The truth for any disagreement is the
|
|
396
403
|
* UNION of the Rust route shapes, never one serde struct (create/delete answer
|
|
@@ -442,6 +449,16 @@ interface Profile {
|
|
|
442
449
|
proxy_id: string | null;
|
|
443
450
|
geo_mode: GeoMode;
|
|
444
451
|
expected_country: string | null;
|
|
452
|
+
/**
|
|
453
|
+
* Whether this profile claims its exit address for itself, so no other profile of
|
|
454
|
+
* the account starts on it (DEC-017). On for a new profile. Turn it off for a
|
|
455
|
+
* provider that hands out ONE address on purpose, a residential line you pay for
|
|
456
|
+
* or a whitelisted office address, where the rule would refuse every start after
|
|
457
|
+
* the first.
|
|
458
|
+
*
|
|
459
|
+
* Additive: a daemon predating it omits the field.
|
|
460
|
+
*/
|
|
461
|
+
exit_exclusive?: boolean;
|
|
445
462
|
data_dir: string;
|
|
446
463
|
created_at: number;
|
|
447
464
|
last_open_at: number | null;
|
|
@@ -718,12 +735,54 @@ interface Proxy {
|
|
|
718
735
|
host: string;
|
|
719
736
|
port: number;
|
|
720
737
|
rotation: Rotation;
|
|
738
|
+
/**
|
|
739
|
+
* The operator's own name for this row, or `null` if they never gave one.
|
|
740
|
+
*
|
|
741
|
+
* The only field that tells two rows of one provider pool apart: kind, host,
|
|
742
|
+
* port and rotation are identical across a bought gateway, and the session tag
|
|
743
|
+
* that actually differs sits in the write-only username. Do not fall back to
|
|
744
|
+
* `last_exit_ip` for identity; the health check wrote it hours or days ago and
|
|
745
|
+
* a rotating exit no longer has that address.
|
|
746
|
+
*/
|
|
747
|
+
label: string | null;
|
|
721
748
|
last_exit_ip: string | null;
|
|
722
749
|
last_country: string | null;
|
|
750
|
+
/**
|
|
751
|
+
* The operator string the geo probe answered with, for example
|
|
752
|
+
* `"AS21928 T-Mobile USA, Inc."`. Part of the same measurement as the fields
|
|
753
|
+
* around it: one check writes them, an endpoint change clears them together.
|
|
754
|
+
* The daemon derives the address kind from it, which decides how long an
|
|
755
|
+
* address stays reserved for a profile.
|
|
756
|
+
*/
|
|
757
|
+
last_asn: string | null;
|
|
723
758
|
last_check_at: number | null;
|
|
724
759
|
healthy: boolean | null;
|
|
760
|
+
/** Round-trip latency of the last health check, in ms. */
|
|
761
|
+
last_latency_ms: number | null;
|
|
762
|
+
/**
|
|
763
|
+
* The row holds credentials that could not be decrypted (a database restored
|
|
764
|
+
* without its master key). Every launch through it fails closed, so a screen
|
|
765
|
+
* that shows only `healthy` paints such a row green while nothing can use it.
|
|
766
|
+
* Omitted by the daemon when false.
|
|
767
|
+
*/
|
|
768
|
+
credentials_unreadable?: boolean;
|
|
725
769
|
created_at: number;
|
|
726
770
|
}
|
|
771
|
+
/**
|
|
772
|
+
* Who depends on one proxy, as `GET /v1/proxies` reports it per row.
|
|
773
|
+
*
|
|
774
|
+
* `count` is exact, `names` holds at most three. A proxy shared by a fleet must
|
|
775
|
+
* not drag every profile name into the listing, so showing the names without the
|
|
776
|
+
* count would turn "three of forty" into "these three".
|
|
777
|
+
*/
|
|
778
|
+
interface ProxyUsage {
|
|
779
|
+
count: number;
|
|
780
|
+
names: string[];
|
|
781
|
+
}
|
|
782
|
+
/** A row of the proxy LIST: the proxy plus who uses it. The single GET has no `used_by`. */
|
|
783
|
+
interface ProxyRow extends Proxy {
|
|
784
|
+
used_by: ProxyUsage;
|
|
785
|
+
}
|
|
727
786
|
/** Per-detector outcome; `skip` means the page could not be evaluated, NOT a pass. */
|
|
728
787
|
type AuditVerdict = 'pass' | 'warn' | 'fail' | 'skip' | 'error';
|
|
729
788
|
interface AuditDetectorReport {
|
|
@@ -889,7 +948,8 @@ interface ExitStatus {
|
|
|
889
948
|
/**
|
|
890
949
|
* The per-profile task list and the profile's own durable memory.
|
|
891
950
|
*
|
|
892
|
-
*
|
|
951
|
+
* One of the files that ARE the contract; the web-ui reads them through
|
|
952
|
+
* `@scalebrowser/wire/*` rather than keeping a copy (Decision 022).
|
|
893
953
|
*/
|
|
894
954
|
/**
|
|
895
955
|
* Where a task stands.
|
|
@@ -1218,8 +1278,8 @@ declare function eventStream(params: StreamParams): AsyncIterableIterator<Lifecy
|
|
|
1218
1278
|
* What the browser asks (interruptions), the bytes that go in and out
|
|
1219
1279
|
* (artifacts), and what the licence says (account).
|
|
1220
1280
|
*
|
|
1221
|
-
*
|
|
1222
|
-
*
|
|
1281
|
+
* One of the files that ARE the contract; the web-ui reads them through
|
|
1282
|
+
* `@scalebrowser/wire/*` rather than keeping a copy (Decision 022).
|
|
1223
1283
|
*/
|
|
1224
1284
|
/** What an operator has taken out of an agent's hands. */
|
|
1225
1285
|
type InterruptionLock = 'always_block' | 'always_allow' | 'agent_decides';
|
|
@@ -1291,6 +1351,32 @@ interface ArtifactBytes {
|
|
|
1291
1351
|
/** Parsed out of `Content-Disposition`, when the daemon sent one. */
|
|
1292
1352
|
filename: string | null;
|
|
1293
1353
|
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Which installation this daemon is: the data directory it serves and the binary
|
|
1356
|
+
* it runs from.
|
|
1357
|
+
*
|
|
1358
|
+
* One machine can hold several installations, and they are told apart by their
|
|
1359
|
+
* data directory, never by their address. A port is a preference: the desktop app
|
|
1360
|
+
* takes the first free one from 8787, and a `runtime.json` left behind by an
|
|
1361
|
+
* earlier daemon can name a port that something else now holds. Ask this before
|
|
1362
|
+
* assuming the daemon you reached is the one you meant.
|
|
1363
|
+
*/
|
|
1364
|
+
interface Connection {
|
|
1365
|
+
/** The address the native API is bound to, as resolved. */
|
|
1366
|
+
native_addr: string;
|
|
1367
|
+
/** The data directory, in a form suitable for showing or for a command line. */
|
|
1368
|
+
data_dir: string;
|
|
1369
|
+
/**
|
|
1370
|
+
* The same directory, in the form two daemons compare. Case is folded on
|
|
1371
|
+
* Windows and links are resolved, so do not show this one to anybody; compare
|
|
1372
|
+
* it with another daemon's value and nothing else.
|
|
1373
|
+
*/
|
|
1374
|
+
data_dir_key: string;
|
|
1375
|
+
/** Absolute path of the running binary, for a client that launches it over stdio. */
|
|
1376
|
+
executable?: string;
|
|
1377
|
+
/** The AdsPower-compatible adapter's address, when that adapter is enabled. */
|
|
1378
|
+
adspower_addr?: string;
|
|
1379
|
+
}
|
|
1294
1380
|
/**
|
|
1295
1381
|
* Licence state, for display.
|
|
1296
1382
|
*
|
|
@@ -1344,6 +1430,27 @@ interface RemoteStatus {
|
|
|
1344
1430
|
* whatever the switch says. */
|
|
1345
1431
|
ready: boolean;
|
|
1346
1432
|
}
|
|
1433
|
+
/**
|
|
1434
|
+
* What `GET /v1/exit-rule` answers: the machine's own exit-address exclusivity
|
|
1435
|
+
* switch.
|
|
1436
|
+
*
|
|
1437
|
+
* On by default. Turn it off for a provider that hands out ONE address on
|
|
1438
|
+
* purpose, a residential line you pay for or a whitelisted office address, where
|
|
1439
|
+
* the rule would refuse every start after the first.
|
|
1440
|
+
*/
|
|
1441
|
+
interface ExitRuleStatus {
|
|
1442
|
+
/** Does the rule apply on this machine? */
|
|
1443
|
+
enabled: boolean;
|
|
1444
|
+
/** Did a person decide this, or is the configured default still standing? */
|
|
1445
|
+
explicit: boolean;
|
|
1446
|
+
/**
|
|
1447
|
+
* How many profiles switched the rule off for themselves.
|
|
1448
|
+
*
|
|
1449
|
+
* A global "on" reads as "every profile is separated", and that stops being
|
|
1450
|
+
* true the moment one profile has its own switch off.
|
|
1451
|
+
*/
|
|
1452
|
+
profiles_opted_out: number;
|
|
1453
|
+
}
|
|
1347
1454
|
|
|
1348
1455
|
interface ScalebrowserClientOptions {
|
|
1349
1456
|
/** Daemon base URL. Default `http://127.0.0.1:8787`. */
|
|
@@ -1411,6 +1518,15 @@ declare class ControlApi extends ClientCore {
|
|
|
1411
1518
|
* connected or permitted. Same shape of tolerance as {@link getMetrics}.
|
|
1412
1519
|
*/
|
|
1413
1520
|
getAccount(signal?: AbortSignal): Promise<Account>;
|
|
1521
|
+
/**
|
|
1522
|
+
* Which installation answered: its data directory and its binary.
|
|
1523
|
+
*
|
|
1524
|
+
* `health()` tells you something is there. This tells you WHAT, and the two are
|
|
1525
|
+
* different questions whenever a machine holds more than one installation. The
|
|
1526
|
+
* data directory is the identity; the address is not, because a port is a
|
|
1527
|
+
* preference and a stale `runtime.json` can name one that moved.
|
|
1528
|
+
*/
|
|
1529
|
+
getConnection(signal?: AbortSignal): Promise<Connection>;
|
|
1414
1530
|
/** "Is the daemon alive?" Public, needs no token. */
|
|
1415
1531
|
health(signal?: AbortSignal): Promise<HealthStatus>;
|
|
1416
1532
|
/** "Can it serve?" Local facts only; the control plane is deliberately not consulted. */
|
|
@@ -1453,6 +1569,21 @@ interface CreateProfileBody {
|
|
|
1453
1569
|
host_mode?: HostMode;
|
|
1454
1570
|
geo_mode?: GeoMode;
|
|
1455
1571
|
expected_country?: string | null;
|
|
1572
|
+
/**
|
|
1573
|
+
* Draw the identity for this region (ISO-3166 alpha-2, e.g. `"DE"`): language,
|
|
1574
|
+
* timezone and speech voices come out of one row of the model together. Omit to
|
|
1575
|
+
* draw unconstrained, weighted the way the population is.
|
|
1576
|
+
*
|
|
1577
|
+
* This is not `expected_country`, which only checks the exit and never touches
|
|
1578
|
+
* the identity. And it is a starting value, not a promise: under the default
|
|
1579
|
+
* `geo_mode` the launch rewrites the region to the country the profile really
|
|
1580
|
+
* exits in, which is its proxy's, or with no proxy the machine's own. The
|
|
1581
|
+
* daemon refuses the pairings where that collision is already known.
|
|
1582
|
+
*
|
|
1583
|
+
* Set only at create. A region the model cannot draw is a 400 listing the ones
|
|
1584
|
+
* it can.
|
|
1585
|
+
*/
|
|
1586
|
+
persona_country?: string;
|
|
1456
1587
|
group_id?: string | null;
|
|
1457
1588
|
proxy_id?: string | null;
|
|
1458
1589
|
}
|
|
@@ -1461,7 +1592,14 @@ interface CreateProfileBody {
|
|
|
1461
1592
|
* time (C4/C5): a DIFFERING `host_mode` is refused with 400, an unchanged echo is
|
|
1462
1593
|
* accepted. Changing a tier requires delete + recreate.
|
|
1463
1594
|
*/
|
|
1464
|
-
type UpdateProfileBody = Omit<Partial<CreateProfileBody>, "host_mode" | "seed"
|
|
1595
|
+
type UpdateProfileBody = Omit<Partial<CreateProfileBody>, "host_mode" | "seed" | "persona_country"> & {
|
|
1596
|
+
/**
|
|
1597
|
+
* Turn the exit-address rule off for this profile (DEC-017). Deliberately not
|
|
1598
|
+
* part of `CreateProfileBody`: a new profile always claims its address, and
|
|
1599
|
+
* switching that off is a later, deliberate act for a setup that needs it.
|
|
1600
|
+
*/
|
|
1601
|
+
exit_exclusive?: boolean;
|
|
1602
|
+
};
|
|
1465
1603
|
interface StartProfileBody {
|
|
1466
1604
|
headless?: boolean;
|
|
1467
1605
|
}
|
|
@@ -1510,6 +1648,12 @@ interface CreateProxyBody {
|
|
|
1510
1648
|
username?: string | null;
|
|
1511
1649
|
password?: string | null;
|
|
1512
1650
|
rotation?: Rotation;
|
|
1651
|
+
/**
|
|
1652
|
+
* The operator's own name for the row. Trimmed by the daemon; a blank string is
|
|
1653
|
+
* stored as null. On an update the field carries three states: omit the key to
|
|
1654
|
+
* leave the name alone, send `null` to clear it, send a string to set it.
|
|
1655
|
+
*/
|
|
1656
|
+
label?: string | null;
|
|
1513
1657
|
}
|
|
1514
1658
|
type UpdateProxyBody = Partial<CreateProxyBody>;
|
|
1515
1659
|
/**
|
|
@@ -1646,9 +1790,10 @@ declare class ExtensionsApi extends ClientCore {
|
|
|
1646
1790
|
* The account layer: mailboxes, passkeys and the one door a cookie value leaves
|
|
1647
1791
|
* through.
|
|
1648
1792
|
*
|
|
1649
|
-
*
|
|
1650
|
-
*
|
|
1651
|
-
* it is a REST-only route deliberately kept off
|
|
1793
|
+
* One of the files that ARE the contract; the web-ui reads them through
|
|
1794
|
+
* `@scalebrowser/wire/*` rather than keeping a copy (Decision 022). The cookie
|
|
1795
|
+
* reveal has no UI counterpart: it is a REST-only route deliberately kept off
|
|
1796
|
+
* every screen.
|
|
1652
1797
|
*/
|
|
1653
1798
|
/** One configured mailbox. The password is never sent back. */
|
|
1654
1799
|
interface Inbox {
|
|
@@ -2051,7 +2196,8 @@ declare class TasksApi extends ClientCore {
|
|
|
2051
2196
|
* the live event stream carries them, and the run list describes the same rows.
|
|
2052
2197
|
* A second copy would let the two drift apart while both looked right.
|
|
2053
2198
|
*
|
|
2054
|
-
*
|
|
2199
|
+
* One of the files that ARE the contract; the web-ui reads them through
|
|
2200
|
+
* `@scalebrowser/wire/*` rather than keeping a copy (Decision 022).
|
|
2055
2201
|
*/
|
|
2056
2202
|
|
|
2057
2203
|
/** Who made the outcome claim. `derived` means nobody did. */
|
|
@@ -2511,7 +2657,8 @@ declare class ScalebrowserClient extends ClientCore {
|
|
|
2511
2657
|
* drifts the moment that model changes and every create 400s.
|
|
2512
2658
|
*/
|
|
2513
2659
|
getPersonaConstraints(signal?: AbortSignal): Promise<PersonaConstraintOptions>;
|
|
2514
|
-
|
|
2660
|
+
/** The list carries `used_by` per row; `getProxy` below does not. */
|
|
2661
|
+
listProxies(signal?: AbortSignal): Promise<ProxyRow[]>;
|
|
2515
2662
|
getProxy(id: string, signal?: AbortSignal): Promise<Proxy>;
|
|
2516
2663
|
createProxy(body: CreateProxyBody): Promise<Proxy>;
|
|
2517
2664
|
updateProxy(id: string, body: UpdateProxyBody): Promise<Proxy>;
|
|
@@ -2549,6 +2696,22 @@ declare class ScalebrowserClient extends ClientCore {
|
|
|
2549
2696
|
getRemoteAccess(signal?: AbortSignal): Promise<RemoteStatus>;
|
|
2550
2697
|
/** Turn remote access on or off for this machine. */
|
|
2551
2698
|
setRemoteAccess(enabled: boolean, signal?: AbortSignal): Promise<RemoteStatus>;
|
|
2699
|
+
/**
|
|
2700
|
+
* Does one exit address belong to one profile on this machine?
|
|
2701
|
+
*
|
|
2702
|
+
* Local like the remote-access switch above, and here for the same reason: on
|
|
2703
|
+
* a headless install there is no UI to click, and setting up fifty machines by
|
|
2704
|
+
* hand is not setting them up.
|
|
2705
|
+
*/
|
|
2706
|
+
getExitRule(signal?: AbortSignal): Promise<ExitRuleStatus>;
|
|
2707
|
+
/**
|
|
2708
|
+
* Turn the exit-address rule on or off for this machine.
|
|
2709
|
+
*
|
|
2710
|
+
* Off means two of your profiles can leave over the same address. Reach for it
|
|
2711
|
+
* when the provider hands out ONE address on purpose; a per-profile switch
|
|
2712
|
+
* exists for the narrower case (`updateProfile` with `exit_exclusive`).
|
|
2713
|
+
*/
|
|
2714
|
+
setExitRule(enabled: boolean, signal?: AbortSignal): Promise<ExitRuleStatus>;
|
|
2552
2715
|
/** Subscribe to lifecycle events. Returns an unsubscribe function. */
|
|
2553
2716
|
subscribeEvents(handlers: StreamHandlers): () => void;
|
|
2554
2717
|
/** `for await (const event of client.events())` over lifecycle events. */
|
|
@@ -2661,6 +2824,6 @@ declare function errorMessage(err: unknown): string;
|
|
|
2661
2824
|
* ```
|
|
2662
2825
|
*/
|
|
2663
2826
|
|
|
2664
|
-
declare const VERSION = "0.
|
|
2827
|
+
declare const VERSION = "0.7.0";
|
|
2665
2828
|
|
|
2666
|
-
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 CdpConnectOptions, CdpError, type CdpEvent, CdpSession, type Chapter, type ClickOptions, type CodecsStatus, type CreateGroupBody, type CreateInboxBody, type CreatePresetBody, type CreateTasksBody, type CreateTasksResult, DEFAULT_CAPACITY, type DeleteInterruptionRuleParams, type EffectiveInterruptionLock, ErrorCode, type ErrorCodeValue, type EvaluateOptions, type ExitClaim, type ExitScope, type ExitStatus, type ExportPresetName, type ExtraOutput, type FetchLike, GEO_MODES, type GeoMode, type GoalSource, type Group, HOST_MODES, type HealthStatus, type HostMode, 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, 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 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 };
|
|
2829
|
+
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 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, HOST_MODES, type HealthStatus, type HostMode, 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 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
|
@@ -288,6 +288,17 @@ var ControlApi = class extends ClientCore {
|
|
|
288
288
|
throw err;
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
+
/**
|
|
292
|
+
* Which installation answered: its data directory and its binary.
|
|
293
|
+
*
|
|
294
|
+
* `health()` tells you something is there. This tells you WHAT, and the two are
|
|
295
|
+
* different questions whenever a machine holds more than one installation. The
|
|
296
|
+
* data directory is the identity; the address is not, because a port is a
|
|
297
|
+
* preference and a stale `runtime.json` can name one that moved.
|
|
298
|
+
*/
|
|
299
|
+
getConnection(signal) {
|
|
300
|
+
return this.request("GET", "/v1/connection", void 0, { signal });
|
|
301
|
+
}
|
|
291
302
|
/** "Is the daemon alive?" Public, needs no token. */
|
|
292
303
|
health(signal) {
|
|
293
304
|
return this.request("GET", "/health", void 0, { signal });
|
|
@@ -1518,6 +1529,7 @@ var ScalebrowserClient = class extends ClientCore {
|
|
|
1518
1529
|
);
|
|
1519
1530
|
}
|
|
1520
1531
|
// ── Proxies (credentials write-only) ────────────────────────────────────────
|
|
1532
|
+
/** The list carries `used_by` per row; `getProxy` below does not. */
|
|
1521
1533
|
listProxies(signal) {
|
|
1522
1534
|
return this.request("GET", "/v1/proxies", void 0, { signal });
|
|
1523
1535
|
}
|
|
@@ -1609,6 +1621,27 @@ var ScalebrowserClient = class extends ClientCore {
|
|
|
1609
1621
|
async setRemoteAccess(enabled, signal) {
|
|
1610
1622
|
return this.request("PUT", "/v1/remote", { enabled }, { signal });
|
|
1611
1623
|
}
|
|
1624
|
+
// ── Exit-address exclusivity (the machine's own switch) ─────────────────────
|
|
1625
|
+
/**
|
|
1626
|
+
* Does one exit address belong to one profile on this machine?
|
|
1627
|
+
*
|
|
1628
|
+
* Local like the remote-access switch above, and here for the same reason: on
|
|
1629
|
+
* a headless install there is no UI to click, and setting up fifty machines by
|
|
1630
|
+
* hand is not setting them up.
|
|
1631
|
+
*/
|
|
1632
|
+
async getExitRule(signal) {
|
|
1633
|
+
return this.request("GET", "/v1/exit-rule", void 0, { signal });
|
|
1634
|
+
}
|
|
1635
|
+
/**
|
|
1636
|
+
* Turn the exit-address rule on or off for this machine.
|
|
1637
|
+
*
|
|
1638
|
+
* Off means two of your profiles can leave over the same address. Reach for it
|
|
1639
|
+
* when the provider hands out ONE address on purpose; a per-profile switch
|
|
1640
|
+
* exists for the narrower case (`updateProfile` with `exit_exclusive`).
|
|
1641
|
+
*/
|
|
1642
|
+
async setExitRule(enabled, signal) {
|
|
1643
|
+
return this.request("PUT", "/v1/exit-rule", { enabled }, { signal });
|
|
1644
|
+
}
|
|
1612
1645
|
// ── Events (SSE) ───────────────────────────────────────────────────────────
|
|
1613
1646
|
/** Subscribe to lifecycle events. Returns an unsubscribe function. */
|
|
1614
1647
|
subscribeEvents(handlers) {
|
|
@@ -1683,6 +1716,6 @@ var PROXY_KINDS = ["http", "socks5", "gateway"];
|
|
|
1683
1716
|
var ROTATIONS = ["sticky", "rotating"];
|
|
1684
1717
|
|
|
1685
1718
|
// src/index.ts
|
|
1686
|
-
var VERSION = "0.
|
|
1719
|
+
var VERSION = "0.7.0";
|
|
1687
1720
|
|
|
1688
1721
|
export { ApiError, CdpError, CdpSession, DEFAULT_CAPACITY, ErrorCode, GEO_MODES, HOST_MODES, NetworkError, PROXY_KINDS, ROTATIONS, RUNTIME_STATES, ScalebrowserClient, ScalebrowserError, VERSION, deriveMetricsFromProfiles, errorMessage, eventStream, openCdpSession, parseSseFrame, subscribeEvents };
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalebrowser/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Official Node/TypeScript SDK for the Scalebrowser daemon — typed REST client + 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/
|
|
10
|
+
"url": "git+https://github.com/blackdiamond-labs/scalebrowser.git",
|
|
11
11
|
"directory": "sdks/node"
|
|
12
12
|
},
|
|
13
13
|
"bugs": {
|