import assert from "node:assert/strict"; import test from "node:test"; import { buildPiLaunchArgs, reasoningArgvLeaksTools, TOOL_PROFILE_REASONING } from "../pi-args.mjs"; test("reasoning profile argv has no read, write, edit, search, or extension", () => { const args = buildPiLaunchArgs({ toolProfile: TOOL_PROFILE_REASONING, provider: "minimax", model: "MiniMax-M3", systemPromptFile: "INSTRUCTIONS.md", extension: "/app/extensions/tavily-search.mjs", workspaceTools: "read,write,edit,tavily_search,web_search", }); assert.equal(args.includes("--no-tools"), true); assert.equal(args.includes("-e"), false); assert.equal(args.includes("--tools"), false); assert.equal(args.includes("--approve"), false); assert.equal(reasoningArgvLeaksTools(args), false); }); test("default profile keeps the workspace tool list", () => { const args = buildPiLaunchArgs({ provider: "minimax", model: "MiniMax-M3", extension: "/app/extensions/tavily-search.mjs", workspaceTools: "read,write,edit,tavily_search,web_search", }); assert.equal(args.includes("--no-tools"), false); assert.deepEqual(args.slice(args.indexOf("--tools"), args.indexOf("--tools") + 2), [ "--tools", "read,write,edit,tavily_search,web_search", ]); }); test("unknown profile does not fall open", () => { assert.throws( () => buildPiLaunchArgs({ toolProfile: "full", provider: "minimax", model: "m" }), (err) => err.code === "UNKNOWN_TOOL_PROFILE", ); });