@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.
Files changed (322) hide show
  1. package/README.md +114 -50
  2. package/bin/qcr.js +1 -1
  3. package/config.example.toml +20 -6
  4. package/deploy/ansible/README.md +20 -12
  5. package/deploy/ansible/inventory.example.ini +1 -1
  6. package/deploy/collect-secrets.sh +1 -1
  7. package/deploy/qcr-update.sh +1 -1
  8. package/dist/extensions/cli/home.js +14 -0
  9. package/dist/extensions/cli/home.js.map +1 -0
  10. package/dist/extensions/cli/selfimprove.js +18 -0
  11. package/dist/extensions/cli/selfimprove.js.map +1 -0
  12. package/dist/extensions/home.js +350 -0
  13. package/dist/extensions/home.js.map +1 -0
  14. package/dist/extensions/login-route.js +1 -1
  15. package/dist/extensions/login-route.js.map +1 -1
  16. package/dist/extensions/onboarding.js +8 -7
  17. package/dist/extensions/onboarding.js.map +1 -1
  18. package/dist/extensions/selfimprove.js +49 -0
  19. package/dist/extensions/selfimprove.js.map +1 -0
  20. package/dist/extensions/setup-scan.js +23 -592
  21. package/dist/extensions/setup-scan.js.map +1 -1
  22. package/dist/extensions/setup.js +2 -47
  23. package/dist/extensions/setup.js.map +1 -1
  24. package/dist/src/archive/restore.js +18 -15
  25. package/dist/src/archive/restore.js.map +1 -1
  26. package/dist/src/botworker.js +13 -2
  27. package/dist/src/botworker.js.map +1 -1
  28. package/dist/src/channelfs.js +3 -26
  29. package/dist/src/channelfs.js.map +1 -1
  30. package/dist/src/cli.js +12 -50
  31. package/dist/src/cli.js.map +1 -1
  32. package/dist/src/config.js +16 -0
  33. package/dist/src/config.js.map +1 -1
  34. package/dist/src/daemon.js +26 -0
  35. package/dist/src/daemon.js.map +1 -1
  36. package/dist/src/debuground.js +1 -0
  37. package/dist/src/debuground.js.map +1 -1
  38. package/dist/src/debugroundpi.js +1 -0
  39. package/dist/src/debugroundpi.js.map +1 -1
  40. package/dist/src/engine/caserunner-sdk.js +15 -251
  41. package/dist/src/engine/caserunner-sdk.js.map +1 -1
  42. package/dist/src/home/adapters.js +349 -0
  43. package/dist/src/home/adapters.js.map +1 -0
  44. package/dist/src/home/advanced.js +318 -0
  45. package/dist/src/home/advanced.js.map +1 -0
  46. package/dist/src/home/advancedtools.js +57 -0
  47. package/dist/src/home/advancedtools.js.map +1 -0
  48. package/dist/src/home/autoreview.js +325 -0
  49. package/dist/src/home/autoreview.js.map +1 -0
  50. package/dist/src/home/daemonstatus.js +32 -0
  51. package/dist/src/home/daemonstatus.js.map +1 -0
  52. package/dist/src/home/devicelogin.js +61 -0
  53. package/dist/src/home/devicelogin.js.map +1 -0
  54. package/dist/src/home/launch.js +202 -0
  55. package/dist/src/home/launch.js.map +1 -0
  56. package/dist/src/home/loginowner.js +205 -0
  57. package/dist/src/home/loginowner.js.map +1 -0
  58. package/dist/src/home/memory.js +122 -0
  59. package/dist/src/home/memory.js.map +1 -0
  60. package/dist/src/home/model.js +811 -0
  61. package/dist/src/home/model.js.map +1 -0
  62. package/dist/src/home/panel.js +520 -0
  63. package/dist/src/home/panel.js.map +1 -0
  64. package/dist/src/home/ports.js +19 -0
  65. package/dist/src/home/ports.js.map +1 -0
  66. package/dist/src/home/review.js +163 -0
  67. package/dist/src/home/review.js.map +1 -0
  68. package/dist/src/home/reviews.js +478 -0
  69. package/dist/src/home/reviews.js.map +1 -0
  70. package/dist/src/home/setup.js +507 -0
  71. package/dist/src/home/setup.js.map +1 -0
  72. package/dist/src/home/setupadapters.js +214 -0
  73. package/dist/src/home/setupadapters.js.map +1 -0
  74. package/dist/src/home/setupcard.js +199 -0
  75. package/dist/src/home/setupcard.js.map +1 -0
  76. package/dist/src/home/setuptools.js +45 -0
  77. package/dist/src/home/setuptools.js.map +1 -0
  78. package/dist/src/home/spend.js +160 -0
  79. package/dist/src/home/spend.js.map +1 -0
  80. package/dist/src/home/switches.js +209 -0
  81. package/dist/src/home/switches.js.map +1 -0
  82. package/dist/src/home/switchon.js +439 -0
  83. package/dist/src/home/switchon.js.map +1 -0
  84. package/dist/src/home/toolnames.js +41 -0
  85. package/dist/src/home/toolnames.js.map +1 -0
  86. package/dist/src/home/tune.js +341 -0
  87. package/dist/src/home/tune.js.map +1 -0
  88. package/dist/src/home/words.js +7 -0
  89. package/dist/src/home/words.js.map +1 -0
  90. package/dist/src/homes.js +14 -0
  91. package/dist/src/homes.js.map +1 -1
  92. package/dist/src/install.js +1 -1
  93. package/dist/src/install.js.map +1 -1
  94. package/dist/src/ipc/workerspec.js +8 -0
  95. package/dist/src/ipc/workerspec.js.map +1 -1
  96. package/dist/src/live/publish.js +1 -1
  97. package/dist/src/live/publish.js.map +1 -1
  98. package/dist/src/livecli.js +1 -1
  99. package/dist/src/livecli.js.map +1 -1
  100. package/dist/src/loginrefresh/handover.js +121 -0
  101. package/dist/src/loginrefresh/handover.js.map +1 -0
  102. package/dist/src/loginrefresh/lock.js +54 -3
  103. package/dist/src/loginrefresh/lock.js.map +1 -1
  104. package/dist/src/loginrefresh/refresher.js +33 -5
  105. package/dist/src/loginrefresh/refresher.js.map +1 -1
  106. package/dist/src/loginrefresh/supervisor.js +18 -1
  107. package/dist/src/loginrefresh/supervisor.js.map +1 -1
  108. package/dist/src/npmverbs.js +42 -12
  109. package/dist/src/npmverbs.js.map +1 -1
  110. package/dist/src/onboard/choices.js +6 -3
  111. package/dist/src/onboard/choices.js.map +1 -1
  112. package/dist/src/onboard/engine.js +33 -292
  113. package/dist/src/onboard/engine.js.map +1 -1
  114. package/dist/src/onboard/steps/bringup.js +3 -2
  115. package/dist/src/onboard/steps/bringup.js.map +1 -1
  116. package/dist/src/onboard/steps/configfill.js +18 -7
  117. package/dist/src/onboard/steps/configfill.js.map +1 -1
  118. package/dist/src/onboard/steps/loginshare.js +213 -0
  119. package/dist/src/onboard/steps/loginshare.js.map +1 -0
  120. package/dist/src/onboard/steps/memory.js +14 -2
  121. package/dist/src/onboard/steps/memory.js.map +1 -1
  122. package/dist/src/onboard/steps/repoconfig.js +72 -0
  123. package/dist/src/onboard/steps/repoconfig.js.map +1 -0
  124. package/dist/src/onboard/toolnames.js +2 -2
  125. package/dist/src/onboard/toolnames.js.map +1 -1
  126. package/dist/src/piagentdir.js +13 -0
  127. package/dist/src/piagentdir.js.map +1 -0
  128. package/dist/src/pilogin.js +31 -16
  129. package/dist/src/pilogin.js.map +1 -1
  130. package/dist/src/qcrbin.js +16 -11
  131. package/dist/src/qcrbin.js.map +1 -1
  132. package/dist/src/reviewargs.js +122 -0
  133. package/dist/src/reviewargs.js.map +1 -0
  134. package/dist/src/reviewcli.js +7 -161
  135. package/dist/src/reviewcli.js.map +1 -1
  136. package/dist/src/reviewdetach.js +76 -11
  137. package/dist/src/reviewdetach.js.map +1 -1
  138. package/dist/src/scancli.js +39 -691
  139. package/dist/src/scancli.js.map +1 -1
  140. package/dist/src/selfimprove.js +66 -0
  141. package/dist/src/selfimprove.js.map +1 -0
  142. package/dist/src/setup/adapters.js +5 -223
  143. package/dist/src/setup/adapters.js.map +1 -1
  144. package/dist/src/setup/caserunner.js +15 -249
  145. package/dist/src/setup/caserunner.js.map +1 -1
  146. package/dist/src/setup/engine.js +32 -341
  147. package/dist/src/setup/engine.js.map +1 -1
  148. package/dist/src/setup/facts.js +3 -592
  149. package/dist/src/setup/facts.js.map +1 -1
  150. package/dist/src/setup/findings.js +3 -947
  151. package/dist/src/setup/findings.js.map +1 -1
  152. package/dist/src/setup/presentation.js +3 -8
  153. package/dist/src/setup/presentation.js.map +1 -1
  154. package/dist/src/setup/scan.js +3 -724
  155. package/dist/src/setup/scan.js.map +1 -1
  156. package/dist/src/setup/scanbuild.js +9 -92
  157. package/dist/src/setup/scanbuild.js.map +1 -1
  158. package/dist/src/setup/scanlease.js +3 -250
  159. package/dist/src/setup/scanlease.js.map +1 -1
  160. package/dist/src/setup/scanreport.js +3 -288
  161. package/dist/src/setup/scanreport.js.map +1 -1
  162. package/dist/src/setup/scanrun.js +3 -1732
  163. package/dist/src/setup/scanrun.js.map +1 -1
  164. package/dist/src/setup/scantree.js +3 -256
  165. package/dist/src/setup/scantree.js.map +1 -1
  166. package/dist/src/setup/stage2request.js +3 -258
  167. package/dist/src/setup/stage2request.js.map +1 -1
  168. package/dist/src/setup/unitcut.js +3 -436
  169. package/dist/src/setup/unitcut.js.map +1 -1
  170. package/dist/src/state.js +2 -0
  171. package/dist/src/state.js.map +1 -1
  172. package/dist/src/takeover.js +1 -0
  173. package/dist/src/takeover.js.map +1 -1
  174. package/dist/src/takeoverpi.js +2 -1
  175. package/dist/src/takeoverpi.js.map +1 -1
  176. package/dist/src/tui/board.js +1 -1
  177. package/dist/src/tui/board.js.map +1 -1
  178. package/dist/src/tui/companion.js +2 -1
  179. package/dist/src/tui/companion.js.map +1 -1
  180. package/dist/src/tui/deploytab.js +2 -2
  181. package/dist/src/tui/deploytab.js.map +1 -1
  182. package/dist/src/tui/index.js +9 -6
  183. package/dist/src/tui/index.js.map +1 -1
  184. package/dist/src/tui/memory.js +3 -16
  185. package/dist/src/tui/memory.js.map +1 -1
  186. package/dist/src/tui/memoryurl.js +22 -0
  187. package/dist/src/tui/memoryurl.js.map +1 -0
  188. package/dist/src/tui/remote.js +1 -1
  189. package/dist/src/tui/remote.js.map +1 -1
  190. package/dist/src/tui/route.js +2 -2
  191. package/dist/src/tui/route.js.map +1 -1
  192. package/dist/src/tui/setupstate.js +8 -5
  193. package/dist/src/tui/setupstate.js.map +1 -1
  194. package/dist/src/tui/sshtriage.js +1 -1
  195. package/dist/src/tui/sshtriage.js.map +1 -1
  196. package/dist/src/wire.js +6 -2
  197. package/dist/src/wire.js.map +1 -1
  198. package/dist/src/workerworld.js +4 -0
  199. package/dist/src/workerworld.js.map +1 -1
  200. package/docker/README.md +1 -1
  201. package/docker/entrypoint.sh +40 -6
  202. package/docker-compose.yml +16 -1
  203. package/extensions/cli/home.ts +14 -0
  204. package/extensions/cli/selfimprove.ts +18 -0
  205. package/extensions/home.ts +484 -0
  206. package/extensions/login-route.ts +1 -1
  207. package/extensions/onboarding.ts +8 -7
  208. package/extensions/selfimprove.ts +65 -0
  209. package/extensions/setup-scan.ts +79 -766
  210. package/extensions/setup.ts +14 -70
  211. package/package.json +6 -4
  212. package/prompts/onboarding.md +8 -7
  213. package/schemas/review-result.v1.json +60 -0
  214. package/scripts/deploy.sh +8 -6
  215. package/scripts/qcr-host.sh +28 -5
  216. package/scripts/vm-ghcr-login.sh +7 -4
  217. package/src/archive/restore.ts +18 -21
  218. package/src/botworker.ts +13 -2
  219. package/src/channelfs.ts +3 -26
  220. package/src/cli.ts +11 -54
  221. package/src/config.ts +38 -0
  222. package/src/daemon.ts +26 -0
  223. package/src/debuground.ts +3 -0
  224. package/src/debugroundpi.ts +1 -0
  225. package/src/engine/caserunner-sdk.ts +29 -314
  226. package/src/home/adapters.ts +418 -0
  227. package/src/home/advanced.ts +421 -0
  228. package/src/home/advancedtools.ts +96 -0
  229. package/src/home/autoreview.ts +385 -0
  230. package/src/home/daemonstatus.ts +55 -0
  231. package/src/home/devicelogin.ts +107 -0
  232. package/src/home/launch.ts +257 -0
  233. package/src/home/loginowner.ts +248 -0
  234. package/src/home/memory.ts +176 -0
  235. package/src/home/model.ts +965 -0
  236. package/src/home/panel.ts +666 -0
  237. package/src/home/ports.ts +338 -0
  238. package/src/home/review.ts +206 -0
  239. package/src/home/reviews.ts +565 -0
  240. package/src/home/setup.ts +689 -0
  241. package/src/home/setupadapters.ts +217 -0
  242. package/src/home/setupcard.ts +288 -0
  243. package/src/home/setuptools.ts +57 -0
  244. package/src/home/spend.ts +194 -0
  245. package/src/home/switches.ts +293 -0
  246. package/src/home/switchon.ts +554 -0
  247. package/src/home/toolnames.ts +46 -0
  248. package/src/home/tune.ts +405 -0
  249. package/src/home/words.ts +8 -0
  250. package/src/homes.ts +17 -0
  251. package/src/install.ts +1 -1
  252. package/src/ipc/workerspec.ts +15 -0
  253. package/src/live/publish.ts +4 -1
  254. package/src/livecli.ts +6 -1
  255. package/src/loginrefresh/handover.ts +138 -0
  256. package/src/loginrefresh/lock.ts +72 -3
  257. package/src/loginrefresh/refresher.ts +34 -5
  258. package/src/loginrefresh/supervisor.ts +25 -2
  259. package/src/npmverbs.ts +51 -11
  260. package/src/onboard/choices.ts +6 -3
  261. package/src/onboard/engine.ts +64 -434
  262. package/src/onboard/steps/bringup.ts +3 -2
  263. package/src/onboard/steps/configfill.ts +23 -7
  264. package/src/onboard/steps/loginshare.ts +258 -0
  265. package/src/onboard/steps/memory.ts +18 -2
  266. package/src/onboard/steps/repoconfig.ts +85 -0
  267. package/src/onboard/toolnames.ts +2 -2
  268. package/src/piagentdir.ts +12 -0
  269. package/src/pilogin.ts +32 -16
  270. package/src/qcrbin.ts +16 -11
  271. package/src/reviewargs.ts +119 -0
  272. package/src/reviewcli.ts +6 -167
  273. package/src/reviewdetach.ts +107 -13
  274. package/src/scancli.ts +75 -826
  275. package/src/selfimprove.ts +90 -0
  276. package/src/setup/adapters.ts +13 -221
  277. package/src/setup/caserunner.ts +34 -273
  278. package/src/setup/engine.ts +62 -496
  279. package/src/setup/facts.ts +3 -627
  280. package/src/setup/findings.ts +3 -1264
  281. package/src/setup/presentation.ts +3 -18
  282. package/src/setup/scan.ts +3 -1033
  283. package/src/setup/scanbuild.ts +20 -114
  284. package/src/setup/scanlease.ts +3 -297
  285. package/src/setup/scanreport.ts +3 -373
  286. package/src/setup/scanrun.ts +3 -2268
  287. package/src/setup/scantree.ts +3 -259
  288. package/src/setup/stage2request.ts +3 -347
  289. package/src/setup/unitcut.ts +3 -523
  290. package/src/state.ts +25 -0
  291. package/src/takeover.ts +5 -0
  292. package/src/takeoverpi.ts +3 -2
  293. package/src/tui/board.ts +1 -1
  294. package/src/tui/companion.ts +2 -1
  295. package/src/tui/deploytab.ts +2 -2
  296. package/src/tui/index.ts +9 -6
  297. package/src/tui/memory.ts +3 -15
  298. package/src/tui/memoryurl.ts +22 -0
  299. package/src/tui/remote.ts +1 -1
  300. package/src/tui/route.ts +2 -2
  301. package/src/tui/setupstate.ts +20 -16
  302. package/src/tui/sshtriage.ts +1 -1
  303. package/src/wire.ts +6 -2
  304. package/src/workerworld.ts +9 -1
  305. package/dist/src/live/projection.js +0 -450
  306. package/dist/src/live/projection.js.map +0 -1
  307. package/dist/src/live/read.js +0 -60
  308. package/dist/src/live/read.js.map +0 -1
  309. package/dist/src/onboard/launch.js +0 -75
  310. package/dist/src/onboard/launch.js.map +0 -1
  311. package/dist/src/setup/ledger.js +0 -207
  312. package/dist/src/setup/ledger.js.map +0 -1
  313. package/dist/src/setup/stage2.js +0 -617
  314. package/dist/src/setup/stage2.js.map +0 -1
  315. package/dist/src/setup/textsniff.js +0 -89
  316. package/dist/src/setup/textsniff.js.map +0 -1
  317. package/src/live/projection.ts +0 -491
  318. package/src/live/read.ts +0 -86
  319. package/src/onboard/launch.ts +0 -103
  320. package/src/setup/ledger.ts +0 -324
  321. package/src/setup/stage2.ts +0 -926
  322. 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 onboarding checklist is not complete: run qcr onboard
118
- (the board names the next step)
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 this checkout holds locally (the compose project's .env, the
458
- // onboarding checklist, the Docker socket's mode). Two small file reads and
459
- // one access(2): no docker, network or walk, so it may precede the frame.
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 routeFacts = deps.routeFacts ?? readRouteFacts(sandboxRoot());
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, MEMORY } from "./companion.js";
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
- * Where the TUI reaches OpenViking: the memory forward's loopback listener.
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 — run `qcr onboard`, or set [tui] target = "local"';
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
- '(run `qcr onboard`, or set [tui] target = "local", to make it explicit)',
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 route's ssh alias is written by onboarding: run `qcr onboard`"
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
  }
@@ -1,25 +1,27 @@
1
- // Is onboarding finished? Read from the checklist file the wizard keeps
2
- // (src/onboard/engine.ts), so a TUI opened halfway through `qcr onboard` says
3
- // so on its first frame instead of troubleshooting a daemon nobody has started
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 ran the wizard (a hand-written config, the VM operator's own setup)
8
- // has no checklist and gets no banner. The next step is the first enabled step,
9
- // in the wizard's own order, that the file does not record as done — the same
10
- // predicates the engine applies, so the TUI cannot name a step the wizard would
11
- // skip.
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 ("the final verification" when only
16
- * finish is left), or undefined when it could not be computed. */
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 onboard\` to continue${s.next ? ` (next: ${s.next})` : ""}`;
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, or onboarding is complete). */
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 { defaultSteps } = await import("../onboard/steps/index.js");
38
- const steps = [...defaultSteps()].sort((a, b) => a.order - b.order);
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
- next = pending?.title ?? "the final verification";
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.
@@ -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: "qcr onboard",
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.
@@ -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: where the login lives (the refresher keeps it). */
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,