@intentic/machine 1.428.0 → 1.430.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 +80 -1
- package/dist/admin/elevated.d.ts +29 -0
- package/dist/admin/elevated.d.ts.map +1 -0
- package/dist/admin/elevated.js +49 -0
- package/dist/admin/elevated.js.map +1 -0
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +2 -0
- package/dist/commands.js.map +1 -1
- package/dist/device/commands.js +1 -1
- package/dist/device/commands.js.map +1 -1
- package/dist/device/grant.d.ts +72 -0
- package/dist/device/grant.d.ts.map +1 -1
- package/dist/device/indicator.d.ts +15 -0
- package/dist/device/indicator.d.ts.map +1 -1
- package/dist/device/indicator.js +89 -39
- package/dist/device/indicator.js.map +1 -1
- package/dist/device/mcp.d.ts +3 -0
- package/dist/device/mcp.d.ts.map +1 -1
- package/dist/device/policy.d.ts +14 -1
- package/dist/device/policy.d.ts.map +1 -1
- package/dist/device/policy.js +13 -10
- package/dist/device/policy.js.map +1 -1
- package/dist/device/remote/commands.d.ts +7 -0
- package/dist/device/remote/commands.d.ts.map +1 -0
- package/dist/device/remote/commands.js +80 -0
- package/dist/device/remote/commands.js.map +1 -0
- package/dist/device/remote/remote.d.ts +48 -0
- package/dist/device/remote/remote.d.ts.map +1 -0
- package/dist/device/remote/remote.js +310 -0
- package/dist/device/remote/remote.js.map +1 -0
- package/dist/device/remote/remoted-binary.d.ts +19 -0
- package/dist/device/remote/remoted-binary.d.ts.map +1 -0
- package/dist/device/remote/remoted-binary.js +91 -0
- package/dist/device/remote/remoted-binary.js.map +1 -0
- package/dist/device/remote/remoted-files.d.ts +85 -0
- package/dist/device/remote/remoted-files.d.ts.map +1 -0
- package/dist/device/remote/remoted-files.js +105 -0
- package/dist/device/remote/remoted-files.js.map +1 -0
- package/dist/device/remote/remoted-service.d.ts +58 -0
- package/dist/device/remote/remoted-service.d.ts.map +1 -0
- package/dist/device/remote/remoted-service.js +183 -0
- package/dist/device/remote/remoted-service.js.map +1 -0
- package/dist/device/remote/remoted.d.ts +32 -0
- package/dist/device/remote/remoted.d.ts.map +1 -0
- package/dist/device/remote/remoted.js +153 -0
- package/dist/device/remote/remoted.js.map +1 -0
- package/dist/device/router.d.ts +60 -0
- package/dist/device/router.d.ts.map +1 -1
- package/dist/device/router.js +15 -1
- package/dist/device/router.js.map +1 -1
- package/dist/device/tools/describe.d.ts.map +1 -1
- package/dist/device/tools/describe.js +4 -1
- package/dist/device/tools/describe.js.map +1 -1
- package/dist/device/tools/programs/isolated.d.ts +1 -0
- package/dist/device/tools/programs/isolated.d.ts.map +1 -1
- package/dist/device/tools/programs/isolated.js +2 -0
- package/dist/device/tools/programs/isolated.js.map +1 -1
- package/dist/install.d.ts +1 -1
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +8 -2
- package/dist/install.js.map +1 -1
- package/dist/keyring/service.d.ts +2 -9
- package/dist/keyring/service.d.ts.map +1 -1
- package/dist/keyring/service.js +14 -42
- package/dist/keyring/service.js.map +1 -1
- package/dist/release/security-hint.d.ts +4 -0
- package/dist/release/security-hint.d.ts.map +1 -0
- package/dist/release/security-hint.js +23 -0
- package/dist/release/security-hint.js.map +1 -0
- package/dist/resident/resident.d.ts.map +1 -1
- package/dist/resident/resident.js +5 -0
- package/dist/resident/resident.js.map +1 -1
- package/dist/sync/binary/mutagen-binary.d.ts +14 -0
- package/dist/sync/binary/mutagen-binary.d.ts.map +1 -1
- package/dist/sync/binary/mutagen-binary.js +135 -19
- package/dist/sync/binary/mutagen-binary.js.map +1 -1
- package/dist/sync/commands.d.ts.map +1 -1
- package/dist/sync/commands.js +24 -17
- package/dist/sync/commands.js.map +1 -1
- package/dist/sync/mirror.d.ts.map +1 -1
- package/dist/sync/mirror.js +2 -1
- package/dist/sync/mirror.js.map +1 -1
- package/dist/sync/mutagen.d.ts +2 -0
- package/dist/sync/mutagen.d.ts.map +1 -1
- package/dist/sync/mutagen.js +19 -1
- package/dist/sync/mutagen.js.map +1 -1
- package/dist/sync/setup/setup-verdict.d.ts +15 -0
- package/dist/sync/setup/setup-verdict.d.ts.map +1 -0
- package/dist/sync/setup/setup-verdict.js +64 -0
- package/dist/sync/setup/setup-verdict.js.map +1 -0
- package/dist/upgrade.d.ts +1 -0
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +34 -3
- package/dist/upgrade.js.map +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -1105,6 +1105,13 @@ release only through `keyring upgrade`, which downloads and checks the new binar
|
|
|
1105
1105
|
the person), and only then swaps it, keeping `.previous` and putting it back if the new one does not answer; the new
|
|
1106
1106
|
binary's `service install` then runs as an administrator, so the service's own copy follows.
|
|
1107
1107
|
|
|
1108
|
+
The administrator's yes is asked one way for everything this agent installs that needs it
|
|
1109
|
+
([`admin/elevated.ts`](src/admin/elevated.ts), 2026-11-20, factored out of the keyring's setup when remote access's lock-screen
|
|
1110
|
+
service came to need the same): `Start-Process -Verb RunAs -WindowStyle Hidden -Wait` under PowerShell on Windows, each
|
|
1111
|
+
argument quoted as the program reads it back (Start-Process quotes nothing, so a path under a profile with a space would
|
|
1112
|
+
otherwise split), or `pkexec` on Linux; ten minutes for the person to answer, and UAC's "canceled by the user" (or
|
|
1113
|
+
pkexec's 126 and 127) read as a no rather than a failure.
|
|
1114
|
+
|
|
1108
1115
|
On Windows the service's startup task and the helper's logon task run at normal priority (Task Scheduler's 5,
|
|
1109
1116
|
2026-11-18), where this agent's own task stays below normal: a person waits on every answer the two carry, and a
|
|
1110
1117
|
computer busy with containers starved them past the desktop app's deadline, so Passwords read as not answering and
|
|
@@ -1201,6 +1208,78 @@ where the agent is root. This agent decides whether a change asked from the edit
|
|
|
1201
1208
|
sandboxes" can send the first one for a slug on this machine. A pin that looks wrong is reset here and pinned again
|
|
1202
1209
|
from the editor.
|
|
1203
1210
|
|
|
1211
|
+
### People's remote access (intentic-remoted)
|
|
1212
|
+
|
|
1213
|
+
(2026-11-20) A person in a sandbox's editor, never an agent, can see this computer's screen, use its mouse and keyboard,
|
|
1214
|
+
or open a terminal on it. One daemon per environment serves them, [intentic-remoted](../remoted): it dials each linked
|
|
1215
|
+
sandbox's `/system/device-uplink` and carries the view and the terminals over that uplink. An agent in a WSL distro runs
|
|
1216
|
+
its own Linux remoted, so that distro's terminals are native shells there; the sandbox shows the screen on the Windows
|
|
1217
|
+
side's connection only. The agent starts it only while
|
|
1218
|
+
some link wants it, and enforces the switches ([`device/remote/`](src/device/remote)).
|
|
1219
|
+
|
|
1220
|
+
- **The switches.** Three per link, apart from the agents' own and all off by default: "Let people see the screen"
|
|
1221
|
+
(`remoteView`), "Let people use the mouse and keyboard" (`remoteControl`) and "Let people open terminals"
|
|
1222
|
+
(`remoteTerminal`). Each link's uplink allows what that link's grant says. A grant pushed with one of them changed
|
|
1223
|
+
rewrites the uplink's `allow` at once, and remoted re-reads its config within half a second, so terminals that stay
|
|
1224
|
+
allowed are not cut; all three off drops the uplink.
|
|
1225
|
+
- **The procedures.** `remoteStart({ device, uplinkToken, mediaKey, iceServers? })` and `remoteStop()`, called by the
|
|
1226
|
+
daemon alone and only on an agent advertising `remote`; `iceServers` (the sandbox's `remoteIceServers` URLs) only to
|
|
1227
|
+
one advertising `remote-ice` as well, since the input is strict and an older agent would refuse the call. `remoteStart` is refused as `FORBIDDEN`, naming the three switches, while all
|
|
1228
|
+
three are off, and as `PRECONDITION_FAILED`, saying why, when no remoted can be had. Otherwise it writes the link's
|
|
1229
|
+
uplink under the next `generation`, starts remoted if it is not running, waits up to 10 s for its status to show the
|
|
1230
|
+
uplink `up` at that generation (not an `up` left from its last start), and answers remoted's version, what is allowed, the monitors and the environments. Past 10 s it answers
|
|
1231
|
+
`GATEWAY_TIMEOUT` with remoted's own last error for the uplink, which keeps dialling. `remoteStop` drops the link's
|
|
1232
|
+
uplink. Both are audited, never with the token or the key.
|
|
1233
|
+
- **The binary.** `bin/intentic-remoted`, the asset `intentic-remoted-<os>-<arch>` of the agent's own release (published
|
|
1234
|
+
for windows-amd64, linux-amd64 and linux-arm64), checked against the release's signed `SHA256SUMS` as the launcher
|
|
1235
|
+
and the keyring are. It is fetched on the first `remoteStart` that needs it, and again when the one in `bin/` answers
|
|
1236
|
+
`version` with another release than the agent's. A from-source agent never downloads: it takes
|
|
1237
|
+
`_devices/remoted/target/release/intentic-remoted` from its checkout. `INTENTIC_REMOTED_BIN` overrides both. The
|
|
1238
|
+
agent advertises `remote` only where one can be had: the override, one in `bin/`, or a published platform.
|
|
1239
|
+
- **The files.** `remoted.json` (0600, written whole by rename) holds `paused`, `notBefore` and one uplink per link:
|
|
1240
|
+
`id` (the link's sandbox URL), `url` (that sandbox's daemon as the link's own socket resolves it, loopback when it
|
|
1241
|
+
runs here), `device`, `uplinkToken`, `mediaKey`, `allow`, `generation` and, when the sandbox sent them, `iceServers` (the
|
|
1242
|
+
STUN servers remoted gathers its screens' outside address from; without them it offers host candidates only). An uplink not `up` for 30 s has its address
|
|
1243
|
+
resolved again, and rewritten if it moved. remoted prints a status line on stdout whenever anything in it changes, and
|
|
1244
|
+
the agent keeps the latest as `remoted-status.json`.
|
|
1245
|
+
- **The supervisor** ([`remote/remoted.ts`](src/device/remote/remoted.ts)) runs `intentic-remoted run --config <path>
|
|
1246
|
+
--parent-stdin`, its stdin a pipe the agent holds, so it never outlives the agent; its stderr lines land in the
|
|
1247
|
+
agent's log as `remoted: …`. An exit nobody asked for is logged with its code and last line, and it is started again
|
|
1248
|
+
after 1 s, doubling to a minute, back to 1 s after a run that held a minute. Once no uplink is left (a `remoteStop`,
|
|
1249
|
+
every switch off, the link removed or revoked) its stdin is closed, and it is killed 3 s later if it is still there.
|
|
1250
|
+
An agent starting takes up the uplinks `remoted.json` held for links that still exist and still allow something, and
|
|
1251
|
+
drops the rest.
|
|
1252
|
+
- **The person at the computer.** On Windows, while anyone is connected, the agents' notice stays up and says so,
|
|
1253
|
+
naming the foremost kind: someone using the mouse and keyboard, else viewing, else in a terminal. (2026-11-20: ranked by
|
|
1254
|
+
the screen the person sits at, since a terminal shows whoever is connected nothing of it.) `Ctrl+Alt+Shift+P` pauses
|
|
1255
|
+
people's input as it pauses the agents', through the same `paused` file, which `remoted.json`'s `paused` follows.
|
|
1256
|
+
`intentic-machine remote end` sets `notBefore` to now, which drops everyone connected and refuses every way in handed
|
|
1257
|
+
out before it; `intentic-machine remote status [--json]` prints the latest status. People coming and going are audited
|
|
1258
|
+
(`remote-person`).
|
|
1259
|
+
- **Before sign-in** remoted runs as it does after it, so terminals work; nothing is promised of the screen, and no
|
|
1260
|
+
notice is put up.
|
|
1261
|
+
- **The lock screen and administrator prompts** (2026-11-20, Windows). remoted in the person's session cannot see or
|
|
1262
|
+
drive the secure desktop: the sign-in and lock screen, Ctrl+Alt+Del, UAC prompts. remoted's own Windows service can,
|
|
1263
|
+
and installing it needs an administrator, so it is opt-in: the device procedure `remoteService({ action })`
|
|
1264
|
+
([`remote/remoted-service.ts`](src/device/remote/remoted-service.ts)), advertised as `remote-service` by a Windows
|
|
1265
|
+
agent that advertises `remote`. `status` runs `intentic-remoted service status` as the agent; `install` runs
|
|
1266
|
+
`intentic-remoted service install --client <bin/intentic-remoted>` (fetched first if it is not there, so the service
|
|
1267
|
+
serves the remoted this agent starts; again to update it) through ONE UAC prompt the person at the computer answers,
|
|
1268
|
+
waited on for up to ten minutes, then reads `status` again unelevated; the elevated run's own answer comes back
|
|
1269
|
+
through a file (`--result`), read for the reason when it failed. `uninstall` first runs `service uninstall`
|
|
1270
|
+
unelevated, which asks the running service through its helper to remove itself (taking the privilege away needs
|
|
1271
|
+
nobody's yes, and the person may not be at the computer), and goes through the prompt only when that cannot be done
|
|
1272
|
+
(remoted's exit 3). It answers `{ supported, reason?, installed,
|
|
1273
|
+
state?, version?, agentVersion?, outOfDate, helper?, declined?, error? }`: `version` is the service's, `agentVersion`
|
|
1274
|
+
what `intentic-remoted version` says of the agent's own remoted, and `outOfDate` that both are known and differ; a
|
|
1275
|
+
no at the prompt is `declined: true`, and a prompt that could not be shown, was not answered in time, or ran and did
|
|
1276
|
+
not leave the service as asked is `error`, in a sentence, beside the status read after it. One prompt is up at a
|
|
1277
|
+
time (a second change meanwhile is `CONFLICT`), none before anyone has signed in, and every change is audited
|
|
1278
|
+
(`remoteService`). Off Windows it answers `supported: false` without running anything. Who may ask: the daemon only,
|
|
1279
|
+
for a person with Full access to its sandbox, as for the switches; never a tool, so no agent can put a UAC prompt in
|
|
1280
|
+
front of the person, and no switch gates it, since the switches already bound what people may do through it.
|
|
1281
|
+
`uninstall` of this agent does not remove the service yet.
|
|
1282
|
+
|
|
1204
1283
|
### Uninstall
|
|
1205
1284
|
|
|
1206
1285
|
`intentic-machine uninstall [--purge] [--delete-data]` ([`src/uninstall/`](src/uninstall/)). `ic uninstall` is the one
|
|
@@ -1244,7 +1323,7 @@ person who runs it alone, and either way it never downloads anything.
|
|
|
1244
1323
|
|
|
1245
1324
|
## Key files
|
|
1246
1325
|
|
|
1247
|
-
- [src/commands.ts](src/commands.ts) — the CLI: `device`, `sync`, `keyring`, `sandbox`, `egress`, `run`, `status`, `doctor`, `upgrade`, `updates`, `uninstall`.
|
|
1326
|
+
- [src/commands.ts](src/commands.ts) — the CLI: `device`, `sync`, `keyring`, `sandbox`, `egress`, `remote`, `run`, `status`, `doctor`, `upgrade`, `updates`, `uninstall`.
|
|
1248
1327
|
- [src/uninstall/purge.ts](src/uninstall/purge.ts) — `uninstall --purge`: the steps in `steps.ts`, the distros in `distros.ts`, the files in `sweep.ts`, every decision pure in `plan.ts`.
|
|
1249
1328
|
- [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.
|
|
1250
1329
|
- [src/device/mcp.ts](src/device/mcp.ts) — every tool a sandbox can call on this device.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ProcessResult } from "@intentic/base/process";
|
|
2
|
+
export declare const ELEVATED_TIMEOUT_MS: number;
|
|
3
|
+
export interface ElevatedCommand {
|
|
4
|
+
readonly command: string;
|
|
5
|
+
readonly args: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
export declare const windowsArg: (arg: string) => string;
|
|
8
|
+
export declare const elevatedRun: (binary: string, args: readonly string[], platform?: NodeJS.Platform) => ElevatedCommand;
|
|
9
|
+
export declare const elevatedScriptCommand: (script: string, platform?: NodeJS.Platform) => ElevatedCommand;
|
|
10
|
+
export declare const approvalRefused: (exitCode: number | null, said: string, platform?: NodeJS.Platform) => boolean;
|
|
11
|
+
export type ElevatedOutcome = {
|
|
12
|
+
readonly kind: "done";
|
|
13
|
+
} | {
|
|
14
|
+
readonly kind: "unstarted";
|
|
15
|
+
readonly why: string;
|
|
16
|
+
} | {
|
|
17
|
+
readonly kind: "declined";
|
|
18
|
+
} | {
|
|
19
|
+
readonly kind: "failed";
|
|
20
|
+
readonly exitCode: number | null;
|
|
21
|
+
readonly said: string;
|
|
22
|
+
readonly timedOut: boolean;
|
|
23
|
+
};
|
|
24
|
+
type Runner = (command: string, args: readonly string[], options: {
|
|
25
|
+
readonly timeoutMs: number;
|
|
26
|
+
}) => Promise<ProcessResult>;
|
|
27
|
+
export declare const runAsAdministrator: (elevated: ElevatedCommand, run?: Runner, platform?: NodeJS.Platform) => Promise<ElevatedOutcome>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=elevated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevated.d.ts","sourceRoot":"","sources":["../../src/admin/elevated.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAc,MAAM,wBAAwB,CAAC;AAUxE,eAAO,MAAM,mBAAmB,QAAc,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAWD,eAAO,MAAM,UAAU,QAAS,MAAM,KAA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text) => `'${text.replaceAll("'", "''")}'`;
|
|
5
|
+
export const windowsArg = (arg) => {
|
|
6
|
+
if (arg !== "" && !/[\s"]/u.test(arg)) {
|
|
7
|
+
return arg;
|
|
8
|
+
}
|
|
9
|
+
return `"${arg.replaceAll(/(\\*)"/gu, '$1$1\\"').replace(/(\\+)$/u, "$1$1")}"`;
|
|
10
|
+
};
|
|
11
|
+
export const elevatedRun = (binary, args, platform = process.platform) => platform === "win32"
|
|
12
|
+
? {
|
|
13
|
+
command: "powershell.exe",
|
|
14
|
+
args: [
|
|
15
|
+
"-NoProfile",
|
|
16
|
+
"-NonInteractive",
|
|
17
|
+
"-WindowStyle",
|
|
18
|
+
"Hidden",
|
|
19
|
+
"-Command",
|
|
20
|
+
`$p = Start-Process -FilePath ${psQuoted(binary)} -ArgumentList ${args.map((arg) => psQuoted(windowsArg(arg))).join(",")} -Verb RunAs -WindowStyle Hidden -Wait -PassThru; exit $p.ExitCode`,
|
|
21
|
+
],
|
|
22
|
+
}
|
|
23
|
+
: { command: "pkexec", args: [binary, ...args] };
|
|
24
|
+
export const elevatedScriptCommand = (script, platform = process.platform) => platform === "win32"
|
|
25
|
+
? {
|
|
26
|
+
command: "powershell.exe",
|
|
27
|
+
args: [
|
|
28
|
+
"-NoProfile",
|
|
29
|
+
"-NonInteractive",
|
|
30
|
+
"-WindowStyle",
|
|
31
|
+
"Hidden",
|
|
32
|
+
"-Command",
|
|
33
|
+
`$p = Start-Process -FilePath 'powershell.exe' -ArgumentList '-NoProfile','-NonInteractive','-WindowStyle','Hidden','-EncodedCommand',${psQuoted(Buffer.from(script, "utf16le").toString("base64"))} -Verb RunAs -WindowStyle Hidden -Wait -PassThru; exit $p.ExitCode`,
|
|
34
|
+
],
|
|
35
|
+
}
|
|
36
|
+
: { command: "pkexec", args: ["sh", "-c", script] };
|
|
37
|
+
export const approvalRefused = (exitCode, said, platform = process.platform) => platform === "win32" ? /canceled by the user/iu.test(said) : exitCode === 126 || exitCode === 127;
|
|
38
|
+
export const runAsAdministrator = async (elevated, run = runBounded, platform = process.platform) => {
|
|
39
|
+
const result = await run(elevated.command, elevated.args, { timeoutMs: ELEVATED_TIMEOUT_MS });
|
|
40
|
+
if (result.spawnError !== undefined) {
|
|
41
|
+
return { kind: "unstarted", why: `${elevated.command} could not be started: ${errorMessage(result.spawnError)}` };
|
|
42
|
+
}
|
|
43
|
+
if (result.exitCode === 0) {
|
|
44
|
+
return { kind: "done" };
|
|
45
|
+
}
|
|
46
|
+
const said = result.stderr.text.trim();
|
|
47
|
+
return approvalRefused(result.exitCode, said, platform) ? { kind: "declined" } : { kind: "failed", exitCode: result.exitCode, said, timedOut: result.timedOut };
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=elevated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevated.js","sourceRoot":"","sources":["../../src/admin/elevated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAsB,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAUxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,GAAG,MAAM,CAAC;AAQ/C,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC;AAQ7E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAU,EAAE;IAC9C,IAAI,GAAG,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACpC,OAAO,GAAG,CAAC;IACf,CAAC;IACD,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC;AACnF,CAAC,CAAC;AAOF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAc,E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ourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAwInE,eAAO,MAAM,QAAQ,kDAgCnB,CAAC"}
|
package/dist/commands.js
CHANGED
|
@@ -5,6 +5,7 @@ import { buildCommand, machineUi } from "./cli-ui.js";
|
|
|
5
5
|
import { runLogPath } from "./config.js";
|
|
6
6
|
import { deviceCommands } from "./device/commands.js";
|
|
7
7
|
import { egressRoutes } from "./device/egress/trust-command.js";
|
|
8
|
+
import { remoteRoutes } from "./device/remote/commands.js";
|
|
8
9
|
import { sandboxRoutes } from "./device/sandbox-cli.js";
|
|
9
10
|
import { environmentRoutes, updates } from "./environments/commands.js";
|
|
10
11
|
import { keyringCommands } from "./keyring/commands.js";
|
|
@@ -112,6 +113,7 @@ export const commands = buildRouteMap({
|
|
|
112
113
|
}),
|
|
113
114
|
sandbox: sandboxRoutes,
|
|
114
115
|
egress: egressRoutes,
|
|
116
|
+
remote: remoteRoutes,
|
|
115
117
|
environment: environmentRoutes,
|
|
116
118
|
run,
|
|
117
119
|
"before-sign-in": beforeSignInCommand,
|
package/dist/commands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAA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ACxH,CAAC,CAAC"}
|
package/dist/device/commands.js
CHANGED
|
@@ -63,7 +63,7 @@ const runSetup = async (ui, out, flags) => {
|
|
|
63
63
|
sandboxUrl: flags.url,
|
|
64
64
|
id,
|
|
65
65
|
token,
|
|
66
|
-
scopes: { shell: "off", write: "off", screen: "off", control: "off", sandboxes: "off", destructive: "off", programs: "off" },
|
|
66
|
+
scopes: { shell: "off", write: "off", screen: "off", control: "off", sandboxes: "off", destructive: "off", programs: "off", remoteView: "off", remoteControl: "off", remoteTerminal: "off" },
|
|
67
67
|
};
|
|
68
68
|
const links = await upsertLink(link);
|
|
69
69
|
ui.step("device-starting", "starting the agent on this device…");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/device/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAoC,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAA8B,MAAM,0CAA0C,CAAC;AACxG,OAAO,EAAE,0BAA0B,EAAE,MAAM,oDAAoD,CAAC;AAEhG,OAAO,EAAE,YAAY,EAAE,SAAS,EAAkB,YAAY,EAAE,MAAM,cAAc,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,UAAU,EAAiB,SAAS,EAAE,cA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
|
29
29
|
off: "off";
|
|
30
30
|
on: "on";
|
|
31
31
|
}>>;
|
|
32
|
+
remoteView: z.ZodDefault<z.ZodEnum<{
|
|
33
|
+
off: "off";
|
|
34
|
+
on: "on";
|
|
35
|
+
}>>;
|
|
36
|
+
remoteControl: z.ZodDefault<z.ZodEnum<{
|
|
37
|
+
off: "off";
|
|
38
|
+
on: "on";
|
|
39
|
+
}>>;
|
|
40
|
+
remoteTerminal: z.ZodDefault<z.ZodEnum<{
|
|
41
|
+
off: "off";
|
|
42
|
+
on: "on";
|
|
43
|
+
}>>;
|
|
32
44
|
roots: z.ZodOptional<z.ZodString>;
|
|
33
45
|
platform: z.ZodOptional<z.ZodString>;
|
|
34
46
|
}, z.core.$loose>;
|
|
@@ -1011,6 +1023,54 @@ export declare const tolerantDeviceContract: {
|
|
|
1011
1023
|
}>;
|
|
1012
1024
|
refusal: z.ZodString;
|
|
1013
1025
|
}, z.core.$strip>], "ok">, Record<never, never>, Record<never, never>>;
|
|
1026
|
+
remoteStart: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1027
|
+
device: z.ZodString;
|
|
1028
|
+
uplinkToken: z.ZodString;
|
|
1029
|
+
mediaKey: z.ZodString;
|
|
1030
|
+
iceServers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1031
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1032
|
+
version: z.ZodString;
|
|
1033
|
+
allow: z.ZodObject<{
|
|
1034
|
+
view: z.ZodBoolean;
|
|
1035
|
+
control: z.ZodBoolean;
|
|
1036
|
+
terminal: z.ZodBoolean;
|
|
1037
|
+
}, z.core.$strict>;
|
|
1038
|
+
monitors: z.ZodArray<z.ZodObject<{
|
|
1039
|
+
id: z.ZodString;
|
|
1040
|
+
name: z.ZodString;
|
|
1041
|
+
x: z.ZodInt;
|
|
1042
|
+
y: z.ZodInt;
|
|
1043
|
+
width: z.ZodInt;
|
|
1044
|
+
height: z.ZodInt;
|
|
1045
|
+
scale: z.ZodNumber;
|
|
1046
|
+
primary: z.ZodBoolean;
|
|
1047
|
+
}, z.core.$strict>>;
|
|
1048
|
+
environments: z.ZodArray<z.ZodString>;
|
|
1049
|
+
}, z.core.$strict>, Record<never, never>, Record<never, never>>;
|
|
1050
|
+
remoteStop: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
|
|
1051
|
+
ok: z.ZodLiteral<true>;
|
|
1052
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1053
|
+
remoteService: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1054
|
+
action: z.ZodEnum<{
|
|
1055
|
+
install: "install";
|
|
1056
|
+
status: "status";
|
|
1057
|
+
uninstall: "uninstall";
|
|
1058
|
+
}>;
|
|
1059
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1060
|
+
supported: z.ZodBoolean;
|
|
1061
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
1062
|
+
installed: z.ZodBoolean;
|
|
1063
|
+
state: z.ZodOptional<z.ZodString>;
|
|
1064
|
+
version: z.ZodOptional<z.ZodString>;
|
|
1065
|
+
agentVersion: z.ZodOptional<z.ZodString>;
|
|
1066
|
+
outOfDate: z.ZodBoolean;
|
|
1067
|
+
helper: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1068
|
+
session: z.ZodInt;
|
|
1069
|
+
desktop: z.ZodNullable<z.ZodString>;
|
|
1070
|
+
}, z.core.$strip>>>;
|
|
1071
|
+
declined: z.ZodOptional<z.ZodBoolean>;
|
|
1072
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1073
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
1014
1074
|
setScopes: {
|
|
1015
1075
|
"~orpc": {
|
|
1016
1076
|
meta: Record<never, never>;
|
|
@@ -1048,6 +1108,18 @@ export declare const tolerantDeviceContract: {
|
|
|
1048
1108
|
off: "off";
|
|
1049
1109
|
on: "on";
|
|
1050
1110
|
}>>;
|
|
1111
|
+
remoteView: z.ZodDefault<z.ZodEnum<{
|
|
1112
|
+
off: "off";
|
|
1113
|
+
on: "on";
|
|
1114
|
+
}>>;
|
|
1115
|
+
remoteControl: z.ZodDefault<z.ZodEnum<{
|
|
1116
|
+
off: "off";
|
|
1117
|
+
on: "on";
|
|
1118
|
+
}>>;
|
|
1119
|
+
remoteTerminal: z.ZodDefault<z.ZodEnum<{
|
|
1120
|
+
off: "off";
|
|
1121
|
+
on: "on";
|
|
1122
|
+
}>>;
|
|
1051
1123
|
roots: z.ZodOptional<z.ZodString>;
|
|
1052
1124
|
platform: z.ZodOptional<z.ZodString>;
|
|
1053
1125
|
}, z.core.$loose>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grant.d.ts","sourceRoot":"","sources":["../../src/device/grant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAExG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"grant.d.ts","sourceRoot":"","sources":["../../src/device/grant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAExG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAyE,CAAC;AACvG,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAM1D,MAAM,WAAW,KAAK;IAClB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED,eAAO,MAAM,SAAS,UAAW,UAAU,KAAG,KAK5C,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGlC,CAAC"}
|
|
@@ -19,10 +19,25 @@ export interface IndicatorDeps {
|
|
|
19
19
|
detail: string;
|
|
20
20
|
}) => Promise<void>;
|
|
21
21
|
}
|
|
22
|
+
export type PersonKind = "view" | "control" | "terminal";
|
|
23
|
+
export interface PersonOnScreen {
|
|
24
|
+
readonly kind: PersonKind;
|
|
25
|
+
readonly sandboxUrl: string;
|
|
26
|
+
}
|
|
22
27
|
export interface Indicator {
|
|
23
28
|
readonly control: (caller: Caller | undefined) => Promise<void>;
|
|
24
29
|
readonly release: (sandboxUrl: string) => void;
|
|
30
|
+
readonly people: (people: readonly PersonOnScreen[], log: Log) => Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export declare const peopleSentence: (people: readonly PersonOnScreen[]) => string | undefined;
|
|
33
|
+
export interface NoticeState {
|
|
34
|
+
readonly driving: boolean;
|
|
35
|
+
readonly agentUrl: string | undefined;
|
|
36
|
+
readonly people: readonly PersonOnScreen[];
|
|
37
|
+
readonly paused: boolean;
|
|
38
|
+
readonly hotkey: boolean;
|
|
25
39
|
}
|
|
26
40
|
export declare const createIndicator: (deps: IndicatorDeps) => Indicator;
|
|
41
|
+
export declare const onPauseChanged: (listener: (paused: boolean) => void) => (() => void);
|
|
27
42
|
export declare const machineIndicator: () => Indicator;
|
|
28
43
|
//# sourceMappingURL=indicator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indicator.d.ts","sourceRoot":"","sources":["../../src/device/indicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIrD,OAAO,EAAU,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":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,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhE,QAAQ,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAE/C,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnF;AAsBD,eAAO,MAAM,cAAc,WAAY,SAAS,cAAc,EAAE,KAAG,MAAM,GAAG,SAO3E,CAAC;AAIF,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC5B;AA6DD,eAAO,MAAM,eAAe,SAAU,aAAa,KAAG,SAqErD,CAAC;AAMF,eAAO,MAAM,cAAc,aAAc,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAG/E,CAAC;AAGF,eAAO,MAAM,gBAAgB,QAAO,SAgB7B,CAAC"}
|
package/dist/device/indicator.js
CHANGED
|
@@ -13,30 +13,37 @@ export const readPausedAt = async () => (await stat(pausePath).catch(undefinedIf
|
|
|
13
13
|
export const calling = new AsyncLocalStorage();
|
|
14
14
|
const PAUSED = `Refused: paused by the person at this computer: they pressed ${PAUSE_HOTKEY}, which stops agents from using its mouse and keyboard until they press it again. Tell the user; do not look for another way to do this on the screen.`;
|
|
15
15
|
const hostOf = (sandboxUrl) => URL.parse(sandboxUrl)?.host ?? sandboxUrl;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const PERSON_RANK = { control: 3, view: 2, terminal: 1 };
|
|
17
|
+
const PERSON_DOING = {
|
|
18
|
+
control: "using the mouse and keyboard",
|
|
19
|
+
view: "viewing this computer",
|
|
20
|
+
terminal: "in a terminal on this computer",
|
|
21
|
+
};
|
|
22
|
+
const foremostPerson = (people) => people.toSorted((a, b) => PERSON_RANK[b.kind] - PERSON_RANK[a.kind])[0];
|
|
23
|
+
export const peopleSentence = (people) => {
|
|
24
|
+
const foremost = foremostPerson(people);
|
|
25
|
+
if (foremost === undefined) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
const several = people.filter((person) => person.kind === foremost.kind).length > 1;
|
|
29
|
+
return `${several ? "People are" : "A person is"} ${PERSON_DOING[foremost.kind]}`;
|
|
30
|
+
};
|
|
31
|
+
const noticeText = ({ driving, agentUrl, people, paused, hotkey }) => {
|
|
32
|
+
const person = foremostPerson(people);
|
|
33
|
+
const parts = [
|
|
34
|
+
...(driving ? [paused ? "Intentic agent paused" : "Intentic agent is controlling this computer"] : []),
|
|
35
|
+
...(person === undefined ? [] : [`${peopleSentence(people) ?? ""}${paused ? " (input paused)" : ""}`]),
|
|
36
|
+
];
|
|
37
|
+
const host = driving ? agentUrl : person?.sandboxUrl;
|
|
38
|
+
const who = host === undefined ? "" : ` · ${hostOf(host)}`;
|
|
39
|
+
const keys = hotkey ? ` · ${PAUSE_HOTKEY} ${paused ? "resumes" : "pauses"}` : "";
|
|
40
|
+
return `${parts.join(" · ")}${who}${keys}`;
|
|
41
|
+
};
|
|
42
|
+
const noticeWindow = (deps, toggle, log, words) => {
|
|
18
43
|
let shown;
|
|
19
|
-
let paused;
|
|
20
44
|
let broken = false;
|
|
21
45
|
let hotkey = true;
|
|
22
|
-
|
|
23
|
-
const latest = () => [...driving.values()].at(-1)?.caller;
|
|
24
|
-
const log = (message) => latest()?.log(message);
|
|
25
|
-
const text = () => {
|
|
26
|
-
const caller = latest();
|
|
27
|
-
const who = caller === undefined ? "" : ` · ${hostOf(caller.sandboxUrl)}`;
|
|
28
|
-
const keys = hotkey ? ` · ${PAUSE_HOTKEY} ${paused === true ? "resumes" : "pauses"}` : "";
|
|
29
|
-
return `${paused === true ? "Intentic agent paused" : "Intentic agent is controlling this computer"}${who}${keys}`;
|
|
30
|
-
};
|
|
31
|
-
const toggle = () => {
|
|
32
|
-
const now = paused !== true;
|
|
33
|
-
paused = now;
|
|
34
|
-
saved = saved.then(async () => await deps.setPaused(now)).catch((error) => log(`could not save the pause: ${errorMessage(error)}`));
|
|
35
|
-
const detail = `${now ? "paused" : "resumed"} by the person at this computer (${PAUSE_HOTKEY})`;
|
|
36
|
-
log(detail);
|
|
37
|
-
void deps.audit({ tool: "local-pause", ok: true, detail });
|
|
38
|
-
shown?.show(text());
|
|
39
|
-
};
|
|
46
|
+
const show = () => shown?.show(words(hotkey));
|
|
40
47
|
const open = () => {
|
|
41
48
|
try {
|
|
42
49
|
shown = deps.open({
|
|
@@ -44,7 +51,7 @@ export const createIndicator = (deps) => {
|
|
|
44
51
|
hotkeyTaken: () => {
|
|
45
52
|
hotkey = false;
|
|
46
53
|
log(`${PAUSE_HOTKEY} is held by another program, so it cannot pause agents here until that program lets go of it.`);
|
|
47
|
-
|
|
54
|
+
show();
|
|
48
55
|
},
|
|
49
56
|
exited: (said) => {
|
|
50
57
|
shown = undefined;
|
|
@@ -58,6 +65,42 @@ export const createIndicator = (deps) => {
|
|
|
58
65
|
log(`the on-screen notice could not open: ${errorMessage(error)}`);
|
|
59
66
|
}
|
|
60
67
|
};
|
|
68
|
+
return {
|
|
69
|
+
show,
|
|
70
|
+
up: () => {
|
|
71
|
+
if (shown === undefined && !broken) {
|
|
72
|
+
open();
|
|
73
|
+
}
|
|
74
|
+
show();
|
|
75
|
+
},
|
|
76
|
+
down: () => {
|
|
77
|
+
const closing = shown;
|
|
78
|
+
shown = undefined;
|
|
79
|
+
broken = false;
|
|
80
|
+
hotkey = true;
|
|
81
|
+
closing?.close();
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export const createIndicator = (deps) => {
|
|
86
|
+
const driving = new Map();
|
|
87
|
+
let connected = [];
|
|
88
|
+
let peopleLog;
|
|
89
|
+
let paused;
|
|
90
|
+
let saved = Promise.resolve();
|
|
91
|
+
const latest = () => [...driving.values()].at(-1)?.caller;
|
|
92
|
+
const log = (message) => (latest()?.log ?? peopleLog)?.(message);
|
|
93
|
+
const toggle = () => {
|
|
94
|
+
const now = paused !== true;
|
|
95
|
+
paused = now;
|
|
96
|
+
saved = saved.then(async () => await deps.setPaused(now)).catch((error) => log(`could not save the pause: ${errorMessage(error)}`));
|
|
97
|
+
const detail = `${now ? "paused" : "resumed"} by the person at this computer (${PAUSE_HOTKEY})`;
|
|
98
|
+
log(detail);
|
|
99
|
+
void deps.audit({ tool: "local-pause", ok: true, detail });
|
|
100
|
+
helper.show();
|
|
101
|
+
};
|
|
102
|
+
const helper = noticeWindow(deps, toggle, log, (hotkey) => noticeText({ driving: driving.size > 0, agentUrl: latest()?.sandboxUrl, people: connected, paused: paused === true, hotkey }));
|
|
103
|
+
const settle = () => (driving.size > 0 || connected.length > 0 ? helper.up() : helper.down());
|
|
61
104
|
const release = (sandboxUrl) => {
|
|
62
105
|
const entry = driving.get(sandboxUrl);
|
|
63
106
|
if (entry === undefined) {
|
|
@@ -65,15 +108,7 @@ export const createIndicator = (deps) => {
|
|
|
65
108
|
}
|
|
66
109
|
clearTimeout(entry.timer);
|
|
67
110
|
driving.delete(sandboxUrl);
|
|
68
|
-
|
|
69
|
-
shown?.show(text());
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
const closing = shown;
|
|
73
|
-
shown = undefined;
|
|
74
|
-
broken = false;
|
|
75
|
-
hotkey = true;
|
|
76
|
-
closing?.close();
|
|
111
|
+
settle();
|
|
77
112
|
};
|
|
78
113
|
return {
|
|
79
114
|
control: async (caller) => {
|
|
@@ -87,28 +122,43 @@ export const createIndicator = (deps) => {
|
|
|
87
122
|
const timer = setTimeout(() => release(key), IDLE_MS);
|
|
88
123
|
timer.unref();
|
|
89
124
|
driving.set(key, { caller, timer });
|
|
90
|
-
|
|
91
|
-
open();
|
|
92
|
-
}
|
|
93
|
-
shown?.show(text());
|
|
125
|
+
settle();
|
|
94
126
|
if (paused) {
|
|
95
127
|
throw new ScopeError(PAUSED);
|
|
96
128
|
}
|
|
97
129
|
},
|
|
98
130
|
release,
|
|
131
|
+
people: async (people, said) => {
|
|
132
|
+
connected = people;
|
|
133
|
+
peopleLog = said;
|
|
134
|
+
if (people.length > 0 && paused === undefined) {
|
|
135
|
+
const onDisk = await deps.paused().catch(() => undefined);
|
|
136
|
+
paused ??= onDisk;
|
|
137
|
+
}
|
|
138
|
+
settle();
|
|
139
|
+
},
|
|
99
140
|
};
|
|
100
141
|
};
|
|
101
142
|
let machine;
|
|
143
|
+
const pauseListeners = new Set();
|
|
144
|
+
export const onPauseChanged = (listener) => {
|
|
145
|
+
pauseListeners.add(listener);
|
|
146
|
+
return () => void pauseListeners.delete(listener);
|
|
147
|
+
};
|
|
102
148
|
export const machineIndicator = () => (machine ??= createIndicator({
|
|
103
149
|
open: (events) => notice(PAUSE_HOTKEY, events),
|
|
104
150
|
paused: async () => (await readPausedAt()) !== undefined,
|
|
105
151
|
setPaused: async (paused) => {
|
|
106
|
-
if (
|
|
152
|
+
if (paused) {
|
|
153
|
+
await mkdir(baseDir, { recursive: true, mode: 0o700 });
|
|
154
|
+
await writeFile(pausePath, "", { mode: 0o600 });
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
107
157
|
await rm(pausePath, { force: true });
|
|
108
|
-
return;
|
|
109
158
|
}
|
|
110
|
-
|
|
111
|
-
|
|
159
|
+
for (const listener of pauseListeners) {
|
|
160
|
+
listener(paused);
|
|
161
|
+
}
|
|
112
162
|
},
|
|
113
163
|
audit,
|
|
114
164
|
}));
|