@qt4798/pi-web 0.9.21 → 0.9.23

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 (331) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +20 -17
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/required-server-files.js +1 -1
  5. package/.next/required-server-files.json +1 -1
  6. package/.next/routes-manifest.json +18 -0
  7. package/.next/server/app/_global-error/page.js +3 -3
  8. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/_global-error.html +1 -1
  10. package/.next/server/app/_global-error.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  16. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  17. package/.next/server/app/_not-found/page.js +2 -2
  18. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/.next/server/app/_not-found.html +1 -1
  20. package/.next/server/app/_not-found.rsc +2 -2
  21. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  22. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  23. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  24. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  25. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  26. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  27. package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
  28. package/.next/server/app/api/agent/[id]/events/route.js +2 -2
  29. package/.next/server/app/api/agent/[id]/route.js +1 -1
  30. package/.next/server/app/api/agent/new/route.js +1 -1
  31. package/.next/server/app/api/agent/running/events/route.js +1 -1
  32. package/.next/server/app/api/agent/running/route.js +1 -1
  33. package/.next/server/app/api/auth/all-providers/route.js +1 -1
  34. package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
  35. package/.next/server/app/api/auth/combined/route.js +1 -1
  36. package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
  37. package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
  38. package/.next/server/app/api/auth/providers/route.js +1 -1
  39. package/.next/server/app/api/backup/export/route.js +1 -1
  40. package/.next/server/app/api/backup/import/route.js +1 -1
  41. package/.next/server/app/api/cwd/browse/route.js +1 -1
  42. package/.next/server/app/api/cwd/validate/route.js +1 -1
  43. package/.next/server/app/api/deepseek/balance/route.js +1 -1
  44. package/.next/server/app/api/default-cwd/route.js +1 -1
  45. package/.next/server/app/api/events/route.js +2 -2
  46. package/.next/server/app/api/features/route.js +1 -1
  47. package/.next/server/app/api/file-index/route.js +1 -1
  48. package/.next/server/app/api/files/[...path]/route.js +1 -1
  49. package/.next/server/app/api/git/diff/route.js +2 -2
  50. package/.next/server/app/api/git/push/route.js +1 -1
  51. package/.next/server/app/api/git/stash/route.js +1 -1
  52. package/.next/server/app/api/git/status/route.js +1 -1
  53. package/.next/server/app/api/home/route.js +1 -1
  54. package/.next/server/app/api/import/discover/route.js +1 -1
  55. package/.next/server/app/api/import/execute/route.js +1 -1
  56. package/.next/server/app/api/import/status/route.js +1 -1
  57. package/.next/server/app/api/logs/route.js +1 -1
  58. package/.next/server/app/api/mcp/restart/route.js +1 -0
  59. package/.next/server/app/api/mcp/restart/route.js.nft.json +1 -0
  60. package/.next/server/app/api/mcp/restart/route_client-reference-manifest.js +1 -0
  61. package/.next/server/app/api/mcp/route.js +1 -1
  62. package/.next/server/app/api/models/route.js +1 -1
  63. package/.next/server/app/api/models-config/builtin/route.js +1 -1
  64. package/.next/server/app/api/models-config/catalog/route.js +1 -1
  65. package/.next/server/app/api/models-config/discover/route.js +1 -1
  66. package/.next/server/app/api/models-config/route.js +1 -1
  67. package/.next/server/app/api/models-config/test/route.js +1 -1
  68. package/.next/server/app/api/modes/route.js +1 -1
  69. package/.next/server/app/api/opencode-zen/external/key/route.js +1 -1
  70. package/.next/server/app/api/opencode-zen/external/test/route.js +1 -1
  71. package/.next/server/app/api/opencode-zen/import/route.js +1 -1
  72. package/.next/server/app/api/opencode-zen/key/route.js +1 -1
  73. package/.next/server/app/api/opencode-zen/route.js +1 -1
  74. package/.next/server/app/api/opencode-zen/test/route.js +1 -1
  75. package/.next/server/app/api/plugins/route.js +1 -1
  76. package/.next/server/app/api/project-aliases/route.js +1 -0
  77. package/.next/server/app/api/project-aliases/route.js.nft.json +1 -0
  78. package/.next/server/app/api/project-aliases/route_client-reference-manifest.js +1 -0
  79. package/.next/server/app/api/project-trust/route.js +1 -1
  80. package/.next/server/app/api/proxy/route.js +1 -1
  81. package/.next/server/app/api/proxy/test/route.js +1 -1
  82. package/.next/server/app/api/sessions/[id]/auto-name/route.js +3 -3
  83. package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
  84. package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
  85. package/.next/server/app/api/sessions/[id]/export/route.js +2 -2
  86. package/.next/server/app/api/sessions/[id]/queue-recovery/route.js +1 -1
  87. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  88. package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
  89. package/.next/server/app/api/sessions/route.js +1 -1
  90. package/.next/server/app/api/settings/title-model/route.js +1 -1
  91. package/.next/server/app/api/skills/check/route.js +1 -1
  92. package/.next/server/app/api/skills/install/route.js +1 -1
  93. package/.next/server/app/api/skills/route.js +2 -2
  94. package/.next/server/app/api/skills/search/route.js +1 -1
  95. package/.next/server/app/api/skills/update/route.js +1 -1
  96. package/.next/server/app/api/snippets/[id]/route.js +1 -1
  97. package/.next/server/app/api/snippets/route.js +1 -1
  98. package/.next/server/app/api/subagents/agents/[name]/route.js +2 -2
  99. package/.next/server/app/api/subagents/route.js +2 -2
  100. package/.next/server/app/api/subagents/transcript/route.js +1 -0
  101. package/.next/server/app/api/subagents/transcript/route.js.nft.json +1 -0
  102. package/.next/server/app/api/subagents/transcript/route_client-reference-manifest.js +1 -0
  103. package/.next/server/app/api/tasks/[id]/[action]/route.js +1 -1
  104. package/.next/server/app/api/tasks/[id]/changed-files/route.js +2 -2
  105. package/.next/server/app/api/tasks/[id]/diff/route.js +1 -1
  106. package/.next/server/app/api/tasks/[id]/events/route.js +1 -1
  107. package/.next/server/app/api/tasks/[id]/route.js +1 -1
  108. package/.next/server/app/api/tasks/batch/route.js +1 -1
  109. package/.next/server/app/api/tasks/events/route.js +2 -2
  110. package/.next/server/app/api/tasks/route.js +1 -1
  111. package/.next/server/app/api/tasks/settings/route.js +1 -1
  112. package/.next/server/app/api/tasks/templates/route.js +1 -1
  113. package/.next/server/app/api/themes/[name]/route.js +1 -1
  114. package/.next/server/app/api/themes/route.js +1 -1
  115. package/.next/server/app/api/usage/route.js +1 -1
  116. package/.next/server/app/api/vision-config/route.js +2 -2
  117. package/.next/server/app/api/worktrees/route.js +1 -1
  118. package/.next/server/app/icon.ico/route.js +1 -1
  119. package/.next/server/app/icon.png/route.js +1 -1
  120. package/.next/server/app/icon.svg/route.js +1 -1
  121. package/.next/server/app/index.html +1 -1
  122. package/.next/server/app/index.rsc +4 -4
  123. package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  124. package/.next/server/app/index.segments/_full.segment.rsc +4 -4
  125. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  126. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  127. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  128. package/.next/server/app/page.js +15 -15
  129. package/.next/server/app/page_client-reference-manifest.js +1 -1
  130. package/.next/server/app-paths-manifest.json +20 -17
  131. package/.next/server/chunks/4253.js +1 -1
  132. package/.next/server/chunks/5582.js +2 -2
  133. package/.next/server/chunks/6429.js +1 -1
  134. package/.next/server/chunks/7915.js +1 -1
  135. package/.next/server/middleware-build-manifest.js +1 -1
  136. package/.next/server/pages/404.html +1 -1
  137. package/.next/server/pages/500.html +1 -1
  138. package/.next/static/Zj8YLnblAjsL5HR_ER_d_/_buildManifest.js +1 -0
  139. package/.next/static/chunks/711-462ef5daacae3d6c.js +1 -0
  140. package/.next/static/chunks/app/_global-error/page-e106132a25a7dc95.js +1 -0
  141. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-e106132a25a7dc95.js +1 -0
  142. package/.next/static/chunks/app/api/agent/[id]/events/route-e106132a25a7dc95.js +1 -0
  143. package/.next/static/chunks/app/api/agent/[id]/route-e106132a25a7dc95.js +1 -0
  144. package/.next/static/chunks/app/api/agent/new/route-e106132a25a7dc95.js +1 -0
  145. package/.next/static/chunks/app/api/agent/running/events/route-e106132a25a7dc95.js +1 -0
  146. package/.next/static/chunks/app/api/agent/running/route-e106132a25a7dc95.js +1 -0
  147. package/.next/static/chunks/app/api/auth/all-providers/route-e106132a25a7dc95.js +1 -0
  148. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-e106132a25a7dc95.js +1 -0
  149. package/.next/static/chunks/app/api/auth/combined/route-e106132a25a7dc95.js +1 -0
  150. package/.next/static/chunks/app/api/auth/login/[provider]/route-e106132a25a7dc95.js +1 -0
  151. package/.next/static/chunks/app/api/auth/logout/[provider]/route-e106132a25a7dc95.js +1 -0
  152. package/.next/static/chunks/app/api/auth/providers/route-e106132a25a7dc95.js +1 -0
  153. package/.next/static/chunks/app/api/backup/export/route-e106132a25a7dc95.js +1 -0
  154. package/.next/static/chunks/app/api/backup/import/route-e106132a25a7dc95.js +1 -0
  155. package/.next/static/chunks/app/api/cwd/browse/route-e106132a25a7dc95.js +1 -0
  156. package/.next/static/chunks/app/api/cwd/validate/route-e106132a25a7dc95.js +1 -0
  157. package/.next/static/chunks/app/api/deepseek/balance/route-e106132a25a7dc95.js +1 -0
  158. package/.next/static/chunks/app/api/default-cwd/route-e106132a25a7dc95.js +1 -0
  159. package/.next/static/chunks/app/api/events/route-e106132a25a7dc95.js +1 -0
  160. package/.next/static/chunks/app/api/features/route-e106132a25a7dc95.js +1 -0
  161. package/.next/static/chunks/app/api/file-index/route-e106132a25a7dc95.js +1 -0
  162. package/.next/static/chunks/app/api/files/[...path]/route-e106132a25a7dc95.js +1 -0
  163. package/.next/static/chunks/app/api/git/diff/route-e106132a25a7dc95.js +1 -0
  164. package/.next/static/chunks/app/api/git/push/route-e106132a25a7dc95.js +1 -0
  165. package/.next/static/chunks/app/api/git/stash/route-e106132a25a7dc95.js +1 -0
  166. package/.next/static/chunks/app/api/git/status/route-e106132a25a7dc95.js +1 -0
  167. package/.next/static/chunks/app/api/home/route-e106132a25a7dc95.js +1 -0
  168. package/.next/static/chunks/app/api/import/discover/route-e106132a25a7dc95.js +1 -0
  169. package/.next/static/chunks/app/api/import/execute/route-e106132a25a7dc95.js +1 -0
  170. package/.next/static/chunks/app/api/import/status/route-e106132a25a7dc95.js +1 -0
  171. package/.next/static/chunks/app/api/logs/route-e106132a25a7dc95.js +1 -0
  172. package/.next/static/chunks/app/api/mcp/restart/route-e106132a25a7dc95.js +1 -0
  173. package/.next/static/chunks/app/api/mcp/route-e106132a25a7dc95.js +1 -0
  174. package/.next/static/chunks/app/api/models/route-e106132a25a7dc95.js +1 -0
  175. package/.next/static/chunks/app/api/models-config/builtin/route-e106132a25a7dc95.js +1 -0
  176. package/.next/static/chunks/app/api/models-config/catalog/route-e106132a25a7dc95.js +1 -0
  177. package/.next/static/chunks/app/api/models-config/discover/route-e106132a25a7dc95.js +1 -0
  178. package/.next/static/chunks/app/api/models-config/route-e106132a25a7dc95.js +1 -0
  179. package/.next/static/chunks/app/api/models-config/test/route-e106132a25a7dc95.js +1 -0
  180. package/.next/static/chunks/app/api/modes/route-e106132a25a7dc95.js +1 -0
  181. package/.next/static/chunks/app/api/opencode-zen/external/key/route-e106132a25a7dc95.js +1 -0
  182. package/.next/static/chunks/app/api/opencode-zen/external/test/route-e106132a25a7dc95.js +1 -0
  183. package/.next/static/chunks/app/api/opencode-zen/import/route-e106132a25a7dc95.js +1 -0
  184. package/.next/static/chunks/app/api/opencode-zen/key/route-e106132a25a7dc95.js +1 -0
  185. package/.next/static/chunks/app/api/opencode-zen/route-e106132a25a7dc95.js +1 -0
  186. package/.next/static/chunks/app/api/opencode-zen/test/route-e106132a25a7dc95.js +1 -0
  187. package/.next/static/chunks/app/api/plugins/route-e106132a25a7dc95.js +1 -0
  188. package/.next/static/chunks/app/api/project-aliases/route-e106132a25a7dc95.js +1 -0
  189. package/.next/static/chunks/app/api/project-trust/route-e106132a25a7dc95.js +1 -0
  190. package/.next/static/chunks/app/api/proxy/route-e106132a25a7dc95.js +1 -0
  191. package/.next/static/chunks/app/api/proxy/test/route-e106132a25a7dc95.js +1 -0
  192. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-e106132a25a7dc95.js +1 -0
  193. package/.next/static/chunks/app/api/sessions/[id]/context/route-e106132a25a7dc95.js +1 -0
  194. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-e106132a25a7dc95.js +1 -0
  195. package/.next/static/chunks/app/api/sessions/[id]/export/route-e106132a25a7dc95.js +1 -0
  196. package/.next/static/chunks/app/api/sessions/[id]/queue-recovery/route-e106132a25a7dc95.js +1 -0
  197. package/.next/static/chunks/app/api/sessions/[id]/route-e106132a25a7dc95.js +1 -0
  198. package/.next/static/chunks/app/api/sessions/[id]/state/route-e106132a25a7dc95.js +1 -0
  199. package/.next/static/chunks/app/api/sessions/route-e106132a25a7dc95.js +1 -0
  200. package/.next/static/chunks/app/api/settings/title-model/route-e106132a25a7dc95.js +1 -0
  201. package/.next/static/chunks/app/api/skills/check/route-e106132a25a7dc95.js +1 -0
  202. package/.next/static/chunks/app/api/skills/install/route-e106132a25a7dc95.js +1 -0
  203. package/.next/static/chunks/app/api/skills/route-e106132a25a7dc95.js +1 -0
  204. package/.next/static/chunks/app/api/skills/search/route-e106132a25a7dc95.js +1 -0
  205. package/.next/static/chunks/app/api/skills/update/route-e106132a25a7dc95.js +1 -0
  206. package/.next/static/chunks/app/api/snippets/[id]/route-e106132a25a7dc95.js +1 -0
  207. package/.next/static/chunks/app/api/snippets/route-e106132a25a7dc95.js +1 -0
  208. package/.next/static/chunks/app/api/subagents/agents/[name]/route-e106132a25a7dc95.js +1 -0
  209. package/.next/static/chunks/app/api/subagents/route-e106132a25a7dc95.js +1 -0
  210. package/.next/static/chunks/app/api/subagents/transcript/route-e106132a25a7dc95.js +1 -0
  211. package/.next/static/chunks/app/api/tasks/[id]/[action]/route-e106132a25a7dc95.js +1 -0
  212. package/.next/static/chunks/app/api/tasks/[id]/changed-files/route-e106132a25a7dc95.js +1 -0
  213. package/.next/static/chunks/app/api/tasks/[id]/diff/route-e106132a25a7dc95.js +1 -0
  214. package/.next/static/chunks/app/api/tasks/[id]/events/route-e106132a25a7dc95.js +1 -0
  215. package/.next/static/chunks/app/api/tasks/[id]/route-e106132a25a7dc95.js +1 -0
  216. package/.next/static/chunks/app/api/tasks/batch/route-e106132a25a7dc95.js +1 -0
  217. package/.next/static/chunks/app/api/tasks/events/route-e106132a25a7dc95.js +1 -0
  218. package/.next/static/chunks/app/api/tasks/route-e106132a25a7dc95.js +1 -0
  219. package/.next/static/chunks/app/api/tasks/settings/route-e106132a25a7dc95.js +1 -0
  220. package/.next/static/chunks/app/api/tasks/templates/route-e106132a25a7dc95.js +1 -0
  221. package/.next/static/chunks/app/api/themes/[name]/route-e106132a25a7dc95.js +1 -0
  222. package/.next/static/chunks/app/api/themes/route-e106132a25a7dc95.js +1 -0
  223. package/.next/static/chunks/app/api/usage/route-e106132a25a7dc95.js +1 -0
  224. package/.next/static/chunks/app/api/vision-config/route-e106132a25a7dc95.js +1 -0
  225. package/.next/static/chunks/app/api/worktrees/route-e106132a25a7dc95.js +1 -0
  226. package/.next/static/chunks/app/page-4e2e6b9b44c2727c.js +53 -0
  227. package/.next/static/chunks/next/dist/client/components/builtin/app-error-e106132a25a7dc95.js +1 -0
  228. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-e106132a25a7dc95.js +1 -0
  229. package/.next/static/chunks/next/dist/client/components/builtin/not-found-e106132a25a7dc95.js +1 -0
  230. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-e106132a25a7dc95.js +1 -0
  231. package/.next/static/css/437ace30775068cf.css +1 -0
  232. package/.next/trace +9 -9
  233. package/.next/trace-build +1 -1
  234. package/.next/types/app/api/mcp/restart/route.ts +351 -0
  235. package/.next/types/app/api/project-aliases/route.ts +351 -0
  236. package/.next/types/app/api/subagents/transcript/route.ts +351 -0
  237. package/.next/types/routes.d.ts +4 -1
  238. package/.next/types/validator.ts +27 -0
  239. package/package.json +1 -1
  240. package/.next/static/GxM26wqNKTWNiNc1-YXns/_buildManifest.js +0 -1
  241. package/.next/static/chunks/3555-b9de79b68c0278d5.js +0 -1
  242. package/.next/static/chunks/app/_global-error/page-3581deaae88a2371.js +0 -1
  243. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-3581deaae88a2371.js +0 -1
  244. package/.next/static/chunks/app/api/agent/[id]/events/route-3581deaae88a2371.js +0 -1
  245. package/.next/static/chunks/app/api/agent/[id]/route-3581deaae88a2371.js +0 -1
  246. package/.next/static/chunks/app/api/agent/new/route-3581deaae88a2371.js +0 -1
  247. package/.next/static/chunks/app/api/agent/running/events/route-3581deaae88a2371.js +0 -1
  248. package/.next/static/chunks/app/api/agent/running/route-3581deaae88a2371.js +0 -1
  249. package/.next/static/chunks/app/api/auth/all-providers/route-3581deaae88a2371.js +0 -1
  250. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-3581deaae88a2371.js +0 -1
  251. package/.next/static/chunks/app/api/auth/combined/route-3581deaae88a2371.js +0 -1
  252. package/.next/static/chunks/app/api/auth/login/[provider]/route-3581deaae88a2371.js +0 -1
  253. package/.next/static/chunks/app/api/auth/logout/[provider]/route-3581deaae88a2371.js +0 -1
  254. package/.next/static/chunks/app/api/auth/providers/route-3581deaae88a2371.js +0 -1
  255. package/.next/static/chunks/app/api/backup/export/route-3581deaae88a2371.js +0 -1
  256. package/.next/static/chunks/app/api/backup/import/route-3581deaae88a2371.js +0 -1
  257. package/.next/static/chunks/app/api/cwd/browse/route-3581deaae88a2371.js +0 -1
  258. package/.next/static/chunks/app/api/cwd/validate/route-3581deaae88a2371.js +0 -1
  259. package/.next/static/chunks/app/api/deepseek/balance/route-3581deaae88a2371.js +0 -1
  260. package/.next/static/chunks/app/api/default-cwd/route-3581deaae88a2371.js +0 -1
  261. package/.next/static/chunks/app/api/events/route-3581deaae88a2371.js +0 -1
  262. package/.next/static/chunks/app/api/features/route-3581deaae88a2371.js +0 -1
  263. package/.next/static/chunks/app/api/file-index/route-3581deaae88a2371.js +0 -1
  264. package/.next/static/chunks/app/api/files/[...path]/route-3581deaae88a2371.js +0 -1
  265. package/.next/static/chunks/app/api/git/diff/route-3581deaae88a2371.js +0 -1
  266. package/.next/static/chunks/app/api/git/push/route-3581deaae88a2371.js +0 -1
  267. package/.next/static/chunks/app/api/git/stash/route-3581deaae88a2371.js +0 -1
  268. package/.next/static/chunks/app/api/git/status/route-3581deaae88a2371.js +0 -1
  269. package/.next/static/chunks/app/api/home/route-3581deaae88a2371.js +0 -1
  270. package/.next/static/chunks/app/api/import/discover/route-3581deaae88a2371.js +0 -1
  271. package/.next/static/chunks/app/api/import/execute/route-3581deaae88a2371.js +0 -1
  272. package/.next/static/chunks/app/api/import/status/route-3581deaae88a2371.js +0 -1
  273. package/.next/static/chunks/app/api/logs/route-3581deaae88a2371.js +0 -1
  274. package/.next/static/chunks/app/api/mcp/route-3581deaae88a2371.js +0 -1
  275. package/.next/static/chunks/app/api/models/route-3581deaae88a2371.js +0 -1
  276. package/.next/static/chunks/app/api/models-config/builtin/route-3581deaae88a2371.js +0 -1
  277. package/.next/static/chunks/app/api/models-config/catalog/route-3581deaae88a2371.js +0 -1
  278. package/.next/static/chunks/app/api/models-config/discover/route-3581deaae88a2371.js +0 -1
  279. package/.next/static/chunks/app/api/models-config/route-3581deaae88a2371.js +0 -1
  280. package/.next/static/chunks/app/api/models-config/test/route-3581deaae88a2371.js +0 -1
  281. package/.next/static/chunks/app/api/modes/route-3581deaae88a2371.js +0 -1
  282. package/.next/static/chunks/app/api/opencode-zen/external/key/route-3581deaae88a2371.js +0 -1
  283. package/.next/static/chunks/app/api/opencode-zen/external/test/route-3581deaae88a2371.js +0 -1
  284. package/.next/static/chunks/app/api/opencode-zen/import/route-3581deaae88a2371.js +0 -1
  285. package/.next/static/chunks/app/api/opencode-zen/key/route-3581deaae88a2371.js +0 -1
  286. package/.next/static/chunks/app/api/opencode-zen/route-3581deaae88a2371.js +0 -1
  287. package/.next/static/chunks/app/api/opencode-zen/test/route-3581deaae88a2371.js +0 -1
  288. package/.next/static/chunks/app/api/plugins/route-3581deaae88a2371.js +0 -1
  289. package/.next/static/chunks/app/api/project-trust/route-3581deaae88a2371.js +0 -1
  290. package/.next/static/chunks/app/api/proxy/route-3581deaae88a2371.js +0 -1
  291. package/.next/static/chunks/app/api/proxy/test/route-3581deaae88a2371.js +0 -1
  292. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-3581deaae88a2371.js +0 -1
  293. package/.next/static/chunks/app/api/sessions/[id]/context/route-3581deaae88a2371.js +0 -1
  294. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-3581deaae88a2371.js +0 -1
  295. package/.next/static/chunks/app/api/sessions/[id]/export/route-3581deaae88a2371.js +0 -1
  296. package/.next/static/chunks/app/api/sessions/[id]/queue-recovery/route-3581deaae88a2371.js +0 -1
  297. package/.next/static/chunks/app/api/sessions/[id]/route-3581deaae88a2371.js +0 -1
  298. package/.next/static/chunks/app/api/sessions/[id]/state/route-3581deaae88a2371.js +0 -1
  299. package/.next/static/chunks/app/api/sessions/route-3581deaae88a2371.js +0 -1
  300. package/.next/static/chunks/app/api/settings/title-model/route-3581deaae88a2371.js +0 -1
  301. package/.next/static/chunks/app/api/skills/check/route-3581deaae88a2371.js +0 -1
  302. package/.next/static/chunks/app/api/skills/install/route-3581deaae88a2371.js +0 -1
  303. package/.next/static/chunks/app/api/skills/route-3581deaae88a2371.js +0 -1
  304. package/.next/static/chunks/app/api/skills/search/route-3581deaae88a2371.js +0 -1
  305. package/.next/static/chunks/app/api/skills/update/route-3581deaae88a2371.js +0 -1
  306. package/.next/static/chunks/app/api/snippets/[id]/route-3581deaae88a2371.js +0 -1
  307. package/.next/static/chunks/app/api/snippets/route-3581deaae88a2371.js +0 -1
  308. package/.next/static/chunks/app/api/subagents/agents/[name]/route-3581deaae88a2371.js +0 -1
  309. package/.next/static/chunks/app/api/subagents/route-3581deaae88a2371.js +0 -1
  310. package/.next/static/chunks/app/api/tasks/[id]/[action]/route-3581deaae88a2371.js +0 -1
  311. package/.next/static/chunks/app/api/tasks/[id]/changed-files/route-3581deaae88a2371.js +0 -1
  312. package/.next/static/chunks/app/api/tasks/[id]/diff/route-3581deaae88a2371.js +0 -1
  313. package/.next/static/chunks/app/api/tasks/[id]/events/route-3581deaae88a2371.js +0 -1
  314. package/.next/static/chunks/app/api/tasks/[id]/route-3581deaae88a2371.js +0 -1
  315. package/.next/static/chunks/app/api/tasks/batch/route-3581deaae88a2371.js +0 -1
  316. package/.next/static/chunks/app/api/tasks/events/route-3581deaae88a2371.js +0 -1
  317. package/.next/static/chunks/app/api/tasks/route-3581deaae88a2371.js +0 -1
  318. package/.next/static/chunks/app/api/tasks/settings/route-3581deaae88a2371.js +0 -1
  319. package/.next/static/chunks/app/api/tasks/templates/route-3581deaae88a2371.js +0 -1
  320. package/.next/static/chunks/app/api/themes/[name]/route-3581deaae88a2371.js +0 -1
  321. package/.next/static/chunks/app/api/themes/route-3581deaae88a2371.js +0 -1
  322. package/.next/static/chunks/app/api/usage/route-3581deaae88a2371.js +0 -1
  323. package/.next/static/chunks/app/api/vision-config/route-3581deaae88a2371.js +0 -1
  324. package/.next/static/chunks/app/api/worktrees/route-3581deaae88a2371.js +0 -1
  325. package/.next/static/chunks/app/page-3de6991e0964e474.js +0 -53
  326. package/.next/static/chunks/next/dist/client/components/builtin/app-error-3581deaae88a2371.js +0 -1
  327. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-3581deaae88a2371.js +0 -1
  328. package/.next/static/chunks/next/dist/client/components/builtin/not-found-3581deaae88a2371.js +0 -1
  329. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-3581deaae88a2371.js +0 -1
  330. package/.next/static/css/096d7027f97f110c.css +0 -1
  331. /package/.next/static/{GxM26wqNKTWNiNc1-YXns → Zj8YLnblAjsL5HR_ER_d_}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/page"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"27123":{"*":{"id":"81921","name":"*","chunks":[],"async":false}},"39247":{"*":{"id":"55100","name":"*","chunks":[],"async":false}},"57121":{"*":{"id":"35421","name":"*","chunks":[],"async":false}},"61304":{"*":{"id":"60440","name":"*","chunks":[],"async":false}},"64777":{"*":{"id":"82265","name":"*","chunks":[],"async":false}},"71892":{"*":{"id":"28420","name":"*","chunks":[],"async":false}},"74581":{"*":{"id":"61335","name":"*","chunks":[],"async":false}},"78616":{"*":{"id":"84342","name":"*","chunks":[],"async":false}},"86869":{"*":{"id":"74661","name":"*","chunks":[],"async":false}},"90484":{"*":{"id":"70664","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/client/components/builtin/global-error.js":{"id":27123,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":27123,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/client/components/client-page.js":{"id":61304,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/client/components/client-page.js":{"id":61304,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/client/components/client-segment.js":{"id":78616,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/client/components/client-segment.js":{"id":78616,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":64777,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":64777,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/client/components/layout-router.js":{"id":57121,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/client/components/layout-router.js":{"id":57121,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/client/components/render-from-template-context.js":{"id":74581,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":74581,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/lib/framework/boundary-components.js":{"id":90484,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":90484,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":86869,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":86869,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/katex/dist/katex.min.css":{"id":84559,"name":"*","chunks":["7177","static/chunks/app/layout-7b635840991e69cb.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/app/globals.css":{"id":66872,"name":"*","chunks":["7177","static/chunks/app/layout-7b635840991e69cb.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/@fontsource/ia-writer-quattro/index.css":{"id":26408,"name":"*","chunks":["7177","static/chunks/app/layout-7b635840991e69cb.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/@fontsource/ia-writer-quattro/400-italic.css":{"id":8057,"name":"*","chunks":["7177","static/chunks/app/layout-7b635840991e69cb.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/@fontsource/ia-writer-quattro/700.css":{"id":35279,"name":"*","chunks":["7177","static/chunks/app/layout-7b635840991e69cb.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/@fontsource/ia-writer-quattro/700-italic.css":{"id":48276,"name":"*","chunks":["7177","static/chunks/app/layout-7b635840991e69cb.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/@fontsource/lilex/index.css":{"id":12043,"name":"*","chunks":["7177","static/chunks/app/layout-7b635840991e69cb.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/components/AppShell.tsx":{"id":71892,"name":"*","chunks":["7330","static/chunks/d3ac728e-7964f816a1ca64e5.js","3555","static/chunks/3555-b9de79b68c0278d5.js","8974","static/chunks/app/page-3de6991e0964e474.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/hooks/useI18n.tsx":{"id":39247,"name":"*","chunks":["7330","static/chunks/d3ac728e-7964f816a1ca64e5.js","3555","static/chunks/3555-b9de79b68c0278d5.js","8974","static/chunks/app/page-3de6991e0964e474.js"],"async":false}},"entryCSSFiles":{"/Volumes/1T 原装/项目研发/pi-web-QT/":[],"/Volumes/1T 原装/项目研发/pi-web-QT/app/layout":[{"inlined":false,"path":"static/css/3790610024d16435.css"},{"inlined":false,"path":"static/css/096d7027f97f110c.css"}],"/Volumes/1T 原装/项目研发/pi-web-QT/app/page":[]},"rscModuleMapping":{"8057":{"*":{"id":"17","name":"*","chunks":[],"async":false}},"12043":{"*":{"id":"47561","name":"*","chunks":[],"async":false}},"26408":{"*":{"id":"77222","name":"*","chunks":[],"async":false}},"27123":{"*":{"id":"95547","name":"*","chunks":[],"async":false}},"35279":{"*":{"id":"10289","name":"*","chunks":[],"async":false}},"39247":{"*":{"id":"73884","name":"*","chunks":[],"async":false}},"48276":{"*":{"id":"64388","name":"*","chunks":[],"async":false}},"57121":{"*":{"id":"98099","name":"*","chunks":[],"async":false}},"61304":{"*":{"id":"15098","name":"*","chunks":[],"async":false}},"64777":{"*":{"id":"33859","name":"*","chunks":[],"async":false}},"66872":{"*":{"id":"82704","name":"*","chunks":[],"async":false}},"71892":{"*":{"id":"35790","name":"*","chunks":[],"async":false}},"74581":{"*":{"id":"16237","name":"*","chunks":[],"async":false}},"78616":{"*":{"id":"47644","name":"*","chunks":[],"async":false}},"84559":{"*":{"id":"25319","name":"*","chunks":[],"async":false}},"86869":{"*":{"id":"36675","name":"*","chunks":[],"async":false}},"90484":{"*":{"id":"98562","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}};
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/page"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"27123":{"*":{"id":"81921","name":"*","chunks":[],"async":false}},"39247":{"*":{"id":"55100","name":"*","chunks":[],"async":false}},"57121":{"*":{"id":"35421","name":"*","chunks":[],"async":false}},"61304":{"*":{"id":"60440","name":"*","chunks":[],"async":false}},"64777":{"*":{"id":"82265","name":"*","chunks":[],"async":false}},"74581":{"*":{"id":"61335","name":"*","chunks":[],"async":false}},"78616":{"*":{"id":"84342","name":"*","chunks":[],"async":false}},"86869":{"*":{"id":"74661","name":"*","chunks":[],"async":false}},"90484":{"*":{"id":"70664","name":"*","chunks":[],"async":false}},"98270":{"*":{"id":"28821","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/client/components/builtin/global-error.js":{"id":27123,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":27123,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/client/components/client-page.js":{"id":61304,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/client/components/client-page.js":{"id":61304,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/client/components/client-segment.js":{"id":78616,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/client/components/client-segment.js":{"id":78616,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":64777,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":64777,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/client/components/layout-router.js":{"id":57121,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/client/components/layout-router.js":{"id":57121,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/client/components/render-from-template-context.js":{"id":74581,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":74581,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/lib/framework/boundary-components.js":{"id":90484,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":90484,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":86869,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":86869,"name":"*","chunks":[],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/katex/dist/katex.min.css":{"id":84559,"name":"*","chunks":["7177","static/chunks/app/layout-7b635840991e69cb.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/app/globals.css":{"id":66872,"name":"*","chunks":["7177","static/chunks/app/layout-7b635840991e69cb.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/@fontsource/ia-writer-quattro/index.css":{"id":26408,"name":"*","chunks":["7177","static/chunks/app/layout-7b635840991e69cb.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/@fontsource/ia-writer-quattro/400-italic.css":{"id":8057,"name":"*","chunks":["7177","static/chunks/app/layout-7b635840991e69cb.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/@fontsource/ia-writer-quattro/700.css":{"id":35279,"name":"*","chunks":["7177","static/chunks/app/layout-7b635840991e69cb.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/@fontsource/ia-writer-quattro/700-italic.css":{"id":48276,"name":"*","chunks":["7177","static/chunks/app/layout-7b635840991e69cb.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/node_modules/@fontsource/lilex/index.css":{"id":12043,"name":"*","chunks":["7177","static/chunks/app/layout-7b635840991e69cb.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/components/AppShell.tsx":{"id":98270,"name":"*","chunks":["7330","static/chunks/d3ac728e-7964f816a1ca64e5.js","711","static/chunks/711-462ef5daacae3d6c.js","8974","static/chunks/app/page-4e2e6b9b44c2727c.js"],"async":false},"/Volumes/1T 原装/项目研发/pi-web-QT/hooks/useI18n.tsx":{"id":39247,"name":"*","chunks":["7330","static/chunks/d3ac728e-7964f816a1ca64e5.js","711","static/chunks/711-462ef5daacae3d6c.js","8974","static/chunks/app/page-4e2e6b9b44c2727c.js"],"async":false}},"entryCSSFiles":{"/Volumes/1T 原装/项目研发/pi-web-QT/":[],"/Volumes/1T 原装/项目研发/pi-web-QT/app/layout":[{"inlined":false,"path":"static/css/3790610024d16435.css"},{"inlined":false,"path":"static/css/437ace30775068cf.css"}],"/Volumes/1T 原装/项目研发/pi-web-QT/app/page":[]},"rscModuleMapping":{"8057":{"*":{"id":"17","name":"*","chunks":[],"async":false}},"12043":{"*":{"id":"47561","name":"*","chunks":[],"async":false}},"26408":{"*":{"id":"77222","name":"*","chunks":[],"async":false}},"27123":{"*":{"id":"95547","name":"*","chunks":[],"async":false}},"35279":{"*":{"id":"10289","name":"*","chunks":[],"async":false}},"39247":{"*":{"id":"73884","name":"*","chunks":[],"async":false}},"48276":{"*":{"id":"64388","name":"*","chunks":[],"async":false}},"57121":{"*":{"id":"98099","name":"*","chunks":[],"async":false}},"61304":{"*":{"id":"15098","name":"*","chunks":[],"async":false}},"64777":{"*":{"id":"33859","name":"*","chunks":[],"async":false}},"66872":{"*":{"id":"82704","name":"*","chunks":[],"async":false}},"74581":{"*":{"id":"16237","name":"*","chunks":[],"async":false}},"78616":{"*":{"id":"47644","name":"*","chunks":[],"async":false}},"84559":{"*":{"id":"25319","name":"*","chunks":[],"async":false}},"86869":{"*":{"id":"36675","name":"*","chunks":[],"async":false}},"90484":{"*":{"id":"98562","name":"*","chunks":[],"async":false}},"98270":{"*":{"id":"35790","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}};
@@ -34,57 +34,60 @@
34
34
  "/icon.png/route": "app/icon.png/route.js",
35
35
  "/icon.svg/route": "app/icon.svg/route.js",
36
36
  "/api/agent/[id]/bash-output/route": "app/api/agent/[id]/bash-output/route.js",
37
+ "/api/agent/[id]/events/route": "app/api/agent/[id]/events/route.js",
37
38
  "/api/agent/running/events/route": "app/api/agent/running/events/route.js",
38
39
  "/api/agent/running/route": "app/api/agent/running/route.js",
39
40
  "/api/auth/all-providers/route": "app/api/auth/all-providers/route.js",
40
- "/api/agent/[id]/events/route": "app/api/agent/[id]/events/route.js",
41
- "/api/auth/combined/route": "app/api/auth/combined/route.js",
42
41
  "/api/auth/api-key/[provider]/route": "app/api/auth/api-key/[provider]/route.js",
42
+ "/api/auth/combined/route": "app/api/auth/combined/route.js",
43
43
  "/api/auth/logout/[provider]/route": "app/api/auth/logout/[provider]/route.js",
44
+ "/api/auth/login/[provider]/route": "app/api/auth/login/[provider]/route.js",
44
45
  "/api/auth/providers/route": "app/api/auth/providers/route.js",
45
46
  "/api/backup/export/route": "app/api/backup/export/route.js",
46
- "/api/auth/login/[provider]/route": "app/api/auth/login/[provider]/route.js",
47
- "/api/events/route": "app/api/events/route.js",
47
+ "/api/backup/import/route": "app/api/backup/import/route.js",
48
48
  "/api/deepseek/balance/route": "app/api/deepseek/balance/route.js",
49
+ "/api/events/route": "app/api/events/route.js",
49
50
  "/api/features/route": "app/api/features/route.js",
50
- "/api/backup/import/route": "app/api/backup/import/route.js",
51
51
  "/api/git/diff/route": "app/api/git/diff/route.js",
52
52
  "/api/git/push/route": "app/api/git/push/route.js",
53
- "/api/git/status/route": "app/api/git/status/route.js",
54
53
  "/api/git/stash/route": "app/api/git/stash/route.js",
54
+ "/api/git/status/route": "app/api/git/status/route.js",
55
55
  "/api/logs/route": "app/api/logs/route.js",
56
+ "/api/mcp/restart/route": "app/api/mcp/restart/route.js",
56
57
  "/api/mcp/route": "app/api/mcp/route.js",
57
- "/api/models-config/route": "app/api/models-config/route.js",
58
- "/api/models-config/catalog/route": "app/api/models-config/catalog/route.js",
59
58
  "/api/models-config/builtin/route": "app/api/models-config/builtin/route.js",
59
+ "/api/models-config/catalog/route": "app/api/models-config/catalog/route.js",
60
60
  "/api/models-config/discover/route": "app/api/models-config/discover/route.js",
61
+ "/api/models-config/route": "app/api/models-config/route.js",
61
62
  "/api/models-config/test/route": "app/api/models-config/test/route.js",
62
- "/api/opencode-zen/external/key/route": "app/api/opencode-zen/external/key/route.js",
63
- "/api/modes/route": "app/api/modes/route.js",
64
63
  "/api/models/route": "app/api/models/route.js",
65
- "/api/opencode-zen/key/route": "app/api/opencode-zen/key/route.js",
66
- "/api/opencode-zen/import/route": "app/api/opencode-zen/import/route.js",
64
+ "/api/modes/route": "app/api/modes/route.js",
65
+ "/api/opencode-zen/external/key/route": "app/api/opencode-zen/external/key/route.js",
67
66
  "/api/opencode-zen/external/test/route": "app/api/opencode-zen/external/test/route.js",
68
- "/api/opencode-zen/test/route": "app/api/opencode-zen/test/route.js",
67
+ "/api/opencode-zen/import/route": "app/api/opencode-zen/import/route.js",
68
+ "/api/opencode-zen/key/route": "app/api/opencode-zen/key/route.js",
69
69
  "/api/opencode-zen/route": "app/api/opencode-zen/route.js",
70
+ "/api/opencode-zen/test/route": "app/api/opencode-zen/test/route.js",
71
+ "/api/project-aliases/route": "app/api/project-aliases/route.js",
70
72
  "/api/project-trust/route": "app/api/project-trust/route.js",
73
+ "/api/plugins/route": "app/api/plugins/route.js",
71
74
  "/api/proxy/route": "app/api/proxy/route.js",
72
75
  "/api/proxy/test/route": "app/api/proxy/test/route.js",
73
76
  "/api/sessions/[id]/export/route": "app/api/sessions/[id]/export/route.js",
74
- "/api/plugins/route": "app/api/plugins/route.js",
75
77
  "/api/settings/title-model/route": "app/api/settings/title-model/route.js",
76
78
  "/api/skills/check/route": "app/api/skills/check/route.js",
77
79
  "/api/skills/install/route": "app/api/skills/install/route.js",
78
80
  "/api/skills/route": "app/api/skills/route.js",
81
+ "/api/skills/search/route": "app/api/skills/search/route.js",
79
82
  "/api/skills/update/route": "app/api/skills/update/route.js",
80
83
  "/api/snippets/[id]/route": "app/api/snippets/[id]/route.js",
81
- "/api/skills/search/route": "app/api/skills/search/route.js",
82
84
  "/api/snippets/route": "app/api/snippets/route.js",
83
85
  "/api/subagents/agents/[name]/route": "app/api/subagents/agents/[name]/route.js",
84
- "/api/tasks/[id]/changed-files/route": "app/api/tasks/[id]/changed-files/route.js",
85
86
  "/api/subagents/route": "app/api/subagents/route.js",
87
+ "/api/subagents/transcript/route": "app/api/subagents/transcript/route.js",
88
+ "/api/tasks/[id]/changed-files/route": "app/api/tasks/[id]/changed-files/route.js",
86
89
  "/api/tasks/events/route": "app/api/tasks/events/route.js",
87
- "/api/vision-config/route": "app/api/vision-config/route.js",
88
90
  "/api/usage/route": "app/api/usage/route.js",
91
+ "/api/vision-config/route": "app/api/vision-config/route.js",
89
92
  "/page": "app/page.js"
90
93
  }
@@ -13,4 +13,4 @@ ${p}
13
13
 
14
14
  `:"",n+r+e+(f?`
15
15
 
16
- ${f}`:""));return await C.send({type:"prompt",message:E}),!0}catch(e){let c=e instanceof Error?e.message:String(e),d=(0,i._o)(b,a);return d&&("preparing"===d.status||"queued"===d.status)&&(q(a,d.runSeq,[d.status],"failed",{failureReason:"setup_error",lastError:c,settledAt:o(),finishedAt:o()}),(0,i.Q1)(b,{taskId:a,kind:"failed",actor:"engine",payload:{reason:"setup_error",message:c}})),!1}finally{c.launching.delete(a)}}async function u(a,b){try{let c=(await (0,h.P9)(a)).find(a=>a.branch===b);return c?.path??null}catch{return null}}async function v(a,b){let c=`task-${a.id}`,{session:d}=await (0,j.OF)(c,"",b,{});return{session:d}}async function w(a,b){let c=m().live.get(a.connectionId);if(!c||c.taskId!==a.taskId||!q(a.taskId,a.runSeq,["running","awaiting_input"],"review",{settledAt:o()}))return;(0,i.Q1)(b.projectRoot,{taskId:a.taskId,kind:"review",actor:"engine"});let d=(0,i.Rv)(b.projectRoot);d.preflightCommand&&await x(a,d.preflightCommand)}async function x(a,b){let c=(0,i._o)(a.projectRoot,a.taskId);if(c){p({...c,preflight:{status:"running",command:b}},"preflight_start","engine",{command:b});try{let c=await z(a.session.cwd,b),d=(0,i._o)(a.projectRoot,a.taskId);if(!d)return;p({...d,preflight:{status:0===c.code?"passed":"failed",command:b,exitCode:c.code,outputTail:0===c.code?null:c.output.slice(-4e3)}},0===c.code?"preflight_passed":"preflight_failed","engine",{command:b,exitCode:c.code})}catch(d){let c=(0,i._o)(a.projectRoot,a.taskId);if(!c)return;p({...c,preflight:{status:"failed",command:b,outputTail:d instanceof Error?d.message:String(d)}},"preflight_failed","engine",{command:b})}}}function y(a,b){return new Promise((c,d)=>{let e=(0,g.spawn)(b,{cwd:a,shell:!0,stdio:"ignore"});e.on("error",d),e.on("exit",a=>{0===a?c():d(Error(`init command exited with code ${a??"null"}`))})})}function z(a,b){return new Promise(c=>{let d=(0,g.spawn)(b,{cwd:a,shell:!0}),e="";d.stdout?.on("data",a=>{e+=a.toString()}),d.stderr?.on("data",a=>{e+=a.toString()}),d.on("error",()=>c({code:1,output:e})),d.on("exit",a=>c({code:a,output:e}))})}function A(a){return"/"+a.split("--").map(a=>decodeURIComponent(a)).join("/")}async function B(){try{await C()}catch{}}async function C(){let a=m();if(!a)return;let b=(0,i.z1)("__engine__").replace(/__engine__$/,"");if((0,e.existsSync)(b))for(let c of(0,e.readdirSync)(b,{withFileTypes:!0})){if(!c.isDirectory()||"__engine__"===c.name)continue;let b=A(c.name);for(let c of(0,i.h6)(b)){let d=a.byTask.get(c.id);d||"running"!==c.status&&"awaiting_input"!==c.status&&"merging"!==c.status?d||"preparing"!==c.status||(q(c.id,c.runSeq,["preparing"],"todo",{startedAt:null}),(0,i.Q1)(b,{taskId:c.id,kind:"recovered",actor:"engine"})):(q(c.id,c.runSeq,[c.status],"failed",{failureReason:"interrupted",lastError:"Engine restarted; the run was interrupted.",settledAt:o(),finishedAt:o()}),(0,i.Q1)(b,{taskId:c.id,kind:"interrupted",actor:"engine"}))}l()&&r(b)}}d()}catch(a){d(a)}})},15253:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Fk:()=>h,Y1:()=>g});var e=c(75430),f=a([e]);function g(a,b){return a&&(0,e.hasTrustRequiringProjectResources)(a)?{requiresTrust:!0,trusted:!0===new e.ProjectTrustStore(b).get(a)}:{requiresTrust:!1,trusted:!0}}function h(a,b){if(!g(a,b).requiresTrust)return;let c=new e.ProjectTrustStore(b);return{resolveProjectTrust:async()=>!0===c.get(a)}}e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},16176:a=>{"use strict";let b=Symbol();a.exports.probe=function(a,c,d){let e=c[b];if(e)return c.stat(a,(a,b)=>{if(a)return d(a);d(null,b.mtime,e)});let f=new Date(1e3*Math.ceil(Date.now()/1e3)+5);c.utimes(a,f,f,e=>{if(e)return d(e);c.stat(a,(a,e)=>{if(a)return d(a);let f=e.mtime.getTime()%1e3==0?"s":"ms";Object.defineProperty(c,b,{value:f}),d(null,e.mtime,f)})})},a.exports.getMtime=function(a){let b=Date.now();return"s"===a&&(b=1e3*Math.ceil(b/1e3)),new Date(b)}},17114:(a,b,c)=>{"use strict";c.d(b,{Gc:()=>g,ov:()=>h,pj:()=>i,wx:()=>j});var d=c(55511),e=c(29021);function f(a){return`${a}.queue.json`}function g(a,b,c){return{id:(0,d.randomUUID)(),kind:a,text:b,...c&&c.length>0?{images:c}:{},queuedAt:Date.now()}}function h(a){let b=f(a);if(!(0,e.existsSync)(b))return[];try{let a=JSON.parse((0,e.readFileSync)(b,"utf8"));if(!a||1!==a.version||!Array.isArray(a.entries))return[];return a.entries.filter(a=>!!a&&("steer"===a.kind||"followUp"===a.kind)&&"string"==typeof a.text)}catch{return[]}}function i(a,b){if(!a)return;let c=f(a),g=`${c}.tmp-${process.pid}-${(0,d.randomUUID)()}`;try{(0,e.writeFileSync)(g,JSON.stringify({version:1,entries:b}),"utf8"),(0,e.renameSync)(g,c)}catch(a){try{(0,e.rmSync)(g,{force:!0})}catch{}console.error(`[pi-web] failed to persist queue sidecar ${c}:`,a instanceof Error?a.message:String(a))}}function j(a){try{(0,e.rmSync)(f(a),{force:!0})}catch{}}},18437:(a,b,c)=>{"use strict";function d(a){if(void 0===a)return null;if(!Array.isArray(a))return"images must be an array";if(a.length>10)return"A message can include at most 10 images";for(let b of a)if(!function(a){var b;if(!a||"object"!=typeof a||"image"!==a.type||"string"!=typeof a.data||"string"!=typeof a.mimeType||(b=a.mimeType,!/^image\/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*$/.test(b)))return!1;let c=function(a){if(!a||a.length%4!=0)return null;let b=a.endsWith("==")?2:+!!a.endsWith("="),c=a.length-b,d=null;for(let b=0;b<c;b+=1){var e;let c=(e=a.charCodeAt(b))>=65&&e<=90?e-65:e>=97&&e<=122?e-97+26:e>=48&&e<=57?e-48+52:43===e?62:47===e?63:null;if(null===c)return null;d=c}for(let b=c;b<a.length;b+=1)if("="!==a[b])return null;return 2===b&&d%16!=0||1===b&&d%4!=0?null:a.length/4*3-b}(a.data);return null!==c&&c<=0xa00000}(b))return"Each image must be valid base64 image data with an image MIME type and be 10MB or smaller";return null}c.d(b,{kc:()=>d})},18827:(a,b,c)=>{var d=c(27910).Stream;a.exports=function(a){return{ReadStream:function b(c,e){if(!(this instanceof b))return new b(c,e);d.call(this);var f=this;this.path=c,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536;for(var g=Object.keys(e=e||{}),h=0,i=g.length;h<i;h++){var j=g[h];this[j]=e[j]}if(this.encoding&&this.setEncoding(this.encoding),void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}null!==this.fd?process.nextTick(function(){f._read()}):a.open(this.path,this.flags,this.mode,function(a,b){if(a){f.emit("error",a),f.readable=!1;return}f.fd=b,f.emit("open",b),f._read()})},WriteStream:function b(c,e){if(!(this instanceof b))return new b(c,e);d.call(this),this.path=c,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0;for(var f=Object.keys(e=e||{}),g=0,h=f.length;g<h;g++){var i=f[g];this[i]=e[i]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=a.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}},30116:(a,b,c)=>{"use strict";c.d(b,{LD:()=>m,kP:()=>o,ni:()=>n});var d=c(97563);function e(a){if(!a)return[];let b=[];for(let c of a){let a=function(a){let b=a.trim();if(!b)return null;let c=b.indexOf("="),d=b.indexOf("(");if(c>0&&(d<0||c<d)){let a=b.slice(0,c).trim();return a?{tool:a,subject:b.slice(c+1),literal:!0}:null}if(d>=0&&b.endsWith(")")){let a=b.slice(0,d).trim();return a?{tool:a,subject:b.slice(d+1,-1)}:null}return{tool:b}}(c);a&&b.push(a)}return b}function f(a){return void 0===a.subject?a.tool:a.literal?`${a.tool}=${a.subject}`:`${a.tool}(${a.subject})`}function g(a){return a.includes("*")||a.includes("?")}function h(a,b){return void 0===b.subject||""!==a&&(b.literal||!g(b.subject)?a===b.subject:(function(a){let b="^";for(let c of a)"*"===c?b+=".*":"?"===c?b+=".":b+=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return RegExp(b+"$")})(b.subject).test(a))}function i(a,b){return a.toLowerCase()===b.toLowerCase()}function j(a,b,c){for(let d of a)if(i(d.tool,b)&&h(c,d))return!0;return!1}function k(a){let b=a.trim();return!!b&&!!(/\$\(/.test(b)||/`/.test(b)||/(^|\s)(python|python3|node|ruby|perl|php)\s+-[a-z]*c(\s|$)/i.test(b)||/(^|\s)(sh|bash|zsh)\s+-c(\s|$)/i.test(b)||/(^|\s)(sudo|su)\s/i.test(b)||/;\s*[a-z]/i.test(b)||/\|\s*(sh|bash|zsh|python|python3|node)\b/i.test(b)||/\|\s*tee\b/i.test(b))}let l=["ls","cat","head","tail","grep","rg","find","wc","echo","pwd","cd","git status","git diff","git log","git branch","git remote","git stash list","git show","git ls-files","which","type","env","file","stat","du","df","history","man","less","more","tree","git diff --","git log --","curl -I","curl --head"];function m(a,b,c={}){let e=c.mode??"auto",f=c.readOnly??d.MJ.has(b.toLowerCase()),n=function(a,b){if("bash"===a.toLowerCase()){let a=b?.command;return"string"==typeof a&&a.trim()?`command:${a.trim()}`:""}let c=b??{},d="string"==typeof c.source_path?c.source_path:"",e="string"==typeof c.destination_path?c.destination_path:"";if(d&&e)return e!==d?`${d}\u0000${e}`:d;for(let a of["path","file_path","file","glob","pattern","directory"]){let b=c[a];if("string"==typeof b&&b)return b}return""}(b,c.args),o="bash"===b.toLowerCase(),p=o&&n.startsWith("command:")?n.slice(8):"";if(j(a.deny,b,n))return"deny";if(o&&p){let c=k(p);return j(a.allow,b,n)&&!c?"allow":j(a.ask,b,n)?"ask":c?a.allow.some(a=>i(a.tool,b)&&void 0!==a.subject&&!g(a.subject)&&h(n,a))||"yolo"===e?"allow":"ask":!function(a){let b=a.trim();if(!b||k(b)||/[;&|>]/.test(b))return!1;let c=b.toLowerCase();for(let a of l)if(c===a||c.startsWith(a+" "))return!0;return!1}(p)?"ask"===e?"ask":"allow":"allow"}return j(a.allow,b,n)?"allow":j(a.ask,b,n)?"ask":f?"allow":"ask"===e?"ask":"allow"}function n(a){return{allow:e(a?.allow),ask:e(a?.ask),deny:e(a?.deny)}}function o(a){return{allow:a.allow.map(f),ask:a.ask.map(f),deny:a.deny.map(f)}}},30223:a=>{a.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],"win32"!==process.platform&&a.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&a.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")},32982:(a,b,c)=>{"use strict";function d(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function e(a){let b=function(a){let b={},c=a?.models;if(!Array.isArray(c))return b;for(let a of c)d(a)&&"string"==typeof a.id&&a.id&&(b[a.id]={...a});return b}(a),c=function(a){let b=a?.modelOverrides;if(!d(b))return{};let c={};for(let[a,e]of Object.entries(b))d(e)&&(c[a]={...e});return c}(a),e=new Set([...Object.keys(b),...Object.keys(c)]),f={};for(let a of e)f[a]={...b[a]??{},...c[a]??{}};return f}c.d(b,{du:()=>e})},39466:(a,b,c)=>{var d=c(81115),e=process.cwd,f=null,g=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return f||(f=e.call(process)),f};try{process.cwd()}catch(a){}if("function"==typeof process.chdir){var h=process.chdir;process.chdir=function(a){f=null,h.call(process,a)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,h)}a.exports=function(a){var b,c,e;function f(b){return b?function(c,d,e){return b.call(a,c,d,function(a){m(a)&&(a=null),e&&e.apply(this,arguments)})}:b}function h(b){return b?function(c,d){try{return b.call(a,c,d)}catch(a){if(!m(a))throw a}}:b}function i(b){return b?function(c,d,e,f){return b.call(a,c,d,e,function(a){m(a)&&(a=null),f&&f.apply(this,arguments)})}:b}function j(b){return b?function(c,d,e){try{return b.call(a,c,d,e)}catch(a){if(!m(a))throw a}}:b}function k(b){return b?function(c,d,e){function f(a,b){b&&(b.uid<0&&(b.uid+=0x100000000),b.gid<0&&(b.gid+=0x100000000)),e&&e.apply(this,arguments)}return"function"==typeof d&&(e=d,d=null),d?b.call(a,c,d,f):b.call(a,c,f)}:b}function l(b){return b?function(c,d){var e=d?b.call(a,c,d):b.call(a,c);return e&&(e.uid<0&&(e.uid+=0x100000000),e.gid<0&&(e.gid+=0x100000000)),e}:b}function m(a){return!a||"ENOSYS"===a.code||(!process.getuid||0!==process.getuid())&&("EINVAL"===a.code||"EPERM"===a.code)}d.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&((c=a).lchmod=function(a,b,e){c.open(a,d.O_WRONLY|d.O_SYMLINK,b,function(a,d){if(a){e&&e(a);return}c.fchmod(d,b,function(a){c.close(d,function(b){e&&e(a||b)})})})},c.lchmodSync=function(a,b){var e,f=c.openSync(a,d.O_WRONLY|d.O_SYMLINK,b),g=!0;try{e=c.fchmodSync(f,b),g=!1}finally{if(g)try{c.closeSync(f)}catch(a){}else c.closeSync(f)}return e}),a.lutimes||(e=a,d.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(a,b,c,f){e.open(a,d.O_SYMLINK,function(a,d){if(a){f&&f(a);return}e.futimes(d,b,c,function(a){e.close(d,function(b){f&&f(a||b)})})})},e.lutimesSync=function(a,b,c){var f,g=e.openSync(a,d.O_SYMLINK),h=!0;try{f=e.futimesSync(g,b,c),h=!1}finally{if(h)try{e.closeSync(g)}catch(a){}else e.closeSync(g)}return f}):e.futimes&&(e.lutimes=function(a,b,c,d){d&&process.nextTick(d)},e.lutimesSync=function(){})),a.chown=i(a.chown),a.fchown=i(a.fchown),a.lchown=i(a.lchown),a.chmod=f(a.chmod),a.fchmod=f(a.fchmod),a.lchmod=f(a.lchmod),a.chownSync=j(a.chownSync),a.fchownSync=j(a.fchownSync),a.lchownSync=j(a.lchownSync),a.chmodSync=h(a.chmodSync),a.fchmodSync=h(a.fchmodSync),a.lchmodSync=h(a.lchmodSync),a.stat=k(a.stat),a.fstat=k(a.fstat),a.lstat=k(a.lstat),a.statSync=l(a.statSync),a.fstatSync=l(a.fstatSync),a.lstatSync=l(a.lstatSync),a.chmod&&!a.lchmod&&(a.lchmod=function(a,b,c){c&&process.nextTick(c)},a.lchmodSync=function(){}),a.chown&&!a.lchown&&(a.lchown=function(a,b,c,d){d&&process.nextTick(d)},a.lchownSync=function(){}),"win32"===g&&(a.rename="function"!=typeof a.rename?a.rename:function(b){function c(c,d,e){var f=Date.now(),g=0;b(c,d,function h(i){if(i&&("EACCES"===i.code||"EPERM"===i.code||"EBUSY"===i.code)&&Date.now()-f<6e4){setTimeout(function(){a.stat(d,function(a,f){a&&"ENOENT"===a.code?b(c,d,h):e(i)})},g),g<100&&(g+=10);return}e&&e(i)})}return Object.setPrototypeOf&&Object.setPrototypeOf(c,b),c}(a.rename)),a.read="function"!=typeof a.read?a.read:function(b){function c(c,d,e,f,g,h){var i;if(h&&"function"==typeof h){var j=0;i=function(k,l,m){if(k&&"EAGAIN"===k.code&&j<10)return j++,b.call(a,c,d,e,f,g,i);h.apply(this,arguments)}}return b.call(a,c,d,e,f,g,i)}return Object.setPrototypeOf&&Object.setPrototypeOf(c,b),c}(a.read),a.readSync="function"!=typeof a.readSync?a.readSync:(b=a.readSync,function(c,d,e,f,g){for(var h=0;;)try{return b.call(a,c,d,e,f,g)}catch(a){if("EAGAIN"===a.code&&h<10){h++;continue}throw a}})}},44290:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{lN:()=>j});var e=c(74986),f=c(97563),g=c(30116),h=a([e]);function i(a){if(!a||"object"!=typeof a||Array.isArray(a))return null;let b=a.permissionRules,c=(0,g.kP)((0,g.ni)(b));return{collaborationMode:(0,f.UY)(a.collaborationMode),tokenMode:(0,f.wI)(a.tokenMode),toolApprovalMode:(0,f.g0)(a.toolApprovalMode),permissionRules:{allow:Array.isArray(c.allow)?c.allow:[],ask:Array.isArray(c.ask)?c.ask:[],deny:Array.isArray(c.deny)?c.deny:[]}}}function j(a){let b=(0,f.Md)(),c=(0,e.Tu)();if(a){let b=c.modesPerSession;if(b&&"object"==typeof b&&!Array.isArray(b)){let c=i(b[a]);if(c)return c}}return i(c.modes)??b}e=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},54366:(a,b,c)=>{"use strict";function d(){return{defaultAgentType:null,modeId:null,configValues:{},autoProcess:!0,maxConcurrent:1,mergeStrategy:"merge",deleteWorktreeDefault:!0,preflightCommand:null,initCommand:null,stagePrompts:null}}c.d(b,{os:()=>d})},57856:(a,b,c)=>{"use strict";c.d(b,{TQ:()=>e,p1:()=>d});let d=92;function e(a,b=d,c=40){return Object.freeze({terminal:Object.freeze({columns:b,rows:c,kittyProtocolActive:!1}),requestRender:a})}},61446:(a,b,c)=>{"use strict";let d=c(62404),{toPromise:e,toSync:f,toSyncOptions:g}=c(13884);async function h(a,b){let c=await e(d.lock)(a,b);return e(c)}a.exports=h,a.exports.lock=h,a.exports.unlock=function(a,b){return e(d.unlock)(a,b)},a.exports.lockSync=function(a,b){let c=f(d.lock)(a,g(b));return f(c)},a.exports.unlockSync=function(a,b){return f(d.unlock)(a,g(b))},a.exports.check=function(a,b){return e(d.check)(a,b)},a.exports.checkSync=function(a,b){return f(d.check)(a,g(b))}},61577:(a,b,c)=>{"use strict";async function d(a,b,c){if(!b.model&&!b.thinkingLevel)return{modelDefaultChanged:!1};let d=!1;return b.model&&c.model&&b.model.provider===c.model.provider&&b.model.modelId===c.model.modelId&&(a.setDefaultModelAndProvider(c.model.provider,c.model.modelId),d=!0),b.thinkingLevel&&(c.supportsThinking||"off"!==c.thinkingLevel)&&a.setDefaultThinkingLevel(c.thinkingLevel),await a.flush(),{modelDefaultChanged:d}}c.d(b,{o:()=>d})},62391:(a,b,c)=>{"use strict";c.d(b,{l:()=>o,P9:()=>n,IL:()=>p,KI:()=>l});var d=c(79646),e=c(29021),f=c(33873);function g(a){return a&&"win32"===process.platform?(0,f.normalize)(a):a}function h(a,b){return a===b||!!a&&!!b&&"win32"===process.platform&&g(a).toLowerCase()===g(b).toLowerCase()}let i=(0,c(28354).promisify)(d.execFile);function j(){globalThis.__piProjectCache?.clear()}async function k(a,b){let{stdout:c}=await i("git",["-C",a,...b],{timeout:1e4,maxBuffer:1048576,env:{...process.env,LC_ALL:"C"}});return c.trim()}async function l(a){let b,c=(globalThis.__piProjectCache||(globalThis.__piProjectCache=new Map),globalThis.__piProjectCache),d=c.get(a);if(d&&d.expiresAt>Date.now())return d.info;try{if(!(0,e.existsSync)(a))return b=function(a){let b=(0,f.dirname)(a);if(!b.endsWith("-worktrees"))return null;let c=b.slice(0,-10);return c&&(0,e.existsSync)((0,f.join)(c,".git"))?{projectRoot:c,branch:(0,f.basename)(a),isWorktree:!0,isTopLevel:!0}:null}(a)??{projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1},c.set(a,{info:b,expiresAt:Date.now()+6e4}),b;let[d,i,j,l]=(await k(a,["rev-parse","--path-format=absolute","--git-common-dir","--git-dir","--show-toplevel","--abbrev-ref","HEAD"])).split("\n").map(a=>a.trim()),[m,n,o]=[d,i,j].map(g),p=a;try{p=(0,e.realpathSync)(a)}catch{}let q=h(o,p),r=!h(n,m)&&q;b={projectRoot:r?(0,f.dirname)(m):a,branch:l&&"HEAD"!==l?l:null,isWorktree:r,isTopLevel:q}}catch{b={projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1}}return c.set(a,{info:b,expiresAt:Date.now()+6e4}),b}async function m(a){let b=await k(a,["rev-parse","--path-format=absolute","--git-common-dir"]);return(0,f.dirname)(g(b))}async function n(a){let b=await k(a,["worktree","list","--porcelain"]),c=[],d=null,f=()=>{d?.path&&!d.prunable&&(0,e.existsSync)(d.path)&&c.push({path:d.path,branch:d.branch??null,isMain:0===c.length}),d=null};for(let a of b.split("\n"))a.startsWith("worktree ")?(f(),d={path:g(a.slice(9).trim())}):a.startsWith("branch ")&&d?d.branch=a.slice(7).trim().replace(/^refs\/heads\//,""):a.startsWith("prunable")&&d?d.prunable=!0:""===a.trim()&&f();return f(),c}async function o(a,b){let c=b.trim();if(!c)throw Error("Branch name is required");let d=c.replace(/[\/\\:*?"<>|\s]+/g,"-").replace(/^-+|-+$/g,"");if(!d)throw Error(`Invalid branch name: ${b}`);let g=await m(a),h=`${(0,f.resolve)(g)}-worktrees`,i=(0,f.join)(h,d);if((0,e.existsSync)(i))throw Error(`Directory already exists: ${i}`);(0,e.mkdirSync)(h,{recursive:!0});let l=!1;try{await k(g,["rev-parse","--verify","--quiet",`refs/heads/${c}`]),l=!0}catch{l=!1}try{l?await k(g,["worktree","add","--",i,c]):await k(g,["worktree","add","-b",c,"--",i])}catch(a){throw Error(q(a))}return!function(a){if(!a)return;let b=a.replace(/\\/g,"/");(!globalThis.__piAdditionalAllowedRoots&&(globalThis.__piAdditionalAllowedRoots=new Set),globalThis.__piAdditionalAllowedRoots).add(b),globalThis.__piAllowedRootsCache?.roots.add(b)}(i),j(),{path:i,branch:c}}async function p(a,b,c=!1){let d=(await n(a)).find(a=>h(a.path,b));if(!d)throw Error(`Not a worktree of this repository: ${b}`);if(d.isMain)throw Error("Cannot remove the main worktree");try{await k(a,["worktree","remove",...c?["--force"]:[],b])}catch(a){throw Error(q(a))}j()}function q(a){let b=a.stderr;return"string"==typeof b&&b.trim()?b.trim():a instanceof Error?a.message:String(a)}},62404:(a,b,c)=>{"use strict";let d=c(33873),e=c(93329),f=c(81463),g=c(75856),h=c(16176),i={};function j(a,b){return b.lockfilePath||`${a}.lock`}function k(a,b,c){if(!b.realpath)return c(null,d.resolve(a));b.fs.realpath(a,c)}function l(a,b){return a.mtime.getTime()<Date.now()-b.stale}function m(a,b,c){b.fs.rmdir(j(a,b),a=>{if(a&&"ENOENT"!==a.code)return c(a);c()})}function n(a,b,c){b.released=!0,b.updateTimeout&&clearTimeout(b.updateTimeout),i[a]===b&&delete i[a],b.options.onCompromised(c)}function o(a,b,c){k(a,b={fs:e,realpath:!0,...b},(a,d)=>{if(a)return c(a);let e=i[d];if(!e)return c(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));e.updateTimeout&&clearTimeout(e.updateTimeout),e.released=!0,delete i[d],m(d,b,c)})}g(()=>{for(let a in i){let b=i[a].options;try{b.fs.rmdirSync(j(a,b))}catch(a){}}}),a.exports.lock=function(a,b,c){(b={stale:1e4,update:null,realpath:!0,retries:0,fs:e,onCompromised:a=>{throw a},...b}).retries=b.retries||0,b.retries="number"==typeof b.retries?{retries:b.retries}:b.retries,b.stale=Math.max(b.stale||0,2e3),b.update=null==b.update?b.stale/2:b.update||0,b.update=Math.max(Math.min(b.update,b.stale/2),1e3),k(a,b,(a,d)=>{if(a)return c(a);let e=f.operation(b.retries);e.attempt(()=>{!function a(b,c,d){let e=j(b,c);c.fs.mkdir(e,f=>f?"EEXIST"!==f.code?d(f):c.stale<=0?d(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:b})):void c.fs.stat(e,(e,f)=>e?"ENOENT"===e.code?a(b,{...c,stale:0},d):d(e):l(f,c)?void m(b,c,e=>{if(e)return d(e);a(b,{...c,stale:0},d)}):d(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:b}))):h.probe(e,c.fs,(a,b,f)=>{if(a)return c.fs.rmdir(e,()=>{}),d(a);d(null,b,f)}))}(d,b,(a,f,g)=>{if(e.retry(a))return;if(a)return c(e.mainError());let k=i[d]={lockfilePath:j(d,b),mtime:f,mtimePrecision:g,options:b,lastUpdate:Date.now()};!function a(b,c){let d=i[b];!d.updateTimeout&&(d.updateDelay=d.updateDelay||c.update,d.updateTimeout=setTimeout(()=>{d.updateTimeout=null,c.fs.stat(d.lockfilePath,(e,f)=>{let g=d.lastUpdate+c.stale<Date.now();if(e)return"ENOENT"===e.code||g?n(b,d,Object.assign(e,{code:"ECOMPROMISED"})):(d.updateDelay=1e3,a(b,c));if(d.mtime.getTime()!==f.mtime.getTime())return n(b,d,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let i=h.getMtime(d.mtimePrecision);c.fs.utimes(d.lockfilePath,i,i,e=>{let f=d.lastUpdate+c.stale<Date.now();if(!d.released){if(e)return"ENOENT"===e.code||f?n(b,d,Object.assign(e,{code:"ECOMPROMISED"})):(d.updateDelay=1e3,a(b,c));d.mtime=i,d.lastUpdate=Date.now(),d.updateDelay=null,a(b,c)}})})},d.updateDelay),d.updateTimeout.unref&&d.updateTimeout.unref())}(d,b),c(null,a=>{if(k.released)return a&&a(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));o(d,{...b,realpath:!1},a)})})})})},a.exports.unlock=o,a.exports.check=function(a,b,c){(b={stale:1e4,realpath:!0,fs:e,...b}).stale=Math.max(b.stale||0,2e3),k(a,b,(a,d)=>{if(a)return c(a);b.fs.stat(j(d,b),(a,d)=>a?"ENOENT"===a.code?c(null,!1):c(a):c(null,!l(d,b)))})},a.exports.getLocks=function(){return i}},65562:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Q1:()=>u,Rv:()=>v,_o:()=>s,fd:()=>t,h6:()=>r,z1:()=>m});var e=c(29021),f=c(33873),g=c(75430),h=c(12969),i=c(69420),j=c(54366),k=a([g]);function l(){return(0,f.join)((0,g.getAgentDir)(),"tasks")}function m(a){return(0,f.join)(l(),(0,i.A0)(a).replace(/^\/+/,"").split("/").filter(Boolean).map(a=>encodeURIComponent(a)).join("--")||"root")}function n(a){return(0,f.join)(m(a),"tasks.jsonl")}function o(){return(0,f.join)(l(),"settings.json")}function p(a){(0,e.existsSync)(a)||(0,e.mkdirSync)(a,{recursive:!0,mode:448})}function q(a){if(!(0,e.existsSync)(a))return[];let b=(0,e.readFileSync)(a,"utf8"),c=[];for(let a of b.split("\n")){let b=a.trim();if(b)try{c.push(JSON.parse(b))}catch{}}return c}function r(a){return q(n(a)).sort((a,b)=>a.sortOrder-b.sortOrder||a.id-b.id)}function s(a,b){return r(a).find(a=>a.id===b)??null}function t(a){let b,c=n(a.projectRoot),d=r(a.projectRoot),e=d.findIndex(b=>b.id===a.id),f={...a,updatedAt:new Date().toISOString()};e>=0?d[e]=f:d.push(f),p(c.substring(0,c.lastIndexOf("/"))),b=d.map(a=>JSON.stringify(a)).join("\n")+"\n",(0,h.$)(c,b)}function u(a,b){let c=(0,f.join)(m(a),"events.jsonl"),d=q(c).reduce((a,b)=>Math.max(a,b.id),0)+1,g={...b,payload:b.payload??null,id:d,createdAt:new Date().toISOString()};return p(c.substring(0,c.lastIndexOf("/"))),(0,e.writeFileSync)(c,JSON.stringify(g)+"\n",{encoding:"utf8",flag:"a",mode:384}),g}function v(a){let b=function(a){let b=o();if(!(0,e.existsSync)(b))return null;try{return JSON.parse((0,e.readFileSync)(b,"utf8"))[a]??null}catch{return null}}(a),c=function(){let a=o();if(!(0,e.existsSync)(a))return(0,j.os)();try{let b=JSON.parse((0,e.readFileSync)(a,"utf8"));return{...(0,j.os)(),...b._global??{}}}catch{return(0,j.os)()}}();return b?{...c,...b,configValues:{...c.configValues,...b.configValues??{}}}:c}g=(k.then?(await k)():k)[0],d()}catch(a){d(a)}})},67313:(a,b,c)=>{var d=c(92759);b.operation=function(a){return new d(b.timeouts(a),{forever:a&&a.forever,unref:a&&a.unref,maxRetryTime:a&&a.maxRetryTime})},b.timeouts=function(a){if(a instanceof Array)return[].concat(a);var b={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var c in a)b[c]=a[c];if(b.minTimeout>b.maxTimeout)throw Error("minTimeout is greater than maxTimeout");for(var d=[],e=0;e<b.retries;e++)d.push(this.createTimeout(e,b));return a&&a.forever&&!d.length&&d.push(this.createTimeout(e,b)),d.sort(function(a,b){return a-b}),d},b.createTimeout=function(a,b){var c=Math.round((b.randomize?Math.random()+1:1)*b.minTimeout*Math.pow(b.factor,a));return Math.min(c,b.maxTimeout)},b.wrap=function(a,c,d){if(c instanceof Array&&(d=c,c=null),!d)for(var e in d=[],a)"function"==typeof a[e]&&d.push(e);for(var f=0;f<d.length;f++){var g=d[f],h=a[g];a[g]=(function(d){var e=b.operation(c),f=Array.prototype.slice.call(arguments,1),g=f.pop();f.push(function(a){e.retry(a)||(a&&(arguments[0]=e.mainError()),g.apply(this,arguments))}),e.attempt(function(){d.apply(a,f)})}).bind(a,h),a[g].options=c}}},69420:(a,b,c)=>{"use strict";function d(a){return/^[a-zA-Z]:[\\/]/.test(a)||a.startsWith("\\\\")?a.replace(/\\/g,"/"):a}c.d(b,{A0:()=>d})},69453:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{O8:()=>j,mD:()=>i});var e=c(75430);c(29021);var f=c(33873);c(62391);var g=c(74986),h=a([e,g]);function i(){globalThis.__piSessionListGeneration=(globalThis.__piSessionListGeneration??0)+1,globalThis.__piSessionListCache=void 0}function j(a,b){let c=(0,f.normalize)(b),d=(globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache),e=(globalThis.__piPathToSessionIdCache||(globalThis.__piPathToSessionIdCache=new Map),globalThis.__piPathToSessionIdCache),g=d.get(a),h=e.get(c);g&&g!==c&&e.get(g)===a&&e.delete(g),h&&h!==a&&d.get(h)===c&&d.delete(h),d.set(a,c),e.set(c,a)}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},74986:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Tu:()=>i});var e=c(73024),f=c(76760);c(61446);var g=c(75430);c(12969);var h=a([g]);function i(){let a=(0,f.join)((0,g.getAgentDir)(),"settings.json");if(!(0,e.existsSync)(a))return{};try{let b=JSON.parse((0,e.readFileSync)(a,"utf8"));return null===b||"object"!=typeof b||Array.isArray(b)?{}:b}catch{return{}}}g=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},75856:(a,b,c)=>{var d=global.process;let e=function(a){return a&&"object"==typeof a&&"function"==typeof a.removeListener&&"function"==typeof a.emit&&"function"==typeof a.reallyExit&&"function"==typeof a.listeners&&"function"==typeof a.kill&&"number"==typeof a.pid&&"function"==typeof a.on};if(e(d)){var f,g=c(12412),h=c(30223),i=/^win/i.test(d.platform),j=c(94735);"function"!=typeof j&&(j=j.EventEmitter),d.__signal_exit_emitter__?f=d.__signal_exit_emitter__:((f=d.__signal_exit_emitter__=new j).count=0,f.emitted={}),f.infinite||(f.setMaxListeners(1/0),f.infinite=!0),a.exports=function(a,b){if(!e(global.process))return function(){};g.equal(typeof a,"function","a callback must be provided for exit handler"),!1===n&&o();var c="exit";return b&&b.alwaysLast&&(c="afterexit"),f.on(c,a),function(){f.removeListener(c,a),0===f.listeners("exit").length&&0===f.listeners("afterexit").length&&k()}};var k=function(){n&&e(global.process)&&(n=!1,h.forEach(function(a){try{d.removeListener(a,m[a])}catch(a){}}),d.emit=r,d.reallyExit=p,f.count-=1)};a.exports.unload=k;var l=function(a,b,c){f.emitted[a]||(f.emitted[a]=!0,f.emit(a,b,c))},m={};h.forEach(function(a){m[a]=function(){e(global.process)&&d.listeners(a).length===f.count&&(k(),l("exit",null,a),l("afterexit",null,a),i&&"SIGHUP"===a&&(a="SIGINT"),d.kill(d.pid,a))}}),a.exports.signals=function(){return h};var n=!1,o=function(){!n&&e(global.process)&&(n=!0,f.count+=1,h=h.filter(function(a){try{return d.on(a,m[a]),!0}catch(a){return!1}}),d.emit=s,d.reallyExit=q)};a.exports.load=o;var p=d.reallyExit,q=function(a){e(global.process)&&(d.exitCode=a||0,l("exit",d.exitCode,null),l("afterexit",d.exitCode,null),p.call(d,d.exitCode))},r=d.emit,s=function(a,b){if(!("exit"===a&&e(global.process)))return r.apply(this,arguments);void 0!==b&&(d.exitCode=b);var c=r.apply(this,arguments);return l("exit",d.exitCode,null),l("afterexit",d.exitCode,null),c}}else a.exports=function(){return function(){}}},80723:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{fr:()=>j});var e=c(29021),f=c(33873),g=c(75430),h=c(74986),i=a([g,h]);function j(){let a=(0,f.join)((0,g.getAgentDir)(),"models.json");if(!(0,e.existsSync)(a))return{providers:{}};try{let b=JSON.parse((0,e.readFileSync)(a,"utf8"));return null!==b&&"object"==typeof b?b:{providers:{}}}catch{return{providers:{}}}}[g,h]=i.then?(await i)():i,d()}catch(a){d(a)}})},81463:(a,b,c)=>{a.exports=c(67313)},88250:(a,b,c)=>{"use strict";function d(){let a=(globalThis.__piModelsCacheState||(globalThis.__piModelsCacheState={entries:new Map,inFlight:new Map,generation:0}),globalThis.__piModelsCacheState);a.generation+=1,a.entries.clear(),a.inFlight.clear()}c.d(b,{k:()=>d})},92759:a=>{function b(a,b){"boolean"==typeof b&&(b={forever:b}),this._originalTimeouts=JSON.parse(JSON.stringify(a)),this._timeouts=a,this._options=b||{},this._maxRetryTime=b&&b.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}a.exports=b,b.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts},b.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null},b.prototype.retry=function(a){if(this._timeout&&clearTimeout(this._timeout),!a)return!1;var b=new Date().getTime();if(a&&b-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(a);var c=this._timeouts.shift();if(void 0===c)if(!this._cachedTimeouts)return!1;else this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),c=this._timeouts.shift();var d=this,e=setTimeout(function(){d._attempts++,d._operationTimeoutCb&&(d._timeout=setTimeout(function(){d._operationTimeoutCb(d._attempts)},d._operationTimeout),d._options.unref&&d._timeout.unref()),d._fn(d._attempts)},c);return this._options.unref&&e.unref(),!0},b.prototype.attempt=function(a,b){this._fn=a,b&&(b.timeout&&(this._operationTimeout=b.timeout),b.cb&&(this._operationTimeoutCb=b.cb));var c=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){c._operationTimeoutCb()},c._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},b.prototype.try=function(a){console.log("Using RetryOperation.try() is deprecated"),this.attempt(a)},b.prototype.start=function(a){console.log("Using RetryOperation.start() is deprecated"),this.attempt(a)},b.prototype.start=b.prototype.try,b.prototype.errors=function(){return this._errors},b.prototype.attempts=function(){return this._attempts},b.prototype.mainError=function(){if(0===this._errors.length)return null;for(var a={},b=null,c=0,d=0;d<this._errors.length;d++){var e=this._errors[d],f=e.message,g=(a[f]||0)+1;a[f]=g,g>=c&&(b=e,c=g)}return b}},93329:(a,b,c)=>{var d,e,f,g=c(29021),h=c(39466),i=c(18827),j=c(12817),k=c(28354);function l(a,b){Object.defineProperty(a,d,{get:function(){return b}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(d=Symbol.for("graceful-fs.queue"),e=Symbol.for("graceful-fs.previous")):(d="___graceful-fs.queue",e="___graceful-fs.previous");var m=function(){};function n(a){h(a),a.gracefulify=n,a.createReadStream=function(b,c){return new a.ReadStream(b,c)},a.createWriteStream=function(b,c){return new a.WriteStream(b,c)};var b=a.readFile;a.readFile=function(a,c,d){return"function"==typeof c&&(d=c,c=null),function a(c,d,e,f){return b(c,d,function(b){b&&("EMFILE"===b.code||"ENFILE"===b.code)?o([a,[c,d,e],b,f||Date.now(),Date.now()]):"function"==typeof e&&e.apply(this,arguments)})}(a,c,d)};var c=a.writeFile;a.writeFile=function(a,b,d,e){return"function"==typeof d&&(e=d,d=null),function a(b,d,e,f,g){return c(b,d,e,function(c){c&&("EMFILE"===c.code||"ENFILE"===c.code)?o([a,[b,d,e,f],c,g||Date.now(),Date.now()]):"function"==typeof f&&f.apply(this,arguments)})}(a,b,d,e)};var d=a.appendFile;d&&(a.appendFile=function(a,b,c,e){return"function"==typeof c&&(e=c,c=null),function a(b,c,e,f,g){return d(b,c,e,function(d){d&&("EMFILE"===d.code||"ENFILE"===d.code)?o([a,[b,c,e,f],d,g||Date.now(),Date.now()]):"function"==typeof f&&f.apply(this,arguments)})}(a,b,c,e)});var e=a.copyFile;e&&(a.copyFile=function(a,b,c,d){return"function"==typeof c&&(d=c,c=0),function a(b,c,d,f,g){return e(b,c,d,function(e){e&&("EMFILE"===e.code||"ENFILE"===e.code)?o([a,[b,c,d,f],e,g||Date.now(),Date.now()]):"function"==typeof f&&f.apply(this,arguments)})}(a,b,c,d)});var f=a.readdir;a.readdir=function(a,b,c){"function"==typeof b&&(c=b,b=null);var d=g.test(process.version)?function(a,b,c,d){return f(a,e(a,b,c,d))}:function(a,b,c,d){return f(a,b,e(a,b,c,d))};return d(a,b,c);function e(a,b,c,e){return function(f,g){f&&("EMFILE"===f.code||"ENFILE"===f.code)?o([d,[a,b,c],f,e||Date.now(),Date.now()]):(g&&g.sort&&g.sort(),"function"==typeof c&&c.call(this,f,g))}}};var g=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var j=i(a);q=j.ReadStream,r=j.WriteStream}var k=a.ReadStream;k&&(q.prototype=Object.create(k.prototype),q.prototype.open=function(){var a=this;t(a.path,a.flags,a.mode,function(b,c){b?(a.autoClose&&a.destroy(),a.emit("error",b)):(a.fd=c,a.emit("open",c),a.read())})});var l=a.WriteStream;l&&(r.prototype=Object.create(l.prototype),r.prototype.open=function(){var a=this;t(a.path,a.flags,a.mode,function(b,c){b?(a.destroy(),a.emit("error",b)):(a.fd=c,a.emit("open",c))})}),Object.defineProperty(a,"ReadStream",{get:function(){return q},set:function(a){q=a},enumerable:!0,configurable:!0}),Object.defineProperty(a,"WriteStream",{get:function(){return r},set:function(a){r=a},enumerable:!0,configurable:!0});var m=q;Object.defineProperty(a,"FileReadStream",{get:function(){return m},set:function(a){m=a},enumerable:!0,configurable:!0});var p=r;function q(a,b){return this instanceof q?(k.apply(this,arguments),this):q.apply(Object.create(q.prototype),arguments)}function r(a,b){return this instanceof r?(l.apply(this,arguments),this):r.apply(Object.create(r.prototype),arguments)}Object.defineProperty(a,"FileWriteStream",{get:function(){return p},set:function(a){p=a},enumerable:!0,configurable:!0});var s=a.open;function t(a,b,c,d){return"function"==typeof c&&(d=c,c=null),function a(b,c,d,e,f){return s(b,c,d,function(g,h){g&&("EMFILE"===g.code||"ENFILE"===g.code)?o([a,[b,c,d,e],g,f||Date.now(),Date.now()]):"function"==typeof e&&e.apply(this,arguments)})}(a,b,c,d)}return a.open=t,a}function o(a){m("ENQUEUE",a[0].name,a[1]),g[d].push(a),q()}function p(){for(var a=Date.now(),b=0;b<g[d].length;++b)g[d][b].length>2&&(g[d][b][3]=a,g[d][b][4]=a);q()}function q(){if(clearTimeout(f),f=void 0,0!==g[d].length){var a=g[d].shift(),b=a[0],c=a[1],e=a[2],h=a[3],i=a[4];if(void 0===h)m("RETRY",b.name,c),b.apply(null,c);else if(Date.now()-h>=6e4){m("TIMEOUT",b.name,c);var j=c.pop();"function"==typeof j&&j.call(null,e)}else Date.now()-i>=Math.min(1.2*Math.max(i-h,1),100)?(m("RETRY",b.name,c),b.apply(null,c.concat([h]))):g[d].push(a);void 0===f&&(f=setTimeout(q,0))}}k.debuglog?m=k.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(m=function(){var a=k.format.apply(k,arguments);console.error(a="GFS4: "+a.split(/\n/).join("\nGFS4: "))}),!g[d]&&(l(g,global[d]||[]),g.close=function(a){function b(b,c){return a.call(g,b,function(a){a||p(),"function"==typeof c&&c.apply(this,arguments)})}return Object.defineProperty(b,e,{value:a}),b}(g.close),g.closeSync=function(a){function b(b){a.apply(g,arguments),p()}return Object.defineProperty(b,e,{value:a}),b}(g.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){m(g[d]),c(12412).equal(g[d].length,0)})),global[d]||l(global,g[d]),a.exports=n(j(g)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!g.__patched&&(a.exports=n(g),g.__patched=!0)},96515:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{IR:()=>l,py:()=>k});var e=c(75430),f=c(80723),g=c(32982),h=a([e,f]);[e,f]=h.then?(await h)():h;let m=null;async function i(a){let b=Date.now();if(m&&b-m.at<6e4)return m.data;let c=await a.getAvailable();return m={data:c,at:b},c}function j(a,b){return a.provider===b.provider&&a.id===b.modelId}async function k(a,b,c={}){let d=(0,f.fr)().providers??{},h=new Set;for(let[a,b]of Object.entries(d)){let c=(0,g.du)(b);for(let[b,d]of Object.entries(c))!0===d.hidden&&h.add(`${a}/${b}`)}let j=(b??[]).map(a=>a.trim()).filter(Boolean),l=[],m=[],n={},o=[];if(0===j.length)l=await i(a);else{let b=await (0,e.resolveModelScopeWithDiagnostics)(j,a);for(let c of(m=b.scopedModels,l=b.scopedModels.length>0?b.scopedModels.map(a=>a.model):await i(a),o.push(...b.diagnostics.map(a=>a.message)),m))c.thinkingLevel&&(n[`${c.model.provider}/${c.model.id}`]=c.thinkingLevel)}return c.includeHidden||(l=l.filter(a=>!h.has(`${a.provider}/${a.id}`))),{visible:l,scopedModels:c.includeHidden||l.length===m.length?m:m.filter(a=>!h.has(`${a.model.provider}/${a.model.id}`)),thinkingLevelPins:n,warnings:o}}function l(a,b={}){let c=b.requestedModel?a.visible.find(a=>j(a,b.requestedModel)):void 0;if(b.requestedModel&&!c)throw Error(`Model is not available in the enabled scope: ${b.requestedModel.provider}/${b.requestedModel.modelId}`);let d=c?a.scopedModels.find(a=>j(a.model,{provider:c.provider,modelId:c.id})):void 0,e=!c&&b.defaultModel?a.scopedModels.find(a=>j(a.model,b.defaultModel)):void 0,f=c?void 0:e??a.scopedModels[0],g=c||f||!b.defaultModel?void 0:a.visible.find(a=>j(a,b.defaultModel)),h=c??f?.model??g,i=d??f,k=b.thinkingLevel??i?.thinkingLevel;return{...h?{model:h}:{},...k?{thinkingLevel:k}:{},scopedModels:[...a.scopedModels]}}d()}catch(a){d(a)}})},97563:(a,b,c)=>{"use strict";c.d(b,{MJ:()=>k,Md:()=>g,UY:()=>h,g0:()=>j,wI:()=>i});let d="normal",e="full",f="auto";function g(){return{collaborationMode:d,tokenMode:e,toolApprovalMode:f,permissionRules:{allow:[],ask:[],deny:[]}}}function h(a){return"normal"===a||"plan"===a||"goal"===a?a:d}function i(a){return"economy"===a||"delivery"===a||"full"===a?a:e}function j(a){return"ask"===a||"auto"===a||"yolo"===a?a:f}let k=new Set(["read","grep","find","ls","bash_output","get_tools","get_commands","get_session_stats"])}};
16
+ ${f}`:""));return await C.send({type:"prompt",message:E}),!0}catch(e){let c=e instanceof Error?e.message:String(e),d=(0,i._o)(b,a);return d&&("preparing"===d.status||"queued"===d.status)&&(q(a,d.runSeq,[d.status],"failed",{failureReason:"setup_error",lastError:c,settledAt:o(),finishedAt:o()}),(0,i.Q1)(b,{taskId:a,kind:"failed",actor:"engine",payload:{reason:"setup_error",message:c}})),!1}finally{c.launching.delete(a)}}async function u(a,b){try{let c=(await (0,h.P9)(a)).find(a=>a.branch===b);return c?.path??null}catch{return null}}async function v(a,b){let c=`task-${a.id}`,{session:d}=await (0,j.OF)(c,"",b,{});return{session:d}}async function w(a,b){let c=m().live.get(a.connectionId);if(!c||c.taskId!==a.taskId||!q(a.taskId,a.runSeq,["running","awaiting_input"],"review",{settledAt:o()}))return;(0,i.Q1)(b.projectRoot,{taskId:a.taskId,kind:"review",actor:"engine"});let d=(0,i.Rv)(b.projectRoot);d.preflightCommand&&await x(a,d.preflightCommand)}async function x(a,b){let c=(0,i._o)(a.projectRoot,a.taskId);if(c){p({...c,preflight:{status:"running",command:b}},"preflight_start","engine",{command:b});try{let c=await z(a.session.cwd,b),d=(0,i._o)(a.projectRoot,a.taskId);if(!d)return;p({...d,preflight:{status:0===c.code?"passed":"failed",command:b,exitCode:c.code,outputTail:0===c.code?null:c.output.slice(-4e3)}},0===c.code?"preflight_passed":"preflight_failed","engine",{command:b,exitCode:c.code})}catch(d){let c=(0,i._o)(a.projectRoot,a.taskId);if(!c)return;p({...c,preflight:{status:"failed",command:b,outputTail:d instanceof Error?d.message:String(d)}},"preflight_failed","engine",{command:b})}}}function y(a,b){return new Promise((c,d)=>{let e=(0,g.spawn)(b,{cwd:a,shell:!0,stdio:"ignore"});e.on("error",d),e.on("exit",a=>{0===a?c():d(Error(`init command exited with code ${a??"null"}`))})})}function z(a,b){return new Promise(c=>{let d=(0,g.spawn)(b,{cwd:a,shell:!0}),e="";d.stdout?.on("data",a=>{e+=a.toString()}),d.stderr?.on("data",a=>{e+=a.toString()}),d.on("error",()=>c({code:1,output:e})),d.on("exit",a=>c({code:a,output:e}))})}function A(a){return"/"+a.split("--").map(a=>decodeURIComponent(a)).join("/")}async function B(){try{await C()}catch{}}async function C(){let a=m();if(!a)return;let b=(0,i.z1)("__engine__").replace(/__engine__$/,"");if((0,e.existsSync)(b))for(let c of(0,e.readdirSync)(b,{withFileTypes:!0})){if(!c.isDirectory()||"__engine__"===c.name)continue;let b=A(c.name);for(let c of(0,i.h6)(b)){let d=a.byTask.get(c.id);d||"running"!==c.status&&"awaiting_input"!==c.status&&"merging"!==c.status?d||"preparing"!==c.status||(q(c.id,c.runSeq,["preparing"],"todo",{startedAt:null}),(0,i.Q1)(b,{taskId:c.id,kind:"recovered",actor:"engine"})):(q(c.id,c.runSeq,[c.status],"failed",{failureReason:"interrupted",lastError:"Engine restarted; the run was interrupted.",settledAt:o(),finishedAt:o()}),(0,i.Q1)(b,{taskId:c.id,kind:"interrupted",actor:"engine"}))}l()&&r(b)}}d()}catch(a){d(a)}})},15253:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Fk:()=>h,Y1:()=>g});var e=c(75430),f=a([e]);function g(a,b){return a&&(0,e.hasTrustRequiringProjectResources)(a)?{requiresTrust:!0,trusted:!0===new e.ProjectTrustStore(b).get(a)}:{requiresTrust:!1,trusted:!0}}function h(a,b){if(!g(a,b).requiresTrust)return;let c=new e.ProjectTrustStore(b);return{resolveProjectTrust:async()=>!0===c.get(a)}}e=(f.then?(await f)():f)[0],d()}catch(a){d(a)}})},16176:a=>{"use strict";let b=Symbol();a.exports.probe=function(a,c,d){let e=c[b];if(e)return c.stat(a,(a,b)=>{if(a)return d(a);d(null,b.mtime,e)});let f=new Date(1e3*Math.ceil(Date.now()/1e3)+5);c.utimes(a,f,f,e=>{if(e)return d(e);c.stat(a,(a,e)=>{if(a)return d(a);let f=e.mtime.getTime()%1e3==0?"s":"ms";Object.defineProperty(c,b,{value:f}),d(null,e.mtime,f)})})},a.exports.getMtime=function(a){let b=Date.now();return"s"===a&&(b=1e3*Math.ceil(b/1e3)),new Date(b)}},17114:(a,b,c)=>{"use strict";c.d(b,{Gc:()=>g,ov:()=>h,pj:()=>i,wx:()=>j});var d=c(55511),e=c(29021);function f(a){return`${a}.queue.json`}function g(a,b,c){return{id:(0,d.randomUUID)(),kind:a,text:b,...c&&c.length>0?{images:c}:{},queuedAt:Date.now()}}function h(a){let b=f(a);if(!(0,e.existsSync)(b))return[];try{let a=JSON.parse((0,e.readFileSync)(b,"utf8"));if(!a||1!==a.version||!Array.isArray(a.entries))return[];return a.entries.filter(a=>!!a&&("steer"===a.kind||"followUp"===a.kind)&&"string"==typeof a.text)}catch{return[]}}function i(a,b){if(!a)return;let c=f(a),g=`${c}.tmp-${process.pid}-${(0,d.randomUUID)()}`;try{(0,e.writeFileSync)(g,JSON.stringify({version:1,entries:b}),"utf8"),(0,e.renameSync)(g,c)}catch(a){try{(0,e.rmSync)(g,{force:!0})}catch{}console.error(`[pi-web] failed to persist queue sidecar ${c}:`,a instanceof Error?a.message:String(a))}}function j(a){try{(0,e.rmSync)(f(a),{force:!0})}catch{}}},18437:(a,b,c)=>{"use strict";function d(a){if(void 0===a)return null;if(!Array.isArray(a))return"images must be an array";if(a.length>10)return"A message can include at most 10 images";for(let b of a)if(!function(a){var b;if(!a||"object"!=typeof a||"image"!==a.type||"string"!=typeof a.data||"string"!=typeof a.mimeType||(b=a.mimeType,!/^image\/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*$/.test(b)))return!1;let c=function(a){if(!a||a.length%4!=0)return null;let b=a.endsWith("==")?2:+!!a.endsWith("="),c=a.length-b,d=null;for(let b=0;b<c;b+=1){var e;let c=(e=a.charCodeAt(b))>=65&&e<=90?e-65:e>=97&&e<=122?e-97+26:e>=48&&e<=57?e-48+52:43===e?62:47===e?63:null;if(null===c)return null;d=c}for(let b=c;b<a.length;b+=1)if("="!==a[b])return null;return 2===b&&d%16!=0||1===b&&d%4!=0?null:a.length/4*3-b}(a.data);return null!==c&&c<=0xa00000}(b))return"Each image must be valid base64 image data with an image MIME type and be 10MB or smaller";return null}c.d(b,{kc:()=>d})},18827:(a,b,c)=>{var d=c(27910).Stream;a.exports=function(a){return{ReadStream:function b(c,e){if(!(this instanceof b))return new b(c,e);d.call(this);var f=this;this.path=c,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536;for(var g=Object.keys(e=e||{}),h=0,i=g.length;h<i;h++){var j=g[h];this[j]=e[j]}if(this.encoding&&this.setEncoding(this.encoding),void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}null!==this.fd?process.nextTick(function(){f._read()}):a.open(this.path,this.flags,this.mode,function(a,b){if(a){f.emit("error",a),f.readable=!1;return}f.fd=b,f.emit("open",b),f._read()})},WriteStream:function b(c,e){if(!(this instanceof b))return new b(c,e);d.call(this),this.path=c,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0;for(var f=Object.keys(e=e||{}),g=0,h=f.length;g<h;g++){var i=f[g];this[i]=e[i]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=a.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}},30116:(a,b,c)=>{"use strict";c.d(b,{LD:()=>m,kP:()=>o,ni:()=>n});var d=c(97563);function e(a){if(!a)return[];let b=[];for(let c of a){let a=function(a){let b=a.trim();if(!b)return null;let c=b.indexOf("="),d=b.indexOf("(");if(c>0&&(d<0||c<d)){let a=b.slice(0,c).trim();return a?{tool:a,subject:b.slice(c+1),literal:!0}:null}if(d>=0&&b.endsWith(")")){let a=b.slice(0,d).trim();return a?{tool:a,subject:b.slice(d+1,-1)}:null}return{tool:b}}(c);a&&b.push(a)}return b}function f(a){return void 0===a.subject?a.tool:a.literal?`${a.tool}=${a.subject}`:`${a.tool}(${a.subject})`}function g(a){return a.includes("*")||a.includes("?")}function h(a,b){return void 0===b.subject||""!==a&&(b.literal||!g(b.subject)?a===b.subject:(function(a){let b="^";for(let c of a)"*"===c?b+=".*":"?"===c?b+=".":b+=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return RegExp(b+"$")})(b.subject).test(a))}function i(a,b){return a.toLowerCase()===b.toLowerCase()}function j(a,b,c){for(let d of a)if(i(d.tool,b)&&h(c,d))return!0;return!1}function k(a){let b=a.trim();return!!b&&!!(/\$\(/.test(b)||/`/.test(b)||/(^|\s)(python|python3|node|ruby|perl|php)\s+-[a-z]*c(\s|$)/i.test(b)||/(^|\s)(sh|bash|zsh)\s+-c(\s|$)/i.test(b)||/(^|\s)(sudo|su)\s/i.test(b)||/;\s*[a-z]/i.test(b)||/\|\s*(sh|bash|zsh|python|python3|node)\b/i.test(b)||/\|\s*tee\b/i.test(b))}let l=["ls","cat","head","tail","grep","rg","find","wc","echo","pwd","cd","git status","git diff","git log","git branch","git remote","git stash list","git show","git ls-files","which","type","env","file","stat","du","df","history","man","less","more","tree","git diff --","git log --","curl -I","curl --head"];function m(a,b,c={}){let e=c.mode??"auto",f=c.readOnly??d.MJ.has(b.toLowerCase()),n=function(a,b){if("bash"===a.toLowerCase()){let a=b?.command;return"string"==typeof a&&a.trim()?`command:${a.trim()}`:""}let c=b??{},d="string"==typeof c.source_path?c.source_path:"",e="string"==typeof c.destination_path?c.destination_path:"";if(d&&e)return e!==d?`${d}\u0000${e}`:d;for(let a of["path","file_path","file","glob","pattern","directory"]){let b=c[a];if("string"==typeof b&&b)return b}return""}(b,c.args),o="bash"===b.toLowerCase(),p=o&&n.startsWith("command:")?n.slice(8):"";if(j(a.deny,b,n))return"deny";if(o&&p){let c=k(p);return j(a.allow,b,n)&&!c?"allow":j(a.ask,b,n)?"ask":c?a.allow.some(a=>i(a.tool,b)&&void 0!==a.subject&&!g(a.subject)&&h(n,a))||"yolo"===e?"allow":"ask":!function(a){let b=a.trim();if(!b||k(b)||/[;&|>]/.test(b))return!1;let c=b.toLowerCase();for(let a of l)if(c===a||c.startsWith(a+" "))return!0;return!1}(p)?"ask"===e?"ask":"allow":"allow"}return j(a.allow,b,n)?"allow":j(a.ask,b,n)?"ask":f?"allow":"ask"===e?"ask":"allow"}function n(a){return{allow:e(a?.allow),ask:e(a?.ask),deny:e(a?.deny)}}function o(a){return{allow:a.allow.map(f),ask:a.ask.map(f),deny:a.deny.map(f)}}},30223:a=>{a.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],"win32"!==process.platform&&a.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&a.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")},32982:(a,b,c)=>{"use strict";function d(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function e(a){let b=function(a){let b={},c=a?.models;if(!Array.isArray(c))return b;for(let a of c)d(a)&&"string"==typeof a.id&&a.id&&(b[a.id]={...a});return b}(a),c=function(a){let b=a?.modelOverrides;if(!d(b))return{};let c={};for(let[a,e]of Object.entries(b))d(e)&&(c[a]={...e});return c}(a),e=new Set([...Object.keys(b),...Object.keys(c)]),f={};for(let a of e)f[a]={...b[a]??{},...c[a]??{}};return f}c.d(b,{du:()=>e})},39466:(a,b,c)=>{var d=c(81115),e=process.cwd,f=null,g=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return f||(f=e.call(process)),f};try{process.cwd()}catch(a){}if("function"==typeof process.chdir){var h=process.chdir;process.chdir=function(a){f=null,h.call(process,a)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,h)}a.exports=function(a){var b,c,e;function f(b){return b?function(c,d,e){return b.call(a,c,d,function(a){m(a)&&(a=null),e&&e.apply(this,arguments)})}:b}function h(b){return b?function(c,d){try{return b.call(a,c,d)}catch(a){if(!m(a))throw a}}:b}function i(b){return b?function(c,d,e,f){return b.call(a,c,d,e,function(a){m(a)&&(a=null),f&&f.apply(this,arguments)})}:b}function j(b){return b?function(c,d,e){try{return b.call(a,c,d,e)}catch(a){if(!m(a))throw a}}:b}function k(b){return b?function(c,d,e){function f(a,b){b&&(b.uid<0&&(b.uid+=0x100000000),b.gid<0&&(b.gid+=0x100000000)),e&&e.apply(this,arguments)}return"function"==typeof d&&(e=d,d=null),d?b.call(a,c,d,f):b.call(a,c,f)}:b}function l(b){return b?function(c,d){var e=d?b.call(a,c,d):b.call(a,c);return e&&(e.uid<0&&(e.uid+=0x100000000),e.gid<0&&(e.gid+=0x100000000)),e}:b}function m(a){return!a||"ENOSYS"===a.code||(!process.getuid||0!==process.getuid())&&("EINVAL"===a.code||"EPERM"===a.code)}d.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&((c=a).lchmod=function(a,b,e){c.open(a,d.O_WRONLY|d.O_SYMLINK,b,function(a,d){if(a){e&&e(a);return}c.fchmod(d,b,function(a){c.close(d,function(b){e&&e(a||b)})})})},c.lchmodSync=function(a,b){var e,f=c.openSync(a,d.O_WRONLY|d.O_SYMLINK,b),g=!0;try{e=c.fchmodSync(f,b),g=!1}finally{if(g)try{c.closeSync(f)}catch(a){}else c.closeSync(f)}return e}),a.lutimes||(e=a,d.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(a,b,c,f){e.open(a,d.O_SYMLINK,function(a,d){if(a){f&&f(a);return}e.futimes(d,b,c,function(a){e.close(d,function(b){f&&f(a||b)})})})},e.lutimesSync=function(a,b,c){var f,g=e.openSync(a,d.O_SYMLINK),h=!0;try{f=e.futimesSync(g,b,c),h=!1}finally{if(h)try{e.closeSync(g)}catch(a){}else e.closeSync(g)}return f}):e.futimes&&(e.lutimes=function(a,b,c,d){d&&process.nextTick(d)},e.lutimesSync=function(){})),a.chown=i(a.chown),a.fchown=i(a.fchown),a.lchown=i(a.lchown),a.chmod=f(a.chmod),a.fchmod=f(a.fchmod),a.lchmod=f(a.lchmod),a.chownSync=j(a.chownSync),a.fchownSync=j(a.fchownSync),a.lchownSync=j(a.lchownSync),a.chmodSync=h(a.chmodSync),a.fchmodSync=h(a.fchmodSync),a.lchmodSync=h(a.lchmodSync),a.stat=k(a.stat),a.fstat=k(a.fstat),a.lstat=k(a.lstat),a.statSync=l(a.statSync),a.fstatSync=l(a.fstatSync),a.lstatSync=l(a.lstatSync),a.chmod&&!a.lchmod&&(a.lchmod=function(a,b,c){c&&process.nextTick(c)},a.lchmodSync=function(){}),a.chown&&!a.lchown&&(a.lchown=function(a,b,c,d){d&&process.nextTick(d)},a.lchownSync=function(){}),"win32"===g&&(a.rename="function"!=typeof a.rename?a.rename:function(b){function c(c,d,e){var f=Date.now(),g=0;b(c,d,function h(i){if(i&&("EACCES"===i.code||"EPERM"===i.code||"EBUSY"===i.code)&&Date.now()-f<6e4){setTimeout(function(){a.stat(d,function(a,f){a&&"ENOENT"===a.code?b(c,d,h):e(i)})},g),g<100&&(g+=10);return}e&&e(i)})}return Object.setPrototypeOf&&Object.setPrototypeOf(c,b),c}(a.rename)),a.read="function"!=typeof a.read?a.read:function(b){function c(c,d,e,f,g,h){var i;if(h&&"function"==typeof h){var j=0;i=function(k,l,m){if(k&&"EAGAIN"===k.code&&j<10)return j++,b.call(a,c,d,e,f,g,i);h.apply(this,arguments)}}return b.call(a,c,d,e,f,g,i)}return Object.setPrototypeOf&&Object.setPrototypeOf(c,b),c}(a.read),a.readSync="function"!=typeof a.readSync?a.readSync:(b=a.readSync,function(c,d,e,f,g){for(var h=0;;)try{return b.call(a,c,d,e,f,g)}catch(a){if("EAGAIN"===a.code&&h<10){h++;continue}throw a}})}},44290:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{lN:()=>j});var e=c(74986),f=c(97563),g=c(30116),h=a([e]);function i(a){if(!a||"object"!=typeof a||Array.isArray(a))return null;let b=a.permissionRules,c=(0,g.kP)((0,g.ni)(b));return{collaborationMode:(0,f.UY)(a.collaborationMode),tokenMode:(0,f.wI)(a.tokenMode),toolApprovalMode:(0,f.g0)(a.toolApprovalMode),permissionRules:{allow:Array.isArray(c.allow)?c.allow:[],ask:Array.isArray(c.ask)?c.ask:[],deny:Array.isArray(c.deny)?c.deny:[]}}}function j(a){let b=(0,f.Md)(),c=(0,e.Tu)();if(a){let b=c.modesPerSession;if(b&&"object"==typeof b&&!Array.isArray(b)){let c=i(b[a]);if(c)return c}}return i(c.modes)??b}e=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},54366:(a,b,c)=>{"use strict";function d(){return{defaultAgentType:null,modeId:null,configValues:{},autoProcess:!0,maxConcurrent:1,mergeStrategy:"merge",deleteWorktreeDefault:!0,preflightCommand:null,initCommand:null,stagePrompts:null}}c.d(b,{os:()=>d})},57856:(a,b,c)=>{"use strict";c.d(b,{TQ:()=>e,p1:()=>d});let d=92;function e(a,b=d,c=40){return Object.freeze({terminal:Object.freeze({columns:b,rows:c,kittyProtocolActive:!1}),requestRender:a})}},61446:(a,b,c)=>{"use strict";let d=c(62404),{toPromise:e,toSync:f,toSyncOptions:g}=c(13884);async function h(a,b){let c=await e(d.lock)(a,b);return e(c)}a.exports=h,a.exports.lock=h,a.exports.unlock=function(a,b){return e(d.unlock)(a,b)},a.exports.lockSync=function(a,b){let c=f(d.lock)(a,g(b));return f(c)},a.exports.unlockSync=function(a,b){return f(d.unlock)(a,g(b))},a.exports.check=function(a,b){return e(d.check)(a,b)},a.exports.checkSync=function(a,b){return f(d.check)(a,g(b))}},61577:(a,b,c)=>{"use strict";async function d(a,b,c){if(!b.model&&!b.thinkingLevel)return{modelDefaultChanged:!1};let d=!1;return b.model&&c.model&&b.model.provider===c.model.provider&&b.model.modelId===c.model.modelId&&(a.setDefaultModelAndProvider(c.model.provider,c.model.modelId),d=!0),b.thinkingLevel&&(c.supportsThinking||"off"!==c.thinkingLevel)&&a.setDefaultThinkingLevel(c.thinkingLevel),await a.flush(),{modelDefaultChanged:d}}c.d(b,{o:()=>d})},62391:(a,b,c)=>{"use strict";c.d(b,{l:()=>o,P9:()=>n,IL:()=>p,KI:()=>l});var d=c(79646),e=c(29021),f=c(33873);function g(a){return a&&"win32"===process.platform?(0,f.normalize)(a):a}function h(a,b){return a===b||!!a&&!!b&&"win32"===process.platform&&g(a).toLowerCase()===g(b).toLowerCase()}let i=(0,c(28354).promisify)(d.execFile);function j(){globalThis.__piProjectCache?.clear()}async function k(a,b){let{stdout:c}=await i("git",["-C",a,...b],{timeout:1e4,maxBuffer:1048576,env:{...process.env,LC_ALL:"C"}});return c.trim()}async function l(a){let b,c=(globalThis.__piProjectCache||(globalThis.__piProjectCache=new Map),globalThis.__piProjectCache),d=c.get(a);if(d&&d.expiresAt>Date.now())return d.info;try{if(!(0,e.existsSync)(a))return b=function(a){let b=(0,f.dirname)(a);if(!b.endsWith("-worktrees"))return null;let c=b.slice(0,-10);return c&&(0,e.existsSync)((0,f.join)(c,".git"))?{projectRoot:c,branch:(0,f.basename)(a),isWorktree:!0,isTopLevel:!0}:null}(a)??{projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1},c.set(a,{info:b,expiresAt:Date.now()+6e4}),b;let[d,i,j,l]=(await k(a,["rev-parse","--path-format=absolute","--git-common-dir","--git-dir","--show-toplevel","--abbrev-ref","HEAD"])).split("\n").map(a=>a.trim()),[m,n,o]=[d,i,j].map(g),p=a;try{p=(0,e.realpathSync)(a)}catch{}let q=h(o,p),r=!h(n,m)&&q;b={projectRoot:r?(0,f.dirname)(m):a,branch:l&&"HEAD"!==l?l:null,isWorktree:r,isTopLevel:q}}catch{b={projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1}}return c.set(a,{info:b,expiresAt:Date.now()+6e4}),b}async function m(a){let b=await k(a,["rev-parse","--path-format=absolute","--git-common-dir"]);return(0,f.dirname)(g(b))}async function n(a){let b=await k(a,["worktree","list","--porcelain"]),c=[],d=null,f=()=>{d?.path&&!d.prunable&&(0,e.existsSync)(d.path)&&c.push({path:d.path,branch:d.branch??null,isMain:0===c.length}),d=null};for(let a of b.split("\n"))a.startsWith("worktree ")?(f(),d={path:g(a.slice(9).trim())}):a.startsWith("branch ")&&d?d.branch=a.slice(7).trim().replace(/^refs\/heads\//,""):a.startsWith("prunable")&&d?d.prunable=!0:""===a.trim()&&f();return f(),c}async function o(a,b){let c=b.trim();if(!c)throw Error("Branch name is required");let d=c.replace(/[\/\\:*?"<>|\s]+/g,"-").replace(/^-+|-+$/g,"");if(!d)throw Error(`Invalid branch name: ${b}`);let g=await m(a),h=`${(0,f.resolve)(g)}-worktrees`,i=(0,f.join)(h,d);if((0,e.existsSync)(i))throw Error(`Directory already exists: ${i}`);(0,e.mkdirSync)(h,{recursive:!0});let l=!1;try{await k(g,["rev-parse","--verify","--quiet",`refs/heads/${c}`]),l=!0}catch{l=!1}try{l?await k(g,["worktree","add","--",i,c]):await k(g,["worktree","add","-b",c,"--",i])}catch(a){throw Error(q(a))}return!function(a){if(!a)return;let b=a.replace(/\\/g,"/");(!globalThis.__piAdditionalAllowedRoots&&(globalThis.__piAdditionalAllowedRoots=new Set),globalThis.__piAdditionalAllowedRoots).add(b),globalThis.__piAllowedRootsCache?.roots.add(b)}(i),j(),{path:i,branch:c}}async function p(a,b,c=!1){let d=(await n(a)).find(a=>h(a.path,b));if(!d)throw Error(`Not a worktree of this repository: ${b}`);if(d.isMain)throw Error("Cannot remove the main worktree");try{await k(a,["worktree","remove",...c?["--force"]:[],b])}catch(a){throw Error(q(a))}j()}function q(a){let b=a.stderr;return"string"==typeof b&&b.trim()?b.trim():a instanceof Error?a.message:String(a)}},62404:(a,b,c)=>{"use strict";let d=c(33873),e=c(93329),f=c(81463),g=c(75856),h=c(16176),i={};function j(a,b){return b.lockfilePath||`${a}.lock`}function k(a,b,c){if(!b.realpath)return c(null,d.resolve(a));b.fs.realpath(a,c)}function l(a,b){return a.mtime.getTime()<Date.now()-b.stale}function m(a,b,c){b.fs.rmdir(j(a,b),a=>{if(a&&"ENOENT"!==a.code)return c(a);c()})}function n(a,b,c){b.released=!0,b.updateTimeout&&clearTimeout(b.updateTimeout),i[a]===b&&delete i[a],b.options.onCompromised(c)}function o(a,b,c){k(a,b={fs:e,realpath:!0,...b},(a,d)=>{if(a)return c(a);let e=i[d];if(!e)return c(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));e.updateTimeout&&clearTimeout(e.updateTimeout),e.released=!0,delete i[d],m(d,b,c)})}g(()=>{for(let a in i){let b=i[a].options;try{b.fs.rmdirSync(j(a,b))}catch(a){}}}),a.exports.lock=function(a,b,c){(b={stale:1e4,update:null,realpath:!0,retries:0,fs:e,onCompromised:a=>{throw a},...b}).retries=b.retries||0,b.retries="number"==typeof b.retries?{retries:b.retries}:b.retries,b.stale=Math.max(b.stale||0,2e3),b.update=null==b.update?b.stale/2:b.update||0,b.update=Math.max(Math.min(b.update,b.stale/2),1e3),k(a,b,(a,d)=>{if(a)return c(a);let e=f.operation(b.retries);e.attempt(()=>{!function a(b,c,d){let e=j(b,c);c.fs.mkdir(e,f=>f?"EEXIST"!==f.code?d(f):c.stale<=0?d(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:b})):void c.fs.stat(e,(e,f)=>e?"ENOENT"===e.code?a(b,{...c,stale:0},d):d(e):l(f,c)?void m(b,c,e=>{if(e)return d(e);a(b,{...c,stale:0},d)}):d(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:b}))):h.probe(e,c.fs,(a,b,f)=>{if(a)return c.fs.rmdir(e,()=>{}),d(a);d(null,b,f)}))}(d,b,(a,f,g)=>{if(e.retry(a))return;if(a)return c(e.mainError());let k=i[d]={lockfilePath:j(d,b),mtime:f,mtimePrecision:g,options:b,lastUpdate:Date.now()};!function a(b,c){let d=i[b];!d.updateTimeout&&(d.updateDelay=d.updateDelay||c.update,d.updateTimeout=setTimeout(()=>{d.updateTimeout=null,c.fs.stat(d.lockfilePath,(e,f)=>{let g=d.lastUpdate+c.stale<Date.now();if(e)return"ENOENT"===e.code||g?n(b,d,Object.assign(e,{code:"ECOMPROMISED"})):(d.updateDelay=1e3,a(b,c));if(d.mtime.getTime()!==f.mtime.getTime())return n(b,d,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let i=h.getMtime(d.mtimePrecision);c.fs.utimes(d.lockfilePath,i,i,e=>{let f=d.lastUpdate+c.stale<Date.now();if(!d.released){if(e)return"ENOENT"===e.code||f?n(b,d,Object.assign(e,{code:"ECOMPROMISED"})):(d.updateDelay=1e3,a(b,c));d.mtime=i,d.lastUpdate=Date.now(),d.updateDelay=null,a(b,c)}})})},d.updateDelay),d.updateTimeout.unref&&d.updateTimeout.unref())}(d,b),c(null,a=>{if(k.released)return a&&a(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));o(d,{...b,realpath:!1},a)})})})})},a.exports.unlock=o,a.exports.check=function(a,b,c){(b={stale:1e4,realpath:!0,fs:e,...b}).stale=Math.max(b.stale||0,2e3),k(a,b,(a,d)=>{if(a)return c(a);b.fs.stat(j(d,b),(a,d)=>a?"ENOENT"===a.code?c(null,!1):c(a):c(null,!l(d,b)))})},a.exports.getLocks=function(){return i}},65562:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Q1:()=>u,Rv:()=>v,_o:()=>s,fd:()=>t,h6:()=>r,z1:()=>m});var e=c(29021),f=c(33873),g=c(75430),h=c(12969),i=c(69420),j=c(54366),k=a([g]);function l(){return(0,f.join)((0,g.getAgentDir)(),"tasks")}function m(a){return(0,f.join)(l(),(0,i.A0)(a).replace(/^\/+/,"").split("/").filter(Boolean).map(a=>encodeURIComponent(a)).join("--")||"root")}function n(a){return(0,f.join)(m(a),"tasks.jsonl")}function o(){return(0,f.join)(l(),"settings.json")}function p(a){(0,e.existsSync)(a)||(0,e.mkdirSync)(a,{recursive:!0,mode:448})}function q(a){if(!(0,e.existsSync)(a))return[];let b=(0,e.readFileSync)(a,"utf8"),c=[];for(let a of b.split("\n")){let b=a.trim();if(b)try{c.push(JSON.parse(b))}catch{}}return c}function r(a){return q(n(a)).sort((a,b)=>a.sortOrder-b.sortOrder||a.id-b.id)}function s(a,b){return r(a).find(a=>a.id===b)??null}function t(a){let b,c=n(a.projectRoot),d=r(a.projectRoot),e=d.findIndex(b=>b.id===a.id),f={...a,updatedAt:new Date().toISOString()};e>=0?d[e]=f:d.push(f),p(c.substring(0,c.lastIndexOf("/"))),b=d.map(a=>JSON.stringify(a)).join("\n")+"\n",(0,h.$)(c,b)}function u(a,b){let c=(0,f.join)(m(a),"events.jsonl"),d=q(c).reduce((a,b)=>Math.max(a,b.id),0)+1,g={...b,payload:b.payload??null,id:d,createdAt:new Date().toISOString()};return p(c.substring(0,c.lastIndexOf("/"))),(0,e.writeFileSync)(c,JSON.stringify(g)+"\n",{encoding:"utf8",flag:"a",mode:384}),g}function v(a){let b=function(a){let b=o();if(!(0,e.existsSync)(b))return null;try{return JSON.parse((0,e.readFileSync)(b,"utf8"))[a]??null}catch{return null}}(a),c=function(){let a=o();if(!(0,e.existsSync)(a))return(0,j.os)();try{let b=JSON.parse((0,e.readFileSync)(a,"utf8"));return{...(0,j.os)(),...b._global??{}}}catch{return(0,j.os)()}}();return b?{...c,...b,configValues:{...c.configValues,...b.configValues??{}}}:c}g=(k.then?(await k)():k)[0],d()}catch(a){d(a)}})},67313:(a,b,c)=>{var d=c(92759);b.operation=function(a){return new d(b.timeouts(a),{forever:a&&a.forever,unref:a&&a.unref,maxRetryTime:a&&a.maxRetryTime})},b.timeouts=function(a){if(a instanceof Array)return[].concat(a);var b={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var c in a)b[c]=a[c];if(b.minTimeout>b.maxTimeout)throw Error("minTimeout is greater than maxTimeout");for(var d=[],e=0;e<b.retries;e++)d.push(this.createTimeout(e,b));return a&&a.forever&&!d.length&&d.push(this.createTimeout(e,b)),d.sort(function(a,b){return a-b}),d},b.createTimeout=function(a,b){var c=Math.round((b.randomize?Math.random()+1:1)*b.minTimeout*Math.pow(b.factor,a));return Math.min(c,b.maxTimeout)},b.wrap=function(a,c,d){if(c instanceof Array&&(d=c,c=null),!d)for(var e in d=[],a)"function"==typeof a[e]&&d.push(e);for(var f=0;f<d.length;f++){var g=d[f],h=a[g];a[g]=(function(d){var e=b.operation(c),f=Array.prototype.slice.call(arguments,1),g=f.pop();f.push(function(a){e.retry(a)||(a&&(arguments[0]=e.mainError()),g.apply(this,arguments))}),e.attempt(function(){d.apply(a,f)})}).bind(a,h),a[g].options=c}}},69420:(a,b,c)=>{"use strict";function d(a){return/^[a-zA-Z]:[\\/]/.test(a)||a.startsWith("\\\\")?a.replace(/\\/g,"/"):a}c.d(b,{A0:()=>d})},69453:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{O8:()=>j,mD:()=>i});var e=c(75430);c(29021);var f=c(33873);c(97563),c(62391);var g=c(74986),h=a([e,g]);function i(){globalThis.__piSessionListGeneration=(globalThis.__piSessionListGeneration??0)+1,globalThis.__piSessionListCache=void 0}function j(a,b){let c=(0,f.normalize)(b),d=(globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache),e=(globalThis.__piPathToSessionIdCache||(globalThis.__piPathToSessionIdCache=new Map),globalThis.__piPathToSessionIdCache),g=d.get(a),h=e.get(c);g&&g!==c&&e.get(g)===a&&e.delete(g),h&&h!==a&&d.get(h)===c&&d.delete(h),d.set(a,c),e.set(c,a)}[e,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},74986:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Tu:()=>i});var e=c(73024),f=c(76760);c(61446);var g=c(75430);c(12969);var h=a([g]);function i(){let a=(0,f.join)((0,g.getAgentDir)(),"settings.json");if(!(0,e.existsSync)(a))return{};try{let b=JSON.parse((0,e.readFileSync)(a,"utf8"));return null===b||"object"!=typeof b||Array.isArray(b)?{}:b}catch{return{}}}g=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},75856:(a,b,c)=>{var d=global.process;let e=function(a){return a&&"object"==typeof a&&"function"==typeof a.removeListener&&"function"==typeof a.emit&&"function"==typeof a.reallyExit&&"function"==typeof a.listeners&&"function"==typeof a.kill&&"number"==typeof a.pid&&"function"==typeof a.on};if(e(d)){var f,g=c(12412),h=c(30223),i=/^win/i.test(d.platform),j=c(94735);"function"!=typeof j&&(j=j.EventEmitter),d.__signal_exit_emitter__?f=d.__signal_exit_emitter__:((f=d.__signal_exit_emitter__=new j).count=0,f.emitted={}),f.infinite||(f.setMaxListeners(1/0),f.infinite=!0),a.exports=function(a,b){if(!e(global.process))return function(){};g.equal(typeof a,"function","a callback must be provided for exit handler"),!1===n&&o();var c="exit";return b&&b.alwaysLast&&(c="afterexit"),f.on(c,a),function(){f.removeListener(c,a),0===f.listeners("exit").length&&0===f.listeners("afterexit").length&&k()}};var k=function(){n&&e(global.process)&&(n=!1,h.forEach(function(a){try{d.removeListener(a,m[a])}catch(a){}}),d.emit=r,d.reallyExit=p,f.count-=1)};a.exports.unload=k;var l=function(a,b,c){f.emitted[a]||(f.emitted[a]=!0,f.emit(a,b,c))},m={};h.forEach(function(a){m[a]=function(){e(global.process)&&d.listeners(a).length===f.count&&(k(),l("exit",null,a),l("afterexit",null,a),i&&"SIGHUP"===a&&(a="SIGINT"),d.kill(d.pid,a))}}),a.exports.signals=function(){return h};var n=!1,o=function(){!n&&e(global.process)&&(n=!0,f.count+=1,h=h.filter(function(a){try{return d.on(a,m[a]),!0}catch(a){return!1}}),d.emit=s,d.reallyExit=q)};a.exports.load=o;var p=d.reallyExit,q=function(a){e(global.process)&&(d.exitCode=a||0,l("exit",d.exitCode,null),l("afterexit",d.exitCode,null),p.call(d,d.exitCode))},r=d.emit,s=function(a,b){if(!("exit"===a&&e(global.process)))return r.apply(this,arguments);void 0!==b&&(d.exitCode=b);var c=r.apply(this,arguments);return l("exit",d.exitCode,null),l("afterexit",d.exitCode,null),c}}else a.exports=function(){return function(){}}},80723:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{fr:()=>j});var e=c(29021),f=c(33873),g=c(75430),h=c(74986),i=a([g,h]);function j(){let a=(0,f.join)((0,g.getAgentDir)(),"models.json");if(!(0,e.existsSync)(a))return{providers:{}};try{let b=JSON.parse((0,e.readFileSync)(a,"utf8"));return null!==b&&"object"==typeof b?b:{providers:{}}}catch{return{providers:{}}}}[g,h]=i.then?(await i)():i,d()}catch(a){d(a)}})},81463:(a,b,c)=>{a.exports=c(67313)},88250:(a,b,c)=>{"use strict";function d(){let a=(globalThis.__piModelsCacheState||(globalThis.__piModelsCacheState={entries:new Map,inFlight:new Map,generation:0}),globalThis.__piModelsCacheState);a.generation+=1,a.entries.clear(),a.inFlight.clear()}c.d(b,{k:()=>d})},92759:a=>{function b(a,b){"boolean"==typeof b&&(b={forever:b}),this._originalTimeouts=JSON.parse(JSON.stringify(a)),this._timeouts=a,this._options=b||{},this._maxRetryTime=b&&b.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}a.exports=b,b.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts},b.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null},b.prototype.retry=function(a){if(this._timeout&&clearTimeout(this._timeout),!a)return!1;var b=new Date().getTime();if(a&&b-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(a);var c=this._timeouts.shift();if(void 0===c)if(!this._cachedTimeouts)return!1;else this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),c=this._timeouts.shift();var d=this,e=setTimeout(function(){d._attempts++,d._operationTimeoutCb&&(d._timeout=setTimeout(function(){d._operationTimeoutCb(d._attempts)},d._operationTimeout),d._options.unref&&d._timeout.unref()),d._fn(d._attempts)},c);return this._options.unref&&e.unref(),!0},b.prototype.attempt=function(a,b){this._fn=a,b&&(b.timeout&&(this._operationTimeout=b.timeout),b.cb&&(this._operationTimeoutCb=b.cb));var c=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){c._operationTimeoutCb()},c._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},b.prototype.try=function(a){console.log("Using RetryOperation.try() is deprecated"),this.attempt(a)},b.prototype.start=function(a){console.log("Using RetryOperation.start() is deprecated"),this.attempt(a)},b.prototype.start=b.prototype.try,b.prototype.errors=function(){return this._errors},b.prototype.attempts=function(){return this._attempts},b.prototype.mainError=function(){if(0===this._errors.length)return null;for(var a={},b=null,c=0,d=0;d<this._errors.length;d++){var e=this._errors[d],f=e.message,g=(a[f]||0)+1;a[f]=g,g>=c&&(b=e,c=g)}return b}},93329:(a,b,c)=>{var d,e,f,g=c(29021),h=c(39466),i=c(18827),j=c(12817),k=c(28354);function l(a,b){Object.defineProperty(a,d,{get:function(){return b}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(d=Symbol.for("graceful-fs.queue"),e=Symbol.for("graceful-fs.previous")):(d="___graceful-fs.queue",e="___graceful-fs.previous");var m=function(){};function n(a){h(a),a.gracefulify=n,a.createReadStream=function(b,c){return new a.ReadStream(b,c)},a.createWriteStream=function(b,c){return new a.WriteStream(b,c)};var b=a.readFile;a.readFile=function(a,c,d){return"function"==typeof c&&(d=c,c=null),function a(c,d,e,f){return b(c,d,function(b){b&&("EMFILE"===b.code||"ENFILE"===b.code)?o([a,[c,d,e],b,f||Date.now(),Date.now()]):"function"==typeof e&&e.apply(this,arguments)})}(a,c,d)};var c=a.writeFile;a.writeFile=function(a,b,d,e){return"function"==typeof d&&(e=d,d=null),function a(b,d,e,f,g){return c(b,d,e,function(c){c&&("EMFILE"===c.code||"ENFILE"===c.code)?o([a,[b,d,e,f],c,g||Date.now(),Date.now()]):"function"==typeof f&&f.apply(this,arguments)})}(a,b,d,e)};var d=a.appendFile;d&&(a.appendFile=function(a,b,c,e){return"function"==typeof c&&(e=c,c=null),function a(b,c,e,f,g){return d(b,c,e,function(d){d&&("EMFILE"===d.code||"ENFILE"===d.code)?o([a,[b,c,e,f],d,g||Date.now(),Date.now()]):"function"==typeof f&&f.apply(this,arguments)})}(a,b,c,e)});var e=a.copyFile;e&&(a.copyFile=function(a,b,c,d){return"function"==typeof c&&(d=c,c=0),function a(b,c,d,f,g){return e(b,c,d,function(e){e&&("EMFILE"===e.code||"ENFILE"===e.code)?o([a,[b,c,d,f],e,g||Date.now(),Date.now()]):"function"==typeof f&&f.apply(this,arguments)})}(a,b,c,d)});var f=a.readdir;a.readdir=function(a,b,c){"function"==typeof b&&(c=b,b=null);var d=g.test(process.version)?function(a,b,c,d){return f(a,e(a,b,c,d))}:function(a,b,c,d){return f(a,b,e(a,b,c,d))};return d(a,b,c);function e(a,b,c,e){return function(f,g){f&&("EMFILE"===f.code||"ENFILE"===f.code)?o([d,[a,b,c],f,e||Date.now(),Date.now()]):(g&&g.sort&&g.sort(),"function"==typeof c&&c.call(this,f,g))}}};var g=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var j=i(a);q=j.ReadStream,r=j.WriteStream}var k=a.ReadStream;k&&(q.prototype=Object.create(k.prototype),q.prototype.open=function(){var a=this;t(a.path,a.flags,a.mode,function(b,c){b?(a.autoClose&&a.destroy(),a.emit("error",b)):(a.fd=c,a.emit("open",c),a.read())})});var l=a.WriteStream;l&&(r.prototype=Object.create(l.prototype),r.prototype.open=function(){var a=this;t(a.path,a.flags,a.mode,function(b,c){b?(a.destroy(),a.emit("error",b)):(a.fd=c,a.emit("open",c))})}),Object.defineProperty(a,"ReadStream",{get:function(){return q},set:function(a){q=a},enumerable:!0,configurable:!0}),Object.defineProperty(a,"WriteStream",{get:function(){return r},set:function(a){r=a},enumerable:!0,configurable:!0});var m=q;Object.defineProperty(a,"FileReadStream",{get:function(){return m},set:function(a){m=a},enumerable:!0,configurable:!0});var p=r;function q(a,b){return this instanceof q?(k.apply(this,arguments),this):q.apply(Object.create(q.prototype),arguments)}function r(a,b){return this instanceof r?(l.apply(this,arguments),this):r.apply(Object.create(r.prototype),arguments)}Object.defineProperty(a,"FileWriteStream",{get:function(){return p},set:function(a){p=a},enumerable:!0,configurable:!0});var s=a.open;function t(a,b,c,d){return"function"==typeof c&&(d=c,c=null),function a(b,c,d,e,f){return s(b,c,d,function(g,h){g&&("EMFILE"===g.code||"ENFILE"===g.code)?o([a,[b,c,d,e],g,f||Date.now(),Date.now()]):"function"==typeof e&&e.apply(this,arguments)})}(a,b,c,d)}return a.open=t,a}function o(a){m("ENQUEUE",a[0].name,a[1]),g[d].push(a),q()}function p(){for(var a=Date.now(),b=0;b<g[d].length;++b)g[d][b].length>2&&(g[d][b][3]=a,g[d][b][4]=a);q()}function q(){if(clearTimeout(f),f=void 0,0!==g[d].length){var a=g[d].shift(),b=a[0],c=a[1],e=a[2],h=a[3],i=a[4];if(void 0===h)m("RETRY",b.name,c),b.apply(null,c);else if(Date.now()-h>=6e4){m("TIMEOUT",b.name,c);var j=c.pop();"function"==typeof j&&j.call(null,e)}else Date.now()-i>=Math.min(1.2*Math.max(i-h,1),100)?(m("RETRY",b.name,c),b.apply(null,c.concat([h]))):g[d].push(a);void 0===f&&(f=setTimeout(q,0))}}k.debuglog?m=k.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(m=function(){var a=k.format.apply(k,arguments);console.error(a="GFS4: "+a.split(/\n/).join("\nGFS4: "))}),!g[d]&&(l(g,global[d]||[]),g.close=function(a){function b(b,c){return a.call(g,b,function(a){a||p(),"function"==typeof c&&c.apply(this,arguments)})}return Object.defineProperty(b,e,{value:a}),b}(g.close),g.closeSync=function(a){function b(b){a.apply(g,arguments),p()}return Object.defineProperty(b,e,{value:a}),b}(g.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){m(g[d]),c(12412).equal(g[d].length,0)})),global[d]||l(global,g[d]),a.exports=n(j(g)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!g.__patched&&(a.exports=n(g),g.__patched=!0)},96515:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{IR:()=>l,py:()=>k});var e=c(75430),f=c(80723),g=c(32982),h=a([e,f]);[e,f]=h.then?(await h)():h;let m=null;async function i(a){let b=Date.now();if(m&&b-m.at<6e4)return m.data;let c=await a.getAvailable();return m={data:c,at:b},c}function j(a,b){return a.provider===b.provider&&a.id===b.modelId}async function k(a,b,c={}){let d=(0,f.fr)().providers??{},h=new Set;for(let[a,b]of Object.entries(d)){let c=(0,g.du)(b);for(let[b,d]of Object.entries(c))!0===d.hidden&&h.add(`${a}/${b}`)}let j=(b??[]).map(a=>a.trim()).filter(Boolean),l=[],m=[],n={},o=[];if(0===j.length)l=await i(a);else{let b=await (0,e.resolveModelScopeWithDiagnostics)(j,a);for(let c of(m=b.scopedModels,l=b.scopedModels.length>0?b.scopedModels.map(a=>a.model):await i(a),o.push(...b.diagnostics.map(a=>a.message)),m))c.thinkingLevel&&(n[`${c.model.provider}/${c.model.id}`]=c.thinkingLevel)}return c.includeHidden||(l=l.filter(a=>!h.has(`${a.provider}/${a.id}`))),{visible:l,scopedModels:c.includeHidden||l.length===m.length?m:m.filter(a=>!h.has(`${a.model.provider}/${a.model.id}`)),thinkingLevelPins:n,warnings:o}}function l(a,b={}){let c=b.requestedModel?a.visible.find(a=>j(a,b.requestedModel)):void 0;if(b.requestedModel&&!c)throw Error(`Model is not available in the enabled scope: ${b.requestedModel.provider}/${b.requestedModel.modelId}`);let d=c?a.scopedModels.find(a=>j(a.model,{provider:c.provider,modelId:c.id})):void 0,e=!c&&b.defaultModel?a.scopedModels.find(a=>j(a.model,b.defaultModel)):void 0,f=c?void 0:e??a.scopedModels[0],g=c||f||!b.defaultModel?void 0:a.visible.find(a=>j(a,b.defaultModel)),h=c??f?.model??g,i=d??f,k=b.thinkingLevel??i?.thinkingLevel;return{...h?{model:h}:{},...k?{thinkingLevel:k}:{},scopedModels:[...a.scopedModels]}}d()}catch(a){d(a)}})},97563:(a,b,c)=>{"use strict";c.d(b,{MJ:()=>k,Md:()=>g,UY:()=>h,g0:()=>j,wI:()=>i});let d="normal",e="full",f="auto";function g(){return{collaborationMode:d,tokenMode:e,toolApprovalMode:f,permissionRules:{allow:[],ask:[],deny:[]}}}function h(a){return"normal"===a||"plan"===a||"goal"===a?a:d}function i(a){return"economy"===a||"delivery"===a||"full"===a?a:e}function j(a){return"ask"===a||"auto"===a||"yolo"===a?a:f}let k=new Set(["read","grep","find","ls","bash_output","get_tools","get_commands","get_session_stats"])}};
@@ -1,3 +1,3 @@
1
- exports.id=5582,exports.ids=[5582],exports.modules={6999:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Tu:()=>o,o$:()=>n});var e=c(73024),f=c(76760),g=c(80974),h=c.n(g),i=c(75430),j=c(8102),k=a([i]);i=(k.then?(await k)():k)[0];let p={retries:{retries:10,factor:2,minTimeout:50,maxTimeout:2e3,randomize:!0},stale:3e4};function l(){return(0,f.join)((0,i.getAgentDir)(),"settings.json")}function m(){let a=l();if(!(0,e.existsSync)(a))return{};try{let b=JSON.parse((0,e.readFileSync)(a,"utf8"));return null===b||"object"!=typeof b||Array.isArray(b)?{}:b}catch{return{}}}async function n(a){let b=l(),c=null,d=await h().lock(b,{...p,onCompromised:a=>{c=a}});try{if(c)throw c;let d=m(),e=await a(d);if(c)throw c;if(!e||"object"!=typeof e||!e.settings)throw Error("settings.json mutation must return { settings }");if(!1===e.changed)return{changed:!1};if((0,j.$)(b,JSON.stringify(e.settings,null,2)),c)throw c;return{changed:!0}}finally{d().catch(()=>{})}}function o(){return m()}d()}catch(a){d(a)}})},8102:(a,b,c)=>{"use strict";c.d(b,{$:()=>g});var d=c(55511),e=c(29021),f=c(33873);function g(a,b){let c=(0,f.dirname)(a),g=(0,f.join)(c,`.${(0,f.basename)(a)}-${(0,d.randomUUID)()}.tmp`),h=!1;try{(0,e.writeFileSync)(g,b,{encoding:"utf8",flag:"wx",mode:384,flush:!0}),(0,e.renameSync)(g,a)}catch(a){throw h=!0,a}finally{try{(0,e.unlinkSync)(g)}catch(a){if("ENOENT"!==a.code&&!h)throw a}}}},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},23808:(a,b,c)=>{"use strict";c.d(b,{l:()=>q,P9:()=>p,IL:()=>r,KI:()=>n});var d=c(79646),e=c(29021),f=c(33873),g=c(28354),h=c(25252);function i(a){return a&&"win32"===process.platform?(0,f.normalize)(a):a}function j(a,b){return a===b||!!a&&!!b&&"win32"===process.platform&&i(a).toLowerCase()===i(b).toLowerCase()}let k=(0,g.promisify)(d.execFile);function l(){globalThis.__piProjectCache?.clear()}async function m(a,b){let{stdout:c}=await k("git",["-C",a,...b],{timeout:1e4,maxBuffer:1048576,env:{...process.env,LC_ALL:"C"}});return c.trim()}async function n(a){let b,c=(globalThis.__piProjectCache||(globalThis.__piProjectCache=new Map),globalThis.__piProjectCache),d=c.get(a);if(d&&d.expiresAt>Date.now())return d.info;try{if(!(0,e.existsSync)(a))return b=function(a){let b=(0,f.dirname)(a);if(!b.endsWith("-worktrees"))return null;let c=b.slice(0,-10);return c&&(0,e.existsSync)((0,f.join)(c,".git"))?{projectRoot:c,branch:(0,f.basename)(a),isWorktree:!0,isTopLevel:!0}:null}(a)??{projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1},c.set(a,{info:b,expiresAt:Date.now()+6e4}),b;let[d,g,h,k]=(await m(a,["rev-parse","--path-format=absolute","--git-common-dir","--git-dir","--show-toplevel","--abbrev-ref","HEAD"])).split("\n").map(a=>a.trim()),[l,n,o]=[d,g,h].map(i),p=a;try{p=(0,e.realpathSync)(a)}catch{}let q=j(o,p),r=!j(n,l)&&q;b={projectRoot:r?(0,f.dirname)(l):a,branch:k&&"HEAD"!==k?k:null,isWorktree:r,isTopLevel:q}}catch{b={projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1}}return c.set(a,{info:b,expiresAt:Date.now()+6e4}),b}async function o(a){let b=await m(a,["rev-parse","--path-format=absolute","--git-common-dir"]);return(0,f.dirname)(i(b))}async function p(a){let b=await m(a,["worktree","list","--porcelain"]),c=[],d=null,f=()=>{d?.path&&!d.prunable&&(0,e.existsSync)(d.path)&&c.push({path:d.path,branch:d.branch??null,isMain:0===c.length}),d=null};for(let a of b.split("\n"))a.startsWith("worktree ")?(f(),d={path:i(a.slice(9).trim())}):a.startsWith("branch ")&&d?d.branch=a.slice(7).trim().replace(/^refs\/heads\//,""):a.startsWith("prunable")&&d?d.prunable=!0:""===a.trim()&&f();return f(),c}async function q(a,b){let c=b.trim();if(!c)throw Error("Branch name is required");let d=c.replace(/[\/\\:*?"<>|\s]+/g,"-").replace(/^-+|-+$/g,"");if(!d)throw Error(`Invalid branch name: ${b}`);let g=await o(a),i=`${(0,f.resolve)(g)}-worktrees`,j=(0,f.join)(i,d);if((0,e.existsSync)(j))throw Error(`Directory already exists: ${j}`);(0,e.mkdirSync)(i,{recursive:!0});let k=!1;try{await m(g,["rev-parse","--verify","--quiet",`refs/heads/${c}`]),k=!0}catch{k=!1}try{k?await m(g,["worktree","add","--",j,c]):await m(g,["worktree","add","-b",c,"--",j])}catch(a){throw Error(s(a))}return(0,h.wz)(j),l(),{path:j,branch:c}}async function r(a,b,c=!1){let d=(await p(a)).find(a=>j(a.path,b));if(!d)throw Error(`Not a worktree of this repository: ${b}`);if(d.isMain)throw Error("Cannot remove the main worktree");try{await m(a,["worktree","remove",...c?["--force"]:[],b])}catch(a){throw Error(s(a))}l()}function s(a){let b=a.stderr;return"string"==typeof b&&b.trim()?b.trim():a instanceof Error?a.message:String(a)}},25252:(a,b,c)=>{"use strict";function d(a){return a.replace(/\\/g,"/")}function e(){return globalThis.__piAdditionalAllowedRoots||(globalThis.__piAdditionalAllowedRoots=new Set),globalThis.__piAdditionalAllowedRoots}function f(a){if(!a)return;let b=d(a);e().add(b),globalThis.__piAllowedRootsCache?.roots.add(b)}c.d(b,{HM:()=>e,Nw:()=>d,wz:()=>f})},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{BR:()=>t,DK:()=>v,O8:()=>s,Uv:()=>w,dQ:()=>m,eP:()=>u,mD:()=>n,os:()=>q,u1:()=>r});var e=c(75430),f=c(29021),g=c(33873),h=c(12039),i=c(23808),j=c(6999),k=a([e,j]);async function l(){let a=await e.SessionManager.listAll(),b=new Map;for(let c of a)b.set((0,g.normalize)(c.path),c.id);let c=[...new Set(a.map(a=>a.cwd).filter(Boolean))],d=new Map;await Promise.all(c.map(async a=>{d.set(a,await (0,i.KI)(a))}));let f=(0,j.Tu)(),h=Array.isArray(f.sessionPins)?f.sessionPins:[],k=new Set(h.filter(a=>"string"==typeof a));return a.map(a=>{s(a.id,a.path);let c=a.cwd?d.get(a.cwd):void 0;return{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get((0,g.normalize)(a.parentSessionPath)):void 0,projectRoot:c?.projectRoot??a.cwd,pinned:k.has(a.id),importedFrom:a.importedFrom,...c?.isWorktree&&c.branch?{worktreeBranch:c.branch}:{}}})}async function m(){let a=globalThis.__piSessionListGeneration??0;if(globalThis.__piSessionListCache&&Date.now()-globalThis.__piSessionListCache.ts<z)return globalThis.__piSessionListCache.data;if(globalThis.__piSessionListPromise&&globalThis.__piSessionListPromiseGeneration===a)return globalThis.__piSessionListPromise;let b=l().then(b=>((globalThis.__piSessionListGeneration??0)===a&&(globalThis.__piSessionListCache={data:b,ts:Date.now()}),b)).finally(()=>{globalThis.__piSessionListPromise===b&&(globalThis.__piSessionListPromise=void 0,globalThis.__piSessionListPromiseGeneration=void 0)});return globalThis.__piSessionListPromise=b,globalThis.__piSessionListPromiseGeneration=a,b}[e,j]=k.then?(await k)():k;let z=5e3;function n(){globalThis.__piSessionListGeneration=(globalThis.__piSessionListGeneration??0)+1,globalThis.__piSessionListCache=void 0}function o(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}function p(){return globalThis.__piPathToSessionIdCache||(globalThis.__piPathToSessionIdCache=new Map),globalThis.__piPathToSessionIdCache}async function q(a){let b=o().get(a);return b||(await m(),o().get(a)??null)}async function r(a){let b=(0,g.normalize)(a),c=p().get(b);return c||(await m(),p().get(b))}function s(a,b){let c=(0,g.normalize)(b),d=o(),e=p(),f=d.get(a),h=e.get(c);f&&f!==c&&e.get(f)===a&&e.delete(f),h&&h!==a&&d.get(h)===c&&d.delete(h),d.set(a,c),e.set(c,a)}function t(a){let b=o(),c=p(),d=b.get(a);b.delete(a),d&&c.get(d)===a&&c.delete(d)}function u(a){let b=(0,f.openSync)(a,"r");try{let a=[],c=0,d=!1;for(;c<65536&&!d;){let e=Buffer.allocUnsafe(Math.min(4096,65536-c)),g=(0,f.readSync)(b,e,0,e.length,c);if(0===g)break;let h=e.subarray(0,g),i=h.indexOf(10);a.push(-1===i?h:h.subarray(0,i)),c+=g,d=-1!==i}if(!d&&c>=65536)return null;let e=Buffer.concat(a).toString("utf8").trimEnd();if(!e)return null;try{let a=JSON.parse(e);return"session"===a.type?a:null}catch{return null}}finally{(0,f.closeSync)(b)}}function v(a){return e.SessionManager.open(a).getEntries()}function w(a,b,c={}){let d=new Map;for(let b of a)d.set(b.id,b);let f=(0,e.buildSessionContext)(a,b,d),g=(0,e.buildContextEntries)(a,b,d),i=[],j=[];for(let a of g){let b=function(a,b){switch(a.type){case"message":{let c=b.deferToolResultImages?function(a){if("toolResult"!==a.role)return a;let b=0,c=0,d=new Set,e=a.content.filter(a=>{let e=function(a){let b,c;if(!y(a)||"image"!==a.type||("string"==typeof a.data?(b=a.data,c="string"==typeof a.mimeType?a.mimeType:void 0):y(a.source)&&"base64"===a.source.type&&"string"==typeof a.source.data&&(b=a.source.data,c="string"==typeof a.source.media_type?a.source.media_type:void 0),!b))return null;let d=b.endsWith("==")?2:+!!b.endsWith("=");return{bytes:Math.max(0,Math.floor(3*b.length/4)-d),mime:c}}(a);return!e||(b+=1,c+=e.bytes,e.mime&&d.add(e.mime),!1)});if(0===b)return a;let f=d.size>0?`: ${[...d].join(", ")}`:"";return e.push({type:"text",text:`[${b} tool result image${1===b?"":"s"} omitted from initial history payload${f}, ~${c} bytes]`}),{...a,content:e}}((0,h.B)(a.message)):(0,h.B)(a.message);if(!b.deferThinking||"assistant"!==c.role)return c;return{...c,content:c.content.map(a=>"thinking"===a.type&&""!==a.thinking.trim()?{...a,thinking:"",deferred:!0}:a)}}case"compaction":return{role:"custom",customType:"compaction",content:a.summary,display:!0,details:{tokensBefore:a.tokensBefore,firstKeptEntryId:a.firstKeptEntryId},timestamp:x(a.timestamp)};case"branch_summary":if(!a.summary)return null;return{role:"user",content:`*The conversation briefly explored another branch and returned with this summary:*
1
+ exports.id=5582,exports.ids=[5582],exports.modules={6999:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Tu:()=>o,o$:()=>n});var e=c(73024),f=c(76760),g=c(80974),h=c.n(g),i=c(75430),j=c(8102),k=a([i]);i=(k.then?(await k)():k)[0];let p={retries:{retries:10,factor:2,minTimeout:50,maxTimeout:2e3,randomize:!0},stale:3e4};function l(){return(0,f.join)((0,i.getAgentDir)(),"settings.json")}function m(){let a=l();if(!(0,e.existsSync)(a))return{};try{let b=JSON.parse((0,e.readFileSync)(a,"utf8"));return null===b||"object"!=typeof b||Array.isArray(b)?{}:b}catch{return{}}}async function n(a){let b=l(),c=null,d=await h().lock(b,{...p,onCompromised:a=>{c=a}});try{if(c)throw c;let d=m(),e=await a(d);if(c)throw c;if(!e||"object"!=typeof e||!e.settings)throw Error("settings.json mutation must return { settings }");if(!1===e.changed)return{changed:!1};if((0,j.$)(b,JSON.stringify(e.settings,null,2)),c)throw c;return{changed:!0}}finally{d().catch(()=>{})}}function o(){return m()}d()}catch(a){d(a)}})},8102:(a,b,c)=>{"use strict";c.d(b,{$:()=>g});var d=c(55511),e=c(29021),f=c(33873);function g(a,b){let c=(0,f.dirname)(a),g=(0,f.join)(c,`.${(0,f.basename)(a)}-${(0,d.randomUUID)()}.tmp`),h=!1;try{(0,e.writeFileSync)(g,b,{encoding:"utf8",flag:"wx",mode:384,flush:!0}),(0,e.renameSync)(g,a)}catch(a){throw h=!0,a}finally{try{(0,e.unlinkSync)(g)}catch(a){if("ENOENT"!==a.code&&!h)throw a}}}},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},23808:(a,b,c)=>{"use strict";c.d(b,{l:()=>q,P9:()=>p,IL:()=>r,KI:()=>n});var d=c(79646),e=c(29021),f=c(33873),g=c(28354),h=c(25252);function i(a){return a&&"win32"===process.platform?(0,f.normalize)(a):a}function j(a,b){return a===b||!!a&&!!b&&"win32"===process.platform&&i(a).toLowerCase()===i(b).toLowerCase()}let k=(0,g.promisify)(d.execFile);function l(){globalThis.__piProjectCache?.clear()}async function m(a,b){let{stdout:c}=await k("git",["-C",a,...b],{timeout:1e4,maxBuffer:1048576,env:{...process.env,LC_ALL:"C"}});return c.trim()}async function n(a){let b,c=(globalThis.__piProjectCache||(globalThis.__piProjectCache=new Map),globalThis.__piProjectCache),d=c.get(a);if(d&&d.expiresAt>Date.now())return d.info;try{if(!(0,e.existsSync)(a))return b=function(a){let b=(0,f.dirname)(a);if(!b.endsWith("-worktrees"))return null;let c=b.slice(0,-10);return c&&(0,e.existsSync)((0,f.join)(c,".git"))?{projectRoot:c,branch:(0,f.basename)(a),isWorktree:!0,isTopLevel:!0}:null}(a)??{projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1},c.set(a,{info:b,expiresAt:Date.now()+6e4}),b;let[d,g,h,k]=(await m(a,["rev-parse","--path-format=absolute","--git-common-dir","--git-dir","--show-toplevel","--abbrev-ref","HEAD"])).split("\n").map(a=>a.trim()),[l,n,o]=[d,g,h].map(i),p=a;try{p=(0,e.realpathSync)(a)}catch{}let q=j(o,p),r=!j(n,l)&&q;b={projectRoot:r?(0,f.dirname)(l):a,branch:k&&"HEAD"!==k?k:null,isWorktree:r,isTopLevel:q}}catch{b={projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1}}return c.set(a,{info:b,expiresAt:Date.now()+6e4}),b}async function o(a){let b=await m(a,["rev-parse","--path-format=absolute","--git-common-dir"]);return(0,f.dirname)(i(b))}async function p(a){let b=await m(a,["worktree","list","--porcelain"]),c=[],d=null,f=()=>{d?.path&&!d.prunable&&(0,e.existsSync)(d.path)&&c.push({path:d.path,branch:d.branch??null,isMain:0===c.length}),d=null};for(let a of b.split("\n"))a.startsWith("worktree ")?(f(),d={path:i(a.slice(9).trim())}):a.startsWith("branch ")&&d?d.branch=a.slice(7).trim().replace(/^refs\/heads\//,""):a.startsWith("prunable")&&d?d.prunable=!0:""===a.trim()&&f();return f(),c}async function q(a,b){let c=b.trim();if(!c)throw Error("Branch name is required");let d=c.replace(/[\/\\:*?"<>|\s]+/g,"-").replace(/^-+|-+$/g,"");if(!d)throw Error(`Invalid branch name: ${b}`);let g=await o(a),i=`${(0,f.resolve)(g)}-worktrees`,j=(0,f.join)(i,d);if((0,e.existsSync)(j))throw Error(`Directory already exists: ${j}`);(0,e.mkdirSync)(i,{recursive:!0});let k=!1;try{await m(g,["rev-parse","--verify","--quiet",`refs/heads/${c}`]),k=!0}catch{k=!1}try{k?await m(g,["worktree","add","--",j,c]):await m(g,["worktree","add","-b",c,"--",j])}catch(a){throw Error(s(a))}return(0,h.wz)(j),l(),{path:j,branch:c}}async function r(a,b,c=!1){let d=(await p(a)).find(a=>j(a.path,b));if(!d)throw Error(`Not a worktree of this repository: ${b}`);if(d.isMain)throw Error("Cannot remove the main worktree");try{await m(a,["worktree","remove",...c?["--force"]:[],b])}catch(a){throw Error(s(a))}l()}function s(a){let b=a.stderr;return"string"==typeof b&&b.trim()?b.trim():a instanceof Error?a.message:String(a)}},25252:(a,b,c)=>{"use strict";function d(a){return a.replace(/\\/g,"/")}function e(){return globalThis.__piAdditionalAllowedRoots||(globalThis.__piAdditionalAllowedRoots=new Set),globalThis.__piAdditionalAllowedRoots}function f(a){if(!a)return;let b=d(a);e().add(b),globalThis.__piAllowedRootsCache?.roots.add(b)}c.d(b,{HM:()=>e,Nw:()=>d,wz:()=>f})},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{BR:()=>u,DK:()=>w,O8:()=>t,Uv:()=>x,dQ:()=>n,eP:()=>v,mD:()=>o,os:()=>r,u1:()=>s});var e=c(75430),f=c(29021),g=c(33873),h=c(12039),i=c(67264),j=c(23808),k=c(6999),l=a([e,k]);async function m(){let a=await e.SessionManager.listAll(),b=new Map;for(let c of a)b.set((0,g.normalize)(c.path),c.id);let c=[...new Set(a.map(a=>a.cwd).filter(Boolean))],d=new Map;await Promise.all(c.map(async a=>{d.set(a,await (0,j.KI)(a))}));let f=(0,k.Tu)(),h=Array.isArray(f.sessionPins)?f.sessionPins:[],l=new Set(h.filter(a=>"string"==typeof a));return a.map(a=>{t(a.id,a.path);let c=a.cwd?d.get(a.cwd):void 0;return{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:(0,i.CS)(a.firstMessage||"(no messages)"),parentSessionId:a.parentSessionPath?b.get((0,g.normalize)(a.parentSessionPath)):void 0,projectRoot:c?.projectRoot??a.cwd,pinned:l.has(a.id),importedFrom:a.importedFrom,...c?.branch?{worktreeBranch:c.branch}:{}}})}async function n(){let a=globalThis.__piSessionListGeneration??0;if(globalThis.__piSessionListCache&&Date.now()-globalThis.__piSessionListCache.ts<A)return globalThis.__piSessionListCache.data;if(globalThis.__piSessionListPromise&&globalThis.__piSessionListPromiseGeneration===a)return globalThis.__piSessionListPromise;let b=m().then(b=>((globalThis.__piSessionListGeneration??0)===a&&(globalThis.__piSessionListCache={data:b,ts:Date.now()}),b)).finally(()=>{globalThis.__piSessionListPromise===b&&(globalThis.__piSessionListPromise=void 0,globalThis.__piSessionListPromiseGeneration=void 0)});return globalThis.__piSessionListPromise=b,globalThis.__piSessionListPromiseGeneration=a,b}[e,k]=l.then?(await l)():l;let A=5e3;function o(){globalThis.__piSessionListGeneration=(globalThis.__piSessionListGeneration??0)+1,globalThis.__piSessionListCache=void 0}function p(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}function q(){return globalThis.__piPathToSessionIdCache||(globalThis.__piPathToSessionIdCache=new Map),globalThis.__piPathToSessionIdCache}async function r(a){let b=p().get(a);return b||(await n(),p().get(a)??null)}async function s(a){let b=(0,g.normalize)(a),c=q().get(b);return c||(await n(),q().get(b))}function t(a,b){let c=(0,g.normalize)(b),d=p(),e=q(),f=d.get(a),h=e.get(c);f&&f!==c&&e.get(f)===a&&e.delete(f),h&&h!==a&&d.get(h)===c&&d.delete(h),d.set(a,c),e.set(c,a)}function u(a){let b=p(),c=q(),d=b.get(a);b.delete(a),d&&c.get(d)===a&&c.delete(d)}function v(a){let b=(0,f.openSync)(a,"r");try{let a=[],c=0,d=!1;for(;c<65536&&!d;){let e=Buffer.allocUnsafe(Math.min(4096,65536-c)),g=(0,f.readSync)(b,e,0,e.length,c);if(0===g)break;let h=e.subarray(0,g),i=h.indexOf(10);a.push(-1===i?h:h.subarray(0,i)),c+=g,d=-1!==i}if(!d&&c>=65536)return null;let e=Buffer.concat(a).toString("utf8").trimEnd();if(!e)return null;try{let a=JSON.parse(e);return"session"===a.type?a:null}catch{return null}}finally{(0,f.closeSync)(b)}}function w(a){return e.SessionManager.open(a).getEntries()}function x(a,b,c={}){let d=new Map;for(let b of a)d.set(b.id,b);let f=(0,e.buildSessionContext)(a,b,d),g=(0,e.buildContextEntries)(a,b,d),i=[],j=[];for(let a of g){let b=function(a,b){switch(a.type){case"message":{let c=b.deferToolResultImages?function(a){if("toolResult"!==a.role)return a;let b=0,c=0,d=new Set,e=a.content.filter(a=>{let e=function(a){let b,c;if(!z(a)||"image"!==a.type||("string"==typeof a.data?(b=a.data,c="string"==typeof a.mimeType?a.mimeType:void 0):z(a.source)&&"base64"===a.source.type&&"string"==typeof a.source.data&&(b=a.source.data,c="string"==typeof a.source.media_type?a.source.media_type:void 0),!b))return null;let d=b.endsWith("==")?2:+!!b.endsWith("=");return{bytes:Math.max(0,Math.floor(3*b.length/4)-d),mime:c}}(a);return!e||(b+=1,c+=e.bytes,e.mime&&d.add(e.mime),!1)});if(0===b)return a;let f=d.size>0?`: ${[...d].join(", ")}`:"";return e.push({type:"text",text:`[${b} tool result image${1===b?"":"s"} omitted from initial history payload${f}, ~${c} bytes]`}),{...a,content:e}}((0,h.B)(a.message)):(0,h.B)(a.message);if(!b.deferThinking||"assistant"!==c.role)return c;return{...c,content:c.content.map(a=>"thinking"===a.type&&""!==a.thinking.trim()?{...a,thinking:"",deferred:!0}:a)}}case"compaction":return{role:"custom",customType:"compaction",content:a.summary,display:!0,details:{tokensBefore:a.tokensBefore,firstKeptEntryId:a.firstKeptEntryId},timestamp:y(a.timestamp)};case"branch_summary":if(!a.summary)return null;return{role:"user",content:`*The conversation briefly explored another branch and returned with this summary:*
2
2
 
3
- ${a.summary}`,timestamp:x(a.timestamp)};case"custom_message":return{role:"custom",customType:a.customType,content:a.content,display:a.display,details:a.details,timestamp:x(a.timestamp)};default:return null}}(a,c);b&&(i.push(b),j.push(a.id))}return{messages:i,entryIds:j,thinkingLevel:f.thinkingLevel,model:f.model}}function x(a){let b=Date.parse(a);return Number.isNaN(b)?void 0:b}function y(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}d()}catch(a){d(a)}})},78335:()=>{},96487:()=>{}};
3
+ ${a.summary}`,timestamp:y(a.timestamp)};case"custom_message":return{role:"custom",customType:a.customType,content:a.content,display:a.display,details:a.details,timestamp:y(a.timestamp)};default:return null}}(a,c);b&&(i.push(b),j.push(a.id))}return{messages:i,entryIds:j,thinkingLevel:f.thinkingLevel,model:f.model}}function y(a){let b=Date.parse(a);return Number.isNaN(b)?void 0:b}function z(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}d()}catch(a){d(a)}})},67264:(a,b,c)=>{"use strict";c.d(b,{CS:()=>l,MJ:()=>k,Md:()=>g,UY:()=>h,g0:()=>j,wI:()=>i});let d="normal",e="full",f="auto";function g(){return{collaborationMode:d,tokenMode:e,toolApprovalMode:f,permissionRules:{allow:[],ask:[],deny:[]}}}function h(a){return"normal"===a||"plan"===a||"goal"===a?a:d}function i(a){return"economy"===a||"delivery"===a||"full"===a?a:e}function j(a){return"ask"===a||"auto"===a||"yolo"===a?a:f}let k=new Set(["read","grep","find","ls","bash_output","get_tools","get_commands","get_session_stats"]);function l(a){if(!a)return"";let b=a.replace(/^\uFEFF/,""),c=b;if((b=b.replace(/<(?:economy|delivery|goal)-profile>\n?[\s\S]*?<\/(?:economy|delivery|goal)-profile>\n*(?:Goal:\s*[^\n]*\n?)?/g,""))===c){let a=/^\s*<(?:economy|delivery|goal)-profile>\s*/.exec(b);if(a){let c=b.slice(a[0].length).match(/^[^.]*?\.\s+([\s\S]*)$/);b=c?c[1]:""}}return(b=b.replace(/^You are in PLAN MODE\.[\s\S]*?\n(?=\n|$)/,"")).replace(/^\s*\n/,"").trimStart()}},78335:()=>{},96487:()=>{}};