@scalebrowser/sdk 0.6.0 → 0.8.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 +47 -0
- package/dist/index.cjs +51 -3
- package/dist/index.d.cts +251 -53
- package/dist/index.d.ts +251 -53
- package/dist/index.js +52 -3
- package/package.json +4 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
The Node/TypeScript SDK for the Scalebrowser daemon.
|
|
4
|
+
|
|
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 is in the repository's history. It was never
|
|
7
|
+
published as release notes, and reconstructing it here would look like a record
|
|
8
|
+
that had been kept all along.
|
|
9
|
+
|
|
10
|
+
The daemon and the SDK version independently. An SDK release names the daemon
|
|
11
|
+
version it was tested against wherever that matters.
|
|
12
|
+
|
|
13
|
+
## 0.8.0 (2026-09-11)
|
|
14
|
+
|
|
15
|
+
Breaking: `host_mode` is gone, and with it the `HostMode` type and the
|
|
16
|
+
`HOST_MODES` list. It named one of two tiers, and there is only one left: a
|
|
17
|
+
daemon runs the engine built for its own operating system, so the tier is the
|
|
18
|
+
host. The field disappears from `Profile`, from `CreateProfileBody` and from a
|
|
19
|
+
preset's `config`. A client that keeps sending it is not refused; the daemon
|
|
20
|
+
ignores the key.
|
|
21
|
+
|
|
22
|
+
## 0.7.0 (2026-09-09)
|
|
23
|
+
|
|
24
|
+
- `checkProxy` and the exit-address views report the address KIND (mobile, fixed
|
|
25
|
+
line, datacenter, unknown) from an ASN dataset instead of the provider's own
|
|
26
|
+
description. The ownership term for an exit address follows that kind, so a
|
|
27
|
+
wrong classification used to be off by a factor of 30.
|
|
28
|
+
- A proxy row carries a name and lists the profiles bound to it.
|
|
29
|
+
- The exit-exclusivity rule has a switch, globally and per profile.
|
|
30
|
+
|
|
31
|
+
## 0.6.0 (2026-09-01)
|
|
32
|
+
|
|
33
|
+
- Remote access (the MCP tunnel) has a switch. It ships off, and it can only be
|
|
34
|
+
turned on at the machine itself.
|
|
35
|
+
|
|
36
|
+
## 0.5.0 (2026-08-31)
|
|
37
|
+
|
|
38
|
+
- Every profile carries a memory (`PROFILE.md`) and a task list. Both are
|
|
39
|
+
reachable through the client.
|
|
40
|
+
- `proxy_short_side` in both SDKs.
|
|
41
|
+
- The agent layer says "lease" throughout, matching the names of its tools.
|
|
42
|
+
|
|
43
|
+
## What this file does not promise
|
|
44
|
+
|
|
45
|
+
Nothing here promises a stable wire format. The daemon's REST surface is
|
|
46
|
+
versioned under `/v1` and this client tracks it. A breaking change there arrives
|
|
47
|
+
as a major version of the SDK, with the reason written in this file.
|
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 });
|
|
@@ -1375,6 +1386,23 @@ var ScalebrowserClient = class extends ClientCore {
|
|
|
1375
1386
|
signal
|
|
1376
1387
|
});
|
|
1377
1388
|
}
|
|
1389
|
+
/**
|
|
1390
|
+
* How many profiles match `params`, split by runtime state. One request, and
|
|
1391
|
+
* its size does not grow with the fleet.
|
|
1392
|
+
*
|
|
1393
|
+
* `listProfiles` is paged and answers a bare array, so counting what came back
|
|
1394
|
+
* counts the page. `listProfileIds` carries the same total but ships an
|
|
1395
|
+
* identifier per profile to do it, and cannot split by state at all.
|
|
1396
|
+
*
|
|
1397
|
+
* `params.state` is ignored here on purpose: a caller labelling every state is
|
|
1398
|
+
* sitting in one of them.
|
|
1399
|
+
*/
|
|
1400
|
+
countProfiles(params = {}, signal) {
|
|
1401
|
+
return this.request("GET", "/v1/profiles/count", void 0, {
|
|
1402
|
+
query: { group: params.group, q: params.q },
|
|
1403
|
+
signal
|
|
1404
|
+
});
|
|
1405
|
+
}
|
|
1378
1406
|
getProfile(id, signal) {
|
|
1379
1407
|
return this.request("GET", `/v1/profiles/${enc(id)}`, void 0, { signal });
|
|
1380
1408
|
}
|
|
@@ -1524,6 +1552,7 @@ var ScalebrowserClient = class extends ClientCore {
|
|
|
1524
1552
|
);
|
|
1525
1553
|
}
|
|
1526
1554
|
// ── Proxies (credentials write-only) ────────────────────────────────────────
|
|
1555
|
+
/** The list carries `used_by` per row; `getProxy` below does not. */
|
|
1527
1556
|
listProxies(signal) {
|
|
1528
1557
|
return this.request("GET", "/v1/proxies", void 0, { signal });
|
|
1529
1558
|
}
|
|
@@ -1615,6 +1644,27 @@ var ScalebrowserClient = class extends ClientCore {
|
|
|
1615
1644
|
async setRemoteAccess(enabled, signal) {
|
|
1616
1645
|
return this.request("PUT", "/v1/remote", { enabled }, { signal });
|
|
1617
1646
|
}
|
|
1647
|
+
// ── Exit-address exclusivity (the machine's own switch) ─────────────────────
|
|
1648
|
+
/**
|
|
1649
|
+
* Does one exit address belong to one profile on this machine?
|
|
1650
|
+
*
|
|
1651
|
+
* Local like the remote-access switch above, and here for the same reason: on
|
|
1652
|
+
* a headless install there is no UI to click, and setting up fifty machines by
|
|
1653
|
+
* hand is not setting them up.
|
|
1654
|
+
*/
|
|
1655
|
+
async getExitRule(signal) {
|
|
1656
|
+
return this.request("GET", "/v1/exit-rule", void 0, { signal });
|
|
1657
|
+
}
|
|
1658
|
+
/**
|
|
1659
|
+
* Turn the exit-address rule on or off for this machine.
|
|
1660
|
+
*
|
|
1661
|
+
* Off means two of your profiles can leave over the same address. Reach for it
|
|
1662
|
+
* when the provider hands out ONE address on purpose; a per-profile switch
|
|
1663
|
+
* exists for the narrower case (`updateProfile` with `exit_exclusive`).
|
|
1664
|
+
*/
|
|
1665
|
+
async setExitRule(enabled, signal) {
|
|
1666
|
+
return this.request("PUT", "/v1/exit-rule", { enabled }, { signal });
|
|
1667
|
+
}
|
|
1618
1668
|
// ── Events (SSE) ───────────────────────────────────────────────────────────
|
|
1619
1669
|
/** Subscribe to lifecycle events. Returns an unsubscribe function. */
|
|
1620
1670
|
subscribeEvents(handlers) {
|
|
@@ -1683,13 +1733,12 @@ applyMixins(ScalebrowserClient, [
|
|
|
1683
1733
|
|
|
1684
1734
|
// src/types.ts
|
|
1685
1735
|
var RUNTIME_STATES = ["stopped", "starting", "running", "crashed"];
|
|
1686
|
-
var HOST_MODES = ["linux_engine_spoof", "local_native_windows"];
|
|
1687
1736
|
var GEO_MODES = ["strict_expected", "follow_exit", "off"];
|
|
1688
1737
|
var PROXY_KINDS = ["http", "socks5", "gateway"];
|
|
1689
1738
|
var ROTATIONS = ["sticky", "rotating"];
|
|
1690
1739
|
|
|
1691
1740
|
// src/index.ts
|
|
1692
|
-
var VERSION = "0.
|
|
1741
|
+
var VERSION = "0.8.0";
|
|
1693
1742
|
|
|
1694
1743
|
exports.ApiError = ApiError;
|
|
1695
1744
|
exports.CdpError = CdpError;
|
|
@@ -1697,7 +1746,6 @@ exports.CdpSession = CdpSession;
|
|
|
1697
1746
|
exports.DEFAULT_CAPACITY = DEFAULT_CAPACITY;
|
|
1698
1747
|
exports.ErrorCode = ErrorCode;
|
|
1699
1748
|
exports.GEO_MODES = GEO_MODES;
|
|
1700
|
-
exports.HOST_MODES = HOST_MODES;
|
|
1701
1749
|
exports.NetworkError = NetworkError;
|
|
1702
1750
|
exports.PROXY_KINDS = PROXY_KINDS;
|
|
1703
1751
|
exports.ROTATIONS = ROTATIONS;
|