@sma1lboy/rove 0.9.222 → 0.9.223

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 (131) hide show
  1. package/dist/cli/{chunk-k0ymxqbc.js → chunk-0cfmq5yw.js} +1 -1
  2. package/dist/cli/{chunk-0zcr89a6.js → chunk-0r46kk4s.js} +1 -1
  3. package/dist/cli/chunk-12jedc14.js +8 -0
  4. package/dist/cli/{chunk-fykzzj26.js → chunk-1f8c92xt.js} +1 -1
  5. package/dist/cli/{chunk-vyr2ga59.js → chunk-2cwb64fj.js} +1 -1
  6. package/dist/cli/{chunk-hmsqfmhg.js → chunk-2fntqq4z.js} +1 -1
  7. package/dist/cli/{chunk-4pf41rdt.js → chunk-2xsem13q.js} +1 -1
  8. package/dist/cli/{chunk-58avfm7n.js → chunk-3atfaa4h.js} +1 -1
  9. package/dist/cli/{chunk-ed3r9mb4.js → chunk-3c7bvsb3.js} +2 -2
  10. package/dist/cli/chunk-3h73z1x9.js +12 -0
  11. package/dist/cli/{chunk-94jwnk5q.js → chunk-3htqngp4.js} +1 -1
  12. package/dist/cli/{chunk-59c04v65.js → chunk-3wb64q0p.js} +1 -1
  13. package/dist/cli/{chunk-h0zssfds.js → chunk-3xz0w8tj.js} +8 -8
  14. package/dist/cli/{chunk-psbfd19k.js → chunk-3yh71rdr.js} +1 -1
  15. package/dist/cli/{chunk-89vj273t.js → chunk-44pjeyc5.js} +1 -1
  16. package/dist/cli/{chunk-5qb8czj2.js → chunk-4g3tq47n.js} +1 -1
  17. package/dist/cli/{chunk-jbx6t00x.js → chunk-4rnfvn7x.js} +1 -1
  18. package/dist/cli/chunk-4vsrjqz8.js +2 -0
  19. package/dist/cli/chunk-57q6gykd.js +2 -0
  20. package/dist/cli/chunk-5xqa2ys0.js +2 -0
  21. package/dist/cli/chunk-64bam14p.js +2 -0
  22. package/dist/cli/{chunk-7taqx3cm.js → chunk-6r478s75.js} +1 -1
  23. package/dist/cli/{chunk-3skf3g0c.js → chunk-6wfxd468.js} +1 -1
  24. package/dist/cli/{chunk-7nndmapz.js → chunk-6x5vzzpx.js} +1 -1
  25. package/dist/cli/{chunk-8rk6ecgf.js → chunk-7mfjczcz.js} +1 -1
  26. package/dist/cli/{chunk-y1pebzpv.js → chunk-7sd9m43a.js} +1 -1
  27. package/dist/cli/{chunk-5mweps5x.js → chunk-7txq91d9.js} +1 -1
  28. package/dist/cli/{chunk-63wmhbqs.js → chunk-85mk6j0s.js} +1 -1
  29. package/dist/cli/{chunk-smyp21f3.js → chunk-8bknntvc.js} +1 -1
  30. package/dist/cli/{chunk-q5jhy3t8.js → chunk-8hbtca1g.js} +2 -2
  31. package/dist/cli/{chunk-nxr2qg1f.js → chunk-9e6rnnsy.js} +1 -1
  32. package/dist/cli/{chunk-ndtbxgyp.js → chunk-9mtxxsb3.js} +1 -1
  33. package/dist/cli/{chunk-92k1jste.js → chunk-b1kg21v2.js} +2 -2
  34. package/dist/cli/chunk-bm1z1zsp.js +2 -0
  35. package/dist/cli/{chunk-h30gy8x8.js → chunk-bs7v83x0.js} +1 -1
  36. package/dist/cli/{chunk-80jwjzn8.js → chunk-bw73t1zw.js} +1 -1
  37. package/dist/cli/chunk-bx2m48tf.js +2 -0
  38. package/dist/cli/{chunk-d8a464tx.js → chunk-cb4gdbxn.js} +1 -1
  39. package/dist/cli/{chunk-jyghj39f.js → chunk-cezewj1a.js} +1 -1
  40. package/dist/cli/{chunk-mmdvkep0.js → chunk-chmhmxmc.js} +1 -1
  41. package/dist/cli/{chunk-35xdfn8a.js → chunk-d1a1kw0c.js} +1 -1
  42. package/dist/cli/{chunk-t116w45w.js → chunk-d9hjspk0.js} +1 -1
  43. package/dist/cli/{chunk-t5r0e11g.js → chunk-dfa8fz7d.js} +1 -1
  44. package/dist/cli/{chunk-p5yb73tg.js → chunk-eyx792dw.js} +1 -1
  45. package/dist/cli/chunk-frrjz0dr.js +2 -0
  46. package/dist/cli/chunk-fwb72vzc.js +2 -0
  47. package/dist/cli/{chunk-878cxvry.js → chunk-gfwxx6mh.js} +1 -1
  48. package/dist/cli/{chunk-ad6wj8y8.js → chunk-ggq4vsdv.js} +1 -1
  49. package/dist/cli/chunk-ghxhqkey.js +2 -0
  50. package/dist/cli/{chunk-b9xgyff6.js → chunk-gjtyxam6.js} +1 -1
  51. package/dist/cli/{chunk-mz0khr9c.js → chunk-h9gh63kp.js} +1 -1
  52. package/dist/cli/{chunk-dhfcgq6t.js → chunk-hf1sjxtt.js} +1 -1
  53. package/dist/cli/chunk-hg87p5n8.js +3 -0
  54. package/dist/cli/chunk-hgx20x94.js +2 -0
  55. package/dist/cli/{chunk-rga7a5kk.js → chunk-jtbk2jqm.js} +1 -1
  56. package/dist/cli/{chunk-9zf2wn5c.js → chunk-k7g060qr.js} +1 -1
  57. package/dist/cli/chunk-k95j7j3a.js +3 -0
  58. package/dist/cli/{chunk-09g89dxy.js → chunk-kbsrbpbf.js} +1 -1
  59. package/dist/cli/chunk-mbxn4tj2.js +2 -0
  60. package/dist/cli/{chunk-81p6mm0p.js → chunk-mkksdcsw.js} +1 -1
  61. package/dist/cli/{chunk-w0tdbrpw.js → chunk-mvz494h2.js} +1 -1
  62. package/dist/cli/chunk-n8dkpf4v.js +3 -0
  63. package/dist/cli/{chunk-kf8whkc2.js → chunk-nnz4r6p4.js} +1 -1
  64. package/dist/cli/{chunk-pvwfah6e.js → chunk-ntr5zmav.js} +1 -1
  65. package/dist/cli/{chunk-fczqwtmq.js → chunk-nvqdmx7q.js} +1 -1
  66. package/dist/cli/{chunk-ekdh3m31.js → chunk-nzjx0c9k.js} +1 -1
  67. package/dist/cli/{chunk-f6fws7v6.js → chunk-p5cq4s0x.js} +1 -1
  68. package/dist/cli/chunk-ppwpjm39.js +3 -0
  69. package/dist/cli/chunk-pycgw6f8.js +2 -0
  70. package/dist/cli/{chunk-a9zyq3m8.js → chunk-qdfcdhy8.js} +2 -2
  71. package/dist/cli/chunk-qhbg7mcd.js +2 -0
  72. package/dist/cli/{chunk-j98bfbz1.js → chunk-qm637645.js} +1 -1
  73. package/dist/cli/chunk-qqkw8v6p.js +2 -0
  74. package/dist/cli/chunk-qzfksm8e.js +9 -0
  75. package/dist/cli/{chunk-jtpcbk1y.js → chunk-r84kan7b.js} +1 -1
  76. package/dist/cli/{chunk-gp72n435.js → chunk-ream62r3.js} +1 -1
  77. package/dist/cli/{chunk-pq897z3n.js → chunk-rhczy26f.js} +1 -1
  78. package/dist/cli/{chunk-53akb9x8.js → chunk-s1e0e9hc.js} +2 -2
  79. package/dist/cli/{chunk-x6c4jega.js → chunk-s278gjet.js} +1 -1
  80. package/dist/cli/{chunk-eswcq53q.js → chunk-s9tesp5e.js} +2 -2
  81. package/dist/cli/{chunk-3xs0hv9f.js → chunk-sn2r47e9.js} +1 -1
  82. package/dist/cli/{chunk-hrrpfxpk.js → chunk-snaz3hq7.js} +1 -1
  83. package/dist/cli/{chunk-s08dx83v.js → chunk-vbhhrewn.js} +1 -1
  84. package/dist/cli/{chunk-q6h7128y.js → chunk-vh5bkm9k.js} +2 -2
  85. package/dist/cli/chunk-vzqrj32e.js +2 -0
  86. package/dist/cli/{chunk-wm7gc75a.js → chunk-xkt7pf15.js} +2 -2
  87. package/dist/cli/chunk-xmdbky9n.js +2 -0
  88. package/dist/cli/{chunk-cs1k9d61.js → chunk-xtw1bcaw.js} +1 -1
  89. package/dist/cli/{chunk-nzshm6jy.js → chunk-y3k1accw.js} +1 -1
  90. package/dist/cli/{chunk-3gbfsmqf.js → chunk-y5y0sc9a.js} +1 -1
  91. package/dist/cli/chunk-ywmw8pvp.js +2 -0
  92. package/dist/cli/{chunk-ebhc6q1y.js → chunk-yynhrtxx.js} +2 -2
  93. package/dist/cli/{chunk-bgnjt0pv.js → chunk-zja9chrd.js} +1 -1
  94. package/dist/cli/{chunk-k74rfmkd.js → chunk-zm2f0d23.js} +1 -1
  95. package/dist/cli/{chunk-6cm9pb1f.js → chunk-zyd6k6ak.js} +1 -1
  96. package/dist/cli/index.js +7 -7
  97. package/dist/cli/kobe-run.js +1 -1
  98. package/dist/cli/kobe.js +6 -6
  99. package/dist/cli/rove-run.js +1 -1
  100. package/dist/cli/rove.js +6 -6
  101. package/dist/skills/rove/SKILL.md +1 -1
  102. package/dist/skills/rove/references/api-flags.md +1 -1
  103. package/dist/web-ui/assets/{harness-BP9XoO1F.js → harness-DiS1yHqA.js} +1 -1
  104. package/dist/web-ui/assets/{index-CgF_t_5x.css → index-D3usUDr4.css} +1 -1
  105. package/dist/web-ui/assets/{index-DnDOnFJk.js → index-DxszcdCE.js} +2 -2
  106. package/dist/web-ui/index.html +2 -2
  107. package/package.json +2 -1
  108. package/dist/cli/chunk-00ehck55.js +0 -3
  109. package/dist/cli/chunk-228be43v.js +0 -2
  110. package/dist/cli/chunk-2wxhkv4v.js +0 -3
  111. package/dist/cli/chunk-55xh5e1h.js +0 -2
  112. package/dist/cli/chunk-7eb6g8h1.js +0 -2
  113. package/dist/cli/chunk-87zgxa61.js +0 -2
  114. package/dist/cli/chunk-9213863e.js +0 -9
  115. package/dist/cli/chunk-ad8dbps8.js +0 -2
  116. package/dist/cli/chunk-ah9ky2f7.js +0 -2
  117. package/dist/cli/chunk-c8dbw8rz.js +0 -3
  118. package/dist/cli/chunk-d0f53cxh.js +0 -2
  119. package/dist/cli/chunk-eny3f446.js +0 -2
  120. package/dist/cli/chunk-gkxvcb9n.js +0 -8
  121. package/dist/cli/chunk-j5ye4gwh.js +0 -3
  122. package/dist/cli/chunk-md0fz63v.js +0 -2
  123. package/dist/cli/chunk-mvz2a6a1.js +0 -3
  124. package/dist/cli/chunk-nxht58t9.js +0 -2
  125. package/dist/cli/chunk-p92skpts.js +0 -2
  126. package/dist/cli/chunk-pvr86wd3.js +0 -2
  127. package/dist/cli/chunk-qsne628q.js +0 -2
  128. package/dist/cli/chunk-rgw6ddre.js +0 -2
  129. package/dist/cli/chunk-txevhry4.js +0 -2
  130. package/dist/cli/chunk-wmv1bjak.js +0 -2
  131. package/dist/cli/chunk-y4a23q6m.js +0 -2
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{toTaskId}from"./chunk-xy8be792.js";import{coerceVendorId}from"./chunk-05jej26n.js";import{LockfileError,acquire}from"./chunk-hq2n27y1.js";import{DAEMON_MIGRATION_MARKER}from"./chunk-fxs82dsx.js";import{logClient}from"./chunk-3es6spp4.js";import{defaultClientLogPath}from"./chunk-y8fqdnh3.js";import{existsSync}from"fs";import{copyFile,readFile}from"fs/promises";import{dirname,join}from"path";function coerceTask(value){if(!value||typeof value!=="object")return null;let v=value;if(typeof v.id!=="string"||typeof v.title!=="string"||typeof v.repo!=="string"||typeof v.branch!=="string"||typeof v.worktreePath!=="string"||typeof v.status!=="string"||typeof v.createdAt!=="string"||typeof v.updatedAt!=="string")return null;if(!isTaskStatus(v.status))return null;let kind=v.kind==="main"?"main":v.kind==="dir"?"dir":"task",scratch=kind==="dir"&&v.scratch===!0,healedStatus=kind==="main"&&(v.status==="in_progress"||v.status==="done")?"backlog":v.status,deletion=coerceDeletion(v.deletion),quotaResume=coerceQuotaResume(v.quotaResume),linkedWorkItem=coerceLinkedWorkItem(v.linkedWorkItem),dispatcher=coerceDispatcher(v.dispatcher),routine=coerceRoutine(v.routine),report=coerceWorkerReport(v.report);return{id:toTaskId(v.id),title:v.title,repo:v.repo,branch:v.branch,worktreePath:v.worktreePath,status:healedStatus,pinned:typeof v.pinned==="boolean"?v.pinned:!1,kind,...scratch?{scratch:!0}:{},...routine?{routine}:{},vendor:coerceVendorId(typeof v.vendor==="string"?v.vendor:void 0),...typeof v.command==="string"&&v.command.trim().length>0?{command:v.command}:{},prStatus:coercePRStatus(v.prStatus),...typeof v.modelEffort==="string"&&v.modelEffort.length>0?{modelEffort:v.modelEffort}:{},...typeof v.model==="string"&&v.model.length>0?{model:v.model}:{},...typeof v.tier==="string"&&v.tier.length>0?{tier:v.tier}:{},...typeof v.groupId==="string"&&v.groupId.length>0?{groupId:v.groupId}:{},...v.observedLanguage==="zh"||v.observedLanguage==="en"?{observedLanguage:v.observedLanguage}:{},...deletion?{deletion}:{},...quotaResume?{quotaResume}:{},...linkedWorkItem?{linkedWorkItem}:{},...dispatcher?{dispatcher}:{},...typeof v.prompt==="string"&&v.prompt.length>0?{prompt:v.prompt}:{},...typeof v.baseRef==="string"&&v.baseRef.trim().length>0?{baseRef:v.baseRef}:{},...typeof v.worktreeName==="string"&&v.worktreeName.trim().length>0?{worktreeName:v.worktreeName}:{},...report?{report}:{},createdAt:v.createdAt,updatedAt:v.updatedAt}}function coerceWorkerReport(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.at!=="string"||v.at.length===0)return;return{at:v.at,...typeof v.branch==="string"&&v.branch.length>0?{branch:v.branch}:{},...typeof v.pr==="number"&&Number.isFinite(v.pr)?{pr:v.pr}:{},...typeof v.summary==="string"&&v.summary.length>0?{summary:v.summary}:{}}}function coerceDispatcher(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.taskId!=="string"||v.taskId.length===0)return;if(typeof v.tabId!=="string"||v.tabId.length===0)return;return{taskId:v.taskId,tabId:v.tabId}}function coerceRoutine(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.automationId!=="string"||v.automationId.length===0)return;return{automationId:v.automationId}}function coerceQuotaResume(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.resumeAt!=="string"||v.resumeAt.length===0)return;if(typeof v.requestedAt!=="string"||v.requestedAt.length===0)return;return{resumeAt:v.resumeAt,requestedAt:v.requestedAt}}function coerceLinkedWorkItem(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(v.provider!=="github")return;if(v.type!=="issue"&&v.type!=="pr")return;if(typeof v.number!=="number"||!Number.isFinite(v.number))return;if(typeof v.title!=="string"||typeof v.url!=="string"||v.url.length===0)return;return{provider:v.provider,type:v.type,number:v.number,title:v.title,url:v.url}}function coerceDeletion(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(v.phase!=="queued"&&v.phase!=="running"&&v.phase!=="error"||typeof v.force!=="boolean"||typeof v.requestedAt!=="string"||v.requestedAt.length===0||v.error!==void 0&&typeof v.error!=="string")return;return{phase:v.phase,force:v.force,...typeof v.deleteBranch==="boolean"?{deleteBranch:v.deleteBranch}:{},requestedAt:v.requestedAt,...typeof v.error==="string"?{error:v.error}:{}}}function coercePRStatus(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(!isPRProviderId(v.provider)||!isPRLifecycleState(v.lifecycle)||!isPRCheckState(v.checkState))return;return{provider:v.provider,lifecycle:v.lifecycle,checkState:v.checkState,...typeof v.number==="number"&&Number.isFinite(v.number)?{number:v.number}:{},...typeof v.url==="string"?{url:v.url}:{},...typeof v.title==="string"?{title:v.title}:{},...typeof v.baseRef==="string"?{baseRef:v.baseRef}:{},...typeof v.reviewDecision==="string"?{reviewDecision:v.reviewDecision}:{},...typeof v.mergeable==="string"?{mergeable:v.mergeable}:{},...typeof v.lastCheckedAt==="string"?{lastCheckedAt:v.lastCheckedAt}:{},...typeof v.lastError==="string"?{lastError:v.lastError}:{}}}function isPRProviderId(v){return v==="github"||v==="gitlab"||v==="bitbucket"||v==="unknown"}function isPRLifecycleState(v){return v==="creating"||v==="open"||v==="ready_to_merge"||v==="merged"||v==="closed"||v==="unknown"}function isPRCheckState(v){return v==="none"||v==="pending"||v==="passing"||v==="failing"||v==="unknown"}function isTaskStatus(s){return s==="backlog"||s==="in_progress"||s==="in_review"||s==="done"||s==="canceled"||s==="error"}var sleep=(ms)=>new Promise((resolve)=>setTimeout(resolve,ms)),LOCK_RETRY_DELAY_MS=25,LOCK_MAX_WAIT_MS=5000;async function acquireWithRetry(lockPath){let deadline=Date.now()+LOCK_MAX_WAIT_MS;for(;;)try{return await acquire(lockPath)}catch(err){if(!(err instanceof LockfileError)||Date.now()>=deadline)throw err;await sleep(LOCK_RETRY_DELAY_MS)}}var CURRENT_VERSION=3;async function backupCorruptManifest(path,now=()=>new Date){let backupPath=`${path}.corrupt-${now().toISOString().replaceAll(":","-")}`;try{return await copyFile(path,backupPath),backupPath}catch{return null}}var SUPPORTED_VERSIONS=new Set([1,2,3]);function warnManifestRecovery(message,manifestPath){console.warn(message),logClient("tasks-index",message,manifestPath?defaultClientLogPath(dirname(dirname(manifestPath))):void 0)}async function recoverUnsupportedVersion(parsed,sourcePath){if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return!1;let version=parsed.version;if(version===void 0||SUPPORTED_VERSIONS.has(version))return!1;let backup=await backupCorruptManifest(sourcePath);return warnManifestRecovery(`[rove] tasks.json at ${sourcePath} has unsupported version=${String(version)}; recovering with empty index.${backup?` Original bytes backed up to ${backup}.`:" Backup copy failed; the stale file is left in place."}`,sourcePath),!0}function normalizeIndex(parsed,source){if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return warnManifestRecovery(`[rove] tasks.json at ${source} is not an object; recovering with empty index.`,source),{version:CURRENT_VERSION,tasks:[]};let obj=parsed,version=obj.version;if(version!==void 0&&!SUPPORTED_VERSIONS.has(version))return warnManifestRecovery(`[rove] tasks.json at ${source} has unsupported version=${String(version)}; recovering with empty index.`,source),{version:CURRENT_VERSION,tasks:[]};let rawTasks=Array.isArray(obj.tasks)?obj.tasks:[],tasks=[];for(let entry of rawTasks){let task=coerceTask(entry);if(task)tasks.push(task);else console.warn(`[rove] dropping malformed task entry from ${source}: ${JSON.stringify(entry)}`)}return{version:CURRENT_VERSION,tasks}}var TOMBSTONE_TTL_MS=2592000000;function readableLegacyIndexPath(canonicalPath,legacyPath){return existsSync(join(dirname(canonicalPath),DAEMON_MIGRATION_MARKER))?void 0:legacyPath}async function readDiskIndex(path,legacyPath){let raw,sourcePath=path;try{raw=await readFile(sourcePath,"utf8")}catch(err){if(err.code!=="ENOENT")throw err;let legacy=readableLegacyIndexPath(path,legacyPath);if(!legacy)return{tasks:[],removed:[]};sourcePath=legacy;try{raw=await readFile(sourcePath,"utf8")}catch(legacyErr){if(legacyErr.code==="ENOENT")return{tasks:[],removed:[]};throw legacyErr}}let parsed;try{parsed=JSON.parse(raw)}catch{return await backupCorruptManifest(sourcePath),{tasks:[],removed:[]}}if(await recoverUnsupportedVersion(parsed,sourcePath))return{tasks:[],removed:[]};return{tasks:normalizeIndex(parsed,sourcePath).tasks,removed:coerceTombstones(parsed)}}function coerceTombstones(parsed){if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return[];let raw=parsed.removed;if(!Array.isArray(raw))return[];let out=[];for(let entry of raw){if(!entry||typeof entry!=="object")continue;let v=entry;if(typeof v.id==="string"&&v.id.length>0&&typeof v.at==="string")out.push({id:v.id,at:v.at})}return out}function mergeTasksWithDisk(cacheTasks,diskTasks,dirty,removed,diskRemoved=[],now=Date.now()){let tombstones=new Map;for(let t of diskRemoved){let at=Date.parse(t.at);if(!Number.isFinite(at)||now-at>TOMBSTONE_TTL_MS)continue;tombstones.set(t.id,t.at)}for(let[id,at]of removed)tombstones.set(id,at);let diskById=new Map(diskTasks.map((t)=>[t.id,t])),result=[],included=new Set;for(let task of cacheTasks){if(tombstones.has(task.id))continue;if(dirty.has(task.id))result.push(task);else{let onDisk=diskById.get(task.id);if(onDisk===void 0)continue;result.push(onDisk)}included.add(task.id)}for(let task of diskTasks){if(included.has(task.id)||tombstones.has(task.id))continue;result.push(task),included.add(task.id)}return{tasks:result,removed:[...tombstones].map(([id,at])=>({id,at}))}}async function recoverIndexFromDisk(path,legacyPath){let raw,sourcePath=path;try{raw=await readFile(path,"utf8")}catch(err){if(err.code!=="ENOENT")throw err;let legacy=readableLegacyIndexPath(path,legacyPath),legacyRaw;if(legacy)try{legacyRaw=await readFile(legacy,"utf8"),sourcePath=legacy}catch(legacyErr){if(legacyErr.code!=="ENOENT")throw legacyErr}if(legacyRaw===void 0)return{version:CURRENT_VERSION,tasks:[]};raw=legacyRaw}let parsed;try{parsed=JSON.parse(raw)}catch(err){let backup=await backupCorruptManifest(sourcePath);return warnManifestRecovery(`[rove] tasks.json at ${sourcePath} is corrupted (${err.message}); recovering with empty index.${backup?` Original bytes backed up to ${backup}.`:" Backup copy failed; the stale file is left in place."}`,sourcePath),{version:CURRENT_VERSION,tasks:[]}}if(await recoverUnsupportedVersion(parsed,sourcePath))return{version:CURRENT_VERSION,tasks:[]};return normalizeIndex(parsed,sourcePath)}
2
+ import{toTaskId}from"./chunk-xy8be792.js";import{coerceVendorId}from"./chunk-05jej26n.js";import{DAEMON_MIGRATION_MARKER}from"./chunk-fxs82dsx.js";import{LockfileError,acquire}from"./chunk-hq2n27y1.js";import{logClient}from"./chunk-3es6spp4.js";import{defaultClientLogPath}from"./chunk-y8fqdnh3.js";import{existsSync}from"fs";import{copyFile,readFile}from"fs/promises";import{dirname,join}from"path";function coerceTask(value){if(!value||typeof value!=="object")return null;let v=value;if(typeof v.id!=="string"||typeof v.title!=="string"||typeof v.repo!=="string"||typeof v.branch!=="string"||typeof v.worktreePath!=="string"||typeof v.status!=="string"||typeof v.createdAt!=="string"||typeof v.updatedAt!=="string")return null;if(!isTaskStatus(v.status))return null;let kind=v.kind==="main"?"main":v.kind==="dir"?"dir":"task",scratch=kind==="dir"&&v.scratch===!0,healedStatus=kind==="main"&&(v.status==="in_progress"||v.status==="done")?"backlog":v.status,deletion=coerceDeletion(v.deletion),quotaResume=coerceQuotaResume(v.quotaResume),linkedWorkItem=coerceLinkedWorkItem(v.linkedWorkItem),dispatcher=coerceDispatcher(v.dispatcher),routine=coerceRoutine(v.routine),report=coerceWorkerReport(v.report);return{id:toTaskId(v.id),title:v.title,repo:v.repo,branch:v.branch,worktreePath:v.worktreePath,status:healedStatus,pinned:typeof v.pinned==="boolean"?v.pinned:!1,kind,...scratch?{scratch:!0}:{},...routine?{routine}:{},vendor:coerceVendorId(typeof v.vendor==="string"?v.vendor:void 0),...typeof v.command==="string"&&v.command.trim().length>0?{command:v.command}:{},prStatus:coercePRStatus(v.prStatus),...typeof v.modelEffort==="string"&&v.modelEffort.length>0?{modelEffort:v.modelEffort}:{},...typeof v.model==="string"&&v.model.length>0?{model:v.model}:{},...typeof v.tier==="string"&&v.tier.length>0?{tier:v.tier}:{},...typeof v.groupId==="string"&&v.groupId.length>0?{groupId:v.groupId}:{},...v.observedLanguage==="zh"||v.observedLanguage==="en"?{observedLanguage:v.observedLanguage}:{},...deletion?{deletion}:{},...quotaResume?{quotaResume}:{},...linkedWorkItem?{linkedWorkItem}:{},...dispatcher?{dispatcher}:{},...typeof v.prompt==="string"&&v.prompt.length>0?{prompt:v.prompt}:{},...typeof v.baseRef==="string"&&v.baseRef.trim().length>0?{baseRef:v.baseRef}:{},...typeof v.worktreeName==="string"&&v.worktreeName.trim().length>0?{worktreeName:v.worktreeName}:{},...report?{report}:{},createdAt:v.createdAt,updatedAt:v.updatedAt}}function coerceWorkerReport(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.at!=="string"||v.at.length===0)return;return{at:v.at,...typeof v.branch==="string"&&v.branch.length>0?{branch:v.branch}:{},...typeof v.pr==="number"&&Number.isFinite(v.pr)?{pr:v.pr}:{},...typeof v.summary==="string"&&v.summary.length>0?{summary:v.summary}:{}}}function coerceDispatcher(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.taskId!=="string"||v.taskId.length===0)return;if(typeof v.tabId!=="string"||v.tabId.length===0)return;return{taskId:v.taskId,tabId:v.tabId}}function coerceRoutine(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.automationId!=="string"||v.automationId.length===0)return;return{automationId:v.automationId}}function coerceQuotaResume(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(typeof v.resumeAt!=="string"||v.resumeAt.length===0)return;if(typeof v.requestedAt!=="string"||v.requestedAt.length===0)return;return{resumeAt:v.resumeAt,requestedAt:v.requestedAt}}function coerceLinkedWorkItem(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(v.provider!=="github")return;if(v.type!=="issue"&&v.type!=="pr")return;if(typeof v.number!=="number"||!Number.isFinite(v.number))return;if(typeof v.title!=="string"||typeof v.url!=="string"||v.url.length===0)return;return{provider:v.provider,type:v.type,number:v.number,title:v.title,url:v.url}}function coerceDeletion(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(v.phase!=="queued"&&v.phase!=="running"&&v.phase!=="error"||typeof v.force!=="boolean"||typeof v.requestedAt!=="string"||v.requestedAt.length===0||v.error!==void 0&&typeof v.error!=="string")return;return{phase:v.phase,force:v.force,...typeof v.deleteBranch==="boolean"?{deleteBranch:v.deleteBranch}:{},requestedAt:v.requestedAt,...typeof v.error==="string"?{error:v.error}:{}}}function coercePRStatus(value){if(!value||typeof value!=="object"||Array.isArray(value))return;let v=value;if(!isPRProviderId(v.provider)||!isPRLifecycleState(v.lifecycle)||!isPRCheckState(v.checkState))return;return{provider:v.provider,lifecycle:v.lifecycle,checkState:v.checkState,...typeof v.number==="number"&&Number.isFinite(v.number)?{number:v.number}:{},...typeof v.url==="string"?{url:v.url}:{},...typeof v.title==="string"?{title:v.title}:{},...typeof v.baseRef==="string"?{baseRef:v.baseRef}:{},...typeof v.reviewDecision==="string"?{reviewDecision:v.reviewDecision}:{},...typeof v.mergeable==="string"?{mergeable:v.mergeable}:{},...typeof v.lastCheckedAt==="string"?{lastCheckedAt:v.lastCheckedAt}:{},...typeof v.lastError==="string"?{lastError:v.lastError}:{}}}function isPRProviderId(v){return v==="github"||v==="gitlab"||v==="bitbucket"||v==="unknown"}function isPRLifecycleState(v){return v==="creating"||v==="open"||v==="ready_to_merge"||v==="merged"||v==="closed"||v==="unknown"}function isPRCheckState(v){return v==="none"||v==="pending"||v==="passing"||v==="failing"||v==="unknown"}function isTaskStatus(s){return s==="backlog"||s==="in_progress"||s==="in_review"||s==="done"||s==="canceled"||s==="error"}var sleep=(ms)=>new Promise((resolve)=>setTimeout(resolve,ms)),LOCK_RETRY_DELAY_MS=25,LOCK_MAX_WAIT_MS=5000;async function acquireWithRetry(lockPath){let deadline=Date.now()+LOCK_MAX_WAIT_MS;for(;;)try{return await acquire(lockPath)}catch(err){if(!(err instanceof LockfileError)||Date.now()>=deadline)throw err;await sleep(LOCK_RETRY_DELAY_MS)}}var CURRENT_VERSION=3;async function backupCorruptManifest(path,now=()=>new Date){let backupPath=`${path}.corrupt-${now().toISOString().replaceAll(":","-")}`;try{return await copyFile(path,backupPath),backupPath}catch{return null}}var SUPPORTED_VERSIONS=new Set([1,2,3]);function warnManifestRecovery(message,manifestPath){console.warn(message),logClient("tasks-index",message,manifestPath?defaultClientLogPath(dirname(dirname(manifestPath))):void 0)}async function recoverUnsupportedVersion(parsed,sourcePath){if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return!1;let version=parsed.version;if(version===void 0||SUPPORTED_VERSIONS.has(version))return!1;let backup=await backupCorruptManifest(sourcePath);return warnManifestRecovery(`[rove] tasks.json at ${sourcePath} has unsupported version=${String(version)}; recovering with empty index.${backup?` Original bytes backed up to ${backup}.`:" Backup copy failed; the stale file is left in place."}`,sourcePath),!0}function normalizeIndex(parsed,source){if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return warnManifestRecovery(`[rove] tasks.json at ${source} is not an object; recovering with empty index.`,source),{version:CURRENT_VERSION,tasks:[]};let obj=parsed,version=obj.version;if(version!==void 0&&!SUPPORTED_VERSIONS.has(version))return warnManifestRecovery(`[rove] tasks.json at ${source} has unsupported version=${String(version)}; recovering with empty index.`,source),{version:CURRENT_VERSION,tasks:[]};let rawTasks=Array.isArray(obj.tasks)?obj.tasks:[],tasks=[];for(let entry of rawTasks){let task=coerceTask(entry);if(task)tasks.push(task);else console.warn(`[rove] dropping malformed task entry from ${source}: ${JSON.stringify(entry)}`)}return{version:CURRENT_VERSION,tasks}}var TOMBSTONE_TTL_MS=2592000000;function readableLegacyIndexPath(canonicalPath,legacyPath){return existsSync(join(dirname(canonicalPath),DAEMON_MIGRATION_MARKER))?void 0:legacyPath}async function readDiskIndex(path,legacyPath){let raw,sourcePath=path;try{raw=await readFile(sourcePath,"utf8")}catch(err){if(err.code!=="ENOENT")throw err;let legacy=readableLegacyIndexPath(path,legacyPath);if(!legacy)return{tasks:[],removed:[]};sourcePath=legacy;try{raw=await readFile(sourcePath,"utf8")}catch(legacyErr){if(legacyErr.code==="ENOENT")return{tasks:[],removed:[]};throw legacyErr}}let parsed;try{parsed=JSON.parse(raw)}catch{return await backupCorruptManifest(sourcePath),{tasks:[],removed:[]}}if(await recoverUnsupportedVersion(parsed,sourcePath))return{tasks:[],removed:[]};return{tasks:normalizeIndex(parsed,sourcePath).tasks,removed:coerceTombstones(parsed)}}function coerceTombstones(parsed){if(!parsed||typeof parsed!=="object"||Array.isArray(parsed))return[];let raw=parsed.removed;if(!Array.isArray(raw))return[];let out=[];for(let entry of raw){if(!entry||typeof entry!=="object")continue;let v=entry;if(typeof v.id==="string"&&v.id.length>0&&typeof v.at==="string")out.push({id:v.id,at:v.at})}return out}function mergeTasksWithDisk(cacheTasks,diskTasks,dirty,removed,diskRemoved=[],now=Date.now()){let tombstones=new Map;for(let t of diskRemoved){let at=Date.parse(t.at);if(!Number.isFinite(at)||now-at>TOMBSTONE_TTL_MS)continue;tombstones.set(t.id,t.at)}for(let[id,at]of removed)tombstones.set(id,at);let diskById=new Map(diskTasks.map((t)=>[t.id,t])),result=[],included=new Set;for(let task of cacheTasks){if(tombstones.has(task.id))continue;if(dirty.has(task.id))result.push(task);else{let onDisk=diskById.get(task.id);if(onDisk===void 0)continue;result.push(onDisk)}included.add(task.id)}for(let task of diskTasks){if(included.has(task.id)||tombstones.has(task.id))continue;result.push(task),included.add(task.id)}return{tasks:result,removed:[...tombstones].map(([id,at])=>({id,at}))}}async function recoverIndexFromDisk(path,legacyPath){let raw,sourcePath=path;try{raw=await readFile(path,"utf8")}catch(err){if(err.code!=="ENOENT")throw err;let legacy=readableLegacyIndexPath(path,legacyPath),legacyRaw;if(legacy)try{legacyRaw=await readFile(legacy,"utf8"),sourcePath=legacy}catch(legacyErr){if(legacyErr.code!=="ENOENT")throw legacyErr}if(legacyRaw===void 0)return{version:CURRENT_VERSION,tasks:[]};raw=legacyRaw}let parsed;try{parsed=JSON.parse(raw)}catch(err){let backup=await backupCorruptManifest(sourcePath);return warnManifestRecovery(`[rove] tasks.json at ${sourcePath} is corrupted (${err.message}); recovering with empty index.${backup?` Original bytes backed up to ${backup}.`:" Backup copy failed; the stale file is left in place."}`,sourcePath),{version:CURRENT_VERSION,tasks:[]}}if(await recoverUnsupportedVersion(parsed,sourcePath))return{version:CURRENT_VERSION,tasks:[]};return normalizeIndex(parsed,sourcePath)}
3
3
  export{acquireWithRetry,readableLegacyIndexPath,readDiskIndex,mergeTasksWithDisk,recoverIndexFromDisk};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{CLAUDE_HOOK_EVENT_MAP,claudeSettingsPath}from"./chunk-nzshm6jy.js";import{hasKobeActivityHooks,isObject}from"./chunk-80jwjzn8.js";import"./chunk-7kysxgbq.js";import"./chunk-4pf41rdt.js";import"./chunk-xy8be792.js";import"./chunk-05jej26n.js";import{installedSkillDirs}from"./chunk-a9zyq3m8.js";import"./chunk-c8dbw8rz.js";import"./chunk-6cm9pb1f.js";import"./chunk-hq2n27y1.js";import"./chunk-40dgv828.js";import"./chunk-81p6mm0p.js";import"./chunk-vnpqemb0.js";import"./chunk-q5jhy3t8.js";import"./chunk-9prawccj.js";import"./chunk-00ehck55.js";import"./chunk-fxs82dsx.js";import"./chunk-sb0ns0c7.js";import"./chunk-3es6spp4.js";import"./chunk-pw6yfj10.js";import"./chunk-f10n6063.js";import"./chunk-y8fqdnh3.js";import"./chunk-hq4b3fca.js";import"./chunk-wqfp8d9w.js";import{readFileSync}from"fs";import{homedir}from"os";var PLUGIN_NAME="rove";function readSettings(path){try{let parsed=JSON.parse(readFileSync(path,"utf8"));return isObject(parsed)?parsed:null}catch{return null}}function isRovePluginEnabled(settingsFilePath=claudeSettingsPath()){let settings=readSettings(settingsFilePath);if(!settings||!isObject(settings.enabledPlugins))return!1;return Object.entries(settings.enabledPlugins).some(([key,on])=>on===!0&&key.split("@")[0]===PLUGIN_NAME)}function detectLegacyInstalls(opts={}){let settingsFilePath=opts.settingsFilePath??claudeSettingsPath(),home=opts.home??homedir(),settings=readSettings(settingsFilePath),legacyHooks=settings!==null&&(hasKobeActivityHooks(settings,CLAUDE_HOOK_EVENT_MAP)||settingsHasWorktreeWatch(settings)),legacySkillDirs=installedSkillDirs(home);return{legacyHooks,legacySkillDirs}}function settingsHasWorktreeWatch(settings){let hooks=isObject(settings.hooks)?settings.hooks:{};return Object.values(hooks).some((groups)=>Array.isArray(groups)&&groups.some((g)=>isObject(g)&&Array.isArray(g.hooks)&&g.hooks.some((h)=>isObject(h)&&typeof h.command==="string"&&h.command.includes("worktree-created")&&!h.command.includes("CLAUDE_PLUGIN_ROOT"))))}function migrationHint(findings,cliName){if(!findings.legacyHooks&&findings.legacySkillDirs.length===0)return null;let lines=[`${cliName}: the Rove Claude Code plugin is enabled, but legacy installs remain:`];if(findings.legacyHooks)lines.push(" \u2022 ~/.claude/settings.json still has the settings-managed Rove hooks (every event fires TWICE).",` Run \`${cliName} hook cleanup\` to remove them (only Rove's own entries are touched).`);for(let dir of findings.legacySkillDirs)lines.push(` \u2022 legacy skill copy at ${dir} (the plugin bundles the skill \u2014 two copies double-register).`," Remove that directory to keep the plugin's copy only.");return lines.push(" Reading this inside a session? Just ask your agent to run the cleanup for you."),`${lines.join(`
2
+ import{CLAUDE_HOOK_EVENT_MAP,claudeSettingsPath}from"./chunk-y3k1accw.js";import{hasKobeActivityHooks,isObject}from"./chunk-bw73t1zw.js";import"./chunk-7kysxgbq.js";import"./chunk-2xsem13q.js";import"./chunk-xy8be792.js";import"./chunk-05jej26n.js";import{installedSkillDirs}from"./chunk-qdfcdhy8.js";import"./chunk-hg87p5n8.js";import"./chunk-40dgv828.js";import"./chunk-mkksdcsw.js";import"./chunk-ppwpjm39.js";import"./chunk-fxs82dsx.js";import"./chunk-zyd6k6ak.js";import"./chunk-8hbtca1g.js";import"./chunk-hq2n27y1.js";import"./chunk-sb0ns0c7.js";import"./chunk-vnpqemb0.js";import"./chunk-9prawccj.js";import"./chunk-3es6spp4.js";import"./chunk-pw6yfj10.js";import"./chunk-f10n6063.js";import"./chunk-y8fqdnh3.js";import"./chunk-hq4b3fca.js";import"./chunk-wqfp8d9w.js";import{readFileSync}from"fs";import{homedir}from"os";var PLUGIN_NAME="rove";function readSettings(path){try{let parsed=JSON.parse(readFileSync(path,"utf8"));return isObject(parsed)?parsed:null}catch{return null}}function isRovePluginEnabled(settingsFilePath=claudeSettingsPath()){let settings=readSettings(settingsFilePath);if(!settings||!isObject(settings.enabledPlugins))return!1;return Object.entries(settings.enabledPlugins).some(([key,on])=>on===!0&&key.split("@")[0]===PLUGIN_NAME)}function detectLegacyInstalls(opts={}){let settingsFilePath=opts.settingsFilePath??claudeSettingsPath(),home=opts.home??homedir(),settings=readSettings(settingsFilePath),legacyHooks=settings!==null&&(hasKobeActivityHooks(settings,CLAUDE_HOOK_EVENT_MAP)||settingsHasWorktreeWatch(settings)),legacySkillDirs=installedSkillDirs(home);return{legacyHooks,legacySkillDirs}}function settingsHasWorktreeWatch(settings){let hooks=isObject(settings.hooks)?settings.hooks:{};return Object.values(hooks).some((groups)=>Array.isArray(groups)&&groups.some((g)=>isObject(g)&&Array.isArray(g.hooks)&&g.hooks.some((h)=>isObject(h)&&typeof h.command==="string"&&h.command.includes("worktree-created")&&!h.command.includes("CLAUDE_PLUGIN_ROOT"))))}function migrationHint(findings,cliName){if(!findings.legacyHooks&&findings.legacySkillDirs.length===0)return null;let lines=[`${cliName}: the Rove Claude Code plugin is enabled, but legacy installs remain:`];if(findings.legacyHooks)lines.push(" \u2022 ~/.claude/settings.json still has the settings-managed Rove hooks (every event fires TWICE).",` Run \`${cliName} hook cleanup\` to remove them (only Rove's own entries are touched).`);for(let dir of findings.legacySkillDirs)lines.push(` \u2022 legacy skill copy at ${dir} (the plugin bundles the skill \u2014 two copies double-register).`," Remove that directory to keep the plugin's copy only.");return lines.push(" Reading this inside a session? Just ask your agent to run the cleanup for you."),`${lines.join(`
3
3
  `)}
4
4
  `}export{migrationHint,isRovePluginEnabled,detectLegacyInstalls};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{buildPaneArgv}from"./chunk-j648y3vt.js";import{PluginCliError,installPlugin,linkPlugin}from"./chunk-rga7a5kk.js";import{resolvePluginBinPath}from"./chunk-7nndmapz.js";import{buildPluginEnv}from"./chunk-53afdybj.js";import{currentPluginPlatform,loadPluginRegistry,pluginCheckoutDir,pluginConfigDir,pluginLogPath,qualifiedActionId,readPluginManifest,removePluginEntry,savePluginRegistry,supportsPlatform}from"./chunk-1da3bqjc.js";import"./chunk-b99tf0jr.js";import"./chunk-w7zv47mp.js";import{flagValue}from"./chunk-jvxh93nz.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{SUBCOMMAND_VERBS}from"./chunk-fhch0x0q.js";import"./chunk-2wxhkv4v.js";import"./chunk-q5jhy3t8.js";import"./chunk-9prawccj.js";import{activeCliName}from"./chunk-00ehck55.js";import"./chunk-fxs82dsx.js";import"./chunk-sb0ns0c7.js";import"./chunk-hqbmzz4t.js";import{defaultDaemonSocketPath}from"./chunk-y8fqdnh3.js";import"./chunk-hq4b3fca.js";import{__require}from"./chunk-wqfp8d9w.js";import{spawnSync}from"child_process";import{readFileSync,rmSync}from"fs";var CLI_NAME=activeCliName();function printUsage(out){out.write([`usage: ${CLI_NAME} plugin <command>`,""," install <owner/repo[/subdir]> [--yes] [--ref <rev>] clone from GitHub, preview, build, register"," link <dir> register a local plugin directory (dev)"," list installed + linked plugins"," search [query] browse the marketplace (GitHub topic rove-plugin)"," outdated check GitHub-installed plugins against upstream"," update <id\u2026> | --all [--yes] reinstall stale plugins from GitHub"," enable <id> | disable <id> toggle a plugin without unregistering it"," unlink <id> unregister a linked plugin (files untouched)"," uninstall <id-or-spec> unregister + remove the managed checkout"," config-dir <id> print the plugin's config directory"," log <id> [-n <count>] tail the plugin's command-run log"," action list [--plugin <id>] declared actions"," action invoke <plugin-id.action-id> run an action now"," pane open <plugin-id.pane-id> [--task <task-id>] open a plugin pane as a terminal tab (JSON:"," clients \u2014 0 = no attached UI performed the split)","","Marketplace: https://github.com/topics/rove-plugin (legacy kobe-plugin is included)",""].join(`
2
+ import{buildPaneArgv}from"./chunk-j648y3vt.js";import{PluginCliError,installPlugin,linkPlugin}from"./chunk-jtbk2jqm.js";import{resolvePluginBinPath}from"./chunk-6x5vzzpx.js";import{buildPluginEnv}from"./chunk-53afdybj.js";import{currentPluginPlatform,loadPluginRegistry,pluginCheckoutDir,pluginConfigDir,pluginLogPath,qualifiedActionId,readPluginManifest,removePluginEntry,savePluginRegistry,supportsPlatform}from"./chunk-1da3bqjc.js";import"./chunk-b99tf0jr.js";import"./chunk-w7zv47mp.js";import{flagValue}from"./chunk-jvxh93nz.js";import{errorMessage}from"./chunk-2brn8e1y.js";import{SUBCOMMAND_VERBS}from"./chunk-fhch0x0q.js";import"./chunk-n8dkpf4v.js";import{activeCliName}from"./chunk-ppwpjm39.js";import"./chunk-fxs82dsx.js";import"./chunk-zyd6k6ak.js";import"./chunk-8hbtca1g.js";import"./chunk-hq2n27y1.js";import"./chunk-sb0ns0c7.js";import"./chunk-vnpqemb0.js";import"./chunk-9prawccj.js";import"./chunk-hqbmzz4t.js";import{defaultDaemonSocketPath}from"./chunk-y8fqdnh3.js";import"./chunk-hq4b3fca.js";import{__require}from"./chunk-wqfp8d9w.js";import{spawnSync}from"child_process";import{readFileSync,rmSync}from"fs";var CLI_NAME=activeCliName();function printUsage(out){out.write([`usage: ${CLI_NAME} plugin <command>`,""," install <owner/repo[/subdir]> [--yes] [--ref <rev>] clone from GitHub, preview, build, register"," link <dir> register a local plugin directory (dev)"," list installed + linked plugins"," search [query] browse the marketplace (GitHub topic rove-plugin)"," outdated check GitHub-installed plugins against upstream"," update <id\u2026> | --all [--yes] reinstall stale plugins from GitHub"," enable <id> | disable <id> toggle a plugin without unregistering it"," unlink <id> unregister a linked plugin (files untouched)"," uninstall <id-or-spec> unregister + remove the managed checkout"," config-dir <id> print the plugin's config directory"," log <id> [-n <count>] tail the plugin's command-run log"," action list [--plugin <id>] declared actions"," action invoke <plugin-id.action-id> run an action now"," pane open <plugin-id.pane-id> [--task <task-id>] open a plugin pane as a terminal tab (JSON:"," clients \u2014 0 = no attached UI performed the split)","","Marketplace: https://github.com/topics/rove-plugin (legacy kobe-plugin is included)",""].join(`
3
3
  `))}function loadAll(){return loadPluginRegistry().plugins.map((entry)=>{try{return{entry,manifest:readPluginManifest(entry.root).manifest}}catch{return{entry,manifest:void 0}}})}function requireEntry(id){let entry=loadPluginRegistry().plugins.find((p)=>p.id===id);if(!entry)throw new PluginCliError(`no plugin registered as \`${id}\`; see \`${CLI_NAME} plugin list\``);return entry}function listPlugins(){let all=loadAll();if(all.length===0){console.log(`no plugins installed. Try: ${CLI_NAME} plugin install <owner/repo> \u2014 browse the \`rove-plugin\` GitHub topic.`);return}for(let{entry,manifest}of all){let state=entry.enabled?"enabled":"disabled",kind=entry.source.kind==="link"?`linked ${entry.root}`:entry.source.spec,broken=manifest?"":" [manifest unreadable]";console.log(`${entry.id} v${entry.version} ${state} (${kind})${broken}`)}}function setEnabled(id,enabled){let entry=requireEntry(id),registry=loadPluginRegistry();savePluginRegistry({plugins:registry.plugins.map((p)=>p.id===id?{...entry,enabled}:p)}),console.log(`${enabled?"enabled":"disabled"} ${id}`)}function unlink(id){let entry=requireEntry(id);if(entry.source.kind!=="link")throw new PluginCliError(`\`${id}\` is a GitHub install; use uninstall`);savePluginRegistry(removePluginEntry(loadPluginRegistry(),id)),console.log(`unlinked ${id} (files untouched at ${entry.root})`)}function uninstall(idOrSpec){let registry=loadPluginRegistry(),entry=registry.plugins.find((p)=>p.id===idOrSpec||p.source.kind==="github"&&p.source.spec===idOrSpec);if(!entry)throw new PluginCliError(`no plugin registered as \`${idOrSpec}\``);if(entry.source.kind==="link")throw new PluginCliError(`\`${entry.id}\` is linked; use unlink`);savePluginRegistry(removePluginEntry(registry,entry.id)),rmSync(pluginCheckoutDir(entry.id),{recursive:!0,force:!0}),console.log(`uninstalled ${entry.id} (config/state kept under ~/.rove/plugins/${entry.id}/)`)}function listActions(pluginFilter){for(let{entry,manifest}of loadAll()){if(!manifest||pluginFilter&&entry.id!==pluginFilter)continue;for(let action of manifest.actions)console.log(`${qualifiedActionId(entry.id,action.id)} ${action.title}`)}}function findByLongestPluginPrefix(qualified,options,findItem){for(let{entry,manifest}of loadAll().filter(({entry:entry2,manifest:manifest2})=>Boolean(manifest2&&(!options.enabledOnly||entry2.enabled)&&qualified.startsWith(`${entry2.id}.`))).sort((a,b)=>b.entry.id.length-a.entry.id.length)){let item=findItem(manifest,qualified.slice(entry.id.length+1));if(item!==void 0)return{entry,manifest,item}}return}function assertPlatformSupported(label,item,manifest){if(supportsPlatform(item,manifest,currentPluginPlatform()))return;let declared=(item.platforms??manifest.platforms??[]).join(", ");throw new PluginCliError(`\`${label}\` is not supported on this platform (declares ${declared})`)}function invokeAction(qualified,extraArgs){let hit=findByLongestPluginPrefix(qualified,{enabledOnly:!0},(manifest,actionId)=>manifest.actions.find((a)=>a.id===actionId));if(!hit)throw new PluginCliError(`no action \`${qualified}\`; see \`${CLI_NAME} plugin action list\``);assertPlatformSupported(qualified,hit.item,hit.manifest);let action=hit.item,[cmd,...args]=[...action.command,...extraArgs],res=spawnSync(cmd,args,{cwd:hit.entry.root,stdio:"inherit",env:buildPluginEnv({socketPath:defaultDaemonSocketPath(),binPath:resolvePluginBinPath(),pluginId:hit.entry.id,pluginRoot:hit.entry.root,extra:{ROVE_PLUGIN_ACTION_ID:action.id,ROVE_PLUGIN_INVOKE_CWD:process.cwd()}})});process.exit(res.status??1)}function resolvePaneQualified(qualified){let hit=findByLongestPluginPrefix(qualified,{enabledOnly:!1},(manifest,entrypoint)=>manifest.panes.find((p)=>p.id===entrypoint));if(!hit)throw new PluginCliError(`no pane \`${qualified}\`; see \`${CLI_NAME} plugin list\``);return{pluginId:hit.entry.id,entrypoint:hit.item.id}}async function openPane(pluginId,entrypoint,taskFlag){let loaded=loadAll().find(({entry})=>entry.id===pluginId);if(!loaded?.manifest)throw new PluginCliError(`no plugin \`${pluginId}\` (or its manifest is unreadable)`);if(!loaded.entry.enabled)throw new PluginCliError(`\`${pluginId}\` is disabled`);let pane=loaded.manifest.panes.find((p)=>p.id===entrypoint);if(!pane)throw new PluginCliError(`no pane \`${entrypoint}\` in \`${pluginId}\`; declare it under [[panes]]`);assertPlatformSupported(`${pluginId}.${pane.id}`,pane,loaded.manifest);let{openDaemonSession,resolveActiveTaskId}=await import("./chunk-122vhkba.js"),session=await openDaemonSession({mode:"start"});try{let taskId=taskFlag??await resolveActiveTaskId(session.client);if(!taskId)throw new PluginCliError("no active task; pass --task <id>");let argv=buildPaneArgv(loaded.entry.id,loaded.entry.root,pane,{socketPath:defaultDaemonSocketPath(),binPath:resolvePluginBinPath(),taskId}),reply=await session.client.request("tab.open",{taskId,argv,title:pane.title,placement:pane.placement});console.log(JSON.stringify({...reply,ok:!0,pane:`${pluginId}.${pane.id}`,taskId,title:pane.title}))}finally{session.close()}}function tailLog(id,count){requireEntry(id);let text;try{text=readFileSync(pluginLogPath(id),"utf8")}catch{console.log("(no runs logged yet)");return}let lines=text.trimEnd().split(`
4
- `);for(let line of lines.slice(-count))console.log(line)}async function runPluginSubcommand(rest){let[command,...args]=rest;if(command!==void 0&&!SUBCOMMAND_VERBS.plugin.includes(command)){let isHelp=command==="help"||command==="--help"||command==="-h";if(printUsage(isHelp?process.stdout:process.stderr),!isHelp)process.exit(2);return}try{switch(command){case"install":{let spec=args.find((a)=>!a.startsWith("-"));if(!spec)throw new PluginCliError("install needs <owner/repo[/subdir]>");await installPlugin(spec,{yes:args.includes("--yes"),ref:flagValue(args,"--ref")});return}case"link":{if(!args[0])throw new PluginCliError("link needs a directory");linkPlugin(args[0]);return}case"list":listPlugins();return;case"search":{let{searchMarketplace}=await import("./chunk-rgw6ddre.js");await searchMarketplace(args.find((a)=>!a.startsWith("-")));return}case"outdated":{let{printOutdated}=await import("./chunk-ad8dbps8.js");printOutdated();return}case"update":{let{updatePlugins}=await import("./chunk-ad8dbps8.js");await updatePlugins(args.filter((a)=>!a.startsWith("-")),{all:args.includes("--all"),yes:args.includes("--yes")});return}case"enable":case"disable":{if(!args[0])throw new PluginCliError(`${command} needs a plugin id`);setEnabled(args[0],command==="enable");return}case"unlink":{if(!args[0])throw new PluginCliError("unlink needs a plugin id");unlink(args[0]);return}case"uninstall":{if(!args[0])throw new PluginCliError("uninstall needs a plugin id or owner/repo spec");uninstall(args[0]);return}case"config-dir":{if(!args[0])throw new PluginCliError("config-dir needs a plugin id");requireEntry(args[0]),console.log(pluginConfigDir(args[0]));return}case"log":{if(!args[0])throw new PluginCliError("log needs a plugin id");tailLog(args[0],Number.parseInt(flagValue(args,"-n")??"20",10)||20);return}case"pane":{let[sub,...paneArgs]=args;if(sub==="open"){let positional=paneArgs.find((a)=>!a.startsWith("-")&&a!==flagValue(paneArgs,"--task")),pluginId=flagValue(paneArgs,"--plugin"),entrypoint=flagValue(paneArgs,"--entrypoint");if(!pluginId||!entrypoint){if(!positional)throw new PluginCliError("pane open needs <plugin-id.pane-id> (or --plugin <id> --entrypoint <pane-id>) [--task <task-id>]");({pluginId,entrypoint}=resolvePaneQualified(positional))}await openPane(pluginId,entrypoint,flagValue(paneArgs,"--task"));return}printUsage(process.stderr),process.exit(2);return}case"action":{let[sub,...actionArgs]=args;if(sub==="list"){listActions(flagValue(actionArgs,"--plugin"));return}if(sub==="invoke"){if(!actionArgs[0])throw new PluginCliError("action invoke needs <plugin-id.action-id>");invokeAction(actionArgs[0],actionArgs.slice(1));return}printUsage(process.stderr),process.exit(2);return}default:{let isHelp=command===void 0||command==="help"||command==="--help"||command==="-h";if(printUsage(isHelp?process.stdout:process.stderr),!isHelp)process.exit(2);return}}}catch(err){if(err instanceof PluginCliError)console.error(`${CLI_NAME} plugin: ${err.message}`),process.exit(1);console.error(`${CLI_NAME} plugin: ${errorMessage(err)}`),process.exit(1)}}export{runPluginSubcommand};
4
+ `);for(let line of lines.slice(-count))console.log(line)}async function runPluginSubcommand(rest){let[command,...args]=rest;if(command!==void 0&&!SUBCOMMAND_VERBS.plugin.includes(command)){let isHelp=command==="help"||command==="--help"||command==="-h";if(printUsage(isHelp?process.stdout:process.stderr),!isHelp)process.exit(2);return}try{switch(command){case"install":{let spec=args.find((a)=>!a.startsWith("-"));if(!spec)throw new PluginCliError("install needs <owner/repo[/subdir]>");await installPlugin(spec,{yes:args.includes("--yes"),ref:flagValue(args,"--ref")});return}case"link":{if(!args[0])throw new PluginCliError("link needs a directory");linkPlugin(args[0]);return}case"list":listPlugins();return;case"search":{let{searchMarketplace}=await import("./chunk-64bam14p.js");await searchMarketplace(args.find((a)=>!a.startsWith("-")));return}case"outdated":{let{printOutdated}=await import("./chunk-5xqa2ys0.js");printOutdated();return}case"update":{let{updatePlugins}=await import("./chunk-5xqa2ys0.js");await updatePlugins(args.filter((a)=>!a.startsWith("-")),{all:args.includes("--all"),yes:args.includes("--yes")});return}case"enable":case"disable":{if(!args[0])throw new PluginCliError(`${command} needs a plugin id`);setEnabled(args[0],command==="enable");return}case"unlink":{if(!args[0])throw new PluginCliError("unlink needs a plugin id");unlink(args[0]);return}case"uninstall":{if(!args[0])throw new PluginCliError("uninstall needs a plugin id or owner/repo spec");uninstall(args[0]);return}case"config-dir":{if(!args[0])throw new PluginCliError("config-dir needs a plugin id");requireEntry(args[0]),console.log(pluginConfigDir(args[0]));return}case"log":{if(!args[0])throw new PluginCliError("log needs a plugin id");tailLog(args[0],Number.parseInt(flagValue(args,"-n")??"20",10)||20);return}case"pane":{let[sub,...paneArgs]=args;if(sub==="open"){let positional=paneArgs.find((a)=>!a.startsWith("-")&&a!==flagValue(paneArgs,"--task")),pluginId=flagValue(paneArgs,"--plugin"),entrypoint=flagValue(paneArgs,"--entrypoint");if(!pluginId||!entrypoint){if(!positional)throw new PluginCliError("pane open needs <plugin-id.pane-id> (or --plugin <id> --entrypoint <pane-id>) [--task <task-id>]");({pluginId,entrypoint}=resolvePaneQualified(positional))}await openPane(pluginId,entrypoint,flagValue(paneArgs,"--task"));return}printUsage(process.stderr),process.exit(2);return}case"action":{let[sub,...actionArgs]=args;if(sub==="list"){listActions(flagValue(actionArgs,"--plugin"));return}if(sub==="invoke"){if(!actionArgs[0])throw new PluginCliError("action invoke needs <plugin-id.action-id>");invokeAction(actionArgs[0],actionArgs.slice(1));return}printUsage(process.stderr),process.exit(2);return}default:{let isHelp=command===void 0||command==="help"||command==="--help"||command==="-h";if(printUsage(isHelp?process.stdout:process.stderr),!isHelp)process.exit(2);return}}}catch(err){if(err instanceof PluginCliError)console.error(`${CLI_NAME} plugin: ${err.message}`),process.exit(1);console.error(`${CLI_NAME} plugin: ${errorMessage(err)}`),process.exit(1)}}export{runPluginSubcommand};
@@ -0,0 +1,12 @@
1
+ // @bun
2
+ import{protocolEntry}from"./chunk-gfwxx6mh.js";import{getPersistedString,getPersistedValue}from"./chunk-hg87p5n8.js";import{secretsPath}from"./chunk-8hbtca1g.js";import{acquireSync,releaseSync}from"./chunk-hq2n27y1.js";var AUTO_ROUTING_TIERS=["swift","standard","deep"];function isAutoRoutingTier(value){return AUTO_ROUTING_TIERS.includes(value??"")}var DEFAULT_AUTO_ROUTING={swift:{engine:"claude",model:"sonnet"},standard:{engine:"claude",model:"opus"},deep:{engine:"claude",model:"fable"}};function autoRoutingKey(tier,field){return`autoRouting.${tier}.${field}`}function stringAt(get,key){let raw=get(key);return typeof raw==="string"?raw:void 0}function readAutoRoutingTable(get=getPersistedString){let table={};for(let tier of AUTO_ROUTING_TIERS){let base=DEFAULT_AUTO_ROUTING[tier],engine=stringAt(get,autoRoutingKey(tier,"engine"));if(engine!==void 0&&!engine.trim())return null;let model=stringAt(get,autoRoutingKey(tier,"model")),effort=stringAt(get,autoRoutingKey(tier,"effort")),resolvedModel=model===void 0?base.model:model.trim()||void 0,resolvedEffort=effort===void 0?base.effort:effort.trim()||void 0;table[tier]={engine:engine?.trim()||base.engine,...resolvedModel?{model:resolvedModel}:{},...resolvedEffort?{effort:resolvedEffort}:{}}}return table}function tierBlock(target,deps){let{engine}=target;if(!deps.engineIds.has(engine))return{kind:"engine",engine};if(deps.accountKind(engine)==="none")return{kind:"account",engine};let entry=protocolEntry(engine);if(target.model&&!entry.modelArgv)return{kind:"model",engine,model:target.model};if(target.effort){let levels=entry.effortLevels??[];if(!levels.includes(target.effort))return{kind:"effort",engine,effort:target.effort,levels}}return null}function describeTierBlock(block){switch(block.kind){case"engine":return`engine ${block.engine} is not one engine-list names`;case"account":return`engine ${block.engine} is not logged in`;case"model":return`engine ${block.engine} declares no model flag, so model ${JSON.stringify(block.model)} cannot be passed`;case"effort":return block.levels.length===0?`engine ${block.engine} declares no reasoning effort levels`:`engine ${block.engine} does not accept effort ${JSON.stringify(block.effort)} \u2014 it declares ${block.levels.join(", ")}`}}import{mkdirSync,readFileSync,readdirSync,renameSync,unlinkSync,writeFileSync}from"fs";import{basename,dirname,join}from"path";var HINT_TAIL=4;function readStored(path){let raw;try{raw=readFileSync(path,"utf8")}catch{return{}}try{let parsed=JSON.parse(raw);if(typeof parsed==="object"&&parsed!==null&&!Array.isArray(parsed))return parsed}catch{}return"corrupt"}function readAll(){let stored=readStored(secretsPath());if(stored==="corrupt")return{};let out={};for(let[k,v]of Object.entries(stored))if(typeof v==="string")out[k]=v;return out}function stagingPath(path){return`${path}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`}function sweepStagingFiles(path){let dir=dirname(path),prefix=`${basename(path)}.`,entries;try{entries=readdirSync(dir)}catch{return}for(let entry of entries){if(!entry.startsWith(prefix)||!entry.endsWith(".tmp"))continue;try{unlinkSync(join(dir,entry))}catch{}}}function transact(mutate){let path=secretsPath();mkdirSync(dirname(path),{recursive:!0,mode:448});let lockPath=`${path}.lock`,token=acquireSync(lockPath);try{sweepStagingFiles(path);let secrets=readStored(path);if(secrets==="corrupt")renameSync(path,`${path}.corrupt-${Date.now()}`),secrets={};if(mutate(secrets),Object.keys(secrets).length===0){try{unlinkSync(path)}catch(err){if(err?.code!=="ENOENT")throw err}return}let tmp=stagingPath(path);writeFileSync(tmp,JSON.stringify(secrets),{encoding:"utf8",mode:384}),renameSync(tmp,path)}finally{releaseSync(lockPath,token)}}function readSecret(name){let v=readAll()[name];return v?.trim()?v.trim():void 0}function resolveSecret(name,env=process.env){return env[name]?.trim()||readSecret(name)}function secretStatus(name,env=process.env){let stored=readAll()[name]?.trim(),hint=stored?secretHint(stored):"";if(env[name]?.trim())return{source:"env",hint};return{source:stored?"file":"none",hint}}function secretHint(value){let v=value.trim();return v.length<=HINT_TAIL?"\u2026":`\u2026${v.slice(-HINT_TAIL)}`}function writeSecret(name,value){transact((secrets)=>{let v=value.trim();if(v)secrets[name]=v;else delete secrets[name]})}var SUM_TOLERANCE=0.02,bad=(why)=>({ok:!1,why});function isRecord(v){return typeof v==="object"&&v!==null&&!Array.isArray(v)}function readConfidence(v){return typeof v==="number"&&Number.isFinite(v)&&v>=0&&v<=1?v:void 0}function readChoiceAnswer(answer){if(!isRecord(answer))return bad("answer is not an object");let choice=answer.choice;if(typeof choice!=="string"||!isAutoRoutingTier(choice))return bad(`choice ${JSON.stringify(choice)} is not one of the offered tiers`);let probs=answer.probabilities;if(!isRecord(probs))return bad("probabilities is not an object");let keys=Object.keys(probs).sort(),expected=[...AUTO_ROUTING_TIERS].sort();if(keys.length!==expected.length||keys.some((k,i)=>k!==expected[i]))return bad(`probabilities keys ${keys.join(",")} do not match the offered tiers`);let values={},sum=0;for(let tier of AUTO_ROUTING_TIERS){let p=probs[tier];if(typeof p!=="number"||!Number.isFinite(p)||p<0||p>1)return bad(`probability for ${tier} is not a number in [0,1]`);values[tier]=p,sum+=p}if(Math.abs(sum-1)>SUM_TOLERANCE)return bad(`probabilities sum to ${sum.toFixed(3)}`);for(let tier of AUTO_ROUTING_TIERS)if(values[tier]>values[choice])return bad(`choice ${choice} is not the most likely tier`);let confidence=readConfidence(answer.confidence);if(confidence===void 0)return bad("confidence is missing or out of range");return{ok:!0,value:{tier:choice,confidence,probabilities:values}}}function readJevAnswer(payload){if(!isRecord(payload))return bad("response is not an object");let answers=payload.answers;if(!isRecord(answers))return bad("response has no answers");return readChoiceAnswer(answers.verdict)}function readPlainAnswer(payload){if(!isRecord(payload))return bad("response is not an object");let tier=payload.tier;if(typeof tier!=="string"||!isAutoRoutingTier(tier))return bad(`tier ${JSON.stringify(tier)} is not one of ${AUTO_ROUTING_TIERS.join(", ")}`);let confidence=readConfidence(payload.confidence);if(confidence===void 0)return bad("confidence is missing or not a number in [0,1]");return{ok:!0,value:{tier,confidence}}}var DEFAULT_TIER_RUBRIC={role:"\u4F60\u5728\u7ED9\u4E00\u6761\u300C\u7528\u6237\u65B0\u5EFA coding task \u65F6\u5199\u7684\u7B2C\u4E00\u53E5\u8BDD\u300D\u6253\u6DF1\u5EA6\u6863\u3002",criterion:"\u53EA\u6709\u4E00\u4E2A\u5224\u636E\uFF1A\u7528\u6237\u7684\u6307\u4EE4\u91CC\uFF0C\u6709\u591A\u5C11\u6D41\u7A0B\u9700\u8981\u6A21\u578B\u81EA\u5DF1\u63A8\u7406\u51FA\u6765\u3002\u4E0D\u770B\u5DE5\u4F5C\u91CF\uFF0C\u4E0D\u770B\u96BE\u5EA6\uFF0C\u4E0D\u770B\u6587\u672C\u957F\u77ED\uFF0C\u4E0D\u770B\u8BED\u8A00\u3002\u4E09\u6863\u6CA1\u6709\u76EE\u6807\u6BD4\u4F8B\u3002",criteria:{swift:{what:`- \u8BF4\u4E86\u600E\u4E48\u505A\uFF1Astep-by-step\u3001\u6307\u5230\u4E86\u6587\u4EF6/\u914D\u7F6E/\u9009\u9879\u3001\u7ED9\u4E86\u53C2\u8003\u5B9E\u73B0\uFF08\u300C\u53C2\u8003 vuetify \u540C\u540D prop\u300D\u300C\u50CF fzf \u90A3\u6837\u300D\uFF09\u3002
3
+ - \u7528\u6237\u5DF2\u7ECF\u5B9A\u4F4D\u8FC7\u4E86\uFF1A\u300Cprofile \u4E86\u4E00\u4E0B\u53D1\u73B0\u662F X\uFF0C\u7F13\u5B58\u4E00\u4E0B\u5427\u300D\u2014\u2014\u539F\u56E0\u627E\u5230\u4E86\uFF0C\u5269\u4E0B\u7167\u505A\u3002
4
+ - \u4E00\u4E2A**\u5177\u4F53\u5230\u590D\u73B0\u5C31\u80FD\u4FEE\u7684\u884C\u4E3A**\uFF1A\u300CTooltip \u5728 iframe \u91CC\u5B9A\u4F4D\u9519\u300D\u300C\u6DF1\u8272\u6A21\u5F0F\u4EE3\u7801\u5757\u80CC\u666F\u548C\u6B63\u6587\u4E00\u4E2A\u8272\u300D\u300Chero \u52A8\u753B safari \u5361 chrome \u4E0D\u5361\u300D\u2014\u2014\u73B0\u8C61\u4E00\u53E5\u8BDD\u8BF4\u6B7B\u3001\u6CA1\u6709\u6761\u4EF6\u3001\u6CA1\u6709\u731C\u6D4B\uFF0C\u6253\u5F00\u5C31\u80FD\u770B\u89C1\u3002
5
+ - \u52A0\u4E00\u4E2A flag / prop / \u5F00\u5173\uFF0C\u5E76\u8BF4\u4E86\u5B83\u505A\u4EC0\u4E48\u3002\u6587\u6863/\u6587\u6848/\u94FE\u63A5\u4FEE\u6B63\u3002`,\u{8fb9}\u{754c}:"\u548C standard \u7684\u5206\u754C\uFF1A\u7528\u6237\u6709\u6CA1\u6709\u544A\u8BC9\u6A21\u578B\u6539\u54EA\u3001\u600E\u4E48\u6539\uFF0C\u6216\u8005\u73B0\u8C61\u662F\u4E0D\u662F\u5177\u4F53\u5230\u6253\u5F00\u5C31\u80FD\u770B\u89C1\uFF1F\u6709 \u2192 swift\u3002**\u76F4\u63A5\u63D0\u95EE\u4E5F\u7B97 swift**\uFF1A\u95EE\u300C\u4F60\u662F\u4EC0\u4E48\u6A21\u578B\u300D\u300C\u8FD9\u4E2A\u6587\u4EF6\u5728\u54EA\u300D\u300CX \u662F\u4EC0\u4E48\u610F\u601D\u300D\uFF0C\u6216\u8005\u6253\u4E2A\u62DB\u547C\u3001\u9053\u4E2A\u8C22\u2014\u2014\u8FD9\u4E9B\u8BDD\u672C\u8EAB\u5DF2\u7ECF\u5B8C\u6574\uFF0C\u7B54\u5B83\u4E0D\u9700\u8981\u5148\u60F3\u6E05\u695A\u505A\u6210\u4EC0\u4E48\u6837\uFF0C\u6CA1\u6709\u4EFB\u4F55\u6D41\u7A0B\u8981\u6A21\u578B\u53BB\u63A8\u3002\u6CA1\u6709\u8981\u505A\u7684\u4E8B \u2260 \u76EE\u6807\u8981\u6A21\u578B\u81EA\u5DF1\u627E\u3002"},standard:{what:`- \u8BF4\u6E05\u695A\u4E86\u8981\u505A\u6210\u4EC0\u4E48\u6837\u4F46\u6CA1\u8BF4\u600E\u4E48\u505A\uFF1Afeature \u8BF7\u6C42\u3001\u300C\u80FD\u4E0D\u80FD\u505A\u6210\u53EF\u914D\u7F6E\u300D\u300C\u6539\u6210\u5B9E\u65F6\u66F4\u65B0\u300D\u300C\u52A0\u4E2A xlsx \u5BFC\u51FA\u300D\u3002
6
+ - **\u75C7\u72B6 + \u7528\u6237\u81EA\u5DF1\u731C\u4E86\u4E00\u4E2A\u539F\u56E0**\uFF1A\u300Cpaste \u4E22\u5B57\u7B26\uFF0C\u662F\u4E0D\u662F truncate \u4E86\u300D\u300C\u91CD\u590D\u56DE\u590D\uFF0C\u662F\u4E0D\u662F\u6CA1\u52A0\u53BB\u91CD\u300D\u300C\u5DF2\u8BFB\u4E0D\u66F4\u65B0\uFF0C\u6000\u7591\u662F\u8BA2\u9605\u4E22\u4E86\u300D\u2014\u2014\u731C\u7684\u539F\u56E0\u5C31\u662F\u76EE\u6807\uFF0C\u6A21\u578B\u53BB\u9A8C\u8BC1\u5B83\u3002
7
+ - \u7ED9\u4E86\u4E00\u4E2A\u94FE\u63A5/\u5916\u90E8\u53C2\u8003\u8BF4\u300C\u7167\u8FD9\u4E2A\u505A\u300D\u300C\u80FD\u4E0D\u80FD\u63A5\u8FDB\u6765\u300D\u3002`,\u{8fb9}\u{754c}:"\u548C swift \u7684\u5206\u754C\uFF1A\u7528\u6237\u6CA1\u8BF4\u6539\u54EA\u3001\u600E\u4E48\u6539 \u2192 \u4E0D\u662F swift\u3002\u548C deep \u7684\u5206\u754C\uFF1A\u7528\u6237\u8BF4\u4E86\u8981\u505A\u6210\u4EC0\u4E48\uFF08\u54EA\u6015\u53EA\u662F\u731C\u4E86\u4E2A\u539F\u56E0\uFF09\u2192 standard\u3002"},deep:{what:`- \u5F00\u653E\u5F0F\uFF1A\u300C\u6709\u4EC0\u4E48\u53EF\u4EE5\u4F18\u5316\u300D\u300C\u4EC0\u4E48\u65B9\u5411\u503C\u5F97\u505A\u300D\u300C\u8C03\u67E5\u4E00\u4E0B\u74F6\u9888\u5728\u54EA\u300D\u300C\u6362\u67B6\u6784\u6709\u5FC5\u8981\u5417\u300D\u3002
8
+ - \u53EA\u95EE\u53EF\u4E0D\u53EF\u4EE5\u3001\u6CA1\u8BF4\u8981\u505A\uFF1A\u300C\u6709\u6CA1\u6709\u529E\u6CD5\u8BA9 X \u6309 Y \u4E0D\u4E00\u6837\u300D\u300Cany ideas on how to\u2026\u300D\u300Ccould we support\u2026\u300D\u2014\u2014\u5148\u8981\u5224\u65AD\u65B9\u6848\u3002
9
+ - **\u75C7\u72B6\u5E26\u6761\u4EF6\u3001\u4E0D\u7A33\u5B9A\u590D\u73B0\u3001\u6CA1\u6709\u4EFB\u4F55\u731C\u6D4B**\uFF1A\u300C\u6709\u65F6\u5019\u4F1A\u8DD1\u5230\u5C4F\u5E55\u5916\uFF0C\u591A\u5C4F\u60C5\u51B5\u4E0B\u300D\u300C\u611F\u89C9\u5361\u4E00\u4E0B\u300D\u300Cresults feel stale\u300D\u300C\u8D85\u8FC7 200 \u884C\u5C31\u7A7A\u767D\u300D\u2014\u2014\u5148\u8981\u627E\u5230\u89E6\u53D1\u6761\u4EF6\u624D\u6709\u76EE\u6807\u3002`,\u{8fb9}\u{754c}:"\u548C standard \u7684\u5206\u754C\uFF1A\u7528\u6237\u6709\u6CA1\u6709\u8BF4\u8981\u505A\u6210\u4EC0\u4E48\uFF1F\u6CA1\u6709 \u2192 deep\u3002\u4F46 deep \u8BF4\u7684\u662F\u300C\u8981\u5148\u8C03\u67E5\u624D\u77E5\u9053\u505A\u6210\u4EC0\u4E48\u6837\u300D\uFF0C\u4E0D\u662F\u300C\u8FD9\u53E5\u8BDD\u91CC\u6CA1\u6709\u6D3B\u300D\u3002\u4E00\u53E5\u5DF2\u7ECF\u5B8C\u6574\u3001\u53EF\u4EE5\u76F4\u63A5\u56DE\u7B54\u7684\u8BDD\u4E0D\u662F deep\uFF0C\u662F swift\u3002"}},examples:[{task:"\u80FD\u4E0D\u80FD\u8C03\u67E5\u4E00\u4E0B\u4E3A\u4EC0\u4E48\u5BA1\u8BA1\u65E5\u5FD7\u8868\u6700\u8FD1\u6DA8\u5F97\u8FD9\u4E48\u5FEB",tier:"deep"},{task:"\u641C\u7D22\u7ED3\u679C\u70B9\u8FDB\u53BB\u7ECF\u5E38\u662F\u6B7B\u94FE,404,\u9EBB\u70E6\u67E5\u4E00\u4E0B\u662F\u4E0D\u662F\u6784\u5EFA\u7684\u65F6\u5019\u8DEF\u7531\u6CA1\u540C\u6B65",tier:"standard"},{task:"\u6DF1\u8272\u6A21\u5F0F\u4EE3\u7801\u5757\u80CC\u666F\u8272\u8DDF\u6B63\u6587\u80CC\u666F\u4E00\u4E2A\u989C\u8272 \u770B\u4E0D\u51FA\u533A\u522B",tier:"swift"},{task:"Tooltip \u5728 iframe \u91CC\u5B9A\u4F4D\u5B8C\u5168\u662F\u9519\u7684",tier:"swift"},{task:"Table \u7EC4\u4EF6\u8868\u5934\u56FA\u5B9A\u4E4B\u540E\u6A2A\u5411\u6EDA\u52A8\u6761\u6D88\u5931\u4E86",tier:"standard"},{task:"Preferences window doesn't remember size after quit\n\n`PreferencesWindowController.swift` never persists its frame via `setFrameAutosaveName`. Add an autosave name and call it in `windowDidLoad`, so resizing the window sticks across relaunches like the main status window already does.",tier:"swift"},{task:"what would it take to add keyboard-only card creation (no mouse) to the board view?",tier:"deep"},{task:"Add a `--json` flag to the `board list` command\n\nRight now `board list` only prints an ASCII table (src/commands/list.ts). Add a `--json` flag that dumps the same data as JSON to stdout instead, and update the `--help` text in `cli.ts` to document it. Useful for piping into `jq` in scripts.",tier:"swift"},{task:"Scheduled job leaks DB connections\n\n`ReportGenerationJob.java` opens a `Connection` manually in `run()` but never closes it in the catch block when an exception is thrown mid-query. Under load this exhausts the HikariCP pool within a couple hours. Wrap it in try-with-resources and add a test that simulates a query failure and asserts pool size returns to baseline.",tier:"swift"},{task:"\u8DD1\u5927\u8868\u7684\u65F6\u5019\u62A5\u4E86\u4E2A\u5185\u5B58\u9519\u8BEF\n```\nMemoryError: Unable to allocate 3.2 GiB for an array\n```\n\u770B\u770B\u80FD\u4E0D\u80FD\u6D41\u5F0F\u5904\u7406\u4E0D\u8981\u4E00\u6B21\u8BFB\u5168\u90E8",tier:"standard"},{task:`\u89D2\u8272\u6743\u9650\u7F13\u5B58\u6CA1\u6709\u5931\u6548\u673A\u5236
10
+
11
+ PermissionCacheService.java \u7528 Guava Cache \u5B58\u6743\u9650,\u6CA1\u8BBE TTL,\u7BA1\u7406\u5458\u5728\u540E\u53F0\u6539\u4E86\u67D0\u4E2A\u89D2\u8272\u7684\u6743\u9650\u4E4B\u540E,\u5DF2\u7ECF\u767B\u5F55\u7684\u7528\u6237\u90A3\u8FB9\u8FD8\u662F\u8BFB\u5230\u65E7\u7684\u7F13\u5B58\u503C,\u8981\u91CD\u542F\u670D\u52A1\u624D\u4F1A\u5237\u65B0\u3002\u60F3\u52A0\u4E24\u5757:\u4E00\u662F\u7ED9\u7F13\u5B58\u52A0\u4E2A\u5408\u7406\u7684 TTL \u515C\u5E95,\u4E8C\u662F\u5728 RoleController.updateRole \u4FDD\u5B58\u6210\u529F\u4E4B\u540E\u4E3B\u52A8\u8C03\u7528\u4E00\u6B21\u7F13\u5B58\u5931\u6548,\u628A\u6539\u52A8\u7ACB\u523B\u751F\u6548\u3002\u987A\u4FBF\u8865\u4E00\u4E2A\u8986\u76D6\u8FD9\u4E2A\u5931\u6548\u903B\u8F91\u7684\u5355\u6D4B\u3002`,tier:"swift"},{task:"any chance we could speed up the parquet export path? it feels way slower than the csv one for the same row count",tier:"deep"},{task:"could we support opening files in $EDITOR from the file manager instead of always using vi?",tier:"deep"},{task:"\u6253\u602A\u6389\u94B1\u7684\u51E0\u7387\u597D\u50CF\u592A\u9AD8\u4E86,\u80FD\u4E0D\u80FD\u914D\u7F6E\u5316",tier:"standard"},{task:"\u7535\u91CF\u56FE\u6807\u5728\u5145\u6EE1\u7535\u4E4B\u540E\u6CA1\u6709\u53D8\u7EFF,\u770B\u4E0B",tier:"standard"},{task:"any ideas on how to make undo/redo work across card moves, not just edits?",tier:"deep"},{task:"Getting this on startup after bumping api-version in plugin.yml:\n```\njava.lang.NoSuchMethodError: 'void org.bukkit.entity.Player.sendActionBar(net.md_5.bungee.api.chat.BaseComponent)'\n```\nLooks like a Paper API compat issue, please fix.",tier:"standard"},{task:"is there a way to make the Select component support async options loading?",tier:"deep"},{task:"websocket \u4EE3\u7406\u8001\u662F\u65AD\u8FDE,http \u7684\u6CA1\u95EE\u9898,\u662F\u4E0D\u662F upstream \u7684 timeout \u8BBE\u7F6E\u592A\u77ED\u4E86",tier:"standard"},{task:"OrderController \u7684\u5206\u9875\u63A5\u53E3,pageSize \u4F20\u8D85\u8FC7 1000 \u4F1A\u76F4\u63A5 OOM,\u52A0\u4E2A max pageSize \u6821\u9A8C,\u8D85\u8FC7\u5C31 400,\u987A\u4FBF\u628A error message \u91CC\u90A3\u53E5\u82F1\u6587\u6539\u6210\u4E2D\u6587",tier:"swift"},{task:"\u8BBE\u7F6E\u9762\u677F\u91CC\u52A0\u4E00\u4E2A\u300C\u5F00\u673A\u81EA\u542F\u300D\u7684\u5F00\u5173,\u7528 SMAppService \u90A3\u5957\u65B0 API(macOS 13+),\u72B6\u6001\u5B58\u8FDB UserDefaults \u7684 launchAtLogin \u952E,UI \u7167\u6284\u73B0\u5728\u300C\u663E\u793A\u79D2\u6570\u300D\u90A3\u4E2A toggle \u7684\u6837\u5F0F\u5C31\u884C",tier:"swift"},{task:"\u611F\u89C9\u542F\u52A8\u901F\u5EA6\u53EF\u4EE5\u518D\u5FEB\u70B9,\u8C03\u67E5\u4E00\u4E0B\u74F6\u9888\u5728\u54EA",tier:"deep"},{task:"\u6587\u4EF6\u6811\u6EDA\u52A8\u7684\u65F6\u5019\u611F\u89C9\u5361\u4E00\u4E0B \u80FD\u4E0D\u80FD\u67E5\u4E00\u4E0B\u662F\u4E0D\u662F\u91CD\u7ED8\u7684\u95EE\u9898",tier:"deep"},{task:"health check \u7684 interval \u73B0\u5728\u5199\u6B7B 5s,\u80FD\u4E0D\u80FD\u505A\u6210\u6BCF\u4E2A upstream \u53EF\u914D\u7F6E?",tier:"standard"}]};var JEV_ENDPOINT="https://api.typesafe.ai/v1/systemone",PROMPT_LIMIT=1200,DEFAULT_THRESHOLD=0.5,DEFAULT_TIMEOUT_MS=4000,DEFAULT_MODEL="jev-latest",DEFAULT_KEY_ENV="TYPESAFE_API_KEY";function stringAt2(get,key){let raw=get(key);return typeof raw==="string"&&raw.trim()?raw.trim():void 0}function numberAt(get,key,fallback,min,max){let raw=get(key);if(typeof raw==="string"&&!raw.trim())return fallback;let n=typeof raw==="number"?raw:Number(typeof raw==="string"?raw:Number.NaN);if(!Number.isFinite(n)||n<min||n>max)return fallback;return n}function isLoopback(hostname){let host=hostname.replace(/^\[|\]$/g,"").toLowerCase();return host==="localhost"||host.endsWith(".localhost")||host==="::1"||/^127\.\d+\.\d+\.\d+$/.test(host)}function endpointMode(raw){let url;try{url=new URL(raw)}catch{return{kind:"off"}}if(url.protocol==="https:")return{kind:"url",url:raw};if(url.protocol!=="http:")return{kind:"off"};if(isLoopback(url.hostname))return{kind:"url",url:raw};return{kind:"refused",why:`http:// is only accepted for a loopback address; use https:// for ${url.hostname}`}}function readClassifierConfig(get=getPersistedValue){let raw=stringAt2(get,"autoRouting.classifier")??"off",mode=raw==="jev"?{kind:"jev"}:raw==="off"?{kind:"off"}:endpointMode(raw),keyEnv=mode.kind==="jev"?stringAt2(get,"autoRouting.classifierKeyEnv")??DEFAULT_KEY_ENV:stringAt2(get,"autoRouting.classifierCustomKeyEnv");return{mode,threshold:numberAt(get,"autoRouting.classifierThreshold",DEFAULT_THRESHOLD,0,1),timeoutMs:numberAt(get,"autoRouting.classifierTimeoutMs",DEFAULT_TIMEOUT_MS,200,60000),model:stringAt2(get,"autoRouting.classifierModel")??DEFAULT_MODEL,...keyEnv?{keyEnv}:{}}}var declined=(reason,detail)=>({kind:"declined",reason,...detail?{detail}:{}});async function classifyTier(text,config,deps={}){if(config.mode.kind==="off")return declined("off");if(config.mode.kind==="refused")return declined("refused",config.mode.why);let prompt=text.trim().slice(0,PROMPT_LIMIT);if(!prompt)return declined("blank");let env=deps.env??process.env,key=config.keyEnv?(deps.readSecret??resolveSecret)(config.keyEnv,env):void 0;if(config.mode.kind==="jev"&&!key)return declined("no-key",`no ${config.keyEnv} in the environment or ~/.rove/secrets.json`);let doFetch=deps.fetch??globalThis.fetch,controller=new AbortController,timer=setTimeout(()=>controller.abort(),config.timeoutMs);try{let request=config.mode.kind==="jev"?{url:JEV_ENDPOINT,body:jevRequest(prompt,config.model,deps.rubric??DEFAULT_TIER_RUBRIC)}:{url:config.mode.url,body:{text:prompt}},res=await doFetch(request.url,{method:"POST",headers:{"content-type":"application/json",...key?{authorization:`Bearer ${key}`}:{}},body:JSON.stringify(request.body),signal:controller.signal,redirect:"error"});if(!res.ok)return declined("failed",describeHttpFailure(res));let payload=await res.json(),verdict=config.mode.kind==="jev"?readJevAnswer(payload):readPlainAnswer(payload);if(!verdict.ok)return declined("failed",verdict.why);if(verdict.value.confidence<config.threshold)return declined("low-confidence",`${verdict.value.tier} at ${verdict.value.confidence.toFixed(2)}`);return{kind:"picked",verdict:verdict.value}}catch(err){let why=err instanceof Error&&err.name==="AbortError"?`timed out after ${config.timeoutMs}ms`:String(err);return declined("failed",why)}finally{clearTimeout(timer)}}function describeHttpFailure(res){let status=`HTTP ${res.status}`;if(res.status!==429)return status;let after=res.headers?.get?.("retry-after"),when=after?`, retry-after ${after}`:"";return`${status} \u2014 upstream pool rate limit, not necessarily your quota${when}`}function jevRequest(prompt,model,rubric){return{model,state:{task_text:prompt,labelled_examples:rubric.examples.map((e)=>({task:e.task,tier:e.tier}))},questions:{verdict:{type:"choice",criteria:rubric.criteria,instructions:{role:rubric.role,criterion:rubric.criterion}}}}}var TASK_GROUPS=["waiting-on-you","landing","ready-for-review","working","idle","unknown"];function taskGroupRank(group){return TASK_GROUPS.indexOf(group)}var ERROR_SETTLE_MS=20000,DEAD_SETTLE_MS=60000;function actedOn(task){if(task.status==="done"||task.status==="canceled")return!0;let lifecycle=task.prStatus?.lifecycle;return lifecycle==="merged"||lifecycle==="closed"}function autoResumes(task,now){let at=task.quotaResume?.resumeAt;if(!at)return!1;let ms=Date.parse(at);return!Number.isNaN(ms)&&ms>now}function deriveTaskGroup(input){let{task,now}=input,activity=input.activity??null,state=activity?.state,age=activity?Math.max(0,now-activity.at):0;if(task.deletion?.phase==="error")return"waiting-on-you";if(state==="permission_needed")return"waiting-on-you";if(state==="rate_limited"&&!autoResumes(task,now))return"waiting-on-you";if(state==="error"&&age>=ERROR_SETTLE_MS)return"waiting-on-you";if(activity&&!task.report&&age>=DEAD_SETTLE_MS&&(state==="dead"||input.tabAlive===!1))return"waiting-on-you";if(state==="running"&&input.tabAlive!==!1)return"working";if(state==="rate_limited")return"working";let pr=task.prStatus;if((pr?.lifecycle==="open"||pr?.lifecycle==="ready_to_merge")&&(pr.reviewDecision??"").toUpperCase()==="APPROVED")return"landing";if((task.report!==void 0||state==="turn_complete")&&!actedOn(task))return"ready-for-review";return activity?"idle":"unknown"}function taskGroupOf(input){let group=deriveTaskGroup(input);return{group,rank:taskGroupRank(group)}}
12
+ export{secretStatus,writeSecret,AUTO_ROUTING_TIERS,isAutoRoutingTier,autoRoutingKey,readAutoRoutingTable,tierBlock,describeTierBlock,readClassifierConfig,classifyTier,taskGroupRank,deriveTaskGroup,taskGroupOf};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{binaryAvailable,resolveEditorCommand}from"./chunk-pvwfah6e.js";import"./chunk-6xppe9bj.js";import"./chunk-7kysxgbq.js";import"./chunk-c8dbw8rz.js";import"./chunk-6cm9pb1f.js";import"./chunk-hq2n27y1.js";import"./chunk-40dgv828.js";import"./chunk-81p6mm0p.js";import"./chunk-vnpqemb0.js";import{kvStatePath}from"./chunk-q5jhy3t8.js";import"./chunk-9prawccj.js";import{activeCliName}from"./chunk-00ehck55.js";import"./chunk-fxs82dsx.js";import"./chunk-sb0ns0c7.js";import"./chunk-f10n6063.js";import"./chunk-y8fqdnh3.js";import"./chunk-hq4b3fca.js";import"./chunk-wqfp8d9w.js";import{existsSync,mkdirSync,writeFileSync}from"fs";import{dirname}from"path";var CLI_NAME=activeCliName();function printUsage(out){out.write([`Usage: ${CLI_NAME} config [--path]`,"","Open Rove's user config (state.json \u2014 theme, locale, engine + editor prefs)","in your editor. The editor is your configured one (Settings \u2192 General \u2192","Editor); left on Auto it is $VISUAL / $EDITOR, else the first of","nvim / vim / emacs / nano.","Rove re-reads the file on its next launch.","","Options:"," --path Print the config file path and exit (don't open an editor)"," -h, --help Print this help",""].join(`
2
+ import{binaryAvailable,resolveEditorCommand}from"./chunk-ntr5zmav.js";import"./chunk-6xppe9bj.js";import"./chunk-7kysxgbq.js";import"./chunk-hg87p5n8.js";import"./chunk-40dgv828.js";import"./chunk-mkksdcsw.js";import{activeCliName}from"./chunk-ppwpjm39.js";import"./chunk-fxs82dsx.js";import"./chunk-zyd6k6ak.js";import{kvStatePath}from"./chunk-8hbtca1g.js";import"./chunk-hq2n27y1.js";import"./chunk-sb0ns0c7.js";import"./chunk-vnpqemb0.js";import"./chunk-9prawccj.js";import"./chunk-f10n6063.js";import"./chunk-y8fqdnh3.js";import"./chunk-hq4b3fca.js";import"./chunk-wqfp8d9w.js";import{existsSync,mkdirSync,writeFileSync}from"fs";import{dirname}from"path";var CLI_NAME=activeCliName();function printUsage(out){out.write([`Usage: ${CLI_NAME} config [--path]`,"","Open Rove's user config (state.json \u2014 theme, locale, engine + editor prefs)","in your editor. The editor is your configured one (Settings \u2192 General \u2192","Editor); left on Auto it is $VISUAL / $EDITOR, else the first of","nvim / vim / emacs / nano.","Rove re-reads the file on its next launch.","","Options:"," --path Print the config file path and exit (don't open an editor)"," -h, --help Print this help",""].join(`
3
3
  `))}async function runConfigSubcommand(argv=[]){if(argv.some((a)=>a==="-h"||a==="--help"||a==="help")){printUsage(process.stdout);return}let path=kvStatePath();if(argv.some((a)=>a==="--path"||a==="path")){console.log(path);return}let unknown=argv.find((a)=>a.length>0);if(unknown!==void 0)process.stderr.write(`${CLI_NAME} config: unexpected argument "${unknown}"
4
4
  `),printUsage(process.stderr),process.exit(2);if(!existsSync(path))mkdirSync(dirname(path),{recursive:!0}),writeFileSync(path,`{}
5
5
  `);let resolved=await resolveEditorCommand(path);if(!resolved||!await binaryAvailable(resolved.bin))process.stderr.write(`${CLI_NAME} config: no editor found \u2014 set $EDITOR (or Settings \u2192 General \u2192 Editor), or edit directly:
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{DEFAULT_TASK_VENDOR}from"./chunk-xy8be792.js";import{BUILTIN_VENDORS,isBuiltinVendor}from"./chunk-05jej26n.js";import{getCustomEngineIds,getDisabledEngineIds,getPersistedString,setPersistedString}from"./chunk-c8dbw8rz.js";var REPO_KEY_PREFIX="lastActiveVendor.";function validVendor(value,customIds){let v=value?.trim();if(!v)return;if(getDisabledEngineIds().includes(v))return;if(isBuiltinVendor(v)||customIds.includes(v))return v;return}function firstEnabledVendor(){let disabled=new Set(getDisabledEngineIds());return[...BUILTIN_VENDORS,...getCustomEngineIds()].find((id)=>!disabled.has(id))??DEFAULT_TASK_VENDOR}function getRepoLastActiveVendor(repo){return validVendor(getPersistedString(REPO_KEY_PREFIX+repo),getCustomEngineIds())}function setRepoLastActiveVendor(repo,vendor){setPersistedString(REPO_KEY_PREFIX+repo,vendor)}function getGlobalDefaultVendor(){let customIds=getCustomEngineIds();return validVendor(getPersistedString("defaultVendor"),customIds)??validVendor(getPersistedString("lastSelectedVendor"),customIds)}function setGlobalDefaultVendor(vendor){setPersistedString("defaultVendor",vendor)}function resolvePreferredVendor(repo){return(repo?getRepoLastActiveVendor(repo):void 0)??getGlobalDefaultVendor()??firstEnabledVendor()}
2
+ import{DEFAULT_TASK_VENDOR}from"./chunk-xy8be792.js";import{BUILTIN_VENDORS,isBuiltinVendor}from"./chunk-05jej26n.js";import{getCustomEngineIds,getDisabledEngineIds,getPersistedString,setPersistedString}from"./chunk-hg87p5n8.js";var REPO_KEY_PREFIX="lastActiveVendor.";function validVendor(value,customIds){let v=value?.trim();if(!v)return;if(getDisabledEngineIds().includes(v))return;if(isBuiltinVendor(v)||customIds.includes(v))return v;return}function firstEnabledVendor(){let disabled=new Set(getDisabledEngineIds());return[...BUILTIN_VENDORS,...getCustomEngineIds()].find((id)=>!disabled.has(id))??DEFAULT_TASK_VENDOR}function getRepoLastActiveVendor(repo){return validVendor(getPersistedString(REPO_KEY_PREFIX+repo),getCustomEngineIds())}function setRepoLastActiveVendor(repo,vendor){setPersistedString(REPO_KEY_PREFIX+repo,vendor)}function getGlobalDefaultVendor(){let customIds=getCustomEngineIds();return validVendor(getPersistedString("defaultVendor"),customIds)??validVendor(getPersistedString("lastSelectedVendor"),customIds)}function setGlobalDefaultVendor(vendor){setPersistedString("defaultVendor",vendor)}function resolvePreferredVendor(repo){return(repo?getRepoLastActiveVendor(repo):void 0)??getGlobalDefaultVendor()??firstEnabledVendor()}
3
3
  export{getRepoLastActiveVendor,setRepoLastActiveVendor,getGlobalDefaultVendor,setGlobalDefaultVendor,resolvePreferredVendor};