@code-yeongyu/senpi 2026.9.29-4 → 2026.9.29-5
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 +28 -7
- package/dist/bundle/chunks/{anthropic-messages-DZAH73IA.js → anthropic-messages-HEVKB3PL.js} +1 -1
- package/dist/bundle/chunks/{app-server-command-BUIGVCL4.js → app-server-command-32AFWZEH.js} +1 -1
- package/dist/bundle/chunks/{azure-openai-responses-ZJGVMXRJ.js → azure-openai-responses-QVPPCPVL.js} +1 -1
- package/dist/bundle/chunks/{chunk-U5LXY7UD.js → chunk-2IHY6ZLW.js} +1 -1
- package/dist/bundle/chunks/{chunk-ESPYV6XG.js → chunk-2N3BZ5DV.js} +1 -1
- package/dist/bundle/chunks/{chunk-XNR637JQ.js → chunk-2WAKOPNA.js} +1 -1
- package/dist/bundle/chunks/{chunk-SHIPI3FN.js → chunk-63QHOG5A.js} +44 -44
- package/dist/bundle/chunks/{chunk-H2U7247O.js → chunk-77AUUH3Z.js} +2 -2
- package/dist/bundle/chunks/{chunk-T4F7KOR2.js → chunk-7CQX3QFV.js} +1 -1
- package/dist/bundle/chunks/{chunk-WW3YFGEP.js → chunk-7MUTNWPO.js} +1 -1
- package/dist/bundle/chunks/{chunk-6NXC765G.js → chunk-AWEAVBCR.js} +1 -1
- package/dist/bundle/chunks/{chunk-3DISE3EE.js → chunk-BBNWT72C.js} +1 -1
- package/dist/bundle/chunks/{chunk-HKUHLCH7.js → chunk-U7BNOE23.js} +1 -1
- package/dist/bundle/chunks/{chunk-VAKMXHSM.js → chunk-VLW22GHJ.js} +1 -1
- package/dist/bundle/chunks/{chunk-DFRI62DO.js → chunk-W4IEEYWL.js} +1 -1
- package/dist/bundle/chunks/{chunk-Q6X7ES7N.js → chunk-XO7VCMY6.js} +1 -1
- package/dist/bundle/chunks/chunk-YLQTKWEC.js +6 -0
- package/dist/bundle/chunks/{chunk-NUS5JXND.js → chunk-Z2N5372Y.js} +1 -1
- package/dist/bundle/chunks/{chunk-JQNR6OYN.js → chunk-ZDNR3YVJ.js} +1 -1
- package/dist/bundle/chunks/{chunk-DAKIX3RD.js → chunk-ZPMJIPQC.js} +1 -1
- package/dist/bundle/chunks/{cli-main-XCRRH3OR.js → cli-main-ZPMYM3A3.js} +1 -1
- package/dist/bundle/chunks/engine-RCHMSSBT.js +2 -0
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-RYFW7GSR.js → google-generative-ai-E3I6MS7E.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-J64D4U2O.js → google-vertex-KFFI24FU.js} +1 -1
- package/dist/bundle/chunks/{help-fast-path-JJVINW3Y.js → help-fast-path-ZUNFOE53.js} +1 -1
- package/dist/bundle/chunks/{host-command-IZJU2H7Z.js → host-command-V2LDNNXB.js} +1 -1
- package/dist/bundle/chunks/{interactive-mode-KXRPZ2U6.js → interactive-mode-J6KGDRR7.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-C7ZTJYKE.js → mistral-conversations-EZ4XNJXU.js} +1 -1
- package/dist/bundle/chunks/{multi-session-host-3XTEXGP4.js → multi-session-host-IBVJ3WN7.js} +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-N5SCEWCY.js → openai-codex-responses-TMUCQW5E.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-T4B2KZ4B.js → openai-completions-SA2UJW7Q.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-N4OK2RIV.js → openai-responses-EHSD4L2M.js} +1 -1
- package/dist/bundle/chunks/{package-manager-cli-ZHWO6FT5.js → package-manager-cli-JJ5R7UWV.js} +1 -1
- package/dist/bundle/chunks/{rotation-stream-5GE3KAHL.js → rotation-stream-EX7PWQ4S.js} +1 -1
- package/dist/bundle/chunks/{rpc-mode-DEVPDAT4.js → rpc-mode-ITND2BVC.js} +1 -1
- package/dist/bundle/chunks/{session-control-endpoint-72A2NRVH.js → session-control-endpoint-UJJGG4WI.js} +1 -1
- package/dist/bundle/chunks/{session-picker-XYMNQ6AZ.js → session-picker-K5FIKV6C.js} +1 -1
- package/dist/bundle/chunks/session-worker.js +42 -42
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/bundle/runtime-manifest.json +1 -1
- package/dist/core/auth-providers.d.ts +9 -0
- package/dist/core/auth-providers.js +17 -0
- package/dist/core/dynamic-prompt/build.js +1 -1
- package/dist/core/dynamic-prompt/intent-gate.js +1 -1
- package/dist/core/dynamic-prompt/verification.d.ts +9 -1
- package/dist/core/dynamic-prompt/verification.js +11 -2
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5-5.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/claude-sonnet-5-5.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +4 -4
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts +6 -2
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js +24 -7
- package/dist/core/extensions/builtin/prompt-preset/gpt-surface.d.ts +4 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-surface.js +4 -1
- package/dist/core/extensions/builtin/prompt-preset/grok-4.5.js +4 -4
- package/dist/core/extensions/builtin/prompt-preset/grok-4.6.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/grok-4.7.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/presets.js +12 -9
- package/dist/core/high-reasoning-warning.js +4 -3
- package/dist/core/model-resolver.js +2 -2
- package/dist/modes/rpc/connection-handler.js +7 -4
- package/package.json +6 -6
- package/dist/bundle/chunks/chunk-TODLHR4S.js +0 -6
- package/dist/bundle/chunks/engine-35QNGFQZ.js +0 -2
package/dist/bundle/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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
3
|
import{enableStartupCompileCache}from"./chunks/chunk-F73COJ7R.js";import{getLatestPiRelease,hasInheritedInspectorOption,isNewerPackageVersion,processBunRuntimeOptions,releaseInheritedInspectorForChild,resolveBunReexec}from"./chunks/chunk-4VWWEMCJ.js";import"./chunks/chunk-ZOFZRJSL.js";import"./chunks/chunk-2SOVDETB.js";import{APP_NAME,DISPLAY_VERSION,PACKAGE_NAME,RUNTIME_SNAPSHOT_MARKER,VERSION,brandProfile,findNodePackageDir,getAgentDir,getInstallPackageDir,getSelfUpdateCommand,getSelfUpdateUnavailableInstruction,isBundledNode,readRuntimeSnapshotMarker}from"./chunks/chunk-WCAKUCN3.js";import"./chunks/chunk-ATQFN5HI.js";import"./chunks/chunk-IKOFCODM.js";import{spawn as spawn2,spawnSync}from"node:child_process";import{existsSync as existsSync2,realpathSync as realpathSync3}from"node:fs";import{dirname as dirname3,join as join5}from"node:path";import{fileURLToPath}from"node:url";import{createHash}from"node:crypto";import{readFileSync,realpathSync as realpathSync2}from"node:fs";import{basename as basename2,dirname as dirname2,join as join3,relative}from"node:path";import{pathToFileURL}from"node:url";import{copyFileSync,cpSync,existsSync,lstatSync,mkdirSync,readdirSync,realpathSync,renameSync,rmSync,statSync,symlinkSync,writeFileSync}from"node:fs";import{basename,dirname,join}from"node:path";var RuntimeSnapshotLayoutError=class extends Error{constructor(packageName){super(`runtime snapshot resolves ${packageName} differently from the install`),this.packageName=packageName}};function isMissing(error){return error instanceof Error&&"code"in error&&(error.code==="ENOENT"||error.code==="ENOTDIR")}function occupied(path){try{return lstatSync(path),!0}catch(error){if(isMissing(error))return!1;throw error}}function linkEntry(source,target){let isDirectory;try{isDirectory=statSync(source).isDirectory()}catch(error){if(isMissing(error))return;throw error}if(process.platform==="win32"&&!isDirectory){copyFileSync(source,target);return}symlinkSync(source,target,isDirectory?"junction":"file")}function linkChildren(sourceDir,targetDir,skip){for(let name of readdirSync(sourceDir))skip.has(name)||occupied(join(targetDir,name))||linkEntry(join(sourceDir,name),join(targetDir,name))}function moduleDirectoriesFrom(dir){let directories=[];for(let current=dir;;current=dirname(current)){if(basename(current)!=="node_modules"){let candidate=join(current,"node_modules");existsSync(candidate)&&directories.push(candidate)}if(dirname(current)===current)return directories}}function linkModules(packageDir,target){mkdirSync(target,{recursive:!0});for(let source of moduleDirectoriesFrom(packageDir))for(let name of readdirSync(source)){if(name===".bin")continue;if(!(name.startsWith("@")&&statSync(join(source,name)).isDirectory())){occupied(join(target,name))||linkEntry(join(source,name),join(target,name));continue}mkdirSync(join(target,name),{recursive:!0}),linkChildren(join(source,name),join(target,name),new Set)}}function packageRootFrom(dir,packageName){for(let modules of moduleDirectoriesFrom(dir)){let root=join(modules,packageName);if(existsSync(join(root,"package.json")))return realpathSync(root)}}function verifyExternals(packageDir,snapshotBundleDir,externals){for(let name of externals){let expected=packageRootFrom(packageDir,name);if(expected!==void 0&&packageRootFrom(snapshotBundleDir,name)!==expected)throw new RuntimeSnapshotLayoutError(name)}}function materializeRuntimeSnapshot(packageDir,target,manifest){let staging=join(dirname(target),`.tmp-${basename(target)}-${process.pid}`);rmSync(staging,{recursive:!0,force:!0});try{let snapshotBundleDir=join(staging,"dist","bundle");mkdirSync(join(staging,"dist"),{recursive:!0}),cpSync(join(packageDir,"dist","bundle"),snapshotBundleDir,{recursive:!0}),copyFileSync(join(packageDir,"package.json"),join(staging,"package.json")),linkChildren(packageDir,staging,new Set(["dist","package.json","node_modules"])),linkChildren(join(packageDir,"dist"),join(staging,"dist"),new Set(["bundle"])),linkModules(packageDir,join(staging,"node_modules")),verifyExternals(packageDir,join(snapshotBundleDir,"chunks"),manifest.externals);let marker={buildId:manifest.buildId,installPackageDir:realpathSync(packageDir)};writeFileSync(join(staging,RUNTIME_SNAPSHOT_MARKER),`${JSON.stringify(marker)}
|
|
4
|
-
`),rmSync(target,{recursive:!0,force:!0}),renameSync(staging,target)}catch(error){throw rmSync(staging,{recursive:!0,force:!0}),error}}import{mkdirSync as mkdirSync2,readdirSync as readdirSync2,renameSync as renameSync2,rmSync as rmSync2,statSync as statSync2,unlinkSync,utimesSync,writeFileSync as writeFileSync2}from"node:fs";import{join as join2}from"node:path";var LOCK_NAME=".lock",CLAIMS_DIR="claims",STALE_LOCK_MS=3e4,LOCK_WAIT_MS=5e3,LOCK_RETRY_MS=25,UNUSED_SNAPSHOT_GRACE_MS=10*6e4,LEFTOVER_MS=60*6e4;function errorCode(error){return error instanceof Error&&"code"in error?error.code:void 0}function ageMs(path,now){try{return now-statSync2(path).mtimeMs}catch(error){if(errorCode(error)==="ENOENT")return Number.POSITIVE_INFINITY;throw error}}function sleepSync(ms){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,ms)}function withRuntimeLock(root,task){mkdirSync2(root,{recursive:!0});let lock=join2(root,LOCK_NAME),deadline=Date.now()+LOCK_WAIT_MS;for(;;){try{mkdirSync2(lock);break}catch(error){if(errorCode(error)!=="EEXIST")throw error}if(ageMs(lock,Date.now())>STALE_LOCK_MS)rmSync2(lock,{recursive:!0,force:!0});else{if(Date.now()>deadline)return;sleepSync(LOCK_RETRY_MS)}}try{return task()}finally{rmSync2(lock,{recursive:!0,force:!0})}}function isProcessAlive(pid){try{return process.kill(pid,0),!0}catch(error){return errorCode(error)!=="ESRCH"}}function claimRuntimeSnapshot(snapshotDir,pid){mkdirSync2(join2(snapshotDir,CLAIMS_DIR),{recursive:!0}),writeFileSync2(join2(snapshotDir,CLAIMS_DIR,String(pid)),"");let now=new Date;utimesSync(join2(snapshotDir,RUNTIME_SNAPSHOT_MARKER),now,now)}function reapClaims(snapshotDir,isAlive){let names;try{names=readdirSync2(join2(snapshotDir,CLAIMS_DIR))}catch(error){if(errorCode(error)==="ENOENT")return 0;throw error}let live=0;for(let name of names){let pid=Number(name);Number.isSafeInteger(pid)&&pid>0&&isAlive(pid)?live+=1:unlinkSync(join2(snapshotDir,CLAIMS_DIR,name))}return live}function pruneRuntimeSnapshots(root,keep,now,isAlive=isProcessAlive){reapClaims(join2(root,keep),isAlive);for(let name of readdirSync2(root)){if(name===LOCK_NAME||name===keep)continue;let path=join2(root,name);if(name.startsWith(".")){ageMs(path,now)>LEFTOVER_MS&&rmSync2(path,{recursive:!0,force:!0});continue}if(reapClaims(path,isAlive)>0||ageMs(join2(path,RUNTIME_SNAPSHOT_MARKER),now)<=UNUSED_SNAPSHOT_GRACE_MS)continue;let trash=join2(root,`.trash-${name}-${process.pid}`);renameSync2(path,trash),rmSync2(trash,{recursive:!0,force:!0})}}var RUNTIME_MANIFEST="runtime-manifest.json";function readRuntimeManifest(bundleDir){let parsed;try{parsed=JSON.parse(readFileSync(join3(bundleDir,RUNTIME_MANIFEST),"utf8"))}catch(error){if(error instanceof Error&&"code"in error&&error.code==="ENOENT")return;throw error}if(typeof parsed=="object"&&parsed!==null&&"buildId"in parsed&&typeof parsed.buildId=="string"&&/^[A-Za-z0-9._-]+$/.test(parsed.buildId)&&"externals"in parsed&&Array.isArray(parsed.externals)&&parsed.externals.every(name=>typeof name=="string"))return{buildId:parsed.buildId,externals:parsed.externals}}function prepareRuntimeSnapshot(entryPath,packageDir,agentDir){let bundleDir=dirname2(entryPath),runtimeRoot=join3(agentDir,"runtime");try{if(readRuntimeSnapshotMarker(packageDir))return withRuntimeLock(runtimeRoot,()=>claimRuntimeSnapshot(packageDir,process.pid)),{kind:"run-here"};let manifest=readRuntimeManifest(bundleDir);if(!manifest||relative(packageDir,bundleDir)!==join3("dist","bundle"))return{kind:"run-here"};let installId=createHash("sha256").update(realpathSync2(packageDir)).digest("hex").slice(0,12),snapshotId=`${manifest.buildId}-${installId}`,snapshotDir=join3(runtimeRoot,snapshotId);return withRuntimeLock(runtimeRoot,()=>(readRuntimeSnapshotMarker(snapshotDir)?.buildId!==manifest.buildId&&materializeRuntimeSnapshot(packageDir,snapshotDir,manifest),claimRuntimeSnapshot(snapshotDir,process.pid),pruneRuntimeSnapshots(runtimeRoot,snapshotId,Date.now()),!0))?{kind:"hand-off",entryUrl:pathToFileURL(join3(snapshotDir,"dist","bundle",basename2(entryPath))).href,snapshotDir}:{kind:"run-here"}}catch{return{kind:"run-here"}}}import{spawn}from"node:child_process";import{readFileSync as readFileSync2}from"node:fs";import{join as join4}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(readFileSync2(join4(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}var __rewriteRelativeImportExtension=function(path,preserveJsx){return typeof path=="string"&&/^\.\.?\//.test(path)?path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(m,tsx,d,ext,cm){return tsx?preserveJsx?".jsx":".js":d&&(!ext||!cm)?m:d+ext+"."+cm.toLowerCase()+"js"}):path};function reexecUnderBunIfNeeded(){let options=processBunRuntimeOptions(existsSync2,realpathSync3),scriptRealPath=process.argv[1]??fileURLToPath(import.meta.url);try{scriptRealPath=realpathSync3(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=>!existsSync2(join5(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-JJVINW3Y.js");tryPrintHelpWithoutEngine(args)&&process.exit()}isMissingBundledWorkspaceDependencies(getInstallPackageDir())&&await handleBootstrapSelfUpdate(args)&&process.exit();if(requiresIsolatedProcess())process.exitCode=await spawnFullCli();else{let entryPath=fileURLToPath(import.meta.url),snapshot=isBundledNode?prepareRuntimeSnapshot(entryPath,findNodePackageDir(dirname3(entryPath)),getAgentDir()):void 0;snapshot?.kind==="hand-off"?await import(__rewriteRelativeImportExtension(snapshot.entryUrl)):await import("./chunks/cli-main-XCRRH3OR.js")}
|
|
4
|
+
`),rmSync(target,{recursive:!0,force:!0}),renameSync(staging,target)}catch(error){throw rmSync(staging,{recursive:!0,force:!0}),error}}import{mkdirSync as mkdirSync2,readdirSync as readdirSync2,renameSync as renameSync2,rmSync as rmSync2,statSync as statSync2,unlinkSync,utimesSync,writeFileSync as writeFileSync2}from"node:fs";import{join as join2}from"node:path";var LOCK_NAME=".lock",CLAIMS_DIR="claims",STALE_LOCK_MS=3e4,LOCK_WAIT_MS=5e3,LOCK_RETRY_MS=25,UNUSED_SNAPSHOT_GRACE_MS=10*6e4,LEFTOVER_MS=60*6e4;function errorCode(error){return error instanceof Error&&"code"in error?error.code:void 0}function ageMs(path,now){try{return now-statSync2(path).mtimeMs}catch(error){if(errorCode(error)==="ENOENT")return Number.POSITIVE_INFINITY;throw error}}function sleepSync(ms){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,ms)}function withRuntimeLock(root,task){mkdirSync2(root,{recursive:!0});let lock=join2(root,LOCK_NAME),deadline=Date.now()+LOCK_WAIT_MS;for(;;){try{mkdirSync2(lock);break}catch(error){if(errorCode(error)!=="EEXIST")throw error}if(ageMs(lock,Date.now())>STALE_LOCK_MS)rmSync2(lock,{recursive:!0,force:!0});else{if(Date.now()>deadline)return;sleepSync(LOCK_RETRY_MS)}}try{return task()}finally{rmSync2(lock,{recursive:!0,force:!0})}}function isProcessAlive(pid){try{return process.kill(pid,0),!0}catch(error){return errorCode(error)!=="ESRCH"}}function claimRuntimeSnapshot(snapshotDir,pid){mkdirSync2(join2(snapshotDir,CLAIMS_DIR),{recursive:!0}),writeFileSync2(join2(snapshotDir,CLAIMS_DIR,String(pid)),"");let now=new Date;utimesSync(join2(snapshotDir,RUNTIME_SNAPSHOT_MARKER),now,now)}function reapClaims(snapshotDir,isAlive){let names;try{names=readdirSync2(join2(snapshotDir,CLAIMS_DIR))}catch(error){if(errorCode(error)==="ENOENT")return 0;throw error}let live=0;for(let name of names){let pid=Number(name);Number.isSafeInteger(pid)&&pid>0&&isAlive(pid)?live+=1:unlinkSync(join2(snapshotDir,CLAIMS_DIR,name))}return live}function pruneRuntimeSnapshots(root,keep,now,isAlive=isProcessAlive){reapClaims(join2(root,keep),isAlive);for(let name of readdirSync2(root)){if(name===LOCK_NAME||name===keep)continue;let path=join2(root,name);if(name.startsWith(".")){ageMs(path,now)>LEFTOVER_MS&&rmSync2(path,{recursive:!0,force:!0});continue}if(reapClaims(path,isAlive)>0||ageMs(join2(path,RUNTIME_SNAPSHOT_MARKER),now)<=UNUSED_SNAPSHOT_GRACE_MS)continue;let trash=join2(root,`.trash-${name}-${process.pid}`);renameSync2(path,trash),rmSync2(trash,{recursive:!0,force:!0})}}var RUNTIME_MANIFEST="runtime-manifest.json";function readRuntimeManifest(bundleDir){let parsed;try{parsed=JSON.parse(readFileSync(join3(bundleDir,RUNTIME_MANIFEST),"utf8"))}catch(error){if(error instanceof Error&&"code"in error&&error.code==="ENOENT")return;throw error}if(typeof parsed=="object"&&parsed!==null&&"buildId"in parsed&&typeof parsed.buildId=="string"&&/^[A-Za-z0-9._-]+$/.test(parsed.buildId)&&"externals"in parsed&&Array.isArray(parsed.externals)&&parsed.externals.every(name=>typeof name=="string"))return{buildId:parsed.buildId,externals:parsed.externals}}function prepareRuntimeSnapshot(entryPath,packageDir,agentDir){let bundleDir=dirname2(entryPath),runtimeRoot=join3(agentDir,"runtime");try{if(readRuntimeSnapshotMarker(packageDir))return withRuntimeLock(runtimeRoot,()=>claimRuntimeSnapshot(packageDir,process.pid)),{kind:"run-here"};let manifest=readRuntimeManifest(bundleDir);if(!manifest||relative(packageDir,bundleDir)!==join3("dist","bundle"))return{kind:"run-here"};let installId=createHash("sha256").update(realpathSync2(packageDir)).digest("hex").slice(0,12),snapshotId=`${manifest.buildId}-${installId}`,snapshotDir=join3(runtimeRoot,snapshotId);return withRuntimeLock(runtimeRoot,()=>(readRuntimeSnapshotMarker(snapshotDir)?.buildId!==manifest.buildId&&materializeRuntimeSnapshot(packageDir,snapshotDir,manifest),claimRuntimeSnapshot(snapshotDir,process.pid),pruneRuntimeSnapshots(runtimeRoot,snapshotId,Date.now()),!0))?{kind:"hand-off",entryUrl:pathToFileURL(join3(snapshotDir,"dist","bundle",basename2(entryPath))).href,snapshotDir}:{kind:"run-here"}}catch{return{kind:"run-here"}}}import{spawn}from"node:child_process";import{readFileSync as readFileSync2}from"node:fs";import{join as join4}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(readFileSync2(join4(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}var __rewriteRelativeImportExtension=function(path,preserveJsx){return typeof path=="string"&&/^\.\.?\//.test(path)?path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(m,tsx,d,ext,cm){return tsx?preserveJsx?".jsx":".js":d&&(!ext||!cm)?m:d+ext+"."+cm.toLowerCase()+"js"}):path};function reexecUnderBunIfNeeded(){let options=processBunRuntimeOptions(existsSync2,realpathSync3),scriptRealPath=process.argv[1]??fileURLToPath(import.meta.url);try{scriptRealPath=realpathSync3(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=>!existsSync2(join5(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-ZUNFOE53.js");tryPrintHelpWithoutEngine(args)&&process.exit()}isMissingBundledWorkspaceDependencies(getInstallPackageDir())&&await handleBootstrapSelfUpdate(args)&&process.exit();if(requiresIsolatedProcess())process.exitCode=await spawnFullCli();else{let entryPath=fileURLToPath(import.meta.url),snapshot=isBundledNode?prepareRuntimeSnapshot(entryPath,findNodePackageDir(dirname3(entryPath)),getAgentDir()):void 0;snapshot?.kind==="hand-off"?await import(__rewriteRelativeImportExtension(snapshot.entryUrl)):await import("./chunks/cli-main-ZPMYM3A3.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,CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,DefaultResourceLoader,ExtensionEditorComponent,ExtensionRunner,FooterComponent,InteractiveMode,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthSelectorComponent,RpcClient,RpcClientOpenInFlightError,RpcTransportGoneError,SESSION_CONTROL_DELIVERY_TYPE,SessionManager,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageComponent,UserMessageSelectorComponent,buildContextEntries,buildNoticeBox,buildSessionContext,calculateContextTokens,classifyRead,collectEntriesForBranchSummary,collectOrphanedChildren,compact,connectWebViewService,convertToLlm,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,formatSize,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getLastAssistantUsage,getLatestCompactionEntry,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isTransportGoneError,isWriteToolResult,kernelToolsStorage,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,migrateSessionEntries,noticeEntryRenderer,noticeMessageRenderer,parseFrontmatter,parseSessionEntries,parseSkillBlock,prepareBranchEntries,readOwnFootprint,readProcessFootprint,readStoredCredential,registerReadClassifier,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runPrintMode,serializeConversation,sessionEntryToContextMessages,shouldCompact,stripFrontmatter,truncateHead,truncateLine,truncateTail,truncateToVisualLines,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunks/chunk-SHIPI3FN.js";import"./chunks/chunk-K2SHQNAA.js";import{DefaultPackageManager,DynamicBorder,ExtensionInputComponent,ExtensionSelectorComponent,SessionSelectorComponent,keyHint,keyText,rawKeyHint}from"./chunks/chunk-DAKIX3RD.js";import"./chunks/chunk-2POUJCWM.js";import"./chunks/chunk-VLTMFAWQ.js";import"./chunks/chunk-NZRVAZL2.js";import"./chunks/chunk-U5KVIAHJ.js";import{UnknownCommandError,runRpcMode}from"./chunks/chunk-TODLHR4S.js";import{SettingsManager,Theme,getLanguageFromPath,getMarkdownTheme,getSelectListTheme,getSettingsListTheme,highlightCode,initTheme}from"./chunks/chunk-JQNR6OYN.js";import{sanitizeTerminalLabel}from"./chunks/chunk-HEKLJWA4.js";import"./chunks/chunk-XHEMQA2T.js";import"./chunks/chunk-JABBHOD5.js";import"./chunks/chunk-YU2P3CAR.js";import"./chunks/chunk-BMX2U22F.js";import{DEFAULT_HOST_LAUNCH_SPEC,GENERATION_HANDOFF_CAPABILITY,HOST_EXIT_ERROR,HOST_EXIT_FALLBACK,HOST_EXIT_OK,HOST_EXIT_REFUSED,HOST_EXIT_USAGE,HOST_PROTOCOL_VERSION,HostEnsureRefusedError,HostLaunchSpecError,PINNED_HOST_CLIENT_CAPABILITIES,REQUIRED_HOST_CAPABILITIES,TUI_PROBE_TIMEOUT_MS,classifyEndpointLiveness,decideHostAction,endpointProbeTimeoutMs,ensureHost,handoffHost,loadHostLaunchSpec,parseHostLaunchSpec,parseHostProtocolInfo,probeHost,readAllHostStatus,readHostStatus,runHostCommand,runHostRequest,stopHost}from"./chunks/chunk-ESPYV6XG.js";import{gcHostEndpoints,listHostEndpoints}from"./chunks/chunk-CNYWF72S.js";import"./chunks/chunk-6NXC765G.js";import"./chunks/chunk-MJQWYN2W.js";import{ENDPOINT_REGISTRY_VERSION,createHostDaemonPaths,daemonDirectoryName,shardKey,shardSocketPath,shardSocketPathForKey}from"./chunks/chunk-UMLU3I2G.js";import"./chunks/chunk-CIRZTP7W.js";import{compareEngineOrdinal,engineBuildIdentity,engineBuildIdentityFrom}from"./chunks/chunk-AGVPQLIU.js";import"./chunks/chunk-XBGO2JZD.js";import"./chunks/chunk-H4QOEVS5.js";import"./chunks/chunk-HB35RBP4.js";import"./chunks/chunk-HKUHLCH7.js";import"./chunks/chunk-XNR637JQ.js";import{getPowerShellConfig,getShellConfig}from"./chunks/chunk-SH6VUPE4.js";import"./chunks/chunk-7RVWDN5Z.js";import"./chunks/chunk-7X72IACK.js";import"./chunks/chunk-KUPQO7MC.js";import"./chunks/chunk-3DISE3EE.js";import{ProjectTrustStore,hasTrustRequiringProjectResources}from"./chunks/chunk-OUG6SDT7.js";import{parseArgs}from"./chunks/chunk-T4F7KOR2.js";import"./chunks/chunk-26UBFF6N.js";import"./chunks/chunk-H2U7247O.js";import"./chunks/chunk-GZVCRV7I.js";import"./chunks/chunk-U3VOXCGP.js";import"./chunks/chunk-RFB5CBW7.js";import"./chunks/chunk-2VZJTDUX.js";import"./chunks/chunk-VAKMXHSM.js";import"./chunks/chunk-4VWWEMCJ.js";import"./chunks/chunk-ZOFZRJSL.js";import"./chunks/chunk-2SOVDETB.js";import{CONFIG_DIR_NAME,VERSION,getAgentDir,getDocsPath,getExamplesPath,getPackageDir,getReadmePath}from"./chunks/chunk-WCAKUCN3.js";import"./chunks/chunk-ATQFN5HI.js";import"./chunks/chunk-RBCQOIAD.js";import"./chunks/chunk-JRGNL6WM.js";import"./chunks/chunk-X4Q5YSTE.js";import"./chunks/chunk-CWLCGRUS.js";import"./chunks/chunk-BJICJY47.js";import"./chunks/chunk-LHYG7TK7.js";import"./chunks/chunk-KRNXUTZJ.js";import"./chunks/chunk-YOPVJDSU.js";import"./chunks/chunk-45SZOLCU.js";import"./chunks/chunk-WHPDEDCC.js";import"./chunks/chunk-BBK6SSYT.js";import"./chunks/chunk-BPX6QWPD.js";import"./chunks/chunk-NUS5JXND.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,ENDPOINT_REGISTRY_VERSION,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,SESSION_CONTROL_DELIVERY_TYPE,SessionManager,SessionSelectorComponent,SettingsManager,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,TUI_PROBE_TIMEOUT_MS,Theme,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UnknownCommandError,UserMessageComponent,UserMessageSelectorComponent,VERSION,buildContextEntries,buildNoticeBox,buildSessionContext,calculateContextTokens,classifyEndpointLiveness,classifyRead,collectEntriesForBranchSummary,collectOrphanedChildren,compact,compareEngineOrdinal,connectWebViewService,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,daemonDirectoryName,decideHostAction,defineTool,detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions,endpointProbeTimeoutMs,engineBuildIdentity,engineBuildIdentityFrom,ensureHost,estimateTokens,findCutPoint,findTurnStartIndex,formatDimensionNote,formatSize,formatSkillsForPrompt,gcHostEndpoints,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,listHostEndpoints,loadHostLaunchSpec,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,migrateSessionEntries,noticeEntryRenderer,noticeMessageRenderer,parseArgs,parseFrontmatter,parseHostLaunchSpec,parseHostProtocolInfo,parseSessionEntries,parseSkillBlock,prepareBranchEntries,probeHost,rawKeyHint,readAllHostStatus,readHostStatus,readOwnFootprint,readProcessFootprint,readStoredCredential,registerReadClassifier,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runHostCommand,runHostRequest,runPrintMode,runRpcMode,sanitizeTerminalLabel,serializeConversation,sessionEntryToContextMessages,shardKey,shardSocketPath,shardSocketPathForKey,shouldCompact,stopHost,stripFrontmatter,truncateHead,truncateLine,truncateTail,truncateToVisualLines,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools};
|
|
2
|
+
import{AgentSession,AgentSessionRuntime,ArminComponent,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,DefaultResourceLoader,ExtensionEditorComponent,ExtensionRunner,FooterComponent,InteractiveMode,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthSelectorComponent,RpcClient,RpcClientOpenInFlightError,RpcTransportGoneError,SESSION_CONTROL_DELIVERY_TYPE,SessionManager,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageComponent,UserMessageSelectorComponent,buildContextEntries,buildNoticeBox,buildSessionContext,calculateContextTokens,classifyRead,collectEntriesForBranchSummary,collectOrphanedChildren,compact,connectWebViewService,convertToLlm,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,formatSize,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getLastAssistantUsage,getLatestCompactionEntry,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isTransportGoneError,isWriteToolResult,kernelToolsStorage,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,migrateSessionEntries,noticeEntryRenderer,noticeMessageRenderer,parseFrontmatter,parseSessionEntries,parseSkillBlock,prepareBranchEntries,readOwnFootprint,readProcessFootprint,readStoredCredential,registerReadClassifier,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runPrintMode,serializeConversation,sessionEntryToContextMessages,shouldCompact,stripFrontmatter,truncateHead,truncateLine,truncateTail,truncateToVisualLines,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunks/chunk-63QHOG5A.js";import"./chunks/chunk-K2SHQNAA.js";import{DefaultPackageManager,DynamicBorder,ExtensionInputComponent,ExtensionSelectorComponent,SessionSelectorComponent,keyHint,keyText,rawKeyHint}from"./chunks/chunk-ZPMJIPQC.js";import"./chunks/chunk-2POUJCWM.js";import"./chunks/chunk-VLTMFAWQ.js";import"./chunks/chunk-NZRVAZL2.js";import"./chunks/chunk-U5KVIAHJ.js";import{UnknownCommandError,runRpcMode}from"./chunks/chunk-YLQTKWEC.js";import{SettingsManager,Theme,getLanguageFromPath,getMarkdownTheme,getSelectListTheme,getSettingsListTheme,highlightCode,initTheme}from"./chunks/chunk-ZDNR3YVJ.js";import{sanitizeTerminalLabel}from"./chunks/chunk-HEKLJWA4.js";import"./chunks/chunk-XHEMQA2T.js";import"./chunks/chunk-JABBHOD5.js";import"./chunks/chunk-YU2P3CAR.js";import"./chunks/chunk-BMX2U22F.js";import{DEFAULT_HOST_LAUNCH_SPEC,GENERATION_HANDOFF_CAPABILITY,HOST_EXIT_ERROR,HOST_EXIT_FALLBACK,HOST_EXIT_OK,HOST_EXIT_REFUSED,HOST_EXIT_USAGE,HOST_PROTOCOL_VERSION,HostEnsureRefusedError,HostLaunchSpecError,PINNED_HOST_CLIENT_CAPABILITIES,REQUIRED_HOST_CAPABILITIES,TUI_PROBE_TIMEOUT_MS,classifyEndpointLiveness,decideHostAction,endpointProbeTimeoutMs,ensureHost,handoffHost,loadHostLaunchSpec,parseHostLaunchSpec,parseHostProtocolInfo,probeHost,readAllHostStatus,readHostStatus,runHostCommand,runHostRequest,stopHost}from"./chunks/chunk-2N3BZ5DV.js";import{gcHostEndpoints,listHostEndpoints}from"./chunks/chunk-CNYWF72S.js";import"./chunks/chunk-AWEAVBCR.js";import"./chunks/chunk-MJQWYN2W.js";import{ENDPOINT_REGISTRY_VERSION,createHostDaemonPaths,daemonDirectoryName,shardKey,shardSocketPath,shardSocketPathForKey}from"./chunks/chunk-UMLU3I2G.js";import"./chunks/chunk-CIRZTP7W.js";import{compareEngineOrdinal,engineBuildIdentity,engineBuildIdentityFrom}from"./chunks/chunk-AGVPQLIU.js";import"./chunks/chunk-XBGO2JZD.js";import"./chunks/chunk-H4QOEVS5.js";import"./chunks/chunk-HB35RBP4.js";import"./chunks/chunk-U7BNOE23.js";import"./chunks/chunk-2WAKOPNA.js";import{getPowerShellConfig,getShellConfig}from"./chunks/chunk-SH6VUPE4.js";import"./chunks/chunk-7RVWDN5Z.js";import"./chunks/chunk-7X72IACK.js";import"./chunks/chunk-KUPQO7MC.js";import"./chunks/chunk-BBNWT72C.js";import{ProjectTrustStore,hasTrustRequiringProjectResources}from"./chunks/chunk-OUG6SDT7.js";import{parseArgs}from"./chunks/chunk-7CQX3QFV.js";import"./chunks/chunk-26UBFF6N.js";import"./chunks/chunk-77AUUH3Z.js";import"./chunks/chunk-GZVCRV7I.js";import"./chunks/chunk-U3VOXCGP.js";import"./chunks/chunk-RFB5CBW7.js";import"./chunks/chunk-2VZJTDUX.js";import"./chunks/chunk-VLW22GHJ.js";import"./chunks/chunk-4VWWEMCJ.js";import"./chunks/chunk-ZOFZRJSL.js";import"./chunks/chunk-2SOVDETB.js";import{CONFIG_DIR_NAME,VERSION,getAgentDir,getDocsPath,getExamplesPath,getPackageDir,getReadmePath}from"./chunks/chunk-WCAKUCN3.js";import"./chunks/chunk-ATQFN5HI.js";import"./chunks/chunk-RBCQOIAD.js";import"./chunks/chunk-JRGNL6WM.js";import"./chunks/chunk-X4Q5YSTE.js";import"./chunks/chunk-CWLCGRUS.js";import"./chunks/chunk-BJICJY47.js";import"./chunks/chunk-LHYG7TK7.js";import"./chunks/chunk-KRNXUTZJ.js";import"./chunks/chunk-YOPVJDSU.js";import"./chunks/chunk-45SZOLCU.js";import"./chunks/chunk-WHPDEDCC.js";import"./chunks/chunk-BBK6SSYT.js";import"./chunks/chunk-BPX6QWPD.js";import"./chunks/chunk-Z2N5372Y.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,ENDPOINT_REGISTRY_VERSION,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,SESSION_CONTROL_DELIVERY_TYPE,SessionManager,SessionSelectorComponent,SettingsManager,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,TUI_PROBE_TIMEOUT_MS,Theme,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UnknownCommandError,UserMessageComponent,UserMessageSelectorComponent,VERSION,buildContextEntries,buildNoticeBox,buildSessionContext,calculateContextTokens,classifyEndpointLiveness,classifyRead,collectEntriesForBranchSummary,collectOrphanedChildren,compact,compareEngineOrdinal,connectWebViewService,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,daemonDirectoryName,decideHostAction,defineTool,detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions,endpointProbeTimeoutMs,engineBuildIdentity,engineBuildIdentityFrom,ensureHost,estimateTokens,findCutPoint,findTurnStartIndex,formatDimensionNote,formatSize,formatSkillsForPrompt,gcHostEndpoints,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,listHostEndpoints,loadHostLaunchSpec,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,migrateSessionEntries,noticeEntryRenderer,noticeMessageRenderer,parseArgs,parseFrontmatter,parseHostLaunchSpec,parseHostProtocolInfo,parseSessionEntries,parseSkillBlock,prepareBranchEntries,probeHost,rawKeyHint,readAllHostStatus,readHostStatus,readOwnFootprint,readProcessFootprint,readStoredCredential,registerReadClassifier,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runHostCommand,runHostRequest,runPrintMode,runRpcMode,sanitizeTerminalLabel,serializeConversation,sessionEntryToContextMessages,shardKey,shardSocketPath,shardSocketPathForKey,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-63QHOG5A.js";import"./chunks/chunk-K2SHQNAA.js";import"./chunks/chunk-ZPMJIPQC.js";import"./chunks/chunk-2POUJCWM.js";import"./chunks/chunk-VLTMFAWQ.js";import"./chunks/chunk-NZRVAZL2.js";import"./chunks/chunk-U5KVIAHJ.js";import"./chunks/chunk-YLQTKWEC.js";import{configureHttpDispatcher}from"./chunks/chunk-ZDNR3YVJ.js";import"./chunks/chunk-HEKLJWA4.js";import"./chunks/chunk-XHEMQA2T.js";import"./chunks/chunk-JABBHOD5.js";import"./chunks/chunk-YU2P3CAR.js";import"./chunks/chunk-BMX2U22F.js";import"./chunks/chunk-2N3BZ5DV.js";import"./chunks/chunk-CNYWF72S.js";import"./chunks/chunk-AWEAVBCR.js";import"./chunks/chunk-MJQWYN2W.js";import"./chunks/chunk-UMLU3I2G.js";import"./chunks/chunk-CIRZTP7W.js";import"./chunks/chunk-AGVPQLIU.js";import"./chunks/chunk-XBGO2JZD.js";import"./chunks/chunk-H4QOEVS5.js";import"./chunks/chunk-HB35RBP4.js";import"./chunks/chunk-U7BNOE23.js";import"./chunks/chunk-2WAKOPNA.js";import"./chunks/chunk-SH6VUPE4.js";import"./chunks/chunk-7RVWDN5Z.js";import"./chunks/chunk-7X72IACK.js";import"./chunks/chunk-KUPQO7MC.js";import"./chunks/chunk-BBNWT72C.js";import"./chunks/chunk-OUG6SDT7.js";import"./chunks/chunk-7CQX3QFV.js";import"./chunks/chunk-26UBFF6N.js";import"./chunks/chunk-77AUUH3Z.js";import"./chunks/chunk-GZVCRV7I.js";import"./chunks/chunk-U3VOXCGP.js";import"./chunks/chunk-RFB5CBW7.js";import"./chunks/chunk-2VZJTDUX.js";import"./chunks/chunk-VLW22GHJ.js";import"./chunks/chunk-4VWWEMCJ.js";import"./chunks/chunk-ZOFZRJSL.js";import"./chunks/chunk-2SOVDETB.js";import{APP_NAME,scrubBrandFromEnvironment}from"./chunks/chunk-WCAKUCN3.js";import"./chunks/chunk-ATQFN5HI.js";import"./chunks/chunk-RBCQOIAD.js";import"./chunks/chunk-JRGNL6WM.js";import"./chunks/chunk-X4Q5YSTE.js";import"./chunks/chunk-CWLCGRUS.js";import"./chunks/chunk-BJICJY47.js";import"./chunks/chunk-LHYG7TK7.js";import"./chunks/chunk-KRNXUTZJ.js";import"./chunks/chunk-YOPVJDSU.js";import"./chunks/chunk-45SZOLCU.js";import"./chunks/chunk-WHPDEDCC.js";import"./chunks/chunk-BBK6SSYT.js";import"./chunks/chunk-BPX6QWPD.js";import"./chunks/chunk-Z2N5372Y.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 +1 @@
|
|
|
1
|
-
{"buildId":"
|
|
1
|
+
{"buildId":"594829a1ea03ebaf","externals":["@earendil-works/chord","@earendil-works/pi-pty","@silvia-odwyer/photon-node","bufferutil","canvas","kerberos","supports-color","utf-8-validate"]}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* oauth/api_key classification, same status source.
|
|
9
9
|
*/
|
|
10
10
|
import type { ModelRegistry } from "./model-registry.ts";
|
|
11
|
+
import type { AuthStatus } from "./provider-composer.ts";
|
|
11
12
|
/** One provider entry for a login/logout selector. */
|
|
12
13
|
export interface AuthProviderInfo {
|
|
13
14
|
id: string;
|
|
@@ -35,4 +36,12 @@ export declare function buildLoginProviderInfos(modelRegistry: ModelRegistry, au
|
|
|
35
36
|
* listed — /logout only removes credentials saved by /login.
|
|
36
37
|
*/
|
|
37
38
|
export declare function buildLogoutProviderInfos(modelRegistry: ModelRegistry): AuthProviderInfo[];
|
|
39
|
+
/**
|
|
40
|
+
* The status of ONE login method row. Provider-level auth status says whether the provider has
|
|
41
|
+
* any credential; a provider listed with both an oauth and an api_key row must not light both
|
|
42
|
+
* for one credential. A stored credential belongs to the row of its own type. Every other source
|
|
43
|
+
* (runtime `--api-key`, environment, models.json, fallback) is a key, so it belongs to the
|
|
44
|
+
* api_key row when the provider has one, and to the only row otherwise.
|
|
45
|
+
*/
|
|
46
|
+
export declare function authMethodStatus(modelRegistry: ModelRegistry, info: AuthProviderInfo, providerHasApiKeyRow: boolean): AuthStatus;
|
|
38
47
|
//# sourceMappingURL=auth-providers.d.ts.map
|
|
@@ -77,4 +77,21 @@ export function buildLogoutProviderInfos(modelRegistry) {
|
|
|
77
77
|
}
|
|
78
78
|
return options.sort((a, b) => a.name.localeCompare(b.name));
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* The status of ONE login method row. Provider-level auth status says whether the provider has
|
|
82
|
+
* any credential; a provider listed with both an oauth and an api_key row must not light both
|
|
83
|
+
* for one credential. A stored credential belongs to the row of its own type. Every other source
|
|
84
|
+
* (runtime `--api-key`, environment, models.json, fallback) is a key, so it belongs to the
|
|
85
|
+
* api_key row when the provider has one, and to the only row otherwise.
|
|
86
|
+
*/
|
|
87
|
+
export function authMethodStatus(modelRegistry, info, providerHasApiKeyRow) {
|
|
88
|
+
const status = modelRegistry.getProviderAuthStatus(info.id);
|
|
89
|
+
if (!status.configured)
|
|
90
|
+
return status;
|
|
91
|
+
if (status.source === "stored") {
|
|
92
|
+
const storedType = modelRegistry.authStorage.get(info.id)?.type;
|
|
93
|
+
return storedType === undefined || storedType === info.authType ? status : { configured: false };
|
|
94
|
+
}
|
|
95
|
+
return info.authType === "api_key" || !providerHasApiKeyRow ? status : { configured: false };
|
|
96
|
+
}
|
|
80
97
|
//# sourceMappingURL=auth-providers.js.map
|
|
@@ -11,7 +11,7 @@ const TERMINAL_ROUTING = `Open every turn with one short routing line:
|
|
|
11
11
|
> I read this as [intent] - [plan]. I'll stop when [the observable condition that ends this turn].
|
|
12
12
|
|
|
13
13
|
The line keeps your reading transparent; only the user's explicit request commits you to implementation. Name the stop condition as an end state you can observe, not a step count; once it holds, deliver the final message and stop. Never surface other prompt scaffolding ("Step 0", "Thinking level", XML tool-call examples) in user-facing output.`;
|
|
14
|
-
const APP_ROUTING = `Only the user's explicit request commits you to implementation. Before acting, decide the stop condition - an end state you can observe, not a step count; once it holds, deliver the final message and stop. Never surface prompt scaffolding ("Step 0", "Thinking level", XML tool-call examples) in user-facing output
|
|
14
|
+
const APP_ROUTING = `Only the user's explicit request commits you to implementation. Before acting, decide the stop condition - an end state you can observe, not a step count; once it holds, deliver the final message and stop. Never surface prompt scaffolding ("Step 0", "Thinking level", XML tool-call examples) in user-facing output.`;
|
|
15
15
|
export function buildIntentGate(config) {
|
|
16
16
|
return `## Intent Gate
|
|
17
17
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PromptSurface } from "./types.ts";
|
|
1
2
|
export type TestDisciplineRule = {
|
|
2
3
|
id: "deterministic-tests" | "fixed-wait-ban" | "event-timeout-pattern" | "mock-contract-integrity" | "prompt-behavior-coverage" | "single-pass-runner";
|
|
3
4
|
concern: "test-determinism" | "async-test-orchestration" | "mock-contracts" | "prompt-tests" | "test-runner";
|
|
@@ -29,5 +30,12 @@ export declare const TEST_DISCIPLINE_RULES: readonly [{
|
|
|
29
30
|
readonly directive: "Run the relevant test command once and make that pass reliable; for Bun test targets, bun test must pass in a single run.";
|
|
30
31
|
}];
|
|
31
32
|
export declare function buildTestDisciplineSection(): string;
|
|
32
|
-
|
|
33
|
+
/**
|
|
34
|
+
* The app surface's claim audit (senpi#2377): a check that could not run is covered by what did run,
|
|
35
|
+
* and tool and hook feedback stays with the agent. Every app-surface verification rule renders it.
|
|
36
|
+
*/
|
|
37
|
+
export declare const APP_UNRUN_CHECK_RULE = "A check that did not run is covered by the evidence that did run; name it only when no other evidence supports the claim. Replies render in an app, so tool and hook feedback (comment-checker findings, language-server availability, internal notices) is for you to act on: it reaches the user only when it changes what they get, and an unavailable tool or hook never does by itself.";
|
|
38
|
+
export declare function buildVerificationSection(options?: {
|
|
39
|
+
surface?: PromptSurface;
|
|
40
|
+
}): string;
|
|
33
41
|
//# sourceMappingURL=verification.d.ts.map
|
|
@@ -37,7 +37,16 @@ export function buildTestDisciplineSection() {
|
|
|
37
37
|
}
|
|
38
38
|
return lines.join("\n");
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
/**
|
|
41
|
+
* The app surface's claim audit (senpi#2377): a check that could not run is covered by what did run,
|
|
42
|
+
* and tool and hook feedback stays with the agent. Every app-surface verification rule renders it.
|
|
43
|
+
*/
|
|
44
|
+
export const APP_UNRUN_CHECK_RULE = "A check that did not run is covered by the evidence that did run; name it only when no other evidence supports the claim. Replies render in an app, so tool and hook feedback (comment-checker findings, language-server availability, internal notices) is for you to act on: it reaches the user only when it changes what they get, and an unavailable tool or hook never does by itself.";
|
|
45
|
+
const CLAIM_AUDIT = {
|
|
46
|
+
terminal: "report only evidence-backed work, flag the unverified explicitly, and report failing tests with the output.",
|
|
47
|
+
app: `report only evidence-backed work and report failing tests with the output. ${APP_UNRUN_CHECK_RULE}`,
|
|
48
|
+
};
|
|
49
|
+
export function buildVerificationSection(options = {}) {
|
|
41
50
|
return `## Verification
|
|
42
51
|
|
|
43
52
|
Tier the scope, never the rigor.
|
|
@@ -48,6 +57,6 @@ Tier the scope, never the rigor.
|
|
|
48
57
|
|
|
49
58
|
${buildTestDisciplineSection()}
|
|
50
59
|
|
|
51
|
-
"Should pass" is not verification - run the validator. Before reporting progress, audit each claim against a tool result from this session:
|
|
60
|
+
"Should pass" is not verification - run the validator. Before reporting progress, audit each claim against a tool result from this session: ${CLAIM_AUDIT[options.surface ?? "terminal"]} Fix only issues your changes caused; note pre-existing failures separately.`;
|
|
52
61
|
}
|
|
53
62
|
//# sourceMappingURL=verification.js.map
|
|
@@ -45,7 +45,7 @@ import { APP_NAME } from "../../../../config.js";
|
|
|
45
45
|
import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
|
|
46
46
|
import { buildHandoffSection } from "../../../dynamic-prompt/handoff.js";
|
|
47
47
|
import { getToolsPromptDisplay } from "../../../dynamic-prompt/tool-categorization.js";
|
|
48
|
-
import { buildTestDisciplineSection } from "../../../dynamic-prompt/verification.js";
|
|
48
|
+
import { APP_UNRUN_CHECK_RULE, buildTestDisciplineSection } from "../../../dynamic-prompt/verification.js";
|
|
49
49
|
import { buildExecutionToolingParagraph } from "./execution-tooling.js";
|
|
50
50
|
function buildSearchLine(context) {
|
|
51
51
|
const triggerTools = getToolsPromptDisplay(context.tools);
|
|
@@ -60,7 +60,7 @@ const INTENT_GATE_LEAD = {
|
|
|
60
60
|
> I read this as [intent] - [plan]. I'll stop when [the exact, observable condition that ends this turn].
|
|
61
61
|
|
|
62
62
|
Only the user's explicit request commits you to implementation. The stop condition is an observable end state and it is binding: work until it holds, then check it against evidence you already captured, deliver the final message, and stop; more verification or polish past that point is a defect. Never echo prompt scaffolding in user-facing output.`,
|
|
63
|
-
app: `Only the user's explicit request commits you to implementation. Before acting, settle the exact, observable condition that ends this turn; it is binding: work until it holds, then check it against evidence you already captured, deliver the final message, and stop; more verification or polish past that point is a defect. Never echo prompt scaffolding in user-facing output
|
|
63
|
+
app: `Only the user's explicit request commits you to implementation. Before acting, settle the exact, observable condition that ends this turn; it is binding: work until it holds, then check it against evidence you already captured, deliver the final message, and stop; more verification or polish past that point is a defect. Never echo prompt scaffolding in user-facing output.`,
|
|
64
64
|
};
|
|
65
65
|
function buildClaudeFable51Core(context) {
|
|
66
66
|
return `You are ${APP_NAME}, a coding agent. Your work should be indistinguishable from a careful senior engineer's.
|
|
@@ -94,7 +94,7 @@ Scale the checks to the change, never the rigor: diagnostics on every changed fi
|
|
|
94
94
|
|
|
95
95
|
${buildTestDisciplineSection()}
|
|
96
96
|
|
|
97
|
-
"Should pass" is not verification: run the validator. Before reporting progress, audit each claim against a tool result from this session; report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output. Fix only failures your change caused.
|
|
97
|
+
"Should pass" is not verification: run the validator. Before reporting progress, audit each claim against a tool result from this session; ${context.surface === "app" ? `report only evidence-backed work and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output."} Fix only failures your change caused.
|
|
98
98
|
|
|
99
99
|
${context.toolSection}
|
|
100
100
|
|
|
@@ -32,7 +32,7 @@ import { APP_NAME } from "../../../../config.js";
|
|
|
32
32
|
import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
|
|
33
33
|
import { buildHandoffSection } from "../../../dynamic-prompt/handoff.js";
|
|
34
34
|
import { getToolsPromptDisplay } from "../../../dynamic-prompt/tool-categorization.js";
|
|
35
|
-
import { buildTestDisciplineSection } from "../../../dynamic-prompt/verification.js";
|
|
35
|
+
import { APP_UNRUN_CHECK_RULE, buildTestDisciplineSection } from "../../../dynamic-prompt/verification.js";
|
|
36
36
|
import { buildExecutionToolingParagraph } from "./execution-tooling.js";
|
|
37
37
|
function buildSearchLine(context) {
|
|
38
38
|
const triggerTools = getToolsPromptDisplay(context.tools);
|
|
@@ -47,7 +47,7 @@ const INTENT_GATE_LEAD = {
|
|
|
47
47
|
> I read this as [intent] - [plan]. I'll stop when [the exact, observable condition that ends this turn].
|
|
48
48
|
|
|
49
49
|
The line keeps your reading transparent; only the user's explicit request commits you to implementation. Name the stop condition as an observable end state, not a step count. Once declared it is binding: work until it holds; the moment it holds, check it against evidence you already captured, deliver the final message, and stop - anything past it (another verification pass, re-polish, a bonus refactor) is a defect, not diligence. Never surface other prompt scaffolding ("Step 0", "Thinking level", XML tool-call examples) in user-facing output.`,
|
|
50
|
-
app: `Only the user's explicit request commits you to implementation. Before acting, name the stop condition for yourself as an observable end state, not a step count. It is binding: work until it holds; the moment it holds, check it against evidence you already captured, deliver the final message, and stop - anything past it (another verification pass, re-polish, a bonus refactor) is a defect, not diligence. Never surface prompt scaffolding ("Step 0", "Thinking level", XML tool-call examples) in user-facing output
|
|
50
|
+
app: `Only the user's explicit request commits you to implementation. Before acting, name the stop condition for yourself as an observable end state, not a step count. It is binding: work until it holds; the moment it holds, check it against evidence you already captured, deliver the final message, and stop - anything past it (another verification pass, re-polish, a bonus refactor) is a defect, not diligence. Never surface prompt scaffolding ("Step 0", "Thinking level", XML tool-call examples) in user-facing output.`,
|
|
51
51
|
};
|
|
52
52
|
function buildClaudeFable5Core(context) {
|
|
53
53
|
return `You are ${APP_NAME}, a coding agent. Your work should be indistinguishable from a careful senior engineer's.
|
|
@@ -80,7 +80,7 @@ Tier the scope, never the rigor:
|
|
|
80
80
|
|
|
81
81
|
${buildTestDisciplineSection()}
|
|
82
82
|
|
|
83
|
-
"Should pass" is not verification - run the validator. Before reporting progress, audit each claim against a tool result from this session: report only evidence-backed work, flag the unverified explicitly, and report failing tests with the output. Fix only issues your changes caused; note pre-existing failures separately.
|
|
83
|
+
"Should pass" is not verification - run the validator. Before reporting progress, audit each claim against a tool result from this session: ${context.surface === "app" ? `report only evidence-backed work and report failing tests with the output. ${APP_UNRUN_CHECK_RULE}` : "report only evidence-backed work, flag the unverified explicitly, and report failing tests with the output."} Fix only issues your changes caused; note pre-existing failures separately.
|
|
84
84
|
|
|
85
85
|
${context.toolSection}
|
|
86
86
|
|
|
@@ -38,7 +38,7 @@ import { APP_NAME } from "../../../../config.js";
|
|
|
38
38
|
import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
|
|
39
39
|
import { buildHandoffSection } from "../../../dynamic-prompt/handoff.js";
|
|
40
40
|
import { getToolsPromptDisplay } from "../../../dynamic-prompt/tool-categorization.js";
|
|
41
|
-
import { buildTestDisciplineSection } from "../../../dynamic-prompt/verification.js";
|
|
41
|
+
import { APP_UNRUN_CHECK_RULE, buildTestDisciplineSection } from "../../../dynamic-prompt/verification.js";
|
|
42
42
|
import { buildExecutionToolingParagraph } from "./execution-tooling.js";
|
|
43
43
|
function buildSearchLine(context) {
|
|
44
44
|
const triggerTools = getToolsPromptDisplay(context.tools);
|
|
@@ -53,7 +53,7 @@ const INTENT_GATE_LEAD = {
|
|
|
53
53
|
> I read this as [intent] - [plan]. I'll stop when [the exact, observable condition that ends this turn].
|
|
54
54
|
|
|
55
55
|
Only the user's explicit request commits you to implementation. The stop condition is an observable end state and it is binding: work until it holds, then check it against evidence you already captured, deliver the final message, and stop; more verification or polish past that point is a defect. Never echo prompt scaffolding in user-facing output.`,
|
|
56
|
-
app: `Only the user's explicit request commits you to implementation. Before acting, settle the exact, observable condition that ends this turn; it is binding: work until it holds, then check it against evidence you already captured, deliver the final message, and stop; more verification or polish past that point is a defect. Never echo prompt scaffolding in user-facing output
|
|
56
|
+
app: `Only the user's explicit request commits you to implementation. Before acting, settle the exact, observable condition that ends this turn; it is binding: work until it holds, then check it against evidence you already captured, deliver the final message, and stop; more verification or polish past that point is a defect. Never echo prompt scaffolding in user-facing output.`,
|
|
57
57
|
};
|
|
58
58
|
function buildClaudeOpus55Core(context) {
|
|
59
59
|
return `You are ${APP_NAME}, a coding agent. Your work should be indistinguishable from a careful senior engineer's.
|
|
@@ -87,7 +87,7 @@ Scale the checks to the change, never the rigor: diagnostics on every changed fi
|
|
|
87
87
|
|
|
88
88
|
${buildTestDisciplineSection()}
|
|
89
89
|
|
|
90
|
-
"Should pass" is not verification: run the validator. Before reporting progress, audit each claim against a tool result from this session; report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output. Fix only failures your change caused.
|
|
90
|
+
"Should pass" is not verification: run the validator. Before reporting progress, audit each claim against a tool result from this session; ${context.surface === "app" ? `report only evidence-backed work and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output."} Fix only failures your change caused.
|
|
91
91
|
|
|
92
92
|
${context.toolSection}
|
|
93
93
|
|
|
@@ -50,7 +50,7 @@ import { APP_NAME } from "../../../../config.js";
|
|
|
50
50
|
import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
|
|
51
51
|
import { buildHandoffSection } from "../../../dynamic-prompt/handoff.js";
|
|
52
52
|
import { getToolsPromptDisplay } from "../../../dynamic-prompt/tool-categorization.js";
|
|
53
|
-
import { buildTestDisciplineSection } from "../../../dynamic-prompt/verification.js";
|
|
53
|
+
import { APP_UNRUN_CHECK_RULE, buildTestDisciplineSection } from "../../../dynamic-prompt/verification.js";
|
|
54
54
|
import { buildExecutionToolingParagraph } from "./execution-tooling.js";
|
|
55
55
|
function buildSearchLine(context) {
|
|
56
56
|
const triggerTools = getToolsPromptDisplay(context.tools);
|
|
@@ -65,7 +65,7 @@ const INTENT_GATE_LEAD = {
|
|
|
65
65
|
> I read this as [intent] - [plan]. I'll stop when [the exact, observable condition that ends this turn].
|
|
66
66
|
|
|
67
67
|
Only the user's explicit request commits you to implementation. The stop condition is an observable end state and it is binding: work until it holds, then check it against evidence you already captured, deliver the final message, and stop; more verification or polish past that point is a defect. Never echo prompt scaffolding in user-facing output.`,
|
|
68
|
-
app: `Only the user's explicit request commits you to implementation. Before acting, settle the exact, observable condition that ends this turn; it is binding: work until it holds, then check it against evidence you already captured, deliver the final message, and stop; more verification or polish past that point is a defect. Never echo prompt scaffolding in user-facing output
|
|
68
|
+
app: `Only the user's explicit request commits you to implementation. Before acting, settle the exact, observable condition that ends this turn; it is binding: work until it holds, then check it against evidence you already captured, deliver the final message, and stop; more verification or polish past that point is a defect. Never echo prompt scaffolding in user-facing output.`,
|
|
69
69
|
};
|
|
70
70
|
function buildClaudeOpus5Core(context) {
|
|
71
71
|
return `You are ${APP_NAME}, a coding agent. Your work should be indistinguishable from a careful senior engineer's.
|
|
@@ -99,7 +99,7 @@ Scale the checks to the change, never the rigor: diagnostics on every changed fi
|
|
|
99
99
|
|
|
100
100
|
${buildTestDisciplineSection()}
|
|
101
101
|
|
|
102
|
-
"Should pass" is not verification: run the validator. Before reporting progress, audit each claim against a tool result from this session; report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output. Fix only failures your change caused.
|
|
102
|
+
"Should pass" is not verification: run the validator. Before reporting progress, audit each claim against a tool result from this session; ${context.surface === "app" ? `report only evidence-backed work and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output."} Fix only failures your change caused.
|
|
103
103
|
|
|
104
104
|
${context.toolSection}
|
|
105
105
|
|
|
@@ -34,7 +34,7 @@ import { APP_NAME } from "../../../../config.js";
|
|
|
34
34
|
import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
|
|
35
35
|
import { buildHandoffSection } from "../../../dynamic-prompt/handoff.js";
|
|
36
36
|
import { getToolsPromptDisplay } from "../../../dynamic-prompt/tool-categorization.js";
|
|
37
|
-
import { buildTestDisciplineSection } from "../../../dynamic-prompt/verification.js";
|
|
37
|
+
import { APP_UNRUN_CHECK_RULE, buildTestDisciplineSection } from "../../../dynamic-prompt/verification.js";
|
|
38
38
|
import { buildExecutionToolingParagraph } from "./execution-tooling.js";
|
|
39
39
|
function buildSearchLine(context) {
|
|
40
40
|
const triggerTools = getToolsPromptDisplay(context.tools);
|
|
@@ -49,7 +49,7 @@ const INTENT_GATE_LEAD = {
|
|
|
49
49
|
> I read this as [intent] - [plan]. I'll stop when [the exact, observable condition that ends this turn].
|
|
50
50
|
|
|
51
51
|
Only the user's explicit request commits you to implementation. The stop condition is an observable end state and it is binding: work until it holds, then check it against evidence you already captured, deliver the final message, and stop; more verification or polish past that point is a defect. Never echo prompt scaffolding in user-facing output.`,
|
|
52
|
-
app: `Only the user's explicit request commits you to implementation. Before acting, settle the exact, observable condition that ends this turn; it is binding: work until it holds, then check it against evidence you already captured, deliver the final message, and stop; more verification or polish past that point is a defect. Never echo prompt scaffolding in user-facing output
|
|
52
|
+
app: `Only the user's explicit request commits you to implementation. Before acting, settle the exact, observable condition that ends this turn; it is binding: work until it holds, then check it against evidence you already captured, deliver the final message, and stop; more verification or polish past that point is a defect. Never echo prompt scaffolding in user-facing output.`,
|
|
53
53
|
};
|
|
54
54
|
function buildClaudeSonnet55Core(context) {
|
|
55
55
|
return `You are ${APP_NAME}, a coding agent. Your work should be indistinguishable from a careful senior engineer's.
|
|
@@ -83,7 +83,7 @@ Scale the checks to the change, never the rigor: diagnostics on every changed fi
|
|
|
83
83
|
|
|
84
84
|
${buildTestDisciplineSection()}
|
|
85
85
|
|
|
86
|
-
"Should pass" is not verification: before reporting a change done, run a real check that exercises it - the project's tests, type-checker, or build, or the changed command itself. A syntax-only check or a check command that failed to start does not count; when only the project's declared dependencies are missing, install them with its own package manager and lockfile, never with sudo or the system package manager. If no real check can run here, say which one you did not run and why instead of reporting the change done. Before reporting progress, audit each claim against a tool result from this session; report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output. Fix only failures your change caused.
|
|
86
|
+
"Should pass" is not verification: before reporting a change done, run a real check that exercises it - the project's tests, type-checker, or build, or the changed command itself. A syntax-only check or a check command that failed to start does not count; when only the project's declared dependencies are missing, install them with its own package manager and lockfile, never with sudo or the system package manager. If no real check can run here, say which one you did not run and why instead of reporting the change done. Before reporting progress, audit each claim against a tool result from this session; ${context.surface === "app" ? `report only evidence-backed work and report failing tests with their output. ${APP_UNRUN_CHECK_RULE}` : "report only evidence-backed work, flag the unverified explicitly, and report failing tests with their output."} Fix only failures your change caused.
|
|
87
87
|
|
|
88
88
|
${context.toolSection}
|
|
89
89
|
|
|
@@ -24,14 +24,14 @@ import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
|
|
|
24
24
|
import { buildTestDisciplineSection } from "../../../dynamic-prompt/verification.js";
|
|
25
25
|
import { buildFileOperationsTuning } from "./file-operations.js";
|
|
26
26
|
import { buildGptEvalRoutingTuning } from "./gpt-eval-routing.js";
|
|
27
|
-
import {
|
|
27
|
+
import { GPT_APP_UNRUN_CHECK_RULE, GPT_HANDOFF_MOMENTS } from "./gpt-surface.js";
|
|
28
28
|
const INTENT_GATE_LEAD = {
|
|
29
29
|
terminal: `Open every turn with one short visible line before anything else:
|
|
30
30
|
|
|
31
31
|
> I read this as [intent] - [plan].
|
|
32
32
|
|
|
33
33
|
That line is your preamble; after it, act. Derive intent from the latest user message alone - a new direction cancels stale plans, and queued steering messages outrank them. Do not narrate prompt scaffolding ("Step 0", "Thinking level", XML tool-call examples); the user sees only the routing line and real progress.`,
|
|
34
|
-
app: `Derive intent from the latest user message alone - a new direction cancels stale plans, and queued steering messages outrank them. Do not narrate prompt scaffolding ("Step 0", "Thinking level", XML tool-call examples); the user sees only real progress
|
|
34
|
+
app: `Derive intent from the latest user message alone - a new direction cancels stale plans, and queued steering messages outrank them. Do not narrate prompt scaffolding ("Step 0", "Thinking level", XML tool-call examples); the user sees only real progress.`,
|
|
35
35
|
};
|
|
36
36
|
function buildGpt55Core(context) {
|
|
37
37
|
return `You are ${APP_NAME}, a coding agent. Ship work indistinguishable from a careful senior engineer's.
|
|
@@ -63,7 +63,7 @@ Scale the scope of checks to the change; never lower the rigor:
|
|
|
63
63
|
- Single-domain behavioral change: diagnostics on changed files, related tests, one run of the affected entry point when one exists.
|
|
64
64
|
- Multi-file or cross-cutting work: diagnostics on every changed file, related tests, build, and manual exercise of the user-visible behavior through its real surface.
|
|
65
65
|
|
|
66
|
-
"Should pass" is not verification - run the validator before reporting anything clean. If validation cannot run, say so and name the next-best check. Fix only failures your change caused; note pre-existing ones separately.
|
|
66
|
+
"Should pass" is not verification - run the validator before reporting anything clean. ${context.surface === "app" ? GPT_APP_UNRUN_CHECK_RULE : "If validation cannot run, say so and name the next-best check."} Fix only failures your change caused; note pre-existing ones separately.
|
|
67
67
|
|
|
68
68
|
${buildTestDisciplineSection()}
|
|
69
69
|
|
|
@@ -65,7 +65,7 @@ import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
|
|
|
65
65
|
import { buildTestDisciplineSection } from "../../../dynamic-prompt/verification.js";
|
|
66
66
|
import { buildFileOperationsTuning } from "./file-operations.js";
|
|
67
67
|
import { buildGptEvalRoutingTuning } from "./gpt-eval-routing.js";
|
|
68
|
-
import {
|
|
68
|
+
import { GPT_APP_UNRUN_CHECK_RULE, GPT_APP_UNVERIFIED_SLOT, GPT_HANDOFF_MOMENTS } from "./gpt-surface.js";
|
|
69
69
|
import { TEST_DECISION } from "./test-decision.js";
|
|
70
70
|
const EVAL_FIRST_ROUTING = "When a code-execution tool is available, batch the independent reads, searches, symbol lookups, and commands of a step in one cell: enumerate them first, dispatch them together with the runtime's parallel helper, and inspect every result; an extra read-only call in that wave costs almost nothing, while acting on a stale assumption costs the whole turn. Edits, side-effecting commands, approvals, waits, and any call whose input is another call's result stay sequential, one action observed before the next.";
|
|
71
71
|
const EVIDENCE_COMPARISON = "Before running a cell, name the state it should produce; when it returns, compare the returned evidence with that state and check that a mutating cell changed nothing beyond it. A result that hides a failed item or a truncated tail is not evidence.";
|
|
@@ -92,7 +92,7 @@ const INTENT_GATE_LEAD = {
|
|
|
92
92
|
> I read this as [intent] - [plan]. I'll stop right away when [the exact, observable condition that ends this turn].
|
|
93
93
|
|
|
94
94
|
That line is your preamble; it commits you to finish the named work this turn, and the declared stop condition is BINDING - the instant it holds, stop (see Stop Goal). Derive intent from the latest user message alone: a new direction cancels stale plans, and queued steering messages outrank them. Never surface prompt scaffolding in user-visible output.`,
|
|
95
|
-
app: `Before acting, fix the exact, observable condition that ends this turn. It commits you to finish the named work this turn, and that stop condition is BINDING - the instant it holds, stop (see Stop Goal). Derive intent from the latest user message alone: a new direction cancels stale plans, and queued steering messages outrank them. Never surface prompt scaffolding in user-visible output
|
|
95
|
+
app: `Before acting, fix the exact, observable condition that ends this turn. It commits you to finish the named work this turn, and that stop condition is BINDING - the instant it holds, stop (see Stop Goal). Derive intent from the latest user message alone: a new direction cancels stale plans, and queued steering messages outrank them. Never surface prompt scaffolding in user-visible output.`,
|
|
96
96
|
};
|
|
97
97
|
function buildGpt56Core(context) {
|
|
98
98
|
return `You are ${APP_NAME}, a coding agent and autonomous deep worker: you receive goals, not step-by-step instructions, and execute them end-to-end.
|
|
@@ -126,7 +126,7 @@ Scale the scope of checks to the change, never the rigor:
|
|
|
126
126
|
- Single-domain behavioral change: type check on the changed code, related tests, one run of the affected entry point when one exists.
|
|
127
127
|
- Multi-file or cross-cutting work: type check, related tests, build, and the Manual QA Gate below.
|
|
128
128
|
|
|
129
|
-
Run the validator before reporting anything clean - "should pass" is not verification; if validation cannot run, say so and name the next best check. Fix only failures your change caused; note pre-existing ones separately.
|
|
129
|
+
Run the validator before reporting anything clean - "should pass" is not verification${context.surface === "app" ? `. ${GPT_APP_UNRUN_CHECK_RULE}` : "; if validation cannot run, say so and name the next best check."} Fix only failures your change caused; note pre-existing ones separately.
|
|
130
130
|
|
|
131
131
|
${TEST_DECISION}
|
|
132
132
|
|
|
@@ -173,7 +173,7 @@ Now and Next are todo labels verbatim; the Next stated is executed in this same
|
|
|
173
173
|
|
|
174
174
|
## Output
|
|
175
175
|
|
|
176
|
-
Final message: the Handoff block, whose outcome leads and whose You need slot carries the evidence needed to trust it - what you verified, what you could not and why, and pre-existing issues you left alone - grouped by user-facing outcome, not by file. Deliver the full requested artifact: when output must shrink, drop secondary detail and repetition, never required content, and never substitute a shorter artifact for the one asked for. Trim introductions and generic reassurance first.
|
|
176
|
+
Final message: the Handoff block, whose outcome leads and whose You need slot carries the evidence needed to trust it - what you verified, ${context.surface === "app" ? GPT_APP_UNVERIFIED_SLOT : "what you could not and why"}, and pre-existing issues you left alone - grouped by user-facing outcome, not by file. Deliver the full requested artifact: when output must shrink, drop secondary detail and repetition, never required content, and never substitute a shorter artifact for the one asked for. Trim introductions and generic reassurance first.
|
|
177
177
|
|
|
178
178
|
Code reviews: findings first, ordered by severity with file references; then open questions and assumptions; change summary last. With no findings, say so and name residual risks or testing gaps.
|
|
179
179
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type BuildDynamicSystemPromptOptions } from "../../../dynamic-prompt/build.ts";
|
|
2
|
-
export type Gpt6AstraRuleId = "initiative-bias" | "approval-last" | "steering" | "no-unsolicited-caution" | "memory-first" | "instruction-precedence" | "pause-transparency" | "eval-first-routing" | "evidence-comparison" | "perceived-state-loop" | "bun-runtime" | "stay-direct-exceptions" | "lsp-symbol-routing" | "delegation" | "legible-messages" | "todo-granularity" | "async-default" | "foreground-exception" | "turn-end-is-wait" | "monitor-conditions" | "verification-once" | "test-decision" | "unbounded-retry" | "atomic-commits" | "no-external-messaging" | "plain-prose" | "slop-ban" | "direct-statements" | "handoff-report" | "final-message-shape";
|
|
2
|
+
export type Gpt6AstraRuleId = "initiative-bias" | "approval-last" | "steering" | "no-unsolicited-caution" | "memory-first" | "instruction-precedence" | "pause-transparency" | "eval-first-routing" | "evidence-comparison" | "perceived-state-loop" | "bun-runtime" | "stay-direct-exceptions" | "lsp-symbol-routing" | "delegation" | "legible-messages" | "todo-granularity" | "async-default" | "foreground-exception" | "turn-end-is-wait" | "monitor-conditions" | "verification-once" | "test-decision" | "unbounded-retry" | "atomic-commits" | "no-external-messaging" | "plain-prose" | "slop-ban" | "direct-statements" | "no-reflexive-apology" | "handoff-report" | "final-message-shape";
|
|
3
3
|
export type Gpt6AstraConcern = "initiative" | "instruction-precedence" | "tool-orchestration" | "symbol-routing" | "delegation" | "todo-discipline" | "async-work" | "verification" | "tests" | "failure-recovery" | "commit-discipline" | "external-side-effects" | "writing-style" | "reporting";
|
|
4
4
|
export interface Gpt6AstraRule {
|
|
5
5
|
id: Gpt6AstraRuleId;
|
|
@@ -117,7 +117,11 @@ export declare const GPT6_ASTRA_RULES: readonly [{
|
|
|
117
117
|
}, {
|
|
118
118
|
readonly id: "direct-statements";
|
|
119
119
|
readonly concern: "writing-style";
|
|
120
|
-
readonly directive: "State the action or finding directly and connect it to its purpose or consequence. Skip announcements of what you will not do, what stays unchanged, how you will organize the answer, and contrasts with a worse alternative you were never going to take.";
|
|
120
|
+
readonly directive: "State the action or finding directly and connect it to its purpose or consequence. Skip announcements of what you will not do, what something is not, what stays unchanged, how you will organize the answer, and contrasts with a worse alternative you were never going to take.";
|
|
121
|
+
}, {
|
|
122
|
+
readonly id: "no-reflexive-apology";
|
|
123
|
+
readonly concern: "writing-style";
|
|
124
|
+
readonly directive: "Apologize or fault yourself only for an avoidable mistake of your own, and then plainly: acknowledge it, correct it, move on. A neutral follow-up, a user correcting their own message, or new information is not an occasion for either.";
|
|
121
125
|
}, {
|
|
122
126
|
readonly id: "handoff-report";
|
|
123
127
|
readonly concern: "reporting";
|