@intentic/machine 1.316.0 → 1.318.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +198 -10
- package/dist/agent-trial.d.ts +25 -0
- package/dist/agent-trial.d.ts.map +1 -0
- package/dist/agent-trial.js +132 -0
- package/dist/agent-trial.js.map +1 -0
- package/dist/autostart/autostart.d.ts.map +1 -0
- package/dist/{autostart.js → autostart/autostart.js} +1 -1
- package/dist/autostart/autostart.js.map +1 -0
- package/dist/autostart/legacy-autostart.d.ts +4 -0
- package/dist/autostart/legacy-autostart.d.ts.map +1 -0
- package/dist/autostart/legacy-autostart.js +33 -0
- package/dist/autostart/legacy-autostart.js.map +1 -0
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +3 -1
- package/dist/commands.js.map +1 -1
- package/dist/device/grant.d.ts +322 -0
- package/dist/device/grant.d.ts.map +1 -0
- package/dist/device/grant.js +15 -0
- package/dist/device/grant.js.map +1 -0
- package/dist/device/loopback-catch.d.ts +3 -0
- package/dist/device/loopback-catch.d.ts.map +1 -0
- package/dist/device/loopback-catch.js +103 -0
- package/dist/device/loopback-catch.js.map +1 -0
- package/dist/device/mcp.d.ts.map +1 -1
- package/dist/device/mcp.js +5 -2
- package/dist/device/mcp.js.map +1 -1
- package/dist/device/router.d.ts +41 -2
- package/dist/device/router.d.ts.map +1 -1
- package/dist/device/router.js +23 -7
- package/dist/device/router.js.map +1 -1
- package/dist/device/sandbox-cli.d.ts +6 -0
- package/dist/device/sandbox-cli.d.ts.map +1 -0
- package/dist/device/sandbox-cli.js +76 -0
- package/dist/device/sandbox-cli.js.map +1 -0
- package/dist/device/sandbox-rounds/auto-backup.d.ts +13 -0
- package/dist/device/sandbox-rounds/auto-backup.d.ts.map +1 -0
- package/dist/device/sandbox-rounds/auto-backup.js +97 -0
- package/dist/device/sandbox-rounds/auto-backup.js.map +1 -0
- package/dist/device/sandbox-rounds/auto-prepare.d.ts +11 -0
- package/dist/device/sandbox-rounds/auto-prepare.d.ts.map +1 -0
- package/dist/device/sandbox-rounds/auto-prepare.js +20 -0
- package/dist/device/sandbox-rounds/auto-prepare.js.map +1 -0
- package/dist/device/sandbox-rounds/ic-rounds.d.ts +23 -0
- package/dist/device/sandbox-rounds/ic-rounds.d.ts.map +1 -0
- package/dist/device/sandbox-rounds/ic-rounds.js +78 -0
- package/dist/device/sandbox-rounds/ic-rounds.js.map +1 -0
- package/dist/device/sandbox-rounds/probation-watch.d.ts +32 -0
- package/dist/device/sandbox-rounds/probation-watch.d.ts.map +1 -0
- package/dist/device/sandbox-rounds/probation-watch.js +60 -0
- package/dist/device/sandbox-rounds/probation-watch.js.map +1 -0
- package/dist/device/sandbox-rounds/swap-records.d.ts +14 -0
- package/dist/device/sandbox-rounds/swap-records.d.ts.map +1 -0
- package/dist/device/sandbox-rounds/swap-records.js +45 -0
- package/dist/device/sandbox-rounds/swap-records.js.map +1 -0
- package/dist/device/tools/agent.d.ts +2 -2
- package/dist/device/tools/agent.d.ts.map +1 -1
- package/dist/device/tools/agent.js +14 -3
- package/dist/device/tools/agent.js.map +1 -1
- package/dist/device/tools/command-ledger.d.ts +14 -0
- package/dist/device/tools/command-ledger.d.ts.map +1 -0
- package/dist/device/tools/command-ledger.js +85 -0
- package/dist/device/tools/command-ledger.js.map +1 -0
- package/dist/device/tools/describe.d.ts +1 -1
- package/dist/device/tools/describe.d.ts.map +1 -1
- package/dist/device/tools/describe.js +2 -1
- package/dist/device/tools/describe.js.map +1 -1
- package/dist/device/tools/ic-binary.d.ts +1 -1
- package/dist/device/tools/ic-binary.d.ts.map +1 -1
- package/dist/device/tools/ic-binary.js +8 -3
- package/dist/device/tools/ic-binary.js.map +1 -1
- package/dist/device/tools/in-flight.d.ts +6 -0
- package/dist/device/tools/in-flight.d.ts.map +1 -0
- package/dist/device/tools/in-flight.js +26 -0
- package/dist/device/tools/in-flight.js.map +1 -0
- package/dist/device/tools/sandboxes.d.ts +14 -4
- package/dist/device/tools/sandboxes.d.ts.map +1 -1
- package/dist/device/tools/sandboxes.js +87 -27
- package/dist/device/tools/sandboxes.js.map +1 -1
- package/dist/device/tools/shell.d.ts +1 -0
- package/dist/device/tools/shell.d.ts.map +1 -1
- package/dist/device/tools/shell.js +15 -1
- package/dist/device/tools/shell.js.map +1 -1
- package/dist/environments/auto-upgrade.d.ts +2 -0
- package/dist/environments/auto-upgrade.d.ts.map +1 -1
- package/dist/environments/auto-upgrade.js +15 -0
- package/dist/environments/auto-upgrade.js.map +1 -1
- package/dist/environments/children.js +1 -1
- package/dist/environments/children.js.map +1 -1
- package/dist/environments/commands.d.ts +2 -0
- package/dist/environments/commands.d.ts.map +1 -1
- package/dist/environments/commands.js +46 -10
- package/dist/environments/commands.js.map +1 -1
- package/dist/environments/machine-upgrade.d.ts +2 -0
- package/dist/environments/machine-upgrade.d.ts.map +1 -1
- package/dist/environments/machine-upgrade.js +17 -2
- package/dist/environments/machine-upgrade.js.map +1 -1
- package/dist/environments/machine.d.ts +6 -0
- package/dist/environments/machine.d.ts.map +1 -1
- package/dist/environments/machine.js.map +1 -1
- package/dist/release.d.ts.map +1 -1
- package/dist/release.js +1 -6
- package/dist/release.js.map +1 -1
- package/dist/resident.d.ts +1 -0
- package/dist/resident.d.ts.map +1 -1
- package/dist/resident.js +30 -6
- package/dist/resident.js.map +1 -1
- package/dist/status.d.ts.map +1 -1
- package/dist/status.js +9 -4
- package/dist/status.js.map +1 -1
- package/dist/supervision.d.ts +1 -0
- package/dist/supervision.d.ts.map +1 -1
- package/dist/supervision.js +17 -1
- package/dist/supervision.js.map +1 -1
- package/dist/sync/commands.d.ts +19 -0
- package/dist/sync/commands.d.ts.map +1 -1
- package/dist/sync/commands.js +117 -23
- package/dist/sync/commands.js.map +1 -1
- package/dist/sync/config.d.ts +12 -1
- package/dist/sync/config.d.ts.map +1 -1
- package/dist/sync/config.js +45 -1
- package/dist/sync/config.js.map +1 -1
- package/dist/sync/folders.d.ts +8 -0
- package/dist/sync/folders.d.ts.map +1 -0
- package/dist/sync/folders.js +34 -0
- package/dist/sync/folders.js.map +1 -0
- package/dist/sync/git-bridge.d.ts +1 -1
- package/dist/sync/git-bridge.d.ts.map +1 -1
- package/dist/sync/git-bridge.js +2 -1
- package/dist/sync/git-bridge.js.map +1 -1
- package/dist/sync/mirror.d.ts +3 -1
- package/dist/sync/mirror.d.ts.map +1 -1
- package/dist/sync/mirror.js +72 -20
- package/dist/sync/mirror.js.map +1 -1
- package/dist/sync/mutagen.d.ts +29 -5
- package/dist/sync/mutagen.d.ts.map +1 -1
- package/dist/sync/mutagen.js +86 -31
- package/dist/sync/mutagen.js.map +1 -1
- package/dist/sync/project-commands.d.ts +23 -0
- package/dist/sync/project-commands.d.ts.map +1 -0
- package/dist/sync/project-commands.js +212 -0
- package/dist/sync/project-commands.js.map +1 -0
- package/dist/sync/project-files.d.ts +42 -0
- package/dist/sync/project-files.d.ts.map +1 -0
- package/dist/sync/project-files.js +110 -0
- package/dist/sync/project-files.js.map +1 -0
- package/dist/sync/project-local.d.ts +46 -0
- package/dist/sync/project-local.d.ts.map +1 -0
- package/dist/sync/project-local.js +217 -0
- package/dist/sync/project-local.js.map +1 -0
- package/dist/sync/project-remote.d.ts +55 -0
- package/dist/sync/project-remote.d.ts.map +1 -0
- package/dist/sync/project-remote.js +261 -0
- package/dist/sync/project-remote.js.map +1 -0
- package/dist/sync/project-transfer.d.ts +52 -0
- package/dist/sync/project-transfer.d.ts.map +1 -0
- package/dist/sync/project-transfer.js +278 -0
- package/dist/sync/project-transfer.js.map +1 -0
- package/dist/sync/report.d.ts.map +1 -1
- package/dist/sync/report.js +6 -4
- package/dist/sync/report.js.map +1 -1
- package/dist/sync/residue.d.ts.map +1 -1
- package/dist/sync/residue.js +2 -1
- package/dist/sync/residue.js.map +1 -1
- package/dist/sync/restore-points.d.ts +72 -0
- package/dist/sync/restore-points.d.ts.map +1 -0
- package/dist/sync/restore-points.js +154 -0
- package/dist/sync/restore-points.js.map +1 -0
- package/dist/sync/ssh.d.ts +6 -0
- package/dist/sync/ssh.d.ts.map +1 -1
- package/dist/sync/ssh.js +41 -3
- package/dist/sync/ssh.js.map +1 -1
- package/dist/sync/swap-pause.d.ts +10 -0
- package/dist/sync/swap-pause.d.ts.map +1 -0
- package/dist/sync/swap-pause.js +29 -0
- package/dist/sync/swap-pause.js.map +1 -0
- package/dist/sync/symlinks.d.ts +8 -0
- package/dist/sync/symlinks.d.ts.map +1 -0
- package/dist/sync/symlinks.js +30 -0
- package/dist/sync/symlinks.js.map +1 -0
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +18 -7
- package/dist/upgrade.js.map +1 -1
- package/package.json +8 -8
- package/dist/autostart.d.ts.map +0 -1
- package/dist/autostart.js.map +0 -1
- package/dist/device/auto-prepare.d.ts +0 -18
- package/dist/device/auto-prepare.d.ts.map +0 -1
- package/dist/device/auto-prepare.js +0 -85
- package/dist/device/auto-prepare.js.map +0 -1
- /package/dist/{autostart.d.ts → autostart/autostart.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -23,39 +23,227 @@ flowchart LR
|
|
|
23
23
|
`ic sandbox list --json` passed through, and start, stop, restart, the swaps, `set-shape`, `forget-shape` and the
|
|
24
24
|
logs are ic's own verbs, argv spelled by the contract (`icShapeArgs`, `icPowerArgs`). The shape reaches ic as the
|
|
25
25
|
contract's own object (`--set memoryGib=12`), so no flag of ic's is spelled here; the old `reshape` op is carried
|
|
26
|
-
out through the same verb.
|
|
26
|
+
out through the same verb. A rollback's `to` becomes `ic sandbox rollback <slug> --to <version>`. A sandbox an
|
|
27
|
+
interrupted swap left parked is listed under its own slug and found like any other, so start, rollback and update
|
|
28
|
+
reach it; a listing field a newer ic writes in a way this agent cannot read costs that field, not the whole
|
|
29
|
+
listing. Nothing here runs docker or reads the shape saved for a sandbox's next restart; ic
|
|
27
30
|
answers both. Before its first `ic` call the agent makes
|
|
28
31
|
sure the installed `ic` is at least as new as itself, fetching its own release's into `~/.intentic/ic/bin` when it
|
|
29
32
|
is not ([`tools/ic-binary.ts`](src/device/tools/ic-binary.ts)), since a new verb here arrives with a new verb there.
|
|
30
33
|
A fetch that fails is logged with its reason and reported in the device's facts (`icOutOfDate`, beside `features`),
|
|
31
34
|
so a stale `ic` explains why logs and saving a shape are missing; the next sandbox action tries again.
|
|
32
35
|
- **sync** (`src/sync/`): `sync setup` enrolls an SSH key and runs Mutagen against the sandbox's sshd, reached
|
|
33
|
-
through a loopback port tunnelled over a WebSocket. It keeps a folder two-way synced
|
|
34
|
-
port to the same localhost port, and fast-forwards local git clones from the sandbox.
|
|
36
|
+
through a loopback port tunnelled over a WebSocket. It keeps a folder two-way synced (a project copy-first, below),
|
|
37
|
+
forwards every workspace port to the same localhost port, and fast-forwards local git clones from the sandbox.
|
|
38
|
+
- A **project pairing** (`sync setup --remote-dir /work/<name> --project`, what the desktop app asks for when it
|
|
39
|
+
makes a sandbox for a folder the owner picked) syncs that folder with `/work/<name>` rather than `/work`, and nothing
|
|
40
|
+
of the sandbox's is written into it: no state backup session, no git bridge, and an ignore list that keeps a
|
|
41
|
+
project's own `.intentic/` and `refs/` ([`sync/config.ts`](src/sync/config.ts) holds a remote dir to those two
|
|
42
|
+
shapes, and refuses `sync.json` whole otherwise). `setup` refuses a folder that is, holds or sits inside another
|
|
43
|
+
sandbox's, and a set-up-again that would change where a paired sandbox's folder syncs. It is **copy-first** unless
|
|
44
|
+
its owner opted into two-way: see [Copy-first projects](#copy-first-projects).
|
|
45
|
+
- Only the resident agent creates Mutagen sessions: `setup` records the pairing and waits for the session to
|
|
46
|
+
appear, since two creators racing left one name holding two identical sessions. The agent keeps one session per
|
|
47
|
+
name, terminating any extras, and recreates a session whose rules drifted (its ignores, its folders, its sync mode,
|
|
48
|
+
its symlink mode). A two-way session replaced by another waits until no conflicts are left and has its derived
|
|
49
|
+
residue swept first; every other replacement happens as soon as the sandbox answers (`settlesFirst` in
|
|
50
|
+
[`sync/mutagen.ts`](src/sync/mutagen.ts) says why for each).
|
|
51
|
+
- `setup` replaces what this agent's `known_hosts` holds for the pairing's alias (hashed entries included): with the
|
|
52
|
+
host key the enrollment carries when it carries one (a sandbox reads its sshd's public key off its history volume and
|
|
53
|
+
answers with it, `SyncEnrollmentAnswerSchema` in the contract), else with nothing, so `accept-new` records the key
|
|
54
|
+
the sandbox presents now, as it does for an older sandbox. Outside an enrollment a changed key is still refused. A sandbox whose ports poll has failed for ten
|
|
55
|
+
minutes has its forwards taken off localhost, and they come back with its first answer. `sync uninstall` stops and
|
|
56
|
+
unregisters Mutagen's daemon only when it is this agent's own copy, never a Mutagen the user installed.
|
|
57
|
+
- Symbolic links travel only where the device can create them ([`sync/symlinks.ts`](src/sync/symlinks.ts)). A
|
|
58
|
+
Windows PC without Developer Mode refuses every link, and Mutagen would try again on every cycle, so its sessions
|
|
59
|
+
use `--symlink-mode ignore`. Turning Developer Mode on brings them back at the agent's next start.
|
|
35
60
|
- **Which computer this is** ([`machine-id.ts`](src/machine-id.ts)): a `machineId` minted once at install and kept
|
|
36
61
|
in `~/.intentic/machine/machine-id`, sent in the connect-time facts, the sync report and the sync enrollment. The
|
|
37
62
|
Windows side hands its own to the agent it starts in each distro, so every OS install of one PC answers with one id;
|
|
38
63
|
a sandbox joins enrollments, sync enrollments and device rows on it, never on a hostname.
|
|
39
|
-
- The features a device advertises (`set-shape`, `reshape-later`) are read off the `ic` under it, from
|
|
40
|
-
help (
|
|
41
|
-
an op or field this agent does not know is refused
|
|
42
|
-
|
|
64
|
+
- The features a device advertises (`set-shape`, `reshape-later`, `rollback-to`) are read off the `ic` under it, from
|
|
65
|
+
that `ic`'s own help (`ic sandbox shape --set` for the first two, `ic sandbox rollback --to` for the third), rather
|
|
66
|
+
than listed beside the code. The device RPC inputs are strict, so an op or field this agent does not know is refused
|
|
67
|
+
rather than dropped, and a `to` on anything but a rollback is refused. The one exception is the grant a sandbox
|
|
68
|
+
pushes ([`device/grant.ts`](src/device/grant.ts)): a switch this agent does not know is left off and logged once per
|
|
69
|
+
link, since refusing the grant dropped the link and the sandbox redialled it forever. A known switch with a value it
|
|
70
|
+
has no meaning for is still refused. `reshape-later` and the old `reshape` op stay only for pages and daemons from
|
|
71
|
+
before `set-shape` (v1.312.0 and older), and go in v1.314.0.
|
|
43
72
|
- Every path under the user's home goes through `homeDir()` from [local-agent](../local-agent), which follows a `HOME`
|
|
44
73
|
set after startup; a test holds the sources to it.
|
|
45
74
|
- Scopes are enforced here and nowhere else: the sandbox only asks, and a refusal names the switch that is off.
|
|
46
75
|
Files stay inside the configured roots, writes need their own switch, and every call is appended to
|
|
47
76
|
`~/.intentic/machine/audit.jsonl`. While an agent drives input on Windows, a notice shows on screen and
|
|
48
|
-
`PAUSE_HOTKEY` pauses every link.
|
|
49
|
-
|
|
77
|
+
`PAUSE_HOTKEY` pauses every link. The one door behind no switch is this agent's own Update and Restart
|
|
78
|
+
(`runAgentFlow`, [`device/tools/agent.ts`](src/device/tools/agent.ts)): no agent tool reaches it, and the sandbox
|
|
79
|
+
admits only a maintainer to it, so the owner's maintenance does not wait on the agents' "Run commands" (2026-09-29;
|
|
80
|
+
it rode that switch before, and an owner had to widen what agents may do to update the agent).
|
|
81
|
+
- Every connection dials out; the only listeners are on loopback. One of them is short-lived: while a sandbox's
|
|
82
|
+
sign-in is open, [`device/loopback-catch.ts`](src/device/loopback-catch.ts) listens on the
|
|
83
|
+
`http://localhost:<port>/…` address the provider redirects to, the one a CLI running here would have held, and
|
|
84
|
+
streams each landing back (`catchLoopback`, advertised as the `loopback-catch` feature). It checks nothing: the state
|
|
85
|
+
and the PKCE verifier stay in the sandbox, which alone can tell the sign-in from anything else that hits the port. A
|
|
86
|
+
taken port answers `busy`, and the sandbox leaves the paste to the person.
|
|
50
87
|
- On Windows the Windows side is the root of the PC (`src/environments/`): it holds one `wsl.exe` session per
|
|
51
88
|
distro with an agent, and `upgrade` brings every environment to the same release. The root also updates itself
|
|
52
89
|
on a timer and pre-downloads sandbox updates with `ic sandbox prepare --auto`.
|
|
53
90
|
- The install shims only put a first binary down and run `setup`; `install.ts` decides the rest. `status --json`
|
|
54
91
|
is what the desktop app's tray reads.
|
|
55
92
|
|
|
93
|
+
### Copy-first projects
|
|
94
|
+
|
|
95
|
+
A project's folder flows **one way**, this device to the sandbox, so nothing an agent does in `/work/<name>` (an
|
|
96
|
+
`rm -rf` included) reaches the owner's files. What an agent changed comes back only when the owner asks, through
|
|
97
|
+
`sync bring-back`, which keeps a restore point first. Two-way stays one switch away.
|
|
98
|
+
|
|
99
|
+
- **Direction** is the pairing's `direction` in `sync.json`: `"to-sandbox"` (Mutagen's `one-way-safe`, this device as
|
|
100
|
+
alpha) or `"both"` (`two-way-safe`, as every workspace pairing). Absent, as on every project paired before it existed,
|
|
101
|
+
means `"to-sandbox"`, and so does a value this build has no word for; it means nothing on a workspace pairing
|
|
102
|
+
([`sync/config.ts`](src/sync/config.ts) `projectDirection`). An older agent keeps the field through every write but a
|
|
103
|
+
`setup` (which resets it, with the pairing's other switches), and keeps the copy-first session it finds, since it never
|
|
104
|
+
compared sync modes. `sync direction` rewrites the field; the watcher sees the new mode on its next tick and recreates
|
|
105
|
+
the session (`sessionMatchesSpec` compares the live session's `mode`).
|
|
106
|
+
- **Replacements** into copy-first happen at once, conflicts or not, with no flush and no residue sweep: a last flush
|
|
107
|
+
of a two-way session would carry the sandbox's latest changes into the folder, and the new session never writes here.
|
|
108
|
+
Out of copy-first too: a one-way session's conflicts are the agent's kept edits, which differ whoever holds them. This
|
|
109
|
+
is how every existing project becomes copy-first on its first start of this build.
|
|
110
|
+
|
|
111
|
+
**What one-way-safe does**, measured with Mutagen 0.18.1 over ssh against an sshd whose `/work` was a scratch folder,
|
|
112
|
+
driving this agent's own session code and CLI (alpha is this device, beta the sandbox):
|
|
113
|
+
|
|
114
|
+
| The sandbox (an agent)… | Mutagen one-way-safe |
|
|
115
|
+
|---|---|
|
|
116
|
+
| edits a file this folder has | keeps the sandbox's version and reports it as a conflict; this folder is untouched |
|
|
117
|
+
| creates a file | keeps it in the sandbox, no conflict; nothing reaches this folder |
|
|
118
|
+
| deletes a file or a folder | puts it back from this folder on the next cycle |
|
|
119
|
+
| runs `rm -rf /work/<name>/*`, or removes `/work/<name>` | refills the sandbox's copy from this folder; this folder is untouched |
|
|
120
|
+
|
|
121
|
+
| This device… | Mutagen one-way-safe |
|
|
122
|
+
|---|---|
|
|
123
|
+
| edits, creates or deletes a file | carries it to the sandbox, except over a file the sandbox changed, which is kept |
|
|
124
|
+
| deletes a file the sandbox changed | the sandbox keeps its version, and the conflict clears |
|
|
125
|
+
|
|
126
|
+
A fresh session over two copies that already differ (what any replacement starts from) deletes nothing on either side.
|
|
127
|
+
One-way-safe copies what only this folder has into the sandbox and keeps every sandbox file that differs, as a conflict.
|
|
128
|
+
Two-way-safe also copies what only the sandbox has into this folder, and reports what differs on both as a conflict.
|
|
129
|
+
`mutagen sync list --template '{{json .}}'` prints the mode as a top-level `mode`, absent on a session created without
|
|
130
|
+
`--sync-mode`, which Mutagen runs two-way-safe.
|
|
131
|
+
|
|
132
|
+
**The commands**, all under `intentic-machine sync`, name the project by `--dir <its folder>` (links resolved, case
|
|
133
|
+
folded where the platform folds it). With `--json` each prints exactly one JSON object on stdout, and on failure
|
|
134
|
+
`{ "ok": false, "error": "<sentence>" }` with exit code 1. The desktop app parses these, so fields are only ever added.
|
|
135
|
+
|
|
136
|
+
| Command | Success output |
|
|
137
|
+
|---|---|
|
|
138
|
+
| `sync changes` | `{ "ok": true, "pairing": "<id>", "direction": "to-sandbox"\|"both", "changes": [{ "path", "kind": "added"\|"modified"\|"deleted", "size"?, "conflict"?: true }], "truncated"?: true }` |
|
|
139
|
+
| `sync bring-back [--path <p>]... [--paths-file <file>]` | `{ "ok": true, "point": "<id>", "applied": [{ "path", "kind" }], "skipped": [{ "path", "reason" }] }` |
|
|
140
|
+
| `sync restore-points` | `{ "ok": true, "points": [{ "id", "createdAt", "entries": n }] }` |
|
|
141
|
+
| `sync restore --point <id>` | `{ "ok": true, "restored": n, "skipped": [{ "path", "reason" }] }` |
|
|
142
|
+
| `sync direction <to-sandbox\|both>` | `{ "ok": true, "direction": "…" }` |
|
|
143
|
+
|
|
144
|
+
- **`sync changes`** lists what the sandbox did, relative paths with `/`, sorted, the first 5,000 (`truncated` when
|
|
145
|
+
there were more): `added` exists only in the sandbox's copy, `modified` on both with different content (`size` is the
|
|
146
|
+
sandbox copy's), `deleted` was removed there. The sandbox is listed by ONE command over the pairing's ssh alias, a
|
|
147
|
+
node program that walks `/work/<name>` and prints path, size and sha256 NUL-separated, so any name survives. This
|
|
148
|
+
device is walked the same way, reading a file only where its size matches the sandbox's, through a hash cache keyed
|
|
149
|
+
by path, size and times in `~/.intentic/machine/hashes/<pairing>.json`. Both walks prune by the pairing's ignore list
|
|
150
|
+
read as Mutagen reads it: a name, `*` within it, at any depth (or at the root with a leading `/`), taking a matched
|
|
151
|
+
folder's contents along; any other spelling is refused rather than approximated. Mutagen's `.mutagen-temporary-*`
|
|
152
|
+
scratch files are left out too, and so are links and anything else that is not a regular file, on either side.
|
|
153
|
+
- **Whose change it is, and never over a newer edit.** The same cache file records each path's content when both
|
|
154
|
+
copies were last seen equal. A difference the sandbox did not move away from (an edit made here, still on its way) is
|
|
155
|
+
not listed at all. A file only this device holds is offered as `deleted` only when that record shows the sandbox had
|
|
156
|
+
exactly this copy. A `modified` file is written over here only when this device's copy is still what the two last
|
|
157
|
+
agreed on, which only a session that was running and whose flush just finished a whole cycle can show. Mutagen's own
|
|
158
|
+
record says so for the files it reports in conflict (ten at most, each with SHA-1 digests of what the two last agreed
|
|
159
|
+
on and of this device's copy, the latter checked against the file here now); the listing record says so for the rest.
|
|
160
|
+
Anything else is listed with `conflict: true` and skipped by bring-back with its reason, even when named by `--path`:
|
|
161
|
+
both copies moved (a record gone stale while the sync was paused, say, with the owner's own older version in the
|
|
162
|
+
sandbox), no record of the two ever agreeing on it, or a session that was paused, absent, or whose flush did not
|
|
163
|
+
finish. Since one-way-safe puts an agent's deletions back, `deleted` shows up mainly while the session is paused, and
|
|
164
|
+
a rename in the sandbox comes back as an addition (the old name is put back there). The record is written only by
|
|
165
|
+
whoever holds the folder's lock, so a listing beside a running bring-back never undoes what that one recorded.
|
|
166
|
+
- **`sync bring-back`** runs with the session paused (after a flush) if it was running, and leaves one somebody paused
|
|
167
|
+
as it is. It lists both sides and fetches the `added` and `modified` files in ONE ssh stream into a private staging
|
|
168
|
+
folder, each checked against the listing's sha256 (a file that changed since is skipped with the reason). Then it
|
|
169
|
+
writes the restore point, and only then touches the folder: each file renamed into place from a copy beside it, only
|
|
170
|
+
where the folder still holds what the point kept of it. `deleted` files are removed with the folders they leave
|
|
171
|
+
empty. `--path` takes a file or a folder, repeatable; `--paths-file` names a UTF-8 file holding a JSON array of such
|
|
172
|
+
paths (a Windows command line holds 32,767 characters, fewer than a long selection), taken together with any
|
|
173
|
+
`--path`. An unreadable file, one that is not such an array, or an empty one (which would otherwise mean every change)
|
|
174
|
+
is refused before anything is listed. A new file gets the sandbox copy's executable bit. Nothing is written through a
|
|
175
|
+
link: every folder on the way is checked.
|
|
176
|
+
- **Why the session pushes nothing stale back.** Paused, it runs no cycle between the listing, the fetch and the writes,
|
|
177
|
+
and on resume it rescans both sides. What was written here is byte for byte the sandbox's, so both sides moved from
|
|
178
|
+
their last agreement to the same content: Mutagen records that and transfers nothing. A sandbox file that changed
|
|
179
|
+
again meanwhile is a sandbox modification one-way-safe keeps, as a conflict. The e2e run checked all of it: no
|
|
180
|
+
conflicts after resume, the sandbox still holding the agent's content, and a later edit here carried over as usual.
|
|
181
|
+
- **Restore points** live in `~/.intentic/machine/restore/<pairing>/<id>/`, the id being the creation time in ISO 8601
|
|
182
|
+
basic format (`20260928T213000.123Z`, a folder name on every system). Each holds `manifest.json`, which is
|
|
183
|
+
`{ id, createdAt, dir, entries: [{ path, kind, backedUp, applied, backup?, mode? }] }` (`applied` is the sha256
|
|
184
|
+
bring-back left, null for a deletion), and `files/<path>`, a copy of every file bring-back overwrote or deleted. Only
|
|
185
|
+
what was actually written stays in the manifest. All of it is on the disk before the first write here: each copy is
|
|
186
|
+
flushed as it is made, the manifest by a durable write, then every folder of the point up to `restore/<pairing>`, so a
|
|
187
|
+
crash right after a bring-back never finds the folder rewritten and the copies empty. Files put in the folder are
|
|
188
|
+
flushed before the rename that places them.
|
|
189
|
+
- **Retention**, after each bring-back and under its lock: a pairing keeps its newest 20 points that hold files, plus
|
|
190
|
+
every such point younger than 30 days. A point that holds nothing (a bring-back that wrote nothing, or one cut off
|
|
191
|
+
before its manifest) never counts toward the 20, is never listed, and goes at the next bring-back. Until then it is
|
|
192
|
+
the `point` that bring-back answered with, so that answer always names a real point, as the desktop app expects.
|
|
193
|
+
- **`sync restore --point <id>`** puts each backed-up file back and removes each file bring-back added, where the
|
|
194
|
+
folder still holds exactly what bring-back left (by sha256). Anything else is skipped and reported, one already put
|
|
195
|
+
back included. Copy-first then carries the restored files to the sandbox, as it does any edit here, so the agent's
|
|
196
|
+
versions they replace are gone from there too.
|
|
197
|
+
- One bring-back or restore runs per folder at a time (`restore/<pairing>/.operation.pid`, a pid of this boot, checked
|
|
198
|
+
alive). A pause an operation made and never lifted (the process killed in between) is recorded in
|
|
199
|
+
`restore/<pairing>/.paused`, and the next command about that folder resumes the session.
|
|
200
|
+
|
|
201
|
+
### Upgrades that can be undone
|
|
202
|
+
|
|
203
|
+
- **A swap is never cut short by this agent.** `ic` runs in a process group of its own on POSIX, keeps its pipes, and
|
|
204
|
+
is never killed when the link or request that asked for it goes away. Every restart of the agent (the auto-upgrade
|
|
205
|
+
tick, `upgrade`, `run`, the browser's Update and Restart) waits while any channel record in this environment's ic
|
|
206
|
+
home (`INTENTIC_HOME`, else `~/.intentic`) says `swap_phase=cutover` with `swap_at` in the last 30 minutes, or while
|
|
207
|
+
this process runs a flow that moves a container ([`device/sandbox-rounds/swap-records.ts`](src/device/sandbox-rounds/swap-records.ts)); the tick
|
|
208
|
+
looks again in five minutes, a command waits and says so.
|
|
209
|
+
- **The probation watch** ([`device/sandbox-rounds/probation-watch.ts`](src/device/sandbox-rounds/probation-watch.ts)) runs
|
|
210
|
+
`ic sandbox watch <slug> --json` every minute for each sandbox whose record names a `swap_phase`, and
|
|
211
|
+
`ic sandbox watch --json` over every sandbox half a minute after start (a reboot mid-swap) and every ten minutes.
|
|
212
|
+
ic finishes or undoes an interrupted cutover and rolls a failing new version back; the agent logs what it did.
|
|
213
|
+
The per-record watch runs in every environment, since only the environment that swapped holds the record; the sweep
|
|
214
|
+
over every sandbox runs on the root only, as the daily jobs below do, because a WSL distro shares the Windows
|
|
215
|
+
side's Docker engine.
|
|
216
|
+
- **Daily**, on the root: `ic sandbox backup <slug> --auto --json` for each running sandbox, one at a time, twenty to
|
|
217
|
+
forty minutes after start and then every day, then one `ic sandbox tidy --json`, whose volumes nobody claims are
|
|
218
|
+
named and never deleted. Both back off from a slug that keeps failing, as auto-prepare does, and each has its switch
|
|
219
|
+
beside the update ones (`intentic-machine updates --backups off`, `--tidy off`).
|
|
220
|
+
- **File sync holds still while its sandbox is swapped here** ([`sync/swap-pause.ts`](src/sync/swap-pause.ts)). A
|
|
221
|
+
pairing's local slug is the first label of its sandbox's public hostname (what ic names a sandbox with one) or the
|
|
222
|
+
id in it (what ic names one from its connect token), so the mapping is exact. Its sessions are paused through the
|
|
223
|
+
cutover and the first quarter hour of probation, and past that while the sandbox does not answer, then resumed; a
|
|
224
|
+
pause somebody made is left alone. Only this environment's records count: a distro syncing a sandbox the Windows side
|
|
225
|
+
swaps is not paused.
|
|
226
|
+
- **A self-update is kept undoable** ([`agent-trial.ts`](src/agent-trial.ts)). The replaced binary stays as
|
|
227
|
+
`<bin>.previous` until the new agent has run for ten minutes and written its "healthy since" marker. Three starts of a
|
|
228
|
+
release within ten minutes, none ended by a stop, restart or upgrade, put `.previous` back (at that start, or at the
|
|
229
|
+
next upgrade pass) and record the release as `skippedAgent` in `machine.json`: neither the auto-upgrade nor an
|
|
230
|
+
`upgrade` moves this environment onto it again until a newer one is published (`upgrade --force` does). A restart
|
|
231
|
+
that throws during an upgrade puts the old binary back too.
|
|
232
|
+
- **What the agent leaves behind.** Under a systemd user unit the default `KillMode` ended the unit's whole cgroup on
|
|
233
|
+
every `systemctl stop` and every agent exit, `ic` mid-swap included: the unit now says `KillMode=process`, and a
|
|
234
|
+
unit an older build wrote is rewritten at the agent's next start, since a repair now replaces an entry that starts
|
|
235
|
+
this same agent with other settings. What outlives the agent on purpose is `ic` (bounded by its own swap), Mutagen's
|
|
236
|
+
daemon and the browser it opened; what must not, the agent ends itself: every `run_command` group still running
|
|
237
|
+
when it stops, and on Linux the groups a crashed agent left, which the next agent ends at its start
|
|
238
|
+
([`tools/command-ledger.ts`](src/device/tools/command-ledger.ts)). The login entries of the two agents this one
|
|
239
|
+
replaced on 2026-08-29 (`intentic-host`, the sync mirror) are removed once, at start.
|
|
240
|
+
- `intentic-machine sandbox <verb> [slug]` passes `list`, `start`, `stop`, `restart`, `update`, `rollback [--to]`,
|
|
241
|
+
`versions`, `logs`, `doctor`, `watch`, `backup` and `backups` straight to ic, in this terminal, with ic's exit code:
|
|
242
|
+
a sandbox can be looked at and repaired from here when no browser reaches it.
|
|
243
|
+
|
|
56
244
|
## Key files
|
|
57
245
|
|
|
58
|
-
- [src/commands.ts](src/commands.ts) — the CLI: `device`, `sync`, `run`, `status`, `upgrade`, `uninstall`.
|
|
246
|
+
- [src/commands.ts](src/commands.ts) — the CLI: `device`, `sync`, `sandbox`, `run`, `status`, `upgrade`, `updates`, `uninstall`.
|
|
59
247
|
- [src/resident.ts](src/resident.ts) — the resident process that holds links, pairings and WSL distros.
|
|
60
248
|
- [src/device/mcp.ts](src/device/mcp.ts) — every tool a sandbox can call on this device.
|
|
61
249
|
- [src/device/policy.ts](src/device/policy.ts) — scope checks and the file-root boundary.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Log } from "@intentic/local-agent";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export declare const HEALTHY_AFTER_MS: number;
|
|
4
|
+
export declare const CRASH_LOOP_STARTS = 3;
|
|
5
|
+
declare const StartLedgerSchema: z.ZodObject<{
|
|
6
|
+
version: z.ZodString;
|
|
7
|
+
starts: z.ZodArray<z.ZodObject<{
|
|
8
|
+
at: z.ZodNumber;
|
|
9
|
+
pid: z.ZodNumber;
|
|
10
|
+
clean: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type StartLedger = z.infer<typeof StartLedgerSchema>;
|
|
14
|
+
export declare const withStart: (ledger: StartLedger | undefined, version: string, pid: number, now: number) => StartLedger;
|
|
15
|
+
export declare const withCleanExit: (ledger: StartLedger, pid: number) => StartLedger;
|
|
16
|
+
export declare const crashLooping: (ledger: StartLedger, healthy: string | undefined, now: number) => boolean;
|
|
17
|
+
export declare const recordStopped: (pid: number) => Promise<void>;
|
|
18
|
+
export interface Trial {
|
|
19
|
+
readonly clean: () => Promise<void>;
|
|
20
|
+
readonly prove: (log: Log) => () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const beginTrial: (log: Log) => Promise<Trial | "restored">;
|
|
23
|
+
export declare const rollBackIfCrashLooping: (log: Log) => Promise<boolean>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=agent-trial.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-trial.d.ts","sourceRoot":"","sources":["../src/agent-trial.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,eAAO,MAAM,gBAAgB,QAAc,CAAC;AAE5C,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAOnC,QAAA,MAAM,iBAAiB;;;;;;;iBAAkE,CAAC;AAC1F,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAK5D,eAAO,MAAM,SAAS,WAAY,WAAW,GAAG,SAAS,WAAW,MAAM,OAAO,MAAM,OAAO,MAAM,KAAG,WAGrG,CAAC;AAIH,eAAO,MAAM,aAAa,WAAY,WAAW,OAAO,MAAM,KAAG,WAG/D,CAAC;AAIH,eAAO,MAAM,YAAY,WAAY,WAAW,WAAW,MAAM,GAAG,SAAS,OAAO,MAAM,KAAG,OAC2D,CAAC;AAoBzJ,eAAO,MAAM,aAAa,QAAe,MAAM,KAAG,OAAO,CAAC,IAAI,CAM7D,CAAC;AAiEF,MAAM,WAAW,KAAK;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpC,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,IAAI,CAAC;CAC5C;AAOD,eAAO,MAAM,UAAU,QAAe,GAAG,KAAG,OAAO,CAAC,KAAK,GAAG,UAAU,CAsBrE,CAAC;AAIF,eAAO,MAAM,sBAAsB,QAAe,GAAG,KAAG,OAAO,CAAC,OAAO,CAMtE,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { readFile, rename, rm } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { errorMessage } from "@intentic/base/errors";
|
|
5
|
+
import { writeFileAtomic } from "@intentic/base/fs";
|
|
6
|
+
import { DEV_VERSION } from "@intentic/sandbox-contract";
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { baseDir } from "./config.js";
|
|
9
|
+
import { readMachineConfig, updateMachineConfig } from "./environments/machine.js";
|
|
10
|
+
import { installedBuild, runningAsInstalledAgent } from "./installed.js";
|
|
11
|
+
import { agentPath, launcherPath, renameIfPresent } from "./release.js";
|
|
12
|
+
import { MACHINE_VERSION } from "./version.js";
|
|
13
|
+
export const HEALTHY_AFTER_MS = 10 * 60_000;
|
|
14
|
+
export const CRASH_LOOP_STARTS = 3;
|
|
15
|
+
const startsPath = join(baseDir, "agent-starts.json");
|
|
16
|
+
const healthyPath = join(baseDir, "agent-healthy.json");
|
|
17
|
+
const StartSchema = z.object({ at: z.number(), pid: z.number(), clean: z.boolean().optional() });
|
|
18
|
+
const StartLedgerSchema = z.object({ version: z.string(), starts: z.array(StartSchema) });
|
|
19
|
+
const HealthySchema = z.object({ version: z.string(), since: z.number() });
|
|
20
|
+
export const withStart = (ledger, version, pid, now) => ({
|
|
21
|
+
version,
|
|
22
|
+
starts: [...(ledger?.version === version ? ledger.starts.filter((start) => now - start.at < HEALTHY_AFTER_MS) : []), { at: now, pid }],
|
|
23
|
+
});
|
|
24
|
+
export const withCleanExit = (ledger, pid) => ({
|
|
25
|
+
...ledger,
|
|
26
|
+
starts: ledger.starts.map((start) => (start.pid === pid ? { ...start, clean: true } : start)),
|
|
27
|
+
});
|
|
28
|
+
export const crashLooping = (ledger, healthy, now) => ledger.version !== healthy && ledger.starts.filter((start) => start.clean !== true && now - start.at < HEALTHY_AFTER_MS).length >= CRASH_LOOP_STARTS;
|
|
29
|
+
const readJson = async (path, schema) => {
|
|
30
|
+
const raw = await readFile(path, "utf8").catch(() => undefined);
|
|
31
|
+
try {
|
|
32
|
+
const parsed = raw === undefined ? undefined : schema.safeParse(JSON.parse(raw));
|
|
33
|
+
return parsed?.success === true ? parsed.data : undefined;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const readLedger = async () => await readJson(startsPath, StartLedgerSchema);
|
|
40
|
+
const readHealthyVersion = async () => (await readJson(healthyPath, HealthySchema))?.version;
|
|
41
|
+
const writeLedger = async (ledger) => await writeFileAtomic(startsPath, JSON.stringify(ledger));
|
|
42
|
+
export const recordStopped = async (pid) => {
|
|
43
|
+
const ledger = await readLedger();
|
|
44
|
+
if (ledger !== undefined) {
|
|
45
|
+
await writeLedger(withCleanExit(ledger, pid)).catch(() => undefined);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const previousOf = (target) => `${target}.previous`;
|
|
49
|
+
const putBack = async (target) => {
|
|
50
|
+
if (!existsSync(previousOf(target))) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const aside = `${target}.old`;
|
|
54
|
+
await renameIfPresent(target, aside);
|
|
55
|
+
try {
|
|
56
|
+
await rename(previousOf(target), target);
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
await renameIfPresent(aside, target);
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const rollBack = async (version, log) => {
|
|
64
|
+
try {
|
|
65
|
+
await putBack(launcherPath);
|
|
66
|
+
await putBack(agentPath);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
log(`the agent ${version} keeps stopping, but the one before it could not be put back (${errorMessage(error)}).`);
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
await updateMachineConfig((config) => ({ ...config, skippedAgent: { version, at: Date.now() } }));
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
log(`could not record ${version} as skipped (${errorMessage(error)}); an upgrade may offer it again.`);
|
|
77
|
+
}
|
|
78
|
+
log(`the agent ${version} stopped ${CRASH_LOOP_STARTS} times within ${HEALTHY_AFTER_MS / 60_000} minutes of starting, so the one it replaced is back in its place. ${version} is skipped here until a newer release is published.`);
|
|
79
|
+
return true;
|
|
80
|
+
};
|
|
81
|
+
const markHealthy = async (version, since, log) => {
|
|
82
|
+
try {
|
|
83
|
+
await proven(version, since, log);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
log(`could not record the agent ${version} as healthy (${errorMessage(error)}).`);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const proven = async (version, since, log) => {
|
|
90
|
+
await writeFileAtomic(healthyPath, JSON.stringify({ version, since }));
|
|
91
|
+
const kept = [previousOf(agentPath), previousOf(launcherPath)].filter((path) => existsSync(path));
|
|
92
|
+
await Promise.all(kept.map(async (path) => await rm(path, { force: true })));
|
|
93
|
+
if (kept.length > 0) {
|
|
94
|
+
log(`the agent ${version} has run for ${HEALTHY_AFTER_MS / 60_000} minutes, so the copy of the one before it, kept to undo this update, is dropped.`);
|
|
95
|
+
}
|
|
96
|
+
if ((await readMachineConfig().catch(() => undefined))?.skippedAgent?.version === version) {
|
|
97
|
+
await updateMachineConfig(({ skippedAgent: _lifted, ...rest }) => rest);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const INERT = { clean: async () => await Promise.resolve(), prove: () => () => undefined };
|
|
101
|
+
export const beginTrial = async (log) => {
|
|
102
|
+
if (!runningAsInstalledAgent() || MACHINE_VERSION === DEV_VERSION) {
|
|
103
|
+
return INERT;
|
|
104
|
+
}
|
|
105
|
+
const startedAt = Date.now();
|
|
106
|
+
const ledger = withStart(await readLedger(), MACHINE_VERSION, process.pid, startedAt);
|
|
107
|
+
try {
|
|
108
|
+
await writeLedger(ledger);
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
log(`could not record this start (${errorMessage(error)}); a crash loop of this release goes unnoticed until it can.`);
|
|
112
|
+
}
|
|
113
|
+
if (crashLooping(ledger, await readHealthyVersion(), startedAt) && existsSync(previousOf(agentPath)) && (await rollBack(MACHINE_VERSION, log))) {
|
|
114
|
+
return "restored";
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
clean: async () => await recordStopped(process.pid),
|
|
118
|
+
prove: (say) => {
|
|
119
|
+
const timer = setTimeout(() => void markHealthy(MACHINE_VERSION, startedAt, say), HEALTHY_AFTER_MS);
|
|
120
|
+
timer.unref();
|
|
121
|
+
return () => clearTimeout(timer);
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
export const rollBackIfCrashLooping = async (log) => {
|
|
126
|
+
const ledger = await readLedger();
|
|
127
|
+
if (ledger === undefined || !existsSync(previousOf(agentPath)) || installedBuild() !== ledger.version) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
return crashLooping(ledger, await readHealthyVersion(), Date.now()) && (await rollBack(ledger.version, log));
|
|
131
|
+
};
|
|
132
|
+
//# sourceMappingURL=agent-trial.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-trial.js","sourceRoot":"","sources":["../src/agent-trial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAU/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,GAAG,MAAM,CAAC;AAE5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;AACtD,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;AAExD,MAAM,WA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ts","sourceRoot":"","sources":["../../src/autostart/autostart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAM3D,eAAO,MAAM,iBAAiB,EAAE,aAY/B,CAAC"}
|
|
@@ -0,0 +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,mEAAmE,MAAM,uFAAuF,UAAU,EAAE;CACnL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-autostart.d.ts","sourceRoot":"","sources":["../../src/autostart/legacy-autostart.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,aAAa,EAAE,KAAK,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAwBhF,eAAO,MAAM,gBAAgB,EAAE,SAAS,aAAa,EAGpD,CAAC;AAMF,eAAO,MAAM,qBAAqB,QAAe,GAAG,KAAG,OAAO,CAAC,IAAI,CAWlE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { writeFile } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { autostart } from "@intentic/local-agent";
|
|
5
|
+
import { baseDir } from "../config.js";
|
|
6
|
+
import { machineLauncher } from "../supervision.js";
|
|
7
|
+
const retired = (id, windowsRunValue) => ({
|
|
8
|
+
id,
|
|
9
|
+
windowsRunValue,
|
|
10
|
+
desktopName: id,
|
|
11
|
+
desktopComment: `retired: ${id}`,
|
|
12
|
+
logPath: join(baseDir, `${id}.log`),
|
|
13
|
+
detachedArgs: [],
|
|
14
|
+
foregroundArgs: [],
|
|
15
|
+
failureNote: (reason) => reason,
|
|
16
|
+
});
|
|
17
|
+
export const LEGACY_AUTOSTART = [
|
|
18
|
+
retired("intentic-host", "IntenticHost"),
|
|
19
|
+
{ ...retired("intentic-sync-mirror", "IntenticSyncMirror"), launchAgent: { label: "dev.intentic.sync-mirror" } },
|
|
20
|
+
];
|
|
21
|
+
const retiredPath = join(baseDir, "legacy-autostart-retired");
|
|
22
|
+
export const retireLegacyAutostart = async (log) => {
|
|
23
|
+
if (existsSync(retiredPath)) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const quiet = () => undefined;
|
|
27
|
+
for (const spec of LEGACY_AUTOSTART) {
|
|
28
|
+
await autostart(spec, machineLauncher(), quiet).unregister();
|
|
29
|
+
}
|
|
30
|
+
await writeFile(retiredPath, `${new Date().toISOString()}\n`, { mode: 0o600 });
|
|
31
|
+
log("removed the login entries intentic-host and intentic-sync's mirror left before they became this agent, wherever any were left.");
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=legacy-autostart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-autostart.js","sourceRoot":"","sources":["../../src/autostart/legacy-autostart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAgC,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MA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package/dist/commands.d.ts.map
CHANGED
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAoGjF,eAAO,MAAM,QAAQ,kDAoBnB,CAAC"}
|
package/dist/commands.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { buildCommand, buildRouteMap } from "@stricli/core";
|
|
2
2
|
import { deviceCommands, deviceUninstall } from "./device/commands.js";
|
|
3
|
+
import { sandboxRoutes } from "./device/sandbox-cli.js";
|
|
3
4
|
import { environmentRoutes, updates } from "./environments/commands.js";
|
|
4
5
|
import { realMachineIo, upgradeMachine } from "./environments/machine-upgrade.js";
|
|
5
6
|
import { runForeground } from "./resident.js";
|
|
@@ -46,7 +47,7 @@ const upgrade = buildCommand({
|
|
|
46
47
|
flags: {
|
|
47
48
|
force: {
|
|
48
49
|
kind: "boolean",
|
|
49
|
-
brief: "Install the published agent even over one built from source (
|
|
50
|
+
brief: "Install the published agent even over one built from source, or onto a release this machine rolled back from (both otherwise left alone)",
|
|
50
51
|
},
|
|
51
52
|
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 },
|
|
52
53
|
},
|
|
@@ -81,6 +82,7 @@ export const commands = buildRouteMap({
|
|
|
81
82
|
routes: syncCommands,
|
|
82
83
|
docs: { brief: "Mirror a sandbox's files and ports onto this machine (the Desktop sync card)" },
|
|
83
84
|
}),
|
|
85
|
+
sandbox: sandboxRoutes,
|
|
84
86
|
environment: environmentRoutes,
|
|
85
87
|
run,
|
|
86
88
|
status,
|
package/dist/commands.js.map
CHANGED
|
@@ -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,iBAAiB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
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,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE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