@surething/cockpit 1.0.212 → 1.0.214

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 (569) hide show
  1. package/.next-prod/BUILD_ID +1 -1
  2. package/.next-prod/app-path-routes-manifest.json +6 -2
  3. package/.next-prod/build-manifest.json +2 -2
  4. package/.next-prod/prerender-manifest.json +3 -3
  5. package/.next-prod/routes-manifest.json +24 -0
  6. package/.next-prod/server/app/_global-error/page.js +3 -3
  7. package/.next-prod/server/app/_global-error/page.js.nft.json +1 -1
  8. package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/.next-prod/server/app/_global-error.html +1 -1
  10. package/.next-prod/server/app/_global-error.rsc +1 -1
  11. package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  13. package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  14. package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
  15. package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
  16. package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  17. package/.next-prod/server/app/_not-found/page.js +2 -2
  18. package/.next-prod/server/app/_not-found/page.js.nft.json +1 -1
  19. package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next-prod/server/app/_not-found.html +1 -1
  21. package/.next-prod/server/app/_not-found.rsc +3 -3
  22. package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +3 -3
  23. package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
  24. package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +3 -3
  25. package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  26. package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  27. package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  28. package/.next-prod/server/app/api/agent/test/route.js +1 -1
  29. package/.next-prod/server/app/api/agent/test/route.js.nft.json +1 -1
  30. package/.next-prod/server/app/api/bash/route.js +1 -1
  31. package/.next-prod/server/app/api/bash/route.js.nft.json +1 -1
  32. package/.next-prod/server/app/api/chat/codex/route.js +2 -87
  33. package/.next-prod/server/app/api/chat/codex/route.js.nft.json +1 -1
  34. package/.next-prod/server/app/api/chat/deepseek/route.js +2 -87
  35. package/.next-prod/server/app/api/chat/deepseek/route.js.nft.json +1 -1
  36. package/.next-prod/server/app/api/chat/kimi/route.js +2 -87
  37. package/.next-prod/server/app/api/chat/kimi/route.js.nft.json +1 -1
  38. package/.next-prod/server/app/api/chat/ollama/route.js +4 -89
  39. package/.next-prod/server/app/api/chat/ollama/route.js.nft.json +1 -1
  40. package/.next-prod/server/app/api/chat/route.js +2 -87
  41. package/.next-prod/server/app/api/chat/route.js.nft.json +1 -1
  42. package/.next-prod/server/app/api/claude-stats/route.js +1 -1
  43. package/.next-prod/server/app/api/claude-stats/route.js.nft.json +1 -1
  44. package/.next-prod/server/app/api/commands/route.js +1 -1
  45. package/.next-prod/server/app/api/commands/route.js.nft.json +1 -1
  46. package/.next-prod/server/app/api/comments/route.js +1 -1
  47. package/.next-prod/server/app/api/comments/route.js.nft.json +1 -1
  48. package/.next-prod/server/app/api/db/columns/route.js +2 -2
  49. package/.next-prod/server/app/api/db/columns/route.js.nft.json +1 -1
  50. package/.next-prod/server/app/api/db/connect/route.js +1 -1
  51. package/.next-prod/server/app/api/db/connect/route.js.nft.json +1 -1
  52. package/.next-prod/server/app/api/db/disconnect/route.js +1 -1
  53. package/.next-prod/server/app/api/db/disconnect/route.js.nft.json +1 -1
  54. package/.next-prod/server/app/api/db/export/route.js +1 -1
  55. package/.next-prod/server/app/api/db/export/route.js.nft.json +1 -1
  56. package/.next-prod/server/app/api/db/query/route.js +1 -1
  57. package/.next-prod/server/app/api/db/query/route.js.nft.json +1 -1
  58. package/.next-prod/server/app/api/db/schemas/route.js +1 -1
  59. package/.next-prod/server/app/api/db/schemas/route.js.nft.json +1 -1
  60. package/.next-prod/server/app/api/dev/spans/route.js +1 -1
  61. package/.next-prod/server/app/api/dev/spans/route.js.nft.json +1 -1
  62. package/.next-prod/server/app/api/extension/version/route.js +1 -1
  63. package/.next-prod/server/app/api/extension/version/route.js.nft.json +1 -1
  64. package/.next-prod/server/app/api/file/route.js +1 -1
  65. package/.next-prod/server/app/api/file/route.js.nft.json +1 -1
  66. package/.next-prod/server/app/api/files/blame/route.js +1 -1
  67. package/.next-prod/server/app/api/files/blame/route.js.nft.json +1 -1
  68. package/.next-prod/server/app/api/files/clipboard/route.js +1 -1
  69. package/.next-prod/server/app/api/files/clipboard/route.js.nft.json +1 -1
  70. package/.next-prod/server/app/api/files/copy/route.js +1 -1
  71. package/.next-prod/server/app/api/files/copy/route.js.nft.json +1 -1
  72. package/.next-prod/server/app/api/files/delete/route.js +1 -1
  73. package/.next-prod/server/app/api/files/delete/route.js.nft.json +1 -1
  74. package/.next-prod/server/app/api/files/expanded/route.js +1 -1
  75. package/.next-prod/server/app/api/files/expanded/route.js.nft.json +1 -1
  76. package/.next-prod/server/app/api/files/index/route.js +1 -1
  77. package/.next-prod/server/app/api/files/index/route.js.nft.json +1 -1
  78. package/.next-prod/server/app/api/files/init/route.js +1 -1
  79. package/.next-prod/server/app/api/files/init/route.js.nft.json +1 -1
  80. package/.next-prod/server/app/api/files/paste/route.js +1 -1
  81. package/.next-prod/server/app/api/files/paste/route.js.nft.json +1 -1
  82. package/.next-prod/server/app/api/files/read/route.js +1 -1
  83. package/.next-prod/server/app/api/files/read/route.js.nft.json +1 -1
  84. package/.next-prod/server/app/api/files/readdir/route.js +1 -1
  85. package/.next-prod/server/app/api/files/readdir/route.js.nft.json +1 -1
  86. package/.next-prod/server/app/api/files/recent/route.js +1 -1
  87. package/.next-prod/server/app/api/files/recent/route.js.nft.json +1 -1
  88. package/.next-prod/server/app/api/files/save/route.js +1 -1
  89. package/.next-prod/server/app/api/files/save/route.js.nft.json +1 -1
  90. package/.next-prod/server/app/api/files/search/route.js +1 -1
  91. package/.next-prod/server/app/api/files/search/route.js.nft.json +1 -1
  92. package/.next-prod/server/app/api/files/stat/route.js +1 -1
  93. package/.next-prod/server/app/api/files/stat/route.js.nft.json +1 -1
  94. package/.next-prod/server/app/api/files/text/route.js +1 -1
  95. package/.next-prod/server/app/api/files/text/route.js.nft.json +1 -1
  96. package/.next-prod/server/app/api/git/branch-diff/route.js +1 -1
  97. package/.next-prod/server/app/api/git/branch-diff/route.js.nft.json +1 -1
  98. package/.next-prod/server/app/api/git/branches/route.js +1 -1
  99. package/.next-prod/server/app/api/git/branches/route.js.nft.json +1 -1
  100. package/.next-prod/server/app/api/git/commit-diff/route.js +1 -1
  101. package/.next-prod/server/app/api/git/commit-diff/route.js.nft.json +1 -1
  102. package/.next-prod/server/app/api/git/commits/route.js +1 -1
  103. package/.next-prod/server/app/api/git/commits/route.js.nft.json +1 -1
  104. package/.next-prod/server/app/api/git/diff/route.js +1 -1
  105. package/.next-prod/server/app/api/git/diff/route.js.nft.json +1 -1
  106. package/.next-prod/server/app/api/git/discard/route.js +1 -1
  107. package/.next-prod/server/app/api/git/discard/route.js.nft.json +1 -1
  108. package/.next-prod/server/app/api/git/stage/route.js +1 -1
  109. package/.next-prod/server/app/api/git/stage/route.js.nft.json +1 -1
  110. package/.next-prod/server/app/api/git/status/route.js +1 -1
  111. package/.next-prod/server/app/api/git/status/route.js.nft.json +1 -1
  112. package/.next-prod/server/app/api/git/unstage/route.js +1 -1
  113. package/.next-prod/server/app/api/git/unstage/route.js.nft.json +1 -1
  114. package/.next-prod/server/app/api/git/worktree/route.js +1 -1
  115. package/.next-prod/server/app/api/git/worktree/route.js.nft.json +1 -1
  116. package/.next-prod/server/app/api/global-state/route.js +1 -1
  117. package/.next-prod/server/app/api/global-state/route.js.nft.json +1 -1
  118. package/.next-prod/server/app/api/jupyter/load/route.js +1 -1
  119. package/.next-prod/server/app/api/jupyter/load/route.js.nft.json +1 -1
  120. package/.next-prod/server/app/api/jupyter/save/route.js +1 -1
  121. package/.next-prod/server/app/api/jupyter/save/route.js.nft.json +1 -1
  122. package/.next-prod/server/app/api/jupyter/shutdown/route.js +1 -1
  123. package/.next-prod/server/app/api/jupyter/shutdown/route.js.nft.json +1 -1
  124. package/.next-prod/server/app/api/lsp/definition/route.js +1 -1
  125. package/.next-prod/server/app/api/lsp/definition/route.js.nft.json +1 -1
  126. package/.next-prod/server/app/api/lsp/hover/route.js +1 -1
  127. package/.next-prod/server/app/api/lsp/hover/route.js.nft.json +1 -1
  128. package/.next-prod/server/app/api/lsp/references/route.js +1 -1
  129. package/.next-prod/server/app/api/lsp/references/route.js.nft.json +1 -1
  130. package/.next-prod/server/app/api/lsp/status/route.js +1 -1
  131. package/.next-prod/server/app/api/lsp/status/route.js.nft.json +1 -1
  132. package/.next-prod/server/app/api/lsp/warmup/route.js +1 -1
  133. package/.next-prod/server/app/api/lsp/warmup/route.js.nft.json +1 -1
  134. package/.next-prod/server/app/api/mysql/columns/route.js +1 -1
  135. package/.next-prod/server/app/api/mysql/columns/route.js.nft.json +1 -1
  136. package/.next-prod/server/app/api/mysql/connect/route.js +1 -1
  137. package/.next-prod/server/app/api/mysql/connect/route.js.nft.json +1 -1
  138. package/.next-prod/server/app/api/mysql/disconnect/route.js +1 -1
  139. package/.next-prod/server/app/api/mysql/disconnect/route.js.nft.json +1 -1
  140. package/.next-prod/server/app/api/mysql/export/route.js +1 -1
  141. package/.next-prod/server/app/api/mysql/export/route.js.nft.json +1 -1
  142. package/.next-prod/server/app/api/mysql/query/route.js +1 -1
  143. package/.next-prod/server/app/api/mysql/query/route.js.nft.json +1 -1
  144. package/.next-prod/server/app/api/mysql/schemas/route.js +1 -1
  145. package/.next-prod/server/app/api/mysql/schemas/route.js.nft.json +1 -1
  146. package/.next-prod/server/app/api/neo4j/connect/route.js +1 -1
  147. package/.next-prod/server/app/api/neo4j/connect/route.js.nft.json +1 -1
  148. package/.next-prod/server/app/api/neo4j/disconnect/route.js +1 -1
  149. package/.next-prod/server/app/api/neo4j/disconnect/route.js.nft.json +1 -1
  150. package/.next-prod/server/app/api/neo4j/query/route.js +1 -1
  151. package/.next-prod/server/app/api/neo4j/query/route.js.nft.json +1 -1
  152. package/.next-prod/server/app/api/neo4j/schema/route.js +1 -1
  153. package/.next-prod/server/app/api/neo4j/schema/route.js.nft.json +1 -1
  154. package/.next-prod/server/app/api/note/route.js +1 -1
  155. package/.next-prod/server/app/api/note/route.js.nft.json +1 -1
  156. package/.next-prod/server/app/api/ollama/models/route.js +1 -1
  157. package/.next-prod/server/app/api/ollama/models/route.js.nft.json +1 -1
  158. package/.next-prod/server/app/api/ollama/start/route.js +1 -1
  159. package/.next-prod/server/app/api/ollama/start/route.js.nft.json +1 -1
  160. package/.next-prod/server/app/api/open-cursor/route.js +1 -1
  161. package/.next-prod/server/app/api/open-cursor/route.js.nft.json +1 -1
  162. package/.next-prod/server/app/api/open-vscode/route.js +1 -1
  163. package/.next-prod/server/app/api/open-vscode/route.js.nft.json +1 -1
  164. package/.next-prod/server/app/api/pick-folder/route.js +1 -1
  165. package/.next-prod/server/app/api/pick-folder/route.js.nft.json +1 -1
  166. package/.next-prod/server/app/api/pinned-sessions/route.js +1 -1
  167. package/.next-prod/server/app/api/pinned-sessions/route.js.nft.json +1 -1
  168. package/.next-prod/server/app/api/project-settings/route.js +1 -1
  169. package/.next-prod/server/app/api/project-settings/route.js.nft.json +1 -1
  170. package/.next-prod/server/app/api/project-state/route.js +1 -1
  171. package/.next-prod/server/app/api/project-state/route.js.nft.json +1 -1
  172. package/.next-prod/server/app/api/projectGraph/affected/route.js +1 -0
  173. package/.next-prod/server/app/api/projectGraph/affected/route.js.nft.json +1 -0
  174. package/.next-prod/server/app/api/projectGraph/affected/route_client-reference-manifest.js +1 -0
  175. package/.next-prod/server/app/api/projectGraph/callees/route.js +1 -1
  176. package/.next-prod/server/app/api/projectGraph/callees/route.js.nft.json +1 -1
  177. package/.next-prod/server/app/api/projectGraph/callers/route.js +1 -1
  178. package/.next-prod/server/app/api/projectGraph/callers/route.js.nft.json +1 -1
  179. package/.next-prod/server/app/api/projectGraph/coedit/route.js +1 -1
  180. package/.next-prod/server/app/api/projectGraph/coedit/route.js.nft.json +1 -1
  181. package/.next-prod/server/app/api/projectGraph/context/route.js +1 -0
  182. package/.next-prod/server/app/api/projectGraph/context/route.js.nft.json +1 -0
  183. package/.next-prod/server/app/api/projectGraph/context/route_client-reference-manifest.js +1 -0
  184. package/.next-prod/server/app/api/projectGraph/file/route.js +1 -1
  185. package/.next-prod/server/app/api/projectGraph/file/route.js.nft.json +1 -1
  186. package/.next-prod/server/app/api/projectGraph/file-functions/route.js +1 -1
  187. package/.next-prod/server/app/api/projectGraph/file-functions/route.js.nft.json +1 -1
  188. package/.next-prod/server/app/api/projectGraph/impact/route.js +1 -1
  189. package/.next-prod/server/app/api/projectGraph/impact/route.js.nft.json +1 -1
  190. package/.next-prod/server/app/api/projectGraph/related/route.js +1 -0
  191. package/.next-prod/server/app/api/projectGraph/related/route.js.nft.json +1 -0
  192. package/.next-prod/server/app/api/projectGraph/related/route_client-reference-manifest.js +1 -0
  193. package/.next-prod/server/app/api/projectGraph/risk/route.js +1 -0
  194. package/.next-prod/server/app/api/projectGraph/risk/route.js.nft.json +1 -0
  195. package/.next-prod/server/app/api/projectGraph/risk/route_client-reference-manifest.js +1 -0
  196. package/.next-prod/server/app/api/projectGraph/search/route.js +1 -1
  197. package/.next-prod/server/app/api/projectGraph/search/route.js.nft.json +1 -1
  198. package/.next-prod/server/app/api/projects/route.js +1 -1
  199. package/.next-prod/server/app/api/projects/route.js.nft.json +1 -1
  200. package/.next-prod/server/app/api/redis/command/route.js +1 -1
  201. package/.next-prod/server/app/api/redis/command/route.js.nft.json +1 -1
  202. package/.next-prod/server/app/api/redis/connect/route.js +1 -1
  203. package/.next-prod/server/app/api/redis/connect/route.js.nft.json +1 -1
  204. package/.next-prod/server/app/api/redis/delete/route.js +1 -1
  205. package/.next-prod/server/app/api/redis/delete/route.js.nft.json +1 -1
  206. package/.next-prod/server/app/api/redis/disconnect/route.js +1 -1
  207. package/.next-prod/server/app/api/redis/disconnect/route.js.nft.json +1 -1
  208. package/.next-prod/server/app/api/redis/get/route.js +1 -1
  209. package/.next-prod/server/app/api/redis/get/route.js.nft.json +1 -1
  210. package/.next-prod/server/app/api/redis/keys/route.js +1 -1
  211. package/.next-prod/server/app/api/redis/keys/route.js.nft.json +1 -1
  212. package/.next-prod/server/app/api/redis/set/route.js +1 -1
  213. package/.next-prod/server/app/api/redis/set/route.js.nft.json +1 -1
  214. package/.next-prod/server/app/api/review/[id]/comments/route.js +1 -1
  215. package/.next-prod/server/app/api/review/[id]/comments/route.js.nft.json +1 -1
  216. package/.next-prod/server/app/api/review/[id]/replies/route.js +1 -1
  217. package/.next-prod/server/app/api/review/[id]/replies/route.js.nft.json +1 -1
  218. package/.next-prod/server/app/api/review/[id]/route.js +1 -1
  219. package/.next-prod/server/app/api/review/[id]/route.js.nft.json +1 -1
  220. package/.next-prod/server/app/api/review/identify/route.js +1 -1
  221. package/.next-prod/server/app/api/review/identify/route.js.nft.json +1 -1
  222. package/.next-prod/server/app/api/review/order/route.js +1 -1
  223. package/.next-prod/server/app/api/review/order/route.js.nft.json +1 -1
  224. package/.next-prod/server/app/api/review/route.js +1 -1
  225. package/.next-prod/server/app/api/review/route.js.nft.json +1 -1
  226. package/.next-prod/server/app/api/review/share-info/route.js +1 -1
  227. package/.next-prod/server/app/api/review/share-info/route.js.nft.json +1 -1
  228. package/.next-prod/server/app/api/review/users/route.js +1 -1
  229. package/.next-prod/server/app/api/review/users/route.js.nft.json +1 -1
  230. package/.next-prod/server/app/api/scheduled-tasks/route.js +1 -1
  231. package/.next-prod/server/app/api/scheduled-tasks/route.js.nft.json +1 -1
  232. package/.next-prod/server/app/api/services/config/route.js +1 -1
  233. package/.next-prod/server/app/api/services/config/route.js.nft.json +1 -1
  234. package/.next-prod/server/app/api/services/scripts/route.js +1 -1
  235. package/.next-prod/server/app/api/services/scripts/route.js.nft.json +1 -1
  236. package/.next-prod/server/app/api/session/[sessionId]/fork/route.js +1 -1
  237. package/.next-prod/server/app/api/session/[sessionId]/fork/route.js.nft.json +1 -1
  238. package/.next-prod/server/app/api/session/[sessionId]/history/route.js +1 -1
  239. package/.next-prod/server/app/api/session/[sessionId]/history/route.js.nft.json +1 -1
  240. package/.next-prod/server/app/api/session-by-path/route.js +1 -1
  241. package/.next-prod/server/app/api/session-by-path/route.js.nft.json +1 -1
  242. package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js +1 -1
  243. package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js.nft.json +1 -1
  244. package/.next-prod/server/app/api/sessions/projects/route.js +1 -1
  245. package/.next-prod/server/app/api/sessions/projects/route.js.nft.json +1 -1
  246. package/.next-prod/server/app/api/sessions/route.js +1 -1
  247. package/.next-prod/server/app/api/sessions/route.js.nft.json +1 -1
  248. package/.next-prod/server/app/api/settings/route.js +1 -1
  249. package/.next-prod/server/app/api/settings/route.js.nft.json +1 -1
  250. package/.next-prod/server/app/api/skills/[id]/route.js +1 -1
  251. package/.next-prod/server/app/api/skills/[id]/route.js.nft.json +1 -1
  252. package/.next-prod/server/app/api/skills/content/route.js +1 -1
  253. package/.next-prod/server/app/api/skills/content/route.js.nft.json +1 -1
  254. package/.next-prod/server/app/api/skills/route.js +1 -1
  255. package/.next-prod/server/app/api/skills/route.js.nft.json +1 -1
  256. package/.next-prod/server/app/api/terminal/aliases/route.js +1 -1
  257. package/.next-prod/server/app/api/terminal/aliases/route.js.nft.json +1 -1
  258. package/.next-prod/server/app/api/terminal/autocomplete/route.js +1 -1
  259. package/.next-prod/server/app/api/terminal/autocomplete/route.js.nft.json +1 -1
  260. package/.next-prod/server/app/api/terminal/bubble-order/route.js +1 -1
  261. package/.next-prod/server/app/api/terminal/bubble-order/route.js.nft.json +1 -1
  262. package/.next-prod/server/app/api/terminal/env/route.js +1 -1
  263. package/.next-prod/server/app/api/terminal/env/route.js.nft.json +1 -1
  264. package/.next-prod/server/app/api/terminal/history/route.js +1 -1
  265. package/.next-prod/server/app/api/terminal/history/route.js.nft.json +1 -1
  266. package/.next-prod/server/app/api/version/route.js +1 -1
  267. package/.next-prod/server/app/api/version/route.js.nft.json +1 -1
  268. package/.next-prod/server/app/favicon.ico/route.js +1 -1
  269. package/.next-prod/server/app/favicon.ico/route.js.nft.json +1 -1
  270. package/.next-prod/server/app/manifest.webmanifest/route.js +2 -2
  271. package/.next-prod/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  272. package/.next-prod/server/app/page.js +2 -2
  273. package/.next-prod/server/app/page.js.nft.json +1 -1
  274. package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
  275. package/.next-prod/server/app/project/page.js +2 -2
  276. package/.next-prod/server/app/project/page.js.nft.json +1 -1
  277. package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
  278. package/.next-prod/server/app/review/[id]/page.js +2 -2
  279. package/.next-prod/server/app/review/[id]/page.js.nft.json +1 -1
  280. package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
  281. package/.next-prod/server/app-paths-manifest.json +6 -2
  282. package/.next-prod/server/chunks/2540.js +1 -0
  283. package/.next-prod/server/chunks/2939.js +1 -1
  284. package/.next-prod/server/chunks/4008.js +1 -0
  285. package/.next-prod/server/chunks/7828.js +502 -0
  286. package/.next-prod/server/chunks/8916.js +1 -1
  287. package/.next-prod/server/chunks/9658.js +5 -5
  288. package/.next-prod/server/middleware-build-manifest.js +1 -1
  289. package/.next-prod/server/pages/404.html +1 -1
  290. package/.next-prod/server/pages/500.html +1 -1
  291. package/.next-prod/server/server-reference-manifest.json +1 -1
  292. package/.next-prod/static/chunks/2171-1d5aa2a301006dfb.js +1 -0
  293. package/.next-prod/static/chunks/5188-38f55b21ae1eeb28.js +29 -0
  294. package/.next-prod/static/chunks/6345-fc2d45a72316c5f8.js +14 -0
  295. package/.next-prod/static/chunks/{aaea2bcf-be8b39a8f32280f3.js → aaea2bcf-56770c8875ee56c9.js} +1 -1
  296. package/.next-prod/static/chunks/app/_global-error/page-8ae56b9359db0996.js +1 -0
  297. package/.next-prod/static/chunks/app/api/agent/test/route-8ae56b9359db0996.js +1 -0
  298. package/.next-prod/static/chunks/app/api/bash/route-8ae56b9359db0996.js +1 -0
  299. package/.next-prod/static/chunks/app/api/chat/codex/route-8ae56b9359db0996.js +1 -0
  300. package/.next-prod/static/chunks/app/api/chat/deepseek/route-8ae56b9359db0996.js +1 -0
  301. package/.next-prod/static/chunks/app/api/chat/kimi/route-8ae56b9359db0996.js +1 -0
  302. package/.next-prod/static/chunks/app/api/chat/ollama/route-8ae56b9359db0996.js +1 -0
  303. package/.next-prod/static/chunks/app/api/chat/route-8ae56b9359db0996.js +1 -0
  304. package/.next-prod/static/chunks/app/api/claude-stats/route-8ae56b9359db0996.js +1 -0
  305. package/.next-prod/static/chunks/app/api/commands/route-8ae56b9359db0996.js +1 -0
  306. package/.next-prod/static/chunks/app/api/comments/route-8ae56b9359db0996.js +1 -0
  307. package/.next-prod/static/chunks/app/api/db/columns/route-8ae56b9359db0996.js +1 -0
  308. package/.next-prod/static/chunks/app/api/db/connect/route-8ae56b9359db0996.js +1 -0
  309. package/.next-prod/static/chunks/app/api/db/disconnect/route-8ae56b9359db0996.js +1 -0
  310. package/.next-prod/static/chunks/app/api/db/export/route-8ae56b9359db0996.js +1 -0
  311. package/.next-prod/static/chunks/app/api/db/query/route-8ae56b9359db0996.js +1 -0
  312. package/.next-prod/static/chunks/app/api/db/schemas/route-8ae56b9359db0996.js +1 -0
  313. package/.next-prod/static/chunks/app/api/dev/spans/route-8ae56b9359db0996.js +1 -0
  314. package/.next-prod/static/chunks/app/api/extension/version/route-8ae56b9359db0996.js +1 -0
  315. package/.next-prod/static/chunks/app/api/file/route-8ae56b9359db0996.js +1 -0
  316. package/.next-prod/static/chunks/app/api/files/blame/route-8ae56b9359db0996.js +1 -0
  317. package/.next-prod/static/chunks/app/api/files/clipboard/route-8ae56b9359db0996.js +1 -0
  318. package/.next-prod/static/chunks/app/api/files/copy/route-8ae56b9359db0996.js +1 -0
  319. package/.next-prod/static/chunks/app/api/files/delete/route-8ae56b9359db0996.js +1 -0
  320. package/.next-prod/static/chunks/app/api/files/expanded/route-8ae56b9359db0996.js +1 -0
  321. package/.next-prod/static/chunks/app/api/files/index/route-8ae56b9359db0996.js +1 -0
  322. package/.next-prod/static/chunks/app/api/files/init/route-8ae56b9359db0996.js +1 -0
  323. package/.next-prod/static/chunks/app/api/files/paste/route-8ae56b9359db0996.js +1 -0
  324. package/.next-prod/static/chunks/app/api/files/read/route-8ae56b9359db0996.js +1 -0
  325. package/.next-prod/static/chunks/app/api/files/readdir/route-8ae56b9359db0996.js +1 -0
  326. package/.next-prod/static/chunks/app/api/files/recent/route-8ae56b9359db0996.js +1 -0
  327. package/.next-prod/static/chunks/app/api/files/save/route-8ae56b9359db0996.js +1 -0
  328. package/.next-prod/static/chunks/app/api/files/search/route-8ae56b9359db0996.js +1 -0
  329. package/.next-prod/static/chunks/app/api/files/stat/route-8ae56b9359db0996.js +1 -0
  330. package/.next-prod/static/chunks/app/api/files/text/route-8ae56b9359db0996.js +1 -0
  331. package/.next-prod/static/chunks/app/api/git/branch-diff/route-8ae56b9359db0996.js +1 -0
  332. package/.next-prod/static/chunks/app/api/git/branches/route-8ae56b9359db0996.js +1 -0
  333. package/.next-prod/static/chunks/app/api/git/commit-diff/route-8ae56b9359db0996.js +1 -0
  334. package/.next-prod/static/chunks/app/api/git/commits/route-8ae56b9359db0996.js +1 -0
  335. package/.next-prod/static/chunks/app/api/git/diff/route-8ae56b9359db0996.js +1 -0
  336. package/.next-prod/static/chunks/app/api/git/discard/route-8ae56b9359db0996.js +1 -0
  337. package/.next-prod/static/chunks/app/api/git/stage/route-8ae56b9359db0996.js +1 -0
  338. package/.next-prod/static/chunks/app/api/git/status/route-8ae56b9359db0996.js +1 -0
  339. package/.next-prod/static/chunks/app/api/git/unstage/route-8ae56b9359db0996.js +1 -0
  340. package/.next-prod/static/chunks/app/api/git/worktree/route-8ae56b9359db0996.js +1 -0
  341. package/.next-prod/static/chunks/app/api/global-state/route-8ae56b9359db0996.js +1 -0
  342. package/.next-prod/static/chunks/app/api/jupyter/load/route-8ae56b9359db0996.js +1 -0
  343. package/.next-prod/static/chunks/app/api/jupyter/save/route-8ae56b9359db0996.js +1 -0
  344. package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-8ae56b9359db0996.js +1 -0
  345. package/.next-prod/static/chunks/app/api/lsp/definition/route-8ae56b9359db0996.js +1 -0
  346. package/.next-prod/static/chunks/app/api/lsp/hover/route-8ae56b9359db0996.js +1 -0
  347. package/.next-prod/static/chunks/app/api/lsp/references/route-8ae56b9359db0996.js +1 -0
  348. package/.next-prod/static/chunks/app/api/lsp/status/route-8ae56b9359db0996.js +1 -0
  349. package/.next-prod/static/chunks/app/api/lsp/warmup/route-8ae56b9359db0996.js +1 -0
  350. package/.next-prod/static/chunks/app/api/mysql/columns/route-8ae56b9359db0996.js +1 -0
  351. package/.next-prod/static/chunks/app/api/mysql/connect/route-8ae56b9359db0996.js +1 -0
  352. package/.next-prod/static/chunks/app/api/mysql/disconnect/route-8ae56b9359db0996.js +1 -0
  353. package/.next-prod/static/chunks/app/api/mysql/export/route-8ae56b9359db0996.js +1 -0
  354. package/.next-prod/static/chunks/app/api/mysql/query/route-8ae56b9359db0996.js +1 -0
  355. package/.next-prod/static/chunks/app/api/mysql/schemas/route-8ae56b9359db0996.js +1 -0
  356. package/.next-prod/static/chunks/app/api/neo4j/connect/route-8ae56b9359db0996.js +1 -0
  357. package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-8ae56b9359db0996.js +1 -0
  358. package/.next-prod/static/chunks/app/api/neo4j/query/route-8ae56b9359db0996.js +1 -0
  359. package/.next-prod/static/chunks/app/api/neo4j/schema/route-8ae56b9359db0996.js +1 -0
  360. package/.next-prod/static/chunks/app/api/note/route-8ae56b9359db0996.js +1 -0
  361. package/.next-prod/static/chunks/app/api/ollama/models/route-8ae56b9359db0996.js +1 -0
  362. package/.next-prod/static/chunks/app/api/ollama/start/route-8ae56b9359db0996.js +1 -0
  363. package/.next-prod/static/chunks/app/api/open-cursor/route-8ae56b9359db0996.js +1 -0
  364. package/.next-prod/static/chunks/app/api/open-vscode/route-8ae56b9359db0996.js +1 -0
  365. package/.next-prod/static/chunks/app/api/pick-folder/route-8ae56b9359db0996.js +1 -0
  366. package/.next-prod/static/chunks/app/api/pinned-sessions/route-8ae56b9359db0996.js +1 -0
  367. package/.next-prod/static/chunks/app/api/project-settings/route-8ae56b9359db0996.js +1 -0
  368. package/.next-prod/static/chunks/app/api/project-state/route-8ae56b9359db0996.js +1 -0
  369. package/.next-prod/static/chunks/app/api/projectGraph/affected/route-8ae56b9359db0996.js +1 -0
  370. package/.next-prod/static/chunks/app/api/projectGraph/callees/route-8ae56b9359db0996.js +1 -0
  371. package/.next-prod/static/chunks/app/api/projectGraph/callers/route-8ae56b9359db0996.js +1 -0
  372. package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-8ae56b9359db0996.js +1 -0
  373. package/.next-prod/static/chunks/app/api/projectGraph/context/route-8ae56b9359db0996.js +1 -0
  374. package/.next-prod/static/chunks/app/api/projectGraph/file/route-8ae56b9359db0996.js +1 -0
  375. package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-8ae56b9359db0996.js +1 -0
  376. package/.next-prod/static/chunks/app/api/projectGraph/impact/route-8ae56b9359db0996.js +1 -0
  377. package/.next-prod/static/chunks/app/api/projectGraph/related/route-8ae56b9359db0996.js +1 -0
  378. package/.next-prod/static/chunks/app/api/projectGraph/risk/route-8ae56b9359db0996.js +1 -0
  379. package/.next-prod/static/chunks/app/api/projectGraph/search/route-8ae56b9359db0996.js +1 -0
  380. package/.next-prod/static/chunks/app/api/projects/route-8ae56b9359db0996.js +1 -0
  381. package/.next-prod/static/chunks/app/api/redis/command/route-8ae56b9359db0996.js +1 -0
  382. package/.next-prod/static/chunks/app/api/redis/connect/route-8ae56b9359db0996.js +1 -0
  383. package/.next-prod/static/chunks/app/api/redis/delete/route-8ae56b9359db0996.js +1 -0
  384. package/.next-prod/static/chunks/app/api/redis/disconnect/route-8ae56b9359db0996.js +1 -0
  385. package/.next-prod/static/chunks/app/api/redis/get/route-8ae56b9359db0996.js +1 -0
  386. package/.next-prod/static/chunks/app/api/redis/keys/route-8ae56b9359db0996.js +1 -0
  387. package/.next-prod/static/chunks/app/api/redis/set/route-8ae56b9359db0996.js +1 -0
  388. package/.next-prod/static/chunks/app/api/review/[id]/comments/route-8ae56b9359db0996.js +1 -0
  389. package/.next-prod/static/chunks/app/api/review/[id]/replies/route-8ae56b9359db0996.js +1 -0
  390. package/.next-prod/static/chunks/app/api/review/[id]/route-8ae56b9359db0996.js +1 -0
  391. package/.next-prod/static/chunks/app/api/review/identify/route-8ae56b9359db0996.js +1 -0
  392. package/.next-prod/static/chunks/app/api/review/order/route-8ae56b9359db0996.js +1 -0
  393. package/.next-prod/static/chunks/app/api/review/route-8ae56b9359db0996.js +1 -0
  394. package/.next-prod/static/chunks/app/api/review/share-info/route-8ae56b9359db0996.js +1 -0
  395. package/.next-prod/static/chunks/app/api/review/users/route-8ae56b9359db0996.js +1 -0
  396. package/.next-prod/static/chunks/app/api/scheduled-tasks/route-8ae56b9359db0996.js +1 -0
  397. package/.next-prod/static/chunks/app/api/services/config/route-8ae56b9359db0996.js +1 -0
  398. package/.next-prod/static/chunks/app/api/services/scripts/route-8ae56b9359db0996.js +1 -0
  399. package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-8ae56b9359db0996.js +1 -0
  400. package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-8ae56b9359db0996.js +1 -0
  401. package/.next-prod/static/chunks/app/api/session-by-path/route-8ae56b9359db0996.js +1 -0
  402. package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-8ae56b9359db0996.js +1 -0
  403. package/.next-prod/static/chunks/app/api/sessions/projects/route-8ae56b9359db0996.js +1 -0
  404. package/.next-prod/static/chunks/app/api/sessions/route-8ae56b9359db0996.js +1 -0
  405. package/.next-prod/static/chunks/app/api/settings/route-8ae56b9359db0996.js +1 -0
  406. package/.next-prod/static/chunks/app/api/skills/[id]/route-8ae56b9359db0996.js +1 -0
  407. package/.next-prod/static/chunks/app/api/skills/content/route-8ae56b9359db0996.js +1 -0
  408. package/.next-prod/static/chunks/app/api/skills/route-8ae56b9359db0996.js +1 -0
  409. package/.next-prod/static/chunks/app/api/terminal/aliases/route-8ae56b9359db0996.js +1 -0
  410. package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-8ae56b9359db0996.js +1 -0
  411. package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-8ae56b9359db0996.js +1 -0
  412. package/.next-prod/static/chunks/app/api/terminal/env/route-8ae56b9359db0996.js +1 -0
  413. package/.next-prod/static/chunks/app/api/terminal/history/route-8ae56b9359db0996.js +1 -0
  414. package/.next-prod/static/chunks/app/api/version/route-8ae56b9359db0996.js +1 -0
  415. package/.next-prod/static/chunks/app/manifest.webmanifest/route-8ae56b9359db0996.js +1 -0
  416. package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-8ae56b9359db0996.js +1 -0
  417. package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-8ae56b9359db0996.js +1 -0
  418. package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-8ae56b9359db0996.js +1 -0
  419. package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-8ae56b9359db0996.js +1 -0
  420. package/.next-prod/static/css/{f9a27209b85d8e5a.css → f016b445331fc5a2.css} +1 -1
  421. package/.next-prod/static/ekMRRxcvpy2AIjMrVn4lK/_buildManifest.js +1 -0
  422. package/.next-prod/trace +13 -12
  423. package/.next-prod/trace-build +1 -1
  424. package/.next-prod/types/app/api/projectGraph/affected/route.ts +351 -0
  425. package/.next-prod/types/app/api/projectGraph/context/route.ts +351 -0
  426. package/.next-prod/types/app/api/projectGraph/related/route.ts +351 -0
  427. package/.next-prod/types/app/api/projectGraph/risk/route.ts +351 -0
  428. package/.next-prod/types/routes.d.ts +5 -1
  429. package/.next-prod/types/validator.ts +36 -0
  430. package/README.md +0 -1
  431. package/README.zh.md +0 -1
  432. package/bin/cock-affected.mjs +190 -0
  433. package/bin/cock-terminal.mjs +471 -159
  434. package/bin/cock.mjs +9 -1
  435. package/dist/cache-GIQJA4HL.mjs +502 -0
  436. package/dist/chunk-7P6ASYW6.mjs +9 -0
  437. package/dist/{chunk-OWUW2O3D.mjs → chunk-CZWJPTRO.mjs} +4 -2
  438. package/dist/{chunk-FBR4KJI5.mjs → chunk-KRTISG5I.mjs} +213 -2
  439. package/dist/{chunk-TXBVUZVH.mjs → chunk-ZJ6CC3MH.mjs} +0 -7
  440. package/dist/httpApi.mjs +203 -17
  441. package/dist/scheduledTasks.mjs +3 -2
  442. package/dist/{server-E7G55DY7.mjs → server-OSOMFNXR.mjs} +27 -4
  443. package/dist/wsServer.mjs +8 -34
  444. package/package.json +3 -1
  445. package/.next-prod/static/IVZ8ReZv3wH9JQhz4PDC2/_buildManifest.js +0 -1
  446. package/.next-prod/static/chunks/2171-5163d946ec03ce80.js +0 -1
  447. package/.next-prod/static/chunks/5188-6ad3d686c5e9fb28.js +0 -29
  448. package/.next-prod/static/chunks/6345-3da1914a1a74c1fb.js +0 -14
  449. package/.next-prod/static/chunks/app/_global-error/page-994734ef0d317687.js +0 -1
  450. package/.next-prod/static/chunks/app/api/agent/test/route-994734ef0d317687.js +0 -1
  451. package/.next-prod/static/chunks/app/api/bash/route-994734ef0d317687.js +0 -1
  452. package/.next-prod/static/chunks/app/api/chat/codex/route-994734ef0d317687.js +0 -1
  453. package/.next-prod/static/chunks/app/api/chat/deepseek/route-994734ef0d317687.js +0 -1
  454. package/.next-prod/static/chunks/app/api/chat/kimi/route-994734ef0d317687.js +0 -1
  455. package/.next-prod/static/chunks/app/api/chat/ollama/route-994734ef0d317687.js +0 -1
  456. package/.next-prod/static/chunks/app/api/chat/route-994734ef0d317687.js +0 -1
  457. package/.next-prod/static/chunks/app/api/claude-stats/route-994734ef0d317687.js +0 -1
  458. package/.next-prod/static/chunks/app/api/commands/route-994734ef0d317687.js +0 -1
  459. package/.next-prod/static/chunks/app/api/comments/route-994734ef0d317687.js +0 -1
  460. package/.next-prod/static/chunks/app/api/db/columns/route-994734ef0d317687.js +0 -1
  461. package/.next-prod/static/chunks/app/api/db/connect/route-994734ef0d317687.js +0 -1
  462. package/.next-prod/static/chunks/app/api/db/disconnect/route-994734ef0d317687.js +0 -1
  463. package/.next-prod/static/chunks/app/api/db/export/route-994734ef0d317687.js +0 -1
  464. package/.next-prod/static/chunks/app/api/db/query/route-994734ef0d317687.js +0 -1
  465. package/.next-prod/static/chunks/app/api/db/schemas/route-994734ef0d317687.js +0 -1
  466. package/.next-prod/static/chunks/app/api/dev/spans/route-994734ef0d317687.js +0 -1
  467. package/.next-prod/static/chunks/app/api/extension/version/route-994734ef0d317687.js +0 -1
  468. package/.next-prod/static/chunks/app/api/file/route-994734ef0d317687.js +0 -1
  469. package/.next-prod/static/chunks/app/api/files/blame/route-994734ef0d317687.js +0 -1
  470. package/.next-prod/static/chunks/app/api/files/clipboard/route-994734ef0d317687.js +0 -1
  471. package/.next-prod/static/chunks/app/api/files/copy/route-994734ef0d317687.js +0 -1
  472. package/.next-prod/static/chunks/app/api/files/delete/route-994734ef0d317687.js +0 -1
  473. package/.next-prod/static/chunks/app/api/files/expanded/route-994734ef0d317687.js +0 -1
  474. package/.next-prod/static/chunks/app/api/files/index/route-994734ef0d317687.js +0 -1
  475. package/.next-prod/static/chunks/app/api/files/init/route-994734ef0d317687.js +0 -1
  476. package/.next-prod/static/chunks/app/api/files/paste/route-994734ef0d317687.js +0 -1
  477. package/.next-prod/static/chunks/app/api/files/read/route-994734ef0d317687.js +0 -1
  478. package/.next-prod/static/chunks/app/api/files/readdir/route-994734ef0d317687.js +0 -1
  479. package/.next-prod/static/chunks/app/api/files/recent/route-994734ef0d317687.js +0 -1
  480. package/.next-prod/static/chunks/app/api/files/save/route-994734ef0d317687.js +0 -1
  481. package/.next-prod/static/chunks/app/api/files/search/route-994734ef0d317687.js +0 -1
  482. package/.next-prod/static/chunks/app/api/files/stat/route-994734ef0d317687.js +0 -1
  483. package/.next-prod/static/chunks/app/api/files/text/route-994734ef0d317687.js +0 -1
  484. package/.next-prod/static/chunks/app/api/git/branch-diff/route-994734ef0d317687.js +0 -1
  485. package/.next-prod/static/chunks/app/api/git/branches/route-994734ef0d317687.js +0 -1
  486. package/.next-prod/static/chunks/app/api/git/commit-diff/route-994734ef0d317687.js +0 -1
  487. package/.next-prod/static/chunks/app/api/git/commits/route-994734ef0d317687.js +0 -1
  488. package/.next-prod/static/chunks/app/api/git/diff/route-994734ef0d317687.js +0 -1
  489. package/.next-prod/static/chunks/app/api/git/discard/route-994734ef0d317687.js +0 -1
  490. package/.next-prod/static/chunks/app/api/git/stage/route-994734ef0d317687.js +0 -1
  491. package/.next-prod/static/chunks/app/api/git/status/route-994734ef0d317687.js +0 -1
  492. package/.next-prod/static/chunks/app/api/git/unstage/route-994734ef0d317687.js +0 -1
  493. package/.next-prod/static/chunks/app/api/git/worktree/route-994734ef0d317687.js +0 -1
  494. package/.next-prod/static/chunks/app/api/global-state/route-994734ef0d317687.js +0 -1
  495. package/.next-prod/static/chunks/app/api/jupyter/load/route-994734ef0d317687.js +0 -1
  496. package/.next-prod/static/chunks/app/api/jupyter/save/route-994734ef0d317687.js +0 -1
  497. package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-994734ef0d317687.js +0 -1
  498. package/.next-prod/static/chunks/app/api/lsp/definition/route-994734ef0d317687.js +0 -1
  499. package/.next-prod/static/chunks/app/api/lsp/hover/route-994734ef0d317687.js +0 -1
  500. package/.next-prod/static/chunks/app/api/lsp/references/route-994734ef0d317687.js +0 -1
  501. package/.next-prod/static/chunks/app/api/lsp/status/route-994734ef0d317687.js +0 -1
  502. package/.next-prod/static/chunks/app/api/lsp/warmup/route-994734ef0d317687.js +0 -1
  503. package/.next-prod/static/chunks/app/api/mysql/columns/route-994734ef0d317687.js +0 -1
  504. package/.next-prod/static/chunks/app/api/mysql/connect/route-994734ef0d317687.js +0 -1
  505. package/.next-prod/static/chunks/app/api/mysql/disconnect/route-994734ef0d317687.js +0 -1
  506. package/.next-prod/static/chunks/app/api/mysql/export/route-994734ef0d317687.js +0 -1
  507. package/.next-prod/static/chunks/app/api/mysql/query/route-994734ef0d317687.js +0 -1
  508. package/.next-prod/static/chunks/app/api/mysql/schemas/route-994734ef0d317687.js +0 -1
  509. package/.next-prod/static/chunks/app/api/neo4j/connect/route-994734ef0d317687.js +0 -1
  510. package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-994734ef0d317687.js +0 -1
  511. package/.next-prod/static/chunks/app/api/neo4j/query/route-994734ef0d317687.js +0 -1
  512. package/.next-prod/static/chunks/app/api/neo4j/schema/route-994734ef0d317687.js +0 -1
  513. package/.next-prod/static/chunks/app/api/note/route-994734ef0d317687.js +0 -1
  514. package/.next-prod/static/chunks/app/api/ollama/models/route-994734ef0d317687.js +0 -1
  515. package/.next-prod/static/chunks/app/api/ollama/start/route-994734ef0d317687.js +0 -1
  516. package/.next-prod/static/chunks/app/api/open-cursor/route-994734ef0d317687.js +0 -1
  517. package/.next-prod/static/chunks/app/api/open-vscode/route-994734ef0d317687.js +0 -1
  518. package/.next-prod/static/chunks/app/api/pick-folder/route-994734ef0d317687.js +0 -1
  519. package/.next-prod/static/chunks/app/api/pinned-sessions/route-994734ef0d317687.js +0 -1
  520. package/.next-prod/static/chunks/app/api/project-settings/route-994734ef0d317687.js +0 -1
  521. package/.next-prod/static/chunks/app/api/project-state/route-994734ef0d317687.js +0 -1
  522. package/.next-prod/static/chunks/app/api/projectGraph/callees/route-994734ef0d317687.js +0 -1
  523. package/.next-prod/static/chunks/app/api/projectGraph/callers/route-994734ef0d317687.js +0 -1
  524. package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-994734ef0d317687.js +0 -1
  525. package/.next-prod/static/chunks/app/api/projectGraph/file/route-994734ef0d317687.js +0 -1
  526. package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-994734ef0d317687.js +0 -1
  527. package/.next-prod/static/chunks/app/api/projectGraph/impact/route-994734ef0d317687.js +0 -1
  528. package/.next-prod/static/chunks/app/api/projectGraph/search/route-994734ef0d317687.js +0 -1
  529. package/.next-prod/static/chunks/app/api/projects/route-994734ef0d317687.js +0 -1
  530. package/.next-prod/static/chunks/app/api/redis/command/route-994734ef0d317687.js +0 -1
  531. package/.next-prod/static/chunks/app/api/redis/connect/route-994734ef0d317687.js +0 -1
  532. package/.next-prod/static/chunks/app/api/redis/delete/route-994734ef0d317687.js +0 -1
  533. package/.next-prod/static/chunks/app/api/redis/disconnect/route-994734ef0d317687.js +0 -1
  534. package/.next-prod/static/chunks/app/api/redis/get/route-994734ef0d317687.js +0 -1
  535. package/.next-prod/static/chunks/app/api/redis/keys/route-994734ef0d317687.js +0 -1
  536. package/.next-prod/static/chunks/app/api/redis/set/route-994734ef0d317687.js +0 -1
  537. package/.next-prod/static/chunks/app/api/review/[id]/comments/route-994734ef0d317687.js +0 -1
  538. package/.next-prod/static/chunks/app/api/review/[id]/replies/route-994734ef0d317687.js +0 -1
  539. package/.next-prod/static/chunks/app/api/review/[id]/route-994734ef0d317687.js +0 -1
  540. package/.next-prod/static/chunks/app/api/review/identify/route-994734ef0d317687.js +0 -1
  541. package/.next-prod/static/chunks/app/api/review/order/route-994734ef0d317687.js +0 -1
  542. package/.next-prod/static/chunks/app/api/review/route-994734ef0d317687.js +0 -1
  543. package/.next-prod/static/chunks/app/api/review/share-info/route-994734ef0d317687.js +0 -1
  544. package/.next-prod/static/chunks/app/api/review/users/route-994734ef0d317687.js +0 -1
  545. package/.next-prod/static/chunks/app/api/scheduled-tasks/route-994734ef0d317687.js +0 -1
  546. package/.next-prod/static/chunks/app/api/services/config/route-994734ef0d317687.js +0 -1
  547. package/.next-prod/static/chunks/app/api/services/scripts/route-994734ef0d317687.js +0 -1
  548. package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-994734ef0d317687.js +0 -1
  549. package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-994734ef0d317687.js +0 -1
  550. package/.next-prod/static/chunks/app/api/session-by-path/route-994734ef0d317687.js +0 -1
  551. package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-994734ef0d317687.js +0 -1
  552. package/.next-prod/static/chunks/app/api/sessions/projects/route-994734ef0d317687.js +0 -1
  553. package/.next-prod/static/chunks/app/api/sessions/route-994734ef0d317687.js +0 -1
  554. package/.next-prod/static/chunks/app/api/settings/route-994734ef0d317687.js +0 -1
  555. package/.next-prod/static/chunks/app/api/skills/[id]/route-994734ef0d317687.js +0 -1
  556. package/.next-prod/static/chunks/app/api/skills/content/route-994734ef0d317687.js +0 -1
  557. package/.next-prod/static/chunks/app/api/skills/route-994734ef0d317687.js +0 -1
  558. package/.next-prod/static/chunks/app/api/terminal/aliases/route-994734ef0d317687.js +0 -1
  559. package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-994734ef0d317687.js +0 -1
  560. package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-994734ef0d317687.js +0 -1
  561. package/.next-prod/static/chunks/app/api/terminal/env/route-994734ef0d317687.js +0 -1
  562. package/.next-prod/static/chunks/app/api/terminal/history/route-994734ef0d317687.js +0 -1
  563. package/.next-prod/static/chunks/app/api/version/route-994734ef0d317687.js +0 -1
  564. package/.next-prod/static/chunks/app/manifest.webmanifest/route-994734ef0d317687.js +0 -1
  565. package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-994734ef0d317687.js +0 -1
  566. package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-994734ef0d317687.js +0 -1
  567. package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-994734ef0d317687.js +0 -1
  568. package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-994734ef0d317687.js +0 -1
  569. /package/.next-prod/static/{IVZ8ReZv3wH9JQhz4PDC2 → ekMRRxcvpy2AIjMrVn4lK}/_ssgManifest.js +0 -0
@@ -1,215 +1,527 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * cockpit terminal <id> <action> [args...]
4
+ * cockpit terminal read-only analysis CLI for running terminal bubbles.
5
5
  *
6
- * CLI entry point: access a running terminal bubble, read output, stream in real time, send input.
6
+ * 4 subcommands (read-only by design; write side belongs to Bash tool / web UI):
7
+ *
8
+ * cock terminal list Discover terminals
9
+ * cock terminal <id> [--json] Status / meta
10
+ * cock terminal <id> output [flags] Read + filter + global lineno
11
+ * cock terminal <id> wait <mode> [flags] Wait for pattern / idle / exit
12
+ *
13
+ * The CLI is a thin HTTP wrapper. All filtering, lineno bookkeeping, and
14
+ * waiting happens on the server (see packages/feature/console/server/terminal).
15
+ *
16
+ * Global line numbers (`--since N`, `--around N`, `next` in JSON envelopes)
17
+ * are MONOTONIC across the terminal's lifetime — they do not shift when the
18
+ * server's ring buffer trims older lines. `firstAvailable` tells you the
19
+ * smallest line still reachable; `truncated:true` tells you your cursor or
20
+ * window fell partly outside the live buffer.
7
21
  */
8
22
 
9
- const args = process.argv.slice(2);
10
-
11
- // Read prod port from ~/.cockpit/server.json
12
23
  import { readFileSync } from 'fs';
13
24
  import { join } from 'path';
14
25
  import { homedir } from 'os';
26
+
27
+ const args = process.argv.slice(2);
28
+
29
+ /* ───────────────────────────────────────────────────────────────────────── */
30
+ /* Bootstrap */
31
+ /* ───────────────────────────────────────────────────────────────────────── */
32
+
15
33
  function readServerPort() {
16
34
  try {
17
35
  return JSON.parse(readFileSync(join(homedir(), '.cockpit', 'server.json'), 'utf8')).port;
18
- } catch { return null; }
36
+ } catch {
37
+ return null;
38
+ }
19
39
  }
20
40
 
21
- // status: { running, command } when passed, display current terminal status
22
- function printHelp(prefix = '<id>', status = null) {
23
- console.log(`Interact with a running terminal process — read output, stream logs, and send input.
41
+ const port = process.env.COCKPIT_PORT || readServerPort() || 3457;
42
+ const baseUrl = `http://localhost:${port}`;
43
+
44
+ async function post(path, body, timeoutMs = 10000) {
45
+ try {
46
+ const res = await fetch(`${baseUrl}${path}`, {
47
+ method: 'POST',
48
+ headers: { 'Content-Type': 'application/json' },
49
+ body: JSON.stringify(body || {}),
50
+ signal: AbortSignal.timeout(timeoutMs),
51
+ });
52
+ const data = await res.json().catch(() => null);
53
+ if (!res.ok || !data?.ok) {
54
+ const msg = data?.error || `HTTP ${res.status}`;
55
+ throw new Error(msg);
56
+ }
57
+ return data.data;
58
+ } catch (err) {
59
+ if (err.cause?.code === 'ECONNREFUSED') {
60
+ console.error(`Connection refused: Cockpit server not running at ${baseUrl}`);
61
+ } else {
62
+ console.error(`Error: ${err.message}`);
63
+ }
64
+ process.exit(1);
65
+ }
66
+ }
24
67
 
25
- Usage: cockpit terminal ${prefix} <action>`);
68
+ /* ───────────────────────────────────────────────────────────────────────── */
69
+ /* Flag parsing — minimal, no dependency */
70
+ /* ───────────────────────────────────────────────────────────────────────── */
26
71
 
27
- if (status) {
28
- if (status.running) {
29
- let line = `\nStatus: running`;
30
- if (status.command) line += `\n command: ${status.command}`;
31
- console.log(line);
72
+ /**
73
+ * Parse `argv` looking for flags described by `spec`. Returns
74
+ * `{flags, positional}`. Flags accept:
75
+ * - boolean (no value)
76
+ * - 'string' / 'number' (takes the next argv as value)
77
+ *
78
+ * Unknown flags fail loudly so typos surface.
79
+ */
80
+ function parseFlags(argv, spec) {
81
+ const flags = {};
82
+ const positional = [];
83
+ for (let i = 0; i < argv.length; i++) {
84
+ const tok = argv[i];
85
+ if (!tok.startsWith('--')) {
86
+ positional.push(tok);
87
+ continue;
88
+ }
89
+ const name = tok.slice(2);
90
+ if (!(name in spec)) {
91
+ console.error(`Unknown flag: --${name}`);
92
+ process.exit(2);
93
+ }
94
+ const type = spec[name];
95
+ if (type === 'boolean') {
96
+ flags[name] = true;
32
97
  } else {
33
- console.log(`\nStatus: not running`);
98
+ const val = argv[++i];
99
+ if (val === undefined) {
100
+ console.error(`Missing value for --${name}`);
101
+ process.exit(2);
102
+ }
103
+ flags[name] = type === 'number' ? Number(val) : val;
104
+ if (type === 'number' && Number.isNaN(flags[name])) {
105
+ console.error(`--${name} requires a number, got "${val}"`);
106
+ process.exit(2);
107
+ }
34
108
  }
35
109
  }
110
+ return { flags, positional };
111
+ }
36
112
 
37
- console.log(`
38
- Actions:
39
- output Get buffered output
40
- follow Stream real-time output (Ctrl+C to stop)
41
- stdin <data> Send input to process
113
+ /* ───────────────────────────────────────────────────────────────────────── */
114
+ /* Top-level help */
115
+ /* ───────────────────────────────────────────────────────────────────────── */
42
116
 
43
- ── Next step ──────────────────────────────────────────
44
- Run \`cockpit terminal ${prefix} output\` to read the terminal output.
45
- Use \`stdin\` to send commands or input to the process.
117
+ function printTopHelp() {
118
+ console.log(`Analyse output of long-running terminal bubbles inside Cockpit.
46
119
 
47
- Example session:
48
- cockpit terminal ${prefix} output # 1. read current output
49
- cockpit terminal ${prefix} stdin "ls -la" # 2. send a command
50
- cockpit terminal ${prefix} output # 3. read new output
51
- cockpit terminal ${prefix} follow # stream output in real-time`);
52
- }
120
+ This CLI is READ-ONLY by design — the write side (stdin, signals, kill) is
121
+ covered by the Bash tool (spawn your own process) or the Cockpit web UI
122
+ (human types into the bubble). cock terminal only reads, filters, and waits.
53
123
 
54
- if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {
55
- printHelp();
56
- process.exit(0);
124
+ Usage: cockpit terminal <id> <action> [flags]
125
+ cockpit terminal list
126
+
127
+ Subcommands:
128
+ list List all terminals (use --json for structured)
129
+ <id> Show terminal status + FULL action cheat sheet
130
+ ← start here when you don't know what flags exist
131
+ <id> output [flags] Read buffered output (filter / context / cursor)
132
+ <id> wait <mode> [flags] Block until pattern / idle / exit / timeout
133
+
134
+ For specific flag docs:
135
+ cockpit terminal <id> show all flags for this terminal
136
+ cockpit terminal <id> output --help output flags
137
+ cockpit terminal <id> wait --help wait flags
138
+
139
+ Quick orientation if you don't have an id yet:
140
+ cockpit terminal list → pick a shortId from the list
141
+ cockpit terminal <shortId> → see status + full cheat sheet`);
57
142
  }
58
143
 
59
- let id, action;
144
+ /* ───────────────────────────────────────────────────────────────────────── */
145
+ /* list */
146
+ /* ───────────────────────────────────────────────────────────────────────── */
60
147
 
61
- if (args[0] === 'list') {
62
- id = null;
63
- action = 'list';
64
- } else {
65
- id = args[0];
66
- action = args[1];
67
- if (!action || action === '--help' || action === '-h') {
68
- action = '_status';
148
+ async function cmdList(rest) {
149
+ const { flags } = parseFlags(rest, { json: 'boolean' });
150
+ const list = await post('/api/terminal/list', {});
151
+ if (flags.json) {
152
+ process.stdout.write(JSON.stringify({ terminals: list }) + '\n');
153
+ return;
69
154
  }
155
+ if (list.length === 0) {
156
+ console.log('No running terminals');
157
+ return;
158
+ }
159
+ for (const t of list) {
160
+ const dot = t.running ? '●' : '○';
161
+ const ptyTag = t.usePty ? ' [pty]' : '';
162
+ console.log(`${dot} ${t.shortId} ${t.running ? 'running' : 'stopped'}${ptyTag} ${t.command}`);
163
+ }
164
+ // Hint AI to the next step. The cheat sheet on the meta page is the real
165
+ // entry point — list alone doesn't tell you how to act on any of these ids.
166
+ console.log('');
167
+ console.log(`Next: cock terminal <shortId> (status + full action cheat sheet)`);
70
168
  }
71
169
 
72
- const extraArgs = args.slice(2);
170
+ /* ───────────────────────────────────────────────────────────────────────── */
171
+ /* <id> meta */
172
+ /* ───────────────────────────────────────────────────────────────────────── */
73
173
 
74
- // Port: env COCKPIT_PORT > ~/.cockpit/server.json > default 3457
75
- const port = process.env.COCKPIT_PORT || readServerPort() || 3457;
76
- const baseUrl = `http://localhost:${port}`;
174
+ function formatRelative(iso) {
175
+ if (!iso) return 'never';
176
+ const ms = Date.now() - new Date(iso).getTime();
177
+ if (ms < 1000) return 'just now';
178
+ if (ms < 60000) return `${Math.floor(ms / 1000)}s ago`;
179
+ if (ms < 3600000) return `${Math.floor(ms / 60000)}m ago`;
180
+ return `${Math.floor(ms / 3600000)}h ago`;
181
+ }
77
182
 
78
- async function run() {
79
- // Only id provided without action check status + show available commands
80
- if (action === '_status') {
81
- let status = null;
82
- try {
83
- const res = await fetch(`${baseUrl}/api/terminal/list`, {
84
- method: 'POST',
85
- headers: { 'Content-Type': 'application/json' },
86
- body: '{}',
87
- signal: AbortSignal.timeout(5000),
88
- });
89
- const data = await res.json();
90
- const terminal = data.ok && data.data?.find(t => t.shortId === id);
91
- if (terminal) {
92
- status = { running: terminal.running, command: terminal.command };
93
- }
94
- } catch {
95
- // server unreachable show help without status
96
- }
97
- printHelp(id, status);
183
+ /**
184
+ * Cheat sheet rendered into the `<id>` meta output. AI agents have no memory
185
+ * between tool calls — this is their entry point and must self-describe the
186
+ * full surface area. Includes a copy-pasteable workflow section keyed off
187
+ * the actual id so the agent can use it without templating.
188
+ */
189
+ function actionsCheatSheet(id) {
190
+ return `Available actions:
191
+
192
+ cock terminal ${id} output [flags] Read buffered output (filter + global lineno)
193
+ cock terminal ${id} wait <mode> [flags] Block until pattern / idle / exit / timeout
194
+
195
+ Output read mode (pick one, default = entire buffer):
196
+ --since <N> Continue from global line number N (cursor from previous call).
197
+ Line numbers are MONOTONIC and stable across ring buffer trims.
198
+ --tail <N> Last N complete lines
199
+ --head <N> First N complete lines still in the ring
200
+ --around <N> Window around global line N (use with --context)
201
+ --context <K> Context size for --around (default 5)
202
+
203
+ Output — filtering / display:
204
+ --grep <regex> Server-side regex over each line (post-strip)
205
+ --ignore-case, -i Case-insensitive grep
206
+ --no-ansi/--keep-ansi Strip ANSI control sequences (default: on)
207
+ --collapse-cr/--keep-cr Fold \\r overwrites within line (default: on)
208
+ --with-lineno/--no-prefix Lineno prefix (grep/around default: on)
209
+ --max-bytes <N> Cap response body (default 65536; trims oldest first)
210
+ --json JSON envelope on stdout
211
+
212
+ Output raw format:
213
+ stdout = lines (each prefixed with "<lineno>: " in grep/around modes)
214
+ stderr last line = {"next":N,"firstAvailable":M,"totalLines":T,"truncated":bool,"running":bool,"matched":K}
215
+ Use the "next" value as --since for the next call to read only new output.
216
+
217
+ Wait — pick exactly one mode:
218
+ --pattern <regex> Wait until an output line matches (does NOT scan history,
219
+ only new output after this call)
220
+ --idle <s> Wait until s seconds elapse with no new output
221
+ --exit Wait until command exits
222
+ --timeout <s> Total deadline in seconds (default 30)
223
+ --print Echo received output to stdout
224
+ --json JSON envelope
225
+
226
+ Wait exit codes: 0=condition met, 124=timeout (GNU convention), 2=bad usage, 1=other.
227
+
228
+ Common workflows:
229
+ # Find error candidates with global line numbers
230
+ cock terminal ${id} output --grep error -i
231
+
232
+ # Inspect 15 lines around line 4920
233
+ cock terminal ${id} output --around 4920 --context 15
234
+
235
+ # Incremental read — pass 'next' from previous call's stderr
236
+ cock terminal ${id} output --since 5100
237
+
238
+ # Wait until build settles (3s idle)
239
+ cock terminal ${id} wait --idle 3 --timeout 60
240
+
241
+ # Wait until dev server announces ready
242
+ cock terminal ${id} wait --pattern 'Ready in' --timeout 90 --print
243
+
244
+ # Programmatic — both stdout/stderr fields available in one JSON
245
+ cock terminal ${id} output --tail 50 --json | jq .`;
246
+ }
247
+
248
+ async function cmdMeta(id, rest) {
249
+ const { flags } = parseFlags(rest, { json: 'boolean' });
250
+ const meta = await post('/api/terminal/meta', { id });
251
+ if (flags.json) {
252
+ process.stdout.write(JSON.stringify(meta) + '\n');
98
253
  return;
99
254
  }
255
+ const mode = meta.usePty ? 'pty' : 'pipe';
256
+ if (meta.running) {
257
+ console.log(`Terminal ${meta.shortId} (running, ${mode})`);
258
+ console.log(` command: ${meta.command}`);
259
+ console.log(` pid: ${meta.pid}`);
260
+ if (meta.cwd) console.log(` cwd: ${meta.cwd}`);
261
+ console.log(` started: ${formatRelative(meta.startedAt)}`);
262
+ console.log(` last output: ${formatRelative(meta.lastOutputAt)}`);
263
+ const truncTag =
264
+ meta.firstAvailable > 0
265
+ ? ` (truncated, first available line ${meta.firstAvailable})`
266
+ : '';
267
+ console.log(` output: ${meta.totalLines} lines${truncTag}`);
268
+ console.log('');
269
+ console.log(actionsCheatSheet(meta.shortId));
270
+ } else {
271
+ console.log(`Terminal ${meta.shortId} (stopped)`);
272
+ console.log(` command: ${meta.command}`);
273
+ console.log('');
274
+ console.log('Output of stopped terminals is read from JSONL history; live cursor/grep/wait do not apply.');
275
+ }
276
+ }
100
277
 
101
- // list
102
- if (action === 'list') {
103
- try {
104
- const res = await fetch(`${baseUrl}/api/terminal/list`, {
105
- method: 'POST',
106
- headers: { 'Content-Type': 'application/json' },
107
- body: '{}',
108
- signal: AbortSignal.timeout(5000),
109
- });
110
- const data = await res.json();
111
- if (!data.ok) { console.error(data.error); process.exit(1); }
112
- if (data.data.length === 0) { console.log('No running terminals'); return; }
113
- for (const t of data.data) {
114
- const status = t.running ? '' : '';
115
- console.log(`${status} ${t.shortId} ${t.running ? 'running' : 'stopped'} ${t.command}`);
116
- }
117
- } catch (err) {
118
- if (err.cause?.code === 'ECONNREFUSED') {
119
- console.error(`Connection refused: Cockpit server not running at ${baseUrl}`);
120
- } else {
121
- console.error(`Error: ${err.message}`);
122
- }
123
- process.exit(1);
124
- }
278
+ /* ───────────────────────────────────────────────────────────────────────── */
279
+ /* <id> output */
280
+ /* ───────────────────────────────────────────────────────────────────────── */
281
+
282
+ const OUTPUT_FLAG_SPEC = {
283
+ // read mode (mutually exclusive)
284
+ since: 'number',
285
+ tail: 'number',
286
+ head: 'number',
287
+ around: 'number',
288
+ context: 'number',
289
+ // filtering
290
+ grep: 'string',
291
+ ['ignore-case']: 'boolean',
292
+ i: 'boolean', // alias for ignore-case
293
+ // display
294
+ ['no-ansi']: 'boolean',
295
+ ['keep-ansi']: 'boolean',
296
+ ['collapse-cr']: 'boolean',
297
+ ['keep-cr']: 'boolean',
298
+ ['with-lineno']: 'boolean',
299
+ ['no-prefix']: 'boolean',
300
+ ['max-bytes']: 'number',
301
+ json: 'boolean',
302
+ };
303
+
304
+ function printOutputHelp() {
305
+ console.log(`Usage: cock terminal <id> output [flags]
306
+
307
+ Read modes (pick one, default = entire buffer):
308
+ --since <N> Continue from global line number N (cursor)
309
+ --tail <N> Last N complete lines
310
+ --head <N> First N complete lines still in the ring
311
+ --around <N> Lines around global line N (use with --context)
312
+ --context <K> Context size for --around (default 5)
313
+
314
+ Filtering:
315
+ --grep <regex> Server-side regex over each line (post-strip)
316
+ --ignore-case, -i Case-insensitive grep
317
+ --since <N> May be combined with --grep to bound scan
318
+
319
+ Display:
320
+ --no-ansi Strip ANSI control sequences (default: on; --keep-ansi to disable)
321
+ --keep-ansi Force-keep ANSI
322
+ --collapse-cr Fold \\r-overwrites within each line (default: on; --keep-cr to disable)
323
+ --keep-cr Force-keep \\r
324
+ --with-lineno Prefix each line with "<lineno>: "
325
+ --no-prefix Force no lineno prefix
326
+ --max-bytes <N> Cap response body (default 65536; trims oldest first)
327
+ --json Return JSON envelope on stdout
328
+
329
+ Default prefix behaviour:
330
+ --grep / --around prefix on
331
+ --since/--tail/--head prefix off
332
+ `);
333
+ }
334
+
335
+ async function cmdOutput(id, rest) {
336
+ if (rest.includes('--help') || rest.includes('-h')) {
337
+ printOutputHelp();
125
338
  return;
126
339
  }
340
+ const { flags } = parseFlags(rest, OUTPUT_FLAG_SPEC);
127
341
 
128
- // output
129
- if (action === 'output') {
130
- try {
131
- const res = await fetch(`${baseUrl}/api/terminal/output`, {
132
- method: 'POST',
133
- headers: { 'Content-Type': 'application/json' },
134
- body: JSON.stringify({ id }),
135
- signal: AbortSignal.timeout(10000),
136
- });
137
- const data = await res.json();
138
- if (!data.ok) { console.error(data.error); process.exit(1); }
139
- if (data.data.output) {
140
- process.stdout.write(data.data.output);
141
- }
142
- } catch (err) {
143
- console.error(`Error: ${err.message}`);
144
- process.exit(1);
145
- }
342
+ // Reconcile keep- / no- conflicts (later flag wins).
343
+ const ansiFlag =
344
+ flags['keep-ansi'] ? false : flags['no-ansi'] ? true : undefined;
345
+ const crFlag =
346
+ flags['keep-cr'] ? false : flags['collapse-cr'] ? true : undefined;
347
+
348
+ const body = {
349
+ id,
350
+ ...(typeof flags.since === 'number' ? { since: flags.since } : {}),
351
+ ...(typeof flags.tail === 'number' ? { tail: flags.tail } : {}),
352
+ ...(typeof flags.head === 'number' ? { head: flags.head } : {}),
353
+ ...(typeof flags.around === 'number' ? { around: flags.around } : {}),
354
+ ...(typeof flags.context === 'number' ? { context: flags.context } : {}),
355
+ ...(flags.grep ? { grep: flags.grep } : {}),
356
+ ...(flags['ignore-case'] || flags.i ? { ignoreCase: true } : {}),
357
+ ...(ansiFlag !== undefined ? { noAnsi: ansiFlag } : {}),
358
+ ...(crFlag !== undefined ? { collapseCr: crFlag } : {}),
359
+ ...(typeof flags['max-bytes'] === 'number'
360
+ ? { maxBytes: flags['max-bytes'] }
361
+ : {}),
362
+ };
363
+
364
+ const data = await post('/api/terminal/output', body, 30000);
365
+
366
+ if (flags.json) {
367
+ process.stdout.write(JSON.stringify(data) + '\n');
146
368
  return;
147
369
  }
148
370
 
149
- // stdin
150
- if (action === 'stdin') {
151
- const inputData = extraArgs.join(' ');
152
- if (!inputData) {
153
- console.error('Usage: cockpit terminal <id> stdin <data>');
154
- process.exit(1);
155
- }
156
- try {
157
- const res = await fetch(`${baseUrl}/api/terminal/stdin`, {
158
- method: 'POST',
159
- headers: { 'Content-Type': 'application/json' },
160
- body: JSON.stringify({ id, data: inputData + '\n' }),
161
- signal: AbortSignal.timeout(5000),
162
- });
163
- const data = await res.json();
164
- if (!data.ok) { console.error(data.error); process.exit(1); }
165
- } catch (err) {
166
- console.error(`Error: ${err.message}`);
167
- process.exit(1);
371
+ // Default prefix: on for grep/around, off otherwise. Explicit
372
+ // --with-lineno / --no-prefix override.
373
+ const grepOrAround = !!flags.grep || typeof flags.around === 'number';
374
+ let withLineno = grepOrAround;
375
+ if (flags['with-lineno']) withLineno = true;
376
+ if (flags['no-prefix']) withLineno = false;
377
+
378
+ for (const m of data.matches) {
379
+ if (withLineno) {
380
+ process.stdout.write(`${m.lineno}: ${m.text}\n`);
381
+ } else {
382
+ process.stdout.write(`${m.text}\n`);
168
383
  }
384
+ }
385
+
386
+ // Idle interactive prompt heuristic: when a PTY terminal hasn't run any
387
+ // command, its buffer is dominated by zsh prompt redraws (`\r\x1b[K…`).
388
+ // After strip-ansi + collapse-cr these collapse to empty strings, so the
389
+ // user sees blank lines and may think the call is broken. Tell them.
390
+ if (
391
+ data.matches.length > 0 &&
392
+ data.matches.every((m) => m.text === '')
393
+ ) {
394
+ process.stderr.write(
395
+ `(${data.matches.length} lines returned, all empty after strip-ansi + ` +
396
+ `collapse-cr — likely an idle interactive shell. ` +
397
+ `Use --keep-ansi --keep-cr to see raw bytes, ` +
398
+ `or wait for actual command output.)\n`,
399
+ );
400
+ }
401
+
402
+ // Cursor + truncation info on stderr so AI can pipe stdout cleanly.
403
+ const meta = {
404
+ next: data.next,
405
+ firstAvailable: data.firstAvailable,
406
+ totalLines: data.totalLines,
407
+ truncated: data.truncated,
408
+ running: data.running,
409
+ matched: data.matches.length,
410
+ };
411
+ process.stderr.write(JSON.stringify(meta) + '\n');
412
+ }
413
+
414
+ /* ───────────────────────────────────────────────────────────────────────── */
415
+ /* <id> wait */
416
+ /* ───────────────────────────────────────────────────────────────────────── */
417
+
418
+ const WAIT_FLAG_SPEC = {
419
+ pattern: 'string',
420
+ idle: 'number',
421
+ exit: 'boolean',
422
+ timeout: 'number',
423
+ print: 'boolean',
424
+ json: 'boolean',
425
+ };
426
+
427
+ function printWaitHelp() {
428
+ console.log(`Usage: cock terminal <id> wait [flags]
429
+
430
+ Modes (exactly one):
431
+ --pattern <regex> Wait until output line matches regex
432
+ --idle <s> Wait until s seconds elapse without new output
433
+ --exit Wait until the command exits
434
+
435
+ Common:
436
+ --timeout <s> Total deadline (default 30s)
437
+ --print Echo received output to stdout (only meaningful for --pattern / --idle)
438
+ --json JSON envelope instead of text
439
+
440
+ Exit codes:
441
+ 0 condition satisfied
442
+ 124 timeout (GNU \`timeout\` convention)
443
+ 2 bad usage
444
+ 1 other error
445
+ `);
446
+ }
447
+
448
+ async function cmdWait(id, rest) {
449
+ if (rest.includes('--help') || rest.includes('-h')) {
450
+ printWaitHelp();
169
451
  return;
170
452
  }
453
+ const { flags } = parseFlags(rest, WAIT_FLAG_SPEC);
454
+ const modeCount =
455
+ (flags.pattern ? 1 : 0) +
456
+ (typeof flags.idle === 'number' ? 1 : 0) +
457
+ (flags.exit ? 1 : 0);
458
+ if (modeCount !== 1) {
459
+ console.error('wait requires exactly one of --pattern / --idle / --exit');
460
+ process.exit(2);
461
+ }
171
462
 
172
- // follow (WebSocket real-time stream)
173
- if (action === 'follow') {
174
- const { default: WebSocket } = await import('ws');
175
- const ws = new WebSocket(`ws://localhost:${port}/ws/terminal-follow?id=${id}`);
463
+ const timeoutSec = typeof flags.timeout === 'number' ? flags.timeout : 30;
464
+ const body = {
465
+ id,
466
+ timeout: timeoutSec,
467
+ ...(flags.pattern ? { pattern: flags.pattern } : {}),
468
+ ...(typeof flags.idle === 'number' ? { idle: flags.idle } : {}),
469
+ ...(flags.exit ? { waitExit: true } : {}),
470
+ ...(flags.print ? { printOutput: true } : {}),
471
+ };
472
+ // Allow the HTTP socket a bit longer than the server-side deadline so we
473
+ // don't race the server's `outcome:"timeout"` response.
474
+ const data = await post('/api/terminal/wait', body, (timeoutSec + 5) * 1000);
176
475
 
177
- ws.on('open', () => {
178
- // connected
179
- });
476
+ if (flags.json) {
477
+ process.stdout.write(JSON.stringify(data) + '\n');
478
+ } else {
479
+ if (data.output) process.stdout.write(data.output);
480
+ process.stderr.write(JSON.stringify(data) + '\n');
481
+ }
482
+ process.exit(data.outcome === 'timeout' ? 124 : 0);
483
+ }
180
484
 
181
- ws.on('message', (raw) => {
182
- let msg;
183
- try { msg = JSON.parse(raw.toString()); } catch { return; }
485
+ /* ───────────────────────────────────────────────────────────────────────── */
486
+ /* Top-level dispatch */
487
+ /* ───────────────────────────────────────────────────────────────────────── */
184
488
 
185
- if (msg.type === 'output') {
186
- process.stdout.write(msg.data);
187
- } else if (msg.type === 'exit') {
188
- console.log(`\n[exited: ${msg.code}]`);
189
- process.exit(msg.code || 0);
190
- }
191
- // ignore ping
192
- });
489
+ async function run() {
490
+ if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {
491
+ printTopHelp();
492
+ return;
493
+ }
193
494
 
194
- ws.on('close', () => process.exit(0));
195
- ws.on('error', (err) => {
196
- console.error(`WS error: ${err.message}`);
197
- process.exit(1);
198
- });
495
+ // list is the only id-less subcommand.
496
+ if (args[0] === 'list') {
497
+ await cmdList(args.slice(1));
498
+ return;
499
+ }
199
500
 
200
- // Graceful exit on Ctrl+C
201
- process.on('SIGINT', () => {
202
- ws.close();
203
- process.exit(0);
204
- });
501
+ const id = args[0];
502
+ const action = args[1];
503
+ const rest = args.slice(2);
504
+
505
+ if (!action || action === '--help' || action === '-h' || action === '--json') {
506
+ // `cock terminal <id>` or `cock terminal <id> --json` → meta
507
+ const extras = action ? [action, ...rest] : rest;
508
+ await cmdMeta(id, extras);
509
+ return;
510
+ }
205
511
 
206
- // Keep process alive
207
- return new Promise(() => {});
512
+ if (action === 'output') {
513
+ await cmdOutput(id, rest);
514
+ return;
515
+ }
516
+
517
+ if (action === 'wait') {
518
+ await cmdWait(id, rest);
519
+ return;
208
520
  }
209
521
 
210
522
  console.error(`Unknown action: ${action}`);
211
- printHelp(id);
212
- process.exit(1);
523
+ printTopHelp();
524
+ process.exit(2);
213
525
  }
214
526
 
215
527
  export const done = run();