@sma1lboy/rove 0.9.151 → 0.9.153
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/{chunk-6dn6h640.js → chunk-07k2njwk.js} +1 -1
- package/dist/cli/{chunk-jwv06n3d.js → chunk-1a7ctg07.js} +1 -1
- package/dist/cli/{chunk-x8m1vmyd.js → chunk-2kvvykg1.js} +1 -1
- package/dist/cli/{chunk-jq5vp0f7.js → chunk-2wdnqzbf.js} +1 -1
- package/dist/cli/chunk-2z90jxcn.js +3 -0
- package/dist/cli/{chunk-jv5nqjnv.js → chunk-31crt0e4.js} +1 -1
- package/dist/cli/chunk-37gnmm2m.js +3 -0
- package/dist/cli/{chunk-q0f6rhex.js → chunk-3gvqnsty.js} +3 -3
- package/dist/cli/{chunk-wzyh3fgx.js → chunk-45j1qqdf.js} +1 -1
- package/dist/cli/{chunk-6kz81dkc.js → chunk-4c220qpj.js} +3 -4
- package/dist/cli/chunk-4gaqhq8t.js +2 -0
- package/dist/cli/{chunk-0vmrteyg.js → chunk-4tzgma89.js} +1 -1
- package/dist/cli/{chunk-tk8p54f7.js → chunk-51y7sjhe.js} +1 -1
- package/dist/cli/chunk-55s4zykj.js +2 -0
- package/dist/cli/{chunk-yfg503fr.js → chunk-56m4hk0p.js} +1 -1
- package/dist/cli/chunk-5hjs0374.js +2 -0
- package/dist/cli/chunk-5snrwe65.js +3 -0
- package/dist/cli/{chunk-7tfqaet5.js → chunk-6s6pne9d.js} +1 -1
- package/dist/cli/chunk-6t2zhxmq.js +2 -0
- package/dist/cli/{chunk-fpjcrjna.js → chunk-73qrq7bg.js} +1 -1
- package/dist/cli/{chunk-3zf7mr7r.js → chunk-7gy0rnrs.js} +1 -1
- package/dist/cli/{chunk-q4ry13v3.js → chunk-7h7tqran.js} +1 -1
- package/dist/cli/{chunk-wc1kk5c0.js → chunk-7s82zpcv.js} +1 -1
- package/dist/cli/{chunk-e7t4xpr9.js → chunk-7z9cqycv.js} +1 -1
- package/dist/cli/{chunk-4d5bph3p.js → chunk-81cysjk5.js} +1 -1
- package/dist/cli/chunk-81h96pha.js +2 -0
- package/dist/cli/{chunk-rgh49bm3.js → chunk-8ad0ba2n.js} +2 -2
- package/dist/cli/{chunk-g47vt3k5.js → chunk-8gsqypg8.js} +1 -1
- package/dist/cli/{chunk-ktmvmskn.js → chunk-8r1pnch1.js} +1 -1
- package/dist/cli/{chunk-m4my5wna.js → chunk-90wcrcj5.js} +2 -2
- package/dist/cli/{chunk-xe62kmhp.js → chunk-9gz7jmgq.js} +1 -1
- package/dist/cli/chunk-9j7507ap.js +2 -0
- package/dist/cli/{chunk-m370e00b.js → chunk-9zb2wkfr.js} +1 -1
- package/dist/cli/chunk-a4h476hv.js +3 -0
- package/dist/cli/{chunk-d89r6eqm.js → chunk-ap5bjaq8.js} +1 -1
- package/dist/cli/{chunk-0sm2k04y.js → chunk-b9h2ywc7.js} +1 -1
- package/dist/cli/chunk-bkba9c4n.js +4 -0
- package/dist/cli/{chunk-kdrrw9tm.js → chunk-c1xp9qx6.js} +1 -1
- package/dist/cli/{chunk-nw91q4x3.js → chunk-d809qqsk.js} +1 -1
- package/dist/cli/{chunk-87y9qjcm.js → chunk-deejtpcr.js} +1 -1
- package/dist/cli/{chunk-emm50f4q.js → chunk-dgsrf048.js} +1 -1
- package/dist/cli/{chunk-gtkejmxx.js → chunk-dv7rxr77.js} +1 -1
- package/dist/cli/chunk-dwfv6dxg.js +2 -0
- package/dist/cli/{chunk-n4dmwkfa.js → chunk-ea1r26pa.js} +1 -1
- package/dist/cli/{chunk-5mr9j201.js → chunk-ed1y1wtm.js} +3 -3
- package/dist/cli/{chunk-m2xasved.js → chunk-efdphna5.js} +1 -1
- package/dist/cli/{chunk-ayagydjk.js → chunk-evmfa4v5.js} +1 -1
- package/dist/cli/{chunk-xnr8dga2.js → chunk-fd7swjnq.js} +4 -6
- package/dist/cli/{chunk-rf2m6f3h.js → chunk-fna6sxe4.js} +1 -1
- package/dist/cli/chunk-g2advs8t.js +3 -0
- package/dist/cli/{chunk-x3gch5nw.js → chunk-g5nz190n.js} +1 -1
- package/dist/cli/{chunk-ybsdy2w8.js → chunk-gc25wht3.js} +1 -1
- package/dist/cli/chunk-h4n8ffqy.js +4 -0
- package/dist/cli/{chunk-r1p9bwja.js → chunk-h5jhdjv7.js} +1 -1
- package/dist/cli/chunk-j1a890dg.js +2 -0
- package/dist/cli/{chunk-k9skkhzs.js → chunk-j2j1kq3m.js} +1 -1
- package/dist/cli/{chunk-jy6nd23p.js → chunk-kd870mfy.js} +1 -1
- package/dist/cli/chunk-ke95ebrz.js +3 -0
- package/dist/cli/{chunk-6sp2ags8.js → chunk-kpf3yaj9.js} +1 -1
- package/dist/cli/{chunk-15k6hqzx.js → chunk-m6n0mkye.js} +1 -1
- package/dist/cli/{chunk-98thhbm5.js → chunk-makzf3q1.js} +1 -1
- package/dist/cli/{chunk-s433recg.js → chunk-mmd7zehs.js} +1 -1
- package/dist/cli/chunk-nhsr87w7.js +2 -0
- package/dist/cli/{chunk-s8xyh1bt.js → chunk-nm802jgt.js} +1 -1
- package/dist/cli/chunk-nywh3yb9.js +3 -0
- package/dist/cli/chunk-nzy3yafz.js +2 -0
- package/dist/cli/chunk-p8hzr9m6.js +2 -0
- package/dist/cli/chunk-pxtx1gcf.js +3 -0
- package/dist/cli/{chunk-fm4q306m.js → chunk-q2p5cnse.js} +1 -1
- package/dist/cli/{chunk-pmt3agbd.js → chunk-qdp0w20h.js} +1 -1
- package/dist/cli/chunk-r94jdy8g.js +2 -0
- package/dist/cli/chunk-rkt1qjec.js +3 -0
- package/dist/cli/{chunk-m57cv76y.js → chunk-rsqx358z.js} +1 -1
- package/dist/cli/{chunk-9c1e5z6a.js → chunk-s8eh3cf1.js} +1 -1
- package/dist/cli/chunk-s9a974w9.js +2 -0
- package/dist/cli/{chunk-p9vkwnb8.js → chunk-tw2t78nk.js} +2 -2
- package/dist/cli/{chunk-9nbg0nzh.js → chunk-v9p6gxm0.js} +1 -1
- package/dist/cli/{chunk-rz8247zr.js → chunk-x7ssay77.js} +1 -1
- package/dist/cli/{chunk-t05pnk6y.js → chunk-xjskp76m.js} +1 -1
- package/dist/cli/chunk-xqw5d5rv.js +3 -0
- package/dist/cli/chunk-xve4g8ct.js +2 -0
- package/dist/cli/{chunk-k1sjc72d.js → chunk-ybv02fyn.js} +5 -5
- package/dist/cli/{chunk-x39pv7rx.js → chunk-yshnare4.js} +1 -1
- package/dist/cli/chunk-z1e1bsv5.js +5 -0
- package/dist/cli/{chunk-y5hnrx8d.js → chunk-z2aqaabp.js} +1 -1
- package/dist/cli/{chunk-tgxe9ae1.js → chunk-z4c6bmw0.js} +2 -2
- package/dist/cli/{chunk-579zz8df.js → chunk-z83wxkg6.js} +2 -2
- package/dist/cli/index.js +10 -10
- package/dist/cli/kobe.js +1 -1
- package/dist/cli/rove.js +1 -1
- package/dist/web-ui/assets/{harness-CYGJ4uoR.js → harness-DvVhbIUb.js} +1 -1
- package/dist/web-ui/assets/{index-BTJ-X_4s.js → index-DrVCJr6C.js} +2 -2
- package/dist/web-ui/index.html +1 -1
- package/package.json +1 -1
- package/dist/cli/chunk-1kktfmtg.js +0 -4
- package/dist/cli/chunk-1rkb0j1j.js +0 -3
- package/dist/cli/chunk-1vhbnf49.js +0 -2
- package/dist/cli/chunk-2cyzv75r.js +0 -3
- package/dist/cli/chunk-4nm1axc3.js +0 -2
- package/dist/cli/chunk-6frfschk.js +0 -2
- package/dist/cli/chunk-7zmrn4gn.js +0 -3
- package/dist/cli/chunk-8rxg6hs2.js +0 -2
- package/dist/cli/chunk-95e0ks8n.js +0 -2
- package/dist/cli/chunk-akckb9kw.js +0 -3
- package/dist/cli/chunk-aynx3d2a.js +0 -2
- package/dist/cli/chunk-cexxmfva.js +0 -2
- package/dist/cli/chunk-dmdqnet6.js +0 -3
- package/dist/cli/chunk-fyf7xgaa.js +0 -2
- package/dist/cli/chunk-gzf4dfg6.js +0 -3
- package/dist/cli/chunk-j5r92gh9.js +0 -2
- package/dist/cli/chunk-jfkw009v.js +0 -2
- package/dist/cli/chunk-mjvq39gf.js +0 -4
- package/dist/cli/chunk-ssepbf68.js +0 -2
- package/dist/cli/chunk-tz9e598v.js +0 -2
- /package/dist/cli/{chunk-h82kzdsn.js → chunk-bq3fyc0p.js} +0 -0
package/dist/web-ui/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta charset="UTF-8" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Rove</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DrVCJr6C.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-Cs2vPLNB.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@sma1lboy/rove",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.153",
|
|
5
5
|
"description": "Rove — the agent multiplexer for your terminal. Run coding agents on parallel tasks with isolated worktrees and persistent sessions.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"terminal",
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{quoteShellArg,quoteShellArgv}from"./chunk-2fypr41w.js";import{spawn,spawnSync}from"child_process";import{existsSync}from"fs";import{mkdir,readFile as readFileAsync,readdir as readdirAsync}from"fs/promises";var shQuote=quoteShellArg,shJoin=quoteShellArgv;function shToken(s){return/^[A-Za-z0-9_@%+=:,./-]+$/.test(s)?s:quoteShellArg(s)}function remoteEnvPrefix(env){if(!env)return"";let pairs=Object.entries(env).filter(([key])=>/^[A-Za-z_][A-Za-z0-9_]*$/.test(key));if(pairs.length===0)return"";return`${pairs.map(([key,value])=>`${key}=${shQuote(value)}`).join(" ")} `}function sshConnectArgs(spec,opts={}){let argv=["ssh"];if(opts.tty)argv.push("-tt");if(opts.batch)argv.push("-o","BatchMode=yes");if(argv.push("-o","ControlMaster=auto","-o",`ControlPath=${spec.controlPath}`,"-o","ControlPersist=300"),argv.push("-o","StrictHostKeyChecking=accept-new"),spec.port)argv.push("-p",String(spec.port));if(spec.auth.kind==="key"&&spec.auth.keyPath)argv.push("-i",spec.auth.keyPath);return argv.push(`${spec.user}@${spec.host}`),argv}function spawnCollect(argv,opts={}){return new Promise((resolve)=>{let[cmd,...rest]=argv,stdout="",stderr="",settled=!1,finish=(exitCode)=>{if(settled)return;settled=!0,resolve({stdout,stderr,exitCode})},child;try{child=spawn(cmd??"",rest,{cwd:opts.cwd,env:opts.env,shell:!1,signal:opts.signal})}catch{finish(-1);return}child.stdout?.setEncoding("utf8"),child.stdout?.on("data",(d)=>{stdout+=d}),child.stderr?.setEncoding("utf8"),child.stderr?.on("data",(d)=>{stderr+=d}),child.on("error",()=>finish(-1)),child.on("close",(code)=>finish(code??-1))})}class LocalExecHost{isRemote=!1;run(argv,opts={}){return spawnCollect(argv,{cwd:opts.cwd,env:opts.env?{...process.env,...opts.env}:process.env,signal:opts.signal})}async exists(path){return existsSync(path)}async mkdirp(path){await mkdir(path,{recursive:!0})}async readFile(path){try{return await readFileAsync(path,"utf8")}catch{return null}}async readdir(path){try{return await readdirAsync(path)}catch{return[]}}wrapCommand(command){return command}ensureReady(){}}var defaultSpawner=(argv,env)=>{let[cmd,...rest]=argv,proc=spawnSync(cmd??"",rest,{env:env?{...process.env,...env}:process.env,encoding:"utf8",shell:!1});return{stdout:proc.stdout??"",stderr:proc.stderr??"",exitCode:proc.status??-1}},defaultAsyncSpawner=(argv,env,opts)=>spawnCollect(argv,{env:env?{...process.env,...env}:process.env,signal:opts?.signal});class RemoteExecHost{spec;spawn;isRemote=!0;masterUp=!1;spawnAsync;constructor(spec,spawn2=defaultSpawner,spawnAsync){this.spec=spec;this.spawn=spawn2;this.spawnAsync=spawnAsync??(this.spawn===defaultSpawner?defaultAsyncSpawner:async(argv,env)=>this.spawn(argv,env))}ensureReady(){if(this.masterUp)return;if(this.spawn([...sshConnectArgs(this.spec,{batch:!0}),"-O","check"]).exitCode===0){this.masterUp=!0;return}let base=[...sshConnectArgs(this.spec,{batch:this.spec.auth.kind!=="password"}),"-fN"];if(this.spec.auth.kind==="password"){let pw=this.spec.auth.getPassword();if(pw!=null){this.spawn(["sshpass","-e",...base],{SSHPASS:pw}),this.masterUp=!0;return}}this.spawn(base),this.masterUp=!0}async run(argv,opts={}){this.ensureReady();let command=`${remoteEnvPrefix(opts.env)}${shJoin(argv)}`,remote=opts.cwd?`cd ${shQuote(opts.cwd)} && ${command}`:command,result=await this.spawnAsync([...sshConnectArgs(this.spec,{batch:!0}),remote],void 0,{signal:opts.signal});if(result.exitCode===255)this.masterUp=!1;return result}async exists(path){return(await this.run(["test","-e",path])).exitCode===0}async mkdirp(path){await this.run(["mkdir","-p",path])}async readFile(path){let r=await this.run(["cat",path]);return r.exitCode===0?r.stdout:null}async readdir(path){let r=await this.run(["ls","-1A",path]);if(r.exitCode!==0)return[];return r.stdout.split(`
|
|
3
|
-
`).filter((s)=>s.length>0)}wrapCommand(command,opts={}){let remote=opts.cwd?`cd ${shQuote(opts.cwd)} && ${command}`:command;return`${sshConnectArgs(this.spec,{tty:opts.tty}).map(shToken).join(" ")} ${shQuote(remote)}`}}import{spawnSync as spawnSync2}from"child_process";import{platform}from"os";var defaultDeps={run(argv){let[cmd,...rest]=argv,proc=spawnSync2(cmd??"",rest,{encoding:"utf8",shell:!1});return{stdout:proc.stdout??"",exitCode:proc.status??-1}},platform(){return platform()}},KOBE_KEYCHAIN_SERVICE="kobe-remote-ssh";function remoteKeychainRef(host,user,port){return{service:KOBE_KEYCHAIN_SERVICE,account:port?`${user}@${host}:${port}`:`${user}@${host}`}}function isKeychainSupported(deps=defaultDeps){return deps.platform()==="darwin"}function setKeychainPassword(ref,password,deps=defaultDeps){if(deps.platform()!=="darwin")return!1;let{exitCode}=deps.run(["security","add-generic-password","-U","-s",ref.service,"-a",ref.account,"-w",password]);return exitCode===0}function getKeychainPassword(ref,deps=defaultDeps){if(deps.platform()!=="darwin")return null;let{stdout,exitCode}=deps.run(["security","find-generic-password","-s",ref.service,"-a",ref.account,"-w"]);if(exitCode!==0)return null;return stdout.replace(/\n$/,"")}
|
|
4
|
-
export{LocalExecHost,RemoteExecHost,remoteKeychainRef,isKeychainSupported,setKeychainPassword,getKeychainPassword};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{connectIfRunning,connectOrStartDaemon}from"./chunk-5bn91n19.js";async function openDaemonSession(opts={}){let client=opts.mode==="require-running"?await connectIfRunning():await connectOrStartDaemon();if(!client)return null;return{client,close:()=>client.close()}}async function withDaemonSession(work,opts={}){let session=await openDaemonSession(opts);try{return await work(session?.client??null)}finally{session?.close()}}async function resolveActiveTaskId(client){let activeId=null,off=client.onChannel("active-task",(payload)=>{activeId=payload.taskId});try{await client.subscribe()}finally{off()}return activeId}
|
|
3
|
-
export{openDaemonSession,withDaemonSession,resolveActiveTaskId};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{GitWorktreeManager}from"./chunk-98thhbm5.js";import"./chunk-2cyzv75r.js";import"./chunk-6xppe9bj.js";import"./chunk-7zmrn4gn.js";import"./chunk-1kktfmtg.js";import"./chunk-2fypr41w.js";import"./chunk-87y9qjcm.js";import"./chunk-m57cv76y.js";import"./chunk-a3a9gdc4.js";import"./chunk-9c1e5z6a.js";import"./chunk-6dn6h640.js";import"./chunk-cb2fpajx.js";import"./chunk-3bfm4hrs.js";import"./chunk-wqfp8d9w.js";export{GitWorktreeManager};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{execHostForRepo}from"./chunk-7zmrn4gn.js";import{getRemoteRepoConfig,isRemoteRepoKey}from"./chunk-87y9qjcm.js";import{loadStateFile}from"./chunk-m57cv76y.js";import{homeDir,legacyKobeStateDir,roveStateDir}from"./chunk-6dn6h640.js";import{createHash}from"crypto";import fs from"fs";import path from"path";import{isAbsolute,join,resolve}from"path";var WORKTREE_BASE_KEY="worktree.basePath",WORKTREE_BASE_CUSTOM_KEY="worktree.basePath.custom",PROJECT_DIR_TOKEN="$project_dir",PROJECT_SIBLING_BASE=`${PROJECT_DIR_TOKEN}/..`;function worktreeBaseKindOf(raw){let trimmed=raw.trim();if(!trimmed)return"default";if(trimmed.replace(/\/+$/,"")===PROJECT_SIBLING_BASE)return"nextToProject";return"custom"}function hasProjectDirToken(raw){let trimmed=raw.trim();return trimmed===PROJECT_DIR_TOKEN||trimmed.startsWith(`${PROJECT_DIR_TOKEN}/`)}function normalizeWorktreeBase(raw,projectDir){if(typeof raw!=="string")return null;let trimmed=raw.trim();if(!trimmed)return null;if(hasProjectDirToken(trimmed)){if(!projectDir)return null;let rest=trimmed.slice(PROJECT_DIR_TOKEN.length).replace(/^\/+/,"");return resolve(projectDir,rest)}let home=homeDir();if(trimmed==="~")return home;let expanded=trimmed.startsWith("~/")?join(home,trimmed.slice(2)):trimmed;return isAbsolute(expanded)?expanded:resolve(home,expanded)}function getWorktreeBaseOverride(projectDir){let value=loadStateFile()[WORKTREE_BASE_KEY];return normalizeWorktreeBase(typeof value==="string"?value:null,projectDir)}var KOBE_WORKTREE_ROOT_DIR="worktrees",REPO_LOCAL_ROVE_WORKTREE_ROOT_SUBPATH=".rove/worktrees",REPO_LOCAL_KOBE_WORKTREE_ROOT_SUBPATH=".kobe/worktrees",LEGACY_KOBE_WORKTREE_ROOT_SUBPATH=".claude/worktrees",REPO_LOCAL_KOBE_MANAGED_WORKTREE_ROOT_SUBPATHS=[REPO_LOCAL_ROVE_WORKTREE_ROOT_SUBPATH,REPO_LOCAL_KOBE_WORKTREE_ROOT_SUBPATH,LEGACY_KOBE_WORKTREE_ROOT_SUBPATH];function localWorktreesRoot(repo){return getWorktreeBaseOverride(repo)??path.join(roveStateDir(),KOBE_WORKTREE_ROOT_DIR)}function defaultLocalWorktreesRoot(){return path.join(roveStateDir(),KOBE_WORKTREE_ROOT_DIR)}function legacyLocalWorktreesRoot(){return path.join(legacyKobeStateDir(),KOBE_WORKTREE_ROOT_DIR)}function worktreeRootFor(repo){if(!path.isAbsolute(repo))throw Error(`worktreeRootFor: repo must be an absolute path, got: ${repo}`);return path.join(localWorktreesRoot(repo),repoWorktreeDirName(repo))}function managedWorktreeRootsFor(repo){if(!path.isAbsolute(repo))throw Error(`managedWorktreeRootsFor: repo must be an absolute path, got: ${repo}`);let active=worktreeRootFor(repo),fallback=path.join(defaultLocalWorktreesRoot(),repoWorktreeDirName(repo)),legacy=path.join(legacyLocalWorktreesRoot(),repoWorktreeDirName(repo));return[...new Set([...[active,fallback,legacy],...REPO_LOCAL_KOBE_MANAGED_WORKTREE_ROOT_SUBPATHS.map((subpath)=>path.join(repo,subpath))])]}function worktreePathFor(repo,slug){if(!slug||/[/\\\0]/.test(slug))throw Error(`worktreePathFor: invalid slug: ${JSON.stringify(slug)}`);return path.join(worktreeRootFor(repo),slug)}async function listWorktreeDirNames(repo){if(isRemoteRepoKey(repo)){let basePath=getRemoteRepoConfig(repo)?.basePath;if(!basePath)return[];let names2=new Set,host=execHostForRepo(repo),entries=await Promise.all(remoteManagedWorktreeRootsFor(basePath).map((root)=>host.readdir(root)));for(let list of entries)for(let name of list)names2.add(name);return[...names2]}let names=new Set;for(let root of managedWorktreeRootsFor(repo))try{for(let e of fs.readdirSync(root,{withFileTypes:!0}))if(e.isDirectory())names.add(e.name)}catch{}return[...names]}function managedWorktreeRootForPath(repo,candidate){if(!path.isAbsolute(repo)||!path.isAbsolute(candidate))return null;let target=canonicalize(candidate);for(let rootPath of managedWorktreeRootsFor(repo)){let root=canonicalize(rootPath),rel=path.relative(root,target);if(rel!==""&&!rel.startsWith("..")&&!path.isAbsolute(rel))return rootPath}return null}function isKobeManagedPath(repo,candidate){return managedWorktreeRootForPath(repo,candidate)!==null}function isUnderManagedWorktreesRoot(candidate,projectDir){if(!path.isAbsolute(candidate))return!1;let target=canonicalize(candidate),roots=[getWorktreeBaseOverride(projectDir)??"",defaultLocalWorktreesRoot(),legacyLocalWorktreesRoot()];for(let rootPath of roots){if(!rootPath)continue;let root=canonicalize(rootPath),rel=path.relative(root,target);if(rel.startsWith("..")||path.isAbsolute(rel))continue;if(rel.split(path.sep).filter(Boolean).length===2)return!0}return!1}function remoteWorktreeRootFor(basePath){return`${stripTrailingSlash(basePath)}/.rove/worktrees`}function remoteManagedWorktreeRootsFor(basePath){let base=stripTrailingSlash(basePath);return[`${base}/.rove/worktrees`,`${base}/.kobe/worktrees`]}function remoteWorktreePathFor(basePath,slug){if(!slug||/[/\\\0]/.test(slug))throw Error(`remoteWorktreePathFor: invalid slug: ${JSON.stringify(slug)}`);return`${remoteWorktreeRootFor(basePath)}/${slug}`}function remoteManagedRootForPath(basePath,candidate){for(let root of remoteManagedWorktreeRootsFor(basePath))if(candidate===root||candidate.startsWith(`${root}/`))return root;return null}function stripTrailingSlash(p){return p.length>1&&p.endsWith("/")?p.replace(/\/+$/,""):p}function requireAbsolute(name,value){if(!value||!path.isAbsolute(value))throw Error(`${name} must be an absolute path, got: ${JSON.stringify(value)}`)}function canonicalize(p){try{return fs.realpathSync(p)}catch{return path.resolve(p)}}function repoWorktreeDirName(repo){let safeBase=(path.basename(repo)||"repo").replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"repo",hash=createHash("sha1").update(path.resolve(repo)).digest("hex").slice(0,12);return`${safeBase}-${hash}`}
|
|
3
|
-
export{WORKTREE_BASE_KEY,WORKTREE_BASE_CUSTOM_KEY,PROJECT_DIR_TOKEN,PROJECT_SIBLING_BASE,worktreeBaseKindOf,hasProjectDirToken,normalizeWorktreeBase,worktreePathFor,listWorktreeDirNames,managedWorktreeRootForPath,isKobeManagedPath,isUnderManagedWorktreesRoot,remoteWorktreePathFor,remoteManagedRootForPath,requireAbsolute,canonicalize};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{readLastActiveTaskId,writeLastActiveTaskId}from"./chunk-s433recg.js";import"./chunk-m57cv76y.js";import"./chunk-a3a9gdc4.js";import"./chunk-6dn6h640.js";import"./chunk-cb2fpajx.js";import"./chunk-3bfm4hrs.js";import"./chunk-wqfp8d9w.js";export{writeLastActiveTaskId,readLastActiveTaskId};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{LocalExecHost,RemoteExecHost,getKeychainPassword}from"./chunk-1kktfmtg.js";import{getRemoteRepoConfig,getRemoteRepos,isRemoteRepoKey}from"./chunk-87y9qjcm.js";import{remoteControlSocketPath}from"./chunk-6dn6h640.js";function remoteSpecFromConfig(config){let cfgAuth=config.auth,auth=cfgAuth.kind==="key"?{kind:"key",keyPath:cfgAuth.keyPath}:{kind:"password",getPassword:()=>getKeychainPassword(cfgAuth.keychainRef)};return{host:config.host,user:config.user,port:config.port,auth,controlPath:remoteControlSocketPath(config.host,config.user,config.port)}}var remoteHostCache=new Map;function cachedRemoteHost(config){let spec=remoteSpecFromConfig(config),cached=remoteHostCache.get(spec.controlPath);if(cached)return cached;let host=new RemoteExecHost(spec);return remoteHostCache.set(spec.controlPath,host),host}function execHostForRepo(repoKey){let config=getRemoteRepoConfig(repoKey);if(!config)return new LocalExecHost;return cachedRemoteHost(config)}function execHostForWorktreePath(worktreePath){for(let config of Object.values(getRemoteRepos()))if(worktreePath===config.basePath||worktreePath.startsWith(`${config.basePath}/`))return cachedRemoteHost(config);return new LocalExecHost}function remoteKeyForRepo(repo){return repo&&isRemoteRepoKey(repo)?repo:void 0}
|
|
3
|
-
export{execHostForRepo,execHostForWorktreePath,remoteKeyForRepo};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{publishKobeTerminalTitle}from"./chunk-dw853n4w.js";import{ensureGlobalKobeHooks}from"./chunk-jwv06n3d.js";import"./chunk-3ry6prwn.js";import"./chunk-r2pztgm6.js";import{enforceResetGate}from"./chunk-jy6nd23p.js";import{maybeHintSkillInstall}from"./chunk-579zz8df.js";import"./chunk-d393z1mj.js";import"./chunk-gtkejmxx.js";import"./chunk-jvxh93nz.js";import"./chunk-5bn91n19.js";import"./chunk-pdh5w4ht.js";import"./chunk-4wwx51m5.js";import"./chunk-79gqh5p2.js";import"./chunk-3ztek08w.js";import"./chunk-kwe61yx7.js";import"./chunk-e7t4xpr9.js";import"./chunk-n4dmwkfa.js";import"./chunk-w7zv47mp.js";import"./chunk-gwcneg6c.js";import"./chunk-m370e00b.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-87y9qjcm.js";import"./chunk-m57cv76y.js";import"./chunk-dmdqnet6.js";import"./chunk-xy8be792.js";import"./chunk-a3a9gdc4.js";import"./chunk-2brn8e1y.js";import"./chunk-9c1e5z6a.js";import"./chunk-6dn6h640.js";import"./chunk-h82kzdsn.js";import"./chunk-ef11h2am.js";import"./chunk-8ddjfc2v.js";import"./chunk-cb2fpajx.js";import"./chunk-grh6dvfv.js";import"./chunk-pw6yfj10.js";import"./chunk-x760j10f.js";import"./chunk-3bfm4hrs.js";import{__require}from"./chunk-wqfp8d9w.js";async function startTui(){enforceResetGate(),publishKobeTerminalTitle(),await maybeHintSkillInstall(),await ensureGlobalKobeHooks();let{loadPluginEngines}=await import("./chunk-cexxmfva.js");loadPluginEngines();let{startWorkspaceHost}=await import("./chunk-k1sjc72d.js");await startWorkspaceHost()}export{startTui};
|
|
@@ -1,2 +0,0 @@
|
|
|
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-t05pnk6y.js";import"./chunk-y5hnrx8d.js";import"./chunk-xnr8dga2.js";import"./chunk-hape5vwj.js";import"./chunk-7zmrn4gn.js";import"./chunk-1kktfmtg.js";import"./chunk-e8493db0.js";import"./chunk-gzf4dfg6.js";import"./chunk-jvxh93nz.js";import"./chunk-7q67dz4c.js";import"./chunk-1cjd7h8p.js";import"./chunk-b99tf0jr.js";import"./chunk-s8xyh1bt.js";import"./chunk-zaxdx0wd.js";import"./chunk-sexavazm.js";import"./chunk-sdyzxayr.js";import"./chunk-0sm2k04y.js";import"./chunk-5bn91n19.js";import"./chunk-pdh5w4ht.js";import"./chunk-4wwx51m5.js";import"./chunk-79gqh5p2.js";import"./chunk-3ztek08w.js";import"./chunk-kwe61yx7.js";import"./chunk-x3gch5nw.js";import"./chunk-e7t4xpr9.js";import"./chunk-n4dmwkfa.js";import"./chunk-w7zv47mp.js";import"./chunk-gwcneg6c.js";import"./chunk-m370e00b.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-87y9qjcm.js";import"./chunk-m57cv76y.js";import"./chunk-dmdqnet6.js";import"./chunk-xy8be792.js";import"./chunk-a3a9gdc4.js";import"./chunk-2brn8e1y.js";import"./chunk-9c1e5z6a.js";import"./chunk-6dn6h640.js";import"./chunk-h82kzdsn.js";import"./chunk-ef11h2am.js";import"./chunk-8ddjfc2v.js";import"./chunk-cb2fpajx.js";import"./chunk-grh6dvfv.js";import"./chunk-pw6yfj10.js";import"./chunk-x760j10f.js";import"./chunk-3bfm4hrs.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 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{canonicalize}from"./chunk-2cyzv75r.js";import{applyJitter,exponentialBackoff}from"./chunk-gwcneg6c.js";import{getRemoteRepoConfig,isRemoteRepoKey,resolveRepoRoot}from"./chunk-87y9qjcm.js";var canonPath=canonicalize;function randomDirTaskSuffix(){return Math.random().toString(36).slice(2,6).padEnd(4,"0")}function titleFromRepo(repo){let segs=repo.split(/[/\\]/).filter(Boolean);return segs.length>0?segs[segs.length-1]??repo:repo}function normalizeMainRepo(repo){let normalized=resolveRepoRoot(repo);return{repo:normalized,key:isRemoteRepoKey(normalized)?normalized:canonPath(normalized)}}function repoWorkingDir(repo){return getRemoteRepoConfig(repo)?.basePath??repo}var GH_PR_VIEW_FIELDS="number,url,title,state,baseRefName,headRefName,reviewDecision,mergeable,statusCheckRollup";function lifecycleFromState(state,reviewDecision){switch((state??"").toUpperCase()){case"MERGED":return"merged";case"CLOSED":return"closed";case"OPEN":return(reviewDecision??"").toUpperCase()==="APPROVED"?"ready_to_merge":"open";default:return"unknown"}}function entryCheckState(entry){let status=(entry.status??"").toUpperCase(),conclusion=(entry.conclusion??"").toUpperCase(),contextState=(entry.state??"").toUpperCase();if(status&&status!=="COMPLETED")return"pending";if(conclusion){if(conclusion==="SUCCESS"||conclusion==="NEUTRAL"||conclusion==="SKIPPED")return"passing";return"failing"}if(contextState==="SUCCESS")return"passing";if(contextState==="PENDING"||contextState==="EXPECTED")return"pending";if(contextState==="FAILURE"||contextState==="ERROR")return"failing";return"unknown"}function checkStateFromRollup(rollup){if(!rollup||rollup.length===0)return"none";let sawPending=!1,sawPassing=!1;for(let entry of rollup){let s=entryCheckState(entry);if(s==="failing")return"failing";if(s==="pending")sawPending=!0;else if(s==="passing")sawPassing=!0}if(sawPending)return"pending";if(sawPassing)return"passing";return"unknown"}function mapGhPrView(view,at){if(!view||typeof view.number!=="number")return null;return{provider:"github",lifecycle:lifecycleFromState(view.state,view.reviewDecision),checkState:checkStateFromRollup(view.statusCheckRollup),number:view.number,url:view.url,title:view.title,baseRef:view.baseRefName,headRef:view.headRefName,reviewDecision:view.reviewDecision||void 0,mergeable:view.mergeable||void 0,lastCheckedAt:at}}function samePrStatus(a,b){if(a===b)return!0;if(!a||!b)return!1;return a.provider===b.provider&&a.lifecycle===b.lifecycle&&a.checkState===b.checkState&&a.number===b.number&&a.url===b.url&&a.title===b.title&&a.baseRef===b.baseRef&&a.headRef===b.headRef&&a.reviewDecision===b.reviewDecision&&a.mergeable===b.mergeable}var NO_REMOTE_PATTERNS=["none of the git remotes","no git remote","to use github cli in a github repository","not a github repository"],AUTH_PATTERNS=["gh auth login","authentication required","not logged in","http 401","bad credentials","requires authentication"],NETWORK_PATTERNS=["could not resolve host","no such host","dial tcp","connection refused","connection reset","network is unreachable","i/o timeout","timeout","tls handshake","http 5","rate limit","try again"];function matchesAny(haystack,needles){return needles.some((n)=>haystack.includes(n))}function classifyGhFailure(s){if(s.parseError)return{kind:"error",error:"parse"};if(s.timedOut)return{kind:"error",error:"timeout"};if(s.spawnError)return{kind:"error",error:"missing-binary"};let err=(s.stderr??"").toLowerCase();if(matchesAny(err,NO_REMOTE_PATTERNS))return{kind:"error",error:"no-remote"};if(matchesAny(err,AUTH_PATTERNS))return{kind:"error",error:"auth"};if(matchesAny(err,NETWORK_PATTERNS))return{kind:"error",error:"network"};return{kind:"error",error:"unknown"}}function nextPrPoll(outcome,prevFailures,now,cfg,rand=Math.random){let at=(delay)=>now+applyJitter(delay,cfg.jitterRatio,rand);if(outcome.kind==="pr")return{nextAllowedAt:at(outcome.settled?cfg.settledMs:cfg.tickMs),failures:0};if(outcome.kind==="empty")return{nextAllowedAt:at(cfg.noPrMs),failures:0};if(outcome.error==="no-remote")return{nextAllowedAt:at(cfg.noRemoteMs),failures:0};let failures=prevFailures+1;return{nextAllowedAt:at(exponentialBackoff(cfg.failureBaseMs,failures-1,cfg.failureCapMs)),failures}}function checkResolutionNotify(prev,next){if(prev!=="pending")return null;if(next==="passing"||next==="failing")return next;return null}
|
|
3
|
-
export{GH_PR_VIEW_FIELDS,mapGhPrView,samePrStatus,classifyGhFailure,nextPrPoll,checkResolutionNotify,canonPath,randomDirTaskSuffix,titleFromRepo,normalizeMainRepo,repoWorkingDir};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{openDaemonSession,resolveActiveTaskId,withDaemonSession}from"./chunk-1rkb0j1j.js";import"./chunk-5bn91n19.js";import"./chunk-pdh5w4ht.js";import"./chunk-4wwx51m5.js";import"./chunk-79gqh5p2.js";import"./chunk-3ztek08w.js";import"./chunk-kwe61yx7.js";import"./chunk-grh6dvfv.js";import"./chunk-pw6yfj10.js";import"./chunk-x760j10f.js";import"./chunk-3bfm4hrs.js";import"./chunk-wqfp8d9w.js";export{withDaemonSession,resolveActiveTaskId,openDaemonSession};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ensurePluginEnginesLoaded,loadPluginEngines,registeredEngineIds,reloadPluginEngines}from"./chunk-9nbg0nzh.js";import"./chunk-d393z1mj.js";import"./chunk-kwe61yx7.js";import"./chunk-n4dmwkfa.js";import"./chunk-w7zv47mp.js";import"./chunk-7jkf3tvr.js";import"./chunk-87y9qjcm.js";import"./chunk-m57cv76y.js";import"./chunk-a3a9gdc4.js";import"./chunk-2brn8e1y.js";import"./chunk-9c1e5z6a.js";import"./chunk-6dn6h640.js";import"./chunk-cb2fpajx.js";import"./chunk-3bfm4hrs.js";import"./chunk-wqfp8d9w.js";export{reloadPluginEngines,registeredEngineIds,loadPluginEngines,ensurePluginEnginesLoaded};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{toTaskId}from"./chunk-xy8be792.js";import{LockfileError,acquire}from"./chunk-a3a9gdc4.js";import{coerceVendorId}from"./chunk-h82kzdsn.js";import{DAEMON_MIGRATION_MARKER}from"./chunk-8ddjfc2v.js";import{logClient}from"./chunk-grh6dvfv.js";import{defaultClientLogPath}from"./chunk-x760j10f.js";import{existsSync}from"fs";import{copyFile,readFile}from"fs/promises";import{dirname,join}from"path";function coerceTask(value){if(!value||typeof value!=="object")return null;let v=value;if(typeof v.id!=="string"||typeof v.title!=="string"||typeof v.repo!=="string"||typeof v.branch!=="string"||typeof v.worktreePath!=="string"||typeof v.status!=="string"||typeof v.createdAt!=="string"||typeof v.updatedAt!=="string")return null;if(!isTaskStatus(v.status))return null;let kind=v.kind==="main"?"main":v.kind==="dir"?"dir":"task",scratch=kind==="dir"&&v.scratch===!0,healedStatus=kind==="main"&&(v.status==="in_progress"||v.status==="done")?"backlog":v.status,deletion=coerceDeletion(v.deletion),quotaResume=coerceQuotaResume(v.quotaResume),linkedWorkItem=coerceLinkedWorkItem(v.linkedWorkItem),dispatcher=coerceDispatcher(v.dispatcher),routine=coerceRoutine(v.routine);return{id:toTaskId(v.id),title:v.title,repo:v.repo,branch:v.branch,worktreePath:v.worktreePath,status:healedStatus,pinned:typeof v.pinned==="boolean"?v.pinned:!1,kind,...scratch?{scratch:!0}:{},...routine?{routine}:{},vendor:coerceVendorId(typeof v.vendor==="string"?v.vendor:void 0),...typeof v.command==="string"&&v.command.trim().length>0?{command:v.command}:{},prStatus:coercePRStatus(v.prStatus),...typeof v.modelEffort==="string"&&v.modelEffort.length>0?{modelEffort:v.modelEffort}:{},...typeof v.groupId==="string"&&v.groupId.length>0?{groupId:v.groupId}:{},...v.observedLanguage==="zh"||v.observedLanguage==="en"?{observedLanguage:v.observedLanguage}:{},...deletion?{deletion}:{},...quotaResume?{quotaResume}:{},...linkedWorkItem?{linkedWorkItem}:{},...dispatcher?{dispatcher}:{},...typeof v.prompt==="string"&&v.prompt.length>0?{prompt:v.prompt}:{},...typeof v.baseRef==="string"&&v.baseRef.trim().length>0?{baseRef:v.baseRef}:{},createdAt:v.createdAt,updatedAt:v.updatedAt}}function coerceDispatcher(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.taskId!=="string"||v.taskId.length===0)return;if(typeof v.tabId!=="string"||v.tabId.length===0)return;return{taskId:v.taskId,tabId:v.tabId}}function coerceRoutine(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.automationId!=="string"||v.automationId.length===0)return;return{automationId:v.automationId}}function coerceQuotaResume(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.resumeAt!=="string"||v.resumeAt.length===0)return;if(typeof v.requestedAt!=="string"||v.requestedAt.length===0)return;return{resumeAt:v.resumeAt,requestedAt:v.requestedAt}}function coerceLinkedWorkItem(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(v.provider!=="github")return;if(v.type!=="issue"&&v.type!=="pr")return;if(typeof v.number!=="number"||!Number.isFinite(v.number))return;if(typeof v.title!=="string"||typeof v.url!=="string"||v.url.length===0)return;return{provider:v.provider,type:v.type,number:v.number,title:v.title,url:v.url}}function coerceDeletion(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(v.phase!=="queued"&&v.phase!=="running"&&v.phase!=="error"||typeof v.force!=="boolean"||typeof v.requestedAt!=="string"||v.requestedAt.length===0||v.error!==void 0&&typeof v.error!=="string")return;return{phase:v.phase,force:v.force,...typeof v.deleteBranch==="boolean"?{deleteBranch:v.deleteBranch}:{},requestedAt:v.requestedAt,...typeof v.error==="string"?{error:v.error}:{}}}function coercePRStatus(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(!isPRProviderId(v.provider)||!isPRLifecycleState(v.lifecycle)||!isPRCheckState(v.checkState))return;return{provider:v.provider,lifecycle:v.lifecycle,checkState:v.checkState,...typeof v.number==="number"&&Number.isFinite(v.number)?{number:v.number}:{},...typeof v.url==="string"?{url:v.url}:{},...typeof v.title==="string"?{title:v.title}:{},...typeof v.baseRef==="string"?{baseRef:v.baseRef}:{},...typeof v.headRef==="string"?{headRef:v.headRef}:{},...typeof v.reviewDecision==="string"?{reviewDecision:v.reviewDecision}:{},...typeof v.mergeable==="string"?{mergeable:v.mergeable}:{},...typeof v.lastCheckedAt==="string"?{lastCheckedAt:v.lastCheckedAt}:{},...typeof v.lastError==="string"?{lastError:v.lastError}:{}}}function isPRProviderId(v){return v==="github"||v==="gitlab"||v==="bitbucket"||v==="unknown"}function isPRLifecycleState(v){return v==="creating"||v==="open"||v==="ready_to_merge"||v==="merged"||v==="closed"||v==="unknown"}function isPRCheckState(v){return v==="none"||v==="pending"||v==="passing"||v==="failing"||v==="unknown"}function isTaskStatus(s){return s==="backlog"||s==="in_progress"||s==="in_review"||s==="done"||s==="canceled"||s==="error"}var sleep=(ms)=>new Promise((resolve)=>setTimeout(resolve,ms)),LOCK_RETRY_DELAY_MS=25,LOCK_MAX_WAIT_MS=5000;async function acquireWithRetry(lockPath){let deadline=Date.now()+LOCK_MAX_WAIT_MS;for(;;)try{return await acquire(lockPath)}catch(err){if(!(err instanceof LockfileError)||Date.now()>=deadline)throw err;await sleep(LOCK_RETRY_DELAY_MS)}}var CURRENT_VERSION=3;async function backupCorruptManifest(path,now=()=>new Date){let backupPath=`${path}.corrupt-${now().toISOString().replaceAll(":","-")}`;try{return await copyFile(path,backupPath),backupPath}catch{return null}}var SUPPORTED_VERSIONS=new Set([1,2,3]);function warnManifestRecovery(message,manifestPath){console.warn(message),logClient("tasks-index",message,manifestPath?defaultClientLogPath(dirname(dirname(manifestPath))):void 0)}async function recoverUnsupportedVersion(parsed,sourcePath){if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return!1;let version=parsed.version;if(version===void 0||SUPPORTED_VERSIONS.has(version))return!1;let backup=await backupCorruptManifest(sourcePath);return warnManifestRecovery(`[rove] tasks.json at ${sourcePath} has unsupported version=${String(version)}; recovering with empty index.${backup?` Original bytes backed up to ${backup}.`:" Backup copy failed; the stale file is left in place."}`,sourcePath),!0}function normalizeIndex(parsed,source){if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return warnManifestRecovery(`[rove] tasks.json at ${source} is not an object; recovering with empty index.`,source),{version:CURRENT_VERSION,tasks:[]};let obj=parsed,version=obj.version;if(version!==void 0&&!SUPPORTED_VERSIONS.has(version))return warnManifestRecovery(`[rove] tasks.json at ${source} has unsupported version=${String(version)}; recovering with empty index.`,source),{version:CURRENT_VERSION,tasks:[]};let rawTasks=Array.isArray(obj.tasks)?obj.tasks:[],tasks=[];for(let entry of rawTasks){let task=coerceTask(entry);if(task)tasks.push(task);else console.warn(`[rove] dropping malformed task entry from ${source}: ${JSON.stringify(entry)}`)}return{version:CURRENT_VERSION,tasks}}var TOMBSTONE_TTL_MS=2592000000;function readableLegacyIndexPath(canonicalPath,legacyPath){return existsSync(join(dirname(canonicalPath),DAEMON_MIGRATION_MARKER))?void 0:legacyPath}async function readDiskIndex(path,legacyPath){let raw,sourcePath=path;try{raw=await readFile(sourcePath,"utf8")}catch(err){if(err.code!=="ENOENT")throw err;let legacy=readableLegacyIndexPath(path,legacyPath);if(!legacy)return{tasks:[],removed:[]};sourcePath=legacy;try{raw=await readFile(sourcePath,"utf8")}catch(legacyErr){if(legacyErr.code==="ENOENT")return{tasks:[],removed:[]};throw legacyErr}}let parsed;try{parsed=JSON.parse(raw)}catch{return await backupCorruptManifest(sourcePath),{tasks:[],removed:[]}}if(await recoverUnsupportedVersion(parsed,sourcePath))return{tasks:[],removed:[]};return{tasks:normalizeIndex(parsed,sourcePath).tasks,removed:coerceTombstones(parsed)}}function coerceTombstones(parsed){if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return[];let raw=parsed.removed;if(!Array.isArray(raw))return[];let out=[];for(let entry of raw){if(!entry||typeof entry!=="object")continue;let v=entry;if(typeof v.id==="string"&&v.id.length>0&&typeof v.at==="string")out.push({id:v.id,at:v.at})}return out}function mergeTasksWithDisk(cacheTasks,diskTasks,dirty,removed,diskRemoved=[],now=Date.now()){let tombstones=new Map;for(let t of diskRemoved){let at=Date.parse(t.at);if(!Number.isFinite(at)||now-at>TOMBSTONE_TTL_MS)continue;tombstones.set(t.id,t.at)}for(let[id,at]of removed)tombstones.set(id,at);let diskById=new Map(diskTasks.map((t)=>[t.id,t])),result=[],included=new Set;for(let task of cacheTasks){if(tombstones.has(task.id))continue;if(dirty.has(task.id))result.push(task);else{let onDisk=diskById.get(task.id);if(onDisk===void 0)continue;result.push(onDisk)}included.add(task.id)}for(let task of diskTasks){if(included.has(task.id)||tombstones.has(task.id))continue;result.push(task),included.add(task.id)}return{tasks:result,removed:[...tombstones].map(([id,at])=>({id,at}))}}async function recoverIndexFromDisk(path,legacyPath){let raw,sourcePath=path;try{raw=await readFile(path,"utf8")}catch(err){if(err.code!=="ENOENT")throw err;let legacy=readableLegacyIndexPath(path,legacyPath),legacyRaw;if(legacy)try{legacyRaw=await readFile(legacy,"utf8"),sourcePath=legacy}catch(legacyErr){if(legacyErr.code!=="ENOENT")throw legacyErr}if(legacyRaw===void 0)return{version:CURRENT_VERSION,tasks:[]};raw=legacyRaw}let parsed;try{parsed=JSON.parse(raw)}catch(err){let backup=await backupCorruptManifest(sourcePath);return warnManifestRecovery(`[rove] tasks.json at ${sourcePath} is corrupted (${err.message}); recovering with empty index.${backup?` Original bytes backed up to ${backup}.`:" Backup copy failed; the stale file is left in place."}`,sourcePath),{version:CURRENT_VERSION,tasks:[]}}if(await recoverUnsupportedVersion(parsed,sourcePath))return{version:CURRENT_VERSION,tasks:[]};return normalizeIndex(parsed,sourcePath)}
|
|
3
|
-
export{acquireWithRetry,readableLegacyIndexPath,readDiskIndex,mergeTasksWithDisk,recoverIndexFromDisk};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{applyOnboardingChoices,detectShell,envReadyForTasks,installCompletions,maybeRunOnboarding}from"./chunk-p9vkwnb8.js";import"./chunk-yfg503fr.js";import"./chunk-x39pv7rx.js";import"./chunk-jy6nd23p.js";import"./chunk-579zz8df.js";import"./chunk-gtkejmxx.js";import"./chunk-gzf4dfg6.js";import"./chunk-jvxh93nz.js";import"./chunk-zaxdx0wd.js";import"./chunk-sexavazm.js";import"./chunk-sdyzxayr.js";import"./chunk-x3gch5nw.js";import"./chunk-e7t4xpr9.js";import"./chunk-n4dmwkfa.js";import"./chunk-w7zv47mp.js";import"./chunk-gwcneg6c.js";import"./chunk-m370e00b.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-87y9qjcm.js";import"./chunk-m57cv76y.js";import"./chunk-dmdqnet6.js";import"./chunk-xy8be792.js";import"./chunk-a3a9gdc4.js";import"./chunk-2brn8e1y.js";import"./chunk-9c1e5z6a.js";import"./chunk-6dn6h640.js";import"./chunk-h82kzdsn.js";import"./chunk-ef11h2am.js";import"./chunk-8ddjfc2v.js";import"./chunk-cb2fpajx.js";import"./chunk-grh6dvfv.js";import"./chunk-pw6yfj10.js";import"./chunk-x760j10f.js";import"./chunk-3bfm4hrs.js";import"./chunk-wqfp8d9w.js";export{maybeRunOnboarding,installCompletions,envReadyForTasks,detectShell,applyOnboardingChoices};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{vendorFromArgv}from"./chunk-x3gch5nw.js";import{engineEntry}from"./chunk-e7t4xpr9.js";import{isContribEngine}from"./chunk-n4dmwkfa.js";import{roveCliInvocation}from"./chunk-m370e00b.js";import{getCustomEngineIds,getPersistedString}from"./chunk-87y9qjcm.js";import{BUILTIN_VENDORS,coerceVendorId,isBuiltinVendor}from"./chunk-h82kzdsn.js";function engineCommandKey(vendor){return`engineCommand.${vendor}`}function engineNameKey(vendor){return`engineName.${vendor}`}function engineDisplayName(vendor){return getPersistedString(engineNameKey(vendor))?.trim()||engineEntry(vendor).displayName}function humanizeSlug(id){return id.split(/[-_]+/).filter((word)=>word.length>0).map((word)=>word.charAt(0).toUpperCase()+word.slice(1)).join(" ")}function defaultEngineCommand(vendor){return engineEntry(coerceVendorId(vendor)).defaultCommand}function parseEngineCommand(command){let out=[],token="",hasToken=!1,quote=null;for(let ch of command){if(quote){if(ch===quote)quote=null;else token+=ch;continue}if(ch==='"'||ch==="'"){quote=ch,hasToken=!0;continue}if(/\s/.test(ch)){if(hasToken)out.push(token),token="",hasToken=!1;continue}token+=ch,hasToken=!0}if(hasToken)out.push(token);return out}function interactiveEngineCommand(vendor,effort){let v=coerceVendorId(vendor),override=getPersistedString(engineCommandKey(v))?.trim(),base=(()=>{if(override){let argv=parseEngineCommand(override);if(argv.length>0)return argv}return defaultEngineCommand(v)})();return withEngineTerminalTitle(withEngineEffort(base,v,effort),v)}function withEngineTerminalTitle(argv,vendor){let args=engineEntry(coerceVendorId(vendor)).terminalTitle?.launchArgs;return args&&args.length>0?[...argv,...args]:argv}function withEngineEffort(argv,vendor,effort){let trimmed=effort?.trim();if(!trimmed)return argv;let entry=engineEntry(coerceVendorId(vendor));if(!entry.effortLevels?.includes(trimmed))return argv;return entry.effortArgv?.(argv,trimmed)??argv}function kobeApiInvocation(){let quote=(a)=>/^[A-Za-z0-9_/.:=-]+$/.test(a)?a:`'${a.replace(/'/g,"'\\''")}'`;try{return[...roveCliInvocation(),"api"].map(quote).join(" ")}catch{return"rove api"}}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
|
-
export{engineCommandKey,engineNameKey,engineDisplayName,humanizeSlug,defaultEngineCommand,interactiveEngineCommand,kobeApiInvocation,pickUnclaimedSessionId,GENERIC_PROTOCOL,ENGINE_PROTOCOLS,engineProtocolKey,getEngineProtocol,listPresetIds,describePreset,listEnginePresets,resolveCommandProtocol,engineLaunchArgv,sessionProtocol,protocolEntry,withPinnedSessionId,engineResumeArgv,engineCanFork,engineForkArgv};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{envReadyForTasks}from"./chunk-p9vkwnb8.js";import{wizardKeyLines}from"./chunk-3zf7mr7r.js";import"./chunk-yfg503fr.js";import"./chunk-x39pv7rx.js";import"./chunk-jy6nd23p.js";import"./chunk-579zz8df.js";import{$Fragment,$jsx,$jsxs,bootPaneHost,currentPrefixConfiguration,pageCloseBindings,require_react_production,useBindings,useRenderer,useT,useTheme}from"./chunk-rz8247zr.js";import"./chunk-764bsyb0.js";import"./chunk-mjvq39gf.js";import"./chunk-6xppe9bj.js";import"./chunk-gtkejmxx.js";import"./chunk-gzf4dfg6.js";import"./chunk-jvxh93nz.js";import"./chunk-s8xyh1bt.js";import"./chunk-zaxdx0wd.js";import"./chunk-sexavazm.js";import"./chunk-sdyzxayr.js";import"./chunk-0sm2k04y.js";import"./chunk-5bn91n19.js";import"./chunk-pdh5w4ht.js";import"./chunk-4wwx51m5.js";import"./chunk-79gqh5p2.js";import"./chunk-3ztek08w.js";import"./chunk-kwe61yx7.js";import"./chunk-x3gch5nw.js";import"./chunk-e7t4xpr9.js";import"./chunk-n4dmwkfa.js";import"./chunk-w7zv47mp.js";import"./chunk-gwcneg6c.js";import"./chunk-m370e00b.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-87y9qjcm.js";import"./chunk-m57cv76y.js";import"./chunk-dmdqnet6.js";import"./chunk-xy8be792.js";import"./chunk-a3a9gdc4.js";import"./chunk-2brn8e1y.js";import"./chunk-9c1e5z6a.js";import"./chunk-6dn6h640.js";import"./chunk-h82kzdsn.js";import"./chunk-ef11h2am.js";import"./chunk-8ddjfc2v.js";import"./chunk-cb2fpajx.js";import"./chunk-grh6dvfv.js";import"./chunk-pw6yfj10.js";import"./chunk-x760j10f.js";import"./chunk-3bfm4hrs.js";import{__toESM}from"./chunk-wqfp8d9w.js";import{TextAttributes}from"@opentui/core";var import_react2=__toESM(require_react_production(),1);function inlineRowsFor(env){return 15+env.engines.lines.length+envActionKeys(env).length}function envActionKeys(env){let keys=[];if(!env.engines.anyUsable)keys.push("doctor.fix.noEngineAction");if(!env.git.found)keys.push("doctor.fix.gitAction");return keys}function WizardPage(props){let{theme}=useTheme(),t=useT(),renderer=useRenderer(),steps=(props.mode??"full")==="primer"?[]:props.shell===null?["skill"]:["completions","skill"],[stepIndex,setStepIndex]=import_react2.useState(0),[yes,setYes]=import_react2.useState(!0),[answers,setAnswers]=import_react2.useState({}),[page,setPage]=import_react2.useState(steps.length===0?"env":"questions"),step=steps[stepIndex];function finish(finalAnswers){renderer?.destroy(),props.onDone({completions:finalAnswers.completions??!1,skill:finalAnswers.skill??!1})}function confirm(choice=yes){if(page==="env"){setPage("keys");return}if(page==="keys"){finish(answers);return}let next={...answers,[step]:choice};if(setAnswers(next),stepIndex+1>=steps.length){setPage("env");return}setStepIndex(stepIndex+1),setYes(!0)}useBindings(()=>({bindings:[{key:"up",cmd:()=>setYes(!0)},{key:"k",cmd:()=>setYes(!0)},{key:"down",cmd:()=>setYes(!1)},{key:"j",cmd:()=>setYes(!1)},{key:"return",cmd:()=>confirm()},...pageCloseBindings(()=>finish(answers))]}));function questionFor(s){return s==="completions"?t("onboarding.completionsQuestion",{shell:props.shell??""}):t("onboarding.skillQuestion")}let explain=step==="completions"?t("onboarding.completionsExplain"):t("onboarding.skillExplain"),ready=envReadyForTasks(props.env);return $jsxs("box",{flexDirection:"column",flexGrow:1,paddingTop:1,paddingLeft:2,paddingRight:2,children:[$jsx("text",{fg:theme.primary,attributes:TextAttributes.BOLD,wrapMode:"none",children:t("onboarding.title")}),$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:t("onboarding.subtitle")}),$jsxs("box",{flexDirection:"column",paddingTop:1,children:[steps.slice(0,page==="questions"?stepIndex:steps.length).map((answered)=>$jsxs("box",{flexDirection:"row",gap:1,children:[$jsx("text",{fg:theme.success,wrapMode:"none",children:"\u2713"}),$jsx("text",{fg:theme.textMuted,wrapMode:"none",children:questionFor(answered)}),$jsx("text",{fg:theme.text,wrapMode:"none",children:answers[answered]?t("onboarding.optionYes"):t("onboarding.optionNo")})]},answered)),page==="env"?$jsxs("box",{flexDirection:"column",onMouseUp:()=>confirm(),children:[$jsx("text",{fg:theme.text,attributes:TextAttributes.BOLD,wrapMode:"word",children:t("onboarding.envTitle")}),$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:t("onboarding.envExplain")}),$jsxs("box",{flexDirection:"column",paddingTop:1,children:[$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:props.env.git.line}),props.env.engines.lines.map((line)=>$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:line},line))]}),$jsxs("box",{paddingTop:1,flexDirection:"column",children:[$jsx("text",{fg:ready?theme.success:theme.error,wrapMode:"word",children:ready?t("onboarding.envReady"):t("onboarding.envNotReady")}),envActionKeys(props.env).map((key)=>$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:`\u2192 ${t(key)}`},key))]})]}):null,page==="keys"?$jsxs("box",{flexDirection:"column",onMouseUp:()=>confirm(),children:[$jsx("text",{fg:theme.text,attributes:TextAttributes.BOLD,wrapMode:"word",children:t("onboarding.keysTitle")}),wizardKeyLines(currentPrefixConfiguration().key).map((line)=>$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:t(`onboarding.${line.msg}`,line.params)},line.msg))]}):null,page==="questions"?$jsxs($Fragment,{children:[$jsx("text",{fg:theme.text,attributes:TextAttributes.BOLD,wrapMode:"word",children:questionFor(step)}),$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:explain}),[!0,!1].map((option)=>{let active=yes===option;return $jsxs("box",{flexDirection:"row",gap:1,paddingLeft:1,onMouseUp:()=>confirm(option),children:[$jsx("text",{fg:active?theme.primary:theme.textMuted,wrapMode:"none",children:active?"\u276F":" "}),$jsx("text",{fg:active?theme.primary:theme.textMuted,attributes:active?TextAttributes.BOLD:void 0,wrapMode:"none",children:option?t("onboarding.optionYes"):t("onboarding.optionNo")})]},String(option))})]}):null]}),$jsx("box",{paddingTop:1,children:$jsx("text",{fg:theme.textMuted,attributes:TextAttributes.DIM,wrapMode:"none",children:t(page==="keys"?"onboarding.keysLegend":page==="env"?"onboarding.envLegend":"onboarding.legend")})})]})}async function runOnboardingWizard(shell,env,mode){return await new Promise((resolve)=>{bootPaneHost({inlineRows:inlineRowsFor(env),setup:()=>({root:()=>$jsx(WizardPage,{shell,env,mode,onDone:resolve})})})})}export{runOnboardingWizard,WizardPage};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Orchestrator}from"./chunk-rf2m6f3h.js";import"./chunk-akckb9kw.js";import"./chunk-s433recg.js";import"./chunk-98thhbm5.js";import"./chunk-2cyzv75r.js";import"./chunk-6sp2ags8.js";import"./chunk-6xppe9bj.js";import{PLACEHOLDER_TASK_TITLE}from"./chunk-aq912vvw.js";import"./chunk-hape5vwj.js";import"./chunk-7zmrn4gn.js";import"./chunk-1kktfmtg.js";import"./chunk-sdyzxayr.js";import"./chunk-gwcneg6c.js";import"./chunk-2fypr41w.js";import"./chunk-87y9qjcm.js";import"./chunk-m57cv76y.js";import"./chunk-xy8be792.js";import"./chunk-a3a9gdc4.js";import"./chunk-2brn8e1y.js";import"./chunk-9c1e5z6a.js";import"./chunk-6dn6h640.js";import"./chunk-h82kzdsn.js";import"./chunk-cb2fpajx.js";import"./chunk-3bfm4hrs.js";import"./chunk-wqfp8d9w.js";export{PLACEHOLDER_TASK_TITLE,Orchestrator};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{readOnlyGitProcessEnv}from"./chunk-6xppe9bj.js";import{spawnSync}from"child_process";var ENCODER=new TextEncoder,DECODER=new TextDecoder;function isOctalDigit(ch){return ch>="0"&&ch<="7"}function readQuoted(field,start){let bytes=[],lit="",flush=()=>{if(lit.length>0){for(let b of ENCODER.encode(lit))bytes.push(b);lit=""}},i=start+1;while(i<field.length){let ch=field[i];if(ch==='"'){i++;break}if(ch==="\\"){let n=field[i+1];if(n===void 0){lit+="\\",i++;continue}switch(n){case"a":flush(),bytes.push(7),i+=2;break;case"b":flush(),bytes.push(8),i+=2;break;case"t":flush(),bytes.push(9),i+=2;break;case"n":flush(),bytes.push(10),i+=2;break;case"v":flush(),bytes.push(11),i+=2;break;case"f":flush(),bytes.push(12),i+=2;break;case"r":flush(),bytes.push(13),i+=2;break;case'"':lit+='"',i+=2;break;case"\\":lit+="\\",i+=2;break;default:if(isOctalDigit(n)){let oct="",j=i+1;while(j<field.length&&oct.length<3&&isOctalDigit(field[j]))oct+=field[j],j++;flush(),bytes.push(Number.parseInt(oct,8)&255),i=j}else lit+=n,i+=2;break}}else lit+=ch,i++}return flush(),{value:DECODER.decode(new Uint8Array(bytes)),end:i}}function unquoteGitPath(field){if(field.length===0||field[0]!=='"')return field;return readQuoted(field,0).value}function splitRenameField(field,sep){if(field[0]==='"'){let left=readQuoted(field,0);if(field.startsWith(sep,left.end))return{orig:left.value,neu:unquoteGitPath(field.slice(left.end+sep.length))};return null}let idx=field.indexOf(sep);if(idx<0)return null;return{orig:field.slice(0,idx),neu:unquoteGitPath(field.slice(idx+sep.length))}}function parsePorcelainRows(raw){let rows=[];for(let rawLine of raw.split(`
|
|
3
|
-
`)){let line=rawLine.replace(/\r$/,"");if(line.length<4)continue;if(line.startsWith("##"))continue;let x=line[0],y=line[1];if(line[2]!==" ")continue;let rest=line.slice(3);if(x==="R"||x==="C"||y==="R"||y==="C"){let split=splitRenameField(rest," -> ");if(split){rows.push({x,y,path:split.neu,origPath:split.orig});continue}}rows.push({x,y,path:unquoteGitPath(rest)})}return rows}function parseCount(token){if(token==="-")return null;let n=Number.parseInt(token,10);return Number.isNaN(n)?null:n}function parseNumstatRows(raw){let rows=[],fields=raw.split("\x00");if(fields.length>0&&fields[fields.length-1]==="")fields.pop();let i=0;while(i<fields.length){let header=fields[i],tab1=header.indexOf("\t");if(tab1<0){i++;continue}let tab2=header.indexOf("\t",tab1+1);if(tab2<0){i++;continue}let added=parseCount(header.slice(0,tab1)),deleted=parseCount(header.slice(tab1+1,tab2)),pathField=header.slice(tab2+1);if(pathField.length>0)rows.push({path:unquoteGitPath(pathField),added,deleted}),i++;else{if(i+2>=fields.length)break;rows.push({path:unquoteGitPath(fields[i+2]),origPath:unquoteGitPath(fields[i+1]),added,deleted}),i+=3}}return rows}var ZERO={added:0,deleted:0};function sameWorktreeChanges(a,b){if(a===null||b===null)return a===b;return a.added===b.added&&a.deleted===b.deleted&&a.behind===b.behind&&a.ahead===b.ahead}function pickPushedChanges(pushed,worktreePath){if(!pushed)return null;if(pushed.has(worktreePath))return pushed.get(worktreePath)??"unknown";return ZERO}function readWorktreeChanges(worktreePath){if(!worktreePath)return null;try{let out=spawnSync("git",["status","--porcelain=v1"],{cwd:worktreePath,encoding:"utf8",stdio:["ignore","pipe","pipe"],env:readOnlyGitProcessEnv()});if(out.status!==0||out.stdout===void 0||out.stdout===null)return null;return parsePorcelain(out.stdout)}catch{return null}}function parsePorcelain(text){let added=0,deleted=0;for(let{x,y}of parsePorcelainRows(text))if(x==="D"||y==="D")deleted+=1;else added+=1;return{added,deleted}}
|
|
4
|
-
export{unquoteGitPath,parsePorcelainRows,parseNumstatRows,sameWorktreeChanges,pickPushedChanges,readWorktreeChanges,parsePorcelain};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{API_VERBS,RETIRED_VERBS,VERBS,VERB_ALIASES,VERB_GROUPS,findVerb}from"./chunk-5mr9j201.js";import"./chunk-9nbg0nzh.js";import"./chunk-1rkb0j1j.js";import"./chunk-aq912vvw.js";import"./chunk-d393z1mj.js";import"./chunk-d89r6eqm.js";import"./chunk-qkehg2c1.js";import"./chunk-0vmrteyg.js";import"./chunk-gtkejmxx.js";import"./chunk-t05pnk6y.js";import"./chunk-y5hnrx8d.js";import"./chunk-xnr8dga2.js";import"./chunk-hape5vwj.js";import"./chunk-7zmrn4gn.js";import"./chunk-1kktfmtg.js";import"./chunk-e8493db0.js";import"./chunk-gzf4dfg6.js";import"./chunk-jvxh93nz.js";import"./chunk-7q67dz4c.js";import"./chunk-1cjd7h8p.js";import"./chunk-b99tf0jr.js";import"./chunk-s8xyh1bt.js";import"./chunk-zaxdx0wd.js";import"./chunk-sexavazm.js";import"./chunk-sdyzxayr.js";import"./chunk-0sm2k04y.js";import"./chunk-5bn91n19.js";import"./chunk-pdh5w4ht.js";import"./chunk-4wwx51m5.js";import"./chunk-79gqh5p2.js";import"./chunk-3ztek08w.js";import"./chunk-kwe61yx7.js";import"./chunk-x3gch5nw.js";import"./chunk-e7t4xpr9.js";import"./chunk-n4dmwkfa.js";import"./chunk-w7zv47mp.js";import"./chunk-gwcneg6c.js";import"./chunk-m370e00b.js";import"./chunk-7jkf3tvr.js";import"./chunk-2fypr41w.js";import"./chunk-87y9qjcm.js";import"./chunk-m57cv76y.js";import"./chunk-dmdqnet6.js";import"./chunk-xy8be792.js";import"./chunk-a3a9gdc4.js";import"./chunk-2brn8e1y.js";import"./chunk-9c1e5z6a.js";import"./chunk-6dn6h640.js";import"./chunk-h82kzdsn.js";import"./chunk-ef11h2am.js";import"./chunk-8ddjfc2v.js";import"./chunk-cb2fpajx.js";import"./chunk-grh6dvfv.js";import"./chunk-pw6yfj10.js";import"./chunk-rxvbm4vt.js";import"./chunk-x760j10f.js";import"./chunk-3bfm4hrs.js";import"./chunk-wqfp8d9w.js";export{findVerb,VERB_GROUPS,VERB_ALIASES,VERBS,RETIRED_VERBS,API_VERBS};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{releaseBodyLines,runShellUpdater}from"./chunk-jq5vp0f7.js";import{$jsx,$jsxs,bootPaneHost,pageCloseBindings,require_react_production,useBindings,useRenderer,useT,useTheme}from"./chunk-rz8247zr.js";import"./chunk-764bsyb0.js";import"./chunk-mjvq39gf.js";import"./chunk-6xppe9bj.js";import{BREAKING_VERSIONS,CURRENT_VERSION,UPDATE_COMMAND,breakingVersionsCrossed,fetchReleaseNotes,fetchReleaseSummaries}from"./chunk-gtkejmxx.js";import"./chunk-s8xyh1bt.js";import"./chunk-zaxdx0wd.js";import"./chunk-sexavazm.js";import"./chunk-sdyzxayr.js";import"./chunk-0sm2k04y.js";import"./chunk-5bn91n19.js";import"./chunk-pdh5w4ht.js";import"./chunk-4wwx51m5.js";import"./chunk-79gqh5p2.js";import"./chunk-3ztek08w.js";import"./chunk-kwe61yx7.js";import"./chunk-m57cv76y.js";import"./chunk-xy8be792.js";import"./chunk-a3a9gdc4.js";import"./chunk-2brn8e1y.js";import"./chunk-6dn6h640.js";import"./chunk-cb2fpajx.js";import"./chunk-grh6dvfv.js";import"./chunk-pw6yfj10.js";import"./chunk-x760j10f.js";import"./chunk-3bfm4hrs.js";import{__toESM}from"./chunk-wqfp8d9w.js";import{TextAttributes}from"@opentui/core";var import_react2=__toESM(require_react_production(),1);var RELEASE_LIMIT=20;function VersionsPage(props){let{theme}=useTheme(),t=useT(),renderer=useRenderer(),[releases,setReleases]=import_react2.useState(null),[cursor,setCursor]=import_react2.useState(0),[notes,setNotes]=import_react2.useState({}),[status,setStatus]=import_react2.useState(null),selected=releases?.[cursor],crossings=selected?breakingVersionsCrossed(CURRENT_VERSION,selected.version):[];import_react2.useEffect(()=>{fetchReleaseSummaries(RELEASE_LIMIT).then((fetched)=>setReleases(fetched))},[]);let selectedVersion=selected?.version;import_react2.useEffect(()=>{if(selectedVersion===void 0||notes[selectedVersion]!==void 0)return;setNotes((cache)=>({...cache,[selectedVersion]:"loading"})),fetchReleaseNotes(selectedVersion).then((fetched)=>{setNotes((cache)=>({...cache,[selectedVersion]:fetched??"missing"}))})},[selectedVersion,notes]);function move(delta){let count=releases?.length??0;if(count===0)return;setCursor((index)=>(index+delta+count)%count)}async function installSelected(){if(!selected)return;setStatus(t("update.statusRunningUpdater")),await new Promise((resolve)=>setTimeout(resolve,30)),await runShellUpdater({renderer,t,targetLabel:selected.version,command:`${UPDATE_COMMAND} -s -- ${selected.version}`})}useBindings(()=>({bindings:[{key:"up",cmd:()=>move(-1)},{key:"down",cmd:()=>move(1)},{key:"k",cmd:()=>move(-1)},{key:"j",cmd:()=>move(1)},{key:"return",cmd:()=>void installSelected()},{key:"u",cmd:()=>void installSelected()},...pageCloseBindings(props.onClose)]}));let selectedNotes=selectedVersion===void 0?void 0:notes[selectedVersion];return $jsxs("box",{flexDirection:"column",flexGrow:1,paddingTop:1,paddingLeft:2,paddingRight:2,children:[$jsxs("box",{flexDirection:"row",justifyContent:"space-between",flexShrink:0,children:[$jsx("text",{fg:theme.text,attributes:TextAttributes.BOLD,wrapMode:"none",children:t("update.versions.pageTitle")}),$jsx("text",{fg:theme.textMuted,wrapMode:"none",onMouseUp:props.onClose,children:"q / esc"})]}),$jsxs("box",{flexDirection:"row",flexGrow:1,paddingTop:1,gap:2,children:[$jsxs("box",{flexDirection:"column",width:26,flexShrink:0,children:[releases===null?$jsx("text",{fg:theme.textMuted,children:t("update.versions.loading")}):null,releases!==null&&releases.length===0?$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:t("update.versions.unavailable")}):null,(releases??[]).map((release,index)=>{let active=index===cursor,tags=[release.version===CURRENT_VERSION?t("update.versions.tagCurrent"):"",index===0?t("update.versions.tagLatest"):"",BREAKING_VERSIONS.includes(release.version)?t("update.versions.tagBreaking"):""].filter(Boolean).join(" ");return $jsxs("box",{flexDirection:"row",gap:1,paddingLeft:1,backgroundColor:active?theme.primary:void 0,onMouseUp:()=>setCursor(index),children:[$jsxs("text",{fg:active?theme.selectedListItemText:theme.text,attributes:release.version===CURRENT_VERSION?TextAttributes.BOLD:void 0,wrapMode:"none",children:["v",release.version]}),tags?$jsx("text",{fg:active?theme.selectedListItemText:theme.textMuted,wrapMode:"none",children:tags}):null]},release.version)})]}),$jsxs("box",{flexDirection:"column",flexGrow:1,flexShrink:1,children:[$jsx("scrollbox",{flexGrow:1,flexShrink:1,stickyScroll:!1,verticalScrollbarOptions:{trackOptions:{backgroundColor:theme.background,foregroundColor:theme.borderActive}},children:$jsxs("box",{flexDirection:"column",paddingRight:1,paddingBottom:1,gap:0,children:[selectedNotes==="loading"?$jsx("text",{fg:theme.textMuted,children:t("update.loadingNotes")}):null,selectedNotes==="missing"?$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:t("update.notesUnavailable")}):null,selectedNotes!==void 0&&selectedNotes!=="loading"&&selectedNotes!=="missing"?releaseBodyLines(selectedNotes.body).map((line,i)=>$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:line},`${i}:${line}`)):null]})}),crossings.length>0?$jsx("text",{fg:theme.warning,wrapMode:"word",children:t("update.versions.breakingWarning",{versions:crossings.join(", ")})}):null]})]}),status?$jsx("text",{fg:theme.info,wrapMode:"word",children:status}):null,$jsx("box",{flexShrink:0,paddingTop:1,children:$jsx("text",{fg:theme.textMuted,attributes:TextAttributes.DIM,wrapMode:"none",children:t("update.versions.footerHint")})})]})}var INLINE_ROWS=24;async function startVersionsHost(){await bootPaneHost({inlineRows:INLINE_ROWS,setup:()=>({root:()=>$jsx(VersionsPage,{onClose:()=>process.exit(0)})})})}export{startVersionsHost};
|
|
File without changes
|