@stim-cli/core 1.13.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,434 @@
1
+ import { Br as HostedMacosPlacement, Bt as AndroidDeviceState, Cr as MacosAppRecord, En as PhysicalDeviceState, Gn as WorktreeFacts, In as StatusPayload, Jt as BuildDiagnostic, Kn as WorktreeGit, On as RemoteDeviceState, Pn as StatusIssue, Qt as BuildMissReason, Rt as AgentSession, Tr as MacosBuild, Vn as WebBrowserState, Wn as WorkspaceStage, Yt as BuildHistoryEntry, Zt as BuildMissChange, _n as MachineOwner, an as DeviceActivity, cn as DiskMeasure, dn as EnvironmentState, en as BuildPlacement, fn as GitChip, jn as SimulatorState, mn as LastBuildReport, nn as BuildReport, on as DeviceAppProcess, qn as WorktreePullRequest, qt as BuildDetail, sn as DeviceLeaseState, tn as BuildPlanPayload, un as EnvironmentDisk, xn as MetroBundleState, yn as MachineUsageState } from "./index-DgLuTAvh.mjs";
2
+ import { $ as FrameDelayedEvent, $t as NotificationSuppression, An as SERVER_UPDATE_METHODS, At as LogRecord, B as DeviceFrameArtwork, Cn as ReplayKeyframeParams, Dn as ReplayTarget, En as ReplaySpan, F as ControlEndedEvent, Hn as SimulatorOptions, Ht as MachineVolume, J as ErrorEvent, L as DEVICE_HOST_METHODS, Lt as MachineDetails, M as ControlBeginParams, Mn as ServerEvent, Mt as LogsEvent, N as ControlBeginResult, Nt as LogsQueryResult, Ot as LogFilter, Qt as NotificationLevel, Rt as MachineHistory, S as BuildProgressEvent, Sn as ReplayKeyframe, St as KeyModifier, Tn as ReplayRange, U as DevicePosture, V as DeviceFrameEvent, Vn as SimulatorCommand, Vt as MachineUsage, W as DeviceUsageSeries, Wn as StatusEvent, Wt as MacosWindowsEvent, Xn as UsageSample, Xt as NotificationEntry, Yn as UsageHistory, Zt as NotificationEvent, _t as InputSimulatorParams, a as BUILD_METHODS, an as PROTOCOL_VERSION, at as FramesSubscribeResult, cn as PairingAuth, cr as WorkspaceFiles, d as BuildClientSummary, dn as PushEvent, et as FrameEvent, fn as PushRegisterParams, ft as InputKey, g as BuildMachineReport, i as ActionResult, jt as LogSource, kn as RotateDirection, kt as LogLevel, ln as Platform, n as ActionName, nn as NotificationsListResult, or as WorkspaceDiff, ot as HelloParams, qn as TouchPhase, qt as Methods, r as ActionParams, sr as WorkspaceFile, st as HelloResult, t as ACTIONS, tt as FrameTarget, un as ProtocolError, ur as WorkspacePatch, ut as InputButton, wn as ReplayMarker, xn as ReplayEndedEvent, y as BuildPlanParams, z as DeviceAuth } from "./protocol-BjnE921M.mjs";
3
+ //#region phone-protocol.d.ts
4
+ type PhonePlatform = BuildPlanParams["platform"];
5
+ type PhoneDevicePlatform = Platform;
6
+ type PhoneReloadPlatform = Exclude<PhoneDevicePlatform, "macos">;
7
+ interface PhonePairingPayload {
8
+ v: 1;
9
+ name: string;
10
+ endpoint: string;
11
+ pairingToken: string;
12
+ }
13
+ type PhoneSimState = Omit<SimulatorState, "activity" | "app" | "appPresence"> & {
14
+ activity?: PhoneDeviceActivity;
15
+ app?: PhoneDeviceAppProcess;
16
+ appPresence?: PhoneAppPresence;
17
+ };
18
+ type PhoneDeviceDisk = DiskMeasure;
19
+ type PhoneAndroidState = Omit<OptionalFields<AndroidDeviceState, "name">, "state" | "activity" | "app" | "appPresence"> & {
20
+ state?: string;
21
+ activity?: PhoneDeviceActivity;
22
+ app?: PhoneDeviceAppProcess;
23
+ appPresence?: PhoneAppPresence;
24
+ };
25
+ type PhoneAppPresence = string | null;
26
+ type PhoneDeviceAppProcess = Omit<DeviceAppProcess, "state"> & {
27
+ state: string;
28
+ };
29
+ type PhoneDeviceActivity = Omit<DeviceActivity, "state"> & {
30
+ state: string;
31
+ };
32
+ type PhoneBuildPhase = string;
33
+ type PhoneBuildReport = Omit<BuildReport, "outcomeKnown" | "placement" | "missProvisional" | "platform" | "state" | "phase" | "outcome" | "cacheLookupOutcome" | "plannedPhases" | "missReason" | "detail"> & {
34
+ outcomeKnown?: boolean;
35
+ placement?: PhoneBuildPlacement;
36
+ missProvisional?: boolean;
37
+ platform: string;
38
+ state: string;
39
+ phase: PhoneBuildPhase;
40
+ outcome: string | null;
41
+ cacheLookupOutcome?: string;
42
+ plannedPhases?: {
43
+ phase: PhoneBuildPhase;
44
+ expectedMs: number;
45
+ }[] | null;
46
+ missReason?: PhoneBuildMissReason;
47
+ detail?: PhoneBuildDetail;
48
+ };
49
+ type PhoneBuildPlacement = string | Exclude<BuildPlacement, string>;
50
+ type PhoneBuildDetail = Omit<BuildDetail, "step" | "unit"> & {
51
+ step: string | null;
52
+ unit: string | null;
53
+ };
54
+ type PhoneBuildCacheHit = string | false;
55
+ type PhoneBuildMissCategory = string;
56
+ type PhoneBuildMissChange = Omit<BuildMissChange, "change" | "category"> & {
57
+ change: string;
58
+ category: PhoneBuildMissCategory;
59
+ };
60
+ type PhoneBuildMissReason = Omit<BuildMissReason, "kind" | "changes" | "baseline"> & {
61
+ kind: string;
62
+ changes: PhoneBuildMissChange[];
63
+ baseline: (Omit<NonNullable<BuildMissReason["baseline"]>, "from"> & {
64
+ from: string;
65
+ }) | null;
66
+ };
67
+ type PhoneBuildPlan = Omit<BuildPlanPayload, "platform" | "cacheHit" | "prebuild" | "outcome" | "missReason"> & {
68
+ platform: string;
69
+ cacheHit: PhoneBuildCacheHit;
70
+ prebuild: string | null;
71
+ outcome: string | null;
72
+ missReason?: PhoneBuildMissReason;
73
+ };
74
+ type PhoneBuildPlanParams = BuildPlanParams;
75
+ type PhoneRemoteDeviceState = Omit<RemoteDeviceState, "platform" | "state" | "backend"> & {
76
+ platform: string | null;
77
+ state: string;
78
+ backend: string;
79
+ };
80
+ type PhonePhysicalDeviceState = Omit<PhysicalDeviceState, "platform" | "connection" | "lease"> & {
81
+ platform: string;
82
+ connection: string;
83
+ lease: Omit<PhysicalDeviceState["lease"], "kind"> & {
84
+ kind: string;
85
+ };
86
+ };
87
+ type PhoneWorktreeGit = WorktreeGit;
88
+ type PhoneWorktreeFacts = Omit<WorktreeFacts, "pullRequest" | "gitChip"> & {
89
+ pullRequest?: PhonePullRequestFacts | null;
90
+ gitChip?: PhoneGitChipFacts;
91
+ };
92
+ type PhoneGitChipPart = {
93
+ kind: string;
94
+ ahead?: number;
95
+ behind?: number;
96
+ count?: number;
97
+ into?: string;
98
+ };
99
+ type PhoneGitChipFacts = Omit<GitChip, "ci" | "parts"> & {
100
+ ci: string | null;
101
+ parts: PhoneGitChipPart[];
102
+ };
103
+ type PhoneStageFacts = Omit<WorkspaceStage, "kind" | "platform" | "closedApps"> & {
104
+ kind: string;
105
+ platform: string | null;
106
+ closedApps: {
107
+ platform: string;
108
+ slot: string;
109
+ }[];
110
+ };
111
+ type PhonePullRequestFacts = Omit<WorktreePullRequest, "state" | "reviewDecision"> & {
112
+ state: string;
113
+ reviewDecision: string | null;
114
+ };
115
+ type PhoneStatusIssue = Omit<StatusIssue, "code" | "severity"> & {
116
+ code: string;
117
+ severity: string;
118
+ };
119
+ type PhoneWebBrowserState = Omit<OptionalFields<WebBrowserState, "targetId">, "browser" | "viewport" | "page" | "activity"> & {
120
+ browser: string;
121
+ viewport: string;
122
+ page?: (Omit<NonNullable<WebBrowserState["page"]>, "state"> & {
123
+ state: string;
124
+ }) | null;
125
+ activity?: PhoneDeviceActivity;
126
+ };
127
+ type PhoneMacosAppState = Omit<MacosAppRecord, "build" | "hostLaunched" | "host"> & {
128
+ state: string;
129
+ build: Omit<MacosBuild, "state"> & {
130
+ state: string;
131
+ };
132
+ hostLaunched?: boolean | string;
133
+ host?: Omit<HostedMacosPlacement, "agent"> & {
134
+ agent: {
135
+ driver: string;
136
+ setting?: string;
137
+ remoteConfig?: string;
138
+ command?: string;
139
+ };
140
+ };
141
+ };
142
+ type PhoneEnvironmentState = Omit<EnvironmentState, "slots" | "metro" | "build" | "issues" | "android" | "ios" | "web" | "macos" | "phase" | "stage" | "warmStep" | "memorySource" | "worktree" | "remoteDevices" | "physicalDevices" | "lastBuilds" | "builds" | "agents" | "endedAgents"> & {
143
+ phase?: string;
144
+ stage?: PhoneStageFacts;
145
+ warmStep?: string;
146
+ memorySource?: string;
147
+ macos?: PhoneMacosAppState | null;
148
+ worktree?: PhoneWorktreeFacts | null;
149
+ remoteDevices?: PhoneRemoteDeviceState[];
150
+ physicalDevices?: PhonePhysicalDeviceState[];
151
+ lastBuilds?: Partial<Record<string, PhoneLastBuild>>;
152
+ builds?: Partial<Record<string, PhoneBuildHistoryEntry[]>>;
153
+ agents?: PhoneAgentSession[];
154
+ endedAgents?: PhoneEndedAgentSession[];
155
+ build?: PhoneBuildReport | null;
156
+ issues?: PhoneStatusIssue[];
157
+ ios?: PhoneSimState | null;
158
+ android?: PhoneAndroidState | null;
159
+ labelOnly?: boolean;
160
+ web?: PhoneWebBrowserState | null;
161
+ slots?: {
162
+ slot: string;
163
+ ios?: PhoneSimState | null;
164
+ android?: PhoneAndroidState | null;
165
+ }[];
166
+ metro?: (Omit<NonNullable<EnvironmentState["metro"]>, "lastStop" | "tunnel" | "bundle" | "idleStop"> & {
167
+ lastStop?: {
168
+ reason: string;
169
+ at?: string;
170
+ };
171
+ tunnel?: {
172
+ provider: string;
173
+ url: string;
174
+ };
175
+ bundle?: PhoneMetroBundle;
176
+ idleStop?: Omit<NonNullable<NonNullable<EnvironmentState["metro"]>["idleStop"]>, "reason"> & {
177
+ reason: string;
178
+ };
179
+ }) | null;
180
+ };
181
+ type PhoneAgentSession = Omit<AgentSession, "tool"> & {
182
+ tool: string;
183
+ };
184
+ type PhoneEndedAgentSession = Omit<PhoneAgentSession, "pid"> & {
185
+ endedAt: string;
186
+ };
187
+ type PhoneMetroBundle = Omit<MetroBundleState, "last" | "platform"> & {
188
+ platform?: string;
189
+ last?: Omit<NonNullable<MetroBundleState["last"]>, "platform" | "status"> & {
190
+ platform: string;
191
+ status: string;
192
+ };
193
+ };
194
+ type PhoneWorkspaceDisk = EnvironmentDisk;
195
+ type PhoneStatusUsage = Omit<UsageHistory, "devices"> & {
196
+ devices: (Omit<DeviceUsageSeries, "kind"> & {
197
+ kind: string;
198
+ })[];
199
+ };
200
+ type PhoneBuildResult = string;
201
+ type PhoneBuildHistoryEntry = Omit<BuildHistoryEntry, keyof LastBuildReport | "result" | "phases"> & PhoneLastBuild & {
202
+ result: PhoneBuildResult;
203
+ phases: Partial<Record<string, number>>;
204
+ };
205
+ type PhoneLastBuild = Omit<LastBuildReport, "platform" | "status" | "cacheHit" | "missReason"> & {
206
+ platform: string;
207
+ status: string;
208
+ cacheHit: PhoneBuildCacheHit;
209
+ missReason?: PhoneBuildMissReason;
210
+ };
211
+ type PhoneBuildDiagnostic = BuildDiagnostic;
212
+ type PhoneDeviceLeaseState = DeviceLeaseState;
213
+ type PhoneStatusPayload = Omit<StatusPayload, "environments" | "machine" | "unprovisionedWorktrees"> & {
214
+ unprovisionedWorktrees?: PhoneWorktreeFacts[];
215
+ environments: PhoneEnvironmentState[];
216
+ machine?: PhoneMachineUsageState | null;
217
+ ownLeases?: string[];
218
+ };
219
+ type PhoneMachineOwnerKind = string;
220
+ type PhoneMachineOwner = Omit<OptionalFields<MachineOwner, "memoryMb">, "kind"> & {
221
+ kind: PhoneMachineOwnerKind;
222
+ };
223
+ type PhoneMachineUsageState = Omit<MachineUsageState, "owners" | "memorySource"> & {
224
+ memorySource?: string;
225
+ owners: PhoneMachineOwner[];
226
+ };
227
+ type PhoneLogSource = LogSource;
228
+ type PhoneLogLevel = LogLevel;
229
+ interface PhoneStackFrame {
230
+ file?: string | null;
231
+ line?: number | null;
232
+ column?: number | null;
233
+ fn?: string | null;
234
+ }
235
+ type PhoneLogRecord = LogRecord & {
236
+ ts: number;
237
+ src: PhoneLogSource;
238
+ level: PhoneLogLevel;
239
+ msg: string;
240
+ slot?: string;
241
+ event?: string;
242
+ stack?: PhoneStackFrame[];
243
+ deviceId?: string;
244
+ };
245
+ type PhoneLogFilter = LogFilter;
246
+ type PhoneFrameTarget = FrameTarget;
247
+ type PhoneReplayRate = 0 | 1 | 2;
248
+ type PhoneReplaySpan = ReplaySpan;
249
+ type PhoneReplayMarker = Omit<ReplayMarker, "kind"> & {
250
+ kind: string;
251
+ };
252
+ type PhoneReplayKeyframe = Omit<ReplayKeyframe, "posture"> & {
253
+ posture?: string;
254
+ };
255
+ type PhoneReplayRange = Omit<ReplayRange, "markers"> & {
256
+ markers: PhoneReplayMarker[];
257
+ };
258
+ type PhoneReplayEndedEvent = ReplayEndedEvent;
259
+ type PhoneControlBeginParams = ControlBeginParams;
260
+ type PhoneControlBeginResult = Omit<ControlBeginResult, "platform" | "postures"> & {
261
+ platform: string;
262
+ postures: string[];
263
+ };
264
+ type PhoneSimulatorOptions = SimulatorOptions;
265
+ type PhoneSimulatorCommand = SimulatorCommand;
266
+ type PhoneInputSimulatorParams = InputSimulatorParams;
267
+ type PhoneTouchPhase = TouchPhase;
268
+ type PhoneInputButton = InputButton;
269
+ type PhoneInputKey = InputKey;
270
+ type PhoneKeyModifier = KeyModifier;
271
+ type PhoneRotateDirection = RotateDirection;
272
+ type PhoneDevicePosture = DevicePosture;
273
+ type PhoneActionName = ActionName;
274
+ type PhoneActionParams = ActionParams;
275
+ type PhoneActionResult = Omit<ActionResult, "action"> & {
276
+ action: string;
277
+ };
278
+ type PhoneMemoryPressure = string;
279
+ type PhoneMachineVolume = MachineVolume;
280
+ type PhoneMachineUsage = Omit<OptionalFields<MachineUsage, "cpu">, "memory"> & {
281
+ memory: Omit<MachineUsage["memory"], "pressure"> & {
282
+ pressure: PhoneMemoryPressure | null;
283
+ };
284
+ };
285
+ type PhoneUsageSample = Omit<UsageSample, "memoryPressure"> & {
286
+ memoryPressure: number | null;
287
+ };
288
+ type PhoneMachineHistory = Omit<MachineHistory, "samples"> & {
289
+ samples: PhoneUsageSample[];
290
+ };
291
+ type PhoneMachineDetails = OptionalFields<MachineDetails, "buildMachines">;
292
+ type PhoneBuildClientSummary = BuildClientSummary;
293
+ type PhoneBuildMachineReport = BuildMachineReport;
294
+ type PhoneClientAuth = PairingAuth | DeviceAuth;
295
+ type PhonePushEvent = PushEvent;
296
+ type PhoneNotificationLevel = NotificationLevel;
297
+ type PhonePushRegisterParams = PushRegisterParams;
298
+ type PhoneNotificationSuppression = NotificationSuppression;
299
+ type PhoneNotificationTarget = {
300
+ kind: string;
301
+ path?: string;
302
+ platform?: string;
303
+ slot?: string;
304
+ url?: string;
305
+ };
306
+ type PhoneWorkspaceFile = WorkspaceFile;
307
+ type PhoneWorkspaceFiles = WorkspaceFiles;
308
+ type PhoneWorkspacePatch = Omit<WorkspacePatch, "section" | "kind"> & {
309
+ section: string;
310
+ kind: string;
311
+ };
312
+ type PhoneWorkspaceDiff = Omit<WorkspaceDiff, "patches"> & {
313
+ patches: PhoneWorkspacePatch[];
314
+ };
315
+ type PhoneNotificationEntry = Omit<NotificationEntry, "category" | "suppressed" | "target"> & {
316
+ category: string;
317
+ suppressed?: string;
318
+ target: PhoneNotificationTarget;
319
+ };
320
+ type PhoneNotificationsListResult = Omit<NotificationsListResult, "notifications"> & {
321
+ notifications: PhoneNotificationEntry[];
322
+ };
323
+ type PhoneProtocolError = Omit<ProtocolError, "code"> & {
324
+ code: string;
325
+ };
326
+ type PhoneStatusEvent = Omit<StatusEvent, "payload" | "usage"> & {
327
+ payload: PhoneStatusPayload;
328
+ usage?: PhoneStatusUsage;
329
+ };
330
+ type PhoneLogsEvent = Omit<LogsEvent, "records"> & {
331
+ records: PhoneLogRecord[];
332
+ };
333
+ type PhoneDeviceFrameArtwork = DeviceFrameArtwork;
334
+ type PhoneDeviceFrameEvent = DeviceFrameEvent;
335
+ type PhoneMacosWindowsEvent = OptionalFields<MacosWindowsEvent, "pinned">;
336
+ type PhoneFrameEvent = Omit<FrameEvent, "platform" | "posture" | "mime"> & {
337
+ platform: string;
338
+ posture?: string;
339
+ mime: string;
340
+ };
341
+ type PhoneFrameDelayedEvent = FrameDelayedEvent;
342
+ type PhoneErrorEvent = OptionalFields<Omit<ErrorEvent, "error">, "subscription"> & {
343
+ error: PhoneProtocolError;
344
+ };
345
+ type PhoneControlEndedEvent = Omit<ControlEndedEvent, "reason"> & {
346
+ reason: string;
347
+ };
348
+ type PhoneNotificationEvent = Omit<NotificationEvent, "notification"> & {
349
+ notification: PhoneNotificationEntry;
350
+ };
351
+ type PhoneServerEvent = Exclude<ServerEvent, BuildProgressEvent | StatusEvent | LogsEvent | ErrorEvent | FrameEvent | ControlEndedEvent | NotificationEvent | MacosWindowsEvent> | PhoneMacosWindowsEvent | PhoneStatusEvent | PhoneLogsEvent | PhoneErrorEvent | PhoneFrameEvent | PhoneControlEndedEvent | PhoneNotificationEvent;
352
+ /** Fields introduced after protocol v1's initial release remain optional on the receiving client. */
353
+ type OptionalFields<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
354
+ type PhoneHelloResult = OptionalFields<Omit<HelloResult, "server" | "features" | "capabilities" | "actions" | "approval">, "device"> & {
355
+ actions?: string[];
356
+ server: OptionalFields<HelloResult["server"], "home">;
357
+ features?: string[];
358
+ capabilities: string[];
359
+ approval?: {
360
+ state: string;
361
+ expiresAt: string;
362
+ };
363
+ };
364
+ type PhoneMethods = Omit<Methods, (typeof BUILD_METHODS)[number] | (typeof DEVICE_HOST_METHODS)[number] | (typeof SERVER_UPDATE_METHODS)[number] | "machines.update.start" | "machines.update.status" | "route.setup" | "hello" | "logs.query" | "machine.get" | "machine.details" | "machine.history" | "workspace.diff" | "frames.subscribe" | "replay.range" | "replay.keyframe" | "build.plan" | "action" | "control.begin" | "notifications.list"> & {
365
+ hello: {
366
+ params: Omit<HelloParams, "auth"> & {
367
+ auth: PhoneClientAuth;
368
+ };
369
+ result: PhoneHelloResult;
370
+ };
371
+ "machine.history": {
372
+ params: Methods["machine.history"]["params"];
373
+ result: PhoneMachineHistory;
374
+ };
375
+ "workspace.diff": {
376
+ params: Methods["workspace.diff"]["params"];
377
+ result: PhoneWorkspaceDiff;
378
+ };
379
+ "frames.subscribe": {
380
+ params: FrameTarget;
381
+ result: Omit<FramesSubscribeResult, "video"> & {
382
+ video?: string;
383
+ };
384
+ };
385
+ "replay.range": {
386
+ params: ReplayTarget;
387
+ result: PhoneReplayRange;
388
+ };
389
+ "replay.keyframe": {
390
+ params: ReplayKeyframeParams;
391
+ result: PhoneReplayKeyframe;
392
+ };
393
+ "build.plan": {
394
+ params: BuildPlanParams;
395
+ result: PhoneBuildPlan;
396
+ };
397
+ action: {
398
+ params: ActionParams;
399
+ result: PhoneActionResult;
400
+ };
401
+ "control.begin": {
402
+ params: ControlBeginParams;
403
+ result: PhoneControlBeginResult;
404
+ };
405
+ "notifications.list": {
406
+ params: Methods["notifications.list"]["params"];
407
+ result: PhoneNotificationsListResult;
408
+ };
409
+ "machine.get": {
410
+ params?: Record<string, never>;
411
+ result: PhoneMachineUsage;
412
+ };
413
+ "machine.details": {
414
+ params?: Record<string, never>;
415
+ result: PhoneMachineDetails;
416
+ };
417
+ "logs.query": {
418
+ params: LogFilter;
419
+ result: Omit<LogsQueryResult, "records"> & {
420
+ records: PhoneLogRecord[];
421
+ };
422
+ };
423
+ };
424
+ type PhoneMethod = keyof PhoneMethods;
425
+ type PhoneResponse<M extends PhoneMethod = PhoneMethod> = {
426
+ id: number;
427
+ result: PhoneMethods[M]["result"];
428
+ } | {
429
+ id: number;
430
+ error: PhoneProtocolError;
431
+ };
432
+ type PhoneServerMessage = PhoneResponse | PhoneServerEvent;
433
+ //#endregion
434
+ export { ACTIONS, type PhoneActionName as ActionName, PhoneActionName, type PhoneActionParams as ActionParams, PhoneActionParams, type PhoneActionResult as ActionResult, PhoneActionResult, type PhoneAgentSession as AgentSession, PhoneAgentSession, type PhoneAndroidState as AndroidState, PhoneAndroidState, type PhoneAppPresence as AppPresence, PhoneAppPresence, type PhoneBuildCacheHit as BuildCacheHit, PhoneBuildCacheHit, type PhoneBuildClientSummary as BuildClientSummary, PhoneBuildClientSummary, type PhoneBuildDetail as BuildDetail, PhoneBuildDetail, type PhoneBuildDiagnostic as BuildDiagnostic, PhoneBuildDiagnostic, type PhoneBuildHistoryEntry as BuildHistoryEntry, PhoneBuildHistoryEntry, type PhoneBuildMachineReport as BuildMachineReport, PhoneBuildMachineReport, type PhoneBuildMissCategory as BuildMissCategory, PhoneBuildMissCategory, type PhoneBuildMissChange as BuildMissChange, PhoneBuildMissChange, type PhoneBuildMissReason as BuildMissReason, PhoneBuildMissReason, type PhoneBuildPhase as BuildPhase, PhoneBuildPhase, type PhoneBuildPlacement as BuildPlacement, PhoneBuildPlacement, type PhoneBuildPlan as BuildPlan, PhoneBuildPlan, type PhoneBuildPlanParams as BuildPlanParams, PhoneBuildPlanParams, type PhoneBuildReport as BuildReport, PhoneBuildReport, type PhoneBuildResult as BuildResult, PhoneBuildResult, type PhoneClientAuth as ClientAuth, PhoneClientAuth, type PhoneControlBeginParams as ControlBeginParams, PhoneControlBeginParams, type PhoneControlBeginResult as ControlBeginResult, PhoneControlBeginResult, type PhoneControlEndedEvent as ControlEndedEvent, PhoneControlEndedEvent, type PhoneDeviceActivity as DeviceActivity, PhoneDeviceActivity, type PhoneDeviceAppProcess as DeviceAppProcess, PhoneDeviceAppProcess, type PhoneDeviceDisk as DeviceDisk, PhoneDeviceDisk, type PhoneDeviceFrameArtwork as DeviceFrameArtwork, PhoneDeviceFrameArtwork, type PhoneDeviceFrameEvent as DeviceFrameEvent, PhoneDeviceFrameEvent, type PhoneDeviceLeaseState as DeviceLeaseState, PhoneDeviceLeaseState, type PhoneDevicePlatform as DevicePlatform, PhoneDevicePlatform, type PhoneDevicePosture as DevicePosture, PhoneDevicePosture, type PhoneEndedAgentSession as EndedAgentSession, PhoneEndedAgentSession, type PhoneEnvironmentState as EnvironmentState, PhoneEnvironmentState, type PhoneErrorEvent as ErrorEvent, PhoneErrorEvent, type PhoneFrameDelayedEvent as FrameDelayedEvent, PhoneFrameDelayedEvent, type PhoneFrameEvent as FrameEvent, PhoneFrameEvent, type PhoneFrameTarget as FrameTarget, PhoneFrameTarget, type PhoneGitChipFacts as GitChipFacts, PhoneGitChipFacts, type PhoneGitChipPart as GitChipPart, PhoneGitChipPart, type PhoneHelloResult as HelloResult, PhoneHelloResult, type PhoneInputButton as InputButton, PhoneInputButton, type PhoneInputKey as InputKey, PhoneInputKey, type PhoneInputSimulatorParams as InputSimulatorParams, PhoneInputSimulatorParams, type PhoneKeyModifier as KeyModifier, PhoneKeyModifier, type PhoneLastBuild as LastBuild, PhoneLastBuild, type PhoneLogFilter as LogFilter, PhoneLogFilter, type PhoneLogLevel as LogLevel, PhoneLogLevel, type PhoneLogRecord as LogRecord, PhoneLogRecord, type PhoneLogSource as LogSource, PhoneLogSource, type PhoneLogsEvent as LogsEvent, PhoneLogsEvent, type PhoneMachineDetails as MachineDetails, PhoneMachineDetails, type PhoneMachineHistory as MachineHistory, PhoneMachineHistory, type PhoneMachineOwner as MachineOwner, PhoneMachineOwner, type PhoneMachineOwnerKind as MachineOwnerKind, PhoneMachineOwnerKind, type PhoneMachineUsage as MachineUsage, PhoneMachineUsage, type PhoneMachineUsageState as MachineUsageState, PhoneMachineUsageState, type PhoneMachineVolume as MachineVolume, PhoneMachineVolume, type PhoneMacosAppState as MacosAppState, PhoneMacosAppState, type PhoneMacosWindowsEvent as MacosWindowsEvent, PhoneMacosWindowsEvent, type PhoneMemoryPressure as MemoryPressure, PhoneMemoryPressure, type PhoneMethod as Method, PhoneMethod, type PhoneMethods as Methods, PhoneMethods, type PhoneMetroBundle as MetroBundle, PhoneMetroBundle, type PhoneNotificationEntry as NotificationEntry, PhoneNotificationEntry, type PhoneNotificationEvent as NotificationEvent, PhoneNotificationEvent, type PhoneNotificationLevel as NotificationLevel, PhoneNotificationLevel, type PhoneNotificationSuppression as NotificationSuppression, PhoneNotificationSuppression, type PhoneNotificationTarget as NotificationTarget, PhoneNotificationTarget, type PhoneNotificationsListResult as NotificationsListResult, PhoneNotificationsListResult, PROTOCOL_VERSION, type PhonePairingPayload as PairingPayload, PhonePairingPayload, PhonePhysicalDeviceState, type PhonePhysicalDeviceState as PhysicalDeviceState, PhonePlatform, type PhonePlatform as Platform, PhoneProtocolError, type PhoneProtocolError as ProtocolError, PhonePullRequestFacts, type PhonePullRequestFacts as PullRequestFacts, PhonePushEvent, type PhonePushEvent as PushEvent, PhonePushRegisterParams, type PhonePushRegisterParams as PushRegisterParams, PhoneReloadPlatform, type PhoneReloadPlatform as ReloadPlatform, PhoneRemoteDeviceState, type PhoneRemoteDeviceState as RemoteDeviceState, PhoneReplayEndedEvent, type PhoneReplayEndedEvent as ReplayEndedEvent, PhoneReplayKeyframe, type PhoneReplayKeyframe as ReplayKeyframe, PhoneReplayMarker, type PhoneReplayMarker as ReplayMarker, PhoneReplayRange, type PhoneReplayRange as ReplayRange, PhoneReplayRate, type PhoneReplayRate as ReplayRate, PhoneReplaySpan, type PhoneReplaySpan as ReplaySpan, PhoneResponse, type PhoneResponse as Response, PhoneRotateDirection, type PhoneRotateDirection as RotateDirection, PhoneServerEvent, type PhoneServerEvent as ServerEvent, PhoneServerMessage, type PhoneServerMessage as ServerMessage, PhoneSimState, type PhoneSimState as SimState, PhoneSimulatorCommand, type PhoneSimulatorCommand as SimulatorCommand, PhoneSimulatorOptions, type PhoneSimulatorOptions as SimulatorOptions, PhoneStackFrame, type PhoneStackFrame as StackFrame, PhoneStageFacts, type PhoneStageFacts as StageFacts, PhoneStatusEvent, type PhoneStatusEvent as StatusEvent, PhoneStatusIssue, type PhoneStatusIssue as StatusIssue, PhoneStatusPayload, type PhoneStatusPayload as StatusPayload, PhoneStatusUsage, type PhoneStatusUsage as StatusUsage, PhoneTouchPhase, type PhoneTouchPhase as TouchPhase, PhoneUsageSample, type PhoneUsageSample as UsageSample, PhoneWebBrowserState, type PhoneWebBrowserState as WebBrowserState, PhoneWorkspaceDiff, type PhoneWorkspaceDiff as WorkspaceDiff, PhoneWorkspaceDisk, type PhoneWorkspaceDisk as WorkspaceDisk, PhoneWorkspaceFile, type PhoneWorkspaceFile as WorkspaceFile, PhoneWorkspaceFiles, type PhoneWorkspaceFiles as WorkspaceFiles, PhoneWorkspacePatch, type PhoneWorkspacePatch as WorkspacePatch, PhoneWorktreeFacts, type PhoneWorktreeFacts as WorktreeFacts, PhoneWorktreeGit, type PhoneWorktreeGit as WorktreeGit };
@@ -0,0 +1,2 @@
1
+ import { ACTIONS, PROTOCOL_VERSION } from "./protocol.mjs";
2
+ export { ACTIONS, PROTOCOL_VERSION };
@@ -0,0 +1,37 @@
1
+ //#region process-identity.d.ts
2
+ interface ProcessRecord {
3
+ pid?: unknown;
4
+ processToken?: unknown;
5
+ }
6
+ declare function sameProcessRecord(a: ProcessRecord | null | undefined, b: ProcessRecord | null | undefined): boolean;
7
+ type CapturedIdentity = {
8
+ ok: true;
9
+ token: string;
10
+ } | {
11
+ ok: false;
12
+ reason: string;
13
+ };
14
+ declare function captureProcessIdentity(pid: number): CapturedIdentity;
15
+ declare function captureProcessToken(pid: number): string | null;
16
+ type ProcessIdentityStatus = "same" | "different" | "gone" | "unknown";
17
+ declare function inspectProcessIdentity(record: ProcessRecord | null | undefined): ProcessIdentityStatus;
18
+ type ProcessStart = {
19
+ status: "running";
20
+ startedAtMs: number;
21
+ } | {
22
+ status: "gone";
23
+ } | {
24
+ status: "unknown";
25
+ };
26
+ /** Start time of a live process, read from the same OS identity that `captureProcessIdentity` records. */
27
+ declare function inspectProcessStart(pid: number): ProcessStart;
28
+ /** Exact Darwin process start time for a native viewer that revalidates the same owned process. */
29
+ declare function processStartMicros(pid: number): {
30
+ status: "running";
31
+ startedAtMicros: number;
32
+ } | {
33
+ status: "gone" | "unknown";
34
+ };
35
+ declare function waitForProcessExit(record: ProcessRecord, timeoutMs: number): Promise<boolean>;
36
+ //#endregion
37
+ export { captureProcessIdentity as a, inspectProcessStart as c, waitForProcessExit as d, ProcessStart as i, processStartMicros as l, ProcessIdentityStatus as n, captureProcessToken as o, ProcessRecord as r, inspectProcessIdentity as s, CapturedIdentity as t, sameProcessRecord as u };
@@ -1,30 +1,2 @@
1
- //#region process-identity.d.ts
2
- interface ProcessRecord {
3
- pid?: unknown;
4
- processToken?: unknown;
5
- }
6
- declare function sameProcessRecord(a: ProcessRecord | null | undefined, b: ProcessRecord | null | undefined): boolean;
7
- type CapturedIdentity = {
8
- ok: true;
9
- token: string;
10
- } | {
11
- ok: false;
12
- reason: string;
13
- };
14
- declare function captureProcessIdentity(pid: number): CapturedIdentity;
15
- declare function captureProcessToken(pid: number): string | null;
16
- type ProcessIdentityStatus = "same" | "different" | "gone" | "unknown";
17
- declare function inspectProcessIdentity(record: ProcessRecord | null | undefined): ProcessIdentityStatus;
18
- type ProcessStart = {
19
- status: "running";
20
- startedAtMs: number;
21
- } | {
22
- status: "gone";
23
- } | {
24
- status: "unknown";
25
- };
26
- /** Start time of a live process, read from the same OS identity that `captureProcessIdentity` records. */
27
- declare function inspectProcessStart(pid: number): ProcessStart;
28
- declare function waitForProcessExit(record: ProcessRecord, timeoutMs: number): Promise<boolean>;
29
- //#endregion
30
- export { CapturedIdentity, ProcessIdentityStatus, ProcessRecord, ProcessStart, captureProcessIdentity, captureProcessToken, inspectProcessIdentity, inspectProcessStart, sameProcessRecord, waitForProcessExit };
1
+ import { a as captureProcessIdentity, c as inspectProcessStart, d as waitForProcessExit, i as ProcessStart, l as processStartMicros, n as ProcessIdentityStatus, o as captureProcessToken, r as ProcessRecord, s as inspectProcessIdentity, t as CapturedIdentity, u as sameProcessRecord } from "./process-identity-BTyww2Xj.mjs";
2
+ export { CapturedIdentity, ProcessIdentityStatus, ProcessRecord, ProcessStart, captureProcessIdentity, captureProcessToken, inspectProcessIdentity, inspectProcessStart, processStartMicros, sameProcessRecord, waitForProcessExit };
@@ -28,6 +28,14 @@ function inspectProcessIdentity(record) {
28
28
  }
29
29
  /** Start time of a live process, read from the same OS identity that `captureProcessIdentity` records. */
30
30
  function inspectProcessStart(pid) {
31
+ const result = processStartMicros(pid);
32
+ return result.status === "running" ? {
33
+ status: "running",
34
+ startedAtMs: Math.floor(result.startedAtMicros / 1e3)
35
+ } : result;
36
+ }
37
+ /** Exact Darwin process start time for a native viewer that revalidates the same owned process. */
38
+ function processStartMicros(pid) {
31
39
  const captured = capture(pid);
32
40
  if (!captured.ok) return captured.error.code === "NOT_FOUND" ? { status: "gone" } : { status: "unknown" };
33
41
  const decoded = decode(captured.value);
@@ -36,7 +44,7 @@ function inspectProcessStart(pid) {
36
44
  if (!match) return { status: "unknown" };
37
45
  return {
38
46
  status: "running",
39
- startedAtMs: Number(match[1]) * 1e3 + Math.floor(Number(match[2]) / 1e3)
47
+ startedAtMicros: Number(match[1]) * 1e6 + Number(match[2])
40
48
  };
41
49
  }
42
50
  async function waitForProcessExit(record, timeoutMs) {
@@ -50,4 +58,4 @@ async function waitForProcessExit(record, timeoutMs) {
50
58
  return false;
51
59
  }
52
60
  //#endregion
53
- export { captureProcessIdentity, captureProcessToken, inspectProcessIdentity, inspectProcessStart, sameProcessRecord, waitForProcessExit };
61
+ export { captureProcessIdentity, captureProcessToken, inspectProcessIdentity, inspectProcessStart, processStartMicros, sameProcessRecord, waitForProcessExit };