@sma1lboy/rove 0.9.165 → 0.9.166

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 (46) hide show
  1. package/dist/cli/{chunk-g3nyhgxe.js → chunk-0mzgrnqb.js} +1 -1
  2. package/dist/cli/{chunk-99kgdgns.js → chunk-12z4a3j8.js} +1 -1
  3. package/dist/cli/{chunk-5jq3dvmn.js → chunk-130kknp8.js} +1 -1
  4. package/dist/cli/{chunk-es6kqdjf.js → chunk-3g5qzq5g.js} +1 -1
  5. package/dist/cli/{chunk-zg3wezj6.js → chunk-3v1hzr8z.js} +1 -1
  6. package/dist/cli/{chunk-m4j20c64.js → chunk-4wajaa3z.js} +1 -1
  7. package/dist/cli/{chunk-s4tvt1xg.js → chunk-7mx1xz2b.js} +1 -1
  8. package/dist/cli/{chunk-cjrq979n.js → chunk-7rx93fhy.js} +1 -1
  9. package/dist/cli/{chunk-xqhcr66s.js → chunk-97z6a25c.js} +1 -1
  10. package/dist/cli/{chunk-c8520k12.js → chunk-a56ygbrm.js} +1 -1
  11. package/dist/cli/{chunk-bfpvywwr.js → chunk-apdy1yh2.js} +1 -1
  12. package/dist/cli/{chunk-etnnwbdx.js → chunk-avf82zmm.js} +1 -1
  13. package/dist/cli/{chunk-mbb0pp66.js → chunk-b82bc173.js} +1 -1
  14. package/dist/cli/{chunk-dj5q2ta4.js → chunk-bgnvgcsp.js} +1 -1
  15. package/dist/cli/{chunk-dwvqnbqg.js → chunk-bzhtt3sq.js} +1 -1
  16. package/dist/cli/{chunk-crdag2rc.js → chunk-d4xhc9th.js} +1 -1
  17. package/dist/cli/{chunk-5ekr8x6h.js → chunk-dqse88xv.js} +1 -1
  18. package/dist/cli/{chunk-xywb33k2.js → chunk-dqx9n8mn.js} +1 -1
  19. package/dist/cli/{chunk-d9zpbywp.js → chunk-f2w2c77j.js} +1 -1
  20. package/dist/cli/{chunk-4ba5m3ek.js → chunk-fw6nqqpg.js} +1 -1
  21. package/dist/cli/{chunk-gj6q5mvv.js → chunk-g3vn40x3.js} +1 -1
  22. package/dist/cli/{chunk-t50g8fm5.js → chunk-ggaad0r0.js} +1 -1
  23. package/dist/cli/{chunk-kmby478q.js → chunk-hnktpxpj.js} +2 -2
  24. package/dist/cli/{chunk-v89n12j1.js → chunk-jjt118jt.js} +1 -1
  25. package/dist/cli/{chunk-7bdeahgv.js → chunk-jw134zg6.js} +2 -2
  26. package/dist/cli/{chunk-x2gepvfj.js → chunk-kemnxd03.js} +3 -3
  27. package/dist/cli/{chunk-a20p202a.js → chunk-m4vgx1sc.js} +1 -1
  28. package/dist/cli/{chunk-mzmsbfsk.js → chunk-mg4r96nk.js} +1 -1
  29. package/dist/cli/{chunk-b0f0jdnb.js → chunk-mn1c17zf.js} +1 -1
  30. package/dist/cli/{chunk-avrs60rp.js → chunk-p8bj0t7j.js} +1 -1
  31. package/dist/cli/{chunk-vhrfe63r.js → chunk-pabqr39m.js} +1 -1
  32. package/dist/cli/{chunk-yqcsjw9c.js → chunk-pkzyrwhv.js} +1 -1
  33. package/dist/cli/{chunk-tvgvbq0p.js → chunk-pnzk2rhm.js} +1 -1
  34. package/dist/cli/{chunk-efnhyt0e.js → chunk-sp7jf5mx.js} +1 -1
  35. package/dist/cli/{chunk-q4428qws.js → chunk-sq5kj4za.js} +1 -1
  36. package/dist/cli/{chunk-2ywxqv7x.js → chunk-svfheeb2.js} +1 -1
  37. package/dist/cli/{chunk-z1c2d91p.js → chunk-tsmzqp49.js} +1 -1
  38. package/dist/cli/{chunk-mqcnntym.js → chunk-v027zrx5.js} +2 -2
  39. package/dist/cli/{chunk-edeh4d1v.js → chunk-w0m1q23m.js} +1 -1
  40. package/dist/cli/{chunk-nrafk2b7.js → chunk-wfwaa4n8.js} +1 -1
  41. package/dist/cli/{chunk-8mmycqkp.js → chunk-zdtq90cz.js} +1 -1
  42. package/dist/cli/{chunk-jtft7vt4.js → chunk-zhzpmdd5.js} +1 -1
  43. package/dist/cli/index.js +3 -3
  44. package/dist/cli/kobe.js +1 -1
  45. package/dist/cli/rove.js +1 -1
  46. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{isDev}from"./chunk-ch9b1d5y.js";import{fileURLToPath}from"url";var package_default={$schema:"https://json.schemastore.org/package.json",name:"@sma1lboy/rove",version:"0.9.165",description:"Rove \u2014 the agent multiplexer for your terminal. Run coding agents on parallel tasks with isolated worktrees and persistent sessions.",keywords:["terminal","tui","cli","multiplexer","ai-agents","coding-agent","ai-coding-assistant","agentic-ai","parallel-agents","git-worktree","claude-code","codex","llm","developer-tools"],type:"module",packageManager:"bun@1.3.13",bin:{kobe:"dist/cli/kobe.js",rove:"dist/cli/rove.js"},files:["dist/cli","dist/web-ui","dist/skills","dist/*.wav","README.md","LICENSE"],publishConfig:{access:"public"},repository:{type:"git",url:"git+https://github.com/Sma1lboy/rove.git"},homepage:"https://rove.run",bugs:{url:"https://github.com/Sma1lboy/rove/issues"},engines:{bun:">=1.3.11"},scripts:{dev:"ROVE_DEV=1 bun --conditions=browser ./src/cli/rove.ts","dev:kobe":"KOBE_DEV=1 bun --conditions=browser ./src/cli/kobe.ts","dev:mock":"KOBE_DEV=1 bun ./src/tui-react/mock/host.tsx","dev:sandbox":"bun run scripts/dev-sandbox.ts run","dev:sandbox:reset":"bun run scripts/dev-sandbox.ts reset",build:"bun run scripts/build.ts",compile:"bun run scripts/compile.ts",typecheck:"tsc --noEmit","check-i18n":"bun run scripts/check-i18n.ts",test:"bun run test:fast && bun run test:socket","perf:golden":"bun scripts/perf-golden.ts","pty:soak":"bun scripts/pty-soak.ts","test:fast":"vitest run --passWithNoTests --minWorkers=1 --maxWorkers=8","test:socket":"KOBE_INCLUDE_SOCKET=1 vitest run test/daemon --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests","test:socket:coverage":"KOBE_INCLUDE_SOCKET=1 KOBE_COVERAGE_DAEMON=1 vitest run test/daemon --coverage --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests","test:behavior":"KOBE_INCLUDE_BEHAVIOR=1 vitest run test/behavior --pool forks --minWorkers=1 --maxWorkers=1 --retry=2 --passWithNoTests","test:render":"bun test test/render --coverage --coverage-reporter=text --coverage-reporter=lcov --coverage-dir=coverage-render",coverage:"vitest run --coverage --passWithNoTests",bench:"vitest bench --run",lint:"biome check .",knip:"knip-bun",postinstall:"bun run scripts/check-preview-deps.ts || true",prepublishOnly:"bun run typecheck && bun run build","plugin-sandbox":"bun run scripts/plugin-sandbox.ts"},"//":"biome.json + bunfig.toml live at the monorepo root since they apply repo-wide; bun.lock also lives at root (workspace-shared).",dependencies:{"@ansi-tools/parser":"^1.0.15","@opentui/core":"0.4.3","@opentui/react":"0.4.3","@xterm/addon-serialize":"^0.14.0","@xterm/addon-unicode11":"^0.9.0","@xterm/headless":"^6.0.0","node-pty":"^1.1.0",react:"^19.2.8","smol-toml":"^1.7.1",ws:"^8.18.0"},devDependencies:{"@biomejs/biome":"1.9.4","@sma1lboy/kobe-daemon":"0.7.19","@tsconfig/bun":"1.0.10","@types/bun":"1.3.14","@types/node":"25.6.2","@types/react":"^19.2.0","@vitest/coverage-v8":"2.1.9",knip:"^6.14.2","react-devtools-core":"^7.0.1",typescript:"5.8.2",vitest:"2.1.9"},trustedDependencies:[]};var CURRENT_VERSION=package_default.version,PACKAGE_NAME=package_default.name;function repoSlug(){let url=package_default.repository?.url;if(!url)return null;let m=url.match(/github\.com[:/]([^/]+)\/([^/.]+)/);if(!m||!m[1]||!m[2])return null;return`${m[1]}/${m[2]}`}var UPDATE_SCRIPT_URL="https://raw.githubusercontent.com/Sma1lboy/rove/main/scripts/update.sh",UPDATE_COMMAND=`curl -fsSL ${UPDATE_SCRIPT_URL} | sh`;function owningNpmPrefix(modulePath=fileURLToPath(import.meta.url)){let at=modulePath.indexOf("/lib/node_modules/");if(at<=0)return null;return modulePath.slice(0,at)}function recommendedGlobalInstallCommand(prefix=owningNpmPrefix()){let target=`${PACKAGE_NAME}@latest`;return prefix===null?`npm install -g ${target}`:`npm install -g --prefix ${prefix} ${target}`}var BREAKING_VERSIONS=[];function breakingVersionsCrossed(from,to,breaking=BREAKING_VERSIONS){let[lo,hi]=compareSemver(from,to)<=0?[from,to]:[to,from];return breaking.filter((b)=>compareSemver(b,lo)>0&&compareSemver(b,hi)<=0)}var FETCH_TIMEOUT_MS=3000,RELEASE_CHANNELS=["latest","nightly"],DEFAULT_RELEASE_CHANNEL="latest";function channelOf(version=CURRENT_VERSION){return prereleaseOf(version)?.split(".")[0]==="nightly"?"nightly":DEFAULT_RELEASE_CHANNEL}async function fetchLatestFromRegistry(packageName,channel){let ctrl=new AbortController,timer=setTimeout(()=>ctrl.abort(),FETCH_TIMEOUT_MS);try{let encoded=packageName.replace("/","%2F"),res=await fetch(`https://registry.npmjs.org/${encoded}/${channel}`,{signal:ctrl.signal,headers:{accept:"application/json"}});if(!res.ok)return null;let body=await res.json();if(typeof body.version!=="string")return null;return body.version}catch{return null}finally{clearTimeout(timer)}}function isNewerSemver(latest,current){let core=compareSemver(latest,current);if(core!==0)return core>0;return comparePrerelease(prereleaseOf(latest),prereleaseOf(current))>0}function prereleaseOf(version){let dash=version.indexOf("-");return dash===-1?void 0:version.slice(dash+1)||void 0}function comparePrerelease(a,b){if(a===b)return 0;if(a===void 0)return 1;if(b===void 0)return-1;let aParts=a.split("."),bParts=b.split(".");for(let i=0;i<Math.max(aParts.length,bParts.length);i++){let av=aParts[i],bv=bParts[i];if(av===void 0)return-1;if(bv===void 0)return 1;if(av===bv)continue;let an=/^\d+$/.test(av)?Number.parseInt(av,10):null,bn=/^\d+$/.test(bv)?Number.parseInt(bv,10):null;if(an!==null&&bn!==null)return an>bn?1:-1;if(an!==null)return-1;if(bn!==null)return 1;return av>bv?1:-1}return 0}function compareSemver(aVersion,bVersion){let norm=(v)=>v.split("-")[0]??v,a=norm(aVersion).split(".").map((s)=>Number.parseInt(s,10)),b=norm(bVersion).split(".").map((s)=>Number.parseInt(s,10));for(let i=0;i<3;i++){let av=a[i]??0,bv=b[i]??0;if(Number.isNaN(av)||Number.isNaN(bv))return 0;if(av>bv)return 1;if(av<bv)return-1}return 0}async function checkLatestVersion(opts={}){let channel=opts.channel??channelOf(),fake=process.env.KOBE_FAKE_UPDATE;if(fake)return{current:CURRENT_VERSION,latest:fake,hasUpdate:isNewerSemver(fake,CURRENT_VERSION),channel};if(isDev()&&!opts.force)return null;let latest=await fetchLatestFromRegistry(PACKAGE_NAME,channel);if(!latest)return null;return{current:CURRENT_VERSION,latest,hasUpdate:isNewerSemver(latest,CURRENT_VERSION),channel}}function versionFromTagName(tagName){if(typeof tagName!=="string")return null;return tagName.match(/^v(\d+\.\d+\.\d+)$/)?.[1]??null}async function fetchReleaseNotes(version){let slug=repoSlug();if(!slug)return null;let tag=`v${version}`,ctrl=new AbortController,timer=setTimeout(()=>ctrl.abort(),FETCH_TIMEOUT_MS);try{let res=await fetch(`https://api.github.com/repos/${slug}/releases/tags/${tag}`,{signal:ctrl.signal,headers:{accept:"application/vnd.github+json","x-github-api-version":"2022-11-28"}});if(!res.ok)return null;let body=await res.json();if(typeof body.body!=="string"||typeof body.html_url!=="string")return null;return{body:body.body,url:body.html_url,version}}catch{return null}finally{clearTimeout(timer)}}async function fetchReleaseNotesRange(args){let slug=repoSlug();if(!slug)return[];let limit=args.limit??100,ctrl=new AbortController,timer=setTimeout(()=>ctrl.abort(),FETCH_TIMEOUT_MS);try{let res=await fetch(`https://api.github.com/repos/${slug}/releases?per_page=${limit}`,{signal:ctrl.signal,headers:{accept:"application/vnd.github+json","x-github-api-version":"2022-11-28"}});if(!res.ok)return[];let body=await res.json();if(!Array.isArray(body))return[];return body.map((release)=>{let version=versionFromTagName(release.tag_name);if(!version||typeof release.html_url!=="string"||typeof release.body!=="string")return null;if(compareSemver(version,args.current)<=0)return null;if(compareSemver(version,args.latest)>0)return null;return{version,url:release.html_url,body:release.body}}).filter((release)=>release!==null)}catch{return[]}finally{clearTimeout(timer)}}async function fetchReleaseSummaries(limit=12){let slug=repoSlug();if(!slug)return[];let ctrl=new AbortController,timer=setTimeout(()=>ctrl.abort(),FETCH_TIMEOUT_MS);try{let res=await fetch(`https://api.github.com/repos/${slug}/releases?per_page=${limit}`,{signal:ctrl.signal,headers:{accept:"application/vnd.github+json","x-github-api-version":"2022-11-28"}});if(!res.ok)return[];let body=await res.json();if(!Array.isArray(body))return[];return body.map((release)=>{let version=versionFromTagName(release.tag_name);if(!version||typeof release.html_url!=="string")return null;return{version,url:release.html_url}}).filter((release)=>release!==null)}catch{return[]}finally{clearTimeout(timer)}}function releasePageUrl(version){let slug=repoSlug();if(!slug)return null;return`https://github.com/${slug}/releases/tag/v${version}`}
2
+ import{isDev}from"./chunk-ch9b1d5y.js";import{fileURLToPath}from"url";var package_default={$schema:"https://json.schemastore.org/package.json",name:"@sma1lboy/rove",version:"0.9.166",description:"Rove \u2014 the agent multiplexer for your terminal. Run coding agents on parallel tasks with isolated worktrees and persistent sessions.",keywords:["terminal","tui","cli","multiplexer","ai-agents","coding-agent","ai-coding-assistant","agentic-ai","parallel-agents","git-worktree","claude-code","codex","llm","developer-tools"],type:"module",packageManager:"bun@1.3.13",bin:{kobe:"dist/cli/kobe.js",rove:"dist/cli/rove.js"},files:["dist/cli","dist/web-ui","dist/skills","dist/*.wav","README.md","LICENSE"],publishConfig:{access:"public"},repository:{type:"git",url:"git+https://github.com/Sma1lboy/rove.git"},homepage:"https://rove.run",bugs:{url:"https://github.com/Sma1lboy/rove/issues"},engines:{bun:">=1.3.11"},scripts:{dev:"ROVE_DEV=1 bun --conditions=browser ./src/cli/rove.ts","dev:kobe":"KOBE_DEV=1 bun --conditions=browser ./src/cli/kobe.ts","dev:mock":"KOBE_DEV=1 bun ./src/tui-react/mock/host.tsx","dev:sandbox":"bun run scripts/dev-sandbox.ts run","dev:sandbox:reset":"bun run scripts/dev-sandbox.ts reset",build:"bun run scripts/build.ts",compile:"bun run scripts/compile.ts",typecheck:"tsc --noEmit","check-i18n":"bun run scripts/check-i18n.ts",test:"bun run test:fast && bun run test:socket","perf:golden":"bun scripts/perf-golden.ts","pty:soak":"bun scripts/pty-soak.ts","test:fast":"vitest run --passWithNoTests --minWorkers=1 --maxWorkers=8","test:socket":"KOBE_INCLUDE_SOCKET=1 vitest run test/daemon --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests","test:socket:coverage":"KOBE_INCLUDE_SOCKET=1 KOBE_COVERAGE_DAEMON=1 vitest run test/daemon --coverage --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests","test:behavior":"KOBE_INCLUDE_BEHAVIOR=1 vitest run test/behavior --pool forks --minWorkers=1 --maxWorkers=1 --retry=2 --passWithNoTests","test:render":"bun test test/render --coverage --coverage-reporter=text --coverage-reporter=lcov --coverage-dir=coverage-render",coverage:"vitest run --coverage --passWithNoTests",bench:"vitest bench --run",lint:"biome check .",knip:"knip-bun",postinstall:"bun run scripts/check-preview-deps.ts || true",prepublishOnly:"bun run typecheck && bun run build","plugin-sandbox":"bun run scripts/plugin-sandbox.ts"},"//":"biome.json + bunfig.toml live at the monorepo root since they apply repo-wide; bun.lock also lives at root (workspace-shared).",dependencies:{"@ansi-tools/parser":"^1.0.15","@opentui/core":"0.4.3","@opentui/react":"0.4.3","@xterm/addon-serialize":"^0.14.0","@xterm/addon-unicode11":"^0.9.0","@xterm/headless":"^6.0.0","node-pty":"^1.1.0",react:"^19.2.8","smol-toml":"^1.7.1",ws:"^8.18.0"},devDependencies:{"@biomejs/biome":"1.9.4","@sma1lboy/kobe-daemon":"0.7.19","@tsconfig/bun":"1.0.10","@types/bun":"1.3.14","@types/node":"25.6.2","@types/react":"^19.2.0","@vitest/coverage-v8":"2.1.9",knip:"^6.14.2","react-devtools-core":"^7.0.1",typescript:"5.8.2",vitest:"2.1.9"},trustedDependencies:[]};var CURRENT_VERSION=package_default.version,PACKAGE_NAME=package_default.name;function repoSlug(){let url=package_default.repository?.url;if(!url)return null;let m=url.match(/github\.com[:/]([^/]+)\/([^/.]+)/);if(!m||!m[1]||!m[2])return null;return`${m[1]}/${m[2]}`}var UPDATE_SCRIPT_URL="https://raw.githubusercontent.com/Sma1lboy/rove/main/scripts/update.sh",UPDATE_COMMAND=`curl -fsSL ${UPDATE_SCRIPT_URL} | sh`;function owningNpmPrefix(modulePath=fileURLToPath(import.meta.url)){let at=modulePath.indexOf("/lib/node_modules/");if(at<=0)return null;return modulePath.slice(0,at)}function recommendedGlobalInstallCommand(prefix=owningNpmPrefix()){let target=`${PACKAGE_NAME}@latest`;return prefix===null?`npm install -g ${target}`:`npm install -g --prefix ${prefix} ${target}`}var BREAKING_VERSIONS=[];function breakingVersionsCrossed(from,to,breaking=BREAKING_VERSIONS){let[lo,hi]=compareSemver(from,to)<=0?[from,to]:[to,from];return breaking.filter((b)=>compareSemver(b,lo)>0&&compareSemver(b,hi)<=0)}var FETCH_TIMEOUT_MS=3000,RELEASE_CHANNELS=["latest","nightly"],DEFAULT_RELEASE_CHANNEL="latest";function channelOf(version=CURRENT_VERSION){return prereleaseOf(version)?.split(".")[0]==="nightly"?"nightly":DEFAULT_RELEASE_CHANNEL}async function fetchLatestFromRegistry(packageName,channel){let ctrl=new AbortController,timer=setTimeout(()=>ctrl.abort(),FETCH_TIMEOUT_MS);try{let encoded=packageName.replace("/","%2F"),res=await fetch(`https://registry.npmjs.org/${encoded}/${channel}`,{signal:ctrl.signal,headers:{accept:"application/json"}});if(!res.ok)return null;let body=await res.json();if(typeof body.version!=="string")return null;return body.version}catch{return null}finally{clearTimeout(timer)}}function isNewerSemver(latest,current){let core=compareSemver(latest,current);if(core!==0)return core>0;return comparePrerelease(prereleaseOf(latest),prereleaseOf(current))>0}function prereleaseOf(version){let dash=version.indexOf("-");return dash===-1?void 0:version.slice(dash+1)||void 0}function comparePrerelease(a,b){if(a===b)return 0;if(a===void 0)return 1;if(b===void 0)return-1;let aParts=a.split("."),bParts=b.split(".");for(let i=0;i<Math.max(aParts.length,bParts.length);i++){let av=aParts[i],bv=bParts[i];if(av===void 0)return-1;if(bv===void 0)return 1;if(av===bv)continue;let an=/^\d+$/.test(av)?Number.parseInt(av,10):null,bn=/^\d+$/.test(bv)?Number.parseInt(bv,10):null;if(an!==null&&bn!==null)return an>bn?1:-1;if(an!==null)return-1;if(bn!==null)return 1;return av>bv?1:-1}return 0}function compareSemver(aVersion,bVersion){let norm=(v)=>v.split("-")[0]??v,a=norm(aVersion).split(".").map((s)=>Number.parseInt(s,10)),b=norm(bVersion).split(".").map((s)=>Number.parseInt(s,10));for(let i=0;i<3;i++){let av=a[i]??0,bv=b[i]??0;if(Number.isNaN(av)||Number.isNaN(bv))return 0;if(av>bv)return 1;if(av<bv)return-1}return 0}async function checkLatestVersion(opts={}){let channel=opts.channel??channelOf(),fake=process.env.KOBE_FAKE_UPDATE;if(fake)return{current:CURRENT_VERSION,latest:fake,hasUpdate:isNewerSemver(fake,CURRENT_VERSION),channel};if(isDev()&&!opts.force)return null;let latest=await fetchLatestFromRegistry(PACKAGE_NAME,channel);if(!latest)return null;return{current:CURRENT_VERSION,latest,hasUpdate:isNewerSemver(latest,CURRENT_VERSION),channel}}function versionFromTagName(tagName){if(typeof tagName!=="string")return null;return tagName.match(/^v(\d+\.\d+\.\d+)$/)?.[1]??null}async function fetchReleaseNotes(version){let slug=repoSlug();if(!slug)return null;let tag=`v${version}`,ctrl=new AbortController,timer=setTimeout(()=>ctrl.abort(),FETCH_TIMEOUT_MS);try{let res=await fetch(`https://api.github.com/repos/${slug}/releases/tags/${tag}`,{signal:ctrl.signal,headers:{accept:"application/vnd.github+json","x-github-api-version":"2022-11-28"}});if(!res.ok)return null;let body=await res.json();if(typeof body.body!=="string"||typeof body.html_url!=="string")return null;return{body:body.body,url:body.html_url,version}}catch{return null}finally{clearTimeout(timer)}}async function fetchReleaseNotesRange(args){let slug=repoSlug();if(!slug)return[];let limit=args.limit??100,ctrl=new AbortController,timer=setTimeout(()=>ctrl.abort(),FETCH_TIMEOUT_MS);try{let res=await fetch(`https://api.github.com/repos/${slug}/releases?per_page=${limit}`,{signal:ctrl.signal,headers:{accept:"application/vnd.github+json","x-github-api-version":"2022-11-28"}});if(!res.ok)return[];let body=await res.json();if(!Array.isArray(body))return[];return body.map((release)=>{let version=versionFromTagName(release.tag_name);if(!version||typeof release.html_url!=="string"||typeof release.body!=="string")return null;if(compareSemver(version,args.current)<=0)return null;if(compareSemver(version,args.latest)>0)return null;return{version,url:release.html_url,body:release.body}}).filter((release)=>release!==null)}catch{return[]}finally{clearTimeout(timer)}}async function fetchReleaseSummaries(limit=12){let slug=repoSlug();if(!slug)return[];let ctrl=new AbortController,timer=setTimeout(()=>ctrl.abort(),FETCH_TIMEOUT_MS);try{let res=await fetch(`https://api.github.com/repos/${slug}/releases?per_page=${limit}`,{signal:ctrl.signal,headers:{accept:"application/vnd.github+json","x-github-api-version":"2022-11-28"}});if(!res.ok)return[];let body=await res.json();if(!Array.isArray(body))return[];return body.map((release)=>{let version=versionFromTagName(release.tag_name);if(!version||typeof release.html_url!=="string")return null;return{version,url:release.html_url}}).filter((release)=>release!==null)}catch{return[]}finally{clearTimeout(timer)}}function releasePageUrl(version){let slug=repoSlug();if(!slug)return null;return`https://github.com/${slug}/releases/tag/v${version}`}
3
3
  export{package_default,CURRENT_VERSION,PACKAGE_NAME,repoSlug,UPDATE_SCRIPT_URL,UPDATE_COMMAND,owningNpmPrefix,recommendedGlobalInstallCommand,BREAKING_VERSIONS,breakingVersionsCrossed,RELEASE_CHANNELS,DEFAULT_RELEASE_CHANNEL,channelOf,isNewerSemver,compareSemver,checkLatestVersion,fetchReleaseNotes,fetchReleaseNotesRange,fetchReleaseSummaries,releasePageUrl};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{$jsx,$jsxs,pageCloseBindings,require_react_production,useBindings,useRenderer,useT,useTheme}from"./chunk-yqcsjw9c.js";import{CURRENT_VERSION,UPDATE_COMMAND,checkLatestVersion,fetchReleaseNotesRange,releasePageUrl}from"./chunk-a20p202a.js";import{__toESM}from"./chunk-wqfp8d9w.js";import{spawnSync}from"child_process";function waitForKeypress(){if(!process.stdin.isTTY)return Promise.resolve();return new Promise((resolve)=>{let stdin=process.stdin,done=()=>{stdin.off("data",done),stdin.setRawMode?.(!1),stdin.pause(),resolve()};stdin.setRawMode?.(!0),stdin.resume(),stdin.once("data",done)})}async function runShellUpdater(opts){opts.renderer?.destroy(),process.stdout.write(`
2
+ import{$jsx,$jsxs,pageCloseBindings,require_react_production,useBindings,useRenderer,useT,useTheme}from"./chunk-pkzyrwhv.js";import{CURRENT_VERSION,UPDATE_COMMAND,checkLatestVersion,fetchReleaseNotesRange,releasePageUrl}from"./chunk-m4vgx1sc.js";import{__toESM}from"./chunk-wqfp8d9w.js";import{spawnSync}from"child_process";function waitForKeypress(){if(!process.stdin.isTTY)return Promise.resolve();return new Promise((resolve)=>{let stdin=process.stdin,done=()=>{stdin.off("data",done),stdin.setRawMode?.(!1),stdin.pause(),resolve()};stdin.setRawMode?.(!0),stdin.resume(),stdin.once("data",done)})}async function runShellUpdater(opts){opts.renderer?.destroy(),process.stdout.write(`
3
3
  rove ${CURRENT_VERSION} -> ${opts.targetLabel}
4
4
  `),process.stdout.write(`running: ${opts.command}
5
5
 
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{INIT_PROMPT_FILENAME,INIT_SCRIPT_FILENAME,describeRepoInitSources,missingDependenciesCoda,resolveEngineLaunchInit,resolveRepoInit}from"./chunk-h8m37225.js";import"./chunk-hape5vwj.js";import"./chunk-zg3wezj6.js";import"./chunk-jvxh93nz.js";import"./chunk-crdag2rc.js";import"./chunk-khj0apc7.js";import"./chunk-nzscq4yf.js";import"./chunk-w7zv47mp.js";import"./chunk-6tvrvekq.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-k1qe5qqa.js";import"./chunk-xy8be792.js";import"./chunk-6wpege0h.js";import"./chunk-j75axe29.js";import"./chunk-ayhhgfsz.js";import"./chunk-2brn8e1y.js";import"./chunk-bq3fyc0p.js";import"./chunk-3wj69b0a.js";import"./chunk-ch9b1d5y.js";import"./chunk-mv7ptt5w.js";import"./chunk-v0zxyqrq.js";import"./chunk-e29hx18x.js";import"./chunk-g56kvet6.js";import"./chunk-k2ckx8zw.js";import"./chunk-pw6yfj10.js";import"./chunk-mcdv19rs.js";import"./chunk-r3k9rbwm.js";import"./chunk-wqfp8d9w.js";export{resolveRepoInit,resolveEngineLaunchInit,missingDependenciesCoda,describeRepoInitSources,INIT_SCRIPT_FILENAME,INIT_PROMPT_FILENAME};
2
+ import{INIT_PROMPT_FILENAME,INIT_SCRIPT_FILENAME,describeRepoInitSources,missingDependenciesCoda,resolveEngineLaunchInit,resolveRepoInit}from"./chunk-h8m37225.js";import"./chunk-hape5vwj.js";import"./chunk-3v1hzr8z.js";import"./chunk-jvxh93nz.js";import"./chunk-d4xhc9th.js";import"./chunk-khj0apc7.js";import"./chunk-nzscq4yf.js";import"./chunk-w7zv47mp.js";import"./chunk-6tvrvekq.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-k1qe5qqa.js";import"./chunk-xy8be792.js";import"./chunk-6wpege0h.js";import"./chunk-j75axe29.js";import"./chunk-ayhhgfsz.js";import"./chunk-2brn8e1y.js";import"./chunk-bq3fyc0p.js";import"./chunk-3wj69b0a.js";import"./chunk-ch9b1d5y.js";import"./chunk-mv7ptt5w.js";import"./chunk-v0zxyqrq.js";import"./chunk-e29hx18x.js";import"./chunk-g56kvet6.js";import"./chunk-k2ckx8zw.js";import"./chunk-pw6yfj10.js";import"./chunk-mcdv19rs.js";import"./chunk-r3k9rbwm.js";import"./chunk-wqfp8d9w.js";export{resolveRepoInit,resolveEngineLaunchInit,missingDependenciesCoda,describeRepoInitSources,INIT_SCRIPT_FILENAME,INIT_PROMPT_FILENAME};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ENGINE_NOT_OBSERVED_REASON,ENGINE_START_POLL_MS,ENGINE_START_PROBE_MS,deferOrThrow,deliverHostedPrompt,deliverToKey,ensurePtyHost,findEngineKey,isTaskKey,killTaskSessions,listSessions,listSessionsOrNull,openPtyHost,outcomeFields,resolveComposerManifest,taskKeys}from"./chunk-v89n12j1.js";import"./chunk-nrafk2b7.js";import"./chunk-mbb0pp66.js";import"./chunk-rhsvvdcn.js";import"./chunk-bkba9c4n.js";import"./chunk-g2advs8t.js";import"./chunk-zhbws9n3.js";import"./chunk-vhrfe63r.js";import"./chunk-rcyasw34.js";import"./chunk-b99tf0jr.js";import"./chunk-7q67dz4c.js";import"./chunk-h8m37225.js";import"./chunk-hape5vwj.js";import"./chunk-zg3wezj6.js";import"./chunk-ym78sw9a.js";import"./chunk-zqfbyq0a.js";import"./chunk-rvybphrq.js";import"./chunk-xhb03ybc.js";import"./chunk-sdyzxayr.js";import"./chunk-w25b7xxz.js";import"./chunk-jvxh93nz.js";import"./chunk-h9mqdxvs.js";import"./chunk-8wv8526c.js";import"./chunk-0gepyh6e.js";import"./chunk-bkvr06xn.js";import"./chunk-mnqxgvyb.js";import"./chunk-etnnwbdx.js";import"./chunk-crdag2rc.js";import"./chunk-khj0apc7.js";import"./chunk-nzscq4yf.js";import"./chunk-w7zv47mp.js";import"./chunk-6tvrvekq.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-k1qe5qqa.js";import"./chunk-xy8be792.js";import"./chunk-6wpege0h.js";import"./chunk-j75axe29.js";import"./chunk-ayhhgfsz.js";import"./chunk-2brn8e1y.js";import"./chunk-bq3fyc0p.js";import"./chunk-3wj69b0a.js";import"./chunk-ch9b1d5y.js";import"./chunk-mv7ptt5w.js";import"./chunk-v0zxyqrq.js";import"./chunk-e29hx18x.js";import"./chunk-g56kvet6.js";import"./chunk-pxk2c2vj.js";import"./chunk-k2ckx8zw.js";import"./chunk-pw6yfj10.js";import"./chunk-mcdv19rs.js";import"./chunk-r3k9rbwm.js";import"./chunk-wqfp8d9w.js";export{taskKeys,resolveComposerManifest,outcomeFields,openPtyHost,listSessionsOrNull,listSessions,killTaskSessions,isTaskKey,findEngineKey,ensurePtyHost,deliverToKey,deliverHostedPrompt,deferOrThrow,ENGINE_START_PROBE_MS,ENGINE_START_POLL_MS,ENGINE_NOT_OBSERVED_REASON};
2
+ import{ENGINE_NOT_OBSERVED_REASON,ENGINE_START_POLL_MS,ENGINE_START_PROBE_MS,deferOrThrow,deliverHostedPrompt,deliverToKey,ensurePtyHost,findEngineKey,isTaskKey,killTaskSessions,listSessions,listSessionsOrNull,openPtyHost,outcomeFields,resolveComposerManifest,taskKeys}from"./chunk-jjt118jt.js";import"./chunk-wfwaa4n8.js";import"./chunk-b82bc173.js";import"./chunk-rhsvvdcn.js";import"./chunk-bkba9c4n.js";import"./chunk-g2advs8t.js";import"./chunk-zhbws9n3.js";import"./chunk-pabqr39m.js";import"./chunk-rcyasw34.js";import"./chunk-b99tf0jr.js";import"./chunk-7q67dz4c.js";import"./chunk-h8m37225.js";import"./chunk-hape5vwj.js";import"./chunk-3v1hzr8z.js";import"./chunk-ym78sw9a.js";import"./chunk-zqfbyq0a.js";import"./chunk-rvybphrq.js";import"./chunk-xhb03ybc.js";import"./chunk-sdyzxayr.js";import"./chunk-w25b7xxz.js";import"./chunk-jvxh93nz.js";import"./chunk-h9mqdxvs.js";import"./chunk-8wv8526c.js";import"./chunk-0gepyh6e.js";import"./chunk-bkvr06xn.js";import"./chunk-mnqxgvyb.js";import"./chunk-avf82zmm.js";import"./chunk-d4xhc9th.js";import"./chunk-khj0apc7.js";import"./chunk-nzscq4yf.js";import"./chunk-w7zv47mp.js";import"./chunk-6tvrvekq.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-k1qe5qqa.js";import"./chunk-xy8be792.js";import"./chunk-6wpege0h.js";import"./chunk-j75axe29.js";import"./chunk-ayhhgfsz.js";import"./chunk-2brn8e1y.js";import"./chunk-bq3fyc0p.js";import"./chunk-3wj69b0a.js";import"./chunk-ch9b1d5y.js";import"./chunk-mv7ptt5w.js";import"./chunk-v0zxyqrq.js";import"./chunk-e29hx18x.js";import"./chunk-g56kvet6.js";import"./chunk-pxk2c2vj.js";import"./chunk-k2ckx8zw.js";import"./chunk-pw6yfj10.js";import"./chunk-mcdv19rs.js";import"./chunk-r3k9rbwm.js";import"./chunk-wqfp8d9w.js";export{taskKeys,resolveComposerManifest,outcomeFields,openPtyHost,listSessionsOrNull,listSessions,killTaskSessions,isTaskKey,findEngineKey,ensurePtyHost,deliverToKey,deliverHostedPrompt,deferOrThrow,ENGINE_START_PROBE_MS,ENGINE_START_POLL_MS,ENGINE_NOT_OBSERVED_REASON};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{defaultEngineCommand,engineCommandKey,engineDisplayName,interactiveEngineCommand,parseEngineCommand,withEngineEffort,withEngineTerminalTitle}from"./chunk-zg3wezj6.js";import{vendorFromArgv}from"./chunk-etnnwbdx.js";import{engineEntry}from"./chunk-crdag2rc.js";import{isContribEngine}from"./chunk-nzscq4yf.js";import{getCustomEngineIds,getPersistedString}from"./chunk-6wpege0h.js";import{BUILTIN_VENDORS,isBuiltinVendor}from"./chunk-bq3fyc0p.js";import{randomUUID}from"crypto";function hasFlag(argv,flag){return argv.some((a)=>a===flag||a.startsWith(`${flag}=`))}function controlsOwnSession(identity,argv){return(identity?.sessionControlFlags??[]).some((flag)=>hasFlag(argv,flag))}function pinSessionArgv(identity,argv,sessionId){if(!identity?.pinFlag)return argv;if(controlsOwnSession(identity,argv))return argv;return[...argv,identity.pinFlag,sessionId]}function acceptsPinnedSession(identity,argv){return!!identity?.pinFlag&&!controlsOwnSession(identity,argv)}function resumeSessionArgv(identity,base,sessionId){if(!sessionId||!identity?.resumeArgv)return null;if(controlsOwnSession(identity,base))return null;return identity.resumeArgv(base,sessionId)}function pickUnclaimedSessionId(ids,claimed){for(let i=ids.length-1;i>=0;i--){let id=ids[i];if(id&&!claimed.has(id))return id}return null}function forkSessionArgvFor(identity,base,sourceId,newId){if(!sourceId||!identity?.forkArgv)return null;if(controlsOwnSession(identity,base))return null;return identity.forkArgv(base,sourceId,newId)}function acceptsSessionFork(identity){return!!identity?.forkArgv}var GENERIC_PROTOCOL="generic",ENGINE_PROTOCOLS=BUILTIN_VENDORS;function engineProtocolKey(id){return`engineProtocol.${id}`}function getEngineProtocol(id){if(isBuiltinVendor(id)||isContribEngine(id))return id;let raw=getPersistedString(engineProtocolKey(id))?.trim();return raw&&ENGINE_PROTOCOLS.includes(raw)?raw:void 0}function isPresetId(id){return isBuiltinVendor(id)||isContribEngine(id)||getCustomEngineIds().includes(id)}function listPresetIds(){return[...BUILTIN_VENDORS,...getCustomEngineIds()]}function describePreset(id){let command=getPersistedString(engineCommandKey(id))?.trim()||defaultEngineCommand(id).join(" ");return{id,name:engineDisplayName(id),command,protocol:getEngineProtocol(id)??GENERIC_PROTOCOL,builtin:isBuiltinVendor(id)}}function listEnginePresets(){return listPresetIds().map(describePreset)}function resolveCommandProtocol(command){let trimmed=command?.trim();if(!trimmed)return GENERIC_PROTOCOL;if(isPresetId(trimmed))return getEngineProtocol(trimmed)??GENERIC_PROTOCOL;let fromArgv=vendorFromArgv(trimmed);if(fromArgv)return fromArgv;let argv0=parseEngineCommand(trimmed)[0];if(argv0)for(let id of getCustomEngineIds()){let preset=getPersistedString(engineCommandKey(id))?.trim();if(preset&&parseEngineCommand(preset)[0]===argv0)return getEngineProtocol(id)??GENERIC_PROTOCOL}return GENERIC_PROTOCOL}function engineLaunchArgv(spec){let command=spec.command?.trim();if(!command)return interactiveEngineCommand(spec.vendor,spec.effort);let vendor=(isPresetId(command)?getEngineProtocol(command):void 0)??resolveCommandProtocol(command),base=isPresetId(command)?presetBaseArgv(command):(()=>{let argv=parseEngineCommand(command);return argv.length>0?argv:null})();if(!base)return interactiveEngineCommand(spec.vendor,spec.effort);return withEngineTerminalTitle(withEngineEffort(base,vendor,spec.effort),vendor)}function presetBaseArgv(id){let override=getPersistedString(engineCommandKey(id))?.trim();if(override){let argv=parseEngineCommand(override);if(argv.length>0)return argv}return defaultEngineCommand(id)}function sessionProtocol(vendor){let id=vendor?.trim();if(!id)return"claude";return getEngineProtocol(id)??id}function protocolEntry(vendor){return engineEntry(sessionProtocol(vendor))}function withPinnedSessionId(argv,vendor,newId=randomUUID){let identity=engineEntry(sessionProtocol(vendor)).sessionIdentity;if(!acceptsPinnedSession(identity,argv))return{argv,sessionId:null};let sessionId=newId();return{argv:pinSessionArgv(identity,argv,sessionId),sessionId}}function engineResumeArgv(base,vendor,sessionId){return resumeSessionArgv(engineEntry(sessionProtocol(vendor)).sessionIdentity,base,sessionId)}function engineCanFork(vendor){return acceptsSessionFork(engineEntry(sessionProtocol(vendor)).sessionIdentity)}function engineForkArgv(base,vendor,sourceId,newId){return forkSessionArgvFor(engineEntry(sessionProtocol(vendor)).sessionIdentity,base,sourceId,newId)}
2
+ import{defaultEngineCommand,engineCommandKey,engineDisplayName,interactiveEngineCommand,parseEngineCommand,withEngineEffort,withEngineTerminalTitle}from"./chunk-3v1hzr8z.js";import{vendorFromArgv}from"./chunk-avf82zmm.js";import{engineEntry}from"./chunk-d4xhc9th.js";import{isContribEngine}from"./chunk-nzscq4yf.js";import{getCustomEngineIds,getPersistedString}from"./chunk-6wpege0h.js";import{BUILTIN_VENDORS,isBuiltinVendor}from"./chunk-bq3fyc0p.js";import{randomUUID}from"crypto";function hasFlag(argv,flag){return argv.some((a)=>a===flag||a.startsWith(`${flag}=`))}function controlsOwnSession(identity,argv){return(identity?.sessionControlFlags??[]).some((flag)=>hasFlag(argv,flag))}function pinSessionArgv(identity,argv,sessionId){if(!identity?.pinFlag)return argv;if(controlsOwnSession(identity,argv))return argv;return[...argv,identity.pinFlag,sessionId]}function acceptsPinnedSession(identity,argv){return!!identity?.pinFlag&&!controlsOwnSession(identity,argv)}function resumeSessionArgv(identity,base,sessionId){if(!sessionId||!identity?.resumeArgv)return null;if(controlsOwnSession(identity,base))return null;return identity.resumeArgv(base,sessionId)}function pickUnclaimedSessionId(ids,claimed){for(let i=ids.length-1;i>=0;i--){let id=ids[i];if(id&&!claimed.has(id))return id}return null}function forkSessionArgvFor(identity,base,sourceId,newId){if(!sourceId||!identity?.forkArgv)return null;if(controlsOwnSession(identity,base))return null;return identity.forkArgv(base,sourceId,newId)}function acceptsSessionFork(identity){return!!identity?.forkArgv}var GENERIC_PROTOCOL="generic",ENGINE_PROTOCOLS=BUILTIN_VENDORS;function engineProtocolKey(id){return`engineProtocol.${id}`}function getEngineProtocol(id){if(isBuiltinVendor(id)||isContribEngine(id))return id;let raw=getPersistedString(engineProtocolKey(id))?.trim();return raw&&ENGINE_PROTOCOLS.includes(raw)?raw:void 0}function isPresetId(id){return isBuiltinVendor(id)||isContribEngine(id)||getCustomEngineIds().includes(id)}function listPresetIds(){return[...BUILTIN_VENDORS,...getCustomEngineIds()]}function describePreset(id){let command=getPersistedString(engineCommandKey(id))?.trim()||defaultEngineCommand(id).join(" ");return{id,name:engineDisplayName(id),command,protocol:getEngineProtocol(id)??GENERIC_PROTOCOL,builtin:isBuiltinVendor(id)}}function listEnginePresets(){return listPresetIds().map(describePreset)}function resolveCommandProtocol(command){let trimmed=command?.trim();if(!trimmed)return GENERIC_PROTOCOL;if(isPresetId(trimmed))return getEngineProtocol(trimmed)??GENERIC_PROTOCOL;let fromArgv=vendorFromArgv(trimmed);if(fromArgv)return fromArgv;let argv0=parseEngineCommand(trimmed)[0];if(argv0)for(let id of getCustomEngineIds()){let preset=getPersistedString(engineCommandKey(id))?.trim();if(preset&&parseEngineCommand(preset)[0]===argv0)return getEngineProtocol(id)??GENERIC_PROTOCOL}return GENERIC_PROTOCOL}function engineLaunchArgv(spec){let command=spec.command?.trim();if(!command)return interactiveEngineCommand(spec.vendor,spec.effort);let vendor=(isPresetId(command)?getEngineProtocol(command):void 0)??resolveCommandProtocol(command),base=isPresetId(command)?presetBaseArgv(command):(()=>{let argv=parseEngineCommand(command);return argv.length>0?argv:null})();if(!base)return interactiveEngineCommand(spec.vendor,spec.effort);return withEngineTerminalTitle(withEngineEffort(base,vendor,spec.effort),vendor)}function presetBaseArgv(id){let override=getPersistedString(engineCommandKey(id))?.trim();if(override){let argv=parseEngineCommand(override);if(argv.length>0)return argv}return defaultEngineCommand(id)}function sessionProtocol(vendor){let id=vendor?.trim();if(!id)return"claude";return getEngineProtocol(id)??id}function protocolEntry(vendor){return engineEntry(sessionProtocol(vendor))}function withPinnedSessionId(argv,vendor,newId=randomUUID){let identity=engineEntry(sessionProtocol(vendor)).sessionIdentity;if(!acceptsPinnedSession(identity,argv))return{argv,sessionId:null};let sessionId=newId();return{argv:pinSessionArgv(identity,argv,sessionId),sessionId}}function engineResumeArgv(base,vendor,sessionId){return resumeSessionArgv(engineEntry(sessionProtocol(vendor)).sessionIdentity,base,sessionId)}function engineCanFork(vendor){return acceptsSessionFork(engineEntry(sessionProtocol(vendor)).sessionIdentity)}function engineForkArgv(base,vendor,sourceId,newId){return forkSessionArgvFor(engineEntry(sessionProtocol(vendor)).sessionIdentity,base,sourceId,newId)}
3
3
  export{pickUnclaimedSessionId,GENERIC_PROTOCOL,ENGINE_PROTOCOLS,engineProtocolKey,getEngineProtocol,listPresetIds,describePreset,listEnginePresets,resolveCommandProtocol,engineLaunchArgv,sessionProtocol,protocolEntry,withPinnedSessionId,engineResumeArgv,engineCanFork,engineForkArgv};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{sameWorktreeChanges}from"./chunk-xqw5d5rv.js";import{CURRENT_VERSION}from"./chunk-a20p202a.js";import{BUNDLED_THEMES,DEFAULT_THEME,applyDisplayOverlay,readPersistedUiPrefs,resolveTheme}from"./chunk-ym78sw9a.js";import{loadUserThemes}from"./chunk-zqfbyq0a.js";import{localeState,setLocaleLang,t}from"./chunk-rvybphrq.js";import{isLocaleId}from"./chunk-xhb03ybc.js";import{createStateCell,mapReadableState,recentStateChangesForDiagnostics}from"./chunk-sdyzxayr.js";import{connectIfRunning,ensureDaemonReachable,isStaleInstallError}from"./chunk-h9mqdxvs.js";import{DAEMON_PROTOCOL_VERSION,MIN_COMPATIBLE_PROTOCOL_VERSION,isAttentionInboxState,isDaemonVersionStale,isForeignDaemonHome,isProtocolCompatible,parseDaemonStopReason}from"./chunk-bkvr06xn.js";import{toTaskId}from"./chunk-xy8be792.js";import{loadStateFile,patchStateFile,replaceStateFile}from"./chunk-j75axe29.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{homeDir,isDev,keybindingsConfigPath}from"./chunk-ch9b1d5y.js";import{installClientCrashHandlers,logClient,logClientError,setClientLogContext}from"./chunk-k2ckx8zw.js";import{__commonJS,__esm,__require,__toESM}from"./chunk-wqfp8d9w.js";var require_react_production=__commonJS((exports)=>{var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_PORTAL_TYPE=Symbol.for("react.portal"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment"),REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode"),REACT_PROFILER_TYPE=Symbol.for("react.profiler"),REACT_CONSUMER_TYPE=Symbol.for("react.consumer"),REACT_CONTEXT_TYPE=Symbol.for("react.context"),REACT_FORWARD_REF_TYPE=Symbol.for("react.forward_ref"),REACT_SUSPENSE_TYPE=Symbol.for("react.suspense"),REACT_MEMO_TYPE=Symbol.for("react.memo"),REACT_LAZY_TYPE=Symbol.for("react.lazy"),REACT_ACTIVITY_TYPE=Symbol.for("react.activity"),MAYBE_ITERATOR_SYMBOL=Symbol.iterator;function getIteratorFn(maybeIterable){if(maybeIterable===null||typeof maybeIterable!=="object")return null;return maybeIterable=MAYBE_ITERATOR_SYMBOL&&maybeIterable[MAYBE_ITERATOR_SYMBOL]||maybeIterable["@@iterator"],typeof maybeIterable==="function"?maybeIterable:null}var ReactNoopUpdateQueue={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},assign=Object.assign,emptyObject={};function Component(props,context,updater){this.props=props,this.context=context,this.refs=emptyObject,this.updater=updater||ReactNoopUpdateQueue}Component.prototype.isReactComponent={};Component.prototype.setState=function(partialState,callback){if(typeof partialState!=="object"&&typeof partialState!=="function"&&partialState!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,partialState,callback,"setState")};Component.prototype.forceUpdate=function(callback){this.updater.enqueueForceUpdate(this,callback,"forceUpdate")};function ComponentDummy(){}ComponentDummy.prototype=Component.prototype;function PureComponent(props,context,updater){this.props=props,this.context=context,this.refs=emptyObject,this.updater=updater||ReactNoopUpdateQueue}var pureComponentPrototype=PureComponent.prototype=new ComponentDummy;pureComponentPrototype.constructor=PureComponent;assign(pureComponentPrototype,Component.prototype);pureComponentPrototype.isPureReactComponent=!0;var isArrayImpl=Array.isArray;function noop(){}var ReactSharedInternals={H:null,A:null,T:null,S:null},hasOwnProperty=Object.prototype.hasOwnProperty;function ReactElement(type,key,props){var refProp=props.ref;return{$$typeof:REACT_ELEMENT_TYPE,type,key,ref:refProp!==void 0?refProp:null,props}}function cloneAndReplaceKey(oldElement,newKey){return ReactElement(oldElement.type,newKey,oldElement.props)}function isValidElement(object){return typeof object==="object"&&object!==null&&object.$$typeof===REACT_ELEMENT_TYPE}function escape(key){var escaperLookup={"=":"=0",":":"=2"};return"$"+key.replace(/[=:]/g,function(match){return escaperLookup[match]})}var userProvidedKeyEscapeRegex=/\/+/g;function getElementKey(element,index){return typeof element==="object"&&element!==null&&element.key!=null?escape(""+element.key):index.toString(36)}function resolveThenable(thenable){switch(thenable.status){case"fulfilled":return thenable.value;case"rejected":throw thenable.reason;default:switch(typeof thenable.status==="string"?thenable.then(noop,noop):(thenable.status="pending",thenable.then(function(fulfilledValue){thenable.status==="pending"&&(thenable.status="fulfilled",thenable.value=fulfilledValue)},function(error){thenable.status==="pending"&&(thenable.status="rejected",thenable.reason=error)})),thenable.status){case"fulfilled":return thenable.value;case"rejected":throw thenable.reason}}throw thenable}function mapIntoArray(children,array,escapedPrefix,nameSoFar,callback){var type=typeof children;if(type==="undefined"||type==="boolean")children=null;var invokeCallback=!1;if(children===null)invokeCallback=!0;else switch(type){case"bigint":case"string":case"number":invokeCallback=!0;break;case"object":switch(children.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:invokeCallback=!0;break;case REACT_LAZY_TYPE:return invokeCallback=children._init,mapIntoArray(invokeCallback(children._payload),array,escapedPrefix,nameSoFar,callback)}}if(invokeCallback)return callback=callback(children),invokeCallback=nameSoFar===""?"."+getElementKey(children,0):nameSoFar,isArrayImpl(callback)?(escapedPrefix="",invokeCallback!=null&&(escapedPrefix=invokeCallback.replace(userProvidedKeyEscapeRegex,"$&/")+"/"),mapIntoArray(callback,array,escapedPrefix,"",function(c){return c})):callback!=null&&(isValidElement(callback)&&(callback=cloneAndReplaceKey(callback,escapedPrefix+(callback.key==null||children&&children.key===callback.key?"":(""+callback.key).replace(userProvidedKeyEscapeRegex,"$&/")+"/")+invokeCallback)),array.push(callback)),1;invokeCallback=0;var nextNamePrefix=nameSoFar===""?".":nameSoFar+":";if(isArrayImpl(children))for(var i=0;i<children.length;i++)nameSoFar=children[i],type=nextNamePrefix+getElementKey(nameSoFar,i),invokeCallback+=mapIntoArray(nameSoFar,array,escapedPrefix,type,callback);else if(i=getIteratorFn(children),typeof i==="function")for(children=i.call(children),i=0;!(nameSoFar=children.next()).done;)nameSoFar=nameSoFar.value,type=nextNamePrefix+getElementKey(nameSoFar,i++),invokeCallback+=mapIntoArray(nameSoFar,array,escapedPrefix,type,callback);else if(type==="object"){if(typeof children.then==="function")return mapIntoArray(resolveThenable(children),array,escapedPrefix,nameSoFar,callback);throw array=String(children),Error("Objects are not valid as a React child (found: "+(array==="[object Object]"?"object with keys {"+Object.keys(children).join(", ")+"}":array)+"). If you meant to render a collection of children, use an array instead.")}return invokeCallback}function mapChildren(children,func,context){if(children==null)return children;var result=[],count=0;return mapIntoArray(children,result,"","",function(child){return func.call(context,child,count++)}),result}function lazyInitializer(payload){if(payload._status===-1){var ctor=payload._result;ctor=ctor(),ctor.then(function(moduleObject){if(payload._status===0||payload._status===-1)payload._status=1,payload._result=moduleObject},function(error){if(payload._status===0||payload._status===-1)payload._status=2,payload._result=error}),payload._status===-1&&(payload._status=0,payload._result=ctor)}if(payload._status===1)return payload._result.default;throw payload._result}var reportGlobalError=typeof reportError==="function"?reportError:function(error){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var event=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof error==="object"&&error!==null&&typeof error.message==="string"?String(error.message):String(error),error});if(!window.dispatchEvent(event))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",error);return}console.error(error)},Children={map:mapChildren,forEach:function(children,forEachFunc,forEachContext){mapChildren(children,function(){forEachFunc.apply(this,arguments)},forEachContext)},count:function(children){var n=0;return mapChildren(children,function(){n++}),n},toArray:function(children){return mapChildren(children,function(child){return child})||[]},only:function(children){if(!isValidElement(children))throw Error("React.Children.only expected to receive a single React element child.");return children}};exports.Activity=REACT_ACTIVITY_TYPE;exports.Children=Children;exports.Component=Component;exports.Fragment=REACT_FRAGMENT_TYPE;exports.Profiler=REACT_PROFILER_TYPE;exports.PureComponent=PureComponent;exports.StrictMode=REACT_STRICT_MODE_TYPE;exports.Suspense=REACT_SUSPENSE_TYPE;exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ReactSharedInternals;exports.__COMPILER_RUNTIME={__proto__:null,c:function(size){return ReactSharedInternals.H.useMemoCache(size)}};exports.cache=function(fn){return function(){return fn.apply(null,arguments)}};exports.cacheSignal=function(){return null};exports.cloneElement=function(element,config,children){if(element===null||element===void 0)throw Error("The argument must be a React element, but you passed "+element+".");var props=assign({},element.props),key=element.key;if(config!=null)for(propName in config.key!==void 0&&(key=""+config.key),config)!hasOwnProperty.call(config,propName)||propName==="key"||propName==="__self"||propName==="__source"||propName==="ref"&&config.ref===void 0||(props[propName]=config[propName]);var propName=arguments.length-2;if(propName===1)props.children=children;else if(1<propName){for(var childArray=Array(propName),i=0;i<propName;i++)childArray[i]=arguments[i+2];props.children=childArray}return ReactElement(element.type,key,props)};exports.createContext=function(defaultValue){return defaultValue={$$typeof:REACT_CONTEXT_TYPE,_currentValue:defaultValue,_currentValue2:defaultValue,_threadCount:0,Provider:null,Consumer:null},defaultValue.Provider=defaultValue,defaultValue.Consumer={$$typeof:REACT_CONSUMER_TYPE,_context:defaultValue},defaultValue};exports.createElement=function(type,config,children){var propName,props={},key=null;if(config!=null)for(propName in config.key!==void 0&&(key=""+config.key),config)hasOwnProperty.call(config,propName)&&propName!=="key"&&propName!=="__self"&&propName!=="__source"&&(props[propName]=config[propName]);var childrenLength=arguments.length-2;if(childrenLength===1)props.children=children;else if(1<childrenLength){for(var childArray=Array(childrenLength),i=0;i<childrenLength;i++)childArray[i]=arguments[i+2];props.children=childArray}if(type&&type.defaultProps)for(propName in childrenLength=type.defaultProps,childrenLength)props[propName]===void 0&&(props[propName]=childrenLength[propName]);return ReactElement(type,key,props)};exports.createRef=function(){return{current:null}};exports.forwardRef=function(render){return{$$typeof:REACT_FORWARD_REF_TYPE,render}};exports.isValidElement=isValidElement;exports.lazy=function(ctor){return{$$typeof:REACT_LAZY_TYPE,_payload:{_status:-1,_result:ctor},_init:lazyInitializer}};exports.memo=function(type,compare){return{$$typeof:REACT_MEMO_TYPE,type,compare:compare===void 0?null:compare}};exports.startTransition=function(scope){var prevTransition=ReactSharedInternals.T,currentTransition={};ReactSharedInternals.T=currentTransition;try{var returnValue=scope(),onStartTransitionFinish=ReactSharedInternals.S;onStartTransitionFinish!==null&&onStartTransitionFinish(currentTransition,returnValue),typeof returnValue==="object"&&returnValue!==null&&typeof returnValue.then==="function"&&returnValue.then(noop,reportGlobalError)}catch(error){reportGlobalError(error)}finally{prevTransition!==null&&currentTransition.types!==null&&(prevTransition.types=currentTransition.types),ReactSharedInternals.T=prevTransition}};exports.unstable_useCacheRefresh=function(){return ReactSharedInternals.H.useCacheRefresh()};exports.use=function(usable){return ReactSharedInternals.H.use(usable)};exports.useActionState=function(action,initialState,permalink){return ReactSharedInternals.H.useActionState(action,initialState,permalink)};exports.useCallback=function(callback,deps){return ReactSharedInternals.H.useCallback(callback,deps)};exports.useContext=function(Context){return ReactSharedInternals.H.useContext(Context)};exports.useDebugValue=function(){};exports.useDeferredValue=function(value,initialValue){return ReactSharedInternals.H.useDeferredValue(value,initialValue)};exports.useEffect=function(create,deps){return ReactSharedInternals.H.useEffect(create,deps)};exports.useEffectEvent=function(callback){return ReactSharedInternals.H.useEffectEvent(callback)};exports.useId=function(){return ReactSharedInternals.H.useId()};exports.useImperativeHandle=function(ref,create,deps){return ReactSharedInternals.H.useImperativeHandle(ref,create,deps)};exports.useInsertionEffect=function(create,deps){return ReactSharedInternals.H.useInsertionEffect(create,deps)};exports.useLayoutEffect=function(create,deps){return ReactSharedInternals.H.useLayoutEffect(create,deps)};exports.useMemo=function(create,deps){return ReactSharedInternals.H.useMemo(create,deps)};exports.useOptimistic=function(passthrough,reducer){return ReactSharedInternals.H.useOptimistic(passthrough,reducer)};exports.useReducer=function(reducer,initialArg,init){return ReactSharedInternals.H.useReducer(reducer,initialArg,init)};exports.useRef=function(initialValue){return ReactSharedInternals.H.useRef(initialValue)};exports.useState=function(initialState){return ReactSharedInternals.H.useState(initialState)};exports.useSyncExternalStore=function(subscribe,getSnapshot,getServerSnapshot){return ReactSharedInternals.H.useSyncExternalStore(subscribe,getSnapshot,getServerSnapshot)};exports.useTransition=function(){return ReactSharedInternals.H.useTransition()};exports.version="19.2.8"});function push(heap,node){var index=heap.length;heap.push(node);a:for(;0<index;){var parentIndex=index-1>>>1,parent=heap[parentIndex];if(0<compare(parent,node))heap[parentIndex]=node,heap[index]=parent,index=parentIndex;else break a}}function peek(heap){return heap.length===0?null:heap[0]}function pop(heap){if(heap.length===0)return null;var first=heap[0],last=heap.pop();if(last!==first){heap[0]=last;a:for(var index=0,length=heap.length,halfLength=length>>>1;index<halfLength;){var leftIndex=2*(index+1)-1,left=heap[leftIndex],rightIndex=leftIndex+1,right=heap[rightIndex];if(0>compare(left,last))rightIndex<length&&0>compare(right,left)?(heap[index]=right,heap[rightIndex]=last,index=rightIndex):(heap[index]=left,heap[leftIndex]=last,index=leftIndex);else if(rightIndex<length&&0>compare(right,last))heap[index]=right,heap[rightIndex]=last,index=rightIndex;else break a}}return first}function compare(a,b){var diff=a.sortIndex-b.sortIndex;return diff!==0?diff:a.id-b.id}function advanceTimers(currentTime){for(var timer=peek(timerQueue);timer!==null;){if(timer.callback===null)pop(timerQueue);else if(timer.startTime<=currentTime)pop(timerQueue),timer.sortIndex=timer.expirationTime,push(taskQueue,timer);else break;timer=peek(timerQueue)}}function handleTimeout(currentTime){if(isHostTimeoutScheduled=!1,advanceTimers(currentTime),!isHostCallbackScheduled)if(peek(taskQueue)!==null)isHostCallbackScheduled=!0,isMessageLoopRunning||(isMessageLoopRunning=!0,schedulePerformWorkUntilDeadline());else{var firstTimer=peek(timerQueue);firstTimer!==null&&requestHostTimeout(handleTimeout,firstTimer.startTime-currentTime)}}function shouldYieldToHost(){return needsPaint?!0:$unstable_now()-startTime<frameInterval?!1:!0}function performWorkUntilDeadline(){if(needsPaint=!1,isMessageLoopRunning){var currentTime=$unstable_now();startTime=currentTime;var hasMoreWork=!0;try{a:{isHostCallbackScheduled=!1,isHostTimeoutScheduled&&(isHostTimeoutScheduled=!1,localClearTimeout(taskTimeoutID),taskTimeoutID=-1),isPerformingWork=!0;var previousPriorityLevel=currentPriorityLevel;try{b:{advanceTimers(currentTime);for(currentTask=peek(taskQueue);currentTask!==null&&!(currentTask.expirationTime>currentTime&&shouldYieldToHost());){var callback=currentTask.callback;if(typeof callback==="function"){currentTask.callback=null,currentPriorityLevel=currentTask.priorityLevel;var continuationCallback=callback(currentTask.expirationTime<=currentTime);if(currentTime=$unstable_now(),typeof continuationCallback==="function"){currentTask.callback=continuationCallback,advanceTimers(currentTime),hasMoreWork=!0;break b}currentTask===peek(taskQueue)&&pop(taskQueue),advanceTimers(currentTime)}else pop(taskQueue);currentTask=peek(taskQueue)}if(currentTask!==null)hasMoreWork=!0;else{var firstTimer=peek(timerQueue);firstTimer!==null&&requestHostTimeout(handleTimeout,firstTimer.startTime-currentTime),hasMoreWork=!1}}break a}finally{currentTask=null,currentPriorityLevel=previousPriorityLevel,isPerformingWork=!1}hasMoreWork=void 0}}finally{hasMoreWork?schedulePerformWorkUntilDeadline():isMessageLoopRunning=!1}}}function requestHostTimeout(callback,ms){taskTimeoutID=localSetTimeout(function(){callback($unstable_now())},ms)}var $unstable_now=void 0,localPerformance,localDate,initialTime,taskQueue,timerQueue,taskIdCounter=1,currentTask=null,currentPriorityLevel=3,isPerformingWork=!1,isHostCallbackScheduled=!1,isHostTimeoutScheduled=!1,needsPaint=!1,localSetTimeout,localClearTimeout,localSetImmediate,isMessageLoopRunning=!1,taskTimeoutID=-1,frameInterval=5,startTime=-1,schedulePerformWorkUntilDeadline,channel,port,$unstable_IdlePriority=5,$unstable_ImmediatePriority=1,$unstable_NormalPriority=3,$unstable_UserBlockingPriority=2,$unstable_cancelCallback=function(task){task.callback=null},$unstable_requestPaint=function(){needsPaint=!0},$unstable_scheduleCallback=function(priorityLevel,callback,options){var currentTime=$unstable_now();switch(typeof options==="object"&&options!==null?(options=options.delay,options=typeof options==="number"&&0<options?currentTime+options:currentTime):options=currentTime,priorityLevel){case 1:var timeout=-1;break;case 2:timeout=250;break;case 5:timeout=1073741823;break;case 4:timeout=1e4;break;default:timeout=5000}return timeout=options+timeout,priorityLevel={id:taskIdCounter++,callback,priorityLevel,startTime:options,expirationTime:timeout,sortIndex:-1},options>currentTime?(priorityLevel.sortIndex=options,push(timerQueue,priorityLevel),peek(taskQueue)===null&&priorityLevel===peek(timerQueue)&&(isHostTimeoutScheduled?(localClearTimeout(taskTimeoutID),taskTimeoutID=-1):isHostTimeoutScheduled=!0,requestHostTimeout(handleTimeout,options-currentTime))):(priorityLevel.sortIndex=timeout,push(taskQueue,priorityLevel),isHostCallbackScheduled||isPerformingWork||(isHostCallbackScheduled=!0,isMessageLoopRunning||(isMessageLoopRunning=!0,schedulePerformWorkUntilDeadline()))),priorityLevel},$unstable_shouldYield;var init_scheduler_production=__esm(()=>{if(typeof performance==="object"&&typeof performance.now==="function")localPerformance=performance,$unstable_now=function(){return localPerformance.now()};else localDate=Date,initialTime=localDate.now(),$unstable_now=function(){return localDate.now()-initialTime};taskQueue=[],timerQueue=[],localSetTimeout=typeof setTimeout==="function"?setTimeout:null,localClearTimeout=typeof clearTimeout==="function"?clearTimeout:null,localSetImmediate=typeof setImmediate<"u"?setImmediate:null;if(typeof localSetImmediate==="function")schedulePerformWorkUntilDeadline=function(){localSetImmediate(performWorkUntilDeadline)};else if(typeof MessageChannel<"u")channel=new MessageChannel,port=channel.port2,channel.port1.onmessage=performWorkUntilDeadline,schedulePerformWorkUntilDeadline=function(){port.postMessage(null)};else schedulePerformWorkUntilDeadline=function(){localSetTimeout(performWorkUntilDeadline,0)};$unstable_shouldYield=shouldYieldToHost});var require_react_reconciler_production=__commonJS((exports,module)=>{init_scheduler_production();var React=__toESM(require_react_production());module.exports=function($$$config){function createFiber(tag,pendingProps,key,mode){return new FiberNode(tag,pendingProps,key,mode)}function noop(){}function formatProdErrorMessage(code){var url="https://react.dev/errors/"+code;if(1<arguments.length){url+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)url+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+code+"; visit "+url+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function getNearestMountedFiber(fiber){var node=fiber,nearestMounted=fiber;if(fiber.alternate)for(;node.return;)node=node.return;else{fiber=node;do node=fiber,(node.flags&4098)!==0&&(nearestMounted=node.return),fiber=node.return;while(fiber)}return node.tag===3?nearestMounted:null}function assertIsMounted(fiber){if(getNearestMountedFiber(fiber)!==fiber)throw Error(formatProdErrorMessage(188))}function findCurrentFiberUsingSlowPath(fiber){var alternate=fiber.alternate;if(!alternate){if(alternate=getNearestMountedFiber(fiber),alternate===null)throw Error(formatProdErrorMessage(188));return alternate!==fiber?null:fiber}for(var a=fiber,b=alternate;;){var parentA=a.return;if(parentA===null)break;var parentB=parentA.alternate;if(parentB===null){if(b=parentA.return,b!==null){a=b;continue}break}if(parentA.child===parentB.child){for(parentB=parentA.child;parentB;){if(parentB===a)return assertIsMounted(parentA),fiber;if(parentB===b)return assertIsMounted(parentA),alternate;parentB=parentB.sibling}throw Error(formatProdErrorMessage(188))}if(a.return!==b.return)a=parentA,b=parentB;else{for(var didFindChild=!1,child$0=parentA.child;child$0;){if(child$0===a){didFindChild=!0,a=parentA,b=parentB;break}if(child$0===b){didFindChild=!0,b=parentA,a=parentB;break}child$0=child$0.sibling}if(!didFindChild){for(child$0=parentB.child;child$0;){if(child$0===a){didFindChild=!0,a=parentB,b=parentA;break}if(child$0===b){didFindChild=!0,b=parentB,a=parentA;break}child$0=child$0.sibling}if(!didFindChild)throw Error(formatProdErrorMessage(189))}}if(a.alternate!==b)throw Error(formatProdErrorMessage(190))}if(a.tag!==3)throw Error(formatProdErrorMessage(188));return a.stateNode.current===a?fiber:alternate}function findCurrentHostFiberImpl(node){var tag=node.tag;if(tag===5||tag===26||tag===27||tag===6)return node;for(node=node.child;node!==null;){if(tag=findCurrentHostFiberImpl(node),tag!==null)return tag;node=node.sibling}return null}function findCurrentHostFiberWithNoPortalsImpl(node){var tag=node.tag;if(tag===5||tag===26||tag===27||tag===6)return node;for(node=node.child;node!==null;){if(node.tag!==4&&(tag=findCurrentHostFiberWithNoPortalsImpl(node),tag!==null))return tag;node=node.sibling}return null}function getIteratorFn(maybeIterable){if(maybeIterable===null||typeof maybeIterable!=="object")return null;return maybeIterable=MAYBE_ITERATOR_SYMBOL&&maybeIterable[MAYBE_ITERATOR_SYMBOL]||maybeIterable["@@iterator"],typeof maybeIterable==="function"?maybeIterable:null}function getComponentNameFromType(type){if(type==null)return null;if(typeof type==="function")return type.$$typeof===REACT_CLIENT_REFERENCE?null:type.displayName||type.name||null;if(typeof type==="string")return type;switch(type){case REACT_FRAGMENT_TYPE:return"Fragment";case REACT_PROFILER_TYPE:return"Profiler";case REACT_STRICT_MODE_TYPE:return"StrictMode";case REACT_SUSPENSE_TYPE:return"Suspense";case REACT_SUSPENSE_LIST_TYPE:return"SuspenseList";case REACT_ACTIVITY_TYPE:return"Activity"}if(typeof type==="object")switch(type.$$typeof){case REACT_PORTAL_TYPE:return"Portal";case REACT_CONTEXT_TYPE:return type.displayName||"Context";case REACT_CONSUMER_TYPE:return(type._context.displayName||"Context")+".Consumer";case REACT_FORWARD_REF_TYPE:var innerType=type.render;return type=type.displayName,type||(type=innerType.displayName||innerType.name||"",type=type!==""?"ForwardRef("+type+")":"ForwardRef"),type;case REACT_MEMO_TYPE:return innerType=type.displayName||null,innerType!==null?innerType:getComponentNameFromType(type.type)||"Memo";case REACT_LAZY_TYPE:innerType=type._payload,type=type._init;try{return getComponentNameFromType(type(innerType))}catch(x){}}return null}function createCursor(defaultValue){return{current:defaultValue}}function pop2(cursor){0>index$jscomp$0||(cursor.current=valueStack[index$jscomp$0],valueStack[index$jscomp$0]=null,index$jscomp$0--)}function push2(cursor,value){index$jscomp$0++,valueStack[index$jscomp$0]=cursor.current,cursor.current=value}function clz32Fallback(x){return x>>>=0,x===0?32:31-(log$1(x)/LN2|0)|0}function getHighestPriorityLanes(lanes){var pendingSyncLanes=lanes&42;if(pendingSyncLanes!==0)return pendingSyncLanes;switch(lanes&-lanes){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return lanes&261888;case 262144:case 524288:case 1048576:case 2097152:return lanes&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return lanes&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return lanes}}function getNextLanes(root,wipLanes,rootHasPendingCommit){var pendingLanes=root.pendingLanes;if(pendingLanes===0)return 0;var nextLanes=0,suspendedLanes=root.suspendedLanes,pingedLanes=root.pingedLanes;root=root.warmLanes;var nonIdlePendingLanes=pendingLanes&134217727;return nonIdlePendingLanes!==0?(pendingLanes=nonIdlePendingLanes&~suspendedLanes,pendingLanes!==0?nextLanes=getHighestPriorityLanes(pendingLanes):(pingedLanes&=nonIdlePendingLanes,pingedLanes!==0?nextLanes=getHighestPriorityLanes(pingedLanes):rootHasPendingCommit||(rootHasPendingCommit=nonIdlePendingLanes&~root,rootHasPendingCommit!==0&&(nextLanes=getHighestPriorityLanes(rootHasPendingCommit))))):(nonIdlePendingLanes=pendingLanes&~suspendedLanes,nonIdlePendingLanes!==0?nextLanes=getHighestPriorityLanes(nonIdlePendingLanes):pingedLanes!==0?nextLanes=getHighestPriorityLanes(pingedLanes):rootHasPendingCommit||(rootHasPendingCommit=pendingLanes&~root,rootHasPendingCommit!==0&&(nextLanes=getHighestPriorityLanes(rootHasPendingCommit)))),nextLanes===0?0:wipLanes!==0&&wipLanes!==nextLanes&&(wipLanes&suspendedLanes)===0&&(suspendedLanes=nextLanes&-nextLanes,rootHasPendingCommit=wipLanes&-wipLanes,suspendedLanes>=rootHasPendingCommit||suspendedLanes===32&&(rootHasPendingCommit&4194048)!==0)?wipLanes:nextLanes}function checkIfRootIsPrerendering(root,renderLanes2){return(root.pendingLanes&~(root.suspendedLanes&~root.pingedLanes)&renderLanes2)===0}function computeExpirationTime(lane,currentTime){switch(lane){case 1:case 2:case 4:case 8:case 64:return currentTime+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return currentTime+5000;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function claimNextRetryLane(){var lane=nextRetryLane;return nextRetryLane<<=1,(nextRetryLane&62914560)===0&&(nextRetryLane=4194304),lane}function createLaneMap(initial){for(var laneMap=[],i=0;31>i;i++)laneMap.push(initial);return laneMap}function markRootUpdated$1(root,updateLane){root.pendingLanes|=updateLane,updateLane!==268435456&&(root.suspendedLanes=0,root.pingedLanes=0,root.warmLanes=0)}function markRootFinished(root,finishedLanes,remainingLanes,spawnedLane,updatedLanes,suspendedRetryLanes){var previouslyPendingLanes=root.pendingLanes;root.pendingLanes=remainingLanes,root.suspendedLanes=0,root.pingedLanes=0,root.warmLanes=0,root.expiredLanes&=remainingLanes,root.entangledLanes&=remainingLanes,root.errorRecoveryDisabledLanes&=remainingLanes,root.shellSuspendCounter=0;var{entanglements,expirationTimes,hiddenUpdates}=root;for(remainingLanes=previouslyPendingLanes&~remainingLanes;0<remainingLanes;){var index$5=31-clz32(remainingLanes),lane=1<<index$5;entanglements[index$5]=0,expirationTimes[index$5]=-1;var hiddenUpdatesForLane=hiddenUpdates[index$5];if(hiddenUpdatesForLane!==null)for(hiddenUpdates[index$5]=null,index$5=0;index$5<hiddenUpdatesForLane.length;index$5++){var update=hiddenUpdatesForLane[index$5];update!==null&&(update.lane&=-536870913)}remainingLanes&=~lane}spawnedLane!==0&&markSpawnedDeferredLane(root,spawnedLane,0),suspendedRetryLanes!==0&&updatedLanes===0&&root.tag!==0&&(root.suspendedLanes|=suspendedRetryLanes&~(previouslyPendingLanes&~finishedLanes))}function markSpawnedDeferredLane(root,spawnedLane,entangledLanes){root.pendingLanes|=spawnedLane,root.suspendedLanes&=~spawnedLane;var spawnedLaneIndex=31-clz32(spawnedLane);root.entangledLanes|=spawnedLane,root.entanglements[spawnedLaneIndex]=root.entanglements[spawnedLaneIndex]|1073741824|entangledLanes&261930}function markRootEntangled(root,entangledLanes){var rootEntangledLanes=root.entangledLanes|=entangledLanes;for(root=root.entanglements;rootEntangledLanes;){var index$6=31-clz32(rootEntangledLanes),lane=1<<index$6;lane&entangledLanes|root[index$6]&entangledLanes&&(root[index$6]|=entangledLanes),rootEntangledLanes&=~lane}}function getBumpedLaneForHydration(root,renderLanes2){var renderLane=renderLanes2&-renderLanes2;return renderLane=(renderLane&42)!==0?1:getBumpedLaneForHydrationByLane(renderLane),(renderLane&(root.suspendedLanes|renderLanes2))!==0?0:renderLane}function getBumpedLaneForHydrationByLane(lane){switch(lane){case 2:lane=1;break;case 8:lane=4;break;case 32:lane=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:lane=128;break;case 268435456:lane=134217728;break;default:lane=0}return lane}function lanesToEventPriority(lanes){return lanes&=-lanes,2<lanes?8<lanes?(lanes&134217727)!==0?32:268435456:8:2}function setIsStrictModeForDevtools(newIsStrictMode){if(typeof log2==="function"&&unstable_setDisableYieldValue2(newIsStrictMode),injectedHook&&typeof injectedHook.setStrictMode==="function")try{injectedHook.setStrictMode(rendererID,newIsStrictMode)}catch(err){}}function is(x,y){return x===y&&(x!==0||1/x===1/y)||x!==x&&y!==y}function describeBuiltInComponentFrame(name){if(prefix===void 0)try{throw Error()}catch(x){var match=x.stack.trim().match(/\n( *(at )?)/);prefix=match&&match[1]||"",suffix=-1<x.stack.indexOf(`
2
+ import{sameWorktreeChanges}from"./chunk-xqw5d5rv.js";import{CURRENT_VERSION}from"./chunk-m4vgx1sc.js";import{BUNDLED_THEMES,DEFAULT_THEME,applyDisplayOverlay,readPersistedUiPrefs,resolveTheme}from"./chunk-ym78sw9a.js";import{loadUserThemes}from"./chunk-zqfbyq0a.js";import{localeState,setLocaleLang,t}from"./chunk-rvybphrq.js";import{isLocaleId}from"./chunk-xhb03ybc.js";import{createStateCell,mapReadableState,recentStateChangesForDiagnostics}from"./chunk-sdyzxayr.js";import{connectIfRunning,ensureDaemonReachable,isStaleInstallError}from"./chunk-h9mqdxvs.js";import{DAEMON_PROTOCOL_VERSION,MIN_COMPATIBLE_PROTOCOL_VERSION,isAttentionInboxState,isDaemonVersionStale,isForeignDaemonHome,isProtocolCompatible,parseDaemonStopReason}from"./chunk-bkvr06xn.js";import{toTaskId}from"./chunk-xy8be792.js";import{loadStateFile,patchStateFile,replaceStateFile}from"./chunk-j75axe29.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{homeDir,isDev,keybindingsConfigPath}from"./chunk-ch9b1d5y.js";import{installClientCrashHandlers,logClient,logClientError,setClientLogContext}from"./chunk-k2ckx8zw.js";import{__commonJS,__esm,__require,__toESM}from"./chunk-wqfp8d9w.js";var require_react_production=__commonJS((exports)=>{var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_PORTAL_TYPE=Symbol.for("react.portal"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment"),REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode"),REACT_PROFILER_TYPE=Symbol.for("react.profiler"),REACT_CONSUMER_TYPE=Symbol.for("react.consumer"),REACT_CONTEXT_TYPE=Symbol.for("react.context"),REACT_FORWARD_REF_TYPE=Symbol.for("react.forward_ref"),REACT_SUSPENSE_TYPE=Symbol.for("react.suspense"),REACT_MEMO_TYPE=Symbol.for("react.memo"),REACT_LAZY_TYPE=Symbol.for("react.lazy"),REACT_ACTIVITY_TYPE=Symbol.for("react.activity"),MAYBE_ITERATOR_SYMBOL=Symbol.iterator;function getIteratorFn(maybeIterable){if(maybeIterable===null||typeof maybeIterable!=="object")return null;return maybeIterable=MAYBE_ITERATOR_SYMBOL&&maybeIterable[MAYBE_ITERATOR_SYMBOL]||maybeIterable["@@iterator"],typeof maybeIterable==="function"?maybeIterable:null}var ReactNoopUpdateQueue={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},assign=Object.assign,emptyObject={};function Component(props,context,updater){this.props=props,this.context=context,this.refs=emptyObject,this.updater=updater||ReactNoopUpdateQueue}Component.prototype.isReactComponent={};Component.prototype.setState=function(partialState,callback){if(typeof partialState!=="object"&&typeof partialState!=="function"&&partialState!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,partialState,callback,"setState")};Component.prototype.forceUpdate=function(callback){this.updater.enqueueForceUpdate(this,callback,"forceUpdate")};function ComponentDummy(){}ComponentDummy.prototype=Component.prototype;function PureComponent(props,context,updater){this.props=props,this.context=context,this.refs=emptyObject,this.updater=updater||ReactNoopUpdateQueue}var pureComponentPrototype=PureComponent.prototype=new ComponentDummy;pureComponentPrototype.constructor=PureComponent;assign(pureComponentPrototype,Component.prototype);pureComponentPrototype.isPureReactComponent=!0;var isArrayImpl=Array.isArray;function noop(){}var ReactSharedInternals={H:null,A:null,T:null,S:null},hasOwnProperty=Object.prototype.hasOwnProperty;function ReactElement(type,key,props){var refProp=props.ref;return{$$typeof:REACT_ELEMENT_TYPE,type,key,ref:refProp!==void 0?refProp:null,props}}function cloneAndReplaceKey(oldElement,newKey){return ReactElement(oldElement.type,newKey,oldElement.props)}function isValidElement(object){return typeof object==="object"&&object!==null&&object.$$typeof===REACT_ELEMENT_TYPE}function escape(key){var escaperLookup={"=":"=0",":":"=2"};return"$"+key.replace(/[=:]/g,function(match){return escaperLookup[match]})}var userProvidedKeyEscapeRegex=/\/+/g;function getElementKey(element,index){return typeof element==="object"&&element!==null&&element.key!=null?escape(""+element.key):index.toString(36)}function resolveThenable(thenable){switch(thenable.status){case"fulfilled":return thenable.value;case"rejected":throw thenable.reason;default:switch(typeof thenable.status==="string"?thenable.then(noop,noop):(thenable.status="pending",thenable.then(function(fulfilledValue){thenable.status==="pending"&&(thenable.status="fulfilled",thenable.value=fulfilledValue)},function(error){thenable.status==="pending"&&(thenable.status="rejected",thenable.reason=error)})),thenable.status){case"fulfilled":return thenable.value;case"rejected":throw thenable.reason}}throw thenable}function mapIntoArray(children,array,escapedPrefix,nameSoFar,callback){var type=typeof children;if(type==="undefined"||type==="boolean")children=null;var invokeCallback=!1;if(children===null)invokeCallback=!0;else switch(type){case"bigint":case"string":case"number":invokeCallback=!0;break;case"object":switch(children.$$typeof){case REACT_ELEMENT_TYPE:case REACT_PORTAL_TYPE:invokeCallback=!0;break;case REACT_LAZY_TYPE:return invokeCallback=children._init,mapIntoArray(invokeCallback(children._payload),array,escapedPrefix,nameSoFar,callback)}}if(invokeCallback)return callback=callback(children),invokeCallback=nameSoFar===""?"."+getElementKey(children,0):nameSoFar,isArrayImpl(callback)?(escapedPrefix="",invokeCallback!=null&&(escapedPrefix=invokeCallback.replace(userProvidedKeyEscapeRegex,"$&/")+"/"),mapIntoArray(callback,array,escapedPrefix,"",function(c){return c})):callback!=null&&(isValidElement(callback)&&(callback=cloneAndReplaceKey(callback,escapedPrefix+(callback.key==null||children&&children.key===callback.key?"":(""+callback.key).replace(userProvidedKeyEscapeRegex,"$&/")+"/")+invokeCallback)),array.push(callback)),1;invokeCallback=0;var nextNamePrefix=nameSoFar===""?".":nameSoFar+":";if(isArrayImpl(children))for(var i=0;i<children.length;i++)nameSoFar=children[i],type=nextNamePrefix+getElementKey(nameSoFar,i),invokeCallback+=mapIntoArray(nameSoFar,array,escapedPrefix,type,callback);else if(i=getIteratorFn(children),typeof i==="function")for(children=i.call(children),i=0;!(nameSoFar=children.next()).done;)nameSoFar=nameSoFar.value,type=nextNamePrefix+getElementKey(nameSoFar,i++),invokeCallback+=mapIntoArray(nameSoFar,array,escapedPrefix,type,callback);else if(type==="object"){if(typeof children.then==="function")return mapIntoArray(resolveThenable(children),array,escapedPrefix,nameSoFar,callback);throw array=String(children),Error("Objects are not valid as a React child (found: "+(array==="[object Object]"?"object with keys {"+Object.keys(children).join(", ")+"}":array)+"). If you meant to render a collection of children, use an array instead.")}return invokeCallback}function mapChildren(children,func,context){if(children==null)return children;var result=[],count=0;return mapIntoArray(children,result,"","",function(child){return func.call(context,child,count++)}),result}function lazyInitializer(payload){if(payload._status===-1){var ctor=payload._result;ctor=ctor(),ctor.then(function(moduleObject){if(payload._status===0||payload._status===-1)payload._status=1,payload._result=moduleObject},function(error){if(payload._status===0||payload._status===-1)payload._status=2,payload._result=error}),payload._status===-1&&(payload._status=0,payload._result=ctor)}if(payload._status===1)return payload._result.default;throw payload._result}var reportGlobalError=typeof reportError==="function"?reportError:function(error){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var event=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof error==="object"&&error!==null&&typeof error.message==="string"?String(error.message):String(error),error});if(!window.dispatchEvent(event))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",error);return}console.error(error)},Children={map:mapChildren,forEach:function(children,forEachFunc,forEachContext){mapChildren(children,function(){forEachFunc.apply(this,arguments)},forEachContext)},count:function(children){var n=0;return mapChildren(children,function(){n++}),n},toArray:function(children){return mapChildren(children,function(child){return child})||[]},only:function(children){if(!isValidElement(children))throw Error("React.Children.only expected to receive a single React element child.");return children}};exports.Activity=REACT_ACTIVITY_TYPE;exports.Children=Children;exports.Component=Component;exports.Fragment=REACT_FRAGMENT_TYPE;exports.Profiler=REACT_PROFILER_TYPE;exports.PureComponent=PureComponent;exports.StrictMode=REACT_STRICT_MODE_TYPE;exports.Suspense=REACT_SUSPENSE_TYPE;exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ReactSharedInternals;exports.__COMPILER_RUNTIME={__proto__:null,c:function(size){return ReactSharedInternals.H.useMemoCache(size)}};exports.cache=function(fn){return function(){return fn.apply(null,arguments)}};exports.cacheSignal=function(){return null};exports.cloneElement=function(element,config,children){if(element===null||element===void 0)throw Error("The argument must be a React element, but you passed "+element+".");var props=assign({},element.props),key=element.key;if(config!=null)for(propName in config.key!==void 0&&(key=""+config.key),config)!hasOwnProperty.call(config,propName)||propName==="key"||propName==="__self"||propName==="__source"||propName==="ref"&&config.ref===void 0||(props[propName]=config[propName]);var propName=arguments.length-2;if(propName===1)props.children=children;else if(1<propName){for(var childArray=Array(propName),i=0;i<propName;i++)childArray[i]=arguments[i+2];props.children=childArray}return ReactElement(element.type,key,props)};exports.createContext=function(defaultValue){return defaultValue={$$typeof:REACT_CONTEXT_TYPE,_currentValue:defaultValue,_currentValue2:defaultValue,_threadCount:0,Provider:null,Consumer:null},defaultValue.Provider=defaultValue,defaultValue.Consumer={$$typeof:REACT_CONSUMER_TYPE,_context:defaultValue},defaultValue};exports.createElement=function(type,config,children){var propName,props={},key=null;if(config!=null)for(propName in config.key!==void 0&&(key=""+config.key),config)hasOwnProperty.call(config,propName)&&propName!=="key"&&propName!=="__self"&&propName!=="__source"&&(props[propName]=config[propName]);var childrenLength=arguments.length-2;if(childrenLength===1)props.children=children;else if(1<childrenLength){for(var childArray=Array(childrenLength),i=0;i<childrenLength;i++)childArray[i]=arguments[i+2];props.children=childArray}if(type&&type.defaultProps)for(propName in childrenLength=type.defaultProps,childrenLength)props[propName]===void 0&&(props[propName]=childrenLength[propName]);return ReactElement(type,key,props)};exports.createRef=function(){return{current:null}};exports.forwardRef=function(render){return{$$typeof:REACT_FORWARD_REF_TYPE,render}};exports.isValidElement=isValidElement;exports.lazy=function(ctor){return{$$typeof:REACT_LAZY_TYPE,_payload:{_status:-1,_result:ctor},_init:lazyInitializer}};exports.memo=function(type,compare){return{$$typeof:REACT_MEMO_TYPE,type,compare:compare===void 0?null:compare}};exports.startTransition=function(scope){var prevTransition=ReactSharedInternals.T,currentTransition={};ReactSharedInternals.T=currentTransition;try{var returnValue=scope(),onStartTransitionFinish=ReactSharedInternals.S;onStartTransitionFinish!==null&&onStartTransitionFinish(currentTransition,returnValue),typeof returnValue==="object"&&returnValue!==null&&typeof returnValue.then==="function"&&returnValue.then(noop,reportGlobalError)}catch(error){reportGlobalError(error)}finally{prevTransition!==null&&currentTransition.types!==null&&(prevTransition.types=currentTransition.types),ReactSharedInternals.T=prevTransition}};exports.unstable_useCacheRefresh=function(){return ReactSharedInternals.H.useCacheRefresh()};exports.use=function(usable){return ReactSharedInternals.H.use(usable)};exports.useActionState=function(action,initialState,permalink){return ReactSharedInternals.H.useActionState(action,initialState,permalink)};exports.useCallback=function(callback,deps){return ReactSharedInternals.H.useCallback(callback,deps)};exports.useContext=function(Context){return ReactSharedInternals.H.useContext(Context)};exports.useDebugValue=function(){};exports.useDeferredValue=function(value,initialValue){return ReactSharedInternals.H.useDeferredValue(value,initialValue)};exports.useEffect=function(create,deps){return ReactSharedInternals.H.useEffect(create,deps)};exports.useEffectEvent=function(callback){return ReactSharedInternals.H.useEffectEvent(callback)};exports.useId=function(){return ReactSharedInternals.H.useId()};exports.useImperativeHandle=function(ref,create,deps){return ReactSharedInternals.H.useImperativeHandle(ref,create,deps)};exports.useInsertionEffect=function(create,deps){return ReactSharedInternals.H.useInsertionEffect(create,deps)};exports.useLayoutEffect=function(create,deps){return ReactSharedInternals.H.useLayoutEffect(create,deps)};exports.useMemo=function(create,deps){return ReactSharedInternals.H.useMemo(create,deps)};exports.useOptimistic=function(passthrough,reducer){return ReactSharedInternals.H.useOptimistic(passthrough,reducer)};exports.useReducer=function(reducer,initialArg,init){return ReactSharedInternals.H.useReducer(reducer,initialArg,init)};exports.useRef=function(initialValue){return ReactSharedInternals.H.useRef(initialValue)};exports.useState=function(initialState){return ReactSharedInternals.H.useState(initialState)};exports.useSyncExternalStore=function(subscribe,getSnapshot,getServerSnapshot){return ReactSharedInternals.H.useSyncExternalStore(subscribe,getSnapshot,getServerSnapshot)};exports.useTransition=function(){return ReactSharedInternals.H.useTransition()};exports.version="19.2.8"});function push(heap,node){var index=heap.length;heap.push(node);a:for(;0<index;){var parentIndex=index-1>>>1,parent=heap[parentIndex];if(0<compare(parent,node))heap[parentIndex]=node,heap[index]=parent,index=parentIndex;else break a}}function peek(heap){return heap.length===0?null:heap[0]}function pop(heap){if(heap.length===0)return null;var first=heap[0],last=heap.pop();if(last!==first){heap[0]=last;a:for(var index=0,length=heap.length,halfLength=length>>>1;index<halfLength;){var leftIndex=2*(index+1)-1,left=heap[leftIndex],rightIndex=leftIndex+1,right=heap[rightIndex];if(0>compare(left,last))rightIndex<length&&0>compare(right,left)?(heap[index]=right,heap[rightIndex]=last,index=rightIndex):(heap[index]=left,heap[leftIndex]=last,index=leftIndex);else if(rightIndex<length&&0>compare(right,last))heap[index]=right,heap[rightIndex]=last,index=rightIndex;else break a}}return first}function compare(a,b){var diff=a.sortIndex-b.sortIndex;return diff!==0?diff:a.id-b.id}function advanceTimers(currentTime){for(var timer=peek(timerQueue);timer!==null;){if(timer.callback===null)pop(timerQueue);else if(timer.startTime<=currentTime)pop(timerQueue),timer.sortIndex=timer.expirationTime,push(taskQueue,timer);else break;timer=peek(timerQueue)}}function handleTimeout(currentTime){if(isHostTimeoutScheduled=!1,advanceTimers(currentTime),!isHostCallbackScheduled)if(peek(taskQueue)!==null)isHostCallbackScheduled=!0,isMessageLoopRunning||(isMessageLoopRunning=!0,schedulePerformWorkUntilDeadline());else{var firstTimer=peek(timerQueue);firstTimer!==null&&requestHostTimeout(handleTimeout,firstTimer.startTime-currentTime)}}function shouldYieldToHost(){return needsPaint?!0:$unstable_now()-startTime<frameInterval?!1:!0}function performWorkUntilDeadline(){if(needsPaint=!1,isMessageLoopRunning){var currentTime=$unstable_now();startTime=currentTime;var hasMoreWork=!0;try{a:{isHostCallbackScheduled=!1,isHostTimeoutScheduled&&(isHostTimeoutScheduled=!1,localClearTimeout(taskTimeoutID),taskTimeoutID=-1),isPerformingWork=!0;var previousPriorityLevel=currentPriorityLevel;try{b:{advanceTimers(currentTime);for(currentTask=peek(taskQueue);currentTask!==null&&!(currentTask.expirationTime>currentTime&&shouldYieldToHost());){var callback=currentTask.callback;if(typeof callback==="function"){currentTask.callback=null,currentPriorityLevel=currentTask.priorityLevel;var continuationCallback=callback(currentTask.expirationTime<=currentTime);if(currentTime=$unstable_now(),typeof continuationCallback==="function"){currentTask.callback=continuationCallback,advanceTimers(currentTime),hasMoreWork=!0;break b}currentTask===peek(taskQueue)&&pop(taskQueue),advanceTimers(currentTime)}else pop(taskQueue);currentTask=peek(taskQueue)}if(currentTask!==null)hasMoreWork=!0;else{var firstTimer=peek(timerQueue);firstTimer!==null&&requestHostTimeout(handleTimeout,firstTimer.startTime-currentTime),hasMoreWork=!1}}break a}finally{currentTask=null,currentPriorityLevel=previousPriorityLevel,isPerformingWork=!1}hasMoreWork=void 0}}finally{hasMoreWork?schedulePerformWorkUntilDeadline():isMessageLoopRunning=!1}}}function requestHostTimeout(callback,ms){taskTimeoutID=localSetTimeout(function(){callback($unstable_now())},ms)}var $unstable_now=void 0,localPerformance,localDate,initialTime,taskQueue,timerQueue,taskIdCounter=1,currentTask=null,currentPriorityLevel=3,isPerformingWork=!1,isHostCallbackScheduled=!1,isHostTimeoutScheduled=!1,needsPaint=!1,localSetTimeout,localClearTimeout,localSetImmediate,isMessageLoopRunning=!1,taskTimeoutID=-1,frameInterval=5,startTime=-1,schedulePerformWorkUntilDeadline,channel,port,$unstable_IdlePriority=5,$unstable_ImmediatePriority=1,$unstable_NormalPriority=3,$unstable_UserBlockingPriority=2,$unstable_cancelCallback=function(task){task.callback=null},$unstable_requestPaint=function(){needsPaint=!0},$unstable_scheduleCallback=function(priorityLevel,callback,options){var currentTime=$unstable_now();switch(typeof options==="object"&&options!==null?(options=options.delay,options=typeof options==="number"&&0<options?currentTime+options:currentTime):options=currentTime,priorityLevel){case 1:var timeout=-1;break;case 2:timeout=250;break;case 5:timeout=1073741823;break;case 4:timeout=1e4;break;default:timeout=5000}return timeout=options+timeout,priorityLevel={id:taskIdCounter++,callback,priorityLevel,startTime:options,expirationTime:timeout,sortIndex:-1},options>currentTime?(priorityLevel.sortIndex=options,push(timerQueue,priorityLevel),peek(taskQueue)===null&&priorityLevel===peek(timerQueue)&&(isHostTimeoutScheduled?(localClearTimeout(taskTimeoutID),taskTimeoutID=-1):isHostTimeoutScheduled=!0,requestHostTimeout(handleTimeout,options-currentTime))):(priorityLevel.sortIndex=timeout,push(taskQueue,priorityLevel),isHostCallbackScheduled||isPerformingWork||(isHostCallbackScheduled=!0,isMessageLoopRunning||(isMessageLoopRunning=!0,schedulePerformWorkUntilDeadline()))),priorityLevel},$unstable_shouldYield;var init_scheduler_production=__esm(()=>{if(typeof performance==="object"&&typeof performance.now==="function")localPerformance=performance,$unstable_now=function(){return localPerformance.now()};else localDate=Date,initialTime=localDate.now(),$unstable_now=function(){return localDate.now()-initialTime};taskQueue=[],timerQueue=[],localSetTimeout=typeof setTimeout==="function"?setTimeout:null,localClearTimeout=typeof clearTimeout==="function"?clearTimeout:null,localSetImmediate=typeof setImmediate<"u"?setImmediate:null;if(typeof localSetImmediate==="function")schedulePerformWorkUntilDeadline=function(){localSetImmediate(performWorkUntilDeadline)};else if(typeof MessageChannel<"u")channel=new MessageChannel,port=channel.port2,channel.port1.onmessage=performWorkUntilDeadline,schedulePerformWorkUntilDeadline=function(){port.postMessage(null)};else schedulePerformWorkUntilDeadline=function(){localSetTimeout(performWorkUntilDeadline,0)};$unstable_shouldYield=shouldYieldToHost});var require_react_reconciler_production=__commonJS((exports,module)=>{init_scheduler_production();var React=__toESM(require_react_production());module.exports=function($$$config){function createFiber(tag,pendingProps,key,mode){return new FiberNode(tag,pendingProps,key,mode)}function noop(){}function formatProdErrorMessage(code){var url="https://react.dev/errors/"+code;if(1<arguments.length){url+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)url+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+code+"; visit "+url+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function getNearestMountedFiber(fiber){var node=fiber,nearestMounted=fiber;if(fiber.alternate)for(;node.return;)node=node.return;else{fiber=node;do node=fiber,(node.flags&4098)!==0&&(nearestMounted=node.return),fiber=node.return;while(fiber)}return node.tag===3?nearestMounted:null}function assertIsMounted(fiber){if(getNearestMountedFiber(fiber)!==fiber)throw Error(formatProdErrorMessage(188))}function findCurrentFiberUsingSlowPath(fiber){var alternate=fiber.alternate;if(!alternate){if(alternate=getNearestMountedFiber(fiber),alternate===null)throw Error(formatProdErrorMessage(188));return alternate!==fiber?null:fiber}for(var a=fiber,b=alternate;;){var parentA=a.return;if(parentA===null)break;var parentB=parentA.alternate;if(parentB===null){if(b=parentA.return,b!==null){a=b;continue}break}if(parentA.child===parentB.child){for(parentB=parentA.child;parentB;){if(parentB===a)return assertIsMounted(parentA),fiber;if(parentB===b)return assertIsMounted(parentA),alternate;parentB=parentB.sibling}throw Error(formatProdErrorMessage(188))}if(a.return!==b.return)a=parentA,b=parentB;else{for(var didFindChild=!1,child$0=parentA.child;child$0;){if(child$0===a){didFindChild=!0,a=parentA,b=parentB;break}if(child$0===b){didFindChild=!0,b=parentA,a=parentB;break}child$0=child$0.sibling}if(!didFindChild){for(child$0=parentB.child;child$0;){if(child$0===a){didFindChild=!0,a=parentB,b=parentA;break}if(child$0===b){didFindChild=!0,b=parentB,a=parentA;break}child$0=child$0.sibling}if(!didFindChild)throw Error(formatProdErrorMessage(189))}}if(a.alternate!==b)throw Error(formatProdErrorMessage(190))}if(a.tag!==3)throw Error(formatProdErrorMessage(188));return a.stateNode.current===a?fiber:alternate}function findCurrentHostFiberImpl(node){var tag=node.tag;if(tag===5||tag===26||tag===27||tag===6)return node;for(node=node.child;node!==null;){if(tag=findCurrentHostFiberImpl(node),tag!==null)return tag;node=node.sibling}return null}function findCurrentHostFiberWithNoPortalsImpl(node){var tag=node.tag;if(tag===5||tag===26||tag===27||tag===6)return node;for(node=node.child;node!==null;){if(node.tag!==4&&(tag=findCurrentHostFiberWithNoPortalsImpl(node),tag!==null))return tag;node=node.sibling}return null}function getIteratorFn(maybeIterable){if(maybeIterable===null||typeof maybeIterable!=="object")return null;return maybeIterable=MAYBE_ITERATOR_SYMBOL&&maybeIterable[MAYBE_ITERATOR_SYMBOL]||maybeIterable["@@iterator"],typeof maybeIterable==="function"?maybeIterable:null}function getComponentNameFromType(type){if(type==null)return null;if(typeof type==="function")return type.$$typeof===REACT_CLIENT_REFERENCE?null:type.displayName||type.name||null;if(typeof type==="string")return type;switch(type){case REACT_FRAGMENT_TYPE:return"Fragment";case REACT_PROFILER_TYPE:return"Profiler";case REACT_STRICT_MODE_TYPE:return"StrictMode";case REACT_SUSPENSE_TYPE:return"Suspense";case REACT_SUSPENSE_LIST_TYPE:return"SuspenseList";case REACT_ACTIVITY_TYPE:return"Activity"}if(typeof type==="object")switch(type.$$typeof){case REACT_PORTAL_TYPE:return"Portal";case REACT_CONTEXT_TYPE:return type.displayName||"Context";case REACT_CONSUMER_TYPE:return(type._context.displayName||"Context")+".Consumer";case REACT_FORWARD_REF_TYPE:var innerType=type.render;return type=type.displayName,type||(type=innerType.displayName||innerType.name||"",type=type!==""?"ForwardRef("+type+")":"ForwardRef"),type;case REACT_MEMO_TYPE:return innerType=type.displayName||null,innerType!==null?innerType:getComponentNameFromType(type.type)||"Memo";case REACT_LAZY_TYPE:innerType=type._payload,type=type._init;try{return getComponentNameFromType(type(innerType))}catch(x){}}return null}function createCursor(defaultValue){return{current:defaultValue}}function pop2(cursor){0>index$jscomp$0||(cursor.current=valueStack[index$jscomp$0],valueStack[index$jscomp$0]=null,index$jscomp$0--)}function push2(cursor,value){index$jscomp$0++,valueStack[index$jscomp$0]=cursor.current,cursor.current=value}function clz32Fallback(x){return x>>>=0,x===0?32:31-(log$1(x)/LN2|0)|0}function getHighestPriorityLanes(lanes){var pendingSyncLanes=lanes&42;if(pendingSyncLanes!==0)return pendingSyncLanes;switch(lanes&-lanes){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return lanes&261888;case 262144:case 524288:case 1048576:case 2097152:return lanes&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return lanes&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return lanes}}function getNextLanes(root,wipLanes,rootHasPendingCommit){var pendingLanes=root.pendingLanes;if(pendingLanes===0)return 0;var nextLanes=0,suspendedLanes=root.suspendedLanes,pingedLanes=root.pingedLanes;root=root.warmLanes;var nonIdlePendingLanes=pendingLanes&134217727;return nonIdlePendingLanes!==0?(pendingLanes=nonIdlePendingLanes&~suspendedLanes,pendingLanes!==0?nextLanes=getHighestPriorityLanes(pendingLanes):(pingedLanes&=nonIdlePendingLanes,pingedLanes!==0?nextLanes=getHighestPriorityLanes(pingedLanes):rootHasPendingCommit||(rootHasPendingCommit=nonIdlePendingLanes&~root,rootHasPendingCommit!==0&&(nextLanes=getHighestPriorityLanes(rootHasPendingCommit))))):(nonIdlePendingLanes=pendingLanes&~suspendedLanes,nonIdlePendingLanes!==0?nextLanes=getHighestPriorityLanes(nonIdlePendingLanes):pingedLanes!==0?nextLanes=getHighestPriorityLanes(pingedLanes):rootHasPendingCommit||(rootHasPendingCommit=pendingLanes&~root,rootHasPendingCommit!==0&&(nextLanes=getHighestPriorityLanes(rootHasPendingCommit)))),nextLanes===0?0:wipLanes!==0&&wipLanes!==nextLanes&&(wipLanes&suspendedLanes)===0&&(suspendedLanes=nextLanes&-nextLanes,rootHasPendingCommit=wipLanes&-wipLanes,suspendedLanes>=rootHasPendingCommit||suspendedLanes===32&&(rootHasPendingCommit&4194048)!==0)?wipLanes:nextLanes}function checkIfRootIsPrerendering(root,renderLanes2){return(root.pendingLanes&~(root.suspendedLanes&~root.pingedLanes)&renderLanes2)===0}function computeExpirationTime(lane,currentTime){switch(lane){case 1:case 2:case 4:case 8:case 64:return currentTime+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return currentTime+5000;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function claimNextRetryLane(){var lane=nextRetryLane;return nextRetryLane<<=1,(nextRetryLane&62914560)===0&&(nextRetryLane=4194304),lane}function createLaneMap(initial){for(var laneMap=[],i=0;31>i;i++)laneMap.push(initial);return laneMap}function markRootUpdated$1(root,updateLane){root.pendingLanes|=updateLane,updateLane!==268435456&&(root.suspendedLanes=0,root.pingedLanes=0,root.warmLanes=0)}function markRootFinished(root,finishedLanes,remainingLanes,spawnedLane,updatedLanes,suspendedRetryLanes){var previouslyPendingLanes=root.pendingLanes;root.pendingLanes=remainingLanes,root.suspendedLanes=0,root.pingedLanes=0,root.warmLanes=0,root.expiredLanes&=remainingLanes,root.entangledLanes&=remainingLanes,root.errorRecoveryDisabledLanes&=remainingLanes,root.shellSuspendCounter=0;var{entanglements,expirationTimes,hiddenUpdates}=root;for(remainingLanes=previouslyPendingLanes&~remainingLanes;0<remainingLanes;){var index$5=31-clz32(remainingLanes),lane=1<<index$5;entanglements[index$5]=0,expirationTimes[index$5]=-1;var hiddenUpdatesForLane=hiddenUpdates[index$5];if(hiddenUpdatesForLane!==null)for(hiddenUpdates[index$5]=null,index$5=0;index$5<hiddenUpdatesForLane.length;index$5++){var update=hiddenUpdatesForLane[index$5];update!==null&&(update.lane&=-536870913)}remainingLanes&=~lane}spawnedLane!==0&&markSpawnedDeferredLane(root,spawnedLane,0),suspendedRetryLanes!==0&&updatedLanes===0&&root.tag!==0&&(root.suspendedLanes|=suspendedRetryLanes&~(previouslyPendingLanes&~finishedLanes))}function markSpawnedDeferredLane(root,spawnedLane,entangledLanes){root.pendingLanes|=spawnedLane,root.suspendedLanes&=~spawnedLane;var spawnedLaneIndex=31-clz32(spawnedLane);root.entangledLanes|=spawnedLane,root.entanglements[spawnedLaneIndex]=root.entanglements[spawnedLaneIndex]|1073741824|entangledLanes&261930}function markRootEntangled(root,entangledLanes){var rootEntangledLanes=root.entangledLanes|=entangledLanes;for(root=root.entanglements;rootEntangledLanes;){var index$6=31-clz32(rootEntangledLanes),lane=1<<index$6;lane&entangledLanes|root[index$6]&entangledLanes&&(root[index$6]|=entangledLanes),rootEntangledLanes&=~lane}}function getBumpedLaneForHydration(root,renderLanes2){var renderLane=renderLanes2&-renderLanes2;return renderLane=(renderLane&42)!==0?1:getBumpedLaneForHydrationByLane(renderLane),(renderLane&(root.suspendedLanes|renderLanes2))!==0?0:renderLane}function getBumpedLaneForHydrationByLane(lane){switch(lane){case 2:lane=1;break;case 8:lane=4;break;case 32:lane=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:lane=128;break;case 268435456:lane=134217728;break;default:lane=0}return lane}function lanesToEventPriority(lanes){return lanes&=-lanes,2<lanes?8<lanes?(lanes&134217727)!==0?32:268435456:8:2}function setIsStrictModeForDevtools(newIsStrictMode){if(typeof log2==="function"&&unstable_setDisableYieldValue2(newIsStrictMode),injectedHook&&typeof injectedHook.setStrictMode==="function")try{injectedHook.setStrictMode(rendererID,newIsStrictMode)}catch(err){}}function is(x,y){return x===y&&(x!==0||1/x===1/y)||x!==x&&y!==y}function describeBuiltInComponentFrame(name){if(prefix===void 0)try{throw Error()}catch(x){var match=x.stack.trim().match(/\n( *(at )?)/);prefix=match&&match[1]||"",suffix=-1<x.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<x.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+prefix+name+suffix}function describeNativeComponentFrame(fn,construct){if(!fn||reentry)return"";reentry=!0;var previousPrepareStackTrace=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var RunInRootFrame={DetermineComponentFrameRoot:function(){try{if(construct){var Fake=function(){throw Error()};if(Object.defineProperty(Fake.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==="object"&&Reflect.construct){try{Reflect.construct(Fake,[])}catch(x){var control=x}Reflect.construct(fn,[],Fake)}else{try{Fake.call()}catch(x$8){control=x$8}fn.call(Fake.prototype)}}else{try{throw Error()}catch(x$9){control=x$9}(Fake=fn())&&typeof Fake.catch==="function"&&Fake.catch(function(){})}}catch(sample){if(sample&&control&&typeof sample.stack==="string")return[sample.stack,control.stack]}return[null,null]}};RunInRootFrame.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var namePropDescriptor=Object.getOwnPropertyDescriptor(RunInRootFrame.DetermineComponentFrameRoot,"name");namePropDescriptor&&namePropDescriptor.configurable&&Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _RunInRootFrame$Deter=RunInRootFrame.DetermineComponentFrameRoot(),sampleStack=_RunInRootFrame$Deter[0],controlStack=_RunInRootFrame$Deter[1];if(sampleStack&&controlStack){var sampleLines=sampleStack.split(`
5
5
  `),controlLines=controlStack.split(`
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{findBinding,formatChord}from"./chunk-yqcsjw9c.js";function capOf(row){return row.hint?.keys??row.keys[0]}function legendCap(id){let row=findBinding(id);if(!row)return null;let cap=capOf(row);return cap&&cap.length>0?cap:null}function directCap(row){if(row.keys.length>0)return row.hint?.keys??row.keys[0]??null;return row.prefixKeys?.length?null:row.hint?.keys??null}function availableOn(row,surface){if(row.scope==="global")return!0;if(surface===null)return!1;if(row.scope===surface)return!0;return surface==="terminal"&&row.scope==="workspace"}function grammarHelpSections(keymap,surface,prefixKey,reachability){let here=[],direct=[],prefix=[],other=new Map;for(let binding of keymap){let cap=directCap(binding),staticallyAvailable=availableOn(binding,surface),directAvailable=reachability?reachability.direct.has(binding.id):staticallyAvailable,prefixAvailable=reachability?reachability.prefix.has(binding.id):staticallyAvailable;if(cap){let row={binding,primary:cap,aliases:binding.keys.filter((key)=>key!==cap)};if(directAvailable&&(staticallyAvailable||binding.presentation==="onePress"))if(binding.presentation==="onePress")direct.push(row);else here.push(row);else if(!staticallyAvailable&&binding.scope!=="global"){let rows=other.get(binding.scope);if(rows)rows.push(row);else other.set(binding.scope,[row])}}if(prefixKey&&prefixAvailable&&binding.prefixKeys?.length)prefix.push({binding,primary:`${prefixKey} + ${binding.prefixKeys[0]}`,aliases:binding.prefixKeys.slice(1).map((key)=>`${prefixKey} + ${key}`)})}let sections=[];if(here.length)sections.push({kind:"here",scope:surface??void 0,rows:here});if(direct.length)sections.push({kind:"direct",rows:direct});if(prefix.length)sections.push({kind:"prefix",rows:prefix});for(let[scope,rows]of other)sections.push({kind:"other",scope,rows});return sections}var SCOPE_CATEGORY={global:"Global",sidebar:"Sidebar",workspace:"Workspace",files:"Files",inbox:"Inbox",terminal:"Terminal"};function scopeCategory(scope){return scope?SCOPE_CATEGORY[scope]:"Global"}function guideCategory(action){if(["kanban.open","automations.open","workItems.open"].includes(action))return"Views";if(action.startsWith("focus."))return"Navigation";if(action.startsWith("inbox.")||action.startsWith("attention."))return"Attention";if(action.startsWith("chat.tab.")||action.startsWith("chat.session."))return"Sessions";if(action.startsWith("chat.fork.")||action.startsWith("task."))return"Tasks";if(action.startsWith("settings.")||action==="workspace.zenToggle")return"Tools";return findBinding(action)?.category??"Global"}var KEY_HINTS_ENABLED_KEY="hints.keyboard.enabled",PANE_HINT_USED_KEYS={sidebar:"hints.sidebar.used",files:"hints.files.used"};function keyHintsEnabled(raw){return raw!==!1}function keyHintsToggleOn(kv){return keyHintsEnabled(kv.get(KEY_HINTS_ENABLED_KEY,!0))}function toggleKeyHints(kv){let next=!keyHintsToggleOn(kv);if(kv.set(KEY_HINTS_ENABLED_KEY,next),next)for(let key of Object.values(PANE_HINT_USED_KEYS))kv.set(key,!1)}function paneHintVisible(enabledRaw,usedRaw){return keyHintsEnabled(enabledRaw)&&usedRaw!==!0}function statusHintTokens(reach,prefixKey){let tokens=[];if(prefixKey!==null&&reach.prefix.size>0)tokens.push({chord:prefixKey,msg:"commands"});else if(reach.inputPassthrough){let cap=reach.direct.has("focus.sidebar")?legendCap("focus.sidebar"):null;if(cap)tokens.push({chord:cap,msg:"sidebar"})}if(reach.direct.has("help.open")){let cap=legendCap("help.open");if(cap)tokens.push({chord:cap,msg:"help"})}return tokens}var PANE_HINT_ROWS={sidebar:[{id:"sidebar.nav",msg:"move"},{id:"sidebar.select",msg:"open"}],files:[{id:"files.nav",msg:"move"},{id:"files.hierarchy",msg:"collapse"},{id:"files.open",msg:"open",always:!0},{id:"files.diff",msg:"diff",always:!0}]};function paneHintTokens(pane,mode){return PANE_HINT_ROWS[pane].flatMap((row)=>{if(mode==="always"&&row.always!==!0)return[];let cap=legendCap(row.id);return cap?[{cap,msg:row.msg}]:[]})}function wizardKeyLines(prefixKey){let lines=[],nav=legendCap("sidebar.nav"),open=legendCap("sidebar.select");if(nav&&open)lines.push({msg:"keysBare",params:{nav:formatChord(nav),open:formatChord(open)}});let newTab=legendCap("chat.tab.new"),focusNext=legendCap("focus.next");if(newTab&&focusNext)lines.push({msg:"keysOnePress",params:{newTab:formatChord(newTab),focusNext:formatChord(focusNext)}});if(prefixKey!==null)lines.push({msg:"keysPrefix",params:{prefix:formatChord(prefixKey)}});let help=legendCap("help.open");if(help)lines.push({msg:"keysHelp",params:{help:formatChord(help)}});return lines}
2
+ import{findBinding,formatChord}from"./chunk-pkzyrwhv.js";function capOf(row){return row.hint?.keys??row.keys[0]}function legendCap(id){let row=findBinding(id);if(!row)return null;let cap=capOf(row);return cap&&cap.length>0?cap:null}function directCap(row){if(row.keys.length>0)return row.hint?.keys??row.keys[0]??null;return row.prefixKeys?.length?null:row.hint?.keys??null}function availableOn(row,surface){if(row.scope==="global")return!0;if(surface===null)return!1;if(row.scope===surface)return!0;return surface==="terminal"&&row.scope==="workspace"}function grammarHelpSections(keymap,surface,prefixKey,reachability){let here=[],direct=[],prefix=[],other=new Map;for(let binding of keymap){let cap=directCap(binding),staticallyAvailable=availableOn(binding,surface),directAvailable=reachability?reachability.direct.has(binding.id):staticallyAvailable,prefixAvailable=reachability?reachability.prefix.has(binding.id):staticallyAvailable;if(cap){let row={binding,primary:cap,aliases:binding.keys.filter((key)=>key!==cap)};if(directAvailable&&(staticallyAvailable||binding.presentation==="onePress"))if(binding.presentation==="onePress")direct.push(row);else here.push(row);else if(!staticallyAvailable&&binding.scope!=="global"){let rows=other.get(binding.scope);if(rows)rows.push(row);else other.set(binding.scope,[row])}}if(prefixKey&&prefixAvailable&&binding.prefixKeys?.length)prefix.push({binding,primary:`${prefixKey} + ${binding.prefixKeys[0]}`,aliases:binding.prefixKeys.slice(1).map((key)=>`${prefixKey} + ${key}`)})}let sections=[];if(here.length)sections.push({kind:"here",scope:surface??void 0,rows:here});if(direct.length)sections.push({kind:"direct",rows:direct});if(prefix.length)sections.push({kind:"prefix",rows:prefix});for(let[scope,rows]of other)sections.push({kind:"other",scope,rows});return sections}var SCOPE_CATEGORY={global:"Global",sidebar:"Sidebar",workspace:"Workspace",files:"Files",inbox:"Inbox",terminal:"Terminal"};function scopeCategory(scope){return scope?SCOPE_CATEGORY[scope]:"Global"}function guideCategory(action){if(["kanban.open","automations.open","workItems.open"].includes(action))return"Views";if(action.startsWith("focus."))return"Navigation";if(action.startsWith("inbox.")||action.startsWith("attention."))return"Attention";if(action.startsWith("chat.tab.")||action.startsWith("chat.session."))return"Sessions";if(action.startsWith("chat.fork.")||action.startsWith("task."))return"Tasks";if(action.startsWith("settings.")||action==="workspace.zenToggle")return"Tools";return findBinding(action)?.category??"Global"}var KEY_HINTS_ENABLED_KEY="hints.keyboard.enabled",PANE_HINT_USED_KEYS={sidebar:"hints.sidebar.used",files:"hints.files.used"};function keyHintsEnabled(raw){return raw!==!1}function keyHintsToggleOn(kv){return keyHintsEnabled(kv.get(KEY_HINTS_ENABLED_KEY,!0))}function toggleKeyHints(kv){let next=!keyHintsToggleOn(kv);if(kv.set(KEY_HINTS_ENABLED_KEY,next),next)for(let key of Object.values(PANE_HINT_USED_KEYS))kv.set(key,!1)}function paneHintVisible(enabledRaw,usedRaw){return keyHintsEnabled(enabledRaw)&&usedRaw!==!0}function statusHintTokens(reach,prefixKey){let tokens=[];if(prefixKey!==null&&reach.prefix.size>0)tokens.push({chord:prefixKey,msg:"commands"});else if(reach.inputPassthrough){let cap=reach.direct.has("focus.sidebar")?legendCap("focus.sidebar"):null;if(cap)tokens.push({chord:cap,msg:"sidebar"})}if(reach.direct.has("help.open")){let cap=legendCap("help.open");if(cap)tokens.push({chord:cap,msg:"help"})}return tokens}var PANE_HINT_ROWS={sidebar:[{id:"sidebar.nav",msg:"move"},{id:"sidebar.select",msg:"open"}],files:[{id:"files.nav",msg:"move"},{id:"files.hierarchy",msg:"collapse"},{id:"files.open",msg:"open",always:!0},{id:"files.diff",msg:"diff",always:!0}]};function paneHintTokens(pane,mode){return PANE_HINT_ROWS[pane].flatMap((row)=>{if(mode==="always"&&row.always!==!0)return[];let cap=legendCap(row.id);return cap?[{cap,msg:row.msg}]:[]})}function wizardKeyLines(prefixKey){let lines=[],nav=legendCap("sidebar.nav"),open=legendCap("sidebar.select");if(nav&&open)lines.push({msg:"keysBare",params:{nav:formatChord(nav),open:formatChord(open)}});let newTab=legendCap("chat.tab.new"),focusNext=legendCap("focus.next");if(newTab&&focusNext)lines.push({msg:"keysOnePress",params:{newTab:formatChord(newTab),focusNext:formatChord(focusNext)}});if(prefixKey!==null)lines.push({msg:"keysPrefix",params:{prefix:formatChord(prefixKey)}});let help=legendCap("help.open");if(help)lines.push({msg:"keysHelp",params:{help:formatChord(help)}});return lines}
3
3
  export{legendCap,grammarHelpSections,scopeCategory,guideCategory,KEY_HINTS_ENABLED_KEY,PANE_HINT_USED_KEYS,keyHintsEnabled,keyHintsToggleOn,toggleKeyHints,paneHintVisible,statusHintTokens,paneHintTokens,wizardKeyLines};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{KEY_HINTS_ENABLED_KEY,PANE_HINT_USED_KEYS,grammarHelpSections,guideCategory,keyHintsEnabled,keyHintsToggleOn,legendCap,paneHintTokens,paneHintVisible,scopeCategory,statusHintTokens,toggleKeyHints}from"./chunk-tvgvbq0p.js";import{embeddedTerminalEnv}from"./chunk-ef39ym8f.js";import{readOutdatedCache}from"./chunk-n4nntq73.js";import{listPaneLaunches}from"./chunk-9xt05etk.js";import{deriveTitleFromSessionId,startTaskSessionWithPromptAdapter}from"./chunk-dwvqnbqg.js";import{canonPath,checkResolutionNotify}from"./chunk-zfqm8rmp.js";import{readLastActiveTaskId}from"./chunk-tqat428f.js";import{formatBytes}from"./chunk-my20q579.js";import{detectEngineStatuses,probeableEngineIds,summarizeEngines}from"./chunk-edeh4d1v.js";import{ISSUE_STATUSES,isValidCron,nextCronAfter,tightenPluginPermissions}from"./chunk-044s3zc5.js";import"./chunk-41ahvk51.js";import{DEFAULT_EDITOR_KIND,EDITOR_CUSTOM_KEY,EDITOR_KINDS,EDITOR_KIND_KEY,normalizeEditorKind,resolveEditorLaunch}from"./chunk-2jt0tbte.js";import{approxCellWidth,approxCharCells,charWidth,displayWidth,padEndCells}from"./chunk-dvcb6mk4.js";import{UpdatePage,openWithSystemViewer,resolveRowSelectionChrome,spawnDetached}from"./chunk-mzmsbfsk.js";import{$Fragment,$jsx,$jsxs,DEFAULT_PREFIX_CONFIGURATION,DIRECT_GUIDE_PREFIX_ACTION_ID,FIXED_BINDING_IDS,KobeKeymap,PREFIX_GUIDE_DELAY_MS,PREFIX_HUD_TTL_MS,RemoteOrchestrator,armPrefixFromCurrentStack,attentionEdges,attentionKindFor,bindByIds,bootPaneHost,chipAttentionKind,currentBindingReachability,currentPrefixConfiguration,defaultChordsOf,findBinding,formatChord,imeAnchorController,invokeArmedPrefixActionFromCurrentStack,isKittyModifierKeyEvent,isNarrowWidth,keymapVersion,modalActive,narrowSurface,pageCloseBindings,pluginKeybindings,prefixAction,prefixHudClock,prefixHudState,redrawScreen,reloadUserKeybindings,require_react_production,shortcutCaption,showDialog,subscribeKeymapVersion,taskJumpDigit,useAccessor,useBindingStackVersion,useBindings,useDialog,useDialogPaddingX,useFocus,useKV,useLatest,useNotifications,useOptionalDialog,useOptionalFocus,useOptionalKV,useOptionalNotifications,usePaste,useRenderer,useT,useTerminalDimensions,useTheme,userKeybindingsReport}from"./chunk-yqcsjw9c.js";import"./chunk-764bsyb0.js";import{getGlobalDefaultVendor,resolvePreferredVendor,setGlobalDefaultVendor,setRepoLastActiveVendor}from"./chunk-kn3pgymw.js";import{parseNumstatRows,parsePorcelain,pickPushedChanges,sameWorktreeChanges}from"./chunk-xqw5d5rv.js";import{parsePorcelainRows,unquoteGitPath}from"./chunk-h4n8ffqy.js";import{READ_ONLY_GIT_ENV,readOnlyGitProcessEnv}from"./chunk-6xppe9bj.js";import{reloadPluginEngines}from"./chunk-vhhzk3xj.js";import{submitFeedback}from"./chunk-5jq3dvmn.js";import{DIRTY_WORKTREE_CODE,TASK_DELETING_CODE,TaskDeletingError}from"./chunk-9kefy6ev.js";import{PROJECT_SIBLING_BASE,WORKTREE_BASE_CUSTOM_KEY,worktreeBaseKindOf}from"./chunk-me23en52.js";import{currentPluginPlatform,loadPluginRegistry,parsePluginManifest,pluginConfigDir,pluginLogPath,pluginManifestPath,qualifiedActionId,readPluginManifest,savePluginRegistry,supportsPlatform}from"./chunk-38272eqv.js";import{PROJECT_DIR_TOKEN,WORKTREE_BASE_KEY,hasProjectDirToken,normalizeWorktreeBase}from"./chunk-5f80ggc3.js";import{ulid}from"./chunk-qkehg2c1.js";import{matchPathGlob}from"./chunk-kg11c1py.js";import{tildify}from"./chunk-msr1xtay.js";import{CURRENT_VERSION}from"./chunk-a20p202a.js";import{addTab,closeActiveTab,closeTab,collapseSplit,cycleLeaf,cycleTab,engineTabSpawnFor,expandHome,filterSubdirs,findEditorTab,forgetTaskTabsSnapshot,hasEngineLeaf,initialShellTabs,initialSplit,initialTabs,isTabSplit,joinDrill,joinPicked,leaves,listSubdirs,moveTab,openCommandTab,openContentTab,openEditorTab,pathLeaf,recycleTabs,rehydrateTabs,removeLeaf,renameActiveTab,renameLeaf,reopenTabs,selectTab,setTabAutoTitle,setTabEngineCommand,setTabForkFrom,setTabInitialPrompt,setTabLastTitle,setTabLiveVendor,setTabSessionId,setTabSpawned,setTabSplit,setTabTitle,shellIdentityInput,splitActive,splitLeafNames,splitLeafPtyKey,splitPathForDirSuggest,stripTrailingSlash,sweepOrphanTabsSnapshots,tabCwdFor,tabExitAction,tabPtyKey,tabPtyKeyFor,tabTitle,tabTitleStable,terminalTabsKey,visibleNativeStatus}from"./chunk-nrafk2b7.js";import{AUTO_STATUS_KEY,DELIVERY_GUARDS,DISPATCHER_KEY,Ke,deliveryGuardEnvOverride,deliveryGuardPreference,hostedTaskKeys,killHostedSessions,listHostedSessions,nextDeliveryGuard,openHostedSessionHost,pastePromptWhenEngineUp,require_xterm_headless,setDeliveryGuardPreference}from"./chunk-mbb0pp66.js";import{execHostForWorktreePath,remoteKeyForRepo}from"./chunk-rhsvvdcn.js";import"./chunk-bkba9c4n.js";import"./chunk-g2advs8t.js";import{ensurePtyHostReachable}from"./chunk-zhbws9n3.js";import{ENGINE_PROTOCOLS,engineCanFork,engineLaunchArgv,engineProtocolKey,getEngineProtocol,pickUnclaimedSessionId,protocolEntry,withPinnedSessionId}from"./chunk-vhrfe63r.js";import"./chunk-rcyasw34.js";import{resolveLoginShell}from"./chunk-b99tf0jr.js";import{DEFAULT_TERMINAL_COLORS,formatDefaultColorReply,parseTerminalDefaultColors}from"./chunk-7q67dz4c.js";import{readFirstNonEmptyRepoFile}from"./chunk-h8m37225.js";import"./chunk-hape5vwj.js";import{defaultEngineCommand,engineCommandKey,engineDisplayName,engineNameKey,humanizeSlug,interactiveEngineCommand,kobeApiInvocation}from"./chunk-zg3wezj6.js";import{FOCUS_ACCENT_SLOTS,LOCALE_KEY}from"./chunk-ym78sw9a.js";import"./chunk-zqfbyq0a.js";import{currentLang,intlLocale,setLocaleLang,t,tKeys}from"./chunk-rvybphrq.js";import{LOCALES}from"./chunk-xhb03ybc.js";import{createStateCell}from"./chunk-sdyzxayr.js";import"./chunk-w25b7xxz.js";import"./chunk-jvxh93nz.js";import{connectOrStartDaemon}from"./chunk-h9mqdxvs.js";import"./chunk-8wv8526c.js";import{KobeDaemonClient}from"./chunk-0gepyh6e.js";import{attentionInboxItemKey,automationRunNeedsAttention}from"./chunk-bkvr06xn.js";import"./chunk-mnqxgvyb.js";import{foregroundEngineIn,parsePsSnapshot,psSnapshot}from"./chunk-etnnwbdx.js";import{engineEntry,engineSessionIdFromTitle,engineTitleTurnHint,getCapabilities,stripEngineStatusPrefix}from"./chunk-crdag2rc.js";import{maybeStartScheduledRun,spawnCapture}from"./chunk-khj0apc7.js";import{availableEngineIds,installedEngineIds}from"./chunk-nzscq4yf.js";import"./chunk-w7zv47mp.js";import{roveCliInvocation}from"./chunk-6tvrvekq.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-k1qe5qqa.js";import{DEFAULT_TASK_VENDOR,TASK_STATUSES}from"./chunk-xy8be792.js";import{addSavedRepo,getSavedRepos,isGitRepo,isRemoteRepoKey,resolveMainRepoRoot}from"./chunk-6wpege0h.js";import{loadStateFile}from"./chunk-j75axe29.js";import"./chunk-ayhhgfsz.js";import{errorMessage,userFacingErrorMessage}from"./chunk-2brn8e1y.js";import{ALL_VENDORS,isBuiltinVendor,nextVendorWithin,prevVendorWithin}from"./chunk-bq3fyc0p.js";import"./chunk-3wj69b0a.js";import{isDev,promptAttachmentsDir,roveStateDir}from"./chunk-ch9b1d5y.js";import"./chunk-mv7ptt5w.js";import{activeCliName}from"./chunk-v0zxyqrq.js";import"./chunk-e29hx18x.js";import{ROVE_PRODUCT_NAME}from"./chunk-g56kvet6.js";import"./chunk-pxk2c2vj.js";import{logClientError}from"./chunk-k2ckx8zw.js";import"./chunk-pw6yfj10.js";import{defaultDaemonSocketPath}from"./chunk-mcdv19rs.js";import{readRoveEnv}from"./chunk-r3k9rbwm.js";import{__require,__toESM}from"./chunk-wqfp8d9w.js";var import_react115=__toESM(require_react_production(),1);function truncateEnd(s,max){if(max<=0)return"";let points=[...s];if(points.length<=max)return s;return`${points.slice(0,Math.max(0,max-1)).join("")}\u2026`}function truncateEndCells(s,maxCells,cellsOf){if(maxCells<=0)return"";let total=0;for(let ch of s)total+=cellsOf(ch.codePointAt(0)??0);if(total<=maxCells)return s;let used=0,out="";for(let ch of s){let w=cellsOf(ch.codePointAt(0)??0);if(used+w>maxCells-1)break;used+=w,out+=ch}return`${out}\u2026`}function truncateStart(s,max){if(max<=0)return"";let points=[...s];if(points.length<=max)return s;return`\u2026${points.slice(points.length-Math.max(0,max-1)).join("")}`}function truncateStartCells(s,maxCells,cellsOf){if(maxCells<=0)return"";let points=[...s],total=0;for(let ch of points)total+=cellsOf(ch.codePointAt(0)??0);if(total<=maxCells)return s;let used=0,out="";for(let i=points.length-1;i>=0;i--){let ch=points[i],w=cellsOf(ch.codePointAt(0)??0);if(used+w>maxCells-1)break;used+=w,out=ch+out}return`\u2026${out}`}var SIDEBAR_WIDTH=24;function sidebarWidthFor(terminalWidth){return Math.max(SIDEBAR_WIDTH,Math.min(40,Math.floor(terminalWidth/6)))}var MAIN_BRANCH_POLL_MS=2000;function sidebarEmptyStateKey(opts){if(opts.searching)return"tasks.empty.noMatchSearch";if(opts.projectFilter)return"tasks.empty.noActiveProject";return"tasks.empty.noActive"}var BRANCH_LABEL_MAX=16;function truncateBranchLabel(branch,max=BRANCH_LABEL_MAX){return truncateEnd(branch,max)}function toneColor(theme,tone){switch(tone){case"success":return theme.success;case"warning":return theme.warning;case"primary":return theme.primary;case"error":return theme.error;default:return theme.textMuted}}function searchQueryKeystroke(query,evt){if(evt.defaultPrevented)return null;if(evt.ctrl||evt.meta||evt.option)return null;if(evt.name==="backspace")return query.slice(0,-1);let seq=evt.sequence;if(!seq||seq.length!==1)return null;let code=seq.charCodeAt(0);if(code<32||code===127)return null;return query+seq}var m=0,p=0,g=0,b=0,I;((r)=>{function u(t2,a,s,i){return i!==void 0?`#${B(t2)}${B(a)}${B(s)}${B(i)}`:`#${B(t2)}${B(a)}${B(s)}`}r.toCss=u;function o(t2,a,s,i=255){return(t2<<24|a<<16|s<<8|i)>>>0}r.toRgba=o;function e(t2,a,s,i){return{css:r.toCss(t2,a,s,i),rgba:r.toRgba(t2,a,s,i)}}r.toColor=e})(I||={});var $;((i)=>{function u(n,l){if(b=(l.rgba&255)/255,b===1)return{css:l.css,rgba:l.rgba};let f=l.rgba>>24&255,d=l.rgba>>16&255,c=l.rgba>>8&255,C=n.rgba>>24&255,h=n.rgba>>16&255,x=n.rgba>>8&255;m=C+Math.round((f-C)*b),p=h+Math.round((d-h)*b),g=x+Math.round((c-x)*b);let R=I.toCss(m,p,g),L=I.toRgba(m,p,g);return{css:R,rgba:L}}i.blend=u;function o(n){return(n.rgba&255)===255}i.isOpaque=o;function e(n,l,f){let d=y.ensureContrastRatio(n.rgba,l.rgba,f);if(d)return I.toColor(d>>24&255,d>>16&255,d>>8&255)}i.ensureContrastRatio=e;function r(n){let l=(n.rgba|255)>>>0;return[m,p,g]=y.toChannels(l),{css:I.toCss(m,p,g),rgba:l}}i.opaque=r;function t2(n,l){return b=Math.round(l*255),[m,p,g]=y.toChannels(n.rgba),{css:I.toCss(m,p,g,b),rgba:I.toRgba(m,p,g,b)}}i.opacity=t2;function a(n,l){return b=n.rgba&255,t2(n,b*l/255)}i.multiplyOpacity=a;function s(n){return[n.rgba>>24&255,n.rgba>>16&255,n.rgba>>8&255]}i.toColorRGB=s})($||={});var _;((r)=>{let u,o;try{let t2=document.createElement("canvas");t2.width=1,t2.height=1;let a=t2.getContext("2d",{willReadFrequently:!0});a&&(u=a,u.globalCompositeOperation="copy",o=u.createLinearGradient(0,0,1,1))}catch{}function e(t2){if(t2.match(/#[\da-f]{3,8}/i))switch(t2.length){case 4:return m=parseInt(t2.slice(1,2).repeat(2),16),p=parseInt(t2.slice(2,3).repeat(2),16),g=parseInt(t2.slice(3,4).repeat(2),16),I.toColor(m,p,g);case 5:return m=parseInt(t2.slice(1,2).repeat(2),16),p=parseInt(t2.slice(2,3).repeat(2),16),g=parseInt(t2.slice(3,4).repeat(2),16),b=parseInt(t2.slice(4,5).repeat(2),16),I.toColor(m,p,g,b);case 7:return{css:t2,rgba:(parseInt(t2.slice(1),16)<<8|255)>>>0};case 9:return{css:t2,rgba:parseInt(t2.slice(1),16)>>>0}}let a=t2.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return m=parseInt(a[1]),p=parseInt(a[2]),g=parseInt(a[3]),b=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),I.toColor(m,p,g,b);if(!u||!o)throw Error("css.toColor: Unsupported css format");if(u.fillStyle=o,u.fillStyle=t2,typeof u.fillStyle!="string")throw Error("css.toColor: Unsupported css format");if(u.fillRect(0,0,1,1),[m,p,g,b]=u.getImageData(0,0,1,1).data,b!==255)throw Error("css.toColor: Unsupported css format");return{rgba:I.toRgba(m,p,g,b),css:t2}}r.toColor=e})(_||={});var v;((e)=>{function u(r){return o(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=u;function o(r,t2,a){let s=r/255,i=t2/255,n=a/255,l=s<=0.03928?s/12.92:Math.pow((s+0.055)/1.055,2.4),f=i<=0.03928?i/12.92:Math.pow((i+0.055)/1.055,2.4),d=n<=0.03928?n/12.92:Math.pow((n+0.055)/1.055,2.4);return l*0.2126+f*0.7152+d*0.0722}e.relativeLuminance2=o})(v||={});var y;((a)=>{function u(s,i){if(b=(i&255)/255,b===1)return i;let n=i>>24&255,l=i>>16&255,f=i>>8&255,d=s>>24&255,c=s>>16&255,C=s>>8&255;return m=d+Math.round((n-d)*b),p=c+Math.round((l-c)*b),g=C+Math.round((f-C)*b),I.toRgba(m,p,g)}a.blend=u;function o(s,i,n){let l=v.relativeLuminance(s>>8),f=v.relativeLuminance(i>>8);if(F(l,f)<n){if(f<l){let h=e(s,i,n),x=F(l,v.relativeLuminance(h>>8));if(x<n){let R=r(s,i,n),L=F(l,v.relativeLuminance(R>>8));return x>L?h:R}return h}let c=r(s,i,n),C=F(l,v.relativeLuminance(c>>8));if(C<n){let h=e(s,i,n),x=F(l,v.relativeLuminance(h>>8));return C>x?c:h}return c}}a.ensureContrastRatio=o;function e(s,i,n){let l=s>>24&255,f=s>>16&255,d=s>>8&255,c=i>>24&255,C=i>>16&255,h=i>>8&255,x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));for(;x<n&&(c>0||C>0||h>0);)c-=Math.max(0,Math.ceil(c*0.1)),C-=Math.max(0,Math.ceil(C*0.1)),h-=Math.max(0,Math.ceil(h*0.1)),x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));return(c<<24|C<<16|h<<8|255)>>>0}a.reduceLuminance=e;function r(s,i,n){let l=s>>24&255,f=s>>16&255,d=s>>8&255,c=i>>24&255,C=i>>16&255,h=i>>8&255,x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));for(;x<n&&(c<255||C<255||h<255);)c=Math.min(255,c+Math.ceil((255-c)*0.1)),C=Math.min(255,C+Math.ceil((255-C)*0.1)),h=Math.min(255,h+Math.ceil((255-h)*0.1)),x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));return(c<<24|C<<16|h<<8|255)>>>0}a.increaseLuminance=r;function t2(s){return[s>>24&255,s>>16&255,s>>8&255,s&255]}a.toChannels=t2})(y||={});function B(u){let o=u.toString(16);return o.length<2?"0"+o:o}function F(u,o){return u<o?(o+0.05)/(u+0.05):(u+0.05)/(o+0.05)}var E=Object.freeze((()=>{let u=[_.toColor("#2e3436"),_.toColor("#cc0000"),_.toColor("#4e9a06"),_.toColor("#c4a000"),_.toColor("#3465a4"),_.toColor("#75507b"),_.toColor("#06989a"),_.toColor("#d3d7cf"),_.toColor("#555753"),_.toColor("#ef2929"),_.toColor("#8ae234"),_.toColor("#fce94f"),_.toColor("#729fcf"),_.toColor("#ad7fa8"),_.toColor("#34e2e2"),_.toColor("#eeeeec")],o=[0,95,135,175,215,255];for(let e=0;e<216;e++){let r=o[e/36%6|0],t2=o[e/6%6|0],a=o[e%6];u.push({css:I.toCss(r,t2,a),rgba:I.toRgba(r,t2,a)})}for(let e=0;e<24;e++){let r=8+e*10;u.push({css:I.toCss(r,r,r),rgba:I.toRgba(r,r,r)})}return u})());function A(u,o,e){return Math.max(o,Math.min(u,e))}function O(u){switch(u){case"&":return"&amp;";case"<":return"&lt;"}return u}var S=class{constructor(o){this._buffer=o}serialize(o,e){let r=this._buffer.getNullCell(),t2=this._buffer.getNullCell(),a=r,s=o.start.y,i=o.end.y,n=o.start.x,l=o.end.x;this._beforeSerialize(i-s,s,i);for(let f=s;f<=i;f++){let d=this._buffer.getLine(f);if(d){let c=f===o.start.y?n:0,C=f===o.end.y?l:d.length;for(let h=c;h<C;h++){let x=d.getCell(h,a===r?t2:r);if(!x){console.warn(`Can't get cell at row=${f}, col=${h}`);continue}this._nextCell(x,a,f,h),a=x}}this._rowEnd(f,f===i)}return this._afterSerialize(),this._serializeString(e)}_nextCell(o,e,r,t2){}_rowEnd(o,e){}_beforeSerialize(o,e,r){}_afterSerialize(){}_serializeString(o){return""}};function T(u,o){return u.getFgColorMode()===o.getFgColorMode()&&u.getFgColor()===o.getFgColor()}function w(u,o){return u.getBgColorMode()===o.getBgColorMode()&&u.getBgColor()===o.getBgColor()}function z(u,o){return u.isInverse()===o.isInverse()&&u.isBold()===o.isBold()&&u.isUnderline()===o.isUnderline()&&u.isOverline()===o.isOverline()&&u.isBlink()===o.isBlink()&&u.isInvisible()===o.isInvisible()&&u.isItalic()===o.isItalic()&&u.isDim()===o.isDim()&&u.isStrikethrough()===o.isStrikethrough()}var k=class extends S{constructor(e,r){super(e);this._terminal=r,this._rowIndex=0,this._allRows=[],this._allRowSeparators=[],this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(e,r,t2){this._allRows=Array(e),this._lastContentCursorRow=r,this._lastCursorRow=r,this._firstRow=r}_rowEnd(e,r){this._nullCellCount>0&&!w(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let t2="";if(!r){e-this._firstRow>=this._terminal.rows&&this._buffer.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol,this._backgroundCell);let a=this._buffer.getLine(e),s=this._buffer.getLine(e+1);if(!s.isWrapped)t2=`\r
2
+ import{KEY_HINTS_ENABLED_KEY,PANE_HINT_USED_KEYS,grammarHelpSections,guideCategory,keyHintsEnabled,keyHintsToggleOn,legendCap,paneHintTokens,paneHintVisible,scopeCategory,statusHintTokens,toggleKeyHints}from"./chunk-pnzk2rhm.js";import{embeddedTerminalEnv}from"./chunk-ef39ym8f.js";import{readOutdatedCache}from"./chunk-n4nntq73.js";import{listPaneLaunches}from"./chunk-9xt05etk.js";import{deriveTitleFromSessionId,startTaskSessionWithPromptAdapter}from"./chunk-bzhtt3sq.js";import{canonPath,checkResolutionNotify}from"./chunk-zfqm8rmp.js";import{readLastActiveTaskId}from"./chunk-tqat428f.js";import{formatBytes}from"./chunk-my20q579.js";import{detectEngineStatuses,probeableEngineIds,summarizeEngines}from"./chunk-w0m1q23m.js";import{ISSUE_STATUSES,isValidCron,nextCronAfter,tightenPluginPermissions}from"./chunk-044s3zc5.js";import"./chunk-41ahvk51.js";import{DEFAULT_EDITOR_KIND,EDITOR_CUSTOM_KEY,EDITOR_KINDS,EDITOR_KIND_KEY,normalizeEditorKind,resolveEditorLaunch}from"./chunk-2jt0tbte.js";import{approxCellWidth,approxCharCells,charWidth,displayWidth,padEndCells}from"./chunk-dvcb6mk4.js";import{UpdatePage,openWithSystemViewer,resolveRowSelectionChrome,spawnDetached}from"./chunk-mg4r96nk.js";import{$Fragment,$jsx,$jsxs,DEFAULT_PREFIX_CONFIGURATION,DIRECT_GUIDE_PREFIX_ACTION_ID,FIXED_BINDING_IDS,KobeKeymap,PREFIX_GUIDE_DELAY_MS,PREFIX_HUD_TTL_MS,RemoteOrchestrator,armPrefixFromCurrentStack,attentionEdges,attentionKindFor,bindByIds,bootPaneHost,chipAttentionKind,currentBindingReachability,currentPrefixConfiguration,defaultChordsOf,findBinding,formatChord,imeAnchorController,invokeArmedPrefixActionFromCurrentStack,isKittyModifierKeyEvent,isNarrowWidth,keymapVersion,modalActive,narrowSurface,pageCloseBindings,pluginKeybindings,prefixAction,prefixHudClock,prefixHudState,redrawScreen,reloadUserKeybindings,require_react_production,shortcutCaption,showDialog,subscribeKeymapVersion,taskJumpDigit,useAccessor,useBindingStackVersion,useBindings,useDialog,useDialogPaddingX,useFocus,useKV,useLatest,useNotifications,useOptionalDialog,useOptionalFocus,useOptionalKV,useOptionalNotifications,usePaste,useRenderer,useT,useTerminalDimensions,useTheme,userKeybindingsReport}from"./chunk-pkzyrwhv.js";import"./chunk-764bsyb0.js";import{getGlobalDefaultVendor,resolvePreferredVendor,setGlobalDefaultVendor,setRepoLastActiveVendor}from"./chunk-kn3pgymw.js";import{parseNumstatRows,parsePorcelain,pickPushedChanges,sameWorktreeChanges}from"./chunk-xqw5d5rv.js";import{parsePorcelainRows,unquoteGitPath}from"./chunk-h4n8ffqy.js";import{READ_ONLY_GIT_ENV,readOnlyGitProcessEnv}from"./chunk-6xppe9bj.js";import{reloadPluginEngines}from"./chunk-vhhzk3xj.js";import{submitFeedback}from"./chunk-130kknp8.js";import{DIRTY_WORKTREE_CODE,TASK_DELETING_CODE,TaskDeletingError}from"./chunk-9kefy6ev.js";import{PROJECT_SIBLING_BASE,WORKTREE_BASE_CUSTOM_KEY,worktreeBaseKindOf}from"./chunk-me23en52.js";import{currentPluginPlatform,loadPluginRegistry,parsePluginManifest,pluginConfigDir,pluginLogPath,pluginManifestPath,qualifiedActionId,readPluginManifest,savePluginRegistry,supportsPlatform}from"./chunk-38272eqv.js";import{PROJECT_DIR_TOKEN,WORKTREE_BASE_KEY,hasProjectDirToken,normalizeWorktreeBase}from"./chunk-5f80ggc3.js";import{ulid}from"./chunk-qkehg2c1.js";import{matchPathGlob}from"./chunk-kg11c1py.js";import{tildify}from"./chunk-msr1xtay.js";import{CURRENT_VERSION}from"./chunk-m4vgx1sc.js";import{addTab,closeActiveTab,closeTab,collapseSplit,cycleLeaf,cycleTab,engineTabSpawnFor,expandHome,filterSubdirs,findEditorTab,forgetTaskTabsSnapshot,hasEngineLeaf,initialShellTabs,initialSplit,initialTabs,isTabSplit,joinDrill,joinPicked,leaves,listSubdirs,moveTab,openCommandTab,openContentTab,openEditorTab,pathLeaf,recycleTabs,rehydrateTabs,removeLeaf,renameActiveTab,renameLeaf,reopenTabs,selectTab,setTabAutoTitle,setTabEngineCommand,setTabForkFrom,setTabInitialPrompt,setTabLastTitle,setTabLiveVendor,setTabSessionId,setTabSpawned,setTabSplit,setTabTitle,shellIdentityInput,splitActive,splitLeafNames,splitLeafPtyKey,splitPathForDirSuggest,stripTrailingSlash,sweepOrphanTabsSnapshots,tabCwdFor,tabExitAction,tabPtyKey,tabPtyKeyFor,tabTitle,tabTitleStable,terminalTabsKey,visibleNativeStatus}from"./chunk-wfwaa4n8.js";import{AUTO_STATUS_KEY,DELIVERY_GUARDS,DISPATCHER_KEY,Ke,deliveryGuardEnvOverride,deliveryGuardPreference,hostedTaskKeys,killHostedSessions,listHostedSessions,nextDeliveryGuard,openHostedSessionHost,pastePromptWhenEngineUp,require_xterm_headless,setDeliveryGuardPreference}from"./chunk-b82bc173.js";import{execHostForWorktreePath,remoteKeyForRepo}from"./chunk-rhsvvdcn.js";import"./chunk-bkba9c4n.js";import"./chunk-g2advs8t.js";import{ensurePtyHostReachable}from"./chunk-zhbws9n3.js";import{ENGINE_PROTOCOLS,engineCanFork,engineLaunchArgv,engineProtocolKey,getEngineProtocol,pickUnclaimedSessionId,protocolEntry,withPinnedSessionId}from"./chunk-pabqr39m.js";import"./chunk-rcyasw34.js";import{resolveLoginShell}from"./chunk-b99tf0jr.js";import{DEFAULT_TERMINAL_COLORS,formatDefaultColorReply,parseTerminalDefaultColors}from"./chunk-7q67dz4c.js";import{readFirstNonEmptyRepoFile}from"./chunk-h8m37225.js";import"./chunk-hape5vwj.js";import{defaultEngineCommand,engineCommandKey,engineDisplayName,engineNameKey,humanizeSlug,interactiveEngineCommand,kobeApiInvocation}from"./chunk-3v1hzr8z.js";import{FOCUS_ACCENT_SLOTS,LOCALE_KEY}from"./chunk-ym78sw9a.js";import"./chunk-zqfbyq0a.js";import{currentLang,intlLocale,setLocaleLang,t,tKeys}from"./chunk-rvybphrq.js";import{LOCALES}from"./chunk-xhb03ybc.js";import{createStateCell}from"./chunk-sdyzxayr.js";import"./chunk-w25b7xxz.js";import"./chunk-jvxh93nz.js";import{connectOrStartDaemon}from"./chunk-h9mqdxvs.js";import"./chunk-8wv8526c.js";import{KobeDaemonClient}from"./chunk-0gepyh6e.js";import{attentionInboxItemKey,automationRunNeedsAttention}from"./chunk-bkvr06xn.js";import"./chunk-mnqxgvyb.js";import{foregroundEngineIn,parsePsSnapshot,psSnapshot}from"./chunk-avf82zmm.js";import{engineEntry,engineSessionIdFromTitle,engineTitleTurnHint,getCapabilities,stripEngineStatusPrefix}from"./chunk-d4xhc9th.js";import{maybeStartScheduledRun,spawnCapture}from"./chunk-khj0apc7.js";import{availableEngineIds,installedEngineIds}from"./chunk-nzscq4yf.js";import"./chunk-w7zv47mp.js";import{roveCliInvocation}from"./chunk-6tvrvekq.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-k1qe5qqa.js";import{DEFAULT_TASK_VENDOR,TASK_STATUSES}from"./chunk-xy8be792.js";import{addSavedRepo,getSavedRepos,isGitRepo,isRemoteRepoKey,resolveMainRepoRoot}from"./chunk-6wpege0h.js";import{loadStateFile}from"./chunk-j75axe29.js";import"./chunk-ayhhgfsz.js";import{errorMessage,userFacingErrorMessage}from"./chunk-2brn8e1y.js";import{ALL_VENDORS,isBuiltinVendor,nextVendorWithin,prevVendorWithin}from"./chunk-bq3fyc0p.js";import"./chunk-3wj69b0a.js";import{isDev,promptAttachmentsDir,roveStateDir}from"./chunk-ch9b1d5y.js";import"./chunk-mv7ptt5w.js";import{activeCliName}from"./chunk-v0zxyqrq.js";import"./chunk-e29hx18x.js";import{ROVE_PRODUCT_NAME}from"./chunk-g56kvet6.js";import"./chunk-pxk2c2vj.js";import{logClientError}from"./chunk-k2ckx8zw.js";import"./chunk-pw6yfj10.js";import{defaultDaemonSocketPath}from"./chunk-mcdv19rs.js";import{readRoveEnv}from"./chunk-r3k9rbwm.js";import{__require,__toESM}from"./chunk-wqfp8d9w.js";var import_react115=__toESM(require_react_production(),1);function truncateEnd(s,max){if(max<=0)return"";let points=[...s];if(points.length<=max)return s;return`${points.slice(0,Math.max(0,max-1)).join("")}\u2026`}function truncateEndCells(s,maxCells,cellsOf){if(maxCells<=0)return"";let total=0;for(let ch of s)total+=cellsOf(ch.codePointAt(0)??0);if(total<=maxCells)return s;let used=0,out="";for(let ch of s){let w=cellsOf(ch.codePointAt(0)??0);if(used+w>maxCells-1)break;used+=w,out+=ch}return`${out}\u2026`}function truncateStart(s,max){if(max<=0)return"";let points=[...s];if(points.length<=max)return s;return`\u2026${points.slice(points.length-Math.max(0,max-1)).join("")}`}function truncateStartCells(s,maxCells,cellsOf){if(maxCells<=0)return"";let points=[...s],total=0;for(let ch of points)total+=cellsOf(ch.codePointAt(0)??0);if(total<=maxCells)return s;let used=0,out="";for(let i=points.length-1;i>=0;i--){let ch=points[i],w=cellsOf(ch.codePointAt(0)??0);if(used+w>maxCells-1)break;used+=w,out=ch+out}return`\u2026${out}`}var SIDEBAR_WIDTH=24;function sidebarWidthFor(terminalWidth){return Math.max(SIDEBAR_WIDTH,Math.min(40,Math.floor(terminalWidth/6)))}var MAIN_BRANCH_POLL_MS=2000;function sidebarEmptyStateKey(opts){if(opts.searching)return"tasks.empty.noMatchSearch";if(opts.projectFilter)return"tasks.empty.noActiveProject";return"tasks.empty.noActive"}var BRANCH_LABEL_MAX=16;function truncateBranchLabel(branch,max=BRANCH_LABEL_MAX){return truncateEnd(branch,max)}function toneColor(theme,tone){switch(tone){case"success":return theme.success;case"warning":return theme.warning;case"primary":return theme.primary;case"error":return theme.error;default:return theme.textMuted}}function searchQueryKeystroke(query,evt){if(evt.defaultPrevented)return null;if(evt.ctrl||evt.meta||evt.option)return null;if(evt.name==="backspace")return query.slice(0,-1);let seq=evt.sequence;if(!seq||seq.length!==1)return null;let code=seq.charCodeAt(0);if(code<32||code===127)return null;return query+seq}var m=0,p=0,g=0,b=0,I;((r)=>{function u(t2,a,s,i){return i!==void 0?`#${B(t2)}${B(a)}${B(s)}${B(i)}`:`#${B(t2)}${B(a)}${B(s)}`}r.toCss=u;function o(t2,a,s,i=255){return(t2<<24|a<<16|s<<8|i)>>>0}r.toRgba=o;function e(t2,a,s,i){return{css:r.toCss(t2,a,s,i),rgba:r.toRgba(t2,a,s,i)}}r.toColor=e})(I||={});var $;((i)=>{function u(n,l){if(b=(l.rgba&255)/255,b===1)return{css:l.css,rgba:l.rgba};let f=l.rgba>>24&255,d=l.rgba>>16&255,c=l.rgba>>8&255,C=n.rgba>>24&255,h=n.rgba>>16&255,x=n.rgba>>8&255;m=C+Math.round((f-C)*b),p=h+Math.round((d-h)*b),g=x+Math.round((c-x)*b);let R=I.toCss(m,p,g),L=I.toRgba(m,p,g);return{css:R,rgba:L}}i.blend=u;function o(n){return(n.rgba&255)===255}i.isOpaque=o;function e(n,l,f){let d=y.ensureContrastRatio(n.rgba,l.rgba,f);if(d)return I.toColor(d>>24&255,d>>16&255,d>>8&255)}i.ensureContrastRatio=e;function r(n){let l=(n.rgba|255)>>>0;return[m,p,g]=y.toChannels(l),{css:I.toCss(m,p,g),rgba:l}}i.opaque=r;function t2(n,l){return b=Math.round(l*255),[m,p,g]=y.toChannels(n.rgba),{css:I.toCss(m,p,g,b),rgba:I.toRgba(m,p,g,b)}}i.opacity=t2;function a(n,l){return b=n.rgba&255,t2(n,b*l/255)}i.multiplyOpacity=a;function s(n){return[n.rgba>>24&255,n.rgba>>16&255,n.rgba>>8&255]}i.toColorRGB=s})($||={});var _;((r)=>{let u,o;try{let t2=document.createElement("canvas");t2.width=1,t2.height=1;let a=t2.getContext("2d",{willReadFrequently:!0});a&&(u=a,u.globalCompositeOperation="copy",o=u.createLinearGradient(0,0,1,1))}catch{}function e(t2){if(t2.match(/#[\da-f]{3,8}/i))switch(t2.length){case 4:return m=parseInt(t2.slice(1,2).repeat(2),16),p=parseInt(t2.slice(2,3).repeat(2),16),g=parseInt(t2.slice(3,4).repeat(2),16),I.toColor(m,p,g);case 5:return m=parseInt(t2.slice(1,2).repeat(2),16),p=parseInt(t2.slice(2,3).repeat(2),16),g=parseInt(t2.slice(3,4).repeat(2),16),b=parseInt(t2.slice(4,5).repeat(2),16),I.toColor(m,p,g,b);case 7:return{css:t2,rgba:(parseInt(t2.slice(1),16)<<8|255)>>>0};case 9:return{css:t2,rgba:parseInt(t2.slice(1),16)>>>0}}let a=t2.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return m=parseInt(a[1]),p=parseInt(a[2]),g=parseInt(a[3]),b=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),I.toColor(m,p,g,b);if(!u||!o)throw Error("css.toColor: Unsupported css format");if(u.fillStyle=o,u.fillStyle=t2,typeof u.fillStyle!="string")throw Error("css.toColor: Unsupported css format");if(u.fillRect(0,0,1,1),[m,p,g,b]=u.getImageData(0,0,1,1).data,b!==255)throw Error("css.toColor: Unsupported css format");return{rgba:I.toRgba(m,p,g,b),css:t2}}r.toColor=e})(_||={});var v;((e)=>{function u(r){return o(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=u;function o(r,t2,a){let s=r/255,i=t2/255,n=a/255,l=s<=0.03928?s/12.92:Math.pow((s+0.055)/1.055,2.4),f=i<=0.03928?i/12.92:Math.pow((i+0.055)/1.055,2.4),d=n<=0.03928?n/12.92:Math.pow((n+0.055)/1.055,2.4);return l*0.2126+f*0.7152+d*0.0722}e.relativeLuminance2=o})(v||={});var y;((a)=>{function u(s,i){if(b=(i&255)/255,b===1)return i;let n=i>>24&255,l=i>>16&255,f=i>>8&255,d=s>>24&255,c=s>>16&255,C=s>>8&255;return m=d+Math.round((n-d)*b),p=c+Math.round((l-c)*b),g=C+Math.round((f-C)*b),I.toRgba(m,p,g)}a.blend=u;function o(s,i,n){let l=v.relativeLuminance(s>>8),f=v.relativeLuminance(i>>8);if(F(l,f)<n){if(f<l){let h=e(s,i,n),x=F(l,v.relativeLuminance(h>>8));if(x<n){let R=r(s,i,n),L=F(l,v.relativeLuminance(R>>8));return x>L?h:R}return h}let c=r(s,i,n),C=F(l,v.relativeLuminance(c>>8));if(C<n){let h=e(s,i,n),x=F(l,v.relativeLuminance(h>>8));return C>x?c:h}return c}}a.ensureContrastRatio=o;function e(s,i,n){let l=s>>24&255,f=s>>16&255,d=s>>8&255,c=i>>24&255,C=i>>16&255,h=i>>8&255,x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));for(;x<n&&(c>0||C>0||h>0);)c-=Math.max(0,Math.ceil(c*0.1)),C-=Math.max(0,Math.ceil(C*0.1)),h-=Math.max(0,Math.ceil(h*0.1)),x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));return(c<<24|C<<16|h<<8|255)>>>0}a.reduceLuminance=e;function r(s,i,n){let l=s>>24&255,f=s>>16&255,d=s>>8&255,c=i>>24&255,C=i>>16&255,h=i>>8&255,x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));for(;x<n&&(c<255||C<255||h<255);)c=Math.min(255,c+Math.ceil((255-c)*0.1)),C=Math.min(255,C+Math.ceil((255-C)*0.1)),h=Math.min(255,h+Math.ceil((255-h)*0.1)),x=F(v.relativeLuminance2(c,C,h),v.relativeLuminance2(l,f,d));return(c<<24|C<<16|h<<8|255)>>>0}a.increaseLuminance=r;function t2(s){return[s>>24&255,s>>16&255,s>>8&255,s&255]}a.toChannels=t2})(y||={});function B(u){let o=u.toString(16);return o.length<2?"0"+o:o}function F(u,o){return u<o?(o+0.05)/(u+0.05):(u+0.05)/(o+0.05)}var E=Object.freeze((()=>{let u=[_.toColor("#2e3436"),_.toColor("#cc0000"),_.toColor("#4e9a06"),_.toColor("#c4a000"),_.toColor("#3465a4"),_.toColor("#75507b"),_.toColor("#06989a"),_.toColor("#d3d7cf"),_.toColor("#555753"),_.toColor("#ef2929"),_.toColor("#8ae234"),_.toColor("#fce94f"),_.toColor("#729fcf"),_.toColor("#ad7fa8"),_.toColor("#34e2e2"),_.toColor("#eeeeec")],o=[0,95,135,175,215,255];for(let e=0;e<216;e++){let r=o[e/36%6|0],t2=o[e/6%6|0],a=o[e%6];u.push({css:I.toCss(r,t2,a),rgba:I.toRgba(r,t2,a)})}for(let e=0;e<24;e++){let r=8+e*10;u.push({css:I.toCss(r,r,r),rgba:I.toRgba(r,r,r)})}return u})());function A(u,o,e){return Math.max(o,Math.min(u,e))}function O(u){switch(u){case"&":return"&amp;";case"<":return"&lt;"}return u}var S=class{constructor(o){this._buffer=o}serialize(o,e){let r=this._buffer.getNullCell(),t2=this._buffer.getNullCell(),a=r,s=o.start.y,i=o.end.y,n=o.start.x,l=o.end.x;this._beforeSerialize(i-s,s,i);for(let f=s;f<=i;f++){let d=this._buffer.getLine(f);if(d){let c=f===o.start.y?n:0,C=f===o.end.y?l:d.length;for(let h=c;h<C;h++){let x=d.getCell(h,a===r?t2:r);if(!x){console.warn(`Can't get cell at row=${f}, col=${h}`);continue}this._nextCell(x,a,f,h),a=x}}this._rowEnd(f,f===i)}return this._afterSerialize(),this._serializeString(e)}_nextCell(o,e,r,t2){}_rowEnd(o,e){}_beforeSerialize(o,e,r){}_afterSerialize(){}_serializeString(o){return""}};function T(u,o){return u.getFgColorMode()===o.getFgColorMode()&&u.getFgColor()===o.getFgColor()}function w(u,o){return u.getBgColorMode()===o.getBgColorMode()&&u.getBgColor()===o.getBgColor()}function z(u,o){return u.isInverse()===o.isInverse()&&u.isBold()===o.isBold()&&u.isUnderline()===o.isUnderline()&&u.isOverline()===o.isOverline()&&u.isBlink()===o.isBlink()&&u.isInvisible()===o.isInvisible()&&u.isItalic()===o.isItalic()&&u.isDim()===o.isDim()&&u.isStrikethrough()===o.isStrikethrough()}var k=class extends S{constructor(e,r){super(e);this._terminal=r,this._rowIndex=0,this._allRows=[],this._allRowSeparators=[],this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(e,r,t2){this._allRows=Array(e),this._lastContentCursorRow=r,this._lastCursorRow=r,this._firstRow=r}_rowEnd(e,r){this._nullCellCount>0&&!w(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let t2="";if(!r){e-this._firstRow>=this._terminal.rows&&this._buffer.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol,this._backgroundCell);let a=this._buffer.getLine(e),s=this._buffer.getLine(e+1);if(!s.isWrapped)t2=`\r
3
3
  `,this._lastCursorRow=e+1,this._lastCursorCol=0;else{t2="";let i=a.getCell(a.length-1,this._thisRowLastChar),n=a.getCell(a.length-2,this._thisRowLastSecondChar),l=s.getCell(0,this._nextRowFirstChar),f=l.getWidth()>1,d=!1;(l.getChars()&&f?this._nullCellCount<=1:this._nullCellCount<=0)&&((i.getChars()||i.getWidth()===0)&&w(i,l)&&(d=!0),f&&(n.getChars()||n.getWidth()===0)&&w(i,l)&&w(n,l)&&(d=!0)),d||(t2="-".repeat(this._nullCellCount+1),t2+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(t2+="\x1B[A",t2+=`\x1B[${a.length-this._nullCellCount}C`,t2+=`\x1B[${this._nullCellCount}X`,t2+=`\x1B[${a.length-this._nullCellCount}D`,t2+="\x1B[B"),this._lastContentCursorRow=e+1,this._lastContentCursorCol=0,this._lastCursorRow=e+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=t2,this._currentRow="",this._nullCellCount=0}_diffStyle(e,r){let t2=[],a=!T(e,r),s=!w(e,r),i=!z(e,r);if(a||s||i)if(e.isAttributeDefault())r.isAttributeDefault()||t2.push(0);else{if(a){let n=e.getFgColor();e.isFgRGB()?t2.push(38,2,n>>>16&255,n>>>8&255,n&255):e.isFgPalette()?n>=16?t2.push(38,5,n):t2.push(n&8?90+(n&7):30+(n&7)):t2.push(39)}if(s){let n=e.getBgColor();e.isBgRGB()?t2.push(48,2,n>>>16&255,n>>>8&255,n&255):e.isBgPalette()?n>=16?t2.push(48,5,n):t2.push(n&8?100+(n&7):40+(n&7)):t2.push(49)}i&&(e.isInverse()!==r.isInverse()&&t2.push(e.isInverse()?7:27),e.isBold()!==r.isBold()&&t2.push(e.isBold()?1:22),e.isUnderline()!==r.isUnderline()&&t2.push(e.isUnderline()?4:24),e.isOverline()!==r.isOverline()&&t2.push(e.isOverline()?53:55),e.isBlink()!==r.isBlink()&&t2.push(e.isBlink()?5:25),e.isInvisible()!==r.isInvisible()&&t2.push(e.isInvisible()?8:28),e.isItalic()!==r.isItalic()&&t2.push(e.isItalic()?3:23),e.isDim()!==r.isDim()&&t2.push(e.isDim()?2:22),e.isStrikethrough()!==r.isStrikethrough()&&t2.push(e.isStrikethrough()?9:29))}return t2}_nextCell(e,r,t2,a){if(e.getWidth()===0)return;let i=e.getChars()==="",n=this._diffStyle(e,this._cursorStyle);if(i?!w(this._cursorStyle,e):n.length>0){this._nullCellCount>0&&(w(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=t2,this._lastContentCursorCol=this._lastCursorCol=a,this._currentRow+=`\x1B[${n.join(";")}m`;let f=this._buffer.getLine(t2);f!==void 0&&(f.getCell(a,this._cursorStyle),this._cursorStyleRow=t2,this._cursorStyleCol=a)}i?this._nullCellCount+=e.getWidth():(this._nullCellCount>0&&(w(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=e.getChars(),this._lastContentCursorRow=this._lastCursorRow=t2,this._lastContentCursorCol=this._lastCursorCol=a+e.getWidth())}_serializeString(e){let r=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(r=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let t2="";for(let i=0;i<r;i++)t2+=this._allRows[i],i+1<r&&(t2+=this._allRowSeparators[i]);if(!e){let i=this._buffer.baseY+this._buffer.cursorY,n=this._buffer.cursorX,l=i!==this._lastCursorRow||n!==this._lastCursorCol,f=(c)=>{c>0?t2+=`\x1B[${c}C`:c<0&&(t2+=`\x1B[${-c}D`)};l&&(((c)=>{c>0?t2+=`\x1B[${c}B`:c<0&&(t2+=`\x1B[${-c}A`)})(i-this._lastCursorRow),f(n-this._lastCursorCol))}let a=this._terminal._core._inputHandler._curAttrData,s=this._diffStyle(a,this._cursorStyle);return s.length>0&&(t2+=`\x1B[${s.join(";")}m`),t2}},D=class{activate(o){this._terminal=o}_serializeBufferByScrollback(o,e,r){let t2=e.length,a=r===void 0?t2:A(r+o.rows,0,t2);return this._serializeBufferByRange(o,e,{start:t2-a,end:t2-1},!1)}_serializeBufferByRange(o,e,r,t2){return new k(e,o).serialize({start:{x:0,y:typeof r.start=="number"?r.start:r.start.line},end:{x:o.cols,y:typeof r.end=="number"?r.end:r.end.line}},t2)}_serializeBufferAsHTML(o,e){let r=o.buffer.active,t2=new M(r,o,e),a=e.onlySelection??!1,s=e.range;if(s)return t2.serialize({start:{x:s.startCol,y:(s.startLine,s.startLine)},end:{x:o.cols,y:(s.endLine,s.endLine)}});if(!a){let n=r.length,l=e.scrollback,f=l===void 0?n:A(l+o.rows,0,n);return t2.serialize({start:{x:0,y:n-f},end:{x:o.cols,y:n-1}})}let i=this._terminal?.getSelectionPosition();return i!==void 0?t2.serialize({start:{x:i.start.x,y:i.start.y},end:{x:i.end.x,y:i.end.y}}):""}_serializeModes(o){let e="",r=o.modes;if(r.applicationCursorKeysMode&&(e+="\x1B[?1h"),r.applicationKeypadMode&&(e+="\x1B[?66h"),r.bracketedPasteMode&&(e+="\x1B[?2004h"),r.insertMode&&(e+="\x1B[4h"),r.originMode&&(e+="\x1B[?6h"),r.reverseWraparoundMode&&(e+="\x1B[?45h"),r.sendFocusMode&&(e+="\x1B[?1004h"),r.wraparoundMode===!1&&(e+="\x1B[?7l"),r.mouseTrackingMode!=="none")switch(r.mouseTrackingMode){case"x10":e+="\x1B[?9h";break;case"vt200":e+="\x1B[?1000h";break;case"drag":e+="\x1B[?1002h";break;case"any":e+="\x1B[?1003h";break}return e}serialize(o){if(!this._terminal)throw Error("Cannot use addon until it has been loaded");let e=o?.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,o.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,o?.scrollback);if(!o?.excludeAltBuffer&&this._terminal.buffer.active.type==="alternate"){let r=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);e+=`\x1B[?1049h\x1B[H${r}`}return o?.excludeModes||(e+=this._serializeModes(this._terminal)),e}serializeAsHTML(o){if(!this._terminal)throw Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,o||{})}dispose(){}},M=class extends S{constructor(e,r,t2){super(e);this._terminal=r,this._options=t2,this._currentRow="",this._htmlContent="",r._core._themeService?this._ansiColors=r._core._themeService.colors.ansi:this._ansiColors=E}_padStart(e,r,t2){return r=r>>0,t2=t2??" ",e.length>r?e:(r-=e.length,r>t2.length&&(t2+=t2.repeat(r/t2.length)),t2.slice(0,r)+e)}_beforeSerialize(e,r,t2){this._htmlContent+="<html><body><!--StartFragment--><pre>";let a="#000000",s="#ffffff";(this._options.includeGlobalBackground??!1)&&(a=this._terminal.options.theme?.foreground??"#ffffff",s=this._terminal.options.theme?.background??"#000000");let i=[];i.push("color: "+a+";"),i.push("background-color: "+s+";"),i.push("font-family: "+this._terminal.options.fontFamily+";"),i.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+i.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(e,r){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(e,r){let t2=r?e.getFgColor():e.getBgColor();if(r?e.isFgRGB():e.isBgRGB())return"#"+[t2>>16&255,t2>>8&255,t2&255].map((s)=>this._padStart(s.toString(16),2,"0")).join("");if(r?e.isFgPalette():e.isBgPalette())return this._ansiColors[t2].css}_diffStyle(e,r){let t2=[],a=!T(e,r),s=!w(e,r),i=!z(e,r);if(a||s||i){let n=this._getHexColor(e,!0);n&&t2.push("color: "+n+";");let l=this._getHexColor(e,!1);return l&&t2.push("background-color: "+l+";"),e.isInverse()&&t2.push("color: #000000; background-color: #BFBFBF;"),e.isBold()&&t2.push("font-weight: bold;"),e.isUnderline()&&e.isOverline()?t2.push("text-decoration: overline underline;"):e.isUnderline()?t2.push("text-decoration: underline;"):e.isOverline()&&t2.push("text-decoration: overline;"),e.isBlink()&&t2.push("text-decoration: blink;"),e.isInvisible()&&t2.push("visibility: hidden;"),e.isItalic()&&t2.push("font-style: italic;"),e.isDim()&&t2.push("opacity: 0.5;"),e.isStrikethrough()&&t2.push("text-decoration: line-through;"),t2}}_nextCell(e,r,t2,a){if(e.getWidth()===0)return;let i=e.getChars()==="",n=this._diffStyle(e,r);n&&(this._currentRow+=n.length===0?"</span><span>":"</span><span style='"+n.join(" ")+"'>"),i?this._currentRow+=" ":this._currentRow+=O(e.getChars())}_serializeString(){return this._htmlContent}};var D2=new Set(["<","=",">"]);var M2=new Set(["P","_","^","X"]);var F2=/[;:]/,I2={TEXT:"TEXT",INTRODUCER:"INTRODUCER",DATA:"DATA",FINAL:"FINAL"},L={CSI:"CSI",DCS:"DCS",DEC:"DEC",ESC:"ESC",OSC:"OSC",PRIVATE:"PRIVATE",SGR:"SGR",STRING:"STRING",TEXT:"TEXT"};function R(e){if(e.length===1)return e[0].raw;if(e.length===0)return"";let t2="";for(let n of e)t2+=n.raw;return t2}function z2(e,t2,n){let r=R(t2),i=e.raw+r+(n?.raw||"");return{type:L.STRING,pos:e.pos,raw:i,command:"APC",params:r?[r]:[]}}function B2(e,t2,n){let r=R(t2),i=n?.raw??"",a=e.raw+r+i,o=[],s=L.CSI,c=0;if(r)for(;c<r.length;){let e2=r.charCodeAt(c);if(e2<48||e2>63)break;c++}let l=c>0?r.substring(0,c):"",u=c<r.length?r.substring(c):"";if(l){let e2=0;for(let t3=0;t3<=l.length;t3++)(t3===l.length||l.charCodeAt(t3)===59||l.charCodeAt(t3)===58)&&(o.push(t3>e2?l.substring(e2,t3):"0"),e2=t3+1)}let d=u+i,f=o[0];if(f!==void 0&&f.charCodeAt(0)===63)return s=L.DEC,f.length>1?o[0]=f.substring(1):o.shift(),{type:s,pos:e.pos,raw:a,command:d,params:o};for(let t3 of o)if(t3.length>0&&D2.has(t3[0])){s=L.PRIVATE;let n2=t3[0]+d;for(let e2=0;e2<o.length;e2++)if(o[e2].length>0&&D2.has(o[e2][0])){o[e2].length>1?o[e2]=o[e2].substring(1):o.splice(e2,1);break}return{type:s,pos:e.pos,raw:a,command:n2,params:o}}return d==="m"&&o.length===5&&o[1]==="2"&&(f==="38"||f==="48")&&o.splice(2,0,"0"),d==="r"&&o.length===2&&o[1]==="0"&&(o[1]="-1"),{type:s,pos:e.pos,raw:a,command:d,params:o}}var V=new Map([["$q",2],["+q",2],["+p",2],["|",1],["{",1]]);function H(e,t2,n){let r=R(t2),i=e.raw+r+(n?.raw??"");if(!r)return{type:L.DCS,pos:e.pos,raw:i,command:"",params:[]};for(let[t3,n2]of V)if(r.startsWith(t3)){let a=r.slice(n2),o=[];if(a)for(let e2 of a.split(F2))o.push(e2||"-1");return{type:L.DCS,pos:e.pos,raw:i,command:t3,params:o}}return{type:L.DCS,pos:e.pos,raw:i,command:"",params:[r]}}function U(e,t2,n){let r=R(t2),i=e.intermediate||(t2[0]?.raw??n?.raw??""),a=e.intermediate&&n?.raw?[n.raw]:[],o=e.raw+r+(n?.raw??"");return{type:L.ESC,pos:e.pos,raw:o,command:i,params:a}}function W(e,t2,n){let r=R(t2),i=e.raw+r+(n?.raw||""),a=r.indexOf(";");if(a===-1)return{type:L.OSC,pos:e.pos,raw:i,command:r,params:[]};let o=r.slice(0,a),s=r.slice(a+1);if(o==="1337")return{type:L.OSC,pos:e.pos,raw:i,command:o,params:[s]};let c=s?s.split(";"):[];return{type:L.OSC,pos:e.pos,raw:i,command:o,params:c}}function G(e,t2,n){let r=R(t2),i=e.raw+r+(n?.raw||"");return{type:L.STRING,pos:e.pos,raw:i,command:"PM",params:r?[r]:[]}}function K(e,t2,n){let r=R(t2),i=e.raw+r+(n?.raw||"");return{type:L.STRING,pos:e.pos,raw:i,command:"SOS",params:r?[r]:[]}}function q(e){return e===24||e===26||e===27||e===155||e===157||e===144||e===159||e===158||e===152}function J(e){return e===24||e===26}function Y(e){return e===27||e===155||e===157||e===144||e===159||e===158||e===152}function X(e){return e===155||e===157||e===144||e===159||e===158||e===152}function Z(e){let t2=[],n=0,r=0,i=0,a=e.length;for(;n<a;)if(r===0){let o=n,s=e.charCodeAt(n);for(;n<a&&!Y(s);)s=e.charCodeAt(++n);if(n>o&&t2.push({type:I2.TEXT,pos:o,raw:e.substring(o,n)}),n>=a)break;if(X(s))t2.push({type:I2.INTRODUCER,pos:n,raw:e[n],code:e[n]}),n++,r=1,i=s;else{let o2=e.charCodeAt(n+1);if(o2===91)t2.push({type:I2.INTRODUCER,pos:n,raw:e.substring(n,n+2),code:"\x9B"}),n+=2,r=1,i=155;else if(o2===93)t2.push({type:I2.INTRODUCER,pos:n,raw:e.substring(n,n+2),code:"\x9D"}),n+=2,r=1,i=157;else if(n+1<a&&M2.has(e[n+1]))t2.push({type:I2.INTRODUCER,pos:n,raw:e.substring(n,n+2),code:e[n+1]}),n+=2,r=1,i=o2;else if(n+1<a){let o3=n+1;for(;o3<a&&e.charCodeAt(o3)>=32&&e.charCodeAt(o3)<=47;)o3++;if(o3>n+1){let r2=e.substring(n+1,o3);t2.push({type:I2.INTRODUCER,pos:n,raw:e.substring(n,o3),code:"\x1B",intermediate:r2})}else t2.push({type:I2.INTRODUCER,pos:n,raw:e[n],code:"\x1B"});n=o3,o3<a&&(r=1,i=27)}else t2.push({type:I2.INTRODUCER,pos:n,raw:e[n],code:"\x1B"}),n++}}else{let o=n;if(i===155){let i2=n;for(;n<a;){let a2=e.charCodeAt(n);if(q(a2)){n>i2&&t2.push({type:I2.DATA,pos:o,raw:e.substring(i2,n)}),r=0,J(a2)&&(t2.push({type:I2.TEXT,pos:n,raw:e[n]}),n++);break}if(a2>=64&&a2<=126){n>i2&&t2.push({type:I2.DATA,pos:o,raw:e.substring(i2,n)}),t2.push({type:I2.FINAL,pos:n,raw:e[n]}),n++,r=0;break}n++}r===1&&n>i2&&t2.push({type:I2.DATA,pos:o,raw:e.substring(i2,n)})}else if(i===27){if(n<a){let i2=e.charCodeAt(n);q(i2)?(r=0,J(i2)&&(t2.push({type:I2.TEXT,pos:n,raw:e[n]}),n++)):(t2.push({type:I2.FINAL,pos:n,raw:e[n]}),n++,r=0)}}else{let s=n;for(;n<a;){let a2=e.charCodeAt(n),c;if(a2===27&&e.charCodeAt(n+1)===92?c="\x1B\\":a2===156?c="\x9C":a2===7&&i===157&&(c="\x07"),c){n>s&&t2.push({type:I2.DATA,pos:o,raw:e.substring(s,n)}),t2.push({type:I2.FINAL,pos:n,raw:c}),n+=c.length,r=0;break}if(q(a2)){n>s&&t2.push({type:I2.DATA,pos:o,raw:e.substring(s,n)}),r=0,J(a2)&&(t2.push({type:I2.TEXT,pos:n,raw:e[n]}),n++);break}n++}r===1&&n>s&&t2.push({type:I2.DATA,pos:o,raw:e.substring(s,n)})}r===1&&(r=0)}return t2}function Q(e,t2,n){switch(e.code){case"\x9B":return B2(e,t2,n);case"\x9D":return W(e,t2,n);case"\x90":case"P":return H(e,t2,n);case"\x9F":case"_":return z2(e,t2,n);case"\x9E":case"X":return G(e,t2,n);case"\x98":case"^":return K(e,t2,n);case"\x1B":return U(e,t2,n);default:return{type:L.TEXT,pos:e.pos,raw:e.raw}}}function $2(e){let t2=[],n=0,r=e.length;for(;n<r;){let i=e[n];if(i.type===I2.TEXT){t2.push({type:L.TEXT,pos:i.pos,raw:i.raw}),n++;continue}if(i.type===I2.INTRODUCER){let a=i,o=[],s;for(n++;n<r;){let t3=e[n];if(t3.type===I2.DATA)o.push(t3);else if(t3.type===I2.FINAL){s=t3,n++;break}else break;n++}t2.push(Q(a,o,s))}else n++}return t2}function ie(e){return $2(Z(e))}var DEFAULT_COLS=80,DEFAULT_ROWS=24,PIPE_SCROLLBACK_LIMIT=200000;function defaultShell(){return resolveLoginShell()}function extractOscTitle(chunk){let title=null;for(let code of ie(chunk))if(code.type==="OSC"&&(code.command==="0"||code.command==="2")&&code.params[0])title=code.params[0];return title}function resolveArgv(opts){if(opts.command&&opts.command.length>0)return[...opts.command];return[opts.shell??defaultShell()]}var shared=null,hostedByKey=new Map;function routeAdd(handle){let set=hostedByKey.get(handle.taskId);if(!set)set=new Set,hostedByKey.set(handle.taskId,set);set.add(handle)}function routeRemove(handle){let set=hostedByKey.get(handle.taskId);if(!set)return 0;if(set.delete(handle),set.size===0)hostedByKey.delete(handle.taskId);return set.size}function routeCount(key){return hostedByKey.get(key)?.size??0}var dispatchInstalled=new WeakSet;function installDispatch(client){if(dispatchInstalled.has(client))return;dispatchInstalled.add(client),client.on("pty.data",(frame)=>{let payload=frame.payload,handles=hostedByKey.get(payload.key);if(handles)for(let handle of handles)handle.feedFrame(payload.data)}),client.on("pty.exit",(frame)=>{let payload=frame.payload,handles=hostedByKey.get(payload.key);if(handles)for(let handle of[...handles])handle.remoteExited(payload.pid)})}function getSharedPtyClient(){if(shared)return shared;let p3=(async()=>{let socketPath=await ensurePtyHostReachable(),client=new KobeDaemonClient(socketPath);return await client.connect(),installDispatch(client),client.onLifecycle("close",()=>{if(shared===p3)shared=null}),client})();return p3.catch(()=>{if(shared===p3)shared=null}),shared=p3,p3}function peekSharedPtyClient(){return shared}function warmHostedShell(cwd,shell=defaultShell()){if((process.env.KOBE_TERMINAL_BACKEND??"hosted")!=="hosted")return;getSharedPtyClient().then((client)=>client.request("pty.warm",{cwd,shell})).catch(()=>{})}var import_headless=__toESM(require_xterm_headless(),1);var SCROLLBACK_ROWS_KEY="terminal.scrollbackRows",DEFAULT_SCROLLBACK_ROWS=1000,SCROLLBACK_ROWS_MIN=100,SCROLLBACK_ROWS_MAX=1e5;function normalizeScrollbackRows(value){let n2=typeof value==="number"?Math.floor(value):typeof value==="string"?Number.parseInt(value.trim(),10):Number.NaN;if(!Number.isFinite(n2))return DEFAULT_SCROLLBACK_ROWS;return Math.min(SCROLLBACK_ROWS_MAX,Math.max(SCROLLBACK_ROWS_MIN,n2))}function persistedScrollbackRows(){return normalizeScrollbackRows(loadStateFile()[SCROLLBACK_ROWS_KEY])}var target=process.env.ROVE_RENDER_PROFILE,renderProfileOn=Boolean(target),counts=new Map,totals=new Map,started=0;function flush(){if(counts.size===0)return;let row={sec:Math.round((Date.now()-started)/1000)};for(let[k3,n2]of counts){row[`${k3}_n`]=n2;let ms=totals.get(k3);if(ms!==void 0)row[`${k3}_ms`]=+ms.toFixed(3)}counts.clear(),totals.clear();try{__require("fs").appendFileSync(target,`${JSON.stringify(row)}
4
4
  `)}catch{}}if(renderProfileOn)started=Date.now(),setInterval(flush,1000).unref?.();function profileTick(stage){if(!renderProfileOn)return;counts.set(stage,(counts.get(stage)??0)+1)}function profileSpan(stage,fn){if(!renderProfileOn)return fn();let t0=performance.now();try{return fn()}finally{counts.set(stage,(counts.get(stage)??0)+1),totals.set(stage,(totals.get(stage)??0)+(performance.now()-t0))}}var KITTY_CSI_U_RE=/^\x1b\[[\d:;]*u$/;function containsControlCharacter(value){for(let character of value){let codePoint=character.codePointAt(0);if(codePoint===void 0||codePoint<=31||codePoint>=127&&codePoint<=159)return!0}return!1}var CTRL_PUNCT_C0={"@":"\x00","[":"\x1B","\\":"\x1C","]":"\x1D","^":"\x1E",_:"\x1F","?":"\x7F"},LEGACY_FUNCTION_KEYS={f1:{kind:"ss3",final:"P"},f2:{kind:"ss3",final:"Q"},f3:{kind:"ss3",final:"R"},f4:{kind:"ss3",final:"S"},f5:{kind:"tilde",number:15},f6:{kind:"tilde",number:17},f7:{kind:"tilde",number:18},f8:{kind:"tilde",number:19},f9:{kind:"tilde",number:20},f10:{kind:"tilde",number:21},f11:{kind:"tilde",number:23},f12:{kind:"tilde",number:24}},XTERM_MODIFIER_NAMED_KEYS=new Set(["delete","kpdelete","insert","kpinsert","up","kpup","down","kpdown","right","kpright","left","kpleft","home","kphome","end","kpend","pageup","kppageup","pagedown","kppagedown"]);function legacyModifier(evt){return 1+(evt.shift?1:0)+(evt.option||evt.meta?2:0)+(evt.ctrl?4:0)+(evt.super?8:0)+(evt.hyper?16:0)}function legacyCursorSequence(evt,final,applicationCursorKeys){let modifier=legacyModifier(evt);if(modifier!==1)return`\x1B[1;${modifier}${final}`;return applicationCursorKeys?`\x1BO${final}`:`\x1B[${final}`}function legacyTildeSequence(evt,number){let modifier=legacyModifier(evt);return modifier===1?`\x1B[${number}~`:`\x1B[${number};${modifier}~`}function legacyFunctionSequence(evt,key){if(key.kind==="tilde")return legacyTildeSequence(evt,key.number);let modifier=legacyModifier(evt);return modifier===1?`\x1BO${key.final}`:`\x1B[1;${modifier}${key.final}`}var NORMAL_TERMINAL_INPUT_MODES={applicationCursorKeys:!1,applicationKeypad:!1};function keyEventToShellBytes(evt,modes=NORMAL_TERMINAL_INPUT_MODES){if(isKittyModifierKeyEvent(evt))return null;let e2=evt,seq=typeof e2.sequence==="string"&&e2.sequence.length>0?e2.sequence:null,kittyInput=e2.source==="kitty"||typeof e2.raw==="string"&&KITTY_CSI_U_RE.test(e2.raw)||seq!=null&&KITTY_CSI_U_RE.test(seq);if(seq!=null&&!kittyInput)return seq;if(seq!=null&&!containsControlCharacter(seq)&&!evt.ctrl&&!e2.option&&!e2.meta)return seq;return synthesizeShellBytes(evt,modes)}function synthesizeShellBytes(evt,modes){let name=evt.name;if(!name)return null;if(evt.shift&&name==="tab")return"\x1B[Z";let functionKey=LEGACY_FUNCTION_KEYS[name],xtermModifiedNamedKey=functionKey!==void 0||XTERM_MODIFIER_NAMED_KEYS.has(name);if((evt.option||evt.meta)&&!xtermModifiedNamedKey){let inner=synthesizeShellBytes({...evt,option:!1,meta:!1},modes);return inner==null?null:`\x1B${inner}`}if(functionKey)return legacyFunctionSequence(evt,functionKey);switch(name){case"return":case"enter":return"\r";case"kpenter":return modes.applicationKeypad&&legacyModifier(evt)===1?"\x1BOM":"\r";case"tab":return"\t";case"backspace":return"\x7F";case"delete":case"kpdelete":return legacyTildeSequence(evt,3);case"insert":case"kpinsert":return legacyTildeSequence(evt,2);case"up":case"kpup":return legacyCursorSequence(evt,"A",modes.applicationCursorKeys);case"down":case"kpdown":return legacyCursorSequence(evt,"B",modes.applicationCursorKeys);case"right":case"kpright":return legacyCursorSequence(evt,"C",modes.applicationCursorKeys);case"left":case"kpleft":return legacyCursorSequence(evt,"D",modes.applicationCursorKeys);case"home":case"kphome":return legacyCursorSequence(evt,"H",modes.applicationCursorKeys);case"end":case"kpend":return legacyCursorSequence(evt,"F",modes.applicationCursorKeys);case"pageup":case"kppageup":return legacyTildeSequence(evt,5);case"pagedown":case"kppagedown":return legacyTildeSequence(evt,6);case"clear":return"\x1B[E";case"escape":return"\x1B";case"space":return evt.ctrl?"\x00":" ";default:if(name.length===1){if(evt.ctrl){let code=name.toLowerCase().charCodeAt(0);if(code>=97&&code<=122)return String.fromCharCode(code-96);let c0=CTRL_PUNCT_C0[name];if(c0!=null)return c0;return null}if(evt.shift&&name>="a"&&name<="z")return name.toUpperCase();return name}return null}}var DEFAULT_PAGE_SIZE=10;var RESERVED_SPEC=[{id:"help.open"},{id:"focus.sidebar"},{id:"chat.tab.new"},{id:"chat.tab.close"},{id:"chat.tab.cycle-next"},{id:"chat.tab.cycle-prev"},{id:"chat.tab.rename"},"ctrl+e","ctrl+f",{id:"workspace.split.right"},{id:"workspace.split.down"},{id:"workspace.split.focus-next"},{id:"focus.next"},{id:"terminal.reset"},{id:"attention.next"},{id:"tasks.jump"}],RESERVED_GLOBAL_CHORDS=[...new Set(RESERVED_SPEC.flatMap((entry)=>typeof entry==="string"?[entry]:defaultChordsOf(entry.id)))],PASSTHROUGH_NAMES=[..."abcdefghijklmnopqrstuvwxyz".split(""),..."ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),..."0123456789".split(""),..." `~!@#$%^&*()-_=+[]{}\\|;:'\",.<>/?".split(""),"return","enter","space","tab","backspace","delete","up","down","left","right","home","end","pageup","pagedown","escape","insert","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12"],PASSTHROUGH_MODIFIER_PREFIXES=["","ctrl+","alt+","shift+","ctrl+shift+","alt+shift+","ctrl+alt+"],PASSTHROUGH_CHORDS=PASSTHROUGH_NAMES.flatMap((name)=>PASSTHROUGH_MODIFIER_PREFIXES.map((prefix)=>`${prefix}${name}`)).filter((chord)=>!RESERVED_GLOBAL_CHORDS.includes(chord));function encodeWheel(modes,direction,col,row){if(modes.mouseTracking)return`\x1B[<${direction==="up"?64:65};${Math.max(1,col)};${Math.max(1,row)}M`;if(modes.alternateScreen)return(modes.applicationCursorKeys?direction==="up"?"\x1BOA":"\x1BOB":direction==="up"?"\x1B[A":"\x1B[B").repeat(3);return null}function encodeMouseButton(modes,kind,button,col,row,modifiers){if(modes.mouseTracking==="none")return null;if(kind==="drag"&&modes.mouseTracking!=="drag"&&modes.mouseTracking!=="any")return null;let code=button;if(kind==="drag")code+=32;if(modifiers?.shift)code+=4;if(modifiers?.alt)code+=8;if(modifiers?.ctrl)code+=16;return`\x1B[<${code};${Math.max(1,col)};${Math.max(1,row)}${kind==="up"?"m":"M"}`}class PtyListeners{data=new Set;exits=new Set;titles=new Set;get dataCount(){return this.data.size}addData(listener){return this.data.add(listener),()=>this.data.delete(listener)}addExit(listener){return this.exits.add(listener),()=>this.exits.delete(listener)}addTitle(listener){return this.titles.add(listener),()=>this.titles.delete(listener)}publishData(snapshot,cursor,window,wrapped){for(let listener of this.data)try{listener(snapshot,cursor,window,wrapped)}catch{}}publishTitle(title){for(let listener of this.titles)try{listener(title)}catch{}}drainExits(){let listeners=[...this.exits];return this.exits.clear(),listeners}clearData(){this.data.clear()}clearAll(){this.data.clear(),this.exits.clear(),this.titles.clear()}}function sameRgb(a2,b3){if(a2===b3)return!0;return a2!==void 0&&b3!==void 0&&a2[0]===b3[0]&&a2[1]===b3[1]&&a2[2]===b3[2]}function sameChunk(a2,b3){return a2.text===b3.text&&(a2.attributes??0)===(b3.attributes??0)&&sameRgb(a2.fg,b3.fg)&&sameRgb(a2.bg,b3.bg)}function sameRow(a2,b3){if(a2===b3)return!0;if(a2.length!==b3.length)return!1;for(let i2=0;i2<a2.length;i2++)if(!sameChunk(a2[i2],b3[i2]))return!1;return!0}function reconcileTerminalRow(previous,next){return previous&&sameRow(previous,next)?previous:next}function reconcileTerminalRows(previous,next){if(previous.length!==next.length)return next;let changed=!1;for(let i2=0;i2<next.length;i2++){let stable=reconcileTerminalRow(previous[i2],next[i2]);if(next[i2]=stable,stable!==previous[i2])changed=!0}return changed?next:previous}function reconcileTerminalCursor(previous,next){if(previous===next)return previous;if(previous&&next&&previous.x===next.x&&previous.y===next.y)return previous;return next}var ATTR=Object.freeze({BOLD:1,DIM:2,ITALIC:4,UNDERLINE:8,BLINK:16,INVERSE:32,HIDDEN:64,STRIKETHROUGH:128}),EMPTY_STYLE=Object.freeze({fg:void 0,bg:void 0,attributes:0});function ansi256ToRgb(index){if(index<0)return[0,0,0];if(index<16)return SYSTEM_PALETTE[index]??[0,0,0];if(index<232){let i2=index-16,r2=Math.floor(i2/36),g3=Math.floor(i2/6%6),b3=i2%6,step=(n2)=>n2===0?0:55+40*n2;return[step(r2),step(g3),step(b3)]}if(index<256){let gray=8+10*(index-232);return[gray,gray,gray]}return[0,0,0]}var SYSTEM_PALETTE=[[21,22,30],[247,118,142],[158,206,106],[224,175,104],[122,162,247],[187,154,247],[125,207,255],[169,177,214],[65,72,104],[255,137,157],[158,224,68],[250,186,74],[141,176,255],[199,169,255],[164,218,255],[192,202,245]];function applySgr(prev,rawParams){let params=rawParams.length===0?[0]:rawParams.map((p3)=>p3===""?0:Number.parseInt(p3,10)||0),fg=prev.fg,bg=prev.bg,attr=prev.attributes,i2=0;while(i2<params.length){let p3=params[i2];if(p3===void 0)break;if(p3===0){fg=void 0,bg=void 0,attr=0,i2+=1;continue}if(p3===1){attr|=ATTR.BOLD,i2+=1;continue}if(p3===2){attr|=ATTR.DIM,i2+=1;continue}if(p3===3){attr|=ATTR.ITALIC,i2+=1;continue}if(p3===4){attr|=ATTR.UNDERLINE,i2+=1;continue}if(p3===5||p3===6){attr|=ATTR.BLINK,i2+=1;continue}if(p3===7){attr|=ATTR.INVERSE,i2+=1;continue}if(p3===8){attr|=ATTR.HIDDEN,i2+=1;continue}if(p3===9){attr|=ATTR.STRIKETHROUGH,i2+=1;continue}if(p3===22){attr&=~(ATTR.BOLD|ATTR.DIM),i2+=1;continue}if(p3===23){attr&=~ATTR.ITALIC,i2+=1;continue}if(p3===24){attr&=~ATTR.UNDERLINE,i2+=1;continue}if(p3===25){attr&=~ATTR.BLINK,i2+=1;continue}if(p3===27){attr&=~ATTR.INVERSE,i2+=1;continue}if(p3===28){attr&=~ATTR.HIDDEN,i2+=1;continue}if(p3===29){attr&=~ATTR.STRIKETHROUGH,i2+=1;continue}if(p3>=30&&p3<=37){fg=ansi256ToRgb(p3-30),i2+=1;continue}if(p3>=90&&p3<=97){fg=ansi256ToRgb(p3-90+8),i2+=1;continue}if(p3===39){fg=void 0,i2+=1;continue}if(p3>=40&&p3<=47){bg=ansi256ToRgb(p3-40),i2+=1;continue}if(p3>=100&&p3<=107){bg=ansi256ToRgb(p3-100+8),i2+=1;continue}if(p3===49){bg=void 0,i2+=1;continue}if(p3===38){let sub=params[i2+1];if(sub===5){let idx=params[i2+2]??0;fg=ansi256ToRgb(idx),i2+=3;continue}if(sub===2){let r2=params[i2+2]??0,g3=params[i2+3]??0,b3=params[i2+4]??0;fg=[r2,g3,b3],i2+=5;continue}i2+=1;continue}if(p3===48){let sub=params[i2+1];if(sub===5){let idx=params[i2+2]??0;bg=ansi256ToRgb(idx),i2+=3;continue}if(sub===2){let r2=params[i2+2]??0,g3=params[i2+3]??0,b3=params[i2+4]??0;bg=[r2,g3,b3],i2+=5;continue}i2+=1;continue}i2+=1}return{fg,bg,attributes:attr}}function sgrParamsFromRaw(raw){let body=raw;if(body.charCodeAt(0)===27)body=body.slice(2);else if(body.charCodeAt(0)===155)body=body.slice(1);if(body.endsWith("m"))body=body.slice(0,-1);return body.split(";")}function parseAnsiLine(input,initial=EMPTY_STYLE){if(input.length===0)return{chunks:[],endStyle:initial};let out=[],style={...initial},buf="",flush2=()=>{if(buf.length===0)return;let c2={text:buf,...style.fg?{fg:style.fg}:{},...style.bg?{bg:style.bg}:{},...style.attributes!==0?{attributes:style.attributes}:{}};out.push(c2),buf=""},codes=ie(input);for(let code of codes){if(code.type==="TEXT"){buf+=code.raw;continue}if(code.type==="CSI"&&code.command==="m"){flush2(),style=applySgr(style,sgrParamsFromRaw(code.raw));continue}if(code.type==="OSC"&&code.command==="8"){flush2();let url=code.params[code.params.length-1]??"";style={...style,attributes:url?style.attributes|ATTR.UNDERLINE:style.attributes&~ATTR.UNDERLINE}}}return flush2(),{chunks:out,endStyle:style}}function parseAnsiSnapshot(input){let lines=input.split(`
5
5
  `),rows=[],carry=EMPTY_STYLE;for(let line of lines){let{chunks,endStyle}=parseAnsiLine(line,carry);rows.push(chunks),carry=endStyle}return rows}var XTERM_COLOR_MODE_DEFAULT=0,XTERM_COLOR_MODE_PALETTE=16777216,XTERM_COLOR_MODE_RGB=50331648,DEFAULT_RENDER_STYLE=Object.freeze({fg:"",bg:"",attrs:0});function colorKeyToRGB(key){if(key==="")return;let sep=key.indexOf(":"),value=Number(key.slice(sep+1));if(key.startsWith("rgb:"))return[value>>16&255,value>>8&255,value&255];if(key.startsWith("pal:"))return ansi256ToRgb(value);return}function colorKey(cell,kind){if(kind==="fg"?cell.isFgDefault():cell.isBgDefault())return"";let mode=kind==="fg"?cell.getFgColorMode():cell.getBgColorMode(),color=kind==="fg"?cell.getFgColor():cell.getBgColor();if(mode===XTERM_COLOR_MODE_RGB||(kind==="fg"?cell.isFgRGB():cell.isBgRGB()))return`rgb:${color}`;if(mode===XTERM_COLOR_MODE_PALETTE||(kind==="fg"?cell.isFgPalette():cell.isBgPalette()))return`pal:${color}`;if(mode===XTERM_COLOR_MODE_DEFAULT)return"";return""}function cellAttributes(cell){let attrs=0;if(cell.isBold())attrs|=ATTR.BOLD;if(cell.isDim())attrs|=ATTR.DIM;if(cell.isItalic())attrs|=ATTR.ITALIC;if(cell.isUnderline())attrs|=ATTR.UNDERLINE;if(cell.isBlink())attrs|=ATTR.BLINK;if(cell.isInverse())attrs|=ATTR.INVERSE;if(cell.isInvisible())attrs|=ATTR.HIDDEN;if(cell.isStrikethrough())attrs|=ATTR.STRIKETHROUGH;return attrs}function matchingStyleRewrite(cell,styleRewrites){if(!styleRewrites||styleRewrites.length===0||!cell.isFgDefault()||cell.isBgDefault())return;let background=colorKeyToRGB(colorKey(cell,"bg"));return styleRewrites.find((rewrite)=>sameRgb2(background,rewrite.matchBackground))}function rgbKey([red,green,blue]){return`rgb:${red<<16|green<<8|blue}`}function cellStyle(cell,styleRewrites){let style={fg:colorKey(cell,"fg"),bg:colorKey(cell,"bg"),attrs:cellAttributes(cell)},rewrite=matchingStyleRewrite(cell,styleRewrites);return rewrite?{...style,fg:rgbKey(rewrite.foreground),bg:rgbKey(rewrite.background)}:style}function styleEquals(a2,b3){return a2.fg===b3.fg&&a2.bg===b3.bg&&a2.attrs===b3.attrs}function renderStyleToChunkFields(style){let fg=colorKeyToRGB(style.fg),bg=colorKeyToRGB(style.bg);return{...fg?{fg}:{},...bg?{bg}:{},...style.attrs!==0?{attributes:style.attrs}:{}}}function isSolidBlock(chars){return chars==="\u2580"||chars==="\u2584"||chars==="\u2588"}function paintsSamePixel(fg,bg){if(fg===void 0||bg===void 0)return!1;return fg[0]===bg[0]&&fg[1]===bg[1]&&fg[2]===bg[2]}function isVisibleCell(cell){let chars=cell.getChars();if(chars!==""&&chars!==" ")return!0;return!cell.isAttributeDefault()||!cell.isFgDefault()||!cell.isBgDefault()}var scratchCell;function getCellReusing(line,x2){if(scratchCell===void 0){let seeded=line.getCell(x2);if(seeded)scratchCell=seeded;return seeded}return line.getCell(x2,scratchCell)}function xtermLineToChunks(line,minLast=-1,styleRewrites){let last=Math.min(line.length-1,minLast);for(let x2=0;x2<line.length;x2++){let cell=getCellReusing(line,x2);if(!cell||cell.getWidth()===0)continue;if(isVisibleCell(cell))last=Math.max(last,x2)}if(last===-1)return[];let out=[],active=DEFAULT_RENDER_STYLE,activeIsFill=!1,buf="",flush2=()=>{if(buf==="")return;out.push({text:buf,...renderStyleToChunkFields(active)}),buf=""};for(let x2=0;x2<=last;x2++){let cell=getCellReusing(line,x2);if(!cell||cell.getWidth()===0)continue;let next=cellStyle(cell,styleRewrites);if(!styleEquals(active,next))flush2(),active=next,activeIsFill=paintsSamePixel(colorKeyToRGB(next.fg),colorKeyToRGB(next.bg));let chars=cell.getChars()||" ";buf+=isSolidBlock(chars)&&activeIsFill?" ":chars}return flush2(),out}function chunkColorMatchesCell(rgb,cell,kind){if(kind==="fg"?cell.isFgDefault():cell.isBgDefault())return rgb===void 0;if(!rgb)return!1;let mode=kind==="fg"?cell.getFgColorMode():cell.getBgColorMode(),color=kind==="fg"?cell.getFgColor():cell.getBgColor();if(mode===XTERM_COLOR_MODE_RGB||(kind==="fg"?cell.isFgRGB():cell.isBgRGB()))return rgb[0]===(color>>16&255)&&rgb[1]===(color>>8&255)&&rgb[2]===(color&255);if(mode===XTERM_COLOR_MODE_PALETTE||(kind==="fg"?cell.isFgPalette():cell.isBgPalette())){let palette=ansi256ToRgb(color);return rgb[0]===palette[0]&&rgb[1]===palette[1]&&rgb[2]===palette[2]}return!1}function sameRgb2(a2,b3){return Boolean(a2&&b3&&a2[0]===b3[0]&&a2[1]===b3[1]&&a2[2]===b3[2])}function chunkStyleMatchesCell(chunk,cell,styleRewrites){let rewrite=matchingStyleRewrite(cell,styleRewrites);if(rewrite)return(chunk.attributes??0)===cellAttributes(cell)&&sameRgb2(chunk.fg,rewrite.foreground)&&sameRgb2(chunk.bg,rewrite.background);return(chunk.attributes??0)===cellAttributes(cell)&&chunkColorMatchesCell(chunk.fg,cell,"fg")&&chunkColorMatchesCell(chunk.bg,cell,"bg")}function xtermLineMatchesChunks(line,row,minLast=-1,styleRewrites){if(!line)return row.length===0;let last=Math.min(line.length-1,minLast);for(let x2=0;x2<line.length;x2++){let cell=getCellReusing(line,x2);if(!cell||cell.getWidth()===0)continue;if(isVisibleCell(cell))last=Math.max(last,x2)}if(last===-1)return row.length===0;let chunkIndex=0,textOffset=0;for(let x2=0;x2<=last;x2++){let cell=getCellReusing(line,x2);if(!cell||cell.getWidth()===0)continue;let chunk=row[chunkIndex];if(!chunk||!chunkStyleMatchesCell(chunk,cell,styleRewrites))return!1;let raw=cell.getChars()||" ",text=isSolidBlock(raw)&&paintsSamePixel(chunk.fg,chunk.bg)?" ":raw;if(!chunk.text.startsWith(text,textOffset))return!1;if(textOffset+=text.length,textOffset===chunk.text.length)chunkIndex++,textOffset=0;else if(textOffset>chunk.text.length)return!1}return chunkIndex===row.length&&textOffset===0}function wireXtermChannels(term,hooks){term.onData(hooks.onReply),term.onTitleChange(hooks.onTitle)}function wireXtermDefaultColorQueries(term,colors,reply){let resolved=parseTerminalDefaultColors(colors)??DEFAULT_TERMINAL_COLORS;for(let slot of[10,11])term.parser.registerOscHandler(slot,(payload)=>{if(payload!=="?")return!1;return reply(formatDefaultColorReply(slot,resolved)),!0})}class XtermRefreshTracker{dirty=null;subscription;supported;constructor(term){let event=term._core?._inputHandler?.onRequestRefreshRows;if(!event){this.supported=!1,this.subscription=null;return}this.supported=!0,this.subscription=event((range)=>{if(!range){this.dirty={kind:"all"};return}if(!this.dirty)this.dirty={kind:"range",start:range.start,end:range.end};else if(this.dirty.kind==="range")this.dirty.start=Math.min(this.dirty.start,range.start),this.dirty.end=Math.max(this.dirty.end,range.end)})}markAll(){this.dirty={kind:"all"}}peek(){return this.dirty}clear(){this.dirty=null}dispose(){this.subscription?.dispose()}}function snapshotMeta(active,viewportRows,scrollbackRows){return{type:active.type,baseY:active.baseY,length:active.length,start:Math.max(0,active.length-(viewportRows+scrollbackRows))}}function sameMeta(a2,b3){return a2.type===b3.type&&a2.baseY===b3.baseY&&a2.length===b3.length&&a2.start===b3.start}function dirtyRowsMatchSnapshot(active,snapshot,previousMeta,currentMeta,dirty,cursorHidden,frozen=null,styleRewrites){if(!previousMeta||!sameMeta(previousMeta,currentMeta)||!dirty)return!1;let first=currentMeta.start,last=currentMeta.length-1;if(dirty.kind==="range")first=Math.max(first,active.baseY+dirty.start),last=Math.min(last,active.baseY+dirty.end);let cursorY=active.baseY+active.cursorY;for(let y3=first;y3<=last;y3++){let row=snapshot[y3-currentMeta.start];if(!row)return!1;if(frozen&&y3<frozen.baseY&&frozen.cache.get(frozen.absBase+y3)===row)continue;let minLast=!cursorHidden&&y3===cursorY?active.cursorX-1:-1;if(!xtermLineMatchesChunks(active.getLine(y3),row,minLast,styleRewrites))return!1}return!0}function xtermSynchronizedOutput(term){try{return term.modes.synchronizedOutputMode===!0}catch{return!1}}function xtermCursorHidden(term){try{return term._core?.coreService?.isCursorHidden===!0}catch{return!1}}function sameFlags(previous,next){if(previous.length!==next.length)return!1;for(let i2=0;i2<next.length;i2++)if(previous[i2]!==next[i2])return!1;return!0}class XtermSnapshotEngine{alternateScreenStyleRewrites;scrollbackCache=new Map;wrappedCache=new Map;wrapped=[];anchor;anchorId=0;snapshotEpoch=0;publishedMeta=null;constructor(alternateScreenStyleRewrites){this.alternateScreenStyleRewrites=alternateScreenStyleRewrites}invalidate(){this.scrollbackCache.clear(),this.wrappedCache.clear(),this.wrapped=[],this.anchor?.dispose(),this.anchor=void 0,this.anchorId=0,this.publishedMeta=null}refresh(term,rows,scrollbackRows,refreshTracker,previousSnapshot,previousCursor,previousWindow){let active=term.buffer.active,styleRewrites=active.type==="alternate"?this.alternateScreenStyleRewrites:void 0,cursorHidden=xtermCursorHidden(term),currentMeta=snapshotMeta(active,rows,scrollbackRows),nextCursor=reconcileTerminalCursor(previousCursor,cursorHidden?null:{x:active.cursorX,y:active.baseY+active.cursorY-currentMeta.start}),verifyAnchor=this.anchor,verifyFrozen=active.type!=="alternate"&&verifyAnchor!==void 0&&!verifyAnchor.isDisposed?{baseY:active.baseY,absBase:this.anchorId-verifyAnchor.line,cache:this.scrollbackCache}:null;if(dirtyRowsMatchSnapshot(active,previousSnapshot,this.publishedMeta,currentMeta,refreshTracker.peek(),cursorHidden,verifyFrozen,styleRewrites))return refreshTracker.clear(),this.publishedMeta=currentMeta,{snapshot:previousSnapshot,cursor:nextCursor,snapshotWindow:previousWindow,wrapped:this.wrapped,changed:nextCursor!==previousCursor};if(xtermSynchronizedOutput(term))return null;let canAnchor=active.type!=="alternate"&&active.baseY>0;if(canAnchor&&(this.anchor===void 0||this.anchor.isDisposed)){this.scrollbackCache.clear(),this.wrappedCache.clear();let fresh=term.registerMarker(-active.cursorY-1);if(fresh)this.snapshotEpoch+=1,this.anchor=fresh,this.anchorId=fresh.line}let anchorAlive=canAnchor&&this.anchor!==void 0&&!this.anchor.isDisposed,absBase=anchorAlive?this.anchorId-this.anchor.line:0,cache=this.scrollbackCache,wrappedCache=this.wrappedCache,rowsOut=[],wrappedOut=[],cursorY=active.baseY+active.cursorY,start=currentMeta.start;for(let y3=start;y3<active.length;y3++){let frozen=anchorAlive&&y3<active.baseY;if(frozen){let cached=cache.get(absBase+y3);if(cached){rowsOut.push(cached),wrappedOut.push(wrappedCache.get(absBase+y3)??!1);continue}}let line=active.getLine(y3),minLast=!cursorHidden&&y3===cursorY?active.cursorX-1:-1,row=line?xtermLineToChunks(line,minLast,styleRewrites):[],wraps=y3>start&&line?.isWrapped===!0,stableRow=frozen?reconcileTerminalRow(previousSnapshot[rowsOut.length],row):row;if(rowsOut.push(stableRow),wrappedOut.push(wraps),frozen)cache.set(absBase+y3,stableRow),wrappedCache.set(absBase+y3,wraps)}if(anchorAlive){let min=absBase+start;for(let id of cache.keys())if(id<min)cache.delete(id);for(let id of wrappedCache.keys())if(id<min)wrappedCache.delete(id)}if(canAnchor){let next=term.registerMarker(-active.cursorY-1);if(next)this.anchorId=anchorAlive?absBase+next.line:0,this.anchor?.dispose(),this.anchor=next}let snapshot=reconcileTerminalRows(previousSnapshot,rowsOut),nextStartLine=absBase+start,snapshotWindow=anchorAlive?previousWindow?.epoch===this.snapshotEpoch&&previousWindow.startLine===nextStartLine?previousWindow:{epoch:this.snapshotEpoch,startLine:nextStartLine}:null;refreshTracker.clear(),this.publishedMeta=currentMeta;let wrapLayoutMoved=!sameFlags(this.wrapped,wrappedOut);if(wrapLayoutMoved)this.wrapped=wrappedOut;let changed=snapshot!==previousSnapshot||nextCursor!==previousCursor||snapshotWindow!==previousWindow||wrapLayoutMoved;return{snapshot,cursor:nextCursor,snapshotWindow,wrapped:this.wrapped,changed}}}var SNAPSHOT_COALESCE_MS=33;class XtermTaskPty{taskId;cwd;term;listeners=new PtyListeners;snapshot=[];cursor=null;snapshotWindow=null;snapshotWrapped=[];snapshotDirty=!1;snapshotEngine;_title=null;_unwatchedSince=Date.now();_killed=!1;muteReplies=!1;cols;rows;refreshQueued=!1;refreshTracker;scrollbackRows;constructor(opts,options={}){if(this.taskId=opts.taskId,this.cwd=opts.cwd,this.cols=opts.cols??DEFAULT_COLS,this.rows=opts.rows??DEFAULT_ROWS,opts.restore?.title)this._title=opts.restore.title;this.scrollbackRows=opts.scrollback??persistedScrollbackRows(),this.term=new import_headless.Terminal({allowProposedApi:!0,cols:this.cols,rows:this.rows,scrollback:this.scrollbackRows}),this.snapshotEngine=new XtermSnapshotEngine(opts.alternateScreenStyleRewrites),this.term.loadAddon(new Ke),this.term.unicode.activeVersion="11",this.refreshTracker=new XtermRefreshTracker(this.term);let reply=(data)=>{if(this._killed||this.muteReplies)return;try{this.transportWrite(data)}catch{}};if(wireXtermChannels(this.term,{onReply:reply,onTitle:(title)=>{if(!title||title===this._title)return;this._title=title,this.listeners.publishTitle(title)}}),options.respondToDefaultColorQueries!==!1)wireXtermDefaultColorQueries(this.term,opts.defaultColors,reply)}get killed(){return this._killed}write(data){if(this._killed||data.length===0)return;try{this.transportWrite(data)}catch{this.markDead(!1)}}inputModes(){try{return{applicationCursorKeys:this.term.modes.applicationCursorKeysMode===!0,applicationKeypad:this.term.modes.applicationKeypadMode===!0}}catch{return{applicationCursorKeys:!1,applicationKeypad:!1}}}onExit(cb){if(this._killed)return cb(),()=>{};return this.listeners.addExit(cb)}onTitleChange(cb){let off=this.listeners.addTitle(cb);if(this._title)try{cb(this._title)}catch{}return off}paste(text){if(this._killed||text.length===0)return;let bracketed=!1;try{bracketed=this.term.modes.bracketedPasteMode===!0}catch{}this.write(bracketed?`\x1B[200~${text}\x1B[201~`:text)}wheel(direction,col,row){if(this._killed)return!1;try{let modes=this.term.modes,seq=encodeWheel({mouseTracking:modes.mouseTrackingMode!=="none",applicationCursorKeys:modes.applicationCursorKeysMode===!0,alternateScreen:this.term.buffer.active.type==="alternate"},direction,col,row);if(seq!==null)return this.write(seq),!0}catch{}return!1}click(kind,button,col,row,modifiers){if(this._killed)return!1;try{let seq=encodeMouseButton({mouseTracking:this.term.modes.mouseTrackingMode},kind,button,col,row,modifiers);if(seq!==null)return this.write(seq),!0}catch{}return!1}get appOwnsMouse(){if(this._killed)return!1;try{return this.term.modes.mouseTrackingMode!=="none"}catch{return!1}}get onAlternateScreen(){if(this._killed)return!1;try{return this.term.buffer.active.type==="alternate"}catch{return!1}}onData(cb){this.ensureFreshSnapshot();let off=this.listeners.addData(cb);if(this._unwatchedSince=null,this.snapshot.length>0)try{cb(this.snapshot,this.cursor,this.snapshotWindow,this.snapshotWrapped)}catch{}return()=>{if(off(),this.listeners.dataCount===0&&this._unwatchedSince===null)this._unwatchedSince=Date.now()}}unwatchedSinceMs(){return this._unwatchedSince}get windowTitle(){return this._title}get scrollback(){return this.scrollbackRows}resizeEmulator(cols,rows){this.cols=cols,this.rows=rows,this.term.resize(cols,rows),this.invalidateScrollbackCache(),this.refreshTracker.markAll()}get size(){return{cols:this.cols,rows:this.rows}}resize(cols,rows){if(this._killed)return;this.cols=cols,this.rows=rows;try{this.term.resize(cols,rows),this.invalidateScrollbackCache(),this.transportResize(cols,rows),this.refreshTracker.markAll(),this.refreshSnapshot()}catch{this.markDead(!1)}}invalidateScrollbackCache(){this.snapshotEngine.invalidate(),this.snapshotWindow=null}capture(){return this.ensureFreshSnapshot(),this.snapshot}captureCursor(){return this.ensureFreshSnapshot(),this.cursor}captureWindow(){return this.ensureFreshSnapshot(),this.snapshotWindow}captureWrapped(){return this.ensureFreshSnapshot(),this.snapshotWrapped}ensureFreshSnapshot(){if(!this.snapshotDirty||this._killed)return;this.refreshSnapshot()}kill(){if(this._killed)return;this.markDead(!0)}feed(data){this.feedInternal(data,!1)}feedReplay(data){this.feedInternal(data,!0)}feedInternal(data,muteReplies){if(this._killed)return;if(muteReplies)this.muteReplies=!0;profileTick("feed"),this.term.write(data,()=>{if(muteReplies)this.muteReplies=!1;if(!this.refreshTracker.supported)this.refreshTracker.markAll();this.queueRefresh()})}queueRefresh(){if(this.listeners.dataCount===0){this.snapshotDirty=!0;return}if(this.refreshQueued)return;this.refreshQueued=!0,setTimeout(()=>{this.refreshQueued=!1,this.refreshSnapshot()},SNAPSHOT_COALESCE_MS)}refreshSnapshot(){if(this._killed)return;let result=profileSpan("refresh",()=>this.snapshotEngine.refresh(this.term,this.rows,this.scrollbackRows,this.refreshTracker,this.snapshot,this.cursor,this.snapshotWindow));if(result===null){this.queueRefresh();return}if(this.snapshot=result.snapshot,this.cursor=result.cursor,this.snapshotWindow=result.snapshotWindow,this.snapshotWrapped=result.wrapped,this.snapshotDirty=!1,result.changed)this.publishSnapshot()}publishSnapshot(){profileTick("publish"),this.listeners.publishData(this.snapshot,this.cursor,this.snapshotWindow,this.snapshotWrapped)}disposeEmulator(){try{this.term.dispose()}catch{}}markDead(killProcess){if(this._killed)return;if(this._killed=!0,this.refreshTracker.dispose(),this.disposeEmulator(),killProcess)try{this.transportKill()}catch{}let exitCbs=this.listeners.drainExits();this.listeners.clearData();for(let cb of exitCbs)try{cb()}catch{}}silentDispose(){this._killed=!0,this.refreshTracker.dispose(),this.disposeEmulator(),this.listeners.clearAll()}}var WIGGLE_MIN_GAP_MS=150;class HostedTaskPty extends XtermTaskPty{client=null;opened=!1;pendingInput=[];pendingResize=null;unsubs=[];deadOnAttach=!1;sessionPid=void 0;pendingExitPid=null;get shellPid(){return this.sessionPid??null}serializer=new D;hostOffset=null;constructor(opts){super(opts,{respondToDefaultColorQueries:!1});this.term.loadAddon(this.serializer),this.openRemote(opts)}static createdFresh(res){return res.alive&&(res.created??res.replay.length===0)}async openRemote(opts){try{let client=await getSharedPtyClient();if(this.killed)return;this.client=client,routeAdd(this),this.unsubs.push(client.onLifecycle("close",()=>this.remoteGone()));let res=await client.request("pty.open",{key:this.taskId,cwd:this.cwd,command:opts.command,shell:opts.shell,cols:this.cols,rows:this.rows,defaultColors:opts.defaultColors,sinceOffset:opts.restore?.byteOffset,sincePid:opts.restore?.pid??void 0});if(this.killed)return;this.sessionPid=res.pid??null,this.hostOffset=res.offset??null;let restored=opts.restore!==void 0&&res.sinceValid===!0&&res.created!==!0&&(res.pid??null)===opts.restore.pid;if(restored&&opts.restore){if(await this.restoreParked(opts.restore,Buffer.from(res.replay,"base64")),this.killed)return}else if(res.replay.length>0)this.feedReplay(Buffer.from(res.replay,"base64"));if(this.opened=!0,this.pendingResize){let{cols,rows}=this.pendingResize;this.pendingResize=null,this.sendResize(cols,rows)}let fresh=HostedTaskPty.createdFresh(res);if(opts.initialInput&&fresh)this.sendInput(opts.initialInput);if(opts.firstMessage&&fresh)pastePromptWhenEngineUp(client,this.taskId,opts.engineBin,opts.firstMessage).catch((err)=>logClientError("pty-hosted",err));for(let data of this.pendingInput.splice(0))this.sendInput(data);let parkedExitPid=this.pendingExitPid;if(this.pendingExitPid=null,!res.alive)this.deadOnAttach=res.replay.length>0||restored,this.remoteGone();else if(parkedExitPid!==null&&parkedExitPid===this.sessionPid)this.remoteGone();else if(res.replay.length>0&&!restored){if(this.sendResize(this.cols,Math.max(1,this.rows-1)),await Promise.all([this.nextDataOrTimeout(500),new Promise((r2)=>setTimeout(r2,WIGGLE_MIN_GAP_MS))]),!this.killed)this.sendResize(this.cols,this.rows)}}catch(err){logClientError("pty-hosted",err),this.remoteGone()}}transportWrite(data){if(!this.opened){this.pendingInput.push(data);return}this.sendInput(data)}transportResize(cols,rows){if(!this.opened){this.pendingResize={cols,rows};return}this.sendResize(cols,rows)}transportKill(){let client=this.client;if(client)client.request("pty.kill",{key:this.taskId}).catch(()=>{});this.cleanup()}kill(){if(this.killed){this.client?.request("pty.kill",{key:this.taskId}).catch(()=>{});return}super.kill()}capturePark(){if(this.killed||!this.opened||this.hostOffset===null||this.sessionPid===void 0)return null;try{return{serialized:Buffer.from(this.serializer.serialize({scrollback:this.scrollback}),"utf8").toString(),title:this.windowTitle,cursorHidden:xtermCursorHidden(this.term),cols:this.cols,rows:this.rows,byteOffset:this.hostOffset,pid:this.sessionPid}}catch{return null}}async restoreParked(state,delta){let targetCols=this.cols,targetRows=this.rows;if(state.cols!==targetCols||state.rows!==targetRows)this.resizeEmulator(state.cols,state.rows);if(this.feedReplay(state.serialized+(state.cursorHidden?"\x1B[?25l":"")),delta.byteLength>0)this.feedReplay(delta);if(await new Promise((resolve)=>{let off=this.onExit(resolve);this.term.write("",()=>{off(),resolve()})}),!this.killed&&(this.cols!==targetCols||this.rows!==targetRows))this.resizeEmulator(targetCols,targetRows)}detach(opts={}){let client=this.client;this.cleanup();let siblings=routeCount(this.taskId);if(client&&siblings===0)client.request("pty.detach",{key:this.taskId,parked:opts.parked===!0,parkedScreenBytes:opts.parkedScreenBytes}).catch(()=>{});this.silentDispose()}sendInput(data){this.client?.request("pty.write",{key:this.taskId,data}).catch(()=>this.remoteGone())}sendResize(cols,rows){this.client?.request("pty.resize",{key:this.taskId,cols,rows}).catch(()=>{})}dataWaiter=null;_lastOutputAt=null;lastOutputAtMs(){return this._lastOutputAt}nextDataOrTimeout(ms){return new Promise((resolve)=>{let timer=setTimeout(()=>{this.dataWaiter=null,resolve()},ms);this.dataWaiter=()=>{this.dataWaiter=null,clearTimeout(timer),resolve()}})}feedFrame(dataB64){this.dataWaiter?.(),this._lastOutputAt=Date.now();let buf=Buffer.from(dataB64,"base64");if(this.hostOffset!==null)this.hostOffset+=buf.byteLength;this.feed(buf)}remoteExited(pid){if(this.killed)return;if(pid===void 0){this.remoteGone();return}if(this.sessionPid===void 0){this.pendingExitPid=pid;return}if(pid!==null&&pid===this.sessionPid)this.remoteGone()}remoteGone(){this.cleanup(),this.markDead(!1)}cleanup(){routeRemove(this);for(let unsub of this.unsubs.splice(0))try{unsub()}catch{}}}class MockTaskPty{taskId;cwd;listeners=new Set;buffer="";writes=[];_killed=!1;_title=null;exitListeners=new Set;titleListeners=new Set;pastes=[];deadOnAttach=!1;wheels=[];clicks=[];appOwnsMouse=!1;onAlternateScreen=!1;_cols;_rows;_cursor=null;modes={applicationCursorKeys:!1,applicationKeypad:!1};constructor(opts){if(this.taskId=opts.taskId,this.cwd=opts.cwd,this._cols=opts.cols??DEFAULT_COLS,this._rows=opts.rows??DEFAULT_ROWS,opts.initialInput)this.writes.push(opts.initialInput)}get killed(){return this._killed}get writeLog(){return this.writes}get geometry(){return{cols:this._cols,rows:this._rows}}feed(data){if(this._killed)return;this.buffer+=data;let title=extractOscTitle(data);if(title&&title!==this._title){this._title=title;for(let cb of this.titleListeners)try{cb(title)}catch{}}let rows=this.capture();for(let cb of this.listeners)try{cb(rows,this._cursor,null)}catch{}}write(data){if(this._killed)return;this.writes.push(data)}inputModes(){return this.modes}replaceScreen(data){if(this._killed)return;this.buffer="",this.feed(data)}onData(cb){if(this.listeners.add(cb),this.buffer!=="")try{cb(this.capture(),this._cursor,null)}catch{}return()=>{this.listeners.delete(cb)}}resize(cols,rows){if(this._killed)return;this._cols=cols,this._rows=rows}capture(){return parseAnsiSnapshot(this.buffer)}setCursor(pos){this._cursor=pos}captureCursor(){if(this._killed)return null;return this._cursor}captureWindow(){return null}kill(){if(this._killed)return;this._killed=!0,this.listeners.clear();let exitCbs=[...this.exitListeners];this.exitListeners.clear();for(let cb of exitCbs)cb()}paste(text){if(this._killed)return;this.pastes.push(text)}wheel(direction,col,row){if(this._killed)return!1;return this.wheels.push({direction,col,row}),!1}click(kind,button,col,row){if(this._killed)return!1;return this.clicks.push({kind,button,col,row}),this.appOwnsMouse}onExit(cb){if(this._killed)return cb(),()=>{};return this.exitListeners.add(cb),()=>{this.exitListeners.delete(cb)}}onTitleChange(cb){if(this.titleListeners.add(cb),this._title)try{cb(this._title)}catch{}return()=>{this.titleListeners.delete(cb)}}}import{spawn}from"child_process";class PipeTaskPty{taskId;cwd;proc;listeners=new Set;buffer="";_killed=!1;_title=null;exitListeners=new Set;titleListeners=new Set;cols;rows;constructor(opts){this.taskId=opts.taskId,this.cwd=opts.cwd,this.cols=opts.cols??DEFAULT_COLS,this.rows=opts.rows??DEFAULT_ROWS;let argv=resolveArgv(opts),exe=argv[0]??defaultShell(),args=argv.slice(1);if(this.proc=spawn(exe,args,{cwd:opts.cwd,env:embeddedTerminalEnv(process.env,{TERM:process.env.TERM??"xterm-256color",COLUMNS:String(this.cols),LINES:String(this.rows),KOBE_TERMINAL_PIPE:"1"}),stdio:["pipe","pipe","pipe"]}),this.proc.stdout?.setEncoding("utf8"),this.proc.stderr?.setEncoding("utf8"),this.proc.stdout?.on("data",(chunk)=>this.append(chunk)),this.proc.stderr?.on("data",(chunk)=>this.append(chunk)),this.proc.stdin?.on("error",()=>this.markDead(!1)),this.proc.on("error",(err)=>{this.append(`
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{describeAccount,detectEngineStatuses,probeableEngineIds,summarizeEngines}from"./chunk-edeh4d1v.js";import{t}from"./chunk-rvybphrq.js";import{createInterface}from"readline";function daemonRestartFix(cliName,reason){return{kind:"run",id:"daemon-restart",label:t(`doctor.fix.${reason}`),command:[cliName,"daemon","restart"],why:t("doctor.fix.daemonRestartWhy")}}function skillInstallFix(installCommand,stale){return{kind:"run",id:"skill-install",label:t(stale?"doctor.fix.skillStale":"doctor.fix.skillMissing"),command:installCommand.split(" "),why:t("doctor.fix.skillInstallWhy")}}function resetManualFix(cliName,reason){return{kind:"manual",id:`reset:${reason}`,label:t(`doctor.fix.${reason}`),action:`${cliName} reset`,why:t("doctor.fix.resetWhy")}}function killOrphansManualFix(cliName,count){return{kind:"manual",id:"kill-orphans",label:t("doctor.fix.orphans",{count}),action:`${cliName} doctor --kill-orphans`,why:t("doctor.fix.orphansWhy")}}function engineTabsManualFix(){return{kind:"manual",id:"engine-tabs",label:t("doctor.fix.engineTabs"),action:t("doctor.fix.engineTabsAction"),why:t("doctor.fix.engineTabsWhy")}}function reinstallManualFix(){return{kind:"manual",id:"reinstall",label:t("doctor.fix.staleInstall"),action:t("doctor.fix.staleInstallAction"),why:t("doctor.fix.staleInstallWhy")}}function spawnHelperFix(paths){return{kind:"run",id:"spawn-helper-chmod",label:t("doctor.fix.spawnHelper"),command:["chmod","755",...paths],why:t("doctor.fix.spawnHelperWhy")}}function humanOnlyFix(reason,vars){return{kind:"manual",id:reason,label:t(`doctor.fix.${reason}`),action:t(`doctor.fix.${reason}Action`,vars),why:t("doctor.fix.humanOnlyWhy")}}function noEngineFix(signedOut){return signedOut.length>0?humanOnlyFix("noEngineLogin",{list:signedOut.join(", ")}):humanOnlyFix("noEngine")}function noEngineAction(signedOut){return signedOut.length>0?t("doctor.fix.noEngineLoginAction",{list:signedOut.join(", ")}):t("doctor.fix.noEngineAction")}function dedupeFixes(fixes){let seen=new Set;return fixes.filter((fix)=>{if(seen.has(fix.id))return!1;return seen.add(fix.id),!0})}async function applyFixes(collected,rt){let fixes=dedupeFixes(collected);if(fixes.length===0){rt.out(""),rt.out(t("doctor.fix.none"));return}let runnable=fixes.filter((fix)=>fix.kind==="run");if(runnable.length>0){rt.out(""),rt.out(t("doctor.fix.header"));for(let fix of runnable){if(rt.out(` ${fix.label}`),rt.out(` ${t("doctor.fix.willRun",{command:fix.command.join(" ")})}`),rt.out(` ${fix.why}`),!rt.interactive)continue;if(!await rt.confirm(` ${t("doctor.fix.confirmPrompt")}`)){rt.out(` ${t("doctor.fix.skipped")}`);continue}let code=await rt.exec(fix.command);rt.out(code===0?` ${t("doctor.fix.done")}`:` ${t("doctor.fix.failed",{code})}`)}if(!rt.interactive)rt.out(` ${t("doctor.fix.nonInteractive")}`)}let manual=fixes.filter((fix)=>fix.kind==="manual");if(manual.length>0){rt.out(""),rt.out(t("doctor.fix.manualHeader"));for(let fix of manual)rt.out(` ${fix.label}`),rt.out(` \u2192 ${fix.action}`),rt.out(` ${fix.why}`)}}async function confirmTty(question){let readline=createInterface({input:process.stdin,output:process.stdout});try{let answer=await new Promise((resolve)=>readline.question(question,resolve));return answer.trim().toLowerCase()==="y"||answer.trim().toLowerCase()==="yes"}finally{readline.close()}}async function execInherited(command){try{return await Bun.spawn([...command],{stdin:"inherit",stdout:"inherit",stderr:"inherit"}).exited}catch{return 127}}function defaultFixRuntime(){return{confirm:confirmTty,exec:execInherited,out:(line)=>console.log(line),interactive:process.stdin.isTTY===!0}}async function probeGit(){try{let proc=Bun.spawn(["git","--version"],{stdin:"ignore",stdout:"pipe",stderr:"ignore"}),text=(await new Response(proc.stdout).text()).trim();if(await proc.exited===0&&text)return{line:`git: \u2713 ${text}`,found:!0}}catch{}return{line:"git: \u2717 not found on PATH",found:!1}}function binaryLabel(binary){return binary.found?`\u2713 ${binary.path}`:`\u2717 ${binary.error}`}async function probeEngines(){let statuses=await detectEngineStatuses(await probeableEngineIds()),lines=["engines:"];for(let status of statuses){let account=describeAccount(status.account),name=`${status.vendor.padEnd(7)} `;if(lines.push(` ${name}${binaryLabel(status.binary)}${status.binary.found?` \u2014 ${account}`:""}`),status.accountError)lines.push(` \u26A0 ${status.accountError}`)}let{usable,signedOut}=summarizeEngines(statuses);return{lines,anyUsable:usable.length>0,signedOut}}async function checkOnboardingEnv(){let[git,engines]=await Promise.all([probeGit(),probeEngines()]);return{git,engines}}
2
+ import{describeAccount,detectEngineStatuses,probeableEngineIds,summarizeEngines}from"./chunk-w0m1q23m.js";import{t}from"./chunk-rvybphrq.js";import{createInterface}from"readline";function daemonRestartFix(cliName,reason){return{kind:"run",id:"daemon-restart",label:t(`doctor.fix.${reason}`),command:[cliName,"daemon","restart"],why:t("doctor.fix.daemonRestartWhy")}}function skillInstallFix(installCommand,stale){return{kind:"run",id:"skill-install",label:t(stale?"doctor.fix.skillStale":"doctor.fix.skillMissing"),command:installCommand.split(" "),why:t("doctor.fix.skillInstallWhy")}}function resetManualFix(cliName,reason){return{kind:"manual",id:`reset:${reason}`,label:t(`doctor.fix.${reason}`),action:`${cliName} reset`,why:t("doctor.fix.resetWhy")}}function killOrphansManualFix(cliName,count){return{kind:"manual",id:"kill-orphans",label:t("doctor.fix.orphans",{count}),action:`${cliName} doctor --kill-orphans`,why:t("doctor.fix.orphansWhy")}}function engineTabsManualFix(){return{kind:"manual",id:"engine-tabs",label:t("doctor.fix.engineTabs"),action:t("doctor.fix.engineTabsAction"),why:t("doctor.fix.engineTabsWhy")}}function reinstallManualFix(){return{kind:"manual",id:"reinstall",label:t("doctor.fix.staleInstall"),action:t("doctor.fix.staleInstallAction"),why:t("doctor.fix.staleInstallWhy")}}function spawnHelperFix(paths){return{kind:"run",id:"spawn-helper-chmod",label:t("doctor.fix.spawnHelper"),command:["chmod","755",...paths],why:t("doctor.fix.spawnHelperWhy")}}function humanOnlyFix(reason,vars){return{kind:"manual",id:reason,label:t(`doctor.fix.${reason}`),action:t(`doctor.fix.${reason}Action`,vars),why:t("doctor.fix.humanOnlyWhy")}}function noEngineFix(signedOut){return signedOut.length>0?humanOnlyFix("noEngineLogin",{list:signedOut.join(", ")}):humanOnlyFix("noEngine")}function noEngineAction(signedOut){return signedOut.length>0?t("doctor.fix.noEngineLoginAction",{list:signedOut.join(", ")}):t("doctor.fix.noEngineAction")}function dedupeFixes(fixes){let seen=new Set;return fixes.filter((fix)=>{if(seen.has(fix.id))return!1;return seen.add(fix.id),!0})}async function applyFixes(collected,rt){let fixes=dedupeFixes(collected);if(fixes.length===0){rt.out(""),rt.out(t("doctor.fix.none"));return}let runnable=fixes.filter((fix)=>fix.kind==="run");if(runnable.length>0){rt.out(""),rt.out(t("doctor.fix.header"));for(let fix of runnable){if(rt.out(` ${fix.label}`),rt.out(` ${t("doctor.fix.willRun",{command:fix.command.join(" ")})}`),rt.out(` ${fix.why}`),!rt.interactive)continue;if(!await rt.confirm(` ${t("doctor.fix.confirmPrompt")}`)){rt.out(` ${t("doctor.fix.skipped")}`);continue}let code=await rt.exec(fix.command);rt.out(code===0?` ${t("doctor.fix.done")}`:` ${t("doctor.fix.failed",{code})}`)}if(!rt.interactive)rt.out(` ${t("doctor.fix.nonInteractive")}`)}let manual=fixes.filter((fix)=>fix.kind==="manual");if(manual.length>0){rt.out(""),rt.out(t("doctor.fix.manualHeader"));for(let fix of manual)rt.out(` ${fix.label}`),rt.out(` \u2192 ${fix.action}`),rt.out(` ${fix.why}`)}}async function confirmTty(question){let readline=createInterface({input:process.stdin,output:process.stdout});try{let answer=await new Promise((resolve)=>readline.question(question,resolve));return answer.trim().toLowerCase()==="y"||answer.trim().toLowerCase()==="yes"}finally{readline.close()}}async function execInherited(command){try{return await Bun.spawn([...command],{stdin:"inherit",stdout:"inherit",stderr:"inherit"}).exited}catch{return 127}}function defaultFixRuntime(){return{confirm:confirmTty,exec:execInherited,out:(line)=>console.log(line),interactive:process.stdin.isTTY===!0}}async function probeGit(){try{let proc=Bun.spawn(["git","--version"],{stdin:"ignore",stdout:"pipe",stderr:"ignore"}),text=(await new Response(proc.stdout).text()).trim();if(await proc.exited===0&&text)return{line:`git: \u2713 ${text}`,found:!0}}catch{}return{line:"git: \u2717 not found on PATH",found:!1}}function binaryLabel(binary){return binary.found?`\u2713 ${binary.path}`:`\u2717 ${binary.error}`}async function probeEngines(){let statuses=await detectEngineStatuses(await probeableEngineIds()),lines=["engines:"];for(let status of statuses){let account=describeAccount(status.account),name=`${status.vendor.padEnd(7)} `;if(lines.push(` ${name}${binaryLabel(status.binary)}${status.binary.found?` \u2014 ${account}`:""}`),status.accountError)lines.push(` \u26A0 ${status.accountError}`)}let{usable,signedOut}=summarizeEngines(statuses);return{lines,anyUsable:usable.length>0,signedOut}}async function checkOnboardingEnv(){let[git,engines]=await Promise.all([probeGit(),probeEngines()]);return{git,engines}}
3
3
  export{daemonRestartFix,skillInstallFix,resetManualFix,killOrphansManualFix,engineTabsManualFix,reinstallManualFix,spawnHelperFix,humanOnlyFix,noEngineFix,noEngineAction,applyFixes,defaultFixRuntime,probeGit,probeEngines,checkOnboardingEnv};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{BREAKING_VERSIONS,CURRENT_VERSION,DEFAULT_RELEASE_CHANNEL,PACKAGE_NAME,RELEASE_CHANNELS,UPDATE_COMMAND,UPDATE_SCRIPT_URL,breakingVersionsCrossed,channelOf,checkLatestVersion,compareSemver,fetchReleaseNotes,fetchReleaseNotesRange,fetchReleaseSummaries,isNewerSemver,owningNpmPrefix,recommendedGlobalInstallCommand,releasePageUrl,repoSlug}from"./chunk-a20p202a.js";import"./chunk-ch9b1d5y.js";import"./chunk-g56kvet6.js";import"./chunk-r3k9rbwm.js";import"./chunk-wqfp8d9w.js";export{repoSlug,releasePageUrl,recommendedGlobalInstallCommand,owningNpmPrefix,isNewerSemver,fetchReleaseSummaries,fetchReleaseNotesRange,fetchReleaseNotes,compareSemver,checkLatestVersion,channelOf,breakingVersionsCrossed,UPDATE_SCRIPT_URL,UPDATE_COMMAND,RELEASE_CHANNELS,PACKAGE_NAME,DEFAULT_RELEASE_CHANNEL,CURRENT_VERSION,BREAKING_VERSIONS};
2
+ import{BREAKING_VERSIONS,CURRENT_VERSION,DEFAULT_RELEASE_CHANNEL,PACKAGE_NAME,RELEASE_CHANNELS,UPDATE_COMMAND,UPDATE_SCRIPT_URL,breakingVersionsCrossed,channelOf,checkLatestVersion,compareSemver,fetchReleaseNotes,fetchReleaseNotesRange,fetchReleaseSummaries,isNewerSemver,owningNpmPrefix,recommendedGlobalInstallCommand,releasePageUrl,repoSlug}from"./chunk-m4vgx1sc.js";import"./chunk-ch9b1d5y.js";import"./chunk-g56kvet6.js";import"./chunk-r3k9rbwm.js";import"./chunk-wqfp8d9w.js";export{repoSlug,releasePageUrl,recommendedGlobalInstallCommand,owningNpmPrefix,isNewerSemver,fetchReleaseSummaries,fetchReleaseNotesRange,fetchReleaseNotes,compareSemver,checkLatestVersion,channelOf,breakingVersionsCrossed,UPDATE_SCRIPT_URL,UPDATE_COMMAND,RELEASE_CHANNELS,PACKAGE_NAME,DEFAULT_RELEASE_CHANNEL,CURRENT_VERSION,BREAKING_VERSIONS};