@aixnn/aixautots 0.6.17 → 0.6.21
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/{automation-queue-DO8fOG6l.d.ts → automation-queue-GhfQtZLm.d.ts} +2 -2
- package/dist/{chunk-TJ2QIP5M.js → chunk-4NRIEM5Z.js} +249 -33
- package/dist/chunk-6IH74UX6.js +1693 -0
- package/dist/{chunk-WOPEKCVC.js → chunk-DAU3FVCV.js} +2 -2
- package/dist/chunk-DTXXQPOU.js +693 -0
- package/dist/{chunk-7BJPVSEZ.js → chunk-ED6CB3B4.js} +222 -12
- package/dist/{chunk-NIEGPH3E.js → chunk-FJKMRWYC.js} +55 -23
- package/dist/{chunk-ZDCTHR7D.js → chunk-H7KZUU67.js} +2 -2
- package/dist/{chunk-FJPIY4YI.js → chunk-HQ2L4NQ2.js} +262 -10
- package/dist/{chunk-LOKPZ677.js → chunk-JQBSGFAR.js} +2 -2
- package/dist/{chunk-2KPZSPV6.js → chunk-OJK35AQD.js} +105 -17
- package/dist/{chunk-KASSYUGM.js → chunk-RFOJSDYI.js} +2 -2
- package/dist/{chunk-QEK25NUA.js → chunk-UEZVXYGP.js} +12 -5
- package/dist/{config-CBUhr4Gl.d.ts → config-C79rcedl.d.ts} +52 -10
- package/dist/core/index.d.ts +13 -9
- package/dist/core/index.js +2 -2
- package/dist/core/network-adb-node.d.ts +23 -0
- package/dist/core/network-adb-node.js +171 -0
- package/dist/{script-debugger-DoT02din.d.ts → device-channel-OiZwAqNQ.d.ts} +41 -55
- package/dist/{device-normalize-Vl5JYbAI.d.ts → device-normalize-ODrxJb-a.d.ts} +1 -1
- package/dist/device-session-PVHD6PNR.js +1 -0
- package/dist/i18n/index.js +1 -1
- package/dist/{mirror-session-Y1InpkUY.d.ts → mirror-session-DifANocH.d.ts} +2 -2
- package/dist/react/index.d.ts +19 -12
- package/dist/react/index.js +3 -3
- package/dist/script-debugger-DjxpvdaN.d.ts +56 -0
- package/dist/{task-agent-runner-Cl2ickJ1.d.ts → task-agent-runner-CAt-z8gr.d.ts} +3 -3
- package/dist/{types-Cp1ohbTb.d.ts → types-CBI5SIH5.d.ts} +102 -4
- package/dist/ui/billing.d.ts +43 -6
- package/dist/ui/billing.js +190 -309
- package/dist/ui/device-create.d.ts +1 -1
- package/dist/ui/device-create.js +7 -7
- package/dist/ui/device-mirror.js +5 -5
- package/dist/ui/devices.d.ts +5 -5
- package/dist/ui/devices.js +9 -9
- package/dist/ui/editor.d.ts +2 -2
- package/dist/ui/editor.js +5 -5
- package/dist/ui/index.d.ts +6 -4
- package/dist/ui/index.js +13 -492
- package/dist/ui/inspector.js +4 -4
- package/dist/ui/ip-commerce.d.ts +2 -2
- package/dist/ui/ip-commerce.js +5 -5
- package/dist/ui/market.js +4 -4
- package/dist/ui/mirror.d.ts +3 -3
- package/dist/ui/script-studio.js +4 -4
- package/dist/ui/scripts.d.ts +1 -1
- package/dist/ui/scripts.js +4 -4
- package/dist/ui/settings.d.ts +164 -0
- package/dist/ui/settings.js +10 -0
- package/dist/ui/tasks.js +9 -9
- package/package.json +9 -1
- package/dist/device-session-3XK2SZDF.js +0 -1
|
@@ -209,7 +209,8 @@ function resolveConfig(cfg) {
|
|
|
209
209
|
if (t2 == null) throw new AixAuthError("no user bearer token configured (set auth.user or getAuthToken)");
|
|
210
210
|
return t2;
|
|
211
211
|
});
|
|
212
|
-
|
|
212
|
+
const channel = cfg.channel?.trim() || void 0;
|
|
213
|
+
return { baseUrl: cfg.baseUrl, channel, getAuthToken, auth, fetchFn, wsFactory, rtcFactory, localNode: cfg.localNode };
|
|
213
214
|
}
|
|
214
215
|
|
|
215
216
|
// src/core/transport.ts
|
|
@@ -217,6 +218,7 @@ var ReconnectingSocket = class {
|
|
|
217
218
|
constructor(o) {
|
|
218
219
|
this.o = o;
|
|
219
220
|
this.ws = null;
|
|
221
|
+
this.opened = false;
|
|
220
222
|
this.closed = false;
|
|
221
223
|
this.attempt = 0;
|
|
222
224
|
this.reconnectTimer = null;
|
|
@@ -235,6 +237,7 @@ var ReconnectingSocket = class {
|
|
|
235
237
|
ws.onopen = () => {
|
|
236
238
|
if (!this.closed && this.ws === ws) {
|
|
237
239
|
this.attempt = 0;
|
|
240
|
+
this.opened = true;
|
|
238
241
|
this.o.onOpen?.();
|
|
239
242
|
}
|
|
240
243
|
};
|
|
@@ -247,6 +250,7 @@ var ReconnectingSocket = class {
|
|
|
247
250
|
ws.onclose = () => {
|
|
248
251
|
if (this.ws !== ws) return;
|
|
249
252
|
this.ws = null;
|
|
253
|
+
this.opened = false;
|
|
250
254
|
this.o.onClose?.();
|
|
251
255
|
if (!this.closed) this.scheduleReconnect();
|
|
252
256
|
};
|
|
@@ -272,6 +276,7 @@ var ReconnectingSocket = class {
|
|
|
272
276
|
}
|
|
273
277
|
const previous = this.ws;
|
|
274
278
|
this.ws = null;
|
|
279
|
+
this.opened = false;
|
|
275
280
|
try {
|
|
276
281
|
previous?.close();
|
|
277
282
|
} catch {
|
|
@@ -280,11 +285,19 @@ var ReconnectingSocket = class {
|
|
|
280
285
|
this.scheduleReconnect();
|
|
281
286
|
}
|
|
282
287
|
send(text) {
|
|
283
|
-
if (!this.ws) throw new Error("socket not connected");
|
|
288
|
+
if (!this.ws || !this.opened) throw new Error("socket not connected");
|
|
289
|
+
this.ws.send(text);
|
|
290
|
+
}
|
|
291
|
+
/** Refuse ADB writes when transport backpressure is unavailable or over budget. */
|
|
292
|
+
sendBounded(text, maxBufferedBytes) {
|
|
293
|
+
if (!this.ws || !this.opened) throw new Error("socket not connected");
|
|
294
|
+
if (typeof this.ws.bufferedAmount !== "number" || !Number.isFinite(this.ws.bufferedAmount) || this.ws.bufferedAmount + text.length > maxBufferedBytes) {
|
|
295
|
+
throw new Error("ADB socket buffer capacity unavailable or exhausted");
|
|
296
|
+
}
|
|
284
297
|
this.ws.send(text);
|
|
285
298
|
}
|
|
286
299
|
isConnected() {
|
|
287
|
-
return this.
|
|
300
|
+
return this.opened;
|
|
288
301
|
}
|
|
289
302
|
close() {
|
|
290
303
|
if (this.reconnectTimer !== null) {
|
|
@@ -292,6 +305,7 @@ var ReconnectingSocket = class {
|
|
|
292
305
|
this.reconnectTimer = null;
|
|
293
306
|
}
|
|
294
307
|
this.closed = true;
|
|
308
|
+
this.opened = false;
|
|
295
309
|
this.ws?.close();
|
|
296
310
|
this.ws = null;
|
|
297
311
|
}
|
|
@@ -383,7 +397,7 @@ var RestClient = class {
|
|
|
383
397
|
}
|
|
384
398
|
let resp;
|
|
385
399
|
try {
|
|
386
|
-
resp = await this.cfg.fetchFn(url, { method, headers, body, ...opts.signal ? { signal: opts.signal } : {} });
|
|
400
|
+
resp = await this.cfg.fetchFn(url, { method, headers, body, ...opts.redirect ? { redirect: opts.redirect } : {}, ...opts.signal ? { signal: opts.signal } : {} });
|
|
387
401
|
} catch (e) {
|
|
388
402
|
if (e instanceof AixError) throw e;
|
|
389
403
|
throw new AixError(`${method} ${path} request failed: ${String(e)}`, "network");
|
|
@@ -398,7 +412,7 @@ var RestClient = class {
|
|
|
398
412
|
const error = j.error && typeof j.error === "object" ? j.error : j;
|
|
399
413
|
const m = typeof error.message === "string" ? error.message : typeof j.error === "string" ? j.error : void 0;
|
|
400
414
|
detail = m || void 0;
|
|
401
|
-
apiCode = typeof error.code === "string" ? error.code : void 0;
|
|
415
|
+
apiCode = typeof error.code === "string" ? error.code : typeof j.error === "string" ? j.error : void 0;
|
|
402
416
|
const state = error.request_state ?? j.request_state;
|
|
403
417
|
requestState = state === "rejected" || state === "unknown" ? state : void 0;
|
|
404
418
|
} catch {
|
|
@@ -492,6 +506,9 @@ var UsersApi = class {
|
|
|
492
506
|
};
|
|
493
507
|
|
|
494
508
|
// src/core/resources/devices.ts
|
|
509
|
+
function isQueuedPowerReceipt(receipt) {
|
|
510
|
+
return receipt !== null && typeof receipt === "object" && "status" in receipt && receipt.status === "queued";
|
|
511
|
+
}
|
|
495
512
|
var DevicesApi = class {
|
|
496
513
|
constructor(c) {
|
|
497
514
|
this.c = c;
|
|
@@ -508,6 +525,10 @@ var DevicesApi = class {
|
|
|
508
525
|
provision(spec) {
|
|
509
526
|
return this.c.post("/api/devices/provision", spec);
|
|
510
527
|
}
|
|
528
|
+
/** Inspect a persisted provisioning operation without retrying creation or contacting the node. */
|
|
529
|
+
provisionOperation(operationId, options) {
|
|
530
|
+
return this.c.get(`/api/devices/provision/operations/${encodeURIComponent(operationId)}`, options);
|
|
531
|
+
}
|
|
511
532
|
/** Brand→model identity catalog for the create-wizard's 品牌 → 机型 picker
|
|
512
533
|
* (`GET /api/devices/profile-catalog`). Static read-only data; the chosen
|
|
513
534
|
* `model` is passed back via `ProvisionSpec.model` to lock the fingerprint base. */
|
|
@@ -526,14 +547,22 @@ var DevicesApi = class {
|
|
|
526
547
|
captureUiTree(deviceId) {
|
|
527
548
|
return this.op(deviceId, { op: "capture_ui_tree" });
|
|
528
549
|
}
|
|
529
|
-
/** Power / lifecycle op (`POST /api/devices/:id/power`).
|
|
530
|
-
*
|
|
531
|
-
* `{
|
|
532
|
-
*
|
|
533
|
-
*
|
|
550
|
+
/** Power / lifecycle op (`POST /api/devices/:id/power`). A confirmed Stop
|
|
551
|
+
* returns `{ stopped: true }`, but during an image cutover Stop may return
|
|
552
|
+
* `{ status: 'queued', desired_running: false }`. Reboot starts asynchronously
|
|
553
|
+
* and returns `{ status: 'rebooting', async: true }`. Non-2xx responses
|
|
554
|
+
* reject with the node/backend error. */
|
|
534
555
|
power(deviceId, action, extra) {
|
|
535
556
|
return this.c.post(`/api/devices/${encodeURIComponent(deviceId)}/power`, { action, ...extra });
|
|
536
557
|
}
|
|
558
|
+
/** Read the virtual Android settings back from the device (not USB host authorization). */
|
|
559
|
+
getDeveloperSettings(deviceId) {
|
|
560
|
+
return this.c.get(`/api/devices/${encodeURIComponent(deviceId)}/developer-settings`);
|
|
561
|
+
}
|
|
562
|
+
/** Enable developer mode and USB debugging; backend verifies both by reading Android settings. */
|
|
563
|
+
enableDeveloperSettings(deviceId) {
|
|
564
|
+
return this.c.post(`/api/devices/${encodeURIComponent(deviceId)}/developer-settings`, { developerMode: true, usbDebugging: true });
|
|
565
|
+
}
|
|
537
566
|
/** List all user data snapshots, including while the device is offline. */
|
|
538
567
|
listSnapshots(deviceId) {
|
|
539
568
|
return this.c.get(`/api/devices/${encodeURIComponent(deviceId)}/snapshots`);
|
|
@@ -577,6 +606,8 @@ var DevicesApi = class {
|
|
|
577
606
|
lease(deviceId) {
|
|
578
607
|
return this.c.post(`/api/devices/${encodeURIComponent(deviceId)}/lease`);
|
|
579
608
|
}
|
|
609
|
+
/** Release the caller's open real-device lease sessions and settle their billing.
|
|
610
|
+
* This does not stop, power off, or delete the device. */
|
|
580
611
|
release(deviceId) {
|
|
581
612
|
return this.c.post(`/api/devices/${encodeURIComponent(deviceId)}/release`);
|
|
582
613
|
}
|
|
@@ -617,6 +648,10 @@ var DevicesApi = class {
|
|
|
617
648
|
updateProxy(deviceId, proxy) {
|
|
618
649
|
return this.c.patch(`/api/devices/${encodeURIComponent(deviceId)}`, { proxy });
|
|
619
650
|
}
|
|
651
|
+
/** Retrieve only the configured custom proxy address for an authorized device. */
|
|
652
|
+
customProxyAddress(deviceId) {
|
|
653
|
+
return this.c.get(`/api/devices/${encodeURIComponent(deviceId)}/proxy`);
|
|
654
|
+
}
|
|
620
655
|
/** Probe the device's configured proxy and report its egress IP/connectivity. */
|
|
621
656
|
probeProxy(deviceId) {
|
|
622
657
|
return this.c.post(`/api/devices/${encodeURIComponent(deviceId)}/proxy/probe`, {});
|
|
@@ -1441,14 +1476,31 @@ var ImagesApi = class {
|
|
|
1441
1476
|
};
|
|
1442
1477
|
|
|
1443
1478
|
// src/core/resources/billing.ts
|
|
1479
|
+
function normalizeTopupAmount(value) {
|
|
1480
|
+
if (typeof value !== "string") return null;
|
|
1481
|
+
const text = value.trim();
|
|
1482
|
+
if (!/^\d+(?:\.\d{1,4})?$/.test(text)) return null;
|
|
1483
|
+
const [whole = "", fraction = ""] = text.split(".");
|
|
1484
|
+
const integer = whole.replace(/^0+/, "") || "0";
|
|
1485
|
+
const decimals = fraction.replace(/0+$/, "");
|
|
1486
|
+
if (integer.length > 10 || decimals.length > 4 || integer === "0" && !decimals) return null;
|
|
1487
|
+
return decimals ? `${integer}.${decimals}` : integer;
|
|
1488
|
+
}
|
|
1489
|
+
var TOPUP_UUID = /^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i;
|
|
1444
1490
|
var BillingApi = class {
|
|
1445
|
-
constructor(c) {
|
|
1491
|
+
constructor(c, defaultChannel) {
|
|
1446
1492
|
this.c = c;
|
|
1493
|
+
this.defaultChannel = defaultChannel;
|
|
1447
1494
|
}
|
|
1448
1495
|
/** 当前钱包余额 + 最近流水(`GET /api/billing/balance`)。 */
|
|
1449
1496
|
balance() {
|
|
1450
1497
|
return this.c.get("/api/billing/balance");
|
|
1451
1498
|
}
|
|
1499
|
+
/** Caller project runtime payer mode for display/diagnosis only; server admission is authoritative.
|
|
1500
|
+
* Account balance currency is reported by the server; this does not convert credits or points. */
|
|
1501
|
+
runtimePayer() {
|
|
1502
|
+
return this.c.get("/api/billing/runtime-payer");
|
|
1503
|
+
}
|
|
1452
1504
|
/** 名下项目订阅列表(`GET /api/billing/subscriptions`)。 */
|
|
1453
1505
|
subscriptions() {
|
|
1454
1506
|
return this.c.get("/api/billing/subscriptions");
|
|
@@ -1461,9 +1513,45 @@ var BillingApi = class {
|
|
|
1461
1513
|
ownNodeCharges() {
|
|
1462
1514
|
return this.c.get("/api/billing/own-node-charges");
|
|
1463
1515
|
}
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1516
|
+
topupMethods() {
|
|
1517
|
+
return this.c.get("/api/billing/topup/methods");
|
|
1518
|
+
}
|
|
1519
|
+
wiseOrders() {
|
|
1520
|
+
return this.c.get("/api/billing/wise/orders");
|
|
1521
|
+
}
|
|
1522
|
+
createWiseOrder(amount_cents, opts) {
|
|
1523
|
+
const channel = opts?.channel?.trim() || this.defaultChannel;
|
|
1524
|
+
const body = channel ? { amount_cents, channel } : { amount_cents };
|
|
1525
|
+
return this.c.post("/api/billing/wise/orders", body, { redirect: "error" });
|
|
1526
|
+
}
|
|
1527
|
+
stripeOrders() {
|
|
1528
|
+
return this.c.get("/api/billing/stripe/orders");
|
|
1529
|
+
}
|
|
1530
|
+
createStripeCheckout(input) {
|
|
1531
|
+
const channel = input.channel?.trim() || this.defaultChannel;
|
|
1532
|
+
const body = channel ? { ...input, channel } : input;
|
|
1533
|
+
return this.c.post("/api/billing/stripe/checkout", body, { redirect: "error" });
|
|
1534
|
+
}
|
|
1535
|
+
reconcileStripeCheckout(session_id) {
|
|
1536
|
+
return this.c.post("/api/billing/stripe/reconcile", { session_id }, { redirect: "error" });
|
|
1537
|
+
}
|
|
1538
|
+
/** 查询当前管理员身份,或按 UUID 核对未决充值;不执行写入。 */
|
|
1539
|
+
async lookupTopup(requestId) {
|
|
1540
|
+
if (requestId !== void 0 && (typeof requestId !== "string" || !TOPUP_UUID.test(requestId))) {
|
|
1541
|
+
throw new TypeError("request_id must be a UUID");
|
|
1542
|
+
}
|
|
1543
|
+
return this.c.get("/api/admin/billing/balance/topup", { scope: "admin", query: requestId ? { request_id: requestId } : void 0 });
|
|
1544
|
+
}
|
|
1545
|
+
/** PUT 避免旧版仅 POST 的服务端将未携回执的请求重复入账。 */
|
|
1546
|
+
async topup(input) {
|
|
1547
|
+
if (typeof input.request_id !== "string" || !TOPUP_UUID.test(input.request_id)) {
|
|
1548
|
+
throw new TypeError("request_id must be a UUID");
|
|
1549
|
+
}
|
|
1550
|
+
const amount = normalizeTopupAmount(input.amount);
|
|
1551
|
+
if (amount === null) throw new RangeError("amount must be a positive NUMERIC(14,4) decimal text");
|
|
1552
|
+
const note = input.note?.trim();
|
|
1553
|
+
if (note && ([...note].length > 500 || note.includes("\0"))) throw new RangeError("note must be at most 500 characters and contain no NUL");
|
|
1554
|
+
return this.c.put("/api/admin/billing/balance/topup", { ...input, amount, note: note || void 0 }, { scope: "admin" });
|
|
1467
1555
|
}
|
|
1468
1556
|
};
|
|
1469
1557
|
|
|
@@ -1794,7 +1882,7 @@ var AixClient = class {
|
|
|
1794
1882
|
this.llm = new LlmApi(this.http);
|
|
1795
1883
|
this.admin = new AdminApi(this.http);
|
|
1796
1884
|
this.images = new ImagesApi(this.http);
|
|
1797
|
-
this.billing = new BillingApi(this.http);
|
|
1885
|
+
this.billing = new BillingApi(this.http, this.cfg.channel);
|
|
1798
1886
|
this.proxies = new ManagedProxiesApi(this.http);
|
|
1799
1887
|
this.ipCommerce = new IpCommerceApi(this.http);
|
|
1800
1888
|
this.tokens = new ApiTokensApi(this.http);
|
|
@@ -1815,7 +1903,7 @@ var AixClient = class {
|
|
|
1815
1903
|
* 即可,不必回依赖 client 实例)。
|
|
1816
1904
|
*/
|
|
1817
1905
|
async deviceSession(deviceId, opts = {}) {
|
|
1818
|
-
const { DeviceSession: DeviceSession2 } = await import('./device-session-
|
|
1906
|
+
const { DeviceSession: DeviceSession2 } = await import('./device-session-PVHD6PNR.js');
|
|
1819
1907
|
return DeviceSession2.open(this.cfg, deviceId, opts);
|
|
1820
1908
|
}
|
|
1821
1909
|
};
|
|
@@ -2466,4 +2554,4 @@ async function pullFile(source, deviceId, src, opts = {}) {
|
|
|
2466
2554
|
}
|
|
2467
2555
|
}
|
|
2468
2556
|
|
|
2469
|
-
export { AdminApi, AixAuthError, AixClient, AixDeviceOffline, AixError, AixLocked, AixProtocolError, AixTimeout, ApiTokensApi, AuthApi, BillingApi, ClustersApi, DeviceSession, DevicesApi, EnvRun, FleetApi, ImagesApi, IpCommerceApi, LlmApi, LocalNodeController, LocatorsApi, ManagedProxiesApi, NodesApi, ProjectsApi, ReconnectingSocket, RestClient, ScriptsApi, ShortcutsApi, SnapshotsApi, TasksApi, UsersApi, WebhooksApi, authHeader, buildAuthProvider, createCachedUserCredential, createClient, detectEnvOs, envBlocker, errorFromRet, executionStreamEventsAfter, executionWsTicketUrl, executionWsUrl, getIceServers, getLocale, isEnvEventFrame, isExecutionFrame, isFleetRunTerminal, isFridaEventFrame, isRetFrame, isScriptletEventFrame, isStatusFrame, joinUrl, mintViewerGrant, mintViewerToken, parseIncoming, pullFile, pushFile, resolveConfig, restClient, runEnvToFinish, setLocale, summarizeEnv, t, validUuid, validateViewerGrant };
|
|
2557
|
+
export { AdminApi, AixAuthError, AixClient, AixDeviceOffline, AixError, AixLocked, AixProtocolError, AixTimeout, ApiTokensApi, AuthApi, BillingApi, ClustersApi, DeviceSession, DevicesApi, EnvRun, FleetApi, ImagesApi, IpCommerceApi, LlmApi, LocalNodeController, LocatorsApi, ManagedProxiesApi, NodesApi, ProjectsApi, ReconnectingSocket, RestClient, ScriptsApi, ShortcutsApi, SnapshotsApi, TasksApi, UsersApi, WebhooksApi, authHeader, buildAuthProvider, createCachedUserCredential, createClient, detectEnvOs, envBlocker, errorFromRet, executionStreamEventsAfter, executionWsTicketUrl, executionWsUrl, getIceServers, getLocale, isEnvEventFrame, isExecutionFrame, isFleetRunTerminal, isFridaEventFrame, isQueuedPowerReceipt, isRetFrame, isScriptletEventFrame, isStatusFrame, joinUrl, mintViewerGrant, mintViewerToken, normalizeTopupAmount, parseIncoming, pullFile, pushFile, resolveConfig, restClient, runEnvToFinish, setLocale, summarizeEnv, t, validUuid, validateViewerGrant };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useAixT } from './chunk-FJPIY4YI.js';
|
|
2
1
|
import { Button } from './chunk-7RQTSTR6.js';
|
|
3
|
-
import {
|
|
2
|
+
import { useAixT } from './chunk-HQ2L4NQ2.js';
|
|
3
|
+
import { useClient } from './chunk-UEZVXYGP.js';
|
|
4
4
|
import { useSyncExternalStore, useState, useEffect } from 'react';
|
|
5
5
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DeviceChannel, ScriptDebugger, FlowRun, MirrorSession, normalizeDevices, submitBatch } from './chunk-
|
|
2
|
-
import { resolveConfig, AixClient, isFleetRunTerminal, joinUrl, AixAuthError, AixError, EnvRun, detectEnvOs, summarizeEnv, ReconnectingSocket, executionWsTicketUrl } from './chunk-
|
|
1
|
+
import { DeviceChannel, ScriptDebugger, FlowRun, MirrorSession, normalizeDevices, submitBatch } from './chunk-ED6CB3B4.js';
|
|
2
|
+
import { resolveConfig, AixClient, isFleetRunTerminal, joinUrl, AixAuthError, AixError, EnvRun, detectEnvOs, summarizeEnv, ReconnectingSocket, executionWsTicketUrl } from './chunk-OJK35AQD.js';
|
|
3
3
|
import React, { createContext, useContext, useState, useRef, useEffect, useCallback, useMemo, createElement } from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -10,10 +10,16 @@ function AixProvider({ config, children }) {
|
|
|
10
10
|
// Spread individual stable primitives so an inline config object literal
|
|
11
11
|
// doesn't thrash the channel on every parent render.
|
|
12
12
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13
|
-
[config.baseUrl, config.getAuthToken, config.fetchFn, config.wsFactory]
|
|
13
|
+
[config.baseUrl, config.channel, config.getAuthToken, config.fetchFn, config.wsFactory]
|
|
14
14
|
);
|
|
15
15
|
return /* @__PURE__ */ jsx(Ctx.Provider, { value: resolved, children });
|
|
16
16
|
}
|
|
17
|
+
function AixResolvedProvider({ config, children }) {
|
|
18
|
+
return /* @__PURE__ */ jsx(Ctx.Provider, { value: config, children });
|
|
19
|
+
}
|
|
20
|
+
function useOptionalAixConfig() {
|
|
21
|
+
return useContext(Ctx);
|
|
22
|
+
}
|
|
17
23
|
function useAixConfig() {
|
|
18
24
|
const c = useContext(Ctx);
|
|
19
25
|
if (!c) throw new Error("useAixConfig must be used within <AixProvider>");
|
|
@@ -2270,7 +2276,8 @@ function useBilling() {
|
|
|
2270
2276
|
await refetch();
|
|
2271
2277
|
return r;
|
|
2272
2278
|
}, [c, refetch]);
|
|
2273
|
-
|
|
2279
|
+
const lookupTopup = useCallback((requestId) => c.billing.lookupTopup(requestId), [c]);
|
|
2280
|
+
return { ...q, topup, lookupTopup };
|
|
2274
2281
|
}
|
|
2275
2282
|
function useApiTokens() {
|
|
2276
2283
|
const c = useClient();
|
|
@@ -2293,4 +2300,4 @@ function useApiTokens() {
|
|
|
2293
2300
|
return { ...q, create, revoke, rotate };
|
|
2294
2301
|
}
|
|
2295
2302
|
|
|
2296
|
-
export { AixProvider, DevicesProvider, GROUP_MIRROR_MAX, InspectorProvider, NodesProvider, ShortcutsProvider, createAgentTaskRunner, mapDevice, preflightTaskAgentDevice, useAdmin, useAixConfig, useApiTokens, useAuth, useAutomationQueue, useBilling, useClient, useClusters, useCommands, useDevice, useDeviceActions, useDevices, useDevicesView, useEnvGate, useEnvRun, useFleetRun, useFlowRun, useGroupMirror, useImages, useInspector, useInspectorView, useLlm, useLocators, useMirror, useNodes, useNodesView, useProjects, useQuery, useScript, useScriptRun, useScripts, useShortcutsView, useTaskAgentRun, useTaskStatus, useTasks, useWebhooks };
|
|
2303
|
+
export { AixProvider, AixResolvedProvider, DevicesProvider, GROUP_MIRROR_MAX, InspectorProvider, NodesProvider, ShortcutsProvider, createAgentTaskRunner, mapDevice, preflightTaskAgentDevice, useAdmin, useAixConfig, useApiTokens, useAuth, useAutomationQueue, useBilling, useClient, useClusters, useCommands, useDevice, useDeviceActions, useDevices, useDevicesView, useEnvGate, useEnvRun, useFleetRun, useFlowRun, useGroupMirror, useImages, useInspector, useInspectorView, useLlm, useLocators, useMirror, useNodes, useNodesView, useOptionalAixConfig, useProjects, useQuery, useScript, useScriptRun, useScripts, useShortcutsView, useTaskAgentRun, useTaskStatus, useTasks, useWebhooks };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { v as AuthResult, aP as SendCodeResult, bj as VerifyCodeResult, ay as ProjectUserResult, aw as Project, H as CreateProjectInput, I as CreateProjectResult, aA as ProvisionUserInput, aB as ProvisionUserResult, D as DeviceRow, P as ProvisionSpec, a as ProvisionResult, az as ProvisionOperation, C as CatalogBrand, U as DeviceOp, aO as ScreenshotResult, $ as ElementNode, at as PowerAction, R as DeveloperSettingsReceipt, Y as DeviceSnapshotList, q as AppCandidate, aL as RecycledDeviceRow, aE as ProxyPatchResult, M as CustomProxyAddress, aF as ProxyProbe, V as DeviceProfileView, aS as SetProfileResult, av as ProfileOverrides, a7 as InstallAntiDetectResult, aR as SetDisguiseResult, N as NodeRow, aM as RegisterNodeInput, aN as RegisterNodeResult, bh as UpdateNodeInput, aQ as SetDataRootResult, n as AgentTaskSubmitInput, o as AgentTaskSubmitResult, l as AgentTaskReadResult, k as AgentTaskEventsResult, b as DiscoveredDevice, h as AdbScanResult, ae as IosScanResult, ab as IosDiagnostics, a8 as IosAccountState, ad as IosLoginResult, ac as IosLibraryApp, z as Cluster, F as CreateClusterInput, f as ScriptSummary, S as Script, aT as Shortcut, ak as NewShortcut, ah as Locator, G as CreateLocatorInput, a3 as FleetRunSubmit, a1 as FleetRunDetail, b8 as TaskStatus, b6 as TaskListFilter, b7 as TaskListResult, b5 as TaskEventsResult, bk as WebhookConfig, K as CreateWebhookInput, ag as LlmTestResult, W as DeviceRate, aJ as RateInput, x as BillingPlan, ap as PlanInput, Z as DeviceUsageSession, aK as RebateLedgerRow, aq as PlatformOem, ar as PlatformOemInput, a4 as ImageArtifact, a5 as ImageInput, a6 as ImageOption, w as BalanceResp, ax as ProjectSubscription, b3 as SubscribeInput, ao as OwnNodeDailyCharge, be as TopupMethods, bm as WiseOrders, bl as WiseOrder, b2 as StripeTopupOrder, a$ as StripeCheckoutInput, b0 as StripeCheckoutResult, b1 as StripeReconcileResult, bd as TopupLookup, bc as TopupInput, bg as TopupResult, p as ApiTokenRow, J as CreateTokenInput, L as CreatedToken, s as AppTemplate, aj as NewAppTemplate, as as PortableSnapshot, aX as SnapshotKind, aZ as SnapshotOperationReceipt, aY as SnapshotOperation, aW as SnapshotGrant, an as NodeScope } from './types-CBI5SIH5.js';
|
|
2
2
|
|
|
3
3
|
type OutgoingFrame = {
|
|
4
|
+
t: 'network_adb';
|
|
5
|
+
id: string;
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
} | {
|
|
4
8
|
t: 'adb_exec';
|
|
5
9
|
id: string;
|
|
6
10
|
argv: string[];
|
|
@@ -485,6 +489,8 @@ declare function pullFile(source: AixClient | AixConfig | ResolvedConfig, device
|
|
|
485
489
|
interface RequestOpts {
|
|
486
490
|
/** Optional request cancellation; no automatic retries are performed. */
|
|
487
491
|
signal?: AbortSignal;
|
|
492
|
+
/** Redirect handling for writes that cannot be replayed. */
|
|
493
|
+
redirect?: RequestRedirect;
|
|
488
494
|
/** Auth scope; defaults to 'caller'. */
|
|
489
495
|
scope?: Scope;
|
|
490
496
|
/** JSON body (serialized unless it is a string already). */
|
|
@@ -570,6 +576,8 @@ declare class DevicesApi {
|
|
|
570
576
|
/** Provision a virtual device (`POST /api/devices/provision`). The spec is
|
|
571
577
|
* opaque; `node_id` (optional) routes to a specific usable node. */
|
|
572
578
|
provision(spec: ProvisionSpec): Promise<ProvisionResult>;
|
|
579
|
+
/** Inspect a persisted provisioning operation without retrying creation or contacting the node. */
|
|
580
|
+
provisionOperation(operationId: string, options?: Pick<RequestOpts, 'signal'>): Promise<ProvisionOperation>;
|
|
573
581
|
/** Brand→model identity catalog for the create-wizard's 品牌 → 机型 picker
|
|
574
582
|
* (`GET /api/devices/profile-catalog`). Static read-only data; the chosen
|
|
575
583
|
* `model` is passed back via `ProvisionSpec.model` to lock the fingerprint base. */
|
|
@@ -580,12 +588,16 @@ declare class DevicesApi {
|
|
|
580
588
|
op<T = unknown>(deviceId: string, op: DeviceOp, options?: Pick<RequestOpts, 'signal'>): Promise<T>;
|
|
581
589
|
screenshot(deviceId: string): Promise<ScreenshotResult>;
|
|
582
590
|
captureUiTree(deviceId: string): Promise<ElementNode>;
|
|
583
|
-
/** Power / lifecycle op (`POST /api/devices/:id/power`).
|
|
584
|
-
*
|
|
585
|
-
* `{
|
|
586
|
-
*
|
|
587
|
-
*
|
|
591
|
+
/** Power / lifecycle op (`POST /api/devices/:id/power`). A confirmed Stop
|
|
592
|
+
* returns `{ stopped: true }`, but during an image cutover Stop may return
|
|
593
|
+
* `{ status: 'queued', desired_running: false }`. Reboot starts asynchronously
|
|
594
|
+
* and returns `{ status: 'rebooting', async: true }`. Non-2xx responses
|
|
595
|
+
* reject with the node/backend error. */
|
|
588
596
|
power<T = Record<string, unknown>>(deviceId: string, action: PowerAction, extra?: Record<string, unknown>): Promise<T>;
|
|
597
|
+
/** Read the virtual Android settings back from the device (not USB host authorization). */
|
|
598
|
+
getDeveloperSettings(deviceId: string): Promise<DeveloperSettingsReceipt>;
|
|
599
|
+
/** Enable developer mode and USB debugging; backend verifies both by reading Android settings. */
|
|
600
|
+
enableDeveloperSettings(deviceId: string): Promise<DeveloperSettingsReceipt>;
|
|
589
601
|
/** List all user data snapshots, including while the device is offline. */
|
|
590
602
|
listSnapshots(deviceId: string): Promise<DeviceSnapshotList>;
|
|
591
603
|
/** Save current data under a new server-generated identifier. */
|
|
@@ -611,7 +623,11 @@ declare class DevicesApi {
|
|
|
611
623
|
/** Install an apk/xapk already uploaded to R2 (key from `filesUploadUrl`). */
|
|
612
624
|
installByKey(deviceId: string, key: string): Promise<unknown>;
|
|
613
625
|
lease(deviceId: string): Promise<unknown>;
|
|
614
|
-
|
|
626
|
+
/** Release the caller's open real-device lease sessions and settle their billing.
|
|
627
|
+
* This does not stop, power off, or delete the device. */
|
|
628
|
+
release(deviceId: string): Promise<{
|
|
629
|
+
released: number;
|
|
630
|
+
}>;
|
|
615
631
|
claim(deviceId: string): Promise<unknown>;
|
|
616
632
|
/** 软删除(移入回收站)—`DELETE /api/devices/:id`。在线节点即时销毁容器,
|
|
617
633
|
* 离线节点标记 pending_destroy,待节点重连对账。3 天后自动彻底清除。 */
|
|
@@ -650,6 +666,8 @@ declare class DevicesApi {
|
|
|
650
666
|
}): Promise<unknown>;
|
|
651
667
|
/** Update only the device proxy and retain a typed patch receipt. */
|
|
652
668
|
updateProxy(deviceId: string, proxy: string): Promise<ProxyPatchResult>;
|
|
669
|
+
/** Retrieve only the configured custom proxy address for an authorized device. */
|
|
670
|
+
customProxyAddress(deviceId: string): Promise<CustomProxyAddress>;
|
|
653
671
|
/** Probe the device's configured proxy and report its egress IP/connectivity. */
|
|
654
672
|
probeProxy(deviceId: string): Promise<ProxyProbe>;
|
|
655
673
|
/** 休眠设备 (`POST /api/devices/:id/sleep`)。
|
|
@@ -1093,16 +1111,32 @@ declare class ImagesApi {
|
|
|
1093
1111
|
* 钱包身份恒为 user——项目 key/secret 调用解析到 representative user 的钱包。 */
|
|
1094
1112
|
declare class BillingApi {
|
|
1095
1113
|
private readonly c;
|
|
1096
|
-
|
|
1114
|
+
private readonly defaultChannel?;
|
|
1115
|
+
constructor(c: RestClient, defaultChannel?: string | undefined);
|
|
1097
1116
|
/** 当前钱包余额 + 最近流水(`GET /api/billing/balance`)。 */
|
|
1098
1117
|
balance(): Promise<BalanceResp>;
|
|
1118
|
+
/** Caller project runtime payer mode for display/diagnosis only; server admission is authoritative.
|
|
1119
|
+
* Account balance currency is reported by the server; this does not convert credits or points. */
|
|
1120
|
+
runtimePayer(): Promise<{
|
|
1121
|
+
mode: 'project' | 'paused' | 'personal';
|
|
1122
|
+
}>;
|
|
1099
1123
|
/** 名下项目订阅列表(`GET /api/billing/subscriptions`)。 */
|
|
1100
1124
|
subscriptions(): Promise<ProjectSubscription[]>;
|
|
1101
1125
|
/** 订阅一个套餐(`POST /api/billing/subscriptions`)。`plan_id` 由调用方传入。 */
|
|
1102
1126
|
subscribe(input: SubscribeInput): Promise<ProjectSubscription>;
|
|
1103
1127
|
/** 自有节点日费(`GET /api/billing/own-node-charges`)。 */
|
|
1104
1128
|
ownNodeCharges(): Promise<OwnNodeDailyCharge[]>;
|
|
1105
|
-
|
|
1129
|
+
topupMethods(): Promise<TopupMethods>;
|
|
1130
|
+
wiseOrders(): Promise<WiseOrders>;
|
|
1131
|
+
createWiseOrder(amount_cents: number, opts?: {
|
|
1132
|
+
channel?: string;
|
|
1133
|
+
}): Promise<WiseOrder>;
|
|
1134
|
+
stripeOrders(): Promise<StripeTopupOrder[]>;
|
|
1135
|
+
createStripeCheckout(input: StripeCheckoutInput): Promise<StripeCheckoutResult>;
|
|
1136
|
+
reconcileStripeCheckout(session_id: string): Promise<StripeReconcileResult>;
|
|
1137
|
+
/** 查询当前管理员身份,或按 UUID 核对未决充值;不执行写入。 */
|
|
1138
|
+
lookupTopup(requestId?: string): Promise<TopupLookup>;
|
|
1139
|
+
/** PUT 避免旧版仅 POST 的服务端将未携回执的请求重复入账。 */
|
|
1106
1140
|
topup(input: TopupInput): Promise<TopupResult>;
|
|
1107
1141
|
}
|
|
1108
1142
|
|
|
@@ -1317,6 +1351,8 @@ interface IpOrder {
|
|
|
1317
1351
|
entitlement_ids: string[];
|
|
1318
1352
|
apply_status?: string;
|
|
1319
1353
|
failure_reason?: string | null;
|
|
1354
|
+
/** Safe read-only provisioning projection; present when an attached device creation intent exists. */
|
|
1355
|
+
device_creation?: ProvisionOperation;
|
|
1320
1356
|
}
|
|
1321
1357
|
interface IpResource {
|
|
1322
1358
|
id: string;
|
|
@@ -1572,6 +1608,7 @@ declare class LocalNodeController {
|
|
|
1572
1608
|
}
|
|
1573
1609
|
|
|
1574
1610
|
interface IWebSocket {
|
|
1611
|
+
readonly bufferedAmount?: number;
|
|
1575
1612
|
send(data: string): void;
|
|
1576
1613
|
close(code?: number, reason?: string): void;
|
|
1577
1614
|
onopen: ((ev: unknown) => void) | null;
|
|
@@ -1655,6 +1692,9 @@ type RTCFactory = (config: {
|
|
|
1655
1692
|
interface AixConfig {
|
|
1656
1693
|
/** Backend base URL, e.g. "https://api.example.com". */
|
|
1657
1694
|
baseUrl: string;
|
|
1695
|
+
/** Optional developer channel attribution code passed at startup (e.g. "aixtab").
|
|
1696
|
+
* Automatically attached to billing top-up requests unless overridden per call. */
|
|
1697
|
+
channel?: string;
|
|
1658
1698
|
/** Legacy single-user-token path. Equivalent to `auth: { kind: 'user', getToken }`.
|
|
1659
1699
|
* Optional now that `auth` exists — provide this OR `auth` (or both). */
|
|
1660
1700
|
getAuthToken?: () => string | Promise<string>;
|
|
@@ -1673,6 +1713,8 @@ interface AixConfig {
|
|
|
1673
1713
|
}
|
|
1674
1714
|
interface ResolvedConfig {
|
|
1675
1715
|
baseUrl: string;
|
|
1716
|
+
/** Normalized startup developer channel code, if configured. */
|
|
1717
|
+
channel?: string;
|
|
1676
1718
|
/** Resolved user-bearer accessor (kept for the legacy device/mirror/flow
|
|
1677
1719
|
* paths). Throws if no user credential is configured. */
|
|
1678
1720
|
getAuthToken: () => string | Promise<string>;
|
|
@@ -1717,4 +1759,4 @@ declare function authHeader(getAuthToken: () => string | Promise<string>): Promi
|
|
|
1717
1759
|
}>;
|
|
1718
1760
|
declare function resolveConfig(cfg: AixConfig): ResolvedConfig;
|
|
1719
1761
|
|
|
1720
|
-
export { LlmApi as $, type AixConfig as A, BillingApi as B, type CachedUserCredentialOpts as C, type DcStream as D, type EnvOs as E, type FridaEventFrame as F, type ExecutionStreamEventsResult as G, type FileEntry as H, FleetApi as I, type IRTCDataChannel as J, type IRTCPeerConnection as K, type IWebSocket as L, ImagesApi as M, type IncomingFrame as N, type OutgoingFrame as O, type IpCatalog as P, type IpCatalogFilter as Q, type ResolvedConfig as R, type ScriptletEventFrame as S, IpCommerceApi as T, type IpOffer as U, type IpOrder as V, type WebSocketFactory as W, type IpQuote as X, type IpQuoteInput as Y, type IpResource as Z, type IpResourceConnection as _, type
|
|
1762
|
+
export { LlmApi as $, type AixConfig as A, BillingApi as B, type CachedUserCredentialOpts as C, type DcStream as D, type EnvOs as E, type FridaEventFrame as F, type ExecutionStreamEventsResult as G, type FileEntry as H, FleetApi as I, type IRTCDataChannel as J, type IRTCPeerConnection as K, type IWebSocket as L, ImagesApi as M, type IncomingFrame as N, type OutgoingFrame as O, type IpCatalog as P, type IpCatalogFilter as Q, type ResolvedConfig as R, type ScriptletEventFrame as S, IpCommerceApi as T, type IpOffer as U, type IpOrder as V, type WebSocketFactory as W, type IpQuote as X, type IpQuoteInput as Y, type IpResource as Z, type IpResourceConnection as _, type StatusFrame as a, LocalNodeController as a0, type LocalNodeOptions as a1, LocatorsApi as a2, type ManagedCreationInput as a3, type ManagedCreationQuote as a4, type ManagedCreationReceipt as a5, type ManagedCreations as a6, ManagedProxiesApi as a7, type ManagedProxyCatalog as a8, type ManagedProxyOrder as a9, WebhooksApi as aA, authHeader as aB, buildAuthProvider as aC, createCachedUserCredential as aD, createClient as aE, detectEnvOs as aF, envBlocker as aG, executionStreamEventsAfter as aH, executionWsTicketUrl as aI, executionWsUrl as aJ, isEnvEventFrame as aK, isExecutionFrame as aL, isFleetRunTerminal as aM, isFridaEventFrame as aN, isRetFrame as aO, isScriptletEventFrame as aP, isStatusFrame as aQ, joinUrl as aR, parseIncoming as aS, pullFile as aT, pushFile as aU, resolveConfig as aV, restClient as aW, runEnvToFinish as aX, summarizeEnv as aY, type ManagedProxyProduct as aa, type ManagedProxyPurchaseInput as ab, type ManagedProxyQuote as ac, type ManagedProxyQuoteInput as ad, type NodeHost as ae, type NodeHostStatus as af, NodesApi as ag, type ProgressFn as ah, ProjectsApi as ai, type ProxyIntegrationStatus as aj, type PullResult as ak, type PushInput as al, type RTCFactory as am, type RequestOpts as an, RestClient as ao, type RetFrame as ap, type Scope as aq, ScriptsApi as ar, ShortcutsApi as as, SnapshotsApi as at, type StreamTarget as au, TasksApi as av, type TransferOpts as aw, type TransferProgress as ax, type TransferResult as ay, UsersApi as az, type RunEventKind as b, AixClient as c, type EnvRoute as d, type EnvEventKind as e, AdminApi as f, ApiTokensApi as g, AuthApi as h, type AuthProvider as i, ClustersApi as j, type Credential as k, type DeviceReq as l, type DeviceResp as m, DeviceSession as n, DevicesApi as o, type EnvAction as p, type EnvFinished as q, type EnvResultDto as r, EnvRun as s, type EnvSetupInput as t, type EnvStepMeta as u, type EnvStepView as v, type EnvSummary as w, type EnvTeardownInput as x, type ExecutionFrame as y, type ExecutionStreamEvent as z };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { R as ResolvedConfig, W as WebSocketFactory } from '../config-
|
|
2
|
-
export { f as AdminApi, c as AixClient, A as AixConfig, g as ApiTokensApi, h as AuthApi, i as AuthProvider, B as BillingApi, C as CachedUserCredentialOpts, j as ClustersApi, k as Credential, D as DcStream, l as DeviceReq, m as DeviceResp, n as DeviceSession, o as DevicesApi, p as EnvAction, e as EnvEventKind, q as EnvFinished, E as EnvOs, r as EnvResultDto, d as EnvRoute, s as EnvRun, t as EnvSetupInput, u as EnvStepMeta, v as EnvStepView, w as EnvSummary, x as EnvTeardownInput, y as ExecutionFrame, z as ExecutionStreamEvent, G as ExecutionStreamEventsResult, H as FileEntry, I as FleetApi, F as FridaEventFrame, J as IRTCDataChannel, K as IRTCPeerConnection, L as IWebSocket, M as ImagesApi, N as IncomingFrame, P as IpCatalog, Q as IpCatalogFilter, T as IpCommerceApi, U as IpOffer, V as IpOrder, X as IpQuote, Y as IpQuoteInput, Z as IpResource, _ as IpResourceConnection, $ as LlmApi, a0 as LocalNodeController, a1 as LocalNodeOptions, a2 as LocatorsApi, a3 as ManagedCreationInput, a4 as ManagedCreationQuote, a5 as ManagedCreationReceipt, a6 as ManagedCreations, a7 as ManagedProxiesApi, a8 as ManagedProxyCatalog, a9 as ManagedProxyOrder, aa as ManagedProxyProduct, ab as ManagedProxyPurchaseInput, ac as ManagedProxyQuote, ad as ManagedProxyQuoteInput, ae as NodeHost, af as NodeHostStatus, ag as NodesApi, O as OutgoingFrame, ah as ProgressFn, ai as ProjectsApi, aj as ProxyIntegrationStatus, ak as PullResult, al as PushInput, am as RTCFactory, an as RequestOpts, ao as RestClient, ap as RetFrame,
|
|
3
|
-
export { A as AdbResult, D as DeviceChannel,
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { R as ResolvedConfig, W as WebSocketFactory } from '../config-C79rcedl.js';
|
|
2
|
+
export { f as AdminApi, c as AixClient, A as AixConfig, g as ApiTokensApi, h as AuthApi, i as AuthProvider, B as BillingApi, C as CachedUserCredentialOpts, j as ClustersApi, k as Credential, D as DcStream, l as DeviceReq, m as DeviceResp, n as DeviceSession, o as DevicesApi, p as EnvAction, e as EnvEventKind, q as EnvFinished, E as EnvOs, r as EnvResultDto, d as EnvRoute, s as EnvRun, t as EnvSetupInput, u as EnvStepMeta, v as EnvStepView, w as EnvSummary, x as EnvTeardownInput, y as ExecutionFrame, z as ExecutionStreamEvent, G as ExecutionStreamEventsResult, H as FileEntry, I as FleetApi, F as FridaEventFrame, J as IRTCDataChannel, K as IRTCPeerConnection, L as IWebSocket, M as ImagesApi, N as IncomingFrame, P as IpCatalog, Q as IpCatalogFilter, T as IpCommerceApi, U as IpOffer, V as IpOrder, X as IpQuote, Y as IpQuoteInput, Z as IpResource, _ as IpResourceConnection, $ as LlmApi, a0 as LocalNodeController, a1 as LocalNodeOptions, a2 as LocatorsApi, a3 as ManagedCreationInput, a4 as ManagedCreationQuote, a5 as ManagedCreationReceipt, a6 as ManagedCreations, a7 as ManagedProxiesApi, a8 as ManagedProxyCatalog, a9 as ManagedProxyOrder, aa as ManagedProxyProduct, ab as ManagedProxyPurchaseInput, ac as ManagedProxyQuote, ad as ManagedProxyQuoteInput, ae as NodeHost, af as NodeHostStatus, ag as NodesApi, O as OutgoingFrame, ah as ProgressFn, ai as ProjectsApi, aj as ProxyIntegrationStatus, ak as PullResult, al as PushInput, am as RTCFactory, an as RequestOpts, ao as RestClient, ap as RetFrame, b as RunEventKind, aq as Scope, S as ScriptletEventFrame, ar as ScriptsApi, as as ShortcutsApi, at as SnapshotsApi, a as StatusFrame, au as StreamTarget, av as TasksApi, aw as TransferOpts, ax as TransferProgress, ay as TransferResult, az as UsersApi, aA as WebhooksApi, aB as authHeader, aC as buildAuthProvider, aD as createCachedUserCredential, aE as createClient, aF as detectEnvOs, aG as envBlocker, aH as executionStreamEventsAfter, aI as executionWsTicketUrl, aJ as executionWsUrl, aK as isEnvEventFrame, aL as isExecutionFrame, aM as isFleetRunTerminal, aN as isFridaEventFrame, aO as isRetFrame, aP as isScriptletEventFrame, aQ as isStatusFrame, aR as joinUrl, aS as parseIncoming, aT as pullFile, aU as pushFile, aV as resolveConfig, aW as restClient, aX as runEnvToFinish, aY as summarizeEnv } from '../config-C79rcedl.js';
|
|
3
|
+
export { A as AdbResult, D as DeviceChannel, a as DeviceTunnel, N as NetworkAdbGrant, b as NetworkAdbState, W as WdaResult } from '../device-channel-OiZwAqNQ.js';
|
|
4
|
+
export { b as ScriptDebugger, c as ScriptDebuggerOptions, a as ScriptEngine, S as ScriptEvent, d as ScriptRunInput } from '../script-debugger-DjxpvdaN.js';
|
|
5
|
+
export { A as AutomationQueue, B as BatchConfig, F as FlowEvent, a as FlowRun, b as FlowSubmit, Q as QueueMode, s as submitBatch } from '../automation-queue-GhfQtZLm.js';
|
|
6
|
+
import { g as ScriptParam } from '../types-CBI5SIH5.js';
|
|
7
|
+
export { h as AdbScanResult, d as AgentTaskBlocker, i as AgentTaskCurrentAttempt, j as AgentTaskEvent, k as AgentTaskEventsResult, e as AgentTaskEvidence, l as AgentTaskReadResult, m as AgentTaskReadTarget, n as AgentTaskSubmitInput, o as AgentTaskSubmitResult, c as AgentTaskTarget, A as AgentTaskTargetStatus, p as ApiTokenRow, q as AppCandidate, r as AppEntry, s as AppTemplate, t as AppTemplateItemAndroid, u as AppTemplateItemIos, v as AuthResult, B as BalanceLedgerRow, w as BalanceResp, x as BillingPlan, C as CatalogBrand, y as CatalogModel, z as Cluster, E as ClusterMode, F as CreateClusterInput, G as CreateLocatorInput, H as CreateProjectInput, I as CreateProjectResult, J as CreateTokenInput, K as CreateWebhookInput, L as CreatedToken, M as CustomProxyAddress, O as Decimal, Q as DeveloperRef, R as DeveloperSettingsReceipt, T as DeviceLocation, U as DeviceOp, V as DeviceProfileView, W as DeviceRate, D as DeviceRow, X as DeviceSnapshot, Y as DeviceSnapshotList, Z as DeviceUsageSession, b as DiscoveredDevice, _ as DiscoveredStatus, $ as ElementNode, a0 as FleetMode, a1 as FleetRunDetail, a2 as FleetRunDeviceRow, a3 as FleetRunSubmit, a4 as ImageArtifact, a5 as ImageInput, a6 as ImageOption, a7 as InstallAntiDetectResult, a8 as IosAccountState, a9 as IosDeviceRow, aa as IosDiagnosticStage, ab as IosDiagnostics, ac as IosLibraryApp, ad as IosLoginResult, ae as IosScanResult, af as KnownDeviceOpName, ag as LlmTestResult, ah as Locator, ai as MdnsEntry, aj as NewAppTemplate, ak as NewShortcut, al as NodeEffectiveCaps, am as NodeOwnerPolicy, N as NodeRow, an as NodeScope, ao as OwnNodeDailyCharge, ap as PlanInput, aq as PlatformOem, ar as PlatformOemInput, as as PortableSnapshot, at as PowerAction, au as PowerRunResult, av as ProfileOverrides, aw as Project, ax as ProjectSubscription, ay as ProjectUserResult, az as ProvisionOperation, a as ProvisionResult, P as ProvisionSpec, aA as ProvisionUserInput, aB as ProvisionUserResult, aC as ProxyApplyReceipt, aD as ProxyApplyStatus, aE as ProxyPatchResult, aF as ProxyProbe, aG as ProxyProbeErrorCode, aH as ProxySummary, aI as ProxyUrl, aJ as RateInput, aK as RebateLedgerRow, aL as RecycledDeviceRow, aM as RegisterNodeInput, aN as RegisterNodeResult, aO as ScreenshotResult, S as Script, f as ScriptSummary, aP as SendCodeResult, aQ as SetDataRootResult, aR as SetDisguiseResult, aS as SetProfileResult, aT as Shortcut, aU as ShortcutParam, aV as ShortcutRunResult, aW as SnapshotGrant, aX as SnapshotKind, aY as SnapshotOperation, aZ as SnapshotOperationReceipt, a_ as SnapshotOperationStatus, a$ as StripeCheckoutInput, b0 as StripeCheckoutResult, b1 as StripeReconcileResult, b2 as StripeTopupOrder, b3 as SubscribeInput, b4 as TaskEvent, b5 as TaskEventsResult, b6 as TaskListFilter, b7 as TaskListResult, b8 as TaskStatus, b9 as TaskSubmitResult, ba as TaskSummary, bb as TaskTarget, bc as TopupInput, bd as TopupLookup, be as TopupMethods, bf as TopupReceipt, bg as TopupResult, bh as UpdateNodeInput, bi as User, bj as VerifyCodeResult, bk as WebhookConfig, bl as WiseOrder, bm as WiseOrders } from '../types-CBI5SIH5.js';
|
|
8
|
+
import { C as ControlMessage } from '../mirror-session-DifANocH.js';
|
|
9
|
+
export { I as InputMessage, M as MirrorJoinOptions, a as MirrorSession, S as SCRCPY_PROFILES, b as ScrcpyProfile, c as ScrcpyProfileName, q as qualityMessage } from '../mirror-session-DifANocH.js';
|
|
9
10
|
import { B as Box, D as DeviceSize } from '../coords-LPR_MPyp.js';
|
|
10
11
|
export { a as DevicePoint, t as toDevicePoint } from '../coords-LPR_MPyp.js';
|
|
11
|
-
export { D as DeviceTransport, N as NormalizedDevice, n as normalizeDevices } from '../device-normalize-
|
|
12
|
+
export { D as DeviceTransport, N as NormalizedDevice, n as normalizeDevices } from '../device-normalize-ODrxJb-a.js';
|
|
12
13
|
|
|
13
14
|
type AixErrorCode = 'auth' | 'network' | 'timeout' | 'offline' | 'locked' | 'protocol' | 'unknown';
|
|
14
15
|
interface AixErrorDetails {
|
|
@@ -72,6 +73,7 @@ interface ReconnectingSocketOpts {
|
|
|
72
73
|
declare class ReconnectingSocket {
|
|
73
74
|
private readonly o;
|
|
74
75
|
private ws;
|
|
76
|
+
private opened;
|
|
75
77
|
private closed;
|
|
76
78
|
private attempt;
|
|
77
79
|
private reconnectTimer;
|
|
@@ -85,6 +87,8 @@ declare class ReconnectingSocket {
|
|
|
85
87
|
* can run; queued messages/close events must never affect its replacement. */
|
|
86
88
|
reconnect(): void;
|
|
87
89
|
send(text: string): void;
|
|
90
|
+
/** Refuse ADB writes when transport backpressure is unavailable or over budget. */
|
|
91
|
+
sendBounded(text: string, maxBufferedBytes: number): void;
|
|
88
92
|
isConnected(): boolean;
|
|
89
93
|
close(): void;
|
|
90
94
|
}
|
package/dist/core/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AutomationQueue, DeviceChannel, DeviceTunnel, FlowRun, MirrorSession, SCHEMA_KEY, SCRCPY_PROFILES, ScriptDebugger, mintDeviceAccess, normalizeDevices, qualityMessage, schemaDefaults, schemaToVariables, submitBatch, targetParam, variablesToSchema, wsUrlFromAccess } from '../chunk-
|
|
2
|
-
export { AdminApi, AixAuthError, AixClient, AixDeviceOffline, AixError, AixLocked, AixProtocolError, AixTimeout, ApiTokensApi, AuthApi, BillingApi, ClustersApi, DeviceSession, DevicesApi, EnvRun, FleetApi, ImagesApi, IpCommerceApi, LlmApi, LocalNodeController, LocatorsApi, ManagedProxiesApi, NodesApi, ProjectsApi, ReconnectingSocket, RestClient, ScriptsApi, ShortcutsApi, SnapshotsApi, TasksApi, UsersApi, WebhooksApi, authHeader, buildAuthProvider, createCachedUserCredential, createClient, detectEnvOs, envBlocker, errorFromRet, executionStreamEventsAfter, executionWsTicketUrl, executionWsUrl, getIceServers, getLocale, isEnvEventFrame, isExecutionFrame, isFleetRunTerminal, isFridaEventFrame, isRetFrame, isScriptletEventFrame, isStatusFrame, joinUrl, mintViewerGrant, mintViewerToken, parseIncoming, pullFile, pushFile, resolveConfig, restClient, runEnvToFinish, setLocale, summarizeEnv, t } from '../chunk-
|
|
1
|
+
export { AutomationQueue, DeviceChannel, DeviceTunnel, FlowRun, MirrorSession, SCHEMA_KEY, SCRCPY_PROFILES, ScriptDebugger, mintDeviceAccess, normalizeDevices, qualityMessage, schemaDefaults, schemaToVariables, submitBatch, targetParam, variablesToSchema, wsUrlFromAccess } from '../chunk-ED6CB3B4.js';
|
|
2
|
+
export { AdminApi, AixAuthError, AixClient, AixDeviceOffline, AixError, AixLocked, AixProtocolError, AixTimeout, ApiTokensApi, AuthApi, BillingApi, ClustersApi, DeviceSession, DevicesApi, EnvRun, FleetApi, ImagesApi, IpCommerceApi, LlmApi, LocalNodeController, LocatorsApi, ManagedProxiesApi, NodesApi, ProjectsApi, ReconnectingSocket, RestClient, ScriptsApi, ShortcutsApi, SnapshotsApi, TasksApi, UsersApi, WebhooksApi, authHeader, buildAuthProvider, createCachedUserCredential, createClient, detectEnvOs, envBlocker, errorFromRet, executionStreamEventsAfter, executionWsTicketUrl, executionWsUrl, getIceServers, getLocale, isEnvEventFrame, isExecutionFrame, isFleetRunTerminal, isFridaEventFrame, isRetFrame, isScriptletEventFrame, isStatusFrame, joinUrl, mintViewerGrant, mintViewerToken, parseIncoming, pullFile, pushFile, resolveConfig, restClient, runEnvToFinish, setLocale, summarizeEnv, t } from '../chunk-OJK35AQD.js';
|
|
3
3
|
export { classifyDrag, mapKey, toDevicePoint } from '../chunk-NWFYTFMI.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { D as DeviceChannel } from '../device-channel-OiZwAqNQ.js';
|
|
2
|
+
import '../config-C79rcedl.js';
|
|
3
|
+
import '../types-CBI5SIH5.js';
|
|
4
|
+
|
|
5
|
+
/** Node-only TCP adapter. Call close() to revoke the grant. */
|
|
6
|
+
interface NetworkAdbBridge {
|
|
7
|
+
readonly host: '127.0.0.1' | '::';
|
|
8
|
+
readonly port: number;
|
|
9
|
+
close(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
/** Opt-in all-interface listener. A firewall/VPN is still required: raw TCP adds no ADB authentication. */
|
|
12
|
+
interface AllInterfaceAdbOptions {
|
|
13
|
+
readonly listen: 'all';
|
|
14
|
+
readonly port?: number;
|
|
15
|
+
readonly allowedClients: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
/** Enables ADB only on the supplied, already authenticated device channel. Default is loopback.
|
|
18
|
+
* 'all' is explicit opt-in and requires a source allowlist; raw TCP does not replace a firewall/VPN
|
|
19
|
+
* or change ADB service authentication. Never expose this listener directly to the public internet.
|
|
20
|
+
*/
|
|
21
|
+
declare function openNetworkAdbBridge(channel: DeviceChannel, options?: number | AllInterfaceAdbOptions): Promise<NetworkAdbBridge>;
|
|
22
|
+
|
|
23
|
+
export { type AllInterfaceAdbOptions, type NetworkAdbBridge, openNetworkAdbBridge };
|