@draht/coding-agent 2026.11.19-1 → 2026.11.19

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.
Files changed (65) hide show
  1. package/dist/bundle/chunks/{anthropic-messages-7PTOA4ZA.js → anthropic-messages-W6HN7XZW.js} +1 -1
  2. package/dist/bundle/chunks/{azure-openai-responses-CDW6FCMN.js → azure-openai-responses-IYU6JN7E.js} +1 -1
  3. package/dist/bundle/chunks/bedrock-converse-stream.js +21 -21
  4. package/dist/bundle/chunks/{chunk-7HQNDYWE.js → chunk-3YSKFWGJ.js} +1 -1
  5. package/dist/bundle/chunks/{chunk-GAABJAG4.js → chunk-5K3TBDND.js} +3 -3
  6. package/dist/bundle/chunks/chunk-6MSE6LZ3.js +6 -0
  7. package/dist/bundle/chunks/{chunk-O2P5SYXT.js → chunk-6QA6EP5G.js} +1 -1
  8. package/dist/bundle/chunks/chunk-736QBNUZ.js +12 -0
  9. package/dist/bundle/chunks/{chunk-CAOOVEOM.js → chunk-AQ4POXF4.js} +1 -1
  10. package/dist/bundle/chunks/chunk-BIBUE2PO.js +2 -0
  11. package/dist/bundle/chunks/chunk-CLONDAPI.js +9 -0
  12. package/dist/bundle/chunks/{chunk-4FPBO5KP.js → chunk-G7DJ6PIU.js} +1 -1
  13. package/dist/bundle/chunks/{chunk-WOIC265R.js → chunk-GRGZRSVX.js} +28 -28
  14. package/dist/bundle/chunks/{chunk-JI5YDTBB.js → chunk-GYCFH7QD.js} +1 -1
  15. package/dist/bundle/chunks/{chunk-3F4OOENR.js → chunk-IRBBJMGW.js} +1 -1
  16. package/dist/bundle/chunks/{chunk-GQXRTK54.js → chunk-ITP6IDBA.js} +2 -2
  17. package/dist/bundle/chunks/{chunk-HKQ3PU5T.js → chunk-J5PACQAM.js} +1 -1
  18. package/dist/bundle/chunks/{chunk-BQMYLQSG.js → chunk-K4FC3EMH.js} +8 -8
  19. package/dist/bundle/chunks/{chunk-6WESOD4H.js → chunk-KVH4HR57.js} +1 -1
  20. package/dist/bundle/chunks/{chunk-KFREX3FS.js → chunk-QVGSXIKT.js} +1 -1
  21. package/dist/bundle/chunks/{chunk-B6OJ7QX4.js → chunk-RHXTTWD5.js} +1 -1
  22. package/dist/bundle/chunks/{chunk-INKDO5TZ.js → chunk-SM2YWAF2.js} +3 -3
  23. package/dist/bundle/chunks/{chunk-YOPX5URH.js → chunk-SYW5VSBL.js} +1 -1
  24. package/dist/bundle/chunks/chunk-TIA2T6EO.js +3 -0
  25. package/dist/bundle/chunks/{chunk-MHNW355A.js → chunk-WZMHLLKP.js} +1 -1
  26. package/dist/bundle/chunks/{chunk-RI7HJ6AF.js → chunk-XY64T2H6.js} +10 -10
  27. package/dist/bundle/chunks/{cli-QUYXUKRF.js → cli-KSFELY3W.js} +1 -1
  28. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-W63EWPDW.js → cloudflare-workers-ai-system-one-WIIL62VL.js} +1 -1
  29. package/dist/bundle/chunks/{execute-KGJOWTPG.js → execute-YOMYOVUT.js} +1 -1
  30. package/dist/bundle/chunks/{google-generative-ai-M5WKK5CW.js → google-generative-ai-NZVCFKM4.js} +1 -1
  31. package/dist/bundle/chunks/{google-vertex-UYNOGPMI.js → google-vertex-BL3BF2VF.js} +1 -1
  32. package/dist/bundle/chunks/https-proxy-agent-O2PVUIOI.js +13 -0
  33. package/dist/bundle/chunks/lib-XOG5PI3Y.js +9 -0
  34. package/dist/bundle/chunks/{llama-cpp-classify-SAUGLDPT.js → llama-cpp-classify-GP2X3HGE.js} +1 -1
  35. package/dist/bundle/chunks/{mistral-conversations-VQ3J6W5K.js → mistral-conversations-2REUBSZJ.js} +1 -1
  36. package/dist/bundle/chunks/{multipart-parser-HMCXZ4BD.js → multipart-parser-AZP5BX2W.js} +1 -1
  37. package/dist/bundle/chunks/{node-DXZFQBEO.js → node-BZAVEWJ3.js} +1 -1
  38. package/dist/bundle/chunks/{node-LBZLUIBE.js → node-C2JGH2OB.js} +1 -1
  39. package/dist/bundle/chunks/{openai-codex-responses-JTGQLYC7.js → openai-codex-responses-7MQGGA7O.js} +1 -1
  40. package/dist/bundle/chunks/{openai-completions-WAW7BG4E.js → openai-completions-MTNKQNK4.js} +1 -1
  41. package/dist/bundle/chunks/{openai-decisions-KHHHHMGW.js → openai-decisions-UYPZJCVG.js} +1 -1
  42. package/dist/bundle/chunks/{openai-responses-GWADST54.js → openai-responses-QVXIRAUW.js} +1 -1
  43. package/dist/bundle/chunks/{openrouter-images-AP626CWG.js → openrouter-images-E6VXUX3T.js} +1 -1
  44. package/dist/bundle/chunks/{pi-messages-H5TYIEJT.js → pi-messages-KPT6QQD4.js} +1 -1
  45. package/dist/bundle/chunks/{runtime-73OLLYOI.js → runtime-3ZSEARRN.js} +1 -1
  46. package/dist/bundle/chunks/{runtime-FZKS2BWI.js → runtime-S5WBSLTE.js} +1 -1
  47. package/dist/bundle/chunks/{settings-manager-CWRQW6PZ.js → settings-manager-H3QEOPQ3.js} +1 -1
  48. package/dist/bundle/chunks/src-TIBHS42X.js +4 -0
  49. package/dist/bundle/chunks/{typesafe-system-one-RLPGOT75.js → typesafe-system-one-5RPPTQ5S.js} +1 -1
  50. package/dist/bundle/chunks/{virtual-modules-5V4G5GQH.js → virtual-modules-HCLXUIRY.js} +1 -1
  51. package/dist/bundle/cli-runtime.js +1 -1
  52. package/dist/bundle/index.js +1 -1
  53. package/dist/bundle/rpc-entry.js +1 -1
  54. package/package.json +9 -9
  55. package/dist/bundle/chunks/chunk-2JZLKNZ4.js +0 -3
  56. package/dist/bundle/chunks/chunk-6M3D4XVD.js +0 -2
  57. package/dist/bundle/chunks/chunk-BIXKXDGW.js +0 -9
  58. package/dist/bundle/chunks/chunk-GBFVS2SF.js +0 -12
  59. package/dist/bundle/chunks/chunk-LO6CVU2L.js +0 -6
  60. package/dist/bundle/chunks/https-proxy-agent-WQIRL24U.js +0 -13
  61. package/dist/bundle/chunks/lib-ULKZYRGD.js +0 -9
  62. package/dist/bundle/chunks/src-KDGO7EGF.js +0 -4
  63. /package/dist/bundle/chunks/{chunk-ATYP3OSV.js → chunk-OPLOTJXH.js} +0 -0
  64. /package/dist/bundle/chunks/{chunk-ITKDPD4D.js → chunk-PX3CDFUB.js} +0 -0
  65. /package/dist/bundle/chunks/{chunk-MOOADNVS.js → chunk-ZZD35WKM.js} +0 -0
@@ -0,0 +1,2 @@
1
+ import { createRequire as __drahtCreateRequire } from "node:module"; const require = __drahtCreateRequire(import.meta.url);
2
+ import{__commonJS,__require,__toESM}from"./chunk-HZ2UHMBT.js";var require_windows=__commonJS({"node_modules/isexe/windows.js"(exports,module){module.exports=isexe;isexe.sync=sync;var fs=__require("fs");function checkPathExt(path,options){var pathext=options.pathExt!==void 0?options.pathExt:process.env.PATHEXT;if(!pathext||(pathext=pathext.split(";"),pathext.indexOf("")!==-1))return!0;for(var i=0;i<pathext.length;i++){var p=pathext[i].toLowerCase();if(p&&path.substr(-p.length).toLowerCase()===p)return!0}return!1}function checkStat(stat,path,options){return!stat.isSymbolicLink()&&!stat.isFile()?!1:checkPathExt(path,options)}function isexe(path,options,cb){fs.stat(path,function(er,stat){cb(er,er?!1:checkStat(stat,path,options))})}function sync(path,options){return checkStat(fs.statSync(path),path,options)}}});var require_mode=__commonJS({"node_modules/isexe/mode.js"(exports,module){module.exports=isexe;isexe.sync=sync;var fs=__require("fs");function isexe(path,options,cb){fs.stat(path,function(er,stat){cb(er,er?!1:checkStat(stat,options))})}function sync(path,options){return checkStat(fs.statSync(path),options)}function checkStat(stat,options){return stat.isFile()&&checkMode(stat,options)}function checkMode(stat,options){var mod=stat.mode,uid=stat.uid,gid=stat.gid,myUid=options.uid!==void 0?options.uid:process.getuid&&process.getuid(),myGid=options.gid!==void 0?options.gid:process.getgid&&process.getgid(),u=parseInt("100",8),g=parseInt("010",8),o=parseInt("001",8),ug=u|g,ret=mod&o||mod&g&&gid===myGid||mod&u&&uid===myUid||mod&ug&&myUid===0;return ret}}});var require_isexe=__commonJS({"node_modules/isexe/index.js"(exports,module){var fs=__require("fs"),core;process.platform==="win32"||global.TESTING_WINDOWS?core=require_windows():core=require_mode();module.exports=isexe;isexe.sync=sync;function isexe(path,options,cb){if(typeof options=="function"&&(cb=options,options={}),!cb){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(resolve2,reject){isexe(path,options||{},function(er,is){er?reject(er):resolve2(is)})})}core(path,options||{},function(er,is){er&&(er.code==="EACCES"||options&&options.ignoreErrors)&&(er=null,is=!1),cb(er,is)})}function sync(path,options){try{return core.sync(path,options||{})}catch(er){if(options&&options.ignoreErrors||er.code==="EACCES")return!1;throw er}}}});var require_which=__commonJS({"node_modules/which/which.js"(exports,module){var isWindows=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",path=__require("path"),COLON=isWindows?";":":",isexe=require_isexe(),getNotFoundError=cmd=>Object.assign(new Error(`not found: ${cmd}`),{code:"ENOENT"}),getPathInfo=(cmd,opt)=>{let colon=opt.colon||COLON,pathEnv=cmd.match(/\//)||isWindows&&cmd.match(/\\/)?[""]:[...isWindows?[process.cwd()]:[],...(opt.path||process.env.PATH||"").split(colon)],pathExtExe=isWindows?opt.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",pathExt=isWindows?pathExtExe.split(colon):[""];return isWindows&&cmd.indexOf(".")!==-1&&pathExt[0]!==""&&pathExt.unshift(""),{pathEnv,pathExt,pathExtExe}},which=(cmd,opt,cb)=>{typeof opt=="function"&&(cb=opt,opt={}),opt||(opt={});let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[],step=i=>new Promise((resolve2,reject)=>{if(i===pathEnv.length)return opt.all&&found.length?resolve2(found):reject(getNotFoundError(cmd));let ppRaw=pathEnv[i],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;resolve2(subStep(p,i,0))}),subStep=(p,i,ii)=>new Promise((resolve2,reject)=>{if(ii===pathExt.length)return resolve2(step(i+1));let ext=pathExt[ii];isexe(p+ext,{pathExt:pathExtExe},(er,is)=>{if(!er&&is)if(opt.all)found.push(p+ext);else return resolve2(p+ext);return resolve2(subStep(p,i,ii+1))})});return cb?step(0).then(res=>cb(null,res),cb):step(0)},whichSync=(cmd,opt)=>{opt=opt||{};let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[];for(let i=0;i<pathEnv.length;i++){let ppRaw=pathEnv[i],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;for(let j=0;j<pathExt.length;j++){let cur=p+pathExt[j];try{if(isexe.sync(cur,{pathExt:pathExtExe}))if(opt.all)found.push(cur);else return cur}catch{}}}if(opt.all&&found.length)return found;if(opt.nothrow)return null;throw getNotFoundError(cmd)};module.exports=which;which.sync=whichSync}});var require_path_key=__commonJS({"node_modules/path-key/index.js"(exports,module){"use strict";var pathKey=(options={})=>{let environment=options.env||process.env;return(options.platform||process.platform)!=="win32"?"PATH":Object.keys(environment).reverse().find(key=>key.toUpperCase()==="PATH")||"Path"};module.exports=pathKey;module.exports.default=pathKey}});var require_resolveCommand=__commonJS({"node_modules/cross-spawn/lib/util/resolveCommand.js"(exports,module){"use strict";var path=__require("path"),which=require_which(),getPathKey=require_path_key();function resolveCommandAttempt(parsed,withoutPathExt){let env=parsed.options.env||process.env,cwd=process.cwd(),hasCustomCwd=parsed.options.cwd!=null,shouldSwitchCwd=hasCustomCwd&&process.chdir!==void 0&&!process.chdir.disabled;if(shouldSwitchCwd)try{process.chdir(parsed.options.cwd)}catch{}let resolved;try{resolved=which.sync(parsed.command,{path:env[getPathKey({env})],pathExt:withoutPathExt?path.delimiter:void 0})}catch{}finally{shouldSwitchCwd&&process.chdir(cwd)}return resolved&&(resolved=path.resolve(hasCustomCwd?parsed.options.cwd:"",resolved)),resolved}function resolveCommand(parsed){return resolveCommandAttempt(parsed)||resolveCommandAttempt(parsed,!0)}module.exports=resolveCommand}});var require_escape=__commonJS({"node_modules/cross-spawn/lib/util/escape.js"(exports,module){"use strict";var metaCharsRegExp=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(arg){return arg=arg.replace(metaCharsRegExp,"^$1"),arg}function escapeArgument(arg,doubleEscapeMetaChars){return arg=`${arg}`,arg=arg.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),arg=arg.replace(/(?=(\\+?)?)\1$/,"$1$1"),arg=`"${arg}"`,arg=arg.replace(metaCharsRegExp,"^$1"),doubleEscapeMetaChars&&(arg=arg.replace(metaCharsRegExp,"^$1")),arg}module.exports.command=escapeCommand;module.exports.argument=escapeArgument}});var require_shebang_regex=__commonJS({"node_modules/shebang-regex/index.js"(exports,module){"use strict";module.exports=/^#!(.*)/}});var require_shebang_command=__commonJS({"node_modules/shebang-command/index.js"(exports,module){"use strict";var shebangRegex=require_shebang_regex();module.exports=(string="")=>{let match=string.match(shebangRegex);if(!match)return null;let[path,argument]=match[0].replace(/#! ?/,"").split(" "),binary=path.split("/").pop();return binary==="env"?argument:argument?`${binary} ${argument}`:binary}}});var require_readShebang=__commonJS({"node_modules/cross-spawn/lib/util/readShebang.js"(exports,module){"use strict";var fs=__require("fs"),shebangCommand=require_shebang_command();function readShebang(command){let buffer=Buffer.alloc(150),fd;try{fd=fs.openSync(command,"r"),fs.readSync(fd,buffer,0,150,0),fs.closeSync(fd)}catch{}return shebangCommand(buffer.toString())}module.exports=readShebang}});var require_parse=__commonJS({"node_modules/cross-spawn/lib/parse.js"(exports,module){"use strict";var path=__require("path"),resolveCommand=require_resolveCommand(),escape=require_escape(),readShebang=require_readShebang(),isWin=process.platform==="win32",isExecutableRegExp=/\.(?:com|exe)$/i,isCmdShimRegExp=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(parsed){parsed.file=resolveCommand(parsed);let shebang=parsed.file&&readShebang(parsed.file);return shebang?(parsed.args.unshift(parsed.file),parsed.command=shebang,resolveCommand(parsed)):parsed.file}function parseNonShell(parsed){if(!isWin)return parsed;let commandFile=detectShebang(parsed),needsShell=!isExecutableRegExp.test(commandFile);if(parsed.options.forceShell||needsShell){let needsDoubleEscapeMetaChars=isCmdShimRegExp.test(commandFile);parsed.command=path.normalize(parsed.command),parsed.command=escape.command(parsed.command),parsed.args=parsed.args.map(arg=>escape.argument(arg,needsDoubleEscapeMetaChars));let shellCommand=[parsed.command].concat(parsed.args).join(" ");parsed.args=["/d","/s","/c",`"${shellCommand}"`],parsed.command=process.env.comspec||"cmd.exe",parsed.options.windowsVerbatimArguments=!0}return parsed}function parse(command,args,options){args&&!Array.isArray(args)&&(options=args,args=null),args=args?args.slice(0):[],options=Object.assign({},options);let parsed={command,args,options,file:void 0,original:{command,args}};return options.shell?parsed:parseNonShell(parsed)}module.exports=parse}});var require_enoent=__commonJS({"node_modules/cross-spawn/lib/enoent.js"(exports,module){"use strict";var isWin=process.platform==="win32";function notFoundError(original,syscall){return Object.assign(new Error(`${syscall} ${original.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${syscall} ${original.command}`,path:original.command,spawnargs:original.args})}function hookChildProcess(cp,parsed){if(!isWin)return;let originalEmit=cp.emit;cp.emit=function(name,arg1){if(name==="exit"){let err=verifyENOENT(arg1,parsed);if(err)return originalEmit.call(cp,"error",err)}return originalEmit.apply(cp,arguments)}}function verifyENOENT(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawn"):null}function verifyENOENTSync(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawnSync"):null}module.exports={hookChildProcess,verifyENOENT,verifyENOENTSync,notFoundError}}});var require_cross_spawn=__commonJS({"node_modules/cross-spawn/index.js"(exports,module){"use strict";var cp=__require("child_process"),parse=require_parse(),enoent=require_enoent();function spawn(command,args,options){let parsed=parse(command,args,options),spawned=cp.spawn(parsed.command,parsed.args,parsed.options);return enoent.hookChildProcess(spawned,parsed),spawned}function spawnSync(command,args,options){let parsed=parse(command,args,options),result=cp.spawnSync(parsed.command,parsed.args,parsed.options);return result.error=result.error||enoent.verifyENOENTSync(result.status,parsed),result}module.exports=spawn;module.exports.spawn=spawn;module.exports.sync=spawnSync;module.exports._parse=parse;module.exports._enoent=enoent}});import{statSync}from"node:fs";import{homedir}from"node:os";import{isAbsolute,join,resolve as nodeResolvePath,posix,relative,sep,win32}from"node:path";import{fileURLToPath}from"node:url";var import_cross_spawn=__toESM(require_cross_spawn(),1);import{spawn as nodeSpawn,spawnSync as nodeSpawnSync}from"node:child_process";import{constants as osConstants}from"node:os";var EXIT_STDIO_GRACE_MS=100;function exitCodeForSignal(signal){return 128+(osConstants.signals[signal]??0)}function spawnProcess(command,args,options){return process.platform==="win32"?(0,import_cross_spawn.default)(command,args,options):nodeSpawn(command,args,options)}function spawnProcessSync(command,args,options){return process.platform==="win32"?import_cross_spawn.default.sync(command,args,options):nodeSpawnSync(command,args,options)}function waitForChildProcess(child,options={}){let graceMs=options.exitStdioGraceMs??EXIT_STDIO_GRACE_MS;return new Promise((resolve2,reject)=>{let settled=!1,exited=!1,exitCode=null,exitSignal=null,postExitTimer,stdoutEnded=child.stdout===null,stderrEnded=child.stderr===null,cleanup=()=>{postExitTimer&&(clearTimeout(postExitTimer),postExitTimer=void 0),child.removeListener("error",onError),child.removeListener("exit",onExit),child.removeListener("close",onClose),child.stdout?.removeListener("end",onStdoutEnd),child.stderr?.removeListener("end",onStderrEnd),child.stdout?.removeListener("data",onData),child.stderr?.removeListener("data",onData)},finalize=()=>{settled||(settled=!0,cleanup(),child.stdout?.destroy(),child.stderr?.destroy(),resolve2(exitCode??(exitSignal?exitCodeForSignal(exitSignal):null)))},maybeFinalizeAfterExit=()=>{!exited||settled||stdoutEnded&&stderrEnded&&finalize()},armIdleTimer=()=>{postExitTimer&&clearTimeout(postExitTimer),postExitTimer=setTimeout(()=>finalize(),graceMs)},onData=()=>{exited&&!settled&&armIdleTimer()},onStdoutEnd=()=>{stdoutEnded=!0,maybeFinalizeAfterExit()},onStderrEnd=()=>{stderrEnded=!0,maybeFinalizeAfterExit()},onError=err=>{settled||(settled=!0,cleanup(),reject(err))},onExit=(code,signal)=>{exited=!0,exitCode=code,exitSignal=signal,maybeFinalizeAfterExit(),settled||armIdleTimer()},onClose=(code,signal)=>{exitCode=code,exitSignal=signal,finalize()};child.stdout?.once("end",onStdoutEnd),child.stderr?.once("end",onStderrEnd),child.stdout?.on("data",onData),child.stderr?.on("data",onData),child.once("error",onError),child.once("exit",onExit),child.once("close",onClose)})}var UNICODE_SPACES=/[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g;function getPathComparisonKey(path){let pathApi=getPlatformPathApi(),resolvedPath=pathApi.resolve(path);return pathApi===win32?resolvedPath.toLowerCase():resolvedPath}function getPlatformPathApi(){return process.platform==="win32"?win32:posix}function pathsEqual(left,right){return getPathComparisonKey(left)===getPathComparisonKey(right)}function isPathWithin(parent,child){let parentKey=getPathComparisonKey(parent),childKey=getPathComparisonKey(child);if(childKey===parentKey)return!0;let pathSep=getPlatformPathApi().sep;return childKey.startsWith(parentKey.endsWith(pathSep)?parentKey:`${parentKey}${pathSep}`)}function shortenHomePath(path,homeDir=homedir()){let pathApi=getPlatformPathApi();if(!homeDir||!pathApi.isAbsolute(path)||!isPathWithin(homeDir,path))return path;let relativePath=pathApi.relative(homeDir,path);return relativePath?`~${pathApi.sep}${relativePath}`:"~"}function getFileRevision(path){try{let stats=statSync(path,{bigint:!0});return`${stats.dev}:${stats.ino}:${stats.size}:${stats.mtimeNs}:${stats.ctimeNs}`}catch{return}}function isLocalPath(value){let trimmed=value.trim();return!(trimmed.startsWith("npm:")||trimmed.startsWith("git:")||trimmed.startsWith("github:")||trimmed.startsWith("http:")||trimmed.startsWith("https:")||trimmed.startsWith("ssh:")||trimmed.startsWith("builtin:"))}function normalizeWindowsShellPath(filePath){if(!filePath.startsWith("/")||filePath.startsWith("//")||filePath.includes("\\"))return filePath;let match=filePath.match(/^\/(?:mnt\/|cygdrive\/)?([a-z])(?:\/(.*))?$/i);if(!match)return filePath;let suffix=match[2]?.replaceAll("/","\\");return`${match[1].toUpperCase()}:\\${suffix??""}`}function normalizePath(input,options={}){let normalized=options.trim?input.trim():input;if(options.normalizeUnicodeSpaces&&(normalized=normalized.replace(UNICODE_SPACES," ")),options.stripAtPrefix&&normalized.startsWith("@")&&(normalized=normalized.slice(1)),process.platform==="win32"&&(normalized=normalizeWindowsShellPath(normalized)),options.expandTilde??!0){let home=options.homeDir??homedir();if(normalized==="~")return home;if(normalized.startsWith("~/")||process.platform==="win32"&&normalized.startsWith("~\\"))return join(home,normalized.slice(2))}return/^file:\/\//.test(normalized)?fileURLToPath(normalized):normalized}function resolvePath(input,baseDir=process.cwd(),options={}){let normalized=normalizePath(input,options),normalizedBaseDir=normalizePath(baseDir);return isAbsolute(normalized)?nodeResolvePath(normalized):nodeResolvePath(normalizedBaseDir,normalized)}function getCwdRelativePath(filePath,cwd){let resolvedCwd=resolvePath(cwd),resolvedPath=resolvePath(filePath,resolvedCwd),relativePath=relative(resolvedCwd,resolvedPath);return relativePath===""||relativePath!==".."&&!relativePath.startsWith(`..${sep}`)&&!isAbsolute(relativePath)?relativePath||".":void 0}function formatPathRelativeToCwdOrAbsolute(filePath,cwd){let absolutePath=resolvePath(filePath,cwd);return(getCwdRelativePath(absolutePath,cwd)??absolutePath).split(sep).join("/")}function markPathIgnoredByCloudSync(path){let attrs=process.platform==="darwin"?["com.dropbox.ignored","com.apple.fileprovider.ignore#P"]:process.platform==="linux"?["user.com.dropbox.ignored"]:[];for(let attr of attrs)process.platform==="darwin"?spawnProcessSync("xattr",["-w",attr,"1",path],{encoding:"utf-8",stdio:"ignore"}):spawnProcessSync("setfattr",["-n",attr,"-v","1",path],{encoding:"utf-8",stdio:"ignore"})}function splitBom(content){return content.startsWith("\uFEFF")?{bom:"\uFEFF",text:content.slice(1)}:{bom:"",text:content}}function stripBom(content){return splitBom(content).text}import{accessSync,constants,existsSync,readFileSync,realpathSync}from"fs";import{createRequire}from"module";import{homedir as homedir2}from"os";import{basename,dirname,join as join2,resolve,sep as sep2,win32 as win322}from"path";import{fileURLToPath as fileURLToPath2}from"url";var __filename=fileURLToPath2(import.meta.url),__dirname=dirname(__filename),isBunBinary=import.meta.url.includes("$bunfs")||import.meta.url.includes("~BUN")||import.meta.url.includes("%7EBUN"),isBunRuntime=!!process.versions.bun,isBundledNode=!0;function normalizeSelfUpdatePackageTarget(target){return typeof target=="string"?{packageName:target,installSpec:target}:{packageName:target.packageName,installSpec:target.installSpec??target.packageName}}function makeSelfUpdateCommand(installStep,uninstallStep){return uninstallStep?{...installStep,display:`${uninstallStep.display} && ${installStep.display}`,steps:[uninstallStep,installStep]}:installStep}function makeSelfUpdateCommandStep(command,args){return{command,args,display:[command,...args].map(arg=>/\s/.test(arg)?`"${arg}"`:arg).join(" ")}}function detectInstallMethod(){if(isBunBinary)return"bun-binary";let resolvedPath=`${__dirname}\0${process.execPath||""}`.toLowerCase().replace(/\\/g,"/");return resolvedPath.includes("/pnpm/")||resolvedPath.includes("/.pnpm/")?"pnpm":resolvedPath.includes("/yarn/")||resolvedPath.includes("/.yarn/")?"yarn":isBunRuntime||resolvedPath.includes("/install/global/node_modules/")?"bun":resolvedPath.includes("/npm/")||resolvedPath.includes("/node_modules/")?"npm":"unknown"}function getInferredNpmInstall(){let packageDir=getPackageDir(),path=process.platform==="win32"||packageDir.includes("\\")?win322:{basename,dirname},parent=path.dirname(packageDir),root;if(path.basename(parent).startsWith("@")&&path.basename(path.dirname(parent))==="node_modules"?root=path.dirname(parent):path.basename(parent)==="node_modules"&&(root=parent),!root)return;let rootParent=path.dirname(root);if(path.basename(rootParent)==="lib")return{root,prefix:path.dirname(rootParent)}}function getSelfUpdateCommandForMethod(method,installedPackageName,updatePackageTarget=installedPackageName,npmCommand){let target=normalizeSelfUpdatePackageTarget(updatePackageTarget);switch(method){case"bun-binary":return;case"pnpm":{let match=readCommandOutput("pnpm",["root","-g"])?void 0:/^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(getPackageDir()),binDirArgs=match?[`--config.global-bin-dir=${process.env.PNPM_HOME||dirname(dirname(match[1]))}`]:[];return makeSelfUpdateCommand(makeSelfUpdateCommandStep("pnpm",["install","-g","--ignore-scripts","--config.minimumReleaseAge=0",...binDirArgs,target.installSpec]),target.packageName===installedPackageName?void 0:makeSelfUpdateCommandStep("pnpm",["remove","-g",...binDirArgs,installedPackageName]))}case"yarn":return makeSelfUpdateCommand(makeSelfUpdateCommandStep("yarn",["global","add","--ignore-scripts",target.installSpec]),target.packageName===installedPackageName?void 0:makeSelfUpdateCommandStep("yarn",["global","remove",installedPackageName]));case"bun":return makeSelfUpdateCommand(makeSelfUpdateCommandStep("bun",["install","-g","--ignore-scripts","--minimum-release-age=0",target.installSpec]),target.packageName===installedPackageName?void 0:makeSelfUpdateCommandStep("bun",["uninstall","-g",installedPackageName]));case"npm":{let[command="npm",...npmArgs]=npmCommand??[],inferred=npmCommand?.length?void 0:getInferredNpmInstall(),prefixArgs=[...npmArgs,...inferred?["--prefix",inferred.prefix]:[]],installStep=makeSelfUpdateCommandStep(command,[...prefixArgs,"install","-g","--ignore-scripts","--min-release-age=0",target.installSpec]),uninstallStep=target.packageName===installedPackageName?void 0:makeSelfUpdateCommandStep(command,[...prefixArgs,"uninstall","-g",installedPackageName]);return makeSelfUpdateCommand(installStep,uninstallStep)}case"unknown":return}}function readCommandOutput(command,args,options={}){let result=spawnProcessSync(command,args,{encoding:"utf-8",stdio:["ignore","pipe","pipe"]});if(result.status===0)return result.stdout.trim()||void 0;if(options.requireSuccess){let reason=result.error?.message||result.stderr.trim()||`exit code ${result.status??"unknown"}`;throw new Error(`Failed to run ${[command,...args].join(" ")}: ${reason}`)}}function getGlobalPackageRoots(method,_packageName,npmCommand){switch(method){case"npm":{let configured=!!npmCommand?.length,[command="npm",...npmArgs]=npmCommand??[];if(configured&&command==="bun"){let bunBin=readCommandOutput(command,[...npmArgs,"pm","bin","-g"],{requireSuccess:!0}),roots=[join2(homedir2(),".bun","install","global","node_modules")];return bunBin&&roots.push(join2(dirname(bunBin),"install","global","node_modules")),roots}let root=readCommandOutput(command,[...npmArgs,"root","-g"],{requireSuccess:configured}),inferred=configured?void 0:getInferredNpmInstall();return[root,inferred?.root].filter(x=>!!x)}case"pnpm":{let root=readCommandOutput("pnpm",["root","-g"]);if(root)return[root,dirname(root)];let match=/^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(getPackageDir());return match?[match[1]]:[]}case"yarn":{let dir=readCommandOutput("yarn",["global","dir"]);return dir?[dir,join2(dir,"node_modules")]:[]}case"bun":{let bunBin=readCommandOutput("bun",["pm","bin","-g"]),roots=[join2(homedir2(),".bun","install","global","node_modules")];return bunBin&&roots.push(join2(dirname(bunBin),"install","global","node_modules")),roots}case"bun-binary":case"unknown":return[]}}function normalizeExistingPathForComparison(path,resolveSymlinks){let resolvedPath=resolve(path);if(!existsSync(resolvedPath))return;let normalizedPath=resolvedPath;if(resolveSymlinks)try{normalizedPath=realpathSync(resolvedPath)}catch{return}return process.platform==="win32"&&(normalizedPath=normalizedPath.toLowerCase()),normalizedPath}function getPathComparisonCandidates(path){return Array.from(new Set([normalizeExistingPathForComparison(path,!1),normalizeExistingPathForComparison(path,!0)].filter(candidate=>!!candidate)))}function getEntrypointPackageDir(){let entrypoint=process.argv[1];if(!entrypoint)return;let dir=dirname(entrypoint);for(;dir!==dirname(dir);){if(existsSync(join2(dir,"package.json")))return dir;dir=dirname(dir)}}function isSelfUpdatePathWritable(){let packageDir=getPackageDir();try{return accessSync(packageDir,constants.W_OK),accessSync(dirname(packageDir),constants.W_OK),!0}catch{return!1}}function isManagedByGlobalPackageManager(method,packageName,npmCommand){let packageDirCandidates=[getPackageDir(),getEntrypointPackageDir()].filter(dir=>!!dir).flatMap(dir=>getPathComparisonCandidates(dir));return getGlobalPackageRoots(method,packageName,npmCommand).some(root=>getPathComparisonCandidates(root).some(normalizedRoot=>{let rootPrefix=normalizedRoot.endsWith(sep2)?normalizedRoot:`${normalizedRoot}${sep2}`;return packageDirCandidates.some(packageDir=>packageDir.startsWith(rootPrefix))}))}function getSelfUpdateCommand(packageName,npmCommand,updatePackageTarget=packageName){let method=detectInstallMethod(),command=getSelfUpdateCommandForMethod(method,packageName,updatePackageTarget,npmCommand);if(!(!command||!isManagedByGlobalPackageManager(method,packageName,npmCommand)||!isSelfUpdatePathWritable()))return command}function getConfiguredSelfUpdateArgv(setting){let fromEnv=process.env.DRAHT_SELF_UPDATE_COMMAND?.trim().split(/\s+/).filter(Boolean);return fromEnv?.length?fromEnv:setting?.length?setting:void 0}function makeConfiguredSelfUpdateCommand(argv,release){let values={packageName:release.packageName,version:release.version,installSpec:`${release.packageName}@${release.version}`},[command="",...args]=argv.map(arg=>arg.replace(/\{(packageName|version|installSpec)\}/g,(_,name)=>values[name]));return makeSelfUpdateCommandStep(command,args)}function getSelfUpdateUnavailableInstruction(packageName,npmCommand,updatePackageTarget=packageName){let method=detectInstallMethod(),target=normalizeSelfUpdatePackageTarget(updatePackageTarget);if(method==="bun-binary")return"Download from: https://github.com/draht-dev/draht/releases/latest";let command=getSelfUpdateCommandForMethod(method,packageName,target,npmCommand);return command&&isManagedByGlobalPackageManager(method,packageName,npmCommand)&&!isSelfUpdatePathWritable()?`This installation is managed by a global ${method} install, but the install path is not writable. Update it yourself with: ${command.display}`:`Update ${target.installSpec} using the package manager, wrapper, or source checkout that provides this installation.`}function getPackageDir(){let envDir=process.env.DRAHT_PACKAGE_DIR;return envDir?normalizePath(envDir):isBunBinary?dirname(process.execPath):findPackageRoot(__dirname)}function isEmittedBundleDir(dir){return basename(dir)==="dist"&&existsSync(join2(dirname(dir),"package.json"))}function findPackageRoot(startDir){let dir=startDir;for(;dir!==dirname(dir);){if(existsSync(join2(dir,"package.json"))&&!isEmittedBundleDir(dir))return dir;dir=dirname(dir)}return startDir}function getThemesDir(){if(isBunBinary)return join2(getPackageDir(),"theme");let packageDir=getPackageDir(),srcOrDist=existsSync(join2(packageDir,"src"))?"src":"dist";return join2(packageDir,srcOrDist,"modes","interactive","theme")}function getExportTemplateDir(){if(isBunBinary)return join2(getPackageDir(),"export-html");let packageDir=getPackageDir(),srcOrDist=existsSync(join2(packageDir,"src"))?"src":"dist";return join2(packageDir,srcOrDist,"core","export-html")}function getPackageJsonPath(){return join2(getPackageDir(),"package.json")}function getReadmePath(){return resolve(join2(getPackageDir(),"README.md"))}function getDocsPath(){return resolve(join2(getPackageDir(),"docs"))}function getExamplesPath(){return resolve(join2(getPackageDir(),"examples"))}function getChangelogPath(){return resolve(join2(getPackageDir(),"CHANGELOG.md"))}function getInteractiveAssetsDir(){if(isBunBinary)return join2(getPackageDir(),"assets");let packageDir=getPackageDir(),srcOrDist=existsSync(join2(packageDir,"src"))?"src":"dist";return join2(packageDir,srcOrDist,"modes","interactive","assets")}function getBundledInteractiveAssetPath(name){return join2(getInteractiveAssetsDir(),name)}var quickJSWasmPath;function getQuickJSWasmPath(){return quickJSWasmPath??=createRequire(import.meta.url).resolve("quickjs-wasi/quickjs.wasm"),quickJSWasmPath}function resolveCodemodeWorkerSpecifier(runtime,moduleUrl){if(runtime==="bun-binary")return"./src/extensions/codemode/worker.ts";if(runtime==="bundled-node")return new URL("./codemode-worker.js",moduleUrl)}var codemodeWorkerDataUrl;function getCodemodeWorkerSpecifier(){let runtime=isBunBinary?"bun-binary":isBundledNode?"bundled-node":"unbundled",specifier=resolveCodemodeWorkerSpecifier(runtime,import.meta.url);return runtime!=="bundled-node"||!(specifier instanceof URL)?specifier:(codemodeWorkerDataUrl??=new URL(`data:text/javascript;base64,${readFileSync(specifier).toString("base64")}`),codemodeWorkerDataUrl)}function detectInstallChange(packageJsonPath=startupPackageJsonPath){if(isBunBinary||!packageJsonPath)return;let installed;try{installed=JSON.parse(stripBom(readFileSync(packageJsonPath,"utf-8")))}catch(error){return error.code==="ENOENT"?{kind:"removed"}:void 0}return installed.version&&installed.version!==VERSION?{kind:"updated",version:installed.version}:void 0}var pkg={},startupPackageJsonPath;try{let packageJsonPath=getPackageJsonPath();pkg=JSON.parse(stripBom(readFileSync(packageJsonPath,"utf-8"))),startupPackageJsonPath=packageJsonPath}catch(e){if(e.code!=="ENOENT")throw e}var drahtConfigName=pkg.drahtConfig?.name,PACKAGE_NAME=pkg.name||"@draht/coding-agent",APP_NAME=drahtConfigName||"draht",APP_TITLE=drahtConfigName?APP_NAME:"draht",CONFIG_DIR_NAME=pkg.drahtConfig?.configDir||".draht";var VERSION=pkg.version||"0.0.0",IS_DEV_MODE=existsSync(join2(getPackageDir(),"src")),DISPLAY_VERSION=IS_DEV_MODE?"dev":VERSION;var ENV_AGENT_DIR=`${APP_NAME.toUpperCase()}_CODING_AGENT_DIR`,ENV_SESSION_DIR=`${APP_NAME.toUpperCase()}_CODING_AGENT_SESSION_DIR`;function expandTildePath(path){return normalizePath(path)}function getShareViewerUrl(gistId){let baseUrl=process.env.DRAHT_SHARE_VIEWER_URL?.trim();if(baseUrl)return`${baseUrl}#${gistId}`}function getAgentDir(){let envDir=process.env[ENV_AGENT_DIR];return envDir?expandTildePath(envDir):join2(homedir2(),CONFIG_DIR_NAME,"agent")}function getCustomThemesDir(){return join2(getAgentDir(),"themes")}function getAuthPath(){return join2(getAgentDir(),"auth.json")}function getSettingsPath(){return join2(getAgentDir(),"settings.json")}function getBinDir(){return join2(getAgentDir(),"bin")}function getShippedPromptsDir(){return join2(getPackageDir(),"prompts")}function getShippedSkillsDir(){return join2(getPackageDir(),"skills")}function getSessionsDir(){return join2(getAgentDir(),"sessions")}function getDebugLogPath(){return join2(getAgentDir(),`${APP_NAME}-debug.log`)}export{require_cross_spawn,spawnProcess,spawnProcessSync,waitForChildProcess,getPathComparisonKey,pathsEqual,isPathWithin,shortenHomePath,getFileRevision,isLocalPath,normalizePath,resolvePath,getCwdRelativePath,formatPathRelativeToCwdOrAbsolute,markPathIgnoredByCloudSync,splitBom,stripBom,isBunBinary,detectInstallMethod,getSelfUpdateCommand,getConfiguredSelfUpdateArgv,makeConfiguredSelfUpdateCommand,getSelfUpdateUnavailableInstruction,getPackageDir,getThemesDir,getExportTemplateDir,getReadmePath,getDocsPath,getExamplesPath,getChangelogPath,getBundledInteractiveAssetPath,getQuickJSWasmPath,getCodemodeWorkerSpecifier,detectInstallChange,PACKAGE_NAME,APP_NAME,APP_TITLE,CONFIG_DIR_NAME,VERSION,DISPLAY_VERSION,ENV_AGENT_DIR,ENV_SESSION_DIR,expandTildePath,getShareViewerUrl,getAgentDir,getCustomThemesDir,getAuthPath,getSettingsPath,getBinDir,getShippedPromptsDir,getShippedSkillsDir,getSessionsDir,getDebugLogPath};
@@ -0,0 +1,9 @@
1
+ import { createRequire as __drahtCreateRequire } from "node:module"; const require = __drahtCreateRequire(import.meta.url);
2
+ function contentText(content,separator=`
3
+ `){return typeof content=="string"?content:content.filter(block=>block.type==="text").map(block=>block.text).join(separator)}function getSystemMessageText(message){let parts=[contentText(message.content)];for(let text of Object.values(message.sections??{}))text!==null&&parts.push(text);return parts.filter(part=>part.length>0).join(`
4
+
5
+ `)}function renderSystemMessageUpdate(message){let parts=[],text=contentText(message.content);text.length>0&&parts.push(text);for(let[name,value]of Object.entries(message.sections??{}))parts.push(value===null?`Removed system prompt section "${name}".`:`Updated system prompt section "${name}":
6
+
7
+ ${value}`);return parts.join(`
8
+
9
+ `)}function ownedSlice(text,start,end=text.length){return`${text.slice(start,end)} `.slice(0,-1)}var DRAHT_AI_VERSION="2026.11.19";var DRAHT_ATTRIBUTION={name:"draht",url:"https://github.com/draht-dev/draht",categories:["cli-agent"]},NVIDIA_NIM_HOST="integrate.api.nvidia.com",OPENCODE_HOST="opencode.ai";function mergeClientIdentity(...sources){let merged;for(let source of sources)source&&(merged={...merged},source.userAgent!==void 0&&(merged.userAgent=source.userAgent),source.attribution!==void 0&&(merged.attribution=source.attribution),source.version!==void 0&&(merged.version=source.version));return merged}function getClientVersion(identity){return identity?.version??DRAHT_AI_VERSION}function runtimeDescription(){if(typeof process>"u")return;let versions=process.versions;if(versions?.bun)return`bun/${versions.bun}`;if(versions?.node)return`node/${process.version}`}function formatUserAgent(identity){let mode=identity?.userAgent??"detailed";if(typeof mode=="object")return mode.custom;if(mode==="short")return"draht";let product=`draht/${getClientVersion(identity)}`,runtime=runtimeDescription();return runtime?`${product} (${process.platform}; ${runtime}; ${process.arch})`:`${product} (browser)`}function matchesHost(baseUrl,expectedHost){try{return new URL(baseUrl).hostname===expectedHost}catch{return!1}}function isOpenRouter(target){return target.provider==="openrouter"||target.baseUrl.includes("openrouter.ai")}function isNvidiaNim(target){return target.provider==="nvidia"||matchesHost(target.baseUrl,NVIDIA_NIM_HOST)}function isOpenCode(target){return target.provider==="opencode"||target.provider==="opencode-go"||matchesHost(target.baseUrl,OPENCODE_HOST)}function getAttributionHeaders(target,identity){let attribution=identity?.attribution;if(!attribution)return{};let{name,url,categories}=attribution;return isOpenRouter(target)?{"HTTP-Referer":url,"X-OpenRouter-Title":name,...categories===void 0||categories.length===0?{}:{"X-OpenRouter-Categories":categories.join(",")}}:isNvidiaNim(target)?{"X-BILLING-INVOKE-ORIGIN":name.charAt(0).toUpperCase()+name.slice(1)}:isOpenCode(target)?{"x-opencode-client":name}:{}}function getOpenCodeSessionHeaders(target,sessionId){return sessionId&&isOpenCode(target)?{"x-opencode-session":sessionId}:void 0}function getIdentityHeaders(target,identity){return{"User-Agent":formatUserAgent(identity),...getAttributionHeaders(target,identity)}}function isMutableModels(models){return"setProvider"in models&&"deleteProvider"in models&&"clearProviders"in models}function withClientIdentity(models,identity){let withIdentity=options=>({...options,identity:mergeClientIdentity(identity,options?.identity)}),wrapped={getProviders:()=>models.getProviders(),getProvider:id=>models.getProvider(id),getModels:provider=>models.getModels(provider),getModel:(provider,id)=>models.getModel(provider,id),getModelsOfType:(type,provider)=>models.getModelsOfType(type,provider),getModelOfType:(type,provider,id)=>models.getModelOfType(type,provider,id),getAllModels:provider=>models.getAllModels(provider),refresh:options=>models.refresh(options),checkAuth:(providerId,options)=>models.checkAuth(providerId,options),getAvailable:(providerId,options)=>models.getAvailable(providerId,options),getAvailableOfType:(type,providerId,options)=>models.getAvailableOfType(type,providerId,options),getAllAvailable:(providerId,options)=>models.getAllAvailable(providerId,options),getAuth:models.getAuth.bind(models),login:(providerId,type,interaction,options)=>models.login(providerId,type,interaction,options),logout:(providerId,options)=>models.logout(providerId,options),stream:(model,context,options)=>models.stream(model,context,withIdentity(options)),complete:(model,context,options)=>models.complete(model,context,withIdentity(options)),streamSimple:(model,context,options)=>models.streamSimple(model,context,withIdentity(options)),completeSimple:(model,context,options)=>models.completeSimple(model,context,withIdentity(options)),streamDeferred:(model,handle,options)=>models.streamDeferred(model,handle,withIdentity(options)),fetchDeferred:(model,handle,options)=>models.fetchDeferred(model,handle,withIdentity(options)),cancelDeferred:(model,handle,options)=>models.cancelDeferred(model,handle,withIdentity(options)),generateImages:(model,context,options)=>models.generateImages(model,context,withIdentity(options)),classify:(model,context,options)=>models.classify(model,context,withIdentity(options))};return isMutableModels(models)?{...wrapped,setProvider:provider=>models.setProvider(provider),deleteProvider:id=>models.deleteProvider(id),clearProviders:()=>models.clearProviders()}:wrapped}export{contentText,getSystemMessageText,renderSystemMessageUpdate,ownedSlice,DRAHT_AI_VERSION,DRAHT_ATTRIBUTION,mergeClientIdentity,getClientVersion,formatUserAgent,getAttributionHeaders,getOpenCodeSessionHeaders,getIdentityHeaders,withClientIdentity};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __drahtCreateRequire } from "node:module"; const require = __drahtCreateRequire(import.meta.url);
2
- import{getBinDir}from"./chunk-6M3D4XVD.js";import{accessSync,constants}from"node:fs";import{delimiter,join,win32}from"node:path";import{spawn,spawnSync}from"child_process";function isLegacyWslBashPath(path){let normalized=win32.normalize(path).toLowerCase(),systemRoot=process.env.SystemRoot;return systemRoot?/^[a-z]:[\\/]/i.test(systemRoot)?["System32","Sysnative"].some(directory=>normalized===win32.join(systemRoot,directory,"bash.exe").toLowerCase()):!1:/^[a-z]:\\windows\\(?:system32|sysnative)\\bash\.exe$/.test(normalized)}function getBashShellConfig(shell){return isLegacyWslBashPath(shell)?{shell,args:["-s"],commandTransport:"stdin"}:{shell,args:["-c"]}}function shellPathExists(path){try{return accessSync(path,constants.F_OK),!0}catch{return!1}}function findExecutableOnPath(executable){if(process.platform==="win32"){try{let result=spawnSync("where",[executable],{encoding:"utf-8",timeout:5e3,windowsHide:!0});if(result.status===0&&result.stdout){let firstMatch=result.stdout.trim().split(/\r?\n/)[0];if(firstMatch&&shellPathExists(firstMatch))return firstMatch}}catch{}return null}try{let result=spawnSync("which",[executable],{encoding:"utf-8",timeout:5e3});if(result.status===0&&result.stdout){let firstMatch=result.stdout.trim().split(/\r?\n/)[0];if(firstMatch)return firstMatch}}catch{}return null}function getShellConfig(customShellPath){if(customShellPath){if(shellPathExists(customShellPath))return getBashShellConfig(customShellPath);throw new Error(`Custom shell path not found: ${customShellPath}`)}if(process.platform==="win32"){let paths=[],programFiles=process.env.ProgramFiles;programFiles&&paths.push(`${programFiles}\\Git\\bin\\bash.exe`);let programFilesX86=process.env["ProgramFiles(x86)"];programFilesX86&&paths.push(`${programFilesX86}\\Git\\bin\\bash.exe`);for(let path of paths)if(shellPathExists(path))return getBashShellConfig(path);let bashOnPath2=findExecutableOnPath("bash.exe");if(bashOnPath2)return getBashShellConfig(bashOnPath2);throw new Error(`No bash shell found. Options:
2
+ import{getBinDir}from"./chunk-BIBUE2PO.js";import{accessSync,constants}from"node:fs";import{delimiter,join,win32}from"node:path";import{spawn,spawnSync}from"child_process";function isLegacyWslBashPath(path){let normalized=win32.normalize(path).toLowerCase(),systemRoot=process.env.SystemRoot;return systemRoot?/^[a-z]:[\\/]/i.test(systemRoot)?["System32","Sysnative"].some(directory=>normalized===win32.join(systemRoot,directory,"bash.exe").toLowerCase()):!1:/^[a-z]:\\windows\\(?:system32|sysnative)\\bash\.exe$/.test(normalized)}function getBashShellConfig(shell){return isLegacyWslBashPath(shell)?{shell,args:["-s"],commandTransport:"stdin"}:{shell,args:["-c"]}}function shellPathExists(path){try{return accessSync(path,constants.F_OK),!0}catch{return!1}}function findExecutableOnPath(executable){if(process.platform==="win32"){try{let result=spawnSync("where",[executable],{encoding:"utf-8",timeout:5e3,windowsHide:!0});if(result.status===0&&result.stdout){let firstMatch=result.stdout.trim().split(/\r?\n/)[0];if(firstMatch&&shellPathExists(firstMatch))return firstMatch}}catch{}return null}try{let result=spawnSync("which",[executable],{encoding:"utf-8",timeout:5e3});if(result.status===0&&result.stdout){let firstMatch=result.stdout.trim().split(/\r?\n/)[0];if(firstMatch)return firstMatch}}catch{}return null}function getShellConfig(customShellPath){if(customShellPath){if(shellPathExists(customShellPath))return getBashShellConfig(customShellPath);throw new Error(`Custom shell path not found: ${customShellPath}`)}if(process.platform==="win32"){let paths=[],programFiles=process.env.ProgramFiles;programFiles&&paths.push(`${programFiles}\\Git\\bin\\bash.exe`);let programFilesX86=process.env["ProgramFiles(x86)"];programFilesX86&&paths.push(`${programFilesX86}\\Git\\bin\\bash.exe`);for(let path of paths)if(shellPathExists(path))return getBashShellConfig(path);let bashOnPath2=findExecutableOnPath("bash.exe");if(bashOnPath2)return getBashShellConfig(bashOnPath2);throw new Error(`No bash shell found. Options:
3
3
  1. Install Git for Windows: https://git-scm.com/download/win
4
4
  2. Add your bash to PATH (Cygwin, MSYS2, etc.)
5
5
  3. Set shellPath in settings.json