@h-rig/cli 0.0.6-alpha.71 → 0.0.6-alpha.72
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 +19 -8
- package/dist/src/commands/_operator-view.js +14 -3
- package/dist/src/commands/_pi-frontend.js +13 -2
- package/dist/src/commands/run.js +14 -3
- package/dist/src/commands/task.js +14 -3
- package/dist/src/commands.js +19 -8
- package/dist/src/index.js +19 -8
- package/package.json +8 -8
package/dist/bin/rig.js
CHANGED
|
@@ -7860,7 +7860,7 @@ async function promptForTaskSelection(question) {
|
|
|
7860
7860
|
}
|
|
7861
7861
|
|
|
7862
7862
|
// packages/cli/src/commands/_pi-frontend.ts
|
|
7863
|
-
import { mkdtempSync, rmSync as rmSync5 } from "fs";
|
|
7863
|
+
import { mkdtempSync, rmSync as rmSync5, writeFileSync as writeFileSync6 } from "fs";
|
|
7864
7864
|
import { tmpdir } from "os";
|
|
7865
7865
|
import { join as join3 } from "path";
|
|
7866
7866
|
import { main as runPiMain } from "@earendil-works/pi-coding-agent";
|
|
@@ -7894,6 +7894,16 @@ function buildOperatorPiEnv(input) {
|
|
|
7894
7894
|
async function attachRunBundledPiFrontend(context, input) {
|
|
7895
7895
|
const tempSessionDir = mkdtempSync(join3(tmpdir(), "rig-pi-frontend-sessions-"));
|
|
7896
7896
|
const server = await ensureServerForCli(context.projectRoot);
|
|
7897
|
+
let sessionFileArg = [];
|
|
7898
|
+
try {
|
|
7899
|
+
const payload = await requestServerJson(context, `/api/runs/${encodeURIComponent(input.runId)}/session-file`);
|
|
7900
|
+
if (payload?.ok && typeof payload.content === "string" && payload.content.trim()) {
|
|
7901
|
+
const fileName = typeof payload.fileName === "string" && payload.fileName.trim() ? payload.fileName.replace(/[^A-Za-z0-9._-]/g, "_") : `rig-run-${input.runId}.jsonl`;
|
|
7902
|
+
const localSessionPath = join3(tempSessionDir, fileName);
|
|
7903
|
+
writeFileSync6(localSessionPath, payload.content);
|
|
7904
|
+
sessionFileArg = ["--session", localSessionPath];
|
|
7905
|
+
}
|
|
7906
|
+
} catch {}
|
|
7897
7907
|
const restoreEnv = setTemporaryEnv(buildOperatorPiEnv({
|
|
7898
7908
|
runId: input.runId,
|
|
7899
7909
|
serverUrl: server.baseUrl,
|
|
@@ -7910,7 +7920,8 @@ async function attachRunBundledPiFrontend(context, input) {
|
|
|
7910
7920
|
"--no-extensions",
|
|
7911
7921
|
"--no-skills",
|
|
7912
7922
|
"--no-prompt-templates",
|
|
7913
|
-
"--no-context-files"
|
|
7923
|
+
"--no-context-files",
|
|
7924
|
+
...sessionFileArg
|
|
7914
7925
|
], {
|
|
7915
7926
|
extensionFactories: [piRigExtensionFactory]
|
|
7916
7927
|
});
|
|
@@ -7981,7 +7992,7 @@ async function attachRunOperatorView(context, input) {
|
|
|
7981
7992
|
await withSpinner("Queueing steering message\u2026", () => sendRunPiPromptViaServer(context, input.runId, attachMessage, "steer").catch(() => steerRunViaServer(context, input.runId, attachMessage)), { outputMode: context.outputMode });
|
|
7982
7993
|
steered = true;
|
|
7983
7994
|
}
|
|
7984
|
-
if (
|
|
7995
|
+
if (!input.once && input.interactive !== false && context.outputMode === "text" && Boolean(process.stdin.isTTY && process.stdout.isTTY)) {
|
|
7985
7996
|
return attachRunBundledPiFrontend(context, {
|
|
7986
7997
|
runId: input.runId,
|
|
7987
7998
|
steered
|
|
@@ -9843,7 +9854,7 @@ async function executeTask(context, args, options) {
|
|
|
9843
9854
|
|
|
9844
9855
|
// packages/cli/src/commands/task-run-driver.ts
|
|
9845
9856
|
init_runner();
|
|
9846
|
-
import { copyFileSync as copyFileSync3, existsSync as existsSync15, mkdirSync as mkdirSync9, readFileSync as readFileSync11, statSync as statSync2, writeFileSync as
|
|
9857
|
+
import { copyFileSync as copyFileSync3, existsSync as existsSync15, mkdirSync as mkdirSync9, readFileSync as readFileSync11, statSync as statSync2, writeFileSync as writeFileSync7 } from "fs";
|
|
9847
9858
|
import { resolve as resolve23 } from "path";
|
|
9848
9859
|
import { spawn as spawn2, spawnSync as spawnSync4 } from "child_process";
|
|
9849
9860
|
import { createInterface as createLineInterface } from "readline";
|
|
@@ -10826,7 +10837,7 @@ async function executeRigOwnedTaskRun(context, input) {
|
|
|
10826
10837
|
classifiedAt: new Date().toISOString()
|
|
10827
10838
|
};
|
|
10828
10839
|
mkdirSync9(resolve23(context.projectRoot, ".rig", "runs", input.runId), { recursive: true });
|
|
10829
|
-
|
|
10840
|
+
writeFileSync7(resolve23(context.projectRoot, ".rig", "runs", input.runId, "planning-classification.json"), `${JSON.stringify(persistedPlanning, null, 2)}
|
|
10830
10841
|
`, "utf8");
|
|
10831
10842
|
patchAuthorityRun(context.projectRoot, input.runId, { planning: persistedPlanning });
|
|
10832
10843
|
prompt = `${prompt}
|
|
@@ -10974,7 +10985,7 @@ ${planningClassification.planningRequired ? `Before implementing, write a concis
|
|
|
10974
10985
|
const readyFile = childEnv.RIG_DIRTY_BASELINE_READY_FILE;
|
|
10975
10986
|
if (readyFile) {
|
|
10976
10987
|
mkdirSync9(resolve23(readyFile, ".."), { recursive: true });
|
|
10977
|
-
|
|
10988
|
+
writeFileSync7(readyFile, `${JSON.stringify({ ...dirty, workspaceDir: latestRuntimeWorkspace, appliedAt: new Date().toISOString() }, null, 2)}
|
|
10978
10989
|
`, "utf8");
|
|
10979
10990
|
}
|
|
10980
10991
|
appendRunLog(context.projectRoot, input.runId, {
|
|
@@ -11884,7 +11895,7 @@ async function executeTest(context, args) {
|
|
|
11884
11895
|
|
|
11885
11896
|
// packages/cli/src/commands/setup.ts
|
|
11886
11897
|
init_runner();
|
|
11887
|
-
import { existsSync as existsSync16, mkdirSync as mkdirSync10, readdirSync as readdirSync3, writeFileSync as
|
|
11898
|
+
import { existsSync as existsSync16, mkdirSync as mkdirSync10, readdirSync as readdirSync3, writeFileSync as writeFileSync8 } from "fs";
|
|
11888
11899
|
import { resolve as resolve24 } from "path";
|
|
11889
11900
|
import { createPluginHost } from "@rig/core";
|
|
11890
11901
|
import {
|
|
@@ -11945,7 +11956,7 @@ function runSetupInit(projectRoot) {
|
|
|
11945
11956
|
mkdirSync10(artifactsDir, { recursive: true });
|
|
11946
11957
|
const failuresPath = resolve24(stateDir, "failed_approaches.md");
|
|
11947
11958
|
if (!existsSync16(failuresPath)) {
|
|
11948
|
-
|
|
11959
|
+
writeFileSync8(failuresPath, `# Failed Approaches
|
|
11949
11960
|
|
|
11950
11961
|
`, "utf-8");
|
|
11951
11962
|
}
|
|
@@ -569,7 +569,7 @@ function createOperatorSurface(options = {}) {
|
|
|
569
569
|
}
|
|
570
570
|
|
|
571
571
|
// packages/cli/src/commands/_pi-frontend.ts
|
|
572
|
-
import { mkdtempSync, rmSync } from "fs";
|
|
572
|
+
import { mkdtempSync, rmSync, writeFileSync as writeFileSync2 } from "fs";
|
|
573
573
|
import { tmpdir } from "os";
|
|
574
574
|
import { join } from "path";
|
|
575
575
|
import { main as runPiMain } from "@earendil-works/pi-coding-agent";
|
|
@@ -603,6 +603,16 @@ function buildOperatorPiEnv(input) {
|
|
|
603
603
|
async function attachRunBundledPiFrontend(context, input) {
|
|
604
604
|
const tempSessionDir = mkdtempSync(join(tmpdir(), "rig-pi-frontend-sessions-"));
|
|
605
605
|
const server = await ensureServerForCli(context.projectRoot);
|
|
606
|
+
let sessionFileArg = [];
|
|
607
|
+
try {
|
|
608
|
+
const payload = await requestServerJson(context, `/api/runs/${encodeURIComponent(input.runId)}/session-file`);
|
|
609
|
+
if (payload?.ok && typeof payload.content === "string" && payload.content.trim()) {
|
|
610
|
+
const fileName = typeof payload.fileName === "string" && payload.fileName.trim() ? payload.fileName.replace(/[^A-Za-z0-9._-]/g, "_") : `rig-run-${input.runId}.jsonl`;
|
|
611
|
+
const localSessionPath = join(tempSessionDir, fileName);
|
|
612
|
+
writeFileSync2(localSessionPath, payload.content);
|
|
613
|
+
sessionFileArg = ["--session", localSessionPath];
|
|
614
|
+
}
|
|
615
|
+
} catch {}
|
|
606
616
|
const restoreEnv = setTemporaryEnv(buildOperatorPiEnv({
|
|
607
617
|
runId: input.runId,
|
|
608
618
|
serverUrl: server.baseUrl,
|
|
@@ -619,7 +629,8 @@ async function attachRunBundledPiFrontend(context, input) {
|
|
|
619
629
|
"--no-extensions",
|
|
620
630
|
"--no-skills",
|
|
621
631
|
"--no-prompt-templates",
|
|
622
|
-
"--no-context-files"
|
|
632
|
+
"--no-context-files",
|
|
633
|
+
...sessionFileArg
|
|
623
634
|
], {
|
|
624
635
|
extensionFactories: [piRigExtensionFactory]
|
|
625
636
|
});
|
|
@@ -811,7 +822,7 @@ async function attachRunOperatorView(context, input) {
|
|
|
811
822
|
await withSpinner("Queueing steering message\u2026", () => sendRunPiPromptViaServer(context, input.runId, attachMessage, "steer").catch(() => steerRunViaServer(context, input.runId, attachMessage)), { outputMode: context.outputMode });
|
|
812
823
|
steered = true;
|
|
813
824
|
}
|
|
814
|
-
if (
|
|
825
|
+
if (!input.once && input.interactive !== false && context.outputMode === "text" && Boolean(process.stdin.isTTY && process.stdout.isTTY)) {
|
|
815
826
|
return attachRunBundledPiFrontend(context, {
|
|
816
827
|
runId: input.runId,
|
|
817
828
|
steered
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// packages/cli/src/commands/_pi-frontend.ts
|
|
3
|
-
import { mkdtempSync, rmSync } from "fs";
|
|
3
|
+
import { mkdtempSync, rmSync, writeFileSync as writeFileSync2 } from "fs";
|
|
4
4
|
import { tmpdir } from "os";
|
|
5
5
|
import { join } from "path";
|
|
6
6
|
import { main as runPiMain } from "@earendil-works/pi-coding-agent";
|
|
@@ -366,6 +366,16 @@ function buildOperatorPiEnv(input) {
|
|
|
366
366
|
async function attachRunBundledPiFrontend(context, input) {
|
|
367
367
|
const tempSessionDir = mkdtempSync(join(tmpdir(), "rig-pi-frontend-sessions-"));
|
|
368
368
|
const server = await ensureServerForCli(context.projectRoot);
|
|
369
|
+
let sessionFileArg = [];
|
|
370
|
+
try {
|
|
371
|
+
const payload = await requestServerJson(context, `/api/runs/${encodeURIComponent(input.runId)}/session-file`);
|
|
372
|
+
if (payload?.ok && typeof payload.content === "string" && payload.content.trim()) {
|
|
373
|
+
const fileName = typeof payload.fileName === "string" && payload.fileName.trim() ? payload.fileName.replace(/[^A-Za-z0-9._-]/g, "_") : `rig-run-${input.runId}.jsonl`;
|
|
374
|
+
const localSessionPath = join(tempSessionDir, fileName);
|
|
375
|
+
writeFileSync2(localSessionPath, payload.content);
|
|
376
|
+
sessionFileArg = ["--session", localSessionPath];
|
|
377
|
+
}
|
|
378
|
+
} catch {}
|
|
369
379
|
const restoreEnv = setTemporaryEnv(buildOperatorPiEnv({
|
|
370
380
|
runId: input.runId,
|
|
371
381
|
serverUrl: server.baseUrl,
|
|
@@ -382,7 +392,8 @@ async function attachRunBundledPiFrontend(context, input) {
|
|
|
382
392
|
"--no-extensions",
|
|
383
393
|
"--no-skills",
|
|
384
394
|
"--no-prompt-templates",
|
|
385
|
-
"--no-context-files"
|
|
395
|
+
"--no-context-files",
|
|
396
|
+
...sessionFileArg
|
|
386
397
|
], {
|
|
387
398
|
extensionFactories: [piRigExtensionFactory]
|
|
388
399
|
});
|
package/dist/src/commands/run.js
CHANGED
|
@@ -807,7 +807,7 @@ function createOperatorSurface(options = {}) {
|
|
|
807
807
|
}
|
|
808
808
|
|
|
809
809
|
// packages/cli/src/commands/_pi-frontend.ts
|
|
810
|
-
import { mkdtempSync, rmSync } from "fs";
|
|
810
|
+
import { mkdtempSync, rmSync, writeFileSync as writeFileSync2 } from "fs";
|
|
811
811
|
import { tmpdir } from "os";
|
|
812
812
|
import { join as join2 } from "path";
|
|
813
813
|
import { main as runPiMain } from "@earendil-works/pi-coding-agent";
|
|
@@ -841,6 +841,16 @@ function buildOperatorPiEnv(input) {
|
|
|
841
841
|
async function attachRunBundledPiFrontend(context, input) {
|
|
842
842
|
const tempSessionDir = mkdtempSync(join2(tmpdir(), "rig-pi-frontend-sessions-"));
|
|
843
843
|
const server = await ensureServerForCli(context.projectRoot);
|
|
844
|
+
let sessionFileArg = [];
|
|
845
|
+
try {
|
|
846
|
+
const payload = await requestServerJson(context, `/api/runs/${encodeURIComponent(input.runId)}/session-file`);
|
|
847
|
+
if (payload?.ok && typeof payload.content === "string" && payload.content.trim()) {
|
|
848
|
+
const fileName = typeof payload.fileName === "string" && payload.fileName.trim() ? payload.fileName.replace(/[^A-Za-z0-9._-]/g, "_") : `rig-run-${input.runId}.jsonl`;
|
|
849
|
+
const localSessionPath = join2(tempSessionDir, fileName);
|
|
850
|
+
writeFileSync2(localSessionPath, payload.content);
|
|
851
|
+
sessionFileArg = ["--session", localSessionPath];
|
|
852
|
+
}
|
|
853
|
+
} catch {}
|
|
844
854
|
const restoreEnv = setTemporaryEnv(buildOperatorPiEnv({
|
|
845
855
|
runId: input.runId,
|
|
846
856
|
serverUrl: server.baseUrl,
|
|
@@ -857,7 +867,8 @@ async function attachRunBundledPiFrontend(context, input) {
|
|
|
857
867
|
"--no-extensions",
|
|
858
868
|
"--no-skills",
|
|
859
869
|
"--no-prompt-templates",
|
|
860
|
-
"--no-context-files"
|
|
870
|
+
"--no-context-files",
|
|
871
|
+
...sessionFileArg
|
|
861
872
|
], {
|
|
862
873
|
extensionFactories: [piRigExtensionFactory]
|
|
863
874
|
});
|
|
@@ -1049,7 +1060,7 @@ async function attachRunOperatorView(context, input) {
|
|
|
1049
1060
|
await withSpinner("Queueing steering message\u2026", () => sendRunPiPromptViaServer(context, input.runId, attachMessage, "steer").catch(() => steerRunViaServer(context, input.runId, attachMessage)), { outputMode: context.outputMode });
|
|
1050
1061
|
steered = true;
|
|
1051
1062
|
}
|
|
1052
|
-
if (
|
|
1063
|
+
if (!input.once && input.interactive !== false && context.outputMode === "text" && Boolean(process.stdin.isTTY && process.stdout.isTTY)) {
|
|
1053
1064
|
return attachRunBundledPiFrontend(context, {
|
|
1054
1065
|
runId: input.runId,
|
|
1055
1066
|
steered
|
|
@@ -1170,7 +1170,7 @@ async function withSpinner(label, work, options = {}) {
|
|
|
1170
1170
|
}
|
|
1171
1171
|
|
|
1172
1172
|
// packages/cli/src/commands/_pi-frontend.ts
|
|
1173
|
-
import { mkdtempSync, rmSync } from "fs";
|
|
1173
|
+
import { mkdtempSync, rmSync, writeFileSync as writeFileSync2 } from "fs";
|
|
1174
1174
|
import { tmpdir } from "os";
|
|
1175
1175
|
import { join } from "path";
|
|
1176
1176
|
import { main as runPiMain } from "@earendil-works/pi-coding-agent";
|
|
@@ -1204,6 +1204,16 @@ function buildOperatorPiEnv(input) {
|
|
|
1204
1204
|
async function attachRunBundledPiFrontend(context, input) {
|
|
1205
1205
|
const tempSessionDir = mkdtempSync(join(tmpdir(), "rig-pi-frontend-sessions-"));
|
|
1206
1206
|
const server = await ensureServerForCli(context.projectRoot);
|
|
1207
|
+
let sessionFileArg = [];
|
|
1208
|
+
try {
|
|
1209
|
+
const payload = await requestServerJson(context, `/api/runs/${encodeURIComponent(input.runId)}/session-file`);
|
|
1210
|
+
if (payload?.ok && typeof payload.content === "string" && payload.content.trim()) {
|
|
1211
|
+
const fileName = typeof payload.fileName === "string" && payload.fileName.trim() ? payload.fileName.replace(/[^A-Za-z0-9._-]/g, "_") : `rig-run-${input.runId}.jsonl`;
|
|
1212
|
+
const localSessionPath = join(tempSessionDir, fileName);
|
|
1213
|
+
writeFileSync2(localSessionPath, payload.content);
|
|
1214
|
+
sessionFileArg = ["--session", localSessionPath];
|
|
1215
|
+
}
|
|
1216
|
+
} catch {}
|
|
1207
1217
|
const restoreEnv = setTemporaryEnv(buildOperatorPiEnv({
|
|
1208
1218
|
runId: input.runId,
|
|
1209
1219
|
serverUrl: server.baseUrl,
|
|
@@ -1220,7 +1230,8 @@ async function attachRunBundledPiFrontend(context, input) {
|
|
|
1220
1230
|
"--no-extensions",
|
|
1221
1231
|
"--no-skills",
|
|
1222
1232
|
"--no-prompt-templates",
|
|
1223
|
-
"--no-context-files"
|
|
1233
|
+
"--no-context-files",
|
|
1234
|
+
...sessionFileArg
|
|
1224
1235
|
], {
|
|
1225
1236
|
extensionFactories: [piRigExtensionFactory]
|
|
1226
1237
|
});
|
|
@@ -1291,7 +1302,7 @@ async function attachRunOperatorView(context, input) {
|
|
|
1291
1302
|
await withSpinner("Queueing steering message\u2026", () => sendRunPiPromptViaServer(context, input.runId, attachMessage, "steer").catch(() => steerRunViaServer(context, input.runId, attachMessage)), { outputMode: context.outputMode });
|
|
1292
1303
|
steered = true;
|
|
1293
1304
|
}
|
|
1294
|
-
if (
|
|
1305
|
+
if (!input.once && input.interactive !== false && context.outputMode === "text" && Boolean(process.stdin.isTTY && process.stdout.isTTY)) {
|
|
1295
1306
|
return attachRunBundledPiFrontend(context, {
|
|
1296
1307
|
runId: input.runId,
|
|
1297
1308
|
steered
|
package/dist/src/commands.js
CHANGED
|
@@ -7667,7 +7667,7 @@ async function promptForTaskSelection(question) {
|
|
|
7667
7667
|
}
|
|
7668
7668
|
|
|
7669
7669
|
// packages/cli/src/commands/_pi-frontend.ts
|
|
7670
|
-
import { mkdtempSync, rmSync as rmSync5 } from "fs";
|
|
7670
|
+
import { mkdtempSync, rmSync as rmSync5, writeFileSync as writeFileSync6 } from "fs";
|
|
7671
7671
|
import { tmpdir } from "os";
|
|
7672
7672
|
import { join as join3 } from "path";
|
|
7673
7673
|
import { main as runPiMain } from "@earendil-works/pi-coding-agent";
|
|
@@ -7701,6 +7701,16 @@ function buildOperatorPiEnv(input) {
|
|
|
7701
7701
|
async function attachRunBundledPiFrontend(context, input) {
|
|
7702
7702
|
const tempSessionDir = mkdtempSync(join3(tmpdir(), "rig-pi-frontend-sessions-"));
|
|
7703
7703
|
const server = await ensureServerForCli(context.projectRoot);
|
|
7704
|
+
let sessionFileArg = [];
|
|
7705
|
+
try {
|
|
7706
|
+
const payload = await requestServerJson(context, `/api/runs/${encodeURIComponent(input.runId)}/session-file`);
|
|
7707
|
+
if (payload?.ok && typeof payload.content === "string" && payload.content.trim()) {
|
|
7708
|
+
const fileName = typeof payload.fileName === "string" && payload.fileName.trim() ? payload.fileName.replace(/[^A-Za-z0-9._-]/g, "_") : `rig-run-${input.runId}.jsonl`;
|
|
7709
|
+
const localSessionPath = join3(tempSessionDir, fileName);
|
|
7710
|
+
writeFileSync6(localSessionPath, payload.content);
|
|
7711
|
+
sessionFileArg = ["--session", localSessionPath];
|
|
7712
|
+
}
|
|
7713
|
+
} catch {}
|
|
7704
7714
|
const restoreEnv = setTemporaryEnv(buildOperatorPiEnv({
|
|
7705
7715
|
runId: input.runId,
|
|
7706
7716
|
serverUrl: server.baseUrl,
|
|
@@ -7717,7 +7727,8 @@ async function attachRunBundledPiFrontend(context, input) {
|
|
|
7717
7727
|
"--no-extensions",
|
|
7718
7728
|
"--no-skills",
|
|
7719
7729
|
"--no-prompt-templates",
|
|
7720
|
-
"--no-context-files"
|
|
7730
|
+
"--no-context-files",
|
|
7731
|
+
...sessionFileArg
|
|
7721
7732
|
], {
|
|
7722
7733
|
extensionFactories: [piRigExtensionFactory]
|
|
7723
7734
|
});
|
|
@@ -7788,7 +7799,7 @@ async function attachRunOperatorView(context, input) {
|
|
|
7788
7799
|
await withSpinner("Queueing steering message\u2026", () => sendRunPiPromptViaServer(context, input.runId, attachMessage, "steer").catch(() => steerRunViaServer(context, input.runId, attachMessage)), { outputMode: context.outputMode });
|
|
7789
7800
|
steered = true;
|
|
7790
7801
|
}
|
|
7791
|
-
if (
|
|
7802
|
+
if (!input.once && input.interactive !== false && context.outputMode === "text" && Boolean(process.stdin.isTTY && process.stdout.isTTY)) {
|
|
7792
7803
|
return attachRunBundledPiFrontend(context, {
|
|
7793
7804
|
runId: input.runId,
|
|
7794
7805
|
steered
|
|
@@ -9650,7 +9661,7 @@ async function executeTask(context, args, options) {
|
|
|
9650
9661
|
|
|
9651
9662
|
// packages/cli/src/commands/task-run-driver.ts
|
|
9652
9663
|
init_runner();
|
|
9653
|
-
import { copyFileSync as copyFileSync3, existsSync as existsSync14, mkdirSync as mkdirSync8, readFileSync as readFileSync11, statSync as statSync2, writeFileSync as
|
|
9664
|
+
import { copyFileSync as copyFileSync3, existsSync as existsSync14, mkdirSync as mkdirSync8, readFileSync as readFileSync11, statSync as statSync2, writeFileSync as writeFileSync7 } from "fs";
|
|
9654
9665
|
import { resolve as resolve22 } from "path";
|
|
9655
9666
|
import { spawn as spawn2, spawnSync as spawnSync4 } from "child_process";
|
|
9656
9667
|
import { createInterface as createLineInterface } from "readline";
|
|
@@ -10633,7 +10644,7 @@ async function executeRigOwnedTaskRun(context, input) {
|
|
|
10633
10644
|
classifiedAt: new Date().toISOString()
|
|
10634
10645
|
};
|
|
10635
10646
|
mkdirSync8(resolve22(context.projectRoot, ".rig", "runs", input.runId), { recursive: true });
|
|
10636
|
-
|
|
10647
|
+
writeFileSync7(resolve22(context.projectRoot, ".rig", "runs", input.runId, "planning-classification.json"), `${JSON.stringify(persistedPlanning, null, 2)}
|
|
10637
10648
|
`, "utf8");
|
|
10638
10649
|
patchAuthorityRun(context.projectRoot, input.runId, { planning: persistedPlanning });
|
|
10639
10650
|
prompt = `${prompt}
|
|
@@ -10781,7 +10792,7 @@ ${planningClassification.planningRequired ? `Before implementing, write a concis
|
|
|
10781
10792
|
const readyFile = childEnv.RIG_DIRTY_BASELINE_READY_FILE;
|
|
10782
10793
|
if (readyFile) {
|
|
10783
10794
|
mkdirSync8(resolve22(readyFile, ".."), { recursive: true });
|
|
10784
|
-
|
|
10795
|
+
writeFileSync7(readyFile, `${JSON.stringify({ ...dirty, workspaceDir: latestRuntimeWorkspace, appliedAt: new Date().toISOString() }, null, 2)}
|
|
10785
10796
|
`, "utf8");
|
|
10786
10797
|
}
|
|
10787
10798
|
appendRunLog(context.projectRoot, input.runId, {
|
|
@@ -11691,7 +11702,7 @@ async function executeTest(context, args) {
|
|
|
11691
11702
|
|
|
11692
11703
|
// packages/cli/src/commands/setup.ts
|
|
11693
11704
|
init_runner();
|
|
11694
|
-
import { existsSync as existsSync15, mkdirSync as mkdirSync9, readdirSync as readdirSync3, writeFileSync as
|
|
11705
|
+
import { existsSync as existsSync15, mkdirSync as mkdirSync9, readdirSync as readdirSync3, writeFileSync as writeFileSync8 } from "fs";
|
|
11695
11706
|
import { resolve as resolve23 } from "path";
|
|
11696
11707
|
import { createPluginHost } from "@rig/core";
|
|
11697
11708
|
import {
|
|
@@ -11752,7 +11763,7 @@ function runSetupInit(projectRoot) {
|
|
|
11752
11763
|
mkdirSync9(artifactsDir, { recursive: true });
|
|
11753
11764
|
const failuresPath = resolve23(stateDir, "failed_approaches.md");
|
|
11754
11765
|
if (!existsSync15(failuresPath)) {
|
|
11755
|
-
|
|
11766
|
+
writeFileSync8(failuresPath, `# Failed Approaches
|
|
11756
11767
|
|
|
11757
11768
|
`, "utf-8");
|
|
11758
11769
|
}
|
package/dist/src/index.js
CHANGED
|
@@ -7856,7 +7856,7 @@ async function promptForTaskSelection(question) {
|
|
|
7856
7856
|
}
|
|
7857
7857
|
|
|
7858
7858
|
// packages/cli/src/commands/_pi-frontend.ts
|
|
7859
|
-
import { mkdtempSync, rmSync as rmSync5 } from "fs";
|
|
7859
|
+
import { mkdtempSync, rmSync as rmSync5, writeFileSync as writeFileSync6 } from "fs";
|
|
7860
7860
|
import { tmpdir } from "os";
|
|
7861
7861
|
import { join as join3 } from "path";
|
|
7862
7862
|
import { main as runPiMain } from "@earendil-works/pi-coding-agent";
|
|
@@ -7890,6 +7890,16 @@ function buildOperatorPiEnv(input) {
|
|
|
7890
7890
|
async function attachRunBundledPiFrontend(context, input) {
|
|
7891
7891
|
const tempSessionDir = mkdtempSync(join3(tmpdir(), "rig-pi-frontend-sessions-"));
|
|
7892
7892
|
const server = await ensureServerForCli(context.projectRoot);
|
|
7893
|
+
let sessionFileArg = [];
|
|
7894
|
+
try {
|
|
7895
|
+
const payload = await requestServerJson(context, `/api/runs/${encodeURIComponent(input.runId)}/session-file`);
|
|
7896
|
+
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`;
|
|
7898
|
+
const localSessionPath = join3(tempSessionDir, fileName);
|
|
7899
|
+
writeFileSync6(localSessionPath, payload.content);
|
|
7900
|
+
sessionFileArg = ["--session", localSessionPath];
|
|
7901
|
+
}
|
|
7902
|
+
} catch {}
|
|
7893
7903
|
const restoreEnv = setTemporaryEnv(buildOperatorPiEnv({
|
|
7894
7904
|
runId: input.runId,
|
|
7895
7905
|
serverUrl: server.baseUrl,
|
|
@@ -7906,7 +7916,8 @@ async function attachRunBundledPiFrontend(context, input) {
|
|
|
7906
7916
|
"--no-extensions",
|
|
7907
7917
|
"--no-skills",
|
|
7908
7918
|
"--no-prompt-templates",
|
|
7909
|
-
"--no-context-files"
|
|
7919
|
+
"--no-context-files",
|
|
7920
|
+
...sessionFileArg
|
|
7910
7921
|
], {
|
|
7911
7922
|
extensionFactories: [piRigExtensionFactory]
|
|
7912
7923
|
});
|
|
@@ -7977,7 +7988,7 @@ async function attachRunOperatorView(context, input) {
|
|
|
7977
7988
|
await withSpinner("Queueing steering message\u2026", () => sendRunPiPromptViaServer(context, input.runId, attachMessage, "steer").catch(() => steerRunViaServer(context, input.runId, attachMessage)), { outputMode: context.outputMode });
|
|
7978
7989
|
steered = true;
|
|
7979
7990
|
}
|
|
7980
|
-
if (
|
|
7991
|
+
if (!input.once && input.interactive !== false && context.outputMode === "text" && Boolean(process.stdin.isTTY && process.stdout.isTTY)) {
|
|
7981
7992
|
return attachRunBundledPiFrontend(context, {
|
|
7982
7993
|
runId: input.runId,
|
|
7983
7994
|
steered
|
|
@@ -9839,7 +9850,7 @@ async function executeTask(context, args, options) {
|
|
|
9839
9850
|
|
|
9840
9851
|
// packages/cli/src/commands/task-run-driver.ts
|
|
9841
9852
|
init_runner();
|
|
9842
|
-
import { copyFileSync as copyFileSync3, existsSync as existsSync15, mkdirSync as mkdirSync9, readFileSync as readFileSync11, statSync as statSync2, writeFileSync as
|
|
9853
|
+
import { copyFileSync as copyFileSync3, existsSync as existsSync15, mkdirSync as mkdirSync9, readFileSync as readFileSync11, statSync as statSync2, writeFileSync as writeFileSync7 } from "fs";
|
|
9843
9854
|
import { resolve as resolve23 } from "path";
|
|
9844
9855
|
import { spawn as spawn2, spawnSync as spawnSync4 } from "child_process";
|
|
9845
9856
|
import { createInterface as createLineInterface } from "readline";
|
|
@@ -10822,7 +10833,7 @@ async function executeRigOwnedTaskRun(context, input) {
|
|
|
10822
10833
|
classifiedAt: new Date().toISOString()
|
|
10823
10834
|
};
|
|
10824
10835
|
mkdirSync9(resolve23(context.projectRoot, ".rig", "runs", input.runId), { recursive: true });
|
|
10825
|
-
|
|
10836
|
+
writeFileSync7(resolve23(context.projectRoot, ".rig", "runs", input.runId, "planning-classification.json"), `${JSON.stringify(persistedPlanning, null, 2)}
|
|
10826
10837
|
`, "utf8");
|
|
10827
10838
|
patchAuthorityRun(context.projectRoot, input.runId, { planning: persistedPlanning });
|
|
10828
10839
|
prompt = `${prompt}
|
|
@@ -10970,7 +10981,7 @@ ${planningClassification.planningRequired ? `Before implementing, write a concis
|
|
|
10970
10981
|
const readyFile = childEnv.RIG_DIRTY_BASELINE_READY_FILE;
|
|
10971
10982
|
if (readyFile) {
|
|
10972
10983
|
mkdirSync9(resolve23(readyFile, ".."), { recursive: true });
|
|
10973
|
-
|
|
10984
|
+
writeFileSync7(readyFile, `${JSON.stringify({ ...dirty, workspaceDir: latestRuntimeWorkspace, appliedAt: new Date().toISOString() }, null, 2)}
|
|
10974
10985
|
`, "utf8");
|
|
10975
10986
|
}
|
|
10976
10987
|
appendRunLog(context.projectRoot, input.runId, {
|
|
@@ -11880,7 +11891,7 @@ async function executeTest(context, args) {
|
|
|
11880
11891
|
|
|
11881
11892
|
// packages/cli/src/commands/setup.ts
|
|
11882
11893
|
init_runner();
|
|
11883
|
-
import { existsSync as existsSync16, mkdirSync as mkdirSync10, readdirSync as readdirSync3, writeFileSync as
|
|
11894
|
+
import { existsSync as existsSync16, mkdirSync as mkdirSync10, readdirSync as readdirSync3, writeFileSync as writeFileSync8 } from "fs";
|
|
11884
11895
|
import { resolve as resolve24 } from "path";
|
|
11885
11896
|
import { createPluginHost } from "@rig/core";
|
|
11886
11897
|
import {
|
|
@@ -11941,7 +11952,7 @@ function runSetupInit(projectRoot) {
|
|
|
11941
11952
|
mkdirSync10(artifactsDir, { recursive: true });
|
|
11942
11953
|
const failuresPath = resolve24(stateDir, "failed_approaches.md");
|
|
11943
11954
|
if (!existsSync16(failuresPath)) {
|
|
11944
|
-
|
|
11955
|
+
writeFileSync8(failuresPath, `# Failed Approaches
|
|
11945
11956
|
|
|
11946
11957
|
`, "utf-8");
|
|
11947
11958
|
}
|
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.72",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Rig package",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -24,13 +24,13 @@
|
|
|
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.
|
|
28
|
-
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.
|
|
29
|
-
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.
|
|
30
|
-
"@rig/pi-rig": "npm:@h-rig/pi-rig@0.0.6-alpha.
|
|
31
|
-
"@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.
|
|
32
|
-
"@rig/server": "npm:@h-rig/server@0.0.6-alpha.
|
|
33
|
-
"@rig/standard-plugin": "npm:@h-rig/standard-plugin@0.0.6-alpha.
|
|
27
|
+
"@rig/client": "npm:@h-rig/client@0.0.6-alpha.72",
|
|
28
|
+
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.72",
|
|
29
|
+
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.72",
|
|
30
|
+
"@rig/pi-rig": "npm:@h-rig/pi-rig@0.0.6-alpha.72",
|
|
31
|
+
"@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.72",
|
|
32
|
+
"@rig/server": "npm:@h-rig/server@0.0.6-alpha.72",
|
|
33
|
+
"@rig/standard-plugin": "npm:@h-rig/standard-plugin@0.0.6-alpha.72",
|
|
34
34
|
"effect": "4.0.0-beta.78",
|
|
35
35
|
"picocolors": "^1.1.1"
|
|
36
36
|
}
|