verify rpc and website gates

This commit is contained in:
Advait Paliwal
2026-04-10 10:49:54 -07:00
parent 4137a29507
commit 790824af20
9 changed files with 759 additions and 52 deletions

View File

@@ -348,6 +348,7 @@ export async function main(): Promise<void> {
"alpha-login": { type: "boolean" },
"alpha-logout": { type: "boolean" },
"alpha-status": { type: "boolean" },
mode: { type: "string" },
model: { type: "string" },
"new-session": { type: "boolean" },
prompt: { type: "string" },
@@ -479,6 +480,10 @@ export async function main(): Promise<void> {
const explicitModelSpec = values.model ?? process.env.FEYNMAN_MODEL;
const explicitServiceTier = normalizeServiceTier(values["service-tier"] ?? process.env.FEYNMAN_SERVICE_TIER);
const mode = values.mode;
if (mode !== undefined && mode !== "text" && mode !== "json" && mode !== "rpc") {
throw new Error("Unknown mode. Use text, json, or rpc.");
}
if ((values["service-tier"] ?? process.env.FEYNMAN_SERVICE_TIER) && !explicitServiceTier) {
throw new Error("Unknown service tier. Use auto, default, flex, priority, or standard_only.");
}
@@ -515,6 +520,7 @@ export async function main(): Promise<void> {
sessionDir,
feynmanAgentDir,
feynmanVersion,
mode,
thinkingLevel,
explicitModelSpec,
oneShotPrompt: values.prompt,

View File

@@ -24,7 +24,7 @@ export async function launchPiChat(options: PiRuntimeOptions): Promise<void> {
throw new Error(`Promise polyfill not found: ${promisePolyfillPath}`);
}
if (process.stdout.isTTY) {
if (process.stdout.isTTY && options.mode !== "rpc") {
process.stdout.write("\x1b[2J\x1b[3J\x1b[H");
}

View File

@@ -15,6 +15,7 @@ export type PiRuntimeOptions = {
sessionDir: string;
feynmanAgentDir: string;
feynmanVersion?: string;
mode?: "text" | "json" | "rpc";
thinkingLevel?: string;
explicitModelSpec?: string;
oneShotPrompt?: string;
@@ -83,6 +84,9 @@ export function buildPiArgs(options: PiRuntimeOptions): string[] {
args.push("--system-prompt", readFileSync(paths.systemPromptPath, "utf8"));
}
if (options.mode) {
args.push("--mode", options.mode);
}
if (options.explicitModelSpec) {
args.push("--model", options.explicitModelSpec);
}