@tapflowio/ios-agent 0.19.0 → 0.20.1

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 (24) hide show
  1. package/bin/TapflowNetFilter.app/Contents/CodeResources +0 -0
  2. package/bin/TapflowNetFilter.app/Contents/Info.plist +48 -0
  3. package/bin/TapflowNetFilter.app/Contents/Library/SystemExtensions/dev.tapflow.netfilter.ext.systemextension/Contents/Info.plist +58 -0
  4. package/bin/TapflowNetFilter.app/Contents/Library/SystemExtensions/dev.tapflow.netfilter.ext.systemextension/Contents/MacOS/dev.tapflow.netfilter.ext +0 -0
  5. package/bin/TapflowNetFilter.app/Contents/Library/SystemExtensions/dev.tapflow.netfilter.ext.systemextension/Contents/_CodeSignature/CodeResources +123 -0
  6. package/bin/TapflowNetFilter.app/Contents/Library/SystemExtensions/dev.tapflow.netfilter.ext.systemextension/Contents/embedded.provisionprofile +0 -0
  7. package/bin/TapflowNetFilter.app/Contents/MacOS/TapflowNetFilter +0 -0
  8. package/bin/TapflowNetFilter.app/Contents/PkgInfo +1 -0
  9. package/bin/TapflowNetFilter.app/Contents/_CodeSignature/CodeResources +151 -0
  10. package/bin/TapflowNetFilter.app/Contents/embedded.provisionprofile +0 -0
  11. package/bin/libtapflow-nethook.dylib +0 -0
  12. package/dist/IOSAgent.d.ts +131 -3
  13. package/dist/IOSAgent.d.ts.map +1 -1
  14. package/dist/IOSAgent.js +312 -20
  15. package/dist/IOSAgent.js.map +1 -1
  16. package/dist/SimctlWrapper.d.ts +24 -0
  17. package/dist/SimctlWrapper.d.ts.map +1 -1
  18. package/dist/SimctlWrapper.js +32 -0
  19. package/dist/SimctlWrapper.js.map +1 -1
  20. package/dist/SimulatorNetwork.d.ts +414 -0
  21. package/dist/SimulatorNetwork.d.ts.map +1 -0
  22. package/dist/SimulatorNetwork.js +996 -0
  23. package/dist/SimulatorNetwork.js.map +1 -0
  24. package/package.json +10 -8
@@ -0,0 +1,414 @@
1
+ import type { NetworkStatePayload } from '@tapflowio/agent-core';
2
+ /**
3
+ * Take one simulator off the network, or put it back (#607).
4
+ *
5
+ * A simulator has no NIC to switch off — it is host processes sharing the Mac's network stack — so
6
+ * "offline" is assembled from three mechanisms, and the whole point of this class is that they are
7
+ * never applied separately:
8
+ *
9
+ * 1. **the host content filter** (`ios-netfilter`) drops the simulator's flows at the kernel
10
+ * 2. **the injected dylib** tells the app its path is unsatisfied, and cuts the connections it is
11
+ * already holding
12
+ * 3. **the status bar** stops showing service
13
+ *
14
+ * Each alone produces a false result a tester would sign off on. Layer 1 alone leaves the app
15
+ * believing it is online — measured: traffic dead, `NWPathMonitor` reporting satisfied for the life
16
+ * of the process — and leaves a pooled connection working. Layer 2 alone blocks nothing: faking
17
+ * `nw_path_get_status` does not stop `URLSession`, which reads the kernel's real path. Layer 3 alone
18
+ * is pixels.
19
+ */
20
+ export interface SimulatorNetworkOptions {
21
+ /** The container app that owns the system extension. Absent or not installed means layer 1 cannot
22
+ * be applied, which this class reports rather than works around. */
23
+ filterHostBinary?: string;
24
+ /** Where the dylib looks for its per-simulator flag. The host's `/tmp` is visible at the same path
25
+ * inside every simulator on the Mac, which is why the file name carries the udid. */
26
+ conditionDir?: string;
27
+ /** Where the dylib writes what its self-check found. */
28
+ verdictDir?: string;
29
+ /** The injected library. Overridable so a test never arms a real simulator. */
30
+ nethookDylib?: string;
31
+ /** Where the provider's state file may be, most likely first. Overridable so a test can point at a
32
+ * file it writes rather than at whatever the Mac's real filter is doing. */
33
+ filterStateFiles?: string[];
34
+ /** Called when a device that was offline stops being enforced. The agent turns this into an
35
+ * unsolicited `network:state`; nothing here knows about the wire. */
36
+ onEnforcementLost?: (udid: string) => void;
37
+ /** How often liveness is checked. Overridable so a test does not have to spend seconds of wall
38
+ * clock proving that a stale file is noticed; the threshold itself comes from the file. */
39
+ livenessIntervalMs?: number;
40
+ /** How long the state-file fallback waits for the provider to publish. Same reason as the interval
41
+ * above: proving that a file which never catches up is refused should not cost three seconds. */
42
+ filterConfirmDeadlineMs?: number;
43
+ }
44
+ /**
45
+ * How long after a launch an absent verdict is still ordinary (#629).
46
+ *
47
+ * **Derived from the dylib rather than picked.** Its verdict is written from a
48
+ * `__attribute__((constructor))`, which reads as "milliseconds" and is wrong: the constructor runs
49
+ * `tf_self_check()` first, and that waits on a semaphore for up to **3 seconds** for a path update
50
+ * (`network-hook.m`). So a perfectly healthy install produces no verdict for three seconds after the
51
+ * process starts, plus whatever the launch itself took.
52
+ *
53
+ * 10s is that plus room for a loaded Mac starting a large app. Generous on purpose: past this the
54
+ * answer changes from "waiting" to "this cannot work", and being early would put that verdict on an
55
+ * install that was about to succeed. The cost of being late is that a tester sees `awaiting-app` for a
56
+ * few seconds longer — which is the true answer for those seconds.
57
+ */
58
+ export declare const LAUNCH_VERDICT_DEADLINE_MS = 10000;
59
+ /** The simctl calls this needs. Narrower than `SimctlWrapper` so a test can stand in for it. */
60
+ interface SimctlForNetwork {
61
+ setStatusBarOffline(udid: string, offline: boolean): Promise<void>;
62
+ setSimulatorEnv(udid: string, name: string, value: string): Promise<void>;
63
+ }
64
+ export declare class SimulatorNetwork {
65
+ private readonly simctl;
66
+ private readonly hostBinary;
67
+ private readonly conditionDir;
68
+ private readonly verdictDir;
69
+ private readonly dylib;
70
+ /** Every simulator currently offline. The filter takes the whole set on each call — it has no
71
+ * add/remove — so this is the authority for what the rule should say, not a cache of it. */
72
+ private readonly offline;
73
+ /** Devices whose injection is actually in place. Separates "nothing was delivered" from "delivered,
74
+ * no app has run under it yet" — two states with different remedies, and a reason each. */
75
+ private readonly armed;
76
+ /** Serialises **whole operations**, not just the host run. See `serialize`. */
77
+ private filterQueue;
78
+ /** Set while a liveness check is queued, so a slow toggle does not let ticks pile up behind it. */
79
+ private livenessQueued;
80
+ /** What layer 1 was last found doing, per device. See `FilterVerdict` for why it is remembered. */
81
+ private readonly filterVerdict;
82
+ /** When each device's offline rule was confirmed, in whole seconds. Read by `checkLiveness` to tell
83
+ * a file that disagrees from one that is simply older than the write. */
84
+ private readonly offlineSince;
85
+ /**
86
+ * The drop count last reported for each offline device (#654).
87
+ *
88
+ * **Two things need it.** The liveness check runs every second, so a device with any drops at all
89
+ * would otherwise repeat the same line 600 times in a ten-minute session — into the stream where
90
+ * the enforcement-lost report a person is actually looking for arrives. And the provider's count is
91
+ * per episode but the *file* is a snapshot: only an increase since the last read is news.
92
+ *
93
+ * Cleared wherever `offlineSince` is, so a device that goes offline again starts from nothing —
94
+ * an absent entry reads as zero, and the provider prunes its own counts per episode too, so both
95
+ * ends forget together.
96
+ */
97
+ private readonly dropsReported;
98
+ /**
99
+ * When a launch was last issued for each device (#629).
100
+ *
101
+ * A timestamp rather than a timer: `state()` is synchronous and called from several paths, and there
102
+ * is nothing to cancel — a second launch overwrites this, and a verdict arriving makes it
103
+ * irrelevant. A timer would have to be cancelled on both.
104
+ */
105
+ private readonly launchedAt;
106
+ /** The pid of the last launch that actually started a process, per device. See `markLaunched`. */
107
+ private readonly launchedPid;
108
+ /** Runs only while something is offline. See `updateLiveness`. */
109
+ private liveness;
110
+ /** Set by `dispose`. Without it, work that was already in flight puts the interval back: both
111
+ * `setOffline` and `checkLiveness` call `updateLiveness()` *after* their awaits, so a dispose
112
+ * landing in between was undone by whichever of them resumed next.
113
+ *
114
+ * **No test reaches this flag, and one that appeared to was deleted rather than kept.** The
115
+ * scenario it needs — a dispose landing mid-operation, then a state file that makes the watcher
116
+ * report on its next tick — did not report even with the flag removed *and* `clearInterval` taken
117
+ * out of `dispose`, so the assertion was green against every mutation of the thing it named.
118
+ * Observing the watcher stop needs a seam this class does not have (#664). The flag stays because
119
+ * it is correct and costs one comparison; what it does not have is coverage, and saying so here is
120
+ * cheaper than a test that says otherwise. */
121
+ private disposed;
122
+ private readonly stateFiles;
123
+ private readonly confirmDeadlineMs;
124
+ private enforcementLost;
125
+ private readonly livenessIntervalMs;
126
+ constructor(simctl: SimctlForNetwork, opts?: SimulatorNetworkOptions);
127
+ /**
128
+ * Put the injection in place for a device that has just booted.
129
+ *
130
+ * **Clearing comes first, and it is not tidiness.** The condition file and the verdict both outlive
131
+ * the simulator that wrote them — they are on the host, keyed only by udid — so a device that boots
132
+ * into a leftover condition file is offline before anyone asked, and a leftover verdict answers for
133
+ * hooks that belong to a process which no longer exists.
134
+ *
135
+ * The library is armed here and the target app is not, because the target is not known yet. Until
136
+ * `target()` names one the dylib loads into every process in the simulator and hooks none of them,
137
+ * which is its designed default.
138
+ */
139
+ arm(udid: string): Promise<void>;
140
+ private armLocked;
141
+ /**
142
+ * Name the app the hooks may touch.
143
+ *
144
+ * **Must be called before the app is launched.** dyld reads the environment when a process starts,
145
+ * so naming the target afterwards arms the *next* launch and leaves the running one unhooked —
146
+ * reporting `available: true` for an app that would never see a path update.
147
+ *
148
+ * **The previous app's verdict goes with it.** A verdict is one process's report that its own hooks
149
+ * took, and that process has exited by the time a second app is launched. Leaving the file behind
150
+ * answered for the new app on the old one's evidence: `available: true` before the new process had
151
+ * written anything, and — if its hooks fail — for as long as it runs. The gap where `state()`
152
+ * answers `awaiting-app` for a launch already in flight is the correct reading of that moment;
153
+ * inheriting a stale `ok` is not.
154
+ */
155
+ target(udid: string, bundleId: string): Promise<void>;
156
+ /**
157
+ * A process started, so a verdict is now owed — `markLaunched` opens the window `state()` measures.
158
+ *
159
+ * **Called after the launch, not before it, and that is a correction.** The mark was first set at
160
+ * the top of `target()`, which put `simctl spawn … launchctl setenv`, `simctl launch` and the app's
161
+ * whole dyld load *inside* the budget — none of it measured — and left the mark standing when the
162
+ * launch failed outright, so a launch that never happened reported the hooks as broken ten seconds
163
+ * later.
164
+ *
165
+ * **Only for a pid that is new.** `simctl launch` is issued without `--terminate-running-process`,
166
+ * so launching a bundle that is already running returns the existing pid and starts nothing. The
167
+ * verdict is written from a dyld constructor — once per process — so nothing will rewrite the file
168
+ * `target()` just deleted, and starting a deadline there would report a permanently dead control
169
+ * over an app whose hooks are live and watching. That case stays what it was before this change,
170
+ * which is wrong but harmless; #692 has the decision it needs.
171
+ */
172
+ markLaunched(udid: string, pid: number | null): void;
173
+ /**
174
+ * **Layer 1 leads in both directions, and the order is measured rather than chosen.**
175
+ *
176
+ * Going offline, the dylib cuts the app's open sockets the moment the flag file appears. If the
177
+ * filter were not already dropping new flows at that instant, the app would simply reconnect —
178
+ * reproduced exactly that way while stepping the layers separately, and the reconnected socket then
179
+ * survived the rest of the session.
180
+ *
181
+ * Coming back, the filter has to stop dropping before the app is told the path is satisfied, or the
182
+ * first thing it does with the good news is fail.
183
+ *
184
+ * The status bar goes last either way: it reports, so it should not claim a state before the state
185
+ * is true.
186
+ */
187
+ setOffline(udid: string, offline: boolean): Promise<NetworkStatePayload>;
188
+ /** The body of `setOffline`, running with the queue held. Calls `runFilterHost` directly: going
189
+ * through `serialize` again from in here would wait on a slot this call already owns. */
190
+ private setOfflineLocked;
191
+ /**
192
+ * Write the rule and **ask the provider whether it is holding it.**
193
+ *
194
+ * The write's exit code cannot answer that. The container app exits when the framework accepts the
195
+ * save — 27ms for the whole run — and the running provider is handed the configuration afterwards
196
+ * with nothing coming back. Measured propagation is under 55ms and a probe measured the ask itself
197
+ * at 0.26–0.74ms, which is what makes asking cheaper than the six-second wait an earlier draft
198
+ * proposed in place of it.
199
+ *
200
+ * **The predicate is per-device membership, not set equality.** The filter is host-wide and this
201
+ * agent is not guaranteed to be its only writer; comparing whole sets would report every device as
202
+ * unenforced the moment somebody else's device appeared in the rule.
203
+ *
204
+ * **`wanted` is the value the caller asked for, and it is a parameter for that reason.** Reading it
205
+ * back off `this.offline` here compares the provider's answer against whatever the set says *now*,
206
+ * which is not necessarily what this call wrote — so a second toggle landing in between made a
207
+ * confirmation agree with a rule its own request had not asked for, and the success path then
208
+ * applied layers 2 and 3 for the wrong direction.
209
+ *
210
+ * A mismatch is logged **with what was actually read**, and with the channel it was read from.
211
+ * Two agents writing the same rule cannot be told apart afterwards from a log that only records
212
+ * what each one expected — each is internally consistent and one of them is stale.
213
+ */
214
+ private applyAndConfirm;
215
+ /**
216
+ * What the filter is enforcing — **asked first, and read from the file when the asking is gone.**
217
+ *
218
+ * `--confirm` is the fast and precise channel: 0.26–0.74ms, and it answers from the process the
219
+ * kernel is actually consulting. It stays the primary for exactly that reason, so the healthy Mac
220
+ * this class runs on most of the time is untouched by any of this.
221
+ *
222
+ * **But it disappears after every system-extension replace, and stays gone.** The retired extension
223
+ * sits `[terminated waiting to uninstall on reboot]` still owning the mach name, so the new
224
+ * provider's `NSXPCListener.resume()` fails with `Operation not permitted` — silently, because
225
+ * `resume()` returns void. `--confirm` then answers `no listener` in 9ms while the filter is
226
+ * genuinely enforcing and publishing a fresh state file. Measured 2026-09-03; the provider survives
227
+ * `--off`/`--install` on the same pid, so the listener is never re-vended and the loss lasts as long
228
+ * as the provider does.
229
+ *
230
+ * Taking that as "not confirmed" is what put `filter-unavailable` in front of a tester whose filter
231
+ * was working, on every Mac that had upgraded. The CLI reached the same conclusion earlier and for a
232
+ * different reason (`net-filter.ts`: a stale binary turns a flag it does not know into a rule
233
+ * write); this is the agent following it.
234
+ *
235
+ * `undefined` for every way of not finding out — the remedy is the same whether the filter is
236
+ * absent, disabled, or restarting.
237
+ */
238
+ private confirmEnforcement;
239
+ /** The XPC channel. Its own failures are all the same answer, so none of them are distinguished. */
240
+ private askProvider;
241
+ /**
242
+ * The file channel, polled until it answers or the deadline passes.
243
+ *
244
+ * **Three outcomes, and the middle one is the reason this is a loop rather than a read.** This runs
245
+ * immediately after a rule write, so the ordinary state for up to a pulse is a file that is fresh,
246
+ * correct, and about the *previous* rule — `checkLivenessLocked` says the same thing about the same
247
+ * window, and reading it as a disagreement would fire on every toggle.
248
+ *
249
+ * - The rule matches what was asked for: answered, whenever it was published.
250
+ * - It does not match and was published *after* the baseline: the provider has spoken and it
251
+ * disagrees. That is a real mismatch and is returned so the caller can log it.
252
+ * - It does not match and was published at or before the baseline: it has not published since the
253
+ * write. Wait.
254
+ *
255
+ * A stale file is never any of the three: a provider that died left it there, so it is skipped
256
+ * rather than believed, and `Heartbeat.remove()` means absence is what a *stopped* filter leaves.
257
+ */
258
+ private readConfirmation;
259
+ /** Layers 2 and 3, taken down together. Layer 3 is swallowed for the reason `forget` gives: it only
260
+ * reports, and failing it would abandon the cleanup that matters. */
261
+ private takeDownLayers;
262
+ /**
263
+ * What the device is doing and whether tapflow can still steer it.
264
+ *
265
+ * `offline` describes the **device**, not the last request: a simulator taken offline and then left
266
+ * unsteerable is still offline, and saying otherwise would draw "online" over an app that can reach
267
+ * nothing.
268
+ */
269
+ state(udid: string): NetworkStatePayload;
270
+ /** Called when a device goes away, so a shutdown simulator does not keep a rule alive that names
271
+ * it — the filter would carry the udid for the rest of the host's uptime. */
272
+ forget(udid: string): Promise<void>;
273
+ private forgetLocked;
274
+ /**
275
+ * Point the report somewhere after construction.
276
+ *
277
+ * **The constructor option alone left this untestable, which a review found by mutating the wiring
278
+ * away and watching the whole suite stay green.** `IOSAgent` builds its own `SimulatorNetwork` only
279
+ * when one was not injected, and every test injects one — so the handler was attached on exactly the
280
+ * path no test takes. The one channel that tells a tester their finished check was invalidated had
281
+ * no coverage at all, while the refusal path beside it had five tests.
282
+ */
283
+ setEnforcementLostHandler(fn: (udid: string) => void): void;
284
+ /**
285
+ * Stop watching. **Nothing else clears the interval**, so an agent that shuts down while a device
286
+ * is offline would otherwise keep a timer alive for the life of the process — which is what
287
+ * happened, because for a while this had no caller outside the tests at all. `IOSAgent.disconnect`
288
+ * owns it, beside the resources timer and the tree reader it already stops.
289
+ */
290
+ dispose(): void;
291
+ /**
292
+ * Undo `dispose`, because an agent that disconnected can connect again on the same instance.
293
+ *
294
+ * **A one-way disposed flag is a bug with the shape of the one it fixes**, and this codebase has
295
+ * already shipped it once: the provider's `Heartbeat.stopped` was set by a stop and cleared by
296
+ * nothing, so the first `stopFilter` in a process killed the state file for good while the filter
297
+ * went on filtering. Here it would be quieter and worse — `connect()` is public and reuses the
298
+ * network, so a reconnect after a disconnect would leave the watcher off, and the one report that
299
+ * tells a tester their check was invalidated would simply never come.
300
+ */
301
+ resume(): void;
302
+ /**
303
+ * Watch only while something is offline, because that is the only time there is anything to lose.
304
+ *
305
+ * The interval is `unref`'d: this must not be the reason a process stays alive.
306
+ */
307
+ private updateLiveness;
308
+ /**
309
+ * Notice that a device stopped being enforced, and say so.
310
+ *
311
+ * **Why this exists at all, given the confirmation on the write.** The confirmation answers the
312
+ * moment of the request; enforcement can stop at any point afterwards, and when it does the tester
313
+ * is looking at a control that still says offline. Measured on the reference Mac: killing the
314
+ * provider leaves the kernel passing that simulator's traffic for about 5.8 seconds before launchd
315
+ * has it back, and 23 to 27 requests got through each time. The tester's sign-off covers requests
316
+ * that succeeded.
317
+ *
318
+ * **The threshold comes out of the file.** Three pulses, at whatever rate the provider says it is
319
+ * pulsing — 1s while it is enforcing, so about three seconds. Hard-coding fifteen (three of the old
320
+ * five-second pulses) is what made the outage above arithmetically invisible: the gap closes before
321
+ * the threshold expires and nothing is ever reported.
322
+ *
323
+ * **A timestamp in the future is not freshness, it is a file that cannot be trusted.** Clocks move
324
+ * backwards — NTP corrections, a sleeping Mac — and treating `at > now` as "very fresh" would make
325
+ * a stale file look perfect for as long as the skew lasted.
326
+ */
327
+ private checkLiveness;
328
+ /**
329
+ * **Three questions per device, and each one is a different piece of evidence.** A single "is the
330
+ * file stale" test read against the whole set could not answer them, and the gap it left is
331
+ * measured: the provider publishes its pulse rate *as of the rule it held when it wrote*, so the
332
+ * last write before a device went offline says `pulseSeconds: 5`. A provider dying in the second
333
+ * after a toggle therefore leaves a file that is not stale by its own declared rate for fifteen
334
+ * seconds, and does not name the device either — both predicates false, nothing reported, and the
335
+ * kernel passing that simulator's traffic for the whole of it.
336
+ */
337
+ private checkLivenessLocked;
338
+ /** The first candidate that parses wins. A file that is present but unreadable is not evidence of
339
+ * anything, so it is treated as absent rather than as a reason to stop looking. */
340
+ private readFilterState;
341
+ /**
342
+ * **Serialised, and bounded in time.**
343
+ *
344
+ * The host takes the whole offline set on each run and the last writer wins, so two of these in
345
+ * flight at once decide the rule by which subprocess happens to finish last rather than by which
346
+ * request came last. Two devices toggled in the same second is enough — and the set each one reads
347
+ * is correct, which is what makes the wrong outcome hard to see afterwards: both runs are internally
348
+ * consistent and one of them is stale.
349
+ *
350
+ * **What is serialised is the whole operation, and an earlier version serialised only the host
351
+ * run.** That version released the queue the moment the rule was written, so the confirmation that
352
+ * follows ran outside it — and a review found two ways that breaks. A liveness tick landing between
353
+ * a device joining the offline set and its confirmation declared that device's enforcement lost,
354
+ * rewrote the rule without it, took layers 2 and 3 down, and told every session; the confirmation
355
+ * then came back, compared against a set the tick had already edited, agreed with itself, and put
356
+ * layers 2 and 3 **back on** over a kernel rule that no longer named the device. Two toggles of the
357
+ * same device overlapping produced the mirror image: a fully healthy-looking offline control with
358
+ * layer 2 taken down under it. Both end in the state this class exists to prevent — the app told it
359
+ * is offline while its requests succeed — so the boundary has to contain the confirmation, and
360
+ * every reader and writer of `offline` has to be inside it.
361
+ *
362
+ * The timeout covers a host that never returns. It waits on `OSSystemExtensionRequest`, and one of
363
+ * its outcomes is a System Settings dialog nobody is standing in front of; the binary now exits
364
+ * itself on that path, but a timeout here is what keeps a wedge from taking the queue with it —
365
+ * everything after it is waiting on this chain.
366
+ */
367
+ private serialize;
368
+ /**
369
+ * The container app writes the rule and exits.
370
+ *
371
+ * **Its exit is not the confirmation.** Zero means the container app launched and the framework
372
+ * accepted the save — the whole run is 27ms, measured — and the running provider is handed the new
373
+ * configuration afterwards, with nothing coming back to say it has it. So this answers "nothing
374
+ * refused"; whether the device is actually offline is answered by `state()`, from evidence the
375
+ * dylib wrote inside the simulator.
376
+ */
377
+ /**
378
+ * **Names the devices it is changing, and nothing else.**
379
+ *
380
+ * This used to write `[...this.offline]` — the whole set — and the host replaced the rule with it.
381
+ * The rule is host-wide, so that made every run an assertion about devices this agent had never
382
+ * heard of: a second agent starting knows of no offline device, and `arm()` runs on every device
383
+ * boot, so **starting one put every device the other had taken offline back online**, silently,
384
+ * while its tester watched an offline control over working traffic.
385
+ *
386
+ * A delta cannot say anything about a device it does not name. The cleanup the whole-set write used
387
+ * to provide is not lost, only made precise: `armLocked` names the udid that just booted in
388
+ * `remove`, and a rule left behind by a dead process is cleared the next time that device comes up
389
+ * rather than by wiping the host's.
390
+ */
391
+ private runFilterHost;
392
+ private conditionPath;
393
+ private setCondition;
394
+ /**
395
+ * `missing`, `failed` and `unreadable` are three different answers and a tester needs all of them.
396
+ *
397
+ * Missing is not by itself an answer — it is the same file being absent whether the injection was
398
+ * never delivered or is simply waiting for its first app, which is why `state` reads it against
399
+ * `armed` rather than reporting it directly. Failed means the dylib ran and proved by trying that
400
+ * its hooks did not take, which no amount of relaunching will change.
401
+ *
402
+ * Unreadable is neither, and folding it into `failed` was this reader claiming evidence it does not
403
+ * have: a file this reader cannot parse says nothing about whether the hooks took. **The library
404
+ * now writes it with `rename` and no longer produces torn ones (#653)**, which removes the cause
405
+ * that was reachable on a healthy session — not the member. A simulator still running an app that
406
+ * was launched by an older dylib writes the old way, and a file whose shape this reader does not
407
+ * recognise is unreadable however it got there. Unlike the other two it is **not** resolved against
408
+ * `armed` — see `state` for why that would be worse than the problem.
409
+ */
410
+ private verdictPath;
411
+ private readVerdict;
412
+ }
413
+ export {};
414
+ //# sourceMappingURL=SimulatorNetwork.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SimulatorNetwork.d.ts","sourceRoot":"","sources":["../src/SimulatorNetwork.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAqBhE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,uBAAuB;IACtC;yEACqE;IACrE,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;0FACsF;IACtF,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wDAAwD;IACxD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;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