@code-yeongyu/senpi 2026.9.23-5 → 2026.9.24
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/CHANGELOG.md +14 -0
- package/dist/bundle/chunks/{app-server-command-BGT65PGC.js → app-server-command-WZTNEGBB.js} +1 -1
- package/dist/bundle/chunks/chunk-5NTVESIU.js +8 -0
- package/dist/bundle/chunks/{chunk-RRSND33J.js → chunk-NPPJJR72.js} +4 -4
- package/dist/bundle/chunks/{cli-main-W55CWPEI.js → cli-main-PYD5JQVS.js} +1 -1
- package/dist/bundle/chunks/{interactive-mode-EDJZ4CSY.js → interactive-mode-O2JPPZSV.js} +1 -1
- package/dist/bundle/chunks/{multi-session-host-GFSDQQUJ.js → multi-session-host-ER3UZ2EF.js} +1 -1
- package/dist/bundle/chunks/{package-manager-cli-J7244EJE.js → package-manager-cli-DRWJZ4QO.js} +1 -1
- package/dist/bundle/chunks/{rpc-mode-75CRTY24.js → rpc-mode-GXCVL2WY.js} +1 -1
- package/dist/bundle/chunks/session-worker.js +4 -4
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/core/extensions/builtin/recommended-models/index.d.ts +1 -1
- package/dist/core/extensions/builtin/recommended-models/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/recommended-models/index.js +28 -10
- package/dist/core/extensions/builtin/recommended-models/index.js.map +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +12 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +30 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +30 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/minimax.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/moonshotai-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/moonshotai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opengateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/venice.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +7 -7
- package/dist/bundle/chunks/chunk-LTIMMSDM.js +0 -8
package/dist/bundle/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url); { const __piWorkerThreads = require("node:worker_threads"); if (typeof __piWorkerThreads.markAsUncloneable !== "function") { __piWorkerThreads.markAsUncloneable = () => {}; } }
|
|
3
|
-
import{enableStartupCompileCache}from"./chunks/chunk-F73COJ7R.js";import{getLatestPiRelease,hasInheritedInspectorOption,isNewerPackageVersion,releaseInheritedInspectorForChild}from"./chunks/chunk-34HMVB33.js";import"./chunks/chunk-ZOFZRJSL.js";import"./chunks/chunk-2SOVDETB.js";import{APP_NAME,DISPLAY_VERSION,PACKAGE_NAME,VERSION,brandProfile,getAgentDir,getPackageDir,getSelfUpdateCommand,getSelfUpdateUnavailableInstruction,isBundledNode}from"./chunks/chunk-Y65WFI5H.js";import"./chunks/chunk-ATQFN5HI.js";import"./chunks/chunk-IKOFCODM.js";import{spawn as spawn2,spawnSync}from"node:child_process";import{existsSync,realpathSync}from"node:fs";import{join as join2}from"node:path";import{fileURLToPath}from"node:url";import{homedir as osHomedir}from"node:os";import{posix,win32}from"node:path";var RUNTIME_ENV_VAR="SENPI_RUNTIME";function normalize(path){return path.replaceAll("\\","/")}function paths(options){return options.platform==="win32"?win32:posix}function bunRoot(options){let configured=options.env.BUN_INSTALL;return configured!==void 0&&configured.trim()!==""?configured:paths(options).join(options.homedir,".bun")}function resolveOrSelf(path,options){try{return options.realpath(path)}catch{return path}}function isUnderBunGlobalTree(scriptRealPath,options){let globalRoot=paths(options).join(bunRoot(options),"install","global"),script=normalize(scriptRealPath);for(let candidate of new Set([globalRoot,resolveOrSelf(globalRoot,options)]))if(script.startsWith(`${normalize(candidate)}/`))return!0;return!1}function bunExecutableName(options){return options.platform==="win32"?"bun.exe":"bun"}function pathCandidateNames(options){if(options.platform!=="win32")return["bun"];let extensions=(options.env.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";").map(extension=>extension.trim()).filter(extension=>extension.length>0);return extensions.length>0?extensions.map(extension=>`bun${extension}`):["bun.exe"]}function findBunBinary(options){let path=paths(options),executable=bunExecutableName(options),rootCandidates=[path.join(bunRoot(options),"bin",executable),path.join(options.homedir,".bun","bin",executable)];for(let candidate of rootCandidates)if(options.exists(candidate))return candidate;let pathValue=options.env.PATH??options.env.Path;if(pathValue===void 0||pathValue==="")return;let names=pathCandidateNames(options);for(let directory of pathValue.split(path.delimiter))if(directory!=="")for(let name of names){let candidate=path.join(directory,name);if(options.exists(candidate))return candidate}}function readRuntimePin(options){let value=options.env[RUNTIME_ENV_VAR];if(value==="node"||value==="bun")return value}function resolveBunReexec(input){if(input.versions.bun!==void 0)return{action:"stay",reason:"already-bun"};let pinned=readRuntimePin(input.options);if(pinned==="node")return{action:"stay",reason:"runtime-pinned-node"};if(input.hasInheritedInspectorOption)return{action:"stay",reason:"inspector"};if(!(pinned==="bun"||isUnderBunGlobalTree(input.scriptRealPath,input.options)))return{action:"stay",reason:"not-bun-install"};let bunPath=findBunBinary(input.options);return bunPath===void 0?{action:"stay",reason:"bun-not-found"}:{action:"reexec",bunPath}}function processBunRuntimeOptions(exists,realpath){return{env:process.env,homedir:osHomedir(),platform:process.platform,exists,realpath}}import{spawn}from"node:child_process";import{readFileSync}from"node:fs";import{join}from"node:path";function parseBootstrapSelfUpdateArgs(args2){let[command,...rest]=args2;if(command!=="update")return;let force=!1,selfFlag=!1,extensionsFlag=!1,extensionFlag=!1,source;for(let index=0;index<rest.length;index++){let arg=rest[index];if(arg==="-h"||arg==="--help")return;if(arg==="--force"){force=!0;continue}if(arg==="--self"){selfFlag=!0;continue}if(arg==="--extensions"){extensionsFlag=!0;continue}if(arg==="--extension"){extensionFlag=!0,index++;continue}if(arg.startsWith("-")||source)return;source=arg}if(extensionFlag)return;let sourceIsSelf=source==="self"||source==="pi"||source===APP_NAME;if(!(source&&!sourceIsSelf)&&!(!selfFlag&&!sourceIsSelf&&extensionsFlag))return{force}}function getObjectProperty(value,key){if(!(!value||typeof value!="object"))return Object.getOwnPropertyDescriptor(value,key)?.value}function readConfiguredNpmCommand(){try{let parsed=JSON.parse(readFileSync(join(getAgentDir(),"settings.json"),"utf-8")),npmCommand=getObjectProperty(parsed,"npmCommand");return!Array.isArray(npmCommand)||npmCommand.some(part=>typeof part!="string")?void 0:npmCommand.length>0?npmCommand:void 0}catch{return}}async function runCommand(step){await new Promise((resolve,reject)=>{let child=spawn(step.command,step.args,{stdio:"inherit"});child.on("error",error=>{reject(error)}),child.on("close",(code,signal)=>{code===0?resolve():reject(signal?new Error(`${step.display} terminated by signal ${signal}`):new Error(`${step.display} exited with code ${code??"unknown"}`))})})}async function handleBootstrapSelfUpdate(args2,dependencies={}){let parsed=parseBootstrapSelfUpdateArgs(args2);if(!parsed)return!1;let writeStdout=dependencies.writeStdout??(line=>console.log(line)),writeStderr=dependencies.writeStderr??(line=>console.error(line)),readNpmCommand=dependencies.readNpmCommand??readConfiguredNpmCommand,resolveSelfUpdateCommand=dependencies.getSelfUpdateCommand??getSelfUpdateCommand,resolveUnavailableInstruction=dependencies.getUnavailableInstruction??getSelfUpdateUnavailableInstruction,executeCommand=dependencies.runCommand??runCommand,brandUpdate=brandProfile()?.update;if(brandUpdate)return writeStdout(`${APP_NAME} ships inside ${brandUpdate.packageName}. Update it with: ${brandUpdate.command}`),!0;let loadLatestRelease=dependencies.getLatestRelease??getLatestPiRelease,latestRelease;if(!parsed.force)try{latestRelease=await loadLatestRelease(VERSION)}catch{latestRelease=void 0}let updatePackageName=latestRelease?.packageName??PACKAGE_NAME;if(!(parsed.force||!latestRelease||updatePackageName!==PACKAGE_NAME||isNewerPackageVersion(latestRelease.version,VERSION)))return writeStdout(`${APP_NAME} is already up to date (v${VERSION})`),!0;let npmCommand=readNpmCommand(),selfUpdateCommand=resolveSelfUpdateCommand(PACKAGE_NAME,npmCommand,updatePackageName);if(!selfUpdateCommand)return writeStderr(`error: ${APP_NAME} cannot self-update this installation.`),writeStderr(resolveUnavailableInstruction(PACKAGE_NAME,npmCommand,updatePackageName)),process.argv[1]&&(writeStderr(""),writeStderr(`Location of ${APP_NAME} executable: ${process.argv[1]}`)),process.exitCode=1,!0;latestRelease?.note?.trim()&&(writeStdout(""),writeStdout("Update note"),writeStdout(latestRelease.note.trim()),writeStdout("")),writeStdout(`Updating ${APP_NAME} with ${selfUpdateCommand.display}...`);for(let step of selfUpdateCommand.steps??[selfUpdateCommand])try{await executeCommand(step)}catch(error){let message=error instanceof Error?error.message:"Unknown package command error";return writeStderr(`Error: ${message}`),writeStderr(`If this keeps failing, run this command yourself: ${selfUpdateCommand.display}`),process.exitCode=1,!0}return writeStdout(`Updated ${APP_NAME}`),!0}function reexecUnderBunIfNeeded(){let options=processBunRuntimeOptions(existsSync,realpathSync),scriptRealPath=process.argv[1]??fileURLToPath(import.meta.url);try{scriptRealPath=realpathSync(scriptRealPath)}catch{}let decision=resolveBunReexec({scriptRealPath,versions:process.versions,hasInheritedInspectorOption:hasInheritedInspectorOption(),options});if(decision.action==="stay")return!1;let result=spawnSync(decision.bunPath,[scriptRealPath,...process.argv.slice(2)],{stdio:"inherit",windowsHide:!0});return result.signal?(process.kill(process.pid,result.signal),!0):(process.exitCode=result.status??1,!0)}reexecUnderBunIfNeeded()&&process.exit();enableStartupCompileCache();process.title=APP_NAME;process.env.PI_CODING_AGENT="true";process.env.AI_AGENT=APP_NAME;process.emitWarning=(()=>{});var args=process.argv.slice(2),PACKAGE_COMMANDS=new Set(["install","remove","uninstall","update","list","config"]);function isRootCommand(args2){let firstArg=args2[0];return firstArg===void 0||!PACKAGE_COMMANDS.has(firstArg)}function isPackageManagerInstall(packageDir){return packageDir.replace(/\\/g,"/").includes("/node_modules/@code-yeongyu/senpi")}function isMissingBundledWorkspaceDependencies(packageDir){return isPackageManagerInstall(packageDir)?["pi-agent-core","pi-ai","pi-tui"].some(name=>!existsSync(join2(packageDir,"node_modules","@earendil-works",name,"dist","index.js"))):!1}var ISOLATED_CHILD_ENV="SENPI_CLI_ISOLATED_CHILD";function requiresIsolatedProcess(){return process.env[ISOLATED_CHILD_ENV]==="1"?!1:process.execArgv.length>0||hasInheritedInspectorOption()}async function spawnFullCli(){let extension=import.meta.url.endsWith(".ts")?".ts":".js",fullCliPath=isBundledNode?fileURLToPath(import.meta.url):fileURLToPath(new URL(`./cli-main${extension}`,import.meta.url));releaseInheritedInspectorForChild();let childEnvironment=isBundledNode?{...process.env,[ISOLATED_CHILD_ENV]:"1"}:process.env;return await new Promise((resolve,reject)=>{let child=spawn2(process.execPath,[...process.execArgv,fullCliPath,...args],{env:childEnvironment,stdio:"inherit"});child.on("error",error=>{reject(error)}),child.on("close",(code,signal)=>{if(signal){process.kill(process.pid,signal),resolve(1);return}resolve(code??1)})})}isRootCommand(args)&&(args.includes("--version")||args.includes("-v"))&&(console.log(DISPLAY_VERSION),process.exit());if(isRootCommand(args)&&args.some(arg=>arg==="--help"||arg==="-h")){let{tryPrintHelpWithoutEngine}=await import("./chunks/help-fast-path-QXVCHTP3.js");tryPrintHelpWithoutEngine(args)&&process.exit()}isMissingBundledWorkspaceDependencies(getPackageDir())&&await handleBootstrapSelfUpdate(args)&&process.exit();requiresIsolatedProcess()?process.exitCode=await spawnFullCli():await import("./chunks/cli-main-
|
|
3
|
+
import{enableStartupCompileCache}from"./chunks/chunk-F73COJ7R.js";import{getLatestPiRelease,hasInheritedInspectorOption,isNewerPackageVersion,releaseInheritedInspectorForChild}from"./chunks/chunk-34HMVB33.js";import"./chunks/chunk-ZOFZRJSL.js";import"./chunks/chunk-2SOVDETB.js";import{APP_NAME,DISPLAY_VERSION,PACKAGE_NAME,VERSION,brandProfile,getAgentDir,getPackageDir,getSelfUpdateCommand,getSelfUpdateUnavailableInstruction,isBundledNode}from"./chunks/chunk-Y65WFI5H.js";import"./chunks/chunk-ATQFN5HI.js";import"./chunks/chunk-IKOFCODM.js";import{spawn as spawn2,spawnSync}from"node:child_process";import{existsSync,realpathSync}from"node:fs";import{join as join2}from"node:path";import{fileURLToPath}from"node:url";import{homedir as osHomedir}from"node:os";import{posix,win32}from"node:path";var RUNTIME_ENV_VAR="SENPI_RUNTIME";function normalize(path){return path.replaceAll("\\","/")}function paths(options){return options.platform==="win32"?win32:posix}function bunRoot(options){let configured=options.env.BUN_INSTALL;return configured!==void 0&&configured.trim()!==""?configured:paths(options).join(options.homedir,".bun")}function resolveOrSelf(path,options){try{return options.realpath(path)}catch{return path}}function isUnderBunGlobalTree(scriptRealPath,options){let globalRoot=paths(options).join(bunRoot(options),"install","global"),script=normalize(scriptRealPath);for(let candidate of new Set([globalRoot,resolveOrSelf(globalRoot,options)]))if(script.startsWith(`${normalize(candidate)}/`))return!0;return!1}function bunExecutableName(options){return options.platform==="win32"?"bun.exe":"bun"}function pathCandidateNames(options){if(options.platform!=="win32")return["bun"];let extensions=(options.env.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";").map(extension=>extension.trim()).filter(extension=>extension.length>0);return extensions.length>0?extensions.map(extension=>`bun${extension}`):["bun.exe"]}function findBunBinary(options){let path=paths(options),executable=bunExecutableName(options),rootCandidates=[path.join(bunRoot(options),"bin",executable),path.join(options.homedir,".bun","bin",executable)];for(let candidate of rootCandidates)if(options.exists(candidate))return candidate;let pathValue=options.env.PATH??options.env.Path;if(pathValue===void 0||pathValue==="")return;let names=pathCandidateNames(options);for(let directory of pathValue.split(path.delimiter))if(directory!=="")for(let name of names){let candidate=path.join(directory,name);if(options.exists(candidate))return candidate}}function readRuntimePin(options){let value=options.env[RUNTIME_ENV_VAR];if(value==="node"||value==="bun")return value}function resolveBunReexec(input){if(input.versions.bun!==void 0)return{action:"stay",reason:"already-bun"};let pinned=readRuntimePin(input.options);if(pinned==="node")return{action:"stay",reason:"runtime-pinned-node"};if(input.hasInheritedInspectorOption)return{action:"stay",reason:"inspector"};if(!(pinned==="bun"||isUnderBunGlobalTree(input.scriptRealPath,input.options)))return{action:"stay",reason:"not-bun-install"};let bunPath=findBunBinary(input.options);return bunPath===void 0?{action:"stay",reason:"bun-not-found"}:{action:"reexec",bunPath}}function processBunRuntimeOptions(exists,realpath){return{env:process.env,homedir:osHomedir(),platform:process.platform,exists,realpath}}import{spawn}from"node:child_process";import{readFileSync}from"node:fs";import{join}from"node:path";function parseBootstrapSelfUpdateArgs(args2){let[command,...rest]=args2;if(command!=="update")return;let force=!1,selfFlag=!1,extensionsFlag=!1,extensionFlag=!1,source;for(let index=0;index<rest.length;index++){let arg=rest[index];if(arg==="-h"||arg==="--help")return;if(arg==="--force"){force=!0;continue}if(arg==="--self"){selfFlag=!0;continue}if(arg==="--extensions"){extensionsFlag=!0;continue}if(arg==="--extension"){extensionFlag=!0,index++;continue}if(arg.startsWith("-")||source)return;source=arg}if(extensionFlag)return;let sourceIsSelf=source==="self"||source==="pi"||source===APP_NAME;if(!(source&&!sourceIsSelf)&&!(!selfFlag&&!sourceIsSelf&&extensionsFlag))return{force}}function getObjectProperty(value,key){if(!(!value||typeof value!="object"))return Object.getOwnPropertyDescriptor(value,key)?.value}function readConfiguredNpmCommand(){try{let parsed=JSON.parse(readFileSync(join(getAgentDir(),"settings.json"),"utf-8")),npmCommand=getObjectProperty(parsed,"npmCommand");return!Array.isArray(npmCommand)||npmCommand.some(part=>typeof part!="string")?void 0:npmCommand.length>0?npmCommand:void 0}catch{return}}async function runCommand(step){await new Promise((resolve,reject)=>{let child=spawn(step.command,step.args,{stdio:"inherit"});child.on("error",error=>{reject(error)}),child.on("close",(code,signal)=>{code===0?resolve():reject(signal?new Error(`${step.display} terminated by signal ${signal}`):new Error(`${step.display} exited with code ${code??"unknown"}`))})})}async function handleBootstrapSelfUpdate(args2,dependencies={}){let parsed=parseBootstrapSelfUpdateArgs(args2);if(!parsed)return!1;let writeStdout=dependencies.writeStdout??(line=>console.log(line)),writeStderr=dependencies.writeStderr??(line=>console.error(line)),readNpmCommand=dependencies.readNpmCommand??readConfiguredNpmCommand,resolveSelfUpdateCommand=dependencies.getSelfUpdateCommand??getSelfUpdateCommand,resolveUnavailableInstruction=dependencies.getUnavailableInstruction??getSelfUpdateUnavailableInstruction,executeCommand=dependencies.runCommand??runCommand,brandUpdate=brandProfile()?.update;if(brandUpdate)return writeStdout(`${APP_NAME} ships inside ${brandUpdate.packageName}. Update it with: ${brandUpdate.command}`),!0;let loadLatestRelease=dependencies.getLatestRelease??getLatestPiRelease,latestRelease;if(!parsed.force)try{latestRelease=await loadLatestRelease(VERSION)}catch{latestRelease=void 0}let updatePackageName=latestRelease?.packageName??PACKAGE_NAME;if(!(parsed.force||!latestRelease||updatePackageName!==PACKAGE_NAME||isNewerPackageVersion(latestRelease.version,VERSION)))return writeStdout(`${APP_NAME} is already up to date (v${VERSION})`),!0;let npmCommand=readNpmCommand(),selfUpdateCommand=resolveSelfUpdateCommand(PACKAGE_NAME,npmCommand,updatePackageName);if(!selfUpdateCommand)return writeStderr(`error: ${APP_NAME} cannot self-update this installation.`),writeStderr(resolveUnavailableInstruction(PACKAGE_NAME,npmCommand,updatePackageName)),process.argv[1]&&(writeStderr(""),writeStderr(`Location of ${APP_NAME} executable: ${process.argv[1]}`)),process.exitCode=1,!0;latestRelease?.note?.trim()&&(writeStdout(""),writeStdout("Update note"),writeStdout(latestRelease.note.trim()),writeStdout("")),writeStdout(`Updating ${APP_NAME} with ${selfUpdateCommand.display}...`);for(let step of selfUpdateCommand.steps??[selfUpdateCommand])try{await executeCommand(step)}catch(error){let message=error instanceof Error?error.message:"Unknown package command error";return writeStderr(`Error: ${message}`),writeStderr(`If this keeps failing, run this command yourself: ${selfUpdateCommand.display}`),process.exitCode=1,!0}return writeStdout(`Updated ${APP_NAME}`),!0}function reexecUnderBunIfNeeded(){let options=processBunRuntimeOptions(existsSync,realpathSync),scriptRealPath=process.argv[1]??fileURLToPath(import.meta.url);try{scriptRealPath=realpathSync(scriptRealPath)}catch{}let decision=resolveBunReexec({scriptRealPath,versions:process.versions,hasInheritedInspectorOption:hasInheritedInspectorOption(),options});if(decision.action==="stay")return!1;let result=spawnSync(decision.bunPath,[scriptRealPath,...process.argv.slice(2)],{stdio:"inherit",windowsHide:!0});return result.signal?(process.kill(process.pid,result.signal),!0):(process.exitCode=result.status??1,!0)}reexecUnderBunIfNeeded()&&process.exit();enableStartupCompileCache();process.title=APP_NAME;process.env.PI_CODING_AGENT="true";process.env.AI_AGENT=APP_NAME;process.emitWarning=(()=>{});var args=process.argv.slice(2),PACKAGE_COMMANDS=new Set(["install","remove","uninstall","update","list","config"]);function isRootCommand(args2){let firstArg=args2[0];return firstArg===void 0||!PACKAGE_COMMANDS.has(firstArg)}function isPackageManagerInstall(packageDir){return packageDir.replace(/\\/g,"/").includes("/node_modules/@code-yeongyu/senpi")}function isMissingBundledWorkspaceDependencies(packageDir){return isPackageManagerInstall(packageDir)?["pi-agent-core","pi-ai","pi-tui"].some(name=>!existsSync(join2(packageDir,"node_modules","@earendil-works",name,"dist","index.js"))):!1}var ISOLATED_CHILD_ENV="SENPI_CLI_ISOLATED_CHILD";function requiresIsolatedProcess(){return process.env[ISOLATED_CHILD_ENV]==="1"?!1:process.execArgv.length>0||hasInheritedInspectorOption()}async function spawnFullCli(){let extension=import.meta.url.endsWith(".ts")?".ts":".js",fullCliPath=isBundledNode?fileURLToPath(import.meta.url):fileURLToPath(new URL(`./cli-main${extension}`,import.meta.url));releaseInheritedInspectorForChild();let childEnvironment=isBundledNode?{...process.env,[ISOLATED_CHILD_ENV]:"1"}:process.env;return await new Promise((resolve,reject)=>{let child=spawn2(process.execPath,[...process.execArgv,fullCliPath,...args],{env:childEnvironment,stdio:"inherit"});child.on("error",error=>{reject(error)}),child.on("close",(code,signal)=>{if(signal){process.kill(process.pid,signal),resolve(1);return}resolve(code??1)})})}isRootCommand(args)&&(args.includes("--version")||args.includes("-v"))&&(console.log(DISPLAY_VERSION),process.exit());if(isRootCommand(args)&&args.some(arg=>arg==="--help"||arg==="-h")){let{tryPrintHelpWithoutEngine}=await import("./chunks/help-fast-path-QXVCHTP3.js");tryPrintHelpWithoutEngine(args)&&process.exit()}isMissingBundledWorkspaceDependencies(getPackageDir())&&await handleBootstrapSelfUpdate(args)&&process.exit();requiresIsolatedProcess()?process.exitCode=await spawnFullCli():await import("./chunks/cli-main-PYD5JQVS.js");
|
package/dist/bundle/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url); { const __piWorkerThreads = require("node:worker_threads"); if (typeof __piWorkerThreads.markAsUncloneable !== "function") { __piWorkerThreads.markAsUncloneable = () => {}; } }
|
|
2
|
-
import{AgentSession,AgentSessionRuntime,ArminComponent,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DefaultResourceLoader,ExtensionEditorComponent,ExtensionRunner,FooterComponent,InteractiveMode,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthSelectorComponent,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageComponent,UserMessageSelectorComponent,buildNoticeBox,calculateContextTokens,classifyRead,collectEntriesForBranchSummary,compact,convertToPng,copyToClipboard,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,createLocalBashOperations,createLsTool,createLsToolDefinition,createPowerShellTool,createReadOnlyTools,createReadTool,createReadToolDefinition,createSyntheticSourceInfo,createWriteTool,createWriteToolDefinition,defineTool,detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions,estimateTokens,findCutPoint,findTurnStartIndex,formatDimensionNote,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getLastAssistantUsage,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isWriteToolResult,kernelToolsStorage,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,noticeEntryRenderer,noticeMessageRenderer,parseFrontmatter,parseSkillBlock,prepareBranchEntries,readStoredCredential,registerReadClassifier,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runPrintMode,serializeConversation,shouldCompact,stripFrontmatter,truncateToVisualLines,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunks/chunk-
|
|
2
|
+
import{AgentSession,AgentSessionRuntime,ArminComponent,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DefaultResourceLoader,ExtensionEditorComponent,ExtensionRunner,FooterComponent,InteractiveMode,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthSelectorComponent,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageComponent,UserMessageSelectorComponent,buildNoticeBox,calculateContextTokens,classifyRead,collectEntriesForBranchSummary,compact,convertToPng,copyToClipboard,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,createLocalBashOperations,createLsTool,createLsToolDefinition,createPowerShellTool,createReadOnlyTools,createReadTool,createReadToolDefinition,createSyntheticSourceInfo,createWriteTool,createWriteToolDefinition,defineTool,detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions,estimateTokens,findCutPoint,findTurnStartIndex,formatDimensionNote,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getLastAssistantUsage,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isWriteToolResult,kernelToolsStorage,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,noticeEntryRenderer,noticeMessageRenderer,parseFrontmatter,parseSkillBlock,prepareBranchEntries,readStoredCredential,registerReadClassifier,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runPrintMode,serializeConversation,shouldCompact,stripFrontmatter,truncateToVisualLines,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunks/chunk-NPPJJR72.js";import{DefaultPackageManager,DynamicBorder,ExtensionInputComponent,ExtensionSelectorComponent,SessionSelectorComponent,keyHint,keyText,rawKeyHint}from"./chunks/chunk-XDSQYM4F.js";import"./chunks/chunk-UYCGOK6M.js";import"./chunks/chunk-BBOQ5H4W.js";import{CURRENT_SESSION_VERSION,DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,RpcClient,RpcClientOpenInFlightError,RpcTransportGoneError,SessionManager,buildContextEntries,buildSessionContext,convertToLlm,formatSize,getLatestCompactionEntry,isTransportGoneError,migrateSessionEntries,parseSessionEntries,sessionEntryToContextMessages,truncateHead,truncateLine,truncateTail}from"./chunks/chunk-PSMTQDII.js";import"./chunks/chunk-GFUZPFHN.js";import{runRpcMode}from"./chunks/chunk-5NTVESIU.js";import{Theme,getLanguageFromPath,getMarkdownTheme,getSelectListTheme,getSettingsListTheme,highlightCode,initTheme}from"./chunks/chunk-WUYBEF7C.js";import{sanitizeTerminalLabel}from"./chunks/chunk-ORCF262V.js";import"./chunks/chunk-EN6KDFY2.js";import{SettingsManager}from"./chunks/chunk-ZEFQYQOU.js";import"./chunks/chunk-YU2P3CAR.js";import"./chunks/chunk-BMX2U22F.js";import{DEFAULT_HOST_LAUNCH_SPEC,HOST_EXIT_ERROR,HOST_EXIT_FALLBACK,HOST_EXIT_OK,HOST_EXIT_REFUSED,HOST_EXIT_USAGE,HostLaunchSpecError,loadHostLaunchSpec,parseHostLaunchSpec,readHostStatus,runHostCommand,runHostRequest}from"./chunks/chunk-DUV3UFKX.js";import{GENERATION_HANDOFF_CAPABILITY,HOST_PROTOCOL_VERSION,HostEnsureRefusedError,PINNED_HOST_CLIENT_CAPABILITIES,REQUIRED_HOST_CAPABILITIES,decideHostAction,ensureHost,handoffHost,parseHostProtocolInfo,probeHost,stopHost}from"./chunks/chunk-3XHWW7SQ.js";import"./chunks/chunk-HH3KJDWA.js";import{createHostDaemonPaths}from"./chunks/chunk-7PANH3NB.js";import{compareEngineOrdinal,engineBuildIdentity,engineBuildIdentityFrom}from"./chunks/chunk-NNHFMZD5.js";import"./chunks/chunk-FIJJKSPL.js";import"./chunks/chunk-H4QOEVS5.js";import"./chunks/chunk-HB35RBP4.js";import"./chunks/chunk-WXIRFRXY.js";import"./chunks/chunk-J3QXPP4T.js";import{getPowerShellConfig,getShellConfig}from"./chunks/chunk-FHXKBENX.js";import"./chunks/chunk-X3T45623.js";import"./chunks/chunk-7X72IACK.js";import"./chunks/chunk-KUPQO7MC.js";import"./chunks/chunk-HKE42SWX.js";import{ProjectTrustStore,hasTrustRequiringProjectResources}from"./chunks/chunk-SUQDU5KM.js";import{parseArgs}from"./chunks/chunk-VKBY4F76.js";import"./chunks/chunk-26UBFF6N.js";import"./chunks/chunk-3RN6BFG2.js";import"./chunks/chunk-L6JO4M6J.js";import"./chunks/chunk-RFB5CBW7.js";import"./chunks/chunk-2VZJTDUX.js";import"./chunks/chunk-KLDLZHHS.js";import"./chunks/chunk-PRC5XIIH.js";import"./chunks/chunk-34HMVB33.js";import"./chunks/chunk-ZOFZRJSL.js";import"./chunks/chunk-2SOVDETB.js";import{CONFIG_DIR_NAME,VERSION,getAgentDir,getDocsPath,getExamplesPath,getPackageDir,getReadmePath}from"./chunks/chunk-Y65WFI5H.js";import"./chunks/chunk-ATQFN5HI.js";import"./chunks/chunk-RBCQOIAD.js";import"./chunks/chunk-X4Q5YSTE.js";import"./chunks/chunk-IXAUDPOK.js";import"./chunks/chunk-XYM54ZWK.js";import"./chunks/chunk-WVGCQOLJ.js";import"./chunks/chunk-BPX6QWPD.js";import"./chunks/chunk-IVYZMSFY.js";import"./chunks/chunk-WDTJ6JKE.js";import"./chunks/chunk-5ROMKDLK.js";import"./chunks/chunk-3W47LTXQ.js";import"./chunks/chunk-DMI55M2N.js";import"./chunks/chunk-BQVVQ2LQ.js";import"./chunks/chunk-IKOFCODM.js";export{AgentSession,AgentSessionRuntime,ArminComponent,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CONFIG_DIR_NAME,CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DEFAULT_HOST_LAUNCH_SPEC,DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,DefaultPackageManager,DefaultResourceLoader,DynamicBorder,ExtensionEditorComponent,ExtensionInputComponent,ExtensionRunner,ExtensionSelectorComponent,FooterComponent,GENERATION_HANDOFF_CAPABILITY,HOST_EXIT_ERROR,HOST_EXIT_FALLBACK,HOST_EXIT_OK,HOST_EXIT_REFUSED,HOST_EXIT_USAGE,HOST_PROTOCOL_VERSION,HostEnsureRefusedError,HostLaunchSpecError,InteractiveMode,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthSelectorComponent,PINNED_HOST_CLIENT_CAPABILITIES,ProjectTrustStore,REQUIRED_HOST_CAPABILITIES,RpcClient,RpcClientOpenInFlightError,RpcTransportGoneError,SessionManager,SessionSelectorComponent,SettingsManager,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,Theme,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageComponent,UserMessageSelectorComponent,VERSION,buildContextEntries,buildNoticeBox,buildSessionContext,calculateContextTokens,classifyRead,collectEntriesForBranchSummary,compact,compareEngineOrdinal,convertToLlm,convertToPng,copyToClipboard,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,createHostDaemonPaths,createLocalBashOperations,createLsTool,createLsToolDefinition,createPowerShellTool,createReadOnlyTools,createReadTool,createReadToolDefinition,createSyntheticSourceInfo,createWriteTool,createWriteToolDefinition,decideHostAction,defineTool,detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions,engineBuildIdentity,engineBuildIdentityFrom,ensureHost,estimateTokens,findCutPoint,findTurnStartIndex,formatDimensionNote,formatSize,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getAgentDir,getDocsPath,getExamplesPath,getLanguageFromPath,getLastAssistantUsage,getLatestCompactionEntry,getMarkdownTheme,getPackageDir,getPowerShellConfig,getReadmePath,getSelectListTheme,getSettingsListTheme,getShellConfig,handoffHost,hasTrustRequiringProjectResources,highlightCode,initTheme,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isTransportGoneError,isWriteToolResult,kernelToolsStorage,keyHint,keyText,loadHostLaunchSpec,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,migrateSessionEntries,noticeEntryRenderer,noticeMessageRenderer,parseArgs,parseFrontmatter,parseHostLaunchSpec,parseHostProtocolInfo,parseSessionEntries,parseSkillBlock,prepareBranchEntries,probeHost,rawKeyHint,readHostStatus,readStoredCredential,registerReadClassifier,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runHostCommand,runHostRequest,runPrintMode,runRpcMode,sanitizeTerminalLabel,serializeConversation,sessionEntryToContextMessages,shouldCompact,stopHost,stripFrontmatter,truncateHead,truncateLine,truncateTail,truncateToVisualLines,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools};
|
package/dist/bundle/rpc-entry.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url); { const __piWorkerThreads = require("node:worker_threads"); if (typeof __piWorkerThreads.markAsUncloneable !== "function") { __piWorkerThreads.markAsUncloneable = () => {}; } }
|
|
3
|
-
import{main}from"./chunks/chunk-
|
|
3
|
+
import{main}from"./chunks/chunk-NPPJJR72.js";import"./chunks/chunk-XDSQYM4F.js";import"./chunks/chunk-UYCGOK6M.js";import"./chunks/chunk-BBOQ5H4W.js";import"./chunks/chunk-PSMTQDII.js";import"./chunks/chunk-GFUZPFHN.js";import"./chunks/chunk-5NTVESIU.js";import"./chunks/chunk-WUYBEF7C.js";import"./chunks/chunk-ORCF262V.js";import"./chunks/chunk-EN6KDFY2.js";import{configureHttpDispatcher}from"./chunks/chunk-ZEFQYQOU.js";import"./chunks/chunk-YU2P3CAR.js";import"./chunks/chunk-BMX2U22F.js";import"./chunks/chunk-DUV3UFKX.js";import"./chunks/chunk-3XHWW7SQ.js";import"./chunks/chunk-HH3KJDWA.js";import"./chunks/chunk-7PANH3NB.js";import"./chunks/chunk-NNHFMZD5.js";import"./chunks/chunk-FIJJKSPL.js";import"./chunks/chunk-H4QOEVS5.js";import"./chunks/chunk-HB35RBP4.js";import"./chunks/chunk-WXIRFRXY.js";import"./chunks/chunk-J3QXPP4T.js";import"./chunks/chunk-FHXKBENX.js";import"./chunks/chunk-X3T45623.js";import"./chunks/chunk-7X72IACK.js";import"./chunks/chunk-KUPQO7MC.js";import"./chunks/chunk-HKE42SWX.js";import"./chunks/chunk-SUQDU5KM.js";import"./chunks/chunk-VKBY4F76.js";import"./chunks/chunk-26UBFF6N.js";import"./chunks/chunk-3RN6BFG2.js";import"./chunks/chunk-L6JO4M6J.js";import"./chunks/chunk-RFB5CBW7.js";import"./chunks/chunk-2VZJTDUX.js";import"./chunks/chunk-KLDLZHHS.js";import"./chunks/chunk-PRC5XIIH.js";import"./chunks/chunk-34HMVB33.js";import"./chunks/chunk-ZOFZRJSL.js";import"./chunks/chunk-2SOVDETB.js";import{APP_NAME,scrubBrandFromEnvironment}from"./chunks/chunk-Y65WFI5H.js";import"./chunks/chunk-ATQFN5HI.js";import"./chunks/chunk-RBCQOIAD.js";import"./chunks/chunk-X4Q5YSTE.js";import"./chunks/chunk-IXAUDPOK.js";import"./chunks/chunk-XYM54ZWK.js";import"./chunks/chunk-WVGCQOLJ.js";import"./chunks/chunk-BPX6QWPD.js";import"./chunks/chunk-IVYZMSFY.js";import"./chunks/chunk-WDTJ6JKE.js";import"./chunks/chunk-5ROMKDLK.js";import"./chunks/chunk-3W47LTXQ.js";import"./chunks/chunk-DMI55M2N.js";import"./chunks/chunk-BQVVQ2LQ.js";import"./chunks/chunk-IKOFCODM.js";process.title=`${APP_NAME}-rpc`;scrubBrandFromEnvironment();process.env.PI_CODING_AGENT="true";process.env.AI_AGENT=APP_NAME;process.emitWarning=(()=>{});configureHttpDispatcher();main(["--mode","rpc",...process.argv.slice(2)]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExtensionAPI } from "../../types.ts";
|
|
2
|
-
export declare const RECOMMENDED_DEFAULT_MODELS: readonly [readonly ["kimi-k3", "max"], readonly ["gpt-6-astra", "
|
|
2
|
+
export declare const RECOMMENDED_DEFAULT_MODELS: readonly [readonly ["claude-opus-5-5", "medium", readonly ["anthropic-subscription", "anthropic", "anthropic-api", "github-copilot", "opencode"]], readonly ["claude-fable-5-1", "xhigh", readonly ["anthropic-subscription", "anthropic", "anthropic-api", "github-copilot", "opencode"]], readonly ["kimi-k3", "max", readonly ["kimi-coding", "kimi-for-coding", "moonshotai", "opencode-go"]], readonly ["gpt-6-astra", "xhigh", readonly ["chatgpt-subscription", "openai", "github-copilot", "opencode"]], readonly ["gpt-6-sol", "medium", readonly ["chatgpt-subscription", "openai", "github-copilot", "opencode"]], readonly ["glm-5.3", "max", readonly ["zai-coding-plan", "opencode-go"]]];
|
|
3
3
|
export declare function canonicalModelId(modelId: string): string;
|
|
4
4
|
export default function recommendedModelsExtension(pi: ExtensionAPI): void;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/recommended-models/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAuC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/recommended-models/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAuC,MAAM,gBAAgB,CAAC;AA0BxF,eAAO,MAAM,0BAA0B,yqBAOgD,CAAC;AAWxF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAcxD;AA8CD,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CA6EzE"}
|
|
@@ -7,16 +7,29 @@ const AUTO_SWITCH_PROVENANCE = new Set([
|
|
|
7
7
|
"first-available",
|
|
8
8
|
]);
|
|
9
9
|
const MODEL_ID_SUFFIXES = ["-ultrafast", "-unlocked", "-256k", "-fast"];
|
|
10
|
+
// Provider lanes ranked like the category and model-profile chains: the subscription lane first.
|
|
11
|
+
// A shipped rung is served ONLY by its ranked lanes, so gateway aggregators (opengateway,
|
|
12
|
+
// openrouter, vercel-ai-gateway) and other resellers are never pulled in. A `recommendedModels`
|
|
13
|
+
// override id outside this table carries no ranking and any provider may serve it.
|
|
14
|
+
const CLAUDE_PROVIDERS = [
|
|
15
|
+
"anthropic-subscription",
|
|
16
|
+
"anthropic",
|
|
17
|
+
"anthropic-api",
|
|
18
|
+
"github-copilot",
|
|
19
|
+
"opencode",
|
|
20
|
+
];
|
|
21
|
+
const KIMI_PROVIDERS = ["kimi-coding", "kimi-for-coding", "moonshotai", "opencode-go"];
|
|
22
|
+
const GPT_PROVIDERS = ["chatgpt-subscription", "openai", "github-copilot", "opencode"];
|
|
23
|
+
const GLM_PROVIDERS = ["zai-coding-plan", "opencode-go"];
|
|
10
24
|
export const RECOMMENDED_DEFAULT_MODELS = [
|
|
11
|
-
["
|
|
12
|
-
["
|
|
13
|
-
["
|
|
14
|
-
["gpt-
|
|
15
|
-
["
|
|
16
|
-
["
|
|
17
|
-
["glm-5.2", "max"],
|
|
25
|
+
["claude-opus-5-5", "medium", CLAUDE_PROVIDERS],
|
|
26
|
+
["claude-fable-5-1", "xhigh", CLAUDE_PROVIDERS],
|
|
27
|
+
["kimi-k3", "max", KIMI_PROVIDERS],
|
|
28
|
+
["gpt-6-astra", "xhigh", GPT_PROVIDERS],
|
|
29
|
+
["gpt-6-sol", "medium", GPT_PROVIDERS],
|
|
30
|
+
["glm-5.3", "max", GLM_PROVIDERS],
|
|
18
31
|
];
|
|
19
|
-
const DEFAULT_RECOMMENDATIONS = RECOMMENDED_DEFAULT_MODELS.map(([modelId, thinkingLevel]) => ({ modelId, thinkingLevel }));
|
|
32
|
+
const DEFAULT_RECOMMENDATIONS = RECOMMENDED_DEFAULT_MODELS.map(([modelId, thinkingLevel, providers]) => ({ modelId, thinkingLevel, providers }));
|
|
20
33
|
const DEFAULT_RECOMMENDATIONS_BY_MODEL_ID = new Map(DEFAULT_RECOMMENDATIONS.map((recommendation) => [recommendation.modelId, recommendation]));
|
|
21
34
|
export function canonicalModelId(modelId) {
|
|
22
35
|
let canonical = modelId.toLowerCase();
|
|
@@ -40,12 +53,17 @@ function recommendationsFor(configuredModelIds) {
|
|
|
40
53
|
return configuredModelIds
|
|
41
54
|
.map(canonicalModelId)
|
|
42
55
|
.filter((modelId) => modelId.length > 0)
|
|
43
|
-
.map((modelId) => DEFAULT_RECOMMENDATIONS_BY_MODEL_ID.get(modelId) ?? { modelId, thinkingLevel: "medium" });
|
|
56
|
+
.map((modelId) => DEFAULT_RECOMMENDATIONS_BY_MODEL_ID.get(modelId) ?? { modelId, thinkingLevel: "medium", providers: [] });
|
|
44
57
|
}
|
|
45
58
|
function findAvailableRecommendation(recommendations, ctx) {
|
|
46
59
|
const available = ctx.modelRegistry.getAvailable().filter((model) => ctx.modelRegistry.hasConfiguredAuth(model));
|
|
47
60
|
for (const recommendation of recommendations) {
|
|
48
|
-
const
|
|
61
|
+
const candidates = available.filter((candidate) => canonicalModelId(candidate.id) === recommendation.modelId);
|
|
62
|
+
const model = recommendation.providers.length === 0
|
|
63
|
+
? candidates[0]
|
|
64
|
+
: recommendation.providers
|
|
65
|
+
.map((provider) => candidates.find((candidate) => candidate.provider === provider))
|
|
66
|
+
.find((candidate) => candidate !== undefined);
|
|
49
67
|
if (model) {
|
|
50
68
|
return { recommendation, model };
|
|
51
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/recommended-models/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,MAAM,SAAS,GAAG,uBAAuB,CAAC;AAC1C,yFAAyF;AACzF,qFAAqF;AACrF,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAA2D;IAChG,kBAAkB;IAClB,iBAAiB;CACjB,CAAC,CAAC;AACH,MAAM,iBAAiB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,CAAU,CAAC;AAEjF,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACzC,CAAC,SAAS,EAAE,KAAK,CAAC;IAClB,CAAC,aAAa,EAAE,MAAM,CAAC;IACvB,CAAC,WAAW,EAAE,QAAQ,CAAC;IACvB,CAAC,aAAa,EAAE,QAAQ,CAAC;IACzB,CAAC,kBAAkB,EAAE,MAAM,CAAC;IAC5B,CAAC,iBAAiB,EAAE,KAAK,CAAC;IAC1B,CAAC,SAAS,EAAE,KAAK,CAAC;CACiD,CAAC;AAIrE,MAAM,uBAAuB,GAAgC,0BAA0B,CAAC,GAAG,CAC1F,CAAC,CAAC,OAAO,EAAE,aAAa,CAAC,EAAE,EAAE,CAAC,CAA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C,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,EAAE,CAAC;YAClD,mCAAmC,CAAC,GAAG,CAAC,CAAC;QAC1C,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type { Api, Model } from \"@earendil-works/pi-ai\";\nimport { SettingsManager } from \"../../../settings-manager.ts\";\nimport type { ExtensionAPI, ExtensionContext, SessionStartEvent } from \"../../types.ts\";\n\nconst FLAG_NAME = \"no-recommended-models\";\n// Only implicit fallbacks auto-switch. A `settings` provenance means the user explicitly\n// configured a system default model, which must be respected rather than overridden.\nconst AUTO_SWITCH_PROVENANCE = new Set<NonNullable<SessionStartEvent[\"initialModelProvenance\"]>>([\n\t\"provider-default\",\n\t\"first-available\",\n]);\nconst MODEL_ID_SUFFIXES = [\"-ultrafast\", \"-unlocked\", \"-256k\", \"-fast\"] as const;\n\nexport const RECOMMENDED_DEFAULT_MODELS = [\n\t[\"kimi-k3\", \"max\"],\n\t[\"gpt-6-astra\", \"high\"],\n\t[\"gpt-6-sol\", \"medium\"],\n\t[\"gpt-5.6-sol\", \"medium\"],\n\t[\"claude-fable-5-1\", \"high\"],\n\t[\"claude-opus-5-5\", \"max\"],\n\t[\"glm-5.2\", \"max\"],\n] as const satisfies ReadonlyArray<readonly [string, ThinkingLevel]>;\n\ntype RecommendedModel = { modelId: string; thinkingLevel: ThinkingLevel };\n\nconst DEFAULT_RECOMMENDATIONS: readonly RecommendedModel[] = RECOMMENDED_DEFAULT_MODELS.map(\n\t([modelId, thinkingLevel]) => ({ modelId, thinkingLevel }),\n);\nconst DEFAULT_RECOMMENDATIONS_BY_MODEL_ID = new Map(\n\tDEFAULT_RECOMMENDATIONS.map((recommendation) => [recommendation.modelId, recommendation]),\n);\n\nexport function canonicalModelId(modelId: string): string {\n\tlet canonical = modelId.toLowerCase();\n\tlet strippedSuffix = true;\n\twhile (strippedSuffix) {\n\t\tstrippedSuffix = false;\n\t\tfor (const suffix of MODEL_ID_SUFFIXES) {\n\t\t\tif (canonical.endsWith(suffix)) {\n\t\t\t\tcanonical = canonical.slice(0, -suffix.length);\n\t\t\t\tstrippedSuffix = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn canonical === \"k3\" ? \"kimi-k3\" : canonical;\n}\n\nfunction recommendationsFor(configuredModelIds: string[] | undefined): readonly RecommendedModel[] {\n\tif (configuredModelIds === undefined) {\n\t\treturn DEFAULT_RECOMMENDATIONS;\n\t}\n\treturn configuredModelIds\n\t\t.map(canonicalModelId)\n\t\t.filter((modelId) => modelId.length > 0)\n\t\t.map(\n\t\t\t(modelId): RecommendedModel =>\n\t\t\t\tDEFAULT_RECOMMENDATIONS_BY_MODEL_ID.get(modelId) ?? { modelId, thinkingLevel: \"medium\" },\n\t\t);\n}\n\nfunction findAvailableRecommendation(\n\trecommendations: readonly RecommendedModel[],\n\tctx: ExtensionContext,\n): { recommendation: RecommendedModel; model: Model<Api> } | undefined {\n\tconst available = ctx.modelRegistry.getAvailable().filter((model) => ctx.modelRegistry.hasConfiguredAuth(model));\n\tfor (const recommendation of recommendations) {\n\t\tconst model = available.find((candidate) => canonicalModelId(candidate.id) === recommendation.modelId);\n\t\tif (model) {\n\t\t\treturn { recommendation, model };\n\t\t}\n\t}\n\treturn undefined;\n}\n\nfunction isRecommended(model: Model<Api> | undefined, recommendations: readonly RecommendedModel[]): boolean {\n\treturn (\n\t\tmodel !== undefined &&\n\t\trecommendations.some((recommendation) => canonicalModelId(model.id) === recommendation.modelId)\n\t);\n}\n\nfunction nonRecommendedModelWarning(model: Model<Api> | undefined): string {\n\treturn `Non-recommended model '${model?.id ?? \"<none>\"}': odd behavior is the default state; a working session is the anomaly.`;\n}\n\nexport default function recommendedModelsExtension(pi: ExtensionAPI): void {\n\tpi.registerFlag(FLAG_NAME, {\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t\tdescription: \"Disable recommended model selection for this run.\",\n\t});\n\n\tlet initialized = false;\n\tlet disabled = false;\n\tlet disarmed = false;\n\tlet automaticSelection = false;\n\tlet warningShown = false;\n\tlet canAutoSwitch = false;\n\tlet recommendations: readonly RecommendedModel[] = DEFAULT_RECOMMENDATIONS;\n\n\tconst warnWhenNoRecommendationIsAvailable = (ctx: ExtensionContext): void => {\n\t\tif (warningShown || findAvailableRecommendation(recommendations, ctx)) {\n\t\t\treturn;\n\t\t}\n\t\twarningShown = true;\n\t\tctx.ui.notify(nonRecommendedModelWarning(ctx.model), \"warning\");\n\t};\n\n\tpi.on(\"session_start\", async (event, ctx) => {\n\t\tif (initialized) {\n\t\t\treturn;\n\t\t}\n\t\tinitialized = true;\n\n\t\tconst settingsManager = SettingsManager.create(ctx.cwd);\n\t\tdisabled = pi.getFlag(FLAG_NAME) === true || settingsManager.getWarnings().offRecommendedModel === true;\n\t\trecommendations = recommendationsFor(settingsManager.getRecommendedModels());\n\t\tcanAutoSwitch =\n\t\t\tctx.mode !== \"app-server\" &&\n\t\t\tevent.initialModelProvenance !== undefined &&\n\t\t\tAUTO_SWITCH_PROVENANCE.has(event.initialModelProvenance);\n\t\tif (disabled || !canAutoSwitch || isRecommended(ctx.model, recommendations)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst target = findAvailableRecommendation(recommendations, ctx);\n\t\tif (!target) {\n\t\t\twarnWhenNoRecommendationIsAvailable(ctx);\n\t\t\treturn;\n\t\t}\n\n\t\tconst persistAsDefault = ctx.mode === \"tui\";\n\t\tautomaticSelection = true;\n\t\ttry {\n\t\t\tconst switched = persistAsDefault ? await pi.setModel(target.model) : await pi.setSessionModel(target.model);\n\t\t\tif (!switched) {\n\t\t\t\twarnWhenNoRecommendationIsAvailable(ctx);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (persistAsDefault) {\n\t\t\t\tpi.setThinkingLevel(target.recommendation.thinkingLevel);\n\t\t\t} else {\n\t\t\t\tpi.setSessionThinkingLevel(target.recommendation.thinkingLevel);\n\t\t\t}\n\t\t\tctx.ui.notify(`Switched to recommended model '${target.model.id}'.`, \"info\");\n\t\t} finally {\n\t\t\tautomaticSelection = false;\n\t\t}\n\t});\n\n\tpi.on(\"model_select\", (event, ctx) => {\n\t\tif (!initialized || disabled || disarmed || automaticSelection || !canAutoSwitch) {\n\t\t\treturn;\n\t\t}\n\t\tif (event.source === \"set\" || event.source === \"cycle\") {\n\t\t\tdisarmed = true;\n\t\t\treturn;\n\t\t}\n\t\tif (!isRecommended(event.model, recommendations)) {\n\t\t\twarnWhenNoRecommendationIsAvailable(ctx);\n\t\t}\n\t});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/recommended-models/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,MAAM,SAAS,GAAG,uBAAuB,CAAC;AAC1C,yFAAyF;AACzF,qFAAqF;AACrF,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAA2D;IAChG,kBAAkB;IAClB,iBAAiB;CACjB,CAAC,CAAC;AACH,MAAM,iBAAiB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,CAAU,CAAC;AAEjF,iGAAiG;AACjG,0FAA0F;AAC1F,gGAAgG;AAChG,mFAAmF;AACnF,MAAM,gBAAgB,GAAG;IACxB,wBAAwB;IACxB,WAAW;IACX,eAAe;IACf,gBAAgB;IAChB,UAAU;CACD,CAAC;AACX,MAAM,cAAc,GAAG,CAAC,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,aAAa,CAAU,CAAC;AAChG,MAAM,aAAa,GAAG,CAAC,sBAAsB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,UAAU,CAAU,CAAC;AAChG,MAAM,aAAa,GAAG,CAAC,iBAAiB,EAAE,aAAa,CAAU,CAAC;AAElE,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACzC,CAAC,iBAAiB,EAAE,QAAQ,E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gBACzC,OAAO;YACR,CAAC;YACD,IAAI,gBAAgB,EAAE,CAAC;gBACtB,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;YAC1D,CAAC;iBAAM,CAAC;gBACP,EAAE,CAAC,uBAAuB,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;YACjE,CAAC;YACD,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,kCAAkC,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAC9E,CAAC;gBAAS,CAAC;YACV,kBAAkB,GAAG,KAAK,CAAC;QAC5B,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACpC,IAAI,CAAC,WAAW,IAAI,QAAQ,IAAI,QAAQ,IAAI,kBAAkB,IAAI,CAAC,aAAa,EAAE,CAAC;YAClF,OAAO;QACR,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;YACxD,QAAQ,GAAG,IAAI,CAAC;YAChB,OAAO;QACR,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,EAAE,CAAC;YAClD,mCAAmC,CAAC,GAAG,CAAC,CAAC;QAC1C,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type { Api, Model } from \"@earendil-works/pi-ai\";\nimport { SettingsManager } from \"../../../settings-manager.ts\";\nimport type { ExtensionAPI, ExtensionContext, SessionStartEvent } from \"../../types.ts\";\n\nconst FLAG_NAME = \"no-recommended-models\";\n// Only implicit fallbacks auto-switch. A `settings` provenance means the user explicitly\n// configured a system default model, which must be respected rather than overridden.\nconst AUTO_SWITCH_PROVENANCE = new Set<NonNullable<SessionStartEvent[\"initialModelProvenance\"]>>([\n\t\"provider-default\",\n\t\"first-available\",\n]);\nconst MODEL_ID_SUFFIXES = [\"-ultrafast\", \"-unlocked\", \"-256k\", \"-fast\"] as const;\n\n// Provider lanes ranked like the category and model-profile chains: the subscription lane first.\n// A shipped rung is served ONLY by its ranked lanes, so gateway aggregators (opengateway,\n// openrouter, vercel-ai-gateway) and other resellers are never pulled in. A `recommendedModels`\n// override id outside this table carries no ranking and any provider may serve it.\nconst CLAUDE_PROVIDERS = [\n\t\"anthropic-subscription\",\n\t\"anthropic\",\n\t\"anthropic-api\",\n\t\"github-copilot\",\n\t\"opencode\",\n] as const;\nconst KIMI_PROVIDERS = [\"kimi-coding\", \"kimi-for-coding\", \"moonshotai\", \"opencode-go\"] as const;\nconst GPT_PROVIDERS = [\"chatgpt-subscription\", \"openai\", \"github-copilot\", \"opencode\"] as const;\nconst GLM_PROVIDERS = [\"zai-coding-plan\", \"opencode-go\"] as const;\n\nexport const RECOMMENDED_DEFAULT_MODELS = [\n\t[\"claude-opus-5-5\", \"medium\", CLAUDE_PROVIDERS],\n\t[\"claude-fable-5-1\", \"xhigh\", CLAUDE_PROVIDERS],\n\t[\"kimi-k3\", \"max\", KIMI_PROVIDERS],\n\t[\"gpt-6-astra\", \"xhigh\", GPT_PROVIDERS],\n\t[\"gpt-6-sol\", \"medium\", GPT_PROVIDERS],\n\t[\"glm-5.3\", \"max\", GLM_PROVIDERS],\n] as const satisfies ReadonlyArray<readonly [string, ThinkingLevel, readonly string[]]>;\n\ntype RecommendedModel = { modelId: string; thinkingLevel: ThinkingLevel; providers: readonly string[] };\n\nconst DEFAULT_RECOMMENDATIONS: readonly RecommendedModel[] = RECOMMENDED_DEFAULT_MODELS.map(\n\t([modelId, thinkingLevel, providers]) => ({ modelId, thinkingLevel, providers }),\n);\nconst DEFAULT_RECOMMENDATIONS_BY_MODEL_ID = new Map(\n\tDEFAULT_RECOMMENDATIONS.map((recommendation) => [recommendation.modelId, recommendation]),\n);\n\nexport function canonicalModelId(modelId: string): string {\n\tlet canonical = modelId.toLowerCase();\n\tlet strippedSuffix = true;\n\twhile (strippedSuffix) {\n\t\tstrippedSuffix = false;\n\t\tfor (const suffix of MODEL_ID_SUFFIXES) {\n\t\t\tif (canonical.endsWith(suffix)) {\n\t\t\t\tcanonical = canonical.slice(0, -suffix.length);\n\t\t\t\tstrippedSuffix = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn canonical === \"k3\" ? \"kimi-k3\" : canonical;\n}\n\nfunction recommendationsFor(configuredModelIds: string[] | undefined): readonly RecommendedModel[] {\n\tif (configuredModelIds === undefined) {\n\t\treturn DEFAULT_RECOMMENDATIONS;\n\t}\n\treturn configuredModelIds\n\t\t.map(canonicalModelId)\n\t\t.filter((modelId) => modelId.length > 0)\n\t\t.map(\n\t\t\t(modelId): RecommendedModel =>\n\t\t\t\tDEFAULT_RECOMMENDATIONS_BY_MODEL_ID.get(modelId) ?? { modelId, thinkingLevel: \"medium\", providers: [] },\n\t\t);\n}\n\nfunction findAvailableRecommendation(\n\trecommendations: readonly RecommendedModel[],\n\tctx: ExtensionContext,\n): { recommendation: RecommendedModel; model: Model<Api> } | undefined {\n\tconst available = ctx.modelRegistry.getAvailable().filter((model) => ctx.modelRegistry.hasConfiguredAuth(model));\n\tfor (const recommendation of recommendations) {\n\t\tconst candidates = available.filter((candidate) => canonicalModelId(candidate.id) === recommendation.modelId);\n\t\tconst model =\n\t\t\trecommendation.providers.length === 0\n\t\t\t\t? candidates[0]\n\t\t\t\t: recommendation.providers\n\t\t\t\t\t\t.map((provider) => candidates.find((candidate) => candidate.provider === provider))\n\t\t\t\t\t\t.find((candidate) => candidate !== undefined);\n\t\tif (model) {\n\t\t\treturn { recommendation, model };\n\t\t}\n\t}\n\treturn undefined;\n}\n\nfunction isRecommended(model: Model<Api> | undefined, recommendations: readonly RecommendedModel[]): boolean {\n\treturn (\n\t\tmodel !== undefined &&\n\t\trecommendations.some((recommendation) => canonicalModelId(model.id) === recommendation.modelId)\n\t);\n}\n\nfunction nonRecommendedModelWarning(model: Model<Api> | undefined): string {\n\treturn `Non-recommended model '${model?.id ?? \"<none>\"}': odd behavior is the default state; a working session is the anomaly.`;\n}\n\nexport default function recommendedModelsExtension(pi: ExtensionAPI): void {\n\tpi.registerFlag(FLAG_NAME, {\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t\tdescription: \"Disable recommended model selection for this run.\",\n\t});\n\n\tlet initialized = false;\n\tlet disabled = false;\n\tlet disarmed = false;\n\tlet automaticSelection = false;\n\tlet warningShown = false;\n\tlet canAutoSwitch = false;\n\tlet recommendations: readonly RecommendedModel[] = DEFAULT_RECOMMENDATIONS;\n\n\tconst warnWhenNoRecommendationIsAvailable = (ctx: ExtensionContext): void => {\n\t\tif (warningShown || findAvailableRecommendation(recommendations, ctx)) {\n\t\t\treturn;\n\t\t}\n\t\twarningShown = true;\n\t\tctx.ui.notify(nonRecommendedModelWarning(ctx.model), \"warning\");\n\t};\n\n\tpi.on(\"session_start\", async (event, ctx) => {\n\t\tif (initialized) {\n\t\t\treturn;\n\t\t}\n\t\tinitialized = true;\n\n\t\tconst settingsManager = SettingsManager.create(ctx.cwd);\n\t\tdisabled = pi.getFlag(FLAG_NAME) === true || settingsManager.getWarnings().offRecommendedModel === true;\n\t\trecommendations = recommendationsFor(settingsManager.getRecommendedModels());\n\t\tcanAutoSwitch =\n\t\t\tctx.mode !== \"app-server\" &&\n\t\t\tevent.initialModelProvenance !== undefined &&\n\t\t\tAUTO_SWITCH_PROVENANCE.has(event.initialModelProvenance);\n\t\tif (disabled || !canAutoSwitch || isRecommended(ctx.model, recommendations)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst target = findAvailableRecommendation(recommendations, ctx);\n\t\tif (!target) {\n\t\t\twarnWhenNoRecommendationIsAvailable(ctx);\n\t\t\treturn;\n\t\t}\n\n\t\tconst persistAsDefault = ctx.mode === \"tui\";\n\t\tautomaticSelection = true;\n\t\ttry {\n\t\t\tconst switched = persistAsDefault ? await pi.setModel(target.model) : await pi.setSessionModel(target.model);\n\t\t\tif (!switched) {\n\t\t\t\twarnWhenNoRecommendationIsAvailable(ctx);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (persistAsDefault) {\n\t\t\t\tpi.setThinkingLevel(target.recommendation.thinkingLevel);\n\t\t\t} else {\n\t\t\t\tpi.setSessionThinkingLevel(target.recommendation.thinkingLevel);\n\t\t\t}\n\t\t\tctx.ui.notify(`Switched to recommended model '${target.model.id}'.`, \"info\");\n\t\t} finally {\n\t\t\tautomaticSelection = false;\n\t\t}\n\t});\n\n\tpi.on(\"model_select\", (event, ctx) => {\n\t\tif (!initialized || disabled || disarmed || automaticSelection || !canAutoSwitch) {\n\t\t\treturn;\n\t\t}\n\t\tif (event.source === \"set\" || event.source === \"cycle\") {\n\t\t\tdisarmed = true;\n\t\t\treturn;\n\t\t}\n\t\tif (!isRecommended(event.model, recommendations)) {\n\t\t\twarnWhenNoRecommendationIsAvailable(ctx);\n\t\t}\n\t});\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-yeongyu/senpi-codemode",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.24",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Source-only senpi extension package for codemode evaluation tools",
|
|
6
6
|
"type": "module",
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/parser": "8.0.4",
|
|
34
|
-
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.9.
|
|
34
|
+
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.9.24",
|
|
35
35
|
"typebox": "1.3.34"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@code-yeongyu/senpi": "2026.9.
|
|
38
|
+
"@code-yeongyu/senpi": "2026.9.24"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@code-yeongyu/senpi": "2026.9.
|
|
41
|
+
"@code-yeongyu/senpi": "2026.9.24"
|
|
42
42
|
},
|
|
43
43
|
"keywords": [
|
|
44
44
|
"senpi",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earendil-works/pi-agent-core",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.24",
|
|
4
4
|
"description": "General-purpose agent with transport abstraction, state management, and attachment support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@earendil-works/chord": "0.85.1",
|
|
60
|
-
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.9.
|
|
61
|
-
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.9.
|
|
60
|
+
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.9.24",
|
|
61
|
+
"@earendil-works/pi-telemetry": "npm:@code-yeongyu/senpi-telemetry@2026.9.24",
|
|
62
62
|
"diff": "9.0.0",
|
|
63
63
|
"ignore": "7.0.9",
|
|
64
64
|
"typebox": "1.3.34",
|
|
@@ -275,6 +275,21 @@ export declare const IMAGE_MODELS: {
|
|
|
275
275
|
cacheWrite: number;
|
|
276
276
|
};
|
|
277
277
|
};
|
|
278
|
+
readonly "inclusionai/ming-image-0.1-design-layer": {
|
|
279
|
+
id: string;
|
|
280
|
+
name: string;
|
|
281
|
+
api: "openrouter-images";
|
|
282
|
+
provider: string;
|
|
283
|
+
baseUrl: string;
|
|
284
|
+
input: ("image" | "text")[];
|
|
285
|
+
output: "image"[];
|
|
286
|
+
cost: {
|
|
287
|
+
input: number;
|
|
288
|
+
output: number;
|
|
289
|
+
cacheRead: number;
|
|
290
|
+
cacheWrite: number;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
278
293
|
readonly "krea/krea-2-large": {
|
|
279
294
|
id: string;
|
|
280
295
|
name: string;
|
|
@@ -725,6 +740,21 @@ export declare const IMAGE_MODELS: {
|
|
|
725
740
|
cacheWrite: number;
|
|
726
741
|
};
|
|
727
742
|
};
|
|
743
|
+
readonly "recraft/recraft-v4.1-flash": {
|
|
744
|
+
id: string;
|
|
745
|
+
name: string;
|
|
746
|
+
api: "openrouter-images";
|
|
747
|
+
provider: string;
|
|
748
|
+
baseUrl: string;
|
|
749
|
+
input: "text"[];
|
|
750
|
+
output: "image"[];
|
|
751
|
+
cost: {
|
|
752
|
+
input: number;
|
|
753
|
+
output: number;
|
|
754
|
+
cacheRead: number;
|
|
755
|
+
cacheWrite: number;
|
|
756
|
+
};
|
|
757
|
+
};
|
|
728
758
|
readonly "recraft/recraft-v4.1-pro": {
|
|
729
759
|
id: string;
|
|
730
760
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-models.generated.d.ts","sourceRoot":"","sources":["../src/image-models.generated.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;;;;;;;;;;gBAWrB,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;gBACV,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;gBACV,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;gBACV,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;;;gBAcV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAA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S;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;CAI6D,CAAC"}
|
|
1
|
+
{"version":3,"file":"image-models.generated.d.ts","sourceRoot":"","sources":["../src/image-models.generated.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;;;;;;;;;;gBAWrB,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;gBACV,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;gBACV,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;gBACV,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;;;gBAcV,KAAK;gBACL,MAAM;gBACN,SAAS;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;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;;;;;;;;;gBAYV,KAAK;gBACL,MAAM;gBACN,SAAS;gBACT,UAAU;;;;CAI6D,CAAC"}
|
|
@@ -277,6 +277,21 @@ export const IMAGE_MODELS = {
|
|
|
277
277
|
cacheWrite: 0,
|
|
278
278
|
},
|
|
279
279
|
},
|
|
280
|
+
"inclusionai/ming-image-0.1-design-layer": {
|
|
281
|
+
id: "inclusionai/ming-image-0.1-design-layer",
|
|
282
|
+
name: "inclusionAI: Ming Image 0.1 Design Layer",
|
|
283
|
+
api: "openrouter-images",
|
|
284
|
+
provider: "openrouter",
|
|
285
|
+
baseUrl: "https://openrouter.ai/api/v1",
|
|
286
|
+
input: ["text", "image"],
|
|
287
|
+
output: ["image"],
|
|
288
|
+
cost: {
|
|
289
|
+
input: 0,
|
|
290
|
+
output: 0,
|
|
291
|
+
cacheRead: 0,
|
|
292
|
+
cacheWrite: 0,
|
|
293
|
+
},
|
|
294
|
+
},
|
|
280
295
|
"krea/krea-2-large": {
|
|
281
296
|
id: "krea/krea-2-large",
|
|
282
297
|
name: "Krea: Krea 2 Large",
|
|
@@ -727,6 +742,21 @@ export const IMAGE_MODELS = {
|
|
|
727
742
|
cacheWrite: 0,
|
|
728
743
|
},
|
|
729
744
|
},
|
|
745
|
+
"recraft/recraft-v4.1-flash": {
|
|
746
|
+
id: "recraft/recraft-v4.1-flash",
|
|
747
|
+
name: "Recraft: Recraft V4.1 Flash",
|
|
748
|
+
api: "openrouter-images",
|
|
749
|
+
provider: "openrouter",
|
|
750
|
+
baseUrl: "https://openrouter.ai/api/v1",
|
|
751
|
+
input: ["text"],
|
|
752
|
+
output: ["image"],
|
|
753
|
+
cost: {
|
|
754
|
+
input: 0,
|
|
755
|
+
output: 0,
|
|
756
|
+
cacheRead: 0,
|
|
757
|
+
cacheWrite: 0,
|
|
758
|
+
},
|
|
759
|
+
},
|
|
730
760
|
"recraft/recraft-v4.1-pro": {
|
|
731
761
|
id: "recraft/recraft-v4.1-pro",
|
|
732
762
|
name: "Recraft: Recraft V4.1 Pro",
|