@intentic/machine 1.304.0 → 1.305.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 (148) hide show
  1. package/README.md +111 -52
  2. package/dist/app.d.ts.map +1 -1
  3. package/dist/app.js +2 -5
  4. package/dist/app.js.map +1 -1
  5. package/dist/commands.d.ts +1 -9
  6. package/dist/commands.d.ts.map +1 -1
  7. package/dist/commands.js +41 -27
  8. package/dist/commands.js.map +1 -1
  9. package/dist/config.d.ts +3 -0
  10. package/dist/config.d.ts.map +1 -1
  11. package/dist/config.js +3 -0
  12. package/dist/config.js.map +1 -1
  13. package/dist/daemon-base.d.ts +4 -3
  14. package/dist/daemon-base.d.ts.map +1 -1
  15. package/dist/daemon-base.js.map +1 -1
  16. package/dist/device/auto-prepare.js +3 -3
  17. package/dist/device/auto-prepare.js.map +1 -1
  18. package/dist/device/commands.d.ts +2 -1
  19. package/dist/device/commands.d.ts.map +1 -1
  20. package/dist/device/commands.js +48 -30
  21. package/dist/device/commands.js.map +1 -1
  22. package/dist/device/config.d.ts +17 -12
  23. package/dist/device/config.d.ts.map +1 -1
  24. package/dist/device/config.js +29 -17
  25. package/dist/device/config.js.map +1 -1
  26. package/dist/device/connection.d.ts +3 -1
  27. package/dist/device/connection.d.ts.map +1 -1
  28. package/dist/device/connection.js +7 -3
  29. package/dist/device/connection.js.map +1 -1
  30. package/dist/device/mcp.js.map +1 -1
  31. package/dist/device/policy.d.ts +4 -4
  32. package/dist/device/policy.d.ts.map +1 -1
  33. package/dist/device/policy.js.map +1 -1
  34. package/dist/device/router.d.ts +76 -3
  35. package/dist/device/router.d.ts.map +1 -1
  36. package/dist/device/router.js +12 -4
  37. package/dist/device/router.js.map +1 -1
  38. package/dist/device/tools/agent.d.ts +3 -3
  39. package/dist/device/tools/agent.d.ts.map +1 -1
  40. package/dist/device/tools/agent.js +25 -11
  41. package/dist/device/tools/agent.js.map +1 -1
  42. package/dist/device/tools/apps.d.ts +6 -6
  43. package/dist/device/tools/apps.d.ts.map +1 -1
  44. package/dist/device/tools/apps.js.map +1 -1
  45. package/dist/device/tools/browser.d.ts +9 -9
  46. package/dist/device/tools/browser.d.ts.map +1 -1
  47. package/dist/device/tools/browser.js.map +1 -1
  48. package/dist/device/tools/describe.d.ts +5 -3
  49. package/dist/device/tools/describe.d.ts.map +1 -1
  50. package/dist/device/tools/describe.js +19 -2
  51. package/dist/device/tools/describe.js.map +1 -1
  52. package/dist/device/tools/device.d.ts +2 -2
  53. package/dist/device/tools/device.d.ts.map +1 -1
  54. package/dist/device/tools/device.js.map +1 -1
  55. package/dist/device/tools/files.d.ts +5 -5
  56. package/dist/device/tools/files.d.ts.map +1 -1
  57. package/dist/device/tools/files.js.map +1 -1
  58. package/dist/device/tools/sandboxes.d.ts +16 -11
  59. package/dist/device/tools/sandboxes.d.ts.map +1 -1
  60. package/dist/device/tools/sandboxes.js +36 -54
  61. package/dist/device/tools/sandboxes.js.map +1 -1
  62. package/dist/device/tools/shell.d.ts +2 -24
  63. package/dist/device/tools/shell.d.ts.map +1 -1
  64. package/dist/device/tools/shell.js +2 -53
  65. package/dist/device/tools/shell.js.map +1 -1
  66. package/dist/environments/auto-upgrade.d.ts +20 -0
  67. package/dist/environments/auto-upgrade.d.ts.map +1 -0
  68. package/dist/environments/auto-upgrade.js +77 -0
  69. package/dist/environments/auto-upgrade.js.map +1 -0
  70. package/dist/environments/children.d.ts +27 -0
  71. package/dist/environments/children.d.ts.map +1 -0
  72. package/dist/environments/children.js +106 -0
  73. package/dist/environments/children.js.map +1 -0
  74. package/dist/environments/commands.d.ts +12 -0
  75. package/dist/environments/commands.d.ts.map +1 -0
  76. package/dist/environments/commands.js +102 -0
  77. package/dist/environments/commands.js.map +1 -0
  78. package/dist/environments/crossing.d.ts +31 -0
  79. package/dist/environments/crossing.d.ts.map +1 -0
  80. package/dist/environments/crossing.js +64 -0
  81. package/dist/environments/crossing.js.map +1 -0
  82. package/dist/environments/machine-upgrade.d.ts +26 -0
  83. package/dist/environments/machine-upgrade.d.ts.map +1 -0
  84. package/dist/environments/machine-upgrade.js +153 -0
  85. package/dist/environments/machine-upgrade.js.map +1 -0
  86. package/dist/environments/machine.d.ts +29 -0
  87. package/dist/environments/machine.d.ts.map +1 -0
  88. package/dist/environments/machine.js +88 -0
  89. package/dist/environments/machine.js.map +1 -0
  90. package/dist/install.d.ts +4 -6
  91. package/dist/install.d.ts.map +1 -1
  92. package/dist/install.js +35 -47
  93. package/dist/install.js.map +1 -1
  94. package/dist/installed.d.ts +1 -1
  95. package/dist/installed.d.ts.map +1 -1
  96. package/dist/installed.js +3 -8
  97. package/dist/installed.js.map +1 -1
  98. package/dist/release.d.ts +27 -0
  99. package/dist/release.d.ts.map +1 -0
  100. package/dist/release.js +132 -0
  101. package/dist/release.js.map +1 -0
  102. package/dist/resident.d.ts +12 -6
  103. package/dist/resident.d.ts.map +1 -1
  104. package/dist/resident.js +163 -84
  105. package/dist/resident.js.map +1 -1
  106. package/dist/status.d.ts +3 -2
  107. package/dist/status.d.ts.map +1 -1
  108. package/dist/status.js +21 -7
  109. package/dist/status.js.map +1 -1
  110. package/dist/supervision.d.ts +11 -0
  111. package/dist/supervision.d.ts.map +1 -0
  112. package/dist/supervision.js +98 -0
  113. package/dist/supervision.js.map +1 -0
  114. package/dist/sync/commands.d.ts.map +1 -1
  115. package/dist/sync/commands.js +7 -5
  116. package/dist/sync/commands.js.map +1 -1
  117. package/dist/sync/config.d.ts +0 -1
  118. package/dist/sync/config.d.ts.map +1 -1
  119. package/dist/sync/config.js +0 -1
  120. package/dist/sync/config.js.map +1 -1
  121. package/dist/sync/mirror.d.ts +1 -2
  122. package/dist/sync/mirror.d.ts.map +1 -1
  123. package/dist/sync/mirror.js +2 -3
  124. package/dist/sync/mirror.js.map +1 -1
  125. package/dist/sync/mutagen.d.ts +0 -8
  126. package/dist/sync/mutagen.d.ts.map +1 -1
  127. package/dist/sync/mutagen.js +12 -80
  128. package/dist/sync/mutagen.js.map +1 -1
  129. package/dist/sync/report.d.ts +2 -0
  130. package/dist/sync/report.d.ts.map +1 -1
  131. package/dist/sync/report.js +4 -2
  132. package/dist/sync/report.js.map +1 -1
  133. package/dist/sync/residue.d.ts.map +1 -1
  134. package/dist/sync/residue.js +8 -0
  135. package/dist/sync/residue.js.map +1 -1
  136. package/dist/upgrade.d.ts +7 -16
  137. package/dist/upgrade.d.ts.map +1 -1
  138. package/dist/upgrade.js +93 -116
  139. package/dist/upgrade.js.map +1 -1
  140. package/dist/wsl.d.ts +6 -0
  141. package/dist/wsl.d.ts.map +1 -1
  142. package/dist/wsl.js +23 -2
  143. package/dist/wsl.js.map +1 -1
  144. package/package.json +12 -12
  145. package/dist/device/testing.d.ts +0 -10
  146. package/dist/device/testing.d.ts.map +0 -1
  147. package/dist/device/testing.js +0 -51
  148. package/dist/device/testing.js.map +0 -1
package/README.md CHANGED
@@ -1,10 +1,11 @@
1
1
  # @intentic/machine
2
2
 
3
3
  The one agent that lives on a user's own device: it lets a sandbox's agent work on the machine, and keeps the
4
- machine's folders and ports mirrored with the sandbox — one binary, one resident loop, one logon entry.
4
+ machine's folders and ports mirrored with the sandbox — one binary, one resident agent per OS install, and one version
5
+ across the whole computer.
5
6
 
6
7
  It replaces two agents (`@intentic/host` and `@intentic/sync`) that shared everything about *being installed* —
7
- a resident loop, a pidfile, a login entry, an updater, a ~90 MB compiled binary — and nothing about what they
8
+ a resident agent, a pidfile, a login entry, an updater, a ~90 MB compiled binary — and nothing about what they
8
9
  did. Merging them halves what a machine downloads and keeps resident, and gives "is this machine's agent
9
10
  running" one answer instead of two halves of one.
10
11
 
@@ -13,7 +14,7 @@ running" one answer instead of two halves of one.
13
14
  The **device half** (`src/device/`, the machine side of the `host` capability):
14
15
 
15
16
  - Dial each linked sandbox — one outbound WebSocket, enrollment token in the first frame, oRPC after that; the
16
- machine *serves* `hostContract`, so no port ever opens here. Where it dials is the shared resolver's answer
17
+ machine *serves* `deviceContract`, so no port ever opens here. Where it dials is the shared resolver's answer
17
18
  (below), re-asked on every reconnect, so a sandbox on this very machine stays connected with its tunnel down.
18
19
  - Expose the tool surface (`run_command`, files, screenshot, `describe`; deliberately no delete — trash is
19
20
  recoverable) as MCP carried verbatim, so a machine can learn a tool without a daemon release.
@@ -26,12 +27,20 @@ The **device half** (`src/device/`, the machine side of the `host` capability):
26
27
  their logs. `reshape` changes a sandbox's share or privileges through `ic sandbox reshape` on the same
27
28
  switch as the swaps, because another reshape undoes it; its ask is a closed form (two caps, two switches)
28
29
  spelled into `ic` flags here, so nothing a browser or a model sends reaches docker as text. `describe`
29
- reports the docker engine's size beside the OS, which is the ceiling those caps are held to.
30
+ reports the docker engine's size beside the OS, which is all those caps can amount to.
31
+ - **Drop the links nothing answers** (`intentic-machine device forget-unreachable`, and the button the sandbox's
32
+ Devices tab draws for it): a deleted or recreated sandbox leaves its side of the link here, and the agent re-dials
33
+ that address for as long as the machine runs. Only the resident agent's own live stamp decides what counts as gone
34
+ (`src/device/config.ts`), so a machine whose agent is stopped drops **nothing** — "I can't reach it" and "I'm not
35
+ running" are the same sentence from a config file, and only one of them is a reason to delete a link.
36
+ - **Drop a link the sandbox revoked**, at once: the sandbox closes the socket with 1008 after reading its own
37
+ enrollments, which no redial heals, so the link leaves `device.json` rather than being dialled at every start.
30
38
  - Keep each local sandbox's **next update downloaded** (`src/device/auto-prepare.ts`): a background tick
31
39
  runs `ic sandbox prepare <slug> --auto` every few hours, so the web app's update card offers a half-minute
32
- restart instead of minutes of pulling. On by default; the switch is `intentic-machine device updates
33
- --off` (cached in `device.json`). Nothing in any sandbox can start or steer the tick — a sandbox only
34
- learns the outcome through the staged marker `ic` writes, the way it always has.
40
+ restart instead of minutes of pulling. On by default; the switch is `intentic-machine updates --sandboxes off`
41
+ (kept in `machine.json`, re-read every tick). Only the machine's root runs it (see **One machine**): every
42
+ environment of a PC talks to the one Docker engine, and two ticks would pull the same image twice. Nothing in any
43
+ sandbox can start or steer the tick — a sandbox only learns the outcome through the staged marker `ic` writes.
35
44
 
36
45
  The **sync half** (`src/sync/`, the machine side of desktop sync):
37
46
 
@@ -77,9 +86,10 @@ The **sync half** (`src/sync/`, the machine side of desktop sync):
77
86
  - Register Mutagen's daemon for login autostart — on Windows through the launcher stub, because Mutagen's own
78
87
  registration flashes a console window at every boot.
79
88
 
80
- **Shared** (`src/`): the one resident loop (`run`), the merged `status` (and its `--json` envelope the desktop
81
- app's tray reads), self-`upgrade` with automatic rollback, the autostart spec, and **where a sandbox's daemon is
82
- dialled** ([src/daemon-base.ts](src/daemon-base.ts)). A sandbox usually runs in a container on this very
89
+ **Shared** (`src/`): the one resident agent (`run`), the merged `status` (its `--json` envelope is what the desktop
90
+ app's tray reads, and the sandbox asks the running agent for the same report over the device connection's `report`
91
+ call, behind "Run commands"), the machine-wide `upgrade` with automatic rollback, the `updates` switches, the autostart
92
+ spec, and **where a sandbox's daemon is dialled** ([src/daemon-base.ts](src/daemon-base.ts)). A sandbox usually runs in a container on this very
83
93
  machine, which publishes its daemon on `127.0.0.1:<port derived from the sandbox id>`, so every dial either half
84
94
  makes — the device socket, both enrollments, the sync transport, the ports poll, the machine report — tries
85
95
  that address first and the public URL last. A candidate is adopted only if the daemon's unauthenticated
@@ -91,51 +101,92 @@ tab, with every button there gone, while this same process was polling it over l
91
101
  a pairing sitting on the public URL each minute, so a container started later is promoted with no restart; the
92
102
  socket re-resolves on every reconnect.
93
103
 
94
- ## The resident loop
95
-
96
- `intentic-machine run --foreground` (what systemd, launchd and the Windows launcher stub run) serves both
97
- halves in one process ([src/resident.ts](src/resident.ts)):
98
-
99
- - The sync half re-reads its pairing list every tick; the device half's link list is fixed at startup, which
100
- is why `setup` restarts the loop (`reconcileResidency`) instead of poking it.
101
- - Unpairing one sandbox of several does **not** restart it (`startResidentIfStopped`): the sync half picks the
102
- drop up by itself, and this process holds the socket every sandbox reaches this machine over — bouncing it
103
- makes the sandbox that asked for the unpair watch its own device go offline.
104
- - The process exits — and takes the login entry with it — only when **both** halves have nothing to serve.
105
- - On a signal it exits `128+signal`, never 0: a supervisor must restart what it did not stop, and the incident
106
- that bought that rule is written out in [src/sync/mirror.ts](src/sync/mirror.ts).
107
- - It stamps **the build it is running** into its pidfile (`pid boot build`). Nothing else knows it: replacing the
108
- binary does not touch the process, so a machine can hold a current agent and keep serving a months-old one.
109
- - It stamps **what each link's socket is doing** into `links.tick` every five seconds, for the same reason: the
110
- only process that knows is this one and the only process that is asked is `status`, in another terminal. See
111
- **Linked vs connected**.
104
+ ## The resident agent
105
+
106
+ `intentic-machine run --foreground` (what systemd, launchd, the Windows logon task and, for a distro, its Windows side
107
+ run) serves everything this environment holds in one process ([src/resident.ts](src/resident.ts)):
108
+
109
+ - **Configuration is re-read, never restarted for.** Every tick re-reads the links (`device.json`), the sync pairings
110
+ (`sync.json`) and, on Windows, the distros it keeps running (`machine.json`): a new link is dialled, a removed or
111
+ re-enrolled one is closed, and a pairing added later starts the sync half in this same process. So `setup`,
112
+ `uninstall`, `forget-unreachable` and a scope push leave every other sandbox's socket and every sync transport
113
+ alone; only a new binary or `run` restarts the agent. `device setup` waits for the agent's own stamp to show the new
114
+ link's socket open before it says "connected".
115
+ - It exits — and takes its login entry with it — only when links, pairings and kept distros are all **readably**
116
+ empty. A config that exists and will not parse is logged and the agent keeps what it already runs: retiring the login
117
+ entry is a decision nothing but a fresh install undoes, and one unreadable file must not be able to make it.
118
+ - **One agent per environment.** The pidfile (JSON: pid, the boot it belongs to, the build it runs, who restarts it) is
119
+ claimed by writing it and re-reading after a settle, so two agents started at the same moment cannot both keep it, and
120
+ it is re-checked every tick as a lease: an agent that finds another pid there leaves with exit 75.
121
+ - **Every start goes through the supervisor** ([src/supervision.ts](src/supervision.ts)): `schtasks /run` for the logon
122
+ task, `systemctl --user start`, launchd, or the Windows side for a distro it keeps; a bare detached spawn only where
123
+ nothing supervises. The running agent settles its own entry once as it starts: it puts back one lost to a tidied Run
124
+ key or a reset profile, and a distro kept by its Windows side removes its own, so each agent has exactly one starter.
125
+ - On a signal it exits `128+signal`, never 0: a supervisor must restart what it did not stop, and the incident that
126
+ bought that rule is written out in [src/sync/mirror.ts](src/sync/mirror.ts).
127
+ - It stamps **what each link's socket is doing** into `links.tick` every five seconds: the only process that knows is
128
+ this one and the only process that is asked is `status`, in another terminal. See **Linked vs connected**.
129
+ - State files are written whole: every write lands beside the file and replaces it by rename, so no reader ever sees a
130
+ torn `device.json` and mistakes it for an empty one.
131
+
132
+ ## One machine: Windows and its distros
133
+
134
+ A Windows PC with WSL runs one agent per OS install — Mutagen has to watch a distro's folder from inside that distro —
135
+ but it is one computer, so it has one version and one supervisor tree
136
+ ([machines-and-environments.md](../../docs/design/machines-and-environments.md)).
137
+
138
+ - **The Windows side is the root, and each distro with an agent is its child.** The root holds one `wsl.exe` session
139
+ per child ([src/environments/children.ts](src/environments/children.ts)): the session boots the distro at sign-in,
140
+ keeps WSL from shutting the VM down once its last client leaves, and restarts the distro's agent on a ladder from one
141
+ second to five minutes when it crashes. A child that exits 0 (nothing left to serve), has no agent any more, or is
142
+ gone from `wsl -l` is taken off the list.
143
+ - **A distro hands itself over.** A distro agent that finds a Windows agent through interop asks it to take over
144
+ (the hidden `environment attach <distro>`), removes its own systemd entry and is restarted by the root from then on.
145
+ A Windows `setup` adopts distros already running an agent. A distro whose Windows side has no agent looks after
146
+ itself, and is the root of its own machine.
147
+ - **One upgrade path** ([src/environments/machine-upgrade.ts](src/environments/machine-upgrade.ts)). `intentic-machine upgrade`, from
148
+ any side, moves the whole PC to one exact release: the newest of the published one and every side's installed one,
149
+ never backwards. A distro hands the job to its Windows side; the root upgrades its distros first and itself last,
150
+ since its own restart ends the stream a sandbox is reading. Each side still downloads the tagged asset, probes it,
151
+ swaps it in, restarts through its supervisor, checks the build that came up and rolls back when it did not
152
+ ([src/upgrade.ts](src/upgrade.ts)), under a per-environment lock so two upgrades never share a download. The Windows
153
+ launcher is pinned to the same release and swapped with the agent.
154
+ - **Automatic updates** ([src/environments/auto-upgrade.ts](src/environments/auto-upgrade.ts)). The root compares its
155
+ sides every hour and brings a lagging one level, and asks the release channel about every six hours, first a few
156
+ jittered minutes after it starts. A target that failed is retried after 1, 2, 4… hours, a day at most, and a build
157
+ from source is never touched. `intentic-machine updates --agent off` stops the release check but not the levelling,
158
+ since sides on different versions is never a state worth keeping; `--sandboxes off` is the image switch above. Both
159
+ switches are the root's, and a distro hands the command to it.
160
+ - **Setup lands on the machine's version.** Every `setup` first moves its own side onto the newest version the channel
161
+ or any side has, re-execs, and once enrolled brings the rest of the PC level in the background.
162
+ - **Uninstall stays per environment**, because links and grants differ per side. The Windows side keeps running while
163
+ it still keeps a distro, and says so.
112
164
 
113
165
  ### Installed vs running
114
166
 
115
- Two facts, and every surface now carries both. `agents.sync` in the machine report is the **file** at
116
- `bin/intentic-machine` ([src/installed.ts](src/installed.ts)); `watcher.build` is the **loop** running from it.
117
- They drift whenever a binary lands without a restart — a card's one-liner re-run, a copy dropped in, an upgrade
118
- in one environment while the loop runs in another — and the gap used to be invisible: whichever process built the
119
- report stamped its own version into the one field, so the same machine answered its running build to the sandbox
120
- its loop posts to and its installed build to one reading over a `host` capability.
167
+ Two facts, and every surface carries both. `agent.installed` in the machine report is the **file** at
168
+ `bin/intentic-machine` ([src/installed.ts](src/installed.ts)); `agent.build` is the **agent** running from it, as its
169
+ pidfile stamps it. They drift whenever a binary lands without a restart — a copy dropped in, a swap whose restart did
170
+ not take — and a report that carried one version would answer the running build to one reader and the installed build
171
+ to another.
121
172
 
122
173
  - `intentic-machine status` says which is which, and the summary the tray reads leads with `OLD BUILD RUNNING`.
123
174
  - The Devices row says it beside the pid, with the two commands that close it.
124
- - `intentic-machine upgrade` restarts a loop that is behind the installed binary even when there is nothing to
125
- download, and after a swap it verifies that the loop which came up **is** the new build rather than that some
175
+ - `intentic-machine upgrade` restarts an agent that is behind the installed binary even when there is nothing to
176
+ download, and after a swap it checks that the agent which came up **is** the new build rather than that some
126
177
  process is alive — the check the old agent passed just as well as the new one.
127
- - A loop already on the installed build is never bounced, and a loop that is stopped is never started: `run
128
- --stop` is a thing people do on purpose.
178
+ - An agent already on the installed build is never bounced, and one that is stopped is never started by an upgrade:
179
+ `run --stop` is a thing people do on purpose.
129
180
 
130
181
  ### Linked vs connected
131
182
 
132
183
  The same gap one level down, on the command whose entire job is to answer "is my machine connected". `device.json`
133
184
  records the sandboxes this machine is **meant** to answer to and nothing whatever about whether it reaches any of
134
185
  them, so `status` printed `connected as <id>` for every line in it — including, on the machine this was written
135
- for, a sandbox whose host had been answering 502 for four hours while the loop retried it every 30 seconds and
186
+ for, a sandbox whose host had been answering 502 for four hours while the agent retried it every 30 seconds and
136
187
  said so in a log nobody had been pointed at.
137
188
 
138
- - The loop's stamp is the answer: `status` prints `connected`, `NOT connected (retrying)` or `NOT connected`
189
+ - The agent's stamp is the answer: `status` prints `connected`, `NOT connected (retrying)` or `NOT connected`
139
190
  per link, and the summary the tray reads counts the links that are actually up (`1 of 2 sandboxes connected`).
140
191
  - The stamp **ages** on purpose, since it describes sockets held in a process that may be gone. Four ticks past
141
192
  the last write it is no answer at all — which is also what an agent too old to write one leaves behind — and
@@ -145,14 +196,22 @@ said so in a log nobody had been pointed at.
145
196
 
146
197
  ## Key files
147
198
 
148
- - [src/commands.ts](src/commands.ts) — the CLI surface: `device setup|uninstall|updates`, `sync setup|pause|resume|mirror|uninstall`, shared `run|status|version|upgrade|uninstall`.
149
- - [src/install.ts](src/install.ts) — what every `setup` runs first: self-update (then re-exec), PATH repair, the Windows launcher stub. Everything the install scripts used to decide, decided once here.
150
- - [src/upgrade.ts](src/upgrade.ts) — `upgrade`: what is published, then download → probe → stop → swap → start, with a rollback behind every step, and a restart when the file is current but the loop is not.
199
+ - [src/commands.ts](src/commands.ts) — the CLI surface: `device setup|uninstall|forget-unreachable`, `sync setup|pause|resume|mirror|uninstall|…`, shared `run|status|version|upgrade|updates|uninstall`, and the hidden `environment attach`.
200
+ - [src/install.ts](src/install.ts) — what every `setup` runs first and last: move onto the machine's newest agent (then re-exec), PATH repair, the Windows launcher stub; once enrolled, adopt running distros and level the rest of the PC.
201
+ - [src/release.ts](src/release.ts) — the release channel: tagged asset URLs, what `releases/latest` points at, resumable downloads, the `version` probe, and the sweep of what a finished swap leaves in `bin/`.
202
+ - [src/upgrade.ts](src/upgrade.ts) — one environment to one exact release: download → probe → swap → restart through the supervisor → check, rolling back a build that will not start, and a restart when the file is current but the agent is not.
203
+ - [src/environments/machine-upgrade.ts](src/environments/machine-upgrade.ts) — the machine-wide upgrade: the target rule, the order (distros first, the root last), and the lock.
204
+ - [src/environments/children.ts](src/environments/children.ts) — the root keeping each distro's agent running through a held `wsl.exe` session.
205
+ - [src/environments/auto-upgrade.ts](src/environments/auto-upgrade.ts) — the root's update tick and its backoff.
206
+ - [src/environments/machine.ts](src/environments/machine.ts) — `machine.json` (kept distros, the two update switches, the last failed target) and reaching the Windows side from a distro.
207
+ - [src/environments/crossing.ts](src/environments/crossing.ts) — argv that crosses between Windows and a distro, for `run_command`'s `in:` and for the machine's own calls.
208
+ - [src/supervision.ts](src/supervision.ts) — start, stop and restart through whoever supervises this environment, and which one that is.
151
209
  - [src/installed.ts](src/installed.ts) — which build the *file* at `bin/intentic-machine` is, as opposed to the one running: free while the two agree, one probe per swap after they stop.
152
210
  - [src/daemon-base.ts](src/daemon-base.ts) — where a sandbox's daemon is dialled, for both halves: loopback first when `/health` proves it is ours, the public URL as the floor.
153
- - [src/resident.ts](src/resident.ts) — the one loop, its pidfile, its link stamp, and `reconcileResidency`.
211
+ - [src/resident.ts](src/resident.ts) — the one agent: its claim and lease, the per-tick reconcile of links, pairings and distros, and its exits.
154
212
  - [src/device/auto-prepare.ts](src/device/auto-prepare.ts) — the background update-download tick; the judgement about *what* to download stays in `ic sandbox prepare --auto`, on purpose.
155
213
  - [src/status.ts](src/status.ts) — both halves as one answer; `--json` is what the desktop app and tray read.
214
+ - [src/device/router.ts](src/device/router.ts) — the `deviceContract` this machine serves, including `report`, the reading the sandbox's Devices tab is built from.
156
215
  - [src/wsl.ts](src/wsl.ts) — whether this is a WSL distro, and which one. WSL hands a distro the Windows machine's own hostname, so without this the sandbox cannot tell a distro from the Windows install hosting it, or one distro from its neighbour; reported at connect (`describe`) as well as in the status report, so it is known even with "Run commands" off.
157
216
  - [src/device/tools/shell.ts](src/device/tools/shell.ts) — `run_command`, and its `in:` crossing: `wsl:<distro>` from Windows runs `wsl.exe --exec sh -lc` with the script as one argument, `windows` from a distro runs PowerShell through interop; no quoting through the first shell either way.
158
217
  - [src/device/policy.ts](src/device/policy.ts) — what the sandbox is permitted to do here; the security surface.
@@ -164,16 +223,16 @@ said so in a log nobody had been pointed at.
164
223
  ## How it fits
165
224
 
166
225
  Runs on the user's machine, not in the sandbox. Installed by `device.{sh,ps1}` / `sync.{sh,ps1}` (both cards
167
- put the same binary in `~/.intentic/machine/bin`), shipped as a bun-compiled binary per platform, self-updated
168
- by `upgrade`.
226
+ put the same binary in `~/.intentic/machine/bin`), shipped as a bun-compiled binary per platform, and kept on one
227
+ release across the whole PC by `upgrade` and the root's automatic updates.
169
228
 
170
229
  Those four installers are **bootstrap shims**: they download an agent onto a machine that has none (pinned to
171
230
  the tag `releases/latest` resolves to, resumable, probed by running `version` before it may become the agent)
172
231
  and exec `setup`. Every other decision — installed-vs-published, PATH repair, the Windows launcher stub — runs
173
- from [src/install.ts](src/install.ts) at the top of every `setup`: it self-updates through the same
174
- download→probe→swap→rollback machinery as `upgrade`, then re-execs the new agent with the same argv, so
175
- re-running a card's command still upgrades a machine while the rule lives in exactly one compiled, tested
176
- place.
232
+ from [src/install.ts](src/install.ts) at the top of every `setup`: it moves this side onto the machine's newest
233
+ release through the same download→probe→swap→rollback machinery as `upgrade`, then re-execs the new agent with the
234
+ same argv, so re-running a card's command still upgrades a machine while the rule lives in exactly one compiled,
235
+ tested place.
177
236
 
178
237
  The one decision a shim cannot delegate is whether the installed agent can take the handover at all: `device
179
238
  setup` is itself part of this CLI's vocabulary, so an agent older than a route rename rejects it — and the
@@ -191,10 +250,10 @@ The install-and-stay-alive plumbing is
191
250
 
192
251
  - **Bidirectional sync has no undo.** The integration tests here run against real directories and a real
193
252
  Mutagen for exactly that reason; a unit test that mocks the sync proves nothing about the case that loses work.
194
- - **The two halves keep separate state files** (`device.json`, `sync.json`) in the one home: the loop rewrites
253
+ - **The two halves keep separate state files** (`device.json`, `sync.json`) in the one home: the agent rewrites
195
254
  one half's state while a concurrent `setup` writes the other's, and separate files make cross-half torn
196
255
  writes impossible rather than unlikely.
197
256
  - **Scopes are a cache.** The sandbox pushes the real grant on every connect; what is stored only governs the
198
257
  seconds before the first push, and it starts at everything-off.
199
- - **The transport lives in the resident loop**, so `sync setup` starts the loop *before* it probes ssh or hands
258
+ - **The transport lives in the resident agent**, so `sync setup` starts the agent *before* it probes ssh or hands
200
259
  anything to Mutagen: every step after that one needs the port to be open.
package/dist/app.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,GAAG,6EAqBf,CAAC"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,GAAG,6EAgBf,CAAC"}
package/dist/app.js CHANGED
@@ -1,11 +1,8 @@
1
1
  import { agentException } from "@intentic/local-agent";
2
- import { buildApplication, buildRouteMap, text_en } from "@stricli/core";
2
+ import { buildApplication, text_en } from "@stricli/core";
3
3
  import { commands } from "./commands.js";
4
4
  import { MACHINE_VERSION } from "./version.js";
5
- export const app = buildApplication(buildRouteMap({
6
- routes: commands,
7
- docs: { brief: "intentic-machine, connect this device to your intentic sandboxes" },
8
- }), {
5
+ export const app = buildApplication(commands, {
9
6
  name: "intentic-machine",
10
7
  versionInfo: { currentVersion: MACHINE_VERSION },
11
8
  scanner: { caseStyle: "allow-kebab-for-camel" },
package/dist/app.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../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G,OAAO;YACV,eAAe,EAAE,cAAc;YAC/B,4BAA4B,EAAE,CAAC,GAAY,EAAE,EAAE,CAAC,WAAW,cAAc,CAAC,GAAG,CAAC,EAAE;SACnF;KACJ;CACJ,CACJ,CAAC"}
@@ -1,11 +1,3 @@
1
1
  import { type CommandContext } from "@stricli/core";
2
- export declare const commands: {
3
- device: import("@stricli/core").RouteMap<CommandContext>;
4
- sync: import("@stricli/core").RouteMap<CommandContext>;
5
- run: import("@stricli/core").Command<CommandContext>;
6
- status: import("@stricli/core").Command<CommandContext>;
7
- version: import("@stricli/core").Command<CommandContext>;
8
- upgrade: import("@stricli/core").Command<CommandContext>;
9
- uninstall: import("@stricli/core").Command<CommandContext>;
10
- };
2
+ export declare const commands: import("@stricli/core").RouteMap<CommandContext>;
11
3
  //# sourceMappingURL=commands.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAyFjF,eAAO,MAAM,QAAQ;;;;;;;;CAcpB,CAAC"}
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAkGjF,eAAO,MAAM,QAAQ,kDAmBnB,CAAC"}
package/dist/commands.js CHANGED
@@ -1,17 +1,18 @@
1
1
  import { buildCommand, buildRouteMap } from "@stricli/core";
2
2
  import { deviceCommands, deviceUninstall } from "./device/commands.js";
3
- import { ensureWindowsLauncher, machineUpgradeExec } from "./install.js";
4
- import { reconcileResidency, runForeground, stopResident } from "./resident.js";
3
+ import { environmentRoutes, updates } from "./environments/commands.js";
4
+ import { realMachineIo, upgradeMachine } from "./environments/machine-upgrade.js";
5
+ import { runForeground } from "./resident.js";
6
+ import { readResident, restartResident, stopResident } from "./supervision.js";
5
7
  import { status } from "./status.js";
6
8
  import { syncCommands, syncUninstall } from "./sync/commands.js";
7
- import { assetUrl, runUpgrade, upgradeMessage } from "./upgrade.js";
8
9
  import { MACHINE_VERSION } from "./version.js";
9
10
  const run = buildCommand({
10
- docs: { brief: "Run this machine's agent: sandbox connections, file sync, port mirroring (setup starts this for you)" },
11
+ docs: { brief: "Restart this machine's agent: sandbox connections, file sync, port mirroring (setup starts it for you)" },
11
12
  parameters: {
12
13
  flags: {
13
- foreground: { kind: "boolean", brief: "Run the loop in this terminal instead of the background" },
14
- stop: { kind: "boolean", brief: "Stop the background loop" },
14
+ foreground: { kind: "boolean", brief: "Run the agent in this terminal instead of the background" },
15
+ stop: { kind: "boolean", brief: "Stop the background agent" },
15
16
  },
16
17
  },
17
18
  async func(flags) {
@@ -19,10 +20,13 @@ const run = buildCommand({
19
20
  if (flags.stop) {
20
21
  const pid = await stopResident();
21
22
  out(pid === undefined ? "not running." : `stopped (pid ${pid}).`);
23
+ out("It comes back at your next sign-in, and sooner if this machine's supervisor notices it gone. `intentic-machine uninstall` is what stops it for good.");
22
24
  return;
23
25
  }
24
26
  if (!flags.foreground) {
25
- await reconcileResidency(out);
27
+ await restartResident(out);
28
+ const held = await readResident();
29
+ out(held === undefined ? "the agent did not come back up: check its log." : `running (pid ${held.pid}, ${held.build ?? "unknown build"}).`);
26
30
  return;
27
31
  }
28
32
  await runForeground((message) => void this.process.stdout.write(`[${new Date().toISOString()}] ${message}\n`));
@@ -37,44 +41,54 @@ const version = buildCommand({
37
41
  },
38
42
  });
39
43
  const upgrade = buildCommand({
40
- docs: { brief: "Download and install the current agent, then restart the background loop" },
44
+ docs: { brief: "Upgrade the agent on this whole machine (Windows and every WSL distro on it) to the newest release" },
41
45
  parameters: {
42
46
  flags: {
43
47
  force: {
44
48
  kind: "boolean",
45
49
  brief: "Install the published agent even over one built from source (which is otherwise left alone)",
46
50
  },
51
+ level: { kind: "boolean", brief: "Bring every side to the newest release one of them already runs, without asking for a newer one", default: false, hidden: true },
47
52
  },
48
53
  },
49
54
  async func(flags) {
50
55
  const out = (message) => void this.process.stdout.write(`${message}\n`);
51
- out(upgradeMessage(await runUpgrade(machineUpgradeExec(out), assetUrl, MACHINE_VERSION, flags.force, out)));
52
- await ensureWindowsLauncher(out);
56
+ if (!(await upgradeMachine(realMachineIo(flags, out), flags, out))) {
57
+ process.exitCode = 1;
58
+ }
53
59
  },
54
60
  });
55
61
  const uninstall = buildCommand({
56
- docs: { brief: "Remove this machine's agent entirely: every sandbox link, every sync pairing, the login entry" },
62
+ docs: { brief: "Remove this environment's agent: every sandbox link, every sync pairing, the login entry" },
57
63
  parameters: {},
58
64
  async func() {
59
65
  const out = (message) => void this.process.stdout.write(`${message}\n`);
60
66
  await syncUninstall(out);
61
67
  await deviceUninstall(out);
62
- out("Nothing intentic stays resident on this machine.");
68
+ const still = await readResident();
69
+ out(still === undefined
70
+ ? "Nothing intentic stays resident here."
71
+ : `The agent keeps running (pid ${still.pid}) only to keep this PC's WSL distros running; uninstall inside each of them to remove it entirely.`);
72
+ },
73
+ });
74
+ export const commands = buildRouteMap({
75
+ routes: {
76
+ device: buildRouteMap({
77
+ routes: deviceCommands,
78
+ docs: { brief: "Let a sandbox work on this device (the Connect-this-device card)" },
79
+ }),
80
+ sync: buildRouteMap({
81
+ routes: syncCommands,
82
+ docs: { brief: "Mirror a sandbox's files and ports onto this machine (the Desktop sync card)" },
83
+ }),
84
+ environment: environmentRoutes,
85
+ run,
86
+ status,
87
+ version,
88
+ upgrade,
89
+ updates,
90
+ uninstall,
63
91
  },
92
+ docs: { brief: "intentic-machine, connect this device to your intentic sandboxes", hideRoute: { environment: true } },
64
93
  });
65
- export const commands = {
66
- device: buildRouteMap({
67
- routes: deviceCommands,
68
- docs: { brief: "Let a sandbox work on this device (the Connect-this-device card)" },
69
- }),
70
- sync: buildRouteMap({
71
- routes: syncCommands,
72
- docs: { brief: "Mirror a sandbox's files and ports onto this machine (the Desktop sync card)" },
73
- }),
74
- run,
75
- status,
76
- version,
77
- upgrade,
78
- uninstall,
79
- };
80
94
  //# sourceMappingURL=commands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAuB,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAU/C,MAAM,GAAG,GAAG,YAAY,CAAW;IAC/B,IAAI,EAAE,EAAE,KAAK,EAAE,sGAAsG,EAAE;IACvH,UAAU,EAAE;QACR,KAAK,EAAE;YACH,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,yDAAyD,EAAE;YACjG,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,0BAA0B,EAAE;SAC/D;KACJ;IACD,KAAK,CAAC,IAAI,CAAuB,KAAe;QAC5C,MAAM,GAAG,GAAG,CAAC,OAAe,EAAQ,EAAE,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;QACtF,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;YACb,MAAM,GAAG,GAAG,MAAM,YAAY,EAAE,CAAC;YACjC,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,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;AAGH,MAAM,SAAS,GAAG,YAAY,CAAC;IAC3B,IAAI,EAAE,EAAE,KAAK,EAAE,0FAA0F,EAAE;IAC3G,UAAU,EAAE,EAAE;IACd,KAAK,CAAC,IAAI;QACN,MAAM,GAAG,GAAG,CAAC,OAAe,EAAQ,EAAE,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;QACtF,MAAM,aAAa,CAAC,GAAG,CAAC,CAAC;QACzB,MAAM,eAAe,CAAC,GAAG,CAAC,CAAC;QAC3B,MAAM,KAAK,GAAG,MAAM,YAAY,EAAE,CAAC;QACnC,GAAG,CACC,KAAK,KAAK,SAAS;YACf,CAAC,CAAC,uCAAuC;YACzC,CAAC,CAAC,gCAAgC,KAAK,CAAC,GAAG,oGAAoG,CACtJ,CAAC;IACN,CAAC;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,aAAa,CAAC;IAClC,MAAM,EAAE;QACJ,MAAM,EAAE,aAAa,CAAC;YAClB,MAAM,EAAE,cAAc;YACtB,IAAI,EAAE,EAAE,KAAK,EAAE,kEAAkE,EAAE;SACtF,CAAC;QACF,IAAI,EAAE,aAAa,CAAC;YAChB,MAAM,EAAE,YAAY;YACpB,IAAI,EAAE,EAAE,KAAK,EAAE,8EAA8E,EAAE;SAClG,CAAC;QACF,WAAW,EAAE,iBAAiB;QAC9B,GAAG;QACH,MAAM;QACN,OAAO;QACP,OAAO;QACP,OAAO;QACP,SAAS;KACZ;IACD,IAAI,EAAE,EAAE,KAAK,EAAE,kEAAkE,EAAE,SAAS,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE;CACxH,CAAC,CAAC"}
package/dist/config.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  export declare const baseDir: string;
2
+ export declare const binDir: string;
2
3
  export declare const runPidPath: string;
3
4
  export declare const runLogPath: string;
4
5
  export declare const agentLogPath: string;
6
+ export declare const machineConfigPath: string;
7
+ export declare const upgradeLockPath: string;
5
8
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,QAAW,CAAC;AAGhC,eAAO,MAAM,UAAU,QAA+B,CAAC;AACvD,eAAO,MAAM,UAAU,QAA+B,CAAC;AAGvD,eAAO,MAAM,YAAY,QAAsC,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,OAAO,QAAW,CAAC;AAGhC,eAAO,MAAM,MAAM,QAAuB,CAAC;AAG3C,eAAO,MAAM,UAAU,QAA+B,CAAC;AACvD,eAAO,MAAM,UAAU,QAA+B,CAAC;AAGvD,eAAO,MAAM,YAAY,QAAsC,CAAC;AAGhE,eAAO,MAAM,iBAAiB,QAAgC,CAAC;AAG/D,eAAO,MAAM,eAAe,QAA+B,CAAC"}
package/dist/config.js CHANGED
@@ -2,7 +2,10 @@ import { join } from "node:path";
2
2
  import { agentHome } from "@intentic/local-agent";
3
3
  const home = agentHome("machine");
4
4
  export const baseDir = home.dir;
5
+ export const binDir = join(baseDir, "bin");
5
6
  export const runPidPath = join(baseDir, "machine.pid");
6
7
  export const runLogPath = join(baseDir, "machine.log");
7
8
  export const agentLogPath = join(baseDir, "machine-update.log");
9
+ export const machineConfigPath = join(baseDir, "machine.json");
10
+ export const upgradeLockPath = join(binDir, "upgrade.lock");
8
11
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC;AAGhC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AAGvD,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC;AAGhC,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAG3C,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AAGvD,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;AAGhE,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;AAG/D,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC"}
@@ -1,12 +1,13 @@
1
1
  import type { Log } from "@intentic/local-agent";
2
+ export type FetchImpl = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
2
3
  export declare const daemonIdOf: (sandboxUrl: string) => string | undefined;
3
4
  export declare const candidateBases: (sandboxUrl: string) => readonly string[];
4
- export declare const probeDaemonBase: (base: string, expectedId: string, fetchImpl?: typeof fetch) => Promise<boolean>;
5
+ export declare const probeDaemonBase: (base: string, expectedId: string, fetchImpl?: FetchImpl) => Promise<boolean>;
5
6
  export interface DaemonBase {
6
7
  readonly base: string;
7
8
  readonly local: boolean;
8
9
  }
9
- export declare const resolveDaemonBase: (sandboxUrl: string, fetchImpl?: typeof fetch) => Promise<DaemonBase>;
10
+ export declare const resolveDaemonBase: (sandboxUrl: string, fetchImpl?: FetchImpl) => Promise<DaemonBase>;
10
11
  export declare const PROMOTION_INTERVAL_MS = 60000;
11
12
  export interface DaemonTarget {
12
13
  readonly sandboxId: string;
@@ -16,7 +17,7 @@ export interface DaemonBases {
16
17
  readonly resolve: (pairing: DaemonTarget) => Promise<string>;
17
18
  readonly failed: (sandboxId: string) => void;
18
19
  }
19
- export declare const createDaemonBases: (log: Log, fetchImpl?: typeof fetch, now?: () => number) => DaemonBases;
20
+ export declare const createDaemonBases: (log: Log, fetchImpl?: FetchImpl, now?: () => number) => DaemonBases;
20
21
  export interface Dialed<T extends DaemonTarget> {
21
22
  readonly pairing: T;
22
23
  readonly base: string;
@@ -1 +1 @@
1
- {"version":3,"file":"daemon-base.d.ts","sourceRoot":"","sources":["../src/daemon-base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAejD,eAAO,MAAM,UAAU,eAAgB,MAAM,KAAG,MAAM,GAAG,SAGxD,CAAC;AAIF,eAAO,MAAM,cAAc,eAAgB,MAAM,KAAG,SAAS,MAAM,EASlE,CAAC;AAIF,eAAO,MAAM,eAAe,SAAgB,MAAM,cAAc,MAAM,cAAa,OAAO,KAAK,KAAW,OAAO,CAAC,OAAO,CAWxH,CAAC;AAIF,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CAC3B;AAID,eAAO,MAAM,iBAAi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C,IAAI,CAAC;YACxB,CAAC;YACD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;gBAChB,GAAG,CAAC,KAAK,OAAO,CAAC,SAAS,2BAA2B,OAAO,CAAC,IAAI,sCAAsC,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC;YAClI,CAAC;iBAAM,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBAC5B,GAAG,CAAC,KAAK,OAAO,CAAC,SAAS,oEAAoE,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC;YACnH,CAAC;YACD,OAAO,OAAO,CAAC,IAAI,CAAC;QACxB,CAAC;QAED,MAAM,EAAE,CAAC,SAAiB,EAAQ,EAAE;YAChC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACjC,IAAI,IAAI,EAAE,KAAK,KAAK,IAAI,EAAE,CAAC;gBACvB,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAClD,CAAC;QACL,CAAC;KACJ,CAAC;AACN,CAAC,CAAC;AASF,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAA0B,QAAsB,EAAE,KAAkB,EAAiC,EAAE,CACtI,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { errorMessage } from "@intentic/base/errors";
2
2
  import { plural } from "@intentic/base/format";
3
- import { readPrepareUpdates } from "./config.js";
3
+ import { readMachineConfig } from "../environments/machine.js";
4
4
  import { fleet, icInFlight, runIc } from "./tools/sandboxes.js";
5
5
  const FIRST_TICK_MS = 5 * 60_000;
6
6
  const TICK_MS = 6 * 60 * 60_000;
@@ -63,7 +63,7 @@ export const startAutoPrepare = (log) => {
63
63
  };
64
64
  const tick = async () => {
65
65
  try {
66
- if (await readPrepareUpdates()) {
66
+ if ((await readMachineConfig().catch(() => ({ sandboxUpdates: true }))).sandboxUpdates !== false) {
67
67
  await runTick(state, await fleet(), async (slug) => await runIc(autoPrepareArgs(slug), () => undefined), log);
68
68
  }
69
69
  }
@@ -74,7 +74,7 @@ export const startAutoPrepare = (log) => {
74
74
  schedule(TICK_MS + Math.floor(Math.random() * JITTER_MS));
75
75
  }
76
76
  };
77
- schedule(FIRST_TICK_MS);
77
+ schedule(FIRST_TICK_MS + Math.floor(Math.random() * JITTER_MS));
78
78
  return {
79
79
  stop: () => {
80
80
  stopped = true;
@@ -1 +1 @@
1
- {"version":3,"file":"auto-prepare.js","sourceRoot":"","sources":["../../src/device/auto-prepare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAOhE,MAAM,aAAa,GAAG,CAAC,GAAG,MAAM,CAAC;AAEjC,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC;AAEhC,MAAM,SAAS,GAAG,EAAE,GAAG,MAAM,CAAC;AAE9B,MAAM,cAAc,GAAG,CAAC,CAAC;AAIzB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAA+B,EAAY,EAAE,CACxE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG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AS,CAAC,EAAE,GAAG,CAAC,CAAC;YAClH,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAEb,GAAG,CAAC,sCAAsC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACrE,CAAC;QACD,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC;QAC9D,CAAC;IACL,CAAC,CAAC;IACF,QAAQ,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC;IAChE,OAAO;QACH,IAAI,EAAE,GAAS,EAAE;YACb,OAAO,GAAG,IAAI,CAAC;YACf,YAAY,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC;KACJ,CAAC;AACN,CAAC,CAAC"}
@@ -1,9 +1,10 @@
1
1
  import { type Log } from "@intentic/local-agent";
2
2
  import { type CommandContext } from "@stricli/core";
3
3
  export declare const deviceUninstall: (out: Log, sandbox?: string) => Promise<void>;
4
+ export declare const dropUnreachableLinks: (out: Log) => Promise<void>;
4
5
  export declare const deviceCommands: {
5
6
  setup: import("@stricli/core").Command<CommandContext>;
6
7
  uninstall: import("@stricli/core").Command<CommandContext>;
7
- updates: import("@stricli/core").Command<CommandContext>;
8
+ "forget-unreachable": import("@stricli/core").Command<CommandContext>;
8
9
  };
9
10
  //# sourceMappingURL=commands.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/device/commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,GAAG,EAA0B,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAmIlE,eAAO,MAAM,eAAe,QAAe,GAAG,YAAY,MAAM,KAAG,OAAO,CAAC,IAAI,CAyB9E,CAAC;AAyCF,eAAO,MAAM,cAAc;;;;CAAgC,CAAC"}
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/device/commands.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,GAAG,EAA0B,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AA8JlE,eAAO,MAAM,eAAe,QAAe,GAAG,YAAY,MAAM,KAAG,OAAO,CAAC,IAAI,CAyB9E,CAAC;AAgBF,eAAO,MAAM,oBAAoB,QAAe,GAAG,KAAG,OAAO,CAAC,IAAI,CAwBjE,CAAC;AAEF,eAAO,MAAM,cAAc;;;;CAAgE,CAAC"}