@aixnn/aixautots 0.6.17 → 0.6.20

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.
Files changed (52) hide show
  1. package/dist/{automation-queue-DO8fOG6l.d.ts → automation-queue-GhfQtZLm.d.ts} +2 -2
  2. package/dist/{chunk-TJ2QIP5M.js → chunk-4NRIEM5Z.js} +249 -33
  3. package/dist/{chunk-WOPEKCVC.js → chunk-DAU3FVCV.js} +2 -2
  4. package/dist/chunk-DTXXQPOU.js +693 -0
  5. package/dist/{chunk-7BJPVSEZ.js → chunk-ED6CB3B4.js} +222 -12
  6. package/dist/{chunk-NIEGPH3E.js → chunk-FJKMRWYC.js} +55 -23
  7. package/dist/{chunk-ZDCTHR7D.js → chunk-H7KZUU67.js} +2 -2
  8. package/dist/{chunk-FJPIY4YI.js → chunk-HQ2L4NQ2.js} +262 -10
  9. package/dist/{chunk-LOKPZ677.js → chunk-JQBSGFAR.js} +2 -2
  10. package/dist/{chunk-2KPZSPV6.js → chunk-OJK35AQD.js} +105 -17
  11. package/dist/chunk-QISBQ532.js +1665 -0
  12. package/dist/{chunk-KASSYUGM.js → chunk-RFOJSDYI.js} +2 -2
  13. package/dist/{chunk-QEK25NUA.js → chunk-UEZVXYGP.js} +12 -5
  14. package/dist/{config-CBUhr4Gl.d.ts → config-C79rcedl.d.ts} +52 -10
  15. package/dist/core/index.d.ts +13 -9
  16. package/dist/core/index.js +2 -2
  17. package/dist/core/network-adb-node.d.ts +23 -0
  18. package/dist/core/network-adb-node.js +171 -0
  19. package/dist/{script-debugger-DoT02din.d.ts → device-channel-OiZwAqNQ.d.ts} +41 -55
  20. package/dist/{device-normalize-Vl5JYbAI.d.ts → device-normalize-ODrxJb-a.d.ts} +1 -1
  21. package/dist/device-session-PVHD6PNR.js +1 -0
  22. package/dist/i18n/index.js +1 -1
  23. package/dist/{mirror-session-Y1InpkUY.d.ts → mirror-session-DifANocH.d.ts} +2 -2
  24. package/dist/react/index.d.ts +19 -12
  25. package/dist/react/index.js +3 -3
  26. package/dist/script-debugger-DjxpvdaN.d.ts +56 -0
  27. package/dist/{task-agent-runner-Cl2ickJ1.d.ts → task-agent-runner-CAt-z8gr.d.ts} +3 -3
  28. package/dist/{types-Cp1ohbTb.d.ts → types-CBI5SIH5.d.ts} +102 -4
  29. package/dist/ui/billing.d.ts +43 -6
  30. package/dist/ui/billing.js +190 -309
  31. package/dist/ui/device-create.d.ts +1 -1
  32. package/dist/ui/device-create.js +7 -7
  33. package/dist/ui/device-mirror.js +5 -5
  34. package/dist/ui/devices.d.ts +5 -5
  35. package/dist/ui/devices.js +9 -9
  36. package/dist/ui/editor.d.ts +2 -2
  37. package/dist/ui/editor.js +5 -5
  38. package/dist/ui/index.d.ts +6 -4
  39. package/dist/ui/index.js +13 -492
  40. package/dist/ui/inspector.js +4 -4
  41. package/dist/ui/ip-commerce.d.ts +2 -2
  42. package/dist/ui/ip-commerce.js +5 -5
  43. package/dist/ui/market.js +4 -4
  44. package/dist/ui/mirror.d.ts +3 -3
  45. package/dist/ui/script-studio.js +4 -4
  46. package/dist/ui/scripts.d.ts +1 -1
  47. package/dist/ui/scripts.js +4 -4
  48. package/dist/ui/settings.d.ts +164 -0
  49. package/dist/ui/settings.js +10 -0
  50. package/dist/ui/tasks.js +9 -9
  51. package/package.json +9 -1
  52. package/dist/device-session-3XK2SZDF.js +0 -1
@@ -1,4 +1,4 @@
1
- import { A as AixConfig, R as ResolvedConfig } from './config-CBUhr4Gl.js';
1
+ import { A as AixConfig, R as ResolvedConfig } from './config-C79rcedl.js';
2
2
 
3
3
  /** Mirrors the node's `ControlMsg` (webrtc/control.rs): `t`-tagged, coords
4
4
  * normalized [0,1] (node scales to px). Sent over the `control` DataChannel. */
@@ -74,7 +74,7 @@ declare class MirrorSession {
74
74
  readonly session: string;
75
75
  private readonly socket;
76
76
  private iceServers;
77
- private readonly token;
77
+ private token;
78
78
  private videoOnly;
79
79
  private verified;
80
80
  private nodePeer;
@@ -1,21 +1,27 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { ReactNode } from 'react';
3
- import { A as AixConfig, R as ResolvedConfig, c as AixClient, e as EnvEventKind, q as EnvFinished, t as EnvSetupInput, x as EnvTeardownInput, E as EnvOs } from '../config-CBUhr4Gl.js';
4
- import { D as DeviceChannel, A as AdbResult, W as WdaResult, S as ScriptEvent, e as ScriptRunInput } from '../script-debugger-DoT02din.js';
5
- import { F as FlowEvent, b as FlowSubmit, B as BatchConfig } from '../automation-queue-DO8fOG6l.js';
6
- import { a as MirrorSession, I as InputMessage, c as ScrcpyProfileName, M as MirrorJoinOptions } from '../mirror-session-Y1InpkUY.js';
7
- import { w as AuthResult, aM as SendCodeResult, b9 as VerifyCodeResult, au as Project, I as CreateProjectInput, J as CreateProjectResult, ar as PowerAction, aL as ScreenshotResult, Z as ElementNode, D as DeviceRow, N as NodeRow, al as NodeScope, aK as RegisterNodeResult, ak as NodeOwnerPolicy, aQ as Shortcut, ai as NewShortcut, aS as ShortcutRunResult, as as PowerRunResult, f as ScriptSummary, S as Script, E as Cluster, G as CreateClusterInput, $ as FleetRunDetail, _ as FleetMode, d as AgentTaskBlocker, e as AgentTaskEvidence, b1 as TaskStatus, b3 as TaskSummary, a$ as TaskListFilter, ba as WebhookConfig, L as CreateWebhookInput, aJ as RegisterNodeInput, af as Locator, H as CreateLocatorInput, a2 as ImageArtifact, a3 as ImageInput, ae as LlmTestResult, U as DeviceRate, aG as RateInput, y as BillingPlan, an as PlanInput, X as DeviceUsageSession, aH as RebateLedgerRow, x as BalanceResp, b5 as TopupInput, b6 as TopupResult, q as ApiTokenRow, K as CreateTokenInput, M as CreatedToken } from '../types-Cp1ohbTb.js';
8
- import { a as TaskAgentDevice, b as TaskAgentDeviceStatus, T as TaskAgentRunner } from '../task-agent-runner-Cl2ickJ1.js';
9
- export { D as Device, i as DevicesProvider, j as DevicesProviderProps, k as DevicesView, c as TaskAgentNodeSnapshot, d as TaskAgentPreflightResult, e as TaskAgentRunRequest, f as TaskAgentStreamEvent, g as TaskAgentTarget, m as mapDevice, p as preflightTaskAgentDevice, u as useDevicesView } from '../task-agent-runner-Cl2ickJ1.js';
3
+ import { A as AixConfig, R as ResolvedConfig, c as AixClient, e as EnvEventKind, q as EnvFinished, t as EnvSetupInput, x as EnvTeardownInput, E as EnvOs } from '../config-C79rcedl.js';
4
+ import { D as DeviceChannel, A as AdbResult, W as WdaResult } from '../device-channel-OiZwAqNQ.js';
5
+ import { S as ScriptEvent, d as ScriptRunInput } from '../script-debugger-DjxpvdaN.js';
6
+ import { F as FlowEvent, b as FlowSubmit, B as BatchConfig } from '../automation-queue-GhfQtZLm.js';
7
+ import { a as MirrorSession, I as InputMessage, c as ScrcpyProfileName, M as MirrorJoinOptions } from '../mirror-session-DifANocH.js';
8
+ import { v as AuthResult, aP as SendCodeResult, bj as VerifyCodeResult, aw as Project, H as CreateProjectInput, I as CreateProjectResult, at as PowerAction, aO as ScreenshotResult, $ as ElementNode, D as DeviceRow, N as NodeRow, an as NodeScope, aN as RegisterNodeResult, am as NodeOwnerPolicy, aT as Shortcut, ak as NewShortcut, aV as ShortcutRunResult, au as PowerRunResult, f as ScriptSummary, S as Script, z as Cluster, F as CreateClusterInput, a1 as FleetRunDetail, a0 as FleetMode, d as AgentTaskBlocker, e as AgentTaskEvidence, b8 as TaskStatus, ba as TaskSummary, b6 as TaskListFilter, bk as WebhookConfig, K as CreateWebhookInput, aM as RegisterNodeInput, ah as Locator, G as CreateLocatorInput, a4 as ImageArtifact, a5 as ImageInput, ag as LlmTestResult, W as DeviceRate, aJ as RateInput, x as BillingPlan, ap as PlanInput, Z as DeviceUsageSession, aK as RebateLedgerRow, w as BalanceResp, bc as TopupInput, bg as TopupResult, bd as TopupLookup, p as ApiTokenRow, J as CreateTokenInput, L as CreatedToken } from '../types-CBI5SIH5.js';
9
+ import { a as TaskAgentDevice, b as TaskAgentDeviceStatus, T as TaskAgentRunner } from '../task-agent-runner-CAt-z8gr.js';
10
+ export { D as Device, i as DevicesProvider, j as DevicesProviderProps, k as DevicesView, c as TaskAgentNodeSnapshot, d as TaskAgentPreflightResult, e as TaskAgentRunRequest, f as TaskAgentStreamEvent, g as TaskAgentTarget, m as mapDevice, p as preflightTaskAgentDevice, u as useDevicesView } from '../task-agent-runner-CAt-z8gr.js';
10
11
  import { L as LogEntry } from '../use-script-run-Diay7ibY.js';
11
12
  export { b as LogLevel, S as ScriptRunStatus, a as StepEvent, U as UseScriptRun, u as useScriptRun } from '../use-script-run-Diay7ibY.js';
12
13
  import { A as AgentKind } from '../agent-runner-V60B0is1.js';
13
- import '../device-normalize-Vl5JYbAI.js';
14
+ import '../device-normalize-ODrxJb-a.js';
14
15
 
15
16
  declare function AixProvider({ config, children }: {
16
17
  config: AixConfig;
17
18
  children: react__default.ReactNode;
18
19
  }): react__default.JSX.Element;
20
+ declare function AixResolvedProvider({ config, children }: {
21
+ config: ResolvedConfig;
22
+ children: react__default.ReactNode;
23
+ }): react__default.JSX.Element;
24
+ declare function useOptionalAixConfig(): ResolvedConfig | null;
19
25
  declare function useAixConfig(): ResolvedConfig;
20
26
 
21
27
  interface UseDevice {
@@ -190,8 +196,8 @@ interface ShortcutsView {
190
196
  * (`result.timedOut === true`). */
191
197
  runShortcut: (shortcut: Shortcut, values: Record<string, unknown>, deviceIds: string[]) => Promise<ShortcutRunResult | null>;
192
198
  /** Run a power-kind shortcut: call the backend power API per device and return
193
- * a per-device receipt (`ok` + raw `result`, or `error` on rejection). The
194
- * backend awaits the node, so `ok` reflects whether the op actually ran. */
199
+ * a per-device receipt (`ok` + raw `result`, or `error` on rejection).
200
+ * Check `result` before reporting completion: Stop can be queued and Reboot is async. */
195
201
  runPower: (shortcut: Shortcut, deviceIds: string[]) => Promise<PowerRunResult[]>;
196
202
  }
197
203
  interface ShortcutsProviderProps {
@@ -470,8 +476,9 @@ interface UseAdmin {
470
476
  declare function useAdmin(): UseAdmin;
471
477
 
472
478
  interface UseBilling extends Query<BalanceResp> {
473
- /** 充值到指定用户钱包(admin scope),成功后刷新余额。 */
479
+ /** 充值到指定用户钱包(admin scope),同一意图重试必须沿用 request_id,成功后刷新余额。 */
474
480
  topup(input: TopupInput): Promise<TopupResult>;
481
+ lookupTopup(requestId?: string): Promise<TopupLookup>;
475
482
  }
476
483
  /** 当前钱包余额 + 最近流水;`topup` 充值后自动刷新。 */
477
484
  declare function useBilling(): UseBilling;
@@ -487,4 +494,4 @@ interface UseApiTokens extends Query<ApiTokenRow[]> {
487
494
  /** 名下用户 PAT 列表 + 创建/撤销/轮换(改完刷新列表)。 */
488
495
  declare function useApiTokens(): UseApiTokens;
489
496
 
490
- export { AixProvider, ElementNode, type FleetStatus, GROUP_MIRROR_MAX, type InspectorLocator, InspectorProvider, type InspectorProviderProps, type InspectorView, LogEntry, type MatchElement, NodesProvider, type NodesProviderProps, type NodesView, type Query, ShortcutsProvider, type ShortcutsProviderProps, type ShortcutsView, TaskAgentDevice, type TaskAgentDeviceRun, TaskAgentDeviceStatus, TaskAgentRunner, type UseAdmin, type UseApiTokens, type UseAuth, type UseAutomationQueue, type UseBilling, type UseClusters, type UseCommands, type UseDevice, type UseDeviceActions, type UseDevices, type UseEnvGate, type UseEnvRun, type UseFleetRun, type UseFlowRun, type UseGroupMirror, type UseImages, type UseInspector, type UseLlm, type UseLocators, type UseMirror, type UseNodes, type UseProjects, type UseScript, type UseScripts, type UseTaskAgentRun, type UseTaskStatus, type UseTasks, type UseWebhooks, useAdmin, useAixConfig, useApiTokens, useAuth, useAutomationQueue, useBilling, useClient, useClusters, useCommands, useDevice, useDeviceActions, useDevices, useEnvGate, useEnvRun, useFleetRun, useFlowRun, useGroupMirror, useImages, useInspector, useInspectorView, useLlm, useLocators, useMirror, useNodes, useNodesView, useProjects, useQuery, useScript, useScripts, useShortcutsView, useTaskAgentRun, useTaskStatus, useTasks, useWebhooks };
497
+ export { AixProvider, AixResolvedProvider, ElementNode, type FleetStatus, GROUP_MIRROR_MAX, type InspectorLocator, InspectorProvider, type InspectorProviderProps, type InspectorView, LogEntry, type MatchElement, NodesProvider, type NodesProviderProps, type NodesView, type Query, ShortcutsProvider, type ShortcutsProviderProps, type ShortcutsView, TaskAgentDevice, type TaskAgentDeviceRun, TaskAgentDeviceStatus, TaskAgentRunner, type UseAdmin, type UseApiTokens, type UseAuth, type UseAutomationQueue, type UseBilling, type UseClusters, type UseCommands, type UseDevice, type UseDeviceActions, type UseDevices, type UseEnvGate, type UseEnvRun, type UseFleetRun, type UseFlowRun, type UseGroupMirror, type UseImages, type UseInspector, type UseLlm, type UseLocators, type UseMirror, type UseNodes, type UseProjects, type UseScript, type UseScripts, type UseTaskAgentRun, type UseTaskStatus, type UseTasks, type UseWebhooks, useAdmin, useAixConfig, useApiTokens, useAuth, useAutomationQueue, useBilling, useClient, useClusters, useCommands, useDevice, useDeviceActions, useDevices, useEnvGate, useEnvRun, useFleetRun, useFlowRun, useGroupMirror, useImages, useInspector, useInspectorView, useLlm, useLocators, useMirror, useNodes, useNodesView, useOptionalAixConfig, useProjects, useQuery, useScript, useScripts, useShortcutsView, useTaskAgentRun, useTaskStatus, useTasks, useWebhooks };
@@ -1,4 +1,4 @@
1
- export { AixProvider, DevicesProvider, GROUP_MIRROR_MAX, InspectorProvider, NodesProvider, ShortcutsProvider, 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 } from '../chunk-QEK25NUA.js';
2
- import '../chunk-7BJPVSEZ.js';
3
- import '../chunk-2KPZSPV6.js';
1
+ export { AixProvider, AixResolvedProvider, DevicesProvider, GROUP_MIRROR_MAX, InspectorProvider, NodesProvider, ShortcutsProvider, 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 } from '../chunk-UEZVXYGP.js';
2
+ import '../chunk-ED6CB3B4.js';
3
+ import '../chunk-OJK35AQD.js';
4
4
  import '../chunk-NWFYTFMI.js';
@@ -0,0 +1,56 @@
1
+ import { D as DeviceChannel } from './device-channel-OiZwAqNQ.js';
2
+ import { A as AixConfig, R as ResolvedConfig } from './config-C79rcedl.js';
3
+
4
+ type ScriptEngine = 'frida' | 'scriptlet' | 'flow';
5
+ /** A normalized streaming event from a running script (engine-agnostic). */
6
+ interface ScriptEvent {
7
+ runId: string;
8
+ name: string;
9
+ data: unknown;
10
+ }
11
+ type ScriptDebuggerOptions = {
12
+ engine: 'frida' | 'scriptlet';
13
+ channel: DeviceChannel;
14
+ } | {
15
+ engine: 'flow';
16
+ cfg: AixConfig | ResolvedConfig;
17
+ };
18
+ interface ScriptRunInput {
19
+ script?: string;
20
+ /** scriptlet: flow/vars object injected as JS `vars`. */
21
+ vars?: unknown;
22
+ /** frida: attach target (e.g. `{ pid }`). */
23
+ target?: unknown;
24
+ /** frida: spawn+resume instead of attach. */
25
+ spawn?: boolean;
26
+ flow?: unknown;
27
+ scriptId?: string;
28
+ deviceIds?: string[];
29
+ params?: unknown;
30
+ }
31
+ /**
32
+ * Unified run/call/cancel + event facade over a single script engine on a
33
+ * `DeviceChannel`. `frida`, `scriptlet`, and `flow` are supported.
34
+ * One debugger drives one run at a time; `run()` replaces any previous run's
35
+ * event subscription.
36
+ */
37
+ declare class ScriptDebugger {
38
+ private readonly opts;
39
+ private runId;
40
+ private unsub;
41
+ private flow;
42
+ private readonly listeners;
43
+ constructor(opts: ScriptDebuggerOptions);
44
+ get engine(): ScriptEngine;
45
+ get currentRunId(): string | null;
46
+ on(_event: 'event', cb: (e: ScriptEvent) => void): () => void;
47
+ run(input: ScriptRunInput): Promise<{
48
+ runId: string;
49
+ }>;
50
+ call(method: string, args?: unknown): Promise<unknown>;
51
+ cancel(): Promise<void>;
52
+ private attachChannel;
53
+ private detach;
54
+ }
55
+
56
+ export { type ScriptEvent as S, type ScriptEngine as a, ScriptDebugger as b, type ScriptDebuggerOptions as c, type ScriptRunInput as d };
@@ -1,8 +1,8 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { P as ProvisionSpec, a as ProvisionResult, b as DiscoveredDevice, A as AgentTaskTargetStatus, c as AgentTaskTarget, d as AgentTaskBlocker, e as AgentTaskEvidence } from './types-Cp1ohbTb.js';
4
- import { N as NormalizedDevice } from './device-normalize-Vl5JYbAI.js';
5
- import { A as AixConfig, R as ResolvedConfig } from './config-CBUhr4Gl.js';
3
+ import { P as ProvisionSpec, a as ProvisionResult, b as DiscoveredDevice, A as AgentTaskTargetStatus, c as AgentTaskTarget, d as AgentTaskBlocker, e as AgentTaskEvidence } from './types-CBI5SIH5.js';
4
+ import { N as NormalizedDevice } from './device-normalize-ODrxJb-a.js';
5
+ import { A as AixConfig, R as ResolvedConfig } from './config-C79rcedl.js';
6
6
  import { A as AgentKind } from './agent-runner-V60B0is1.js';
7
7
 
8
8
  interface Device {
@@ -100,6 +100,12 @@ type PowerAction = 'start' | 'stop' | 'reboot' | 'reset' | 'destroy' | 'snapshot
100
100
  interface ScreenshotResult {
101
101
  png_base64: string;
102
102
  }
103
+ /** Read back from Android settings; USB host authorization is not established by these flags. */
104
+ interface DeveloperSettingsReceipt {
105
+ developerMode: boolean;
106
+ usbDebugging: boolean;
107
+ usbAuthorization: 'not_verified';
108
+ }
103
109
  /** Saved device data; names are opaque identifiers, labels are user-facing. */
104
110
  interface DeviceSnapshot {
105
111
  device_id: string;
@@ -179,6 +185,11 @@ interface ProxyApplyReceipt {
179
185
  /** Safe backend explanation for failed/unsupported capability outcomes. */
180
186
  message?: string | null;
181
187
  }
188
+ /** Authorized per-device custom proxy endpoint; contains no credentials or upstream URL. */
189
+ interface CustomProxyAddress {
190
+ configured: boolean;
191
+ address?: string;
192
+ }
182
193
  /** The existing device PATCH returns the updated, credential-scrubbed device row. */
183
194
  interface ProxyPatchResult extends DeviceRow {
184
195
  proxy_apply?: ProxyApplyReceipt | null;
@@ -290,6 +301,12 @@ interface ProvisionResult {
290
301
  tier: string;
291
302
  node_class: string;
292
303
  }
304
+ /** Read-only projection returned by GET /api/devices/provision/operations/:id. */
305
+ interface ProvisionOperation {
306
+ operation_id: string;
307
+ device_id: string;
308
+ status: 'pending' | 'unknown' | 'ready';
309
+ }
293
310
  /** Curated, user-editable fingerprint fields. Identity base switched by `model`
294
311
  * (carries its android_version/build era); region by `locale` (+ `timezone`);
295
312
  * display by dpi/width/height. Unique IDs are never hand-set. */
@@ -884,6 +901,7 @@ interface RebateLedgerRow {
884
901
  id: string;
885
902
  project_id: string;
886
903
  session_id: string | null;
904
+ subscription_id?: string | null;
887
905
  period: string;
888
906
  gross: Decimal;
889
907
  rebate_amount: Decimal;
@@ -939,19 +957,99 @@ interface OwnNodeDailyCharge {
939
957
  /** `POST /api/billing/subscriptions` 入参。`plan_id` 由调用方传入
940
958
  * (caller 套餐目录端点为 follow-up,spec §5.4)。 */
941
959
  interface SubscribeInput {
960
+ request_id: string;
942
961
  plan_id: string;
943
962
  bound_device_id?: string;
944
963
  }
945
- /** `POST /api/admin/billing/balance/topup` 入参(admin 给指定用户钱包充值)。 */
964
+ /** Caller-owned USD transfer order; payment status is server-authoritative. */
965
+ interface WiseOrder {
966
+ id: string;
967
+ reference: string;
968
+ amount_cents: number;
969
+ status: 'pending' | 'paid' | 'expired' | 'review';
970
+ expires_at: string;
971
+ payment_instructions: string;
972
+ }
973
+ interface WiseOrders {
974
+ enabled: boolean;
975
+ orders: WiseOrder[];
976
+ }
977
+ interface TopupMethods {
978
+ currency: string;
979
+ project_id: string;
980
+ channel: string;
981
+ stripe: {
982
+ enabled: boolean;
983
+ min_cents: number;
984
+ max_cents: number;
985
+ packs_cents: number[];
986
+ };
987
+ wise: {
988
+ enabled: boolean;
989
+ };
990
+ }
991
+ interface StripeCheckoutInput {
992
+ amount_cents: number;
993
+ channel?: string;
994
+ return_url?: string;
995
+ cancel_url?: string;
996
+ }
997
+ interface StripeCheckoutResult {
998
+ order_id: string;
999
+ session_id: string;
1000
+ url: string;
1001
+ amount_cents: number;
1002
+ currency: string;
1003
+ project_id: string;
1004
+ channel: string;
1005
+ status: string;
1006
+ }
1007
+ interface StripeTopupOrder {
1008
+ id: string;
1009
+ stripe_session_id: string;
1010
+ amount_cents: number;
1011
+ currency: string;
1012
+ channel: string;
1013
+ status: 'pending' | 'paid' | 'expired' | 'failed' | 'review';
1014
+ credited_at: string | null;
1015
+ created_at: string;
1016
+ }
1017
+ interface StripeReconcileResult {
1018
+ reconciled: boolean;
1019
+ status: string;
1020
+ order_id: string | null;
1021
+ balance: Decimal | null;
1022
+ currency: string;
1023
+ channel: string | null;
1024
+ commission_amount: Decimal | null;
1025
+ }
1026
+ /** `PUT /api/admin/billing/balance/topup`:同一充值意图重试复用 request_id,新意图必须生成新 UUID。 */
946
1027
  interface TopupInput {
947
1028
  owner_user_id: string;
948
- amount: number;
1029
+ amount: string;
949
1030
  note?: string;
1031
+ request_id: string;
1032
+ developer_id?: string;
950
1033
  }
951
- /** 充值结果——返回新余额。 */
1034
+ /** 保留旧响应字段,另回显本次请求键。 */
952
1035
  interface TopupResult {
953
1036
  owner_user_id: string;
954
1037
  new_balance: Decimal;
1038
+ request_id: string;
1039
+ }
1040
+ interface TopupReceipt {
1041
+ request_id: string;
1042
+ developer_id: string;
1043
+ owner_user_id: string;
1044
+ amount: Decimal;
1045
+ currency: string;
1046
+ note: string | null;
1047
+ balance_after: Decimal;
1048
+ created_at: string;
1049
+ }
1050
+ interface TopupLookup {
1051
+ developer_id: string;
1052
+ receipt: TopupReceipt | null;
955
1053
  }
956
1054
  /** 列表一行——无明文/hash,只含展示前缀与生命周期时间戳。 */
957
1055
  interface ApiTokenRow {
@@ -1071,4 +1169,4 @@ interface IosLoginResult {
1071
1169
  };
1072
1170
  }
1073
1171
 
1074
- export type { FleetRunDetail as $, AgentTaskTargetStatus as A, BalanceLedgerRow as B, CatalogBrand as C, DeviceRow as D, Cluster as E, ClusterMode as F, CreateClusterInput as G, CreateLocatorInput as H, CreateProjectInput as I, CreateProjectResult as J, CreateTokenInput as K, CreateWebhookInput as L, CreatedToken as M, NodeRow as N, DeveloperRef as O, ProvisionSpec as P, DeviceLocation as Q, DeviceOp as R, Script as S, DeviceProfileView as T, DeviceRate as U, DeviceSnapshot as V, DeviceSnapshotList as W, DeviceUsageSession as X, DiscoveredStatus as Y, ElementNode as Z, FleetMode as _, ProvisionResult as a, TaskListFilter as a$, FleetRunDeviceRow as a0, FleetRunSubmit as a1, ImageArtifact as a2, ImageInput as a3, ImageOption as a4, InstallAntiDetectResult as a5, IosAccountState as a6, IosDeviceRow as a7, IosDiagnosticStage as a8, IosDiagnostics as a9, ProxyApplyStatus as aA, ProxyPatchResult as aB, ProxyProbe as aC, ProxyProbeErrorCode as aD, ProxySummary as aE, ProxyUrl as aF, RateInput as aG, RebateLedgerRow as aH, RecycledDeviceRow as aI, RegisterNodeInput as aJ, RegisterNodeResult as aK, ScreenshotResult as aL, SendCodeResult as aM, SetDataRootResult as aN, SetDisguiseResult as aO, SetProfileResult as aP, Shortcut as aQ, ShortcutParam as aR, ShortcutRunResult as aS, SnapshotGrant as aT, SnapshotKind as aU, SnapshotOperation as aV, SnapshotOperationReceipt as aW, SnapshotOperationStatus as aX, SubscribeInput as aY, TaskEvent as aZ, TaskEventsResult as a_, IosLibraryApp as aa, IosLoginResult as ab, IosScanResult as ac, KnownDeviceOpName as ad, LlmTestResult as ae, Locator as af, MdnsEntry as ag, NewAppTemplate as ah, NewShortcut as ai, NodeEffectiveCaps as aj, NodeOwnerPolicy as ak, NodeScope as al, OwnNodeDailyCharge as am, PlanInput as an, PlatformOem as ao, PlatformOemInput as ap, PortableSnapshot as aq, PowerAction as ar, PowerRunResult as as, ProfileOverrides as at, Project as au, ProjectSubscription as av, ProjectUserResult as aw, ProvisionUserInput as ax, ProvisionUserResult as ay, ProxyApplyReceipt as az, DiscoveredDevice as b, TaskListResult as b0, TaskStatus as b1, TaskSubmitResult as b2, TaskSummary as b3, TaskTarget as b4, TopupInput as b5, TopupResult as b6, UpdateNodeInput as b7, User as b8, VerifyCodeResult as b9, WebhookConfig as ba, AgentTaskTarget as c, AgentTaskBlocker as d, AgentTaskEvidence as e, ScriptSummary as f, Decimal as g, ScriptParam as h, AdbScanResult as i, AgentTaskCurrentAttempt as j, AgentTaskEvent as k, AgentTaskEventsResult as l, AgentTaskReadResult as m, AgentTaskReadTarget as n, AgentTaskSubmitInput as o, AgentTaskSubmitResult as p, ApiTokenRow as q, AppCandidate as r, AppEntry as s, AppTemplate as t, AppTemplateItemAndroid as u, AppTemplateItemIos as v, AuthResult as w, BalanceResp as x, BillingPlan as y, CatalogModel as z };
1172
+ export type { ElementNode as $, AgentTaskTargetStatus as A, BalanceLedgerRow as B, CatalogBrand as C, DeviceRow as D, ClusterMode as E, CreateClusterInput as F, CreateLocatorInput as G, CreateProjectInput as H, CreateProjectResult as I, CreateTokenInput as J, CreateWebhookInput as K, CreatedToken as L, CustomProxyAddress as M, NodeRow as N, Decimal as O, ProvisionSpec as P, DeveloperRef as Q, DeveloperSettingsReceipt as R, Script as S, DeviceLocation as T, DeviceOp as U, DeviceProfileView as V, DeviceRate as W, DeviceSnapshot as X, DeviceSnapshotList as Y, DeviceUsageSession as Z, DiscoveredStatus as _, ProvisionResult as a, StripeCheckoutInput as a$, FleetMode as a0, FleetRunDetail as a1, FleetRunDeviceRow as a2, FleetRunSubmit as a3, ImageArtifact as a4, ImageInput as a5, ImageOption as a6, InstallAntiDetectResult as a7, IosAccountState as a8, IosDeviceRow as a9, ProvisionUserInput as aA, ProvisionUserResult as aB, ProxyApplyReceipt as aC, ProxyApplyStatus as aD, ProxyPatchResult as aE, ProxyProbe as aF, ProxyProbeErrorCode as aG, ProxySummary as aH, ProxyUrl as aI, RateInput as aJ, RebateLedgerRow as aK, RecycledDeviceRow as aL, RegisterNodeInput as aM, RegisterNodeResult as aN, ScreenshotResult as aO, SendCodeResult as aP, SetDataRootResult as aQ, SetDisguiseResult as aR, SetProfileResult as aS, Shortcut as aT, ShortcutParam as aU, ShortcutRunResult as aV, SnapshotGrant as aW, SnapshotKind as aX, SnapshotOperation as aY, SnapshotOperationReceipt as aZ, SnapshotOperationStatus as a_, IosDiagnosticStage as aa, IosDiagnostics as ab, IosLibraryApp as ac, IosLoginResult as ad, IosScanResult as ae, KnownDeviceOpName as af, LlmTestResult as ag, Locator as ah, MdnsEntry as ai, NewAppTemplate as aj, NewShortcut as ak, NodeEffectiveCaps as al, NodeOwnerPolicy as am, NodeScope as an, OwnNodeDailyCharge as ao, PlanInput as ap, PlatformOem as aq, PlatformOemInput as ar, PortableSnapshot as as, PowerAction as at, PowerRunResult as au, ProfileOverrides as av, Project as aw, ProjectSubscription as ax, ProjectUserResult as ay, ProvisionOperation as az, DiscoveredDevice as b, StripeCheckoutResult as b0, StripeReconcileResult as b1, StripeTopupOrder as b2, SubscribeInput as b3, TaskEvent as b4, TaskEventsResult as b5, TaskListFilter as b6, TaskListResult as b7, TaskStatus as b8, TaskSubmitResult as b9, TaskSummary as ba, TaskTarget as bb, TopupInput as bc, TopupLookup as bd, TopupMethods as be, TopupReceipt as bf, TopupResult as bg, UpdateNodeInput as bh, User as bi, VerifyCodeResult as bj, WebhookConfig as bk, WiseOrder as bl, WiseOrders as bm, AgentTaskTarget as c, AgentTaskBlocker as d, AgentTaskEvidence as e, ScriptSummary as f, ScriptParam as g, AdbScanResult as h, AgentTaskCurrentAttempt as i, AgentTaskEvent as j, AgentTaskEventsResult as k, AgentTaskReadResult as l, AgentTaskReadTarget as m, AgentTaskSubmitInput as n, AgentTaskSubmitResult as o, ApiTokenRow as p, AppCandidate as q, AppEntry as r, AppTemplate as s, AppTemplateItemAndroid as t, AppTemplateItemIos as u, AuthResult as v, BalanceResp as w, BillingPlan as x, CatalogModel as y, Cluster as z };
@@ -1,18 +1,55 @@
1
1
  import * as react from 'react';
2
- import { g as Decimal, B as BalanceLedgerRow } from '../types-Cp1ohbTb.js';
2
+ import { b1 as StripeReconcileResult, O as Decimal, B as BalanceLedgerRow } from '../types-CBI5SIH5.js';
3
3
  import { LucideIcon } from 'lucide-react';
4
4
 
5
- declare function BillingPage(): react.JSX.Element;
5
+ interface BillingPageProps {
6
+ channel?: string;
7
+ returnUrl?: string;
8
+ cancelUrl?: string;
9
+ openExternalUrl?: (url: string) => void | Promise<void>;
10
+ onTopupCompleted?: (result: StripeReconcileResult) => void | Promise<void>;
11
+ }
12
+ declare function BillingPage({ channel, returnUrl, cancelUrl, openExternalUrl, onTopupCompleted, }?: BillingPageProps): react.JSX.Element;
6
13
 
7
14
  interface RechargeDrawerProps {
8
15
  open: boolean;
9
16
  onClose: () => void;
17
+ channel?: string;
18
+ returnUrl?: string;
19
+ cancelUrl?: string;
20
+ openExternalUrl?: (url: string) => void | Promise<void>;
21
+ onTopupCompleted?: (result: StripeReconcileResult) => void | Promise<void>;
10
22
  }
11
- declare function RechargeDrawer({ open, onClose }: RechargeDrawerProps): react.JSX.Element;
23
+ declare function RechargeDrawer({ open, onClose, channel, returnUrl, cancelUrl, openExternalUrl, onTopupCompleted, }: RechargeDrawerProps): react.JSX.Element;
12
24
 
13
- declare function RechargePage(): react.JSX.Element;
25
+ interface RechargePageProps {
26
+ channel?: string;
27
+ returnUrl?: string;
28
+ cancelUrl?: string;
29
+ openExternalUrl?: (url: string) => void | Promise<void>;
30
+ onTopupCompleted?: (result: StripeReconcileResult) => void | Promise<void>;
31
+ }
32
+ declare function RechargePage({ channel, returnUrl, cancelUrl, openExternalUrl, onTopupCompleted, }?: RechargePageProps): react.JSX.Element;
14
33
 
15
- declare function RechargeMethods(): react.JSX.Element;
34
+ interface RechargeMethodsProps {
35
+ refreshBalance: () => Promise<void>;
36
+ channel?: string;
37
+ returnUrl?: string;
38
+ cancelUrl?: string;
39
+ openExternalUrl?: (url: string) => void | Promise<void>;
40
+ onTopupCompleted?: (result: StripeReconcileResult) => void | Promise<void>;
41
+ }
42
+ declare function RechargeMethods({ refreshBalance, channel, returnUrl, cancelUrl, openExternalUrl, onTopupCompleted, }: RechargeMethodsProps): react.JSX.Element;
43
+
44
+ interface StripeTopupPanelProps {
45
+ refreshBalance: () => Promise<void>;
46
+ channel?: string;
47
+ returnUrl?: string;
48
+ cancelUrl?: string;
49
+ openExternalUrl?: (url: string) => void | Promise<void>;
50
+ onTopupCompleted?: (result: StripeReconcileResult) => void | Promise<void>;
51
+ }
52
+ declare function StripeTopupPanel({ refreshBalance, channel, returnUrl, cancelUrl, openExternalUrl, onTopupCompleted, }: StripeTopupPanelProps): react.JSX.Element;
16
53
 
17
54
  interface TopupDrawerProps {
18
55
  open: boolean;
@@ -45,4 +82,4 @@ interface LedgerKindMeta {
45
82
  */
46
83
  declare function ledgerKindMeta(kind: BalanceLedgerRow['kind'], amount?: number): LedgerKindMeta;
47
84
 
48
- export { BillingPage, type LedgerKindMeta, RechargeDrawer, type RechargeDrawerProps, RechargeMethods, RechargePage, TopupDrawer, type TopupDrawerProps, ledgerKindMeta };
85
+ export { BillingPage, type BillingPageProps, type LedgerKindMeta, RechargeDrawer, type RechargeDrawerProps, RechargeMethods, type RechargeMethodsProps, RechargePage, type RechargePageProps, StripeTopupPanel, type StripeTopupPanelProps, TopupDrawer, type TopupDrawerProps, ledgerKindMeta };