@quickchatai/quickreview 1.2.0 → 1.3.1
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 +114 -50
- package/bin/qcr.js +1 -1
- package/config.example.toml +20 -6
- package/deploy/ansible/README.md +20 -12
- package/deploy/ansible/inventory.example.ini +1 -1
- package/deploy/collect-secrets.sh +1 -1
- package/deploy/qcr-update.sh +1 -1
- package/dist/extensions/cli/home.js +14 -0
- package/dist/extensions/cli/home.js.map +1 -0
- package/dist/extensions/cli/selfimprove.js +18 -0
- package/dist/extensions/cli/selfimprove.js.map +1 -0
- package/dist/extensions/home.js +350 -0
- package/dist/extensions/home.js.map +1 -0
- package/dist/extensions/login-route.js +1 -1
- package/dist/extensions/login-route.js.map +1 -1
- package/dist/extensions/onboarding.js +8 -7
- package/dist/extensions/onboarding.js.map +1 -1
- package/dist/extensions/selfimprove.js +49 -0
- package/dist/extensions/selfimprove.js.map +1 -0
- package/dist/extensions/setup-scan.js +23 -592
- package/dist/extensions/setup-scan.js.map +1 -1
- package/dist/extensions/setup.js +2 -47
- package/dist/extensions/setup.js.map +1 -1
- package/dist/src/archive/restore.js +18 -15
- package/dist/src/archive/restore.js.map +1 -1
- package/dist/src/botworker.js +13 -2
- package/dist/src/botworker.js.map +1 -1
- package/dist/src/channelfs.js +3 -26
- package/dist/src/channelfs.js.map +1 -1
- package/dist/src/cli.js +12 -50
- package/dist/src/cli.js.map +1 -1
- package/dist/src/config.js +16 -0
- package/dist/src/config.js.map +1 -1
- package/dist/src/daemon.js +26 -0
- package/dist/src/daemon.js.map +1 -1
- package/dist/src/debuground.js +1 -0
- package/dist/src/debuground.js.map +1 -1
- package/dist/src/debugroundpi.js +1 -0
- package/dist/src/debugroundpi.js.map +1 -1
- package/dist/src/engine/caserunner-sdk.js +15 -251
- package/dist/src/engine/caserunner-sdk.js.map +1 -1
- package/dist/src/home/adapters.js +349 -0
- package/dist/src/home/adapters.js.map +1 -0
- package/dist/src/home/advanced.js +318 -0
- package/dist/src/home/advanced.js.map +1 -0
- package/dist/src/home/advancedtools.js +57 -0
- package/dist/src/home/advancedtools.js.map +1 -0
- package/dist/src/home/autoreview.js +325 -0
- package/dist/src/home/autoreview.js.map +1 -0
- package/dist/src/home/daemonstatus.js +32 -0
- package/dist/src/home/daemonstatus.js.map +1 -0
- package/dist/src/home/devicelogin.js +61 -0
- package/dist/src/home/devicelogin.js.map +1 -0
- package/dist/src/home/launch.js +202 -0
- package/dist/src/home/launch.js.map +1 -0
- package/dist/src/home/loginowner.js +205 -0
- package/dist/src/home/loginowner.js.map +1 -0
- package/dist/src/home/memory.js +122 -0
- package/dist/src/home/memory.js.map +1 -0
- package/dist/src/home/model.js +811 -0
- package/dist/src/home/model.js.map +1 -0
- package/dist/src/home/panel.js +520 -0
- package/dist/src/home/panel.js.map +1 -0
- package/dist/src/home/ports.js +19 -0
- package/dist/src/home/ports.js.map +1 -0
- package/dist/src/home/review.js +163 -0
- package/dist/src/home/review.js.map +1 -0
- package/dist/src/home/reviews.js +478 -0
- package/dist/src/home/reviews.js.map +1 -0
- package/dist/src/home/setup.js +507 -0
- package/dist/src/home/setup.js.map +1 -0
- package/dist/src/home/setupadapters.js +214 -0
- package/dist/src/home/setupadapters.js.map +1 -0
- package/dist/src/home/setupcard.js +199 -0
- package/dist/src/home/setupcard.js.map +1 -0
- package/dist/src/home/setuptools.js +45 -0
- package/dist/src/home/setuptools.js.map +1 -0
- package/dist/src/home/spend.js +160 -0
- package/dist/src/home/spend.js.map +1 -0
- package/dist/src/home/switches.js +209 -0
- package/dist/src/home/switches.js.map +1 -0
- package/dist/src/home/switchon.js +439 -0
- package/dist/src/home/switchon.js.map +1 -0
- package/dist/src/home/toolnames.js +41 -0
- package/dist/src/home/toolnames.js.map +1 -0
- package/dist/src/home/tune.js +341 -0
- package/dist/src/home/tune.js.map +1 -0
- package/dist/src/home/words.js +7 -0
- package/dist/src/home/words.js.map +1 -0
- package/dist/src/homes.js +14 -0
- package/dist/src/homes.js.map +1 -1
- package/dist/src/install.js +1 -1
- package/dist/src/install.js.map +1 -1
- package/dist/src/ipc/workerspec.js +8 -0
- package/dist/src/ipc/workerspec.js.map +1 -1
- package/dist/src/live/publish.js +1 -1
- package/dist/src/live/publish.js.map +1 -1
- package/dist/src/livecli.js +1 -1
- package/dist/src/livecli.js.map +1 -1
- package/dist/src/loginrefresh/handover.js +121 -0
- package/dist/src/loginrefresh/handover.js.map +1 -0
- package/dist/src/loginrefresh/lock.js +54 -3
- package/dist/src/loginrefresh/lock.js.map +1 -1
- package/dist/src/loginrefresh/refresher.js +33 -5
- package/dist/src/loginrefresh/refresher.js.map +1 -1
- package/dist/src/loginrefresh/supervisor.js +18 -1
- package/dist/src/loginrefresh/supervisor.js.map +1 -1
- package/dist/src/npmverbs.js +42 -12
- package/dist/src/npmverbs.js.map +1 -1
- package/dist/src/onboard/choices.js +6 -3
- package/dist/src/onboard/choices.js.map +1 -1
- package/dist/src/onboard/engine.js +33 -292
- package/dist/src/onboard/engine.js.map +1 -1
- package/dist/src/onboard/steps/bringup.js +3 -2
- package/dist/src/onboard/steps/bringup.js.map +1 -1
- package/dist/src/onboard/steps/configfill.js +18 -7
- package/dist/src/onboard/steps/configfill.js.map +1 -1
- package/dist/src/onboard/steps/loginshare.js +213 -0
- package/dist/src/onboard/steps/loginshare.js.map +1 -0
- package/dist/src/onboard/steps/memory.js +14 -2
- package/dist/src/onboard/steps/memory.js.map +1 -1
- package/dist/src/onboard/steps/repoconfig.js +72 -0
- package/dist/src/onboard/steps/repoconfig.js.map +1 -0
- package/dist/src/onboard/toolnames.js +2 -2
- package/dist/src/onboard/toolnames.js.map +1 -1
- package/dist/src/piagentdir.js +13 -0
- package/dist/src/piagentdir.js.map +1 -0
- package/dist/src/pilogin.js +31 -16
- package/dist/src/pilogin.js.map +1 -1
- package/dist/src/qcrbin.js +16 -11
- package/dist/src/qcrbin.js.map +1 -1
- package/dist/src/reviewargs.js +122 -0
- package/dist/src/reviewargs.js.map +1 -0
- package/dist/src/reviewcli.js +7 -161
- package/dist/src/reviewcli.js.map +1 -1
- package/dist/src/reviewdetach.js +76 -11
- package/dist/src/reviewdetach.js.map +1 -1
- package/dist/src/scancli.js +39 -691
- package/dist/src/scancli.js.map +1 -1
- package/dist/src/selfimprove.js +66 -0
- package/dist/src/selfimprove.js.map +1 -0
- package/dist/src/setup/adapters.js +5 -223
- package/dist/src/setup/adapters.js.map +1 -1
- package/dist/src/setup/caserunner.js +15 -249
- package/dist/src/setup/caserunner.js.map +1 -1
- package/dist/src/setup/engine.js +32 -341
- package/dist/src/setup/engine.js.map +1 -1
- package/dist/src/setup/facts.js +3 -592
- package/dist/src/setup/facts.js.map +1 -1
- package/dist/src/setup/findings.js +3 -947
- package/dist/src/setup/findings.js.map +1 -1
- package/dist/src/setup/presentation.js +3 -8
- package/dist/src/setup/presentation.js.map +1 -1
- package/dist/src/setup/scan.js +3 -724
- package/dist/src/setup/scan.js.map +1 -1
- package/dist/src/setup/scanbuild.js +9 -92
- package/dist/src/setup/scanbuild.js.map +1 -1
- package/dist/src/setup/scanlease.js +3 -250
- package/dist/src/setup/scanlease.js.map +1 -1
- package/dist/src/setup/scanreport.js +3 -288
- package/dist/src/setup/scanreport.js.map +1 -1
- package/dist/src/setup/scanrun.js +3 -1732
- package/dist/src/setup/scanrun.js.map +1 -1
- package/dist/src/setup/scantree.js +3 -256
- package/dist/src/setup/scantree.js.map +1 -1
- package/dist/src/setup/stage2request.js +3 -258
- package/dist/src/setup/stage2request.js.map +1 -1
- package/dist/src/setup/unitcut.js +3 -436
- package/dist/src/setup/unitcut.js.map +1 -1
- package/dist/src/state.js +2 -0
- package/dist/src/state.js.map +1 -1
- package/dist/src/takeover.js +1 -0
- package/dist/src/takeover.js.map +1 -1
- package/dist/src/takeoverpi.js +2 -1
- package/dist/src/takeoverpi.js.map +1 -1
- package/dist/src/tui/board.js +1 -1
- package/dist/src/tui/board.js.map +1 -1
- package/dist/src/tui/companion.js +2 -1
- package/dist/src/tui/companion.js.map +1 -1
- package/dist/src/tui/deploytab.js +2 -2
- package/dist/src/tui/deploytab.js.map +1 -1
- package/dist/src/tui/index.js +9 -6
- package/dist/src/tui/index.js.map +1 -1
- package/dist/src/tui/memory.js +3 -16
- package/dist/src/tui/memory.js.map +1 -1
- package/dist/src/tui/memoryurl.js +22 -0
- package/dist/src/tui/memoryurl.js.map +1 -0
- package/dist/src/tui/remote.js +1 -1
- package/dist/src/tui/remote.js.map +1 -1
- package/dist/src/tui/route.js +2 -2
- package/dist/src/tui/route.js.map +1 -1
- package/dist/src/tui/setupstate.js +8 -5
- package/dist/src/tui/setupstate.js.map +1 -1
- package/dist/src/tui/sshtriage.js +1 -1
- package/dist/src/tui/sshtriage.js.map +1 -1
- package/dist/src/wire.js +6 -2
- package/dist/src/wire.js.map +1 -1
- package/dist/src/workerworld.js +4 -0
- package/dist/src/workerworld.js.map +1 -1
- package/docker/README.md +1 -1
- package/docker/entrypoint.sh +40 -6
- package/docker-compose.yml +16 -1
- package/extensions/cli/home.ts +14 -0
- package/extensions/cli/selfimprove.ts +18 -0
- package/extensions/home.ts +484 -0
- package/extensions/login-route.ts +1 -1
- package/extensions/onboarding.ts +8 -7
- package/extensions/selfimprove.ts +65 -0
- package/extensions/setup-scan.ts +79 -766
- package/extensions/setup.ts +14 -70
- package/package.json +6 -4
- package/prompts/onboarding.md +8 -7
- package/schemas/review-result.v1.json +60 -0
- package/scripts/deploy.sh +8 -6
- package/scripts/qcr-host.sh +28 -5
- package/scripts/vm-ghcr-login.sh +7 -4
- package/src/archive/restore.ts +18 -21
- package/src/botworker.ts +13 -2
- package/src/channelfs.ts +3 -26
- package/src/cli.ts +11 -54
- package/src/config.ts +38 -0
- package/src/daemon.ts +26 -0
- package/src/debuground.ts +3 -0
- package/src/debugroundpi.ts +1 -0
- package/src/engine/caserunner-sdk.ts +29 -314
- package/src/home/adapters.ts +418 -0
- package/src/home/advanced.ts +421 -0
- package/src/home/advancedtools.ts +96 -0
- package/src/home/autoreview.ts +385 -0
- package/src/home/daemonstatus.ts +55 -0
- package/src/home/devicelogin.ts +107 -0
- package/src/home/launch.ts +257 -0
- package/src/home/loginowner.ts +248 -0
- package/src/home/memory.ts +176 -0
- package/src/home/model.ts +965 -0
- package/src/home/panel.ts +666 -0
- package/src/home/ports.ts +338 -0
- package/src/home/review.ts +206 -0
- package/src/home/reviews.ts +565 -0
- package/src/home/setup.ts +689 -0
- package/src/home/setupadapters.ts +217 -0
- package/src/home/setupcard.ts +288 -0
- package/src/home/setuptools.ts +57 -0
- package/src/home/spend.ts +194 -0
- package/src/home/switches.ts +293 -0
- package/src/home/switchon.ts +554 -0
- package/src/home/toolnames.ts +46 -0
- package/src/home/tune.ts +405 -0
- package/src/home/words.ts +8 -0
- package/src/homes.ts +17 -0
- package/src/install.ts +1 -1
- package/src/ipc/workerspec.ts +15 -0
- package/src/live/publish.ts +4 -1
- package/src/livecli.ts +6 -1
- package/src/loginrefresh/handover.ts +138 -0
- package/src/loginrefresh/lock.ts +72 -3
- package/src/loginrefresh/refresher.ts +34 -5
- package/src/loginrefresh/supervisor.ts +25 -2
- package/src/npmverbs.ts +51 -11
- package/src/onboard/choices.ts +6 -3
- package/src/onboard/engine.ts +64 -434
- package/src/onboard/steps/bringup.ts +3 -2
- package/src/onboard/steps/configfill.ts +23 -7
- package/src/onboard/steps/loginshare.ts +258 -0
- package/src/onboard/steps/memory.ts +18 -2
- package/src/onboard/steps/repoconfig.ts +85 -0
- package/src/onboard/toolnames.ts +2 -2
- package/src/piagentdir.ts +12 -0
- package/src/pilogin.ts +32 -16
- package/src/qcrbin.ts +16 -11
- package/src/reviewargs.ts +119 -0
- package/src/reviewcli.ts +6 -167
- package/src/reviewdetach.ts +107 -13
- package/src/scancli.ts +75 -826
- package/src/selfimprove.ts +90 -0
- package/src/setup/adapters.ts +13 -221
- package/src/setup/caserunner.ts +34 -273
- package/src/setup/engine.ts +62 -496
- package/src/setup/facts.ts +3 -627
- package/src/setup/findings.ts +3 -1264
- package/src/setup/presentation.ts +3 -18
- package/src/setup/scan.ts +3 -1033
- package/src/setup/scanbuild.ts +20 -114
- package/src/setup/scanlease.ts +3 -297
- package/src/setup/scanreport.ts +3 -373
- package/src/setup/scanrun.ts +3 -2268
- package/src/setup/scantree.ts +3 -259
- package/src/setup/stage2request.ts +3 -347
- package/src/setup/unitcut.ts +3 -523
- package/src/state.ts +25 -0
- package/src/takeover.ts +5 -0
- package/src/takeoverpi.ts +3 -2
- package/src/tui/board.ts +1 -1
- package/src/tui/companion.ts +2 -1
- package/src/tui/deploytab.ts +2 -2
- package/src/tui/index.ts +9 -6
- package/src/tui/memory.ts +3 -15
- package/src/tui/memoryurl.ts +22 -0
- package/src/tui/remote.ts +1 -1
- package/src/tui/route.ts +2 -2
- package/src/tui/setupstate.ts +20 -16
- package/src/tui/sshtriage.ts +1 -1
- package/src/wire.ts +6 -2
- package/src/workerworld.ts +9 -1
- package/dist/src/live/projection.js +0 -450
- package/dist/src/live/projection.js.map +0 -1
- package/dist/src/live/read.js +0 -60
- package/dist/src/live/read.js.map +0 -1
- package/dist/src/onboard/launch.js +0 -75
- package/dist/src/onboard/launch.js.map +0 -1
- package/dist/src/setup/ledger.js +0 -207
- package/dist/src/setup/ledger.js.map +0 -1
- package/dist/src/setup/stage2.js +0 -617
- package/dist/src/setup/stage2.js.map +0 -1
- package/dist/src/setup/textsniff.js +0 -89
- package/dist/src/setup/textsniff.js.map +0 -1
- package/src/live/projection.ts +0 -491
- package/src/live/read.ts +0 -86
- package/src/onboard/launch.ts +0 -103
- package/src/setup/ledger.ts +0 -324
- package/src/setup/stage2.ts +0 -926
- package/src/setup/textsniff.ts +0 -95
package/src/tui/index.ts
CHANGED
|
@@ -114,8 +114,8 @@ troubleshooting:
|
|
|
114
114
|
project): every read is docker exec into the daemon
|
|
115
115
|
container, no ssh. The board names an absent or stopped
|
|
116
116
|
container with the docker compose command that starts it
|
|
117
|
-
setup not finished the
|
|
118
|
-
|
|
117
|
+
setup not finished the setup checklist is not complete: run qcr (the board
|
|
118
|
+
names the next step)
|
|
119
119
|
▲ DATA STALE ssh works but status.json stopped updating — the
|
|
120
120
|
container is down or the daemon hung (qcr-side:
|
|
121
121
|
ssh <host> sudo docker ps / docker logs)
|
|
@@ -454,11 +454,14 @@ export async function runTui(argv: string | string[] = [], deps: RunTuiDeps = {}
|
|
|
454
454
|
|
|
455
455
|
const fileConfig = deps.config ?? loadConfig();
|
|
456
456
|
// The route — which daemon the board reads, and how — from [tui] plus the
|
|
457
|
-
// facts
|
|
458
|
-
// onboarding checklist, the Docker socket's mode).
|
|
459
|
-
//
|
|
457
|
+
// facts the stack holds locally (the compose project's .env, the
|
|
458
|
+
// onboarding checklist, the Docker socket's mode). The stack is the one the
|
|
459
|
+
// home sets up (src/homes.ts `stackRoot`), so an app installed by a package
|
|
460
|
+
// manager reads it from its state home. Two small file reads and one
|
|
461
|
+
// access(2): no docker, network or walk, so it may precede the frame.
|
|
460
462
|
const { readRouteFacts, resolveTuiRoute, pinnedVersion } = await import("./route.js");
|
|
461
|
-
const
|
|
463
|
+
const { stackRoot } = await import("../homes.js");
|
|
464
|
+
const routeFacts = deps.routeFacts ?? readRouteFacts(stackRoot(process.env, sandboxRoot()));
|
|
462
465
|
const route = resolveTuiRoute(fileConfig.tui, routeFacts);
|
|
463
466
|
const loaded: Config = { ...fileConfig, tui: route.cfg };
|
|
464
467
|
// In the containerised TUI the companion is a container the host wrapper
|
package/src/tui/memory.ts
CHANGED
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
import { countOutcome, emptyRequestCounter, type RequestCounter } from "../memory/health.js";
|
|
53
53
|
import { OpenVikingStore } from "../openviking/store.js";
|
|
54
54
|
import { readRetiredUrisFile, writeRetiredUris } from "../memory/ovsession.js";
|
|
55
|
-
import { keysFilePath
|
|
55
|
+
import { keysFilePath } from "./companion.js";
|
|
56
56
|
|
|
57
57
|
export { matchesQuery, normalizeTag, refOf } from "../memory/store.js";
|
|
58
58
|
export type {
|
|
@@ -227,20 +227,8 @@ export function keysFileReader(
|
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
*
|
|
233
|
-
* `QCR_MEMORY_URL` overrides it wholesale; `QCR_MEMORY_PORT` matches the flag
|
|
234
|
-
* the forward itself takes, so a non-default port only has to be spelled once.
|
|
235
|
-
* `MEMORY.port` is the shared constant the forward and the companion already
|
|
236
|
-
* agree on.
|
|
237
|
-
*/
|
|
238
|
-
export function tuiMemoryBaseUrl(env: NodeJS.ProcessEnv = process.env): string {
|
|
239
|
-
const explicit = (env["QCR_MEMORY_URL"] ?? env["QCR_MEMORY_ENDPOINT"] ?? "").trim();
|
|
240
|
-
if (explicit !== "") return explicit.replace(/\/+$/, "");
|
|
241
|
-
const port = Number(env["QCR_MEMORY_PORT"] ?? MEMORY.port) || MEMORY.port;
|
|
242
|
-
return `http://127.0.0.1:${port}`;
|
|
243
|
-
}
|
|
230
|
+
import { tuiMemoryBaseUrl } from "./memoryurl.js";
|
|
231
|
+
export { tuiMemoryBaseUrl };
|
|
244
232
|
|
|
245
233
|
// ---- the store ---------------------------------------------------------------
|
|
246
234
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Where this host reaches OpenViking: the memory forward's loopback
|
|
2
|
+
// listener. A leaf module, so a reader of the URL (the wizard's memory step,
|
|
3
|
+
// the home) never imports the TUI's memory store or the companion.
|
|
4
|
+
|
|
5
|
+
/** The port the memory forward and the companion agree on, the server's own
|
|
6
|
+
* in the VM container (`[openviking] port`). */
|
|
7
|
+
export const MEMORY_PORT = 1933;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Where the TUI reaches OpenViking: the memory forward's loopback listener.
|
|
11
|
+
*
|
|
12
|
+
* `QCR_MEMORY_URL` overrides it wholesale; `QCR_MEMORY_PORT` matches the flag
|
|
13
|
+
* the forward itself takes, so a non-default port only has to be spelled once.
|
|
14
|
+
* `MEMORY_PORT` is the shared constant the forward and the companion already
|
|
15
|
+
* agree on.
|
|
16
|
+
*/
|
|
17
|
+
export function tuiMemoryBaseUrl(env: NodeJS.ProcessEnv = process.env): string {
|
|
18
|
+
const explicit = (env["QCR_MEMORY_URL"] ?? env["QCR_MEMORY_ENDPOINT"] ?? "").trim();
|
|
19
|
+
if (explicit !== "") return explicit.replace(/\/+$/, "");
|
|
20
|
+
const port = Number(env["QCR_MEMORY_PORT"] ?? MEMORY_PORT) || MEMORY_PORT;
|
|
21
|
+
return `http://127.0.0.1:${port}`;
|
|
22
|
+
}
|
package/src/tui/remote.ts
CHANGED
|
@@ -341,7 +341,7 @@ export function killInFlightSsh(): number {
|
|
|
341
341
|
* die on "Could not resolve hostname" and every surface would print an ssh
|
|
342
342
|
* remedy with no host in it. */
|
|
343
343
|
export const NO_SSH_HOST_STDERR =
|
|
344
|
-
'[tui] ssh_host is empty —
|
|
344
|
+
'[tui] ssh_host is empty — set it to the VM\'s ssh alias, or set [tui] target = "local"';
|
|
345
345
|
|
|
346
346
|
export const realSshRunner: SshRunner = (host, argv, opts) =>
|
|
347
347
|
host.trim() === ""
|
package/src/tui/route.ts
CHANGED
|
@@ -109,7 +109,7 @@ export function resolveTuiRoute(file: TuiConfig, facts: RouteFacts): TuiRoute {
|
|
|
109
109
|
};
|
|
110
110
|
notes.push(
|
|
111
111
|
`[tui] target is "ssh" with no ssh_host — reading the local compose stack in ${facts.projectDir} instead ` +
|
|
112
|
-
'(
|
|
112
|
+
'(set [tui] target = "local" to make it explicit)',
|
|
113
113
|
);
|
|
114
114
|
} else {
|
|
115
115
|
return {
|
|
@@ -117,7 +117,7 @@ export function resolveTuiRoute(file: TuiConfig, facts: RouteFacts): TuiRoute {
|
|
|
117
117
|
notes,
|
|
118
118
|
unconfigured:
|
|
119
119
|
topology === "vm"
|
|
120
|
-
? "[tui] ssh_host is empty — the VM
|
|
120
|
+
? "[tui] ssh_host is empty — set it to the VM's ssh alias in config.toml"
|
|
121
121
|
: EMPTY_SSH_HOST,
|
|
122
122
|
};
|
|
123
123
|
}
|
package/src/tui/setupstate.ts
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
// Is
|
|
2
|
-
// (src/onboard/engine.ts), so a TUI opened halfway through
|
|
3
|
-
//
|
|
4
|
-
// yet.
|
|
1
|
+
// Is setup finished? Read from the checklist file switch-on and Advanced keep
|
|
2
|
+
// (src/onboard/engine.ts), so a TUI opened halfway through says so on its
|
|
3
|
+
// first frame instead of troubleshooting a daemon nobody has started yet.
|
|
5
4
|
//
|
|
6
5
|
// Only a checklist that EXISTS and is not complete counts: an install that
|
|
7
|
-
// never
|
|
8
|
-
// has no checklist and gets no banner.
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
6
|
+
// never switched auto-review on (a hand-written config, the VM operator's own
|
|
7
|
+
// setup) has no checklist and gets no banner. Setup is finished in the home
|
|
8
|
+
// (a bare `qcr`), so the steps judged are the home's: switch-on's and
|
|
9
|
+
// Advanced's registry (src/home/advanced.ts), with the engine's own
|
|
10
|
+
// predicates. The next step is the first enabled, required one the file does
|
|
11
|
+
// not record as done; when there is none, nothing is left that the home could
|
|
12
|
+
// finish, and there is no banner (the home never runs the wizard's finish, so
|
|
13
|
+
// its checklist need not carry the wizard's completion marker).
|
|
12
14
|
import { type ChecklistFile } from "../onboard/engine.js";
|
|
13
15
|
|
|
14
16
|
export interface SetupState {
|
|
15
|
-
/** The title of the first pending step
|
|
16
|
-
*
|
|
17
|
+
/** The title of the first pending step, or undefined when it could not be
|
|
18
|
+
* computed. */
|
|
17
19
|
next: string | undefined;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
/** The one sentence every surface uses. */
|
|
21
23
|
export function setupLine(s: SetupState): string {
|
|
22
|
-
return `setup not finished — run \`qcr
|
|
24
|
+
return `setup not finished — run \`qcr\` to finish setting up${s.next ? ` (next: ${s.next})` : ""}`;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
/** Complete now: finished once and not reopened since (engine.ts `completeNow`). */
|
|
@@ -27,22 +29,24 @@ function completeNow(file: ChecklistFile): boolean {
|
|
|
27
29
|
return typeof file.completed_at === "string" && !file.reopened_at;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
/** undefined = nothing to say (no checklist,
|
|
32
|
+
/** undefined = nothing to say (no checklist, setup is complete, or the home
|
|
33
|
+
* has no step left to finish). */
|
|
31
34
|
export async function setupStateOf(
|
|
32
35
|
checklist: ChecklistFile | null,
|
|
33
36
|
): Promise<SetupState | undefined> {
|
|
34
37
|
if (checklist === null || completeNow(checklist)) return undefined;
|
|
35
38
|
let next: string | undefined;
|
|
36
39
|
try {
|
|
37
|
-
const {
|
|
38
|
-
const steps = [...
|
|
40
|
+
const { advancedRegistry } = await import("../home/advanced.js");
|
|
41
|
+
const steps = [...advancedRegistry().steps()].sort((a, b) => a.order - b.order);
|
|
39
42
|
const pending = steps.find(
|
|
40
43
|
(s) =>
|
|
41
44
|
!s.optional &&
|
|
42
45
|
(s.enabled ? s.enabled(checklist.choices) : true) &&
|
|
43
46
|
checklist.steps[s.id]?.status !== "done",
|
|
44
47
|
);
|
|
45
|
-
|
|
48
|
+
if (pending === undefined) return undefined;
|
|
49
|
+
next = pending.title;
|
|
46
50
|
} catch {
|
|
47
51
|
// The step registry could not be loaded: the banner still says setup is
|
|
48
52
|
// unfinished, without naming a step it could not compute.
|
package/src/tui/sshtriage.ts
CHANGED
|
@@ -584,7 +584,7 @@ export async function triageConnection(
|
|
|
584
584
|
return {
|
|
585
585
|
kind: "unconfigured",
|
|
586
586
|
cause: deps.unconfigured ?? NO_SSH_HOST_STDERR,
|
|
587
|
-
remedy: "
|
|
587
|
+
remedy: "set [tui] ssh_host in config.toml",
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
590
|
const exists = deps.exists ?? existsSync;
|
package/src/wire.ts
CHANGED
|
@@ -30,7 +30,7 @@ import { Archiver } from "./archive/archiver.js";
|
|
|
30
30
|
import { piGlobalSessionsDir } from "./archive/piglobal.js";
|
|
31
31
|
import { runDirOf, toolUidSplit } from "./ipc/capability.js";
|
|
32
32
|
import { PermitBroker } from "./ipc/permits.js";
|
|
33
|
-
import { LoginRefreshSupervisor } from "./loginrefresh/supervisor.js";
|
|
33
|
+
import { LoginRefreshSupervisor, loginDirOf } from "./loginrefresh/supervisor.js";
|
|
34
34
|
import { pendingArchiveStatus } from "./archive/status.js";
|
|
35
35
|
import { Learner, learnerKnobsOf } from "./learner/learner.js";
|
|
36
36
|
import { renderNoPacketSection } from "./learner/packet.js";
|
|
@@ -770,6 +770,9 @@ export function createProductionDaemon(parts: ProductionParts = buildParts()): D
|
|
|
770
770
|
// src/workerworld.ts. No config key picks the tmux route, and nothing births a
|
|
771
771
|
// `pr-<n>` tmux session any more; `sessions` serves paths, worktrees and the replay harness.
|
|
772
772
|
const agentDir = process.env["PI_CODING_AGENT_DIR"]?.trim() || join(homedir(), ".pi", "agent");
|
|
773
|
+
// The login itself: the agent dir, or the host's shared login on a single
|
|
774
|
+
// box (one login per box): the refresher owns it and every worker borrows it.
|
|
775
|
+
const loginDir = loginDirOf(process.env, agentDir);
|
|
773
776
|
const workerWorld = buildWorkerWorld({
|
|
774
777
|
cfg,
|
|
775
778
|
root,
|
|
@@ -783,6 +786,7 @@ export function createProductionDaemon(parts: ProductionParts = buildParts()): D
|
|
|
783
786
|
...(parts.ovSessions ? { ovSessions: parts.ovSessions } : {}),
|
|
784
787
|
permits: lensPermits,
|
|
785
788
|
agentDir,
|
|
789
|
+
loginDir,
|
|
786
790
|
pump: () => daemon.pump(),
|
|
787
791
|
loginGate: {
|
|
788
792
|
paused: () => loginRefresh?.paused() ?? false,
|
|
@@ -1627,7 +1631,7 @@ export function createProductionDaemon(parts: ProductionParts = buildParts()): D
|
|
|
1627
1631
|
if (cfg.login_refresh.enabled) {
|
|
1628
1632
|
loginRefresh = new LoginRefreshSupervisor({
|
|
1629
1633
|
repoRoot: root,
|
|
1630
|
-
agentDir,
|
|
1634
|
+
agentDir: loginDir,
|
|
1631
1635
|
marginMin: cfg.login_refresh.margin_min,
|
|
1632
1636
|
log,
|
|
1633
1637
|
// One anomaly per failure episode, through the one durable funnel.
|
package/src/workerworld.ts
CHANGED
|
@@ -27,6 +27,7 @@ import type { Config } from "./config.js";
|
|
|
27
27
|
import { DebugRoundManager } from "./debuground.js";
|
|
28
28
|
import type { FileOutcome } from "./improvements.js";
|
|
29
29
|
import { identityVars } from "@quickchatai/pi-quickreview/src/include.js";
|
|
30
|
+
import { reviewProviders } from "@quickchatai/pi-quickreview/src/modelroute.js";
|
|
30
31
|
import {
|
|
31
32
|
CapabilityStore,
|
|
32
33
|
LaunchFiles,
|
|
@@ -89,8 +90,12 @@ export interface WorkerWorldOptions {
|
|
|
89
90
|
sessions: PiSessionManager;
|
|
90
91
|
ovSessions?: OvSessionLifecycle;
|
|
91
92
|
permits: PermitBroker;
|
|
92
|
-
/** pi's agent dir:
|
|
93
|
+
/** pi's agent dir: models.json, settings and the built lens agents. */
|
|
93
94
|
agentDir: string;
|
|
95
|
+
/** Where the login lives (the refresher keeps it): the agent dir, unless
|
|
96
|
+
* the single box's shared login is mounted elsewhere (supervisor.ts
|
|
97
|
+
* `loginDirOf`). */
|
|
98
|
+
loginDir?: string;
|
|
94
99
|
/** Run the daemon's pump (a lease freed, a worker gone). Late-bound: the daemon is built
|
|
95
100
|
* after this. */
|
|
96
101
|
pump: () => Promise<void>;
|
|
@@ -206,6 +211,8 @@ export function buildWorkerWorld(o: WorkerWorldOptions): WorkerWorld {
|
|
|
206
211
|
root,
|
|
207
212
|
cwd: root,
|
|
208
213
|
agent_dir: o.agentDir,
|
|
214
|
+
...(o.loginDir !== undefined && o.loginDir !== o.agentDir ? { login_dir: o.loginDir } : {}),
|
|
215
|
+
providers: reviewProviders(cfg),
|
|
209
216
|
session_dir: sessions.sessionDir(row.session),
|
|
210
217
|
system_prompt_file: sessions.writeSystemPrompt(row.session, prompt),
|
|
211
218
|
model: cfg.models.conversation,
|
|
@@ -255,6 +262,7 @@ export function buildWorkerWorld(o: WorkerWorldOptions): WorkerWorld {
|
|
|
255
262
|
takeoverPlanFor({
|
|
256
263
|
root,
|
|
257
264
|
agentDir: o.agentDir,
|
|
265
|
+
...(o.loginDir !== undefined ? { loginDir: o.loginDir } : {}),
|
|
258
266
|
sessionsRoot: sessions.sessionsRoot(),
|
|
259
267
|
model: cfg.models.conversation,
|
|
260
268
|
pr,
|