@intentic/machine 1.317.0 → 1.318.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.
Files changed (90) hide show
  1. package/README.md +134 -7
  2. package/dist/device/grant.d.ts +38 -0
  3. package/dist/device/grant.d.ts.map +1 -1
  4. package/dist/device/loopback-catch.d.ts +3 -0
  5. package/dist/device/loopback-catch.d.ts.map +1 -0
  6. package/dist/device/loopback-catch.js +103 -0
  7. package/dist/device/loopback-catch.js.map +1 -0
  8. package/dist/device/router.d.ts +38 -0
  9. package/dist/device/router.d.ts.map +1 -1
  10. package/dist/device/router.js +3 -1
  11. package/dist/device/router.js.map +1 -1
  12. package/dist/device/sandbox-rounds/ic-rounds.js +3 -3
  13. package/dist/device/sandbox-rounds/ic-rounds.js.map +1 -1
  14. package/dist/device/tools/agent.d.ts +2 -2
  15. package/dist/device/tools/agent.d.ts.map +1 -1
  16. package/dist/device/tools/agent.js +1 -3
  17. package/dist/device/tools/agent.js.map +1 -1
  18. package/dist/device/tools/describe.d.ts +1 -1
  19. package/dist/device/tools/describe.d.ts.map +1 -1
  20. package/dist/device/tools/describe.js +2 -1
  21. package/dist/device/tools/describe.js.map +1 -1
  22. package/dist/device/tools/in-flight.d.ts +6 -0
  23. package/dist/device/tools/in-flight.d.ts.map +1 -0
  24. package/dist/device/tools/in-flight.js +26 -0
  25. package/dist/device/tools/in-flight.js.map +1 -0
  26. package/dist/device/tools/sandboxes.d.ts +6 -2
  27. package/dist/device/tools/sandboxes.d.ts.map +1 -1
  28. package/dist/device/tools/sandboxes.js +26 -13
  29. package/dist/device/tools/sandboxes.js.map +1 -1
  30. package/dist/status.d.ts.map +1 -1
  31. package/dist/status.js +9 -4
  32. package/dist/status.js.map +1 -1
  33. package/dist/sync/commands.d.ts +18 -0
  34. package/dist/sync/commands.d.ts.map +1 -1
  35. package/dist/sync/commands.js +88 -17
  36. package/dist/sync/commands.js.map +1 -1
  37. package/dist/sync/config.d.ts +10 -1
  38. package/dist/sync/config.d.ts.map +1 -1
  39. package/dist/sync/config.js +42 -1
  40. package/dist/sync/config.js.map +1 -1
  41. package/dist/sync/folders.d.ts +8 -0
  42. package/dist/sync/folders.d.ts.map +1 -0
  43. package/dist/sync/folders.js +34 -0
  44. package/dist/sync/folders.js.map +1 -0
  45. package/dist/sync/git-bridge.d.ts +1 -1
  46. package/dist/sync/git-bridge.d.ts.map +1 -1
  47. package/dist/sync/git-bridge.js +2 -1
  48. package/dist/sync/git-bridge.js.map +1 -1
  49. package/dist/sync/mirror.d.ts.map +1 -1
  50. package/dist/sync/mirror.js +3 -3
  51. package/dist/sync/mirror.js.map +1 -1
  52. package/dist/sync/mutagen.d.ts +16 -3
  53. package/dist/sync/mutagen.d.ts.map +1 -1
  54. package/dist/sync/mutagen.js +40 -22
  55. package/dist/sync/mutagen.js.map +1 -1
  56. package/dist/sync/project-commands.d.ts +23 -0
  57. package/dist/sync/project-commands.d.ts.map +1 -0
  58. package/dist/sync/project-commands.js +212 -0
  59. package/dist/sync/project-commands.js.map +1 -0
  60. package/dist/sync/project-files.d.ts +42 -0
  61. package/dist/sync/project-files.d.ts.map +1 -0
  62. package/dist/sync/project-files.js +110 -0
  63. package/dist/sync/project-files.js.map +1 -0
  64. package/dist/sync/project-local.d.ts +46 -0
  65. package/dist/sync/project-local.d.ts.map +1 -0
  66. package/dist/sync/project-local.js +217 -0
  67. package/dist/sync/project-local.js.map +1 -0
  68. package/dist/sync/project-remote.d.ts +55 -0
  69. package/dist/sync/project-remote.d.ts.map +1 -0
  70. package/dist/sync/project-remote.js +261 -0
  71. package/dist/sync/project-remote.js.map +1 -0
  72. package/dist/sync/project-transfer.d.ts +52 -0
  73. package/dist/sync/project-transfer.d.ts.map +1 -0
  74. package/dist/sync/project-transfer.js +278 -0
  75. package/dist/sync/project-transfer.js.map +1 -0
  76. package/dist/sync/report.d.ts.map +1 -1
  77. package/dist/sync/report.js +6 -4
  78. package/dist/sync/report.js.map +1 -1
  79. package/dist/sync/residue.d.ts.map +1 -1
  80. package/dist/sync/residue.js +2 -1
  81. package/dist/sync/residue.js.map +1 -1
  82. package/dist/sync/restore-points.d.ts +72 -0
  83. package/dist/sync/restore-points.d.ts.map +1 -0
  84. package/dist/sync/restore-points.js +154 -0
  85. package/dist/sync/restore-points.js.map +1 -0
  86. package/dist/sync/ssh.d.ts +3 -0
  87. package/dist/sync/ssh.d.ts.map +1 -1
  88. package/dist/sync/ssh.js +13 -4
  89. package/dist/sync/ssh.js.map +1 -1
  90. package/package.json +8 -8
package/README.md CHANGED
@@ -33,14 +33,25 @@ flowchart LR
33
33
  A fetch that fails is logged with its reason and reported in the device's facts (`icOutOfDate`, beside `features`),
34
34
  so a stale `ic` explains why logs and saving a shape are missing; the next sandbox action tries again.
35
35
  - **sync** (`src/sync/`): `sync setup` enrolls an SSH key and runs Mutagen against the sandbox's sshd, reached
36
- through a loopback port tunnelled over a WebSocket. It keeps a folder two-way synced, forwards every workspace
37
- port to the same localhost port, and fast-forwards local git clones from the sandbox.
36
+ through a loopback port tunnelled over a WebSocket. It keeps a folder two-way synced (a project copy-first, below),
37
+ forwards every workspace port to the same localhost port, and fast-forwards local git clones from the sandbox.
38
+ - A **project pairing** (`sync setup --remote-dir /work/<name> --project`, what the desktop app asks for when it
39
+ makes a sandbox for a folder the owner picked) syncs that folder with `/work/<name>` rather than `/work`, and nothing
40
+ of the sandbox's is written into it: no state backup session, no git bridge, and an ignore list that keeps a
41
+ project's own `.intentic/` and `refs/` ([`sync/config.ts`](src/sync/config.ts) holds a remote dir to those two
42
+ shapes, and refuses `sync.json` whole otherwise). `setup` refuses a folder that is, holds or sits inside another
43
+ sandbox's, and a set-up-again that would change where a paired sandbox's folder syncs. It is **copy-first** unless
44
+ its owner opted into two-way: see [Copy-first projects](#copy-first-projects).
38
45
  - Only the resident agent creates Mutagen sessions: `setup` records the pairing and waits for the session to
39
46
  appear, since two creators racing left one name holding two identical sessions. The agent keeps one session per
40
- name, terminating any extras, and recreates a session whose rules drifted once there are no conflicts left.
47
+ name, terminating any extras, and recreates a session whose rules drifted (its ignores, its folders, its sync mode,
48
+ its symlink mode). A two-way session replaced by another waits until no conflicts are left and has its derived
49
+ residue swept first; every other replacement happens as soon as the sandbox answers (`settlesFirst` in
50
+ [`sync/mutagen.ts`](src/sync/mutagen.ts) says why for each).
41
51
  - `setup` replaces what this agent's `known_hosts` holds for the pairing's alias (hashed entries included): with the
42
- host key the enrollment carries when it carries one, else with nothing, so `accept-new` records the key the sandbox
43
- presents now. Outside an enrollment a changed key is still refused. A sandbox whose ports poll has failed for ten
52
+ host key the enrollment carries when it carries one (a sandbox reads its sshd's public key off its history volume and
53
+ answers with it, `SyncEnrollmentAnswerSchema` in the contract), else with nothing, so `accept-new` records the key
54
+ the sandbox presents now, as it does for an older sandbox. Outside an enrollment a changed key is still refused. A sandbox whose ports poll has failed for ten
44
55
  minutes has its forwards taken off localhost, and they come back with its first answer. `sync uninstall` stops and
45
56
  unregisters Mutagen's daemon only when it is this agent's own copy, never a Mutagen the user installed.
46
57
  - Symbolic links travel only where the device can create them ([`sync/symlinks.ts`](src/sync/symlinks.ts)). A
@@ -63,14 +74,130 @@ flowchart LR
63
74
  - Scopes are enforced here and nowhere else: the sandbox only asks, and a refusal names the switch that is off.
64
75
  Files stay inside the configured roots, writes need their own switch, and every call is appended to
65
76
  `~/.intentic/machine/audit.jsonl`. While an agent drives input on Windows, a notice shows on screen and
66
- `PAUSE_HOTKEY` pauses every link.
67
- - Every connection dials out; the only listeners are on loopback.
77
+ `PAUSE_HOTKEY` pauses every link. The one door behind no switch is this agent's own Update and Restart
78
+ (`runAgentFlow`, [`device/tools/agent.ts`](src/device/tools/agent.ts)): no agent tool reaches it, and the sandbox
79
+ admits only a maintainer to it, so the owner's maintenance does not wait on the agents' "Run commands" (2026-09-29;
80
+ it rode that switch before, and an owner had to widen what agents may do to update the agent).
81
+ - Every connection dials out; the only listeners are on loopback. One of them is short-lived: while a sandbox's
82
+ sign-in is open, [`device/loopback-catch.ts`](src/device/loopback-catch.ts) listens on the
83
+ `http://localhost:<port>/…` address the provider redirects to, the one a CLI running here would have held, and
84
+ streams each landing back (`catchLoopback`, advertised as the `loopback-catch` feature). It checks nothing: the state
85
+ and the PKCE verifier stay in the sandbox, which alone can tell the sign-in from anything else that hits the port. A
86
+ taken port answers `busy`, and the sandbox leaves the paste to the person.
68
87
  - On Windows the Windows side is the root of the PC (`src/environments/`): it holds one `wsl.exe` session per
69
88
  distro with an agent, and `upgrade` brings every environment to the same release. The root also updates itself
70
89
  on a timer and pre-downloads sandbox updates with `ic sandbox prepare --auto`.
71
90
  - The install shims only put a first binary down and run `setup`; `install.ts` decides the rest. `status --json`
72
91
  is what the desktop app's tray reads.
73
92
 
93
+ ### Copy-first projects
94
+
95
+ A project's folder flows **one way**, this device to the sandbox, so nothing an agent does in `/work/<name>` (an
96
+ `rm -rf` included) reaches the owner's files. What an agent changed comes back only when the owner asks, through
97
+ `sync bring-back`, which keeps a restore point first. Two-way stays one switch away.
98
+
99
+ - **Direction** is the pairing's `direction` in `sync.json`: `"to-sandbox"` (Mutagen's `one-way-safe`, this device as
100
+ alpha) or `"both"` (`two-way-safe`, as every workspace pairing). Absent, as on every project paired before it existed,
101
+ means `"to-sandbox"`, and so does a value this build has no word for; it means nothing on a workspace pairing
102
+ ([`sync/config.ts`](src/sync/config.ts) `projectDirection`). An older agent keeps the field through every write but a
103
+ `setup` (which resets it, with the pairing's other switches), and keeps the copy-first session it finds, since it never
104
+ compared sync modes. `sync direction` rewrites the field; the watcher sees the new mode on its next tick and recreates
105
+ the session (`sessionMatchesSpec` compares the live session's `mode`).
106
+ - **Replacements** into copy-first happen at once, conflicts or not, with no flush and no residue sweep: a last flush
107
+ of a two-way session would carry the sandbox's latest changes into the folder, and the new session never writes here.
108
+ Out of copy-first too: a one-way session's conflicts are the agent's kept edits, which differ whoever holds them. This
109
+ is how every existing project becomes copy-first on its first start of this build.
110
+
111
+ **What one-way-safe does**, measured with Mutagen 0.18.1 over ssh against an sshd whose `/work` was a scratch folder,
112
+ driving this agent's own session code and CLI (alpha is this device, beta the sandbox):
113
+
114
+ | The sandbox (an agent)… | Mutagen one-way-safe |
115
+ |---|---|
116
+ | edits a file this folder has | keeps the sandbox's version and reports it as a conflict; this folder is untouched |
117
+ | creates a file | keeps it in the sandbox, no conflict; nothing reaches this folder |
118
+ | deletes a file or a folder | puts it back from this folder on the next cycle |
119
+ | runs `rm -rf /work/<name>/*`, or removes `/work/<name>` | refills the sandbox's copy from this folder; this folder is untouched |
120
+
121
+ | This device… | Mutagen one-way-safe |
122
+ |---|---|
123
+ | edits, creates or deletes a file | carries it to the sandbox, except over a file the sandbox changed, which is kept |
124
+ | deletes a file the sandbox changed | the sandbox keeps its version, and the conflict clears |
125
+
126
+ A fresh session over two copies that already differ (what any replacement starts from) deletes nothing on either side.
127
+ One-way-safe copies what only this folder has into the sandbox and keeps every sandbox file that differs, as a conflict.
128
+ Two-way-safe also copies what only the sandbox has into this folder, and reports what differs on both as a conflict.
129
+ `mutagen sync list --template '{{json .}}'` prints the mode as a top-level `mode`, absent on a session created without
130
+ `--sync-mode`, which Mutagen runs two-way-safe.
131
+
132
+ **The commands**, all under `intentic-machine sync`, name the project by `--dir <its folder>` (links resolved, case
133
+ folded where the platform folds it). With `--json` each prints exactly one JSON object on stdout, and on failure
134
+ `{ "ok": false, "error": "<sentence>" }` with exit code 1. The desktop app parses these, so fields are only ever added.
135
+
136
+ | Command | Success output |
137
+ |---|---|
138
+ | `sync changes` | `{ "ok": true, "pairing": "<id>", "direction": "to-sandbox"\|"both", "changes": [{ "path", "kind": "added"\|"modified"\|"deleted", "size"?, "conflict"?: true }], "truncated"?: true }` |
139
+ | `sync bring-back [--path <p>]... [--paths-file <file>]` | `{ "ok": true, "point": "<id>", "applied": [{ "path", "kind" }], "skipped": [{ "path", "reason" }] }` |
140
+ | `sync restore-points` | `{ "ok": true, "points": [{ "id", "createdAt", "entries": n }] }` |
141
+ | `sync restore --point <id>` | `{ "ok": true, "restored": n, "skipped": [{ "path", "reason" }] }` |
142
+ | `sync direction <to-sandbox\|both>` | `{ "ok": true, "direction": "…" }` |
143
+
144
+ - **`sync changes`** lists what the sandbox did, relative paths with `/`, sorted, the first 5,000 (`truncated` when
145
+ there were more): `added` exists only in the sandbox's copy, `modified` on both with different content (`size` is the
146
+ sandbox copy's), `deleted` was removed there. The sandbox is listed by ONE command over the pairing's ssh alias, a
147
+ node program that walks `/work/<name>` and prints path, size and sha256 NUL-separated, so any name survives. This
148
+ device is walked the same way, reading a file only where its size matches the sandbox's, through a hash cache keyed
149
+ by path, size and times in `~/.intentic/machine/hashes/<pairing>.json`. Both walks prune by the pairing's ignore list
150
+ read as Mutagen reads it: a name, `*` within it, at any depth (or at the root with a leading `/`), taking a matched
151
+ folder's contents along; any other spelling is refused rather than approximated. Mutagen's `.mutagen-temporary-*`
152
+ scratch files are left out too, and so are links and anything else that is not a regular file, on either side.
153
+ - **Whose change it is, and never over a newer edit.** The same cache file records each path's content when both
154
+ copies were last seen equal. A difference the sandbox did not move away from (an edit made here, still on its way) is
155
+ not listed at all. A file only this device holds is offered as `deleted` only when that record shows the sandbox had
156
+ exactly this copy. A `modified` file is written over here only when this device's copy is still what the two last
157
+ agreed on, which only a session that was running and whose flush just finished a whole cycle can show. Mutagen's own
158
+ record says so for the files it reports in conflict (ten at most, each with SHA-1 digests of what the two last agreed
159
+ on and of this device's copy, the latter checked against the file here now); the listing record says so for the rest.
160
+ Anything else is listed with `conflict: true` and skipped by bring-back with its reason, even when named by `--path`:
161
+ both copies moved (a record gone stale while the sync was paused, say, with the owner's own older version in the
162
+ sandbox), no record of the two ever agreeing on it, or a session that was paused, absent, or whose flush did not
163
+ finish. Since one-way-safe puts an agent's deletions back, `deleted` shows up mainly while the session is paused, and
164
+ a rename in the sandbox comes back as an addition (the old name is put back there). The record is written only by
165
+ whoever holds the folder's lock, so a listing beside a running bring-back never undoes what that one recorded.
166
+ - **`sync bring-back`** runs with the session paused (after a flush) if it was running, and leaves one somebody paused
167
+ as it is. It lists both sides and fetches the `added` and `modified` files in ONE ssh stream into a private staging
168
+ folder, each checked against the listing's sha256 (a file that changed since is skipped with the reason). Then it
169
+ writes the restore point, and only then touches the folder: each file renamed into place from a copy beside it, only
170
+ where the folder still holds what the point kept of it. `deleted` files are removed with the folders they leave
171
+ empty. `--path` takes a file or a folder, repeatable; `--paths-file` names a UTF-8 file holding a JSON array of such
172
+ paths (a Windows command line holds 32,767 characters, fewer than a long selection), taken together with any
173
+ `--path`. An unreadable file, one that is not such an array, or an empty one (which would otherwise mean every change)
174
+ is refused before anything is listed. A new file gets the sandbox copy's executable bit. Nothing is written through a
175
+ link: every folder on the way is checked.
176
+ - **Why the session pushes nothing stale back.** Paused, it runs no cycle between the listing, the fetch and the writes,
177
+ and on resume it rescans both sides. What was written here is byte for byte the sandbox's, so both sides moved from
178
+ their last agreement to the same content: Mutagen records that and transfers nothing. A sandbox file that changed
179
+ again meanwhile is a sandbox modification one-way-safe keeps, as a conflict. The e2e run checked all of it: no
180
+ conflicts after resume, the sandbox still holding the agent's content, and a later edit here carried over as usual.
181
+ - **Restore points** live in `~/.intentic/machine/restore/<pairing>/<id>/`, the id being the creation time in ISO 8601
182
+ basic format (`20260928T213000.123Z`, a folder name on every system). Each holds `manifest.json`, which is
183
+ `{ id, createdAt, dir, entries: [{ path, kind, backedUp, applied, backup?, mode? }] }` (`applied` is the sha256
184
+ bring-back left, null for a deletion), and `files/<path>`, a copy of every file bring-back overwrote or deleted. Only
185
+ what was actually written stays in the manifest. All of it is on the disk before the first write here: each copy is
186
+ flushed as it is made, the manifest by a durable write, then every folder of the point up to `restore/<pairing>`, so a
187
+ crash right after a bring-back never finds the folder rewritten and the copies empty. Files put in the folder are
188
+ flushed before the rename that places them.
189
+ - **Retention**, after each bring-back and under its lock: a pairing keeps its newest 20 points that hold files, plus
190
+ every such point younger than 30 days. A point that holds nothing (a bring-back that wrote nothing, or one cut off
191
+ before its manifest) never counts toward the 20, is never listed, and goes at the next bring-back. Until then it is
192
+ the `point` that bring-back answered with, so that answer always names a real point, as the desktop app expects.
193
+ - **`sync restore --point <id>`** puts each backed-up file back and removes each file bring-back added, where the
194
+ folder still holds exactly what bring-back left (by sha256). Anything else is skipped and reported, one already put
195
+ back included. Copy-first then carries the restored files to the sandbox, as it does any edit here, so the agent's
196
+ versions they replace are gone from there too.
197
+ - One bring-back or restore runs per folder at a time (`restore/<pairing>/.operation.pid`, a pid of this boot, checked
198
+ alive). A pause an operation made and never lifted (the process killed in between) is recorded in
199
+ `restore/<pairing>/.paused`, and the next command about that folder resumes the session.
200
+
74
201
  ### Upgrades that can be undone
75
202
 
76
203
  - **A swap is never cut short by this agent.** `ic` runs in a process group of its own on POSIX, keeps its pipes, and
@@ -73,6 +73,7 @@ export declare const tolerantDeviceContract: {
73
73
  sync: "sync";
74
74
  }>;
75
75
  localDir: z.ZodOptional<z.ZodString>;
76
+ remoteDir: z.ZodOptional<z.ZodString>;
76
77
  mirroring: z.ZodOptional<z.ZodEnum<{
77
78
  off: "off";
78
79
  on: "on";
@@ -242,6 +243,43 @@ export declare const tolerantDeviceContract: {
242
243
  message: z.ZodString;
243
244
  }, z.core.$strip>], "kind">;
244
245
  }, Record<never, never>, Record<never, never>>;
246
+ catchLoopback: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
247
+ id: z.ZodString;
248
+ host: z.ZodEnum<{
249
+ "127.0.0.1": "127.0.0.1";
250
+ localhost: "localhost";
251
+ }>;
252
+ port: z.ZodNumber;
253
+ path: z.ZodString;
254
+ expiresAt: z.ZodNumber;
255
+ title: z.ZodString;
256
+ }, z.core.$strict>, import("@orpc/contract").Schema<AsyncIteratorObject<{
257
+ type: "listening";
258
+ } | {
259
+ type: "busy";
260
+ reason: string;
261
+ } | {
262
+ type: "landed";
263
+ url: string;
264
+ }, unknown, void>, import("@orpc/contract").AsyncIteratorClass<{
265
+ type: "listening";
266
+ } | {
267
+ type: "busy";
268
+ reason: string;
269
+ } | {
270
+ type: "landed";
271
+ url: string;
272
+ }, unknown, void>> & {
273
+ [x: symbol]: z.ZodDiscriminatedUnion<[z.ZodObject<{
274
+ type: z.ZodLiteral<"listening">;
275
+ }, z.core.$strip>, z.ZodObject<{
276
+ type: z.ZodLiteral<"busy">;
277
+ reason: z.ZodString;
278
+ }, z.core.$strip>, z.ZodObject<{
279
+ type: z.ZodLiteral<"landed">;
280
+ url: z.ZodString;
281
+ }, z.core.$strip>], "type">;
282
+ }, Record<never, never>, Record<never, never>>;
245
283
  setScopes: {
246
284
  "~orpc": {
247
285
  meta: Record<never, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"grant.d.ts","sourceRoot":"","sources":["../../src/device/grant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAkB,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAyE,CAAC;AACvG,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAM1D,MAAM,WAAW,KAAK;IAClB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED,eAAO,MAAM,SAAS,UAAW,UAAU,KAAG,KAK5C,CAAC;AAIH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGlC,CAAC"}
1
+ {"version":3,"file":"grant.d.ts","sourceRoot":"","sources":["../../src/device/grant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAkB,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAyE,CAAC;AACvG,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAM1D,MAAM,WAAW,KAAK;IAClB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED,eAAO,MAAM,SAAS,UAAW,UAAU,KAAG,KAK5C,CAAC;AAIH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGlC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { LoopbackCatch, LoopbackCatchEvent } from "@intentic/sandbox-contract";
2
+ export declare function catchLoopback(spec: LoopbackCatch, signal: AbortSignal | undefined, log: (message: string) => void): AsyncGenerator<LoopbackCatchEvent>;
3
+ //# sourceMappingURL=loopback-catch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loopback-catch.d.ts","sourceRoot":"","sources":["../../src/device/loopback-catch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AA6EpF,wBAAuB,aAAa,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,cAAc,CAAC,kBAAkB,CAAC,CAqD7J"}
@@ -0,0 +1,103 @@
1
+ import { createServer } from "node:http";
2
+ const LONGEST_WATCH_MS = 30 * 60_000;
3
+ const escapeHtml = (text) => text.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&#39;");
4
+ const landedPage = (title) => `<!doctype html>
5
+ <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <title>Signed in to ${escapeHtml(title)}</title>
7
+ <style>body{font:16px/1.5 system-ui,sans-serif;margin:0;min-height:100vh;display:grid;place-items:center;background:#0f1115;color:#e6e6e6}main{max-width:28rem;padding:2rem;text-align:center}h1{font-size:1.25rem;margin:0 0 .5rem}p{margin:0;color:#a0a4ab}</style>
8
+ </head><body><main><h1>Signed in to ${escapeHtml(title)}</h1><p>Intentic is finishing the connection. You can close this tab and go back to it.</p></main></body></html>`;
9
+ const listen = (server, port, address) => new Promise((resolve) => {
10
+ const onError = (error) => resolve({ ok: false, code: error.code, message: error.message });
11
+ server.once("error", onError);
12
+ server.listen({ port, host: address, exclusive: true }, () => {
13
+ server.off("error", onError);
14
+ resolve({ ok: true });
15
+ });
16
+ });
17
+ const bind = async (spec, onRequest) => {
18
+ const addresses = spec.host === "localhost" ? ["127.0.0.1", "::1"] : ["127.0.0.1"];
19
+ const servers = [];
20
+ const sockets = new Set();
21
+ const close = async () => {
22
+ for (const socket of sockets) {
23
+ socket.destroy();
24
+ }
25
+ await Promise.all(servers.map((server) => new Promise((resolve) => server.close(() => resolve()))));
26
+ };
27
+ for (const [index, address] of addresses.entries()) {
28
+ const server = createServer(onRequest);
29
+ server.on("connection", (socket) => {
30
+ sockets.add(socket);
31
+ socket.on("close", () => sockets.delete(socket));
32
+ });
33
+ const bound = await listen(server, spec.port, address);
34
+ if (bound.ok) {
35
+ servers.push(server);
36
+ continue;
37
+ }
38
+ if (index === 0) {
39
+ await close();
40
+ return {
41
+ ok: false,
42
+ reason: bound.code === "EADDRINUSE" ? `port ${spec.port} is already taken on this machine` : `could not listen on ${address}:${spec.port}: ${bound.message}`,
43
+ };
44
+ }
45
+ }
46
+ return { ok: true, close };
47
+ };
48
+ const landingUrl = (spec, request) => new URL(request.url ?? "/", `http://${spec.host}:${spec.port}`);
49
+ export async function* catchLoopback(spec, signal, log) {
50
+ const queue = [];
51
+ let wake;
52
+ let over = false;
53
+ const nudge = () => {
54
+ const resume = wake;
55
+ wake = undefined;
56
+ resume?.();
57
+ };
58
+ const end = () => {
59
+ over = true;
60
+ nudge();
61
+ };
62
+ const bound = await bind(spec, (request, response) => {
63
+ const url = landingUrl(spec, request);
64
+ if (request.method !== "GET" || url.pathname !== spec.path) {
65
+ response.writeHead(404, { "content-type": "text/plain; charset=utf-8" }).end("Not found");
66
+ return;
67
+ }
68
+ queue.push({ type: "landed", url: url.toString() });
69
+ nudge();
70
+ response
71
+ .writeHead(200, { "content-type": "text/html; charset=utf-8", "cache-control": "no-store", "referrer-policy": "no-referrer" })
72
+ .end(landedPage(spec.title));
73
+ });
74
+ if (!bound.ok) {
75
+ log(`could not watch for the ${spec.title} sign-in: ${bound.reason}`);
76
+ yield { type: "busy", reason: bound.reason };
77
+ return;
78
+ }
79
+ log(`watching ${spec.host}:${spec.port}${spec.path} for the ${spec.title} sign-in`);
80
+ const deadline = setTimeout(end, Math.max(0, Math.min(spec.expiresAt - Date.now(), LONGEST_WATCH_MS)));
81
+ signal?.addEventListener("abort", end, { once: true });
82
+ try {
83
+ yield { type: "listening" };
84
+ for (;;) {
85
+ const next = queue.shift();
86
+ if (next !== undefined) {
87
+ yield next;
88
+ continue;
89
+ }
90
+ if (over || signal?.aborted === true) {
91
+ break;
92
+ }
93
+ await new Promise((resolve) => (wake = resolve));
94
+ }
95
+ }
96
+ finally {
97
+ clearTimeout(deadline);
98
+ signal?.removeEventListener("abort", end);
99
+ await bound.close();
100
+ log(`stopped watching ${spec.host}:${spec.port} for the ${spec.title} sign-in`);
101
+ }
102
+ }
103
+ //# sourceMappingURL=loopback-catch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loopback-catch.js","sourceRoot":"","sources":["../../src/device/loopback-catch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA0D,MAAM,WAAW,CAAC;AAWjG,MAAM,gBAAgB,GAAG,EAAE,GAAG,MAAM,CAAC;AAErC,MAAM,UAAU,GAAG,CAAC,IAAY,EAAU,EAAE,CACxC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAGrI,MAAM,UAAU,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC;;sBAExB,UAAU,CAAC,KAAK,CAAC;;sCAED,UAAU,CAAC,KAAK,CAAC,kHAAkH,CAAC;AAI1K,MAAM,MAAM,GAAG,CAAC,MAAc,EAAE,IAAY,EAAE,OAAe,EAAoF,EAAE,CAC/I,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;IACpB,MAAM,OAAO,GAAG,CAAC,KAA4B,EAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACzH,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9B,MAAM,CAAC,MAA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AAU,CAAC,CAAC;IACpF,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACvG,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,IAAI,CAAC;QACD,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;QAC5B,SAAS,CAAC;YACN,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;YAC3B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACrB,MAAM,IAAI,CAAC;gBACX,SAAS;YACb,CAAC;YACD,IAAI,IAAI,IAAI,MAAM,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;gBACnC,MAAM;YACV,CAAC;YACD,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC;QAC3D,CAAC;IACL,CAAC;YAAS,CAAC;QACP,YAAY,CAAC,QAAQ,CAAC,CAAC;QACvB,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC1C,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QACpB,GAAG,CAAC,oBAAoB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,YAAY,IAAI,CAAC,KAAK,UAAU,CAAC,CAAC;IACpF,CAAC;AACL,CAAC"}
@@ -44,6 +44,7 @@ export declare const createHostRouter: (runtime: HostRuntime) => {
44
44
  sync: "sync";
45
45
  }>;
46
46
  localDir: import("zod").ZodOptional<import("zod").ZodString>;
47
+ remoteDir: import("zod").ZodOptional<import("zod").ZodString>;
47
48
  mirroring: import("zod").ZodOptional<import("zod").ZodEnum<{
48
49
  off: "off";
49
50
  on: "on";
@@ -243,5 +244,42 @@ export declare const createHostRouter: (runtime: HostRuntime) => {
243
244
  message: import("zod").ZodString;
244
245
  }, import("zod/v4/core").$strip>], "kind">;
245
246
  }, import("@orpc/server").MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
247
+ catchLoopback: import("@orpc/server").Procedure<import("@orpc/server").MergedInitialContext<Record<never, never>, Record<never, never>, Record<never, never>>, Record<never, never>, import("zod").ZodObject<{
248
+ id: import("zod").ZodString;
249
+ host: import("zod").ZodEnum<{
250
+ "127.0.0.1": "127.0.0.1";
251
+ localhost: "localhost";
252
+ }>;
253
+ port: import("zod").ZodNumber;
254
+ path: import("zod").ZodString;
255
+ expiresAt: import("zod").ZodNumber;
256
+ title: import("zod").ZodString;
257
+ }, import("zod/v4/core").$strict>, import("@orpc/server").Schema<AsyncIteratorObject<{
258
+ type: "listening";
259
+ } | {
260
+ type: "busy";
261
+ reason: string;
262
+ } | {
263
+ type: "landed";
264
+ url: string;
265
+ }, unknown, void>, import("@orpc/server").AsyncIteratorClass<{
266
+ type: "listening";
267
+ } | {
268
+ type: "busy";
269
+ reason: string;
270
+ } | {
271
+ type: "landed";
272
+ url: string;
273
+ }, unknown, void>> & {
274
+ [x: symbol]: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
275
+ type: import("zod").ZodLiteral<"listening">;
276
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
277
+ type: import("zod").ZodLiteral<"busy">;
278
+ reason: import("zod").ZodString;
279
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
280
+ type: import("zod").ZodLiteral<"landed">;
281
+ url: import("zod").ZodString;
282
+ }, import("zod/v4/core").$strip>], "type">;
283
+ }, import("@orpc/server").MergedErrorMap<Record<never, never>, Record<never, never>>, Record<never, never>>;
246
284
  };
247
285
  //# sourceMappingURL=router.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDpD,CAAC"}
@@ -2,6 +2,7 @@ import { narrate } from "@intentic/base/async";
2
2
  import { implement, ORPCError } from "@orpc/server";
3
3
  import { readGrant, tolerantDeviceContract } from "./grant.js";
4
4
  import { calling } from "./indicator.js";
5
+ import { catchLoopback } from "./loopback-catch.js";
5
6
  import { handleMcpMessage } from "./mcp.js";
6
7
  import { hostFacts } from "./tools/describe.js";
7
8
  import { machineReport } from "../sync/report.js";
@@ -69,7 +70,8 @@ export const createHostRouter = (runtime) => {
69
70
  ping: os.ping.handler(() => ({ ok: true })),
70
71
  mcp: os.mcp.handler(async ({ input }) => await calling.run(runtime, async () => await handleMcpMessage(input, runtime.scopes()))),
71
72
  runSandboxFlow: os.runSandboxFlow.handler(({ input }) => streamFlow(flowFor(input, runtime.scopes()))),
72
- runAgentFlow: os.runAgentFlow.handler(({ input }) => streamFlow((onLine) => runAgentOp(input.op, runtime.scopes(), onLine))),
73
+ runAgentFlow: os.runAgentFlow.handler(({ input }) => streamFlow((onLine) => runAgentOp(input.op, onLine))),
74
+ catchLoopback: os.catchLoopback.handler(({ input, signal }) => catchLoopback(input, signal, (message) => runtime.log(`${runtime.sandboxUrl}: ${message}`))),
73
75
  });
74
76
  };
75
77
  //# sourceMappingURL=router.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/device/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,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@@ -1,12 +1,12 @@
1
1
  import { errorMessage } from "@intentic/base/errors";
2
2
  import { plural } from "@intentic/base/format";
3
- import { icInFlight } from "../tools/sandboxes.js";
3
+ import { holdIcFlow, icInFlight } from "../tools/sandboxes.js";
4
4
  const MAX_SKIP_TICKS = 8;
5
5
  export const ticksToSkip = (failures) => (failures <= 0 ? 0 : Math.min(2 ** (failures - 1), MAX_SKIP_TICKS));
6
6
  export const newRoundState = () => ({ failures: new Map(), waits: new Map() });
7
7
  export const lastLine = (output) => output.split(/\r?\n/).findLast((line) => line.trim() !== "");
8
8
  const runOne = async (state, slug, job, log) => {
9
- icInFlight.add(slug);
9
+ const release = holdIcFlow(slug, { moves: false });
10
10
  let run;
11
11
  try {
12
12
  run = await job.run(slug);
@@ -15,7 +15,7 @@ const runOne = async (state, slug, job, log) => {
15
15
  run = { code: 1, output: errorMessage(error) };
16
16
  }
17
17
  finally {
18
- icInFlight.delete(slug);
18
+ release();
19
19
  }
20
20
  if (run.code === 0) {
21
21
  state.failures.delete(slug);
@@ -1 +1 @@
1
- {"version":3,"file":"ic-rounds.js","sourceRoot":"","sources":["../../../src/device/sandbox-rounds/ic-rounds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAQnD,MAAM,cAAc,GAAG,CAAC,CAAC;AAGzB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC;AAS7H,MAAM,CAAC,MAAM,aAAa,GAAG,GAAe,EAAE,CAAC,CAAC,EAAE,Q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E;YACb,OAAO,GAAG,IAAI,CAAC;YACf,YAAY,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC;KACJ,CAAC;AACN,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { DeviceAgentOp, DeviceScopes } from "@intentic/sandbox-contract";
1
+ import type { DeviceAgentOp } from "@intentic/sandbox-contract";
2
2
  export declare const AGENT_VERB: Record<DeviceAgentOp, readonly string[]>;
3
- export declare const runAgentOp: (op: DeviceAgentOp, scopes: DeviceScopes, onLine: (line: string) => void) => Promise<string>;
3
+ export declare const runAgentOp: (op: DeviceAgentOp, onLine: (line: string) => void) => Promise<string>;
4
4
  //# sourceMappingURL=agent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/device/tools/agent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAc9E,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAI/D,CAAC;AAmDF,eAAO,MAAM,UAAU,OAAc,aAAa,UAAU,YAAY,UAAU,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,KAAG,OAAO,CAAC,MAAM,CA0BxH,CAAC"}
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/device/tools/agent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAchE,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAI/D,CAAC;AAmDF,eAAO,MAAM,UAAU,OAAc,aAAa,UAAU,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,KAAG,OAAO,CAAC,MAAM,CAyBlG,CAAC"}
@@ -4,7 +4,6 @@ import { isProcessAlive, spawnDetached } from "@intentic/local-agent";
4
4
  import { agentLogPath } from "../../config.js";
5
5
  import { installedBuild } from "../../installed.js";
6
6
  import { machineLauncher } from "../../supervision.js";
7
- import { assertScope } from "../policy.js";
8
7
  import { CUTOVER_HOLDS_MS } from "../sandbox-rounds/swap-records.js";
9
8
  import { icSwapsInFlight } from "./sandboxes.js";
10
9
  export const AGENT_VERB = {
@@ -41,8 +40,7 @@ const waitOutOwnSwaps = async (onLine) => {
41
40
  onLine(`Waiting for ${[...icSwapsInFlight].join(", ")} to finish first: restarting this agent in the middle of a swap could leave that sandbox down.`);
42
41
  await pollUntil(() => icSwapsInFlight.size === 0, { intervalMs: 1_000, timeoutMs: CUTOVER_HOLDS_MS });
43
42
  };
44
- export const runAgentOp = async (op, scopes, onLine) => {
45
- assertScope(scopes, "shell");
43
+ export const runAgentOp = async (op, onLine) => {
46
44
  if (RESTARTS.has(op)) {
47
45
  await waitOutOwnSwaps(onLine);
48
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/device/tools/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAQjD,MAAM,CAAC,MAAM,UAAU,GAA6C;IAChE,OAAO,EAAE,CAAC,SAAS,CAAC;IACpB,OAAO,EAAE,CAAC,KAAK,CAAC;IAChB,oBAAoB,EAAE,CAAC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,CAAC,CAAC;QACjB,CAAC;QACD,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;YACtB,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,MAAM,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC1C,CAAC,CAAC;IACF,MAAM,SAAS,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAC/E,OAAO,OAAO,CAAC,EAAE,CAAC,CAAC;AACvB,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { DeviceFacts, DeviceScopes } from "@intentic/sandbox-contract";
1
+ import { type DeviceFacts, type DeviceScopes } from "@intentic/sandbox-contract";
2
2
  import { type LinkReading } from "../config.js";
3
3
  export declare const linkFacts: (stamped: Readonly<Record<string, LinkReading>> | undefined) => DeviceFacts["links"];
4
4
  export declare const hostFacts: (scopes: DeviceScopes) => Promise<DeviceFacts>;
@@ -1 +1 @@
1
- {"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../../src/device/tools/describe.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,KAAK,WAAW,EAAiC,MAAM,cAAc,CAAC;AAqD/E,eAAO,MAAM,SAAS,YAAa,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,GAAG,SAAS,KAAG,WAAW,CAAC,OAAO,CAWzG,CAAC;AAEF,eAAO,MAAM,SAAS,WAAkB,YAAY,KAAG,OAAO,CAAC,WAAW,CAgCzE,CAAC;AAoBF,eAAO,MAAM,YAAY,WAAkB,YAAY,KAAG,OAAO,CAAC,MAAM,CAsBvE,CAAC"}
1
+ {"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../../src/device/tools/describe.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiC,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAChH,OAAO,EAAE,KAAK,WAAW,EAAiC,MAAM,cAAc,CAAC;AAqD/E,eAAO,MAAM,SAAS,YAAa,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,GAAG,SAAS,KAAG,WAAW,CAAC,OAAO,CAWzG,CAAC;AAEF,eAAO,MAAM,SAAS,WAAkB,YAAY,KAAG,OAAO,CAAC,WAAW,CAiCzE,CAAC;AAoBF,eAAO,MAAM,YAAY,WAAkB,YAAY,KAAG,OAAO,CAAC,MAAM,CAsBvE,CAAC"}
@@ -2,6 +2,7 @@ import { execFile } from "node:child_process";
2
2
  import { arch, hostname, platform, release, type } from "node:os";
3
3
  import { homeDir } from "@intentic/local-agent";
4
4
  import { promisify } from "node:util";
5
+ import { DEVICE_FEATURE_LOOPBACK_CATCH } from "@intentic/sandbox-contract";
5
6
  import { readLinkStates, unreachableIn } from "../config.js";
6
7
  import { rootsOf, rootsText } from "../policy.js";
7
8
  import { shellFor } from "./shell.js";
@@ -65,7 +66,7 @@ export const hostFacts = async (scopes) => {
65
66
  ...(wsl === undefined ? {} : { wsl }),
66
67
  ...(distros === undefined ? {} : { wslDistros: distros }),
67
68
  ...(links === undefined ? {} : { links }),
68
- features,
69
+ features: [...features, DEVICE_FEATURE_LOOPBACK_CATCH],
69
70
  };
70
71
  if (stale !== undefined) {
71
72
  facts.icOutOfDate = stale;
@@ -1 +1 @@
1
- {"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../src/device/tools/describe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAu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