@h-rig/cli 0.0.6-alpha.93 → 0.0.6-alpha.94
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 +33 -23
- package/dist/src/commands/run.js +33 -23
- package/dist/src/commands.js +33 -23
- package/dist/src/index.js +33 -23
- package/dist/src/operator-cli.js +33 -23
- package/package.json +10 -10
package/dist/bin/rig.js
CHANGED
|
@@ -15660,7 +15660,7 @@ async function executeRun(context, args, deps = {}) {
|
|
|
15660
15660
|
const runs = await listRuns(context.projectRoot);
|
|
15661
15661
|
if (text)
|
|
15662
15662
|
printFormattedOutput(formatRunList(runs.map(toRunLike2)));
|
|
15663
|
-
return { ok: true, group: "run", command, details: { runs: runs.map(toRunLike2) } };
|
|
15663
|
+
return { ok: true, group: "run", command, details: { runs: runs.map(toRunLike2), source: "local" } };
|
|
15664
15664
|
}
|
|
15665
15665
|
case "status": {
|
|
15666
15666
|
requireNoExtraArgs(rest, "rig run status");
|
|
@@ -17531,7 +17531,7 @@ function scanRootCommand(argv) {
|
|
|
17531
17531
|
break;
|
|
17532
17532
|
const kind = preCommandFlagKind(arg);
|
|
17533
17533
|
if (kind === undefined) {
|
|
17534
|
-
return { kind: "command", command: arg, skippedHostOnly, skippedOperatorOnly };
|
|
17534
|
+
return { kind: "command", command: arg, index, skippedHostOnly, skippedOperatorOnly };
|
|
17535
17535
|
}
|
|
17536
17536
|
if (kind === "host")
|
|
17537
17537
|
skippedHostOnly = true;
|
|
@@ -17552,19 +17552,18 @@ function valueAfter(argv, flag) {
|
|
|
17552
17552
|
const value = index >= 0 ? argv[index + 1]?.trim() : undefined;
|
|
17553
17553
|
return value ? value : undefined;
|
|
17554
17554
|
}
|
|
17555
|
-
function explicitRunRoute(
|
|
17556
|
-
const
|
|
17557
|
-
const taskRef = valueAfter(stripped, "--task") ?? stripped.slice(1).find((arg) => !arg.startsWith("-"))?.trim();
|
|
17555
|
+
function explicitRunRoute(runArgs, workspaceRoot) {
|
|
17556
|
+
const taskRef = valueAfter(runArgs, "--task") ?? runArgs.find((arg) => !arg.startsWith("-"))?.trim();
|
|
17558
17557
|
if (!taskRef) {
|
|
17559
|
-
return { kind: "unsupported", argv, message: "Usage: rig run <task> [--title <title>] [--model <model>] [--prompt <prompt>]." };
|
|
17558
|
+
return { kind: "unsupported", argv: runArgs, message: "Usage: rig run <task> [--title <title>] [--model <model>] [--prompt <prompt>]." };
|
|
17560
17559
|
}
|
|
17561
17560
|
return {
|
|
17562
17561
|
kind: "run",
|
|
17563
17562
|
taskRef,
|
|
17564
17563
|
workspaceRoot,
|
|
17565
|
-
title: valueAfter(
|
|
17566
|
-
model: valueAfter(
|
|
17567
|
-
prompt: valueAfter(
|
|
17564
|
+
title: valueAfter(runArgs, "--title"),
|
|
17565
|
+
model: valueAfter(runArgs, "--model"),
|
|
17566
|
+
prompt: valueAfter(runArgs, "--prompt") ?? valueAfter(runArgs, "--initial-prompt")
|
|
17568
17567
|
};
|
|
17569
17568
|
}
|
|
17570
17569
|
function resolveRigRootRoute(argv) {
|
|
@@ -17607,13 +17606,13 @@ function resolveRigRootRoute(argv) {
|
|
|
17607
17606
|
};
|
|
17608
17607
|
}
|
|
17609
17608
|
if (command === "run") {
|
|
17610
|
-
const runArgs = stripRootWorkspace(argv
|
|
17609
|
+
const runArgs = stripRootWorkspace(argv.slice(scanned.index + 1));
|
|
17611
17610
|
const firstRunArg = runArgs[0];
|
|
17612
17611
|
const firstArgIsGroupSubcommand = firstRunArg !== undefined && !firstRunArg.startsWith("-") && isRunGroupInvocation(firstRunArg);
|
|
17613
17612
|
const forcedDispatch = Boolean(process.env.RIG_RUN_ID) || valueAfter(runArgs, "--task") !== undefined && !firstArgIsGroupSubcommand;
|
|
17614
17613
|
const runArg = runArgs.find((arg) => !arg.startsWith("-"));
|
|
17615
17614
|
if (forcedDispatch || !isRunGroupInvocation(runArg))
|
|
17616
|
-
return explicitRunRoute(
|
|
17615
|
+
return explicitRunRoute(runArgs, workspaceRoot);
|
|
17617
17616
|
return workspaceRoot ? { kind: "operator", argv: stripRootWorkspace(argv), workspaceRoot } : { kind: "operator", argv: stripRootWorkspace(argv) };
|
|
17618
17617
|
}
|
|
17619
17618
|
if (isOmpRootCommand(command)) {
|
|
@@ -17779,21 +17778,32 @@ async function runRigRootCli(argv = process.argv.slice(2)) {
|
|
|
17779
17778
|
}
|
|
17780
17779
|
case "run": {
|
|
17781
17780
|
const projectRoot = resolve58(route.workspaceRoot ?? process.cwd());
|
|
17782
|
-
const
|
|
17783
|
-
|
|
17784
|
-
|
|
17785
|
-
|
|
17786
|
-
|
|
17787
|
-
|
|
17788
|
-
|
|
17789
|
-
|
|
17790
|
-
|
|
17781
|
+
const restorePublicIdentityEnv = applyPublicIdentityEnv(projectRoot);
|
|
17782
|
+
try {
|
|
17783
|
+
const { runRunProcess } = await import("@rig/rig-host");
|
|
17784
|
+
await runRunProcess({
|
|
17785
|
+
projectRoot,
|
|
17786
|
+
taskId: route.taskRef,
|
|
17787
|
+
title: route.title,
|
|
17788
|
+
model: route.model,
|
|
17789
|
+
prompt: route.prompt,
|
|
17790
|
+
writeStdout: (text) => process.stdout.write(text)
|
|
17791
|
+
});
|
|
17792
|
+
} finally {
|
|
17793
|
+
restorePublicIdentityEnv();
|
|
17794
|
+
}
|
|
17791
17795
|
return;
|
|
17792
17796
|
}
|
|
17793
17797
|
case "operator": {
|
|
17794
|
-
const
|
|
17795
|
-
const
|
|
17796
|
-
|
|
17798
|
+
const projectRoot = resolve58(route.workspaceRoot ?? process.cwd());
|
|
17799
|
+
const restorePublicIdentityEnv = applyPublicIdentityEnv(projectRoot);
|
|
17800
|
+
try {
|
|
17801
|
+
const { runRigOperatorCli: runRigOperatorCli2 } = await init_operator_cli().then(() => exports_operator_cli);
|
|
17802
|
+
const operatorArgv = route.workspaceRoot ? ["--project", route.workspaceRoot, ...route.argv] : [...route.argv];
|
|
17803
|
+
await runRigOperatorCli2(operatorArgv);
|
|
17804
|
+
} finally {
|
|
17805
|
+
restorePublicIdentityEnv();
|
|
17806
|
+
}
|
|
17797
17807
|
return;
|
|
17798
17808
|
}
|
|
17799
17809
|
case "help":
|
package/dist/src/commands/run.js
CHANGED
|
@@ -17084,7 +17084,7 @@ function scanRootCommand(argv) {
|
|
|
17084
17084
|
break;
|
|
17085
17085
|
const kind = preCommandFlagKind(arg);
|
|
17086
17086
|
if (kind === undefined) {
|
|
17087
|
-
return { kind: "command", command: arg, skippedHostOnly, skippedOperatorOnly };
|
|
17087
|
+
return { kind: "command", command: arg, index, skippedHostOnly, skippedOperatorOnly };
|
|
17088
17088
|
}
|
|
17089
17089
|
if (kind === "host")
|
|
17090
17090
|
skippedHostOnly = true;
|
|
@@ -17105,19 +17105,18 @@ function valueAfter(argv, flag) {
|
|
|
17105
17105
|
const value = index >= 0 ? argv[index + 1]?.trim() : undefined;
|
|
17106
17106
|
return value ? value : undefined;
|
|
17107
17107
|
}
|
|
17108
|
-
function explicitRunRoute(
|
|
17109
|
-
const
|
|
17110
|
-
const taskRef = valueAfter(stripped, "--task") ?? stripped.slice(1).find((arg) => !arg.startsWith("-"))?.trim();
|
|
17108
|
+
function explicitRunRoute(runArgs, workspaceRoot) {
|
|
17109
|
+
const taskRef = valueAfter(runArgs, "--task") ?? runArgs.find((arg) => !arg.startsWith("-"))?.trim();
|
|
17111
17110
|
if (!taskRef) {
|
|
17112
|
-
return { kind: "unsupported", argv, message: "Usage: rig run <task> [--title <title>] [--model <model>] [--prompt <prompt>]." };
|
|
17111
|
+
return { kind: "unsupported", argv: runArgs, message: "Usage: rig run <task> [--title <title>] [--model <model>] [--prompt <prompt>]." };
|
|
17113
17112
|
}
|
|
17114
17113
|
return {
|
|
17115
17114
|
kind: "run",
|
|
17116
17115
|
taskRef,
|
|
17117
17116
|
workspaceRoot,
|
|
17118
|
-
title: valueAfter(
|
|
17119
|
-
model: valueAfter(
|
|
17120
|
-
prompt: valueAfter(
|
|
17117
|
+
title: valueAfter(runArgs, "--title"),
|
|
17118
|
+
model: valueAfter(runArgs, "--model"),
|
|
17119
|
+
prompt: valueAfter(runArgs, "--prompt") ?? valueAfter(runArgs, "--initial-prompt")
|
|
17121
17120
|
};
|
|
17122
17121
|
}
|
|
17123
17122
|
function resolveRigRootRoute(argv) {
|
|
@@ -17160,13 +17159,13 @@ function resolveRigRootRoute(argv) {
|
|
|
17160
17159
|
};
|
|
17161
17160
|
}
|
|
17162
17161
|
if (command === "run") {
|
|
17163
|
-
const runArgs = stripRootWorkspace(argv
|
|
17162
|
+
const runArgs = stripRootWorkspace(argv.slice(scanned.index + 1));
|
|
17164
17163
|
const firstRunArg = runArgs[0];
|
|
17165
17164
|
const firstArgIsGroupSubcommand = firstRunArg !== undefined && !firstRunArg.startsWith("-") && isRunGroupInvocation(firstRunArg);
|
|
17166
17165
|
const forcedDispatch = Boolean(process.env.RIG_RUN_ID) || valueAfter(runArgs, "--task") !== undefined && !firstArgIsGroupSubcommand;
|
|
17167
17166
|
const runArg = runArgs.find((arg) => !arg.startsWith("-"));
|
|
17168
17167
|
if (forcedDispatch || !isRunGroupInvocation(runArg))
|
|
17169
|
-
return explicitRunRoute(
|
|
17168
|
+
return explicitRunRoute(runArgs, workspaceRoot);
|
|
17170
17169
|
return workspaceRoot ? { kind: "operator", argv: stripRootWorkspace(argv), workspaceRoot } : { kind: "operator", argv: stripRootWorkspace(argv) };
|
|
17171
17170
|
}
|
|
17172
17171
|
if (isOmpRootCommand(command)) {
|
|
@@ -17332,21 +17331,32 @@ async function runRigRootCli(argv = process.argv.slice(2)) {
|
|
|
17332
17331
|
}
|
|
17333
17332
|
case "run": {
|
|
17334
17333
|
const projectRoot = resolve58(route.workspaceRoot ?? process.cwd());
|
|
17335
|
-
const
|
|
17336
|
-
|
|
17337
|
-
|
|
17338
|
-
|
|
17339
|
-
|
|
17340
|
-
|
|
17341
|
-
|
|
17342
|
-
|
|
17343
|
-
|
|
17334
|
+
const restorePublicIdentityEnv = applyPublicIdentityEnv(projectRoot);
|
|
17335
|
+
try {
|
|
17336
|
+
const { runRunProcess } = await import("@rig/rig-host");
|
|
17337
|
+
await runRunProcess({
|
|
17338
|
+
projectRoot,
|
|
17339
|
+
taskId: route.taskRef,
|
|
17340
|
+
title: route.title,
|
|
17341
|
+
model: route.model,
|
|
17342
|
+
prompt: route.prompt,
|
|
17343
|
+
writeStdout: (text) => process.stdout.write(text)
|
|
17344
|
+
});
|
|
17345
|
+
} finally {
|
|
17346
|
+
restorePublicIdentityEnv();
|
|
17347
|
+
}
|
|
17344
17348
|
return;
|
|
17345
17349
|
}
|
|
17346
17350
|
case "operator": {
|
|
17347
|
-
const
|
|
17348
|
-
const
|
|
17349
|
-
|
|
17351
|
+
const projectRoot = resolve58(route.workspaceRoot ?? process.cwd());
|
|
17352
|
+
const restorePublicIdentityEnv = applyPublicIdentityEnv(projectRoot);
|
|
17353
|
+
try {
|
|
17354
|
+
const { runRigOperatorCli: runRigOperatorCli2 } = await init_operator_cli().then(() => exports_operator_cli);
|
|
17355
|
+
const operatorArgv = route.workspaceRoot ? ["--project", route.workspaceRoot, ...route.argv] : [...route.argv];
|
|
17356
|
+
await runRigOperatorCli2(operatorArgv);
|
|
17357
|
+
} finally {
|
|
17358
|
+
restorePublicIdentityEnv();
|
|
17359
|
+
}
|
|
17350
17360
|
return;
|
|
17351
17361
|
}
|
|
17352
17362
|
case "help":
|
|
@@ -17568,7 +17578,7 @@ async function executeRun(context, args, deps = {}) {
|
|
|
17568
17578
|
const runs = await listRuns(context.projectRoot);
|
|
17569
17579
|
if (text)
|
|
17570
17580
|
printFormattedOutput(formatRunList(runs.map(toRunLike2)));
|
|
17571
|
-
return { ok: true, group: "run", command, details: { runs: runs.map(toRunLike2) } };
|
|
17581
|
+
return { ok: true, group: "run", command, details: { runs: runs.map(toRunLike2), source: "local" } };
|
|
17572
17582
|
}
|
|
17573
17583
|
case "status": {
|
|
17574
17584
|
requireNoExtraArgs(rest, "rig run status");
|
package/dist/src/commands.js
CHANGED
|
@@ -16013,7 +16013,7 @@ function scanRootCommand(argv) {
|
|
|
16013
16013
|
break;
|
|
16014
16014
|
const kind = preCommandFlagKind(arg);
|
|
16015
16015
|
if (kind === undefined) {
|
|
16016
|
-
return { kind: "command", command: arg, skippedHostOnly, skippedOperatorOnly };
|
|
16016
|
+
return { kind: "command", command: arg, index, skippedHostOnly, skippedOperatorOnly };
|
|
16017
16017
|
}
|
|
16018
16018
|
if (kind === "host")
|
|
16019
16019
|
skippedHostOnly = true;
|
|
@@ -16034,19 +16034,18 @@ function valueAfter(argv, flag) {
|
|
|
16034
16034
|
const value = index >= 0 ? argv[index + 1]?.trim() : undefined;
|
|
16035
16035
|
return value ? value : undefined;
|
|
16036
16036
|
}
|
|
16037
|
-
function explicitRunRoute(
|
|
16038
|
-
const
|
|
16039
|
-
const taskRef = valueAfter(stripped, "--task") ?? stripped.slice(1).find((arg) => !arg.startsWith("-"))?.trim();
|
|
16037
|
+
function explicitRunRoute(runArgs, workspaceRoot) {
|
|
16038
|
+
const taskRef = valueAfter(runArgs, "--task") ?? runArgs.find((arg) => !arg.startsWith("-"))?.trim();
|
|
16040
16039
|
if (!taskRef) {
|
|
16041
|
-
return { kind: "unsupported", argv, message: "Usage: rig run <task> [--title <title>] [--model <model>] [--prompt <prompt>]." };
|
|
16040
|
+
return { kind: "unsupported", argv: runArgs, message: "Usage: rig run <task> [--title <title>] [--model <model>] [--prompt <prompt>]." };
|
|
16042
16041
|
}
|
|
16043
16042
|
return {
|
|
16044
16043
|
kind: "run",
|
|
16045
16044
|
taskRef,
|
|
16046
16045
|
workspaceRoot,
|
|
16047
|
-
title: valueAfter(
|
|
16048
|
-
model: valueAfter(
|
|
16049
|
-
prompt: valueAfter(
|
|
16046
|
+
title: valueAfter(runArgs, "--title"),
|
|
16047
|
+
model: valueAfter(runArgs, "--model"),
|
|
16048
|
+
prompt: valueAfter(runArgs, "--prompt") ?? valueAfter(runArgs, "--initial-prompt")
|
|
16050
16049
|
};
|
|
16051
16050
|
}
|
|
16052
16051
|
function resolveRigRootRoute(argv) {
|
|
@@ -16089,13 +16088,13 @@ function resolveRigRootRoute(argv) {
|
|
|
16089
16088
|
};
|
|
16090
16089
|
}
|
|
16091
16090
|
if (command === "run") {
|
|
16092
|
-
const runArgs = stripRootWorkspace(argv
|
|
16091
|
+
const runArgs = stripRootWorkspace(argv.slice(scanned.index + 1));
|
|
16093
16092
|
const firstRunArg = runArgs[0];
|
|
16094
16093
|
const firstArgIsGroupSubcommand = firstRunArg !== undefined && !firstRunArg.startsWith("-") && isRunGroupInvocation(firstRunArg);
|
|
16095
16094
|
const forcedDispatch = Boolean(process.env.RIG_RUN_ID) || valueAfter(runArgs, "--task") !== undefined && !firstArgIsGroupSubcommand;
|
|
16096
16095
|
const runArg = runArgs.find((arg) => !arg.startsWith("-"));
|
|
16097
16096
|
if (forcedDispatch || !isRunGroupInvocation(runArg))
|
|
16098
|
-
return explicitRunRoute(
|
|
16097
|
+
return explicitRunRoute(runArgs, workspaceRoot);
|
|
16099
16098
|
return workspaceRoot ? { kind: "operator", argv: stripRootWorkspace(argv), workspaceRoot } : { kind: "operator", argv: stripRootWorkspace(argv) };
|
|
16100
16099
|
}
|
|
16101
16100
|
if (isOmpRootCommand(command)) {
|
|
@@ -16261,21 +16260,32 @@ async function runRigRootCli(argv = process.argv.slice(2)) {
|
|
|
16261
16260
|
}
|
|
16262
16261
|
case "run": {
|
|
16263
16262
|
const projectRoot = resolve58(route.workspaceRoot ?? process.cwd());
|
|
16264
|
-
const
|
|
16265
|
-
|
|
16266
|
-
|
|
16267
|
-
|
|
16268
|
-
|
|
16269
|
-
|
|
16270
|
-
|
|
16271
|
-
|
|
16272
|
-
|
|
16263
|
+
const restorePublicIdentityEnv = applyPublicIdentityEnv(projectRoot);
|
|
16264
|
+
try {
|
|
16265
|
+
const { runRunProcess } = await import("@rig/rig-host");
|
|
16266
|
+
await runRunProcess({
|
|
16267
|
+
projectRoot,
|
|
16268
|
+
taskId: route.taskRef,
|
|
16269
|
+
title: route.title,
|
|
16270
|
+
model: route.model,
|
|
16271
|
+
prompt: route.prompt,
|
|
16272
|
+
writeStdout: (text) => process.stdout.write(text)
|
|
16273
|
+
});
|
|
16274
|
+
} finally {
|
|
16275
|
+
restorePublicIdentityEnv();
|
|
16276
|
+
}
|
|
16273
16277
|
return;
|
|
16274
16278
|
}
|
|
16275
16279
|
case "operator": {
|
|
16276
|
-
const
|
|
16277
|
-
const
|
|
16278
|
-
|
|
16280
|
+
const projectRoot = resolve58(route.workspaceRoot ?? process.cwd());
|
|
16281
|
+
const restorePublicIdentityEnv = applyPublicIdentityEnv(projectRoot);
|
|
16282
|
+
try {
|
|
16283
|
+
const { runRigOperatorCli: runRigOperatorCli2 } = await init_operator_cli().then(() => exports_operator_cli);
|
|
16284
|
+
const operatorArgv = route.workspaceRoot ? ["--project", route.workspaceRoot, ...route.argv] : [...route.argv];
|
|
16285
|
+
await runRigOperatorCli2(operatorArgv);
|
|
16286
|
+
} finally {
|
|
16287
|
+
restorePublicIdentityEnv();
|
|
16288
|
+
}
|
|
16279
16289
|
return;
|
|
16280
16290
|
}
|
|
16281
16291
|
case "help":
|
|
@@ -16497,7 +16507,7 @@ async function executeRun(context, args, deps = {}) {
|
|
|
16497
16507
|
const runs = await listRuns(context.projectRoot);
|
|
16498
16508
|
if (text)
|
|
16499
16509
|
printFormattedOutput(formatRunList(runs.map(toRunLike2)));
|
|
16500
|
-
return { ok: true, group: "run", command, details: { runs: runs.map(toRunLike2) } };
|
|
16510
|
+
return { ok: true, group: "run", command, details: { runs: runs.map(toRunLike2), source: "local" } };
|
|
16501
16511
|
}
|
|
16502
16512
|
case "status": {
|
|
16503
16513
|
requireNoExtraArgs(rest, "rig run status");
|
package/dist/src/index.js
CHANGED
|
@@ -16013,7 +16013,7 @@ function scanRootCommand(argv) {
|
|
|
16013
16013
|
break;
|
|
16014
16014
|
const kind = preCommandFlagKind(arg);
|
|
16015
16015
|
if (kind === undefined) {
|
|
16016
|
-
return { kind: "command", command: arg, skippedHostOnly, skippedOperatorOnly };
|
|
16016
|
+
return { kind: "command", command: arg, index, skippedHostOnly, skippedOperatorOnly };
|
|
16017
16017
|
}
|
|
16018
16018
|
if (kind === "host")
|
|
16019
16019
|
skippedHostOnly = true;
|
|
@@ -16034,19 +16034,18 @@ function valueAfter(argv, flag) {
|
|
|
16034
16034
|
const value = index >= 0 ? argv[index + 1]?.trim() : undefined;
|
|
16035
16035
|
return value ? value : undefined;
|
|
16036
16036
|
}
|
|
16037
|
-
function explicitRunRoute(
|
|
16038
|
-
const
|
|
16039
|
-
const taskRef = valueAfter(stripped, "--task") ?? stripped.slice(1).find((arg) => !arg.startsWith("-"))?.trim();
|
|
16037
|
+
function explicitRunRoute(runArgs, workspaceRoot) {
|
|
16038
|
+
const taskRef = valueAfter(runArgs, "--task") ?? runArgs.find((arg) => !arg.startsWith("-"))?.trim();
|
|
16040
16039
|
if (!taskRef) {
|
|
16041
|
-
return { kind: "unsupported", argv, message: "Usage: rig run <task> [--title <title>] [--model <model>] [--prompt <prompt>]." };
|
|
16040
|
+
return { kind: "unsupported", argv: runArgs, message: "Usage: rig run <task> [--title <title>] [--model <model>] [--prompt <prompt>]." };
|
|
16042
16041
|
}
|
|
16043
16042
|
return {
|
|
16044
16043
|
kind: "run",
|
|
16045
16044
|
taskRef,
|
|
16046
16045
|
workspaceRoot,
|
|
16047
|
-
title: valueAfter(
|
|
16048
|
-
model: valueAfter(
|
|
16049
|
-
prompt: valueAfter(
|
|
16046
|
+
title: valueAfter(runArgs, "--title"),
|
|
16047
|
+
model: valueAfter(runArgs, "--model"),
|
|
16048
|
+
prompt: valueAfter(runArgs, "--prompt") ?? valueAfter(runArgs, "--initial-prompt")
|
|
16050
16049
|
};
|
|
16051
16050
|
}
|
|
16052
16051
|
function resolveRigRootRoute(argv) {
|
|
@@ -16089,13 +16088,13 @@ function resolveRigRootRoute(argv) {
|
|
|
16089
16088
|
};
|
|
16090
16089
|
}
|
|
16091
16090
|
if (command === "run") {
|
|
16092
|
-
const runArgs = stripRootWorkspace(argv
|
|
16091
|
+
const runArgs = stripRootWorkspace(argv.slice(scanned.index + 1));
|
|
16093
16092
|
const firstRunArg = runArgs[0];
|
|
16094
16093
|
const firstArgIsGroupSubcommand = firstRunArg !== undefined && !firstRunArg.startsWith("-") && isRunGroupInvocation(firstRunArg);
|
|
16095
16094
|
const forcedDispatch = Boolean(process.env.RIG_RUN_ID) || valueAfter(runArgs, "--task") !== undefined && !firstArgIsGroupSubcommand;
|
|
16096
16095
|
const runArg = runArgs.find((arg) => !arg.startsWith("-"));
|
|
16097
16096
|
if (forcedDispatch || !isRunGroupInvocation(runArg))
|
|
16098
|
-
return explicitRunRoute(
|
|
16097
|
+
return explicitRunRoute(runArgs, workspaceRoot);
|
|
16099
16098
|
return workspaceRoot ? { kind: "operator", argv: stripRootWorkspace(argv), workspaceRoot } : { kind: "operator", argv: stripRootWorkspace(argv) };
|
|
16100
16099
|
}
|
|
16101
16100
|
if (isOmpRootCommand(command)) {
|
|
@@ -16261,21 +16260,32 @@ async function runRigRootCli(argv = process.argv.slice(2)) {
|
|
|
16261
16260
|
}
|
|
16262
16261
|
case "run": {
|
|
16263
16262
|
const projectRoot = resolve58(route.workspaceRoot ?? process.cwd());
|
|
16264
|
-
const
|
|
16265
|
-
|
|
16266
|
-
|
|
16267
|
-
|
|
16268
|
-
|
|
16269
|
-
|
|
16270
|
-
|
|
16271
|
-
|
|
16272
|
-
|
|
16263
|
+
const restorePublicIdentityEnv = applyPublicIdentityEnv(projectRoot);
|
|
16264
|
+
try {
|
|
16265
|
+
const { runRunProcess } = await import("@rig/rig-host");
|
|
16266
|
+
await runRunProcess({
|
|
16267
|
+
projectRoot,
|
|
16268
|
+
taskId: route.taskRef,
|
|
16269
|
+
title: route.title,
|
|
16270
|
+
model: route.model,
|
|
16271
|
+
prompt: route.prompt,
|
|
16272
|
+
writeStdout: (text) => process.stdout.write(text)
|
|
16273
|
+
});
|
|
16274
|
+
} finally {
|
|
16275
|
+
restorePublicIdentityEnv();
|
|
16276
|
+
}
|
|
16273
16277
|
return;
|
|
16274
16278
|
}
|
|
16275
16279
|
case "operator": {
|
|
16276
|
-
const
|
|
16277
|
-
const
|
|
16278
|
-
|
|
16280
|
+
const projectRoot = resolve58(route.workspaceRoot ?? process.cwd());
|
|
16281
|
+
const restorePublicIdentityEnv = applyPublicIdentityEnv(projectRoot);
|
|
16282
|
+
try {
|
|
16283
|
+
const { runRigOperatorCli: runRigOperatorCli2 } = await init_operator_cli().then(() => exports_operator_cli);
|
|
16284
|
+
const operatorArgv = route.workspaceRoot ? ["--project", route.workspaceRoot, ...route.argv] : [...route.argv];
|
|
16285
|
+
await runRigOperatorCli2(operatorArgv);
|
|
16286
|
+
} finally {
|
|
16287
|
+
restorePublicIdentityEnv();
|
|
16288
|
+
}
|
|
16279
16289
|
return;
|
|
16280
16290
|
}
|
|
16281
16291
|
case "help":
|
|
@@ -16497,7 +16507,7 @@ async function executeRun(context, args, deps = {}) {
|
|
|
16497
16507
|
const runs = await listRuns(context.projectRoot);
|
|
16498
16508
|
if (text)
|
|
16499
16509
|
printFormattedOutput(formatRunList(runs.map(toRunLike2)));
|
|
16500
|
-
return { ok: true, group: "run", command, details: { runs: runs.map(toRunLike2) } };
|
|
16510
|
+
return { ok: true, group: "run", command, details: { runs: runs.map(toRunLike2), source: "local" } };
|
|
16501
16511
|
}
|
|
16502
16512
|
case "status": {
|
|
16503
16513
|
requireNoExtraArgs(rest, "rig run status");
|
package/dist/src/operator-cli.js
CHANGED
|
@@ -15668,7 +15668,7 @@ function scanRootCommand(argv) {
|
|
|
15668
15668
|
break;
|
|
15669
15669
|
const kind = preCommandFlagKind(arg);
|
|
15670
15670
|
if (kind === undefined) {
|
|
15671
|
-
return { kind: "command", command: arg, skippedHostOnly, skippedOperatorOnly };
|
|
15671
|
+
return { kind: "command", command: arg, index, skippedHostOnly, skippedOperatorOnly };
|
|
15672
15672
|
}
|
|
15673
15673
|
if (kind === "host")
|
|
15674
15674
|
skippedHostOnly = true;
|
|
@@ -15689,19 +15689,18 @@ function valueAfter(argv, flag) {
|
|
|
15689
15689
|
const value = index >= 0 ? argv[index + 1]?.trim() : undefined;
|
|
15690
15690
|
return value ? value : undefined;
|
|
15691
15691
|
}
|
|
15692
|
-
function explicitRunRoute(
|
|
15693
|
-
const
|
|
15694
|
-
const taskRef = valueAfter(stripped, "--task") ?? stripped.slice(1).find((arg) => !arg.startsWith("-"))?.trim();
|
|
15692
|
+
function explicitRunRoute(runArgs, workspaceRoot) {
|
|
15693
|
+
const taskRef = valueAfter(runArgs, "--task") ?? runArgs.find((arg) => !arg.startsWith("-"))?.trim();
|
|
15695
15694
|
if (!taskRef) {
|
|
15696
|
-
return { kind: "unsupported", argv, message: "Usage: rig run <task> [--title <title>] [--model <model>] [--prompt <prompt>]." };
|
|
15695
|
+
return { kind: "unsupported", argv: runArgs, message: "Usage: rig run <task> [--title <title>] [--model <model>] [--prompt <prompt>]." };
|
|
15697
15696
|
}
|
|
15698
15697
|
return {
|
|
15699
15698
|
kind: "run",
|
|
15700
15699
|
taskRef,
|
|
15701
15700
|
workspaceRoot,
|
|
15702
|
-
title: valueAfter(
|
|
15703
|
-
model: valueAfter(
|
|
15704
|
-
prompt: valueAfter(
|
|
15701
|
+
title: valueAfter(runArgs, "--title"),
|
|
15702
|
+
model: valueAfter(runArgs, "--model"),
|
|
15703
|
+
prompt: valueAfter(runArgs, "--prompt") ?? valueAfter(runArgs, "--initial-prompt")
|
|
15705
15704
|
};
|
|
15706
15705
|
}
|
|
15707
15706
|
function resolveRigRootRoute(argv) {
|
|
@@ -15744,13 +15743,13 @@ function resolveRigRootRoute(argv) {
|
|
|
15744
15743
|
};
|
|
15745
15744
|
}
|
|
15746
15745
|
if (command === "run") {
|
|
15747
|
-
const runArgs = stripRootWorkspace(argv
|
|
15746
|
+
const runArgs = stripRootWorkspace(argv.slice(scanned.index + 1));
|
|
15748
15747
|
const firstRunArg = runArgs[0];
|
|
15749
15748
|
const firstArgIsGroupSubcommand = firstRunArg !== undefined && !firstRunArg.startsWith("-") && isRunGroupInvocation(firstRunArg);
|
|
15750
15749
|
const forcedDispatch = Boolean(process.env.RIG_RUN_ID) || valueAfter(runArgs, "--task") !== undefined && !firstArgIsGroupSubcommand;
|
|
15751
15750
|
const runArg = runArgs.find((arg) => !arg.startsWith("-"));
|
|
15752
15751
|
if (forcedDispatch || !isRunGroupInvocation(runArg))
|
|
15753
|
-
return explicitRunRoute(
|
|
15752
|
+
return explicitRunRoute(runArgs, workspaceRoot);
|
|
15754
15753
|
return workspaceRoot ? { kind: "operator", argv: stripRootWorkspace(argv), workspaceRoot } : { kind: "operator", argv: stripRootWorkspace(argv) };
|
|
15755
15754
|
}
|
|
15756
15755
|
if (isOmpRootCommand(command)) {
|
|
@@ -15916,21 +15915,32 @@ async function runRigRootCli(argv = process.argv.slice(2)) {
|
|
|
15916
15915
|
}
|
|
15917
15916
|
case "run": {
|
|
15918
15917
|
const projectRoot = resolve56(route.workspaceRoot ?? process.cwd());
|
|
15919
|
-
const
|
|
15920
|
-
|
|
15921
|
-
|
|
15922
|
-
|
|
15923
|
-
|
|
15924
|
-
|
|
15925
|
-
|
|
15926
|
-
|
|
15927
|
-
|
|
15918
|
+
const restorePublicIdentityEnv = applyPublicIdentityEnv(projectRoot);
|
|
15919
|
+
try {
|
|
15920
|
+
const { runRunProcess } = await import("@rig/rig-host");
|
|
15921
|
+
await runRunProcess({
|
|
15922
|
+
projectRoot,
|
|
15923
|
+
taskId: route.taskRef,
|
|
15924
|
+
title: route.title,
|
|
15925
|
+
model: route.model,
|
|
15926
|
+
prompt: route.prompt,
|
|
15927
|
+
writeStdout: (text) => process.stdout.write(text)
|
|
15928
|
+
});
|
|
15929
|
+
} finally {
|
|
15930
|
+
restorePublicIdentityEnv();
|
|
15931
|
+
}
|
|
15928
15932
|
return;
|
|
15929
15933
|
}
|
|
15930
15934
|
case "operator": {
|
|
15931
|
-
const
|
|
15932
|
-
const
|
|
15933
|
-
|
|
15935
|
+
const projectRoot = resolve56(route.workspaceRoot ?? process.cwd());
|
|
15936
|
+
const restorePublicIdentityEnv = applyPublicIdentityEnv(projectRoot);
|
|
15937
|
+
try {
|
|
15938
|
+
const { runRigOperatorCli } = await init_operator_cli().then(() => exports_operator_cli);
|
|
15939
|
+
const operatorArgv = route.workspaceRoot ? ["--project", route.workspaceRoot, ...route.argv] : [...route.argv];
|
|
15940
|
+
await runRigOperatorCli(operatorArgv);
|
|
15941
|
+
} finally {
|
|
15942
|
+
restorePublicIdentityEnv();
|
|
15943
|
+
}
|
|
15934
15944
|
return;
|
|
15935
15945
|
}
|
|
15936
15946
|
case "help":
|
|
@@ -16152,7 +16162,7 @@ async function executeRun(context, args, deps = {}) {
|
|
|
16152
16162
|
const runs = await listRuns(context.projectRoot);
|
|
16153
16163
|
if (text)
|
|
16154
16164
|
printFormattedOutput(formatRunList(runs.map(toRunLike2)));
|
|
16155
|
-
return { ok: true, group: "run", command, details: { runs: runs.map(toRunLike2) } };
|
|
16165
|
+
return { ok: true, group: "run", command, details: { runs: runs.map(toRunLike2), source: "local" } };
|
|
16156
16166
|
}
|
|
16157
16167
|
case "status": {
|
|
16158
16168
|
requireNoExtraArgs(rest, "rig run status");
|
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.94",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Rig CLI launcher for upstream OMP collab; legacy operator entrypoints are retired.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"@oh-my-pi/pi-coding-agent": "16.0.4",
|
|
29
29
|
"@oh-my-pi/pi-tui": "16.0.4",
|
|
30
30
|
"@oh-my-pi/pi-utils": "16.0.4",
|
|
31
|
-
"@rig/client": "npm:@h-rig/client@0.0.6-alpha.
|
|
32
|
-
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.
|
|
33
|
-
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.
|
|
34
|
-
"@rig/relay-registry": "npm:@h-rig/relay-registry@0.0.6-alpha.
|
|
35
|
-
"@rig/rig-extension": "npm:@h-rig/rig-extension@0.0.6-alpha.
|
|
36
|
-
"@rig/rig-host": "npm:@h-rig/rig-host@0.0.6-alpha.
|
|
37
|
-
"@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.
|
|
38
|
-
"@rig/shared": "npm:@h-rig/shared@0.0.6-alpha.
|
|
39
|
-
"@rig/standard-plugin": "npm:@h-rig/standard-plugin@0.0.6-alpha.
|
|
31
|
+
"@rig/client": "npm:@h-rig/client@0.0.6-alpha.94",
|
|
32
|
+
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.94",
|
|
33
|
+
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.94",
|
|
34
|
+
"@rig/relay-registry": "npm:@h-rig/relay-registry@0.0.6-alpha.94",
|
|
35
|
+
"@rig/rig-extension": "npm:@h-rig/rig-extension@0.0.6-alpha.94",
|
|
36
|
+
"@rig/rig-host": "npm:@h-rig/rig-host@0.0.6-alpha.94",
|
|
37
|
+
"@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.94",
|
|
38
|
+
"@rig/shared": "npm:@h-rig/shared@0.0.6-alpha.94",
|
|
39
|
+
"@rig/standard-plugin": "npm:@h-rig/standard-plugin@0.0.6-alpha.94",
|
|
40
40
|
"@xterm/headless": "^6.0.0",
|
|
41
41
|
"effect": "4.0.0-beta.78",
|
|
42
42
|
"picocolors": "^1.1.1",
|