@surething/cockpit 1.0.251 → 1.0.253

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 (202) hide show
  1. package/.next-prod/BUILD_ID +1 -1
  2. package/.next-prod/app-path-routes-manifest.json +4 -4
  3. package/.next-prod/build-manifest.json +2 -2
  4. package/.next-prod/prerender-manifest.json +3 -3
  5. package/.next-prod/server/app/_global-error/page.js.nft.json +1 -1
  6. package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
  7. package/.next-prod/server/app/_global-error.html +1 -1
  8. package/.next-prod/server/app/_global-error.rsc +1 -1
  9. package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  11. package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  12. package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
  13. package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
  14. package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next-prod/server/app/_not-found/page.js +1 -1
  16. package/.next-prod/server/app/_not-found/page.js.nft.json +1 -1
  17. package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/.next-prod/server/app/_not-found.html +2 -2
  19. package/.next-prod/server/app/_not-found.rsc +3 -3
  20. package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +3 -3
  21. package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
  22. package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +3 -3
  23. package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  24. package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  25. package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  26. package/.next-prod/server/app/api/agent/test/route.js.nft.json +1 -1
  27. package/.next-prod/server/app/api/bash/route.js.nft.json +1 -1
  28. package/.next-prod/server/app/api/chat/codex/route.js.nft.json +1 -1
  29. package/.next-prod/server/app/api/chat/deepseek/route.js.nft.json +1 -1
  30. package/.next-prod/server/app/api/chat/kimi/route.js.nft.json +1 -1
  31. package/.next-prod/server/app/api/chat/ollama/route.js.nft.json +1 -1
  32. package/.next-prod/server/app/api/chat/pty-input/route.js.nft.json +1 -1
  33. package/.next-prod/server/app/api/chat/route.js.nft.json +1 -1
  34. package/.next-prod/server/app/api/chat/stop/route.js.nft.json +1 -1
  35. package/.next-prod/server/app/api/claude-stats/route.js.nft.json +1 -1
  36. package/.next-prod/server/app/api/commands/route.js.nft.json +1 -1
  37. package/.next-prod/server/app/api/comments/route.js.nft.json +1 -1
  38. package/.next-prod/server/app/api/db/columns/route.js.nft.json +1 -1
  39. package/.next-prod/server/app/api/db/connect/route.js.nft.json +1 -1
  40. package/.next-prod/server/app/api/db/disconnect/route.js.nft.json +1 -1
  41. package/.next-prod/server/app/api/db/export/route.js.nft.json +1 -1
  42. package/.next-prod/server/app/api/db/query/route.js.nft.json +1 -1
  43. package/.next-prod/server/app/api/db/schemas/route.js.nft.json +1 -1
  44. package/.next-prod/server/app/api/deepseek/credentials/route.js.nft.json +1 -1
  45. package/.next-prod/server/app/api/dev/spans/route.js.nft.json +1 -1
  46. package/.next-prod/server/app/api/extension/version/route.js.nft.json +1 -1
  47. package/.next-prod/server/app/api/file/route.js.nft.json +1 -1
  48. package/.next-prod/server/app/api/files/blame/route.js.nft.json +1 -1
  49. package/.next-prod/server/app/api/files/clipboard/route.js.nft.json +1 -1
  50. package/.next-prod/server/app/api/files/copy/route.js.nft.json +1 -1
  51. package/.next-prod/server/app/api/files/delete/route.js.nft.json +1 -1
  52. package/.next-prod/server/app/api/files/expanded/route.js.nft.json +1 -1
  53. package/.next-prod/server/app/api/files/index/route.js.nft.json +1 -1
  54. package/.next-prod/server/app/api/files/init/route.js.nft.json +1 -1
  55. package/.next-prod/server/app/api/files/paste/route.js.nft.json +1 -1
  56. package/.next-prod/server/app/api/files/read/route.js.nft.json +1 -1
  57. package/.next-prod/server/app/api/files/readdir/route.js.nft.json +1 -1
  58. package/.next-prod/server/app/api/files/recent/route.js.nft.json +1 -1
  59. package/.next-prod/server/app/api/files/save/route.js.nft.json +1 -1
  60. package/.next-prod/server/app/api/files/search/route.js.nft.json +1 -1
  61. package/.next-prod/server/app/api/files/stat/route.js.nft.json +1 -1
  62. package/.next-prod/server/app/api/files/text/route.js.nft.json +1 -1
  63. package/.next-prod/server/app/api/git/branch-diff/route.js.nft.json +1 -1
  64. package/.next-prod/server/app/api/git/branches/route.js.nft.json +1 -1
  65. package/.next-prod/server/app/api/git/commit-diff/route.js.nft.json +1 -1
  66. package/.next-prod/server/app/api/git/commits/route.js.nft.json +1 -1
  67. package/.next-prod/server/app/api/git/current-branch/route.js.nft.json +1 -1
  68. package/.next-prod/server/app/api/git/diff/route.js.nft.json +1 -1
  69. package/.next-prod/server/app/api/git/discard/route.js.nft.json +1 -1
  70. package/.next-prod/server/app/api/git/stage/route.js.nft.json +1 -1
  71. package/.next-prod/server/app/api/git/status/route.js.nft.json +1 -1
  72. package/.next-prod/server/app/api/git/unstage/route.js.nft.json +1 -1
  73. package/.next-prod/server/app/api/git/worktree/route.js.nft.json +1 -1
  74. package/.next-prod/server/app/api/global-state/route.js.nft.json +1 -1
  75. package/.next-prod/server/app/api/health/route.js.nft.json +1 -1
  76. package/.next-prod/server/app/api/html-apps/[id]/route.js.nft.json +1 -1
  77. package/.next-prod/server/app/api/html-apps/route.js.nft.json +1 -1
  78. package/.next-prod/server/app/api/jupyter/load/route.js.nft.json +1 -1
  79. package/.next-prod/server/app/api/jupyter/save/route.js.nft.json +1 -1
  80. package/.next-prod/server/app/api/jupyter/shutdown/route.js.nft.json +1 -1
  81. package/.next-prod/server/app/api/lsp/definition/route.js.nft.json +1 -1
  82. package/.next-prod/server/app/api/lsp/hover/route.js.nft.json +1 -1
  83. package/.next-prod/server/app/api/lsp/references/route.js.nft.json +1 -1
  84. package/.next-prod/server/app/api/lsp/status/route.js.nft.json +1 -1
  85. package/.next-prod/server/app/api/lsp/warmup/route.js.nft.json +1 -1
  86. package/.next-prod/server/app/api/mysql/columns/route.js.nft.json +1 -1
  87. package/.next-prod/server/app/api/mysql/connect/route.js.nft.json +1 -1
  88. package/.next-prod/server/app/api/mysql/disconnect/route.js.nft.json +1 -1
  89. package/.next-prod/server/app/api/mysql/export/route.js.nft.json +1 -1
  90. package/.next-prod/server/app/api/mysql/query/route.js.nft.json +1 -1
  91. package/.next-prod/server/app/api/mysql/schemas/route.js.nft.json +1 -1
  92. package/.next-prod/server/app/api/neo4j/connect/route.js.nft.json +1 -1
  93. package/.next-prod/server/app/api/neo4j/disconnect/route.js.nft.json +1 -1
  94. package/.next-prod/server/app/api/neo4j/query/route.js.nft.json +1 -1
  95. package/.next-prod/server/app/api/neo4j/schema/route.js.nft.json +1 -1
  96. package/.next-prod/server/app/api/note/route.js.nft.json +1 -1
  97. package/.next-prod/server/app/api/ollama/config/route.js.nft.json +1 -1
  98. package/.next-prod/server/app/api/ollama/models/route.js.nft.json +1 -1
  99. package/.next-prod/server/app/api/ollama/start/route.js.nft.json +1 -1
  100. package/.next-prod/server/app/api/open-cursor/route.js.nft.json +1 -1
  101. package/.next-prod/server/app/api/open-vscode/route.js.nft.json +1 -1
  102. package/.next-prod/server/app/api/pick-folder/route.js.nft.json +1 -1
  103. package/.next-prod/server/app/api/pinned-sessions/route.js.nft.json +1 -1
  104. package/.next-prod/server/app/api/project-settings/route.js.nft.json +1 -1
  105. package/.next-prod/server/app/api/project-state/route.js.nft.json +1 -1
  106. package/.next-prod/server/app/api/projectGraph/affected/route.js.nft.json +1 -1
  107. package/.next-prod/server/app/api/projectGraph/callees/route.js.nft.json +1 -1
  108. package/.next-prod/server/app/api/projectGraph/callers/route.js.nft.json +1 -1
  109. package/.next-prod/server/app/api/projectGraph/coedit/route.js.nft.json +1 -1
  110. package/.next-prod/server/app/api/projectGraph/context/route.js.nft.json +1 -1
  111. package/.next-prod/server/app/api/projectGraph/file/route.js.nft.json +1 -1
  112. package/.next-prod/server/app/api/projectGraph/file-functions/route.js.nft.json +1 -1
  113. package/.next-prod/server/app/api/projectGraph/impact/route.js.nft.json +1 -1
  114. package/.next-prod/server/app/api/projectGraph/related/route.js.nft.json +1 -1
  115. package/.next-prod/server/app/api/projectGraph/risk/route.js.nft.json +1 -1
  116. package/.next-prod/server/app/api/projectGraph/search/route.js.nft.json +1 -1
  117. package/.next-prod/server/app/api/projects/route.js.nft.json +1 -1
  118. package/.next-prod/server/app/api/push/public-key/route.js.nft.json +1 -1
  119. package/.next-prod/server/app/api/push/subscribe/route.js.nft.json +1 -1
  120. package/.next-prod/server/app/api/push/unsubscribe/route.js.nft.json +1 -1
  121. package/.next-prod/server/app/api/redis/command/route.js.nft.json +1 -1
  122. package/.next-prod/server/app/api/redis/connect/route.js.nft.json +1 -1
  123. package/.next-prod/server/app/api/redis/delete/route.js.nft.json +1 -1
  124. package/.next-prod/server/app/api/redis/disconnect/route.js.nft.json +1 -1
  125. package/.next-prod/server/app/api/redis/get/route.js.nft.json +1 -1
  126. package/.next-prod/server/app/api/redis/keys/route.js.nft.json +1 -1
  127. package/.next-prod/server/app/api/redis/set/route.js.nft.json +1 -1
  128. package/.next-prod/server/app/api/review/[id]/comments/route.js.nft.json +1 -1
  129. package/.next-prod/server/app/api/review/[id]/replies/route.js.nft.json +1 -1
  130. package/.next-prod/server/app/api/review/[id]/route.js.nft.json +1 -1
  131. package/.next-prod/server/app/api/review/identify/route.js.nft.json +1 -1
  132. package/.next-prod/server/app/api/review/order/route.js.nft.json +1 -1
  133. package/.next-prod/server/app/api/review/route.js.nft.json +1 -1
  134. package/.next-prod/server/app/api/review/share-info/route.js.nft.json +1 -1
  135. package/.next-prod/server/app/api/review/users/route.js.nft.json +1 -1
  136. package/.next-prod/server/app/api/scheduled-tasks/route.js.nft.json +1 -1
  137. package/.next-prod/server/app/api/services/config/route.js.nft.json +1 -1
  138. package/.next-prod/server/app/api/services/scripts/route.js.nft.json +1 -1
  139. package/.next-prod/server/app/api/session/[sessionId]/fork/route.js.nft.json +1 -1
  140. package/.next-prod/server/app/api/session/[sessionId]/history/route.js +2 -2
  141. package/.next-prod/server/app/api/session/[sessionId]/history/route.js.nft.json +1 -1
  142. package/.next-prod/server/app/api/session-by-path/route.js +2 -2
  143. package/.next-prod/server/app/api/session-by-path/route.js.nft.json +1 -1
  144. package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js.nft.json +1 -1
  145. package/.next-prod/server/app/api/sessions/projects/route.js.nft.json +1 -1
  146. package/.next-prod/server/app/api/sessions/route.js.nft.json +1 -1
  147. package/.next-prod/server/app/api/settings/route.js.nft.json +1 -1
  148. package/.next-prod/server/app/api/skills/[id]/route.js.nft.json +1 -1
  149. package/.next-prod/server/app/api/skills/content/route.js.nft.json +1 -1
  150. package/.next-prod/server/app/api/skills/route.js +1 -1
  151. package/.next-prod/server/app/api/skills/route.js.nft.json +1 -1
  152. package/.next-prod/server/app/api/snapshots/diff/route.js.nft.json +1 -1
  153. package/.next-prod/server/app/api/snapshots/route.js.nft.json +1 -1
  154. package/.next-prod/server/app/api/terminal/aliases/route.js.nft.json +1 -1
  155. package/.next-prod/server/app/api/terminal/autocomplete/route.js.nft.json +1 -1
  156. package/.next-prod/server/app/api/terminal/bubble-order/route.js.nft.json +1 -1
  157. package/.next-prod/server/app/api/terminal/env/route.js.nft.json +1 -1
  158. package/.next-prod/server/app/api/terminal/history/route.js.nft.json +1 -1
  159. package/.next-prod/server/app/api/version/route.js.nft.json +1 -1
  160. package/.next-prod/server/app/apps/[...path]/route.js.nft.json +1 -1
  161. package/.next-prod/server/app/favicon.ico/route.js.nft.json +1 -1
  162. package/.next-prod/server/app/m/page.js +1 -1
  163. package/.next-prod/server/app/m/page.js.nft.json +1 -1
  164. package/.next-prod/server/app/m/page_client-reference-manifest.js +1 -1
  165. package/.next-prod/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  166. package/.next-prod/server/app/page.js +1 -1
  167. package/.next-prod/server/app/page.js.nft.json +1 -1
  168. package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
  169. package/.next-prod/server/app/project/page.js +1 -1
  170. package/.next-prod/server/app/project/page.js.nft.json +1 -1
  171. package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
  172. package/.next-prod/server/app/review/[id]/page.js +1 -1
  173. package/.next-prod/server/app/review/[id]/page.js.nft.json +1 -1
  174. package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
  175. package/.next-prod/server/app-paths-manifest.json +4 -4
  176. package/.next-prod/server/chunks/{6023.js → 293.js} +2 -2
  177. package/.next-prod/server/chunks/4848.js +78 -17
  178. package/.next-prod/server/chunks/5292.js +2 -2
  179. package/.next-prod/server/chunks/6038.js +1 -1
  180. package/.next-prod/server/chunks/9658.js +8 -10
  181. package/.next-prod/server/middleware-build-manifest.js +1 -1
  182. package/.next-prod/server/pages/404.html +2 -2
  183. package/.next-prod/server/pages/500.html +1 -1
  184. package/.next-prod/server/server-reference-manifest.json +1 -1
  185. package/.next-prod/static/chunks/2876-4336c42044f38302.js +25 -0
  186. package/.next-prod/static/chunks/{6784-0a1757d891ff579f.js → 6784-c9969c13c13b25af.js} +0 -0
  187. package/.next-prod/static/chunks/{4473-6877df387a4a05a5.js → 7241-aa9e33a07f5ce517.js} +2 -2
  188. package/.next-prod/static/chunks/9530-27352e6f8bafeb3c.js +15 -0
  189. package/.next-prod/static/chunks/app/{layout-fe0749dfc3651e66.js → layout-145570f39a827c0f.js} +1 -1
  190. package/.next-prod/static/chunks/app/m/{page-03365a5db8980b50.js → page-6c37d1fb9db9b9d6.js} +1 -1
  191. package/.next-prod/static/chunks/app/{page-ce4888a98fda86ff.js → page-487095ac01a4c1ef.js} +1 -1
  192. package/.next-prod/static/chunks/app/project/{page-ce4888a98fda86ff.js → page-487095ac01a4c1ef.js} +1 -1
  193. package/.next-prod/static/css/5aa1c710591e36bb.css +1 -0
  194. package/.next-prod/trace +14 -14
  195. package/.next-prod/trace-build +1 -1
  196. package/dist/scheduledTasks.mjs +78 -17
  197. package/package.json +1 -1
  198. package/.next-prod/static/chunks/4518-ddb1c50646c70ed5.js +0 -25
  199. package/.next-prod/static/chunks/9530-573e8f94413410d4.js +0 -17
  200. package/.next-prod/static/css/940b6d97248df0ed.css +0 -1
  201. /package/.next-prod/static/{43gzI6NymSKUFfFxi94ui → 8aWX4sRFsO4Rx4DD9L9w-}/_buildManifest.js +0 -0
  202. /package/.next-prod/static/{43gzI6NymSKUFfFxi94ui → 8aWX4sRFsO4Rx4DD9L9w-}/_ssgManifest.js +0 -0
@@ -1,21 +1,82 @@
1
1
  "use strict";exports.id=4848,exports.ids=[4848],exports.modules={26925:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{J:()=>l,v:()=>m});var e=c(89705),f=c(94506),g=c(34168),h=c(38561),i=c(95606),j=a([f]);f=(j.then?(await j)():j)[0];let n=globalThis,o=n.__cockpitSnapshotToolIndex??(n.__cockpitSnapshotToolIndex=new Map);function k(a){let b=a.message;return Array.isArray(b?.content)?b.content:[]}let p=a=>{f.s9.runFork(a.pipe(e.h9N(a=>e.FFw(`snapshot failed: ${a.message}`))))};function l(a,b,c){a&&p(e.qIB(g.M,d=>d.baseline(a,b,c)))}function m(a,b,c,d){if(a){if("assistant"===d.type){for(let a of k(d))a.id&&a.name&&o.set(a.id,{name:a.name,files:function(a){if(!a)return[];let b=[];return"string"==typeof a.file_path&&a.file_path&&b.push(a.file_path),"string"==typeof a.notebook_path&&a.notebook_path&&b.push(a.notebook_path),b}(a.input),provider:c,detail:function(a){if(a){if("string"==typeof a.description&&a.description)return a.description;if("string"==typeof a.command&&a.command)return a.command}}(a.input)});!function(){if(o.size<=4e3)return;let a=Math.floor(o.size/2);for(let b of o.keys()){if(a--<=0)break;o.delete(b)}}();return}if("user"===d.type)for(let f of k(d)){if(!f.tool_use_id)continue;let d=o.get(f.tool_use_id);if(d&&o.delete(f.tool_use_id),d&&h.W.has(d.name))continue;let j=f.tool_use_id;(0,i.NQ)(a),p(e.qIB(g.M,e=>e.record({cwd:a,sessionKey:b,provider:c,toolId:j,toolName:d?.name??"tool",toolFiles:d?.files??[],toolDetail:d?.detail})).pipe(e.yeE(e.OH5(()=>(0,i.UT)(a)))))}}}d()}catch(a){d(a)}})},33286:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{T:()=>k});var e=c(79830),f=c(82940),g=c(26925),h=c(37655),i=c(55511),j=a([g]);async function k(a,b,c){let{sessionId:d,images:j,cwd:k,language:l}=b;if(d&&(0,f.yQ)(d))return{ok:!1,status:409,error:"session is already running"};let m=b.prompt,n="string"==typeof m?(0,h.M)(m,l,c):m;if(!(n&&"string"==typeof n||j&&j.length>0))return{ok:!1,status:400,error:"Missing prompt or images"};if(a.preflight){let c=await a.preflight(b);if(!c.ok)return c}let o="string"==typeof n?n:void 0,p=new AbortController,q="string"==typeof b.runId&&b.runId||(0,i.randomUUID)(),r=d||q,s=d,t=!1;if(!(0,f.AD)(r,k||"",o,q))return{ok:!1,status:409,error:"run already active"};(0,f.e5)(r,()=>{t=!0,p.abort()}),k&&d&&(0,e.CS)(k,d,"loading",void 0,o).catch(()=>{}),(0,g.J)(k||"",r,a.name);let u={prompt:o,images:j,cwd:k||"",sessionId:d,params:b,signal:p.signal,emit(b){t||((0,f.ah)(r,b),(0,g.v)(k||"",r,a.name,b))},rekey(a){a&&((0,f.GS)(r,a),r=a,s=a,k&&(0,e.CS)(k,a,"loading",void 0,o).catch(()=>{}))},currentKey:()=>r};return(async()=>{try{await a.runner.run(u)}catch(b){if(p.signal.aborted){t=!0,(0,f.HS)(r,"idle");return}if(console.error(`[engine:${a.name}] run error:`,b),u.emit({type:"error",error:b instanceof Error?b.message:String(b)}),(0,f.HS)(r,"error"),t=!0,k&&s){let a=await (0,e.Pn)(k,s).catch(()=>void 0);await (0,e.CS)(k,s,"unread",a).catch(()=>{})}return}if(k&&s){let b=await (a.runner.resolveTitle?a.runner.resolveTitle(k,s).catch(()=>void 0):Promise.resolve(void 0));await (0,e.CS)(k,s,"unread",b).catch(()=>{})}t=!0,(0,f.HS)(r,"idle")})(),{ok:!0,runKey:r,sessionId:s??null}}g=(j.then?(await j)():j)[0],d()}catch(a){d(a)}})},37655:(a,b,c)=>{c.d(b,{M:()=>j});var d=c(29021),e=c(33873),f=c(7939);let g={qa:{zh:`---
2
2
  name: qa
3
- description: "进入需求澄清讨论模式:理解并复述需求,对不明确点回问确认,只输出理解不改代码,遵循 KISS。"
3
+ description: "进入需求澄清讨论模式:复述对需求的理解,把待确认点做成带推荐答案的选择题表格,只输出理解不改代码,遵循 KISS。"
4
4
  ---
5
5
 
6
- 进入需求澄清讨论模式
7
- 尝试理解用户的需求并给出你对需求的理解,有不明确的点需要向我确认,避免理解不一致而导致无效的代码修改
8
- 遵循 KISS 原则
9
- 输出理解,不改代码`,en:`---
6
+ 进入需求澄清讨论模式。目标是动代码前对齐理解,避免因理解不一致导致无效的代码修改。
7
+
8
+ ## 步骤
9
+
10
+ 1. 复述理解:几句话说清改哪里、改什么、现状是什么。先读代码确认现状再复述,不要凭猜测——猜错的复述比不复述更浪费轮次。
11
+ 2. 列待确认点:做成选择题表格(格式见下)。
12
+ 3. 停下等确认:不改代码,等用户回复再动手。
13
+
14
+ ## 待确认点表格
15
+
16
+ 必须用表格,每个点必须给出具体选项和推荐答案。让用户回一个字母就能定稿,而不是回答开放式问题。
17
+
18
+ | # | 待确认点 | 选项 | 推荐 | 理由 |
19
+ |---|---|---|---|---|
20
+ | 1 | <要定的那个决策> | A <做法一><br>B <做法二><br>C <做法三> | **A** | <为什么不选 B / C,一句话取舍> |
21
+ | 2 | <要定的那个决策> | A <做法一><br>B <做法二> | **B** | <为什么不选 A,一句话取舍> |
22
+
23
+ 表格后面跟一句:「直接回 1A 2B,或回『都按推荐』」。
24
+
25
+ 规则:
26
+ - 选项一行一个,用 <br> 分隔,不要用斜杠挤在一行——选项越长,挤成一行越难比对。
27
+ - 选项互斥且穷尽,最多 3 个。想不出第二个选项,说明它不是待确认点——别凑数。
28
+ - 推荐列必须填,不能写「看你」「都行」。
29
+ - 理由一句话,讲取舍(为什么不选另一个),不讲功能是什么。
30
+ - 硬约束单独写:如果某个选项会连带踩坑(有写死的常量依赖、改了这里会让别处失效),单开一个小表或段落讲清楚,不要塞进理由列——那是决策依据,不是理由。
31
+
32
+ ## 边界
33
+
34
+ - 只输出理解,不改代码、不写文件、不跑改动性命令。读代码确认现状是允许且鼓励的。
35
+ - 遵循 KISS 原则:只列真正影响实现方向的点。能自己查清楚的自己查,不要为了显得周全而堆确认点。
36
+ - 没有不明确的点,直接说「理解无歧义,可以开始」,不要硬凑表格。
37
+
38
+ ## 验证
39
+
40
+ 用户能只回字母或「都按推荐」就进入实现,说明这次澄清是合格的;如果用户还得补一段散文解释,说明选项没穷尽或推荐没给到位。`,en:`---
10
41
  name: qa
11
- description: "Enter requirement clarification mode: understand and restate the need, ask back on ambiguities, output understanding only without modifying code, follow KISS."
42
+ description: "Enter requirement clarification mode: restate your understanding, turn open questions into a multiple-choice table with a recommended answer for each, output understanding only without modifying code, follow KISS."
12
43
  ---
13
44
 
14
- Enter requirement clarification mode.
15
- Understand the user's needs and state your understanding.
16
- Ask for clarification on ambiguous points to avoid unnecessary code changes.
17
- Follow the KISS principle.
18
- Output your understanding only; do not modify code.`},ap:{zh:`---
45
+ Enter requirement clarification mode. The goal is to align on intent before touching code, so a misread requirement never turns into wasted changes.
46
+
47
+ ## Steps
48
+
49
+ 1. Restate your understanding: a few sentences on what changes, where, and what the current behaviour is. Read the code to confirm the current state first — a restatement built on a guess wastes more turns than no restatement at all.
50
+ 2. List the open questions as a multiple-choice table (format below).
51
+ 3. Stop and wait: do not modify code until the user answers.
52
+
53
+ ## Open-questions table
54
+
55
+ Always use a table, and always give every question concrete options plus a recommendation. The user should be able to lock the design by replying with letters, not by answering open-ended prose questions.
56
+
57
+ | # | Question | Options | Recommend | Why |
58
+ |---|---|---|---|---|
59
+ | 1 | <the decision to settle> | A <option one><br>B <option two><br>C <option three> | **A** | <why not B / C — one line of trade-off> |
60
+ | 2 | <the decision to settle> | A <option one><br>B <option two> | **B** | <why not A — one line of trade-off> |
61
+
62
+ Follow the table with: "Reply 1A 2B, or say 'all as recommended'".
63
+
64
+ Rules:
65
+ - One option per line, separated by <br> — never slash-joined on a single line. The longer the options, the harder a single line is to compare.
66
+ - Options must be mutually exclusive and exhaustive, at most 3. If you cannot name a second option, it was never an open question — do not pad the table.
67
+ - The Recommend column must always be filled. Never "up to you" or "either works".
68
+ - Keep Why to one line about the trade-off (why not the other option), not a description of the feature.
69
+ - Put hard constraints in their own table or paragraph: if an option drags a hidden cost along (a hardcoded constant depends on it, changing this breaks that), spell it out separately. It is decision input, not a reason cell.
70
+
71
+ ## Boundaries
72
+
73
+ - Output understanding only: do not modify code, write files, or run mutating commands. Reading code to confirm the current state is allowed and encouraged.
74
+ - Follow the KISS principle: list only what genuinely changes the implementation direction. Anything you can settle by looking it up, look it up.
75
+ - If nothing is ambiguous, just say so and offer to start — do not manufacture a table.
76
+
77
+ ## Verification
78
+
79
+ If the user can reply with only letters or "all as recommended" and you can start implementing, the clarification was good. If they have to write a paragraph back, your options were not exhaustive or your recommendation was missing.`},ap:{zh:`---
19
80
  name: ap
20
81
  description: "apply:实现 <SPEC>,并在实现过程中持续维护一份 apply-notes HTML 文件(放在临时目录),记录规格未覆盖的决策、改动与权衡。"
21
82
  argument-hint: "[SPEC 路径 / 留空 = 本次对话中已达成一致的 spec]"
@@ -926,16 +987,16 @@ description: "完整代码审查:静态 + 动态一遍做完。静态三角校
926
987
 
927
988
  两条副作用红线:① 主会话**不替 subagent 做实质判断**;② 静态拆出去还顺带消掉"静态广度摊薄动态建模"的主稀释。
928
989
 
929
- 按规模三档(**都至少进一个干净 subagent**):
990
+ 按规模三档(**都至少进一个干净 subagent**)。**前两档你自己按规模选;hard 只由用户显式指定,你不得自行升档**——改动再大、风险再高,用户没说 hard 就封顶在默认档,报告里也不要建议改用 hard:
930
991
  - **单 subagent**:无动态面 / 极小 → 1 个干净 subagent 跑 Part A。主会话只转交 diff + 收报告。
931
992
  - **默认(2 subagent)**:有动态面 → 1 静态 + 1 动态,**两个都干净、并行**,各自在干净 diff 上自行 triage(静态扫全部改动 / 动态用切片原型清单列全切片)。
932
- - **hard(1 + N subagent)**:高风险 / 大型 → 先 1 个干净 triage subagent 出切片清单,据此 fan out 1 静态 + 每切片 1 个 subagent。最深、最慢。
993
+ - **hard(1 + N subagent)**:**仅当用户显式要 hard(如 \`/cr hard\`)** → 先 1 个干净 triage subagent 出切片清单,据此 fan out 1 静态 + 每切片 1 个 subagent。最深、最慢。用户点了就照跑,不因为"这次改动不大"自行降档;真拆不出动态切片时,注明"无动态切片,per-slice fan-out 退化为 1 静态"即可。
933
994
 
934
995
  subagent prompt 模板:\`读本 skill (cr/SKILL.md),只对 <你那块(Part A 全部 / 某个动态切片)> 应用对应 Part,自行 triage,按统一格式输出 findings\`。
935
996
 
936
997
  **Synthesis(主会话,只整理不重判)**:汇总各 subagent 的 findings → 去重(同根因标"共犯")→ 影响 \xd7 概率排序 → 一份报告 + 梯度图。**禁止用主会话的开发上下文给任何 finding 洗白 / 降级**——subagent 怎么判就怎么收。要质疑某条,**重新 spawn 一个干净 subagent 复核**,而不是主会话自己拍。
937
998
 
938
- > 取舍:默认 2-subagent 既隔离开发污染、又消掉静态摊薄动态;hard 的 per-slice fan-out 是额外深度(实测把 image/video 挖到 🔴 + 多 subagent 独立收敛提置信度),贵且慢,只在高风险上。
999
+ > 取舍:默认 2-subagent 既隔离开发污染、又消掉静态摊薄动态;hard 的 per-slice fan-out 是额外深度(实测把 image/video 挖到 🔴 + 多 subagent 独立收敛提置信度),贵且慢,由用户显式选用(不自动升档)。
939
1000
 
940
1001
  ## Step 1 — 分诊(triage;两种模式都先做这步)
941
1002
  读 diff,切两面(可重叠):
@@ -1071,16 +1132,16 @@ Most PR review is static — read the snapshot and you can judge right/wrong, **
1071
1132
 
1072
1133
  Two side-effect red lines: ① the main session **does not make substantive judgements on the subagent's behalf**; ② splitting static out also removes the "static breadth dilutes dynamic modelling" dilution of the main thread.
1073
1134
 
1074
- Three tiers by scale (**all enter at least one clean subagent**):
1135
+ Three tiers by scale (**all enter at least one clean subagent**). **You pick between the first two by scale yourself; hard is enabled ONLY when the user explicitly asks for it — never escalate to it on your own** — however large the diff or however high the risk, without the user saying hard you cap at the default tier, and don't suggest switching to hard in the report either:
1075
1136
  - **Single subagent**: no dynamic surface / tiny → 1 clean subagent runs Part A. Main session just relays the diff + collects the report.
1076
1137
  - **Default (2 subagents)**: has a dynamic surface → 1 static + 1 dynamic, **both clean, in parallel**, each triaging on the clean diff itself (static scans all changes / dynamic lists every slice via the slice-archetype checklist).
1077
- - **hard (1 + N subagents)**: high-risk / large → first 1 clean triage subagent produces the slice list, then fan out 1 static + 1 subagent per slice. Deepest, slowest.
1138
+ - **hard (1 + N subagents)**: **only when the user explicitly asks for hard (e.g. \`/cr hard\`)** → first 1 clean triage subagent produces the slice list, then fan out 1 static + 1 subagent per slice. Deepest, slowest. Once the user asks for it, run it as asked — don't downgrade on your own because "this change is small"; if no dynamic slice can be carved out, just note "no dynamic slice, per-slice fan-out degenerates to 1 static".
1078
1139
 
1079
1140
  Subagent prompt template: \`Read this skill (cr/SKILL.md); apply only the matching Part to <your chunk (all of Part A / one dynamic slice)>, triage it yourself, and output findings in the unified format\`.
1080
1141
 
1081
1142
  **Synthesis (main session, organize only — never re-judge)**: gather each subagent's findings → dedup (mark same-root-cause as "accomplices") → sort by impact \xd7 probability → one report + gradient chart. **It is forbidden to use the main session's dev context to whitewash / downgrade any finding** — take what the subagent judged as-is. To dispute one, **spawn a fresh clean subagent to re-check**, not the main session deciding on its own.
1082
1143
 
1083
- > Trade-off: the default 2-subagent both isolates dev pollution and removes static-dilutes-dynamic; hard's per-slice fan-out is extra depth (in practice it dug image/video up to 🔴, and multiple independently-converging subagents raised confidence), expensive and slow, only for high risk.
1144
+ > Trade-off: the default 2-subagent both isolates dev pollution and removes static-dilutes-dynamic; hard's per-slice fan-out is extra depth (in practice it dug image/video up to 🔴, and multiple independently-converging subagents raised confidence), expensive and slow, selected explicitly by the user (never auto-escalated).
1084
1145
 
1085
1146
  ## Step 1 — Triage (do this first in both modes)
1086
1147
  Read the diff, cut two surfaces (may overlap):
@@ -1,5 +1,5 @@
1
- "use strict";exports.id=5292,exports.ids=[5292],exports.modules={15090:(a,b,c)=>{c.d(b,{rL:()=>p,bX:()=>o,BS:()=>q});var d=c(33873),e=c(79646),f=c(79748),g=c(29021);class h{spawn(){let a=this.findTsserver();console.log(`[tsserver] spawning: node ${a}`);let b=(0,d.resolve)(process.cwd(),"bin/set-title.js"),c=(0,e.spawn)("node",["--require",b,a,"--disableAutomaticTypingAcquisition"],{stdio:["pipe","pipe","pipe"],env:{...process.env,TSS_LOG:""}});return c.stdout.on("data",a=>this.onData(a)),c.stderr.setEncoding("utf-8"),c.stderr.on("data",a=>{console.log(`[tsserver stderr] ${a.trim()}`)}),c.stdin.on("error",a=>{console.error("[tsserver] stdin error:",a.message)}),c.on("error",a=>{console.error("[tsserver] process error:",a),this.rejectAll(Error("tsserver process error"))}),c.on("exit",a=>{console.log(`[tsserver] exited with code ${a}`),this.rejectAll(Error(`tsserver exited with code ${a}`)),this.process=null}),this.process=c,c}openFile(a,b){let c=(0,d.resolve)(a);this.openedFiles.has(c)?this.sendRequest("reload",{file:c,tmpfile:c}):(this.openedFiles.add(c),this.sendRequest("open",{file:c,fileContent:b}))}closeFile(a){let b=(0,d.resolve)(a);this.openedFiles.has(b)&&(this.openedFiles.delete(b),this.sendRequest("close",{file:b}))}async definition(a,b,c){let e=(0,d.resolve)(a);await this.ensureFileOpen(e);let f=await this.sendRequestWithResponse("definition",{file:e,line:b,offset:c});return f?.body&&Array.isArray(f.body)?Promise.all(f.body.map(async a=>{let b=await this.readLineFromFile(a.file,a.start.line);return{file:a.file,line:a.start.line,column:a.start.offset,lineText:b}})):[]}async hover(a,b,c){let e,f=(0,d.resolve)(a);await this.ensureFileOpen(f);try{e=await this.sendRequestWithResponse("quickinfo",{file:f,line:b,offset:c},this.coldStart?3e4:3e3)}catch{return null}if(!e?.body)return null;let g=e.body;return{displayString:g.displayString||"",documentation:g.documentation||"",kind:g.kind||""}}async references(a,b,c){let e=(0,d.resolve)(a);await this.ensureFileOpen(e);let f=await this.sendRequestWithResponse("references",{file:e,line:b,offset:c});return f?.body?.refs&&Array.isArray(f.body.refs)?f.body.refs.map(a=>({file:a.file,line:a.start.line,column:a.start.offset,lineText:a.lineText||""})):[]}shutdown(){if(!this.process)return;console.log("[tsserver] shutting down"),this.rejectAll(Error("tsserver shutting down")),this.openedFiles.clear();try{this.sendRequest("exit",{})}catch{}let a=this.process;setTimeout(()=>{a&&!a.killed&&a.kill("SIGTERM")},1e3),this.process=null}findTsserver(){try{if((0,g.existsSync)(28483))return console.log("[tsserver] found via require.resolve: 28483"),28483}catch{}let a=(0,d.join)(process.cwd(),"node_modules/typescript/lib/tsserver.js");if((0,g.existsSync)(a))return console.log(`[tsserver] found via cwd: ${a}`),a;try{let a=(0,e.execSync)("which tsserver",{encoding:"utf-8"}).trim();if(a)return console.log(`[tsserver] found via which: ${a}`),a}catch{}return console.warn("[tsserver] using fallback path"),"node_modules/typescript/lib/tsserver.js"}async ensureFileOpen(a){if(!this.openedFiles.has(a))try{let b=await (0,f.readFile)(a,"utf-8");this.openFile(a,b)}catch{}}sendRequest(a,b){if(!this.process?.stdin?.writable)return;this.seq++;let c=JSON.stringify({seq:this.seq,type:"request",command:a,arguments:b});try{this.process.stdin.write(c+"\n")}catch(b){console.error(`[tsserver] write error for ${a}:`,b)}}sendRequestWithResponse(a,b,c=1e4){return new Promise((d,e)=>{if(!this.process?.stdin?.writable)return void e(Error("tsserver not running"));this.seq++;let f=this.seq,g=setTimeout(()=>{this.pendingRequests.delete(f),e(Error(`tsserver request timeout: ${a}`))},c);this.pendingRequests.set(f,{resolve:d,reject:e,timer:g});let h=JSON.stringify({seq:f,type:"request",command:a,arguments:b});try{this.process.stdin.write(h+"\n")}catch(a){this.pendingRequests.delete(f),clearTimeout(g),e(Error(`tsserver write error: ${a}`))}})}onData(a){this.buffer=Buffer.concat([this.buffer,a]),this.processBuffer()}processBuffer(){let a=Buffer.from("\r\n\r\n"),b=Buffer.from("Content-Length:");for(;;){let c=this.buffer.indexOf(a);if(-1===c)break;let d=this.buffer.subarray(0,c).toString("utf-8").match(/Content-Length:\s*(\d+)/i);if(!d){let a=this.buffer.indexOf(b,c+4);if(-1===a){this.buffer=Buffer.alloc(0);break}this.buffer=this.buffer.subarray(a);continue}let e=parseInt(d[1],10),f=c+4,g=f+e;if(this.buffer.length<g)break;let h=this.buffer.subarray(f,g).toString("utf-8");this.buffer=this.buffer.subarray(g);try{let a=JSON.parse(h);this.handleMessage(a)}catch{}}}handleMessage(a){if("response"===a.type&&void 0!==a.request_seq){let b=this.pendingRequests.get(a.request_seq);b&&(clearTimeout(b.timer),this.pendingRequests.delete(a.request_seq),!1===a.success?b.reject(Error(`tsserver error: ${a.command}`)):(this.coldStart&&(this.coldStart=!1,console.log("[tsserver] project loaded, switching to fast timeout")),b.resolve(a)))}}rejectAll(a){for(let[,b]of this.pendingRequests)clearTimeout(b.timer),b.reject(a);this.pendingRequests.clear()}async readLineFromFile(a,b){try{let c=(await (0,f.readFile)(a,"utf-8")).split("\n");return c[b-1]?.trim()||""}catch{return""}}constructor(){this.language="typescript",this.process=null,this.seq=0,this.pendingRequests=new Map,this.buffer=Buffer.alloc(0),this.openedFiles=new Set,this.coldStart=!0}}var i=c(1932);class j{static isAvailable(){try{return(0,e.execSync)("which pyright-langserver",{stdio:"ignore"}),!0}catch{try{return(0,e.execSync)("which basedpyright-langserver",{stdio:"ignore"}),!0}catch{return!1}}}static getCommand(){try{return(0,e.execSync)("which pyright-langserver",{stdio:"ignore"}),"pyright-langserver"}catch{return"basedpyright-langserver"}}spawn(){let a=j.getCommand();console.log(`[pyright] spawning: ${a} --stdio`);let b=(0,e.spawn)(a,["--stdio"],{stdio:["pipe","pipe","pipe"],env:process.env});return b.stdout.setEncoding("utf-8"),b.stdout.on("data",a=>this.onData(a)),b.stderr.on("data",()=>{}),b.on("error",a=>{console.error("[pyright] process error:",a),this.rejectAll(Error("pyright process error"))}),b.on("exit",a=>{console.log(`[pyright] exited with code ${a}`),this.rejectAll(Error(`pyright exited with code ${a}`))}),this.process=b,b}async initialize(){this.initialized||await this.sendLSPRequest("initialize",{processId:process.pid,capabilities:{textDocument:{hover:{contentFormat:["plaintext"]},definition:{},references:{}}},rootUri:null})&&(this.sendLSPNotification("initialized",{}),this.initialized=!0,console.log("[pyright] initialized"))}openFile(a,b){let c=(0,d.resolve)(a),e=(0,i.pathToFileURL)(c).href;this.openedFiles.has(c)?this.sendLSPNotification("textDocument/didChange",{textDocument:{uri:e,version:Date.now()},contentChanges:[{text:b}]}):(this.openedFiles.add(c),this.sendLSPNotification("textDocument/didOpen",{textDocument:{uri:e,languageId:"python",version:1,text:b}}))}closeFile(a){let b=(0,d.resolve)(a);if(!this.openedFiles.has(b))return;this.openedFiles.delete(b);let c=(0,i.pathToFileURL)(b).href;this.sendLSPNotification("textDocument/didClose",{textDocument:{uri:c}})}async definition(a,b,c){let e=(0,d.resolve)(a);await this.ensureFileOpen(e);let f=(0,i.pathToFileURL)(e).href,g=await this.sendLSPRequest("textDocument/definition",{textDocument:{uri:f},position:{line:b-1,character:c-1}});return g?Promise.all((Array.isArray(g)?g:[g]).map(async a=>{let b=new URL(a.uri).pathname,c=a.range.start.line+1,d=await this.readLineFromFile(b,c);return{file:b,line:c,column:a.range.start.character+1,lineText:d}})):[]}async hover(a,b,c){let e=(0,d.resolve)(a);await this.ensureFileOpen(e);let f=(0,i.pathToFileURL)(e).href,g=await this.sendLSPRequest("textDocument/hover",{textDocument:{uri:f},position:{line:b-1,character:c-1}});if(!g?.contents)return null;let h=g.contents,j="";return"string"==typeof h?j=h:h.value?j=h.value:Array.isArray(h)&&(j=h.map(a=>"string"==typeof a?a:a.value).join("\n")),{displayString:j,documentation:"",kind:""}}async references(a,b,c){let e=(0,d.resolve)(a);await this.ensureFileOpen(e);let f=(0,i.pathToFileURL)(e).href,g=await this.sendLSPRequest("textDocument/references",{textDocument:{uri:f},position:{line:b-1,character:c-1},context:{includeDeclaration:!0}});return Array.isArray(g)?Promise.all(g.map(async a=>{let b=new URL(a.uri).pathname,c=a.range.start.line+1,d=await this.readLineFromFile(b,c);return{file:b,line:c,column:a.range.start.character+1,lineText:d}})):[]}shutdown(){if(this.process){console.log("[pyright] shutting down"),this.rejectAll(Error("pyright shutting down")),this.openedFiles.clear();try{this.sendLSPRequest("shutdown",{}).then(()=>{this.sendLSPNotification("exit",{})}).catch(()=>{})}catch{}setTimeout(()=>{this.process&&!this.process.killed&&this.process.kill("SIGTERM")},1e3),this.process=null}}async ensureFileOpen(a){if(!this.openedFiles.has(a))try{let b=await (0,f.readFile)(a,"utf-8");this.openFile(a,b)}catch{}}sendLSPRequest(a,b){return new Promise((c,d)=>{if(!this.process?.stdin?.writable)return void d(Error("pyright not running"));this.seq++;let e=this.seq,f=setTimeout(()=>{this.pendingRequests.delete(e),d(Error(`pyright request timeout: ${a}`))},1e4);this.pendingRequests.set(e,{resolve:c,reject:d,timer:f});let g=JSON.stringify({jsonrpc:"2.0",id:e,method:a,params:b}),h=`Content-Length: ${Buffer.byteLength(g)}\r
1
+ "use strict";exports.id=5292,exports.ids=[5292],exports.modules={15090:(a,b,c)=>{c.d(b,{rL:()=>q,bX:()=>p,BS:()=>r});var d=c(33873),e=c(55511),f=c(79646),g=c(79748),h=c(29021);class i{spawn(){let a=this.findTsserver();console.log(`[tsserver] spawning: node ${a}`);let b=(0,d.resolve)(process.cwd(),"bin/set-title.js"),c=(0,f.spawn)("node",["--require",b,a,"--disableAutomaticTypingAcquisition"],{stdio:["pipe","pipe","pipe"],env:{...process.env,TSS_LOG:""}});return c.stdout.on("data",a=>this.onData(a)),c.stderr.setEncoding("utf-8"),c.stderr.on("data",a=>{console.log(`[tsserver stderr] ${a.trim()}`)}),c.stdin.on("error",a=>{console.error("[tsserver] stdin error:",a.message)}),c.on("error",a=>{console.error("[tsserver] process error:",a),this.rejectAll(Error("tsserver process error"))}),c.on("exit",a=>{console.log(`[tsserver] exited with code ${a}`),this.rejectAll(Error(`tsserver exited with code ${a}`)),this.process=null}),this.process=c,c}openFile(a,b){let c=(0,d.resolve)(a);this.openedFiles.has(c)?this.sendRequest("reload",{file:c,tmpfile:c}):(this.openedFiles.add(c),this.sendRequest("open",{file:c,fileContent:b}))}closeFile(a){let b=(0,d.resolve)(a);this.openedFiles.has(b)&&(this.openedFiles.delete(b),this.sendRequest("close",{file:b}))}async definition(a,b,c){let e=(0,d.resolve)(a);await this.ensureFileOpen(e);let f=await this.sendRequestWithResponse("definition",{file:e,line:b,offset:c});return f?.body&&Array.isArray(f.body)?Promise.all(f.body.map(async a=>{let b=await this.readLineFromFile(a.file,a.start.line);return{file:a.file,line:a.start.line,column:a.start.offset,lineText:b}})):[]}async hover(a,b,c){let e,f=(0,d.resolve)(a);await this.ensureFileOpen(f);try{e=await this.sendRequestWithResponse("quickinfo",{file:f,line:b,offset:c},this.coldStart?3e4:3e3)}catch{return null}if(!e?.body)return null;let g=e.body;return{displayString:g.displayString||"",documentation:g.documentation||"",kind:g.kind||""}}async references(a,b,c){let e=(0,d.resolve)(a);await this.ensureFileOpen(e);let f=await this.sendRequestWithResponse("references",{file:e,line:b,offset:c});return f?.body?.refs&&Array.isArray(f.body.refs)?f.body.refs.map(a=>({file:a.file,line:a.start.line,column:a.start.offset,lineText:a.lineText||""})):[]}shutdown(){if(!this.process)return;console.log("[tsserver] shutting down"),this.rejectAll(Error("tsserver shutting down")),this.openedFiles.clear();try{this.sendRequest("exit",{})}catch{}let a=this.process;setTimeout(()=>{a&&!a.killed&&a.kill("SIGTERM")},1e3),this.process=null}findTsserver(){try{if((0,h.existsSync)(28483))return console.log("[tsserver] found via require.resolve: 28483"),28483}catch{}let a=(0,d.join)(process.cwd(),"node_modules/typescript/lib/tsserver.js");if((0,h.existsSync)(a))return console.log(`[tsserver] found via cwd: ${a}`),a;try{let a=(0,f.execSync)("which tsserver",{encoding:"utf-8"}).trim();if(a)return console.log(`[tsserver] found via which: ${a}`),a}catch{}return console.warn("[tsserver] using fallback path"),"node_modules/typescript/lib/tsserver.js"}async ensureFileOpen(a){if(!this.openedFiles.has(a))try{let b=await (0,g.readFile)(a,"utf-8");this.openFile(a,b)}catch{}}sendRequest(a,b){if(!this.process?.stdin?.writable)return;this.seq++;let c=JSON.stringify({seq:this.seq,type:"request",command:a,arguments:b});try{this.process.stdin.write(c+"\n")}catch(b){console.error(`[tsserver] write error for ${a}:`,b)}}sendRequestWithResponse(a,b,c=1e4){return new Promise((d,e)=>{if(!this.process?.stdin?.writable)return void e(Error("tsserver not running"));this.seq++;let f=this.seq,g=setTimeout(()=>{this.pendingRequests.delete(f),e(Error(`tsserver request timeout: ${a}`))},c);this.pendingRequests.set(f,{resolve:d,reject:e,timer:g});let h=JSON.stringify({seq:f,type:"request",command:a,arguments:b});try{this.process.stdin.write(h+"\n")}catch(a){this.pendingRequests.delete(f),clearTimeout(g),e(Error(`tsserver write error: ${a}`))}})}onData(a){this.buffer=Buffer.concat([this.buffer,a]),this.processBuffer()}processBuffer(){let a=Buffer.from("\r\n\r\n"),b=Buffer.from("Content-Length:");for(;;){let c=this.buffer.indexOf(a);if(-1===c)break;let d=this.buffer.subarray(0,c).toString("utf-8").match(/Content-Length:\s*(\d+)/i);if(!d){let a=this.buffer.indexOf(b,c+4);if(-1===a){this.buffer=Buffer.alloc(0);break}this.buffer=this.buffer.subarray(a);continue}let e=parseInt(d[1],10),f=c+4,g=f+e;if(this.buffer.length<g)break;let h=this.buffer.subarray(f,g).toString("utf-8");this.buffer=this.buffer.subarray(g);try{let a=JSON.parse(h);this.handleMessage(a)}catch{}}}handleMessage(a){if("response"===a.type&&void 0!==a.request_seq){let b=this.pendingRequests.get(a.request_seq);b&&(clearTimeout(b.timer),this.pendingRequests.delete(a.request_seq),!1===a.success?b.reject(Error(`tsserver error: ${a.command}`)):(this.coldStart&&(this.coldStart=!1,console.log("[tsserver] project loaded, switching to fast timeout")),b.resolve(a)))}}rejectAll(a){for(let[,b]of this.pendingRequests)clearTimeout(b.timer),b.reject(a);this.pendingRequests.clear()}async readLineFromFile(a,b){try{let c=(await (0,g.readFile)(a,"utf-8")).split("\n");return c[b-1]?.trim()||""}catch{return""}}constructor(){this.language="typescript",this.process=null,this.seq=0,this.pendingRequests=new Map,this.buffer=Buffer.alloc(0),this.openedFiles=new Set,this.coldStart=!0}}var j=c(1932);class k{static isAvailable(){try{return(0,f.execSync)("which pyright-langserver",{stdio:"ignore"}),!0}catch{try{return(0,f.execSync)("which basedpyright-langserver",{stdio:"ignore"}),!0}catch{return!1}}}static getCommand(){try{return(0,f.execSync)("which pyright-langserver",{stdio:"ignore"}),"pyright-langserver"}catch{return"basedpyright-langserver"}}spawn(){let a=k.getCommand();console.log(`[pyright] spawning: ${a} --stdio`);let b=(0,f.spawn)(a,["--stdio"],{stdio:["pipe","pipe","pipe"],env:process.env});return b.stdout.setEncoding("utf-8"),b.stdout.on("data",a=>this.onData(a)),b.stderr.on("data",()=>{}),b.on("error",a=>{console.error("[pyright] process error:",a),this.rejectAll(Error("pyright process error"))}),b.on("exit",a=>{console.log(`[pyright] exited with code ${a}`),this.rejectAll(Error(`pyright exited with code ${a}`))}),this.process=b,b}async initialize(){this.initialized||await this.sendLSPRequest("initialize",{processId:process.pid,capabilities:{textDocument:{hover:{contentFormat:["plaintext"]},definition:{},references:{}}},rootUri:null})&&(this.sendLSPNotification("initialized",{}),this.initialized=!0,console.log("[pyright] initialized"))}openFile(a,b){let c=(0,d.resolve)(a),e=(0,j.pathToFileURL)(c).href;this.openedFiles.has(c)?this.sendLSPNotification("textDocument/didChange",{textDocument:{uri:e,version:Date.now()},contentChanges:[{text:b}]}):(this.openedFiles.add(c),this.sendLSPNotification("textDocument/didOpen",{textDocument:{uri:e,languageId:"python",version:1,text:b}}))}closeFile(a){let b=(0,d.resolve)(a);if(!this.openedFiles.has(b))return;this.openedFiles.delete(b);let c=(0,j.pathToFileURL)(b).href;this.sendLSPNotification("textDocument/didClose",{textDocument:{uri:c}})}async definition(a,b,c){let e=(0,d.resolve)(a);await this.ensureFileOpen(e);let f=(0,j.pathToFileURL)(e).href,g=await this.sendLSPRequest("textDocument/definition",{textDocument:{uri:f},position:{line:b-1,character:c-1}});return g?Promise.all((Array.isArray(g)?g:[g]).map(async a=>{let b=new URL(a.uri).pathname,c=a.range.start.line+1,d=await this.readLineFromFile(b,c);return{file:b,line:c,column:a.range.start.character+1,lineText:d}})):[]}async hover(a,b,c){let e=(0,d.resolve)(a);await this.ensureFileOpen(e);let f=(0,j.pathToFileURL)(e).href,g=await this.sendLSPRequest("textDocument/hover",{textDocument:{uri:f},position:{line:b-1,character:c-1}});if(!g?.contents)return null;let h=g.contents,i="";return"string"==typeof h?i=h:h.value?i=h.value:Array.isArray(h)&&(i=h.map(a=>"string"==typeof a?a:a.value).join("\n")),{displayString:i,documentation:"",kind:""}}async references(a,b,c){let e=(0,d.resolve)(a);await this.ensureFileOpen(e);let f=(0,j.pathToFileURL)(e).href,g=await this.sendLSPRequest("textDocument/references",{textDocument:{uri:f},position:{line:b-1,character:c-1},context:{includeDeclaration:!0}});return Array.isArray(g)?Promise.all(g.map(async a=>{let b=new URL(a.uri).pathname,c=a.range.start.line+1,d=await this.readLineFromFile(b,c);return{file:b,line:c,column:a.range.start.character+1,lineText:d}})):[]}shutdown(){if(this.process){console.log("[pyright] shutting down"),this.rejectAll(Error("pyright shutting down")),this.openedFiles.clear();try{this.sendLSPRequest("shutdown",{}).then(()=>{this.sendLSPNotification("exit",{})}).catch(()=>{})}catch{}setTimeout(()=>{this.process&&!this.process.killed&&this.process.kill("SIGTERM")},1e3),this.process=null}}async ensureFileOpen(a){if(!this.openedFiles.has(a))try{let b=await (0,g.readFile)(a,"utf-8");this.openFile(a,b)}catch{}}sendLSPRequest(a,b){return new Promise((c,d)=>{if(!this.process?.stdin?.writable)return void d(Error("pyright not running"));this.seq++;let e=this.seq,f=setTimeout(()=>{this.pendingRequests.delete(e),d(Error(`pyright request timeout: ${a}`))},1e4);this.pendingRequests.set(e,{resolve:c,reject:d,timer:f});let g=JSON.stringify({jsonrpc:"2.0",id:e,method:a,params:b}),h=`Content-Length: ${Buffer.byteLength(g)}\r
2
2
  \r
3
3
  `;this.process.stdin.write(h+g)})}sendLSPNotification(a,b){if(!this.process?.stdin?.writable)return;let c=JSON.stringify({jsonrpc:"2.0",method:a,params:b}),d=`Content-Length: ${Buffer.byteLength(c)}\r
4
4
  \r
5
- `;this.process.stdin.write(d+c)}onData(a){this.buffer+=a,this.processBuffer()}processBuffer(){for(;;){let a=this.buffer.indexOf("\r\n\r\n");if(-1===a)break;let b=this.buffer.slice(0,a).match(/Content-Length:\s*(\d+)/i);if(!b){this.buffer=this.buffer.slice(a+4);continue}let c=parseInt(b[1],10),d=a+4,e=d+c;if(this.buffer.length<e)break;let f=this.buffer.slice(d,e);this.buffer=this.buffer.slice(e);try{let a=JSON.parse(f);this.handleMessage(a)}catch{}}}handleMessage(a){if(void 0!==a.id){let b=this.pendingRequests.get(a.id);b&&(clearTimeout(b.timer),this.pendingRequests.delete(a.id),a.error?b.reject(Error(`pyright error: ${a.error.message}`)):b.resolve(a.result))}}rejectAll(a){for(let[,b]of this.pendingRequests)clearTimeout(b.timer),b.reject(a);this.pendingRequests.clear()}async readLineFromFile(a,b){try{let c=(await (0,f.readFile)(a,"utf-8")).split("\n");return c[b-1]?.trim()||""}catch{return""}}constructor(){this.language="python",this.process=null,this.seq=0,this.pendingRequests=new Map,this.buffer="",this.openedFiles=new Set,this.initialized=!1}}let k=Symbol.for("lsp_server_registry"),l=Symbol.for("lsp_idle_timer");function m(){let a=globalThis;return a[k]||(a[k]=new Map,console.log("[lsp-registry] initialized"),process.on("exit",()=>{let a=m();for(let[,b]of a){console.log(`[lsp-registry] shutting down ${b.language} server (cwd=${b.cwd})`);try{b.adapter.shutdown()}catch{}}a.clear(),n()})),a[k]}function n(){let a=globalThis;a[l]&&(clearInterval(a[l]),a[l]=void 0)}async function o(a,b){let c,e,f=(0,d.resolve)(b),g=`${a}:${(0,d.resolve)(f)}`,i=m(),k=i.get(g);if(k)return k.lastUsedAt=Date.now(),await k.readyPromise,k;let o=m();for(;o.size>=5;){let a=null,b=1/0;for(let[c,d]of o)d.lastUsedAt<b&&(b=d.lastUsedAt,a=c);if(!a)break;let c=o.get(a);console.log(`[lsp-registry] LRU evict: ${c.language} @ ${c.cwd}, pid=${c.process.pid}`);try{c.adapter.shutdown()}catch{}o.delete(a)}let p=function(a){switch(a){case"typescript":return new h;case"python":if(!j.isAvailable())return console.log("[lsp-registry] pyright-langserver not found, python LSP disabled"),null;return new j;default:return null}}(a);if(!p)return null;let q=new Promise(a=>{c=a}),r=p.spawn(),s={language:a,cwd:f,adapter:p,process:r,openedFiles:new Set,ready:!1,readyPromise:q,lastUsedAt:Date.now()};if(i.set(g,s),console.log(`[lsp-registry] started ${a} server for ${f}, pid=${r.pid}`),(e=globalThis)[l]||(e[l]=setInterval(()=>{let a=m(),b=Date.now();for(let[c,d]of a)if(b-d.lastUsedAt>3e5){console.log(`[lsp-registry] idle timeout: ${d.language} @ ${d.cwd}, closing`);try{d.adapter.shutdown()}catch{}a.delete(c)}0===a.size&&n()},6e4),"function"==typeof e[l].unref&&e[l].unref()),r.on("exit",()=>{console.log(`[lsp-registry] ${a} server exited (cwd=${f})`),i.delete(g)}),p.initialize)try{await p.initialize()}catch(b){console.error(`[lsp-registry] ${a} initialize error:`,b)}return s.ready=!0,c(),s}async function p(a,b,c){if(a.lastUsedAt=Date.now(),!a.openedFiles.has(b)){a.openedFiles.add(b),a.adapter.openFile(b,c),a.lastOpenedFile=b;return}a.lastOpenedFile!==b&&(a.adapter.openFile(b,c),a.lastOpenedFile=b)}function q(){let a=[];for(let[,b]of m())a.push({language:b.language,cwd:b.cwd,pid:b.process.pid,ready:b.ready,openedFiles:b.openedFiles.size});return a}},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})}};
5
+ `;this.process.stdin.write(d+c)}onData(a){this.buffer+=a,this.processBuffer()}processBuffer(){for(;;){let a=this.buffer.indexOf("\r\n\r\n");if(-1===a)break;let b=this.buffer.slice(0,a).match(/Content-Length:\s*(\d+)/i);if(!b){this.buffer=this.buffer.slice(a+4);continue}let c=parseInt(b[1],10),d=a+4,e=d+c;if(this.buffer.length<e)break;let f=this.buffer.slice(d,e);this.buffer=this.buffer.slice(e);try{let a=JSON.parse(f);this.handleMessage(a)}catch{}}}handleMessage(a){if(void 0!==a.id){let b=this.pendingRequests.get(a.id);b&&(clearTimeout(b.timer),this.pendingRequests.delete(a.id),a.error?b.reject(Error(`pyright error: ${a.error.message}`)):b.resolve(a.result))}}rejectAll(a){for(let[,b]of this.pendingRequests)clearTimeout(b.timer),b.reject(a);this.pendingRequests.clear()}async readLineFromFile(a,b){try{let c=(await (0,g.readFile)(a,"utf-8")).split("\n");return c[b-1]?.trim()||""}catch{return""}}constructor(){this.language="python",this.process=null,this.seq=0,this.pendingRequests=new Map,this.buffer="",this.openedFiles=new Set,this.initialized=!1}}let l=Symbol.for("lsp_server_registry_v2"),m=Symbol.for("lsp_idle_timer_v2");function n(){let a=globalThis;return a[l]||(a[l]=new Map,console.log("[lsp-registry] initialized"),process.on("exit",()=>{let a=n();for(let[,b]of a){console.log(`[lsp-registry] shutting down ${b.language} server (cwd=${b.cwd})`);try{b.adapter.shutdown()}catch{}}a.clear(),o()})),a[l]}function o(){let a=globalThis;a[m]&&(clearInterval(a[m]),a[m]=void 0)}async function p(a,b){let c,e,f=(0,d.resolve)(b),g=`${a}:${(0,d.resolve)(f)}`,h=n(),j=h.get(g);if(j)return j.lastUsedAt=Date.now(),await j.readyPromise,j;let l=n();for(;l.size>=5;){let a=null,b=1/0;for(let[c,d]of l)d.lastUsedAt<b&&(b=d.lastUsedAt,a=c);if(!a)break;let c=l.get(a);console.log(`[lsp-registry] LRU evict: ${c.language} @ ${c.cwd}, pid=${c.process.pid}`);try{c.adapter.shutdown()}catch{}l.delete(a)}let p=function(a){switch(a){case"typescript":return new i;case"python":if(!k.isAvailable())return console.log("[lsp-registry] pyright-langserver not found, python LSP disabled"),null;return new k;default:return null}}(a);if(!p)return null;let q=new Promise(a=>{c=a}),r=p.spawn(),s={language:a,cwd:f,adapter:p,process:r,openedFiles:new Map,ready:!1,readyPromise:q,lastUsedAt:Date.now()};if(h.set(g,s),console.log(`[lsp-registry] started ${a} server for ${f}, pid=${r.pid}`),(e=globalThis)[m]||(e[m]=setInterval(()=>{let a=n(),b=Date.now();for(let[c,d]of a)if(b-d.lastUsedAt>3e5){console.log(`[lsp-registry] idle timeout: ${d.language} @ ${d.cwd}, closing`);try{d.adapter.shutdown()}catch{}a.delete(c)}0===a.size&&o()},6e4),"function"==typeof e[m].unref&&e[m].unref()),r.on("exit",()=>{console.log(`[lsp-registry] ${a} server exited (cwd=${f})`),h.delete(g)}),p.initialize)try{await p.initialize()}catch(b){console.error(`[lsp-registry] ${a} initialize error:`,b)}return s.ready=!0,c(),s}async function q(a,b,c){a.lastUsedAt=Date.now();let d=(0,e.createHash)("sha1").update(c).digest("hex");(a.openedFiles.get(b)!==d||a.lastOpenedFile!==b)&&(a.openedFiles.set(b,d),a.adapter.openFile(b,c),a.lastOpenedFile=b)}function r(){let a=[];for(let[,b]of n())a.push({language:b.language,cwd:b.cwd,pid:b.process.pid,ready:b.ready,openedFiles:b.openedFiles.size});return a}},72891:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{OZ:()=>o,RL:()=>n,k9:()=>p,ok:()=>l});var e=c(37625),f=c(52693),g=c(18412),h=c(89705),i=c(94506),j=c(770),k=a([i]);i=(k.then?(await k)():k)[0];let l=(a,b=200)=>new Response(JSON.stringify(a),{status:b,headers:{"content-type":"application/json"}}),m=a=>{let b=e.od(a);if(f.Ru(b)){let a=b.value,c=(0,j.Sh)(a);return new Response(JSON.stringify({error:(a=>{let b=a.message;if("string"==typeof b&&b.length>0)return b;let c=a.cause;if(c instanceof Error&&c.message.length>0)return c.message;switch(a._tag){case"ValidationError":return`Invalid ${a.field}: ${a.reason}`;case"NotFoundError":return`${a.resource} not found: ${a.id}`;case"PermissionError":return`Permission denied: ${a.action} on ${a.resource}`;case"DBError":return`${a.db} ${a.op} failed`;case"FSError":return`${a.op} ${a.path} failed`;case"WSError":return`${a.proto} ${a.kind} failed`;case"AgentError":return`${a.provider} ${a.kind} failed`;default:return a._tag}})(a),tag:a._tag}),{status:c,headers:{"content-type":"application/json"}})}return console.error("[handler] uncaught defect:\n"+e.j9(a)),new Response(JSON.stringify({error:"Internal Server Error",tag:"InternalError"}),{status:500,headers:{"content-type":"application/json"}})},n=a=>async b=>{let c=await i.s9.runPromiseExit(a(b));return g.YW(c,{onFailure:a=>m(a),onSuccess:a=>a})},o=a=>async(b,c)=>{let d=await c.params,e=await i.s9.runPromiseExit(a(b,d));return g.YW(e,{onFailure:a=>m(a),onSuccess:a=>a})},p=a=>h.$mh({try:()=>a.json(),catch:()=>new j.yI({field:"body",reason:"invalid JSON"})});d()}catch(a){d(a)}})}};