@aixnn/aixautots 0.5.3 → 0.5.4
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/ScriptStudio-DaCqOF5H.d.ts +43 -0
- package/dist/agent-runner-V60B0is1.d.ts +57 -0
- package/dist/automation-queue-CKsueO9z.d.ts +72 -0
- package/dist/config-fsx4jlLK.d.ts +1378 -0
- package/dist/coords-LPR_MPyp.d.ts +22 -0
- package/dist/core/index.d.ts +135 -0
- package/dist/device-normalize-BaThgnH7.d.ts +43 -0
- package/dist/i18n/index.d.ts +30 -0
- package/dist/mirror-session-DM-trg1F.d.ts +108 -0
- package/dist/nav/index.d.ts +19 -0
- package/dist/react/index.d.ts +487 -0
- package/dist/script-debugger-Cu_coj-h.d.ts +114 -0
- package/dist/task-agent-runner-CMq9Cir1.d.ts +160 -0
- package/dist/types-C2WXVcam.d.ts +1005 -0
- package/dist/ui/billing.d.ts +48 -0
- package/dist/ui/device-create.d.ts +55 -0
- package/dist/ui/device-mirror.d.ts +42 -0
- package/dist/ui/devices.d.ts +223 -0
- package/dist/ui/editor.d.ts +64 -0
- package/dist/ui/index.d.ts +102 -0
- package/dist/ui/inspector.d.ts +5 -0
- package/dist/ui/market.d.ts +10 -0
- package/dist/ui/mirror.d.ts +52 -0
- package/dist/ui/primitives/index.d.ts +101 -0
- package/dist/ui/script-studio.d.ts +85 -0
- package/dist/ui/scripts.d.ts +18 -0
- package/dist/ui/tasks.d.ts +10 -0
- package/dist/use-script-run-Diay7ibY.d.ts +50 -0
- package/package.json +1 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
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-C2WXVcam.js';
|
|
4
|
+
import { N as NormalizedDevice } from './device-normalize-BaThgnH7.js';
|
|
5
|
+
import { A as AixConfig, R as ResolvedConfig } from './config-fsx4jlLK.js';
|
|
6
|
+
import { A as AgentKind } from './agent-runner-V60B0is1.js';
|
|
7
|
+
|
|
8
|
+
interface Device {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
platform: 'ios' | 'android' | 'macos' | 'windows';
|
|
12
|
+
status: 'connected' | 'disconnected' | 'connecting';
|
|
13
|
+
udid: string;
|
|
14
|
+
/** Live online state from the backend node registry. */
|
|
15
|
+
online: boolean;
|
|
16
|
+
/** Capability/spec metadata reported by the node (os_version, model, rooted, tier, provisioned…). */
|
|
17
|
+
meta: Record<string, unknown>;
|
|
18
|
+
/** User-defined group tags. */
|
|
19
|
+
tags: string[];
|
|
20
|
+
/** User-set free-text remark ("" = unset). */
|
|
21
|
+
note: string;
|
|
22
|
+
/** Creation timestamp in ms (0 if unknown). */
|
|
23
|
+
createdAt: number;
|
|
24
|
+
/** Node this device lives on (from the live registry), if any. */
|
|
25
|
+
nodeId: string | null;
|
|
26
|
+
nodeName: string | null;
|
|
27
|
+
/** Underlying transport rows merged into this device (USB + WiFi → length > 1). */
|
|
28
|
+
transports: NormalizedDevice['transports'];
|
|
29
|
+
}
|
|
30
|
+
declare function mapDevice(r: NormalizedDevice): Device;
|
|
31
|
+
interface DevicesView {
|
|
32
|
+
devices: Device[];
|
|
33
|
+
selectedDeviceId: string | null;
|
|
34
|
+
loading: boolean;
|
|
35
|
+
error: string | null;
|
|
36
|
+
/** Reload the device list. `silent` skips the loading flag (for throttled refreshes). */
|
|
37
|
+
fetchDevices: (opts?: {
|
|
38
|
+
silent?: boolean;
|
|
39
|
+
}) => Promise<void>;
|
|
40
|
+
/** Throttled silent refresh (≤ once per ~5s); used by card preview polling. */
|
|
41
|
+
refreshDevicesSoon: () => void;
|
|
42
|
+
selectDevice: (id: string | null) => void;
|
|
43
|
+
connectDevice: (platform: string) => Promise<void>;
|
|
44
|
+
disconnectDevice: (id: string) => Promise<void>;
|
|
45
|
+
provisionDevice: (spec: ProvisionSpec) => Promise<ProvisionResult>;
|
|
46
|
+
discoverDevices: (nodeId: string) => Promise<DiscoveredDevice[]>;
|
|
47
|
+
enrollDiscovered: (d: DiscoveredDevice) => Promise<void>;
|
|
48
|
+
updateTags: (deviceId: string, tags: string[]) => Promise<void>;
|
|
49
|
+
updateNote: (deviceId: string, note: string) => Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
interface DevicesProviderProps {
|
|
52
|
+
children: ReactNode;
|
|
53
|
+
/** Fetch the list on mount (default true). */
|
|
54
|
+
autoFetch?: boolean;
|
|
55
|
+
}
|
|
56
|
+
declare function DevicesProvider({ children, autoFetch }: DevicesProviderProps): react.FunctionComponentElement<react.ProviderProps<DevicesView | null>>;
|
|
57
|
+
/** Access the shared devices view. Must be inside a `<DevicesProvider>`. */
|
|
58
|
+
declare function useDevicesView(): DevicesView;
|
|
59
|
+
|
|
60
|
+
/** A node snapshot carried with a selected device for task-agent preflight. */
|
|
61
|
+
interface TaskAgentNodeSnapshot {
|
|
62
|
+
id: string;
|
|
63
|
+
status: 'online' | 'offline' | 'unknown';
|
|
64
|
+
reported_caps?: Record<string, unknown> | null;
|
|
65
|
+
}
|
|
66
|
+
/** A device selected for a multi-device agent task. */
|
|
67
|
+
interface TaskAgentDevice {
|
|
68
|
+
id: string;
|
|
69
|
+
name: string;
|
|
70
|
+
/**
|
|
71
|
+
* Optional on purpose: injected/custom runners may not have node registry data.
|
|
72
|
+
* `undefined` keeps those hosts backwards-compatible; `null` means the host
|
|
73
|
+
* explicitly knows that this device has no currently resolvable node.
|
|
74
|
+
*/
|
|
75
|
+
node?: TaskAgentNodeSnapshot | null;
|
|
76
|
+
}
|
|
77
|
+
interface TaskAgentPreflightResult {
|
|
78
|
+
ok: boolean;
|
|
79
|
+
reason?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Validate the node-advertised capability used by durable task-agent dispatch.
|
|
83
|
+
* Missing snapshots are intentionally accepted for custom runners that cannot
|
|
84
|
+
* access the node registry; callers that own the registry should pass `null`
|
|
85
|
+
* for an explicitly unknown node so it fails closed.
|
|
86
|
+
*/
|
|
87
|
+
declare function preflightTaskAgentDevice(device: TaskAgentDevice, agent: AgentKind, policyId?: string): TaskAgentPreflightResult;
|
|
88
|
+
/** Request emitted by the portable multi-device agent UI. */
|
|
89
|
+
interface TaskAgentRunRequest {
|
|
90
|
+
agent: AgentKind;
|
|
91
|
+
deviceIds: string[];
|
|
92
|
+
prompt: string;
|
|
93
|
+
/** Maximum number of device agents the host should run at once. */
|
|
94
|
+
concurrency: number;
|
|
95
|
+
}
|
|
96
|
+
/** The UI-facing target lifecycle. Only succeeded, failed, and cancelled are terminal. */
|
|
97
|
+
type TaskAgentDeviceStatus = AgentTaskTargetStatus;
|
|
98
|
+
/** A streamed, cursor-ordered event from a multi-device agent runner. */
|
|
99
|
+
interface TaskAgentStreamEvent {
|
|
100
|
+
runId: string;
|
|
101
|
+
targetId?: string;
|
|
102
|
+
attemptId?: string;
|
|
103
|
+
deviceId?: string;
|
|
104
|
+
cursor?: number;
|
|
105
|
+
stream: 'stdout' | 'stderr' | 'status' | 'done' | 'evidence';
|
|
106
|
+
chunk?: string;
|
|
107
|
+
status?: TaskAgentDeviceStatus;
|
|
108
|
+
error?: string;
|
|
109
|
+
blocker?: AgentTaskBlocker | null;
|
|
110
|
+
/** Canonical display-safe reason for a blocked target. */
|
|
111
|
+
blockedReason?: string;
|
|
112
|
+
evidence?: AgentTaskEvidence[];
|
|
113
|
+
}
|
|
114
|
+
/** Stable target data returned with a newly submitted agent task. */
|
|
115
|
+
interface TaskAgentTarget extends AgentTaskTarget {
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Multi-device agent transport used by both web and desktop hosts. The task
|
|
119
|
+
* itself executes on the selected device node; the UI only submits and replays
|
|
120
|
+
* the durable backend task stream.
|
|
121
|
+
*/
|
|
122
|
+
interface TaskAgentRunner {
|
|
123
|
+
available: boolean;
|
|
124
|
+
defaults?: () => Promise<{
|
|
125
|
+
agent?: AgentKind;
|
|
126
|
+
concurrency?: number;
|
|
127
|
+
}>;
|
|
128
|
+
start: (request: TaskAgentRunRequest) => Promise<{
|
|
129
|
+
runId: string;
|
|
130
|
+
targets: TaskAgentTarget[];
|
|
131
|
+
}>;
|
|
132
|
+
/** Reloads a durable task after a host/page reload and resumes its event stream. */
|
|
133
|
+
resume?: (runId: string, devices: TaskAgentDevice[]) => Promise<{
|
|
134
|
+
runId: string;
|
|
135
|
+
targets: TaskAgentTarget[];
|
|
136
|
+
agent?: AgentKind;
|
|
137
|
+
concurrency?: number;
|
|
138
|
+
}>;
|
|
139
|
+
/** Atomically cancels the durable task and all of its targets. */
|
|
140
|
+
stop: (runId: string) => Promise<void>;
|
|
141
|
+
stopDevice: (runId: string, targetId: string) => Promise<void>;
|
|
142
|
+
retryDevice: (runId: string, targetId: string) => Promise<void>;
|
|
143
|
+
approveDevice: (runId: string, targetId: string) => Promise<void>;
|
|
144
|
+
subscribe: (on: (event: TaskAgentStreamEvent) => void) => () => void;
|
|
145
|
+
}
|
|
146
|
+
interface AgentTaskRunnerOptions {
|
|
147
|
+
/** API prefix for durable agent tasks. */
|
|
148
|
+
basePath?: string;
|
|
149
|
+
/** Backend policy identifier; CLI agent tasks only support the standard policy. */
|
|
150
|
+
policyId?: 'device_standard_v1';
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Builds the portable agent-task runner from the shared SDK configuration.
|
|
154
|
+
* Events are deduplicated by their durable cursor. A reconnect resumes with
|
|
155
|
+
* `after=cursor`; a detected live-stream gap is filled from the REST event log
|
|
156
|
+
* before the newer frame is applied.
|
|
157
|
+
*/
|
|
158
|
+
declare function createAgentTaskRunner(cfg: AixConfig | ResolvedConfig, opts?: AgentTaskRunnerOptions): TaskAgentRunner;
|
|
159
|
+
|
|
160
|
+
export { type AgentTaskRunnerOptions as A, type Device as D, type TaskAgentRunner as T, type TaskAgentDevice as a, type TaskAgentDeviceStatus as b, type TaskAgentNodeSnapshot as c, type TaskAgentPreflightResult as d, type TaskAgentRunRequest as e, type TaskAgentStreamEvent as f, type TaskAgentTarget as g, createAgentTaskRunner as h, DevicesProvider as i, type DevicesProviderProps as j, type DevicesView as k, mapDevice as m, preflightTaskAgentDevice as p, useDevicesView as u };
|