feat: update webui extensions, models, and agent config
Some checks failed
CI / build-check-test (push) Has been cancelled
npm audit / audit (push) Has been cancelled

This commit is contained in:
2026-06-10 21:45:53 +08:00
parent cf5edd6394
commit d51a055d78
64 changed files with 3238 additions and 1665 deletions

View File

@@ -45,12 +45,25 @@ export function createWebUiPaths(): WebUiPaths {
};
}
export function resolvePiRpcLaunch(paths: WebUiPaths): { command: string; args: string[]; mode: "dist" } {
export type PiRpcLaunchMode = "dist" | "tsx";
export function resolvePiRpcLaunch(
paths: WebUiPaths,
): { command: string; args: string[]; mode: PiRpcLaunchMode } {
const rpcArgs = ["--mode", "rpc"];
if (!existsSync(paths.piCliDist)) {
throw new Error(
`[webui] 构建版 sproutclaw 未找到: ${paths.piCliDist}。请先运行: sproutclaw build`,
);
if (existsSync(paths.piCliDist)) {
return { command: process.execPath, args: [paths.piCliDist, ...rpcArgs], mode: "dist" };
}
return { command: process.execPath, args: [paths.piCliDist, ...rpcArgs], mode: "dist" };
const tsxCli = join(paths.repoRoot, "node_modules", "tsx", "dist", "cli.mjs");
const piCliSrc = join(paths.repoRoot, "packages", "coding-agent", "src", "cli.ts");
if (existsSync(tsxCli) && existsSync(piCliSrc)) {
return { command: process.execPath, args: [tsxCli, piCliSrc, ...rpcArgs], mode: "tsx" };
}
const buildHint =
process.platform === "win32"
? "请先运行: npm run build 或 pi-built.bat"
: "请先运行: npm run build 或 sproutclaw build";
throw new Error(`[webui] pi 未找到: ${paths.piCliDist}${buildHint}`);
}