@intentic/machine 1.331.0 → 1.333.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.
- package/README.md +67 -8
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +1 -1
- package/dist/app.js.map +1 -1
- package/dist/autostart/autostart.js +1 -1
- package/dist/autostart/autostart.js.map +1 -1
- package/dist/cli-ui.d.ts +10 -0
- package/dist/cli-ui.d.ts.map +1 -0
- package/dist/cli-ui.js +62 -0
- package/dist/cli-ui.js.map +1 -0
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +61 -26
- package/dist/commands.js.map +1 -1
- package/dist/daemon-base.d.ts +1 -0
- package/dist/daemon-base.d.ts.map +1 -1
- package/dist/daemon-base.js +21 -18
- package/dist/daemon-base.js.map +1 -1
- package/dist/device/audit.d.ts.map +1 -1
- package/dist/device/audit.js.map +1 -1
- package/dist/device/commands.d.ts +8 -6
- package/dist/device/commands.d.ts.map +1 -1
- package/dist/device/commands.js +64 -42
- package/dist/device/commands.js.map +1 -1
- package/dist/device/connection.d.ts.map +1 -1
- package/dist/device/connection.js +2 -3
- package/dist/device/connection.js.map +1 -1
- package/dist/device/grant.d.ts +7 -0
- package/dist/device/grant.d.ts.map +1 -1
- package/dist/device/loopback-catch.d.ts.map +1 -1
- package/dist/device/loopback-catch.js +1 -1
- package/dist/device/loopback-catch.js.map +1 -1
- package/dist/device/mcp.d.ts.map +1 -1
- package/dist/device/mcp.js +19 -0
- package/dist/device/mcp.js.map +1 -1
- package/dist/device/policy.d.ts.map +1 -1
- package/dist/device/policy.js +3 -5
- package/dist/device/policy.js.map +1 -1
- package/dist/device/router.d.ts +7 -0
- package/dist/device/router.d.ts.map +1 -1
- package/dist/device/router.js +17 -5
- package/dist/device/router.js.map +1 -1
- package/dist/device/sandbox-cli.d.ts +12 -1
- package/dist/device/sandbox-cli.d.ts.map +1 -1
- package/dist/device/sandbox-cli.js +90 -18
- package/dist/device/sandbox-cli.js.map +1 -1
- package/dist/device/sandbox-rounds/ic-swaps.d.ts +11 -0
- package/dist/device/sandbox-rounds/ic-swaps.d.ts.map +1 -0
- package/dist/device/sandbox-rounds/ic-swaps.js +40 -0
- package/dist/device/sandbox-rounds/ic-swaps.js.map +1 -0
- package/dist/device/sandbox-rounds/keeper.d.ts +26 -1
- package/dist/device/sandbox-rounds/keeper.d.ts.map +1 -1
- package/dist/device/sandbox-rounds/keeper.js +118 -20
- package/dist/device/sandbox-rounds/keeper.js.map +1 -1
- package/dist/device/sandbox-rounds/probation-watch.d.ts +1 -1
- package/dist/device/sandbox-rounds/probation-watch.d.ts.map +1 -1
- package/dist/device/sandbox-rounds/probation-watch.js +2 -2
- package/dist/device/sandbox-rounds/probation-watch.js.map +1 -1
- package/dist/device/sandbox-rounds/sleep.d.ts +52 -0
- package/dist/device/sandbox-rounds/sleep.d.ts.map +1 -0
- package/dist/device/sandbox-rounds/sleep.js +115 -0
- package/dist/device/sandbox-rounds/sleep.js.map +1 -0
- package/dist/device/sandbox-rounds/swap-records.d.ts +1 -5
- package/dist/device/sandbox-rounds/swap-records.d.ts.map +1 -1
- package/dist/device/sandbox-rounds/swap-records.js +2 -33
- package/dist/device/sandbox-rounds/swap-records.js.map +1 -1
- package/dist/device/sandbox-rounds/swaps-fallback.d.ts +7 -0
- package/dist/device/sandbox-rounds/swaps-fallback.d.ts.map +1 -0
- package/dist/device/sandbox-rounds/swaps-fallback.js +44 -0
- package/dist/device/sandbox-rounds/swaps-fallback.js.map +1 -0
- package/dist/device/tools/agent.js +3 -3
- package/dist/device/tools/agent.js.map +1 -1
- package/dist/device/tools/android.d.ts.map +1 -1
- package/dist/device/tools/android.js +7 -62
- package/dist/device/tools/android.js.map +1 -1
- package/dist/device/tools/apps.d.ts.map +1 -1
- package/dist/device/tools/apps.js +7 -1
- package/dist/device/tools/apps.js.map +1 -1
- package/dist/device/tools/describe.d.ts +6 -0
- package/dist/device/tools/describe.d.ts.map +1 -1
- package/dist/device/tools/describe.js +30 -9
- package/dist/device/tools/describe.js.map +1 -1
- package/dist/device/tools/device.d.ts.map +1 -1
- package/dist/device/tools/device.js +2 -1
- package/dist/device/tools/device.js.map +1 -1
- package/dist/device/tools/ic-binary.d.ts +7 -0
- package/dist/device/tools/ic-binary.d.ts.map +1 -1
- package/dist/device/tools/ic-binary.js +16 -8
- package/dist/device/tools/ic-binary.js.map +1 -1
- package/dist/device/tools/logs/logs.d.ts +30 -0
- package/dist/device/tools/logs/logs.d.ts.map +1 -0
- package/dist/device/tools/logs/logs.js +147 -0
- package/dist/device/tools/logs/logs.js.map +1 -0
- package/dist/device/tools/programs/artifacts.d.ts.map +1 -1
- package/dist/device/tools/programs/artifacts.js +5 -10
- package/dist/device/tools/programs/artifacts.js.map +1 -1
- package/dist/device/tools/programs/{tunnel.d.ts → device-tunnel.d.ts} +1 -1
- package/dist/device/tools/programs/device-tunnel.d.ts.map +1 -0
- package/dist/device/tools/programs/{tunnel.js → device-tunnel.js} +1 -1
- package/dist/device/tools/programs/device-tunnel.js.map +1 -0
- package/dist/device/tools/programs/isolated.d.ts +0 -1
- package/dist/device/tools/programs/isolated.d.ts.map +1 -1
- package/dist/device/tools/programs/isolated.js +8 -10
- package/dist/device/tools/programs/isolated.js.map +1 -1
- package/dist/device/tools/programs/programs.d.ts +1 -1
- package/dist/device/tools/programs/programs.d.ts.map +1 -1
- package/dist/device/tools/programs/programs.js +89 -35
- package/dist/device/tools/programs/programs.js.map +1 -1
- package/dist/device/tools/sandboxes.d.ts.map +1 -1
- package/dist/device/tools/sandboxes.js +11 -10
- package/dist/device/tools/sandboxes.js.map +1 -1
- package/dist/device/tools/shell.d.ts +6 -5
- package/dist/device/tools/shell.d.ts.map +1 -1
- package/dist/device/tools/shell.js +37 -86
- package/dist/device/tools/shell.js.map +1 -1
- package/dist/engine-env.d.ts +15 -0
- package/dist/engine-env.d.ts.map +1 -0
- package/dist/engine-env.js +80 -0
- package/dist/engine-env.js.map +1 -0
- package/dist/environments/auto-upgrade.d.ts +2 -2
- package/dist/environments/auto-upgrade.d.ts.map +1 -1
- package/dist/environments/auto-upgrade.js +3 -5
- package/dist/environments/auto-upgrade.js.map +1 -1
- package/dist/environments/commands.d.ts +7 -1
- package/dist/environments/commands.d.ts.map +1 -1
- package/dist/environments/commands.js +37 -31
- package/dist/environments/commands.js.map +1 -1
- package/dist/environments/machine-upgrade.d.ts +8 -1
- package/dist/environments/machine-upgrade.d.ts.map +1 -1
- package/dist/environments/machine-upgrade.js +35 -26
- package/dist/environments/machine-upgrade.js.map +1 -1
- package/dist/environments/machine.d.ts +5 -4
- package/dist/environments/machine.d.ts.map +1 -1
- package/dist/environments/machine.js +13 -16
- package/dist/environments/machine.js.map +1 -1
- package/dist/environments/wsl.d.ts.map +1 -1
- package/dist/environments/wsl.js +4 -7
- package/dist/environments/wsl.js.map +1 -1
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +28 -30
- package/dist/install.js.map +1 -1
- package/dist/resident/last-exit.d.ts +40 -0
- package/dist/resident/last-exit.d.ts.map +1 -0
- package/dist/resident/last-exit.js +147 -0
- package/dist/resident/last-exit.js.map +1 -0
- package/dist/resident/log-roll.d.ts +8 -0
- package/dist/resident/log-roll.d.ts.map +1 -0
- package/dist/resident/log-roll.js +30 -0
- package/dist/resident/log-roll.js.map +1 -0
- package/dist/{resident.d.ts → resident/resident.d.ts} +1 -1
- package/dist/resident/resident.d.ts.map +1 -0
- package/dist/{resident.js → resident/resident.js} +52 -27
- package/dist/resident/resident.js.map +1 -0
- package/dist/{supervision.d.ts → resident/supervision.d.ts} +7 -3
- package/dist/resident/supervision.d.ts.map +1 -0
- package/dist/{supervision.js → resident/supervision.js} +20 -16
- package/dist/resident/supervision.js.map +1 -0
- package/dist/resident/watchdog.d.ts +24 -0
- package/dist/resident/watchdog.d.ts.map +1 -0
- package/dist/resident/watchdog.js +69 -0
- package/dist/resident/watchdog.js.map +1 -0
- package/dist/status.d.ts +14 -8
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +141 -107
- package/dist/status.js.map +1 -1
- package/dist/sync/attach-commands.d.ts +1 -1
- package/dist/sync/attach-commands.d.ts.map +1 -1
- package/dist/sync/attach-commands.js +19 -12
- package/dist/sync/attach-commands.js.map +1 -1
- package/dist/sync/commands.d.ts +6 -3
- package/dist/sync/commands.d.ts.map +1 -1
- package/dist/sync/commands.js +149 -113
- package/dist/sync/commands.js.map +1 -1
- package/dist/sync/exec.d.ts +9 -0
- package/dist/sync/exec.d.ts.map +1 -1
- package/dist/sync/exec.js +21 -22
- package/dist/sync/exec.js.map +1 -1
- package/dist/sync/folders.d.ts.map +1 -1
- package/dist/sync/folders.js +3 -14
- package/dist/sync/folders.js.map +1 -1
- package/dist/sync/forget-command.d.ts +1 -1
- package/dist/sync/forget-command.d.ts.map +1 -1
- package/dist/sync/forget-command.js +10 -7
- package/dist/sync/forget-command.js.map +1 -1
- package/dist/sync/git-bridge.d.ts.map +1 -1
- package/dist/sync/git-bridge.js +4 -2
- package/dist/sync/git-bridge.js.map +1 -1
- package/dist/sync/local-sandboxes.d.ts.map +1 -1
- package/dist/sync/local-sandboxes.js +2 -4
- package/dist/sync/local-sandboxes.js.map +1 -1
- package/dist/sync/mirror.d.ts.map +1 -1
- package/dist/sync/mirror.js +9 -18
- package/dist/sync/mirror.js.map +1 -1
- package/dist/sync/mutagen.d.ts.map +1 -1
- package/dist/sync/mutagen.js +33 -37
- package/dist/sync/mutagen.js.map +1 -1
- package/dist/sync/project/project-commands.d.ts +7 -2
- package/dist/sync/project/project-commands.d.ts.map +1 -1
- package/dist/sync/project/project-commands.js +110 -46
- package/dist/sync/project/project-commands.js.map +1 -1
- package/dist/sync/project/project-files.d.ts +4 -6
- package/dist/sync/project/project-files.d.ts.map +1 -1
- package/dist/sync/project/project-files.js +4 -6
- package/dist/sync/project/project-files.js.map +1 -1
- package/dist/sync/project/project-local.d.ts.map +1 -1
- package/dist/sync/project/project-local.js +3 -19
- package/dist/sync/project/project-local.js.map +1 -1
- package/dist/sync/project/project-remote.js +4 -4
- package/dist/sync/project/project-transfer.d.ts +13 -30
- package/dist/sync/project/project-transfer.d.ts.map +1 -1
- package/dist/sync/project/project-transfer.js +1 -1
- package/dist/sync/project/project-transfer.js.map +1 -1
- package/dist/sync/retire.d.ts.map +1 -1
- package/dist/sync/retire.js +3 -3
- package/dist/sync/retire.js.map +1 -1
- package/dist/sync/siblings.d.ts.map +1 -1
- package/dist/sync/siblings.js +3 -6
- package/dist/sync/siblings.js.map +1 -1
- package/dist/sync/ssh.d.ts +1 -1
- package/dist/sync/ssh.d.ts.map +1 -1
- package/dist/sync/ssh.js +8 -7
- package/dist/sync/ssh.js.map +1 -1
- package/dist/sync/swap-pause.d.ts.map +1 -1
- package/dist/sync/swap-pause.js +2 -2
- package/dist/sync/swap-pause.js.map +1 -1
- package/dist/upgrade.d.ts +7 -0
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +24 -13
- package/dist/upgrade.js.map +1 -1
- package/dist/upkeep/doctor.d.ts +4 -2
- package/dist/upkeep/doctor.d.ts.map +1 -1
- package/dist/upkeep/doctor.js +40 -26
- package/dist/upkeep/doctor.js.map +1 -1
- package/dist/upkeep/login.js +1 -1
- package/dist/upkeep/login.js.map +1 -1
- package/dist/upkeep/retention.d.ts +6 -0
- package/dist/upkeep/retention.d.ts.map +1 -1
- package/dist/upkeep/retention.js +55 -3
- package/dist/upkeep/retention.js.map +1 -1
- package/dist/upkeep/retired.js +1 -1
- package/dist/upkeep/retired.js.map +1 -1
- package/dist/upkeep/second-ic.d.ts.map +1 -1
- package/dist/upkeep/second-ic.js +4 -6
- package/dist/upkeep/second-ic.js.map +1 -1
- package/dist/upkeep/trash.d.ts.map +1 -1
- package/dist/upkeep/trash.js +5 -6
- package/dist/upkeep/trash.js.map +1 -1
- package/package.json +9 -9
- package/dist/device/tools/programs/tunnel.d.ts.map +0 -1
- package/dist/device/tools/programs/tunnel.js.map +0 -1
- package/dist/resident.d.ts.map +0 -1
- package/dist/resident.js.map +0 -1
- package/dist/supervision.d.ts.map +0 -1
- package/dist/supervision.js.map +0 -1
- package/dist/watchdog.d.ts +0 -13
- package/dist/watchdog.d.ts.map +0 -1
- package/dist/watchdog.js +0 -38
- package/dist/watchdog.js.map +0 -1
package/README.md
CHANGED
|
@@ -44,7 +44,11 @@ flowchart LR
|
|
|
44
44
|
typed with `android_act` like the desktop's, before either crosses.
|
|
45
45
|
- The sandbox tools are thin callers of `ic` ([`tools/sandboxes.ts`](src/device/tools/sandboxes.ts)): the listing is
|
|
46
46
|
`ic sandbox list --json` passed through, and start, stop, restart, the swaps, `set-shape`, `forget-shape` and the
|
|
47
|
-
logs are ic's own verbs, argv spelled by the contract (`icShapeArgs`, `icPowerArgs`).
|
|
47
|
+
logs are ic's own verbs, argv spelled by the contract (`icShapeArgs`, `icPowerArgs`). The "Manage sandboxes"
|
|
48
|
+
switch also covers the same verbs sent another way: `ic sandbox …` or `docker stop|kill|restart|rm` on a sandbox
|
|
49
|
+
container through `run_command`, `app_start`, `open` or typed text is refused while it is off
|
|
50
|
+
(`assertNoSandboxPower` in [`tools/shell.ts`](src/device/tools/shell.ts), recognised by the contract's
|
|
51
|
+
`sandboxPowerCommands`). `diagnose_sandbox` is
|
|
48
52
|
`ic sandbox doctor <slug> --json`, read-only and gated like the logs (`shell` or `sandboxes`), so an agent in another
|
|
49
53
|
sandbox can find out why one on this device is unreachable; it skips the listing, which cannot answer while Docker is
|
|
50
54
|
down, and refuses a slug ic would read as a flag. The shape reaches ic as the
|
|
@@ -156,7 +160,7 @@ flowchart LR
|
|
|
156
160
|
has no meaning for is still refused. `reshape-later` and the old `reshape` op stay only for pages and daemons from
|
|
157
161
|
before `set-shape` (v1.312.0 and older), and go in v1.314.0.
|
|
158
162
|
- Every path under the user's home goes through `homeDir()` from [local-agent](../local-agent), which follows a `HOME`
|
|
159
|
-
set after startup; a
|
|
163
|
+
set after startup; a check holds the sources to it ([home-dir](../../_tools/checks/home-dir.mjs)).
|
|
160
164
|
- Scopes are enforced here and nowhere else: the sandbox only asks, and a refusal names the switch that is off.
|
|
161
165
|
Files stay inside the configured roots, writes need their own switch, and every call is appended to
|
|
162
166
|
`~/.intentic/machine/audit.jsonl`, set aside as `audit.jsonl.1` once it reaches 8 MB (2026-10-05: it grew without
|
|
@@ -539,9 +543,12 @@ whose it is.
|
|
|
539
543
|
- **A swap is never cut short by this agent.** `ic` runs in a process group of its own on POSIX, keeps its pipes, and
|
|
540
544
|
is never killed when the link or request that asked for it goes away. The one run it ever stops is the keeper's
|
|
541
545
|
`sandbox fix` past its deadline (below), which is not a swap. Every restart of the agent (the auto-upgrade
|
|
542
|
-
tick, `upgrade`, `run`, the browser's Update and Restart) waits while
|
|
543
|
-
|
|
544
|
-
|
|
546
|
+
tick, `upgrade`, `run`, the browser's Update and Restart) waits while `ic sandbox swaps --json` says a cutover is in
|
|
547
|
+
progress, or while this process runs a flow that moves a container
|
|
548
|
+
([`device/sandbox-rounds/ic-swaps.ts`](src/device/sandbox-rounds/ic-swaps.ts)). The verdict is ic's own, heartbeat
|
|
549
|
+
and all, and the command answers without Docker. An older ic that lacks it is read by a fallback that applies the
|
|
550
|
+
same rule from the shared `swap-verdicts.json` fixture, marked `COMPAT(ic-swaps)`. The keeper skips a sandbox on the
|
|
551
|
+
same answer. The agent no longer reads ic's records itself. The tick
|
|
545
552
|
looks again in five minutes, a command waits and says so. A keeper's fix is not such a flow (see [The keeper](#the-keeper)).
|
|
546
553
|
- **The probation watch** ([`device/sandbox-rounds/probation-watch.ts`](src/device/sandbox-rounds/probation-watch.ts)) runs
|
|
547
554
|
`ic sandbox watch <slug> --json` every minute for each sandbox whose record names a `swap_phase`, and
|
|
@@ -629,6 +636,11 @@ clock.
|
|
|
629
636
|
lasting ledger of its own repairs.
|
|
630
637
|
- **The log** (`~/.intentic/machine/machine.log`, like every round): what ic is doing as it does it, and each
|
|
631
638
|
sandbox's verdict when it changes (a standing `healthy` or `needs-you` is said once per stretch; `fixed` always).
|
|
639
|
+
A restart of one sandbox is said whole: ic's finding ("Restarting the sandbox, because Daemon health: …"), what made
|
|
640
|
+
the keeper run ic (its sweep, or this agent's link down since when), its side of the computer and the failed check
|
|
641
|
+
ids. The same goes into the container as `/history/logs/restart-intent.json` (`{at, by: "keeper", host, side, action,
|
|
642
|
+
reason, checks}`, read by the daemon at boot) through a `docker exec` of at most three seconds that the restart never
|
|
643
|
+
waits on; ic may write its own over it.
|
|
632
644
|
- **Where.** Every environment runs its own keeper, since `ic sandbox fix` knows only the sandboxes its own ic keeps
|
|
633
645
|
records of; a WSL distro's shares the Windows side's Docker Desktop. Each keeper sweeps only while its environment
|
|
634
646
|
keeps a sandbox of its own: one the listing names without `keptElsewhere`, or one its ic still has a record of that
|
|
@@ -652,6 +664,28 @@ clock.
|
|
|
652
664
|
retiring as before was rejected, since a machine whose last link was revoked kept its sandbox down after every
|
|
653
665
|
reboot).
|
|
654
666
|
|
|
667
|
+
### Sleep and wake
|
|
668
|
+
|
|
669
|
+
(2026-10-10) A PC holding a dozen sandboxes, one or two of them in use, kept every one up: about 1.4 GB each on rog.
|
|
670
|
+
The keeper now puts an unneeded sandbox to sleep and wakes it when somebody opens it
|
|
671
|
+
([`device/sandbox-rounds/sleep.ts`](src/device/sandbox-rounds/sleep.ts)).
|
|
672
|
+
|
|
673
|
+
- **Sleep.** Right after each sweep the keeper runs `ic sandbox sleep --idle <minutes> --json --source agent`. ic stops,
|
|
674
|
+
through Docker (so `--restart unless-stopped` leaves it down), every running sandbox of this side whose daemon has
|
|
675
|
+
said for that long that nobody needs it: no editor connected, nothing in flight, no terminal typed in, nobody
|
|
676
|
+
connected to one of its apps (`quietSince` in its work signal), and no promised wake due within the stretch. ic
|
|
677
|
+
records it asleep and reports `asleep: true` to the platform, so the editor can say so. A sleeping sandbox's dead link
|
|
678
|
+
is never a repair: the keeper leaves it alone, and `ic sandbox fix` finds it healthy.
|
|
679
|
+
- **Wake.** The platform never calls a machine. A browser that finds the sandbox asleep asks the platform to wake it,
|
|
680
|
+
and this agent's wake round asks the platform for such requests (`ic sandbox wakes --json --source agent`, one request
|
|
681
|
+
for every sleeper on this side, each under its own report key), starting each one asked for through `ic sandbox
|
|
682
|
+
start`. It asks every fifteen seconds while anything sleeps, and every five minutes otherwise, to catch a sleep made
|
|
683
|
+
by hand. It runs whatever the keeper's switch says, so a sandbox asleep when the keeper was switched off still wakes.
|
|
684
|
+
- **The setting** is this environment's `sandboxSleepMinutes` in `machine.json`: absent means 30, `0` means never. Set
|
|
685
|
+
it with `intentic-machine sandbox sleep-after <minutes|off>` and read it with `sleep-after status`.
|
|
686
|
+
`intentic-machine sandbox sleep <slug>` puts one sandbox to sleep now. An `ic` without the verbs is said once and
|
|
687
|
+
nothing sleeps.
|
|
688
|
+
|
|
655
689
|
### Upkeep
|
|
656
690
|
|
|
657
691
|
What older releases left on a device, and the stores with no bound, are put right by a reconciler that ships with each
|
|
@@ -681,6 +715,8 @@ login entries once and then stood in for every later cleanup too (2026-10-05).
|
|
|
681
715
|
- `~/.intentic/machine/trash` entries older than 30 days, by the stamp in their name (a moved folder keeps its old
|
|
682
716
|
times), deleted; a name with no stamp is left and reported;
|
|
683
717
|
- `audit.jsonl` set aside at 8 MB;
|
|
718
|
+
- what programs started with `app_start` printed (`runs/<sandbox>/.logs`), after 14 days or past the newest 100 per
|
|
719
|
+
sandbox, never a run `apps.json` still holds as running;
|
|
684
720
|
- the install command's half downloads in `bin/` (`*.part`, `*.part-<release>`) older than a day, never while an
|
|
685
721
|
upgrade runs;
|
|
686
722
|
- a second `ic` found first on PATH (a root install's `/usr/local/bin/ic`), reported with both versions, since only
|
|
@@ -697,7 +733,7 @@ login entries once and then stood in for every later cleanup too (2026-10-05).
|
|
|
697
733
|
### The hang watchdog
|
|
698
734
|
|
|
699
735
|
Every supervisor of this agent restarts it when it exits, and none can tell a hung agent from a busy one
|
|
700
|
-
([`watchdog.ts`](src/watchdog.ts), 2026-10-05). So the agent watches its own event loop from a Worker thread, which has
|
|
736
|
+
([`watchdog.ts`](src/resident/watchdog.ts), 2026-10-05). So the agent watches its own event loop from a Worker thread, which has
|
|
701
737
|
a loop of its own: the main loop pings it every five seconds, and after three minutes without a ping the Worker writes
|
|
702
738
|
`event loop stalled for N s; exiting so the supervisor restarts the agent` to the log (straight to fd 2, where every
|
|
703
739
|
supervisor sends it) and kills the process with SIGKILL. Checks of its own held apart by far more than their
|
|
@@ -708,11 +744,34 @@ laptop's sleep found the last ping minutes old and killed a healthy agent). That
|
|
|
708
744
|
launcher passes to the logon task, and the Windows side restarts a distro's agent that stopped. The Worker is made from
|
|
709
745
|
source text, so the compiled binary needs no second file; both it and the SIGKILL were checked under
|
|
710
746
|
`bun build --compile`. Like any crash, a stall counts toward a new release's trial ([`agent-trial.ts`](src/agent-trial.ts)).
|
|
747
|
+
The stall is read on the monotonic clock, and the wall clock running ten seconds or more ahead of it between two checks
|
|
748
|
+
(Linux's monotonic clock stops while the machine sleeps, so only the wall clock shows the time away) is a sleep too:
|
|
749
|
+
either kind is logged as `watchdog: the agent was paused for N s (suspected sleep/resume, …)` and never counted, and a
|
|
750
|
+
real stall within ten minutes of one says how long after it came (2026-10-11).
|
|
751
|
+
|
|
752
|
+
### Why the agent before ended
|
|
753
|
+
|
|
754
|
+
Every way out of the agent writes `~/.intentic/machine/last-exit.json` ([`last-exit.ts`](src/resident/last-exit.ts)):
|
|
755
|
+
its own exits (a signal, a takeover, nothing to serve, an uncaught error), the watchdog's kill from its Worker, and
|
|
756
|
+
whoever stops it from outside (`run --stop`, a restart, an update) before the signal, since Windows runs none of the
|
|
757
|
+
agent's handlers then. The record is keyed by pid and only an open one is closed, so the stopper's reason is not
|
|
758
|
+
overwritten by the signal that carries it out. The next agent says it in `machine.log` at start and in `describe`; a
|
|
759
|
+
record left open is told apart by the machine's boot time against the last-alive stamp the agent writes each tick.
|
|
760
|
+
|
|
761
|
+
### The agent's own logs
|
|
762
|
+
|
|
763
|
+
`machine.log` is checked every ten minutes and, at 8 MB, copied to `machine.log.1` and cut in place
|
|
764
|
+
([`log-roll.ts`](src/resident/log-roll.ts)): the supervisor holds it open for appending, so a rename would leave its
|
|
765
|
+
lines going to the `.1` (or fail on Windows). The `device_logs` tool ([`tools/logs/logs.ts`](src/device/tools/logs/logs.ts))
|
|
766
|
+
lists `machine.log`(`.1`), `machine-update.log`, `audit.jsonl`(`.1`) and ic's per-run logs (`$INTENTIC_LOG_DIR`, else
|
|
767
|
+
`~/.intentic/logs`, newest first), and tails one by name, never by path: the last MB, with `grep`, `lines`, and for
|
|
768
|
+
the audit `tool` and `failedOnly`. It is gated like `sandbox_logs`. `describe` names the `ic` that answers (path,
|
|
769
|
+
version, file time) and the `IC_*`/`INTENTIC_*` variables in the agent's environment, secrets by length only.
|
|
711
770
|
|
|
712
771
|
## Key files
|
|
713
772
|
|
|
714
773
|
- [src/commands.ts](src/commands.ts) — the CLI: `device`, `sync`, `sandbox`, `run`, `status`, `doctor`, `upgrade`, `updates`, `uninstall`.
|
|
715
|
-
- [src/resident.ts](src/resident.ts) — the resident process that holds links, pairings and WSL distros.
|
|
774
|
+
- [src/resident/resident.ts](src/resident/resident.ts) — the resident process that holds links, pairings and WSL distros; `supervision.ts` beside it starts and stops it through whatever restarts this environment's agent.
|
|
716
775
|
- [src/device/mcp.ts](src/device/mcp.ts) — every tool a sandbox can call on this device.
|
|
717
776
|
- [src/device/policy.ts](src/device/policy.ts) — scope checks and the file-root boundary.
|
|
718
777
|
- [src/sync/endpoint.ts](src/sync/endpoint.ts) — how a pairing reaches its sandbox: the tunnelled sshd (`tunnel.ts`), or Docker for a project on this machine.
|
|
@@ -721,7 +780,7 @@ source text, so the compiled binary needs no second file; both it and the SIGKIL
|
|
|
721
780
|
- [src/sync/gone.ts](src/sync/gone.ts) — when a paired sandbox counts as gone; `gone-watch.ts` acts on it, `retire.ts` retires its pairings, `forget-command.ts` is `sync forget`.
|
|
722
781
|
- [src/environments/machine.ts](src/environments/machine.ts) — the Windows root and its WSL children.
|
|
723
782
|
- [src/upkeep/manifest.ts](src/upkeep/manifest.ts) — what the device upkeep finds and puts right; `reconcile.ts` runs it.
|
|
724
|
-
- [src/watchdog.ts](src/watchdog.ts) — the agent's own hang watchdog.
|
|
783
|
+
- [src/resident/watchdog.ts](src/resident/watchdog.ts) — the agent's own hang watchdog.
|
|
725
784
|
|
|
726
785
|
## Commands
|
|
727
786
|
|
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,
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,GAAG,6EAiBf,CAAC"}
|
package/dist/app.js
CHANGED
|
@@ -10,7 +10,7 @@ export const app = buildApplication(commands, {
|
|
|
10
10
|
text: {
|
|
11
11
|
...text_en,
|
|
12
12
|
formatException: agentException,
|
|
13
|
-
exceptionWhileRunningCommand: (exc) => `
|
|
13
|
+
exceptionWhileRunningCommand: (exc) => `error: ${agentException(exc)}`,
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
});
|
package/dist/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAM/C,MAAM,CAAC,MAAM,GAAG,GAAG,gBAAgB,CAAC,QAAQ,EAAE;IACtC,IAAI,EAAE,kBAAkB;IAGxB,WAAW,EAAE,EAAE,cAAc,EAAE,eAAe,EAAE;IAChD,OAAO,EAAE,EAAE,SAAS,EAAE,uBAAuB,EAAE;
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAM/C,MAAM,CAAC,MAAM,GAAG,GAAG,gBAAgB,CAAC,QAAQ,EAAE;IACtC,IAAI,EAAE,kBAAkB;IAGxB,WAAW,EAAE,EAAE,cAAc,EAAE,eAAe,EAAE;IAChD,OAAO,EAAE,EAAE,SAAS,EAAE,uBAAuB,EAAE;IAI/C,YAAY,EAAE;QACV,IAAI,EAAE;YACF,GAAG,OAAO;YACV,eAAe,EAAE,cAAc;YAC/B,4BAA4B,EAAE,CAAC,GAAY,EAAE,EAAE,CAAC,UAAU,cAAc,CAAC,GAAG,CAAC,EAAE;SAClF;KACJ;CACJ,CACJ,CAAC"}
|
|
@@ -8,6 +8,6 @@ export const MACHINE_AUTOSTART = {
|
|
|
8
8
|
launchAgent: { label: "dev.intentic.machine" },
|
|
9
9
|
detachedArgs: ["run"],
|
|
10
10
|
foregroundArgs: ["run", "--foreground"],
|
|
11
|
-
failureNote: (reason) => `
|
|
11
|
+
failureNote: (reason) => `Couldn't register this device's agent to start at login (${reason}); it runs until this device restarts, and starts again with intentic-machine run. Its log is ${runLogPath}.`,
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=autostart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autostart.js","sourceRoot":"","sources":["../../src/autostart/autostart.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,MAAM,CAAC,MAAM,iBAAiB,GAAkB;IAC5C,EAAE,EAAE,kBAAkB;IACtB,eAAe,EAAE,iBAAiB;IAClC,WAAW,EAAE,wBAAwB;IACrC,cAAc,EAAE,yFAAyF;IAEzG,OAAO,EAAE,UAAU;IACnB,WAAW,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE;IAC9C,YAAY,EAAE,CAAC,KAAK,CAAC;IACrB,cAAc,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC;IACvC,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CACpB,
|
|
1
|
+
{"version":3,"file":"autostart.js","sourceRoot":"","sources":["../../src/autostart/autostart.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,MAAM,CAAC,MAAM,iBAAiB,GAAkB;IAC5C,EAAE,EAAE,kBAAkB;IACtB,eAAe,EAAE,iBAAiB;IAClC,WAAW,EAAE,wBAAwB;IACrC,cAAc,EAAE,yFAAyF;IAEzG,OAAO,EAAE,UAAU;IACnB,WAAW,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE;IAC9C,YAAY,EAAE,CAAC,KAAK,CAAC;IACrB,cAAc,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC;IACvC,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CACpB,4DAA4D,MAAM,iGAAiG,UAAU,GAAG;CACvL,CAAC"}
|
package/dist/cli-ui.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Ui, type UiProcess } from "@intentic/local-agent";
|
|
2
|
+
import { buildCommand as stricliBuildCommand, type CommandContext } from "@stricli/core";
|
|
3
|
+
export declare const sandboxUrlOf: (url: string | undefined, sandbox: string | undefined, failed: string) => string;
|
|
4
|
+
export type Narration = Pick<Ui, "note" | "warn">;
|
|
5
|
+
export declare const machineUi: (process: UiProcess) => Ui;
|
|
6
|
+
export declare const answeringUi: (process: UiProcess, json: boolean) => Ui;
|
|
7
|
+
export declare const failRun: (context: CommandContext, error: unknown) => void;
|
|
8
|
+
export declare const markFailed: (context: CommandContext) => void;
|
|
9
|
+
export declare const buildCommand: typeof stricliBuildCommand;
|
|
10
|
+
//# sourceMappingURL=cli-ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-ui.d.ts","sourceRoot":"","sources":["../src/cli-ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACnG,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,KAAK,cAAc,EAAuB,MAAM,eAAe,CAAC;AAW9G,eAAO,MAAM,YAAY,QAAS,MAAM,GAAG,SAAS,WAAW,MAAM,GAAG,SAAS,UAAU,MAAM,KAAG,MASnG,CAAC;AAGF,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAKlD,eAAO,MAAM,SAAS,YAAa,SAAS,KAAG,EAQ9C,CAAC;AAQF,eAAO,MAAM,WAAW,YAAa,SAAS,QAAQ,OAAO,KAAG,EAc/D,CAAC;AAOF,eAAO,MAAM,OAAO,YAAa,cAAc,SAAS,OAAO,KAAG,IAGjE,CAAC;AAGF,eAAO,MAAM,UAAU,YAAa,cAAc,KAAG,IAIpD,CAAC;AAGF,eAAO,MAAM,YAAY,EAgBnB,OAAO,mBAAmB,CAAC"}
|
package/dist/cli-ui.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { agentException, createUi, explain } from "@intentic/local-agent";
|
|
2
|
+
import { buildCommand as stricliBuildCommand } from "@stricli/core";
|
|
3
|
+
import { MACHINE_VERSION } from "./version.js";
|
|
4
|
+
export const sandboxUrlOf = (url, sandbox, failed) => {
|
|
5
|
+
if (url !== undefined && sandbox !== undefined && url !== sandbox) {
|
|
6
|
+
throw new Error(explain(failed, `--url and --sandbox name two different sandboxes (${url}, ${sandbox}).`, "give one of them."));
|
|
7
|
+
}
|
|
8
|
+
const named = url ?? sandbox;
|
|
9
|
+
if (named === undefined || named.trim() === "") {
|
|
10
|
+
throw new Error(explain(failed, "no sandbox was named.", "pass --sandbox with the sandbox's address."));
|
|
11
|
+
}
|
|
12
|
+
return named;
|
|
13
|
+
};
|
|
14
|
+
const opened = new WeakMap();
|
|
15
|
+
export const machineUi = (process) => {
|
|
16
|
+
const known = opened.get(process);
|
|
17
|
+
if (known !== undefined) {
|
|
18
|
+
return known;
|
|
19
|
+
}
|
|
20
|
+
const ui = createUi(process, { stamp: `intentic-machine ${MACHINE_VERSION}` });
|
|
21
|
+
opened.set(process, ui);
|
|
22
|
+
return ui;
|
|
23
|
+
};
|
|
24
|
+
const aside = new WeakMap();
|
|
25
|
+
export const answeringUi = (process, json) => {
|
|
26
|
+
if (!json) {
|
|
27
|
+
return machineUi(process);
|
|
28
|
+
}
|
|
29
|
+
const known = aside.get(process);
|
|
30
|
+
if (known !== undefined) {
|
|
31
|
+
return known;
|
|
32
|
+
}
|
|
33
|
+
const ui = createUi({ stdout: process.stderr, stderr: process.stderr, env: process.env }, { stamp: `intentic-machine ${MACHINE_VERSION}` });
|
|
34
|
+
aside.set(process, ui);
|
|
35
|
+
return ui;
|
|
36
|
+
};
|
|
37
|
+
export const failRun = (context, error) => {
|
|
38
|
+
machineUi(context.process).fail(agentException(error));
|
|
39
|
+
markFailed(context);
|
|
40
|
+
};
|
|
41
|
+
export const markFailed = (context) => {
|
|
42
|
+
context.process.exitCode = 1;
|
|
43
|
+
};
|
|
44
|
+
export const buildCommand = ((builder) => {
|
|
45
|
+
if (!("func" in builder)) {
|
|
46
|
+
return stricliBuildCommand(builder);
|
|
47
|
+
}
|
|
48
|
+
const inner = builder.func;
|
|
49
|
+
return stricliBuildCommand({
|
|
50
|
+
...builder,
|
|
51
|
+
async func(...args) {
|
|
52
|
+
try {
|
|
53
|
+
return await inner.apply(this, args);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
failRun(this, error);
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
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AM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,OAAkD,EAAE,EAAE;IAChF,IAAI,CAAC,CAAC,MAAM,IAAI,OAAO,CAAC,EAAE,CAAC;QACvB,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAC3B,OAAO,mBAAmB,CAAC;QACvB,GAAG,OAAO;QACV,KAAK,CAAC,IAAI,CAAuB,GAAG,IAA8B;YAC9D,IAAI,CAAC;gBACD,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACzC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBACrB,OAAO,SAAS,CAAC;YACrB,CAAC;QACL,CAAC;KACJ,CAAC,CAAC;AACP,CAAC,CAA+B,CAAC"}
|
package/dist/commands.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAoJnE,eAAO,MAAM,QAAQ,kDAqBnB,CAAC"}
|
package/dist/commands.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { explain } from "@intentic/local-agent";
|
|
2
|
+
import { buildRouteMap } from "@stricli/core";
|
|
3
|
+
import { buildCommand, machineUi } from "./cli-ui.js";
|
|
4
|
+
import { runLogPath } from "./config.js";
|
|
2
5
|
import { deviceCommands, deviceUninstall } from "./device/commands.js";
|
|
3
6
|
import { sandboxRoutes } from "./device/sandbox-cli.js";
|
|
4
7
|
import { environmentRoutes, updates } from "./environments/commands.js";
|
|
5
8
|
import { realMachineIo, upgradeMachine } from "./environments/machine-upgrade.js";
|
|
6
|
-
import { runForeground } from "./resident.js";
|
|
7
|
-
import { readResident, restartResident, stopResident } from "./supervision.js";
|
|
9
|
+
import { runForeground } from "./resident/resident.js";
|
|
10
|
+
import { readResident, restartResident, stopResident } from "./resident/supervision.js";
|
|
8
11
|
import { status } from "./status.js";
|
|
9
12
|
import { syncCommands, syncUninstall } from "./sync/commands.js";
|
|
10
13
|
import { doctor } from "./upkeep/doctor.js";
|
|
14
|
+
import { upgradeLanded, upgradeStop } from "./upgrade.js";
|
|
11
15
|
import { MACHINE_VERSION } from "./version.js";
|
|
12
16
|
const run = buildCommand({
|
|
13
|
-
docs: { brief: "Restart this
|
|
17
|
+
docs: { brief: "Restart this device's agent: sandbox connections, file sync, port mirroring (setup starts it for you)" },
|
|
14
18
|
parameters: {
|
|
15
19
|
flags: {
|
|
16
20
|
foreground: { kind: "boolean", brief: "Run the agent in this terminal instead of the background" },
|
|
@@ -18,20 +22,26 @@ const run = buildCommand({
|
|
|
18
22
|
},
|
|
19
23
|
},
|
|
20
24
|
async func(flags) {
|
|
21
|
-
|
|
25
|
+
if (flags.foreground) {
|
|
26
|
+
await runForeground((message) => void this.process.stdout.write(`[${new Date().toISOString()}] ${message}\n`));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const ui = machineUi(this.process);
|
|
22
30
|
if (flags.stop) {
|
|
31
|
+
ui.act("Stopping the background agent");
|
|
23
32
|
const pid = await stopResident();
|
|
24
|
-
|
|
25
|
-
|
|
33
|
+
ui.note("It comes back at your next sign-in, and sooner if this device's supervisor notices it gone.");
|
|
34
|
+
ui.done(pid === undefined ? "The background agent was not running." : `Stopped the background agent (pid ${pid}).`);
|
|
35
|
+
ui.later([["stop it for good", "intentic-machine uninstall"]]);
|
|
26
36
|
return;
|
|
27
37
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
ui.act("Restarting the background agent");
|
|
39
|
+
await restartResident(ui.note);
|
|
40
|
+
const held = await readResident();
|
|
41
|
+
if (held === undefined) {
|
|
42
|
+
throw new Error(explain("The background agent did not come back up.", `it stopped while starting; its log is ${runLogPath}.`, "intentic-machine run --foreground"));
|
|
33
43
|
}
|
|
34
|
-
|
|
44
|
+
ui.done(`Restarted the background agent (pid ${held.pid}, ${held.build ?? "unknown build"}).`);
|
|
35
45
|
},
|
|
36
46
|
});
|
|
37
47
|
const version = buildCommand({
|
|
@@ -43,34 +53,59 @@ const version = buildCommand({
|
|
|
43
53
|
},
|
|
44
54
|
});
|
|
45
55
|
const upgrade = buildCommand({
|
|
46
|
-
docs: { brief: "
|
|
56
|
+
docs: { brief: "Update the agent on this whole device (Windows and every WSL distro on it) to the newest release" },
|
|
47
57
|
parameters: {
|
|
48
58
|
flags: {
|
|
49
59
|
force: {
|
|
50
60
|
kind: "boolean",
|
|
51
|
-
brief: "Install the published agent even over one built from source, or onto a release this
|
|
61
|
+
brief: "Install the published agent even over one built from source, or onto a release this device rolled back from (both otherwise left alone)",
|
|
52
62
|
},
|
|
53
63
|
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 },
|
|
54
64
|
},
|
|
55
65
|
},
|
|
56
66
|
async func(flags) {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
67
|
+
const ui = machineUi(this.process);
|
|
68
|
+
ui.act("Updating the agent on this device");
|
|
69
|
+
await upgradeMachine(realMachineIo(flags, ui.note), flags, ui.note, (ending) => upgradeEnded(ui, ending));
|
|
61
70
|
},
|
|
62
71
|
});
|
|
72
|
+
const upgradeEnded = (ui, ending) => {
|
|
73
|
+
if (ending.landed) {
|
|
74
|
+
ui.done(ending.said);
|
|
75
|
+
if (ending.outcome?.kind === "current" && ending.outcome.later !== undefined) {
|
|
76
|
+
ui.later([ending.outcome.later]);
|
|
77
|
+
}
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (ending.delegated === true) {
|
|
81
|
+
ui.close();
|
|
82
|
+
process.exitCode = 1;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (ending.legsFailed.length > 0 && (ending.outcome === undefined || upgradeLanded(ending.outcome))) {
|
|
86
|
+
throw new Error(explain("The agent was not updated on every side of this device.", `${ending.legsFailed.join(", ")} did not finish; the lines above say why.`, "intentic-machine upgrade"));
|
|
87
|
+
}
|
|
88
|
+
if (ending.outcome === undefined) {
|
|
89
|
+
throw new Error(explain("The agent was not updated.", "the release channel did not answer, and nothing was changed.", "check the network, then run the same command again."));
|
|
90
|
+
}
|
|
91
|
+
const stop = upgradeStop(ending.outcome);
|
|
92
|
+
throw new Error(explain(stop.headline, stop.problem, stop.fix));
|
|
93
|
+
};
|
|
63
94
|
const uninstall = buildCommand({
|
|
64
95
|
docs: { brief: "Remove this environment's agent: every sandbox link, every sync pairing, the login entry" },
|
|
65
96
|
parameters: {},
|
|
66
97
|
async func() {
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
await
|
|
98
|
+
const ui = machineUi(this.process);
|
|
99
|
+
ui.act("Removing the agent from this device");
|
|
100
|
+
ui.note(await syncUninstall(ui, undefined, { forGood: true }));
|
|
101
|
+
ui.note(await deviceUninstall(ui, undefined, { forGood: true }));
|
|
70
102
|
const still = await readResident();
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
103
|
+
if (still === undefined) {
|
|
104
|
+
ui.done("Removed the agent. Nothing intentic stays running on this device.");
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
ui.note("Run the uninstall inside each of this device's WSL distros to remove it entirely.");
|
|
108
|
+
ui.done(`Removed this side's links. The agent keeps running (pid ${still.pid}) only to keep this device's WSL distros running.`);
|
|
74
109
|
},
|
|
75
110
|
});
|
|
76
111
|
export const commands = buildRouteMap({
|
|
@@ -81,7 +116,7 @@ export const commands = buildRouteMap({
|
|
|
81
116
|
}),
|
|
82
117
|
sync: buildRouteMap({
|
|
83
118
|
routes: syncCommands,
|
|
84
|
-
docs: { brief: "Mirror a sandbox's files and ports onto this
|
|
119
|
+
docs: { brief: "Mirror a sandbox's files and ports onto this device (the Desktop sync card)" },
|
|
85
120
|
}),
|
|
86
121
|
sandbox: sandboxRoutes,
|
|
87
122
|
environment: environmentRoutes,
|
package/dist/commands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAW,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAuB,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAA0B,aAAa,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAC1G,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,eAA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ACtB,WAAW,EAAE,iBAAiB;QAC9B,GAAG;QACH,MAAM;QACN,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/daemon-base.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const resolveDaemonBase: (sandboxUrl: string, fetchImpl?: FetchIm
|
|
|
11
11
|
export interface WarmingAsk {
|
|
12
12
|
readonly doing: string;
|
|
13
13
|
readonly expired: string;
|
|
14
|
+
readonly say?: Log | undefined;
|
|
14
15
|
readonly attempts?: number | undefined;
|
|
15
16
|
readonly delayMs?: number | undefined;
|
|
16
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon-base.d.ts","sourceRoot":"","sources":["../src/daemon-base.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"daemon-base.d.ts","sourceRoot":"","sources":["../src/daemon-base.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAcjD,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAG5F,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,SAAS,KAAW,OAAO,CAAC,OAAO,CAWrH,CAAC;AAIF,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM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,WAAW,KAAG,OAAO,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,EAAE,CAC7B,CAAC"}
|
package/dist/daemon-base.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { anySignal } from "@intentic/base/async";
|
|
2
2
|
import { SANDBOX_ID, sandboxIdFromUrl } from "@intentic/sandbox-contract";
|
|
3
|
+
import { redeemWhileWarming } from "@intentic/sandbox-contract/pairing-redeem";
|
|
3
4
|
import { localDaemonUrlInsecure } from "@intentic/sandbox-run";
|
|
4
5
|
const PROBE_TIMEOUT_MS = 1500;
|
|
5
6
|
export const daemonIdOf = (sandboxUrl) => {
|
|
@@ -41,26 +42,28 @@ export const resolveDaemonBase = async (sandboxUrl, fetchImpl = fetch) => {
|
|
|
41
42
|
}
|
|
42
43
|
return { base: sandboxUrl.replace(/\/$/, ""), local: false };
|
|
43
44
|
};
|
|
45
|
+
const REDEEM_ATTEMPT_TIMEOUT_MS = 30_000;
|
|
44
46
|
export const postWhileWarming = async (sandboxUrl, path, init, ask) => {
|
|
45
|
-
const { doing, expired, attempts = 10, delayMs = 3000 } = ask;
|
|
46
|
-
|
|
47
|
+
const { doing, expired, say = () => undefined, attempts = 10, delayMs = 3000 } = ask;
|
|
48
|
+
const outcome = await redeemWhileWarming(async (_attempt, signal) => {
|
|
47
49
|
const { base } = await resolveDaemonBase(sandboxUrl);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
return fetch(`${base}${path}`, { ...init, method: "POST", signal: anySignal(signal, init.signal ?? undefined) });
|
|
51
|
+
}, {
|
|
52
|
+
attempts,
|
|
53
|
+
delayMs,
|
|
54
|
+
timeoutMs: REDEEM_ATTEMPT_TIMEOUT_MS,
|
|
55
|
+
onRetry: (attempt, why) => {
|
|
56
|
+
const said = why.kind === "unreachable" ? "the sandbox isn't reachable yet" : `the sandbox is warming up (HTTP ${why.status})`;
|
|
57
|
+
say(`${doing}: ${said}, retrying (${attempt}/${attempts})…`);
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
if (outcome.kind === "unreachable") {
|
|
61
|
+
throw outcome.error;
|
|
62
|
+
}
|
|
63
|
+
if (outcome.response.status === 401) {
|
|
64
|
+
throw new Error(expired);
|
|
63
65
|
}
|
|
66
|
+
return outcome.response;
|
|
64
67
|
};
|
|
65
68
|
export const PROMOTION_INTERVAL_MS = 60_000;
|
|
66
69
|
export const createDaemonBases = (log, fetchImpl = fetch, now = Date.now) => {
|
package/dist/daemon-base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon-base.js","sourceRoot":"","sources":["../src/daemon-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"daemon-base.js","sourceRoot":"","sources":["../src/daemon-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAQ/D,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAM9B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,UAAkB,EAAsB,EAAE;IACjE,MAAM,KAAK,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC3C,OAAO,KAAK,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7E,CAAC,CAAC;AAIF,MAAM,CAAC,MAA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AAO,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/device/audit.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,gBAAgB,QAAmB,CAAC;AA0BjD,eAAO,MAAM,SAAS,UAAgB,MAAM,UAAqB,MAAM,KAAsB,OAAO,CAAC,OAAO,CAAyD,CAAC;AAEtK,eAAO,MAAM,KAAK,UAAiB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,KAAG,OAAO,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/device/audit.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,gBAAgB,QAAmB,CAAC;AA0BjD,eAAO,MAAM,SAAS,UAAgB,MAAM,UAAqB,MAAM,KAAsB,OAAO,CAAC,OAAO,CAAyD,CAAC;AAEtK,eAAO,MAAM,KAAK,UAAiB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,KAAG,OAAO,CAAC,IAAI,CAa9F,CAAC"}
|
package/dist/device/audit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/device/audit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,OAAO,E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C,OAAO,KAAK,EAAE,CAAC;QAGb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,KAAK,CAAC,IAAI,OAAO,SAAS,KAAK,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7G,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { type Log } from "@intentic/local-agent";
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { type Log, type Ui } from "@intentic/local-agent";
|
|
2
|
+
import type { CommandContext } from "@stricli/core";
|
|
3
|
+
import { type Narration } from "../cli-ui.js";
|
|
4
|
+
export declare const enroll: (sandboxUrl: string, pairToken: string, say?: Log) => Promise<{
|
|
4
5
|
id: string;
|
|
5
6
|
token: string;
|
|
6
7
|
}>;
|
|
7
|
-
export declare const
|
|
8
|
+
export declare const linkNamed: (urls: readonly string[], value: string) => string;
|
|
9
|
+
export declare const deviceUninstall: (say: Narration, sandbox?: string, { forGood }?: {
|
|
8
10
|
readonly forGood?: boolean;
|
|
9
|
-
}) => Promise<
|
|
10
|
-
export declare const dropUnreachableLinks: (
|
|
11
|
+
}) => Promise<string>;
|
|
12
|
+
export declare const dropUnreachableLinks: (ui: Ui) => Promise<void>;
|
|
11
13
|
export declare const deviceCommands: {
|
|
12
14
|
setup: import("@stricli/core").Command<CommandContext>;
|
|
13
15
|
uninstall: import("@stricli/core").Command<CommandContext>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/device/commands.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/device/commands.ts"],"names":[],"mappings":"AAGA,OAAO,EAAW,KAAK,GAAG,EAAiB,KAAK,EAAE,EAAE,MAAM,uBAAuB,CAAC;AAElF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAA2B,KAAK,SAAS,EAAgB,MAAM,cAAc,CAAC;AAUrF,eAAO,MAAM,MAAM,eAAsB,MAAM,aAAa,MAAM,QAAQ,GAAG,KAAG,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAoBpH,CAAC;AAmHF,eAAO,MAAM,SAAS,SAAU,SAAS,MAAM,EAAE,SAAS,MAAM,KAAG,MASlE,CAAC;AAKF,eAAO,MAAM,eAAe,QAAe,SAAS,YAAY,MAAM,gBAAuB;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,KAAQ,OAAO,CAAC,MAAM,CAsBhJ,CAAC;AAeF,eAAO,MAAM,oBAAoB,OAAc,EAAE,KAAG,OAAO,CAAC,IAAI,CA2B/D,CAAC;AAEF,eAAO,MAAM,cAAc;;;;CAAgE,CAAC"}
|