@h-rig/cli 0.0.6-alpha.35 → 0.0.6-alpha.37
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 +158 -41
- package/dist/src/commands/_help-catalog.js +63 -32
- package/dist/src/commands/_operator-view.js +35 -4
- package/dist/src/commands/_pi-frontend.js +35 -4
- package/dist/src/commands/_pi-worker-bridge-extension.js +35 -2
- package/dist/src/commands/_run-driver-helpers.js +21 -0
- package/dist/src/commands/_server-client.js +0 -9
- package/dist/src/commands/inspect.js +227 -11
- package/dist/src/commands/run.js +35 -4
- package/dist/src/commands/server.js +7 -2
- package/dist/src/commands/task-run-driver.js +21 -0
- package/dist/src/commands/task.js +97 -36
- package/dist/src/commands.js +158 -41
- package/dist/src/index.js +158 -41
- package/package.json +6 -6
package/dist/src/index.js
CHANGED
|
@@ -527,7 +527,8 @@ var init_plugin = __esm(() => {
|
|
|
527
527
|
// packages/cli/src/commands.ts
|
|
528
528
|
init_runner();
|
|
529
529
|
import {
|
|
530
|
-
existsSync as existsSync16
|
|
530
|
+
existsSync as existsSync16,
|
|
531
|
+
readFileSync as readFileSync12
|
|
531
532
|
} from "fs";
|
|
532
533
|
import { resolve as resolve25 } from "path";
|
|
533
534
|
import { readBuildConfig } from "@rig/runtime/build-time-config";
|
|
@@ -6301,6 +6302,7 @@ ${acceptance}` : null,
|
|
|
6301
6302
|
${sourceContractLines.join(`
|
|
6302
6303
|
`)}` : null,
|
|
6303
6304
|
scopeText || renderSourceScopeValidation(sourceTask, sourceValidation) || null,
|
|
6305
|
+
readPriorPrProgressForPrompt(input.projectRoot, input.taskId),
|
|
6304
6306
|
initialPrompt ? `Additional operator guidance:
|
|
6305
6307
|
${initialPrompt}` : null,
|
|
6306
6308
|
providerLines.length > 0 ? `Provider-specific runtime tooling:
|
|
@@ -6310,6 +6312,26 @@ ${providerLines.join(" ")}` : null,
|
|
|
6310
6312
|
|
|
6311
6313
|
`);
|
|
6312
6314
|
}
|
|
6315
|
+
function readPriorPrProgressForPrompt(projectRoot, taskId) {
|
|
6316
|
+
for (const candidate of [
|
|
6317
|
+
resolve20(projectRoot, ".worktrees", taskId, "artifacts", taskId, "pr-state.json"),
|
|
6318
|
+
resolve20(projectRoot, "artifacts", taskId, "pr-state.json")
|
|
6319
|
+
]) {
|
|
6320
|
+
try {
|
|
6321
|
+
const raw = JSON.parse(readFileSync8(candidate, "utf8"));
|
|
6322
|
+
const entries = Array.isArray(raw) ? raw : [raw];
|
|
6323
|
+
const first = entries.find((entry) => entry && typeof entry === "object" && typeof entry.url === "string");
|
|
6324
|
+
if (!first)
|
|
6325
|
+
continue;
|
|
6326
|
+
return [
|
|
6327
|
+
`Prior progress exists for this task: PR ${first.url}${first.branch ? ` (branch ${first.branch})` : ""} was opened by an earlier run.`,
|
|
6328
|
+
"Check its current state first (diff, checks, review). If the work is already complete and checks are green,",
|
|
6329
|
+
"run `rig-agent completion-verification` to merge and close instead of re-implementing anything."
|
|
6330
|
+
].join(" ");
|
|
6331
|
+
} catch {}
|
|
6332
|
+
}
|
|
6333
|
+
return null;
|
|
6334
|
+
}
|
|
6313
6335
|
function firstPromptString(...values) {
|
|
6314
6336
|
for (const value of values) {
|
|
6315
6337
|
const trimmed = typeof value === "string" ? value.trim() : "";
|
|
@@ -6394,7 +6416,24 @@ async function executeInspect(context, args) {
|
|
|
6394
6416
|
const requiredTask = requireTask(task, "rig inspect logs --task <task-id>");
|
|
6395
6417
|
const latestRun = listAuthorityRuns2(context.projectRoot).map((entry) => readAuthorityRun3(context.projectRoot, entry.runId)).filter((run) => Boolean(run)).filter((run) => run.taskId === requiredTask).sort((left, right) => String(right.updatedAt ?? "").localeCompare(String(left.updatedAt ?? "")))[0];
|
|
6396
6418
|
if (!latestRun) {
|
|
6397
|
-
|
|
6419
|
+
const serverRuns = await listRunsViaServer(context, { limit: 200 }).catch(() => []);
|
|
6420
|
+
const serverRun = serverRuns.filter((run) => String(run.taskId ?? "") === requiredTask).sort((left, right) => String(right.updatedAt ?? "").localeCompare(String(left.updatedAt ?? "")))[0];
|
|
6421
|
+
if (!serverRun || typeof serverRun.runId !== "string") {
|
|
6422
|
+
throw new CliError2(`No runs found for ${requiredTask} (local or on the selected server).`);
|
|
6423
|
+
}
|
|
6424
|
+
const page = await getRunLogsViaServer(context, serverRun.runId, { limit: 500 });
|
|
6425
|
+
const entries = Array.isArray(page.entries) ? page.entries : [];
|
|
6426
|
+
if (context.outputMode === "text") {
|
|
6427
|
+
for (const entry of entries) {
|
|
6428
|
+
const record = entry && typeof entry === "object" ? entry : {};
|
|
6429
|
+
const title = String(record.title ?? "");
|
|
6430
|
+
const detail = String(record.detail ?? "");
|
|
6431
|
+
console.log([title, detail].filter(Boolean).join(" \u2014 "));
|
|
6432
|
+
}
|
|
6433
|
+
if (entries.length === 0)
|
|
6434
|
+
console.log(`(no log entries for run ${serverRun.runId})`);
|
|
6435
|
+
}
|
|
6436
|
+
return { ok: true, group: "inspect", command, details: { task: requiredTask, runId: serverRun.runId, source: "server", entries } };
|
|
6398
6437
|
}
|
|
6399
6438
|
const logsPath = resolve21(resolveAuthorityRunDir4(context.projectRoot, latestRun.runId), "logs.jsonl");
|
|
6400
6439
|
if (!existsSync13(logsPath)) {
|
|
@@ -7679,7 +7718,38 @@ function parseWsPayload(message2) {
|
|
|
7679
7718
|
return JSON.parse(message2.data);
|
|
7680
7719
|
return JSON.parse(Buffer.from(message2.data).toString("utf8"));
|
|
7681
7720
|
}
|
|
7682
|
-
|
|
7721
|
+
var BRIDGE_LOCAL_COMMANDS = new Set(["detach", "quit", "q", "stop"]);
|
|
7722
|
+
function registerDaemonCommandsNatively(pi, options, ctx, state, commands, registered) {
|
|
7723
|
+
for (const command of commands) {
|
|
7724
|
+
const record = recordOf(command);
|
|
7725
|
+
const name = typeof record?.name === "string" ? record.name : "";
|
|
7726
|
+
if (!name || registered.has(name) || BRIDGE_LOCAL_COMMANDS.has(name))
|
|
7727
|
+
continue;
|
|
7728
|
+
registered.add(name);
|
|
7729
|
+
const description = typeof record?.description === "string" ? record.description : undefined;
|
|
7730
|
+
const source = typeof record?.source === "string" ? record.source : "worker";
|
|
7731
|
+
try {
|
|
7732
|
+
pi.registerCommand(name, {
|
|
7733
|
+
description: `[worker ${source}] ${description ?? ""}`.trim(),
|
|
7734
|
+
handler: async (args) => {
|
|
7735
|
+
const text2 = `/${name}${args ? ` ${args}` : ""}`;
|
|
7736
|
+
appendTranscript(state, "You", text2);
|
|
7737
|
+
try {
|
|
7738
|
+
const result = await runRunPiCommandViaServer(options.context, options.runId, text2);
|
|
7739
|
+
const message2 = typeof result.message === "string" ? result.message : "worker command accepted";
|
|
7740
|
+
appendTranscript(state, "System", message2);
|
|
7741
|
+
if (state.nativeStream)
|
|
7742
|
+
ctx.ui.notify(message2, "info");
|
|
7743
|
+
} catch (error) {
|
|
7744
|
+
reportBridgeError(ctx, state, error instanceof Error ? error.message : String(error));
|
|
7745
|
+
}
|
|
7746
|
+
updatePiUi(ctx, state);
|
|
7747
|
+
}
|
|
7748
|
+
});
|
|
7749
|
+
} catch {}
|
|
7750
|
+
}
|
|
7751
|
+
}
|
|
7752
|
+
async function connectWorkerStream(options, pi, ctx, state, registeredDaemonCommands) {
|
|
7683
7753
|
const ready = await waitForWorkerReady(options, ctx, state);
|
|
7684
7754
|
if (!ready)
|
|
7685
7755
|
return;
|
|
@@ -7734,6 +7804,7 @@ async function connectWorkerStream(options, ctx, state) {
|
|
|
7734
7804
|
const record = recordOf(command);
|
|
7735
7805
|
return typeof record?.name === "string" ? [`/${record.name}`] : [];
|
|
7736
7806
|
});
|
|
7807
|
+
registerDaemonCommandsNatively(pi, options, ctx, state, commands, registeredDaemonCommands);
|
|
7737
7808
|
catchupDone = true;
|
|
7738
7809
|
for (const payload of buffered.splice(0))
|
|
7739
7810
|
applyEnvelope(ctx, state, payload);
|
|
@@ -7861,6 +7932,7 @@ function createRigWorkerPiBridgeExtension(options) {
|
|
|
7861
7932
|
};
|
|
7862
7933
|
if (options.initialMessageSent)
|
|
7863
7934
|
appendTranscript(state, "System", "Initial message sent to worker Pi daemon.");
|
|
7935
|
+
const registeredDaemonCommands = new Set;
|
|
7864
7936
|
let nativePiUiContextAvailable = false;
|
|
7865
7937
|
pi.on("user_bash", (event) => {
|
|
7866
7938
|
state.nativeStream = Boolean(state.nativeStream || nativePiUiContextAvailable);
|
|
@@ -7893,7 +7965,7 @@ function createRigWorkerPiBridgeExtension(options) {
|
|
|
7893
7965
|
});
|
|
7894
7966
|
return { consume: true };
|
|
7895
7967
|
});
|
|
7896
|
-
connectWorkerStream(options, ctx, state).catch((error) => {
|
|
7968
|
+
connectWorkerStream(options, pi, ctx, state, registeredDaemonCommands).catch((error) => {
|
|
7897
7969
|
appendTranscript(state, "Error", error instanceof Error ? error.message : String(error));
|
|
7898
7970
|
updatePiUi(ctx, state);
|
|
7899
7971
|
});
|
|
@@ -7940,8 +8012,6 @@ async function attachRunBundledPiFrontend(context, input) {
|
|
|
7940
8012
|
"--no-tools",
|
|
7941
8013
|
"--no-builtin-tools",
|
|
7942
8014
|
"--no-skills",
|
|
7943
|
-
"--no-prompt-templates",
|
|
7944
|
-
"--no-themes",
|
|
7945
8015
|
"--no-context-files",
|
|
7946
8016
|
"--no-approve"
|
|
7947
8017
|
], {
|
|
@@ -8486,6 +8556,7 @@ async function executeRun(context, args) {
|
|
|
8486
8556
|
|
|
8487
8557
|
// packages/cli/src/commands/server.ts
|
|
8488
8558
|
init_runner();
|
|
8559
|
+
import { resolveRigServerCommand } from "@rig/runtime/local-server";
|
|
8489
8560
|
async function executeServer(context, args, options) {
|
|
8490
8561
|
const [command = "status", ...rest] = args;
|
|
8491
8562
|
if (["status", "list", "add", "use"].includes(command)) {
|
|
@@ -8503,7 +8574,8 @@ async function executeServer(context, args, options) {
|
|
|
8503
8574
|
const authTokenResult = takeOption(pending, "--auth-token");
|
|
8504
8575
|
pending = authTokenResult.rest;
|
|
8505
8576
|
requireNoExtraArgs(pending, "rig server start [--host <host>] [--port <n>] [--poll-ms <n>] [--auth-token <token>]");
|
|
8506
|
-
const
|
|
8577
|
+
const serverCommand = resolveRigServerCommand(context.projectRoot);
|
|
8578
|
+
const commandParts = [serverCommand.command, ...serverCommand.commandArgs, "start"];
|
|
8507
8579
|
if (hostResult.value) {
|
|
8508
8580
|
commandParts.push("--host", hostResult.value);
|
|
8509
8581
|
}
|
|
@@ -8526,7 +8598,8 @@ async function executeServer(context, args, options) {
|
|
|
8526
8598
|
const eventResult = takeOption(pending, "--event");
|
|
8527
8599
|
pending = eventResult.rest;
|
|
8528
8600
|
requireNoExtraArgs(pending, "rig server notify-test [--event <type>]");
|
|
8529
|
-
const
|
|
8601
|
+
const serverCommand = resolveRigServerCommand(context.projectRoot);
|
|
8602
|
+
const commandParts = [serverCommand.command, ...serverCommand.commandArgs, "notify-test"];
|
|
8530
8603
|
if (eventResult.value) {
|
|
8531
8604
|
commandParts.push("--event", eventResult.value);
|
|
8532
8605
|
}
|
|
@@ -8660,52 +8733,50 @@ import { intro as intro3, log as log4, note as note4, outro as outro3 } from "@c
|
|
|
8660
8733
|
import pc4 from "picocolors";
|
|
8661
8734
|
var TOP_LEVEL_SECTIONS = [
|
|
8662
8735
|
{
|
|
8663
|
-
title: "
|
|
8664
|
-
subtitle: "
|
|
8736
|
+
title: "Start here",
|
|
8737
|
+
subtitle: "one-time setup for a repo",
|
|
8665
8738
|
commands: [
|
|
8666
|
-
{ command: "rig
|
|
8667
|
-
{ command: "rig
|
|
8668
|
-
{ command: "rig server
|
|
8669
|
-
{ command: "rig server use <alias>", description: "Switch this repo to a saved remote server." },
|
|
8670
|
-
{ command: "rig server list", description: "Show saved server aliases, including local." }
|
|
8739
|
+
{ command: "rig init", description: "Wizard: config, GitHub auth, task source, server, Pi wiring." },
|
|
8740
|
+
{ command: "rig doctor", description: "Check every part of the wiring \u2014 run this when anything feels off." },
|
|
8741
|
+
{ command: "rig server use <alias|local>", description: "Pick which Rig server owns this repo (`rig server list` to see them)." }
|
|
8671
8742
|
]
|
|
8672
8743
|
},
|
|
8673
8744
|
{
|
|
8674
|
-
title: "
|
|
8675
|
-
subtitle: "find
|
|
8745
|
+
title: "Work",
|
|
8746
|
+
subtitle: "find a task and put an agent on it",
|
|
8676
8747
|
commands: [
|
|
8677
|
-
{ command: "rig task list", description: "
|
|
8678
|
-
{ command: "rig task next", description: "
|
|
8679
|
-
{ command: "rig task
|
|
8680
|
-
{ command: "rig task run <id
|
|
8748
|
+
{ command: "rig task list", description: "What's on the board (from the selected source/server)." },
|
|
8749
|
+
{ command: "rig task next", description: "The next ready task, as a card." },
|
|
8750
|
+
{ command: "rig task run --next", description: "Dispatch an agent; interactive mode opens the native Pi session." },
|
|
8751
|
+
{ command: "rig task run <id> --detach", description: "Fire-and-forget a specific task." }
|
|
8681
8752
|
]
|
|
8682
8753
|
},
|
|
8683
8754
|
{
|
|
8684
|
-
title: "
|
|
8685
|
-
subtitle: "
|
|
8755
|
+
title: "Watch & steer",
|
|
8756
|
+
subtitle: "live runs are observable and steerable, attached or not",
|
|
8686
8757
|
commands: [
|
|
8687
|
-
{ command: "rig run
|
|
8688
|
-
{ command: "rig run
|
|
8689
|
-
{ command: "rig run
|
|
8690
|
-
{ command: "rig run stop <id>", description: "
|
|
8758
|
+
{ command: "rig run status", description: "Active and recent runs at a glance." },
|
|
8759
|
+
{ command: "rig run attach <id> --follow", description: "Join the live Pi session (worker keeps running if you /detach)." },
|
|
8760
|
+
{ command: "rig run steer <id> -m <text>", description: "Drop a message into a live worker without attaching." },
|
|
8761
|
+
{ command: "rig run stop <id>", description: "Cancel a running worker." }
|
|
8691
8762
|
]
|
|
8692
8763
|
},
|
|
8693
8764
|
{
|
|
8694
|
-
title: "
|
|
8695
|
-
subtitle: "
|
|
8765
|
+
title: "Unblock & gate",
|
|
8766
|
+
subtitle: "answer what workers ask; control what merges",
|
|
8696
8767
|
commands: [
|
|
8697
|
-
{ command: "rig inbox approvals", description: "
|
|
8698
|
-
{ command: "rig inbox inputs", description: "
|
|
8699
|
-
{ command: "rig review show|set", description: "
|
|
8768
|
+
{ command: "rig inbox approvals", description: "Approvals workers are waiting on (then `rig inbox approve \u2026`)." },
|
|
8769
|
+
{ command: "rig inbox inputs", description: "Questions workers asked (then `rig inbox respond \u2026`)." },
|
|
8770
|
+
{ command: "rig review show|set", description: "The completion review gate (Greptile is mandatory on merges)." }
|
|
8700
8771
|
]
|
|
8701
8772
|
},
|
|
8702
8773
|
{
|
|
8703
|
-
title: "
|
|
8704
|
-
subtitle: "
|
|
8774
|
+
title: "Extend",
|
|
8775
|
+
subtitle: "more Pi, more plugins",
|
|
8705
8776
|
commands: [
|
|
8706
|
-
{ command: "rig
|
|
8707
|
-
{ command: "rig
|
|
8708
|
-
{ command: "rig
|
|
8777
|
+
{ command: "rig pi search <term>", description: "Discover community Pi extensions on npm." },
|
|
8778
|
+
{ command: "rig pi add <pkg>", description: "Add a Pi extension to this project (workers pick it up too)." },
|
|
8779
|
+
{ command: "rig plugin list", description: "What the rig.config.ts plugins contribute." }
|
|
8709
8780
|
]
|
|
8710
8781
|
}
|
|
8711
8782
|
];
|
|
@@ -8913,6 +8984,25 @@ var ALL_GROUPS = [...PRIMARY_GROUPS, ...ADVANCED_GROUPS];
|
|
|
8913
8984
|
function heading(title) {
|
|
8914
8985
|
return pc4.bold(pc4.cyan(title));
|
|
8915
8986
|
}
|
|
8987
|
+
function renderRigBanner(version) {
|
|
8988
|
+
const m = (s) => pc4.bold(pc4.magenta(s));
|
|
8989
|
+
const c = (s) => pc4.bold(pc4.cyan(s));
|
|
8990
|
+
const y = (s) => pc4.yellow(s);
|
|
8991
|
+
const d = (s) => pc4.dim(s);
|
|
8992
|
+
const lines = [
|
|
8993
|
+
m(" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ") + d(" \u2591\u2592\u2593\u2588 "),
|
|
8994
|
+
m(" \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D ") + d("\u2593\u2592\u2591"),
|
|
8995
|
+
c(" \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2557") + d(" \u2591\u2592"),
|
|
8996
|
+
c(" \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551") + d(" \u2588\u2593\u2591"),
|
|
8997
|
+
y(" \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D") + d(" \u2592\u2591"),
|
|
8998
|
+
y(" \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D "),
|
|
8999
|
+
"",
|
|
9000
|
+
` ${c("\u25E2\u25E4")} ${pc4.bold("the control rig for autonomous coding agents")} ${m("//")} ${d("you are the operator")}`,
|
|
9001
|
+
version ? ` ${d(`v${version} \xB7 jack in: rig task run --next`)}` : ` ${d("jack in: rig task run --next")}`
|
|
9002
|
+
];
|
|
9003
|
+
return lines.join(`
|
|
9004
|
+
`);
|
|
9005
|
+
}
|
|
8916
9006
|
function commandLine(command, description) {
|
|
8917
9007
|
const commandColumn = command.length >= 38 ? `${command} ` : command.padEnd(38);
|
|
8918
9008
|
return `${pc4.dim("\u2502")} ${pc4.bold(commandColumn)} ${description}`;
|
|
@@ -8986,12 +9076,25 @@ function renderGroupHelp(groupName) {
|
|
|
8986
9076
|
function shouldUseClackOutput2() {
|
|
8987
9077
|
return Boolean(process.stdout.isTTY) && process.env.RIG_CLI_PLAIN_HELP !== "1";
|
|
8988
9078
|
}
|
|
8989
|
-
function printTopLevelHelp() {
|
|
9079
|
+
function printTopLevelHelp(state = {}) {
|
|
8990
9080
|
if (!shouldUseClackOutput2()) {
|
|
8991
9081
|
console.log(renderTopLevelHelp());
|
|
8992
9082
|
return;
|
|
8993
9083
|
}
|
|
8994
|
-
|
|
9084
|
+
console.log(renderRigBanner(state.version));
|
|
9085
|
+
console.log("");
|
|
9086
|
+
if (state.projectInitialized === false) {
|
|
9087
|
+
intro3("no rig project in this directory");
|
|
9088
|
+
note4([
|
|
9089
|
+
commandLine("rig init", "Set this repo up: config, GitHub auth, task source, server, Pi."),
|
|
9090
|
+
commandLine("rig init --yes", "Same, non-interactive, sensible defaults."),
|
|
9091
|
+
commandLine("rig doctor", "Already initialized somewhere else? Check the wiring.")
|
|
9092
|
+
].join(`
|
|
9093
|
+
`), "Get started");
|
|
9094
|
+
outro3("After init: rig task run --next puts an agent on your next task.");
|
|
9095
|
+
return;
|
|
9096
|
+
}
|
|
9097
|
+
intro3(state.selectedServer ? `server: ${state.selectedServer}` : "rig");
|
|
8995
9098
|
for (const section of TOP_LEVEL_SECTIONS) {
|
|
8996
9099
|
note4(renderCommandBlock(section.commands), `${section.title} \u2014 ${section.subtitle}`);
|
|
8997
9100
|
}
|
|
@@ -9002,7 +9105,7 @@ function printTopLevelHelp() {
|
|
|
9002
9105
|
commandLine("--dry-run", "Print the command plan without mutating state.")
|
|
9003
9106
|
].join(`
|
|
9004
9107
|
`), "Global options");
|
|
9005
|
-
outro3("
|
|
9108
|
+
outro3("init \u2192 task run \u2192 watch/steer \u2192 inbox/review \u2192 merged.");
|
|
9006
9109
|
}
|
|
9007
9110
|
function printAdvancedHelp() {
|
|
9008
9111
|
if (!shouldUseClackOutput2()) {
|
|
@@ -11868,9 +11971,23 @@ function isHelpArg(arg) {
|
|
|
11868
11971
|
function helpText() {
|
|
11869
11972
|
return renderTopLevelHelp();
|
|
11870
11973
|
}
|
|
11974
|
+
function resolveTopLevelLaunchState(context) {
|
|
11975
|
+
const projectInitialized = hasInitializedRigProject(context.projectRoot);
|
|
11976
|
+
let selectedServer = null;
|
|
11977
|
+
if (projectInitialized) {
|
|
11978
|
+
try {
|
|
11979
|
+
const statePath = resolve25(context.projectRoot, ".rig", "state", "connection.json");
|
|
11980
|
+
if (existsSync16(statePath)) {
|
|
11981
|
+
const parsed = JSON.parse(readFileSync12(statePath, "utf-8"));
|
|
11982
|
+
selectedServer = parsed.remoteUrl || parsed.url || parsed.selected || null;
|
|
11983
|
+
}
|
|
11984
|
+
} catch {}
|
|
11985
|
+
}
|
|
11986
|
+
return { projectInitialized, selectedServer, version: process.env.RIG_CLI_VERSION || readBuildConfig().RIG_CLI_VERSION || undefined };
|
|
11987
|
+
}
|
|
11871
11988
|
async function execute(context, args) {
|
|
11872
11989
|
if (args.length === 0) {
|
|
11873
|
-
printTopLevelHelp();
|
|
11990
|
+
printTopLevelHelp(resolveTopLevelLaunchState(context));
|
|
11874
11991
|
return { ok: true, group: "help", command: "show" };
|
|
11875
11992
|
}
|
|
11876
11993
|
const [first, ...rest] = args;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h-rig/cli",
|
|
3
|
-
"version": "0.0.6-alpha.
|
|
3
|
+
"version": "0.0.6-alpha.37",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Rig package",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@clack/prompts": "^1.2.0",
|
|
26
|
-
"@earendil-works/pi-coding-agent": "npm:@h-rig/pi-coding-agent@0.0.6-alpha.
|
|
27
|
-
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.
|
|
28
|
-
"@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.
|
|
29
|
-
"@rig/client": "npm:@h-rig/client@0.0.6-alpha.
|
|
30
|
-
"@rig/server": "npm:@h-rig/server@0.0.6-alpha.
|
|
26
|
+
"@earendil-works/pi-coding-agent": "npm:@h-rig/pi-coding-agent@0.0.6-alpha.37",
|
|
27
|
+
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.37",
|
|
28
|
+
"@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.37",
|
|
29
|
+
"@rig/client": "npm:@h-rig/client@0.0.6-alpha.37",
|
|
30
|
+
"@rig/server": "npm:@h-rig/server@0.0.6-alpha.37",
|
|
31
31
|
"picocolors": "^1.1.1"
|
|
32
32
|
}
|
|
33
33
|
}
|