@h-rig/cli 0.0.6-alpha.87 → 0.0.6-alpha.89

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 (78) hide show
  1. package/dist/bin/rig.js +1380 -865
  2. package/dist/src/app/board.js +462 -48
  3. package/dist/src/app-opentui/adapters/common.d.ts +3 -0
  4. package/dist/src/app-opentui/adapters/common.js +4 -0
  5. package/dist/src/app-opentui/adapters/doctor.js +458 -46
  6. package/dist/src/app-opentui/adapters/family.js +701 -151
  7. package/dist/src/app-opentui/adapters/fleet.js +477 -46
  8. package/dist/src/app-opentui/adapters/inbox.js +477 -46
  9. package/dist/src/app-opentui/adapters/init.js +497 -74
  10. package/dist/src/app-opentui/adapters/inspect.js +477 -46
  11. package/dist/src/app-opentui/adapters/pi-attach.d.ts +7 -0
  12. package/dist/src/app-opentui/adapters/pi-attach.js +1004 -519
  13. package/dist/src/app-opentui/adapters/run-detail.js +477 -46
  14. package/dist/src/app-opentui/adapters/server.d.ts +26 -0
  15. package/dist/src/app-opentui/adapters/server.js +676 -59
  16. package/dist/src/app-opentui/adapters/tasks.js +621 -549
  17. package/dist/src/app-opentui/autocomplete.js +4 -2
  18. package/dist/src/app-opentui/bootstrap.js +1376 -861
  19. package/dist/src/app-opentui/command-palette.js +37 -10
  20. package/dist/src/app-opentui/index.js +632 -528
  21. package/dist/src/app-opentui/intent.js +33 -8
  22. package/dist/src/app-opentui/keymap.js +43 -414
  23. package/dist/src/app-opentui/pi-host-child.js +496 -57
  24. package/dist/src/app-opentui/pi-pty-host.d.ts +14 -64
  25. package/dist/src/app-opentui/pi-pty-host.js +3 -397
  26. package/dist/src/app-opentui/react/App.js +144 -469
  27. package/dist/src/app-opentui/react/ChromeHost.js +44 -415
  28. package/dist/src/app-opentui/react/launch.js +659 -552
  29. package/dist/src/app-opentui/react/nav.js +1 -1
  30. package/dist/src/app-opentui/registry.js +1181 -742
  31. package/dist/src/app-opentui/remote-link.d.ts +10 -0
  32. package/dist/src/app-opentui/remote-link.js +47 -0
  33. package/dist/src/app-opentui/render/terminal-handoff.d.ts +16 -0
  34. package/dist/src/app-opentui/render/terminal-handoff.js +14 -0
  35. package/dist/src/app-opentui/runtime.js +632 -528
  36. package/dist/src/app-opentui/scenes/doctor.js +1 -1
  37. package/dist/src/app-opentui/scenes/error.js +50 -4
  38. package/dist/src/app-opentui/scenes/family.js +60 -6
  39. package/dist/src/app-opentui/scenes/fleet.js +65 -13
  40. package/dist/src/app-opentui/scenes/help.js +4 -2
  41. package/dist/src/app-opentui/scenes/init.js +12 -12
  42. package/dist/src/app-opentui/scenes/main.js +7 -7
  43. package/dist/src/app-opentui/scenes/server.js +83 -11
  44. package/dist/src/app-opentui/scenes/tasks.js +79 -16
  45. package/dist/src/app-opentui/state.js +25 -5
  46. package/dist/src/app-opentui/surface-catalog.js +4 -2
  47. package/dist/src/app-opentui/types.d.ts +1 -1
  48. package/dist/src/commands/_cli-format.d.ts +10 -1
  49. package/dist/src/commands/_cli-format.js +5 -2
  50. package/dist/src/commands/_connection-state.d.ts +11 -1
  51. package/dist/src/commands/_connection-state.js +50 -5
  52. package/dist/src/commands/_doctor-checks.js +458 -46
  53. package/dist/src/commands/_help-catalog.js +4 -2
  54. package/dist/src/commands/_json-output.js +4 -0
  55. package/dist/src/commands/_operator-view.js +496 -57
  56. package/dist/src/commands/_pi-frontend.d.ts +25 -0
  57. package/dist/src/commands/_pi-frontend.js +497 -57
  58. package/dist/src/commands/_preflight.js +509 -72
  59. package/dist/src/commands/_server-client.d.ts +33 -0
  60. package/dist/src/commands/_server-client.js +477 -46
  61. package/dist/src/commands/_server-events.js +446 -41
  62. package/dist/src/commands/_snapshot-upload.js +460 -48
  63. package/dist/src/commands/connect.js +620 -15
  64. package/dist/src/commands/doctor.js +458 -46
  65. package/dist/src/commands/github.js +462 -50
  66. package/dist/src/commands/inbox.js +458 -46
  67. package/dist/src/commands/init.js +497 -74
  68. package/dist/src/commands/inspect.js +458 -46
  69. package/dist/src/commands/run.js +496 -57
  70. package/dist/src/commands/server.js +647 -163
  71. package/dist/src/commands/setup.js +463 -51
  72. package/dist/src/commands/stats.js +462 -48
  73. package/dist/src/commands/task-run-driver.js +464 -52
  74. package/dist/src/commands/task.js +551 -85
  75. package/dist/src/commands.js +701 -151
  76. package/dist/src/index.js +705 -151
  77. package/dist/src/launcher.js +4 -0
  78. package/package.json +8 -8
@@ -0,0 +1,10 @@
1
+ import type { AppState } from "./types";
2
+ export type RemoteProjectLinkLike = {
3
+ readonly ok?: boolean;
4
+ readonly status?: string;
5
+ readonly message?: string;
6
+ readonly hint?: string;
7
+ };
8
+ export declare function remoteProjectLinkError(message: string | undefined): boolean;
9
+ export declare function remoteProjectLinkState(state: AppState): RemoteProjectLinkLike | null;
10
+ export declare function shouldOfferRemoteLinkRepair(state: AppState, message?: string): boolean;
@@ -0,0 +1,47 @@
1
+ // @bun
2
+ // packages/cli/src/app-opentui/remote-link.ts
3
+ var REPAIRABLE_REMOTE_LINK_STATUSES = new Set([
4
+ "auth_required",
5
+ "project_not_registered",
6
+ "no_server_checkout",
7
+ "invalid_root",
8
+ "needs_prepare",
9
+ "error"
10
+ ]);
11
+ function remoteProjectLinkError(message) {
12
+ return /no server-host project root link|remote project(?:-root)? link|x-rig-project-root|serverProjectRoot/i.test(message ?? "");
13
+ }
14
+ function serverRecordForRemoteLink(state) {
15
+ const server = state.data.server;
16
+ return server && typeof server === "object" && !Array.isArray(server) ? server : null;
17
+ }
18
+ function remoteProjectLinkState(state) {
19
+ const serverRecord = serverRecordForRemoteLink(state);
20
+ if (!serverRecord || serverRecord.kind !== "remote")
21
+ return null;
22
+ const link = serverRecord.remoteProjectLink;
23
+ if (link && typeof link === "object" && !Array.isArray(link))
24
+ return link;
25
+ const direct = state.data.remoteProjectLink;
26
+ if (direct && typeof direct === "object" && !Array.isArray(direct))
27
+ return direct;
28
+ return null;
29
+ }
30
+ function shouldOfferRemoteLinkRepair(state, message) {
31
+ const link = remoteProjectLinkState(state);
32
+ if (link) {
33
+ if (link.ok === true)
34
+ return false;
35
+ const status = link.status ?? "";
36
+ return REPAIRABLE_REMOTE_LINK_STATUSES.has(status);
37
+ }
38
+ const serverRecord = serverRecordForRemoteLink(state);
39
+ if (serverRecord && serverRecord.kind !== "remote")
40
+ return false;
41
+ return remoteProjectLinkError(message ?? state.error?.message);
42
+ }
43
+ export {
44
+ shouldOfferRemoteLinkRepair,
45
+ remoteProjectLinkState,
46
+ remoteProjectLinkError
47
+ };
@@ -0,0 +1,16 @@
1
+ import type { CliRenderer } from "@opentui/core";
2
+ /** Resume the OpenTUI renderer after an external full-screen TUI (native Pi)
3
+ * owned the terminal.
4
+ *
5
+ * A plain `renderer.resume()` diff-renders against a now-stale frame buffer and
6
+ * leaves the external program's screen content behind: OpenTUI's `resume()` only
7
+ * re-runs `setupTerminal` (re-enter alt-screen + clear + force a full repaint)
8
+ * when its internal `pendingSuspendedTerminalSetup` flag is set — and the
9
+ * suspend path used for shelling out does NOT set it, so a plain resume takes
10
+ * the `resumeRenderer` fast path and the screen stays corrupted (Pi's exit
11
+ * banner, a misplaced cursor, the type-bar rule painted at the top).
12
+ *
13
+ * We force the flag so `resume()` does a clean terminal re-setup, then request a
14
+ * full render. The `as`-casts reach two @opentui/core internals; guarded so a
15
+ * version that renames them degrades to a plain resume rather than throwing. */
16
+ export declare function resumeRendererClean(renderer: CliRenderer): void;
@@ -0,0 +1,14 @@
1
+ // @bun
2
+ // packages/cli/src/app-opentui/render/terminal-handoff.ts
3
+ function resumeRendererClean(renderer) {
4
+ try {
5
+ renderer.pendingSuspendedTerminalSetup = true;
6
+ } catch {}
7
+ renderer.resume();
8
+ try {
9
+ renderer.requestRender?.();
10
+ } catch {}
11
+ }
12
+ export {
13
+ resumeRendererClean
14
+ };