@surething/cockpit 1.0.275 → 1.0.277

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 (739) hide show
  1. package/.next-prod/BUILD_ID +1 -1
  2. package/.next-prod/app-path-routes-manifest.json +8 -5
  3. package/.next-prod/build-manifest.json +2 -2
  4. package/.next-prod/cockpit-build.json +1 -1
  5. package/.next-prod/prerender-manifest.json +4 -4
  6. package/.next-prod/routes-manifest.json +26 -6
  7. package/.next-prod/server/app/_global-error/page.js +2 -2
  8. package/.next-prod/server/app/_global-error/page.js.nft.json +1 -1
  9. package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/.next-prod/server/app/_global-error.html +1 -1
  11. package/.next-prod/server/app/_global-error.rsc +1 -1
  12. package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.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/_index.segment.rsc +3 -3
  22. package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  23. package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  24. package/.next-prod/server/app/api/agent/test/route.js +1 -1
  25. package/.next-prod/server/app/api/agent/test/route.js.nft.json +1 -1
  26. package/.next-prod/server/app/api/bash/route.js +1 -1
  27. package/.next-prod/server/app/api/bash/route.js.nft.json +1 -1
  28. package/.next-prod/server/app/api/bots/[id]/route.js +1 -0
  29. package/.next-prod/server/app/api/bots/[id]/route.js.nft.json +1 -0
  30. package/.next-prod/server/app/api/bots/[id]/route_client-reference-manifest.js +1 -0
  31. package/.next-prod/server/app/api/bots/route.js +1 -0
  32. package/.next-prod/server/app/api/{sessions → bots}/route.js.nft.json +1 -1
  33. package/.next-prod/server/app/api/bots/route_client-reference-manifest.js +1 -0
  34. package/.next-prod/server/app/api/chat/codex/route.js +1 -1
  35. package/.next-prod/server/app/api/chat/codex/route.js.nft.json +1 -1
  36. package/.next-prod/server/app/api/chat/deepseek/route.js +1 -1
  37. package/.next-prod/server/app/api/chat/deepseek/route.js.nft.json +1 -1
  38. package/.next-prod/server/app/api/chat/glm/route.js +1 -1
  39. package/.next-prod/server/app/api/chat/glm/route.js.nft.json +1 -1
  40. package/.next-prod/server/app/api/chat/kimi/route.js +1 -1
  41. package/.next-prod/server/app/api/chat/kimi/route.js.nft.json +1 -1
  42. package/.next-prod/server/app/api/chat/ollama/route.js +1 -1
  43. package/.next-prod/server/app/api/chat/ollama/route.js.nft.json +1 -1
  44. package/.next-prod/server/app/api/chat/route.js +1 -1
  45. package/.next-prod/server/app/api/chat/route.js.nft.json +1 -1
  46. package/.next-prod/server/app/api/chat/stop/route.js +1 -1
  47. package/.next-prod/server/app/api/chat/stop/route.js.nft.json +1 -1
  48. package/.next-prod/server/app/api/claude-stats/route.js +1 -1
  49. package/.next-prod/server/app/api/claude-stats/route.js.nft.json +1 -1
  50. package/.next-prod/server/app/api/commands/route.js +1 -1
  51. package/.next-prod/server/app/api/commands/route.js.nft.json +1 -1
  52. package/.next-prod/server/app/api/comments/route.js +1 -1
  53. package/.next-prod/server/app/api/comments/route.js.nft.json +1 -1
  54. package/.next-prod/server/app/api/db/columns/route.js +2 -2
  55. package/.next-prod/server/app/api/db/columns/route.js.nft.json +1 -1
  56. package/.next-prod/server/app/api/db/connect/route.js +1 -1
  57. package/.next-prod/server/app/api/db/connect/route.js.nft.json +1 -1
  58. package/.next-prod/server/app/api/db/disconnect/route.js +1 -1
  59. package/.next-prod/server/app/api/db/disconnect/route.js.nft.json +1 -1
  60. package/.next-prod/server/app/api/db/export/route.js +1 -1
  61. package/.next-prod/server/app/api/db/export/route.js.nft.json +1 -1
  62. package/.next-prod/server/app/api/db/query/route.js +1 -1
  63. package/.next-prod/server/app/api/db/query/route.js.nft.json +1 -1
  64. package/.next-prod/server/app/api/db/schemas/route.js +1 -1
  65. package/.next-prod/server/app/api/db/schemas/route.js.nft.json +1 -1
  66. package/.next-prod/server/app/api/deepseek/balance/route.js +1 -1
  67. package/.next-prod/server/app/api/deepseek/balance/route.js.nft.json +1 -1
  68. package/.next-prod/server/app/api/deepseek/credentials/route.js +1 -1
  69. package/.next-prod/server/app/api/deepseek/credentials/route.js.nft.json +1 -1
  70. package/.next-prod/server/app/api/deepseek/models/route.js +1 -1
  71. package/.next-prod/server/app/api/deepseek/models/route.js.nft.json +1 -1
  72. package/.next-prod/server/app/api/dev/spans/route.js +1 -1
  73. package/.next-prod/server/app/api/dev/spans/route.js.nft.json +1 -1
  74. package/.next-prod/server/app/api/extension/version/route.js +1 -1
  75. package/.next-prod/server/app/api/extension/version/route.js.nft.json +1 -1
  76. package/.next-prod/server/app/api/file/route.js +1 -1
  77. package/.next-prod/server/app/api/file/route.js.nft.json +1 -1
  78. package/.next-prod/server/app/api/files/blame/route.js +1 -1
  79. package/.next-prod/server/app/api/files/blame/route.js.nft.json +1 -1
  80. package/.next-prod/server/app/api/files/clipboard/route.js +1 -1
  81. package/.next-prod/server/app/api/files/clipboard/route.js.nft.json +1 -1
  82. package/.next-prod/server/app/api/files/copy/route.js +1 -1
  83. package/.next-prod/server/app/api/files/copy/route.js.nft.json +1 -1
  84. package/.next-prod/server/app/api/files/delete/route.js +1 -1
  85. package/.next-prod/server/app/api/files/delete/route.js.nft.json +1 -1
  86. package/.next-prod/server/app/api/files/expanded/route.js +1 -1
  87. package/.next-prod/server/app/api/files/expanded/route.js.nft.json +1 -1
  88. package/.next-prod/server/app/api/files/index/route.js +1 -1
  89. package/.next-prod/server/app/api/files/index/route.js.nft.json +1 -1
  90. package/.next-prod/server/app/api/files/init/route.js +1 -1
  91. package/.next-prod/server/app/api/files/init/route.js.nft.json +1 -1
  92. package/.next-prod/server/app/api/files/paste/route.js +1 -1
  93. package/.next-prod/server/app/api/files/paste/route.js.nft.json +1 -1
  94. package/.next-prod/server/app/api/files/read/route.js +1 -1
  95. package/.next-prod/server/app/api/files/read/route.js.nft.json +1 -1
  96. package/.next-prod/server/app/api/files/readdir/route.js +1 -1
  97. package/.next-prod/server/app/api/files/readdir/route.js.nft.json +1 -1
  98. package/.next-prod/server/app/api/files/recent/route.js +1 -1
  99. package/.next-prod/server/app/api/files/recent/route.js.nft.json +1 -1
  100. package/.next-prod/server/app/api/files/save/route.js +1 -1
  101. package/.next-prod/server/app/api/files/save/route.js.nft.json +1 -1
  102. package/.next-prod/server/app/api/files/search/route.js +1 -1
  103. package/.next-prod/server/app/api/files/search/route.js.nft.json +1 -1
  104. package/.next-prod/server/app/api/files/stat/route.js +1 -1
  105. package/.next-prod/server/app/api/files/stat/route.js.nft.json +1 -1
  106. package/.next-prod/server/app/api/files/text/route.js +1 -1
  107. package/.next-prod/server/app/api/files/text/route.js.nft.json +1 -1
  108. package/.next-prod/server/app/api/git/blob/route.js +1 -1
  109. package/.next-prod/server/app/api/git/blob/route.js.nft.json +1 -1
  110. package/.next-prod/server/app/api/git/branch-diff/route.js +1 -1
  111. package/.next-prod/server/app/api/git/branch-diff/route.js.nft.json +1 -1
  112. package/.next-prod/server/app/api/git/branches/route.js +1 -1
  113. package/.next-prod/server/app/api/git/branches/route.js.nft.json +1 -1
  114. package/.next-prod/server/app/api/git/commit-diff/route.js +1 -1
  115. package/.next-prod/server/app/api/git/commit-diff/route.js.nft.json +1 -1
  116. package/.next-prod/server/app/api/git/commits/route.js +1 -1
  117. package/.next-prod/server/app/api/git/commits/route.js.nft.json +1 -1
  118. package/.next-prod/server/app/api/git/current-branch/route.js +1 -1
  119. package/.next-prod/server/app/api/git/current-branch/route.js.nft.json +1 -1
  120. package/.next-prod/server/app/api/git/diff/route.js +1 -1
  121. package/.next-prod/server/app/api/git/diff/route.js.nft.json +1 -1
  122. package/.next-prod/server/app/api/git/discard/route.js +1 -1
  123. package/.next-prod/server/app/api/git/discard/route.js.nft.json +1 -1
  124. package/.next-prod/server/app/api/git/stage/route.js +1 -1
  125. package/.next-prod/server/app/api/git/stage/route.js.nft.json +1 -1
  126. package/.next-prod/server/app/api/git/status/route.js +1 -1
  127. package/.next-prod/server/app/api/git/status/route.js.nft.json +1 -1
  128. package/.next-prod/server/app/api/git/unstage/route.js +1 -1
  129. package/.next-prod/server/app/api/git/unstage/route.js.nft.json +1 -1
  130. package/.next-prod/server/app/api/git/worktree/route.js +1 -1
  131. package/.next-prod/server/app/api/git/worktree/route.js.nft.json +1 -1
  132. package/.next-prod/server/app/api/glm/credentials/route.js +1 -1
  133. package/.next-prod/server/app/api/glm/credentials/route.js.nft.json +1 -1
  134. package/.next-prod/server/app/api/glm/models/route.js +1 -1
  135. package/.next-prod/server/app/api/glm/models/route.js.nft.json +1 -1
  136. package/.next-prod/server/app/api/glm/usage/route.js +1 -1
  137. package/.next-prod/server/app/api/glm/usage/route.js.nft.json +1 -1
  138. package/.next-prod/server/app/api/global-state/route.js +2 -2
  139. package/.next-prod/server/app/api/global-state/route.js.nft.json +1 -1
  140. package/.next-prod/server/app/api/health/route.js +1 -1
  141. package/.next-prod/server/app/api/health/route.js.nft.json +1 -1
  142. package/.next-prod/server/app/api/html-apps/[id]/route.js +1 -1
  143. package/.next-prod/server/app/api/html-apps/[id]/route.js.nft.json +1 -1
  144. package/.next-prod/server/app/api/html-apps/route.js +1 -1
  145. package/.next-prod/server/app/api/html-apps/route.js.nft.json +1 -1
  146. package/.next-prod/server/app/api/instructions/config/route.js +1 -1
  147. package/.next-prod/server/app/api/instructions/config/route.js.nft.json +1 -1
  148. package/.next-prod/server/app/api/kimi/credentials/route.js +1 -1
  149. package/.next-prod/server/app/api/kimi/credentials/route.js.nft.json +1 -1
  150. package/.next-prod/server/app/api/kimi/models/route.js +1 -1
  151. package/.next-prod/server/app/api/kimi/models/route.js.nft.json +1 -1
  152. package/.next-prod/server/app/api/kimi/usage/route.js +1 -1
  153. package/.next-prod/server/app/api/kimi/usage/route.js.nft.json +1 -1
  154. package/.next-prod/server/app/api/lsp/definition/route.js +1 -1
  155. package/.next-prod/server/app/api/lsp/definition/route.js.nft.json +1 -1
  156. package/.next-prod/server/app/api/lsp/hover/route.js +1 -1
  157. package/.next-prod/server/app/api/lsp/hover/route.js.nft.json +1 -1
  158. package/.next-prod/server/app/api/lsp/references/route.js +1 -1
  159. package/.next-prod/server/app/api/lsp/references/route.js.nft.json +1 -1
  160. package/.next-prod/server/app/api/lsp/status/route.js +1 -1
  161. package/.next-prod/server/app/api/lsp/status/route.js.nft.json +1 -1
  162. package/.next-prod/server/app/api/lsp/warmup/route.js +1 -1
  163. package/.next-prod/server/app/api/lsp/warmup/route.js.nft.json +1 -1
  164. package/.next-prod/server/app/api/mysql/columns/route.js +1 -1
  165. package/.next-prod/server/app/api/mysql/columns/route.js.nft.json +1 -1
  166. package/.next-prod/server/app/api/mysql/connect/route.js +1 -1
  167. package/.next-prod/server/app/api/mysql/connect/route.js.nft.json +1 -1
  168. package/.next-prod/server/app/api/mysql/disconnect/route.js +1 -1
  169. package/.next-prod/server/app/api/mysql/disconnect/route.js.nft.json +1 -1
  170. package/.next-prod/server/app/api/mysql/export/route.js +1 -1
  171. package/.next-prod/server/app/api/mysql/export/route.js.nft.json +1 -1
  172. package/.next-prod/server/app/api/mysql/query/route.js +1 -1
  173. package/.next-prod/server/app/api/mysql/query/route.js.nft.json +1 -1
  174. package/.next-prod/server/app/api/mysql/schemas/route.js +1 -1
  175. package/.next-prod/server/app/api/mysql/schemas/route.js.nft.json +1 -1
  176. package/.next-prod/server/app/api/neo4j/connect/route.js +1 -1
  177. package/.next-prod/server/app/api/neo4j/connect/route.js.nft.json +1 -1
  178. package/.next-prod/server/app/api/neo4j/disconnect/route.js +1 -1
  179. package/.next-prod/server/app/api/neo4j/disconnect/route.js.nft.json +1 -1
  180. package/.next-prod/server/app/api/neo4j/query/route.js +1 -1
  181. package/.next-prod/server/app/api/neo4j/query/route.js.nft.json +1 -1
  182. package/.next-prod/server/app/api/neo4j/schema/route.js +1 -1
  183. package/.next-prod/server/app/api/neo4j/schema/route.js.nft.json +1 -1
  184. package/.next-prod/server/app/api/note/route.js +1 -1
  185. package/.next-prod/server/app/api/note/route.js.nft.json +1 -1
  186. package/.next-prod/server/app/api/ollama/config/route.js +1 -1
  187. package/.next-prod/server/app/api/ollama/config/route.js.nft.json +1 -1
  188. package/.next-prod/server/app/api/ollama/default-model/route.js +1 -0
  189. package/.next-prod/server/app/api/ollama/default-model/route.js.nft.json +1 -0
  190. package/.next-prod/server/app/api/ollama/default-model/route_client-reference-manifest.js +1 -0
  191. package/.next-prod/server/app/api/ollama/models/route.js +1 -1
  192. package/.next-prod/server/app/api/ollama/models/route.js.nft.json +1 -1
  193. package/.next-prod/server/app/api/ollama/start/route.js +1 -1
  194. package/.next-prod/server/app/api/ollama/start/route.js.nft.json +1 -1
  195. package/.next-prod/server/app/api/open-cursor/route.js +1 -1
  196. package/.next-prod/server/app/api/open-cursor/route.js.nft.json +1 -1
  197. package/.next-prod/server/app/api/open-vscode/route.js +1 -1
  198. package/.next-prod/server/app/api/open-vscode/route.js.nft.json +1 -1
  199. package/.next-prod/server/app/api/pick-folder/route.js +1 -1
  200. package/.next-prod/server/app/api/pick-folder/route.js.nft.json +1 -1
  201. package/.next-prod/server/app/api/pinned-sessions/route.js +1 -1
  202. package/.next-prod/server/app/api/pinned-sessions/route.js.nft.json +1 -1
  203. package/.next-prod/server/app/api/project-settings/route.js +1 -1
  204. package/.next-prod/server/app/api/project-settings/route.js.nft.json +1 -1
  205. package/.next-prod/server/app/api/project-state/route.js +2 -2
  206. package/.next-prod/server/app/api/project-state/route.js.nft.json +1 -1
  207. package/.next-prod/server/app/api/projectGraph/affected/route.js +1 -1
  208. package/.next-prod/server/app/api/projectGraph/affected/route.js.nft.json +1 -1
  209. package/.next-prod/server/app/api/projectGraph/callees/route.js +1 -1
  210. package/.next-prod/server/app/api/projectGraph/callees/route.js.nft.json +1 -1
  211. package/.next-prod/server/app/api/projectGraph/callers/route.js +1 -1
  212. package/.next-prod/server/app/api/projectGraph/callers/route.js.nft.json +1 -1
  213. package/.next-prod/server/app/api/projectGraph/coedit/route.js +1 -1
  214. package/.next-prod/server/app/api/projectGraph/coedit/route.js.nft.json +1 -1
  215. package/.next-prod/server/app/api/projectGraph/context/route.js +1 -1
  216. package/.next-prod/server/app/api/projectGraph/context/route.js.nft.json +1 -1
  217. package/.next-prod/server/app/api/projectGraph/file/route.js +1 -1
  218. package/.next-prod/server/app/api/projectGraph/file/route.js.nft.json +1 -1
  219. package/.next-prod/server/app/api/projectGraph/file-functions/route.js +1 -1
  220. package/.next-prod/server/app/api/projectGraph/file-functions/route.js.nft.json +1 -1
  221. package/.next-prod/server/app/api/projectGraph/impact/route.js +1 -1
  222. package/.next-prod/server/app/api/projectGraph/impact/route.js.nft.json +1 -1
  223. package/.next-prod/server/app/api/projectGraph/related/route.js +1 -1
  224. package/.next-prod/server/app/api/projectGraph/related/route.js.nft.json +1 -1
  225. package/.next-prod/server/app/api/projectGraph/risk/route.js +1 -1
  226. package/.next-prod/server/app/api/projectGraph/risk/route.js.nft.json +1 -1
  227. package/.next-prod/server/app/api/projectGraph/search/route.js +1 -1
  228. package/.next-prod/server/app/api/projectGraph/search/route.js.nft.json +1 -1
  229. package/.next-prod/server/app/api/projects/route.js +1 -1
  230. package/.next-prod/server/app/api/projects/route.js.nft.json +1 -1
  231. package/.next-prod/server/app/api/push/public-key/route.js +1 -1
  232. package/.next-prod/server/app/api/push/public-key/route.js.nft.json +1 -1
  233. package/.next-prod/server/app/api/push/subscribe/route.js +1 -1
  234. package/.next-prod/server/app/api/push/subscribe/route.js.nft.json +1 -1
  235. package/.next-prod/server/app/api/push/unsubscribe/route.js +1 -1
  236. package/.next-prod/server/app/api/push/unsubscribe/route.js.nft.json +1 -1
  237. package/.next-prod/server/app/api/redis/command/route.js +1 -1
  238. package/.next-prod/server/app/api/redis/command/route.js.nft.json +1 -1
  239. package/.next-prod/server/app/api/redis/connect/route.js +1 -1
  240. package/.next-prod/server/app/api/redis/connect/route.js.nft.json +1 -1
  241. package/.next-prod/server/app/api/redis/delete/route.js +1 -1
  242. package/.next-prod/server/app/api/redis/delete/route.js.nft.json +1 -1
  243. package/.next-prod/server/app/api/redis/disconnect/route.js +1 -1
  244. package/.next-prod/server/app/api/redis/disconnect/route.js.nft.json +1 -1
  245. package/.next-prod/server/app/api/redis/get/route.js +1 -1
  246. package/.next-prod/server/app/api/redis/get/route.js.nft.json +1 -1
  247. package/.next-prod/server/app/api/redis/keys/route.js +1 -1
  248. package/.next-prod/server/app/api/redis/keys/route.js.nft.json +1 -1
  249. package/.next-prod/server/app/api/redis/set/route.js +1 -1
  250. package/.next-prod/server/app/api/redis/set/route.js.nft.json +1 -1
  251. package/.next-prod/server/app/api/restart/route.js +1 -1
  252. package/.next-prod/server/app/api/restart/route.js.nft.json +1 -1
  253. package/.next-prod/server/app/api/review/[id]/comments/route.js +1 -1
  254. package/.next-prod/server/app/api/review/[id]/comments/route.js.nft.json +1 -1
  255. package/.next-prod/server/app/api/review/[id]/replies/route.js +1 -1
  256. package/.next-prod/server/app/api/review/[id]/replies/route.js.nft.json +1 -1
  257. package/.next-prod/server/app/api/review/[id]/route.js +1 -1
  258. package/.next-prod/server/app/api/review/[id]/route.js.nft.json +1 -1
  259. package/.next-prod/server/app/api/review/identify/route.js +1 -1
  260. package/.next-prod/server/app/api/review/identify/route.js.nft.json +1 -1
  261. package/.next-prod/server/app/api/review/order/route.js +1 -1
  262. package/.next-prod/server/app/api/review/order/route.js.nft.json +1 -1
  263. package/.next-prod/server/app/api/review/route.js +1 -1
  264. package/.next-prod/server/app/api/review/route.js.nft.json +1 -1
  265. package/.next-prod/server/app/api/review/share-info/route.js +1 -1
  266. package/.next-prod/server/app/api/review/share-info/route.js.nft.json +1 -1
  267. package/.next-prod/server/app/api/review/users/route.js +1 -1
  268. package/.next-prod/server/app/api/review/users/route.js.nft.json +1 -1
  269. package/.next-prod/server/app/api/scheduled-tasks/route.js +2 -2
  270. package/.next-prod/server/app/api/scheduled-tasks/route.js.nft.json +1 -1
  271. package/.next-prod/server/app/api/services/config/route.js +1 -1
  272. package/.next-prod/server/app/api/services/config/route.js.nft.json +1 -1
  273. package/.next-prod/server/app/api/services/scripts/route.js +1 -1
  274. package/.next-prod/server/app/api/services/scripts/route.js.nft.json +1 -1
  275. package/.next-prod/server/app/api/session/[sessionId]/fork/route.js +1 -1
  276. package/.next-prod/server/app/api/session/[sessionId]/fork/route.js.nft.json +1 -1
  277. package/.next-prod/server/app/api/session/[sessionId]/history/route.js +1 -1
  278. package/.next-prod/server/app/api/session/[sessionId]/history/route.js.nft.json +1 -1
  279. package/.next-prod/server/app/api/session/[sessionId]/turn/route.js +2 -2
  280. package/.next-prod/server/app/api/session/[sessionId]/turn/route.js.nft.json +1 -1
  281. package/.next-prod/server/app/api/session/user-messages/route.js +1 -1
  282. package/.next-prod/server/app/api/session/user-messages/route.js.nft.json +1 -1
  283. package/.next-prod/server/app/api/session-by-path/route.js +1 -1
  284. package/.next-prod/server/app/api/session-by-path/route.js.nft.json +1 -1
  285. package/.next-prod/server/app/api/sessions/delegate/route.js +1 -1
  286. package/.next-prod/server/app/api/sessions/delegate/route.js.nft.json +1 -1
  287. package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js +1 -1
  288. package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js.nft.json +1 -1
  289. package/.next-prod/server/app/api/sessions/projects/route.js +1 -1
  290. package/.next-prod/server/app/api/sessions/projects/route.js.nft.json +1 -1
  291. package/.next-prod/server/app/api/sessions/search/route.js +1 -1
  292. package/.next-prod/server/app/api/sessions/search/route.js.nft.json +1 -1
  293. package/.next-prod/server/app/api/sessions/status/route.js +1 -1
  294. package/.next-prod/server/app/api/sessions/status/route.js.nft.json +1 -1
  295. package/.next-prod/server/app/api/settings/route.js +1 -1
  296. package/.next-prod/server/app/api/settings/route.js.nft.json +1 -1
  297. package/.next-prod/server/app/api/shutdown/route.js +1 -1
  298. package/.next-prod/server/app/api/shutdown/route.js.nft.json +1 -1
  299. package/.next-prod/server/app/api/skills/[id]/route.js +1 -1
  300. package/.next-prod/server/app/api/skills/[id]/route.js.nft.json +1 -1
  301. package/.next-prod/server/app/api/skills/content/route.js +1 -1
  302. package/.next-prod/server/app/api/skills/content/route.js.nft.json +1 -1
  303. package/.next-prod/server/app/api/skills/route.js +1 -1
  304. package/.next-prod/server/app/api/skills/route.js.nft.json +1 -1
  305. package/.next-prod/server/app/api/snapshots/blob/route.js +1 -1
  306. package/.next-prod/server/app/api/snapshots/blob/route.js.nft.json +1 -1
  307. package/.next-prod/server/app/api/snapshots/diff/route.js +1 -1
  308. package/.next-prod/server/app/api/snapshots/diff/route.js.nft.json +1 -1
  309. package/.next-prod/server/app/api/snapshots/range-diff/route.js +1 -0
  310. package/.next-prod/server/app/api/snapshots/range-diff/route.js.nft.json +1 -0
  311. package/.next-prod/server/app/api/snapshots/range-diff/route_client-reference-manifest.js +1 -0
  312. package/.next-prod/server/app/api/snapshots/route.js +1 -1
  313. package/.next-prod/server/app/api/snapshots/route.js.nft.json +1 -1
  314. package/.next-prod/server/app/api/terminal/aliases/route.js +1 -1
  315. package/.next-prod/server/app/api/terminal/aliases/route.js.nft.json +1 -1
  316. package/.next-prod/server/app/api/terminal/autocomplete/route.js +1 -1
  317. package/.next-prod/server/app/api/terminal/autocomplete/route.js.nft.json +1 -1
  318. package/.next-prod/server/app/api/terminal/bubble-order/route.js +1 -1
  319. package/.next-prod/server/app/api/terminal/bubble-order/route.js.nft.json +1 -1
  320. package/.next-prod/server/app/api/terminal/env/route.js +1 -1
  321. package/.next-prod/server/app/api/terminal/env/route.js.nft.json +1 -1
  322. package/.next-prod/server/app/api/terminal/history/route.js +1 -1
  323. package/.next-prod/server/app/api/terminal/history/route.js.nft.json +1 -1
  324. package/.next-prod/server/app/api/update/route.js +1 -1
  325. package/.next-prod/server/app/api/update/route.js.nft.json +1 -1
  326. package/.next-prod/server/app/api/update-state/route.js +1 -1
  327. package/.next-prod/server/app/api/update-state/route.js.nft.json +1 -1
  328. package/.next-prod/server/app/api/version/route.js +1 -1
  329. package/.next-prod/server/app/api/version/route.js.nft.json +1 -1
  330. package/.next-prod/server/app/apps/[...path]/route.js +1 -1
  331. package/.next-prod/server/app/apps/[...path]/route.js.nft.json +1 -1
  332. package/.next-prod/server/app/favicon.ico/route.js +1 -1
  333. package/.next-prod/server/app/favicon.ico/route.js.nft.json +1 -1
  334. package/.next-prod/server/app/m/page.js +1 -1
  335. package/.next-prod/server/app/m/page.js.nft.json +1 -1
  336. package/.next-prod/server/app/m/page_client-reference-manifest.js +1 -1
  337. package/.next-prod/server/app/manifest.webmanifest/route.js +2 -2
  338. package/.next-prod/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  339. package/.next-prod/server/app/page.js +1 -1
  340. package/.next-prod/server/app/page.js.nft.json +1 -1
  341. package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
  342. package/.next-prod/server/app/project/page.js +1 -1
  343. package/.next-prod/server/app/project/page.js.nft.json +1 -1
  344. package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
  345. package/.next-prod/server/app/review/[id]/page.js +1 -1
  346. package/.next-prod/server/app/review/[id]/page.js.nft.json +1 -1
  347. package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
  348. package/.next-prod/server/app-paths-manifest.json +8 -5
  349. package/.next-prod/server/chunks/2493.js +27 -23
  350. package/.next-prod/server/chunks/6495.js +1 -1
  351. package/.next-prod/server/chunks/6548.js +1 -1
  352. package/.next-prod/server/chunks/7438.js +764 -0
  353. package/.next-prod/server/chunks/{1653.js → 8022.js} +2 -2
  354. package/.next-prod/server/chunks/{7956.js → 8131.js} +3 -3
  355. package/.next-prod/server/chunks/9830.js +1 -1
  356. package/.next-prod/server/middleware-build-manifest.js +1 -1
  357. package/.next-prod/server/pages/404.html +2 -2
  358. package/.next-prod/server/pages/500.html +1 -1
  359. package/.next-prod/server/server-reference-manifest.json +1 -1
  360. package/.next-prod/static/chunks/{88707-2ab6211efb1fae85.js → 15546-54f06dcff501835d.js} +2 -2
  361. package/.next-prod/static/chunks/89656-1b5bae337f6b6892.js +34 -0
  362. package/.next-prod/static/chunks/95313-96a541e7ce6f76c4.js +17 -0
  363. package/.next-prod/static/chunks/99092-7b5fa4560a398020.js +716 -0
  364. package/.next-prod/static/chunks/{103-1f50be74a00f89af.js → 99365-c697e983b9728d08.js} +2 -2
  365. package/.next-prod/static/chunks/app/_global-error/page-6ac899b2cd280c12.js +1 -0
  366. package/.next-prod/static/chunks/app/api/agent/test/route-6ac899b2cd280c12.js +1 -0
  367. package/.next-prod/static/chunks/app/api/bash/route-6ac899b2cd280c12.js +1 -0
  368. package/.next-prod/static/chunks/app/api/bots/[id]/route-6ac899b2cd280c12.js +1 -0
  369. package/.next-prod/static/chunks/app/api/bots/route-6ac899b2cd280c12.js +1 -0
  370. package/.next-prod/static/chunks/app/api/chat/codex/route-6ac899b2cd280c12.js +1 -0
  371. package/.next-prod/static/chunks/app/api/chat/deepseek/route-6ac899b2cd280c12.js +1 -0
  372. package/.next-prod/static/chunks/app/api/chat/glm/route-6ac899b2cd280c12.js +1 -0
  373. package/.next-prod/static/chunks/app/api/chat/kimi/route-6ac899b2cd280c12.js +1 -0
  374. package/.next-prod/static/chunks/app/api/chat/ollama/route-6ac899b2cd280c12.js +1 -0
  375. package/.next-prod/static/chunks/app/api/chat/route-6ac899b2cd280c12.js +1 -0
  376. package/.next-prod/static/chunks/app/api/chat/stop/route-6ac899b2cd280c12.js +1 -0
  377. package/.next-prod/static/chunks/app/api/claude-stats/route-6ac899b2cd280c12.js +1 -0
  378. package/.next-prod/static/chunks/app/api/commands/route-6ac899b2cd280c12.js +1 -0
  379. package/.next-prod/static/chunks/app/api/comments/route-6ac899b2cd280c12.js +1 -0
  380. package/.next-prod/static/chunks/app/api/db/columns/route-6ac899b2cd280c12.js +1 -0
  381. package/.next-prod/static/chunks/app/api/db/connect/route-6ac899b2cd280c12.js +1 -0
  382. package/.next-prod/static/chunks/app/api/db/disconnect/route-6ac899b2cd280c12.js +1 -0
  383. package/.next-prod/static/chunks/app/api/db/export/route-6ac899b2cd280c12.js +1 -0
  384. package/.next-prod/static/chunks/app/api/db/query/route-6ac899b2cd280c12.js +1 -0
  385. package/.next-prod/static/chunks/app/api/db/schemas/route-6ac899b2cd280c12.js +1 -0
  386. package/.next-prod/static/chunks/app/api/deepseek/balance/route-6ac899b2cd280c12.js +1 -0
  387. package/.next-prod/static/chunks/app/api/deepseek/credentials/route-6ac899b2cd280c12.js +1 -0
  388. package/.next-prod/static/chunks/app/api/deepseek/models/route-6ac899b2cd280c12.js +1 -0
  389. package/.next-prod/static/chunks/app/api/dev/spans/route-6ac899b2cd280c12.js +1 -0
  390. package/.next-prod/static/chunks/app/api/extension/version/route-6ac899b2cd280c12.js +1 -0
  391. package/.next-prod/static/chunks/app/api/file/route-6ac899b2cd280c12.js +1 -0
  392. package/.next-prod/static/chunks/app/api/files/blame/route-6ac899b2cd280c12.js +1 -0
  393. package/.next-prod/static/chunks/app/api/files/clipboard/route-6ac899b2cd280c12.js +1 -0
  394. package/.next-prod/static/chunks/app/api/files/copy/route-6ac899b2cd280c12.js +1 -0
  395. package/.next-prod/static/chunks/app/api/files/delete/route-6ac899b2cd280c12.js +1 -0
  396. package/.next-prod/static/chunks/app/api/files/expanded/route-6ac899b2cd280c12.js +1 -0
  397. package/.next-prod/static/chunks/app/api/files/index/route-6ac899b2cd280c12.js +1 -0
  398. package/.next-prod/static/chunks/app/api/files/init/route-6ac899b2cd280c12.js +1 -0
  399. package/.next-prod/static/chunks/app/api/files/paste/route-6ac899b2cd280c12.js +1 -0
  400. package/.next-prod/static/chunks/app/api/files/read/route-6ac899b2cd280c12.js +1 -0
  401. package/.next-prod/static/chunks/app/api/files/readdir/route-6ac899b2cd280c12.js +1 -0
  402. package/.next-prod/static/chunks/app/api/files/recent/route-6ac899b2cd280c12.js +1 -0
  403. package/.next-prod/static/chunks/app/api/files/save/route-6ac899b2cd280c12.js +1 -0
  404. package/.next-prod/static/chunks/app/api/files/search/route-6ac899b2cd280c12.js +1 -0
  405. package/.next-prod/static/chunks/app/api/files/stat/route-6ac899b2cd280c12.js +1 -0
  406. package/.next-prod/static/chunks/app/api/files/text/route-6ac899b2cd280c12.js +1 -0
  407. package/.next-prod/static/chunks/app/api/git/blob/route-6ac899b2cd280c12.js +1 -0
  408. package/.next-prod/static/chunks/app/api/git/branch-diff/route-6ac899b2cd280c12.js +1 -0
  409. package/.next-prod/static/chunks/app/api/git/branches/route-6ac899b2cd280c12.js +1 -0
  410. package/.next-prod/static/chunks/app/api/git/commit-diff/route-6ac899b2cd280c12.js +1 -0
  411. package/.next-prod/static/chunks/app/api/git/commits/route-6ac899b2cd280c12.js +1 -0
  412. package/.next-prod/static/chunks/app/api/git/current-branch/route-6ac899b2cd280c12.js +1 -0
  413. package/.next-prod/static/chunks/app/api/git/diff/route-6ac899b2cd280c12.js +1 -0
  414. package/.next-prod/static/chunks/app/api/git/discard/route-6ac899b2cd280c12.js +1 -0
  415. package/.next-prod/static/chunks/app/api/git/stage/route-6ac899b2cd280c12.js +1 -0
  416. package/.next-prod/static/chunks/app/api/git/status/route-6ac899b2cd280c12.js +1 -0
  417. package/.next-prod/static/chunks/app/api/git/unstage/route-6ac899b2cd280c12.js +1 -0
  418. package/.next-prod/static/chunks/app/api/git/worktree/route-6ac899b2cd280c12.js +1 -0
  419. package/.next-prod/static/chunks/app/api/glm/credentials/route-6ac899b2cd280c12.js +1 -0
  420. package/.next-prod/static/chunks/app/api/glm/models/route-6ac899b2cd280c12.js +1 -0
  421. package/.next-prod/static/chunks/app/api/glm/usage/route-6ac899b2cd280c12.js +1 -0
  422. package/.next-prod/static/chunks/app/api/global-state/route-6ac899b2cd280c12.js +1 -0
  423. package/.next-prod/static/chunks/app/api/health/route-6ac899b2cd280c12.js +1 -0
  424. package/.next-prod/static/chunks/app/api/html-apps/[id]/route-6ac899b2cd280c12.js +1 -0
  425. package/.next-prod/static/chunks/app/api/html-apps/route-6ac899b2cd280c12.js +1 -0
  426. package/.next-prod/static/chunks/app/api/instructions/config/route-6ac899b2cd280c12.js +1 -0
  427. package/.next-prod/static/chunks/app/api/kimi/credentials/route-6ac899b2cd280c12.js +1 -0
  428. package/.next-prod/static/chunks/app/api/kimi/models/route-6ac899b2cd280c12.js +1 -0
  429. package/.next-prod/static/chunks/app/api/kimi/usage/route-6ac899b2cd280c12.js +1 -0
  430. package/.next-prod/static/chunks/app/api/lsp/definition/route-6ac899b2cd280c12.js +1 -0
  431. package/.next-prod/static/chunks/app/api/lsp/hover/route-6ac899b2cd280c12.js +1 -0
  432. package/.next-prod/static/chunks/app/api/lsp/references/route-6ac899b2cd280c12.js +1 -0
  433. package/.next-prod/static/chunks/app/api/lsp/status/route-6ac899b2cd280c12.js +1 -0
  434. package/.next-prod/static/chunks/app/api/lsp/warmup/route-6ac899b2cd280c12.js +1 -0
  435. package/.next-prod/static/chunks/app/api/mysql/columns/route-6ac899b2cd280c12.js +1 -0
  436. package/.next-prod/static/chunks/app/api/mysql/connect/route-6ac899b2cd280c12.js +1 -0
  437. package/.next-prod/static/chunks/app/api/mysql/disconnect/route-6ac899b2cd280c12.js +1 -0
  438. package/.next-prod/static/chunks/app/api/mysql/export/route-6ac899b2cd280c12.js +1 -0
  439. package/.next-prod/static/chunks/app/api/mysql/query/route-6ac899b2cd280c12.js +1 -0
  440. package/.next-prod/static/chunks/app/api/mysql/schemas/route-6ac899b2cd280c12.js +1 -0
  441. package/.next-prod/static/chunks/app/api/neo4j/connect/route-6ac899b2cd280c12.js +1 -0
  442. package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-6ac899b2cd280c12.js +1 -0
  443. package/.next-prod/static/chunks/app/api/neo4j/query/route-6ac899b2cd280c12.js +1 -0
  444. package/.next-prod/static/chunks/app/api/neo4j/schema/route-6ac899b2cd280c12.js +1 -0
  445. package/.next-prod/static/chunks/app/api/note/route-6ac899b2cd280c12.js +1 -0
  446. package/.next-prod/static/chunks/app/api/ollama/config/route-6ac899b2cd280c12.js +1 -0
  447. package/.next-prod/static/chunks/app/api/ollama/default-model/route-6ac899b2cd280c12.js +1 -0
  448. package/.next-prod/static/chunks/app/api/ollama/models/route-6ac899b2cd280c12.js +1 -0
  449. package/.next-prod/static/chunks/app/api/ollama/start/route-6ac899b2cd280c12.js +1 -0
  450. package/.next-prod/static/chunks/app/api/open-cursor/route-6ac899b2cd280c12.js +1 -0
  451. package/.next-prod/static/chunks/app/api/open-vscode/route-6ac899b2cd280c12.js +1 -0
  452. package/.next-prod/static/chunks/app/api/pick-folder/route-6ac899b2cd280c12.js +1 -0
  453. package/.next-prod/static/chunks/app/api/pinned-sessions/route-6ac899b2cd280c12.js +1 -0
  454. package/.next-prod/static/chunks/app/api/project-settings/route-6ac899b2cd280c12.js +1 -0
  455. package/.next-prod/static/chunks/app/api/project-state/route-6ac899b2cd280c12.js +1 -0
  456. package/.next-prod/static/chunks/app/api/projectGraph/affected/route-6ac899b2cd280c12.js +1 -0
  457. package/.next-prod/static/chunks/app/api/projectGraph/callees/route-6ac899b2cd280c12.js +1 -0
  458. package/.next-prod/static/chunks/app/api/projectGraph/callers/route-6ac899b2cd280c12.js +1 -0
  459. package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-6ac899b2cd280c12.js +1 -0
  460. package/.next-prod/static/chunks/app/api/projectGraph/context/route-6ac899b2cd280c12.js +1 -0
  461. package/.next-prod/static/chunks/app/api/projectGraph/file/route-6ac899b2cd280c12.js +1 -0
  462. package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-6ac899b2cd280c12.js +1 -0
  463. package/.next-prod/static/chunks/app/api/projectGraph/impact/route-6ac899b2cd280c12.js +1 -0
  464. package/.next-prod/static/chunks/app/api/projectGraph/related/route-6ac899b2cd280c12.js +1 -0
  465. package/.next-prod/static/chunks/app/api/projectGraph/risk/route-6ac899b2cd280c12.js +1 -0
  466. package/.next-prod/static/chunks/app/api/projectGraph/search/route-6ac899b2cd280c12.js +1 -0
  467. package/.next-prod/static/chunks/app/api/projects/route-6ac899b2cd280c12.js +1 -0
  468. package/.next-prod/static/chunks/app/api/push/public-key/route-6ac899b2cd280c12.js +1 -0
  469. package/.next-prod/static/chunks/app/api/push/subscribe/route-6ac899b2cd280c12.js +1 -0
  470. package/.next-prod/static/chunks/app/api/push/unsubscribe/route-6ac899b2cd280c12.js +1 -0
  471. package/.next-prod/static/chunks/app/api/redis/command/route-6ac899b2cd280c12.js +1 -0
  472. package/.next-prod/static/chunks/app/api/redis/connect/route-6ac899b2cd280c12.js +1 -0
  473. package/.next-prod/static/chunks/app/api/redis/delete/route-6ac899b2cd280c12.js +1 -0
  474. package/.next-prod/static/chunks/app/api/redis/disconnect/route-6ac899b2cd280c12.js +1 -0
  475. package/.next-prod/static/chunks/app/api/redis/get/route-6ac899b2cd280c12.js +1 -0
  476. package/.next-prod/static/chunks/app/api/redis/keys/route-6ac899b2cd280c12.js +1 -0
  477. package/.next-prod/static/chunks/app/api/redis/set/route-6ac899b2cd280c12.js +1 -0
  478. package/.next-prod/static/chunks/app/api/restart/route-6ac899b2cd280c12.js +1 -0
  479. package/.next-prod/static/chunks/app/api/review/[id]/comments/route-6ac899b2cd280c12.js +1 -0
  480. package/.next-prod/static/chunks/app/api/review/[id]/replies/route-6ac899b2cd280c12.js +1 -0
  481. package/.next-prod/static/chunks/app/api/review/[id]/route-6ac899b2cd280c12.js +1 -0
  482. package/.next-prod/static/chunks/app/api/review/identify/route-6ac899b2cd280c12.js +1 -0
  483. package/.next-prod/static/chunks/app/api/review/order/route-6ac899b2cd280c12.js +1 -0
  484. package/.next-prod/static/chunks/app/api/review/route-6ac899b2cd280c12.js +1 -0
  485. package/.next-prod/static/chunks/app/api/review/share-info/route-6ac899b2cd280c12.js +1 -0
  486. package/.next-prod/static/chunks/app/api/review/users/route-6ac899b2cd280c12.js +1 -0
  487. package/.next-prod/static/chunks/app/api/scheduled-tasks/route-6ac899b2cd280c12.js +1 -0
  488. package/.next-prod/static/chunks/app/api/services/config/route-6ac899b2cd280c12.js +1 -0
  489. package/.next-prod/static/chunks/app/api/services/scripts/route-6ac899b2cd280c12.js +1 -0
  490. package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-6ac899b2cd280c12.js +1 -0
  491. package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-6ac899b2cd280c12.js +1 -0
  492. package/.next-prod/static/chunks/app/api/session/[sessionId]/turn/route-6ac899b2cd280c12.js +1 -0
  493. package/.next-prod/static/chunks/app/api/session/user-messages/route-6ac899b2cd280c12.js +1 -0
  494. package/.next-prod/static/chunks/app/api/session-by-path/route-6ac899b2cd280c12.js +1 -0
  495. package/.next-prod/static/chunks/app/api/sessions/delegate/route-6ac899b2cd280c12.js +1 -0
  496. package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-6ac899b2cd280c12.js +1 -0
  497. package/.next-prod/static/chunks/app/api/sessions/projects/route-6ac899b2cd280c12.js +1 -0
  498. package/.next-prod/static/chunks/app/api/sessions/search/route-6ac899b2cd280c12.js +1 -0
  499. package/.next-prod/static/chunks/app/api/sessions/status/route-6ac899b2cd280c12.js +1 -0
  500. package/.next-prod/static/chunks/app/api/settings/route-6ac899b2cd280c12.js +1 -0
  501. package/.next-prod/static/chunks/app/api/shutdown/route-6ac899b2cd280c12.js +1 -0
  502. package/.next-prod/static/chunks/app/api/skills/[id]/route-6ac899b2cd280c12.js +1 -0
  503. package/.next-prod/static/chunks/app/api/skills/content/route-6ac899b2cd280c12.js +1 -0
  504. package/.next-prod/static/chunks/app/api/skills/route-6ac899b2cd280c12.js +1 -0
  505. package/.next-prod/static/chunks/app/api/snapshots/blob/route-6ac899b2cd280c12.js +1 -0
  506. package/.next-prod/static/chunks/app/api/snapshots/diff/route-6ac899b2cd280c12.js +1 -0
  507. package/.next-prod/static/chunks/app/api/snapshots/range-diff/route-6ac899b2cd280c12.js +1 -0
  508. package/.next-prod/static/chunks/app/api/snapshots/route-6ac899b2cd280c12.js +1 -0
  509. package/.next-prod/static/chunks/app/api/terminal/aliases/route-6ac899b2cd280c12.js +1 -0
  510. package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-6ac899b2cd280c12.js +1 -0
  511. package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-6ac899b2cd280c12.js +1 -0
  512. package/.next-prod/static/chunks/app/api/terminal/env/route-6ac899b2cd280c12.js +1 -0
  513. package/.next-prod/static/chunks/app/api/terminal/history/route-6ac899b2cd280c12.js +1 -0
  514. package/.next-prod/static/chunks/app/api/update/route-6ac899b2cd280c12.js +1 -0
  515. package/.next-prod/static/chunks/app/api/update-state/route-6ac899b2cd280c12.js +1 -0
  516. package/.next-prod/static/chunks/app/api/version/route-6ac899b2cd280c12.js +1 -0
  517. package/.next-prod/static/chunks/app/apps/[...path]/route-6ac899b2cd280c12.js +1 -0
  518. package/.next-prod/static/chunks/app/layout-f3f9426dccb507b2.js +1 -0
  519. package/.next-prod/static/chunks/app/m/page-ba0be89e67f08b6d.js +1 -0
  520. package/.next-prod/static/chunks/app/manifest.webmanifest/route-6ac899b2cd280c12.js +1 -0
  521. package/.next-prod/static/chunks/app/page-d97e5df9486f39cb.js +1 -0
  522. package/.next-prod/static/chunks/app/project/page-d97e5df9486f39cb.js +1 -0
  523. package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-6ac899b2cd280c12.js +1 -0
  524. package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-6ac899b2cd280c12.js +1 -0
  525. package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-6ac899b2cd280c12.js +1 -0
  526. package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-6ac899b2cd280c12.js +1 -0
  527. package/.next-prod/static/css/e6181fb6c73884b4.css +1 -0
  528. package/.next-prod/static/yEJ9Z5Bjv9ti4WeYINfCs/_buildManifest.js +1 -0
  529. package/.next-prod/trace +15 -15
  530. package/.next-prod/trace-build +1 -1
  531. package/.next-prod/types/app/api/bots/[id]/route.ts +353 -0
  532. package/.next-prod/types/app/api/{sessions → bots}/route.ts +3 -3
  533. package/.next-prod/types/app/api/ollama/default-model/route.ts +353 -0
  534. package/.next-prod/types/app/api/snapshots/range-diff/route.ts +353 -0
  535. package/.next-prod/types/routes.d.ts +5 -2
  536. package/.next-prod/types/validator.ts +36 -9
  537. package/README.md +15 -2
  538. package/README.zh.md +15 -2
  539. package/bin/cock-codegraph.mjs +58 -58
  540. package/bin/cock-connection.mjs +1 -1
  541. package/bin/cock-terminal.mjs +17 -17
  542. package/bin/cockpit-dev.mjs +3 -4
  543. package/bin/cockpit.mjs +243 -9
  544. package/bin/setup-dev.mjs +3 -4
  545. package/bots/README.md +86 -0
  546. package/bots/cockpit-helper/BOT.md +95 -0
  547. package/bots/cockpit-helper/commitments/active.md +3 -0
  548. package/bots/cockpit-helper/evidence/refs.md +3 -0
  549. package/bots/cockpit-helper/identity/persona.md +25 -0
  550. package/bots/cockpit-helper/identity/principles.md +49 -0
  551. package/bots/cockpit-helper/memory/facts.md +3 -0
  552. package/bots/cockpit-helper/relationships/user.md +3 -0
  553. package/dist/{chunk-6R4AHIIV.mjs → chunk-5ZXPIG4Z.mjs} +1 -1
  554. package/dist/{chunk-JJWVBF6H.mjs → chunk-SGVT4QFB.mjs} +1001 -216
  555. package/dist/httpApi.mjs +2 -2
  556. package/dist/scheduledTasks.mjs +150 -27
  557. package/dist/wsServer.mjs +2 -2
  558. package/package.json +4 -4
  559. package/skills/README.md +18 -2
  560. package/skills/bot/SKILL.md +155 -0
  561. package/skills/bot-run/SKILL.md +151 -0
  562. package/skills/bot-run/followup.md +38 -0
  563. package/skills/bot-run/wait.md +76 -0
  564. package/skills/bot-turn/SKILL.md +106 -0
  565. package/skills/bot-turn/attach.md +45 -0
  566. package/skills/bot-turn/export.md +113 -0
  567. package/skills/bot-turn/review.md +101 -0
  568. package/skills/bot-turn/writing.md +110 -0
  569. package/skills/cc/SKILL.md +0 -1
  570. package/skills/dl/SKILL.md +4 -1
  571. package/.next-prod/server/app/api/sessions/route.js +0 -1
  572. package/.next-prod/server/app/api/sessions/route_client-reference-manifest.js +0 -1
  573. package/.next-prod/server/chunks/5750.js +0 -762
  574. package/.next-prod/static/chunks/72539-7e4ca2de5c9f3f90.js +0 -17
  575. package/.next-prod/static/chunks/89656-bc48af1f9ee9c312.js +0 -32
  576. package/.next-prod/static/chunks/99092-36ee2c49e4c4c059.js +0 -716
  577. package/.next-prod/static/chunks/app/_global-error/page-b56c0b18a3b4d026.js +0 -1
  578. package/.next-prod/static/chunks/app/api/agent/test/route-b56c0b18a3b4d026.js +0 -1
  579. package/.next-prod/static/chunks/app/api/bash/route-b56c0b18a3b4d026.js +0 -1
  580. package/.next-prod/static/chunks/app/api/chat/codex/route-b56c0b18a3b4d026.js +0 -1
  581. package/.next-prod/static/chunks/app/api/chat/deepseek/route-b56c0b18a3b4d026.js +0 -1
  582. package/.next-prod/static/chunks/app/api/chat/glm/route-b56c0b18a3b4d026.js +0 -1
  583. package/.next-prod/static/chunks/app/api/chat/kimi/route-b56c0b18a3b4d026.js +0 -1
  584. package/.next-prod/static/chunks/app/api/chat/ollama/route-b56c0b18a3b4d026.js +0 -1
  585. package/.next-prod/static/chunks/app/api/chat/route-b56c0b18a3b4d026.js +0 -1
  586. package/.next-prod/static/chunks/app/api/chat/stop/route-b56c0b18a3b4d026.js +0 -1
  587. package/.next-prod/static/chunks/app/api/claude-stats/route-b56c0b18a3b4d026.js +0 -1
  588. package/.next-prod/static/chunks/app/api/commands/route-b56c0b18a3b4d026.js +0 -1
  589. package/.next-prod/static/chunks/app/api/comments/route-b56c0b18a3b4d026.js +0 -1
  590. package/.next-prod/static/chunks/app/api/db/columns/route-b56c0b18a3b4d026.js +0 -1
  591. package/.next-prod/static/chunks/app/api/db/connect/route-b56c0b18a3b4d026.js +0 -1
  592. package/.next-prod/static/chunks/app/api/db/disconnect/route-b56c0b18a3b4d026.js +0 -1
  593. package/.next-prod/static/chunks/app/api/db/export/route-b56c0b18a3b4d026.js +0 -1
  594. package/.next-prod/static/chunks/app/api/db/query/route-b56c0b18a3b4d026.js +0 -1
  595. package/.next-prod/static/chunks/app/api/db/schemas/route-b56c0b18a3b4d026.js +0 -1
  596. package/.next-prod/static/chunks/app/api/deepseek/balance/route-b56c0b18a3b4d026.js +0 -1
  597. package/.next-prod/static/chunks/app/api/deepseek/credentials/route-b56c0b18a3b4d026.js +0 -1
  598. package/.next-prod/static/chunks/app/api/deepseek/models/route-b56c0b18a3b4d026.js +0 -1
  599. package/.next-prod/static/chunks/app/api/dev/spans/route-b56c0b18a3b4d026.js +0 -1
  600. package/.next-prod/static/chunks/app/api/extension/version/route-b56c0b18a3b4d026.js +0 -1
  601. package/.next-prod/static/chunks/app/api/file/route-b56c0b18a3b4d026.js +0 -1
  602. package/.next-prod/static/chunks/app/api/files/blame/route-b56c0b18a3b4d026.js +0 -1
  603. package/.next-prod/static/chunks/app/api/files/clipboard/route-b56c0b18a3b4d026.js +0 -1
  604. package/.next-prod/static/chunks/app/api/files/copy/route-b56c0b18a3b4d026.js +0 -1
  605. package/.next-prod/static/chunks/app/api/files/delete/route-b56c0b18a3b4d026.js +0 -1
  606. package/.next-prod/static/chunks/app/api/files/expanded/route-b56c0b18a3b4d026.js +0 -1
  607. package/.next-prod/static/chunks/app/api/files/index/route-b56c0b18a3b4d026.js +0 -1
  608. package/.next-prod/static/chunks/app/api/files/init/route-b56c0b18a3b4d026.js +0 -1
  609. package/.next-prod/static/chunks/app/api/files/paste/route-b56c0b18a3b4d026.js +0 -1
  610. package/.next-prod/static/chunks/app/api/files/read/route-b56c0b18a3b4d026.js +0 -1
  611. package/.next-prod/static/chunks/app/api/files/readdir/route-b56c0b18a3b4d026.js +0 -1
  612. package/.next-prod/static/chunks/app/api/files/recent/route-b56c0b18a3b4d026.js +0 -1
  613. package/.next-prod/static/chunks/app/api/files/save/route-b56c0b18a3b4d026.js +0 -1
  614. package/.next-prod/static/chunks/app/api/files/search/route-b56c0b18a3b4d026.js +0 -1
  615. package/.next-prod/static/chunks/app/api/files/stat/route-b56c0b18a3b4d026.js +0 -1
  616. package/.next-prod/static/chunks/app/api/files/text/route-b56c0b18a3b4d026.js +0 -1
  617. package/.next-prod/static/chunks/app/api/git/blob/route-b56c0b18a3b4d026.js +0 -1
  618. package/.next-prod/static/chunks/app/api/git/branch-diff/route-b56c0b18a3b4d026.js +0 -1
  619. package/.next-prod/static/chunks/app/api/git/branches/route-b56c0b18a3b4d026.js +0 -1
  620. package/.next-prod/static/chunks/app/api/git/commit-diff/route-b56c0b18a3b4d026.js +0 -1
  621. package/.next-prod/static/chunks/app/api/git/commits/route-b56c0b18a3b4d026.js +0 -1
  622. package/.next-prod/static/chunks/app/api/git/current-branch/route-b56c0b18a3b4d026.js +0 -1
  623. package/.next-prod/static/chunks/app/api/git/diff/route-b56c0b18a3b4d026.js +0 -1
  624. package/.next-prod/static/chunks/app/api/git/discard/route-b56c0b18a3b4d026.js +0 -1
  625. package/.next-prod/static/chunks/app/api/git/stage/route-b56c0b18a3b4d026.js +0 -1
  626. package/.next-prod/static/chunks/app/api/git/status/route-b56c0b18a3b4d026.js +0 -1
  627. package/.next-prod/static/chunks/app/api/git/unstage/route-b56c0b18a3b4d026.js +0 -1
  628. package/.next-prod/static/chunks/app/api/git/worktree/route-b56c0b18a3b4d026.js +0 -1
  629. package/.next-prod/static/chunks/app/api/glm/credentials/route-b56c0b18a3b4d026.js +0 -1
  630. package/.next-prod/static/chunks/app/api/glm/models/route-b56c0b18a3b4d026.js +0 -1
  631. package/.next-prod/static/chunks/app/api/glm/usage/route-b56c0b18a3b4d026.js +0 -1
  632. package/.next-prod/static/chunks/app/api/global-state/route-b56c0b18a3b4d026.js +0 -1
  633. package/.next-prod/static/chunks/app/api/health/route-b56c0b18a3b4d026.js +0 -1
  634. package/.next-prod/static/chunks/app/api/html-apps/[id]/route-b56c0b18a3b4d026.js +0 -1
  635. package/.next-prod/static/chunks/app/api/html-apps/route-b56c0b18a3b4d026.js +0 -1
  636. package/.next-prod/static/chunks/app/api/instructions/config/route-b56c0b18a3b4d026.js +0 -1
  637. package/.next-prod/static/chunks/app/api/kimi/credentials/route-b56c0b18a3b4d026.js +0 -1
  638. package/.next-prod/static/chunks/app/api/kimi/models/route-b56c0b18a3b4d026.js +0 -1
  639. package/.next-prod/static/chunks/app/api/kimi/usage/route-b56c0b18a3b4d026.js +0 -1
  640. package/.next-prod/static/chunks/app/api/lsp/definition/route-b56c0b18a3b4d026.js +0 -1
  641. package/.next-prod/static/chunks/app/api/lsp/hover/route-b56c0b18a3b4d026.js +0 -1
  642. package/.next-prod/static/chunks/app/api/lsp/references/route-b56c0b18a3b4d026.js +0 -1
  643. package/.next-prod/static/chunks/app/api/lsp/status/route-b56c0b18a3b4d026.js +0 -1
  644. package/.next-prod/static/chunks/app/api/lsp/warmup/route-b56c0b18a3b4d026.js +0 -1
  645. package/.next-prod/static/chunks/app/api/mysql/columns/route-b56c0b18a3b4d026.js +0 -1
  646. package/.next-prod/static/chunks/app/api/mysql/connect/route-b56c0b18a3b4d026.js +0 -1
  647. package/.next-prod/static/chunks/app/api/mysql/disconnect/route-b56c0b18a3b4d026.js +0 -1
  648. package/.next-prod/static/chunks/app/api/mysql/export/route-b56c0b18a3b4d026.js +0 -1
  649. package/.next-prod/static/chunks/app/api/mysql/query/route-b56c0b18a3b4d026.js +0 -1
  650. package/.next-prod/static/chunks/app/api/mysql/schemas/route-b56c0b18a3b4d026.js +0 -1
  651. package/.next-prod/static/chunks/app/api/neo4j/connect/route-b56c0b18a3b4d026.js +0 -1
  652. package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-b56c0b18a3b4d026.js +0 -1
  653. package/.next-prod/static/chunks/app/api/neo4j/query/route-b56c0b18a3b4d026.js +0 -1
  654. package/.next-prod/static/chunks/app/api/neo4j/schema/route-b56c0b18a3b4d026.js +0 -1
  655. package/.next-prod/static/chunks/app/api/note/route-b56c0b18a3b4d026.js +0 -1
  656. package/.next-prod/static/chunks/app/api/ollama/config/route-b56c0b18a3b4d026.js +0 -1
  657. package/.next-prod/static/chunks/app/api/ollama/models/route-b56c0b18a3b4d026.js +0 -1
  658. package/.next-prod/static/chunks/app/api/ollama/start/route-b56c0b18a3b4d026.js +0 -1
  659. package/.next-prod/static/chunks/app/api/open-cursor/route-b56c0b18a3b4d026.js +0 -1
  660. package/.next-prod/static/chunks/app/api/open-vscode/route-b56c0b18a3b4d026.js +0 -1
  661. package/.next-prod/static/chunks/app/api/pick-folder/route-b56c0b18a3b4d026.js +0 -1
  662. package/.next-prod/static/chunks/app/api/pinned-sessions/route-b56c0b18a3b4d026.js +0 -1
  663. package/.next-prod/static/chunks/app/api/project-settings/route-b56c0b18a3b4d026.js +0 -1
  664. package/.next-prod/static/chunks/app/api/project-state/route-b56c0b18a3b4d026.js +0 -1
  665. package/.next-prod/static/chunks/app/api/projectGraph/affected/route-b56c0b18a3b4d026.js +0 -1
  666. package/.next-prod/static/chunks/app/api/projectGraph/callees/route-b56c0b18a3b4d026.js +0 -1
  667. package/.next-prod/static/chunks/app/api/projectGraph/callers/route-b56c0b18a3b4d026.js +0 -1
  668. package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-b56c0b18a3b4d026.js +0 -1
  669. package/.next-prod/static/chunks/app/api/projectGraph/context/route-b56c0b18a3b4d026.js +0 -1
  670. package/.next-prod/static/chunks/app/api/projectGraph/file/route-b56c0b18a3b4d026.js +0 -1
  671. package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-b56c0b18a3b4d026.js +0 -1
  672. package/.next-prod/static/chunks/app/api/projectGraph/impact/route-b56c0b18a3b4d026.js +0 -1
  673. package/.next-prod/static/chunks/app/api/projectGraph/related/route-b56c0b18a3b4d026.js +0 -1
  674. package/.next-prod/static/chunks/app/api/projectGraph/risk/route-b56c0b18a3b4d026.js +0 -1
  675. package/.next-prod/static/chunks/app/api/projectGraph/search/route-b56c0b18a3b4d026.js +0 -1
  676. package/.next-prod/static/chunks/app/api/projects/route-b56c0b18a3b4d026.js +0 -1
  677. package/.next-prod/static/chunks/app/api/push/public-key/route-b56c0b18a3b4d026.js +0 -1
  678. package/.next-prod/static/chunks/app/api/push/subscribe/route-b56c0b18a3b4d026.js +0 -1
  679. package/.next-prod/static/chunks/app/api/push/unsubscribe/route-b56c0b18a3b4d026.js +0 -1
  680. package/.next-prod/static/chunks/app/api/redis/command/route-b56c0b18a3b4d026.js +0 -1
  681. package/.next-prod/static/chunks/app/api/redis/connect/route-b56c0b18a3b4d026.js +0 -1
  682. package/.next-prod/static/chunks/app/api/redis/delete/route-b56c0b18a3b4d026.js +0 -1
  683. package/.next-prod/static/chunks/app/api/redis/disconnect/route-b56c0b18a3b4d026.js +0 -1
  684. package/.next-prod/static/chunks/app/api/redis/get/route-b56c0b18a3b4d026.js +0 -1
  685. package/.next-prod/static/chunks/app/api/redis/keys/route-b56c0b18a3b4d026.js +0 -1
  686. package/.next-prod/static/chunks/app/api/redis/set/route-b56c0b18a3b4d026.js +0 -1
  687. package/.next-prod/static/chunks/app/api/restart/route-b56c0b18a3b4d026.js +0 -1
  688. package/.next-prod/static/chunks/app/api/review/[id]/comments/route-b56c0b18a3b4d026.js +0 -1
  689. package/.next-prod/static/chunks/app/api/review/[id]/replies/route-b56c0b18a3b4d026.js +0 -1
  690. package/.next-prod/static/chunks/app/api/review/[id]/route-b56c0b18a3b4d026.js +0 -1
  691. package/.next-prod/static/chunks/app/api/review/identify/route-b56c0b18a3b4d026.js +0 -1
  692. package/.next-prod/static/chunks/app/api/review/order/route-b56c0b18a3b4d026.js +0 -1
  693. package/.next-prod/static/chunks/app/api/review/route-b56c0b18a3b4d026.js +0 -1
  694. package/.next-prod/static/chunks/app/api/review/share-info/route-b56c0b18a3b4d026.js +0 -1
  695. package/.next-prod/static/chunks/app/api/review/users/route-b56c0b18a3b4d026.js +0 -1
  696. package/.next-prod/static/chunks/app/api/scheduled-tasks/route-b56c0b18a3b4d026.js +0 -1
  697. package/.next-prod/static/chunks/app/api/services/config/route-b56c0b18a3b4d026.js +0 -1
  698. package/.next-prod/static/chunks/app/api/services/scripts/route-b56c0b18a3b4d026.js +0 -1
  699. package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-b56c0b18a3b4d026.js +0 -1
  700. package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-b56c0b18a3b4d026.js +0 -1
  701. package/.next-prod/static/chunks/app/api/session/[sessionId]/turn/route-b56c0b18a3b4d026.js +0 -1
  702. package/.next-prod/static/chunks/app/api/session/user-messages/route-b56c0b18a3b4d026.js +0 -1
  703. package/.next-prod/static/chunks/app/api/session-by-path/route-b56c0b18a3b4d026.js +0 -1
  704. package/.next-prod/static/chunks/app/api/sessions/delegate/route-b56c0b18a3b4d026.js +0 -1
  705. package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-b56c0b18a3b4d026.js +0 -1
  706. package/.next-prod/static/chunks/app/api/sessions/projects/route-b56c0b18a3b4d026.js +0 -1
  707. package/.next-prod/static/chunks/app/api/sessions/route-b56c0b18a3b4d026.js +0 -1
  708. package/.next-prod/static/chunks/app/api/sessions/search/route-b56c0b18a3b4d026.js +0 -1
  709. package/.next-prod/static/chunks/app/api/sessions/status/route-b56c0b18a3b4d026.js +0 -1
  710. package/.next-prod/static/chunks/app/api/settings/route-b56c0b18a3b4d026.js +0 -1
  711. package/.next-prod/static/chunks/app/api/shutdown/route-b56c0b18a3b4d026.js +0 -1
  712. package/.next-prod/static/chunks/app/api/skills/[id]/route-b56c0b18a3b4d026.js +0 -1
  713. package/.next-prod/static/chunks/app/api/skills/content/route-b56c0b18a3b4d026.js +0 -1
  714. package/.next-prod/static/chunks/app/api/skills/route-b56c0b18a3b4d026.js +0 -1
  715. package/.next-prod/static/chunks/app/api/snapshots/blob/route-b56c0b18a3b4d026.js +0 -1
  716. package/.next-prod/static/chunks/app/api/snapshots/diff/route-b56c0b18a3b4d026.js +0 -1
  717. package/.next-prod/static/chunks/app/api/snapshots/route-b56c0b18a3b4d026.js +0 -1
  718. package/.next-prod/static/chunks/app/api/terminal/aliases/route-b56c0b18a3b4d026.js +0 -1
  719. package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-b56c0b18a3b4d026.js +0 -1
  720. package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-b56c0b18a3b4d026.js +0 -1
  721. package/.next-prod/static/chunks/app/api/terminal/env/route-b56c0b18a3b4d026.js +0 -1
  722. package/.next-prod/static/chunks/app/api/terminal/history/route-b56c0b18a3b4d026.js +0 -1
  723. package/.next-prod/static/chunks/app/api/update/route-b56c0b18a3b4d026.js +0 -1
  724. package/.next-prod/static/chunks/app/api/update-state/route-b56c0b18a3b4d026.js +0 -1
  725. package/.next-prod/static/chunks/app/api/version/route-b56c0b18a3b4d026.js +0 -1
  726. package/.next-prod/static/chunks/app/apps/[...path]/route-b56c0b18a3b4d026.js +0 -1
  727. package/.next-prod/static/chunks/app/layout-5e8ca15dabb4d8c2.js +0 -1
  728. package/.next-prod/static/chunks/app/m/page-8f4f88b0d67c4181.js +0 -1
  729. package/.next-prod/static/chunks/app/manifest.webmanifest/route-b56c0b18a3b4d026.js +0 -1
  730. package/.next-prod/static/chunks/app/page-eb7a11e6dd6a9e94.js +0 -1
  731. package/.next-prod/static/chunks/app/project/page-eb7a11e6dd6a9e94.js +0 -1
  732. package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-b56c0b18a3b4d026.js +0 -1
  733. package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-b56c0b18a3b4d026.js +0 -1
  734. package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-b56c0b18a3b4d026.js +0 -1
  735. package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-b56c0b18a3b4d026.js +0 -1
  736. package/.next-prod/static/css/08c892de6d5e2335.css +0 -1
  737. package/.next-prod/static/mTTTlFslhC7zzHMDXGNOW/_buildManifest.js +0 -1
  738. package/bin/cock.mjs +0 -239
  739. /package/.next-prod/static/{mTTTlFslhC7zzHMDXGNOW → yEJ9Z5Bjv9ti4WeYINfCs}/_ssgManifest.js +0 -0
@@ -6912,67 +6912,67 @@ var Or = (self, that) => {
6912
6912
  });
6913
6913
  return error48;
6914
6914
  };
6915
- var InvalidData = (path2, message, options = {
6915
+ var InvalidData = (path5, message, options = {
6916
6916
  pathDelim: "."
6917
6917
  }) => {
6918
6918
  const error48 = Object.create(proto2);
6919
6919
  error48._op = OP_INVALID_DATA;
6920
- error48.path = path2;
6920
+ error48.path = path5;
6921
6921
  error48.message = message;
6922
6922
  Object.defineProperty(error48, "toString", {
6923
6923
  enumerable: false,
6924
6924
  value() {
6925
- const path3 = pipe(this.path, join(options.pathDelim));
6926
- return `(Invalid data at ${path3}: "${this.message}")`;
6925
+ const path6 = pipe(this.path, join(options.pathDelim));
6926
+ return `(Invalid data at ${path6}: "${this.message}")`;
6927
6927
  }
6928
6928
  });
6929
6929
  return error48;
6930
6930
  };
6931
- var MissingData = (path2, message, options = {
6931
+ var MissingData = (path5, message, options = {
6932
6932
  pathDelim: "."
6933
6933
  }) => {
6934
6934
  const error48 = Object.create(proto2);
6935
6935
  error48._op = OP_MISSING_DATA;
6936
- error48.path = path2;
6936
+ error48.path = path5;
6937
6937
  error48.message = message;
6938
6938
  Object.defineProperty(error48, "toString", {
6939
6939
  enumerable: false,
6940
6940
  value() {
6941
- const path3 = pipe(this.path, join(options.pathDelim));
6942
- return `(Missing data at ${path3}: "${this.message}")`;
6941
+ const path6 = pipe(this.path, join(options.pathDelim));
6942
+ return `(Missing data at ${path6}: "${this.message}")`;
6943
6943
  }
6944
6944
  });
6945
6945
  return error48;
6946
6946
  };
6947
- var SourceUnavailable = (path2, message, cause3, options = {
6947
+ var SourceUnavailable = (path5, message, cause3, options = {
6948
6948
  pathDelim: "."
6949
6949
  }) => {
6950
6950
  const error48 = Object.create(proto2);
6951
6951
  error48._op = OP_SOURCE_UNAVAILABLE;
6952
- error48.path = path2;
6952
+ error48.path = path5;
6953
6953
  error48.message = message;
6954
6954
  error48.cause = cause3;
6955
6955
  Object.defineProperty(error48, "toString", {
6956
6956
  enumerable: false,
6957
6957
  value() {
6958
- const path3 = pipe(this.path, join(options.pathDelim));
6959
- return `(Source unavailable at ${path3}: "${this.message}")`;
6958
+ const path6 = pipe(this.path, join(options.pathDelim));
6959
+ return `(Source unavailable at ${path6}: "${this.message}")`;
6960
6960
  }
6961
6961
  });
6962
6962
  return error48;
6963
6963
  };
6964
- var Unsupported = (path2, message, options = {
6964
+ var Unsupported = (path5, message, options = {
6965
6965
  pathDelim: "."
6966
6966
  }) => {
6967
6967
  const error48 = Object.create(proto2);
6968
6968
  error48._op = OP_UNSUPPORTED;
6969
- error48.path = path2;
6969
+ error48.path = path5;
6970
6970
  error48.message = message;
6971
6971
  Object.defineProperty(error48, "toString", {
6972
6972
  enumerable: false,
6973
6973
  value() {
6974
- const path3 = pipe(this.path, join(options.pathDelim));
6975
- return `(Unsupported operation at ${path3}: "${this.message}")`;
6974
+ const path6 = pipe(this.path, join(options.pathDelim));
6975
+ return `(Unsupported operation at ${path6}: "${this.message}")`;
6976
6976
  }
6977
6977
  });
6978
6978
  return error48;
@@ -7087,9 +7087,9 @@ var isMissingDataOnly = (self) => reduceWithContext2(self, void 0, IsMissingData
7087
7087
  var empty17 = {
7088
7088
  _tag: "Empty"
7089
7089
  };
7090
- var patch5 = /* @__PURE__ */ dual(2, (path2, patch9) => {
7090
+ var patch5 = /* @__PURE__ */ dual(2, (path5, patch9) => {
7091
7091
  let input = of3(patch9);
7092
- let output = path2;
7092
+ let output = path5;
7093
7093
  while (isCons(input)) {
7094
7094
  const patch10 = input.head;
7095
7095
  switch (patch10._tag) {
@@ -7156,7 +7156,7 @@ var make20 = (options) => ({
7156
7156
  var makeFlat = (options) => ({
7157
7157
  [FlatConfigProviderTypeId]: FlatConfigProviderTypeId,
7158
7158
  patch: options.patch,
7159
- load: (path2, config3, split3 = true) => options.load(path2, config3, split3),
7159
+ load: (path5, config3, split3 = true) => options.load(path5, config3, split3),
7160
7160
  enumerateChildren: options.enumerateChildren
7161
7161
  });
7162
7162
  var fromFlat = (flat) => make20({
@@ -7174,29 +7174,29 @@ var fromEnv = (options) => {
7174
7174
  pathDelim: "_",
7175
7175
  seqDelim: ","
7176
7176
  }, options);
7177
- const makePathString = (path2) => pipe(path2, join(pathDelim));
7177
+ const makePathString = (path5) => pipe(path5, join(pathDelim));
7178
7178
  const unmakePathString = (pathString) => pathString.split(pathDelim);
7179
7179
  const getEnv = () => typeof process !== "undefined" && "env" in process && typeof process.env === "object" ? process.env : {};
7180
- const load = (path2, primitive3, split3 = true) => {
7181
- const pathString = makePathString(path2);
7180
+ const load = (path5, primitive3, split3 = true) => {
7181
+ const pathString = makePathString(path5);
7182
7182
  const current2 = getEnv();
7183
7183
  const valueOpt = pathString in current2 ? some2(current2[pathString]) : none2();
7184
- return pipe(valueOpt, mapError(() => MissingData(path2, `Expected ${pathString} to exist in the process context`)), flatMap9((value) => parsePrimitive(value, path2, primitive3, seqDelim, split3)));
7184
+ return pipe(valueOpt, mapError(() => MissingData(path5, `Expected ${pathString} to exist in the process context`)), flatMap9((value) => parsePrimitive(value, path5, primitive3, seqDelim, split3)));
7185
7185
  };
7186
- const enumerateChildren = (path2) => sync(() => {
7186
+ const enumerateChildren = (path5) => sync(() => {
7187
7187
  const current2 = getEnv();
7188
7188
  const keys5 = Object.keys(current2);
7189
7189
  const keyPaths = keys5.map((value) => unmakePathString(value.toUpperCase()));
7190
7190
  const filteredKeyPaths = keyPaths.filter((keyPath) => {
7191
- for (let i = 0; i < path2.length; i++) {
7192
- const pathComponent = pipe(path2, unsafeGet(i));
7191
+ for (let i = 0; i < path5.length; i++) {
7192
+ const pathComponent = pipe(path5, unsafeGet(i));
7193
7193
  const currentElement = keyPath[i];
7194
7194
  if (currentElement === void 0 || pathComponent !== currentElement) {
7195
7195
  return false;
7196
7196
  }
7197
7197
  }
7198
7198
  return true;
7199
- }).flatMap((keyPath) => keyPath.slice(path2.length, path2.length + 1));
7199
+ }).flatMap((keyPath) => keyPath.slice(path5.length, path5.length + 1));
7200
7200
  return fromIterable6(filteredKeyPaths);
7201
7201
  });
7202
7202
  return fromFlat(makeFlat({
@@ -7212,17 +7212,17 @@ var extend = (leftDef, rightDef, left3, right3) => {
7212
7212
  const rightExtension = concat(right3, rightPad);
7213
7213
  return [leftExtension, rightExtension];
7214
7214
  };
7215
- var appendConfigPath = (path2, config3) => {
7215
+ var appendConfigPath = (path5, config3) => {
7216
7216
  let op = config3;
7217
7217
  if (op._tag === "Nested") {
7218
- const out = path2.slice();
7218
+ const out = path5.slice();
7219
7219
  while (op._tag === "Nested") {
7220
7220
  out.push(op.name);
7221
7221
  op = op.config;
7222
7222
  }
7223
7223
  return out;
7224
7224
  }
7225
- return path2;
7225
+ return path5;
7226
7226
  };
7227
7227
  var fromFlatLoop = (flat, prefix, config3, split3) => {
7228
7228
  const op = config3;
@@ -7298,9 +7298,9 @@ var fromFlatLoop = (flat, prefix, config3, split3) => {
7298
7298
  return fail2(right3.left);
7299
7299
  }
7300
7300
  if (isRight2(left3) && isRight2(right3)) {
7301
- const path2 = pipe(prefix, join("."));
7302
- const fail20 = fromFlatLoopFail(prefix, path2);
7303
- const [lefts, rights] = extend(fail20, fail20, pipe(left3.right, map3(right2)), pipe(right3.right, map3(right2)));
7301
+ const path5 = pipe(prefix, join("."));
7302
+ const fail21 = fromFlatLoopFail(prefix, path5);
7303
+ const [lefts, rights] = extend(fail21, fail21, pipe(left3.right, map3(right2)), pipe(right3.right, map3(right2)));
7304
7304
  return pipe(lefts, zip(rights), forEachSequential(([left4, right4]) => pipe(zip2(left4, right4), map10(([left5, right5]) => op.zip(left5, right5)))));
7305
7305
  }
7306
7306
  throw new Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues");
@@ -7308,19 +7308,19 @@ var fromFlatLoop = (flat, prefix, config3, split3) => {
7308
7308
  }
7309
7309
  }
7310
7310
  };
7311
- var fromFlatLoopFail = (prefix, path2) => (index) => left2(MissingData(prefix, `The element at index ${index} in a sequence at path "${path2}" was missing`));
7311
+ var fromFlatLoopFail = (prefix, path5) => (index) => left2(MissingData(prefix, `The element at index ${index} in a sequence at path "${path5}" was missing`));
7312
7312
  var splitPathString = (text, delim) => {
7313
7313
  const split3 = text.split(new RegExp(`\\s*${escape(delim)}\\s*`));
7314
7314
  return split3;
7315
7315
  };
7316
- var parsePrimitive = (text, path2, primitive3, delimiter2, split3) => {
7316
+ var parsePrimitive = (text, path5, primitive3, delimiter2, split3) => {
7317
7317
  if (!split3) {
7318
7318
  return pipe(primitive3.parse(text), mapBoth2({
7319
- onFailure: prefixed(path2),
7319
+ onFailure: prefixed(path5),
7320
7320
  onSuccess: of
7321
7321
  }));
7322
7322
  }
7323
- return pipe(splitPathString(text, delimiter2), forEachSequential((char) => primitive3.parse(char.trim())), mapError(prefixed(path2)));
7323
+ return pipe(splitPathString(text, delimiter2), forEachSequential((char) => primitive3.parse(char.trim())), mapError(prefixed(path5)));
7324
7324
  };
7325
7325
  var transpose = (array7) => {
7326
7326
  return Object.keys(array7[0]).map((column) => array7.map((row) => row[column]));
@@ -9625,21 +9625,21 @@ var tryPromise = (arg) => {
9625
9625
  evaluate3 = arg.try;
9626
9626
  catcher = arg.catch;
9627
9627
  }
9628
- const fail20 = (e) => catcher ? failSync(() => catcher(e)) : fail2(new UnknownException(e, "An unknown error occurred in Effect.tryPromise"));
9628
+ const fail21 = (e) => catcher ? failSync(() => catcher(e)) : fail2(new UnknownException(e, "An unknown error occurred in Effect.tryPromise"));
9629
9629
  if (evaluate3.length >= 1) {
9630
9630
  return async_((resolve3, signal) => {
9631
9631
  try {
9632
- evaluate3(signal).then((a) => resolve3(succeed(a)), (e) => resolve3(fail20(e)));
9632
+ evaluate3(signal).then((a) => resolve3(succeed(a)), (e) => resolve3(fail21(e)));
9633
9633
  } catch (e) {
9634
- resolve3(fail20(e));
9634
+ resolve3(fail21(e));
9635
9635
  }
9636
9636
  });
9637
9637
  }
9638
9638
  return async_((resolve3) => {
9639
9639
  try {
9640
- evaluate3().then((a) => resolve3(succeed(a)), (e) => resolve3(fail20(e)));
9640
+ evaluate3().then((a) => resolve3(succeed(a)), (e) => resolve3(fail21(e)));
9641
9641
  } catch (e) {
9642
- resolve3(fail20(e));
9642
+ resolve3(fail21(e));
9643
9643
  }
9644
9644
  });
9645
9645
  };
@@ -27344,11 +27344,11 @@ var date = (name) => {
27344
27344
  return name === void 0 ? config3 : nested2(config3, name);
27345
27345
  };
27346
27346
  var fail17 = (message) => {
27347
- const fail20 = Object.create(proto13);
27348
- fail20._tag = OP_FAIL2;
27349
- fail20.message = message;
27350
- fail20.parse = () => left2(Unsupported([], message));
27351
- return fail20;
27347
+ const fail21 = Object.create(proto13);
27348
+ fail21._tag = OP_FAIL2;
27349
+ fail21.message = message;
27350
+ fail21.parse = () => left2(Unsupported([], message));
27351
+ return fail21;
27352
27352
  };
27353
27353
  var number4 = (name) => {
27354
27354
  const config3 = primitive("a number property", (text) => {
@@ -28645,14 +28645,14 @@ import { execSync } from "child_process";
28645
28645
 
28646
28646
  // packages/shared/utils/src/encodePath.ts
28647
28647
  var CLAUDE_ENCODED_MAX_LEN = 200;
28648
- function claudePathHash(path2) {
28648
+ function claudePathHash(path5) {
28649
28649
  let h = 0;
28650
- for (let i = 0; i < path2.length; i++) h = (h << 5) - h + path2.charCodeAt(i) | 0;
28650
+ for (let i = 0; i < path5.length; i++) h = (h << 5) - h + path5.charCodeAt(i) | 0;
28651
28651
  return Math.abs(h).toString(36);
28652
28652
  }
28653
- function encodePath(path2) {
28654
- const encoded = path2.replace(/[^a-zA-Z0-9]/g, "-");
28655
- return encoded.length <= CLAUDE_ENCODED_MAX_LEN ? encoded : `${encoded.slice(0, CLAUDE_ENCODED_MAX_LEN)}-${claudePathHash(path2)}`;
28653
+ function encodePath(path5) {
28654
+ const encoded = path5.replace(/[^a-zA-Z0-9]/g, "-");
28655
+ return encoded.length <= CLAUDE_ENCODED_MAX_LEN ? encoded : `${encoded.slice(0, CLAUDE_ENCODED_MAX_LEN)}-${claudePathHash(path5)}`;
28656
28656
  }
28657
28657
 
28658
28658
  // packages/shared/utils/src/homePath.ts
@@ -28675,12 +28675,15 @@ var NOTE_FILE = join4(COCKPIT_DIR, "note.md");
28675
28675
  var SCHEDULED_TASKS_FILE = join4(COCKPIT_DIR, "scheduled-tasks.json");
28676
28676
  var SETTINGS_FILE = join4(COCKPIT_DIR, "settings.json");
28677
28677
  var SKILLS_FILE = join4(COCKPIT_DIR, "skills.json");
28678
+ var BOTS_FILE = join4(COCKPIT_DIR, "bot.json");
28679
+ var BOTS_DIR = join4(COCKPIT_DIR, "bots");
28678
28680
  var CODEX_SESSION_INDEX_FILE = join4(COCKPIT_DIR, "codex-session-index.json");
28679
28681
  var HTML_APPS_FILE = join4(COCKPIT_DIR, "html.json");
28680
28682
  var REVIEW_DIR = join4(COCKPIT_DIR, "review");
28681
28683
  var REVIEW_SIGNAL_FILE = join4(REVIEW_DIR, "_signal");
28682
28684
  var APPS_DIR = join4(process.env.COCKPIT_ROOT || process.cwd(), "apps");
28683
28685
  var BUILTIN_SKILLS_SRC_DIR = join4(process.env.COCKPIT_ROOT || process.cwd(), "skills");
28686
+ var BUILTIN_BOTS_SRC_DIR = join4(process.env.COCKPIT_ROOT || process.cwd(), "bots");
28684
28687
  var CLAUDE_DIR = join4(HOME_DIR, ".claude");
28685
28688
  var CLAUDE_PROJECTS_DIR = join4(CLAUDE_DIR, "projects");
28686
28689
  var DEEPSEEK_DIR = join4(COCKPIT_DIR, "deepseek");
@@ -28938,6 +28941,22 @@ async function readJsonFile(filePath, defaultValue) {
28938
28941
  return defaultValue;
28939
28942
  }
28940
28943
  }
28944
+ async function readJsonFileForUpdate(filePath, defaultValue) {
28945
+ let content;
28946
+ try {
28947
+ content = await readFile(filePath, "utf-8");
28948
+ } catch (err) {
28949
+ if (err?.code === "ENOENT") return defaultValue;
28950
+ throw err;
28951
+ }
28952
+ try {
28953
+ return JSON.parse(content);
28954
+ } catch (err) {
28955
+ throw new Error(
28956
+ `${filePath} is not valid JSON, refusing to overwrite it: ${err instanceof Error ? err.message : String(err)}`
28957
+ );
28958
+ }
28959
+ }
28941
28960
  async function writeJsonFile(filePath, data) {
28942
28961
  await ensureParentDir(filePath);
28943
28962
  await writeFile(filePath, JSON.stringify(data, null, 2), "utf-8");
@@ -28960,7 +28979,7 @@ function withFileLock(filePath, fn2) {
28960
28979
  }
28961
28980
  function mutateJsonFile(filePath, defaultValue, mutate5) {
28962
28981
  return withFileLock(filePath, async () => {
28963
- const current2 = await readJsonFile(filePath, defaultValue);
28982
+ const current2 = await readJsonFileForUpdate(filePath, defaultValue);
28964
28983
  const next4 = await mutate5(current2);
28965
28984
  await writeJsonFile(filePath, next4);
28966
28985
  return next4;
@@ -28999,7 +29018,7 @@ function getUsageUpdateOutputTokens(message) {
28999
29018
  const outputTokens = message.output_tokens;
29000
29019
  return typeof outputTokens === "number" && Number.isFinite(outputTokens) ? Math.max(0, Math.round(outputTokens)) : null;
29001
29020
  }
29002
- function startRun(key, cwd, promptText, runId) {
29021
+ function startRun(key, cwd, promptText, runId, engine) {
29003
29022
  const prev = registry.get(key);
29004
29023
  if (prev?.status === "running") return false;
29005
29024
  const prevSeq = prev?.seq ?? seqByKey.get(key) ?? 0;
@@ -29016,6 +29035,7 @@ function startRun(key, cwd, promptText, runId) {
29016
29035
  events: [],
29017
29036
  startedAt,
29018
29037
  ...runId ? { runId } : {},
29038
+ ...engine ? { engine } : {},
29019
29039
  updatedAt: startedAt
29020
29040
  });
29021
29041
  if (promptText) {
@@ -29086,7 +29106,7 @@ function getRunSessionId(key) {
29086
29106
  function getRunInfo(key) {
29087
29107
  const r = registry.get(key);
29088
29108
  if (!r) return null;
29089
- return { cwd: r.cwd, sessionId: r.sessionId ?? null };
29109
+ return { cwd: r.cwd, sessionId: r.sessionId ?? null, engine: r.engine ?? null };
29090
29110
  }
29091
29111
  function setRunAbort(key, abort) {
29092
29112
  const r = registry.get(key);
@@ -29125,6 +29145,41 @@ function normalizeBase(raw) {
29125
29145
  async function readOllamaStoredConfig() {
29126
29146
  return readJsonFile(OLLAMA_CONFIG_FILE, {});
29127
29147
  }
29148
+ async function writeOllamaStoredConfig(patch9) {
29149
+ return mutateJsonFile(OLLAMA_CONFIG_FILE, {}, (cur) => {
29150
+ const next4 = { ...cur };
29151
+ if (patch9.baseUrl !== void 0) {
29152
+ const v = patch9.baseUrl.trim();
29153
+ if (v) next4.baseUrl = v;
29154
+ else delete next4.baseUrl;
29155
+ }
29156
+ if (patch9.apiKey !== void 0) {
29157
+ const v = patch9.apiKey.trim();
29158
+ if (v) next4.apiKey = v;
29159
+ else delete next4.apiKey;
29160
+ }
29161
+ if (patch9.lastModel !== void 0) {
29162
+ const v = patch9.lastModel.trim();
29163
+ if (v) next4.lastModel = v;
29164
+ else delete next4.lastModel;
29165
+ }
29166
+ return next4;
29167
+ });
29168
+ }
29169
+ async function readOllamaLastModel() {
29170
+ return (await readOllamaStoredConfig()).lastModel?.trim() || void 0;
29171
+ }
29172
+ async function rememberOllamaLastModel(model) {
29173
+ const v = model.trim();
29174
+ if (!v) return;
29175
+ if ((await readOllamaStoredConfig()).lastModel === v) return;
29176
+ await writeOllamaStoredConfig({ lastModel: v });
29177
+ }
29178
+ async function resolveOllamaBaseURL() {
29179
+ const cfg = await readOllamaStoredConfig();
29180
+ const raw = cfg.baseUrl?.trim() || process.env.OLLAMA_BASE_URL || DEFAULT_BASE;
29181
+ return normalizeBase(raw);
29182
+ }
29128
29183
  async function resolveOllamaConnection() {
29129
29184
  const cfg = await readOllamaStoredConfig();
29130
29185
  const baseUrl = normalizeBase(
@@ -29145,12 +29200,16 @@ var NEXT_INJECTED_ENV_KEYS = [
29145
29200
  "NEXT_DEPLOYMENT_ID",
29146
29201
  "TURBOPACK"
29147
29202
  ];
29203
+ var HOST_ONLY_ENV_KEYS = [
29204
+ ...NEXT_INJECTED_ENV_KEYS,
29205
+ "PORT"
29206
+ ];
29148
29207
  function sanitizedSpawnEnv(overrides = {}, base = process.env) {
29149
29208
  const out = {};
29150
29209
  for (const [key, value] of Object.entries(base)) {
29151
29210
  if (value !== void 0) out[key] = value;
29152
29211
  }
29153
- for (const key of NEXT_INJECTED_ENV_KEYS) delete out[key];
29212
+ for (const key of HOST_ONLY_ENV_KEYS) delete out[key];
29154
29213
  for (const [key, value] of Object.entries(overrides)) {
29155
29214
  if (value === void 0) delete out[key];
29156
29215
  else out[key] = value;
@@ -29169,6 +29228,14 @@ function estimateOutputUnits(text) {
29169
29228
  return Math.max(1, Math.ceil(cjk + other / 4));
29170
29229
  }
29171
29230
 
29231
+ // packages/feature/agent/src/shared/botSession.ts
29232
+ var BOT_TASK_LINE = /^Task:\s*@([a-z0-9][a-z0-9-]{0,63})(?=[\s:]|$)/;
29233
+ var detectBotName = (firstUserMessage) => {
29234
+ if (!firstUserMessage) return void 0;
29235
+ const firstLine = firstUserMessage.trimStart().split("\n", 1)[0];
29236
+ return BOT_TASK_LINE.exec(firstLine)?.[1];
29237
+ };
29238
+
29172
29239
  // packages/feature/agent/src/server/state/globalState.ts
29173
29240
  import { createReadStream, existsSync as existsSync2, statSync as statSync2 } from "fs";
29174
29241
  import { createInterface } from "readline";
@@ -29305,8 +29372,8 @@ var CLAUDE_STYLE_PATHS = [
29305
29372
  ];
29306
29373
  function findClaudeStylePath(cwd, sessionId) {
29307
29374
  for (const resolve3 of CLAUDE_STYLE_PATHS) {
29308
- const path2 = resolve3(cwd, sessionId);
29309
- if (existsSync2(path2)) return path2;
29375
+ const path5 = resolve3(cwd, sessionId);
29376
+ if (existsSync2(path5)) return path5;
29310
29377
  }
29311
29378
  return null;
29312
29379
  }
@@ -29365,7 +29432,13 @@ async function updateGlobalState(cwd, sessionId, status3, title, lastUserMessage
29365
29432
  lastUserMessage: truncate(lastUserMessage || existing?.lastUserMessage),
29366
29433
  // Carried like title/lastUserMessage: status-only updates (the client's
29367
29434
  // /api/global-state PATCH) pass no engine and must not erase it.
29368
- engine: engine || existing?.engine
29435
+ engine: engine || existing?.engine,
29436
+ // A Bot names itself in the session's FIRST message, so only the first
29437
+ // write of a session can see it — by the second, `lastUserMessage` has
29438
+ // moved on. Hence: derive on insert, carry forward on every update. A
29439
+ // session that predates this field stays unmarked here and is marked from
29440
+ // disk by getSessionPreview instead, which is the slower but complete path.
29441
+ bot: existed ? existing?.bot : detectBotName(lastUserMessage)
29369
29442
  };
29370
29443
  if (existingIndex >= 0) {
29371
29444
  state.sessions[existingIndex] = newSession;
@@ -29465,13 +29538,15 @@ async function getSessionContent(cwd, sessionId) {
29465
29538
  async function getSessionPreview(cwd, sessionId, opts) {
29466
29539
  const { aiTitle, summary: summary5, messages } = await getSessionContent(cwd, sessionId);
29467
29540
  const title = generateTitle(aiTitle, summary5, messages);
29541
+ const bot = detectBotName(messages[0]);
29468
29542
  const lastUserMessage = messages[messages.length - 1];
29469
29543
  const searchText = opts?.includeSearchText ? [summary5, ...messages].join("\n").toLowerCase() : "";
29470
29544
  if (messages.length <= SUMMARY_THRESHOLD) {
29471
- return { title, lastUserMessage, firstMessages: messages.map((m) => truncate(m)), lastMessages: [], searchText };
29545
+ return { title, bot, lastUserMessage, firstMessages: messages.map((m) => truncate(m)), lastMessages: [], searchText };
29472
29546
  }
29473
29547
  return {
29474
29548
  title,
29549
+ bot,
29475
29550
  lastUserMessage,
29476
29551
  firstMessages: messages.slice(0, SUMMARY_HEAD).map((m) => truncate(m)),
29477
29552
  lastMessages: messages.slice(-SUMMARY_TAIL).map((m) => truncate(m)),
@@ -29514,6 +29589,9 @@ async function getGlobalSessionsSnapshot(limit = 15) {
29514
29589
  // (preview degrades to UNTITLED_SESSION). Mirrors /api/global-state.
29515
29590
  title: preview.title !== UNTITLED_SESSION ? preview.title : session.title ?? preview.title,
29516
29591
  lastUserMessage: preview.lastUserMessage ?? session.lastUserMessage,
29592
+ // Disk wins: it reads the true first message, while the persisted value
29593
+ // is only there for sessions this snapshot never opens (the running ones).
29594
+ bot: preview.bot ?? session.bot,
29517
29595
  firstMessages: preview.firstMessages,
29518
29596
  lastMessages: preview.lastMessages
29519
29597
  };
@@ -30084,6 +30162,11 @@ var DelegationService = Context_exports.GenericTag(
30084
30162
  "@cockpit/DelegationService"
30085
30163
  );
30086
30164
 
30165
+ // packages/shared/effect-services/src/botRegistry.ts
30166
+ var BotRegistryService = Context_exports.GenericTag(
30167
+ "@cockpit/BotRegistryService"
30168
+ );
30169
+
30087
30170
  // packages/feature/console/src/effect/pgLive.ts
30088
30171
  var { Pool } = pg;
30089
30172
  var handleAsync = (op, f) => Effect_exports.tryPromise({
@@ -30526,10 +30609,10 @@ function serializeValue(val) {
30526
30609
  };
30527
30610
  }
30528
30611
  if (val && typeof val === "object" && "segments" in val) {
30529
- const path2 = val;
30612
+ const path5 = val;
30530
30613
  return {
30531
30614
  _type: "path",
30532
- segments: path2.segments.map((s) => ({
30615
+ segments: path5.segments.map((s) => ({
30533
30616
  start: serializeValue(s.start),
30534
30617
  relationship: serializeValue(s.relationship),
30535
30618
  end: serializeValue(s.end)
@@ -31281,10 +31364,10 @@ var snapshotOnce = (snapshotsRoot, maxFileBytes, trigger, kind) => Effect_export
31281
31364
  const addPaths = [];
31282
31365
  const rmPaths = [];
31283
31366
  for (const e of entries2) {
31284
- const path2 = e.slice(3);
31285
- if (!path2) continue;
31286
- if (e[0] === "D" || e[1] === "D") rmPaths.push(path2);
31287
- else addPaths.push(path2);
31367
+ const path5 = e.slice(3);
31368
+ if (!path5) continue;
31369
+ if (e[0] === "D" || e[1] === "D") rmPaths.push(path5);
31370
+ else addPaths.push(path5);
31288
31371
  }
31289
31372
  const sizes = yield* Effect_exports.all(
31290
31373
  addPaths.map(
@@ -31386,15 +31469,15 @@ var listByToolIdsImpl = (snapshotsRoot, cwd, toolIds, sessionKey) => Effect_expo
31386
31469
  (c) => !!c && !!c.toolId && wanted.has(c.toolId) && (!sessionKey || c.sessionKey === sessionKey)
31387
31470
  );
31388
31471
  }).pipe(Effect_exports.withSpan("snapshot.listByToolIds", { attributes: { cwd } }));
31389
- var showFile = (repoDir, cwd, rev, path2) => runGit(repoDir, cwd, ["show", `${rev}:${path2}`]).pipe(
31472
+ var showFile = (repoDir, cwd, rev, path5) => runGit(repoDir, cwd, ["show", `${rev}:${path5}`]).pipe(
31390
31473
  Effect_exports.map((r) => r.code === 0 ? r.stdout : null),
31391
31474
  Effect_exports.orElseSucceed(() => null)
31392
31475
  );
31393
- var gitShowBytes = (repoDir, cwd, rev, path2) => Effect_exports.tryPromise({
31476
+ var gitShowBytes = (repoDir, cwd, rev, path5) => Effect_exports.tryPromise({
31394
31477
  try: () => new Promise((resolve3, reject) => {
31395
31478
  execFile(
31396
31479
  "git",
31397
- ["show", `${rev}:${path2}`],
31480
+ ["show", `${rev}:${path5}`],
31398
31481
  {
31399
31482
  env: {
31400
31483
  ...process.env,
@@ -31414,7 +31497,7 @@ var gitShowBytes = (repoDir, cwd, rev, path2) => Effect_exports.tryPromise({
31414
31497
  );
31415
31498
  }),
31416
31499
  // A miss is ordinary: the path simply doesn't exist at that revision.
31417
- catch: () => new NotFoundError({ resource: "snapshot-blob", id: `${rev}:${path2}` })
31500
+ catch: () => new NotFoundError({ resource: "snapshot-blob", id: `${rev}:${path5}` })
31418
31501
  });
31419
31502
  var blobImpl = (snapshotsRoot, cwd, rev, file2) => Effect_exports.gen(function* () {
31420
31503
  if (!/^[0-9a-f]{6,40}$/i.test(rev)) {
@@ -31430,29 +31513,7 @@ var blobImpl = (snapshotsRoot, cwd, rev, file2) => Effect_exports.gen(function*
31430
31513
  const bytes = yield* gitShowBytes(repoDir, cwd, rev, file2);
31431
31514
  return new Uint8Array(bytes);
31432
31515
  }).pipe(Effect_exports.withSpan("snapshot.blob", { attributes: { cwd, rev } }));
31433
- var diffImpl = (snapshotsRoot, cwd, commitHash) => Effect_exports.gen(function* () {
31434
- if (!/^[0-9a-f]{6,40}$/i.test(commitHash)) {
31435
- return yield* Effect_exports.fail(new ValidationError({ field: "commit", reason: "invalid commit hash" }));
31436
- }
31437
- const repoDir = yield* resolveRepoDir(snapshotsRoot, cwd);
31438
- const repoExists = yield* fsTry(
31439
- "stat HEAD",
31440
- () => stat(join5(repoDir, "HEAD")).then(() => true)
31441
- ).pipe(Effect_exports.orElseSucceed(() => false));
31442
- if (!repoExists) {
31443
- return yield* Effect_exports.fail(new NotFoundError({ resource: "snapshot-repo", id: cwd }));
31444
- }
31445
- const log3 = yield* runGitOk(repoDir, cwd, [
31446
- "log",
31447
- "-1",
31448
- "--format=%x1e%H%x1f%P%x1f%ct%x1f%B",
31449
- commitHash
31450
- ]);
31451
- const commit3 = commitFromLogRecord(log3.stdout.split("").filter(Boolean)[0] ?? "");
31452
- if (!commit3) {
31453
- return yield* Effect_exports.fail(new ValidationError({ field: "commit", reason: "commit not found" }));
31454
- }
31455
- const base = commit3.parent ?? EMPTY_TREE;
31516
+ var collectRangeFiles = (repoDir, cwd, base, head6) => Effect_exports.gen(function* () {
31456
31517
  const nameStatus = yield* runGitOk(repoDir, cwd, [
31457
31518
  "diff-tree",
31458
31519
  "-r",
@@ -31460,7 +31521,7 @@ var diffImpl = (snapshotsRoot, cwd, commitHash) => Effect_exports.gen(function*
31460
31521
  "--no-renames",
31461
31522
  "--name-status",
31462
31523
  base,
31463
- commit3.hash
31524
+ head6
31464
31525
  ]);
31465
31526
  const numstat = yield* runGitOk(repoDir, cwd, [
31466
31527
  "diff-tree",
@@ -31469,7 +31530,7 @@ var diffImpl = (snapshotsRoot, cwd, commitHash) => Effect_exports.gen(function*
31469
31530
  "--no-renames",
31470
31531
  "--numstat",
31471
31532
  base,
31472
- commit3.hash
31533
+ head6
31473
31534
  ]);
31474
31535
  const binarySet = /* @__PURE__ */ new Set();
31475
31536
  const lineStats = /* @__PURE__ */ new Map();
@@ -31486,23 +31547,23 @@ var diffImpl = (snapshotsRoot, cwd, commitHash) => Effect_exports.gen(function*
31486
31547
  const files = [];
31487
31548
  for (let i = 0; i + 1 < tokens.length && files.length < MAX_DIFF_FILES; i += 2) {
31488
31549
  const st = tokens[i];
31489
- const path2 = tokens[i + 1];
31550
+ const path5 = tokens[i + 1];
31490
31551
  const status3 = st === "A" ? "added" : st === "D" ? "deleted" : "modified";
31491
- const binary = binarySet.has(path2);
31552
+ const binary = binarySet.has(path5);
31492
31553
  let oldContent = null;
31493
31554
  let newContent = null;
31494
31555
  if (!binary) {
31495
- if (status3 !== "added") oldContent = yield* showFile(repoDir, cwd, base, path2);
31496
- if (status3 !== "deleted") newContent = yield* showFile(repoDir, cwd, commit3.hash, path2);
31556
+ if (status3 !== "added") oldContent = yield* showFile(repoDir, cwd, base, path5);
31557
+ if (status3 !== "deleted") newContent = yield* showFile(repoDir, cwd, head6, path5);
31497
31558
  if ((oldContent?.length ?? 0) > MAX_DIFF_CONTENT_BYTES || (newContent?.length ?? 0) > MAX_DIFF_CONTENT_BYTES) {
31498
31559
  oldContent = null;
31499
31560
  newContent = null;
31500
31561
  }
31501
31562
  }
31502
- const stats = lineStats.get(path2);
31503
- const isImage = binary && isImagePath(path2);
31563
+ const stats = lineStats.get(path5);
31564
+ const isImage = binary && isImagePath(path5);
31504
31565
  files.push({
31505
- path: path2,
31566
+ path: path5,
31506
31567
  status: status3,
31507
31568
  binary,
31508
31569
  additions: stats?.additions ?? 0,
@@ -31511,17 +31572,75 @@ var diffImpl = (snapshotsRoot, cwd, commitHash) => Effect_exports.gen(function*
31511
31572
  newContent,
31512
31573
  ...isImage ? {
31513
31574
  isImage: true,
31514
- // A parentless day-root commit diffs against the empty tree, so
31515
- // every path comes back "added" — `base` is never handed out as
31516
- // a revision the client could ask for.
31575
+ // A range rooted at the empty tree reports every path as
31576
+ // "added", so EMPTY_TREE is never handed out as a revision the
31577
+ // client could ask for.
31517
31578
  oldRev: status3 === "added" ? null : base,
31518
- newRev: status3 === "deleted" ? null : commit3.hash
31579
+ newRev: status3 === "deleted" ? null : head6
31519
31580
  } : {}
31520
31581
  });
31521
31582
  }
31522
- const truncated = tokens.length / 2 > files.length;
31583
+ return { files, truncated: tokens.length / 2 > files.length };
31584
+ });
31585
+ var diffImpl = (snapshotsRoot, cwd, commitHash) => Effect_exports.gen(function* () {
31586
+ if (!/^[0-9a-f]{6,40}$/i.test(commitHash)) {
31587
+ return yield* Effect_exports.fail(new ValidationError({ field: "commit", reason: "invalid commit hash" }));
31588
+ }
31589
+ const repoDir = yield* resolveRepoDir(snapshotsRoot, cwd);
31590
+ const repoExists = yield* fsTry(
31591
+ "stat HEAD",
31592
+ () => stat(join5(repoDir, "HEAD")).then(() => true)
31593
+ ).pipe(Effect_exports.orElseSucceed(() => false));
31594
+ if (!repoExists) {
31595
+ return yield* Effect_exports.fail(new NotFoundError({ resource: "snapshot-repo", id: cwd }));
31596
+ }
31597
+ const log3 = yield* runGitOk(repoDir, cwd, [
31598
+ "log",
31599
+ "-1",
31600
+ "--format=%x1e%H%x1f%P%x1f%ct%x1f%B",
31601
+ commitHash
31602
+ ]);
31603
+ const commit3 = commitFromLogRecord(log3.stdout.split("").filter(Boolean)[0] ?? "");
31604
+ if (!commit3) {
31605
+ return yield* Effect_exports.fail(new ValidationError({ field: "commit", reason: "commit not found" }));
31606
+ }
31607
+ const base = commit3.parent ?? EMPTY_TREE;
31608
+ const { files, truncated } = yield* collectRangeFiles(repoDir, cwd, base, commit3.hash);
31523
31609
  return { commit: commit3, files, truncated };
31524
31610
  }).pipe(Effect_exports.withSpan("snapshot.diff", { attributes: { cwd, commit: commitHash } }));
31611
+ var rangeDiffImpl = (snapshotsRoot, cwd, base, head6) => Effect_exports.gen(function* () {
31612
+ if (base !== null && !/^[0-9a-f]{6,40}$/i.test(base)) {
31613
+ return yield* Effect_exports.fail(new ValidationError({ field: "base", reason: "invalid commit hash" }));
31614
+ }
31615
+ if (!/^[0-9a-f]{6,40}$/i.test(head6)) {
31616
+ return yield* Effect_exports.fail(new ValidationError({ field: "head", reason: "invalid commit hash" }));
31617
+ }
31618
+ const repoDir = yield* resolveRepoDir(snapshotsRoot, cwd);
31619
+ const repoExists = yield* fsTry(
31620
+ "stat HEAD",
31621
+ () => stat(join5(repoDir, "HEAD")).then(() => true)
31622
+ ).pipe(Effect_exports.orElseSucceed(() => false));
31623
+ if (!repoExists) {
31624
+ return yield* Effect_exports.fail(new NotFoundError({ resource: "snapshot-repo", id: cwd }));
31625
+ }
31626
+ const log3 = yield* runGitOk(repoDir, cwd, [
31627
+ "log",
31628
+ "-1",
31629
+ "--format=%x1e%H%x1f%P%x1f%ct%x1f%B",
31630
+ head6
31631
+ ]);
31632
+ const headCommit = commitFromLogRecord(log3.stdout.split("").filter(Boolean)[0] ?? "");
31633
+ if (!headCommit) {
31634
+ return yield* Effect_exports.fail(new ValidationError({ field: "head", reason: "commit not found" }));
31635
+ }
31636
+ const { files, truncated } = yield* collectRangeFiles(
31637
+ repoDir,
31638
+ cwd,
31639
+ base ?? EMPTY_TREE,
31640
+ headCommit.hash
31641
+ );
31642
+ return { base, head: headCommit, files, truncated };
31643
+ }).pipe(Effect_exports.withSpan("snapshot.rangeDiff", { attributes: { cwd, base: base ?? "empty-tree", head: head6 } }));
31525
31644
  var cleanupImpl = (snapshotsRoot, keepDays, repoTtlDays) => Effect_exports.gen(function* () {
31526
31645
  const dirs = yield* fsTry("readdir", () => readdir(snapshotsRoot)).pipe(
31527
31646
  Effect_exports.orElseSucceed(() => [])
@@ -31645,6 +31764,7 @@ var SnapshotServiceLive = Layer_exports.scoped(
31645
31764
  baseline: (cwd, sessionKey, provider) => snapshotOnce(snapshotsRoot, maxFileBytes, { cwd, sessionKey, provider }, "baseline"),
31646
31765
  listByToolIds: (cwd, toolIds, sessionKey) => listByToolIdsImpl(snapshotsRoot, cwd, toolIds, sessionKey),
31647
31766
  diff: (cwd, commitHash) => diffImpl(snapshotsRoot, cwd, commitHash),
31767
+ rangeDiff: (cwd, base, head6) => rangeDiffImpl(snapshotsRoot, cwd, base, head6),
31648
31768
  blob: (cwd, rev, file2) => blobImpl(snapshotsRoot, cwd, rev, file2),
31649
31769
  cleanup
31650
31770
  });
@@ -32410,7 +32530,7 @@ var patchChanges = (item) => {
32410
32530
  if (Array.isArray(raw)) {
32411
32531
  return raw.map((c) => ({ path: c?.path || "", kind: kindOf(c) }));
32412
32532
  }
32413
- return Object.entries(raw).map(([path2, v]) => ({ path: path2, kind: kindOf(v) }));
32533
+ return Object.entries(raw).map(([path5, v]) => ({ path: path5, kind: kindOf(v) }));
32414
32534
  };
32415
32535
  var patchResultText = (item) => {
32416
32536
  const cs = patchChanges(item);
@@ -32538,12 +32658,14 @@ async function parseTranscriptFile(filePath, page = {}) {
32538
32658
  }
32539
32659
  const allMessages = convertToChatMessages(rawMessages);
32540
32660
  const title = generateTitle(aiTitle, summary5, userTextMessages);
32661
+ const bot = detectBotName(userTextMessages[0]);
32541
32662
  const turns = splitTurns(allMessages);
32542
32663
  const totalTurns = turns.length;
32543
32664
  if (limit === void 0 && fromTurnIndex === void 0) {
32544
32665
  return {
32545
32666
  messages: allMessages,
32546
32667
  title,
32668
+ bot,
32547
32669
  usage: lastUsage,
32548
32670
  totalTurns,
32549
32671
  hasMore: false,
@@ -32555,7 +32677,7 @@ async function parseTranscriptFile(filePath, page = {}) {
32555
32677
  const hasMore = startIndex > 0;
32556
32678
  const selectedTurns = turns.slice(startIndex, endIndex);
32557
32679
  const messages = selectedTurns.flat();
32558
- return { messages, title, usage: lastUsage, totalTurns, hasMore, startTurnIndex: startIndex };
32680
+ return { messages, title, bot, usage: lastUsage, totalTurns, hasMore, startTurnIndex: startIndex };
32559
32681
  }
32560
32682
  function splitTurns(allMessages) {
32561
32683
  const turns = [];
@@ -32750,6 +32872,7 @@ async function parseCodexTranscriptFile(filePath) {
32750
32872
  const messages = [];
32751
32873
  let currentAssistant = null;
32752
32874
  let title = "Untitled Session";
32875
+ let firstUserText = null;
32753
32876
  let lastUsage;
32754
32877
  let msgCounter = 0;
32755
32878
  let toolSinceText = false;
@@ -32803,6 +32926,7 @@ async function parseCodexTranscriptFile(filePath) {
32803
32926
  });
32804
32927
  if (title === "Untitled Session") {
32805
32928
  title = (text || CODEX_IMAGE_ONLY_TEXT).slice(0, 80);
32929
+ firstUserText = text;
32806
32930
  }
32807
32931
  }
32808
32932
  if (payload.type === "message" && payload.role === "assistant") {
@@ -32980,7 +33104,7 @@ async function parseCodexTranscriptFile(filePath) {
32980
33104
  }
32981
33105
  }
32982
33106
  flushAssistant();
32983
- return { messages, title, usage: lastUsage };
33107
+ return { messages, title, bot: detectBotName(firstUserText), usage: lastUsage };
32984
33108
  }
32985
33109
 
32986
33110
  // packages/feature/agent/src/effect/sessionSearchLive.ts
@@ -33064,7 +33188,7 @@ var groupMatches = (matches, terms) => {
33064
33188
  }
33065
33189
  return byFile;
33066
33190
  };
33067
- var fsTry3 = (path2, op, fn2) => Effect_exports.tryPromise({ try: fn2, catch: (cause3) => new FSError({ path: path2, op, cause: cause3 }) });
33191
+ var fsTry3 = (path5, op, fn2) => Effect_exports.tryPromise({ try: fn2, catch: (cause3) => new FSError({ path: path5, op, cause: cause3 }) });
33068
33192
  var readJsonOr = (file2, fallback) => fsTry3(file2, "read", () => readFile4(file2, "utf8")).pipe(
33069
33193
  Effect_exports.flatMap((raw) => Effect_exports.try(() => JSON.parse(raw))),
33070
33194
  Effect_exports.orElseSucceed(() => fallback)
@@ -33568,16 +33692,16 @@ function planPermission(toolName, input, opts) {
33568
33692
  };
33569
33693
  }
33570
33694
  if (PLAN_EDIT_TOOLS.has(toolName)) {
33571
- const path2 = [input.file_path, input.notebook_path, input.path, opts?.blockedPath].find(
33695
+ const path5 = [input.file_path, input.notebook_path, input.path, opts?.blockedPath].find(
33572
33696
  (v) => typeof v === "string"
33573
33697
  );
33574
- if (path2 && isPlanFilePath(path2)) {
33698
+ if (path5 && isPlanFilePath(path5)) {
33575
33699
  return { behavior: "allow", updatedInput: input };
33576
33700
  }
33577
33701
  return {
33578
33702
  behavior: "deny",
33579
33703
  // (C) read-only plan mode, no dialog → feedback instead of silent drop
33580
- message: `Plan mode is read-only and this environment has no approval dialog, so "${toolName}"${path2 ? ` on ${path2}` : ""} can't run. Only writes under .claude/plans/ are allowed. Capture the intended changes in your plan instead of editing files now.`
33704
+ message: `Plan mode is read-only and this environment has no approval dialog, so "${toolName}"${path5 ? ` on ${path5}` : ""} can't run. Only writes under .claude/plans/ are allowed. Capture the intended changes in your plan instead of editing files now.`
33581
33705
  };
33582
33706
  }
33583
33707
  return { behavior: "allow", updatedInput: input };
@@ -33614,8 +33738,10 @@ function buildClaudeOptions(ctx, independent) {
33614
33738
  abortController: abort,
33615
33739
  // env is ALWAYS passed: without it the SDK inherits process.env verbatim,
33616
33740
  // handing the agent this server's NODE_ENV=production. See sanitizedSpawnEnv.
33617
- // COCKPIT_RUN_ID lets a skill's curl identify the session it runs in (delegation parent).
33618
- env: sanitizedSpawnEnv({ COCKPIT_RUN_ID: ctx.currentKey() })
33741
+ // COCKPIT_RUN_ID lets a skill's curl identify the session it runs in (delegation parent);
33742
+ // COCKPIT_CWD is the session's own working directory, which `pwd` stops being the moment
33743
+ // the agent cd's somewhere (see spawnEnv.ts).
33744
+ env: sanitizedSpawnEnv({ COCKPIT_RUN_ID: ctx.currentKey(), COCKPIT_CWD: ctx.cwd || void 0 })
33619
33745
  });
33620
33746
  }
33621
33747
  var claudeSpec = {
@@ -33732,9 +33858,9 @@ function getSessionPath(root, cwd, sessionId) {
33732
33858
  return join9(getSessionDir(root, cwd), `${sessionId}.jsonl`);
33733
33859
  }
33734
33860
  function readSessionMessages(root, cwd, sessionId) {
33735
- const path2 = getSessionPath(root, cwd, sessionId);
33736
- if (!existsSync4(path2)) return [];
33737
- const lines = readFileSync3(path2, "utf-8").split("\n").filter(Boolean);
33861
+ const path5 = getSessionPath(root, cwd, sessionId);
33862
+ if (!existsSync4(path5)) return [];
33863
+ const lines = readFileSync3(path5, "utf-8").split("\n").filter(Boolean);
33738
33864
  const transcriptEntries = [];
33739
33865
  for (const line of lines) {
33740
33866
  try {
@@ -33834,8 +33960,8 @@ function readSessionMessages(root, cwd, sessionId) {
33834
33960
  function appendSessionLine(root, cwd, sessionId, line) {
33835
33961
  const dir = getSessionDir(root, cwd);
33836
33962
  mkdirSync3(dir, { recursive: true });
33837
- const path2 = getSessionPath(root, cwd, sessionId);
33838
- appendFileSync(path2, JSON.stringify(line) + "\n", "utf-8");
33963
+ const path5 = getSessionPath(root, cwd, sessionId);
33964
+ appendFileSync(path5, JSON.stringify(line) + "\n", "utf-8");
33839
33965
  }
33840
33966
  function appendUserText(root, cwd, sessionId, text, opts) {
33841
33967
  appendSessionLine(root, cwd, sessionId, {
@@ -34644,10 +34770,10 @@ function mergeDefs(...defs) {
34644
34770
  function cloneDef(schema) {
34645
34771
  return mergeDefs(schema._zod.def);
34646
34772
  }
34647
- function getElementAtPath(obj, path2) {
34648
- if (!path2)
34773
+ function getElementAtPath(obj, path5) {
34774
+ if (!path5)
34649
34775
  return obj;
34650
- return path2.reduce((acc, key) => acc?.[key], obj);
34776
+ return path5.reduce((acc, key) => acc?.[key], obj);
34651
34777
  }
34652
34778
  function promiseAllObject(promisesObj) {
34653
34779
  const keys5 = Object.keys(promisesObj);
@@ -35030,11 +35156,11 @@ function aborted(x, startIndex = 0) {
35030
35156
  }
35031
35157
  return false;
35032
35158
  }
35033
- function prefixIssues(path2, issues) {
35159
+ function prefixIssues(path5, issues) {
35034
35160
  return issues.map((iss) => {
35035
35161
  var _a2;
35036
35162
  (_a2 = iss).path ?? (_a2.path = []);
35037
- iss.path.unshift(path2);
35163
+ iss.path.unshift(path5);
35038
35164
  return iss;
35039
35165
  });
35040
35166
  }
@@ -35217,7 +35343,7 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
35217
35343
  }
35218
35344
  function treeifyError(error48, mapper = (issue2) => issue2.message) {
35219
35345
  const result = { errors: [] };
35220
- const processError = (error49, path2 = []) => {
35346
+ const processError = (error49, path5 = []) => {
35221
35347
  var _a2, _b;
35222
35348
  for (const issue2 of error49.issues) {
35223
35349
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -35227,7 +35353,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
35227
35353
  } else if (issue2.code === "invalid_element") {
35228
35354
  processError({ issues: issue2.issues }, issue2.path);
35229
35355
  } else {
35230
- const fullpath = [...path2, ...issue2.path];
35356
+ const fullpath = [...path5, ...issue2.path];
35231
35357
  if (fullpath.length === 0) {
35232
35358
  result.errors.push(mapper(issue2));
35233
35359
  continue;
@@ -35259,8 +35385,8 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
35259
35385
  }
35260
35386
  function toDotPath(_path) {
35261
35387
  const segs = [];
35262
- const path2 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
35263
- for (const seg of path2) {
35388
+ const path5 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
35389
+ for (const seg of path5) {
35264
35390
  if (typeof seg === "number")
35265
35391
  segs.push(`[${seg}]`);
35266
35392
  else if (typeof seg === "symbol")
@@ -47237,13 +47363,13 @@ function resolveRef(ref, ctx) {
47237
47363
  if (!ref.startsWith("#")) {
47238
47364
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
47239
47365
  }
47240
- const path2 = ref.slice(1).split("/").filter(Boolean);
47241
- if (path2.length === 0) {
47366
+ const path5 = ref.slice(1).split("/").filter(Boolean);
47367
+ if (path5.length === 0) {
47242
47368
  return ctx.rootSchema;
47243
47369
  }
47244
47370
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
47245
- if (path2[0] === defsKey) {
47246
- const key = path2[1];
47371
+ if (path5[0] === defsKey) {
47372
+ const key = path5[1];
47247
47373
  if (!key || !ctx.defs[key]) {
47248
47374
  throw new Error(`Reference not found: ${ref}`);
47249
47375
  }
@@ -47824,7 +47950,14 @@ function createTools(context7) {
47824
47950
  encoding: "utf-8",
47825
47951
  timeout: timeout5 ?? 6e4,
47826
47952
  maxBuffer: 10 * 1024 * 1024,
47827
- env: sanitizedSpawnEnv({ FORCE_COLOR: "0", CI: "1", COCKPIT_RUN_ID: context7.runId })
47953
+ env: sanitizedSpawnEnv({
47954
+ FORCE_COLOR: "0",
47955
+ CI: "1",
47956
+ COCKPIT_RUN_ID: context7.runId,
47957
+ // The session's own cwd, which survives a `cd` in an earlier command
47958
+ // the way `pwd` does not (see spawnEnv.ts).
47959
+ COCKPIT_CWD: context7.cwd || void 0
47960
+ })
47828
47961
  });
47829
47962
  if (stdout.length === 0) {
47830
47963
  if (stderr.length === 0) {
@@ -47890,14 +48023,14 @@ ${stderrCapped}`;
47890
48023
  ),
47891
48024
  execute: async ({
47892
48025
  pattern,
47893
- path: path2,
48026
+ path: path5,
47894
48027
  ignore_case,
47895
48028
  output_mode,
47896
48029
  "-n": showLineNumbers
47897
48030
  }) => {
47898
48031
  try {
47899
- if (path2 && !isAbsolute2(path2)) return "Error: path must be an absolute path.";
47900
- const target = path2 || context7.cwd;
48032
+ if (path5 && !isAbsolute2(path5)) return "Error: path must be an absolute path.";
48033
+ const target = path5 || context7.cwd;
47901
48034
  const args2 = [
47902
48035
  "--no-heading",
47903
48036
  "--color",
@@ -47963,6 +48096,43 @@ ${summary5}`;
47963
48096
  };
47964
48097
  }
47965
48098
 
48099
+ // packages/feature/agent/src/server/engines/sessionModel.ts
48100
+ var MODEL_MAP_KEY = {
48101
+ ollama: "ollamaModels",
48102
+ deepseek: "deepseekModels",
48103
+ kimi: "kimiModels",
48104
+ glm: "glmModels",
48105
+ claude: "claudeModels",
48106
+ codex: "codexModels"
48107
+ };
48108
+ var EMPTY = { sessions: [] };
48109
+ function mapOf(state, key) {
48110
+ const raw = state[key];
48111
+ return raw && typeof raw === "object" ? raw : {};
48112
+ }
48113
+ async function readSessionModel(engine, cwd, sessionId) {
48114
+ const key = MODEL_MAP_KEY[engine];
48115
+ if (!key || !cwd || !sessionId) return void 0;
48116
+ const state = await readJsonFile(getSessionFilePath(cwd), EMPTY);
48117
+ return mapOf(state, key)[sessionId]?.trim() || void 0;
48118
+ }
48119
+ async function recordSessionModel(engine, cwd, sessionId, model) {
48120
+ const key = MODEL_MAP_KEY[engine];
48121
+ if (!key || !cwd || !sessionId || !model.trim()) return;
48122
+ const value = model.trim();
48123
+ const filePath = getSessionFilePath(cwd);
48124
+ try {
48125
+ const before2 = await readJsonFile(filePath, EMPTY);
48126
+ if (mapOf(before2, key)[sessionId] === value) return;
48127
+ await mutateJsonFile(filePath, EMPTY, (cur) => ({
48128
+ ...cur,
48129
+ [key]: { ...mapOf(cur, key), [sessionId]: value }
48130
+ }));
48131
+ } catch (error48) {
48132
+ console.error(`[engine:${engine}] failed to record session model for ${sessionId}:`, error48);
48133
+ }
48134
+ }
48135
+
47966
48136
  // packages/feature/agent/src/server/engines/shared/providerError.ts
47967
48137
  function extractBodyMessage(body) {
47968
48138
  if (typeof body !== "string" || !body.trim()) return void 0;
@@ -48166,7 +48336,9 @@ async function runBuiltinAgent(ctx, config3) {
48166
48336
  const sid = ctx.currentKey();
48167
48337
  ctx.rekey(sid);
48168
48338
  const model = typeof ctx.params.model === "string" && ctx.params.model || config3.defaultModel;
48339
+ if (!model) throw new Error(`No model resolved for this ${config3.engine} run`);
48169
48340
  const prompt = ctx.prompt;
48341
+ void recordSessionModel(config3.engine, cwd, sid, model);
48170
48342
  const emit2 = (data) => {
48171
48343
  if (data.startsWith("data: [DONE]")) return;
48172
48344
  try {
@@ -48311,13 +48483,15 @@ function resolveEndpoints(p, saved, language) {
48311
48483
  const id3 = saved.region || p.regions.defaultFor(language);
48312
48484
  return p.regions.byId[id3] ?? p.endpoints;
48313
48485
  }
48314
- function resolveModel(requested, saved, fallback) {
48486
+ function resolveModel(requested, session, saved, fallback) {
48315
48487
  if (typeof requested === "string" && requested.trim()) return requested.trim();
48488
+ if (session && session.trim()) return session.trim();
48316
48489
  if (saved && saved.trim()) return saved.trim();
48317
48490
  return fallback;
48318
48491
  }
48319
48492
  function buildConfig(p, apiKey, endpoints) {
48320
48493
  return {
48494
+ engine: p.name,
48321
48495
  sessionsRoot: getBuiltinSessionsRoot(p.name),
48322
48496
  defaultModel: p.defaultModel,
48323
48497
  createModel: async (modelName) => createOpenAiCompatModel({ baseURL: endpoints.openAiBaseUrl, apiKey, modelName }),
@@ -48343,6 +48517,7 @@ function makeAnthropicCompatSpec(p) {
48343
48517
  if (!textCheck.ok) return textCheck;
48344
48518
  params.model = resolveModel(
48345
48519
  typeof params.model === "string" ? params.model : void 0,
48520
+ await readSessionModel(p.name, params.cwd, params.sessionId),
48346
48521
  saved.builtinModel,
48347
48522
  p.defaultModel
48348
48523
  );
@@ -48373,17 +48548,126 @@ var deepseekProvider = {
48373
48548
  };
48374
48549
  var deepseekSpec = makeAnthropicCompatSpec(deepseekProvider);
48375
48550
 
48551
+ // packages/feature/agent/src/server/engines/ollamaCatalog.ts
48552
+ var LIST_TIMEOUT_MS = 3e3;
48553
+ function describeFailure(baseUrl, cause3) {
48554
+ const msg = cause3 instanceof Error ? cause3.message : String(cause3);
48555
+ if (/abort|timeout/i.test(msg)) {
48556
+ return `The Ollama server at ${baseUrl} did not answer within ${LIST_TIMEOUT_MS}ms.`;
48557
+ }
48558
+ if (/ECONNREFUSED|fetch failed|ENOTFOUND|EHOSTUNREACH/i.test(msg)) {
48559
+ return `Cannot reach the Ollama server at ${baseUrl} (${msg}). Start it with \`ollama serve\`, or set another URL in the Ollama picker.`;
48560
+ }
48561
+ return `Failed to list models from the Ollama server at ${baseUrl}: ${msg}`;
48562
+ }
48563
+ async function listOllamaModels() {
48564
+ const baseUrl = await resolveOllamaBaseURL();
48565
+ try {
48566
+ const res = await fetch(`${baseUrl}/api/tags`, { signal: AbortSignal.timeout(LIST_TIMEOUT_MS) });
48567
+ if (res.ok) {
48568
+ const data = await res.json();
48569
+ const models = Array.isArray(data.models) ? data.models : [];
48570
+ if (models.length > 0) {
48571
+ return {
48572
+ ok: true,
48573
+ baseUrl,
48574
+ models: models.map((m) => ({
48575
+ name: m.name,
48576
+ size: m.size,
48577
+ modified_at: m.modified_at,
48578
+ family: m.details?.family,
48579
+ parameter_size: m.details?.parameter_size
48580
+ }))
48581
+ };
48582
+ }
48583
+ }
48584
+ } catch {
48585
+ }
48586
+ try {
48587
+ const res = await fetch(`${baseUrl}/v1/models`, { signal: AbortSignal.timeout(LIST_TIMEOUT_MS) });
48588
+ if (!res.ok) {
48589
+ return {
48590
+ ok: false,
48591
+ baseUrl,
48592
+ reason: `The Ollama server at ${baseUrl} returned HTTP ${res.status} for its model list.`
48593
+ };
48594
+ }
48595
+ const data = await res.json();
48596
+ const models = Array.isArray(data.data) ? data.data : [];
48597
+ return {
48598
+ ok: true,
48599
+ baseUrl,
48600
+ models: models.map((m) => ({
48601
+ name: m.id,
48602
+ size: 0,
48603
+ modified_at: m.created ? new Date(m.created * 1e3).toISOString() : "",
48604
+ family: m.owned_by || void 0
48605
+ }))
48606
+ };
48607
+ } catch (cause3) {
48608
+ return { ok: false, baseUrl, reason: describeFailure(baseUrl, cause3) };
48609
+ }
48610
+ }
48611
+
48376
48612
  // packages/feature/agent/src/server/engines/ollama.ts
48377
- var DEFAULT_MODEL2 = "qwen3.5:35b-a3b-coding-nvfp4";
48378
48613
  var OLLAMA_CONFIG = {
48614
+ engine: "ollama",
48379
48615
  sessionsRoot: getBuiltinSessionsRoot("ollama"),
48380
- defaultModel: DEFAULT_MODEL2,
48381
48616
  createModel: (model) => createOllamaModel(model)
48382
48617
  };
48618
+ var fail20 = (error48) => ({ ok: false, status: 400, error: error48 });
48619
+ function matchInstalled(requested, models) {
48620
+ const exact = models.find((m) => m.name === requested);
48621
+ if (exact) return exact.name;
48622
+ const byTag = models.filter((m) => m.name.startsWith(`${requested}:`));
48623
+ return byTag.length === 1 ? byTag[0].name : void 0;
48624
+ }
48625
+ var nameList = (models) => models.map((m) => m.name).join(", ");
48626
+ async function resolveDefaultOllamaModel() {
48627
+ const catalog = await listOllamaModels();
48628
+ if (!catalog.ok) {
48629
+ return { ok: false, reason: `${catalog.reason} Cockpit picks the model from that list.` };
48630
+ }
48631
+ if (catalog.models.length === 0) {
48632
+ return {
48633
+ ok: false,
48634
+ reason: `The Ollama server at ${catalog.baseUrl} has no models installed. Pull one with \`ollama pull <model>\` (e.g. \`ollama pull qwen3\`), then try again.`
48635
+ };
48636
+ }
48637
+ const last5 = await readOllamaLastModel();
48638
+ return { ok: true, model: last5 && matchInstalled(last5, catalog.models) || catalog.models[0].name };
48639
+ }
48640
+ async function resolveOllamaModel(params) {
48641
+ const requested = typeof params.model === "string" ? params.model.trim() : "";
48642
+ if (!requested) {
48643
+ const recorded = await readSessionModel("ollama", params.cwd, params.sessionId);
48644
+ const choice2 = recorded ? { ok: true, model: recorded } : await resolveDefaultOllamaModel();
48645
+ if (!choice2.ok) return fail20(choice2.reason);
48646
+ params.model = choice2.model;
48647
+ await rememberOllamaLastModel(choice2.model);
48648
+ return { ok: true };
48649
+ }
48650
+ const catalog = await listOllamaModels();
48651
+ if (!catalog.ok) {
48652
+ params.model = requested;
48653
+ return { ok: true };
48654
+ }
48655
+ const installed = matchInstalled(requested, catalog.models);
48656
+ if (!installed) {
48657
+ return fail20(
48658
+ catalog.models.length === 0 ? `The Ollama server at ${catalog.baseUrl} has no models installed, so '${requested}' cannot run. Pull it with \`ollama pull ${requested}\`.` : `Model '${requested}' is not installed on the Ollama server at ${catalog.baseUrl}. Available: ${nameList(catalog.models)}.`
48659
+ );
48660
+ }
48661
+ params.model = installed;
48662
+ await rememberOllamaLastModel(installed);
48663
+ return { ok: true };
48664
+ }
48383
48665
  var ollamaSpec = {
48384
48666
  name: "ollama",
48385
48667
  async preflight(params) {
48386
- return requireTextPrompt(params);
48668
+ const textCheck = requireTextPrompt(params);
48669
+ if (!textCheck.ok) return textCheck;
48670
+ return resolveOllamaModel(params);
48387
48671
  },
48388
48672
  runner: {
48389
48673
  run: (ctx) => runBuiltinAgent(ctx, OLLAMA_CONFIG)
@@ -48393,12 +48677,12 @@ var ollamaSpec = {
48393
48677
 
48394
48678
  // packages/feature/agent/src/server/engines/kimi.ts
48395
48679
  var KIMI_OPENAI_BASE_URL = "https://api.kimi.com/coding/v1";
48396
- var DEFAULT_MODEL3 = "k3";
48680
+ var DEFAULT_MODEL2 = "k3";
48397
48681
  var kimiProvider = {
48398
48682
  name: "kimi",
48399
48683
  label: "Kimi",
48400
48684
  endpoints: { openAiBaseUrl: KIMI_OPENAI_BASE_URL },
48401
- defaultModel: DEFAULT_MODEL3,
48685
+ defaultModel: DEFAULT_MODEL2,
48402
48686
  apiKey: kimiApiKey,
48403
48687
  // Kimi's coding models are thinking-only and reject any temperature but 1 with
48404
48688
  // `invalid temperature: only 1 is allowed for this model`, which fails the turn before a
@@ -48413,7 +48697,7 @@ var GLM_REGIONS = {
48413
48697
  global: { openAiBaseUrl: "https://api.z.ai/api/coding/paas/v4" }
48414
48698
  };
48415
48699
  var GLM_REGION_IDS = Object.keys(GLM_REGIONS);
48416
- var DEFAULT_MODEL4 = "glm-5.3";
48700
+ var DEFAULT_MODEL3 = "glm-5.3";
48417
48701
  var glmProvider = {
48418
48702
  name: "glm",
48419
48703
  label: "GLM",
@@ -48423,7 +48707,7 @@ var glmProvider = {
48423
48707
  // Shared with the picker so the UI cannot claim one host while runs go to another.
48424
48708
  defaultFor: defaultRegionForLanguage
48425
48709
  },
48426
- defaultModel: DEFAULT_MODEL4,
48710
+ defaultModel: DEFAULT_MODEL3,
48427
48711
  apiKey: glmApiKey
48428
48712
  // No builtinTemperature override: temperature 0 with tools is accepted here (verified),
48429
48713
  // unlike Kimi's thinking-only models.
@@ -49133,9 +49417,9 @@ function createCodexEventAdapter(ctx) {
49133
49417
  rolloutPath = null;
49134
49418
  }
49135
49419
  }
49136
- const bindRollout = (path2) => {
49137
- if (!path2 || path2 === rolloutPath) return;
49138
- rolloutPath = path2;
49420
+ const bindRollout = (path5) => {
49421
+ if (!path5 || path5 === rolloutPath) return;
49422
+ rolloutPath = path5;
49139
49423
  basesReady = false;
49140
49424
  initBases();
49141
49425
  };
@@ -49153,8 +49437,8 @@ function createCodexEventAdapter(ctx) {
49153
49437
  };
49154
49438
  const emitSpawn = (item) => {
49155
49439
  const agentIds = item.receiver_thread_ids ?? [];
49156
- const path2 = rolloutPath;
49157
- const entry = path2 ? resolveCodexSpawnCall(readRollout(path2).spawn, spawnBase + spawnSeen, agentIds[0]) : null;
49440
+ const path5 = rolloutPath;
49441
+ const entry = path5 ? resolveCodexSpawnCall(readRollout(path5).spawn, spawnBase + spawnSeen, agentIds[0]) : null;
49158
49442
  spawnSeen += 1;
49159
49443
  const toolUseId = toolUseIdFor(item);
49160
49444
  if (spawnEmitted.has(toolUseId)) return;
@@ -49167,9 +49451,9 @@ function createCodexEventAdapter(ctx) {
49167
49451
  emitSpawnBubble(toolUseId, input, entry?.agentPath);
49168
49452
  };
49169
49453
  const syncSubAgents = (flushPending = false) => {
49170
- const path2 = rolloutPath;
49171
- if (!path2) return;
49172
- const { spawn: spawn2, reports } = readRollout(path2);
49454
+ const path5 = rolloutPath;
49455
+ if (!path5) return;
49456
+ const { spawn: spawn2, reports } = readRollout(path5);
49173
49457
  for (let i = spawnBase; i < spawn2.length; i += 1) {
49174
49458
  const s = spawn2[i];
49175
49459
  if (!s.callId || spawnEmitted.has(s.callId)) continue;
@@ -49326,7 +49610,7 @@ function cleanupImageFiles(imageFiles) {
49326
49610
  function codexTurnInput(prompt, imageFiles) {
49327
49611
  return [
49328
49612
  { type: "text", text: imageFiles.length > 0 ? prompt || CODEX_IMAGE_ONLY_TEXT : prompt },
49329
- ...imageFiles.map((path2) => ({ type: "localImage", path: path2 }))
49613
+ ...imageFiles.map((path5) => ({ type: "localImage", path: path5 }))
49330
49614
  ];
49331
49615
  }
49332
49616
  function codexThreadParams(ctx) {
@@ -49393,8 +49677,9 @@ async function runCodexAppServer(ctx) {
49393
49677
  let client;
49394
49678
  try {
49395
49679
  client = CodexAppServerClient.start({
49396
- // COCKPIT_RUN_ID lets a skill's curl identify the session it runs in (delegation parent).
49397
- env: sanitizedSpawnEnv({ COCKPIT_RUN_ID: ctx.currentKey() }),
49680
+ // COCKPIT_RUN_ID lets a skill's curl identify the session it runs in (delegation parent);
49681
+ // COCKPIT_CWD is the session's own working directory (see spawnEnv.ts).
49682
+ env: sanitizedSpawnEnv({ COCKPIT_RUN_ID: ctx.currentKey(), COCKPIT_CWD: ctx.cwd || void 0 }),
49398
49683
  ...ctx.cwd ? { cwd: ctx.cwd } : {},
49399
49684
  onNotification,
49400
49685
  // Permitted `console.error` under EFFECT.md §0 (subprocess IPC adapter gateway).
@@ -49564,11 +49849,15 @@ var fileExists = (p) => Effect_exports.tryPromise(() => stat5(p)).pipe(
49564
49849
  Effect_exports.map((s) => s.isFile()),
49565
49850
  Effect_exports.orElseSucceed(() => false)
49566
49851
  );
49567
- var validateRequest = (body) => Effect_exports.gen(function* () {
49852
+ var inheritedEngine = (parentRunId) => {
49853
+ const parent = parentRunId ? getRunInfo(parentRunId)?.engine : null;
49854
+ return parent && DELEGATION_ENGINES.includes(parent) ? parent : "claude";
49855
+ };
49856
+ var validateRequest = (body, parentRunId) => Effect_exports.gen(function* () {
49568
49857
  const cwd = str(body.cwd);
49569
49858
  if (!cwd || !isAbsolute3(cwd)) return yield* Effect_exports.fail(invalid("cwd", "must be an absolute path"));
49570
49859
  if (!(yield* isDirectory2(cwd))) return yield* Effect_exports.fail(invalid("cwd", "directory does not exist"));
49571
- const engine = str(body.engine) ?? "claude";
49860
+ const engine = str(body.engine) ?? inheritedEngine(parentRunId);
49572
49861
  if (!DELEGATION_ENGINES.includes(engine)) {
49573
49862
  return yield* Effect_exports.fail(invalid("engine", `expected one of ${DELEGATION_ENGINES.join(", ")}`));
49574
49863
  }
@@ -49769,18 +50058,19 @@ var DelegationServiceLive = Layer_exports.effect(
49769
50058
  if (!spec) return yield* Effect_exports.fail(invalid("engine", `no engine spec for ${request2.engine}`));
49770
50059
  const parent = yield* resolveParent(parentRunId);
49771
50060
  const presetId = randomUUID4();
50061
+ const dispatchParams = {
50062
+ prompt: buildChildPrompt(request2, parent),
50063
+ cwd: request2.cwd,
50064
+ engine: request2.engine,
50065
+ runId: presetId,
50066
+ ...request2.engine === "claude" && { newSessionId: presetId },
50067
+ ...request2.model && { model: request2.model }
50068
+ };
49772
50069
  const runKey = yield* Effect_exports.acquireUseRelease(
49773
50070
  reserve,
49774
50071
  () => Effect_exports.gen(function* () {
49775
50072
  const outcome = yield* Effect_exports.tryPromise({
49776
- try: () => dispatchChat2(spec, {
49777
- prompt: buildChildPrompt(request2, parent),
49778
- cwd: request2.cwd,
49779
- engine: request2.engine,
49780
- runId: presetId,
49781
- ...request2.engine === "claude" && { newSessionId: presetId },
49782
- ...request2.model && { model: request2.model }
49783
- }),
50073
+ try: () => dispatchChat2(spec, dispatchParams),
49784
50074
  catch: (cause3) => new AgentError({ provider: request2.engine, kind: "unknown", cause: cause3 })
49785
50075
  });
49786
50076
  if (!outcome.ok) return yield* Effect_exports.fail(invalid("engine", outcome.error));
@@ -49792,10 +50082,11 @@ var DelegationServiceLive = Layer_exports.effect(
49792
50082
  const sessionId = request2.engine === "codex" ? yield* waitForSessionId(runKey, SESSION_ID_TIMEOUT).pipe(
49793
50083
  Effect_exports.tapError(() => Effect_exports.sync(() => requestStop(runKey)))
49794
50084
  ) : presetId;
50085
+ const model = dispatchParams.model ?? request2.model;
49795
50086
  return {
49796
50087
  cwd: request2.cwd,
49797
50088
  engine: request2.engine,
49798
- ...request2.model && { model: request2.model },
50089
+ ...model && { model },
49799
50090
  sessionId,
49800
50091
  link: buildSessionLink(request2.cwd, sessionId),
49801
50092
  title: request2.title,
@@ -49811,6 +50102,388 @@ var DelegationServiceLive = Layer_exports.effect(
49811
50102
  })
49812
50103
  );
49813
50104
 
50105
+ // packages/feature/agent/src/effect/botRegistryLive.ts
50106
+ import { randomUUID as randomUUID5 } from "crypto";
50107
+ import { readFileSync as readFileSync7, realpathSync as realpathSync3 } from "fs";
50108
+ import path3 from "path";
50109
+
50110
+ // packages/feature/agent/src/shared/bots.ts
50111
+ import yaml from "js-yaml";
50112
+ var BOT_MANIFEST_FILE = "BOT.md";
50113
+ var BOT_NAME = /^[a-z0-9][a-z0-9-]{0,63}$/;
50114
+ var isBotName = (name) => BOT_NAME.test(name);
50115
+ var isManifestPath = (path5, target) => path5.basename(target).toLowerCase() === BOT_MANIFEST_FILE.toLowerCase();
50116
+ var botPaths = (path5, target) => {
50117
+ const dir = isManifestPath(path5, target) ? path5.dirname(target) : path5.join(target);
50118
+ return { dir, manifest: path5.join(dir, BOT_MANIFEST_FILE) };
50119
+ };
50120
+ var parseBotDocument = (path5, content, dir) => {
50121
+ const match21 = content.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
50122
+ let fields = {};
50123
+ if (match21) {
50124
+ const raw = yaml.load(match21[1]);
50125
+ if (raw !== void 0 && raw !== null) {
50126
+ if (typeof raw !== "object" || Array.isArray(raw)) throw new Error("BOT.md frontmatter must be a mapping");
50127
+ fields = raw;
50128
+ }
50129
+ }
50130
+ const fallback = path5.basename(dir).toLowerCase();
50131
+ const name = typeof fields.name === "string" && fields.name.trim() ? fields.name.trim() : fallback;
50132
+ if (!isBotName(name)) throw new Error(`Bot name "${name}" must match [a-z0-9][a-z0-9-]*`);
50133
+ const description = typeof fields.description === "string" ? fields.description.trim() : "";
50134
+ return { name, description };
50135
+ };
50136
+ var messageOf = (cause3) => cause3 instanceof Error ? cause3.message : String(cause3);
50137
+ var resolveBot = (path5, record2, read) => {
50138
+ const { dir, manifest } = botPaths(path5, record2.path);
50139
+ try {
50140
+ return { ...record2, valid: true, ...parseBotDocument(path5, read(manifest), dir) };
50141
+ } catch (cause3) {
50142
+ return { ...record2, valid: false, name: path5.basename(dir), error: messageOf(cause3) };
50143
+ }
50144
+ };
50145
+ var mentionableBots = (path5, bots) => {
50146
+ const out = /* @__PURE__ */ new Map();
50147
+ for (const bot of bots) {
50148
+ if (bot.valid && !out.has(bot.name)) out.set(bot.name, botPaths(path5, bot.path).manifest);
50149
+ }
50150
+ return out;
50151
+ };
50152
+ var findNameClash = (bots, name, dir) => bots.find((bot) => bot.valid && bot.name === name && bot.path !== dir);
50153
+
50154
+ // packages/feature/agent/src/server/lib/builtinBots.ts
50155
+ import { createHash as createHash2 } from "crypto";
50156
+ import {
50157
+ cpSync,
50158
+ existsSync as existsSync8,
50159
+ mkdirSync as mkdirSync6,
50160
+ readFileSync as readFileSync6,
50161
+ readdirSync as readdirSync4,
50162
+ realpathSync as realpathSync2,
50163
+ renameSync as renameSync4,
50164
+ rmdirSync,
50165
+ rmSync,
50166
+ statSync as statSync5,
50167
+ writeFileSync as writeFileSync6
50168
+ } from "fs";
50169
+ import path2, { join as join14 } from "path";
50170
+ var BUILTIN_BOT_ID_PREFIX = "builtin:";
50171
+ var isBuiltinBotId = (id3) => id3.startsWith(BUILTIN_BOT_ID_PREFIX);
50172
+ var builtinBotNameFromId = (id3) => isBuiltinBotId(id3) ? id3.slice(BUILTIN_BOT_ID_PREFIX.length) : "";
50173
+ var builtinBotSeedDir = (name) => join14(BUILTIN_BOTS_SRC_DIR, name);
50174
+ var builtinBotUserDir = (name) => join14(BOTS_DIR, name);
50175
+ var hasManifest = (dir) => {
50176
+ try {
50177
+ return statSync5(join14(dir, BOT_MANIFEST_FILE)).isFile();
50178
+ } catch {
50179
+ return false;
50180
+ }
50181
+ };
50182
+ var INSTALL_STATE_FILE = join14(BOTS_DIR, ".builtin-installs.json");
50183
+ var readInstallState = () => {
50184
+ try {
50185
+ const raw = JSON.parse(readFileSync6(INSTALL_STATE_FILE, "utf-8"));
50186
+ return raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
50187
+ } catch {
50188
+ return {};
50189
+ }
50190
+ };
50191
+ var writeInstallState = (state) => {
50192
+ try {
50193
+ mkdirSync6(BOTS_DIR, { recursive: true });
50194
+ const tmp = `${INSTALL_STATE_FILE}.${process.pid}.tmp`;
50195
+ writeFileSync6(tmp, `${JSON.stringify(state, null, 2)}
50196
+ `);
50197
+ renameSync4(tmp, INSTALL_STATE_FILE);
50198
+ } catch (err) {
50199
+ console.error(`[bots] cannot record builtin Bot installs in ${INSTALL_STATE_FILE}:`, err);
50200
+ }
50201
+ };
50202
+ var hashFile = (file2) => createHash2("sha256").update(readFileSync6(file2)).digest("hex");
50203
+ function fileHashes(dir) {
50204
+ const out = /* @__PURE__ */ new Map();
50205
+ const walk = (rel) => {
50206
+ for (const entry of readdirSync4(join14(dir, rel), { withFileTypes: true })) {
50207
+ const child = rel ? `${rel}/${entry.name}` : entry.name;
50208
+ if (entry.isDirectory()) walk(child);
50209
+ else if (entry.isFile()) out.set(child, hashFile(join14(dir, child)));
50210
+ }
50211
+ };
50212
+ walk("");
50213
+ return out;
50214
+ }
50215
+ var treeHash = (files) => {
50216
+ const hash3 = createHash2("sha256");
50217
+ for (const rel of [...files.keys()].sort()) hash3.update(`${rel}\0${files.get(rel)}\0`);
50218
+ return hash3.digest("hex");
50219
+ };
50220
+ function swapIn(staging, dest) {
50221
+ const retired = `${staging}.old`;
50222
+ let moved = false;
50223
+ try {
50224
+ try {
50225
+ renameSync4(dest, retired);
50226
+ moved = true;
50227
+ } catch (err) {
50228
+ if (err?.code !== "ENOENT") throw err;
50229
+ }
50230
+ renameSync4(staging, dest);
50231
+ if (moved) rmSync(retired, { recursive: true, force: true });
50232
+ } catch (err) {
50233
+ if (moved && !existsSync8(dest)) renameSync4(retired, dest);
50234
+ throw err;
50235
+ } finally {
50236
+ rmSync(staging, { recursive: true, force: true });
50237
+ }
50238
+ }
50239
+ var stagingDir = (label) => {
50240
+ const staging = join14(BOTS_DIR, `.${label}.installing-${process.pid}-${Date.now()}`);
50241
+ mkdirSync6(BOTS_DIR, { recursive: true });
50242
+ rmSync(staging, { recursive: true, force: true });
50243
+ return staging;
50244
+ };
50245
+ function removeAndPrune(root, rel) {
50246
+ rmSync(join14(root, rel), { force: true });
50247
+ for (let dir = path2.dirname(rel); dir && dir !== "."; dir = path2.dirname(dir)) {
50248
+ try {
50249
+ if (readdirSync4(join14(root, dir)).length > 0) return;
50250
+ rmdirSync(join14(root, dir));
50251
+ } catch {
50252
+ return;
50253
+ }
50254
+ }
50255
+ }
50256
+ function refreshInstalled(name, dest, installed) {
50257
+ const seed = builtinBotSeedDir(name);
50258
+ const seedFiles = fileHashes(seed);
50259
+ const copyFiles = fileHashes(dest);
50260
+ const next4 = { ...installed };
50261
+ const writes = [];
50262
+ const deletes = [];
50263
+ for (const rel of /* @__PURE__ */ new Set([...Object.keys(installed), ...seedFiles.keys()])) {
50264
+ const ours = installed[rel];
50265
+ const shipped = seedFiles.get(rel);
50266
+ const current2 = copyFiles.get(rel);
50267
+ if (ours === void 0) {
50268
+ if (shipped !== void 0 && current2 === void 0) {
50269
+ writes.push(rel);
50270
+ next4[rel] = shipped;
50271
+ }
50272
+ continue;
50273
+ }
50274
+ if (current2 !== ours) continue;
50275
+ if (shipped === void 0) {
50276
+ deletes.push(rel);
50277
+ delete next4[rel];
50278
+ } else if (shipped !== ours) {
50279
+ writes.push(rel);
50280
+ next4[rel] = shipped;
50281
+ }
50282
+ }
50283
+ if (writes.length === 0 && deletes.length === 0) return next4;
50284
+ const staging = stagingDir(name);
50285
+ try {
50286
+ cpSync(dest, staging, { recursive: true });
50287
+ for (const rel of deletes) removeAndPrune(staging, rel);
50288
+ for (const rel of writes) {
50289
+ mkdirSync6(join14(staging, path2.dirname(rel)), { recursive: true });
50290
+ cpSync(join14(seed, rel), join14(staging, rel));
50291
+ }
50292
+ swapIn(staging, dest);
50293
+ } catch (err) {
50294
+ rmSync(staging, { recursive: true, force: true });
50295
+ throw err;
50296
+ }
50297
+ return next4;
50298
+ }
50299
+ function syncBuiltinBot(name, state) {
50300
+ if (!isBotName(name)) throw new Error(`"${name}" is not a valid built-in Bot name`);
50301
+ const dest = builtinBotUserDir(name);
50302
+ const seed = builtinBotSeedDir(name);
50303
+ if (!hasManifest(seed)) throw new Error(`no built-in Bot named "${name}"`);
50304
+ if (!hasManifest(dest)) {
50305
+ const seedFiles = fileHashes(seed);
50306
+ const staging = stagingDir(name);
50307
+ try {
50308
+ cpSync(seed, staging, { recursive: true });
50309
+ swapIn(staging, dest);
50310
+ } catch (err) {
50311
+ if (!hasManifest(dest)) throw err;
50312
+ }
50313
+ state[name] = { seed: treeHash(seedFiles), files: Object.fromEntries(seedFiles) };
50314
+ return { dir: dest, changed: true };
50315
+ }
50316
+ const record2 = state[name];
50317
+ if (!record2?.files) return { dir: dest, changed: false };
50318
+ const seedHash = treeHash(fileHashes(seed));
50319
+ if (record2.seed === seedHash) return { dir: dest, changed: false };
50320
+ if (existsSync8(join14(dest, ".locks", "write"))) return { dir: dest, changed: false };
50321
+ state[name] = { seed: seedHash, files: refreshInstalled(name, dest, record2.files) };
50322
+ return { dir: dest, changed: true };
50323
+ }
50324
+ var messageOf2 = (cause3) => cause3 instanceof Error ? cause3.message : String(cause3);
50325
+ function parseManifestIn(dir) {
50326
+ try {
50327
+ const content = readFileSync6(join14(dir, BOT_MANIFEST_FILE), "utf-8");
50328
+ return { ok: true, ...parseBotDocument(path2, content, dir) };
50329
+ } catch (err) {
50330
+ return { ok: false, error: messageOf2(err) };
50331
+ }
50332
+ }
50333
+ function builtinBotHome(name, state) {
50334
+ try {
50335
+ return { ...syncBuiltinBot(name, state), installed: true };
50336
+ } catch (err) {
50337
+ console.error(`[bots] cannot install builtin Bot "${name}" into ${BOTS_DIR} \u2014 using the read-only copy:`, err);
50338
+ return { dir: builtinBotSeedDir(name), installed: false, changed: false };
50339
+ }
50340
+ }
50341
+ function listBuiltinBots() {
50342
+ let dirs;
50343
+ try {
50344
+ dirs = readdirSync4(BUILTIN_BOTS_SRC_DIR, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name).sort();
50345
+ } catch (err) {
50346
+ const code = err?.code;
50347
+ if (code !== "ENOENT") {
50348
+ console.error(
50349
+ `[bots] cannot read builtin bots dir ${BUILTIN_BOTS_SRC_DIR} \u2014 all builtin Bots are unavailable:`,
50350
+ err
50351
+ );
50352
+ }
50353
+ return [];
50354
+ }
50355
+ const state = readInstallState();
50356
+ let stateChanged = false;
50357
+ const bots = [];
50358
+ for (const dir of dirs) {
50359
+ if (!hasManifest(builtinBotSeedDir(dir))) continue;
50360
+ if (!isBotName(dir)) {
50361
+ console.error(`[bots] builtin Bot directory "${dir}" is not a usable Bot name and was skipped`);
50362
+ continue;
50363
+ }
50364
+ if (!hasManifest(builtinBotUserDir(dir))) {
50365
+ const seed = parseManifestIn(builtinBotSeedDir(dir));
50366
+ if (!seed.ok) {
50367
+ console.error(`[bots] builtin Bot "${dir}" is not usable and was skipped: ${seed.error}`);
50368
+ continue;
50369
+ }
50370
+ }
50371
+ const { dir: home, installed, changed } = builtinBotHome(dir, state);
50372
+ stateChanged ||= changed;
50373
+ const manifest = parseManifestIn(home);
50374
+ const base = { id: `${BUILTIN_BOT_ID_PREFIX}${dir}`, path: home, addedAt: "", builtin: true };
50375
+ if (manifest.ok) {
50376
+ bots.push({ ...base, valid: true, name: manifest.name, description: manifest.description });
50377
+ } else if (installed) {
50378
+ bots.push({ ...base, valid: false, name: dir, error: manifest.error });
50379
+ } else {
50380
+ console.error(`[bots] builtin Bot "${dir}" became unreadable and was skipped: ${manifest.error}`);
50381
+ }
50382
+ }
50383
+ if (stateChanged) writeInstallState(state);
50384
+ return bots;
50385
+ }
50386
+ var realpathOr = (target) => {
50387
+ try {
50388
+ return realpathSync2.native(target);
50389
+ } catch {
50390
+ return target;
50391
+ }
50392
+ };
50393
+ function findBuiltinBotByPath(dir) {
50394
+ const target = realpathOr(dir);
50395
+ return listBuiltinBots().find((bot) => {
50396
+ const candidates = [bot.path, builtinBotSeedDir(builtinBotNameFromId(bot.id))];
50397
+ return candidates.some((candidate) => candidate === dir || realpathOr(candidate) === target);
50398
+ });
50399
+ }
50400
+
50401
+ // packages/feature/agent/src/effect/botRegistryLive.ts
50402
+ var EMPTY_REGISTRY = { bots: [] };
50403
+ var readRegistry = () => readJsonFileForUpdate(BOTS_FILE, EMPTY_REGISTRY);
50404
+ var readManifest = (manifestPath) => readFileSync7(manifestPath, "utf8");
50405
+ var resolveRegisteredBots = (registry3) => registry3.bots.map((record2) => resolveBot(path3, record2, readManifest));
50406
+ var invalidPath = (reason) => new ValidationError({ field: "path", reason });
50407
+ var fsReason = (what, target, cause3) => {
50408
+ const code = cause3?.code;
50409
+ if (!code || code === "ENOENT") return invalidPath(`${what} not found: ${target}`);
50410
+ const detail = cause3 instanceof Error ? cause3.message : String(cause3);
50411
+ return invalidPath(`cannot read ${target} (${code}): ${detail}`);
50412
+ };
50413
+ var mergeBuiltins = (registered) => {
50414
+ const builtins = listBuiltinBots();
50415
+ const builtinPaths = new Set(
50416
+ builtins.flatMap((bot) => [bot.path, builtinBotSeedDir(builtinBotNameFromId(bot.id))])
50417
+ );
50418
+ return [...builtins, ...registered.filter((bot) => !builtinPaths.has(bot.path))];
50419
+ };
50420
+ var listBots = Effect_exports.tryPromise({
50421
+ try: async () => mergeBuiltins(resolveRegisteredBots(await readRegistry())),
50422
+ catch: (cause3) => new FSError({ path: BOTS_FILE, op: "read", cause: cause3 })
50423
+ });
50424
+ var addBot = (inputPath) => Effect_exports.gen(function* () {
50425
+ const trimmed = inputPath.trim();
50426
+ if (!trimmed) return yield* Effect_exports.fail(invalidPath("missing"));
50427
+ if (!path3.isAbsolute(trimmed)) return yield* Effect_exports.fail(invalidPath("must be absolute"));
50428
+ const requested = botPaths(path3, trimmed).dir;
50429
+ const dir = yield* Effect_exports.try({
50430
+ try: () => realpathSync3.native(requested),
50431
+ catch: (cause3) => fsReason("directory", requested, cause3)
50432
+ });
50433
+ const builtin = findBuiltinBotByPath(dir);
50434
+ if (builtin) return { ...builtin, alreadyExists: true };
50435
+ const manifestPath = botPaths(path3, dir).manifest;
50436
+ const content = yield* Effect_exports.try({
50437
+ try: () => readManifest(manifestPath),
50438
+ catch: (cause3) => fsReason("BOT.md", manifestPath, cause3)
50439
+ });
50440
+ const manifest = yield* Effect_exports.try({
50441
+ try: () => parseBotDocument(path3, content, dir),
50442
+ catch: (cause3) => invalidPath(cause3 instanceof Error ? cause3.message : String(cause3))
50443
+ });
50444
+ const outcome = yield* Effect_exports.tryPromise({
50445
+ try: () => withFileLock(BOTS_FILE, async () => {
50446
+ const registry3 = await readRegistry();
50447
+ const existing = registry3.bots.find((bot) => bot.path === dir);
50448
+ if (existing) return { kind: "existing", bot: resolveBot(path3, existing, readManifest) };
50449
+ const clash = findNameClash(mergeBuiltins(resolveRegisteredBots(registry3)), manifest.name, dir);
50450
+ if (clash) return { kind: "clash", bot: clash };
50451
+ const record2 = { id: `bot-${randomUUID5()}`, path: dir, addedAt: (/* @__PURE__ */ new Date()).toISOString() };
50452
+ await writeJsonFile(BOTS_FILE, { bots: [...registry3.bots, record2] });
50453
+ return { kind: "added", record: record2 };
50454
+ }),
50455
+ catch: (cause3) => new FSError({ path: BOTS_FILE, op: "write", cause: cause3 })
50456
+ });
50457
+ switch (outcome.kind) {
50458
+ case "existing":
50459
+ return { ...outcome.bot, alreadyExists: true };
50460
+ case "clash":
50461
+ return yield* Effect_exports.fail(invalidPath(`@${manifest.name} is already registered at ${outcome.bot.path}`));
50462
+ case "added":
50463
+ return { ...outcome.record, valid: true, ...manifest, alreadyExists: false };
50464
+ }
50465
+ });
50466
+ var removeBot = (id3) => Effect_exports.gen(function* () {
50467
+ if (isBuiltinBotId(id3)) {
50468
+ return yield* Effect_exports.fail(new ValidationError({ field: "id", reason: "built-in Bots cannot be removed" }));
50469
+ }
50470
+ const removed = yield* Effect_exports.tryPromise({
50471
+ try: () => withFileLock(BOTS_FILE, async () => {
50472
+ const registry3 = await readRegistry();
50473
+ if (!registry3.bots.some((bot) => bot.id === id3)) return false;
50474
+ await writeJsonFile(BOTS_FILE, { bots: registry3.bots.filter((bot) => bot.id !== id3) });
50475
+ return true;
50476
+ }),
50477
+ catch: (cause3) => new FSError({ path: BOTS_FILE, op: "write", cause: cause3 })
50478
+ });
50479
+ if (!removed) return yield* Effect_exports.fail(new NotFoundError({ resource: "bot", id: id3 }));
50480
+ });
50481
+ var BotRegistryServiceLive = Layer_exports.succeed(BotRegistryService, {
50482
+ list: listBots,
50483
+ add: addBot,
50484
+ remove: removeBot
50485
+ });
50486
+
49814
50487
  // packages/shared/effect-runtime/src/server/runtime.ts
49815
50488
  var isDev = process.env.COCKPIT_ENV === "dev";
49816
50489
  var ServerBaseLayer = Layer_exports.unwrapEffect(
@@ -49840,7 +50513,9 @@ var AppLayer = Layer_exports.mergeAll(
49840
50513
  // Cross-project session search (/api/sessions/search)
49841
50514
  SessionSearchServiceLive,
49842
50515
  // Fire-and-forget sub-task sessions + session status (/api/sessions/delegate, /status)
49843
- DelegationServiceLive
50516
+ DelegationServiceLive,
50517
+ // User-registered Bot directories (bot.json)
50518
+ BotRegistryServiceLive
49844
50519
  );
49845
50520
  var AppRuntime = ManagedRuntime_exports.make(AppLayer);
49846
50521
 
@@ -49947,16 +50622,16 @@ function snapshotOnRunEvent(cwd, sessionKey, provider, event) {
49947
50622
  }
49948
50623
 
49949
50624
  // packages/feature/agent/src/server/lib/slashCommands.ts
49950
- import { mkdirSync as mkdirSync6, writeFileSync as writeFileSync6, readFileSync as readFileSync7 } from "fs";
49951
- import { join as join15 } from "path";
50625
+ import { mkdirSync as mkdirSync7, writeFileSync as writeFileSync7, readFileSync as readFileSync9 } from "fs";
50626
+ import path4, { join as join16 } from "path";
49952
50627
 
49953
50628
  // packages/feature/agent/src/server/lib/builtinSkills.ts
49954
- import { readFileSync as readFileSync6, readdirSync as readdirSync4, statSync as statSync5 } from "fs";
49955
- import { join as join14 } from "path";
50629
+ import { readFileSync as readFileSync8, readdirSync as readdirSync5, statSync as statSync6 } from "fs";
50630
+ import { join as join15 } from "path";
49956
50631
  function listBuiltinSkillNames() {
49957
50632
  let entries2;
49958
50633
  try {
49959
- entries2 = readdirSync4(BUILTIN_SKILLS_SRC_DIR, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name);
50634
+ entries2 = readdirSync5(BUILTIN_SKILLS_SRC_DIR, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name);
49960
50635
  } catch (err) {
49961
50636
  console.error(
49962
50637
  `[skills] cannot read builtin skills dir ${BUILTIN_SKILLS_SRC_DIR} \u2014 all builtin slash commands are unavailable:`,
@@ -49966,18 +50641,32 @@ function listBuiltinSkillNames() {
49966
50641
  }
49967
50642
  return entries2.filter((name) => {
49968
50643
  try {
49969
- return statSync5(builtinSkillPath(name)).isFile();
50644
+ return statSync6(builtinSkillPath(name)).isFile();
49970
50645
  } catch {
49971
50646
  return false;
49972
50647
  }
49973
50648
  }).sort();
49974
50649
  }
49975
50650
  function builtinSkillPath(name) {
49976
- return join14(BUILTIN_SKILLS_SRC_DIR, name, "SKILL.md");
50651
+ return join15(BUILTIN_SKILLS_SRC_DIR, name, "SKILL.md");
50652
+ }
50653
+ function listBuiltinSkillExtras(name) {
50654
+ try {
50655
+ return readdirSync5(join15(BUILTIN_SKILLS_SRC_DIR, name), { withFileTypes: true }).filter((e) => e.isFile() && e.name.endsWith(".md") && e.name !== "SKILL.md").map((e) => e.name).sort();
50656
+ } catch {
50657
+ return [];
50658
+ }
50659
+ }
50660
+ function readBuiltinSkillExtra(name, file2) {
50661
+ try {
50662
+ return readFileSync8(join15(BUILTIN_SKILLS_SRC_DIR, name, file2), "utf-8");
50663
+ } catch {
50664
+ return null;
50665
+ }
49977
50666
  }
49978
50667
  function readBuiltinSkill(name) {
49979
50668
  try {
49980
- return readFileSync6(builtinSkillPath(name), "utf-8");
50669
+ return readFileSync8(builtinSkillPath(name), "utf-8");
49981
50670
  } catch {
49982
50671
  return null;
49983
50672
  }
@@ -49990,32 +50679,46 @@ function readFrontmatterField(text, field) {
49990
50679
  }
49991
50680
 
49992
50681
  // packages/feature/agent/src/server/lib/slashCommands.ts
49993
- var BUILTIN_SKILLS_OUT_DIR = join15(COCKPIT_DIR, "skills");
50682
+ var BUILTIN_SKILLS_OUT_DIR = join16(COCKPIT_DIR, "skills");
49994
50683
  function deriveBaseUrl() {
49995
50684
  const port3 = process.env.COCKPIT_PORT || process.env.PORT || "3457";
49996
50685
  return `http://localhost:${port3}`;
49997
50686
  }
49998
- var COMMAND_LINE_RE = /^\s*([/@])(\S+?)(?:\s+|$)/;
49999
- function resolveCommandPrompt(prompt, language = "en", _req) {
50687
+ var COMMAND_LINE_RE = /^\s*(\/@|\/|@)(\S+?)(?:\s+|$)/;
50688
+ function resolveCommandPrompt(prompt, language = "en", _req, cwd) {
50000
50689
  const lang = language.startsWith("zh") ? "zh" : "en";
50001
50690
  const userSkills = listUserSkills();
50002
50691
  const builtins = new Set(listBuiltinSkillNames());
50003
- const isKnown = (cmd) => builtins.has(cmd) || userSkills.some((s) => s.name === cmd);
50692
+ const { bots, corrupt: registryCorrupt } = listRegisteredBots();
50693
+ const isKnown = (marker, cmd) => marker === "@" ? bots.has(cmd) : builtins.has(cmd) || userSkills.some((s) => s.name === cmd);
50694
+ const unresolved = [];
50004
50695
  const lines = prompt.split("\n");
50005
50696
  const cmds = [];
50006
50697
  lines.forEach((line, i) => {
50007
50698
  const m = line.match(COMMAND_LINE_RE);
50008
- if (m && isKnown(m[2])) {
50009
- cmds.push({ i, marker: m[1], cmd: m[2], rest: line.slice(m[0].length).trim() });
50699
+ if (!m) return;
50700
+ const marker = m[1];
50701
+ if (isKnown(marker, m[2])) {
50702
+ const local = marker === "@" && isLocalBotDir(cwd, bots.get(m[2]));
50703
+ cmds.push({ i, marker, cmd: m[2], rest: line.slice(m[0].length).trim(), local });
50704
+ return;
50705
+ }
50706
+ if (marker !== "@") return;
50707
+ if (builtins.has(m[2]) || userSkills.some((s) => s.name === m[2])) {
50708
+ console.warn(`[skills] "@${m[2]}" is not a registered Bot; the subagent form is now "/@${m[2]}" \u2014 left as plain text`);
50709
+ unresolved.push(`@${m[2]} \u2192 the subagent form for a skill is now /@${m[2]}`);
50710
+ } else if (registryCorrupt) {
50711
+ unresolved.push(`@${m[2]} \u2192 could not be resolved: ${BOTS_FILE} does not parse`);
50010
50712
  }
50011
50713
  });
50012
- if (cmds.length === 0) return prompt;
50013
- const showLocus = cmds.length >= 2 || cmds.some((c) => c.marker === "@");
50714
+ if (cmds.length === 0) return appendUnresolvedNote(prompt, unresolved, lang);
50715
+ const showLocus = cmds.length >= 2 || cmds.some((c) => c.marker !== "/");
50014
50716
  const baseUrl = deriveBaseUrl();
50015
50717
  const rendered = /* @__PURE__ */ new Map();
50016
50718
  const consumed = /* @__PURE__ */ new Set();
50017
50719
  const listed = [];
50018
50720
  const seen = /* @__PURE__ */ new Set();
50721
+ const key = (kind, name) => `${kind}:${name}`;
50019
50722
  cmds.forEach((c, k) => {
50020
50723
  const nextCmd = k + 1 < cmds.length ? cmds[k + 1].i : lines.length;
50021
50724
  const bodyLines = [];
@@ -50025,43 +50728,94 @@ function resolveCommandPrompt(prompt, language = "en", _req) {
50025
50728
  bodyLines.push(lines[j].trim());
50026
50729
  consumed.add(j);
50027
50730
  }
50028
- const ref = resolveSkillRef(c.cmd, baseUrl, userSkills);
50029
- rendered.set(c.i, renderCommandLine(c.marker, ref, bodyLines.join("\n"), lang, showLocus));
50030
- if (ref.path && !seen.has(ref.name)) {
50031
- seen.add(ref.name);
50032
- listed.push({ name: ref.name, path: ref.path });
50731
+ const ref = c.marker === "@" ? { name: `@${c.cmd}`, path: bots.get(c.cmd), content: null } : resolveSkillRef(c.cmd, baseUrl, userSkills);
50732
+ const mainSession = c.marker === "/" || c.local;
50733
+ rendered.set(c.i, renderCommandLine(mainSession, ref, bodyLines.join("\n"), lang, showLocus));
50734
+ const kind = c.marker === "@" && !c.local ? "handoff" : "read";
50735
+ if (ref.path && !seen.has(key(kind, ref.name))) {
50736
+ seen.add(key(kind, ref.name));
50737
+ listed.push({ name: ref.name, path: ref.path, kind });
50033
50738
  }
50034
50739
  });
50740
+ let botRunInline = null;
50741
+ let botTurnInline = null;
50742
+ const delegates = cmds.some((c) => c.marker === "@" && !c.local);
50743
+ const runsHere = cmds.some((c) => c.marker === "@" && c.local);
50744
+ if (delegates || runsHere) {
50745
+ const turn = resolveSkillRef("bot-turn", baseUrl, userSkills);
50746
+ if (delegates && turn.path && !seen.has(key("handoff", turn.name))) {
50747
+ seen.add(key("handoff", turn.name));
50748
+ listed.unshift({ name: turn.name, path: turn.path, kind: "handoff" });
50749
+ }
50750
+ if (runsHere) {
50751
+ if (turn.path && !seen.has(key("read", turn.name))) {
50752
+ seen.add(key("read", turn.name));
50753
+ listed.unshift({ name: turn.name, path: turn.path, kind: "read" });
50754
+ } else if (!turn.path) {
50755
+ botTurnInline = turn.content;
50756
+ }
50757
+ }
50758
+ if (delegates) {
50759
+ const run6 = resolveSkillRef("bot-run", baseUrl, userSkills);
50760
+ if (run6.path && !seen.has(key("read", run6.name))) {
50761
+ seen.add(key("read", run6.name));
50762
+ listed.unshift({ name: run6.name, path: run6.path, kind: "read" });
50763
+ } else if (!run6.path) {
50764
+ botRunInline = run6.content;
50765
+ }
50766
+ }
50767
+ }
50035
50768
  const out = [];
50036
50769
  for (let i = 0; i < lines.length; i++) {
50037
50770
  if (consumed.has(i)) continue;
50038
50771
  out.push(rendered.get(i) ?? lines[i]);
50039
50772
  }
50040
50773
  let result = out.join("\n");
50041
- if (listed.length > 0) {
50042
- const header = lang === "zh" ? "\u8BF7\u5148\u8BFB\u53D6\u4EE5\u4E0B skill \u6587\u4EF6\uFF0C\u518D\u636E\u6B64\u6267\u884C\uFF1A" : "Read these skill files first, then act accordingly:";
50774
+ const block = (kind, header) => {
50775
+ const items = listed.filter((s) => s.kind === kind);
50776
+ if (items.length === 0) return null;
50043
50777
  const sep2 = lang === "zh" ? "\uFF1A" : ": ";
50044
- const entries2 = listed.map((s) => `- ${s.name}${sep2}${s.path}`).join("\n");
50045
- result = `${result}
50778
+ return `${header}
50779
+ ${items.map((s) => `- ${s.name}${sep2}${s.path}`).join("\n")}`;
50780
+ };
50781
+ const handoffHeader = runsHere ? lang === "zh" ? "\u4EE5\u4E0B\u8DEF\u5F84\u539F\u6837\u8F6C\u4EA4\u7ED9\u4F60\u6D3E\u53D1\u7684\u5B50\u4F1A\u8BDD\uFF1B\u9664\u4E0A\u9762\u8BFB\u53D6\u5217\u8868\u5DF2\u5217\u51FA\u7684\u4EE5\u5916\uFF0C\u4E0D\u8981\u81EA\u5DF1\u6253\u5F00\uFF1A" : "Pass these paths verbatim to the session you delegate to; do not open any that the read list above does not already list:" : lang === "zh" ? "\u4EE5\u4E0B\u6587\u4EF6\u4EA4\u7ED9\u4F60\u6D3E\u53D1\u7684\u5B50\u4F1A\u8BDD\u53BB\u8BFB\uFF0C\u4F60\u53EA\u8F6C\u4EA4\u8DEF\u5F84\uFF0C\u4E0D\u8981\u81EA\u5DF1\u6253\u5F00\uFF1A" : "These files are for the session you delegate to. Pass the paths along; do not open them yourself:";
50782
+ const blocks = [
50783
+ block("read", lang === "zh" ? "\u8BF7\u5148\u8BFB\u53D6\u4EE5\u4E0B skill \u6587\u4EF6\uFF0C\u518D\u636E\u6B64\u6267\u884C\uFF1A" : "Read these skill files first, then act accordingly:"),
50784
+ block("handoff", handoffHeader),
50785
+ botRunInline,
50786
+ botTurnInline
50787
+ ].filter((b) => b !== null);
50788
+ if (blocks.length > 0) result = `${result}
50789
+
50790
+ ${blocks.join("\n\n")}`;
50791
+ return appendUnresolvedNote(result, unresolved, lang);
50792
+ }
50793
+ function appendUnresolvedNote(result, unresolved, lang) {
50794
+ if (unresolved.length === 0) return result;
50795
+ const header = lang === "zh" ? "\u4EE5\u4E0B @ \u5F00\u5934\u7684\u884C\u6CA1\u6709\u88AB\u8BC6\u522B\uFF0C\u5DF2\u6309\u666E\u901A\u6587\u672C\u5904\u7406\uFF0C\u8BF7\u544A\u77E5\u7528\u6237\uFF1A" : "These @ lines were not recognised and were left as plain text. Tell the user:";
50796
+ return `${result}
50046
50797
 
50047
50798
  ${header}
50048
- ${entries2}`;
50049
- }
50050
- return result;
50799
+ ${unresolved.map((u) => `- ${u}`).join("\n")}`;
50051
50800
  }
50052
- function renderCommandLine(marker, ref, body, lang, showLocus) {
50801
+ function renderCommandLine(mainSession, ref, body, lang, showLocus) {
50053
50802
  if (ref.path) {
50054
- const tag = showLocus ? `[${locusWord(marker, lang)}\xB7${ref.name}]` : `[${ref.name}]`;
50803
+ const tag = showLocus ? `[${locusWord(mainSession, lang)}\xB7${ref.name}]` : `[${ref.name}]`;
50055
50804
  return body ? `${tag} ${body}` : tag;
50056
50805
  }
50057
- const locus = showLocus ? `[${locusWord(marker, lang)}] ` : "";
50806
+ const locus = showLocus ? `[${locusWord(mainSession, lang)}] ` : "";
50058
50807
  const then = body ? lang === "zh" ? `\uFF0C\u7136\u540E\uFF1A${body}` : `, then: ${body}` : "";
50059
50808
  return `${locus}${ref.content ?? ""}${then}`;
50060
50809
  }
50061
- function locusWord(marker, lang) {
50062
- if (marker === "@") return "subagent";
50810
+ function locusWord(mainSession, lang) {
50811
+ if (!mainSession) return "subagent";
50063
50812
  return lang === "zh" ? "\u4E3B\u4F1A\u8BDD" : "main session";
50064
50813
  }
50814
+ function isLocalBotDir(cwd, manifestPath) {
50815
+ if (!cwd || !path4.isAbsolute(cwd)) return false;
50816
+ const norm = (p) => realpathOr(p.replace(/[\\/]+$/, ""));
50817
+ return norm(cwd) === norm(path4.dirname(manifestPath));
50818
+ }
50065
50819
  function resolveSkillRef(cmd, baseUrl, userSkills) {
50066
50820
  const skill = userSkills.find((s) => s.name === cmd);
50067
50821
  if (skill) return { name: cmd, path: skill.path, content: null };
@@ -50070,13 +50824,13 @@ function resolveSkillRef(cmd, baseUrl, userSkills) {
50070
50824
  console.error(`[skills] builtin "${cmd}" disappeared while resolving it`);
50071
50825
  return { name: cmd, path: null, content: null };
50072
50826
  }
50073
- const content = source.replaceAll("{{BASE_URL}}", baseUrl);
50074
- const skillPath = writeBuiltinSkill(cmd, content);
50827
+ const content = substitute(source, baseUrl);
50828
+ const skillPath = writeBuiltinSkill(cmd, content, baseUrl);
50075
50829
  return skillPath ? { name: cmd, path: skillPath, content: null } : { name: cmd, path: null, content };
50076
50830
  }
50077
50831
  function listUserSkills() {
50078
50832
  try {
50079
- const data = JSON.parse(readFileSync7(SKILLS_FILE, "utf-8"));
50833
+ const data = JSON.parse(readFileSync9(SKILLS_FILE, "utf-8"));
50080
50834
  const out = [];
50081
50835
  for (const s of data.skills ?? []) {
50082
50836
  const name = readSkillName(s.path);
@@ -50087,35 +50841,65 @@ function listUserSkills() {
50087
50841
  return [];
50088
50842
  }
50089
50843
  }
50090
- function readSkillName(path2) {
50844
+ function listRegisteredBots() {
50845
+ const builtins = listBuiltinBots();
50846
+ const withBuiltins = (registered) => mentionableBots(path4, [...builtins, ...registered]);
50847
+ let raw;
50848
+ try {
50849
+ raw = readFileSync9(BOTS_FILE, "utf-8");
50850
+ } catch {
50851
+ return { bots: withBuiltins([]), corrupt: false };
50852
+ }
50853
+ try {
50854
+ const data = JSON.parse(raw);
50855
+ const read = (manifest) => readFileSync9(manifest, "utf-8");
50856
+ return { bots: withBuiltins((data.bots ?? []).map((r) => resolveBot(path4, r, read))), corrupt: false };
50857
+ } catch (err) {
50858
+ console.error(`[skills] ${BOTS_FILE} does not parse \u2014 every registered @bot line is left as plain text:`, err);
50859
+ return { bots: withBuiltins([]), corrupt: true };
50860
+ }
50861
+ }
50862
+ function readSkillName(path5) {
50091
50863
  try {
50092
- return readFrontmatterField(readFileSync7(path2, "utf-8"), "name");
50864
+ return readFrontmatterField(readFileSync9(path5, "utf-8"), "name");
50093
50865
  } catch {
50094
50866
  return null;
50095
50867
  }
50096
50868
  }
50097
- function writeBuiltinSkill(cmd, content) {
50869
+ function writeBuiltinSkill(cmd, content, baseUrl) {
50098
50870
  try {
50099
- const dir = join15(BUILTIN_SKILLS_OUT_DIR, cmd);
50100
- mkdirSync6(dir, { recursive: true });
50101
- const filePath = join15(dir, "SKILL.md");
50102
- writeFileSync6(filePath, content.endsWith("\n") ? content : `${content}
50871
+ const dir = join16(BUILTIN_SKILLS_OUT_DIR, cmd);
50872
+ mkdirSync7(dir, { recursive: true });
50873
+ const filePath = join16(dir, "SKILL.md");
50874
+ writeFileSync7(filePath, content.endsWith("\n") ? content : `${content}
50103
50875
  `, "utf-8");
50876
+ for (const file2 of listBuiltinSkillExtras(cmd)) {
50877
+ const extra = readBuiltinSkillExtra(cmd, file2);
50878
+ if (extra === null) continue;
50879
+ try {
50880
+ writeFileSync7(join16(dir, file2), substitute(extra, baseUrl), "utf-8");
50881
+ } catch (err) {
50882
+ console.error(`[skills] builtin "${cmd}": cannot write reference file ${file2}:`, err);
50883
+ }
50884
+ }
50104
50885
  return filePath;
50105
50886
  } catch {
50106
50887
  return null;
50107
50888
  }
50108
50889
  }
50890
+ function substitute(text, baseUrl) {
50891
+ return text.replaceAll("{{BASE_URL}}", baseUrl).replaceAll("{{COCKPIT_DIR}}", COCKPIT_DIR);
50892
+ }
50109
50893
 
50110
50894
  // packages/feature/agent/src/server/engines/orchestrator.ts
50111
- import { randomUUID as randomUUID5 } from "crypto";
50895
+ import { randomUUID as randomUUID6 } from "crypto";
50112
50896
  async function dispatchChat2(spec, body, request2) {
50113
50897
  const { sessionId, images, cwd, language } = body;
50114
50898
  if (sessionId && isRunActive(sessionId)) {
50115
50899
  return { ok: false, status: 409, error: "session is already running" };
50116
50900
  }
50117
50901
  const rawPrompt = body.prompt;
50118
- const prompt = typeof rawPrompt === "string" ? resolveCommandPrompt(rawPrompt, language, request2) : rawPrompt;
50902
+ const prompt = typeof rawPrompt === "string" ? resolveCommandPrompt(rawPrompt, language, request2, cwd) : rawPrompt;
50119
50903
  const hasContent = prompt && typeof prompt === "string" || images && images.length > 0;
50120
50904
  if (!hasContent) {
50121
50905
  return { ok: false, status: 400, error: "Missing prompt or images" };
@@ -50126,11 +50910,11 @@ async function dispatchChat2(spec, body, request2) {
50126
50910
  }
50127
50911
  const promptText = typeof prompt === "string" ? prompt : void 0;
50128
50912
  const abort = new AbortController();
50129
- const runId = typeof body.runId === "string" && body.runId || randomUUID5();
50913
+ const runId = typeof body.runId === "string" && body.runId || randomUUID6();
50130
50914
  let currentKey = sessionId || runId;
50131
50915
  let actualSessionId = sessionId;
50132
50916
  let isClosed = false;
50133
- if (!startRun(currentKey, cwd || "", promptText, runId)) {
50917
+ if (!startRun(currentKey, cwd || "", promptText, runId, spec.name)) {
50134
50918
  return { ok: false, status: 409, error: "run already active" };
50135
50919
  }
50136
50920
  setRunAbort(currentKey, () => {
@@ -50231,6 +51015,7 @@ export {
50231
51015
  findCodexSessionPath,
50232
51016
  ensureParentDir,
50233
51017
  readJsonFile,
51018
+ readJsonFileForUpdate,
50234
51019
  writeJsonFile,
50235
51020
  withFileLock,
50236
51021
  mutateJsonFile,