pinomad 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/chunk-0dh2k3er.js +43 -0
  2. package/dist/{chunk-kmzzjv53.js → chunk-1mjbt2z2.js} +143 -10
  3. package/dist/{chunk-s0h7c7da.js → chunk-1rdbnvy6.js} +1 -1
  4. package/dist/{chunk-53xv3fny.js → chunk-35szq73k.js} +2446 -416
  5. package/dist/{chunk-aapsc9g0.js → chunk-5j7ybhjj.js} +1952 -295
  6. package/dist/{chunk-m51mq8vh.js → chunk-5pv0g1nj.js} +12 -10
  7. package/dist/{chunk-7mn38n4f.js → chunk-63ymn5c9.js} +2 -2
  8. package/dist/{chunk-563fnad9.js → chunk-6j6hkfbj.js} +8 -4
  9. package/dist/{chunk-pqe7q1s7.js → chunk-6vbp1vva.js} +2 -1
  10. package/dist/{chunk-g3ahp7b9.js → chunk-9trbbz4r.js} +1 -1
  11. package/dist/{chunk-d9mq5d46.js → chunk-b0nwq1dt.js} +10 -8
  12. package/dist/chunk-dsr19q5h.js +23 -0
  13. package/dist/{chunk-6th9xv39.js → chunk-e53c0s8z.js} +9 -7
  14. package/dist/{chunk-4fferbxw.js → chunk-e59k3bmz.js} +213 -30
  15. package/dist/chunk-eerpgvy9.js +315 -0
  16. package/dist/chunk-eewxy4cp.js +240 -0
  17. package/dist/{chunk-maqv34cs.js → chunk-evbv1fkn.js} +3 -3
  18. package/dist/{chunk-ra86wjp5.js → chunk-ex5yr09h.js} +11 -6
  19. package/dist/{chunk-t91zt5f0.js → chunk-hg9gs396.js} +1 -1
  20. package/dist/{chunk-90g1cg9n.js → chunk-mtkvft88.js} +1 -1
  21. package/dist/{chunk-wd7aracm.js → chunk-mxwcnnkg.js} +1 -303
  22. package/dist/{chunk-d4tq62yr.js → chunk-w927q9m1.js} +12 -11
  23. package/dist/pinomad.js +12 -12
  24. package/package.json +5 -1
  25. package/web/assets/{core-BHm2gdHL.js → core-BWHGsFpV.js} +1 -1
  26. package/web/assets/{highlighted-diff-DrHvSLK9.js → highlighted-diff-DJ7KZCpS.js} +2 -2
  27. package/web/assets/{highlights-1aLwssz-.js → highlights-CyEmo6OI.js} +1 -1
  28. package/web/assets/{highlights-themes-C1p4pFYS.js → highlights-themes-CSNkBojy.js} +1 -1
  29. package/web/assets/index-C_qkbyL7.css +1 -0
  30. package/web/assets/index-DefQtCI2.js +396 -0
  31. package/web/assets/{shiki-BwyCm3kZ.js → shiki-BzCmRG-v.js} +2 -2
  32. package/web/assets/{shiki-langs-CMlALLSg.js → shiki-langs-DOkjyV4d.js} +1 -1
  33. package/web/assets/{stream-tokenizer-BlgIhw0y.js → stream-tokenizer-CBPqFe4Z.js} +1 -1
  34. package/web/assets/{theming-themes-DDvoqEqT.js → theming-themes-wKVca0aB.js} +1 -1
  35. package/web/assets/{xterm-view-BnKOnF3C.js → xterm-view-CKa1-QCM.js} +12 -12
  36. package/web/index.html +3 -2
  37. package/web/theme-boot.js +11 -0
  38. package/dist/chunk-sd640dt7.js +0 -22
  39. package/dist/chunk-t6fw0wa9.js +0 -96
  40. package/web/assets/index-A_AUJoO6.css +0 -1
  41. package/web/assets/index-BafYMKiN.js +0 -396
@@ -0,0 +1,315 @@
1
+ import {
2
+ ProtocolMismatchError,
3
+ connectRemoteDurable
4
+ } from "./chunk-e59k3bmz.js";
5
+ import {
6
+ isParseArgsError
7
+ } from "./chunk-kzbzacz9.js";
8
+ import {
9
+ argValue,
10
+ installSpec,
11
+ serviceManager
12
+ } from "./chunk-mxwcnnkg.js";
13
+ import {
14
+ DEFAULT_DATA_DIR,
15
+ hostAddress
16
+ } from "./chunk-ngf1zatm.js";
17
+ import {
18
+ commandHint,
19
+ hostEntry,
20
+ packagedVersion
21
+ } from "./chunk-1rdbnvy6.js";
22
+
23
+ // apps/host/src/cli/service.ts
24
+ import { execFile } from "node:child_process";
25
+ import { homedir } from "node:os";
26
+ import { resolve } from "node:path";
27
+ import { fileURLToPath } from "node:url";
28
+ import { parseArgs, promisify } from "node:util";
29
+
30
+ // apps/host/src/service/idle.ts
31
+ async function waitForIdle(remote, onBusy) {
32
+ if (remote.view.current().tasks === undefined)
33
+ await remote.controller.toggleTasks();
34
+ let announced = false;
35
+ await new Promise((resolve) => {
36
+ const check = () => {
37
+ const view = remote.view.current();
38
+ if (view.connection !== "connected") {
39
+ unsubscribe();
40
+ resolve();
41
+ return;
42
+ }
43
+ const tasks = view.tasks;
44
+ if (tasks === undefined)
45
+ return;
46
+ if (Object.keys(tasks.tasks).length === 0) {
47
+ unsubscribe();
48
+ resolve();
49
+ return;
50
+ }
51
+ if (!announced) {
52
+ announced = true;
53
+ onBusy(tasks);
54
+ }
55
+ };
56
+ const unsubscribe = remote.view.subscribe(check);
57
+ check();
58
+ });
59
+ }
60
+
61
+ // apps/host/src/cli/service.ts
62
+ var run = promisify(execFile);
63
+ var repoRoot = fileURLToPath(new URL("../../../../", import.meta.url));
64
+ var message = (error) => error instanceof Error ? error.message : String(error);
65
+ function connectToHost(url, token, timeoutMs = 3000) {
66
+ const connecting = connectRemoteDurable({ url, token, reconnectDelayMs: { min: 200, max: 2000 } });
67
+ const timedOut = Symbol("timedOut");
68
+ return Promise.race([
69
+ connecting,
70
+ new Promise((resolve2) => {
71
+ const timer = setTimeout(() => resolve2(timedOut), timeoutMs);
72
+ timer.unref();
73
+ })
74
+ ]).then((winner) => {
75
+ if (winner !== timedOut)
76
+ return winner;
77
+ connecting.then((remote) => remote.close(), () => {});
78
+ throw new Error("connect timed out");
79
+ });
80
+ }
81
+ async function install(argv) {
82
+ const spec = installSpec(argv, {
83
+ execPath: process.execPath,
84
+ env: process.env,
85
+ home: homedir(),
86
+ cwd: process.cwd(),
87
+ mainPath: hostEntry.script,
88
+ entryArgs: hostEntry.args
89
+ });
90
+ const path = await serviceManager().install(spec);
91
+ console.log(`installed ${path}`);
92
+ console.log(`data dir: ${spec.dataDir}`);
93
+ console.log(`browser link: ${commandHint("link")} pairing QR: ${commandHint("pair")}`);
94
+ }
95
+ async function waitUntilIdle(address, connect, log) {
96
+ try {
97
+ const remote = await connect(address.url, address.token);
98
+ await waitForIdle(remote, (tasks) => {
99
+ log("waiting for running tasks to finish (Ctrl-C to cancel)");
100
+ for (const task of Object.values(tasks.tasks)) {
101
+ log(` ${task.kind} in conversation ${task.conversationId}`);
102
+ }
103
+ });
104
+ remote.close();
105
+ } catch {}
106
+ }
107
+ async function stopService({
108
+ force,
109
+ argv,
110
+ manager = serviceManager(),
111
+ connect = connectToHost,
112
+ log = (line) => console.log(line),
113
+ logError = (line) => console.error(line)
114
+ }) {
115
+ const state = await manager.state();
116
+ if (!state.installed) {
117
+ log(`service not installed (${commandHint("service")} install)`);
118
+ return 1;
119
+ }
120
+ if (state.stopped) {
121
+ log("already stopped");
122
+ return 0;
123
+ }
124
+ if (!force) {
125
+ const spec = argv.length === 0 ? await manager.read() : undefined;
126
+ const port = spec === undefined ? undefined : argValue(spec.hostArgs, "--port");
127
+ const flags = spec === undefined ? argv : ["--data-dir", spec.dataDir, ...port === undefined ? [] : ["--url", `ws://127.0.0.1:${port}`]];
128
+ const address = await hostAddress(flags).catch((error) => {
129
+ if (isParseArgsError(error))
130
+ throw error;
131
+ return;
132
+ });
133
+ if (address !== undefined)
134
+ await waitUntilIdle(address, connect, log);
135
+ }
136
+ const holdInterrupt = () => {};
137
+ process.on("SIGINT", holdInterrupt);
138
+ try {
139
+ await manager.stop();
140
+ } finally {
141
+ process.off("SIGINT", holdInterrupt);
142
+ }
143
+ const after = await manager.state();
144
+ if (!after.stopped) {
145
+ logError(`the host is still running (${after.detail}); run \`${commandHint("service")} stop\` again`);
146
+ return 1;
147
+ }
148
+ log(`stopped; it stays off, also after a restart, until \`${commandHint("service")} start\``);
149
+ return 0;
150
+ }
151
+ async function startService({
152
+ manager = serviceManager(),
153
+ log = (line) => console.log(line)
154
+ } = {}) {
155
+ if (!(await manager.state()).installed) {
156
+ log(`service not installed (${commandHint("service")} install)`);
157
+ return 1;
158
+ }
159
+ await manager.start();
160
+ log("started");
161
+ return 0;
162
+ }
163
+ async function versionLine() {
164
+ if (packagedVersion !== undefined)
165
+ return `version: ${packagedVersion}`;
166
+ const head = await run("git", ["rev-parse", "--short", "HEAD"], { cwd: repoRoot }).then(({ stdout }) => stdout.trim(), () => "unknown");
167
+ return `checkout: ${head}`;
168
+ }
169
+ async function reachabilityLine(argv) {
170
+ try {
171
+ const { url, token } = await hostAddress(argv);
172
+ const remote = await connectToHost(url, token);
173
+ if (remote.view.current().tasks === undefined)
174
+ await remote.controller.toggleTasks();
175
+ const tasks = remote.view.current().tasks;
176
+ const count = tasks === undefined ? 0 : Object.keys(tasks.tasks).length;
177
+ remote.close();
178
+ return `host: reachable at ${url}, ${count} live task${count === 1 ? "" : "s"}`;
179
+ } catch (error) {
180
+ if (isParseArgsError(error))
181
+ throw error;
182
+ return `host: unreachable (${message(error)})`;
183
+ }
184
+ }
185
+ var serviceStatusJson = (state) => JSON.stringify({
186
+ installed: state.installed,
187
+ stopped: state.stopped,
188
+ running: state.running,
189
+ ...state.pid === undefined ? {} : { pid: state.pid },
190
+ detail: state.detail
191
+ });
192
+ async function status(argv) {
193
+ const state = await serviceManager().state();
194
+ if (argv.includes("--json")) {
195
+ console.log(serviceStatusJson(state));
196
+ return;
197
+ }
198
+ console.log(`service: ${state.installed ? state.detail : "not installed"}`);
199
+ console.log(await versionLine());
200
+ console.log(await reachabilityLine(argv));
201
+ }
202
+ async function restartService({
203
+ force,
204
+ argv,
205
+ manager = serviceManager(),
206
+ restart,
207
+ connect = connectToHost,
208
+ pollTimeoutMs = 30000,
209
+ pollDelayMs = 500
210
+ }) {
211
+ const state = await manager.state();
212
+ if (!state.installed) {
213
+ console.log(`service not installed (${commandHint("service")} install)`);
214
+ return 1;
215
+ }
216
+ if (state.stopped && restart === undefined) {
217
+ console.log(`service stopped (${commandHint("service")} start)`);
218
+ return 1;
219
+ }
220
+ const address = await hostAddress(argv).catch((error) => {
221
+ if (isParseArgsError(error))
222
+ throw error;
223
+ return;
224
+ });
225
+ if (!force && address !== undefined)
226
+ await waitUntilIdle(address, connect, (line) => console.log(line));
227
+ await (restart?.() ?? manager.restart());
228
+ if (address === undefined) {
229
+ console.log("restart requested (host address unknown; not polling)");
230
+ return 0;
231
+ }
232
+ return awaitRestarted(address, { connect, pollTimeoutMs, pollDelayMs });
233
+ }
234
+ async function awaitRestarted(address, {
235
+ connect = connectToHost,
236
+ pollTimeoutMs = 30000,
237
+ pollDelayMs = 500
238
+ } = {}) {
239
+ const deadline = Date.now() + pollTimeoutMs;
240
+ for (;; ) {
241
+ try {
242
+ const remote = await connect(address.url, address.token, 2000);
243
+ remote.close();
244
+ console.log(`host restarted, reachable at ${address.url}`);
245
+ return 0;
246
+ } catch (error) {
247
+ if (error instanceof ProtocolMismatchError && error.direction === "client-older") {
248
+ const newer = error.hostVersion ?? `protocol major ${error.hostMajor}`;
249
+ console.log(`host restarted (${newer}, newer than this upgrader), reachable at ${address.url}`);
250
+ return 0;
251
+ }
252
+ if (Date.now() > deadline) {
253
+ console.error(`host did not answer within ${pollTimeoutMs / 1000}s after restart: ${message(error)}`);
254
+ return 1;
255
+ }
256
+ await new Promise((resolve2) => setTimeout(resolve2, pollDelayMs));
257
+ }
258
+ }
259
+ }
260
+ async function logs(argv) {
261
+ const { values } = parseArgs({
262
+ args: [...argv],
263
+ options: {
264
+ follow: { type: "boolean", default: false },
265
+ lines: { type: "string", short: "n", default: "100" },
266
+ "data-dir": { type: "string" }
267
+ }
268
+ });
269
+ const dataDir = resolve(values["data-dir"] ?? DEFAULT_DATA_DIR);
270
+ await serviceManager().logs(dataDir, Number(values.lines), values.follow);
271
+ }
272
+ async function main(argv) {
273
+ const [command, ...args] = argv;
274
+ try {
275
+ switch (command) {
276
+ case "install":
277
+ await install(args);
278
+ break;
279
+ case "uninstall":
280
+ await serviceManager().uninstall();
281
+ console.log("uninstalled");
282
+ break;
283
+ case "status":
284
+ await status(args);
285
+ break;
286
+ case "restart": {
287
+ const force = args.includes("--force");
288
+ process.exitCode = await restartService({ force, argv: args.filter((arg) => arg !== "--force") });
289
+ break;
290
+ }
291
+ case "stop": {
292
+ const force = args.includes("--force");
293
+ process.exitCode = await stopService({ force, argv: args.filter((arg) => arg !== "--force") });
294
+ break;
295
+ }
296
+ case "start":
297
+ process.exitCode = await startService();
298
+ break;
299
+ case "logs":
300
+ await logs(args);
301
+ break;
302
+ default:
303
+ console.error(`usage: ${commandHint("service")} install|uninstall|status|restart|stop|start|logs`);
304
+ process.exitCode = 1;
305
+ }
306
+ } catch (error) {
307
+ if (isParseArgsError(error))
308
+ throw error;
309
+ console.error(message(error));
310
+ process.exitCode = 1;
311
+ }
312
+ }
313
+ if (false) {}
314
+
315
+ export { connectToHost, stopService, startService, versionLine, reachabilityLine, serviceStatusJson, restartService, awaitRestarted, main };
@@ -0,0 +1,240 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ installCommand,
4
+ npmBeside,
5
+ packagePrefix
6
+ } from "./chunk-0dh2k3er.js";
7
+ import {
8
+ awaitRestarted,
9
+ connectToHost,
10
+ restartService
11
+ } from "./chunk-eerpgvy9.js";
12
+ import"./chunk-e59k3bmz.js";
13
+ import"./chunk-kzbzacz9.js";
14
+ import {
15
+ serviceManager
16
+ } from "./chunk-mxwcnnkg.js";
17
+ import {
18
+ hostSupportsCall
19
+ } from "./chunk-1mjbt2z2.js";
20
+ import"./chunk-6vbp1vva.js";
21
+ import {
22
+ hostAddress,
23
+ hostAddressOptions
24
+ } from "./chunk-ngf1zatm.js";
25
+ import {
26
+ commandHint,
27
+ packageDir,
28
+ packagedVersion
29
+ } from "./chunk-1rdbnvy6.js";
30
+ import"./chunk-df32avw6.js";
31
+
32
+ // apps/host/src/cli/upgrade.ts
33
+ import { execFile, spawn } from "node:child_process";
34
+ import { fileURLToPath } from "node:url";
35
+ import { parseArgs, promisify } from "node:util";
36
+
37
+ // apps/host/src/cli/upgrade-via-host.ts
38
+ var message = (error) => error instanceof Error ? error.message : String(error);
39
+ async function hostUpgrade(remote, timeoutMs = 5000) {
40
+ if (!hostSupportsCall(remote.view.current().host?.protocol.minor ?? 0, "startUpgrade"))
41
+ return;
42
+ return new Promise((resolve) => {
43
+ const timer = setTimeout(() => finish(undefined), timeoutMs);
44
+ timer.unref();
45
+ const finish = (value) => {
46
+ clearTimeout(timer);
47
+ unsubscribe();
48
+ resolve(value);
49
+ };
50
+ const check = () => {
51
+ const value = remote.view.current().upgrade;
52
+ if (value !== null)
53
+ finish(value);
54
+ };
55
+ const unsubscribe = remote.view.subscribe(check);
56
+ check();
57
+ });
58
+ }
59
+ async function upgradeWithHost(remote, when, log, onWaiting = () => {}) {
60
+ const initial = await hostUpgrade(remote);
61
+ if (initial === undefined || initial.blocked !== null)
62
+ return;
63
+ if (initial.phase !== "idle")
64
+ return { kind: "failed", message: `the host is already upgrading to pinomad@${initial.target ?? "?"}` };
65
+ try {
66
+ await remote.controller.checkUpgrade();
67
+ } catch (error) {
68
+ log(`the host won't check for releases (${message(error)}); upgrading here`);
69
+ return;
70
+ }
71
+ const checked = remote.view.current().upgrade;
72
+ if (checked === null || checked.available === null)
73
+ return { kind: "current", version: checked?.current ?? null };
74
+ const version = checked.available.version;
75
+ log(`upgrading the host to pinomad@${version}`);
76
+ try {
77
+ await remote.controller.startUpgrade(when);
78
+ } catch (error) {
79
+ return { kind: "failed", message: message(error) };
80
+ }
81
+ const attempt = remote.view.current().upgrade?.attempt;
82
+ return new Promise((resolve) => {
83
+ let phase;
84
+ let installed = false;
85
+ const finish = (outcome) => {
86
+ unsubscribe();
87
+ resolve(outcome);
88
+ };
89
+ const check = () => {
90
+ const view = remote.view.current();
91
+ if (view.connection !== "connected") {
92
+ finish(installed ? { kind: "restarting", version } : { kind: "failed", message: "lost the host before the install finished" });
93
+ return;
94
+ }
95
+ const value = view.upgrade;
96
+ if (value === null)
97
+ return;
98
+ if (value.failure !== null && value.failure.attempt === attempt) {
99
+ finish({ kind: "failed", message: value.failure.message });
100
+ return;
101
+ }
102
+ if (value.phase === phase)
103
+ return;
104
+ phase = value.phase;
105
+ if (phase === "idle") {
106
+ finish({ kind: "cancelled" });
107
+ return;
108
+ }
109
+ if (phase === "waiting") {
110
+ log("waiting for running tasks to finish (Ctrl-C to cancel)");
111
+ onWaiting(() => remote.controller.cancelUpgrade());
112
+ }
113
+ if (phase === "installing") {
114
+ installed = true;
115
+ log(`installing pinomad@${version}`);
116
+ }
117
+ };
118
+ const unsubscribe = remote.view.subscribe(check);
119
+ check();
120
+ });
121
+ }
122
+
123
+ // apps/host/src/cli/upgrade.ts
124
+ var exec = promisify(execFile);
125
+ var repoRoot = fileURLToPath(new URL("../../../../", import.meta.url));
126
+ var step = (command, args, binDir) => new Promise((resolve) => {
127
+ const env = binDir === undefined ? process.env : { ...process.env, PATH: `${binDir}:${process.env.PATH ?? ""}` };
128
+ spawn(command, [...args], { cwd: repoRoot, env, stdio: "inherit" }).once("exit", (code) => resolve(code ?? 1));
129
+ });
130
+ var serviceState = () => Promise.resolve().then(() => serviceManager().state()).catch(() => ({ installed: false, stopped: false }));
131
+ async function upgradeThroughHost(argv, force) {
132
+ const service = await serviceState();
133
+ if (!service.installed || service.stopped)
134
+ return;
135
+ const address = await hostAddress(argv.filter((arg) => arg !== "--force")).catch(() => {
136
+ return;
137
+ });
138
+ if (address === undefined)
139
+ return;
140
+ const remote = await connectToHost(address.url, address.token).catch(() => {
141
+ return;
142
+ });
143
+ if (remote === undefined)
144
+ return;
145
+ try {
146
+ let cancel;
147
+ const interrupt = () => {
148
+ if (cancel === undefined)
149
+ process.exit(130);
150
+ cancel().finally(() => {
151
+ console.log("upgrade cancelled");
152
+ process.exit(130);
153
+ });
154
+ };
155
+ process.on("SIGINT", interrupt);
156
+ const outcome = await upgradeWithHost(remote, force ? "now" : "idle", (line) => console.log(line), (c) => cancel = c).finally(() => process.off("SIGINT", interrupt));
157
+ if (outcome === undefined)
158
+ return;
159
+ switch (outcome.kind) {
160
+ case "current":
161
+ console.log(`already on the latest release (${outcome.version ?? "unknown"})`);
162
+ return 0;
163
+ case "failed":
164
+ console.error(`upgrade failed; the host keeps running the old version:
165
+ ${outcome.message}`);
166
+ return 1;
167
+ case "cancelled":
168
+ console.log("the upgrade was cancelled on another device");
169
+ return 1;
170
+ case "restarting":
171
+ return awaitRestarted(address);
172
+ }
173
+ } finally {
174
+ remote.close();
175
+ }
176
+ }
177
+ async function main(argv, deps = {}) {
178
+ const { values } = parseArgs({
179
+ args: [...argv],
180
+ options: { force: { type: "boolean", default: false }, ...hostAddressOptions }
181
+ });
182
+ const run = deps.run ?? ((command, args) => exec(command, args, { cwd: repoRoot }));
183
+ const runStep = deps.step ?? step;
184
+ const restart = deps.restart ?? restartService;
185
+ if (packagedVersion === undefined) {
186
+ const { stdout } = await run("git", ["status", "--porcelain"]);
187
+ if (stdout.trim() !== "") {
188
+ console.error("upgrade: the checkout has uncommitted changes; commit or stash them first");
189
+ process.exitCode = 1;
190
+ return;
191
+ }
192
+ for (const [command, args] of [
193
+ ["git", ["pull", "--ff-only"]],
194
+ ["bun", ["install"]],
195
+ ["bun", ["run", "build"]]
196
+ ]) {
197
+ const code = await runStep(command, args);
198
+ if (code !== 0) {
199
+ process.exitCode = code;
200
+ return;
201
+ }
202
+ }
203
+ } else {
204
+ const viaHost = await (deps.viaHost ?? upgradeThroughHost)(argv, values.force);
205
+ if (viaHost !== undefined) {
206
+ (deps.exit ?? process.exit)(viaHost);
207
+ return;
208
+ }
209
+ const prefix = packagePrefix();
210
+ if (prefix === undefined) {
211
+ console.error(`upgrade: pinomad isn't a global npm install (${packageDir}); upgrade it the way it was installed`);
212
+ process.exitCode = 1;
213
+ return;
214
+ }
215
+ const npm = installCommand(npmBeside(process.execPath), prefix, "pinomad@latest");
216
+ const code = await runStep(npm.command, npm.args, npm.binDir);
217
+ if (code !== 0) {
218
+ process.exitCode = code;
219
+ return;
220
+ }
221
+ }
222
+ const service = await (deps.serviceState ?? serviceState)();
223
+ if (!service.installed) {
224
+ console.log("service not installed; upgrade done, nothing restarted");
225
+ process.exitCode = 0;
226
+ return;
227
+ }
228
+ if (service.stopped) {
229
+ console.log(`service stopped; upgrade done, it stays off until \`${commandHint("service")} start\``);
230
+ process.exitCode = 0;
231
+ return;
232
+ }
233
+ (deps.exit ?? process.exit)(await restart({ force: values.force, argv: argv.filter((arg) => arg !== "--force") }));
234
+ }
235
+ if (false) {}
236
+ export {
237
+ upgradeThroughHost,
238
+ npmBeside,
239
+ main
240
+ };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  connectRemoteDurable
3
- } from "./chunk-4fferbxw.js";
4
- import"./chunk-kmzzjv53.js";
3
+ } from "./chunk-e59k3bmz.js";
4
+ import"./chunk-1mjbt2z2.js";
5
5
  import {
6
6
  isLoopbackUrl
7
- } from "./chunk-pqe7q1s7.js";
7
+ } from "./chunk-6vbp1vva.js";
8
8
  import {
9
9
  hostAddress
10
10
  } from "./chunk-ngf1zatm.js";
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ awaitRestarted,
4
+ connectToHost,
3
5
  main,
4
6
  reachabilityLine,
5
7
  restartService,
@@ -7,13 +9,14 @@ import {
7
9
  startService,
8
10
  stopService,
9
11
  versionLine
10
- } from "./chunk-wd7aracm.js";
11
- import"./chunk-4fferbxw.js";
12
+ } from "./chunk-eerpgvy9.js";
13
+ import"./chunk-e59k3bmz.js";
12
14
  import"./chunk-kzbzacz9.js";
13
- import"./chunk-kmzzjv53.js";
14
- import"./chunk-pqe7q1s7.js";
15
+ import"./chunk-mxwcnnkg.js";
16
+ import"./chunk-1mjbt2z2.js";
17
+ import"./chunk-6vbp1vva.js";
15
18
  import"./chunk-ngf1zatm.js";
16
- import"./chunk-s0h7c7da.js";
19
+ import"./chunk-1rdbnvy6.js";
17
20
  import"./chunk-df32avw6.js";
18
21
  export {
19
22
  versionLine,
@@ -22,5 +25,7 @@ export {
22
25
  serviceStatusJson,
23
26
  restartService,
24
27
  reachabilityLine,
25
- main
28
+ main,
29
+ connectToHost,
30
+ awaitRestarted
26
31
  };
@@ -3,7 +3,7 @@ import {
3
3
  generateKeyPair,
4
4
  keyPairFromPrivate,
5
5
  toBase64Url
6
- } from "./chunk-pqe7q1s7.js";
6
+ } from "./chunk-6vbp1vva.js";
7
7
 
8
8
  // apps/host/src/devices.ts
9
9
  import { link, readFile, unlink, writeFile } from "node:fs/promises";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-ngf1zatm.js";
4
4
  import {
5
5
  packagedVersion
6
- } from "./chunk-s0h7c7da.js";
6
+ } from "./chunk-1rdbnvy6.js";
7
7
  import"./chunk-df32avw6.js";
8
8
 
9
9
  // apps/host/src/cli/web-link.ts