@h-rig/cli 0.0.6-alpha.82 → 0.0.6-alpha.83

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 (100) hide show
  1. package/dist/bin/build-rig-binaries.js +40 -8
  2. package/dist/bin/rig.js +2798 -1440
  3. package/dist/src/app/board.js +62 -13
  4. package/dist/src/app-opentui/adapters/command.d.ts +2 -0
  5. package/dist/src/app-opentui/adapters/command.js +329 -0
  6. package/dist/src/app-opentui/adapters/common.js +2 -2
  7. package/dist/src/app-opentui/adapters/doctor.js +63 -14
  8. package/dist/src/app-opentui/adapters/fleet.js +84 -20
  9. package/dist/src/app-opentui/adapters/inbox.js +83 -19
  10. package/dist/src/app-opentui/adapters/init.js +87 -23
  11. package/dist/src/app-opentui/adapters/pi-attach.js +96 -34
  12. package/dist/src/app-opentui/adapters/run-detail.js +83 -19
  13. package/dist/src/app-opentui/adapters/server.js +100 -23
  14. package/dist/src/app-opentui/adapters/tasks.d.ts +11 -0
  15. package/dist/src/app-opentui/adapters/tasks.js +742 -94
  16. package/dist/src/app-opentui/bootstrap.d.ts +1 -6
  17. package/dist/src/app-opentui/bootstrap.js +13769 -12368
  18. package/dist/src/app-opentui/command-pty-host.d.ts +62 -0
  19. package/dist/src/app-opentui/command-pty-host.js +248 -0
  20. package/dist/src/app-opentui/events.js +1 -1
  21. package/dist/src/app-opentui/focus-manager.d.ts +14 -0
  22. package/dist/src/app-opentui/focus-manager.js +24 -0
  23. package/dist/src/app-opentui/index.js +3802 -2882
  24. package/dist/src/app-opentui/intent.js +154 -48
  25. package/dist/src/app-opentui/keymap.d.ts +20 -0
  26. package/dist/src/app-opentui/keymap.js +707 -0
  27. package/dist/src/app-opentui/launch-routing.d.ts +16 -0
  28. package/dist/src/app-opentui/launch-routing.js +55 -0
  29. package/dist/src/app-opentui/layout.js +2 -2
  30. package/dist/src/app-opentui/pi-host-child.js +66 -16
  31. package/dist/src/app-opentui/pi-pty-host.d.ts +9 -0
  32. package/dist/src/app-opentui/pi-pty-host.js +9 -11
  33. package/dist/src/app-opentui/registry.js +3231 -2403
  34. package/dist/src/app-opentui/render/ascii-fleet.d.ts +15 -0
  35. package/dist/src/app-opentui/render/ascii-fleet.js +82 -0
  36. package/dist/src/app-opentui/render/graphics.d.ts +1 -1
  37. package/dist/src/app-opentui/render/graphics.js +131 -16
  38. package/dist/src/app-opentui/render/image-visual-layer-worker.js +408 -957
  39. package/dist/src/app-opentui/render/image-visual-layer.d.ts +18 -10
  40. package/dist/src/app-opentui/render/image-visual-layer.js +386 -356
  41. package/dist/src/app-opentui/render/panel-layout.d.ts +38 -0
  42. package/dist/src/app-opentui/render/panel-layout.js +48 -0
  43. package/dist/src/app-opentui/render/panels.d.ts +2 -0
  44. package/dist/src/app-opentui/render/panels.js +62 -29
  45. package/dist/src/app-opentui/render/preloader.d.ts +10 -0
  46. package/dist/src/app-opentui/render/preloader.js +163 -0
  47. package/dist/src/app-opentui/render/scene.d.ts +3 -0
  48. package/dist/src/app-opentui/render/scene.js +12 -0
  49. package/dist/src/app-opentui/render/text.js +5 -1
  50. package/dist/src/app-opentui/render/type-bar.d.ts +2 -1
  51. package/dist/src/app-opentui/render/type-bar.js +51 -16
  52. package/dist/src/app-opentui/runtime-resources.d.ts +16 -0
  53. package/dist/src/app-opentui/runtime-resources.js +62 -0
  54. package/dist/src/app-opentui/runtime.js +2322 -1513
  55. package/dist/src/app-opentui/scenes/command.d.ts +3 -0
  56. package/dist/src/app-opentui/scenes/command.js +103 -0
  57. package/dist/src/app-opentui/scenes/doctor.d.ts +2 -1
  58. package/dist/src/app-opentui/scenes/doctor.js +53 -14
  59. package/dist/src/app-opentui/scenes/error.js +44 -14
  60. package/dist/src/app-opentui/scenes/fleet.js +40 -21
  61. package/dist/src/app-opentui/scenes/handoff.js +142 -27
  62. package/dist/src/app-opentui/scenes/help.js +63 -48
  63. package/dist/src/app-opentui/scenes/inbox.d.ts +2 -1
  64. package/dist/src/app-opentui/scenes/inbox.js +64 -17
  65. package/dist/src/app-opentui/scenes/init.d.ts +2 -1
  66. package/dist/src/app-opentui/scenes/init.js +62 -21
  67. package/dist/src/app-opentui/scenes/main.d.ts +2 -1
  68. package/dist/src/app-opentui/scenes/main.js +80 -24
  69. package/dist/src/app-opentui/scenes/run-detail.d.ts +2 -1
  70. package/dist/src/app-opentui/scenes/run-detail.js +39 -25
  71. package/dist/src/app-opentui/scenes/server.d.ts +2 -1
  72. package/dist/src/app-opentui/scenes/server.js +71 -20
  73. package/dist/src/app-opentui/scenes/tasks.js +44 -22
  74. package/dist/src/app-opentui/state.js +70 -30
  75. package/dist/src/app-opentui/terminal-capabilities.d.ts +7 -0
  76. package/dist/src/app-opentui/terminal-capabilities.js +15 -0
  77. package/dist/src/app-opentui/types.d.ts +10 -2
  78. package/dist/src/commands/_doctor-checks.js +62 -13
  79. package/dist/src/commands/_operator-view.js +63 -13
  80. package/dist/src/commands/_pi-frontend.js +63 -13
  81. package/dist/src/commands/_preflight.js +64 -14
  82. package/dist/src/commands/_server-client.js +82 -18
  83. package/dist/src/commands/_snapshot-upload.js +62 -13
  84. package/dist/src/commands/connect.js +7 -1
  85. package/dist/src/commands/doctor.js +62 -13
  86. package/dist/src/commands/github.js +144 -23
  87. package/dist/src/commands/inbox.js +62 -13
  88. package/dist/src/commands/init.js +82 -18
  89. package/dist/src/commands/inspect.js +62 -13
  90. package/dist/src/commands/run.js +66 -13
  91. package/dist/src/commands/server.js +69 -14
  92. package/dist/src/commands/setup.js +62 -13
  93. package/dist/src/commands/stats.js +62 -13
  94. package/dist/src/commands/task-run-driver.js +62 -13
  95. package/dist/src/commands/task.js +65 -14
  96. package/dist/src/commands.js +227 -92
  97. package/dist/src/index.js +234 -99
  98. package/package.json +8 -9
  99. package/dist/src/app-opentui/render/image-visual-layer-native-canvas.d.ts +0 -2
  100. package/dist/src/app-opentui/render/image-visual-layer-native-canvas.js +0 -1484
@@ -2,10 +2,12 @@
2
2
  // @bun
3
3
 
4
4
  // packages/cli/bin/build-rig-binaries.ts
5
- import { cpSync, existsSync, mkdirSync, readFileSync } from "fs";
6
- import { resolve } from "path";
5
+ import { cpSync, existsSync, mkdirSync, readFileSync, rmSync } from "fs";
6
+ import { createRequire } from "module";
7
+ import { dirname, resolve } from "path";
7
8
  import { runCapture } from "@rig/runtime/control-plane/native/utils";
8
9
  import { buildRuntimeBinary } from "@rig/runtime/binary-run";
10
+ var require2 = createRequire(import.meta.url);
9
11
  function readCliVersion(rootDir) {
10
12
  try {
11
13
  const pkg = JSON.parse(readFileSync(resolve(rootDir, "packages/cli/package.json"), "utf-8"));
@@ -29,6 +31,7 @@ async function main() {
29
31
  "process.env.RIG_CLI_VERSION": JSON.stringify(cliVersion)
30
32
  });
31
33
  await buildBinary("packages/runtime/bin/rig-agent-dispatch.ts", resolve(binDir, "rig-agent"), rootDir);
34
+ copyPiBinaryAssets(binDir);
32
35
  for (const entry of [
33
36
  "hooks",
34
37
  "lib",
@@ -57,17 +60,21 @@ async function main() {
57
60
  };
58
61
  await Bun.write(resolve(outputDir, "manifest.json"), `${JSON.stringify(manifest, null, 2)}
59
62
  `);
60
- const archive = `${outputDir}.tar.gz`;
61
- const tar = await Bun.$`tar -czf ${archive} -C ${outputDir} .`.cwd(rootDir).quiet().nothrow();
62
- if (tar.exitCode !== 0) {
63
- throw new Error(`Failed to create archive: ${tar.stderr.toString() || tar.stdout.toString()}`);
63
+ let archive = null;
64
+ if (args.archive) {
65
+ archive = `${outputDir}.tar.gz`;
66
+ const tar = await Bun.$`tar -czf ${archive} -C ${outputDir} .`.cwd(rootDir).quiet().nothrow();
67
+ if (tar.exitCode !== 0) {
68
+ throw new Error(`Failed to create archive: ${tar.stderr.toString() || tar.stdout.toString()}`);
69
+ }
64
70
  }
65
71
  console.log("Build complete");
66
72
  console.log(`- directory: ${outputDir}`);
67
- console.log(`- archive: ${archive}`);
73
+ if (archive)
74
+ console.log(`- archive: ${archive}`);
68
75
  }
69
76
  function parseArgs(argv) {
70
- const args = {};
77
+ const args = { archive: true };
71
78
  for (let i = 0;i < argv.length; i += 1) {
72
79
  const current = argv[i];
73
80
  if (current === "--output-dir") {
@@ -79,10 +86,35 @@ function parseArgs(argv) {
79
86
  i += 1;
80
87
  continue;
81
88
  }
89
+ if (current === "--no-archive") {
90
+ args.archive = false;
91
+ continue;
92
+ }
82
93
  throw new Error(`Unknown option: ${current}`);
83
94
  }
84
95
  return args;
85
96
  }
97
+ function copyPiBinaryAssets(binDir) {
98
+ const packageJsonPath = require2.resolve("@earendil-works/pi-coding-agent/package.json");
99
+ const packageRoot = dirname(packageJsonPath);
100
+ const assetCopies = [
101
+ [resolve(packageRoot, "dist/modes/interactive/theme"), resolve(binDir, "theme")],
102
+ [resolve(packageRoot, "dist/modes/interactive/assets"), resolve(binDir, "assets")],
103
+ [resolve(packageRoot, "dist/core/export-html"), resolve(binDir, "export-html")],
104
+ [packageJsonPath, resolve(binDir, "package.json")]
105
+ ];
106
+ const missing = assetCopies.filter(([source]) => !existsSync(source)).map(([source]) => source);
107
+ if (missing.length > 0) {
108
+ throw new Error(`Pi binary asset copy failed; missing required source(s): ${missing.join(", ")}`);
109
+ }
110
+ for (const [source, target] of assetCopies) {
111
+ rmSync(target, { recursive: true, force: true });
112
+ cpSync(source, target, { recursive: true });
113
+ if (!existsSync(target)) {
114
+ throw new Error(`Pi binary asset copy failed; target was not written: ${target}`);
115
+ }
116
+ }
117
+ }
86
118
  async function buildBinary(source, output, cwd, define) {
87
119
  await buildRuntimeBinary({
88
120
  sourcePath: source,