@h-rig/cli 0.0.6-alpha.88 → 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.
- package/dist/bin/rig.js +1159 -292
- package/dist/src/app/board.js +462 -48
- package/dist/src/app-opentui/adapters/doctor.js +458 -46
- package/dist/src/app-opentui/adapters/family.js +670 -147
- package/dist/src/app-opentui/adapters/fleet.js +477 -46
- package/dist/src/app-opentui/adapters/inbox.js +477 -46
- package/dist/src/app-opentui/adapters/init.js +497 -74
- package/dist/src/app-opentui/adapters/inspect.js +477 -46
- package/dist/src/app-opentui/adapters/pi-attach.js +484 -53
- package/dist/src/app-opentui/adapters/run-detail.js +477 -46
- package/dist/src/app-opentui/adapters/server.d.ts +26 -0
- package/dist/src/app-opentui/adapters/server.js +676 -59
- package/dist/src/app-opentui/adapters/tasks.js +539 -81
- package/dist/src/app-opentui/autocomplete.js +4 -2
- package/dist/src/app-opentui/bootstrap.js +1155 -288
- package/dist/src/app-opentui/command-palette.js +37 -10
- package/dist/src/app-opentui/index.js +566 -89
- package/dist/src/app-opentui/intent.js +33 -8
- package/dist/src/app-opentui/keymap.js +43 -29
- package/dist/src/app-opentui/pi-host-child.js +465 -53
- package/dist/src/app-opentui/react/App.js +104 -44
- package/dist/src/app-opentui/react/ChromeHost.js +16 -4
- package/dist/src/app-opentui/react/launch.js +555 -88
- package/dist/src/app-opentui/react/nav.js +1 -1
- package/dist/src/app-opentui/registry.js +1062 -237
- package/dist/src/app-opentui/remote-link.d.ts +10 -0
- package/dist/src/app-opentui/remote-link.js +47 -0
- package/dist/src/app-opentui/runtime.js +566 -89
- package/dist/src/app-opentui/scenes/doctor.js +1 -1
- package/dist/src/app-opentui/scenes/error.js +50 -4
- package/dist/src/app-opentui/scenes/family.js +60 -6
- package/dist/src/app-opentui/scenes/fleet.js +65 -13
- package/dist/src/app-opentui/scenes/help.js +4 -2
- package/dist/src/app-opentui/scenes/init.js +12 -12
- package/dist/src/app-opentui/scenes/main.js +7 -7
- package/dist/src/app-opentui/scenes/server.js +83 -11
- package/dist/src/app-opentui/scenes/tasks.js +79 -16
- package/dist/src/app-opentui/state.js +25 -5
- package/dist/src/app-opentui/surface-catalog.js +4 -2
- package/dist/src/app-opentui/types.d.ts +1 -1
- package/dist/src/commands/_cli-format.d.ts +10 -1
- package/dist/src/commands/_cli-format.js +5 -2
- package/dist/src/commands/_connection-state.d.ts +11 -1
- package/dist/src/commands/_connection-state.js +50 -5
- package/dist/src/commands/_doctor-checks.js +458 -46
- package/dist/src/commands/_help-catalog.js +4 -2
- package/dist/src/commands/_json-output.js +4 -0
- package/dist/src/commands/_operator-view.js +465 -53
- package/dist/src/commands/_pi-frontend.js +465 -53
- package/dist/src/commands/_preflight.js +509 -72
- package/dist/src/commands/_server-client.d.ts +33 -0
- package/dist/src/commands/_server-client.js +477 -46
- package/dist/src/commands/_server-events.js +446 -41
- package/dist/src/commands/_snapshot-upload.js +460 -48
- package/dist/src/commands/connect.js +620 -15
- package/dist/src/commands/doctor.js +458 -46
- package/dist/src/commands/github.js +462 -50
- package/dist/src/commands/inbox.js +458 -46
- package/dist/src/commands/init.js +497 -74
- package/dist/src/commands/inspect.js +458 -46
- package/dist/src/commands/run.js +465 -53
- package/dist/src/commands/server.js +647 -163
- package/dist/src/commands/setup.js +463 -51
- package/dist/src/commands/stats.js +462 -48
- package/dist/src/commands/task-run-driver.js +464 -52
- package/dist/src/commands/task.js +520 -81
- package/dist/src/commands.js +670 -147
- package/dist/src/index.js +674 -147
- package/dist/src/launcher.js +4 -0
- package/package.json +8 -8
|
@@ -187,16 +187,31 @@ function taskViewIntent(argv, command = "", rest = [], raw) {
|
|
|
187
187
|
const { payload, label } = taskViewPayload(command, rest);
|
|
188
188
|
return intent("tasks", argv, "refresh", payload, label, raw);
|
|
189
189
|
}
|
|
190
|
-
function routeServer(argv, command, raw, checkingLabel) {
|
|
191
|
-
if (!command || command === "status") {
|
|
190
|
+
function routeServer(argv, command, rest, raw, checkingLabel) {
|
|
191
|
+
if (!command || command === "status" || command === "list") {
|
|
192
192
|
return intent("server", argv, "refresh", undefined, command ? checkingLabel : "Loading server", raw);
|
|
193
193
|
}
|
|
194
|
+
if (command === "use") {
|
|
195
|
+
const alias = firstNonOption(rest);
|
|
196
|
+
if (alias === "local")
|
|
197
|
+
return intent("server", argv, "server-use-local", undefined, "Use local server", raw);
|
|
198
|
+
if (alias)
|
|
199
|
+
return intent("server", argv, "server-use-remote", { alias }, `Use ${alias}`, raw);
|
|
200
|
+
return intent("server", argv, "refresh", undefined, "Select a remote alias in Server", raw);
|
|
201
|
+
}
|
|
202
|
+
if (command === "add")
|
|
203
|
+
return intent("server", argv, "server-add-remote", { argv: [...argv] }, "Add remote server", raw);
|
|
204
|
+
if (command === "repair-link")
|
|
205
|
+
return intent("server", argv, "remote-link-repair", undefined, "Repair remote link", raw);
|
|
194
206
|
return commandRunIntent(argv, raw);
|
|
195
207
|
}
|
|
196
208
|
function routeGithub(argv, command, rest, raw) {
|
|
197
209
|
if (command === "auth" && (rest[0]?.toLowerCase() ?? "status") === "status" && rest.length <= 1) {
|
|
198
210
|
return intent("server", argv, "refresh", undefined, "Checking GitHub auth", raw);
|
|
199
211
|
}
|
|
212
|
+
if (command === "auth" && rest[0]?.toLowerCase() === "import-gh" && rest.length <= 1) {
|
|
213
|
+
return intent("server", argv, "github-auth-import", undefined, "Import GitHub auth", raw);
|
|
214
|
+
}
|
|
200
215
|
return commandRunIntent(argv, raw);
|
|
201
216
|
}
|
|
202
217
|
function routeDoctor(argv, command, raw) {
|
|
@@ -245,11 +260,16 @@ function intentFromArgv(argv) {
|
|
|
245
260
|
return commandRunIntent(argv);
|
|
246
261
|
}
|
|
247
262
|
if (normalizedGroup === "server")
|
|
248
|
-
return routeServer(argv, normalizedCommand, undefined, "Checking server");
|
|
263
|
+
return routeServer(argv, normalizedCommand, rest, undefined, "Checking server");
|
|
249
264
|
if (normalizedGroup === "github")
|
|
250
265
|
return routeGithub(argv, normalizedCommand, rest);
|
|
251
|
-
if (normalizedGroup === "init")
|
|
252
|
-
|
|
266
|
+
if (normalizedGroup === "init") {
|
|
267
|
+
if (!normalizedCommand)
|
|
268
|
+
return intent("init", argv, "refresh", undefined, "Open init");
|
|
269
|
+
if (rest.includes("--yes") || normalizedCommand === "--yes")
|
|
270
|
+
return intent("init", argv, "init-start", undefined, "Run init");
|
|
271
|
+
return intent("init", argv, "refresh", undefined, "Open init");
|
|
272
|
+
}
|
|
253
273
|
if (normalizedGroup === "doctor")
|
|
254
274
|
return routeDoctor(argv, normalizedCommand);
|
|
255
275
|
if (normalizedGroup === "inbox")
|
|
@@ -312,12 +332,17 @@ function intentFromTypeBar(value) {
|
|
|
312
332
|
return commandRunIntent(parts, value);
|
|
313
333
|
return intent("tasks", parts, "refresh", undefined, "Select a task, then press Enter; or use run next", value);
|
|
314
334
|
}
|
|
315
|
-
if (first === "init")
|
|
316
|
-
|
|
335
|
+
if (first === "init") {
|
|
336
|
+
if (!second)
|
|
337
|
+
return intent("init", parts, "refresh", undefined, "Open init", value);
|
|
338
|
+
if (parts.includes("--yes"))
|
|
339
|
+
return intent("init", parts, "init-start", undefined, "Run init", value);
|
|
340
|
+
return intent("init", parts, "refresh", undefined, "Open init", value);
|
|
341
|
+
}
|
|
317
342
|
if (first === "doctor")
|
|
318
343
|
return routeDoctor(parts, second, value);
|
|
319
344
|
if (first === "server")
|
|
320
|
-
return routeServer(parts, second, value, "Loading server");
|
|
345
|
+
return routeServer(parts, second, rest, value, "Loading server");
|
|
321
346
|
if (first === "github")
|
|
322
347
|
return routeGithub(parts, second, rest, value);
|
|
323
348
|
if (first === "inbox")
|
|
@@ -67,12 +67,13 @@ var PRIMARY_GROUPS = [
|
|
|
67
67
|
{
|
|
68
68
|
name: "server",
|
|
69
69
|
summary: "Choose, inspect, and start the Rig server that owns tasks and runs.",
|
|
70
|
-
usage: ["rig server <status|list|add|use|start> [options]"],
|
|
70
|
+
usage: ["rig server <status|list|add|use|repair-link|start> [options]"],
|
|
71
71
|
commands: [
|
|
72
|
-
{ command: "status", description: "Show the selected server for this repo.", primary: true },
|
|
72
|
+
{ command: "status", description: "Show the selected server and remote project-root link for this repo.", primary: true },
|
|
73
73
|
{ command: "use local", description: "Switch this repo to the local Rig server.", primary: true },
|
|
74
74
|
{ command: "add <alias> <url>", description: "Save a remote Rig server URL.", primary: true },
|
|
75
75
|
{ command: "use <alias>", description: "Select a saved remote server alias.", primary: true },
|
|
76
|
+
{ command: "repair-link [--prepare|--backfill-only] [--repo owner/repo]", description: "Backfill or prepare the selected remote's server-host checkout link.", primary: true },
|
|
76
77
|
{ command: "list", description: "List saved local/remote server aliases.", primary: true },
|
|
77
78
|
{ command: "start [--host <host>] [--port <n>]", description: "Start a local rig-server process." }
|
|
78
79
|
],
|
|
@@ -80,6 +81,7 @@ var PRIMARY_GROUPS = [
|
|
|
80
81
|
"rig server status",
|
|
81
82
|
"rig server add prod https://where.rig-does.work",
|
|
82
83
|
"rig server use prod",
|
|
84
|
+
"rig server repair-link --repo owner/repo",
|
|
83
85
|
"rig server use local",
|
|
84
86
|
"rig server start --port 3773"
|
|
85
87
|
],
|
|
@@ -976,16 +978,31 @@ function taskViewIntent(argv, command = "", rest = [], raw) {
|
|
|
976
978
|
const { payload, label } = taskViewPayload(command, rest);
|
|
977
979
|
return intent("tasks", argv, "refresh", payload, label, raw);
|
|
978
980
|
}
|
|
979
|
-
function routeServer(argv, command, raw, checkingLabel) {
|
|
980
|
-
if (!command || command === "status") {
|
|
981
|
+
function routeServer(argv, command, rest, raw, checkingLabel) {
|
|
982
|
+
if (!command || command === "status" || command === "list") {
|
|
981
983
|
return intent("server", argv, "refresh", undefined, command ? checkingLabel : "Loading server", raw);
|
|
982
984
|
}
|
|
985
|
+
if (command === "use") {
|
|
986
|
+
const alias = firstNonOption(rest);
|
|
987
|
+
if (alias === "local")
|
|
988
|
+
return intent("server", argv, "server-use-local", undefined, "Use local server", raw);
|
|
989
|
+
if (alias)
|
|
990
|
+
return intent("server", argv, "server-use-remote", { alias }, `Use ${alias}`, raw);
|
|
991
|
+
return intent("server", argv, "refresh", undefined, "Select a remote alias in Server", raw);
|
|
992
|
+
}
|
|
993
|
+
if (command === "add")
|
|
994
|
+
return intent("server", argv, "server-add-remote", { argv: [...argv] }, "Add remote server", raw);
|
|
995
|
+
if (command === "repair-link")
|
|
996
|
+
return intent("server", argv, "remote-link-repair", undefined, "Repair remote link", raw);
|
|
983
997
|
return commandRunIntent(argv, raw);
|
|
984
998
|
}
|
|
985
999
|
function routeGithub(argv, command, rest, raw) {
|
|
986
1000
|
if (command === "auth" && (rest[0]?.toLowerCase() ?? "status") === "status" && rest.length <= 1) {
|
|
987
1001
|
return intent("server", argv, "refresh", undefined, "Checking GitHub auth", raw);
|
|
988
1002
|
}
|
|
1003
|
+
if (command === "auth" && rest[0]?.toLowerCase() === "import-gh" && rest.length <= 1) {
|
|
1004
|
+
return intent("server", argv, "github-auth-import", undefined, "Import GitHub auth", raw);
|
|
1005
|
+
}
|
|
989
1006
|
return commandRunIntent(argv, raw);
|
|
990
1007
|
}
|
|
991
1008
|
function routeDoctor(argv, command, raw) {
|
|
@@ -1034,11 +1051,16 @@ function intentFromArgv(argv) {
|
|
|
1034
1051
|
return commandRunIntent(argv);
|
|
1035
1052
|
}
|
|
1036
1053
|
if (normalizedGroup === "server")
|
|
1037
|
-
return routeServer(argv, normalizedCommand, undefined, "Checking server");
|
|
1054
|
+
return routeServer(argv, normalizedCommand, rest, undefined, "Checking server");
|
|
1038
1055
|
if (normalizedGroup === "github")
|
|
1039
1056
|
return routeGithub(argv, normalizedCommand, rest);
|
|
1040
|
-
if (normalizedGroup === "init")
|
|
1041
|
-
|
|
1057
|
+
if (normalizedGroup === "init") {
|
|
1058
|
+
if (!normalizedCommand)
|
|
1059
|
+
return intent("init", argv, "refresh", undefined, "Open init");
|
|
1060
|
+
if (rest.includes("--yes") || normalizedCommand === "--yes")
|
|
1061
|
+
return intent("init", argv, "init-start", undefined, "Run init");
|
|
1062
|
+
return intent("init", argv, "refresh", undefined, "Open init");
|
|
1063
|
+
}
|
|
1042
1064
|
if (normalizedGroup === "doctor")
|
|
1043
1065
|
return routeDoctor(argv, normalizedCommand);
|
|
1044
1066
|
if (normalizedGroup === "inbox")
|
|
@@ -1101,12 +1123,17 @@ function intentFromTypeBar(value) {
|
|
|
1101
1123
|
return commandRunIntent(parts, value);
|
|
1102
1124
|
return intent("tasks", parts, "refresh", undefined, "Select a task, then press Enter; or use run next", value);
|
|
1103
1125
|
}
|
|
1104
|
-
if (first === "init")
|
|
1105
|
-
|
|
1126
|
+
if (first === "init") {
|
|
1127
|
+
if (!second)
|
|
1128
|
+
return intent("init", parts, "refresh", undefined, "Open init", value);
|
|
1129
|
+
if (parts.includes("--yes"))
|
|
1130
|
+
return intent("init", parts, "init-start", undefined, "Run init", value);
|
|
1131
|
+
return intent("init", parts, "refresh", undefined, "Open init", value);
|
|
1132
|
+
}
|
|
1106
1133
|
if (first === "doctor")
|
|
1107
1134
|
return routeDoctor(parts, second, value);
|
|
1108
1135
|
if (first === "server")
|
|
1109
|
-
return routeServer(parts, second, value, "Loading server");
|
|
1136
|
+
return routeServer(parts, second, rest, value, "Loading server");
|
|
1110
1137
|
if (first === "github")
|
|
1111
1138
|
return routeGithub(parts, second, rest, value);
|
|
1112
1139
|
if (first === "inbox")
|
|
@@ -1124,12 +1151,6 @@ function intentFromTypeBar(value) {
|
|
|
1124
1151
|
return intentFromArgv(parts);
|
|
1125
1152
|
}
|
|
1126
1153
|
|
|
1127
|
-
// packages/cli/src/app-opentui/pi-pty-host.ts
|
|
1128
|
-
function getActivePiHost() {
|
|
1129
|
-
return null;
|
|
1130
|
-
}
|
|
1131
|
-
function stopActivePiHost(_reason) {}
|
|
1132
|
-
|
|
1133
1154
|
// packages/cli/src/app-opentui/keymap.ts
|
|
1134
1155
|
var autocompleteState;
|
|
1135
1156
|
function clearTypeBar(context, message) {
|
|
@@ -1139,22 +1160,15 @@ function clearTypeBar(context, message) {
|
|
|
1139
1160
|
context.emitTypeBarPatch({ value: "", mode: "nav", prompt: undefined, message });
|
|
1140
1161
|
}
|
|
1141
1162
|
function handleEmbeddedTerminalKey(context, key) {
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
const
|
|
1145
|
-
const host = state.scene === "handoff" ? piHost : state.scene === "command" ? commandHost : null;
|
|
1163
|
+
if (context.getState().scene !== "command")
|
|
1164
|
+
return false;
|
|
1165
|
+
const host = getActiveCommandHost();
|
|
1146
1166
|
if (!host)
|
|
1147
1167
|
return false;
|
|
1148
1168
|
if (key.ctrl && key.name === "]") {
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
context.runAppAction("Opening runs", () => context.runtime.runIntent({ scene: "fleet", argv: ["runs"], action: { kind: "refresh", label: "Opening runs" } }));
|
|
1153
|
-
} else {
|
|
1154
|
-
stopActiveCommandHost("operator detach");
|
|
1155
|
-
clearTypeBar(context, "closed command");
|
|
1156
|
-
context.runAppAction("Project menu", () => context.runtime.runIntent({ scene: "main", argv: ["main"], action: { kind: "none", label: "Project menu" } }));
|
|
1157
|
-
}
|
|
1169
|
+
stopActiveCommandHost("operator detach");
|
|
1170
|
+
clearTypeBar(context, "closed command");
|
|
1171
|
+
context.runAppAction("Project menu", () => context.runtime.runIntent({ scene: "main", argv: ["main"], action: { kind: "none", label: "Project menu" } }));
|
|
1158
1172
|
return true;
|
|
1159
1173
|
}
|
|
1160
1174
|
const sequence = key.raw || key.sequence;
|