style(pi): wrap mode arg lookup

This commit is contained in:
Peter Steinberger
2025-12-11 18:53:32 +00:00
parent 958c13e02d
commit 768887fc0f

View File

@@ -188,7 +188,8 @@ export const piSpec: AgentSpec = {
const argv = [...ctx.argv];
let bodyPos = ctx.bodyIndex;
const modeIdx = argv.indexOf("--mode");
const modeVal = modeIdx >= 0 ? argv[modeIdx + 1]?.toString().toLowerCase() : undefined;
const modeVal =
modeIdx >= 0 ? argv[modeIdx + 1]?.toString().toLowerCase() : undefined;
const isRpcMode = modeVal === "rpc";
// Non-interactive print + JSON
if (!isRpcMode && !argv.includes("-p") && !argv.includes("--print")) {