ompgui 0.6.4 → 0.7.1

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 (336) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +16 -10
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +31 -3
  5. package/.next/react-loadable-manifest.json +13 -13
  6. package/.next/required-server-files.js +2 -2
  7. package/.next/required-server-files.json +2 -2
  8. package/.next/routes-manifest.json +43 -2
  9. package/.next/server/app/_global-error/page.js +2 -2
  10. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/_global-error.html +1 -1
  12. package/.next/server/app/_global-error.rsc +2 -2
  13. package/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
  14. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +2 -2
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found/page.js +1 -1
  17. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/.next/server/app/_not-found.html +1 -1
  19. package/.next/server/app/_not-found.rsc +3 -3
  20. package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  21. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  22. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  23. package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
  24. package/.next/server/app/api/agent/[id]/events/route.js +2 -2
  25. package/.next/server/app/api/agent/[id]/events/route.js.nft.json +1 -1
  26. package/.next/server/app/api/agent/[id]/route.js +1 -1
  27. package/.next/server/app/api/agent/[id]/route.js.nft.json +1 -1
  28. package/.next/server/app/api/agent/new/route.js +1 -1
  29. package/.next/server/app/api/agent/new/route.js.nft.json +1 -1
  30. package/.next/server/app/api/agent/running/events/route.js +2 -2
  31. package/.next/server/app/api/agent/running/events/route.js.nft.json +1 -1
  32. package/.next/server/app/api/agents/[name]/route.js +1 -1
  33. package/.next/server/app/api/agents/route.js +1 -1
  34. package/.next/server/app/api/agents/unpack/route.js +1 -1
  35. package/.next/server/app/api/app-update/route.js +1 -1
  36. package/.next/server/app/api/auth/all-providers/route.js +1 -1
  37. package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
  38. package/.next/server/app/api/auth/login/[provider]/route.js +1 -1
  39. package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
  40. package/.next/server/app/api/auth/providers/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 +2 -1
  43. package/.next/server/app/api/default-cwd/route.js +1 -1
  44. package/.next/server/app/api/file-index/route.js +1 -1
  45. package/.next/server/app/api/files/[...path]/route.js +5 -5
  46. package/.next/server/app/api/files/[...path]/route.js.nft.json +1 -1
  47. package/.next/server/app/api/git/diff/route.js +2 -2
  48. package/.next/server/app/api/git/status/route.js +1 -1
  49. package/.next/server/app/api/home/route.js +1 -1
  50. package/.next/server/app/api/mcp/route.js +3 -3
  51. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  52. package/.next/server/app/api/model-roles/route.js +1 -1
  53. package/.next/server/app/api/models/route.js +1 -1
  54. package/.next/server/app/api/models-config/catalog/route.js +1 -1
  55. package/.next/server/app/api/models-config/route.js +1 -1
  56. package/.next/server/app/api/models-config/test/route.js +1 -1
  57. package/.next/server/app/api/omp-settings/route.js +1 -1
  58. package/.next/server/app/api/omp-update/route.js +1 -1
  59. package/.next/server/app/api/omp-update/route.js.nft.json +1 -1
  60. package/.next/server/app/api/omp-version/route.js +1 -1
  61. package/.next/server/app/api/plugins/route.js +1 -1
  62. package/.next/server/app/api/projects/route.js +2 -2
  63. package/.next/server/app/api/providers/enable/route.js +1 -1
  64. package/.next/server/app/api/relay/devices/[id]/route.js +1 -0
  65. package/.next/server/app/api/relay/devices/[id]/route.js.nft.json +1 -0
  66. package/.next/server/app/api/relay/devices/[id]/route_client-reference-manifest.js +1 -0
  67. package/.next/server/app/api/relay/devices/route.js +1 -0
  68. package/.next/server/app/api/relay/devices/route.js.nft.json +1 -0
  69. package/.next/server/app/api/relay/devices/route_client-reference-manifest.js +1 -0
  70. package/.next/server/app/api/relay/pair/route.js +1 -0
  71. package/.next/server/app/api/relay/pair/route.js.nft.json +1 -0
  72. package/.next/server/app/api/relay/pair/route_client-reference-manifest.js +1 -0
  73. package/.next/server/app/api/sessions/[id]/archive/route.js +1 -1
  74. package/.next/server/app/api/sessions/[id]/archive/route.js.nft.json +1 -1
  75. package/.next/server/app/api/sessions/[id]/auto-name/route.js +1 -1
  76. package/.next/server/app/api/sessions/[id]/auto-name/route.js.nft.json +1 -1
  77. package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
  78. package/.next/server/app/api/sessions/[id]/entries/[entryId]/media/route.js +1 -0
  79. package/.next/server/app/api/sessions/[id]/entries/[entryId]/media/route.js.nft.json +1 -0
  80. package/.next/server/app/api/sessions/[id]/entries/[entryId]/media/route_client-reference-manifest.js +1 -0
  81. package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
  82. package/.next/server/app/api/sessions/[id]/export/route.js +1 -1
  83. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  84. package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  85. package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
  86. package/.next/server/app/api/sessions/[id]/state/route.js.nft.json +1 -1
  87. package/.next/server/app/api/sessions/[id]/subagents/[subagentId]/route.js +1 -1
  88. package/.next/server/app/api/sessions/[id]/subagents/route.js +1 -1
  89. package/.next/server/app/api/sessions/[id]/subagents/route.js.nft.json +1 -1
  90. package/.next/server/app/api/sessions/archive/route.js +1 -1
  91. package/.next/server/app/api/sessions/import/route.js +1 -1
  92. package/.next/server/app/api/sessions/route.js +1 -1
  93. package/.next/server/app/api/sessions/route.js.nft.json +1 -1
  94. package/.next/server/app/api/skills/check/route.js +1 -1
  95. package/.next/server/app/api/skills/check/route.js.nft.json +1 -1
  96. package/.next/server/app/api/skills/install/route.js +1 -1
  97. package/.next/server/app/api/skills/route.js +1 -1
  98. package/.next/server/app/api/skills/search/route.js +1 -1
  99. package/.next/server/app/api/skills/update/route.js +1 -1
  100. package/.next/server/app/api/skills/update/route.js.nft.json +1 -1
  101. package/.next/server/app/api/usage/route.js +1 -1
  102. package/.next/server/app/api/web-auth/session/route.js +1 -1
  103. package/.next/server/app/api/worktrees/route.js +1 -1
  104. package/.next/server/app/apple-icon.png/route.js +1 -1
  105. package/.next/server/app/favicon.ico/route.js +1 -1
  106. package/.next/server/app/icon.svg/route.js +1 -1
  107. package/.next/server/app/index.html +1 -1
  108. package/.next/server/app/index.rsc +4 -4
  109. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  110. package/.next/server/app/index.segments/_full.segment.rsc +4 -4
  111. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  112. package/.next/server/app/login/page.js +1 -1
  113. package/.next/server/app/login/page.js.nft.json +1 -1
  114. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  115. package/.next/server/app/login.html +1 -1
  116. package/.next/server/app/login.rsc +4 -4
  117. package/.next/server/app/login.segments/_full.segment.rsc +4 -4
  118. package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  119. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
  120. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  121. package/.next/server/app/page.js +2 -2
  122. package/.next/server/app/page.js.nft.json +1 -1
  123. package/.next/server/app/page_client-reference-manifest.js +1 -1
  124. package/.next/server/app/pair/page.js +1 -0
  125. package/.next/server/app/pair/page.js.nft.json +1 -0
  126. package/.next/server/app/pair/page_client-reference-manifest.js +1 -0
  127. package/.next/server/app/pair.html +1 -0
  128. package/.next/server/app/pair.meta +26 -0
  129. package/.next/server/app/pair.rsc +23 -0
  130. package/.next/server/app/pair.segments/_full.segment.rsc +23 -0
  131. package/.next/server/app/pair.segments/_tree.segment.rsc +4 -0
  132. package/.next/server/app/pair.segments/pair/__PAGE__.segment.rsc +25 -0
  133. package/.next/server/app/relay/route.js +1 -0
  134. package/.next/server/app/relay/route.js.nft.json +1 -0
  135. package/.next/server/app/relay/route_client-reference-manifest.js +1 -0
  136. package/.next/server/app-paths-manifest.json +16 -10
  137. package/.next/server/chunks/1448.js +1 -1
  138. package/.next/server/chunks/1671.js +1 -1
  139. package/.next/server/chunks/2043.js +12 -0
  140. package/.next/server/chunks/2676.js +4 -0
  141. package/.next/server/chunks/2865.js +1 -1
  142. package/.next/server/chunks/3100.js +2 -2
  143. package/.next/server/chunks/3798.js +4 -5
  144. package/.next/server/chunks/6209.js +4 -4
  145. package/.next/server/chunks/{8353.js → 6332.js} +2 -2
  146. package/.next/server/chunks/7077.js +1 -0
  147. package/.next/server/chunks/714.js +1 -1
  148. package/.next/server/chunks/7779.js +1 -0
  149. package/.next/server/chunks/795.js +105 -0
  150. package/.next/server/chunks/8501.js +1 -1
  151. package/.next/server/chunks/8672.js +1 -0
  152. package/.next/server/chunks/8834.js +18 -0
  153. package/.next/server/chunks/9145.js +2 -0
  154. package/.next/server/chunks/933.js +1 -1
  155. package/.next/server/instrumentation.js +1 -1
  156. package/.next/server/instrumentation.js.nft.json +1 -1
  157. package/.next/server/middleware-build-manifest.js +1 -1
  158. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  159. package/.next/server/middleware.js +5 -5
  160. package/.next/server/pages/404.html +1 -1
  161. package/.next/server/pages/500.html +1 -1
  162. package/.next/server/prefetch-hints.json +14 -0
  163. package/.next/server/server-reference-manifest.json +1 -1
  164. package/.next/static/QFUZ5E_wgec_DUeAoDxrb/_buildManifest.js +1 -0
  165. package/.next/static/chunks/1012.2a9e89fd82a08863.js +17 -0
  166. package/.next/static/chunks/1108.1f1e4661b6e402fb.js +1 -0
  167. package/.next/static/chunks/{2201.46326eb058826eb2.js → 2201.e6bbfc26ce87920c.js} +1 -1
  168. package/.next/static/chunks/3065-24b6f2111fc740ea.js +1 -0
  169. package/.next/static/chunks/{3274.2a04ea2716225057.js → 3274.4cdcf3a52b884856.js} +1 -1
  170. package/.next/static/chunks/4315-bd1069a88334f3a3.js +1 -0
  171. package/.next/static/chunks/484.761e1ff01f663fb2.js +1 -0
  172. package/.next/static/chunks/5658.0fe2642c815aea9a.js +1 -0
  173. package/.next/static/chunks/6604.4ad489ec0e9e8985.js +1 -0
  174. package/.next/static/chunks/{7488.1403755f69bda581.js → 7488.42415d6f1b86c86b.js} +1 -1
  175. package/.next/static/chunks/9090-6ce028ffeafe2aee.js +1 -0
  176. package/.next/static/chunks/9448.b6c5eb8f1356d5fd.js +2 -0
  177. package/.next/static/chunks/9668.b62ea9e45077f781.js +1 -0
  178. package/.next/static/chunks/app/_global-error/page-2900441d61e06609.js +1 -0
  179. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-2900441d61e06609.js +1 -0
  180. package/.next/static/chunks/app/api/agent/[id]/events/route-2900441d61e06609.js +1 -0
  181. package/.next/static/chunks/app/api/agent/[id]/route-2900441d61e06609.js +1 -0
  182. package/.next/static/chunks/app/api/agent/new/route-2900441d61e06609.js +1 -0
  183. package/.next/static/chunks/app/api/agent/running/events/route-2900441d61e06609.js +1 -0
  184. package/.next/static/chunks/app/api/agents/[name]/route-2900441d61e06609.js +1 -0
  185. package/.next/static/chunks/app/api/agents/route-2900441d61e06609.js +1 -0
  186. package/.next/static/chunks/app/api/agents/unpack/route-2900441d61e06609.js +1 -0
  187. package/.next/static/chunks/app/api/app-update/route-2900441d61e06609.js +1 -0
  188. package/.next/static/chunks/app/api/auth/all-providers/route-2900441d61e06609.js +1 -0
  189. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-2900441d61e06609.js +1 -0
  190. package/.next/static/chunks/app/api/auth/login/[provider]/route-2900441d61e06609.js +1 -0
  191. package/.next/static/chunks/app/api/auth/logout/[provider]/route-2900441d61e06609.js +1 -0
  192. package/.next/static/chunks/app/api/auth/providers/route-2900441d61e06609.js +1 -0
  193. package/.next/static/chunks/app/api/cwd/browse/route-2900441d61e06609.js +1 -0
  194. package/.next/static/chunks/app/api/cwd/validate/route-2900441d61e06609.js +1 -0
  195. package/.next/static/chunks/app/api/default-cwd/route-2900441d61e06609.js +1 -0
  196. package/.next/static/chunks/app/api/file-index/route-2900441d61e06609.js +1 -0
  197. package/.next/static/chunks/app/api/files/[...path]/route-2900441d61e06609.js +1 -0
  198. package/.next/static/chunks/app/api/git/diff/route-2900441d61e06609.js +1 -0
  199. package/.next/static/chunks/app/api/git/status/route-2900441d61e06609.js +1 -0
  200. package/.next/static/chunks/app/api/home/route-2900441d61e06609.js +1 -0
  201. package/.next/static/chunks/app/api/mcp/route-2900441d61e06609.js +1 -0
  202. package/.next/static/chunks/app/api/model-roles/route-2900441d61e06609.js +1 -0
  203. package/.next/static/chunks/app/api/models/route-2900441d61e06609.js +1 -0
  204. package/.next/static/chunks/app/api/models-config/catalog/route-2900441d61e06609.js +1 -0
  205. package/.next/static/chunks/app/api/models-config/route-2900441d61e06609.js +1 -0
  206. package/.next/static/chunks/app/api/models-config/test/route-2900441d61e06609.js +1 -0
  207. package/.next/static/chunks/app/api/omp-settings/route-2900441d61e06609.js +1 -0
  208. package/.next/static/chunks/app/api/omp-update/route-2900441d61e06609.js +1 -0
  209. package/.next/static/chunks/app/api/omp-version/route-2900441d61e06609.js +1 -0
  210. package/.next/static/chunks/app/api/plugins/route-2900441d61e06609.js +1 -0
  211. package/.next/static/chunks/app/api/projects/route-2900441d61e06609.js +1 -0
  212. package/.next/static/chunks/app/api/providers/enable/route-2900441d61e06609.js +1 -0
  213. package/.next/static/chunks/app/api/relay/devices/[id]/route-2900441d61e06609.js +1 -0
  214. package/.next/static/chunks/app/api/relay/devices/route-2900441d61e06609.js +1 -0
  215. package/.next/static/chunks/app/api/relay/pair/route-2900441d61e06609.js +1 -0
  216. package/.next/static/chunks/app/api/sessions/[id]/archive/route-2900441d61e06609.js +1 -0
  217. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-2900441d61e06609.js +1 -0
  218. package/.next/static/chunks/app/api/sessions/[id]/context/route-2900441d61e06609.js +1 -0
  219. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/media/route-2900441d61e06609.js +1 -0
  220. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-2900441d61e06609.js +1 -0
  221. package/.next/static/chunks/app/api/sessions/[id]/export/route-2900441d61e06609.js +1 -0
  222. package/.next/static/chunks/app/api/sessions/[id]/route-2900441d61e06609.js +1 -0
  223. package/.next/static/chunks/app/api/sessions/[id]/state/route-2900441d61e06609.js +1 -0
  224. package/.next/static/chunks/app/api/sessions/[id]/subagents/[subagentId]/route-2900441d61e06609.js +1 -0
  225. package/.next/static/chunks/app/api/sessions/[id]/subagents/route-2900441d61e06609.js +1 -0
  226. package/.next/static/chunks/app/api/sessions/archive/route-2900441d61e06609.js +1 -0
  227. package/.next/static/chunks/app/api/sessions/import/route-2900441d61e06609.js +1 -0
  228. package/.next/static/chunks/app/api/sessions/route-2900441d61e06609.js +1 -0
  229. package/.next/static/chunks/app/api/skills/check/route-2900441d61e06609.js +1 -0
  230. package/.next/static/chunks/app/api/skills/install/route-2900441d61e06609.js +1 -0
  231. package/.next/static/chunks/app/api/skills/route-2900441d61e06609.js +1 -0
  232. package/.next/static/chunks/app/api/skills/search/route-2900441d61e06609.js +1 -0
  233. package/.next/static/chunks/app/api/skills/update/route-2900441d61e06609.js +1 -0
  234. package/.next/static/chunks/app/api/usage/route-2900441d61e06609.js +1 -0
  235. package/.next/static/chunks/app/api/web-auth/session/route-2900441d61e06609.js +1 -0
  236. package/.next/static/chunks/app/api/worktrees/route-2900441d61e06609.js +1 -0
  237. package/.next/static/chunks/app/login/page-76b98ef41947c31b.js +1 -0
  238. package/.next/static/chunks/app/manifest.webmanifest/route-2900441d61e06609.js +1 -0
  239. package/.next/static/chunks/app/page-dcb62803f94d0c1c.js +59 -0
  240. package/.next/static/chunks/app/pair/page-e1ad2578491903a8.js +1 -0
  241. package/.next/static/chunks/app/relay/route-2900441d61e06609.js +1 -0
  242. package/.next/static/chunks/next/dist/client/components/builtin/app-error-2900441d61e06609.js +1 -0
  243. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-2900441d61e06609.js +1 -0
  244. package/.next/static/chunks/next/dist/client/components/builtin/not-found-2900441d61e06609.js +1 -0
  245. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-2900441d61e06609.js +1 -0
  246. package/.next/static/chunks/webpack-789dbb5c37af2dc8.js +1 -0
  247. package/.next/static/css/d4456801cd2ff0da.css +3 -0
  248. package/README.ja.md +6 -0
  249. package/README.ko.md +8 -0
  250. package/README.md +9 -1
  251. package/README.zh-CN.md +6 -0
  252. package/bin/ompgui-options.js +11 -3
  253. package/bin/ompgui-pair.js +108 -0
  254. package/bin/ompgui.js +23 -11
  255. package/next.config.ts +3 -1
  256. package/package.json +17 -14
  257. package/.next/server/chunks/3379.js +0 -1
  258. package/.next/server/chunks/370.js +0 -18
  259. package/.next/server/chunks/6465.js +0 -1
  260. package/.next/server/chunks/7567.js +0 -1
  261. package/.next/server/chunks/7834.js +0 -5
  262. package/.next/static/JdmIeYayj8Nh7gwC3FS8R/_buildManifest.js +0 -1
  263. package/.next/static/chunks/4315-2a4f20fecfcbbdd6.js +0 -1
  264. package/.next/static/chunks/484.3215a9f03ff865da.js +0 -1
  265. package/.next/static/chunks/4906-7dff29185f63f908.js +0 -1
  266. package/.next/static/chunks/5658.eb16997c19c2372b.js +0 -1
  267. package/.next/static/chunks/6373.25afd5c658e99aa2.js +0 -17
  268. package/.next/static/chunks/6604.226e5eae7c573e65.js +0 -1
  269. package/.next/static/chunks/7194.0b9186e22efff8bc.js +0 -1
  270. package/.next/static/chunks/9448.3ded6700334581bd.js +0 -2
  271. package/.next/static/chunks/9668.5e681bc0055ed4d0.js +0 -1
  272. package/.next/static/chunks/app/_global-error/page-dee1691f375ec007.js +0 -1
  273. package/.next/static/chunks/app/api/agent/[id]/bash-output/route-dee1691f375ec007.js +0 -1
  274. package/.next/static/chunks/app/api/agent/[id]/events/route-dee1691f375ec007.js +0 -1
  275. package/.next/static/chunks/app/api/agent/[id]/route-dee1691f375ec007.js +0 -1
  276. package/.next/static/chunks/app/api/agent/new/route-dee1691f375ec007.js +0 -1
  277. package/.next/static/chunks/app/api/agent/running/events/route-dee1691f375ec007.js +0 -1
  278. package/.next/static/chunks/app/api/agents/[name]/route-dee1691f375ec007.js +0 -1
  279. package/.next/static/chunks/app/api/agents/route-dee1691f375ec007.js +0 -1
  280. package/.next/static/chunks/app/api/agents/unpack/route-dee1691f375ec007.js +0 -1
  281. package/.next/static/chunks/app/api/app-update/route-dee1691f375ec007.js +0 -1
  282. package/.next/static/chunks/app/api/auth/all-providers/route-dee1691f375ec007.js +0 -1
  283. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-dee1691f375ec007.js +0 -1
  284. package/.next/static/chunks/app/api/auth/login/[provider]/route-dee1691f375ec007.js +0 -1
  285. package/.next/static/chunks/app/api/auth/logout/[provider]/route-dee1691f375ec007.js +0 -1
  286. package/.next/static/chunks/app/api/auth/providers/route-dee1691f375ec007.js +0 -1
  287. package/.next/static/chunks/app/api/cwd/browse/route-dee1691f375ec007.js +0 -1
  288. package/.next/static/chunks/app/api/cwd/validate/route-dee1691f375ec007.js +0 -1
  289. package/.next/static/chunks/app/api/default-cwd/route-dee1691f375ec007.js +0 -1
  290. package/.next/static/chunks/app/api/file-index/route-dee1691f375ec007.js +0 -1
  291. package/.next/static/chunks/app/api/files/[...path]/route-dee1691f375ec007.js +0 -1
  292. package/.next/static/chunks/app/api/git/diff/route-dee1691f375ec007.js +0 -1
  293. package/.next/static/chunks/app/api/git/status/route-dee1691f375ec007.js +0 -1
  294. package/.next/static/chunks/app/api/home/route-dee1691f375ec007.js +0 -1
  295. package/.next/static/chunks/app/api/mcp/route-dee1691f375ec007.js +0 -1
  296. package/.next/static/chunks/app/api/model-roles/route-dee1691f375ec007.js +0 -1
  297. package/.next/static/chunks/app/api/models/route-dee1691f375ec007.js +0 -1
  298. package/.next/static/chunks/app/api/models-config/catalog/route-dee1691f375ec007.js +0 -1
  299. package/.next/static/chunks/app/api/models-config/route-dee1691f375ec007.js +0 -1
  300. package/.next/static/chunks/app/api/models-config/test/route-dee1691f375ec007.js +0 -1
  301. package/.next/static/chunks/app/api/omp-settings/route-dee1691f375ec007.js +0 -1
  302. package/.next/static/chunks/app/api/omp-update/route-dee1691f375ec007.js +0 -1
  303. package/.next/static/chunks/app/api/omp-version/route-dee1691f375ec007.js +0 -1
  304. package/.next/static/chunks/app/api/plugins/route-dee1691f375ec007.js +0 -1
  305. package/.next/static/chunks/app/api/projects/route-dee1691f375ec007.js +0 -1
  306. package/.next/static/chunks/app/api/providers/enable/route-dee1691f375ec007.js +0 -1
  307. package/.next/static/chunks/app/api/sessions/[id]/archive/route-dee1691f375ec007.js +0 -1
  308. package/.next/static/chunks/app/api/sessions/[id]/auto-name/route-dee1691f375ec007.js +0 -1
  309. package/.next/static/chunks/app/api/sessions/[id]/context/route-dee1691f375ec007.js +0 -1
  310. package/.next/static/chunks/app/api/sessions/[id]/entries/[entryId]/thinking/route-dee1691f375ec007.js +0 -1
  311. package/.next/static/chunks/app/api/sessions/[id]/export/route-dee1691f375ec007.js +0 -1
  312. package/.next/static/chunks/app/api/sessions/[id]/route-dee1691f375ec007.js +0 -1
  313. package/.next/static/chunks/app/api/sessions/[id]/state/route-dee1691f375ec007.js +0 -1
  314. package/.next/static/chunks/app/api/sessions/[id]/subagents/[subagentId]/route-dee1691f375ec007.js +0 -1
  315. package/.next/static/chunks/app/api/sessions/[id]/subagents/route-dee1691f375ec007.js +0 -1
  316. package/.next/static/chunks/app/api/sessions/archive/route-dee1691f375ec007.js +0 -1
  317. package/.next/static/chunks/app/api/sessions/import/route-dee1691f375ec007.js +0 -1
  318. package/.next/static/chunks/app/api/sessions/route-dee1691f375ec007.js +0 -1
  319. package/.next/static/chunks/app/api/skills/check/route-dee1691f375ec007.js +0 -1
  320. package/.next/static/chunks/app/api/skills/install/route-dee1691f375ec007.js +0 -1
  321. package/.next/static/chunks/app/api/skills/route-dee1691f375ec007.js +0 -1
  322. package/.next/static/chunks/app/api/skills/search/route-dee1691f375ec007.js +0 -1
  323. package/.next/static/chunks/app/api/skills/update/route-dee1691f375ec007.js +0 -1
  324. package/.next/static/chunks/app/api/usage/route-dee1691f375ec007.js +0 -1
  325. package/.next/static/chunks/app/api/web-auth/session/route-dee1691f375ec007.js +0 -1
  326. package/.next/static/chunks/app/api/worktrees/route-dee1691f375ec007.js +0 -1
  327. package/.next/static/chunks/app/login/page-96cae346e4259ebf.js +0 -1
  328. package/.next/static/chunks/app/manifest.webmanifest/route-dee1691f375ec007.js +0 -1
  329. package/.next/static/chunks/app/page-36d1ca1a0add3500.js +0 -59
  330. package/.next/static/chunks/next/dist/client/components/builtin/app-error-dee1691f375ec007.js +0 -1
  331. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-dee1691f375ec007.js +0 -1
  332. package/.next/static/chunks/next/dist/client/components/builtin/not-found-dee1691f375ec007.js +0 -1
  333. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-dee1691f375ec007.js +0 -1
  334. package/.next/static/chunks/webpack-2b3401cd0c93c4c4.js +0 -1
  335. package/.next/static/css/dd19cac539e3e218.css +0 -3
  336. /package/.next/static/{JdmIeYayj8Nh7gwC3FS8R → QFUZ5E_wgec_DUeAoDxrb}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";exports.id=7779,exports.ids=[7779],exports.modules={28967:(a,b,c)=>{function d(){return globalThis.__piModelsCacheState||(globalThis.__piModelsCacheState={entries:new Map,inFlight:new Map,generation:0}),globalThis.__piModelsCacheState}function e(){let a=d();a.generation+=1,a.entries.clear(),a.inFlight.clear()}function f(a){return{...a,modelError:"Model list is temporarily unavailable. Check your configuration and try again."}}function g(a,b){var c,e,f;let g,h,i=d(),j=i.entries.get(a);if(j&&j.expiresAt>Date.now())return Promise.resolve(j.data);let k=i.inFlight.get(a)??(c=i,e=a,f=b,g=c.generation,h=Promise.resolve().then(f).then(a=>{if(c.generation===g&&c.inFlight.get(e)===h){for(c.entries.delete(e);c.entries.size>=32;){let a=c.entries.keys().next().value;if(void 0===a)break;c.entries.delete(a)}c.entries.set(e,{data:a,expiresAt:Date.now()+6e4})}return a}).finally(()=>{c.inFlight.get(e)===h&&c.inFlight.delete(e)}),c.inFlight.set(e,h),h);return j?(k.catch(()=>{}),Promise.resolve(j.data)):k}c.d(b,{Fw:()=>f,kn:()=>e,rC:()=>g})},87779:(a,b,c)=>{c.d(b,{A4:()=>T,HG:()=>U,rb:()=>P,Te:()=>V,OF:()=>$,Fn:()=>X});var d=c(29021),e=c(21820),f=c(78970),g=c(28967),h=c(13798),i=c(88501),j=c(78573),k=c(77598);let l={revision:0,items:[]},m="enqueue_message",n="recall_queued_message",o="delete_queued_message",p="promote_queued_message",q="get_message_queue",r="queue_stale_revision",s="queue_item_missing",t="queue_item_sending",u="queue_invalid",v="This message may already have been handed to the agent. It was not confirmed and will not be retried.",w=new Set([m,n,o,p,q]);class x extends Error{constructor(a,b){super(a),this.name="SessionQueueError",this.code=b}}function y(a){return"steer"===a||"followUp"===a}function z(a){return{type:"message_queue_update",queue:a}}function A(a,b){return b?{queue:a,recalled:b}:{queue:a}}function B(a){return Buffer.byteLength(a,"utf8")}function C(a){let b={id:a.id,text:a.text,lane:a.lane,status:a.status,...a.error?{error:a.error}:{}};return Object.freeze(b),b}class D{getSnapshot(){return this.snapshot}hasSending(){return this.items.some(a=>"sending"===a.status)}selectDispatchCandidate(a){if(!this.hasSending())return this.items.find(b=>"queued"===b.status&&b.lane===a)}enqueue(a){if(!y(a.lane))throw new x("lane must be steer or followUp",u);let b=this.assertText(a.text);if(this.items.length>=32)throw new x("The queue already holds 32 messages","queue_full");this.assertTotalBytes(B(b));let c=C({id:(0,k.randomUUID)(),lane:a.lane,text:b,status:"queued"});return this.items=[...this.items,c],this.publish()}promote(a,b){let c=this.requireMutable(a,b);if("followUp"!==c.lane||"queued"!==c.status)throw new x("Only a queued follow-up can be promoted to steer",u);let d=C({...c,lane:"steer",status:"queued"});return this.items=[d,...this.items.filter(b=>b.id!==a)],this.publish()}recall(a,b){let c=this.requireMutable(a,b);return this.items=this.items.filter(b=>b.id!==a),{item:c,snapshot:this.publish()}}delete(a,b){return this.requireMutable(a,b),this.items=this.items.filter(b=>b.id!==a),this.publish()}markSending(a){let b=this.items.find(b=>b.id===a);if(!b)throw new x("Queued message was not found",s);if("queued"!==b.status)throw new x("Queued message is already being sent",t);return this.replace(a,{...b,status:"sending"}),this.publish()}markFailed(a,b){let c=this.items.find(b=>b.id===a);return c?(this.replace(a,{...c,status:"failed",error:b}),this.publish()):this.snapshot}remove(a){return this.items.some(b=>b.id===a)?(this.items=this.items.filter(b=>b.id!==a),this.publish()):this.snapshot}failSending(a){return this.hasSending()?(this.items=this.items.map(b=>"sending"===b.status?C({...b,status:"failed",error:a}):b),this.publish()):this.snapshot}reset(){return this.items=[],this.revision=0,this.snapshot=l,this.snapshot}requireMutable(a,b){this.assertCas(b);let c=this.items.find(b=>b.id===a);if(!c)throw new x("Queued message was not found",s);if("sending"===c.status)throw new x("Queued message is already being sent",t);return c}assertCas(a){if("number"!=typeof a||a!==this.revision)throw new x("Queue revision is stale; reload the queue and retry",r)}assertText(a){if("string"!=typeof a)throw new x("Message text is required",u);if(0===a.length||0===a.trim().length)throw new x("Message text cannot be empty",u);if(B(a)>262144)throw new x("Message exceeds 262144 bytes","queue_item_too_large");return a}assertTotalBytes(a){let b=a;for(let a of this.items)b+=B(a.text);if(b>1048576)throw new x("Queue exceeds 1048576 bytes","queue_too_large")}replace(a,b){this.items=this.items.map(c=>c.id===a?C(b):c)}publish(){let a;this.revision+=1;let b={revision:this.revision,items:(Object.freeze(a=this.items.map(a=>C(a))),a)};return Object.freeze(b),this.snapshot=b,b}constructor(){this.revision=0,this.items=[],this.snapshot=l}}let E="This session is restarting — retry in a moment.";class F extends Error{constructor(a,b){super(a),this.name="WebRpcError",this.code=b}}let G=new Set(["select","confirm","input","editor","open_url"]),H=new Set(["abort","abort_and_prompt","set_thinking_level","cycle_thinking_level","cycle_model","get_available_models","set_auto_compaction","set_auto_retry","abort_retry","abort_bash","set_todos","set_steering_mode","set_follow_up_mode","set_interrupt_mode","get_branch_messages","get_messages","get_messages_page","export_html","handoff","get_subagents","get_subagent_messages","set_subagent_subscription","get_login_providers","login"]),I={navigate_tree:"Branch navigation is not supported over the omp RPC protocol",clear_queue:"Recalling queued messages is not supported over the omp RPC protocol",get_tools:"Per-session tool listing is not supported over the omp RPC protocol",set_tools:"Changing tools on a running session is not supported over the omp RPC protocol; tool presets apply to new sessions",extension_ui_input:"Extension custom UI is not supported over the omp RPC protocol"},J={find:"glob",search:"grep"},K=new Set(["ls"]),L=["bash","read","edit","write","grep","find","ls","task"].map(a=>a.toLowerCase()).sort().join(",");function M(a,b,c=!1){let d=[];if(a)d.push("--resume",a);else if(void 0!==b){let a=b.map(a=>a.toLowerCase()).sort().join(",");if(0===b.length)d.push("--no-tools");else if(a===L);else{let a=function(a){let b=[];for(let c of a){let a=c.toLowerCase();if(K.has(a))continue;let d=J[a]??a;b.includes(d)||b.push(d)}return b}(b);a.length>0&&d.push("--tools",a.join(","))}}return c&&!a&&d.push("--advisor"),d}function N(a){return a?.length?a:void 0}function O(a){return"string"==typeof a.toolCallId&&a.toolCallId?a.toolCallId:"string"==typeof a.id&&a.id?a.id:""}function P(a){if(a&&(0,d.existsSync)(a))return{cwd:a,fellBack:!1};try{let a=process.cwd();if(a&&(0,d.existsSync)(a))return{cwd:a,fellBack:!0}}catch{}return{cwd:(0,e.homedir)(),fellBack:!0}}function Q(a){a&&"object"==typeof a&&void 0===a.estimatedTokensAfter&&(a.estimatedTokensAfter=Math.round((a.summary?.length??0)/4))}class R{constructor(a,b,c){this.listeners=[],this.pendingUiRequests=new Map,this.uiExpiryTimers=new Map,this.extensionStatuses=new Map,this.extensionWidgets=new Map,this.promptRunning=!1,this.bashRunning=!1,this.streaming=!1,this.compacting=!1,this.fastModeEnabled=!1,this.idleTimer=null,this.destroyListeners=[],this.onIdentityChangeCallback=null,this.unsubscribeFrames=null,this.initPromise=null,this.restarting=!1,this.mcpListWaiter=null,this._alive=!0,this.hostToolNames=new Set,this.pendingHostTools=new Map,this.hostUriSchemes=new Map,this.pendingHostUris=new Map,this.messageQueue=new D,this.queueEpoch=0,this.queueDispatching=!1,this.queueDispatchAgain=!1,this.abortHoldsDispatch=!1,this.activeToolIds=new Set,this.nativeFollowUpDepth=0,this.nativeHandoffPending=0,this.nativeQueuedCount=0,this.nativeQueueStale=!1,this.nativeReconcileGeneration=0,this.destroyPromise=null,this._sessionId="",this._sessionFile="",this.sessionFileSignalTimer=null,this.proc=a,this.cwd=b,this.recordedCwd=c??null}get sessionId(){return this._sessionId}get sessionFile(){return this._sessionFile}isAlive(){return this._alive&&this.proc.isAlive}isRunning(){return this.isAlive()&&(this.promptRunning||this.streaming||this.compacting||this.bashRunning)}start(){this.unsubscribeFrames=this.proc.onFrame(a=>this.handleFrame(a)),this.resetIdleTimer(),Z()}waitUntilReady(){return this.initPromise||(this.initPromise=this.initialize()),this.initPromise}async initialize(){let a=await this.proc.waitReady(12e4);await this.proc.negotiateProtocol(a),await this.proc.sendCommand({type:"set_subagent_subscription",level:"events"}).catch(()=>{});let b=await this.proc.sendCommand({type:"get_state"});this.applyIdentity(b),this.recordedCwd&&this.recordedCwd!==this.cwd&&this.emit({type:"notice",level:"warning",message:`This session's working directory no longer exists; the agent is running in ${this.cwd}.`})}applyIdentity(a){this._sessionId=a.sessionId,this._sessionFile=a.sessionFile??"",this._sessionName=a.sessionName,this.streaming=a.isStreaming,this.compacting=a.isCompacting,this.fastModeEnabled=a.fastModeEnabled??a.fastMode??this.fastModeEnabled,this._sessionFile&&(0,j.O8)(this._sessionId,this._sessionFile)}handleProcessExit(a){if(!this._alive||this.restarting)return;let b=a.trim().split("\n").pop()??"";this.emit({type:"notice",level:"error",message:`The omp process for this session exited unexpectedly${b?`: ${b}`:"."}`}),(this.streaming||this.promptRunning)&&this.emit({type:"agent_end",isTerminal:!0,messages:[]}),this.destroy()}handleFrame(a){this.resetIdleTimer();let b=!1,c=!1;switch(a.type){case"command_output":{let b=this.mcpListWaiter;if(b&&"string"==typeof a.text){clearTimeout(b.timer),this.mcpListWaiter=null,b.resolve(a.text),Z();return}break}case"agent_start":!this.streaming&&this.nativeFollowUpDepth>0&&(this.nativeFollowUpDepth-=1),this.streaming=!0,(0,j.mD)(),b=!0,this._sessionFile&&!(0,d.existsSync)(this._sessionFile)&&this.signalWhenSessionFileAppears();break;case"agent_end":!1!==a.isTerminal&&(this.streaming=!1,this.promptRunning=!1,this.activeToolIds.clear(),(0,j.mD)(),this.nativeQueuedCount>0||this.nativeQueueStale?this.beginNativeQueueReconcile():c=!0);break;case"prompt_result":this.promptRunning=!1,c=!0;break;case"auto_compaction_start":this.compacting=!0;break;case"auto_compaction_end":this.compacting=!1,Q(a.result),(0,j.mD)(),c=!0;break;case"tool_execution_start":{let b=O(a);b&&this.activeToolIds.add(b);break}case"tool_execution_end":{let b=O(a);b&&this.activeToolIds.delete(b),c=!0;break}case"session_info_update":"string"==typeof a.title&&(this._sessionName=a.title),(0,j.mD)(),b=!0;break;case"response":if(!1===a.success&&"prompt"===a.command){this.promptRunning=!1,this.emit({type:"prompt_error",errorMessage:a.error??"Prompt failed"}),Z(),this.scheduleQueueDispatch();return}break;case"extension_ui_request":if(this.trackExtensionUiRequest(a))return void Z();break;case"host_tool_call":{let b="string"==typeof a.id?a.id:"",c="string"==typeof a.toolName?a.toolName:"";if(b&&c&&this.hostToolNames.has(c)&&this.listeners.length>0){this.pendingHostTools.set(b,a),this.emit(a),Z();return}this.rejectUnexpectedHostTool(a);return}case"host_tool_cancel":{let b="string"==typeof a.targetId?a.targetId:"";if(b&&this.pendingHostTools.delete(b)){this.emit(a),Z();return}break}case"host_uri_request":{let b="string"==typeof a.id?a.id:"",c=("string"==typeof a.url?a.url:"").split(":")[0]??"",d="write"===a.operation?"write":"read",e=this.hostUriSchemes.get(c);if(b&&c&&e&&("write"!==d||e.writable)&&this.listeners.length>0){this.pendingHostUris.set(b,a),this.emit(a),Z();return}this.proc.sendFrame({type:"host_uri_result",id:b,isError:!0,error:`URI scheme "${c}" is not registered by omp-web`});return}case"host_uri_cancel":{let b="string"==typeof a.targetId?a.targetId:"";if(b&&this.pendingHostUris.delete(b)){this.emit(a),Z();return}}}this.emit(a),Z({refreshSessionList:b}),c&&this.scheduleQueueDispatch()}forgetPendingUiRequest(a){this.pendingUiRequests.delete(a);let b=this.uiExpiryTimers.get(a);b&&(clearTimeout(b),this.uiExpiryTimers.delete(a))}clearPendingUiRequests(){for(let a of this.uiExpiryTimers.values())clearTimeout(a);this.uiExpiryTimers.clear(),this.pendingUiRequests.clear()}trackExtensionUiRequest(a){let b=a.method,c=a.id;if("cancel"===b)return this.forgetPendingUiRequest(a.targetId),!1;let d=!1;try{d=(0,i.rk)().settings.tools?.approval?.extension==="allow"}catch{}if("confirm"===b&&"string"==typeof a.title&&/^allow tool\s*:/i.test(a.title)&&d)return this.forgetPendingUiRequest(c),this.proc.sendFrame({type:"extension_ui_response",id:c,confirmed:!0}),!0;if(G.has(b)){this.forgetPendingUiRequest(c);let b="number"==typeof a.timeout?a.timeout:void 0;if(b&&b>0){a.expiresAt=Date.now()+b;let d=setTimeout(()=>this.forgetPendingUiRequest(c),b);d.unref?.(),this.uiExpiryTimers.set(c,d)}return this.pendingUiRequests.set(c,a),!1}if("setStatus"===b){let b=a.statusKey,c=a.statusText;return void 0===c?this.extensionStatuses.delete(b):this.extensionStatuses.set(b,c),!1}if("setWidget"===b){let b=a.widgetKey,c=a.widgetLines;void 0===c?this.extensionWidgets.delete(b):this.extensionWidgets.set(b,{key:b,lines:c,placement:a.widgetPlacement??"aboveEditor"})}return!1}rejectUnexpectedHostTool(a){let b="string"==typeof a.id?a.id:"";if(!b)return;let c="string"==typeof a.toolName?a.toolName:"unknown";this.proc.sendFrame({type:"host_tool_result",id:b,isError:!0,result:{content:[{type:"text",text:`Host tool "${c}" is not available in ompgui. Use OMP's built-in tools within the selected workspace.`}]}}),this.emit({type:"notice",level:"warning",message:`Rejected unavailable host tool: ${c}`})}rejectPendingHostTools(a){for(let b of this.pendingHostTools.keys())this.proc.sendFrame({type:"host_tool_result",id:b,isError:!0,result:{content:[{type:"text",text:a}]}});this.pendingHostTools.clear()}rejectPendingHostUris(a){for(let b of this.pendingHostUris.keys())this.proc.sendFrame({type:"host_uri_result",id:b,isError:!0,error:a});this.pendingHostUris.clear()}emit(a){for(let b of this.listeners)try{b(a)}catch{}}signalWhenSessionFileAppears(){if(this.sessionFileSignalTimer)return;let a=0,b=()=>{if(this.sessionFileSignalTimer=null,this._alive&&this._sessionFile){if(!(0,d.existsSync)(this._sessionFile)){(a+=1)<40&&(this.sessionFileSignalTimer=setTimeout(b,250));return}(0,j.mD)(),Z({refreshSessionList:!0})}};this.sessionFileSignalTimer=setTimeout(b,250)}resetIdleTimer(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=setTimeout(()=>{this.isRunning()?this.resetIdleTimer():this.destroy()},6e5)}onEvent(a){this.listeners.push(a);let b=Date.now();for(let[c,d]of this.pendingUiRequests){let e=d.expiresAt;if(void 0!==e&&e<=b){this.forgetPendingUiRequest(c);continue}a(d)}return a(z(this.messageQueue.getSnapshot())),()=>{let b=this.listeners.indexOf(a);-1!==b&&this.listeners.splice(b,1),0===this.listeners.length&&(this.rejectPendingHostTools("The web UI disconnected while the agent was waiting for this host tool"),this.rejectPendingHostUris("The web UI disconnected while the agent was waiting for this URI request"))}}onDestroy(a){return this._alive?(this.destroyListeners.push(a),()=>{let b=this.destroyListeners.indexOf(a);-1!==b&&this.destroyListeners.splice(b,1)}):(a(),()=>{})}onIdentityChange(a){this.onIdentityChangeCallback=a}async withFinalRunningNotification(a){try{return await a()}finally{Z()}}async getMcpList(){let a,b;if(this.restarting)throw new F(E,"session_restarting");if(!this.isAlive())throw Error("Session is no longer running");if(this.isRunning())throw new F("Wait for the current run to finish","session_busy");if(this.mcpListWaiter)throw new F("MCP list is already loading","mcp_list_loading");this.promptRunning=!0,Z();let c=new Promise((c,d)=>{a=c,b=d});c.catch(()=>{});let d={resolve:a,reject:b,timer:void 0};d.timer=setTimeout(()=>{this.mcpListWaiter===d&&(this.mcpListWaiter=null,b(new F("Timed out while loading MCP servers","mcp_list_timeout")))},15e3),d.timer.unref?.(),this.mcpListWaiter=d;try{return await this.proc.sendCommand({type:"prompt",message:"/mcp list"}),await c}catch(a){throw this.mcpListWaiter===d&&(clearTimeout(d.timer),this.mcpListWaiter=null,d.reject(a instanceof Error?a:Error(String(a)))),a}finally{this.mcpListWaiter===d&&(clearTimeout(d.timer),this.mcpListWaiter=null),this.promptRunning=!1,Z()}}buildWebState(a){return this.streaming=a.isStreaming,this.compacting=a.isCompacting,this._sessionName=a.sessionName,this.nativeQueuedCount=a.queuedMessageCount??0,this.nativeQueueStale=!1,a.sessionId&&(this._sessionId=a.sessionId,this._sessionFile=a.sessionFile??this._sessionFile),{sessionId:a.sessionId,sessionFile:a.sessionFile??"",sessionName:a.sessionName,isStreaming:a.isStreaming,isPromptRunning:this.promptRunning,isBashRunning:this.bashRunning,isCompacting:a.isCompacting,autoCompactionEnabled:a.autoCompactionEnabled,autoRetryEnabled:a.autoRetryEnabled,interruptMode:a.interruptMode,steeringMode:a.steeringMode,followUpMode:a.followUpMode,model:a.model?{id:a.model.id,provider:a.model.provider,name:a.model.name,reasoning:a.model.reasoning,thinking:a.model.thinking?{efforts:a.model.thinking.efforts}:void 0}:void 0,messageCount:a.messageCount,queuedMessageCount:a.queuedMessageCount,messageQueue:this.queueSnapshotForClient(),contextUsage:a.contextUsage??null,systemPrompt:a.systemPrompt?.join("\n\n")??"",thinkingLevel:a.thinkingLevel??"off",fastModeEnabled:a.fastModeEnabled??a.fastMode??this.fastModeEnabled,fastModeActive:a.fastModeActive,todoPhases:a.todoPhases??[],extensionStatuses:Array.from(this.extensionStatuses,([a,b])=>({key:a,text:b})),extensionWidgets:Array.from(this.extensionWidgets.values())}}async refreshIdentityAfterSessionChange(){let a=this._sessionId,b=await this.proc.sendCommand({type:"get_state"});return this.applyIdentity(b),a&&a!==this._sessionId&&(this.discardQueue("Queued messages were discarded because the session changed."),this.onIdentityChangeCallback?.(a,this._sessionId)),(0,j.mD)(),this._sessionId}async restart(){if(this.restarting)throw new F(E,"session_restarting");let a=this._sessionFile,b=!!a&&(0,d.existsSync)(a),c=this.proc;this.restarting=!0,this.queueEpoch+=1,this.abortHoldsDispatch=!1,this.activeToolIds.clear(),this.nativeFollowUpDepth=0,this.nativeHandoffPending=0,this.nativeQueuedCount=0,this.nativeQueueStale=!1,this.nativeReconcileGeneration+=1,this.messageQueue.failSending(v),this.emitQueueSnapshot(),this.unsubscribeFrames?.();try{if(await c.dispose(),!this._alive)return;this.extensionStatuses.clear(),this.extensionWidgets.clear(),this.clearPendingUiRequests(),this.promptRunning=!1,this.bashRunning=!1,this.streaming=!1,this.compacting=!1;let d=new h.X({cwd:this.cwd,extraArgs:M(b?a:""),onExit:({stderrTail:a})=>{this.proc===d&&this.handleProcessExit(a)}});this.proc=d,this.unsubscribeFrames=d.onFrame(a=>this.handleFrame(a));try{let a=await d.waitReady(12e4);await d.negotiateProtocol(a),await d.sendCommand({type:"set_subagent_subscription",level:"events"}).catch(()=>{});let b=await d.sendCommand({type:"get_state"});this.applyIdentity(b)}catch(a){throw this.unsubscribeFrames?.(),this.unsubscribeFrames=null,d.dispose(),this.destroy(),a}}finally{this.restarting=!1}Z(),this.scheduleQueueDispatch()}async send(a){if(this.restarting)throw new F(E,"session_restarting");if(!this.isAlive())throw Error("Session is no longer running");this.resetIdleTimer();let b=a.type;if("prompt"===b||"steer"===b||"follow_up"===b){let b=(0,f.kc)(a.images);if(b)throw Error(b)}let c=I[b];if(c)throw new h.x(b,c,"unsupported");if("string"==typeof b&&w.has(b))return this.handleQueueCommand(a);switch(b){case"prompt":{if(this.bashRunning)throw Error("Cannot send a prompt while a shell command is running");let b=a.streamingBehavior;b||(this.abortHoldsDispatch=!1,this.promptRunning=!0,Z());try{let c=await this.forwardNativeHandoff({type:"prompt",message:a.message,...N(a.images)?{images:N(a.images)}:{},...b?{streamingBehavior:b}:{}},"followUp"===b);c?.agentInvoked===!1&&(b||(this.promptRunning=!1,this.emit({type:"prompt_result",agentInvoked:!1}),Z()),this.scheduleQueueDispatch())}catch(a){throw this.promptRunning=!1,Z(),a}return null}case"steer":case"follow_up":return await this.forwardNativeHandoff({type:b,message:a.message,...N(a.images)?{images:N(a.images)}:{}},"follow_up"===b),null;case"abort":return this.abortHoldsDispatch=!0,await this.withFinalRunningNotification(async()=>{await this.proc.sendCommand({type:"abort"}),this.promptRunning=!1}),null;case"get_state":{let a=await this.proc.sendCommand({type:"get_state"});return this.buildWebState(a)}case"set_model":{let{provider:b,modelId:c}=a,d=await this.proc.sendCommand({type:"set_model",provider:b,modelId:c});return(0,g.kn)(),(0,j.mD)(),{id:d.id,provider:d.provider}}case"set_fast_mode":{let b=!0===a.enabled,c=await this.proc.sendCommand({type:"set_fast_mode",enabled:b});return this.fastModeEnabled=c?.enabled??b,{enabled:this.fastModeEnabled,active:c?.active??!1}}case"fork":if(this.bashRunning)throw Error("Cannot fork while a shell command is running");if(this.queueEpoch+=1,this.messageQueue.failSending(v),this.emitQueueSnapshot(),(await this.proc.sendCommand({type:"branch",entryId:a.entryId})).cancelled)return{cancelled:!0};return{cancelled:!1,newSessionId:await this.refreshIdentityAfterSessionChange()};case"new_session":case"switch_session":{this.queueEpoch+=1,this.messageQueue.failSending(v),this.emitQueueSnapshot();let b=await this.proc.sendCommand(a);if(!b.cancelled)return{cancelled:!1,newSessionId:await this.refreshIdentityAfterSessionChange()};return b}case"compact":try{return await this.withFinalRunningNotification(async()=>{this.compacting=!0,Z();try{let b=await this.proc.sendCommand({type:"compact",...a.customInstructions?{customInstructions:a.customInstructions}:{}});return Q(b),b}finally{this.compacting=!1}})}finally{(0,j.mD)(),this.scheduleQueueDispatch()}case"abort_compaction":return this.abortHoldsDispatch=!0,await this.withFinalRunningNotification(()=>this.proc.sendCommand({type:"abort"})),null;case"set_session_name":{let b=a.name?.trim();if(!b)throw Error("Session name cannot be empty");return await this.proc.sendCommand({type:"set_session_name",name:b}),this._sessionName=b,(0,j.mD)(),null}case"get_session_stats":return{...await this.proc.sendCommand({type:"get_session_stats"}),sessionName:this._sessionName};case"get_last_assistant_text":return{text:(await this.proc.sendCommand({type:"get_last_assistant_text"})).text??""};case"get_commands":return await this.proc.sendCommand({type:"get_available_commands"});case"reload":return await this.restart(),{success:!0};case"extension_ui_response":{let{id:b,...c}=a;return this.forgetPendingUiRequest(b),this.proc.sendFrame({type:"extension_ui_response",id:b,...c}),null}case"bash":if(!0===a.excludeFromContext)throw new F("omp cannot run a shell command with its output excluded from the model context (`!!`): the RPC bash command has no exclusion option, so the output would silently enter the context anyway. Run it with a single `!` to share the output with the model, or use a terminal outside ompgui.","bash_exclude_unsupported");if(this.isRunning())throw Error("Cannot run a shell command while the session is busy");this.bashRunning=!0,Z();try{return await this.proc.sendCommand({type:"bash",command:a.command})}finally{this.bashRunning=!1,(0,j.mD)(),Z(),this.scheduleQueueDispatch()}case"set_host_tools":{let b=(Array.isArray(a.tools)?a.tools:[]).filter(a=>"string"==typeof a.name&&a.name);return this.hostToolNames=new Set(b.map(a=>a.name)),await this.proc.sendCommand({type:"set_host_tools",tools:b}),null}case"host_tool_result":return"string"==typeof a.id&&this.pendingHostTools.delete(a.id),await this.proc.sendCommand(a),null;case"set_host_uri_schemes":{let b=Array.isArray(a.schemes)?a.schemes:[];for(let a of(this.hostUriSchemes=new Map,b))"string"==typeof a.scheme&&a.scheme&&this.hostUriSchemes.set(a.scheme,{writable:!0===a.writable});return await this.proc.sendCommand({type:"set_host_uri_schemes",schemes:b}),null}case"host_uri_result":return"string"==typeof a.id&&this.pendingHostUris.delete(a.id),await this.proc.sendCommand(a),null;default:if(H.has(b)){let c=await this.proc.sendCommand(a);return"set_thinking_level"===b&&(0,j.mD)(),c??null}throw Error(`Unsupported command: ${b}`)}}handleQueueCommand(a){try{let b=a.type;switch(b){case m:if(!y(a.lane))throw new x("lane must be steer or followUp",u);if("string"!=typeof a.message)throw new x("message is required",u);return this.abortHoldsDispatch=!1,this.messageQueue.enqueue({lane:a.lane,text:a.message}),this.emitQueueSnapshot(),this.finishQueueCommand();case p:if("string"!=typeof a.id)throw new x("id is required",u);return this.abortHoldsDispatch=!1,this.messageQueue.promote(a.id,this.requireExpectedRevision(a)),this.emitQueueSnapshot(),this.finishQueueCommand();case n:{if("string"!=typeof a.id)throw new x("id is required",u);let{item:b}=this.messageQueue.recall(a.id,this.requireExpectedRevision(a));return this.emitQueueSnapshot(),this.finishQueueCommand(b)}case o:if("string"!=typeof a.id)throw new x("id is required",u);return this.messageQueue.delete(a.id,this.requireExpectedRevision(a)),this.emitQueueSnapshot(),this.finishQueueCommand();case q:return Promise.resolve(A(this.queueSnapshotForClient()));default:throw Error(`Unsupported command: ${b}`)}}catch(a){if(a instanceof x)throw new F(a.message,a.code);throw a}}requireExpectedRevision(a){if("number"!=typeof a.expectedRevision)throw new x("Queue revision is stale; reload the queue and retry",r);return a.expectedRevision}async finishQueueCommand(a){return await this.drainQueueDispatch(),A(this.queueSnapshotForClient(),a)}queueSnapshotForClient(){return{...this.messageQueue.getSnapshot(),nativeQueuedCount:this.nativeQueuedCount}}emitQueueSnapshot(){this.emit(z(this.queueSnapshotForClient()))}beginNativeQueueReconcile(){this.nativeQueueStale=!0,this.nativeReconcileGeneration+=1;let a=this.nativeReconcileGeneration,b=this.queueEpoch,c=this.proc;this.refreshNativeQueuedCount(a,b,c)}async refreshNativeQueuedCount(a,b,c){try{let d=await c.sendCommand({type:"get_state"});if(!this.nativeReconcileStillValid(a,b,c))return;this.nativeQueuedCount=d.queuedMessageCount??0,this.nativeQueueStale=!1}catch{if(!this.nativeReconcileStillValid(a,b,c))return;this.nativeQueuedCount=0,this.nativeQueueStale=!1}this.scheduleQueueDispatch()}nativeReconcileStillValid(a,b,c){return this._alive&&this.queueEpoch===b&&this.proc===c&&this.nativeReconcileGeneration===a}discardQueue(a){this.queueEpoch+=1;let b=this.messageQueue.getSnapshot().items.length>0;this.messageQueue.reset(),this.emitQueueSnapshot(),b&&this.emit({type:"notice",level:"warning",message:a})}scheduleQueueDispatch(){this.drainQueueDispatch()}async drainQueueDispatch(){if(this.queueDispatching){this.queueDispatchAgain=!0;return}this.queueDispatching=!0;try{do this.queueDispatchAgain=!1,await this.dispatchNextQueueItem();while(this.queueDispatchAgain)}catch{}finally{this.queueDispatching=!1,this.queueDispatchAgain&&this.scheduleQueueDispatch()}}canDispatchSteer(){return this.isAlive()&&!this.restarting&&this.streaming&&!this.compacting&&!this.bashRunning&&0===this.activeToolIds.size&&0===this.pendingHostTools.size&&0===this.nativeHandoffPending}canDispatchFollowUp(){return this.isAlive()&&!this.restarting&&!this.abortHoldsDispatch&&!this.promptRunning&&!this.streaming&&!this.compacting&&!this.bashRunning&&0===this.activeToolIds.size&&0===this.pendingHostTools.size&&0===this.nativeFollowUpDepth&&0===this.nativeHandoffPending&&!this.nativeQueueStale&&0===this.nativeQueuedCount}canDispatchIdlePrompt(){return this.canDispatchFollowUp()}async dispatchNextQueueItem(){for(;this.isAlive()&&!this.restarting;){if(this.messageQueue.hasSending())return;let a=this.messageQueue.selectDispatchCandidate("steer");if(a){if(this.canDispatchSteer()){await this.forwardQueueItem(a,"steer");continue}if(this.canDispatchIdlePrompt()){await this.forwardQueueItem(a);continue}return}let b=this.messageQueue.selectDispatchCandidate("followUp");if(b&&this.canDispatchFollowUp()){await this.forwardQueueItem(b);continue}return}}async forwardQueueItem(a,b){let c=this.queueEpoch,d=this.proc,e=this._sessionId;this.messageQueue.markSending(a.id),this.emitQueueSnapshot(),b||(this.promptRunning=!0,Z());try{let f=await d.sendCommand({type:"prompt",message:a.text,...b?{streamingBehavior:b}:{}},3e4);if(!this.queueForwardStillValid(c,d,e,a.id))return;this.messageQueue.remove(a.id),this.emitQueueSnapshot(),f?.agentInvoked!==!1||b||(this.promptRunning=!1,this.emit({type:"prompt_result",agentInvoked:!1}),Z())}catch(g){if(b||(this.promptRunning=!1),!this.queueForwardStillValid(c,d,e,a.id))return;let f=g instanceof Error&&/timed out/i.test(g.message)?v:`${v} ${g instanceof Error?g.message:String(g)}`;this.messageQueue.markFailed(a.id,f),this.emitQueueSnapshot(),this.emit({type:"notice",level:"warning",message:f}),Z()}}queueForwardStillValid(a,b,c,d){return!!this._alive&&this.queueEpoch===a&&this.proc===b&&(!c||this._sessionId===c)&&this.messageQueue.getSnapshot().items.some(a=>a.id===d&&"sending"===a.status)}async forwardNativeHandoff(a,b){this.nativeHandoffPending+=1,b&&(this.nativeFollowUpDepth+=1);try{var c;let d=await this.proc.sendCommand(a);return b&&(c=d)&&"object"==typeof c&&!1===c.agentInvoked&&(this.nativeFollowUpDepth=Math.max(0,this.nativeFollowUpDepth-1)),d}catch(a){throw b&&(this.nativeFollowUpDepth=Math.max(0,this.nativeFollowUpDepth-1)),a}finally{this.nativeHandoffPending=Math.max(0,this.nativeHandoffPending-1),this.scheduleQueueDispatch()}}destroy(){this.destroyAndWait()}async destroyAndWait(){if(this.destroyPromise)return this.destroyPromise;if(!this._alive)return;this._alive=!1,this.queueEpoch+=1,this.abortHoldsDispatch=!0,this.discardQueue("Queued messages were discarded because the session shut down."),this.idleTimer&&clearTimeout(this.idleTimer),this.sessionFileSignalTimer&&(clearTimeout(this.sessionFileSignalTimer),this.sessionFileSignalTimer=null),this.unsubscribeFrames?.(),this.clearPendingUiRequests(),this.mcpListWaiter&&(clearTimeout(this.mcpListWaiter.timer),this.mcpListWaiter.reject(Error("Session was closed while loading MCP servers")),this.mcpListWaiter=null);let a=this.proc.dispose().catch(()=>{}).then(()=>{for(let[a,b]of S())b===this&&S().delete(a)});for(let b of(this.destroyPromise=a,this.pendingHostTools.clear(),this.hostToolNames.clear(),this.pendingHostUris.clear(),this.hostUriSchemes.clear(),this.destroyListeners.splice(0)))try{b()}catch{}Z(),await a}}function S(){if(!globalThis.__ompSessions){globalThis.__ompSessions=new Map;let a=()=>globalThis.__ompSessions?.forEach(a=>a.destroy());process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__ompSessions}function T(a){return S().get(a)}function U(){let a=new Set;for(let[b,c]of S())c.isRunning()&&a.add(c.sessionId||b);return[...a]}async function V(){let a=[...new Set(S().values())];return await Promise.all(a.map(a=>a.destroyAndWait())),a.length}function W(){return globalThis.__ompRunningListeners||(globalThis.__ompRunningListeners=new Set),globalThis.__ompRunningListeners}function X(a){let b=W();return b.add(a),()=>{b.delete(a)}}let Y="";function Z({refreshSessionList:a=!1}={}){let b=U(),c=JSON.stringify([...b].sort());if(c===Y&&!a)return;Y=c;let d={ids:b,refreshSessionList:a};for(let a of W())try{a(d)}catch{}}async function $(a,b,c,d,e=!1,f){let g=S(),i=(globalThis.__ompStartLocks||(globalThis.__ompStartLocks=new Map),globalThis.__ompStartLocks),j=g.get(a);for(;j&&!j.isAlive()&&j.destroyPromise;)await j.destroyPromise,j=g.get(a);if(j?.isAlive())return{session:j,realSessionId:a};let k=i.get(a);if(k)return k;let l=(async()=>{let a={},i=new R(new h.X({cwd:c,extraArgs:M(b,d,e),onExit:({stderrTail:b})=>a.wrapper?.handleProcessExit(b)}),c,f);a.wrapper=i,i.start();try{await i.waitUntilReady()}catch(a){throw await i.destroyAndWait(),a}let j=i.sessionId;return i.onIdentityChange((a,b)=>{g.get(a)===i&&g.delete(a),g.set(b,i)}),g.set(j,i),{session:i,realSessionId:j}})().finally(()=>i.delete(a));return i.set(a,l),l}}};