@sma1lboy/rove 0.9.310 → 0.9.311-next.651

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/cli/{chunk-v72qzktg.js → chunk-164snxjp.js} +1 -1
  2. package/dist/cli/{chunk-3d6caevx.js → chunk-16w3zr3h.js} +1 -1
  3. package/dist/cli/{chunk-expgczbc.js → chunk-1kbt48sb.js} +1 -1
  4. package/dist/cli/{chunk-ecdnw5xe.js → chunk-281nz84k.js} +2 -2
  5. package/dist/cli/{chunk-teq8p5rp.js → chunk-3mteb2yn.js} +2 -2
  6. package/dist/cli/{chunk-z3cje8hk.js → chunk-6jp5qvp7.js} +1 -1
  7. package/dist/cli/{chunk-jx3zndsh.js → chunk-7gsa4e5v.js} +1 -1
  8. package/dist/cli/{chunk-a2rxzyy4.js → chunk-7pkman2r.js} +1 -1
  9. package/dist/cli/{chunk-0mdzphdz.js → chunk-883sxh54.js} +1 -1
  10. package/dist/cli/{chunk-ep7abg35.js → chunk-88fm48j7.js} +1 -1
  11. package/dist/cli/{chunk-j0s13v56.js → chunk-9g3ykmk1.js} +1 -1
  12. package/dist/cli/{chunk-cqazrkzw.js → chunk-ap8hnhp8.js} +1 -1
  13. package/dist/cli/{chunk-hwckecfa.js → chunk-b8pbxxd7.js} +1 -1
  14. package/dist/cli/{chunk-fads90r0.js → chunk-bhfxqwkr.js} +1 -1
  15. package/dist/cli/{chunk-gfsgk1n8.js → chunk-cpg3xatp.js} +1 -1
  16. package/dist/cli/{chunk-0rfkgmns.js → chunk-d32fc64g.js} +1 -1
  17. package/dist/cli/{chunk-tzhfek18.js → chunk-dkxg9ykw.js} +1 -1
  18. package/dist/cli/{chunk-b3nrywgm.js → chunk-f09xb6kf.js} +1 -1
  19. package/dist/cli/{chunk-ehssspvr.js → chunk-f6sp14yz.js} +1 -1
  20. package/dist/cli/{chunk-mp535p99.js → chunk-ffkvvwyw.js} +1 -1
  21. package/dist/cli/{chunk-bz3p5vp1.js → chunk-fvqhz4jc.js} +1 -1
  22. package/dist/cli/{chunk-wth84cjn.js → chunk-g6mapq3w.js} +1 -1
  23. package/dist/cli/{chunk-7vassnhs.js → chunk-g6wqzvar.js} +2 -2
  24. package/dist/cli/{chunk-kzcd7vdj.js → chunk-j7x4f13g.js} +1 -1
  25. package/dist/cli/{chunk-0x3vfkz9.js → chunk-jqj587mq.js} +1 -1
  26. package/dist/cli/{chunk-11vgtrm4.js → chunk-jra5dpw9.js} +1 -1
  27. package/dist/cli/{chunk-kmfas00z.js → chunk-k54r9610.js} +1 -1
  28. package/dist/cli/{chunk-29ftjs96.js → chunk-kgwe9fe5.js} +1 -1
  29. package/dist/cli/{chunk-pgaf0wqj.js → chunk-khgzase0.js} +1 -1
  30. package/dist/cli/{chunk-gf37e6ty.js → chunk-mmbzs7k5.js} +1 -1
  31. package/dist/cli/{chunk-451z1265.js → chunk-mrvb0vtm.js} +1 -1
  32. package/dist/cli/{chunk-bsprr76b.js → chunk-nzzj0b9g.js} +1 -1
  33. package/dist/cli/{chunk-v29v0cgd.js → chunk-p880k6a0.js} +1 -1
  34. package/dist/cli/{chunk-3kraw5fh.js → chunk-pm71xktm.js} +1 -1
  35. package/dist/cli/{chunk-zgmnse5q.js → chunk-q6k7mpmp.js} +1 -1
  36. package/dist/cli/{chunk-w3dpq6aj.js → chunk-q6t3y24h.js} +2 -2
  37. package/dist/cli/{chunk-vg3tyctk.js → chunk-qvbr5xec.js} +1 -1
  38. package/dist/cli/{chunk-k1pk159f.js → chunk-qxh4hj9t.js} +1 -1
  39. package/dist/cli/{chunk-6qp32yje.js → chunk-r7gjh0kr.js} +1 -1
  40. package/dist/cli/{chunk-cjzyc7cn.js → chunk-snp86g9s.js} +1 -1
  41. package/dist/cli/chunk-v8bdmbb9.js +3 -0
  42. package/dist/cli/{chunk-3yd8nyv6.js → chunk-vcj1rd8h.js} +1 -1
  43. package/dist/cli/{chunk-j6g8jmke.js → chunk-vv3e8ceh.js} +2 -2
  44. package/dist/cli/{chunk-ymmzwv5w.js → chunk-vym8dky3.js} +1 -1
  45. package/dist/cli/{chunk-8akyzrjc.js → chunk-w93a23cv.js} +1 -1
  46. package/dist/cli/{chunk-ene2k7kb.js → chunk-wzrw4tas.js} +1 -1
  47. package/dist/cli/{chunk-z6k53zqj.js → chunk-xtxca7d8.js} +1 -1
  48. package/dist/cli/{chunk-etj5h8hg.js → chunk-yfckah6a.js} +1 -1
  49. package/dist/cli/{chunk-jpa26n83.js → chunk-ypfvxnwf.js} +1 -1
  50. package/dist/cli/index.js +2 -2
  51. package/dist/cli/rove.js +1 -1
  52. package/dist/web/assets/{index-D7OcIn1Q.js → index-B_nBSzPe.js} +44 -44
  53. package/dist/web/assets/index-DmblaqlN.css +1 -0
  54. package/dist/web/assets/{term-mount-CSGanVNa.js → term-mount-blMr0MC-.js} +1 -1
  55. package/dist/web/index.html +2 -2
  56. package/dist/web/relay/index.html +2 -2
  57. package/dist/web/relay-client/assets/{index-B307rVpU.js → index-DV5nLhAz.js} +41 -41
  58. package/dist/web/relay-client/assets/index-Dno3gMd0.css +1 -0
  59. package/dist/web/relay-client/index.html +2 -2
  60. package/package.json +1 -1
  61. package/dist/cli/chunk-aterhn60.js +0 -3
  62. package/dist/web/assets/index-BWayUsdy.css +0 -1
  63. package/dist/web/relay-client/assets/index-T6nIyGrP.css +0 -1
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{PER_SESSION,classifyTier,describeTierBlock,isAutoRoutingTier,listFiles,liveSourceProtocol,loadPreviewData,planWorktreeHandoff,readAutoRoutingTable,readClassifierConfig,resolveBase,runWorktreeGit,searchTasks,statusFiles,statusFilesBranch,taskGroupOf,tierBlock}from"./chunk-yg74j7kp.js";import{ensurePluginEnginesLoaded,registeredEngineIds}from"./chunk-c4c03wnz.js";import{listPaneLaunches}from"./chunk-jyrmdx8f.js";import{resolveActiveTaskId}from"./chunk-zswn8skz.js";import{detectEngineStatus,readEngineVersion}from"./chunk-2vk65d66.js";import{resolveEditorLaunch}from"./chunk-7fw390kp.js";import{DeviceLogin,GH_ENV,GITHUB_HOST,runTool,spawnGhLogin}from"./chunk-h58qkv3b.js";import{allocateTab,applyTabOps,closeTabsSnapshot,collapseSplit,engineTabArgv,findEditorTab,initialSplit,joinTaskTabs,leaves,markCliTabSession,patchTabSplit,publishCliTabSnapshot,readDaemonTabs,readTabsSnapshot,removeLeaf,renameLeaf,renameTabsSnapshot,seedCanonicalTab,seedShellHome,shellIdentityInput,shellTabInput,splitActive,splitLeafPtyKey,tabPtyKeyFor,taskEngineArgv,unregisteredTabIds,wireSplit}from"./chunk-89xz7kc8.js";import{PLACEHOLDER_TASK_TITLE,SHELL_TASK_TITLE,deriveTitleFromPrompt}from"./chunk-4kepb278.js";import{ENGINE_ACTIVITY_KINDS,TASK_ACTIVITY_STATES}from"./chunk-zcywdm3y.js";import{canonicalize}from"./chunk-36qsn2v8.js";import{DIRTY_WORKTREE_CODE,EMPTY_BRANCH_DIRTY_WORKTREE_CODE}from"./chunk-8ca4esh6.js";import{canonicalEngineTab}from"./chunk-q8ffd1pc.js";import{ISSUE_STATUSES}from"./chunk-rh5024pb.js";import{isUngrouped}from"./chunk-hdea2ss8.js";import{fetchHeadlessGatewayEnv}from"./chunk-5p2hhjje.js";import{TERMINAL_IDS,ThemeInstallError,detectLocalTerminalThemes,detectTerminalTheme,installDetectedTerminalTheme}from"./chunk-0rfd9c8r.js";import{DEFAULT_FEEDBACK_KIND,FEEDBACK_KINDS,isFeedbackKind,submitFeedback}from"./chunk-0rfkgmns.js";import{upgradeMachine}from"./chunk-jpa26n83.js";import{GROUP_MOD,VERB_GROUP_IDS,cliCaller,helpStep,promptMayHaveLanded,requireVerbInstalled,splitDaemonCode,verbInstalled}from"./chunk-z0wnws9w.js";import{isBuiltinModInstalled}from"./chunk-v8nbqjwc.js";import{ROW_TOKEN_MAX_TEXT,ROW_TOKEN_TONES}from"./chunk-mdx18vtz.js";import{cloneDirFor,cloneRepo,dispatcherEnvPayload,findCheckouts,forwardVerb,isCleanCheckout,machineRequest,ownSession,parseRepoRef,pickCheckout,primaryCheckouts,readOwnDispatcher,recordSend,repoIdOf,repoIdentity,requireMachine,verifiedSelfSession}from"./chunk-t2f0xqyk.js";import{resolvePtyOwner,tasksAtWorktreePath}from"./chunk-y0e28qha.js";import{ApiError,taskArchivedError}from"./chunk-3vm6e0cf.js";import{ulid}from"./chunk-f1csqde7.js";import{RemoteEngineLaunchError,awaitEngineProcess,buildEngineSessionLaunch,deliverToHostedKey,enginePresence,ensureHostedSessionHost,findHostedEngineKey,hostedSessionFailureLine,hostedTaskKeys,initMarkerSaysFinished,isHostedTaskKey,killHostedSessions,launchReposOf,listHostedSessions,listHostedSessionsOrNull,openHostedSessionHost,pastePromptWhenEngineUp,readPersistedTerminalDefaultColors,repoEnv,screenErrorLine,sessionArgvNamesEngine,trustEngineWorktree,trustExtraRepos,withDeliveryLock}from"./chunk-pw0fvd64.js";import{GENERIC_PROTOCOL,describePreset,engineLaunchArgv,engineResumeArgv,listEnginePresets,protocolEntry,resolveCommandProtocol,roveApiInvocation,sessionProtocol,withPinnedSessionId}from"./chunk-9qye1syf.js";import{aliasKey,hostedKeyFor,isUnderKey,ptyScopeFor,unclaimedSessions}from"./chunk-tswzvtsy.js";import{resolveSessionShell}from"./chunk-tn9gtf18.js";import{engineProcessIn,foregroundEngineIn,parsePsSnapshot,psSnapshot,vendorFromArgv}from"./chunk-jgkjfqm9.js";import{CONTRIB_ENGINE_IDS,engineEntry,getCapabilities,installedEngineIds,remoteNotesFiles,supportsStructuredHistory,vendorsWithEffortLevels,vendorsWithTurnReader}from"./chunk-gxwy1r9a.js";import{forwardedMcp}from"./chunk-rr97z89e.js";import{createRemoteLink,linkedWorktree,readRemoteWorkspace,remotePathKey,remoteWorkspaceDir,removeRemoteLink}from"./chunk-03ab55aq.js";import{runAsync}from"./chunk-ve196r2v.js";import{normalizeRemoteUrl}from"./chunk-nr7c9q0j.js";import{isWindowsPath}from"./chunk-r478tzjz.js";import{dedupeMachines,listMachines,machineSshArgs}from"./chunk-navavqt2.js";import{terminalRows}from"./chunk-etfh8f4z.js";import{resolvePreferredVendor}from"./chunk-ez623zqp.js";import{addSavedRepo,getSavedRepos,inspectRepo,isGitRepo,isValidBranchName,resolveMainRepoRoot}from"./chunk-w70anvs6.js";import{isRemoteRepoKey}from"./chunk-4csg29es.js";import{readOnlyGitProcessEnv}from"./chunk-9k0r47z3.js";import{expandTilde}from"./chunk-grbrh92f.js";import{errorMessage,isDiskFull}from"./chunk-0zs13rdq.js";import{AUTOMATION_EVENT_KINDS,DELIVERY_OUTCOMES,DELIVERY_SUMMARY_MAX_CHARS,MAX_DELIVERIES_PER_TASK,ROUTINE_RESPONSE_MAX_CHARS,SHOULD_RUN_SKIP_EXIT_CODE,SKIP_REASONS,deliveryFooter,isAutomationEventKind}from"./chunk-vpy8tvfy.js";import{ROVE_API_VERSION}from"./chunk-96kvwzj8.js";import{CURRENT_VERSION}from"./chunk-aterhn60.js";import{parseBoolLiteral}from"./chunk-78y80xe8.js";import{loadStateFile}from"./chunk-12qq8r81.js";import{MULTI_REPO_CAP,canonicalPrUrl,gitRepoOf,lineageRootId,repoNameOf,rollupPr,taskCwd,taskRepos,todoCount,uniqueRepoName,workspaceCapabilities}from"./chunk-sckqk79z.js";import{DEFAULT_TASK_VENDOR}from"./chunk-w2czjjxy.js";import{ALL_VENDORS,DEFAULT_VENDOR,coerceVendorId}from"./chunk-8q0nmdh3.js";import{pathWithin,samePath}from"./chunk-pn5ygqn6.js";import{defaultDaemonSocketPath,defaultDesktopBrowserSocketPath}from"./chunk-gvxchzch.js";import{homeDir}from"./chunk-pzbcbmm4.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import{__require}from"./chunk-91sykzqq.js";import{readFileSync as readFileSync2}from"fs";import{resolve as resolve2}from"path";async function ptyScopeOf(daemon,task){let listed=await daemon.request("task.list",{}).catch(()=>({tasks:[]})),scope=ptyScopeFor(listed.tasks,task.id);return task.ptyAlias?{...scope,alias:task.ptyAlias}:scope}function noReplyAddress(self){return new ApiError(`task ${self.taskId} has no dispatcher on record, so a send without --task-id has no reply address`,"NO_REPLY_ADDRESS",{hint:`name the target with --task-id/--tab (see \`${ROVE_PRODUCT_NAME} api list\`), or notify the user with \`${ROVE_PRODUCT_NAME} api notify\``,nextCommandArgs:["api","list"]})}async function resolveDispatcherTab(runtime,daemon,dispatcher){let task=await daemon.request("task.get",{taskId:dispatcher.taskId}).then((res)=>res.task).catch(()=>null),{tabs,running}=await runtime.taskTabs(dispatcher.taskId,void 0,task?await ptyScopeOf(daemon,task):void 0);if(tabs.some((t)=>t.id===dispatcher.tabId&&t.alive))return dispatcher.tabId;if(running)return;throw new ApiError(`dispatcher tab ${dispatcher.tabId} on task ${dispatcher.taskId} is dead and the task has no live engine tab \u2014 the reply has nowhere to land`,"DISPATCHER_UNREACHABLE",{dispatcher,hint:`address an alive target explicitly with --task-id/--tab (see \`${ROVE_PRODUCT_NAME} api pty-list\`), or notify the user with \`${ROVE_PRODUCT_NAME} api notify\``,nextCommandArgs:["api","pty-list"]})}async function replyTabOf(runtime,daemon,taskId){let self=await ownSession(daemon);if(self?.taskId===taskId)return self.tabId;let task=await daemon.request("task.get",{taskId}).then((res)=>res.task).catch(()=>null);if(!task)return;let{tabs}=await runtime.taskTabs(taskId,taskEngineArgv(task),await ptyScopeOf(daemon,task));return tabs.find((t)=>t.kind==="engine"&&t.alive===!0&&t.engineAlive!==!1)?.id}async function withPeerProvenance(daemon,targetTaskId,prompt){let self=await ownSession(daemon),senderId=self?.taskId;if(!self||!senderId||senderId===targetTaskId)return prompt;let api=roveApiInvocation(),replyTarget=`--task-id ${senderId} --tab ${self.tabId}`;return`[ROVE PEER] from task ${senderId} (Rove agent skill /rove, read it once per session; reply only if it changes what I do next: \`${api} send ${replyTarget} --prompt "<text>"\`)
2
+ import{PER_SESSION,classifyTier,describeTierBlock,isAutoRoutingTier,listFiles,liveSourceProtocol,loadPreviewData,planWorktreeHandoff,readAutoRoutingTable,readClassifierConfig,resolveBase,runWorktreeGit,searchTasks,statusFiles,statusFilesBranch,taskGroupOf,tierBlock}from"./chunk-yg74j7kp.js";import{ensurePluginEnginesLoaded,registeredEngineIds}from"./chunk-c4c03wnz.js";import{listPaneLaunches}from"./chunk-jyrmdx8f.js";import{resolveActiveTaskId}from"./chunk-zswn8skz.js";import{detectEngineStatus,readEngineVersion}from"./chunk-2vk65d66.js";import{resolveEditorLaunch}from"./chunk-7fw390kp.js";import{DeviceLogin,GH_ENV,GITHUB_HOST,runTool,spawnGhLogin}from"./chunk-h58qkv3b.js";import{allocateTab,applyTabOps,closeTabsSnapshot,collapseSplit,engineTabArgv,findEditorTab,initialSplit,joinTaskTabs,leaves,markCliTabSession,patchTabSplit,publishCliTabSnapshot,readDaemonTabs,readTabsSnapshot,removeLeaf,renameLeaf,renameTabsSnapshot,seedCanonicalTab,seedShellHome,shellIdentityInput,shellTabInput,splitActive,splitLeafPtyKey,tabPtyKeyFor,taskEngineArgv,unregisteredTabIds,wireSplit}from"./chunk-89xz7kc8.js";import{PLACEHOLDER_TASK_TITLE,SHELL_TASK_TITLE,deriveTitleFromPrompt}from"./chunk-4kepb278.js";import{ENGINE_ACTIVITY_KINDS,TASK_ACTIVITY_STATES}from"./chunk-zcywdm3y.js";import{canonicalize}from"./chunk-36qsn2v8.js";import{DIRTY_WORKTREE_CODE,EMPTY_BRANCH_DIRTY_WORKTREE_CODE}from"./chunk-8ca4esh6.js";import{canonicalEngineTab}from"./chunk-q8ffd1pc.js";import{ISSUE_STATUSES}from"./chunk-rh5024pb.js";import{isUngrouped}from"./chunk-hdea2ss8.js";import{fetchHeadlessGatewayEnv}from"./chunk-5p2hhjje.js";import{TERMINAL_IDS,ThemeInstallError,detectLocalTerminalThemes,detectTerminalTheme,installDetectedTerminalTheme}from"./chunk-0rfd9c8r.js";import{DEFAULT_FEEDBACK_KIND,FEEDBACK_KINDS,isFeedbackKind,submitFeedback}from"./chunk-d32fc64g.js";import{upgradeMachine}from"./chunk-ypfvxnwf.js";import{GROUP_MOD,VERB_GROUP_IDS,cliCaller,helpStep,promptMayHaveLanded,requireVerbInstalled,splitDaemonCode,verbInstalled}from"./chunk-z0wnws9w.js";import{isBuiltinModInstalled}from"./chunk-v8nbqjwc.js";import{ROW_TOKEN_MAX_TEXT,ROW_TOKEN_TONES}from"./chunk-mdx18vtz.js";import{cloneDirFor,cloneRepo,dispatcherEnvPayload,findCheckouts,forwardVerb,isCleanCheckout,machineRequest,ownSession,parseRepoRef,pickCheckout,primaryCheckouts,readOwnDispatcher,recordSend,repoIdOf,repoIdentity,requireMachine,verifiedSelfSession}from"./chunk-t2f0xqyk.js";import{resolvePtyOwner,tasksAtWorktreePath}from"./chunk-y0e28qha.js";import{ApiError,taskArchivedError}from"./chunk-3vm6e0cf.js";import{ulid}from"./chunk-f1csqde7.js";import{RemoteEngineLaunchError,awaitEngineProcess,buildEngineSessionLaunch,deliverToHostedKey,enginePresence,ensureHostedSessionHost,findHostedEngineKey,hostedSessionFailureLine,hostedTaskKeys,initMarkerSaysFinished,isHostedTaskKey,killHostedSessions,launchReposOf,listHostedSessions,listHostedSessionsOrNull,openHostedSessionHost,pastePromptWhenEngineUp,readPersistedTerminalDefaultColors,repoEnv,screenErrorLine,sessionArgvNamesEngine,trustEngineWorktree,trustExtraRepos,withDeliveryLock}from"./chunk-pw0fvd64.js";import{GENERIC_PROTOCOL,describePreset,engineLaunchArgv,engineResumeArgv,listEnginePresets,protocolEntry,resolveCommandProtocol,roveApiInvocation,sessionProtocol,withPinnedSessionId}from"./chunk-9qye1syf.js";import{aliasKey,hostedKeyFor,isUnderKey,ptyScopeFor,unclaimedSessions}from"./chunk-tswzvtsy.js";import{resolveSessionShell}from"./chunk-tn9gtf18.js";import{engineProcessIn,foregroundEngineIn,parsePsSnapshot,psSnapshot,vendorFromArgv}from"./chunk-jgkjfqm9.js";import{CONTRIB_ENGINE_IDS,engineEntry,getCapabilities,installedEngineIds,remoteNotesFiles,supportsStructuredHistory,vendorsWithEffortLevels,vendorsWithTurnReader}from"./chunk-gxwy1r9a.js";import{forwardedMcp}from"./chunk-rr97z89e.js";import{createRemoteLink,linkedWorktree,readRemoteWorkspace,remotePathKey,remoteWorkspaceDir,removeRemoteLink}from"./chunk-03ab55aq.js";import{runAsync}from"./chunk-ve196r2v.js";import{normalizeRemoteUrl}from"./chunk-nr7c9q0j.js";import{isWindowsPath}from"./chunk-r478tzjz.js";import{dedupeMachines,listMachines,machineSshArgs}from"./chunk-navavqt2.js";import{terminalRows}from"./chunk-etfh8f4z.js";import{resolvePreferredVendor}from"./chunk-ez623zqp.js";import{addSavedRepo,getSavedRepos,inspectRepo,isGitRepo,isValidBranchName,resolveMainRepoRoot}from"./chunk-w70anvs6.js";import{isRemoteRepoKey}from"./chunk-4csg29es.js";import{readOnlyGitProcessEnv}from"./chunk-9k0r47z3.js";import{expandTilde}from"./chunk-grbrh92f.js";import{errorMessage,isDiskFull}from"./chunk-0zs13rdq.js";import{AUTOMATION_EVENT_KINDS,DELIVERY_OUTCOMES,DELIVERY_SUMMARY_MAX_CHARS,MAX_DELIVERIES_PER_TASK,ROUTINE_RESPONSE_MAX_CHARS,SHOULD_RUN_SKIP_EXIT_CODE,SKIP_REASONS,deliveryFooter,isAutomationEventKind}from"./chunk-vpy8tvfy.js";import{ROVE_API_VERSION}from"./chunk-96kvwzj8.js";import{CURRENT_VERSION}from"./chunk-v8bdmbb9.js";import{parseBoolLiteral}from"./chunk-78y80xe8.js";import{loadStateFile}from"./chunk-12qq8r81.js";import{MULTI_REPO_CAP,canonicalPrUrl,gitRepoOf,lineageRootId,repoNameOf,rollupPr,taskCwd,taskRepos,todoCount,uniqueRepoName,workspaceCapabilities}from"./chunk-sckqk79z.js";import{DEFAULT_TASK_VENDOR}from"./chunk-w2czjjxy.js";import{ALL_VENDORS,DEFAULT_VENDOR,coerceVendorId}from"./chunk-8q0nmdh3.js";import{pathWithin,samePath}from"./chunk-pn5ygqn6.js";import{defaultDaemonSocketPath,defaultDesktopBrowserSocketPath}from"./chunk-gvxchzch.js";import{homeDir}from"./chunk-pzbcbmm4.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import{__require}from"./chunk-91sykzqq.js";import{readFileSync as readFileSync2}from"fs";import{resolve as resolve2}from"path";async function ptyScopeOf(daemon,task){let listed=await daemon.request("task.list",{}).catch(()=>({tasks:[]})),scope=ptyScopeFor(listed.tasks,task.id);return task.ptyAlias?{...scope,alias:task.ptyAlias}:scope}function noReplyAddress(self){return new ApiError(`task ${self.taskId} has no dispatcher on record, so a send without --task-id has no reply address`,"NO_REPLY_ADDRESS",{hint:`name the target with --task-id/--tab (see \`${ROVE_PRODUCT_NAME} api list\`), or notify the user with \`${ROVE_PRODUCT_NAME} api notify\``,nextCommandArgs:["api","list"]})}async function resolveDispatcherTab(runtime,daemon,dispatcher){let task=await daemon.request("task.get",{taskId:dispatcher.taskId}).then((res)=>res.task).catch(()=>null),{tabs,running}=await runtime.taskTabs(dispatcher.taskId,void 0,task?await ptyScopeOf(daemon,task):void 0);if(tabs.some((t)=>t.id===dispatcher.tabId&&t.alive))return dispatcher.tabId;if(running)return;throw new ApiError(`dispatcher tab ${dispatcher.tabId} on task ${dispatcher.taskId} is dead and the task has no live engine tab \u2014 the reply has nowhere to land`,"DISPATCHER_UNREACHABLE",{dispatcher,hint:`address an alive target explicitly with --task-id/--tab (see \`${ROVE_PRODUCT_NAME} api pty-list\`), or notify the user with \`${ROVE_PRODUCT_NAME} api notify\``,nextCommandArgs:["api","pty-list"]})}async function replyTabOf(runtime,daemon,taskId){let self=await ownSession(daemon);if(self?.taskId===taskId)return self.tabId;let task=await daemon.request("task.get",{taskId}).then((res)=>res.task).catch(()=>null);if(!task)return;let{tabs}=await runtime.taskTabs(taskId,taskEngineArgv(task),await ptyScopeOf(daemon,task));return tabs.find((t)=>t.kind==="engine"&&t.alive===!0&&t.engineAlive!==!1)?.id}async function withPeerProvenance(daemon,targetTaskId,prompt){let self=await ownSession(daemon),senderId=self?.taskId;if(!self||!senderId||senderId===targetTaskId)return prompt;let api=roveApiInvocation(),replyTarget=`--task-id ${senderId} --tab ${self.tabId}`;return`[ROVE PEER] from task ${senderId} (Rove agent skill /rove, read it once per session; reply only if it changes what I do next: \`${api} send ${replyTarget} --prompt "<text>"\`)
3
3
 
4
4
  ${prompt}`}async function assertNotEmptySuccess(daemon,ctx,prompt){if(ctx.args.bool("allow-empty"))return;if(!/^\s*succeeded\s*[:\uff1a]/i.test(prompt))return;await refuseIfEmptyBranch(daemon,ctx,async()=>!0,["api","send",...ctx.args.str("task-id")?["--task-id",ctx.args.str("task-id")]:[],...ctx.args.str("tab")?["--tab",ctx.args.str("tab")]:[],"--allow-empty","--prompt",prompt])}async function assertNotEmptyDoneReport(daemon,ctx,report){if(ctx.args.bool("allow-empty")||report.outcome!=="done")return;await refuseIfEmptyBranch(daemon,ctx,async(taskId)=>{let{deliveries}=await daemon.request("delivery.list",{taskId});return deliveries.find((d)=>d.id===report.delivery)?.source==="send"},["api","report","--delivery",report.delivery,"--outcome","done","--summary",report.summary,...(report.evidence??[]).flatMap((e)=>["--evidence",e]),...report.next?["--next",report.next]:[],"--allow-empty"])}async function refuseIfEmptyBranch(daemon,ctx,applies,nextCommandArgs){let self=await ownSession(daemon);if(!self)return;let sender;try{if(!await applies(self.taskId))return;sender=(await daemon.request("task.get",{taskId:self.taskId})).task}catch{return}if(!workspaceCapabilities(sender).ownsBranch)return;if(!sender.worktreePath)return;let ahead;try{ahead=(await ctx.runtime.readBranchSignals(sender.worktreePath,sender.baseRef)).ahead}catch{return}if(ahead!==0)return;let branch=sender.branch||"your branch";throw new ApiError(`refusing to report success: ${branch} has 0 commits \u2014 "succeeded" means COMMITTED, and this report would reach the coordinator as a clean success with nothing to land`,"EMPTY_SUCCESS_REPORT",{taskId:self.taskId,branch,hint:"commit your work with a real message and run it again \u2014 or, if this task genuinely produced no commits (an investigation or a review), re-run with --allow-empty to say so explicitly",nextCommandArgs})}import{readFileSync}from"fs";import{isAbsolute,resolve}from"path";var FANOUT_CAP=10;function parsePositiveInt(raw){if(!/^\d+$/.test(raw.trim()))return;let n=Number.parseInt(raw,10);return Number.isSafeInteger(n)&&n>0?n:void 0}function parseNonNegativeInt(raw){if(!/^\d+$/.test(raw.trim()))return;let n=Number.parseInt(raw,10);return Number.isSafeInteger(n)&&n>=0?n:void 0}var FANOUT_STEP=helpStep("add"),F={repo:(required=!0)=>({name:"repo",type:"string",required,placeholder:"PATH",description:"Repo root (git toplevel). Relative paths resolve against $PWD."}),taskId:(required=!0)=>({name:"task-id",type:"string",required,placeholder:"ID",description:"Target task id (from `list` / `add`)."}),vendor:()=>({name:"vendor",type:"enum",values:ALL_VENDORS,placeholder:"V",description:"Engine vendor for the task."}),command:()=>({name:"command",type:"string",placeholder:"CMD",description:"Engine launch command, verbatim \u2014 an engine id from `engine-list` (e.g. claude) or a full command line (e.g. 'codex --search'). Unvalidated: probe an unfamiliar engine's flags with `<cmd> --help` first. Omitted = the repo's default engine."}),title:()=>({name:"title",type:"string",placeholder:"T",description:"Human task title."}),prompt:(required,desc)=>({name:"prompt",type:"string",required,placeholder:"TEXT",description:required?`${desc} Required unless --prompt-file is given.`:desc}),promptFile:()=>({name:"prompt-file",type:"string",placeholder:"PATH",description:"Read the prompt from this file instead of --prompt (`-` = stdin). Use it whenever the text has backticks, $vars, or quotes you don't want the shell to touch. Exactly one of --prompt / --prompt-file."})},REPEAT_SEP="\x00";function setFlag(flags,key,value,repeatable){let prev=flags.get(key);flags.set(key,repeatable.has(key)&&prev!==void 0?`${prev}${REPEAT_SEP}${value}`:value)}function parseFlags(argv,booleanFlags=new Set,repeatableFlags=new Set){let flags=new Map,pretty=!1,help=!1;for(let i=0;i<argv.length;i++){let arg=argv[i];if(!arg.startsWith("--")&&arg!=="-h")throw new ApiError(`unexpected positional arg: ${arg}`,"BAD_FLAG");if(arg==="-h"){help=!0;continue}let eq=arg.indexOf("=");if(eq!==-1){let key2=arg.slice(2,eq),value=arg.slice(eq+1);if(key2==="envelope")continue;if(key2==="pretty")pretty=value!=="false"&&value!=="0";else if(key2==="help")help=value!=="false"&&value!=="0";else setFlag(flags,key2,value,repeatableFlags);continue}let key=arg.slice(2);if(key==="envelope")continue;if(key==="pretty"){pretty=!0;continue}if(key==="help"){help=!0;continue}if(booleanFlags.has(key)){let next2=argv[i+1];if(next2!==void 0&&parseBoolLiteral(next2)!==void 0)flags.set(key,next2),i+=1;else flags.set(key,"true");continue}let next=argv[i+1];if(next===void 0||next.startsWith("--"))throw new ApiError(`flag --${key} requires a value`,"BAD_FLAG");setFlag(flags,key,next,repeatableFlags),i+=1}return{flags,pretty,help}}function validateAgainstSpec(verb,flags){let known=new Set(verb.flags.map((f)=>f.name));for(let key of flags.keys())if(!known.has(key))throw new ApiError(`unknown flag --${key} for "${verb.name}"`,"BAD_FLAG",helpStep(verb.name));for(let f of verb.flags){let satisfied=flags.get(f.name)||f.name==="prompt"&&flags.get("prompt-file")||verb.name==="add"&&f.name==="repo"&&(flags.get("fork")||flags.get("no-worktree")||flags.get("isolate-in")||flags.get("handoff-from"));if(f.required&&!satisfied)throw new ApiError(`--${f.name} is required for "${verb.name}"`,"MISSING_FLAG",helpStep(verb.name));if(f.type==="enum"&&f.values){let raw=flags.get(f.name);if(raw!==void 0&&!f.values.includes(raw)){if(f.name==="vendor"&&registeredEngineIds().includes(raw))continue;throw new ApiError(`--${f.name} must be one of ${f.values.join(", ")}`,"BAD_FLAG",helpStep(verb.name))}}if(f.type==="int"){let raw=flags.get(f.name);if(raw!==void 0&&parsePositiveInt(raw)===void 0)throw new ApiError(`--${f.name} must be a positive integer`,"BAD_FLAG")}if(f.type==="uint"){let raw=flags.get(f.name);if(raw!==void 0&&parseNonNegativeInt(raw)===void 0)throw new ApiError(`--${f.name} must be a non-negative integer`,"BAD_FLAG")}}}class VerbArgs{verb;flags;caller;constructor(verb,flags,caller=cliCaller()){this.verb=verb;this.flags=flags;this.caller=caller}resolvePath(name,raw){let expanded=expandTilde(raw);if(isAbsolute(expanded))return expanded;if(this.caller.cwd===void 0)throw new ApiError(`--${name} must be an absolute path: this caller has no working directory`,"BAD_FLAG");return resolve(this.caller.cwd,expanded)}spec(name){let f=this.verb.flags.find((s)=>s.name===name);if(!f)throw Error(`internal: --${name} is not declared on verb "${this.verb.name}"`);return f}str(name){this.spec(name);let v=this.flags.get(name);return v&&v.length>0?v:void 0}present(name){return this.spec(name),this.flags.get(name)!==void 0}list(name){if(!this.spec(name).repeatable)throw Error(`internal: --${name} is not repeatable on verb "${this.verb.name}"`);let raw=this.flags.get(name);return raw===void 0?[]:raw.split(REPEAT_SEP).filter((v)=>v.length>0)}promptText(){if(this.promptMemo!==void 0)return this.promptMemo.value;let value=this.readPromptText();return this.promptMemo={value},value}promptMemo;readPromptText(){let inline=this.verb.flags.some((f)=>f.name==="prompt")?this.str("prompt"):void 0,file=this.str("prompt-file");if(inline!==void 0&&file!==void 0)throw new ApiError("pass --prompt or --prompt-file, not both","BAD_FLAG",helpStep(this.verb.name));if(file===void 0)return inline;if(file==="-"&&!this.caller.cli)throw new ApiError("--prompt-file - reads stdin, which this caller cannot send; pass --prompt","BAD_FLAG");let text=readFileSync(file==="-"?0:this.resolvePath("prompt-file",file),"utf8");if(text.trim().length===0)throw new ApiError(`--prompt-file ${file} is empty`,"BAD_FLAG");return text}require(name){let v=this.str(name);if(v===void 0)throw new ApiError(`--${name} is required`,"MISSING_FLAG");return v}enumOf(name){let f=this.spec(name),v=this.str(name);if(v===void 0)return;if(f.values&&!f.values.includes(v))throw new ApiError(`--${name} must be one of ${f.values.join(", ")}`,"BAD_FLAG",helpStep(this.verb.name));return v}requireEnum(name){return this.require(name),this.enumOf(name)}vendor(){let value=this.str("vendor");if(value===void 0)return;let builtins=this.spec("vendor").values??ALL_VENDORS;if(builtins.includes(value))return value;if(registeredEngineIds().includes(value))return value;throw new ApiError(`--vendor must be a built-in (${builtins.join(", ")}) or a registered engine id \u2014 see \`engine-list\``,"BAD_FLAG",helpStep(this.verb.name))}bool(name){this.spec(name);let raw=this.str(name);if(raw===void 0)return;let value=parseBoolLiteral(raw);if(value===void 0)throw new ApiError(`--${name} must be a boolean (true/false)`,"BAD_FLAG");return value}int(name){this.spec(name);let raw=this.str(name);if(raw===void 0)return;let n=parsePositiveInt(raw);if(n===void 0)throw new ApiError(`--${name} must be a positive integer`,"BAD_FLAG");return n}nonNegativeInt(name){this.spec(name);let raw=this.str(name);if(raw===void 0)return;let n=parseNonNegativeInt(raw);if(n===void 0)throw new ApiError(`--${name} must be a non-negative integer`,"BAD_FLAG");return n}path(name){let v=this.str(name);return v===void 0?void 0:this.resolvePath(name,v)}requirePath(name){return this.resolvePath(name,this.require(name))}requireRepo(name){return this.repoPath(name,this.require(name))}repoPath(name,raw){return isRemoteRepoKey(raw)?raw:this.resolvePath(name,raw)}}function parseAgentsSpec(spec){let out=[];for(let part of spec.split(",")){let trimmed=part.trim();if(!trimmed)continue;let colon=trimmed.indexOf(":");if(colon===-1)throw new ApiError(`--agents entry "${trimmed}" must be engine:count`,"BAD_FLAG",FANOUT_STEP);let vendor=trimmed.slice(0,colon);if(!ALL_VENDORS.includes(vendor)&&!registeredEngineIds().includes(vendor))throw new ApiError(`--agents engine "${vendor}" must be a built-in (${ALL_VENDORS.join(", ")}) or a registered engine id \u2014 see \`engine-list\``,"BAD_FLAG",FANOUT_STEP);let count=parsePositiveInt(trimmed.slice(colon+1));if(count===void 0)throw new ApiError(`--agents count for "${vendor}" must be a positive integer`,"BAD_FLAG",FANOUT_STEP);if(out.length+count>FANOUT_CAP)throw new ApiError(`--agents requests ${out.length+count} agents, exceeds the cap of ${FANOUT_CAP}`,"BAD_FLAG",FANOUT_STEP);for(let i=0;i<count;i++)out.push(vendor)}if(out.length===0)throw new ApiError('--agents specified no agents (e.g. "claude:2,codex:1")',"BAD_FLAG",FANOUT_STEP);return out}function buildCountPlan(count,vendor){if(count>FANOUT_CAP)throw new ApiError(`--count ${count} exceeds the parallel cap of ${FANOUT_CAP} \u2014 spawn in batches`,"BAD_FLAG",FANOUT_STEP);return Array(count).fill(vendor)}function daemonOf(ctx){if(!ctx.client)throw new ApiError("daemon required","BAD_DAEMON");return ctx.client}async function taskToActOn(daemon,taskId){let{task}=await daemon.request("task.get",{taskId});if(task.archived===!0)throw taskArchivedError(taskId);return task}async function repoFilter(runtime,repoFlag,repos){let probe=await runtime.inspectRepo(repoFlag),target=probe.root;if(!probe.usable)throw new ApiError(`--repo ${repoFlag} is not a readable git repository (resolved to ${target}) \u2014 the project may have moved or been deleted; \`rove api list\` still shows its tasks`,"REPO_UNRESOLVABLE");let resolved=new Map,unresolvable=new Set;return await Promise.all([...new Set(repos)].map(async(repo)=>{if(samePath(repo,target)){resolved.set(repo,target);return}let{root,usable}=await runtime.inspectRepo(repo);if(resolved.set(repo,root),!samePath(root,target)&&!usable)unresolvable.add(repo)})),{target,matches:(repo)=>samePath(resolved.get(repo),target),unresolvableRepos:[...unresolvable].sort()}}async function simpleRpc(ctx,name,payload){let request=name;return daemonOf(ctx).request(request,payload)}async function handlePtyList(){let[{RoveDaemonClient},{defaultPtyHostSocketPath}]=await Promise.all([import("./chunk-0ccgkp9z.js"),import("./chunk-fdajxdht.js")]),client=new RoveDaemonClient(defaultPtyHostSocketPath());try{return await client.connect(),await client.request("pty.list",{})}catch{return{sessions:null}}finally{client.close()}}function readJsonBody(source){let raw=readFileSync2(source==="-"?0:resolve2(process.cwd(),expandTilde(source)),"utf8"),parsed;try{parsed=JSON.parse(raw)}catch{throw new ApiError(`--json ${source} is not valid JSON`,"BAD_FLAG")}if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))throw new ApiError("--json must be an object: {delivery, outcome, summary, evidence?, next?}","BAD_FLAG");let body=parsed,evidence=body.evidence;if(evidence!==void 0&&(!Array.isArray(evidence)||evidence.some((e)=>typeof e!=="string")))throw new ApiError("evidence must be an array of strings","BAD_FLAG");for(let key of["delivery","outcome","summary","next"])if(body[key]!==void 0&&typeof body[key]!=="string")throw new ApiError(`${key} must be a string`,"BAD_FLAG");return body}var FIELD_FLAGS=["delivery","outcome","summary","next"];function readBody(ctx){let json=ctx.args.str("json"),evidence=ctx.args.list("evidence");if(json===void 0)return{delivery:ctx.args.str("delivery"),outcome:ctx.args.str("outcome"),summary:ctx.args.str("summary"),evidence,next:ctx.args.str("next")};if(FIELD_FLAGS.some((f)=>ctx.args.str(f)!==void 0)||evidence.length>0)throw new ApiError("pass --json OR the individual flags, not both","BAD_FLAG");return readJsonBody(json)}async function report(ctx){let body=readBody(ctx);if(!body.delivery)throw new ApiError("--delivery is required","MISSING_FLAG");if(!body.outcome||!DELIVERY_OUTCOMES.includes(body.outcome))throw new ApiError(`--outcome must be one of ${DELIVERY_OUTCOMES.join("|")}`,"MISSING_FLAG");if(!body.summary?.trim())throw new ApiError("--summary is required","MISSING_FLAG");if(body.summary.length>DELIVERY_SUMMARY_MAX_CHARS)throw new ApiError(`summary is ${body.summary.length} characters; the cap is ${DELIVERY_SUMMARY_MAX_CHARS}`,"RESPONSE_TOO_LARGE",{hint:"Summarize: lead with the conclusion, put the detail in --evidence (commits, PR urls, paths)."});await assertNotEmptyDoneReport(daemonOf(ctx),ctx,{delivery:body.delivery,outcome:body.outcome,summary:body.summary,evidence:body.evidence,next:body.next});let res=await simpleRpc(ctx,"delivery.report",{deliveryId:body.delivery,outcome:body.outcome,summary:body.summary,...body.evidence?.length?{evidence:body.evidence}:{},...body.next?{next:body.next}:{}});if(res.delivery===null)throw new ApiError(`no delivery ${body.delivery}`,"DELIVERY_NOT_FOUND",{hint:"Copy the id from the [ROVE] report line of the prompt you were given; `deliveries --task-id <id>` lists them."});return res}var REPORT_VERB={name:"report",group:"drive",summary:`Close the report a delivered prompt asked for. Run it as the LAST step of the turn, before you stop: a turn that ends without it is flagged \`report_missing\` in the owner's Inbox (a [ROVE ROUTINE] turn with nothing to report just stops: its delivery goes \`quiet\`). --delivery is the id in the prompt's [ROVE] / [ROVE ROUTINE] line. Re-reporting replaces the earlier report; a late report on a flagged delivery clears the flag. --summary \u2264 ${DELIVERY_SUMMARY_MAX_CHARS} chars; put commits, PR urls, test results and paths in repeatable --evidence, and what the next tick should do in --next. Use --json - (stdin) for text with quotes or backticks. \`--outcome done\` on a \`send\` delivery from a managed task whose branch has 0 commits is REFUSED (EMPTY_SUCCESS_REPORT) \u2014 commit first, or pass --allow-empty when the task genuinely produced no commits.`,flags:[{name:"delivery",type:"string",placeholder:"ID",description:"Delivery id, e.g. d-41."},{name:"outcome",type:"enum",values:DELIVERY_OUTCOMES,placeholder:"O",description:"done = finished what was asked; partial = some of it; blocked = needs the owner or an external fix; failed = tried and could not."},{name:"summary",type:"string",placeholder:"TEXT",description:"What was done (or why not)."},{name:"evidence",type:"string",placeholder:"X",repeatable:!0,description:"A commit, PR url, test command + result, or file path. Repeat the flag for several."},{name:"next",type:"string",placeholder:"TEXT",description:"What the next tick should do."},{name:"allow-empty",type:"bool",required:!1,description:"Report `done` from a task with zero commits (EMPTY_SUCCESS_REPORT is refused otherwise, on a `send` delivery). For work that legitimately produces no commits \u2014 an investigation, a review, a question answered."},{name:"json",type:"string",placeholder:"PATH",description:"Read {delivery, outcome, summary, evidence?, next?} as JSON from this file (`-` = stdin) instead of the flags."}],handler:report},DELIVERIES_VERB={name:"deliveries",group:"read",summary:`A task's armed deliveries, newest first (newest ${MAX_DELIVERIES_PER_TASK} are kept): status awaiting|reported|missing|skipped, the report (outcome, summary, evidence, next) and, for missing, why (cause turn-complete|turn-failed|engine-dead|stalled|interrupted|session-end|rate-limited + note; rate-limited raises no Inbox row and does not block) plus dismissedAt once the owner dismissed it (a missing row blocks \`send --if-runnable\` and routine ticks until a late report or that dismissal). A skipped row is a \`send --if-runnable\` tick should-run refused: \`skipped\` is the verdict {reason, detail?, until?, gateIds?}, \`repeats\` how many identical refusals (same tab, same reason) the one row stands for. The per-tick log a loop prompt should read instead of a growing MEMO file.`,flags:[F.taskId(!0),{name:"limit",type:"int",placeholder:"N",description:"At most N entries (default: all retained)."}],handler:async(ctx)=>simpleRpc(ctx,"delivery.list",{taskId:ctx.args.require("task-id"),...ctx.args.int("limit")!==void 0?{limit:ctx.args.int("limit")}:{}})};async function listAllEnginePresets(){let presets=await enginePresetsInList(),byProtocol=new Map,modelsOf=(protocol)=>{let pending=byProtocol.get(protocol);if(!pending){let list=engineEntry(protocol).listModels;pending=list?list().catch(()=>null):Promise.resolve(null),byProtocol.set(protocol,pending)}return pending};return Promise.all(presets.map(async(preset)=>({...preset,models:await modelsOf(preset.protocol)})))}async function enginePresetsInList(){ensurePluginEnginesLoaded();let presets=[...listEnginePresets()],seen=new Set(presets.map((p)=>p.id));for(let id of await installedEngineIds())if(!seen.has(id))presets.push(describePreset(id));return presets}function withStatus(presets){return Promise.all(presets.map(async(preset)=>{let status=await detectEngineStatus(preset.id).catch(()=>null);if(!status)return preset;let installed=status.binary.found,version=await readEngineVersion(status.vendor,status.binary);return{...preset,installed,ready:installed&&status.account?.kind!=="none",...version?{version}:{}}}))}async function engineListIds(){return(await enginePresetsInList()).map((p)=>p.id)}var ENGINE_LIST_VERB={name:"engine-list",group:"discover",summary:`List every engine Rove can launch \u2014 built-ins, registered presets, the shipped contrib engines whose CLI is on PATH (${CONTRIB_ENGINE_IDS.join(", ")}), and engines contributed by enabled plugins \u2014 each with its RAW launch command, exactly as it runs. Copy one into \`add --command\` verbatim, or edit its flags first. \`protocol\` is the adapter Rove speaks to it (history, trust, delivery); \`generic\` = none, which still runs fine but loses transcript reads. \`models\` is what the engine can name for \`--model\` (suggestions, not a closed set); null = Rove cannot list them for this engine. --status adds \`installed\` (its CLI is on this machine), \`ready\` (installed, and signed in where Rove can read the login) and, where the CLI reports one, \`version\` to each. Returns { engines }.`,flags:[{name:"status",type:"bool",description:"Probe each engine on this machine: adds `installed` and `ready` to every row, and `version` where the CLI reports one. Slower: a missing CLI is also looked for in the login shell."}],offline:!0,handler:async(ctx)=>{let engines=await listAllEnginePresets();return{engines:ctx.args.bool("status")?await withStatus(engines):engines}}};function taskEngine(task){let command=task.command?.trim();if(command){let resolved=resolveCommandProtocol(command);if(resolved!==GENERIC_PROTOCOL)return resolved}return sessionProtocol(coerceVendorId(task.vendor))}function assertEngineAcceptsEffort(engine,level,recover){let levels=engineEntry(engine).effortLevels??[];if(levels.length===0)throw new ApiError(`engine ${engine} declares no reasoning effort levels`,"BAD_EFFORT",{engine,hint:`Only engines with declared reasoning levels accept one (${vendorsWithEffortLevels().join(", ")} today). Check the task's engine with \`get-task\`.`,nextCommandArgs:[...recover]});if(!levels.includes(level))throw new ApiError(`engine ${engine} does not accept effort level ${JSON.stringify(level)} \u2014 it declares ${levels.join(", ")}`,"BAD_EFFORT",{engine,levels,hint:`Pass one of: ${levels.join(", ")}.`,nextCommandArgs:[...recover]})}function assertEngineAcceptsModel(engine,model,recover){if(engineEntry(engine).modelArgv)return;throw new ApiError(`engine ${engine} declares no model flag \u2014 it does not accept a model`,"BAD_MODEL",{engine,hint:"Only engines that declare a model flag accept one; `engine-list` shows `models` per engine.",nextCommandArgs:[...recover]})}function vendorToRecord(task,engine){let recorded=coerceVendorId(task.vendor);return sessionProtocol(recorded)===engine?recorded:engine}async function readRunnability(daemon,taskId){try{return await daemon.request("task.runnability",{taskId})}catch{return}}async function shouldRun(ctx){let tab=ctx.args.str("tab");if(tab&&tab!=="new"&&!/^tab-[A-Za-z0-9-]+$/.test(tab))throw new ApiError(`--tab must be "new" or a tab id like tab-2 (got ${JSON.stringify(tab)})`,"BAD_TAB");let verdict=await daemonOf(ctx).request("task.runnability",{taskId:ctx.args.require("task-id"),...tab?{tabId:tab}:{}});if(!verdict.run)throw new ApiError(`skip: ${verdict.reason}`,"SKIPPED",{...verdict});return verdict}var SHOULD_RUN_VERB={name:"should-run",group:"read",summary:`Would a tick sent to this task be used? Prints the verdict {run:true} or {run:false, reason, detail?, until?, gateIds?} and exits 0 on run, ${SHOULD_RUN_SKIP_EXIT_CODE} on skip (the verdict is still on stdout). reason, first match wins: ${SKIP_REASONS.join(" | ")}. \`awaiting-owner\` = an open gate (answer or withdraw it), \`report-missing\` = the last delivery ended unreported (late \`report\`, or dismiss its Inbox row), \`quota\` clears itself at \`until\`, \`engine-error\` / \`engine-dead\` clear on the engine's next turn or a restart, \`awaiting-permission\` = the engine waits on an approval, \`busy\` = a turn is running or the last delivery still awaits its report. A task whose only gate is answered-but-undelivered is runnable: the next tick carries the answer. Without --tab the whole task is judged and a dead engine is not a skip (\`send\` revives it); --tab tab-N judges that tab and a dead engine is \`engine-dead\`; --tab new judges only task-level state. To check and send in one step use \`send --if-runnable\`.`,flags:[F.taskId(!0),{name:"tab",type:"string",required:!1,placeholder:"TAB",description:'Judge exactly this tab (e.g. tab-2), or "new" for a tab about to be created. Omitted = the whole task.'}],handler:shouldRun};async function attentionDismiss(ctx){let delivery=ctx.args.require("delivery");if((await daemonOf(ctx).request("attention.dismiss",{deliveryId:delivery})).found===!1)throw new ApiError(`no delivery ${delivery}`,"DELIVERY_NOT_FOUND",{hint:"`deliveries --task-id <id>` lists a task's delivery ids; the Inbox row names it as d-N."});return{ok:!0,delivery,cleared:!0}}var ATTENTION_DISMISS_VERB={name:"attention-dismiss",group:"drive",summary:'Dismiss a `report_missing` Inbox row by its delivery id (d-N): the owner\'s deliberate "seen, carry on" for a tick that ended without a report. It unblocks `should-run` for the task. Opening or visiting the row never does this, and a late `report` clears it on its own. Idempotent; an unknown id is DELIVERY_NOT_FOUND.',flags:[{name:"delivery",type:"string",required:!0,placeholder:"ID",description:"Delivery id, e.g. d-41."}],handler:attentionDismiss};async function handleThemeImport(ctx){if(ctx.args.bool("list"))return{terminals:detectLocalTerminalThemes().map((d)=>({id:d.id,label:d.label,configPath:d.configPath,themeName:d.themeName,...d.sourceTheme?{sourceTheme:d.sourceTheme}:{},...d.scheme.fontFamily?{fontFamily:d.scheme.fontFamily}:{},background:d.scheme.background,foreground:d.scheme.foreground,...d.scheme.cursor?{cursor:d.scheme.cursor}:{},ansiCount:d.scheme.ansi.filter(Boolean).length}))};let terminal=ctx.args.str("terminal"),detected=terminal?detectTerminalTheme(terminal):detectLocalTerminalThemes()[0]??null;if(!detected)throw new ApiError(terminal?`no readable color theme found for ${terminal}`:`no readable local terminal theme found (checked ${TERMINAL_IDS.join(", ")})`,"TERMINAL_NOT_FOUND",{hint:"run `rove api theme-import --list` to see which local terminal configs were detected",nextCommandArgs:["api","theme-import","--list"]});try{let result=installDetectedTerminalTheme(detected,{name:ctx.args.str("name"),force:ctx.args.bool("force"),activate:!ctx.args.bool("no-switch")});return{terminal:result.terminal,label:result.label,name:result.name,path:result.path,configPath:result.configPath,switched:result.activated,...result.sourceTheme?{sourceTheme:result.sourceTheme}:{},...result.fontFamily?{fontFamily:result.fontFamily}:{}}}catch(err){if(err instanceof ThemeInstallError){let code=err.message.includes("already exists")?"THEME_EXISTS":"BAD_THEME";throw new ApiError(err.message,code)}throw err}}var THEME_IMPORT_VERB={name:"theme-import",group:"edit",summary:"Auto-detect local terminal emulator configs (Ghostty, Kitty, Alacritty, WezTerm) and import one as a Rove theme (background, foreground, cursor, ANSI 16 colors, optional fontFamily). Switches Rove to the imported theme unless --no-switch is passed. Pass --list to inspect detected terminals without writing.",flags:[{name:"list",type:"bool",description:"List detected local terminal configs and their extracted colors/font without installing."},{name:"terminal",type:"enum",values:TERMINAL_IDS,placeholder:TERMINAL_IDS.join("|"),description:"Terminal emulator to import from. Omit to pick the first detected terminal."},{name:"name",type:"string",placeholder:"NAME",description:"Theme name under ~/.rove/themes/<name>.json (defaults to the terminal id)."},{name:"force",type:"bool",description:"Overwrite an existing user theme with the same name."},{name:"no-switch",type:"bool",description:"Install the theme without switching activeTheme in state.json."}],offline:!0,handler:handleThemeImport};import path from"path";var TASK_STATUSES=["backlog","in_progress","in_review","done","canceled","error"];var TASK_FIELDS=["title","branch","parent","project","no-project","command","model","effort","pinned","kept","connector","require-report","auto-fix-ci","status","progress"],REPORT_FLAGS=["report-branch","report-pr","report-summary"],PROGRESS_MAX=300;async function renameTab(ctx,taskId,tabId){let title=ctx.args.str("title"),others=[...TASK_FIELDS,...REPORT_FLAGS].filter((f)=>f!=="title"&&ctx.args.str(f)!==void 0);if(title===void 0||others.length>0)throw new ApiError("--tab only renames a tab: pass --title and no other field","BAD_FLAG",{hint:"Update the task's own fields in a separate call without --tab."});let daemon=daemonOf(ctx);if(!await renameTabsSnapshot(daemon,taskId,tabId,title))throw new ApiError(`task ${taskId} has no tab ${tabId}`,"TAB_NOT_FOUND",{hint:"`get-task` lists the addressable tab ids in .tabs[].id",nextCommandArgs:["api","get-task","--task-id",taskId]});let reply=await daemon.request("terminalTab.rename",{taskId,tabId,title});return{ok:!0,taskId,tabId,title,renamed:!0,clients:reply.clients??0}}async function resolveTarget(ctx,verb="update"){let explicit=ctx.args.str("task-id");if(explicit)return explicit;let self=await ownSession(daemonOf(ctx));if(!self)throw new ApiError("no --task-id given and the caller is not a verified rove session \u2014 pass --task-id ID","MISSING_TARGET",helpStep(verb));return self.taskId}async function projectRoot(ctx){let raw=ctx.args.str("project")?.trim();if(raw===void 0)return;if(raw==="")throw new ApiError("--project cannot be empty \u2014 pass the repo's path","BAD_FLAG");let root=await ctx.runtime.resolveRepoRoot(path.resolve(ctx.caller.cwd??process.cwd(),raw));if(!await ctx.runtime.isUsableRepo(root))throw new ApiError(`--project ${raw} is not inside a git repository`,"NOT_A_GIT_REPO",{hint:"clone or `git init` the project first, then pass its path"});return root}var NO_PARENT="none";async function reparentGroup(ctx,groupId){let parent=ctx.args.str("parent"),stray=["task-id","tab",...TASK_FIELDS.filter((f)=>f!=="parent"),...REPORT_FLAGS].filter((f)=>ctx.args.str(f)!==void 0);if(parent===void 0||parent===""||stray.length>0)throw new ApiError(`--group moves a whole fan-out round and takes only --parent ID (or \`none\`)${stray.length>0?` \u2014 drop ${stray.map((f)=>`--${f}`).join(", ")}`:""}`,"BAD_FLAG",helpStep("update"));let daemon=daemonOf(ctx),{tasks}=await daemon.request("task.list"),members=tasks.filter((t)=>t.groupId===groupId);if(members.length===0)throw new ApiError(`no tasks in group ${groupId}`,"TASK_NOT_FOUND",{hint:"the groupId is the one `add --count` returned; any surviving sibling's `.groupId` in `list` recovers it",nextCommandArgs:["api","list"]});if(members.some((t)=>t.id===parent))throw new ApiError(`${parent} is itself a member of group ${groupId} \u2014 a round cannot move under one of its own`,"PARENT_IN_GROUP",{hint:"pick a parent outside the round, or move the members one by one with --task-id"});let parentTaskId=parent===NO_PARENT?null:parent,replyTab=parentTaskId===null?void 0:await replyTabOf(ctx.runtime,daemon,parentTaskId),results=[],failures=0;for(let task of members)try{let moved=await simpleRpc(ctx,"task.setParent",{taskId:task.id,parentTaskId,...replyTab?{replyTab}:{}});results.push({taskId:task.id,status:"moved",...moved})}catch(err){failures++;let message=errorMessage(err),coded=err instanceof ApiError?{code:err.code,rest:message}:splitDaemonCode(message);results.push({taskId:task.id,status:"failed",error:coded?.rest??message,...coded?{code:coded.code}:{}})}return{ok:failures===0,groupId,count:members.length,failures,results}}async function updateTask(ctx){let group=ctx.args.str("group");if(group!==void 0)return reparentGroup(ctx,group);let tabId=ctx.args.str("tab"),taskId=tabId!==void 0?ctx.args.require("task-id"):await resolveTarget(ctx);if(tabId!==void 0)return renameTab(ctx,taskId,tabId);let title=ctx.args.str("title"),branch=ctx.args.str("branch"),parent=ctx.args.str("parent"),command=ctx.args.str("command")?.trim(),model=ctx.args.str("model")?.trim(),effort=ctx.args.str("effort")?.trim(),pinned=ctx.args.bool("pinned"),kept=ctx.args.bool("kept"),connector=ctx.args.str("connector")?.trim(),requireReport=ctx.args.enumOf("require-report"),autoFixCi=ctx.args.enumOf("auto-fix-ci"),status=ctx.args.enumOf("status"),progress=ctx.args.present("progress")?ctx.args.str("progress")??"":void 0,report2={reportBranch:ctx.args.str("report-branch"),reportPr:ctx.args.int("report-pr"),reportSummary:ctx.args.str("report-summary")},reporting=Object.values(report2).some((v)=>v!==void 0);if(TASK_FIELDS.every((f)=>ctx.args.str(f)===void 0)&&progress===void 0&&!reporting)throw new ApiError(`nothing to update \u2014 pass at least one of ${TASK_FIELDS.map((f)=>`--${f}`).join(", ")}`,"BAD_FLAG",{nextCommandArgs:["api","update","--help"]});if(reporting&&status===void 0)throw new ApiError("--report-* is recorded with a status: pass --status too","BAD_FLAG",{hint:"A worker reporting delivery usually passes --status in_review (or done)."});if(command==="")throw new ApiError("--command cannot be empty","BAD_FLAG");if(progress!==void 0&&progress.replace(/\s+/g," ").trim().length>PROGRESS_MAX)throw new ApiError(`--progress is one line of at most ${PROGRESS_MAX} characters`,"BAD_FLAG",{hint:"Say what is happening now; the full account belongs in the final report."});if(parent==="")throw new ApiError("--parent cannot be empty \u2014 pass a task id, or `none` for top level","BAD_FLAG");let daemon=daemonOf(ctx),protocol=command?resolveCommandProtocol(command):void 0,noProject=ctx.args.bool("no-project")===!0;if(noProject&&ctx.args.str("project")!==void 0)throw new ApiError("--project and --no-project conflict \u2014 pass one","CONFLICTING_FLAGS");let project=noProject?null:await projectRoot(ctx),task,engine;if(model!==void 0||effort!==void 0){task=(await daemon.request("task.get",{taskId})).task,engine=taskEngine(command?{...task,command}:task);let recover=["api","get-task","--task-id",taskId];if(model!==void 0)assertEngineAcceptsModel(engine,model,recover);if(effort!==void 0)assertEngineAcceptsEffort(engine,effort,recover)}let applied=[],step=async(fields,method,payload)=>{let reply;try{reply=await simpleRpc(ctx,method,{taskId,...payload})}catch(err){if(applied.length===0)throw err;let message=err instanceof Error?err.message:String(err),code=err instanceof ApiError?err.code:"PARTIAL_UPDATE";throw new ApiError(`--${fields.join("/--")} failed after ${applied.join(", ")} applied: ${message}`,code,{applied:[...applied],failed:fields})}return applied.push(...fields),reply},reparented;if(parent!==void 0){let parentTaskId=parent===NO_PARENT?null:parent,replyTab=parentTaskId===null?void 0:await replyTabOf(ctx.runtime,daemon,parentTaskId);reparented=await step(["parent"],"task.setParent",{parentTaskId,...replyTab?{replyTab}:{}})}let regrouped;if(project!==void 0)regrouped=await step([noProject?"no-project":"project"],"task.moveToProject",{repo:project});if(branch!==void 0)await step(["branch"],"task.setBranch",{branch});if(command)await step(["command"],"task.setCommand",{command,vendor:protocol});if(task&&engine){let recorded=vendorToRecord(protocol?{...task,vendor:protocol}:task,engine),fields=[...model!==void 0?["model"]:[],...effort!==void 0?["effort"]:[]];await step(fields,"task.setVendor",{vendor:recorded,model,effort})}if(title!==void 0)await step(["title"],"task.rename",{title});if(pinned!==void 0)await step(["pinned"],"task.pin",{pinned});if(kept!==void 0)await step(["kept"],"task.keep",{kept});if(connector!==void 0)await step(["connector"],"task.connector",{connector:connector===""||connector==="none"?null:connector});if(requireReport!==void 0)await step(["require-report"],"task.requireReport",{required:requireReport==="on"});if(autoFixCi!==void 0)await step(["auto-fix-ci"],"task.autoFixCi",{enabled:autoFixCi==="on"});if(status!==void 0)await step(["status"],"task.status",{status,...report2});if(progress!==void 0)await step(["progress"],"task.progress",{note:progress.trim()||null});return{ok:!0,taskId,updated:applied,...reparented?{parent:reparented}:{},...regrouped?{project:{repo:regrouped.repo,moved:regrouped.moved,note:"regrouped only \u2014 the PTYs, cwd, worktree and branch stay where they were"}}:{},...command?{command,protocol,...protocol===GENERIC_PROTOCOL?{generic:!0}:{}}:{},...engine?{engine}:{}}}var EDIT_VERBS=[{name:"update",group:"edit",summary:"Change a task's metadata \u2014 any combination of title, branch (git branch -m if materialized, else recorded), parent, engine --command / --model / --effort (take effect on the next session rebuild), pin, and status + worker report \u2014 in one call. The flags are checked before anything is written; then they apply in order parent \u2192 branch \u2192 engine \u2192 title/pin/status, and a refusal mid-way names what already applied (`applied`). --parent ID re-parents the task without touching its engine, tabs, worktree or branch: the stored parent is ID's top-level ancestor (children never nest, as with `add` from a child; the task's own children come along, listed in `.parent.moved`) and the task's reply address becomes ID itself, so its bare `send` reaches ID (the caller's own tab when run from inside ID, else ID's live engine tab, else tab-1). `--parent none` makes the task top level and drops a reply address that pointed into its old tree. A parent must live on the same machine as the task. Archiving the stored parent, or `delete --cascade` on it, takes the task along. --group G --parent ID moves a whole fan-out round instead and takes nothing else. With --tab, renames that Terminal Tab instead (the API twin of the TUI's f2) and takes only --title. The status is a cosmetic LABEL: `--status canceled` closes, stops and cleans up nothing \u2014 `delete` ends a task. The --report-* fields record what the WORKER CLAIMS it delivered (`.report` on `get-task` / `collect`), deliberately apart from `.prStatus`, which the daemon polled from the forge; they merge onto any previous report and need --status. --progress records what the worker is doing now as `.progress` ({ note, at }), shown by `context`: it is delivered to no tab, raises no Inbox row, and leaves the status and report alone, so it is the way to leave a progress line without interrupting the dispatcher. Returns { updated } \u2014 the fields written, in order.",flags:[{...F.taskId(!1),description:"Target task id (from `list` / `add`). Default: the calling session's own task, from the verified $ROVE_TASK_ID (an unverifiable env is MISSING_TARGET, never a guess)."},{name:"title",type:"string",placeholder:"T",description:"New task title (or, with --tab, the tab's name)."},{name:"tab",type:"string",placeholder:"TAB",description:"Rename this Terminal Tab (id from `get-task` .tabs[].id, e.g. tab-2) instead of the task; needs --task-id, and only --title may accompany it. TAB_NOT_FOUND when the task's snapshot names no such tab."},{name:"branch",type:"string",placeholder:"B",description:"New branch name."},{name:"parent",type:"string",placeholder:"ID|none",description:"Move the task under this task (its engine, tabs, worktree and branch stay as they are), or `none` to make it top level. Refusals: PARENT_NOT_FOUND, PARENT_IS_SELF, PARENT_CYCLE, TASK_NOT_MOVABLE, REMOTE_PARENT_UNSUPPORTED."},{name:"project",type:"string",placeholder:"PATH",description:"Move a top-level task (and its children) under the project at PATH (relative paths resolve against $PWD; any directory inside the repo names its main checkout), which becomes a project if it was not one. Only the grouping changes: the live session, tabs, cwd, worktree and branch stay exactly where they are, so a running engine keeps its conversation. Moving a worktree task back to the repo that cut it clears the link. Refusals: NOT_A_GIT_REPO, SAME_PROJECT, TASK_NOT_MOVABLE (a routine session or a multi-repo task), CHILD_NOT_MOVABLE (move its parent; children follow), REMOTE_MOVE_UNSUPPORTED."},{name:"no-project",type:"bool",description:"Move a top-level directory session (and its children) back into Ungrouped; the reverse of --project, with the same guarantee that nothing on disk or in the session moves. Worktree children stay in the repo that cut them and still show under it. `.project.repo` is null. Refusals: SAME_PROJECT (already Ungrouped), TASK_NOT_MOVABLE (a worktree session, a routine session or a multi-repo task), CHILD_NOT_MOVABLE, REMOTE_MOVE_UNSUPPORTED. Conflicts with --project (CONFLICTING_FLAGS)."},{name:"group",type:"string",placeholder:"GROUPID",description:"With --parent: move every task of one fan-out round (the `groupId` that `add --count` returns). Takes nothing but --parent; a member's refusal is recorded in `results`, and a parent inside the round is PARENT_IN_GROUP."},{...F.command(),description:"New engine launch command \u2014 an engine id from `engine-list` or a full command line. The protocol Rove speaks to it is derived from it; the result reports which (`generic: true` when the command names no engine Rove knows)."},{name:"model",type:"string",placeholder:"MODEL",description:"Pin a model, passed to the engine VERBATIM in its own spelling (claude alias or id, codex slug, pi/omp pattern); `engine-list` .models are suggestions, not a closed list. BAD_MODEL when the engine declares no model flag."},{name:"effort",type:"string",placeholder:"LEVEL",description:"Reasoning effort level the task's engine declares (codex: none/low/medium/high/xhigh/max; pi, omp: off/minimal/low/medium/high/xhigh/max; claude: low/medium/high/xhigh/max). BAD_EFFORT names the accepted levels."},{name:"pinned",type:"bool",placeholder:"BOOL",description:"true pins the task to the top of the sidebar, false unpins."},{name:"kept",type:"bool",placeholder:"BOOL",description:"true marks the task as the attempt kept from a parallel round (`add --count` / `--agents`); false clears the mark. A flag only: it archives nothing, and other attempts of the round are untouched."},{name:"connector",type:"string",placeholder:"ID",description:"Marks the task as the session a chat connector answers through (`weixin`, a plugin's id such as `lark`): its project sorts below every other in the sidebar. `none` clears it."},{name:"require-report",type:"enum",values:["on","off"],description:"on: every later `send` to this task arms a delivery the agent must close with `report --delivery <id>` (a turn that ends without one raises a `report_missing` Inbox row); off: back to plain sends."},{name:"auto-fix-ci",type:"enum",values:["on","off"],description:"on: when this task's PR checks go red on a new head sha and its engine is at rest, the daemon types the fix-CI prompt (with the failing logs) into the engine, at most once per sha and 3 times in all, then stops and raises an Inbox row; the count starts over when the checks pass. Never interrupts a running turn. off: stop and forget the count."},{name:"status",type:"enum",values:TASK_STATUSES,description:"New lifecycle label (cosmetic \u2014 see summary)."},{name:"report-branch",type:"string",placeholder:"B",description:"The branch the worker says holds the work (a CLAIM \u2014 `.branch` is the task's actual branch)."},{name:"report-pr",type:"int",placeholder:"N",description:"The PR number the worker says it opened (a CLAIM \u2014 `.prStatus.number` is what the daemon read from the forge)."},{name:"report-summary",type:"string",placeholder:"TEXT",description:"One line of what was delivered."},{name:"progress",type:"string",placeholder:"TEXT",description:"One line (at most 300 characters) of what the worker is doing now, replacing the previous one; '' clears it. Passive: read by `context` and `get-task`, delivered to no one."}],handler:updateTask}];async function todo(ctx){let{args}=ctx,taskId=await resolveTarget(ctx,"todo"),add=args.str("add"),check=args.str("check"),uncheck=args.str("uncheck"),edit=args.str("edit"),text=args.str("text"),remove=args.str("remove"),notes=args.bool("clear-notes")===!0?"":args.str("notes");if(edit===void 0!==(text===void 0))throw new ApiError("--edit ID and --text T go together","BAD_FLAG");let ops=[...add!==void 0?[{op:"add",text:add}]:[],...check!==void 0?[{op:"check",id:check,done:!0}]:[],...uncheck!==void 0?[{op:"check",id:uncheck,done:!1}]:[],...edit!==void 0&&text!==void 0?[{op:"edit",id:edit,text}]:[],...remove!==void 0?[{op:"remove",id:remove}]:[]],after=await simpleRpc(ctx,"task.notes",{taskId,...notes!==void 0?{notes}:{},...ops.length>0?{ops}:{}}),count=todoCount(after.todos);return{ok:!0,taskId,notes:after.notes??"",todos:after.todos,done:count?.done??0,total:count?.total??0}}var TODO_VERB={name:"todo",group:"edit",summary:"Read or change a task's notes and checklist \u2014 the owner's own review list (shown in the web Files panel's Notes tab and as `done/total` on the task row). With no flag it lists them. Flags combine in one call and apply together, in this order: --add, --check, --uncheck, --edit/--text, --remove; one refused op (TODO_NOT_FOUND, TODO_EMPTY, TODO_TOO_LONG, TODO_LIMIT) changes nothing. A todo id is `t<N>` as listed. Default target: the calling session's own task. Returns { ok, taskId, notes, todos: [{ id, text, done }], done, total }.",flags:[{...F.taskId(!1),description:"Target task id (from `list` / `add`). Default: the calling session's own task."},{name:"add",type:"string",placeholder:"TEXT",description:"Add an unchecked todo (one line, up to 500 characters; 100 per task)."},{name:"check",type:"string",placeholder:"ID",description:"Mark todo ID done."},{name:"uncheck",type:"string",placeholder:"ID",description:"Mark todo ID not done."},{name:"edit",type:"string",placeholder:"ID",description:"Change todo ID's text to --text."},{name:"text",type:"string",placeholder:"TEXT",description:"The new text for --edit."},{name:"remove",type:"string",placeholder:"ID",description:"Delete todo ID."},{name:"notes",type:"string",placeholder:"TEXT",description:"Replace the task's free-text notes (up to 20000 characters); Use --clear-notes to empty them."},{name:"clear-notes",type:"bool",description:"Empty the free-text notes."}],handler:todo};var API_SCHEMA_VERSION=ROVE_API_VERSION,GLOBAL_FLAGS=[{name:"pretty",type:"bool",description:"Pretty-print stdout JSON."},{name:"help",type:"bool",description:"Show usage for the verb and exit."},{name:"envelope",type:"bool",description:"Print every outcome as one { apiVersion, ok, result | error } on stdout \u2014 what the daemon's and the bridge's api.invoke return."},{name:"machine",type:"string",placeholder:"ALIAS",description:"Run the verb in that registered machine's daemon (`rove machine list`); paths are paths there. A --task-id on another machine goes there without it."}];function displayValues(f){if(!f.values)return;if(f.name!=="vendor")return f.values;let registered=registeredEngineIds().filter((id)=>!f.values.includes(id));return registered.length>0?[...f.values,...registered]:f.values}function flagJson(f){let values=displayValues(f);return{name:f.name,type:f.type,required:f.required??!1,...values?{values}:{},...f.default!==void 0?{default:f.default}:{},...f.placeholder?{placeholder:f.placeholder}:{},...f.repeatable?{repeatable:!0}:{},description:f.description}}function installedVerbs(){return VERBS.filter(verbInstalled)}function installedGroups(){return Object.fromEntries(Object.entries(VERB_GROUPS).filter(([group])=>{let mod=GROUP_MOD[group];return mod===void 0||isBuiltinModInstalled(mod)}))}function verbSchema(v){return{name:v.name,group:v.group,summary:v.summary,offline:v.offline??!1,cliOnly:v.cliOnly??!1,flags:v.flags.map(flagJson)}}function schemaIndex(){let cliName=ROVE_PRODUCT_NAME;return{apiVersion:API_SCHEMA_VERSION,roveVersion:CURRENT_VERSION,hint:`Compact index. Drill into ONE verb: \`${cliName} api schema --verb <name>\` (or \`${cliName} api <verb> --help\`). One group: \`--group <g>\`. Whole spec: \`--all\`.`,groups:installedGroups(),verbs:installedVerbs().map((v)=>({name:v.name,group:v.group,summary:v.summary})),globalFlags:GLOBAL_FLAGS,aliases:VERB_ALIASES}}function groupSchema(group){let verbs=VERBS.filter((v)=>v.group===group);if(verbs[0])requireVerbInstalled(verbs[0]);if(verbs.length===0)throw new ApiError(`unknown group: ${group}. Groups: ${Object.keys(installedGroups()).join(", ")}`,"BAD_VERB",{hint:"that group does not exist \u2014 the compact index lists every group and the verbs in it",nextCommandArgs:["api","schema"]});return{group,verbs:verbs.map((v)=>({name:v.name,summary:v.summary}))}}function fullSchema(){return{apiVersion:API_SCHEMA_VERSION,roveVersion:CURRENT_VERSION,output:{success:"one JSON object on stdout, newline-terminated, exit 0",error:'{"error":{"message","code"}} on stderr, exit != 0',pretty:"--pretty indents stdout JSON",envelope:'--envelope prints {"apiVersion","ok","result"} or {"apiVersion","ok","error"} on stdout instead, exit codes unchanged'},transports:{cli:"rove api <verb> --flag value",daemon:'socket request "api.invoke" {verb, params, machine?} \u2192 the envelope; params are keyed by flag name',bridge:'WebSocket op "api.invoke" {verb, params, machine?} \u2192 result, or the full error object'},globalFlags:GLOBAL_FLAGS,aliases:VERB_ALIASES,groups:installedGroups(),verbs:installedVerbs().map(verbSchema)}}function flagSignature(verb){return verb.flags.map((f)=>{let meta=f.type==="enum"&&f.values?displayValues(f).join("|"):f.placeholder??(f.type==="bool"?"":"X"),core=meta?`--${f.name} ${meta}`:`--${f.name}`;return f.required?core:`[${core}]`}).join(" ")}function verbHelp(verb){let lines=[`${ROVE_PRODUCT_NAME} api ${verb.name} ${flagSignature(verb)}`.trimEnd(),"",verb.summary,""],alias=Object.entries(VERB_ALIASES).find(([,canon])=>canon===verb.name)?.[0];if(alias)lines.push(`Alias: ${alias}`,"");if(verb.flags.length>0){lines.push("Flags:");for(let f of verb.flags){let req=f.required?" (required)":f.repeatable?" (repeatable)":"",def=f.default!==void 0?` [default: ${f.default}]`:"",vals=f.type==="enum"&&f.values?` {${displayValues(f).join("|")}}`:"";lines.push(` --${f.name}${vals}${req}${def} ${f.description}`)}lines.push("")}return lines.push("Global: [--pretty] [--help] [--envelope] [--machine ALIAS]"),lines.join(`
5
5
  `)}function apiUsage(){let cliName=ROVE_PRODUCT_NAME,rows=installedVerbs().map((v)=>` ${v.name.padEnd(18)} ${v.summary}`);return[`usage: ${cliName} api <verb> [flags] [--pretty] [--help]`,"",`Explore the full surface (names, flags, types) with: ${cliName} api schema`,"","verbs:",...rows,"","Output is one JSON object on stdout (exit 0); errors are JSON on stderr (exit != 0)."].join(`
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{isDev}from"./chunk-pzbcbmm4.js";import{fileURLToPath}from"url";var package_default={$schema:"https://json.schemastore.org/package.json",name:"@sma1lboy/rove",version:"0.9.311-next.651",description:"Rove: all your coding agents, in one place. An agentic development environment (ADE) for your terminal: Claude Code, Codex, Copilot and more, side by side in isolated worktrees, handing tasks to each other.",keywords:["terminal","tui","cli","ade","agentic-development-environment","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/voice","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","rove-bench":"bun --conditions=browser scripts/rove-bench.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","check:preview-deps":"bun run scripts/check-preview-deps.ts",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.8.4","@opentui/react":"0.8.4","@xterm/addon-serialize":"^0.14.0","@xterm/addon-unicode11":"^0.9.0","@xterm/headless":"^6.0.0",react:"^19.2.8","smol-toml":"^1.7.1",ws:"^8.21.3",yaml:"^2.9.0"},optionalDependencies:{"@sma1lboy/opentui-rove-darwin-arm64":"0.8.4-rove.1","@sma1lboy/opentui-rove-linux-x64":"0.8.4-rove.1","node-pty":"^1.1.0"},devDependencies:{"@biomejs/biome":"1.9.4","@sma1lboy/rove-api":"0.0.1","@sma1lboy/rove-client":"0.0.1","@sma1lboy/rove-core":"0.0.1","@sma1lboy/rove-daemon":"0.7.23","@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.71","rove-lark":"0.0.6","rove-weixin":"0.0.71",typescript:"5.8.2",vitest:"2.1.9"},trustedDependencies:[]};var RELEASE_CHANNELS=["latest","next","nightly"],DEFAULT_RELEASE_CHANNEL="latest";function channelFor(version){let dash=version.indexOf("-"),tag=dash===-1?void 0:version.slice(dash+1).split(".")[0];return tag==="nightly"||tag==="next"?tag:"latest"}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 updateCommandFor(target){return target===void 0||target===DEFAULT_RELEASE_CHANNEL?UPDATE_COMMAND:`${UPDATE_COMMAND} -s -- ${target}`}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,PACKUMENT_TIMEOUT_MS=15000;function channelOf(version=CURRENT_VERSION){return channelFor(version)}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)}}async function fetchPublishedAt(packageName,version){let ctrl=new AbortController,timer=setTimeout(()=>ctrl.abort(),PACKUMENT_TIMEOUT_MS);try{let encoded=packageName.replace("/","%2F"),res=await fetch(`https://registry.npmjs.org/${encoded}`,{signal:ctrl.signal,headers:{accept:"application/json"}});if(!res.ok)return null;let stamp=(await res.json()).time?.[version],ms=typeof stamp==="string"?Date.parse(stamp):Number.NaN;return Number.isFinite(ms)?ms:null}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;let hasUpdate=isNewerSemver(latest,CURRENT_VERSION),minAgeMs=(opts.minAgeHours??0)*3600000;if(hasUpdate&&minAgeMs>0){let publishedAt=await fetchPublishedAt(PACKAGE_NAME,latest),now=(opts.now??Date.now)();if(publishedAt!==null&&now-publishedAt<minAgeMs)hasUpdate=!1}return{current:CURRENT_VERSION,latest,hasUpdate,channel}}function versionFromTagName(tagName,channel){if(typeof tagName!=="string")return null;let match=tagName.match(/^v\d+\.\d+\.\d+(?:-([a-z]+)\.\d+)?$/);if(!match||match[1]&&match[1]!==channel)return null;return tagName.slice(1)}var ZH_NOTES_ASSET="release-notes.zh.md";async function notesBody(release,locale,signal){if(locale!=="zh"||!Array.isArray(release.assets))return release.body;let asset=release.assets.find((a)=>a.name===ZH_NOTES_ASSET);if(typeof asset?.browser_download_url!=="string")return release.body;try{let res=await fetch(asset.browser_download_url,{signal}),text=res.ok?await res.text():"";return text.trim()?text:release.body}catch{return release.body}}async function fetchReleaseNotes(version,locale="en"){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:await notesBody({...body,body:body.body},locale,ctrl.signal),url:body.html_url,version}}catch{return null}finally{clearTimeout(timer)}}var RELEASES_PER_PAGE=100,MAX_RELEASE_PAGES=10;async function walkReleases(visit){let slug=repoSlug();if(!slug)return;for(let page=1;page<=MAX_RELEASE_PAGES;page++){let body;try{let res=await fetch(`https://api.github.com/repos/${slug}/releases?per_page=${RELEASES_PER_PAGE}&page=${page}`,{signal:AbortSignal.timeout(FETCH_TIMEOUT_MS),headers:{accept:"application/vnd.github+json","x-github-api-version":"2022-11-28"}});if(!res.ok)return;body=await res.json()}catch{return}if(!Array.isArray(body))return;for(let release of body)if(!visit(release))return;if(body.length<RELEASES_PER_PAGE)return}}async function fetchReleaseNotesRange(args){let channel=channelFor(args.latest),inRange=[];await walkReleases((release)=>{let version=versionFromTagName(release.tag_name,channel);if(!version)return!0;if(!isNewerSemver(version,args.current))return!1;if(isNewerSemver(version,args.latest))return!0;if(typeof release.html_url==="string"&&typeof release.body==="string")inRange.push({version,url:release.html_url,release:{...release,body:release.body}});return!0});let signal=AbortSignal.timeout(FETCH_TIMEOUT_MS);return Promise.all(inRange.map(async({version,url,release})=>({version,url,body:await notesBody(release,args.locale??"en",signal)})))}async function fetchReleaseSummaries(limit=12){let summaries=[];return await walkReleases((release)=>{let version=versionFromTagName(release.tag_name);if(version&&typeof release.html_url==="string")summaries.push({version,url:release.html_url});return summaries.length<limit}),summaries}function releasePageUrl(version){let slug=repoSlug();if(!slug)return null;return`https://github.com/${slug}/releases/tag/v${version}`}
3
+ export{package_default,RELEASE_CHANNELS,DEFAULT_RELEASE_CHANNEL,CURRENT_VERSION,PACKAGE_NAME,repoSlug,UPDATE_SCRIPT_URL,UPDATE_COMMAND,updateCommandFor,owningNpmPrefix,recommendedGlobalInstallCommand,BREAKING_VERSIONS,breakingVersionsCrossed,channelOf,isNewerSemver,compareSemver,checkLatestVersion,ZH_NOTES_ASSET,fetchReleaseNotes,fetchReleaseNotesRange,fetchReleaseSummaries,releasePageUrl};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{formatBytes}from"./chunk-8r6qfz40.js";import{hookConfigIssues}from"./chunk-n9d40jze.js";import{inspectLegacyTmux,legacyTmuxDoctorLines}from"./chunk-gkdfct7t.js";import"./chunk-140pf8yx.js";import"./chunk-yprn97vs.js";import"./chunk-a4hsqj1b.js";import"./chunk-97fhq6zk.js";import"./chunk-wcjpanrw.js";import"./chunk-rmnm3f9n.js";import{skillOverview}from"./chunk-yn7y3epg.js";import"./chunk-ex2qtjt3.js";import{applyFixes,daemonRestartFix,defaultFixRuntime,engineTabsManualFix,humanOnlyFix,killOrphansManualFix,noEngineFix,reinstallManualFix,resetManualFix,skillInstallFix,spawnHelperFix}from"./chunk-a2m6sk0n.js";import"./chunk-cpgnm1xr.js";import"./chunk-r3s2t9af.js";import"./chunk-6xr1prk6.js";import{describeAccount,detectEngineStatuses,probeableEngineIds,summarizeEngines,withEngineVersions}from"./chunk-2vk65d66.js";import"./chunk-q8ffd1pc.js";import"./chunk-rh5024pb.js";import"./chunk-hdea2ss8.js";import"./chunk-d1vv8xk6.js";import"./chunk-2bgmby1d.js";import"./chunk-bwgtbaex.js";import"./chunk-5mhvjytn.js";import"./chunk-zknvzer3.js";import"./chunk-v8nbqjwc.js";import"./chunk-ws2q07kb.js";import"./chunk-mdx18vtz.js";import"./chunk-y0e28qha.js";import"./chunk-9qye1syf.js";import{resolveNodeBinary}from"./chunk-tswzvtsy.js";import"./chunk-69cqwz53.js";import"./chunk-mqfvzdpr.js";import{formatDaemonInfo}from"./chunk-rxqdw6s5.js";import"./chunk-tn9gtf18.js";import"./chunk-jgkjfqm9.js";import"./chunk-gxwy1r9a.js";import"./chunk-f60hmm20.js";import"./chunk-w7zv47mp.js";import"./chunk-rr97z89e.js";import"./chunk-03ab55aq.js";import"./chunk-ve196r2v.js";import"./chunk-nr7c9q0j.js";import"./chunk-r478tzjz.js";import"./chunk-navavqt2.js";import"./chunk-fyxfgkrw.js";import"./chunk-etfh8f4z.js";import"./chunk-w70anvs6.js";import"./chunk-4csg29es.js";import"./chunk-dmzg9zdc.js";import"./chunk-h8qg9v95.js";import"./chunk-kg9kmwt9.js";import"./chunk-0zs13rdq.js";import"./chunk-1wpwxcg9.js";import"./chunk-ypbh8ra4.js";import{isStaleInstallError,resolveRoveSpawn}from"./chunk-06cpc990.js";import"./chunk-xc2zndmb.js";import"./chunk-zpwg3eh0.js";import{RoveDaemonClient,isForeignDaemonHome}from"./chunk-vpy8tvfy.js";import"./chunk-96kvwzj8.js";import{CURRENT_VERSION,package_default}from"./chunk-aterhn60.js";import"./chunk-78y80xe8.js";import"./chunk-wx77yjhc.js";import"./chunk-12qq8r81.js";import{t}from"./chunk-z343ngx6.js";import"./chunk-7b2x6nkj.js";import"./chunk-3fzrgjxr.js";import"./chunk-96wm6gt4.js";import"./chunk-6hjt5an9.js";import"./chunk-ptyqj15s.js";import"./chunk-jykxdtad.js";import{readableLegacyIndexPath}from"./chunk-65nm1v5h.js";import"./chunk-sckqk79z.js";import"./chunk-w2czjjxy.js";import"./chunk-8q0nmdh3.js";import"./chunk-8rxg12aj.js";import"./chunk-bzqjk9fb.js";import"./chunk-4y536nwm.js";import"./chunk-pn5ygqn6.js";import"./chunk-a6z2ggxd.js";import"./chunk-spr6z826.js";import{readPidFile}from"./chunk-ydxq51g3.js";import"./chunk-yt15y085.js";import{defaultDaemonLogPath,defaultDaemonPidPath,defaultDaemonSocketPath,defaultPtyHostLogPath,defaultPtyHostPidPath,defaultPtyHostSocketPath}from"./chunk-gvxchzch.js";import{homeDir,kvStatePath,roveStateDir}from"./chunk-pzbcbmm4.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import{preRenameStateDir}from"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-ksx55wt3.js";import{__require}from"./chunk-91sykzqq.js";import{existsSync,readFileSync as readFileSync2,statSync as statSync2}from"fs";import{join as join2}from"path";var MIN_BUN_VERSION=package_default.engines.bun.match(/\d+\.\d+\.\d+/)?.[0]??"0.0.0";function parseBunVersion(raw){return raw.trim().match(/^v?(\d+\.\d+\.\d+)/)?.[1]??null}function isBunAtLeast(raw,minimum=MIN_BUN_VERSION){let found=parseBunVersion(raw),floor=parseBunVersion(minimum);if(!found||!floor)return!0;let a=found.split(".").map(Number),b=floor.split(".").map(Number);for(let i=0;i<3;i++){let av=a[i]??0,bv=b[i]??0;if(av!==bv)return av>bv}return!0}function classifyHookChannel(input){let total=0,hooked=0;for(let tabs of Object.values(input.tabs))for(let entry of Object.values(tabs))if(total++,entry.source==="hook")hooked++;if(total===0)return{kind:"no-tabs"};if(hooked===0)return{kind:"down",totalTabs:total};return{kind:"live",hookTabs:hooked,totalTabs:total}}function hookChannelDoctorLines(verdict,input,cliName){let configLines=(input.configIssues??[]).flatMap((issue)=>[` \u26A0 hook install skipped: ${issue.file}`,` ${issue.reason} \u2014 fix the file, then relaunch Rove`]);if(verdict.kind==="no-tabs")return["hooks: \u2014 no engine tabs yet (nothing to check)",...configLines];if(verdict.kind==="live")return[`hooks: \u2713 engine hook channel live (${verdict.hookTabs}/${verdict.totalTabs} tab(s) hook-sourced)`,...configLines];let out=[`hooks: \u2717 NO hook events reaching the daemon (0/${verdict.totalTabs} tab(s) hook-sourced)`," badges fall back to a ~10s poll, so activity looks seconds late",` daemon socket: ${input.socketPath}`,...configLines];return out.push(' \u2192 compare with an engine tab\'s own path: `ps eww -p <engine-pid> | tr " " "\\n" | grep DAEMON_SOCKET_PATH`',` \u2192 restart the engine tabs (they may hold a stale socket path), or run \`${cliName} daemon restart\``,` \u2192 debug one hook directly: \`ROVE_HOOK_DEBUG=1 echo '{}' | ${cliName} hook turn-start --engine claude\``),out}import{readdirSync,statSync}from"fs";import{createRequire}from"module";import{dirname,join}from"path";function installedSpawnHelpers(){let pkg;try{pkg=dirname(createRequire(import.meta.url).resolve("node-pty/package.json"))}catch{return[]}let prebuilds=join(pkg,"prebuilds"),arches;try{arches=readdirSync(prebuilds).filter((name)=>name.startsWith("darwin-"))}catch{return[]}let helpers=[];for(let arch of arches){let path=join(prebuilds,arch,"spawn-helper");try{helpers.push({path,executable:(statSync(path).mode&64)!==0})}catch{}}return helpers}function spawnHelperDoctorLines(helpers){let broken=helpers.filter((helper)=>!helper.executable).map((helper)=>helper.path);if(helpers.length===0)return{lines:["node-pty: ? no darwin spawn-helper found next to node-pty"],broken};if(broken.length===0)return{lines:[`node-pty: \u2713 spawn-helper executable (${helpers.length} arch)`],broken};return{lines:["node-pty: \u2717 spawn-helper is not executable \u2014 every node-pty PTY spawn fails",...broken.map((path)=>` ${path}`),` \u2192 chmod 755 ${broken.join(" ")}`],broken}}import{appendFileSync,readFileSync}from"fs";var PTY_MARKER="ROVE_TERMINAL_PTY=1",run=async(argv)=>{try{let proc=Bun.spawn([...argv],{stdin:"ignore",stdout:"pipe",stderr:"ignore"}),[stdout,code]=await Promise.all([new Response(proc.stdout).text().catch(()=>""),proc.exited]);return{code,stdout}}catch{return{code:127,stdout:""}}};function parsePsRows(output){let rows=[];for(let line of output.split(`
2
+ import{formatBytes}from"./chunk-8r6qfz40.js";import{hookConfigIssues}from"./chunk-n9d40jze.js";import{inspectLegacyTmux,legacyTmuxDoctorLines}from"./chunk-gkdfct7t.js";import"./chunk-140pf8yx.js";import"./chunk-yprn97vs.js";import"./chunk-a4hsqj1b.js";import"./chunk-97fhq6zk.js";import"./chunk-wcjpanrw.js";import"./chunk-rmnm3f9n.js";import{skillOverview}from"./chunk-yn7y3epg.js";import"./chunk-ex2qtjt3.js";import{applyFixes,daemonRestartFix,defaultFixRuntime,engineTabsManualFix,humanOnlyFix,killOrphansManualFix,noEngineFix,reinstallManualFix,resetManualFix,skillInstallFix,spawnHelperFix}from"./chunk-a2m6sk0n.js";import"./chunk-cpgnm1xr.js";import"./chunk-r3s2t9af.js";import"./chunk-6xr1prk6.js";import{describeAccount,detectEngineStatuses,probeableEngineIds,summarizeEngines,withEngineVersions}from"./chunk-2vk65d66.js";import"./chunk-q8ffd1pc.js";import"./chunk-rh5024pb.js";import"./chunk-hdea2ss8.js";import"./chunk-d1vv8xk6.js";import"./chunk-2bgmby1d.js";import"./chunk-bwgtbaex.js";import"./chunk-5mhvjytn.js";import"./chunk-zknvzer3.js";import"./chunk-v8nbqjwc.js";import"./chunk-ws2q07kb.js";import"./chunk-mdx18vtz.js";import"./chunk-y0e28qha.js";import"./chunk-9qye1syf.js";import{resolveNodeBinary}from"./chunk-tswzvtsy.js";import"./chunk-69cqwz53.js";import"./chunk-mqfvzdpr.js";import{formatDaemonInfo}from"./chunk-rxqdw6s5.js";import"./chunk-tn9gtf18.js";import"./chunk-jgkjfqm9.js";import"./chunk-gxwy1r9a.js";import"./chunk-f60hmm20.js";import"./chunk-w7zv47mp.js";import"./chunk-rr97z89e.js";import"./chunk-03ab55aq.js";import"./chunk-ve196r2v.js";import"./chunk-nr7c9q0j.js";import"./chunk-r478tzjz.js";import"./chunk-navavqt2.js";import"./chunk-fyxfgkrw.js";import"./chunk-etfh8f4z.js";import"./chunk-w70anvs6.js";import"./chunk-4csg29es.js";import"./chunk-dmzg9zdc.js";import"./chunk-h8qg9v95.js";import"./chunk-kg9kmwt9.js";import"./chunk-0zs13rdq.js";import"./chunk-1wpwxcg9.js";import"./chunk-ypbh8ra4.js";import{isStaleInstallError,resolveRoveSpawn}from"./chunk-06cpc990.js";import"./chunk-xc2zndmb.js";import"./chunk-zpwg3eh0.js";import{RoveDaemonClient,isForeignDaemonHome}from"./chunk-vpy8tvfy.js";import"./chunk-96kvwzj8.js";import{CURRENT_VERSION,package_default}from"./chunk-v8bdmbb9.js";import"./chunk-78y80xe8.js";import"./chunk-wx77yjhc.js";import"./chunk-12qq8r81.js";import{t}from"./chunk-z343ngx6.js";import"./chunk-7b2x6nkj.js";import"./chunk-3fzrgjxr.js";import"./chunk-96wm6gt4.js";import"./chunk-6hjt5an9.js";import"./chunk-ptyqj15s.js";import"./chunk-jykxdtad.js";import{readableLegacyIndexPath}from"./chunk-65nm1v5h.js";import"./chunk-sckqk79z.js";import"./chunk-w2czjjxy.js";import"./chunk-8q0nmdh3.js";import"./chunk-8rxg12aj.js";import"./chunk-bzqjk9fb.js";import"./chunk-4y536nwm.js";import"./chunk-pn5ygqn6.js";import"./chunk-a6z2ggxd.js";import"./chunk-spr6z826.js";import{readPidFile}from"./chunk-ydxq51g3.js";import"./chunk-yt15y085.js";import{defaultDaemonLogPath,defaultDaemonPidPath,defaultDaemonSocketPath,defaultPtyHostLogPath,defaultPtyHostPidPath,defaultPtyHostSocketPath}from"./chunk-gvxchzch.js";import{homeDir,kvStatePath,roveStateDir}from"./chunk-pzbcbmm4.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import{preRenameStateDir}from"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-ksx55wt3.js";import{__require}from"./chunk-91sykzqq.js";import{existsSync,readFileSync as readFileSync2,statSync as statSync2}from"fs";import{join as join2}from"path";var MIN_BUN_VERSION=package_default.engines.bun.match(/\d+\.\d+\.\d+/)?.[0]??"0.0.0";function parseBunVersion(raw){return raw.trim().match(/^v?(\d+\.\d+\.\d+)/)?.[1]??null}function isBunAtLeast(raw,minimum=MIN_BUN_VERSION){let found=parseBunVersion(raw),floor=parseBunVersion(minimum);if(!found||!floor)return!0;let a=found.split(".").map(Number),b=floor.split(".").map(Number);for(let i=0;i<3;i++){let av=a[i]??0,bv=b[i]??0;if(av!==bv)return av>bv}return!0}function classifyHookChannel(input){let total=0,hooked=0;for(let tabs of Object.values(input.tabs))for(let entry of Object.values(tabs))if(total++,entry.source==="hook")hooked++;if(total===0)return{kind:"no-tabs"};if(hooked===0)return{kind:"down",totalTabs:total};return{kind:"live",hookTabs:hooked,totalTabs:total}}function hookChannelDoctorLines(verdict,input,cliName){let configLines=(input.configIssues??[]).flatMap((issue)=>[` \u26A0 hook install skipped: ${issue.file}`,` ${issue.reason} \u2014 fix the file, then relaunch Rove`]);if(verdict.kind==="no-tabs")return["hooks: \u2014 no engine tabs yet (nothing to check)",...configLines];if(verdict.kind==="live")return[`hooks: \u2713 engine hook channel live (${verdict.hookTabs}/${verdict.totalTabs} tab(s) hook-sourced)`,...configLines];let out=[`hooks: \u2717 NO hook events reaching the daemon (0/${verdict.totalTabs} tab(s) hook-sourced)`," badges fall back to a ~10s poll, so activity looks seconds late",` daemon socket: ${input.socketPath}`,...configLines];return out.push(' \u2192 compare with an engine tab\'s own path: `ps eww -p <engine-pid> | tr " " "\\n" | grep DAEMON_SOCKET_PATH`',` \u2192 restart the engine tabs (they may hold a stale socket path), or run \`${cliName} daemon restart\``,` \u2192 debug one hook directly: \`ROVE_HOOK_DEBUG=1 echo '{}' | ${cliName} hook turn-start --engine claude\``),out}import{readdirSync,statSync}from"fs";import{createRequire}from"module";import{dirname,join}from"path";function installedSpawnHelpers(){let pkg;try{pkg=dirname(createRequire(import.meta.url).resolve("node-pty/package.json"))}catch{return[]}let prebuilds=join(pkg,"prebuilds"),arches;try{arches=readdirSync(prebuilds).filter((name)=>name.startsWith("darwin-"))}catch{return[]}let helpers=[];for(let arch of arches){let path=join(prebuilds,arch,"spawn-helper");try{helpers.push({path,executable:(statSync(path).mode&64)!==0})}catch{}}return helpers}function spawnHelperDoctorLines(helpers){let broken=helpers.filter((helper)=>!helper.executable).map((helper)=>helper.path);if(helpers.length===0)return{lines:["node-pty: ? no darwin spawn-helper found next to node-pty"],broken};if(broken.length===0)return{lines:[`node-pty: \u2713 spawn-helper executable (${helpers.length} arch)`],broken};return{lines:["node-pty: \u2717 spawn-helper is not executable \u2014 every node-pty PTY spawn fails",...broken.map((path)=>` ${path}`),` \u2192 chmod 755 ${broken.join(" ")}`],broken}}import{appendFileSync,readFileSync}from"fs";var PTY_MARKER="ROVE_TERMINAL_PTY=1",run=async(argv)=>{try{let proc=Bun.spawn([...argv],{stdin:"ignore",stdout:"pipe",stderr:"ignore"}),[stdout,code]=await Promise.all([new Response(proc.stdout).text().catch(()=>""),proc.exited]);return{code,stdout}}catch{return{code:127,stdout:""}}};function parsePsRows(output){let rows=[];for(let line of output.split(`
3
3
  `)){let parts=line.trim().split(/\s+/);if(parts.length<6)continue;let[pid,ppid,pgid]=[parts[0],parts[1],parts[2]].map((value)=>Number.parseInt(value??"",10)),rssKb=Number.parseInt(parts[4]??"",10);if(!Number.isFinite(pid)||!Number.isFinite(ppid)||!Number.isFinite(pgid)||!Number.isFinite(rssKb))continue;rows.push({pid,ppid,pgid,etime:parts[3]??"",rssKb,command:parts.slice(5).join(" ")})}return rows}function pidAlive(pid,rows){return rows.some((row)=>row.pid===pid)}function orphanCandidates(rows,selfPgid,liveSessionPids){return rows.filter((row)=>row.ppid===1&&row.pgid!==selfPgid&&!liveSessionPids.has(row.pgid)&&!pidAlive(row.pgid,rows))}async function markedPids(pids,deps={}){let runProbe=deps.run??run,readEnviron=deps.readEnviron??((pid)=>readFileSync(`/proc/${pid}/environ`,"utf8")),marked=new Set;if(pids.length===0)return{marked,failed:null};if((deps.platform??process.platform)==="linux"){let refused=null;for(let pid of pids)try{if(readEnviron(pid).split("\x00").includes(PTY_MARKER))marked.add(pid)}catch(err){let code=err.code;if(code!=="ENOENT"&&code!=="ESRCH")refused??=`/proc/${pid}/environ: ${code??"unreadable"}`}return{marked,failed:refused}}let result=await runProbe(["ps","eww","-o","pid=,command=","-p",pids.join(",")]);if(result.code!==0)return{marked,failed:`ps eww exited ${result.code}`};let marker=new RegExp(`(^|\\s)${PTY_MARKER}(\\s|$)`);for(let line of result.stdout.split(`
4
4
  `)){let pid=Number.parseInt(line.trim().split(/\s+/)[0]??"",10);if(Number.isFinite(pid)&&marker.test(line))marked.add(pid)}return{marked,failed:null}}async function ownPgid(runProbe){let result=await runProbe(["ps","-o","pgid=","-p",String(process.pid)]),pgid=Number.parseInt(result.stdout.trim(),10);return Number.isFinite(pgid)?pgid:-1}async function collectOrphans(liveSessionPids,deps={}){let runProbe=deps.run??run;if((deps.platform??process.platform)==="win32")return{orphans:[],error:null};let ps=await runProbe(["ps","-A","-o","pid=,ppid=,pgid=,etime=,rss=,command="]);if(ps.code!==0)return{orphans:[],error:`could not read the process table \u2014 ps exited ${ps.code}`};let rows=parsePsRows(ps.stdout),candidates=orphanCandidates(rows,await ownPgid(runProbe),liveSessionPids),{marked,failed}=await markedPids(candidates.map((row)=>row.pid),deps);if(failed)return{orphans:[],error:`could not read process environments \u2014 ${failed}`};return{orphans:candidates.filter((row)=>marked.has(row.pid)),error:null}}function formatMb(rssKb){return`${(rssKb/1024).toFixed(0)} MB`}function orphanDoctorLines(orphans,error,cliName,killing=!1){if(error)return[`orphans: \u2717 ${error}`];if(orphans.length===0)return["orphans: \u2713 none \u2014 no processes left behind by a dead PTY session"];let totalMb=orphans.reduce((sum,row)=>sum+row.rssKb,0)/1024,lines=[`orphans: \u26A0 ${orphans.length} process(es) outlived the PTY session that spawned them (${totalMb.toFixed(0)} MB RSS)`," each is reparented to init, carries Rove's PTY marker, and its process"," group leader is gone \u2014 no live task owns them"];for(let row of[...orphans].sort((a,b)=>b.rssKb-a.rssKb))lines.push(` pid ${row.pid} (group ${row.pgid}) up ${row.etime}, ${formatMb(row.rssKb)}: ${row.command.slice(0,90)}`);if(!killing)lines.push(` \u2192 \`${cliName} doctor --kill-orphans\` ends those process groups (SIGTERM, then SIGKILL)`," read the list first: something you backgrounded from a Rove terminal and then"," closed the tab on looks exactly like a leak, and doctor cannot tell them apart");return lines}var GROUP_EXIT_GRACE_MS=2000,GROUP_POLL_MS=100;function logOrphanKill(pgid,signal,logPath=defaultDaemonLogPath()){try{appendFileSync(logPath,formatDaemonInfo("doctor-kill-orphans",`${signal} process group ${pgid}`))}catch{}}function groupAlive(pgid){try{return process.kill(-pgid,0),!0}catch(err){return err.code!=="ESRCH"}}async function killOrphanGroups(orphans){let groups=[...new Set(orphans.map((row)=>row.pgid))];for(let pgid of groups)try{process.kill(-pgid,"SIGTERM"),logOrphanKill(pgid,"SIGTERM")}catch{}let deadline=Date.now()+GROUP_EXIT_GRACE_MS,survivors=groups.filter(groupAlive);while(survivors.length>0&&Date.now()<deadline)await new Promise((resolve)=>setTimeout(resolve,GROUP_POLL_MS)),survivors=survivors.filter(groupAlive);for(let pgid of survivors)try{process.kill(-pgid,"SIGKILL"),logOrphanKill(pgid,"SIGKILL")}catch{}return await new Promise((resolve)=>setTimeout(resolve,GROUP_POLL_MS)),{groups,survivors:survivors.filter(groupAlive)}}function multiplexerLabel(env){if(env.TMUX)return"tmux";if(env.ZELLIJ)return"zellij";if(env.STY)return"screen";return"no"}function terminalEnvLines(env){let show=(v)=>v&&v.length>0?v:"(unset)",program=env.TERM_PROGRAM?`${env.TERM_PROGRAM}${env.TERM_PROGRAM_VERSION?` v${env.TERM_PROGRAM_VERSION}`:""}`:"(unset)";return[`terminal: TERM=${show(env.TERM)} TERM_PROGRAM=${program} COLORTERM=${show(env.COLORTERM)}`,` running inside a multiplexer: ${multiplexerLabel(env)}`]}function parseKittyProbeReply(data){let kitty=data.match(/\x1b\[\?(\d+)u/);if(kitty?.[1]!==void 0)return{kind:"supported",flags:Number.parseInt(kitty[1],10)};if(/\x1b\[\?[\d;]*c/.test(data))return{kind:"unsupported"};return null}function kittyProbeLine(result){switch(result.kind){case"supported":return` kitty keyboard protocol: \u2713 answered (flags=${result.flags})`;case"unsupported":return[" kitty keyboard protocol: \u2717 not supported \u2014 legacy key path"," (ctrl+h/ctrl+j arrive as C0 backspace/linefeed bytes; the"," split chords ctrl+\\ and ctrl+= cannot be encoded at all)"].join(`
5
5
  `);case"no-response":return" kitty keyboard protocol: ? no reply (terminal ignored both the kitty query and DA1)";case"skipped":return` kitty keyboard protocol: skipped (${result.reason})`}}async function probeKittyKeyboard(timeoutMs=300){let stdin=process.stdin;if(!stdin.isTTY||!process.stdout.isTTY)return{kind:"skipped",reason:"not an interactive terminal"};let wasRaw=stdin.isRaw===!0,buffer="";return await new Promise((resolve)=>{let done=!1,finish=(result)=>{if(done)return;if(done=!0,clearTimeout(timer),stdin.off("data",onData),stdin.pause(),!wasRaw)stdin.setRawMode(!1);resolve(result)},onData=(chunk)=>{buffer+=chunk.toString("latin1");let decided=parseKittyProbeReply(buffer);if(decided)finish(decided)},timer=setTimeout(()=>finish({kind:"no-response"}),timeoutMs);stdin.setRawMode(!0),stdin.resume(),stdin.on("data",onData),process.stdout.write("\x1B[?u\x1B[c")})}async function terminalDoctorLines(){return[...terminalEnvLines(process.env),kittyProbeLine(await probeKittyKeyboard())]}async function probeGit(){try{let proc=Bun.spawn(["git","--version"],{stdin:"ignore",stdout:"pipe",stderr:"ignore"}),text=(await new Response(proc.stdout).text()).trim();if(await proc.exited===0&&text)return{line:`git: \u2713 ${text}`,found:!0}}catch{}return{line:"git: \u2717 not found on PATH",found:!1}}function binaryLabel(binary){return binary.found?`\u2713 ${binary.path}`:`\u2717 ${binary.error}`}async function probeEngines(){let statuses=await withEngineVersions(await detectEngineStatuses(await probeableEngineIds())),lines=["engines:"];for(let status of statuses){let account=describeAccount(status.account),name=`${status.vendor.padEnd(7)} `,version=status.version?` (${status.version})`:"";if(lines.push(` ${name}${binaryLabel(status.binary)}${version}${status.binary.found?` \u2014 ${account}`:""}`),status.accountError)lines.push(` \u26A0 ${status.accountError}`)}let{usable,signedOut}=summarizeEngines(statuses);return{lines,anyUsable:usable.length>0,signedOut}}var CLI_NAME=ROVE_PRODUCT_NAME;function isProcessAlive(pid){try{return process.kill(pid,0),!0}catch(err){return err.code==="EPERM"}}async function requestIfReachable(socketPath,name){let client=new RoveDaemonClient(socketPath);try{return await client.request(name,{})}catch{return null}finally{client.close()}}function fmtDuration(ms){let seconds=Math.floor(ms/1000);if(seconds<60)return`${seconds}s`;let minutes=Math.floor(seconds/60);if(minutes<60)return`${minutes}m ${seconds%60}s`;return`${Math.floor(minutes/60)}h ${minutes%60}m`}function describeFile(path){try{let stat=statSync2(path);return`present (${formatBytes(stat.size)}, modified ${stat.mtime.toISOString()})`}catch{return"absent"}}function taskCount(path){try{let parsed=JSON.parse(readFileSync2(path,"utf8"));return Array.isArray(parsed.tasks)?parsed.tasks.length:null}catch{return null}}function tailFile(path,count){try{return readFileSync2(path,"utf8").split(`
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{updaterShell,updaterShellFailureHint}from"./chunk-j0s13v56.js";import{preferredReleaseChannel,rememberReleaseChannel}from"./chunk-b3nrywgm.js";import"./chunk-tn9gtf18.js";import{BREAKING_VERSIONS,CURRENT_VERSION,DEFAULT_RELEASE_CHANNEL,RELEASE_CHANNELS,UPDATE_COMMAND,UPDATE_SCRIPT_URL,breakingVersionsCrossed,channelOf,checkLatestVersion,fetchReleaseSummaries,recommendedGlobalInstallCommand,updateCommandFor}from"./chunk-aterhn60.js";import"./chunk-12qq8r81.js";import"./chunk-spr6z826.js";import"./chunk-ydxq51g3.js";import"./chunk-yt15y085.js";import"./chunk-gvxchzch.js";import"./chunk-pzbcbmm4.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{spawnSync}from"child_process";var CLI_NAME=ROVE_PRODUCT_NAME;function updatePlan(target){let shell=updateCommandFor(target);return{command:updaterShell(),args:["-c",shell],display:shell}}var VERSION_SHAPE=/^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/;function isReleaseChannel(value){return RELEASE_CHANNELS.includes(value)}var CHANNEL_FLAGS={"--nightly":"nightly","--next":"next","--stable":"latest","--latest":"latest",stable:"latest"};function parseUpdateArgs(args){let dryRun=!1,list=!1,version,channel;for(let i=0;i<args.length;i+=1){let arg=args[i];if(arg===void 0)continue;if(arg==="--help"||arg==="-h"||arg==="help")return{help:!0,dryRun,list,version,channel};if(arg==="dry-run"||arg==="--dry-run"){dryRun=!0;continue}if(arg==="list"||arg==="--list"){list=!0;continue}if(arg==="--channel"||arg.startsWith("--channel=")){let value=(arg.startsWith("--channel=")?arg.slice(10):void 0)??args[++i];if(value===void 0||!isReleaseChannel(value))process.stderr.write(`${CLI_NAME} update: --channel expects one of ${RELEASE_CHANNELS.join(", ")}${value===void 0?"":` (got "${value}")`}
2
+ import{updaterShell,updaterShellFailureHint}from"./chunk-9g3ykmk1.js";import{preferredReleaseChannel,rememberReleaseChannel}from"./chunk-f09xb6kf.js";import"./chunk-tn9gtf18.js";import{BREAKING_VERSIONS,CURRENT_VERSION,DEFAULT_RELEASE_CHANNEL,RELEASE_CHANNELS,UPDATE_COMMAND,UPDATE_SCRIPT_URL,breakingVersionsCrossed,channelOf,checkLatestVersion,fetchReleaseSummaries,recommendedGlobalInstallCommand,updateCommandFor}from"./chunk-v8bdmbb9.js";import"./chunk-12qq8r81.js";import"./chunk-spr6z826.js";import"./chunk-ydxq51g3.js";import"./chunk-yt15y085.js";import"./chunk-gvxchzch.js";import"./chunk-pzbcbmm4.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{spawnSync}from"child_process";var CLI_NAME=ROVE_PRODUCT_NAME;function updatePlan(target){let shell=updateCommandFor(target);return{command:updaterShell(),args:["-c",shell],display:shell}}var VERSION_SHAPE=/^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/;function isReleaseChannel(value){return RELEASE_CHANNELS.includes(value)}var CHANNEL_FLAGS={"--nightly":"nightly","--next":"next","--stable":"latest","--latest":"latest",stable:"latest"};function parseUpdateArgs(args){let dryRun=!1,list=!1,version,channel;for(let i=0;i<args.length;i+=1){let arg=args[i];if(arg===void 0)continue;if(arg==="--help"||arg==="-h"||arg==="help")return{help:!0,dryRun,list,version,channel};if(arg==="dry-run"||arg==="--dry-run"){dryRun=!0;continue}if(arg==="list"||arg==="--list"){list=!0;continue}if(arg==="--channel"||arg.startsWith("--channel=")){let value=(arg.startsWith("--channel=")?arg.slice(10):void 0)??args[++i];if(value===void 0||!isReleaseChannel(value))process.stderr.write(`${CLI_NAME} update: --channel expects one of ${RELEASE_CHANNELS.join(", ")}${value===void 0?"":` (got "${value}")`}
3
3
 
4
4
  `),printUsage(process.stderr),process.exit(2);channel=value;continue}let flagged=CHANNEL_FLAGS[arg];if(channel===void 0&&flagged!==void 0){channel=flagged;continue}if(channel===void 0&&isReleaseChannel(arg)){channel=arg;continue}if(version===void 0&&VERSION_SHAPE.test(arg)){version=arg;continue}process.stderr.write(`${CLI_NAME} update: unknown argument "${arg}"
5
5
 
@@ -10,7 +10,7 @@ import{updaterShell,updaterShellFailureHint}from"./chunk-j0s13v56.js";import{pre
10
10
  install one with: ${CLI_NAME} update <version>
11
11
  `)}async function warnBreakingCrossings(target,channel,io){if(BREAKING_VERSIONS.length===0)return;let resolved=target??(await checkLatestVersion({force:!0,channel}))?.latest;if(!resolved)return;let crossed=breakingVersionsCrossed(CURRENT_VERSION,resolved);if(crossed.length===0)return;io.stderr.write([`warning: ${CURRENT_VERSION} -> ${resolved} crosses breaking version(s): ${crossed.join(", ")}.`,`After this update, Rove will refuse to start until you run \`${CLI_NAME} reset\``,"(worktrees are never touched; add --hard only to also wipe the task index).",""].join(`
12
12
  `))}var FOLLOW_UP_NOTE=["",`${CLI_NAME}: installed. Two background processes are still running the old build:`,` daemon \u2192 \`${CLI_NAME} daemon restart\` (safe; never touches live sessions)`,` pty host \u2192 only \`${CLI_NAME} reset\` replaces it, and that ends every live`," terminal and engine session \u2014 do it when you can afford to.",`Run \`${CLI_NAME} doctor\` to see which of the two is actually stale.`,""].join(`
13
- `);async function runUpdateSubcommand(args,deps){let io={spawn:deps?.spawn??spawnSync,stdout:deps?.stdout??process.stdout,stderr:deps?.stderr??process.stderr,exit:deps?.exit??((code)=>process.exit(code)),channel:deps?.channel??{get:()=>preferredReleaseChannel(),remember:rememberReleaseChannel}},parsed=parseUpdateArgs(args);if(parsed.help){printUsage(io.stdout);return}if(parsed.list){if(deps===void 0&&process.stdout.isTTY){let{startVersionsHost}=await import("./chunk-vg3tyctk.js");await startVersionsHost();return}await printVersionList(io);return}let channel=parsed.channel??io.channel.get(),target=parsed.version??(channel===DEFAULT_RELEASE_CHANNEL?void 0:channel),plan=updatePlan(target),switching=parsed.version===void 0&&channel!==channelOf();if(io.stdout.write(`${CLI_NAME} ${CURRENT_VERSION} -> ${target??channel}
13
+ `);async function runUpdateSubcommand(args,deps){let io={spawn:deps?.spawn??spawnSync,stdout:deps?.stdout??process.stdout,stderr:deps?.stderr??process.stderr,exit:deps?.exit??((code)=>process.exit(code)),channel:deps?.channel??{get:()=>preferredReleaseChannel(),remember:rememberReleaseChannel}},parsed=parseUpdateArgs(args);if(parsed.help){printUsage(io.stdout);return}if(parsed.list){if(deps===void 0&&process.stdout.isTTY){let{startVersionsHost}=await import("./chunk-qvbr5xec.js");await startVersionsHost();return}await printVersionList(io);return}let channel=parsed.channel??io.channel.get(),target=parsed.version??(channel===DEFAULT_RELEASE_CHANNEL?void 0:channel),plan=updatePlan(target),switching=parsed.version===void 0&&channel!==channelOf();if(io.stdout.write(`${CLI_NAME} ${CURRENT_VERSION} -> ${target??channel}
14
14
  `),switching)io.stdout.write(`switching channel: ${channelOf()} -> ${channel}
15
15
  `);if(io.stdout.write(`running: ${plan.display}
16
16
  `),await warnBreakingCrossings(parsed.version,channel,io),parsed.dryRun)return;let result=io.spawn(plan.command,plan.args,{stdio:"inherit"});if(result.error){io.stderr.write(`${CLI_NAME} update: failed to run ${plan.command}: ${result.error.message}
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{booleanFlagsOf,callVerb,errorBody,errorEnvelope,repeatableFlagsOf,runVerb,successEnvelope,toApiError}from"./chunk-wth84cjn.js";import{VerbArgs,apiUsage,findVerb,normalizeWebArgv,parseFlags,unknownVerbError,validateAgainstSpec,verbHelp}from"./chunk-cjzyc7cn.js";import{ensurePluginEnginesLoaded}from"./chunk-c4c03wnz.js";import{openDaemonSession}from"./chunk-zswn8skz.js";import{requireVerbInstalled,verbInstalled}from"./chunk-z0wnws9w.js";import{AUTO_MACHINE,LOCAL_MACHINE,addStaysHere,forwardVerb,pickMachine,repoHosts,requireMachine,routeTarget,takeIdentityWarning}from"./chunk-t2f0xqyk.js";import{ApiError}from"./chunk-3vm6e0cf.js";import{errorMessage}from"./chunk-0zs13rdq.js";import{ROVE_API_VERSION}from"./chunk-96kvwzj8.js";import{argvHasFlag}from"./chunk-78y80xe8.js";function takeMachineFlag(argv){let rest=[],machine;for(let i=0;i<argv.length;i++){let arg=argv[i];if(arg==="--machine")machine=argv[i+1],i+=1;else if(arg.startsWith("--machine="))machine=arg.slice(10);else rest.push(arg)}return{machine:machine||void 0,rest}}function forwardParams(verb,flags){if(!flags.has("prompt-file")||!verb.flags.some((f)=>f.name==="prompt"))return Object.fromEntries(flags);let text=new VerbArgs(verb,flags).promptText(),params=Object.fromEntries([...flags].filter(([name])=>name!=="prompt-file"));return text===void 0?params:{...params,prompt:text}}var envelopeMode=!1;function writeJson(value,pretty,stream=process.stdout){stream.write(`${pretty?JSON.stringify(value,null,2):JSON.stringify(value)}
2
+ import{booleanFlagsOf,callVerb,errorBody,errorEnvelope,repeatableFlagsOf,runVerb,successEnvelope,toApiError}from"./chunk-g6mapq3w.js";import{VerbArgs,apiUsage,findVerb,normalizeWebArgv,parseFlags,unknownVerbError,validateAgainstSpec,verbHelp}from"./chunk-snp86g9s.js";import{ensurePluginEnginesLoaded}from"./chunk-c4c03wnz.js";import{openDaemonSession}from"./chunk-zswn8skz.js";import{requireVerbInstalled,verbInstalled}from"./chunk-z0wnws9w.js";import{AUTO_MACHINE,LOCAL_MACHINE,addStaysHere,forwardVerb,pickMachine,repoHosts,requireMachine,routeTarget,takeIdentityWarning}from"./chunk-t2f0xqyk.js";import{ApiError}from"./chunk-3vm6e0cf.js";import{errorMessage}from"./chunk-0zs13rdq.js";import{ROVE_API_VERSION}from"./chunk-96kvwzj8.js";import{argvHasFlag}from"./chunk-78y80xe8.js";function takeMachineFlag(argv){let rest=[],machine;for(let i=0;i<argv.length;i++){let arg=argv[i];if(arg==="--machine")machine=argv[i+1],i+=1;else if(arg.startsWith("--machine="))machine=arg.slice(10);else rest.push(arg)}return{machine:machine||void 0,rest}}function forwardParams(verb,flags){if(!flags.has("prompt-file")||!verb.flags.some((f)=>f.name==="prompt"))return Object.fromEntries(flags);let text=new VerbArgs(verb,flags).promptText(),params=Object.fromEntries([...flags].filter(([name])=>name!=="prompt-file"));return text===void 0?params:{...params,prompt:text}}var envelopeMode=!1;function writeJson(value,pretty,stream=process.stdout){stream.write(`${pretty?JSON.stringify(value,null,2):JSON.stringify(value)}
3
3
  `)}function emit(value,pretty){let warning=takeIdentityWarning(),payload=warning&&value&&typeof value==="object"&&!Array.isArray(value)?{...value,identityWarning:warning}:value;writeJson(envelopeMode?successEnvelope(payload):payload,pretty)}function fail(message,code,exitCode=1,data){let error=errorBody(new ApiError(message,code,data));if(envelopeMode)writeJson({apiVersion:ROVE_API_VERSION,ok:!1,error},!1);else writeJson({error},!1,process.stderr);process.exit(exitCode)}var USAGE_ERROR_CODES=new Set(["BAD_VERB","UNKNOWN_VERB","BAD_FLAG","MISSING_FLAG","MISSING_VERB","BAD_DAEMON","UNKNOWN_MACHINE"]);async function invokeVerb(verbName,argv,deps){return runVerb(verbName,{argv},deps)}async function runApiSubcommand(argv){let[verbName,...withMachine]=argv,{machine,rest}=takeMachineFlag(withMachine);if(envelopeMode=argvHasFlag(rest,"--envelope"),!verbName||verbName==="--help"||verbName==="-h"||verbName==="help"){if(!verbName)fail(apiUsage(),"MISSING_VERB",2);process.stdout.write(`${apiUsage()}
4
4
  `);return}ensurePluginEnginesLoaded();let verb=findVerb(verbName);if(!verb){let err=unknownVerbError(verbName);fail(`${err.message}
5
5
  ${apiUsage()}`,err.code,2,err.data)}let parsed;try{let verbArgv=verb.name==="web"?normalizeWebArgv(rest):rest;parsed=parseFlags(verbArgv,booleanFlagsOf(verb),repeatableFlagsOf(verb))}catch(err){if(err instanceof ApiError)fail(err.message,err.code,2,err.data);fail(errorMessage(err),"BAD_FLAG",2)}if(parsed.help){if(!verbInstalled(verb))try{requireVerbInstalled(verb)}catch(err){if(err instanceof ApiError)fail(err.message,err.code,2,err.data)}process.stdout.write(`${verbHelp(verb)}
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{API_VERBS,VERBS,VERB_ALIASES,VERB_GROUPS,findVerb,unknownVerbError}from"./chunk-cjzyc7cn.js";import"./chunk-yg74j7kp.js";import"./chunk-c4c03wnz.js";import"./chunk-jyrmdx8f.js";import"./chunk-zswn8skz.js";import"./chunk-2vk65d66.js";import"./chunk-7fw390kp.js";import"./chunk-h58qkv3b.js";import"./chunk-89xz7kc8.js";import"./chunk-4kepb278.js";import"./chunk-zcywdm3y.js";import"./chunk-36qsn2v8.js";import"./chunk-8ca4esh6.js";import"./chunk-q8ffd1pc.js";import"./chunk-rh5024pb.js";import"./chunk-hdea2ss8.js";import"./chunk-d1vv8xk6.js";import"./chunk-2bgmby1d.js";import"./chunk-bwgtbaex.js";import"./chunk-5mhvjytn.js";import"./chunk-5p2hhjje.js";import"./chunk-zknvzer3.js";import"./chunk-0rfd9c8r.js";import"./chunk-0rfkgmns.js";import"./chunk-jpa26n83.js";import"./chunk-z0wnws9w.js";import"./chunk-v8nbqjwc.js";import"./chunk-ws2q07kb.js";import"./chunk-6t1yxx9x.js";import"./chunk-mdx18vtz.js";import"./chunk-b3nrywgm.js";import"./chunk-t2f0xqyk.js";import"./chunk-y0e28qha.js";import"./chunk-76snhsy7.js";import"./chunk-wjmte4f0.js";import"./chunk-3vm6e0cf.js";import"./chunk-f1csqde7.js";import"./chunk-pw0fvd64.js";import"./chunk-9qye1syf.js";import"./chunk-tswzvtsy.js";import"./chunk-69cqwz53.js";import"./chunk-mqfvzdpr.js";import"./chunk-d3sgpjj6.js";import"./chunk-kpq28cbh.js";import"./chunk-hpay0ax8.js";import"./chunk-tteswdyf.js";import"./chunk-qbmdpbdg.js";import"./chunk-de89aagk.js";import"./chunk-rxqdw6s5.js";import"./chunk-z9c475xb.js";import"./chunk-tn9gtf18.js";import"./chunk-ygdxgp8r.js";import"./chunk-drhwacg1.js";import"./chunk-wrqv141p.js";import"./chunk-jgkjfqm9.js";import"./chunk-gxwy1r9a.js";import"./chunk-f60hmm20.js";import"./chunk-w7zv47mp.js";import"./chunk-rr97z89e.js";import"./chunk-03ab55aq.js";import"./chunk-ve196r2v.js";import"./chunk-nr7c9q0j.js";import"./chunk-r478tzjz.js";import"./chunk-navavqt2.js";import"./chunk-etfh8f4z.js";import"./chunk-ez623zqp.js";import"./chunk-w70anvs6.js";import"./chunk-4csg29es.js";import"./chunk-fxpbaff2.js";import"./chunk-dmzg9zdc.js";import"./chunk-h8qg9v95.js";import"./chunk-kg9kmwt9.js";import"./chunk-9k0r47z3.js";import"./chunk-grbrh92f.js";import"./chunk-0zs13rdq.js";import"./chunk-1wpwxcg9.js";import"./chunk-ypbh8ra4.js";import"./chunk-06cpc990.js";import"./chunk-xc2zndmb.js";import"./chunk-zpwg3eh0.js";import"./chunk-vpy8tvfy.js";import"./chunk-96kvwzj8.js";import"./chunk-aterhn60.js";import"./chunk-78y80xe8.js";import"./chunk-wx77yjhc.js";import"./chunk-12qq8r81.js";import"./chunk-z343ngx6.js";import"./chunk-7b2x6nkj.js";import"./chunk-3fzrgjxr.js";import"./chunk-96wm6gt4.js";import"./chunk-6hjt5an9.js";import"./chunk-ptyqj15s.js";import"./chunk-jykxdtad.js";import"./chunk-65nm1v5h.js";import"./chunk-sckqk79z.js";import"./chunk-w2czjjxy.js";import"./chunk-8q0nmdh3.js";import"./chunk-8rxg12aj.js";import"./chunk-bzqjk9fb.js";import"./chunk-4y536nwm.js";import"./chunk-pn5ygqn6.js";import"./chunk-a6z2ggxd.js";import"./chunk-spr6z826.js";import"./chunk-ydxq51g3.js";import"./chunk-yt15y085.js";import"./chunk-gvxchzch.js";import"./chunk-pzbcbmm4.js";import"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-ksx55wt3.js";import"./chunk-91sykzqq.js";export{unknownVerbError,findVerb,VERB_GROUPS,VERB_ALIASES,VERBS,API_VERBS};
2
+ import{API_VERBS,VERBS,VERB_ALIASES,VERB_GROUPS,findVerb,unknownVerbError}from"./chunk-snp86g9s.js";import"./chunk-yg74j7kp.js";import"./chunk-c4c03wnz.js";import"./chunk-jyrmdx8f.js";import"./chunk-zswn8skz.js";import"./chunk-2vk65d66.js";import"./chunk-7fw390kp.js";import"./chunk-h58qkv3b.js";import"./chunk-89xz7kc8.js";import"./chunk-4kepb278.js";import"./chunk-zcywdm3y.js";import"./chunk-36qsn2v8.js";import"./chunk-8ca4esh6.js";import"./chunk-q8ffd1pc.js";import"./chunk-rh5024pb.js";import"./chunk-hdea2ss8.js";import"./chunk-d1vv8xk6.js";import"./chunk-2bgmby1d.js";import"./chunk-bwgtbaex.js";import"./chunk-5mhvjytn.js";import"./chunk-5p2hhjje.js";import"./chunk-zknvzer3.js";import"./chunk-0rfd9c8r.js";import"./chunk-d32fc64g.js";import"./chunk-ypfvxnwf.js";import"./chunk-z0wnws9w.js";import"./chunk-v8nbqjwc.js";import"./chunk-ws2q07kb.js";import"./chunk-6t1yxx9x.js";import"./chunk-mdx18vtz.js";import"./chunk-f09xb6kf.js";import"./chunk-t2f0xqyk.js";import"./chunk-y0e28qha.js";import"./chunk-76snhsy7.js";import"./chunk-wjmte4f0.js";import"./chunk-3vm6e0cf.js";import"./chunk-f1csqde7.js";import"./chunk-pw0fvd64.js";import"./chunk-9qye1syf.js";import"./chunk-tswzvtsy.js";import"./chunk-69cqwz53.js";import"./chunk-mqfvzdpr.js";import"./chunk-d3sgpjj6.js";import"./chunk-kpq28cbh.js";import"./chunk-hpay0ax8.js";import"./chunk-tteswdyf.js";import"./chunk-qbmdpbdg.js";import"./chunk-de89aagk.js";import"./chunk-rxqdw6s5.js";import"./chunk-z9c475xb.js";import"./chunk-tn9gtf18.js";import"./chunk-ygdxgp8r.js";import"./chunk-drhwacg1.js";import"./chunk-wrqv141p.js";import"./chunk-jgkjfqm9.js";import"./chunk-gxwy1r9a.js";import"./chunk-f60hmm20.js";import"./chunk-w7zv47mp.js";import"./chunk-rr97z89e.js";import"./chunk-03ab55aq.js";import"./chunk-ve196r2v.js";import"./chunk-nr7c9q0j.js";import"./chunk-r478tzjz.js";import"./chunk-navavqt2.js";import"./chunk-etfh8f4z.js";import"./chunk-ez623zqp.js";import"./chunk-w70anvs6.js";import"./chunk-4csg29es.js";import"./chunk-fxpbaff2.js";import"./chunk-dmzg9zdc.js";import"./chunk-h8qg9v95.js";import"./chunk-kg9kmwt9.js";import"./chunk-9k0r47z3.js";import"./chunk-grbrh92f.js";import"./chunk-0zs13rdq.js";import"./chunk-1wpwxcg9.js";import"./chunk-ypbh8ra4.js";import"./chunk-06cpc990.js";import"./chunk-xc2zndmb.js";import"./chunk-zpwg3eh0.js";import"./chunk-vpy8tvfy.js";import"./chunk-96kvwzj8.js";import"./chunk-v8bdmbb9.js";import"./chunk-78y80xe8.js";import"./chunk-wx77yjhc.js";import"./chunk-12qq8r81.js";import"./chunk-z343ngx6.js";import"./chunk-7b2x6nkj.js";import"./chunk-3fzrgjxr.js";import"./chunk-96wm6gt4.js";import"./chunk-6hjt5an9.js";import"./chunk-ptyqj15s.js";import"./chunk-jykxdtad.js";import"./chunk-65nm1v5h.js";import"./chunk-sckqk79z.js";import"./chunk-w2czjjxy.js";import"./chunk-8q0nmdh3.js";import"./chunk-8rxg12aj.js";import"./chunk-bzqjk9fb.js";import"./chunk-4y536nwm.js";import"./chunk-pn5ygqn6.js";import"./chunk-a6z2ggxd.js";import"./chunk-spr6z826.js";import"./chunk-ydxq51g3.js";import"./chunk-yt15y085.js";import"./chunk-gvxchzch.js";import"./chunk-pzbcbmm4.js";import"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-ksx55wt3.js";import"./chunk-91sykzqq.js";export{unknownVerbError,findVerb,VERB_GROUPS,VERB_ALIASES,VERBS,API_VERBS};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{chatConnectorStatuses,connectChatConnector,disconnectChatConnector,runConnectorCli,startChatConnectors,updateChatConnector}from"./chunk-3kraw5fh.js";import"./chunk-91sykzqq.js";export{updateChatConnector,startChatConnectors,runConnectorCli,disconnectChatConnector,connectChatConnector,chatConnectorStatuses};
2
+ import{chatConnectorStatuses,connectChatConnector,disconnectChatConnector,runConnectorCli,startChatConnectors,updateChatConnector}from"./chunk-pm71xktm.js";import"./chunk-91sykzqq.js";export{updateChatConnector,startChatConnectors,runConnectorCli,disconnectChatConnector,connectChatConnector,chatConnectorStatuses};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{writeOutdatedCache}from"./chunk-498t9sjd.js";import{PluginCliError,installPlugin}from"./chunk-kmfas00z.js";import{loadPluginRegistry,removePluginEntry,savePluginRegistry}from"./chunk-bwgtbaex.js";import{pluginCheckoutDir,pluginConfigDir,pluginDataDir,pluginStateDir}from"./chunk-ws2q07kb.js";import"./chunk-w7zv47mp.js";import"./chunk-96kvwzj8.js";import"./chunk-aterhn60.js";import"./chunk-yt15y085.js";import"./chunk-pzbcbmm4.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";import{execFileSync}from"child_process";import{existsSync,mkdirSync,readdirSync,renameSync}from"fs";import{join}from"path";function gitOut(args,cwd){try{return execFileSync("git",args,{cwd,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return null}}function checkEntry(entry){let repoSpec=entry.source.spec.split("/").slice(0,2).join("/"),localSha=gitOut(["rev-parse","HEAD"],pluginCheckoutDir(entry.id)),remote=gitOut(["ls-remote",`https://github.com/${repoSpec}.git`,"HEAD"]),remoteSha=remote?remote.split(/\s+/)[0]??null:null;return{id:entry.id,spec:entry.source.spec,version:entry.version,localSha,remoteSha,behind:Boolean(localSha&&remoteSha&&localSha!==remoteSha)}}function listOutdated(){let rows=loadPluginRegistry().plugins.filter((p)=>p.source.kind==="github").map(checkEntry);return writeOutdatedCache(rows.filter((r)=>r.behind).map((r)=>r.id)),rows}function printOutdated(){let rows=listOutdated();if(rows.length===0){console.log("no GitHub-installed plugins.");return}for(let r of rows){let status=r.behind?"update available":r.remoteSha===null?"remote unreachable":r.localSha===null?"local sha unreadable":"up to date";console.log(`${r.id} v${r.version} ${status}`)}}function migrateRenamedPlugin(oldId,newId){for(let dirOf of[pluginConfigDir,pluginStateDir]){let from=dirOf(oldId),to=dirOf(newId);if(!existsSync(from))continue;mkdirSync(to,{recursive:!0});for(let entry of readdirSync(from)){if(existsSync(join(to,entry)))continue;renameSync(join(from,entry),join(to,entry))}}savePluginRegistry(removePluginEntry(loadPluginRegistry(),oldId)),console.log(`renamed ${oldId} \u2192 ${newId}: settings and state carried over, old entry unregistered`),console.log(` leftover checkout (safe to remove): ${pluginDataDir(oldId)}`)}async function updatePlugins(ids,opts){let rows=listOutdated(),targets;if(opts.all){if(targets=rows.filter((r)=>r.behind),targets.length===0){console.log("all plugins up to date.");return}}else{if(ids.length===0)throw new PluginCliError("update takes plugin ids or --all");targets=ids.map((id)=>{let row=rows.find((r)=>r.id===id);if(!row)throw new PluginCliError(`\`${id}\` is not a GitHub-installed plugin; see \`${ROVE_PRODUCT_NAME} plugin list\``);return row})}for(let target of targets){if(!target.behind&&!ids.includes(target.id))continue;console.log(`updating ${target.id} (${target.spec})\u2026`);let installedId=await installPlugin(target.spec,{yes:opts.yes});if(installedId!==target.id)migrateRenamedPlugin(target.id,installedId)}listOutdated()}export{updatePlugins,printOutdated};
2
+ import{writeOutdatedCache}from"./chunk-498t9sjd.js";import{PluginCliError,installPlugin}from"./chunk-k54r9610.js";import{loadPluginRegistry,removePluginEntry,savePluginRegistry}from"./chunk-bwgtbaex.js";import{pluginCheckoutDir,pluginConfigDir,pluginDataDir,pluginStateDir}from"./chunk-ws2q07kb.js";import"./chunk-w7zv47mp.js";import"./chunk-96kvwzj8.js";import"./chunk-v8bdmbb9.js";import"./chunk-yt15y085.js";import"./chunk-pzbcbmm4.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import"./chunk-91sykzqq.js";import{execFileSync}from"child_process";import{existsSync,mkdirSync,readdirSync,renameSync}from"fs";import{join}from"path";function gitOut(args,cwd){try{return execFileSync("git",args,{cwd,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return null}}function checkEntry(entry){let repoSpec=entry.source.spec.split("/").slice(0,2).join("/"),localSha=gitOut(["rev-parse","HEAD"],pluginCheckoutDir(entry.id)),remote=gitOut(["ls-remote",`https://github.com/${repoSpec}.git`,"HEAD"]),remoteSha=remote?remote.split(/\s+/)[0]??null:null;return{id:entry.id,spec:entry.source.spec,version:entry.version,localSha,remoteSha,behind:Boolean(localSha&&remoteSha&&localSha!==remoteSha)}}function listOutdated(){let rows=loadPluginRegistry().plugins.filter((p)=>p.source.kind==="github").map(checkEntry);return writeOutdatedCache(rows.filter((r)=>r.behind).map((r)=>r.id)),rows}function printOutdated(){let rows=listOutdated();if(rows.length===0){console.log("no GitHub-installed plugins.");return}for(let r of rows){let status=r.behind?"update available":r.remoteSha===null?"remote unreachable":r.localSha===null?"local sha unreadable":"up to date";console.log(`${r.id} v${r.version} ${status}`)}}function migrateRenamedPlugin(oldId,newId){for(let dirOf of[pluginConfigDir,pluginStateDir]){let from=dirOf(oldId),to=dirOf(newId);if(!existsSync(from))continue;mkdirSync(to,{recursive:!0});for(let entry of readdirSync(from)){if(existsSync(join(to,entry)))continue;renameSync(join(from,entry),join(to,entry))}}savePluginRegistry(removePluginEntry(loadPluginRegistry(),oldId)),console.log(`renamed ${oldId} \u2192 ${newId}: settings and state carried over, old entry unregistered`),console.log(` leftover checkout (safe to remove): ${pluginDataDir(oldId)}`)}async function updatePlugins(ids,opts){let rows=listOutdated(),targets;if(opts.all){if(targets=rows.filter((r)=>r.behind),targets.length===0){console.log("all plugins up to date.");return}}else{if(ids.length===0)throw new PluginCliError("update takes plugin ids or --all");targets=ids.map((id)=>{let row=rows.find((r)=>r.id===id);if(!row)throw new PluginCliError(`\`${id}\` is not a GitHub-installed plugin; see \`${ROVE_PRODUCT_NAME} plugin list\``);return row})}for(let target of targets){if(!target.behind&&!ids.includes(target.id))continue;console.log(`updating ${target.id} (${target.spec})\u2026`);let installedId=await installPlugin(target.spec,{yes:opts.yes});if(installedId!==target.id)migrateRenamedPlugin(target.id,installedId)}listOutdated()}export{updatePlugins,printOutdated};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
2
  import{expandTilde}from"./chunk-grbrh92f.js";import{pathSyntax}from"./chunk-pn5ygqn6.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import{__require}from"./chunk-91sykzqq.js";import{statSync}from"fs";import{resolve}from"path";function isPathLikeArg(arg){return arg==="."||arg===".."||arg.startsWith("./")||arg.startsWith("../")||arg.startsWith(".\\")||arg.startsWith("..\\")||pathSyntax(arg).isAbsolute(arg)||arg.startsWith("/")||arg==="~"||arg.startsWith("~/")||arg.startsWith("~\\")}async function projectRootFor(dir){let{isGitRepo,resolveRepoRoot}=await import("./chunk-599msv9a.js"),{projectRejection}=await import("./chunk-xff3eqbv.js"),top=resolveRepoRoot(dir);if(top!==dir)return null;return projectRejection(top,isGitRepo,"explicit")?null:top}async function runOpenDirectory(arg){let dir=resolve(process.cwd(),expandTilde(arg)),isDir=!1;try{isDir=statSync(dir).isDirectory()}catch{isDir=!1}if(!isDir)process.stderr.write(`${ROVE_PRODUCT_NAME}: "${arg}" is not a directory (resolved to ${dir}).
3
- `),process.exit(1);let projectRoot=await projectRootFor(dir),{withDaemonOrLocal}=await import("./chunk-887ysmy5.js");await withDaemonOrLocal({daemon:async(client)=>{let at=projectRoot?(await client.request("project.ensure",{repo:projectRoot})).repo:dir,{taskId}=await client.request("task.openDir",{dir:at});await client.request("task.setActive",{taskId})},local:async(orch)=>{let task=await orch.openDirectoryTask({dir:projectRoot?await orch.ensureProject(projectRoot):dir}),{writeLastActiveTaskId}=await import("./chunk-152tg65q.js");writeLastActiveTaskId(String(task.id))}});let{publishRoveTerminalTitle}=await import("./chunk-g8wrdp7n.js");publishRoveTerminalTitle();let{launchTui}=await import("./chunk-ep7abg35.js");await launchTui()}
3
+ `),process.exit(1);let projectRoot=await projectRootFor(dir),{withDaemonOrLocal}=await import("./chunk-887ysmy5.js");await withDaemonOrLocal({daemon:async(client)=>{let at=projectRoot?(await client.request("project.ensure",{repo:projectRoot})).repo:dir,{taskId}=await client.request("task.openDir",{dir:at});await client.request("task.setActive",{taskId})},local:async(orch)=>{let task=await orch.openDirectoryTask({dir:projectRoot?await orch.ensureProject(projectRoot):dir}),{writeLastActiveTaskId}=await import("./chunk-152tg65q.js");writeLastActiveTaskId(String(task.id))}});let{publishRoveTerminalTitle}=await import("./chunk-g8wrdp7n.js");publishRoveTerminalTitle();let{launchTui}=await import("./chunk-88fm48j7.js");await launchTui()}
4
4
  export{isPathLikeArg,runOpenDirectory};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{preferredReleaseChannel}from"./chunk-b3nrywgm.js";import{discoverMachine,remoteRove,runOnMachine}from"./chunk-wjmte4f0.js";var DEFAULTS={version:async(entry)=>{let found=await discoverMachine(entry.alias,entry);return found.ok?found.status.roveVersion||null:null},installed:async(entry)=>{let out=await runOnMachine(entry.alias,entry,remoteRove(entry.roveBin,["--version"]),{timeoutMs:30000});return/\b(\d+\.\d+\.\d+\S*)/.exec(out.stdout)?.[1]??null},run:(entry,args,timeoutMs)=>runOnMachine(entry.alias,entry,remoteRove(entry.roveBin,args),{timeoutMs}),channel:preferredReleaseChannel},lastLines=(run)=>`${run.stdout}
2
+ import{preferredReleaseChannel}from"./chunk-f09xb6kf.js";import{discoverMachine,remoteRove,runOnMachine}from"./chunk-wjmte4f0.js";var DEFAULTS={version:async(entry)=>{let found=await discoverMachine(entry.alias,entry);return found.ok?found.status.roveVersion||null:null},installed:async(entry)=>{let out=await runOnMachine(entry.alias,entry,remoteRove(entry.roveBin,["--version"]),{timeoutMs:30000});return/\b(\d+\.\d+\.\d+\S*)/.exec(out.stdout)?.[1]??null},run:(entry,args,timeoutMs)=>runOnMachine(entry.alias,entry,remoteRove(entry.roveBin,args),{timeoutMs}),channel:preferredReleaseChannel},lastLines=(run)=>`${run.stdout}
3
3
  ${run.stderr}`.trim().split(`
4
4
  `).slice(-6).join(`
5
5
  `)||`exit ${run.exitCode}`;async function upgradeMachine(entry,overrides={}){let deps={...DEFAULTS,...overrides},{alias}=entry,from=await deps.version(entry),install=await deps.run(entry,["update","--channel",deps.channel()],600000);if(install.exitCode!==0)throw Error(`rove update on ${alias} failed:
package/dist/cli/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- import{isPathLikeArg}from"./chunk-etj5h8hg.js";import{matchPathGlob}from"./chunk-kg11c1py.js";import{expandTilde}from"./chunk-grbrh92f.js";import{errorMessage}from"./chunk-0zs13rdq.js";import{rejectionReason}from"./chunk-1wpwxcg9.js";import{CURRENT_VERSION}from"./chunk-aterhn60.js";import{switchFlag}from"./chunk-78y80xe8.js";import{BUILTIN_VENDORS,coerceVendorId,isBuiltinVendor}from"./chunk-8q0nmdh3.js";import"./chunk-pn5ygqn6.js";import"./chunk-pzbcbmm4.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{resolve}from"path";var DYNAMIC_COMMANDS=new Map([["_acp-bridge",async(args)=>{let{runAcpBridgeSubcommand}=await import("./chunk-451z1265.js");await runAcpBridgeSubcommand(args)}],["_trust-claude-worktree",async(paths)=>{let{trustClaudeWorktree}=await import("./chunk-v2vs5nzx.js");for(let path of paths)try{trustClaudeWorktree(path)}catch{}}],["completions",async(args)=>{let{runCompletionsSubcommand}=await import("./chunk-bz3p5vp1.js");await runCompletionsSubcommand(args)}],["export",async(args)=>{let{runExportSubcommand}=await import("./chunk-bche07fb.js");await runExportSubcommand(args)}],["repo",async(args)=>{let{runRepoSubcommand}=await import("./chunk-5jevazzh.js");await runRepoSubcommand(args)}],["api",async(args)=>{let{runApiSubcommand}=await import("./chunk-expgczbc.js");await runApiSubcommand(args)}],["update",async(args)=>{let{runUpdateSubcommand}=await import("./chunk-j6g8jmke.js");await runUpdateSubcommand(args)}],["theme",async(args)=>{let{runThemeSubcommand}=await import("./chunk-3wkjeqt5.js");await runThemeSubcommand(args)}],["feedback",async(args)=>{let{runFeedbackSubcommand}=await import("./chunk-k1pk159f.js");await runFeedbackSubcommand(args)}],["daemon",async(args)=>{let{runDaemonSubcommand}=await import("./chunk-7vassnhs.js");await runDaemonSubcommand(args)}],["gateway",async(args)=>{let{runGatewaySubcommand}=await import("./chunk-bxabhkaq.js");await runGatewaySubcommand(args)}],["machine",async(args)=>{let{runMachineSubcommand}=await import("./chunk-teq8p5rp.js");await runMachineSubcommand(args)}],["weixin",async(args)=>{let{runConnectorCli}=await import("./chunk-ene2k7kb.js");await runConnectorCli("weixin",args)}],["lark",async(args)=>{let{runConnectorCli}=await import("./chunk-ene2k7kb.js");await runConnectorCli("lark",args)}],["inbox",async(args)=>{let{runInboxSubcommand}=await import("./chunk-m932h3dx.js");await runInboxSubcommand(args)}],["doctor",async(args)=>{let{runDoctorSubcommand}=await import("./chunk-3yd8nyv6.js");await runDoctorSubcommand(args)}],["config",async(args)=>{let{runConfigSubcommand}=await import("./chunk-t9vpmnbc.js");await runConfigSubcommand(args)}],["reset",async(args)=>{let{runResetSubcommand}=await import("./chunk-mp535p99.js");await runResetSubcommand(args)}],["pty-host",async(args)=>{let{runPtyHostSubcommand}=await import("./chunk-6qp32yje.js");await runPtyHostSubcommand(args)}],["skill",async(args)=>{let{runSkillSubcommand}=await import("./chunk-rt4bsvd5.js");await runSkillSubcommand(args)}],["plugin",async(args)=>{let{runPluginSubcommand}=await import("./chunk-w3dpq6aj.js");await runPluginSubcommand(args)}],["remote-workspace",async(args)=>{let{runRemoteWorkspaceSubcommand}=await import("./chunk-cqazrkzw.js");await runRemoteWorkspaceSubcommand(args)}],["hook",async(args)=>{let{runHookSubcommand}=await import("./chunk-4g1466qe.js");await runHookSubcommand(args)}]]);function topLevelUsage(cliName=ROVE_PRODUCT_NAME){return[`${cliName} ${CURRENT_VERSION}`,"",`Usage: ${cliName} [command] [options]`,"","Run with no command to launch PureTUI.",`Run \`${cliName} .\` (or \`${cliName} <path>\`) to open a directory as a standalone task.`,"","Commands:"," completions <shell> Generate shell completion script (bash/zsh/fish)"," add [path] Save a repo path for the new-task picker"," remove [path] Forget a saved project (inverse of add; non-destructive)"," adopt [glob] Import existing git worktrees as tasks"," export [--csv|--json] Print the task list (json/csv/table; daemon-free)"," repo <verb> Per-repo init script + first prompt (show|set|unset)",` api <verb> Scriptable RPC surface for agents (see \`${cliName} api --help\`)`," daemon <verb> Manage the daemon (start|stop|status|restart|autostart)"," gateway <verb> Optional local loopback provider gateway (status|enable|add|set-key|\u2026)"," machine <verb> Other computers running Rove (add|doctor|remove|list)"," weixin <verb> Talk to Rove from WeChat (login|logout|status|allow|deny|send|agent)"," lark <verb> Talk to Rove from Lark (connect|disconnect|status|allow|deny|tone)"," inbox <verb> Encrypted inbox outside agents post to (token|rotate|send)"," doctor [--report|--fix] Diagnose daemon/PTY/engines/git; --fix walks the remedies",` config [--path] Open ${cliName}'s config file (state.json) in your editor`," reset [--hard] Stop runtimes; optionally wipe task/UI state"," theme <verb> Manage user themes (list|add|import|remove)",` skill <verb> Install the ${cliName} agent skill (install|status|command|print)`," plugin <verb> Install and run plugins (install|link|list|action|\u2026)"," feedback File a GitHub issue on the Rove repo",` update [version|channel|list] Self-update ${cliName}, switch channel, or list versions`,"","Options:"," -v, --version Print version"," -h, --help Print this help"," --skill Print the agent skill file and exit"," --web [bridge flags] Serve the browser client on 127.0.0.1 and print its link"].join(`
3
+ import{isPathLikeArg}from"./chunk-yfckah6a.js";import{matchPathGlob}from"./chunk-kg11c1py.js";import{expandTilde}from"./chunk-grbrh92f.js";import{errorMessage}from"./chunk-0zs13rdq.js";import{rejectionReason}from"./chunk-1wpwxcg9.js";import{CURRENT_VERSION}from"./chunk-v8bdmbb9.js";import{switchFlag}from"./chunk-78y80xe8.js";import{BUILTIN_VENDORS,coerceVendorId,isBuiltinVendor}from"./chunk-8q0nmdh3.js";import"./chunk-pn5ygqn6.js";import"./chunk-pzbcbmm4.js";import{ROVE_PRODUCT_NAME}from"./chunk-4ctx6hst.js";import"./chunk-g6wb8p4p.js";import"./chunk-nc46gddg.js";import{__require}from"./chunk-91sykzqq.js";import{resolve}from"path";var DYNAMIC_COMMANDS=new Map([["_acp-bridge",async(args)=>{let{runAcpBridgeSubcommand}=await import("./chunk-mrvb0vtm.js");await runAcpBridgeSubcommand(args)}],["_trust-claude-worktree",async(paths)=>{let{trustClaudeWorktree}=await import("./chunk-v2vs5nzx.js");for(let path of paths)try{trustClaudeWorktree(path)}catch{}}],["completions",async(args)=>{let{runCompletionsSubcommand}=await import("./chunk-fvqhz4jc.js");await runCompletionsSubcommand(args)}],["export",async(args)=>{let{runExportSubcommand}=await import("./chunk-bche07fb.js");await runExportSubcommand(args)}],["repo",async(args)=>{let{runRepoSubcommand}=await import("./chunk-5jevazzh.js");await runRepoSubcommand(args)}],["api",async(args)=>{let{runApiSubcommand}=await import("./chunk-1kbt48sb.js");await runApiSubcommand(args)}],["update",async(args)=>{let{runUpdateSubcommand}=await import("./chunk-vv3e8ceh.js");await runUpdateSubcommand(args)}],["theme",async(args)=>{let{runThemeSubcommand}=await import("./chunk-3wkjeqt5.js");await runThemeSubcommand(args)}],["feedback",async(args)=>{let{runFeedbackSubcommand}=await import("./chunk-qxh4hj9t.js");await runFeedbackSubcommand(args)}],["daemon",async(args)=>{let{runDaemonSubcommand}=await import("./chunk-g6wqzvar.js");await runDaemonSubcommand(args)}],["gateway",async(args)=>{let{runGatewaySubcommand}=await import("./chunk-bxabhkaq.js");await runGatewaySubcommand(args)}],["machine",async(args)=>{let{runMachineSubcommand}=await import("./chunk-3mteb2yn.js");await runMachineSubcommand(args)}],["weixin",async(args)=>{let{runConnectorCli}=await import("./chunk-wzrw4tas.js");await runConnectorCli("weixin",args)}],["lark",async(args)=>{let{runConnectorCli}=await import("./chunk-wzrw4tas.js");await runConnectorCli("lark",args)}],["inbox",async(args)=>{let{runInboxSubcommand}=await import("./chunk-m932h3dx.js");await runInboxSubcommand(args)}],["doctor",async(args)=>{let{runDoctorSubcommand}=await import("./chunk-vcj1rd8h.js");await runDoctorSubcommand(args)}],["config",async(args)=>{let{runConfigSubcommand}=await import("./chunk-t9vpmnbc.js");await runConfigSubcommand(args)}],["reset",async(args)=>{let{runResetSubcommand}=await import("./chunk-ffkvvwyw.js");await runResetSubcommand(args)}],["pty-host",async(args)=>{let{runPtyHostSubcommand}=await import("./chunk-r7gjh0kr.js");await runPtyHostSubcommand(args)}],["skill",async(args)=>{let{runSkillSubcommand}=await import("./chunk-rt4bsvd5.js");await runSkillSubcommand(args)}],["plugin",async(args)=>{let{runPluginSubcommand}=await import("./chunk-q6t3y24h.js");await runPluginSubcommand(args)}],["remote-workspace",async(args)=>{let{runRemoteWorkspaceSubcommand}=await import("./chunk-ap8hnhp8.js");await runRemoteWorkspaceSubcommand(args)}],["hook",async(args)=>{let{runHookSubcommand}=await import("./chunk-4g1466qe.js");await runHookSubcommand(args)}]]);function topLevelUsage(cliName=ROVE_PRODUCT_NAME){return[`${cliName} ${CURRENT_VERSION}`,"",`Usage: ${cliName} [command] [options]`,"","Run with no command to launch PureTUI.",`Run \`${cliName} .\` (or \`${cliName} <path>\`) to open a directory as a standalone task.`,"","Commands:"," completions <shell> Generate shell completion script (bash/zsh/fish)"," add [path] Save a repo path for the new-task picker"," remove [path] Forget a saved project (inverse of add; non-destructive)"," adopt [glob] Import existing git worktrees as tasks"," export [--csv|--json] Print the task list (json/csv/table; daemon-free)"," repo <verb> Per-repo init script + first prompt (show|set|unset)",` api <verb> Scriptable RPC surface for agents (see \`${cliName} api --help\`)`," daemon <verb> Manage the daemon (start|stop|status|restart|autostart)"," gateway <verb> Optional local loopback provider gateway (status|enable|add|set-key|\u2026)"," machine <verb> Other computers running Rove (add|doctor|remove|list)"," weixin <verb> Talk to Rove from WeChat (login|logout|status|allow|deny|send|agent)"," lark <verb> Talk to Rove from Lark (connect|disconnect|status|allow|deny|tone)"," inbox <verb> Encrypted inbox outside agents post to (token|rotate|send)"," doctor [--report|--fix] Diagnose daemon/PTY/engines/git; --fix walks the remedies",` config [--path] Open ${cliName}'s config file (state.json) in your editor`," reset [--hard] Stop runtimes; optionally wipe task/UI state"," theme <verb> Manage user themes (list|add|import|remove)",` skill <verb> Install the ${cliName} agent skill (install|status|command|print)`," plugin <verb> Install and run plugins (install|link|list|action|\u2026)"," feedback File a GitHub issue on the Rove repo",` update [version|channel|list] Self-update ${cliName}, switch channel, or list versions`,"","Options:"," -v, --version Print version"," -h, --help Print this help"," --skill Print the agent skill file and exit"," --web [bridge flags] Serve the browser client on 127.0.0.1 and print its link"].join(`
4
4
  `)}var bridge=()=>import("./chunk-887ysmy5.js"),CLI_NAME=ROVE_PRODUCT_NAME,ADD_USAGE=[`Usage: ${CLI_NAME} add [path]`,` ${CLI_NAME} add --remote --host <host> --user <user> --path <basePath> [--port N] [--key [path] | --password]`,"","Save a repo for the new-task picker. With --remote, register an SSH-backed","project whose worktrees live on <host>; engine launch over SSH is pending.",""].join(`
5
5
  `);async function runAddSubcommand(rest){let arg=rest[0];if(arg==="--help"||arg==="-h"||arg==="help"){process.stdout.write(ADD_USAGE);return}if(arg==="--remote"){let{runAddRemote}=await import("./chunk-z4nk2g47.js");await runAddRemote(rest.slice(1));return}if(arg?.startsWith("-"))process.stderr.write(`${CLI_NAME} add: unknown flag "${arg}"
6
6
 
@@ -23,4 +23,4 @@ ${ADOPT_USAGE}
23
23
  pass a path glob to adopt, e.g. ${CLI_NAME} adopt '${repo}/*' --yes`);return}let matched=worktrees.filter(isMatch);if(matched.length===0){console.log(`
24
24
  no worktrees match glob ${JSON.stringify(glob)}`);return}if(!yes){console.log(`
25
25
  ${matched.length} worktree(s) match \u2014 re-run with --yes to adopt them`);return}await adoptWorktreesInto(orch,repo,matched,vendor),console.log(`done \u2014 adopted ${matched.length} worktree(s)`)}function printTopLevelUsage(out){out.write(`${topLevelUsage()}
26
- `)}var COMMANDS=new Map([["add",runAddSubcommand],["remove",runRemoveSubcommand],["adopt",runAdoptSubcommand],...DYNAMIC_COMMANDS]);async function main(){let[,,...rawArgs]=process.argv,[subcommand,...rest]=rawArgs;if(subcommand==="--version"||subcommand==="-v"||subcommand==="version"){let{CURRENT_VERSION:CURRENT_VERSION2}=await import("./chunk-v29v0cgd.js");console.log(`${CLI_NAME} ${CURRENT_VERSION2}`);return}if(subcommand==="--help"||subcommand==="-h"||subcommand==="help"){printTopLevelUsage(process.stdout);return}if(subcommand==="--skill"){let{runSkillSubcommand}=await import("./chunk-rt4bsvd5.js");await runSkillSubcommand(["print"]);return}if(subcommand==="--web"){let{runWebSubcommand}=await import("./chunk-z3cje8hk.js");await runWebSubcommand(rest);return}let handler=subcommand!==void 0?COMMANDS.get(subcommand):void 0;if(handler){await handler(rest);return}if(subcommand!==void 0&&isPathLikeArg(subcommand)){let{runOpenDirectory}=await import("./chunk-0mdzphdz.js");await runOpenDirectory(subcommand);return}if(subcommand!==void 0)console.error(`${CLI_NAME}: unknown command '${subcommand}'`),printTopLevelUsage(process.stderr),process.exit(2);let{publishRoveTerminalTitle}=await import("./chunk-g8wrdp7n.js");publishRoveTerminalTitle();let{launchTui}=await import("./chunk-ep7abg35.js");await launchTui()}var cliDone=main().catch(async(err)=>{let{formatCliFailure}=await import("./chunk-7709m234.js");console.error(formatCliFailure(err,{cliName:CLI_NAME,argv:process.argv,cwd:process.cwd(),env:process.env})),process.exit(1)});export{cliDone};
26
+ `)}var COMMANDS=new Map([["add",runAddSubcommand],["remove",runRemoveSubcommand],["adopt",runAdoptSubcommand],...DYNAMIC_COMMANDS]);async function main(){let[,,...rawArgs]=process.argv,[subcommand,...rest]=rawArgs;if(subcommand==="--version"||subcommand==="-v"||subcommand==="version"){let{CURRENT_VERSION:CURRENT_VERSION2}=await import("./chunk-p880k6a0.js");console.log(`${CLI_NAME} ${CURRENT_VERSION2}`);return}if(subcommand==="--help"||subcommand==="-h"||subcommand==="help"){printTopLevelUsage(process.stdout);return}if(subcommand==="--skill"){let{runSkillSubcommand}=await import("./chunk-rt4bsvd5.js");await runSkillSubcommand(["print"]);return}if(subcommand==="--web"){let{runWebSubcommand}=await import("./chunk-6jp5qvp7.js");await runWebSubcommand(rest);return}let handler=subcommand!==void 0?COMMANDS.get(subcommand):void 0;if(handler){await handler(rest);return}if(subcommand!==void 0&&isPathLikeArg(subcommand)){let{runOpenDirectory}=await import("./chunk-883sxh54.js");await runOpenDirectory(subcommand);return}if(subcommand!==void 0)console.error(`${CLI_NAME}: unknown command '${subcommand}'`),printTopLevelUsage(process.stderr),process.exit(2);let{publishRoveTerminalTitle}=await import("./chunk-g8wrdp7n.js");publishRoveTerminalTitle();let{launchTui}=await import("./chunk-88fm48j7.js");await launchTui()}var cliDone=main().catch(async(err)=>{let{formatCliFailure}=await import("./chunk-7709m234.js");console.error(formatCliFailure(err,{cliName:CLI_NAME,argv:process.argv,cwd:process.cwd(),env:process.env})),process.exit(1)});export{cliDone};
package/dist/cli/rove.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{join as u}from"node:path";import{createInterface as a}from"node:readline/promises";import{pathToFileURL as ss}from"node:url";import{spawnSync as z}from"node:child_process";import{constants as O,accessSync as P}from"node:fs";import{homedir as V}from"node:os";import{basename as R,delimiter as I,dirname as U,join as W}from"node:path";import{fileURLToPath as j}from"node:url";var Y="rove";var o=Y;var Z={$schema:"https://json.schemastore.org/package.json",name:"@sma1lboy/rove",version:"0.9.310",description:"Rove: all your coding agents, in one place. An agentic development environment (ADE) for your terminal: Claude Code, Codex, Copilot and more, side by side in isolated worktrees, handing tasks to each other.",keywords:["terminal","tui","cli","ade","agentic-development-environment","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/voice","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","rove-bench":"bun --conditions=browser scripts/rove-bench.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","check:preview-deps":"bun run scripts/check-preview-deps.ts",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.8.4","@opentui/react":"0.8.4","@xterm/addon-serialize":"^0.14.0","@xterm/addon-unicode11":"^0.9.0","@xterm/headless":"^6.0.0",react:"^19.2.8","smol-toml":"^1.7.1",ws:"^8.21.3",yaml:"^2.9.0"},optionalDependencies:{"@sma1lboy/opentui-rove-darwin-arm64":"0.8.4-rove.1","@sma1lboy/opentui-rove-linux-x64":"0.8.4-rove.1","node-pty":"^1.1.0"},devDependencies:{"@biomejs/biome":"1.9.4","@sma1lboy/rove-api":"0.0.1","@sma1lboy/rove-client":"0.0.1","@sma1lboy/rove-core":"0.0.1","@sma1lboy/rove-daemon":"0.7.23","@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.71","rove-lark":"0.0.6","rove-weixin":"0.0.71",typescript:"5.8.2",vitest:"2.1.9"},trustedDependencies:[]};var x="ROVE_BUN",_="ROVE_NO_BUN_BOOTSTRAP",C="ROVE_SKIP_BUN_CHECK",v=Z.engines.bun.match(/\d+\.\d+\.\d+/)?.[0]??"0.0.0",G=(s)=>{try{return P(s,O.X_OK),!0}catch{return!1}},B=(s)=>s==="win32"?"bun.exe":"bun",f=(s)=>{let t=z(s,["--version"],{encoding:"utf8",timeout:5000});if(t.error||t.status!==0)return null;return t.stdout?.split(`
2
+ import{join as u}from"node:path";import{createInterface as a}from"node:readline/promises";import{pathToFileURL as ss}from"node:url";import{spawnSync as z}from"node:child_process";import{constants as O,accessSync as P}from"node:fs";import{homedir as V}from"node:os";import{basename as R,delimiter as I,dirname as U,join as W}from"node:path";import{fileURLToPath as j}from"node:url";var Y="rove";var o=Y;var Z={$schema:"https://json.schemastore.org/package.json",name:"@sma1lboy/rove",version:"0.9.311-next.651",description:"Rove: all your coding agents, in one place. An agentic development environment (ADE) for your terminal: Claude Code, Codex, Copilot and more, side by side in isolated worktrees, handing tasks to each other.",keywords:["terminal","tui","cli","ade","agentic-development-environment","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/voice","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","rove-bench":"bun --conditions=browser scripts/rove-bench.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","check:preview-deps":"bun run scripts/check-preview-deps.ts",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.8.4","@opentui/react":"0.8.4","@xterm/addon-serialize":"^0.14.0","@xterm/addon-unicode11":"^0.9.0","@xterm/headless":"^6.0.0",react:"^19.2.8","smol-toml":"^1.7.1",ws:"^8.21.3",yaml:"^2.9.0"},optionalDependencies:{"@sma1lboy/opentui-rove-darwin-arm64":"0.8.4-rove.1","@sma1lboy/opentui-rove-linux-x64":"0.8.4-rove.1","node-pty":"^1.1.0"},devDependencies:{"@biomejs/biome":"1.9.4","@sma1lboy/rove-api":"0.0.1","@sma1lboy/rove-client":"0.0.1","@sma1lboy/rove-core":"0.0.1","@sma1lboy/rove-daemon":"0.7.23","@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.71","rove-lark":"0.0.6","rove-weixin":"0.0.71",typescript:"5.8.2",vitest:"2.1.9"},trustedDependencies:[]};var x="ROVE_BUN",_="ROVE_NO_BUN_BOOTSTRAP",C="ROVE_SKIP_BUN_CHECK",v=Z.engines.bun.match(/\d+\.\d+\.\d+/)?.[0]??"0.0.0",G=(s)=>{try{return P(s,O.X_OK),!0}catch{return!1}},B=(s)=>s==="win32"?"bun.exe":"bun",f=(s)=>{let t=z(s,["--version"],{encoding:"utf8",timeout:5000});if(t.error||t.status!==0)return null;return t.stdout?.split(`
3
3
  `)[0]?.trim()??""};function k(s){return s.trim().match(/^v?(\d+\.\d+\.\d+)/)?.[1]??null}function $(s,t=v){let c=k(s),b=k(t);if(!c||!b)return!0;let r=c.split(".").map(Number),i=b.split(".").map(Number);for(let g=0;g<3;g++){let y=r[g]??0,p=i[g]??0;if(y!==p)return y>p}return!0}function d(s=process.env){return s[C]==="1"}function H(s={}){let t=s.env??process.env,c=s.platform??process.platform,b=s.home??t.HOME??t.USERPROFILE??V(),r=B(c),i=[],g=t[x]?.trim();if(g)i.push(g);for(let X of(t.PATH??t.Path??"").split(I))if(X)i.push(W(X,r));let y=t.BUN_INSTALL?.trim();if(y)i.push(W(y,"bin",r));if(b)i.push(W(b,".bun","bin",r));let p=s.launcherDir;if(p)i.push(W(p,"..","..","node_modules","bun","bin",r)),i.push(W(p,"..","..","..","bun","bin",r));return i}function N(s={}){let t=s.isExecutable??G;return H(s).find((c)=>t(c))??null}function J(s={}){let t=s.isExecutable??G,c=s.bunVersionOf??f;if(d(s.env??process.env))return{bun:N(s),stale:null,unusable:null};let b=null,r=null;for(let i of H(s)){if(!t(i))continue;let g=c(i);if(g===null){r??=i;continue}if($(g))return{bun:i,stale:b,unusable:r};b??={path:i,version:k(g)??g}}return{bun:null,stale:b,unusable:r}}function m(s){return U(j(s))}function q(s){return R(j(s)).replace(/\.[cm]?[jt]s$/,"")}function n(s=process.platform){return s==="win32"?["powershell","-NoProfile","-Command","irm bun.sh/install.ps1 | iex"]:["bash","-c","curl -fsSL https://bun.sh/install | bash"]}function A(s=o,t=process.platform){let c=t==="win32"?'powershell -c "irm bun.sh/install.ps1 | iex"':"curl -fsSL https://bun.sh/install | bash";return[`${s}: Rove runs on the Bun runtime, and no Bun was found on this machine.`,"","Install Bun, then run this command again:",` ${c}`," npm install -g bun # any platform, if you already have npm","","Or install Bun and Rove together in one step:"," curl -fsSL https://rove.run/install.sh | sh","",`Already have Bun somewhere unusual? Point Rove at it: ${x}=/path/to/bun`,""].join(`
4
4
  `)}function Q(s,t,c=o){return[`${c}: this machine's Bun is too old for Rove — found ${t} at ${s}, need ${v} or newer.`,"","Rove's terminals are built on Bun's PTY API. An older Bun ignores it silently,","so every terminal and engine tab would open empty and stay empty.","","Upgrade Bun, then run this command again:"," bun upgrade # Bun installed itself (~/.bun)"," brew upgrade bun # Homebrew"," npm install -g bun@latest # npm-managed Bun","",`Have a newer Bun elsewhere? Point Rove at it: ${x}=/path/to/bun`,`Run on this one anyway (unsupported, terminals will be blank): ${C}=1`,""].join(`
5
5
  `)}function K(s,t=o){return[`${t}: the Bun at ${s} could not be run — \`${s} --version\` failed or never returned.`,"","Rove skipped it rather than starting through it, which would hang or fail","with a message from that binary instead of this one.","","Reinstall Bun, then run this command again:"," curl -fsSL https://bun.sh/install | bash","",`Have a working Bun elsewhere? Point Rove at it: ${x}=/path/to/bun`,""].join(`