@sma1lboy/rove 0.9.248 → 0.9.250
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-frtdk8ha.js → chunk-06d596z0.js} +1 -1
- package/dist/cli/{chunk-sxtxxd65.js → chunk-09y4jh6p.js} +1 -1
- package/dist/cli/chunk-191gy3f0.js +2 -0
- package/dist/cli/{chunk-ztcxkm24.js → chunk-21xgqgmv.js} +1 -1
- package/dist/cli/{chunk-n4f4xxhr.js → chunk-2kshjtcs.js} +1 -1
- package/dist/cli/{chunk-1rhham18.js → chunk-2r696a8v.js} +1 -1
- package/dist/cli/{chunk-kcb75khv.js → chunk-38s9e8dh.js} +1 -1
- package/dist/cli/{chunk-hfjd4j5b.js → chunk-3dey6b3r.js} +1 -1
- package/dist/cli/{chunk-e6w94amk.js → chunk-3hcsvyeq.js} +1 -1
- package/dist/cli/{chunk-twa07m8w.js → chunk-41r8zj46.js} +1 -1
- package/dist/cli/{chunk-ekknb5ft.js → chunk-5fft208x.js} +1 -1
- package/dist/cli/{chunk-wvwkmj3t.js → chunk-66r43sfd.js} +1 -1
- package/dist/cli/{chunk-knpr38z6.js → chunk-6axpatfy.js} +1 -1
- package/dist/cli/{chunk-nra5y7r7.js → chunk-78kh1fet.js} +1 -1
- package/dist/cli/{chunk-ha09kd22.js → chunk-79hrybcd.js} +1 -1
- package/dist/cli/{chunk-dmecdp9c.js → chunk-7s67c0kw.js} +1 -1
- package/dist/cli/{chunk-89ag6mab.js → chunk-7xttx9m1.js} +11 -11
- package/dist/cli/{chunk-7mxd2n7q.js → chunk-8gmxg77t.js} +1 -1
- package/dist/cli/{chunk-hdbj5yaz.js → chunk-8kx2k2s8.js} +2 -2
- package/dist/cli/{chunk-dk3g9ynd.js → chunk-8m5crcy5.js} +20 -19
- package/dist/cli/{chunk-jjwxx8yp.js → chunk-8mfpv3fh.js} +1 -1
- package/dist/cli/{chunk-5nfdpc9j.js → chunk-8n19nb0s.js} +1 -1
- package/dist/cli/{chunk-761w6mbm.js → chunk-93r6tgf1.js} +1 -1
- package/dist/cli/{chunk-xpt1rabn.js → chunk-9853bbb9.js} +2 -2
- package/dist/cli/{chunk-k4374n9t.js → chunk-99n8qsw9.js} +2 -2
- package/dist/cli/{chunk-ecdhqwsj.js → chunk-a4hsqj1b.js} +1 -1
- package/dist/cli/{chunk-3y2tv956.js → chunk-ap3r73bm.js} +3 -3
- package/dist/cli/{chunk-ncxhtx5a.js → chunk-asy33vdy.js} +1 -1
- package/dist/cli/{chunk-09y7gspe.js → chunk-bvqazrbz.js} +1 -1
- package/dist/cli/{chunk-9d2p1h1b.js → chunk-c01899mr.js} +1 -1
- package/dist/cli/{chunk-x6gpzj4t.js → chunk-ce16ecse.js} +1 -1
- package/dist/cli/{chunk-jxyvk9c0.js → chunk-cmss5e88.js} +1 -1
- package/dist/cli/{chunk-8shm2q5k.js → chunk-d5xc67hp.js} +1 -1
- package/dist/cli/{chunk-2rve8y8t.js → chunk-e8d5951a.js} +1 -1
- package/dist/cli/chunk-fe7kwz48.js +3 -0
- package/dist/cli/{chunk-5xh7ee2k.js → chunk-fxm1cmp9.js} +1 -1
- package/dist/cli/{chunk-mxag13a6.js → chunk-fxqp6zt5.js} +1 -1
- package/dist/cli/{chunk-0vpn32r6.js → chunk-fz17c524.js} +1 -1
- package/dist/cli/{chunk-q2177zrc.js → chunk-g4k86vkr.js} +1 -1
- package/dist/cli/{chunk-ehs0wh6y.js → chunk-g8fjjbnj.js} +1 -1
- package/dist/cli/{chunk-fs3p13ah.js → chunk-gc77ewk2.js} +1 -1
- package/dist/cli/{chunk-hmm0z8x9.js → chunk-gcdm2jke.js} +1 -1
- package/dist/cli/{chunk-32zj8r86.js → chunk-gpb49qs3.js} +1 -1
- package/dist/cli/{chunk-nz1436cx.js → chunk-hhvvcwjq.js} +1 -1
- package/dist/cli/{chunk-dhnbgfhh.js → chunk-hm6qe86k.js} +1 -1
- package/dist/cli/{chunk-taa06w9e.js → chunk-hzfq0sst.js} +1 -1
- package/dist/cli/{chunk-jj640vvr.js → chunk-j3c4kygc.js} +1 -1
- package/dist/cli/{chunk-y79j580z.js → chunk-j4cqwqnc.js} +1 -1
- package/dist/cli/{chunk-v1ban2hc.js → chunk-jh11snb1.js} +1 -1
- package/dist/cli/{chunk-ncxkn8gy.js → chunk-jk8knad0.js} +2 -2
- package/dist/cli/{chunk-mra8t9tk.js → chunk-k39sf30b.js} +1 -1
- package/dist/cli/{chunk-55rpt311.js → chunk-kecy2zcc.js} +4 -4
- package/dist/cli/{chunk-ysfe09dd.js → chunk-knfnbv60.js} +2 -2
- package/dist/cli/{chunk-043hdsx6.js → chunk-kqc0kym1.js} +1 -1
- package/dist/cli/{chunk-ppj32x3a.js → chunk-m3sq1vgk.js} +1 -1
- package/dist/cli/{chunk-fd260eye.js → chunk-mn6qth54.js} +1 -1
- package/dist/cli/{chunk-cbhzyn31.js → chunk-ntrwd6ks.js} +1 -1
- package/dist/cli/{chunk-9wfdzbnr.js → chunk-pkk9j80z.js} +2 -2
- package/dist/cli/{chunk-shdzs3kz.js → chunk-r07zjer5.js} +1 -1
- package/dist/cli/{chunk-91gkmv3b.js → chunk-rjxj5tf4.js} +1 -1
- package/dist/cli/{chunk-esz0pj68.js → chunk-rtdr5bm8.js} +1 -1
- package/dist/cli/{chunk-30fygd49.js → chunk-rvqse0aa.js} +1 -1
- package/dist/cli/{chunk-y7xzcxb3.js → chunk-vb2tzcde.js} +1 -1
- package/dist/cli/{chunk-5ftfwgnj.js → chunk-vt6ghz8y.js} +1 -1
- package/dist/cli/{chunk-kxzv662p.js → chunk-vt7bc8d6.js} +1 -1
- package/dist/cli/{chunk-ypjca5g3.js → chunk-w594v1n8.js} +1 -1
- package/dist/cli/{chunk-bqthw6ce.js → chunk-wkt6h5cf.js} +1 -1
- package/dist/cli/{chunk-b27fyc2m.js → chunk-wnwzj8am.js} +1 -1
- package/dist/cli/{chunk-89ze9jc2.js → chunk-wtdj8n93.js} +1 -1
- package/dist/cli/chunk-x33sm4rp.js +5 -0
- package/dist/cli/{chunk-v4fa5ycf.js → chunk-y2bga5cw.js} +3 -3
- package/dist/cli/{chunk-0qh9w2sc.js → chunk-y7mg74jx.js} +1 -1
- package/dist/cli/{chunk-wy7qtcym.js → chunk-yjs6d5w1.js} +2 -2
- package/dist/cli/{chunk-empeprq2.js → chunk-z0ewb9k9.js} +1 -1
- package/dist/cli/{chunk-3b52kybr.js → chunk-zh30b87y.js} +1 -1
- package/dist/cli/{chunk-62wgn4br.js → chunk-zwq8cb8p.js} +1 -1
- package/dist/cli/index.js +4 -4
- package/dist/cli/pty-host-node.mjs +1 -0
- package/dist/cli/rove.js +1 -1
- package/dist/web/assets/{index-BC558ZDT.js → index-DaovU92T.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +3 -3
- package/dist/cli/chunk-b9t4vq5j.js +0 -3
- package/dist/cli/chunk-zkmsvjtd.js +0 -2
- package/dist/cli/chunk-znjcesdr.js +0 -5
package/dist/web/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<meta name="referrer" content="no-referrer" />
|
|
7
7
|
<title>rove</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DaovU92T.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-BYv91-Cs.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.250",
|
|
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",
|
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
"@vitest/coverage-v8": "2.1.9",
|
|
98
98
|
"knip": "^6.14.2",
|
|
99
99
|
"react-devtools-core": "^7.0.1",
|
|
100
|
-
"rove-bridge": "0.0.
|
|
101
|
-
"rove-weixin": "0.0.
|
|
100
|
+
"rove-bridge": "0.0.11",
|
|
101
|
+
"rove-weixin": "0.0.11",
|
|
102
102
|
"typescript": "5.8.2",
|
|
103
103
|
"vitest": "2.1.9"
|
|
104
104
|
},
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{isDev}from"./chunk-prqeddy7.js";import{fileURLToPath}from"url";var package_default={$schema:"https://json.schemastore.org/package.json",name:"@sma1lboy/rove",version:"0.9.248",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:{rove:"dist/cli/rove.js"},files:["dist/cli","dist/completions","dist/web","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:mock":"ROVE_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","build:rubric":"bun run scripts/build-tier-rubric.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":"ROVE_INCLUDE_SOCKET=1 vitest run test/daemon --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests","test:socket:coverage":"ROVE_INCLUDE_SOCKET=1 ROVE_COVERAGE_DAEMON=1 vitest run test/daemon --coverage --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests","test:behavior":"ROVE_INCLUDE_BEHAVIOR=1 vitest run test/behavior --pool forks --minWorkers=1 --maxWorkers=1 --retry=2 --passWithNoTests","test:render":"bun scripts/render-track.mjs",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.21.3"},devDependencies:{"@biomejs/biome":"1.9.4","@sma1lboy/rove-daemon":"0.7.21","@tsconfig/bun":"1.0.11","@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","rove-bridge":"0.0.9","rove-weixin":"0.0.9",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.ROVE_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
|
-
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,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{openDaemonSession,resolveActiveTaskId}from"./chunk-mxag13a6.js";import"./chunk-fs3p13ah.js";import"./chunk-x6gpzj4t.js";import"./chunk-v1ban2hc.js";import"./chunk-a7kq09ke.js";import"./chunk-yt15y085.js";import"./chunk-0vpn32r6.js";import"./chunk-x8fd9y51.js";import"./chunk-hq9tbzqa.js";import"./chunk-pn5ygqn6.js";import"./chunk-npwzmmv9.js";import"./chunk-b39sdtt0.js";import"./chunk-nc46gddg.js";import"./chunk-wqfp8d9w.js";export{resolveActiveTaskId,openDaemonSession};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{quoteShellArgv}from"./chunk-7kysxgbq.js";import{acquireWithRetry}from"./chunk-qzsahxd9.js";import{acquireSync,release,releaseSync}from"./chunk-mw0ysrpd.js";import{roveStateDir}from"./chunk-prqeddy7.js";import{ROVE_PRODUCT_NAME}from"./chunk-zt7wfnva.js";import{fileURLToPath}from"url";function roveCliInvocation(){let cliName=ROVE_PRODUCT_NAME;if(import.meta.url.endsWith(".js"))return[cliName];let entry=fileURLToPath(new URL(`./${"rove.ts"}`,import.meta.url));return[process.execPath,"--conditions=browser",entry]}function roveHookInvocation(){if(import.meta.url.endsWith(".js"))return[ROVE_PRODUCT_NAME];if(Bun.which(ROVE_PRODUCT_NAME))return[ROVE_PRODUCT_NAME];return roveCliInvocation()}var ROVE_HOOK_VERSION=1;function roveHookArgs(vendor){return["--engine",vendor,"--hook-version",String(ROVE_HOOK_VERSION)]}var GATED_TOOL_VERBS=new Set(["tool-pre","tool-post","tool-failed"]);function isObject(v){return!!v&&typeof v==="object"&&!Array.isArray(v)}function parseHookSettings(raw){if(raw===void 0)return{ok:!0,doc:{}};let parsed;try{parsed=JSON.parse(raw)}catch(err){return{ok:!1,reason:`not valid JSON (${err instanceof Error?err.message:String(err)})`}}if(!isObject(parsed))return{ok:!1,reason:"top level is not a JSON object"};if(parsed.hooks===void 0)return{ok:!0,doc:parsed};if(!isObject(parsed.hooks))return{ok:!1,reason:'"hooks" is not an object'};for(let[event,groups]of Object.entries(parsed.hooks)){if(!Array.isArray(groups))return{ok:!1,reason:`"hooks.${event}" is not an array`};let bad=groups.findIndex((group)=>!isObject(group)||!Array.isArray(group.hooks));if(bad>=0)return{ok:!1,reason:`"hooks.${event}[${bad}]" is not an object with a "hooks" array`}}return{ok:!0,doc:parsed}}var HOOK_WORD=String.raw`(?:'(?:[^']|'\\'')*'|"[^"$\x60\\]*"|[A-Za-z0-9_./:=+-]+)`,HOOK_ARGV=new RegExp(`^${HOOK_WORD}(?:[ ]+${HOOK_WORD})*$`),ROVE_HOOK_FLAGS={"--engine":/^[a-z][a-z0-9-]*$/,"--hook-version":/^\d+$/};function isRoveHook(hook,verbs){if(!isObject(hook)||typeof hook.command!=="string")return!1;if(hook.type!==void 0&&hook.type!=="command")return!1;let command=hook.command.replace(/^[ \t]+|[ \t]+$/g,"");if(HOOK_ARGV.exec(command)?.[0]!==command)return!1;let argv=(command.match(new RegExp(HOOK_WORD,"g"))??[]).map((word)=>{if(word.startsWith("'"))return word.slice(1,-1).replaceAll("'\\''","'");if(word.startsWith('"'))return word.slice(1,-1);return word}),executable=argv[0]?.split("/").at(-1),offset=1;if(executable==="bun"||executable==="node"){if(argv[offset]==="--conditions=browser")offset++;let entry=argv[offset]??"";if(!/(?:^|\/)(?:src|dist)\/cli\/(?:rove|rove)\.(?:ts|js)$/.test(entry))return!1;offset++}else if(executable!=="rove"&&executable!=="rove")return!1;if(argv[offset]!=="hook"||!verbs.includes(argv[offset+1]))return!1;let rest=argv.slice(offset+2);for(let i=0;i<rest.length;i+=2){let value=rest[i+1],pattern=ROVE_HOOK_FLAGS[rest[i]??""];if(!pattern||value===void 0||!pattern.test(value))return!1}return!0}function removeRoveHooks(groups,verbs){return groups.flatMap((group)=>{if(!isObject(group)||!Array.isArray(group.hooks))return[group];let kept=group.hooks.filter((hook)=>!isRoveHook(hook,verbs));if(kept.length===group.hooks.length)return[group];return kept.length>0?[{...group,hooks:kept}]:[]})}function hasRoveActivityHooks(current,eventMap){let verbs=eventMap.map((spec)=>spec.verb),hooks=isObject(current.hooks)?current.hooks:{};return Object.values(hooks).some((groups)=>Array.isArray(groups)&&groups.some((group)=>isObject(group)&&Array.isArray(group.hooks)&&group.hooks.some((hook)=>isRoveHook(hook,verbs))))}function hookCommandQuoting(platform=process.platform){return{bareSafe:!0,windows:platform==="win32"}}function buildActivityHooks(eventMap,inv=roveHookInvocation(),opts={}){let out={},quoting=hookCommandQuoting();for(let spec of eventMap){if(opts.buildFilter&&!opts.buildFilter(spec))continue;let{event,matcher,verb}=spec,group={hooks:[{type:"command",command:quoteShellArgv([...inv,"hook",verb,...opts.extraArgs??[]],quoting)}]};if(matcher)group.matcher=matcher;let previous=out[event],groups=Array.isArray(previous)?previous:[];groups.push(group),out[event]=groups}return out}function mergeActivityHooks(current,install,eventMap,inv=roveHookInvocation(),opts={}){let verbs=eventMap.map((spec)=>spec.verb),{hooks:rawHooks,...restSettings}=current,hooks=isObject(rawHooks)?{...rawHooks}:{},built=install?buildActivityHooks(eventMap,inv,opts):{};for(let{event}of eventMap){let groups=hooks[event],prior=Array.isArray(groups)?groups:[],kept=removeRoveHooks(prior,verbs),additions=built[event];if(install&&Array.isArray(additions))kept.push(...additions);if(kept.length>0)hooks[event]=kept;else delete hooks[event]}return Object.keys(hooks).length>0?{...restSettings,hooks}:{...restSettings}}var RETIRED_WATCH_EVENT="PostToolUse";function removeWorktreeWatchHook(current){let{hooks:rawHooks,...restSettings}=current,hooks=isObject(rawHooks)?{...rawHooks}:{},groups=hooks[RETIRED_WATCH_EVENT],prior=Array.isArray(groups)?groups:[],kept=removeRoveHooks(prior,["worktree-created"]);if(kept.length>0)hooks[RETIRED_WATCH_EVENT]=kept;else delete hooks[RETIRED_WATCH_EVENT];return Object.keys(hooks).length>0?{...restSettings,hooks}:{...restSettings}}import{constants,closeSync,fstatSync,openSync,readSync}from"fs";import{open}from"fs/promises";var MAX_ENGINE_FILE_BYTES=104857600,MAX_JSONL_LINE_CHARS=8388608,READ_CHUNK_BYTES=65536,READ_FLAGS=constants.O_RDONLY|constants.O_NONBLOCK;async function readTextFileIfRegular(p,maxBytes=MAX_ENGINE_FILE_BYTES){let file=await open(p,READ_FLAGS);try{let info=await file.stat();if(!info.isFile()||info.size>maxBytes)return null;let chunks=[],total=0;while(total<=maxBytes){let buffer=Buffer.allocUnsafe(Math.min(READ_CHUNK_BYTES,maxBytes+1-total)),{bytesRead}=await file.read(buffer);if(bytesRead===0)return Buffer.concat(chunks,total).toString("utf8");chunks.push(buffer.subarray(0,bytesRead)),total+=bytesRead}return null}finally{await file.close()}}async function readTextFileBounded(p,maxBytes=MAX_ENGINE_FILE_BYTES){return await readTextFileIfRegular(p,maxBytes)??""}async function readFirstLineBounded(p,maxBytes=MAX_JSONL_LINE_CHARS){let file=await open(p,READ_FLAGS);try{if(!(await file.stat()).isFile())return"";let chunks=[],total=0,start=0,nonblank=!1;while(total<=maxBytes){let buffer=Buffer.allocUnsafe(Math.min(16384,maxBytes+1-total)),{bytesRead}=await file.read(buffer);if(!bytesRead)return Buffer.concat(chunks,total).subarray(start).toString("utf8");chunks.push(buffer.subarray(0,bytesRead));let segment=0;for(let i=0;i<bytesRead;i++){if(buffer[i]!==10)continue;nonblank||=buffer.subarray(segment,i).toString("utf8").trim().length>0;let end=total+i;if(end>maxBytes)return"";if(nonblank)return Buffer.concat(chunks,total+bytesRead).subarray(start,end).toString("utf8");start=end+1,segment=i+1}nonblank||=buffer.subarray(segment,bytesRead).toString("utf8").trim().length>0,total+=bytesRead}return""}finally{await file.close()}}function readTextFileSyncBounded(p,maxBytes=MAX_ENGINE_FILE_BYTES){try{return readTextFileIfRegularSync(p,maxBytes)}catch(err){if(err instanceof Error&&"code"in err&&err.code==="ENOENT")return null;throw err}}function readTextFileIfRegularSync(p,maxBytes=MAX_ENGINE_FILE_BYTES){let fd=openSync(p,READ_FLAGS);try{let info=fstatSync(fd);if(!info.isFile()||info.size>maxBytes)return null;let chunks=[],total=0;while(total<=maxBytes){let buffer=Buffer.allocUnsafe(Math.min(READ_CHUNK_BYTES,maxBytes+1-total)),bytesRead=readSync(fd,buffer);if(!bytesRead)return Buffer.concat(chunks,total).toString("utf8");chunks.push(buffer.subarray(0,bytesRead)),total+=bytesRead}return null}finally{closeSync(fd)}}function isJsonlLineWithinBound(line,maxChars=MAX_JSONL_LINE_CHARS){return line.length<=maxChars}import{createHash,randomBytes}from"crypto";import{mkdirSync,renameSync,unlinkSync,writeFileSync}from"fs";import{mkdir,rename,unlink,writeFile}from"fs/promises";import{dirname,join}from"path";var MAX_SHARED_CONFIG_BYTES=8388608;function stagingPath(file){return`${file}.rove-${process.pid}-${randomBytes(6).toString("hex")}.tmp`}function sharedConfigLockPath(file){return join(roveStateDir(),`shared-config-${createHash("sha256").update(file).digest("hex").slice(0,16)}.lock`)}var MAX_ATTEMPTS=5;function readSharedConfigSync(file){try{let raw=readTextFileIfRegularSync(file,MAX_SHARED_CONFIG_BYTES);if(raw===null)throw Error(`Refusing non-regular or oversized config: ${file}`);return raw}catch(err){if(err instanceof Error&&"code"in err&&err.code==="ENOENT")return;throw err}}async function readRaw(file){try{let raw=await readTextFileIfRegular(file,MAX_SHARED_CONFIG_BYTES);if(raw===null)throw Error(`Refusing non-regular or oversized config: ${file}`);return raw}catch(err){if(err instanceof Error&&"code"in err&&err.code==="ENOENT")return;throw err}}function updateSharedJsonSync(file,load,build){let lockPath=sharedConfigLockPath(file),lockToken=acquireSync(lockPath);try{for(let attempt=0;attempt<MAX_ATTEMPTS;attempt++){let before=readSharedConfigSync(file),doc=load(before);if(!doc)return;let text=build(doc);if(text===void 0)return;let tmp=stagingPath(file);try{if(mkdirSync(dirname(file),{recursive:!0}),writeFileSync(tmp,text,{mode:384,flag:"wx"}),readSharedConfigSync(file)===before){renameSync(tmp,file);return}}finally{try{unlinkSync(tmp)}catch{}}}throw Error(`gave up updating ${file} after ${MAX_ATTEMPTS} concurrent writes`)}finally{releaseSync(lockPath,lockToken)}}async function updateSharedJson(file,load,build){let lockPath=sharedConfigLockPath(file),lockToken=await acquireWithRetry(lockPath);try{for(let attempt=0;attempt<MAX_ATTEMPTS;attempt++){let before=await readRaw(file),doc=load(before);if(!doc)return;let text=build(doc);if(text===void 0)return;let tmp=stagingPath(file);try{if(await mkdir(dirname(file),{recursive:!0}),await writeFile(tmp,text,{mode:384,flag:"wx"}),await readRaw(file)===before){await rename(tmp,file);return}}finally{await unlink(tmp).catch(()=>{})}}throw Error(`gave up updating ${file} after ${MAX_ATTEMPTS} concurrent writes`)}finally{await release(lockPath,lockToken)}}async function editJsonSettings(settingsFilePath,transform,parse=parseHookSettings){let rejected;try{await updateSharedJson(settingsFilePath,(raw)=>{let parsed=parse(raw);if(parsed.ok)return parsed.doc;rejected=parsed.reason;return},(current)=>{let next=transform(current),json=JSON.stringify(next,null,2);return json===JSON.stringify(current,null,2)?void 0:`${json}
|
|
3
|
-
`})}catch(err){return{ok:!1,file:settingsFilePath,reason:err instanceof Error?err.message:String(err)}}if(rejected!==void 0)return{ok:!1,file:settingsFilePath,reason:rejected};return{ok:!0}}class JsonHookAdapter{supportsHooks(){return!0}activityDetailFromPayload(_kind,_payload){return}sessionFromPayload(_payload){return}supportsWorktreeSync(){return!1}async removeWorktreeSyncHook(_settingsFilePath){}gatedVerbs(){return GATED_TOOL_VERBS}async installActivityHooks(settingsFilePath,opts={}){let gated=this.gatedVerbs(),outcome=await editJsonSettings(settingsFilePath,(cur)=>mergeActivityHooks(cur,!0,this.eventMap,void 0,{extraArgs:roveHookArgs(this.vendor),buildFilter:(spec)=>opts.toolEvents===!0||!gated.has(spec.verb)}));if(!outcome.ok&&!opts.quiet)process.stderr.write(`[rove hooks] ${this.vendor}: skipped ${outcome.file}: ${outcome.reason}
|
|
4
|
-
`);return outcome}async removeActivityHooks(settingsFilePath){await editJsonSettings(settingsFilePath,(cur)=>mergeActivityHooks(cur,!1,this.eventMap))}async removeWorktreeWatchHook(settingsFilePath){await editJsonSettings(settingsFilePath,removeWorktreeWatchHook)}hookConfigRefusal(raw){let parsed=parseHookSettings(raw);return parsed.ok?void 0:parsed.reason}}import{homedir}from"os";import path from"path";var VENDOR_HOMES={claude:{envVar:"CLAUDE_CONFIG_DIR",dirName:".claude"},codex:{envVar:"CODEX_HOME",dirName:".codex"},copilot:{envVar:"COPILOT_HOME",dirName:".copilot"},kimi:{envVar:"KIMI_CODE_HOME",dirName:".kimi-code"}},AGENT_DIR_VENDORS={pi:{envVar:"PI_CODING_AGENT_DIR",dirName:".pi"},omp:{envVar:"PI_CODING_AGENT_DIR",dirName:".omp"}},defaultVendorHomeDeps={env:(name)=>process.env[name],home:()=>homedir()};function vendorWriteHomeDeps(home){return home===void 0?defaultVendorHomeDeps:{env:()=>{return},home:()=>home}}function vendorConfigHome(vendor,deps=defaultVendorHomeDeps){let{envVar,dirName}=VENDOR_HOMES[vendor],override=deps.env(envVar)?.trim();if(override)return override;return path.join(deps.home(),dirName)}function vendorAgentDir(vendor,deps=defaultVendorHomeDeps){let{envVar,dirName}=AGENT_DIR_VENDORS[vendor],override=deps.env(envVar)?.trim();if(override)return override;return path.join(deps.home(),dirName,"agent")}function depsOf(env,home){return{env,home:()=>home}}function claudeGlobalConfigPath(env,home){let override=env("CLAUDE_CONFIG_DIR")?.trim();if(override)return path.join(override,".claude.json");return path.join(home,".claude.json")}function codexAuthPath(env,home){return path.join(vendorConfigHome("codex",depsOf(env,home)),"auth.json")}function copilotConfigPath(env,home){return path.join(vendorConfigHome("copilot",depsOf(env,home)),"config.json")}function bobHome(home=homedir()){return path.join(home,".bob")}function bobTrustPath(home){return path.join(bobHome(home),"trustedFolders.json")}function bobDbPath(home){return path.join(bobHome(home),"db","bob.db")}function bobAuthSecretsPath(home){return path.join(bobHome(home),"settings","auth-secrets.json")}function kimiCredentialsPath(env,home){return path.join(vendorConfigHome("kimi",depsOf(env,home)),"credentials","kimi-code.json")}
|
|
5
|
-
export{roveCliInvocation,roveHookInvocation,ROVE_HOOK_VERSION,roveHookArgs,GATED_TOOL_VERBS,isObject,isRoveHook,removeRoveHooks,hasRoveActivityHooks,hookCommandQuoting,readTextFileIfRegular,readTextFileBounded,readFirstLineBounded,readTextFileSyncBounded,isJsonlLineWithinBound,readSharedConfigSync,updateSharedJsonSync,editJsonSettings,JsonHookAdapter,vendorWriteHomeDeps,vendorConfigHome,vendorAgentDir,claudeGlobalConfigPath,codexAuthPath,copilotConfigPath,bobTrustPath,bobDbPath,bobAuthSecretsPath,kimiCredentialsPath};
|