@h-rig/cli 0.0.6-alpha.74 → 0.0.6-alpha.75

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/src/index.js CHANGED
@@ -7887,14 +7887,13 @@ function buildOperatorPiEnv(input) {
7887
7887
  ...input.serverProjectRoot ? { RIG_PROJECT_ROOT: input.serverProjectRoot } : {}
7888
7888
  };
7889
7889
  }
7890
- async function attachRunBundledPiFrontend(context, input) {
7891
- const tempSessionDir = mkdtempSync(join3(tmpdir(), "rig-pi-frontend-sessions-"));
7890
+ async function prepareOperatorConsole(context, runId, tempSessionDir) {
7892
7891
  const server = await ensureServerForCli(context.projectRoot);
7893
7892
  let sessionFileArg = [];
7894
7893
  try {
7895
- const payload = await requestServerJson(context, `/api/runs/${encodeURIComponent(input.runId)}/session-file`);
7894
+ const payload = await requestServerJson(context, `/api/runs/${encodeURIComponent(runId)}/session-file`);
7896
7895
  if (payload?.ok && typeof payload.content === "string" && payload.content.trim()) {
7897
- const fileName = typeof payload.fileName === "string" && payload.fileName.trim() ? payload.fileName.replace(/[^A-Za-z0-9._-]/g, "_") : `rig-run-${input.runId}.jsonl`;
7896
+ const fileName = typeof payload.fileName === "string" && payload.fileName.trim() ? payload.fileName.replace(/[^A-Za-z0-9._-]/g, "_") : `rig-run-${runId}.jsonl`;
7898
7897
  const localSessionPath = join3(tempSessionDir, fileName);
7899
7898
  const content = payload.content.split(`
7900
7899
  `).map((line, index) => {
@@ -7913,6 +7912,11 @@ async function attachRunBundledPiFrontend(context, input) {
7913
7912
  sessionFileArg = ["--session", localSessionPath];
7914
7913
  }
7915
7914
  } catch {}
7915
+ return { server, sessionFileArg };
7916
+ }
7917
+ async function attachRunBundledPiFrontend(context, input) {
7918
+ const tempSessionDir = mkdtempSync(join3(tmpdir(), "rig-pi-frontend-sessions-"));
7919
+ const { server, sessionFileArg } = await withSpinner(`Opening Pi console for run ${input.runId}\u2026`, () => prepareOperatorConsole(context, input.runId, tempSessionDir), { outputMode: context.outputMode });
7916
7920
  const restoreEnv = setTemporaryEnv(buildOperatorPiEnv({
7917
7921
  runId: input.runId,
7918
7922
  serverUrl: server.baseUrl,
@@ -8743,6 +8747,18 @@ import { computeRigStats } from "@rig/runtime/control-plane/native/run-stats";
8743
8747
  import { intro as intro3, log as log4, note as note4, outro as outro3 } from "@clack/prompts";
8744
8748
  import pc5 from "picocolors";
8745
8749
  var TOP_LEVEL_SECTIONS = [
8750
+ {
8751
+ title: "Pi console",
8752
+ subtitle: "the operator surface \u2014 every attach opens the run's FULL Pi session",
8753
+ commands: [
8754
+ { command: "rig run attach <run-id>", description: "Open the run's Pi console: complete transcript (live AND finished runs), worker turns streaming in live." },
8755
+ { command: "type a message", description: "Inside the console, plain text steers the worker mid-turn \u2014 it lands in the agent's context, not a local model." },
8756
+ { command: "!<command>", description: "Inside the console, runs shell in the WORKER's workspace; output streams back into the transcript." },
8757
+ { command: "/<command>", description: "The palette includes the WORKER session's slash commands ([worker]-tagged) next to /rig." },
8758
+ { command: "/rig abort | /rig stop", description: "Abort the worker's current turn, or stop the whole run, from inside the console." },
8759
+ { command: "rig run steer <id> --message <text>", description: "Steer without attaching \u2014 queue a message; the worker picks it up within seconds." }
8760
+ ]
8761
+ },
8746
8762
  {
8747
8763
  title: "Start here",
8748
8764
  subtitle: "one-time setup, pick a server",
@@ -8757,9 +8773,9 @@ var TOP_LEVEL_SECTIONS = [
8757
8773
  subtitle: "find a task, put an agent on it, answer what it asks",
8758
8774
  commands: [
8759
8775
  { command: "rig task list", description: "What's on the board (from the selected source/server)." },
8760
- { command: "rig task run --next", description: "Dispatch an agent; interactive mode opens the native Pi session." },
8776
+ { command: "rig task run --next", description: "Dispatch an agent on the next ready task; interactive mode drops you into its Pi console." },
8761
8777
  { command: "rig run status", description: "Active and recent runs at a glance." },
8762
- { command: "rig run attach <id> --follow", description: "Join the live Pi session (worker keeps running if you /detach)." },
8778
+ { command: "rig run attach <id> --follow", description: "Same as plain attach \u2014 the Pi console is always the interactive surface." },
8763
8779
  { command: "rig inbox approvals", description: "Approvals workers are waiting on (then `rig inbox approve \u2026`)." }
8764
8780
  ]
8765
8781
  },
@@ -8838,29 +8854,35 @@ var PRIMARY_GROUPS = [
8838
8854
  },
8839
8855
  {
8840
8856
  name: "run",
8841
- summary: "Observe, attach to, and control Rig runs.",
8842
- usage: ["rig run <list|status|show|attach|stop> [options]"],
8857
+ summary: "Observe, attach to, and control Rig runs. `attach` opens the Pi console \u2014 the full worker session, live.",
8858
+ usage: ["rig run <list|status|show|attach|steer|stop|resume|restart> [options]"],
8843
8859
  commands: [
8844
8860
  { command: "list", description: "List recent runs from the selected server or local state.", primary: true },
8845
8861
  { command: "status", description: "Render active and recent run groups.", primary: true },
8846
8862
  { command: "show <id>|--run <id> [--raw]", description: "Show a human run summary; --raw prints the full payload.", primary: true },
8847
- { command: "attach <run-id>|--run <id> [--follow]", description: "Attach to the run; --follow opens the enriched bundled Pi (worker brain).", primary: true },
8863
+ { command: "attach <run-id>|--run <id>", description: "Open the run's Pi console \u2014 see 'Inside the console' below. Works on live AND finished runs.", primary: true },
8864
+ { command: "steer <run-id> --message <text>", description: "Queue a steering message into a live worker without attaching \u2014 delivered into the agent's context within seconds.", primary: true },
8848
8865
  { command: "stop [<run-id>|--run <id>]", description: "Request stop for one run or local active runs.", primary: true },
8849
- { command: "steer <run-id> --message <text>", description: "Queue a steering message into a live worker without attaching." },
8850
- { command: "timeline --run <id> [--follow]", description: "Stream raw run timeline events." },
8866
+ { command: "resume [<run-id>]", description: "Resume an interrupted run on the selected server (defaults to the most recent resumable)." },
8867
+ { command: "restart [<run-id>]", description: "Re-dispatch a run from a clean runtime, reopening its Pi session where possible." },
8868
+ { command: "timeline --run <id> [--follow]", description: "Stream raw run timeline events (scripts; humans should attach)." },
8851
8869
  { command: "replay <run-id>|--run <id> [--with-session]", description: "Print the run's consolidated run.jsonl as a merged timeline; --with-session interleaves the Pi session log." },
8852
- { command: "resume", description: "Resume the most recent interrupted local run." },
8853
- { command: "restart", description: "Restart the most recent local run from a clean runtime." },
8854
8870
  { command: "delete|cleanup", description: "Remove completed run records/artifacts." }
8855
8871
  ],
8856
8872
  examples: [
8873
+ "rig run attach <run-id> # full session console \u2014 live mirror, steering, worker shell",
8874
+ "rig run steer <run-id> --message 'focus on the failing test first'",
8857
8875
  "rig run list",
8858
- "rig run status",
8859
8876
  "rig run show <run-id>",
8860
- "rig run attach <run-id> --follow",
8861
8877
  "rig run stop <run-id>"
8862
8878
  ],
8863
- next: ["Use `rig task run --next` to create a new run.", "Use `--json` when scripts need the full structured record."]
8879
+ next: [
8880
+ "Inside the console: the run's COMPLETE transcript loads on open (finished runs too), and new worker turns stream in live.",
8881
+ "Inside the console: plain text = steering into the worker's context \xB7 !<cmd> = shell in the WORKER workspace \xB7 /<cmd> includes the worker session's commands \xB7 /rig abort stops the current turn.",
8882
+ "The console is read-write but remote-only: nothing runs on your machine; the worker keeps running when you exit.",
8883
+ "Use `rig task run --next` to create a new run; interactive mode drops you straight into its console.",
8884
+ "Use `--json` when scripts need the full structured record."
8885
+ ]
8864
8886
  },
8865
8887
  {
8866
8888
  name: "inbox",
@@ -9083,7 +9105,7 @@ function renderGroup(group) {
9083
9105
  function renderTopLevelHelp() {
9084
9106
  return [
9085
9107
  `${heading("rig")} ${pc5.dim("\u2014 server-owned task/run control plane for Pi-backed engineering work")}`,
9086
- pc5.dim("Current path: select a server, choose a task, submit a run, attach with native Pi, clear inbox gates."),
9108
+ pc5.dim("The loop: pick a task, dispatch an agent, open its Pi console (`rig run attach <id>`) to watch and steer it live, clear inbox gates, merge."),
9087
9109
  "",
9088
9110
  ...TOP_LEVEL_SECTIONS.flatMap((section) => [
9089
9111
  `${pc5.bold(pc5.magenta(`\u25C7 ${section.title}`))} \u2014 ${pc5.dim(section.subtitle)}`,
@@ -9167,7 +9189,7 @@ function printTopLevelHelp(state = {}) {
9167
9189
  commandLine("--dry-run", "Print the command plan without mutating state.")
9168
9190
  ].join(`
9169
9191
  `), "Global options");
9170
- outro3("init \u2192 task run \u2192 watch \u2192 inbox \u2192 merged.");
9192
+ outro3("init \u2192 task run \u2192 attach (Pi console: watch + steer live) \u2192 inbox \u2192 merged.");
9171
9193
  }
9172
9194
  function printAdvancedHelp() {
9173
9195
  if (!shouldUseClackOutput2()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h-rig/cli",
3
- "version": "0.0.6-alpha.74",
3
+ "version": "0.0.6-alpha.75",
4
4
  "type": "module",
5
5
  "description": "Rig package",
6
6
  "license": "UNLICENSED",
@@ -24,13 +24,14 @@
24
24
  "dependencies": {
25
25
  "@clack/prompts": "^1.2.0",
26
26
  "@earendil-works/pi-coding-agent": "0.79.0",
27
- "@rig/client": "npm:@h-rig/client@0.0.6-alpha.74",
28
- "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.74",
29
- "@rig/core": "npm:@h-rig/core@0.0.6-alpha.74",
30
- "@rig/pi-rig": "npm:@h-rig/pi-rig@0.0.6-alpha.74",
31
- "@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.74",
32
- "@rig/server": "npm:@h-rig/server@0.0.6-alpha.74",
33
- "@rig/standard-plugin": "npm:@h-rig/standard-plugin@0.0.6-alpha.74",
27
+ "@earendil-works/pi-tui": "^0.79.0",
28
+ "@rig/client": "npm:@h-rig/client@0.0.6-alpha.75",
29
+ "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.75",
30
+ "@rig/core": "npm:@h-rig/core@0.0.6-alpha.75",
31
+ "@rig/pi-rig": "npm:@h-rig/pi-rig@0.0.6-alpha.75",
32
+ "@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.75",
33
+ "@rig/server": "npm:@h-rig/server@0.0.6-alpha.75",
34
+ "@rig/standard-plugin": "npm:@h-rig/standard-plugin@0.0.6-alpha.75",
34
35
  "effect": "4.0.0-beta.78",
35
36
  "picocolors": "^1.1.1"
36
37
  }