@axhub/acp 0.1.0

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 (488) hide show
  1. package/.next/BUILD_ID +1 -0
  2. package/.next/app-path-routes-manifest.json +21 -0
  3. package/.next/build-manifest.json +22 -0
  4. package/.next/export-marker.json +6 -0
  5. package/.next/fallback-build-manifest.json +13 -0
  6. package/.next/images-manifest.json +68 -0
  7. package/.next/next-minimal-server.js.nft.json +1 -0
  8. package/.next/next-server.js.nft.json +1 -0
  9. package/.next/package.json +1 -0
  10. package/.next/prerender-manifest.json +90 -0
  11. package/.next/required-server-files.js +336 -0
  12. package/.next/required-server-files.json +336 -0
  13. package/.next/routes-manifest.json +171 -0
  14. package/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
  15. package/.next/server/app/_global-error/page/build-manifest.json +18 -0
  16. package/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
  17. package/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
  18. package/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
  19. package/.next/server/app/_global-error/page.js +10 -0
  20. package/.next/server/app/_global-error/page.js.nft.json +1 -0
  21. package/.next/server/app/_global-error/page_client-reference-manifest.js +3 -0
  22. package/.next/server/app/_global-error.html +1 -0
  23. package/.next/server/app/_global-error.meta +15 -0
  24. package/.next/server/app/_global-error.rsc +15 -0
  25. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
  26. package/.next/server/app/_global-error.segments/_full.segment.rsc +15 -0
  27. package/.next/server/app/_global-error.segments/_head.segment.rsc +6 -0
  28. package/.next/server/app/_global-error.segments/_index.segment.rsc +5 -0
  29. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
  30. package/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
  31. package/.next/server/app/_not-found/page/build-manifest.json +18 -0
  32. package/.next/server/app/_not-found/page/next-font-manifest.json +6 -0
  33. package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
  34. package/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
  35. package/.next/server/app/_not-found/page.js +13 -0
  36. package/.next/server/app/_not-found/page.js.nft.json +1 -0
  37. package/.next/server/app/_not-found/page_client-reference-manifest.js +3 -0
  38. package/.next/server/app/_not-found.html +1 -0
  39. package/.next/server/app/_not-found.meta +16 -0
  40. package/.next/server/app/_not-found.rsc +17 -0
  41. package/.next/server/app/_not-found.segments/_full.segment.rsc +17 -0
  42. package/.next/server/app/_not-found.segments/_head.segment.rsc +6 -0
  43. package/.next/server/app/_not-found.segments/_index.segment.rsc +6 -0
  44. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
  45. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +5 -0
  46. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -0
  47. package/.next/server/app/api/acp/capabilities/route/app-paths-manifest.json +3 -0
  48. package/.next/server/app/api/acp/capabilities/route/build-manifest.json +9 -0
  49. package/.next/server/app/api/acp/capabilities/route/server-reference-manifest.json +4 -0
  50. package/.next/server/app/api/acp/capabilities/route.js +9 -0
  51. package/.next/server/app/api/acp/capabilities/route.js.nft.json +1 -0
  52. package/.next/server/app/api/acp/capabilities/route_client-reference-manifest.js +3 -0
  53. package/.next/server/app/api/acp/commands/route/app-paths-manifest.json +3 -0
  54. package/.next/server/app/api/acp/commands/route/build-manifest.json +9 -0
  55. package/.next/server/app/api/acp/commands/route/server-reference-manifest.json +4 -0
  56. package/.next/server/app/api/acp/commands/route.js +6 -0
  57. package/.next/server/app/api/acp/commands/route.js.nft.json +1 -0
  58. package/.next/server/app/api/acp/commands/route_client-reference-manifest.js +3 -0
  59. package/.next/server/app/api/acp/runtime/route/app-paths-manifest.json +3 -0
  60. package/.next/server/app/api/acp/runtime/route/build-manifest.json +9 -0
  61. package/.next/server/app/api/acp/runtime/route/server-reference-manifest.json +4 -0
  62. package/.next/server/app/api/acp/runtime/route.js +6 -0
  63. package/.next/server/app/api/acp/runtime/route.js.nft.json +1 -0
  64. package/.next/server/app/api/acp/runtime/route_client-reference-manifest.js +3 -0
  65. package/.next/server/app/api/chat/route/app-paths-manifest.json +3 -0
  66. package/.next/server/app/api/chat/route/build-manifest.json +9 -0
  67. package/.next/server/app/api/chat/route/server-reference-manifest.json +4 -0
  68. package/.next/server/app/api/chat/route.js +9 -0
  69. package/.next/server/app/api/chat/route.js.nft.json +1 -0
  70. package/.next/server/app/api/chat/route_client-reference-manifest.js +3 -0
  71. package/.next/server/app/api/conversations/[threadId]/messages/route/app-paths-manifest.json +3 -0
  72. package/.next/server/app/api/conversations/[threadId]/messages/route/build-manifest.json +9 -0
  73. package/.next/server/app/api/conversations/[threadId]/messages/route/server-reference-manifest.json +4 -0
  74. package/.next/server/app/api/conversations/[threadId]/messages/route.js +8 -0
  75. package/.next/server/app/api/conversations/[threadId]/messages/route.js.nft.json +1 -0
  76. package/.next/server/app/api/conversations/[threadId]/messages/route_client-reference-manifest.js +3 -0
  77. package/.next/server/app/api/conversations/[threadId]/route/app-paths-manifest.json +3 -0
  78. package/.next/server/app/api/conversations/[threadId]/route/build-manifest.json +9 -0
  79. package/.next/server/app/api/conversations/[threadId]/route/server-reference-manifest.json +4 -0
  80. package/.next/server/app/api/conversations/[threadId]/route.js +8 -0
  81. package/.next/server/app/api/conversations/[threadId]/route.js.nft.json +1 -0
  82. package/.next/server/app/api/conversations/[threadId]/route_client-reference-manifest.js +3 -0
  83. package/.next/server/app/api/conversations/route/app-paths-manifest.json +3 -0
  84. package/.next/server/app/api/conversations/route/build-manifest.json +9 -0
  85. package/.next/server/app/api/conversations/route/server-reference-manifest.json +4 -0
  86. package/.next/server/app/api/conversations/route.js +8 -0
  87. package/.next/server/app/api/conversations/route.js.nft.json +1 -0
  88. package/.next/server/app/api/conversations/route_client-reference-manifest.js +3 -0
  89. package/.next/server/app/api/local-files/image/route/app-paths-manifest.json +3 -0
  90. package/.next/server/app/api/local-files/image/route/build-manifest.json +9 -0
  91. package/.next/server/app/api/local-files/image/route/server-reference-manifest.json +4 -0
  92. package/.next/server/app/api/local-files/image/route.js +6 -0
  93. package/.next/server/app/api/local-files/image/route.js.nft.json +1 -0
  94. package/.next/server/app/api/local-files/image/route_client-reference-manifest.js +3 -0
  95. package/.next/server/app/api/local-files/open/route/app-paths-manifest.json +3 -0
  96. package/.next/server/app/api/local-files/open/route/build-manifest.json +9 -0
  97. package/.next/server/app/api/local-files/open/route/server-reference-manifest.json +4 -0
  98. package/.next/server/app/api/local-files/open/route.js +6 -0
  99. package/.next/server/app/api/local-files/open/route.js.nft.json +1 -0
  100. package/.next/server/app/api/local-files/open/route_client-reference-manifest.js +3 -0
  101. package/.next/server/app/api/output-artifacts/workspace/route/app-paths-manifest.json +3 -0
  102. package/.next/server/app/api/output-artifacts/workspace/route/build-manifest.json +9 -0
  103. package/.next/server/app/api/output-artifacts/workspace/route/server-reference-manifest.json +4 -0
  104. package/.next/server/app/api/output-artifacts/workspace/route.js +6 -0
  105. package/.next/server/app/api/output-artifacts/workspace/route.js.nft.json +1 -0
  106. package/.next/server/app/api/output-artifacts/workspace/route_client-reference-manifest.js +3 -0
  107. package/.next/server/app/api/tools/image-generation/files/[id]/route/app-paths-manifest.json +3 -0
  108. package/.next/server/app/api/tools/image-generation/files/[id]/route/build-manifest.json +9 -0
  109. package/.next/server/app/api/tools/image-generation/files/[id]/route/server-reference-manifest.json +4 -0
  110. package/.next/server/app/api/tools/image-generation/files/[id]/route.js +7 -0
  111. package/.next/server/app/api/tools/image-generation/files/[id]/route.js.nft.json +1 -0
  112. package/.next/server/app/api/tools/image-generation/files/[id]/route_client-reference-manifest.js +3 -0
  113. package/.next/server/app/api/tools/image-generation/records/route/app-paths-manifest.json +3 -0
  114. package/.next/server/app/api/tools/image-generation/records/route/build-manifest.json +9 -0
  115. package/.next/server/app/api/tools/image-generation/records/route/server-reference-manifest.json +4 -0
  116. package/.next/server/app/api/tools/image-generation/records/route.js +7 -0
  117. package/.next/server/app/api/tools/image-generation/records/route.js.nft.json +1 -0
  118. package/.next/server/app/api/tools/image-generation/records/route_client-reference-manifest.js +3 -0
  119. package/.next/server/app/api/tools/user-choice/route/app-paths-manifest.json +3 -0
  120. package/.next/server/app/api/tools/user-choice/route/build-manifest.json +9 -0
  121. package/.next/server/app/api/tools/user-choice/route/server-reference-manifest.json +4 -0
  122. package/.next/server/app/api/tools/user-choice/route.js +6 -0
  123. package/.next/server/app/api/tools/user-choice/route.js.nft.json +1 -0
  124. package/.next/server/app/api/tools/user-choice/route_client-reference-manifest.js +3 -0
  125. package/.next/server/app/favicon.ico/route/app-paths-manifest.json +3 -0
  126. package/.next/server/app/favicon.ico/route/build-manifest.json +9 -0
  127. package/.next/server/app/favicon.ico/route.js +7 -0
  128. package/.next/server/app/favicon.ico/route.js.nft.json +1 -0
  129. package/.next/server/app/favicon.ico.body +0 -0
  130. package/.next/server/app/favicon.ico.meta +1 -0
  131. package/.next/server/app/page/app-paths-manifest.json +3 -0
  132. package/.next/server/app/page/build-manifest.json +18 -0
  133. package/.next/server/app/page/next-font-manifest.json +6 -0
  134. package/.next/server/app/page/react-loadable-manifest.json +1 -0
  135. package/.next/server/app/page/server-reference-manifest.json +4 -0
  136. package/.next/server/app/page.js +14 -0
  137. package/.next/server/app/page.js.nft.json +1 -0
  138. package/.next/server/app/page_client-reference-manifest.js +3 -0
  139. package/.next/server/app/session/[provider]/[sessionId]/page/app-paths-manifest.json +3 -0
  140. package/.next/server/app/session/[provider]/[sessionId]/page/build-manifest.json +18 -0
  141. package/.next/server/app/session/[provider]/[sessionId]/page/next-font-manifest.json +6 -0
  142. package/.next/server/app/session/[provider]/[sessionId]/page/react-loadable-manifest.json +1 -0
  143. package/.next/server/app/session/[provider]/[sessionId]/page/server-reference-manifest.json +4 -0
  144. package/.next/server/app/session/[provider]/[sessionId]/page.js +16 -0
  145. package/.next/server/app/session/[provider]/[sessionId]/page.js.nft.json +1 -0
  146. package/.next/server/app/session/[provider]/[sessionId]/page_client-reference-manifest.js +3 -0
  147. package/.next/server/app/thread/[threadId]/page/app-paths-manifest.json +3 -0
  148. package/.next/server/app/thread/[threadId]/page/build-manifest.json +18 -0
  149. package/.next/server/app/thread/[threadId]/page/next-font-manifest.json +6 -0
  150. package/.next/server/app/thread/[threadId]/page/react-loadable-manifest.json +1 -0
  151. package/.next/server/app/thread/[threadId]/page/server-reference-manifest.json +4 -0
  152. package/.next/server/app/thread/[threadId]/page.js +15 -0
  153. package/.next/server/app/thread/[threadId]/page.js.nft.json +1 -0
  154. package/.next/server/app/thread/[threadId]/page_client-reference-manifest.js +3 -0
  155. package/.next/server/app-paths-manifest.json +21 -0
  156. package/.next/server/chunks/0zjb_server_app_api_conversations_[threadId]_messages_route_actions_0poed25.js +3 -0
  157. package/.next/server/chunks/0zjb_server_app_api_tools_image-generation_files_[id]_route_actions_0-tbvpw.js +3 -0
  158. package/.next/server/chunks/0zjb_server_app_api_tools_image-generation_records_route_actions_0vu38s2.js +3 -0
  159. package/.next/server/chunks/[externals]_next_dist_0.m~pv6._.js +3 -0
  160. package/.next/server/chunks/[root-of-the-server]__04xq..~._.js +3 -0
  161. package/.next/server/chunks/[root-of-the-server]__07sxz4_._.js +3 -0
  162. package/.next/server/chunks/[root-of-the-server]__0dwg3fr._.js +178 -0
  163. package/.next/server/chunks/[root-of-the-server]__0eanzwb._.js +3 -0
  164. package/.next/server/chunks/[root-of-the-server]__0gqx~5k._.js +3 -0
  165. package/.next/server/chunks/[root-of-the-server]__0iokgmz._.js +3 -0
  166. package/.next/server/chunks/[root-of-the-server]__0j-lxr4._.js +3 -0
  167. package/.next/server/chunks/[root-of-the-server]__0ly6hop._.js +3 -0
  168. package/.next/server/chunks/[root-of-the-server]__0nil~wi._.js +3 -0
  169. package/.next/server/chunks/[root-of-the-server]__0tmhg7j._.js +3 -0
  170. package/.next/server/chunks/[root-of-the-server]__0txmfnw._.js +4 -0
  171. package/.next/server/chunks/[root-of-the-server]__0wo0b8z._.js +3 -0
  172. package/.next/server/chunks/[root-of-the-server]__0~mtsby._.js +3 -0
  173. package/.next/server/chunks/[root-of-the-server]__10-n4io._.js +3 -0
  174. package/.next/server/chunks/[root-of-the-server]__10g507v._.js +3 -0
  175. package/.next/server/chunks/[turbopack]_runtime.js +903 -0
  176. package/.next/server/chunks/_next-internal_server_app_api_acp_capabilities_route_actions_08lck.p.js +3 -0
  177. package/.next/server/chunks/_next-internal_server_app_api_acp_commands_route_actions_0as.2z6.js +3 -0
  178. package/.next/server/chunks/_next-internal_server_app_api_acp_runtime_route_actions_0o1ybkn.js +3 -0
  179. package/.next/server/chunks/_next-internal_server_app_api_chat_route_actions_0tmcf6..js +3 -0
  180. package/.next/server/chunks/_next-internal_server_app_api_conversations_[threadId]_route_actions_12yq8z_.js +3 -0
  181. package/.next/server/chunks/_next-internal_server_app_api_conversations_route_actions_131xv69.js +3 -0
  182. package/.next/server/chunks/_next-internal_server_app_api_local-files_image_route_actions_0f~10mn.js +3 -0
  183. package/.next/server/chunks/_next-internal_server_app_api_local-files_open_route_actions_026mg-2.js +3 -0
  184. package/.next/server/chunks/_next-internal_server_app_api_output-artifacts_workspace_route_actions_1239-n7.js +3 -0
  185. package/.next/server/chunks/_next-internal_server_app_api_tools_user-choice_route_actions_09xqbn_.js +3 -0
  186. package/.next/server/chunks/_next-internal_server_app_favicon_ico_route_actions_095lj93.js +3 -0
  187. package/.next/server/chunks/instrumentation_ts_0zq9-xz._.js +3 -0
  188. package/.next/server/chunks/lib_conversations_store_ts_0gzcj38._.js +7 -0
  189. package/.next/server/chunks/node_modules_@vercel_oidc_dist_token_0zdeuds.js +3 -0
  190. package/.next/server/chunks/node_modules_next_00hve1e._.js +13 -0
  191. package/.next/server/chunks/ssr/[root-of-the-server]__02qo-zr._.js +19 -0
  192. package/.next/server/chunks/ssr/[root-of-the-server]__0488vn3._.js +3 -0
  193. package/.next/server/chunks/ssr/[root-of-the-server]__08e5v4-._.js +3 -0
  194. package/.next/server/chunks/ssr/[root-of-the-server]__08iwq-u._.js +3 -0
  195. package/.next/server/chunks/ssr/[root-of-the-server]__0a1m1mq._.js +3 -0
  196. package/.next/server/chunks/ssr/[root-of-the-server]__0i9qg2.._.js +33 -0
  197. package/.next/server/chunks/ssr/[root-of-the-server]__0icm-_h._.js +3 -0
  198. package/.next/server/chunks/ssr/[root-of-the-server]__0piffp7._.js +3 -0
  199. package/.next/server/chunks/ssr/[root-of-the-server]__0xn-a8p._.js +3 -0
  200. package/.next/server/chunks/ssr/[root-of-the-server]__0~c929r._.js +33 -0
  201. package/.next/server/chunks/ssr/[turbopack]_runtime.js +903 -0
  202. package/.next/server/chunks/ssr/_0-oaqqe._.js +6 -0
  203. package/.next/server/chunks/ssr/_006q235._.js +3 -0
  204. package/.next/server/chunks/ssr/_03.pm1z._.js +108 -0
  205. package/.next/server/chunks/ssr/_0txwi90._.js +3 -0
  206. package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0k77kol.js +3 -0
  207. package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0eq97pa.js +3 -0
  208. package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_09-gtaw.js +3 -0
  209. package/.next/server/chunks/ssr/_next-internal_server_app_session_[provider]_[sessionId]_page_actions_0_67qh_.js +3 -0
  210. package/.next/server/chunks/ssr/_next-internal_server_app_thread_[threadId]_page_actions_11mcypo.js +3 -0
  211. package/.next/server/chunks/ssr/lib_conversations_store_ts_0-pd6d3._.js +4 -0
  212. package/.next/server/chunks/ssr/node_modules_09w7yel._.js +33 -0
  213. package/.next/server/chunks/ssr/node_modules_0tev5qq._.js +3 -0
  214. package/.next/server/chunks/ssr/node_modules_@vercel_oidc_dist_token_0yj7kvj.js +3 -0
  215. package/.next/server/chunks/ssr/node_modules_next_dist_09jzzl8._.js +3 -0
  216. package/.next/server/chunks/ssr/node_modules_next_dist_0h9llsw._.js +6 -0
  217. package/.next/server/chunks/ssr/node_modules_next_dist_0t-hj0x._.js +3 -0
  218. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0inhx6q._.js +3 -0
  219. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js +3 -0
  220. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0lgvd_..js +3 -0
  221. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js +3 -0
  222. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_00297nb.js +4 -0
  223. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_002l7yi.js +4 -0
  224. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_02suzhc.js +4 -0
  225. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_04x9gct.js +4 -0
  226. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0nsg22r.js +4 -0
  227. package/.next/server/chunks/tools_image-generation_service_mjs_0k_th7-._.js +3 -0
  228. package/.next/server/edge/chunks/_0e82_ds._.js +3 -0
  229. package/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_00ue99t.js +3 -0
  230. package/.next/server/functions-config-manifest.json +11 -0
  231. package/.next/server/instrumentation/middleware-manifest.json +12 -0
  232. package/.next/server/instrumentation.js +4 -0
  233. package/.next/server/instrumentation.js.nft.json +1 -0
  234. package/.next/server/interception-route-rewrite-manifest.js +1 -0
  235. package/.next/server/middleware-build-manifest.js +22 -0
  236. package/.next/server/middleware-manifest.json +6 -0
  237. package/.next/server/next-font-manifest.js +1 -0
  238. package/.next/server/next-font-manifest.json +6 -0
  239. package/.next/server/pages/404.html +1 -0
  240. package/.next/server/pages/500.html +1 -0
  241. package/.next/server/pages-manifest.json +4 -0
  242. package/.next/server/prefetch-hints.json +1 -0
  243. package/.next/server/server-reference-manifest.js +1 -0
  244. package/.next/server/server-reference-manifest.json +5 -0
  245. package/.next/static/chunks/01xlw8hd842-c.js +1 -0
  246. package/.next/static/chunks/03edqrb4zdj~g.js +31 -0
  247. package/.next/static/chunks/03qq5fxc~pg00.js +1 -0
  248. package/.next/static/chunks/03~yq9q893hmn.js +1 -0
  249. package/.next/static/chunks/0l-_vd.~~z2bw.js +2 -0
  250. package/.next/static/chunks/0qid5lwcbx9s0.js +1 -0
  251. package/.next/static/chunks/0t.k8~x~sghva.js +4 -0
  252. package/.next/static/chunks/0tmpufzgpw2-w.js +1 -0
  253. package/.next/static/chunks/0v_ue~msygctw.js +1 -0
  254. package/.next/static/chunks/0y2l0xgouorae.css +1 -0
  255. package/.next/static/chunks/0zftsky7gte_9.js +102 -0
  256. package/.next/static/chunks/13nvdsh0e09d0.js +1 -0
  257. package/.next/static/chunks/1610ha42i.fl~.css +1 -0
  258. package/.next/static/chunks/turbopack-0mxz-ap91rcoe.js +1 -0
  259. package/.next/static/mbk_N5Gs4ZJg3lciRL6ya/_buildManifest.js +11 -0
  260. package/.next/static/mbk_N5Gs4ZJg3lciRL6ya/_clientMiddlewareManifest.js +1 -0
  261. package/.next/static/mbk_N5Gs4ZJg3lciRL6ya/_ssgManifest.js +1 -0
  262. package/.next/static/media/favicon.0x3dzn~oxb6tn.ico +0 -0
  263. package/README.md +113 -0
  264. package/THIRD_PARTY_NOTICES.md +34 -0
  265. package/bin/acp.mjs +224 -0
  266. package/dist/app/globals.css +146 -0
  267. package/dist/components/assistant-ui/acp-command-menu.d.ts +2 -0
  268. package/dist/components/assistant-ui/acp-command-menu.mjs +176 -0
  269. package/dist/components/assistant-ui/acp-elicitation-option-list.d.ts +3 -0
  270. package/dist/components/assistant-ui/acp-elicitation-option-list.mjs +157 -0
  271. package/dist/components/assistant-ui/acp-selectors.d.ts +2 -0
  272. package/dist/components/assistant-ui/acp-selectors.mjs +301 -0
  273. package/dist/components/assistant-ui/acp-tool-content.d.ts +4 -0
  274. package/dist/components/assistant-ui/acp-tool-content.mjs +127 -0
  275. package/dist/components/assistant-ui/addons/host.d.ts +4 -0
  276. package/dist/components/assistant-ui/addons/host.mjs +85 -0
  277. package/dist/components/assistant-ui/addons/image-generation-records-section.d.ts +14 -0
  278. package/dist/components/assistant-ui/addons/image-generation-records-section.mjs +116 -0
  279. package/dist/components/assistant-ui/addons/output-artifacts-section.d.ts +9 -0
  280. package/dist/components/assistant-ui/addons/output-artifacts-section.mjs +24 -0
  281. package/dist/components/assistant-ui/addons/output-artifacts.d.ts +14 -0
  282. package/dist/components/assistant-ui/addons/output-artifacts.mjs +87 -0
  283. package/dist/components/assistant-ui/addons/plan-addon.d.ts +2 -0
  284. package/dist/components/assistant-ui/addons/plan-addon.mjs +39 -0
  285. package/dist/components/assistant-ui/addons/plan-data.d.ts +5 -0
  286. package/dist/components/assistant-ui/addons/plan-data.mjs +97 -0
  287. package/dist/components/assistant-ui/addons/registry.d.ts +2 -0
  288. package/dist/components/assistant-ui/addons/registry.mjs +8 -0
  289. package/dist/components/assistant-ui/addons/types.d.ts +13 -0
  290. package/dist/components/assistant-ui/addons/types.mjs +1 -0
  291. package/dist/components/assistant-ui/attachment.d.ts +7 -0
  292. package/dist/components/assistant-ui/attachment.mjs +88 -0
  293. package/dist/components/assistant-ui/file.d.ts +37 -0
  294. package/dist/components/assistant-ui/file.mjs +107 -0
  295. package/dist/components/assistant-ui/image-generation-settings-dialog.d.ts +4 -0
  296. package/dist/components/assistant-ui/image-generation-settings-dialog.mjs +28 -0
  297. package/dist/components/assistant-ui/image.d.ts +51 -0
  298. package/dist/components/assistant-ui/image.mjs +215 -0
  299. package/dist/components/assistant-ui/markdown-text.d.ts +2 -0
  300. package/dist/components/assistant-ui/markdown-text.mjs +208 -0
  301. package/dist/components/assistant-ui/thread/composer.d.ts +27 -0
  302. package/dist/components/assistant-ui/thread/composer.mjs +15 -0
  303. package/dist/components/assistant-ui/thread/context-chips.d.ts +2 -0
  304. package/dist/components/assistant-ui/thread/context-chips.mjs +123 -0
  305. package/dist/components/assistant-ui/thread/empty-state.d.ts +9 -0
  306. package/dist/components/assistant-ui/thread/empty-state.mjs +24 -0
  307. package/dist/components/assistant-ui/thread/index.d.ts +11 -0
  308. package/dist/components/assistant-ui/thread/index.mjs +43 -0
  309. package/dist/components/assistant-ui/thread/message-list.d.ts +3 -0
  310. package/dist/components/assistant-ui/thread/message-list.mjs +16 -0
  311. package/dist/components/assistant-ui/thread/messages.d.ts +9 -0
  312. package/dist/components/assistant-ui/thread/messages.mjs +71 -0
  313. package/dist/components/assistant-ui/thread/scroll-to-bottom.d.ts +2 -0
  314. package/dist/components/assistant-ui/thread/scroll-to-bottom.mjs +8 -0
  315. package/dist/components/assistant-ui/thread-list.d.ts +2 -0
  316. package/dist/components/assistant-ui/thread-list.mjs +31 -0
  317. package/dist/components/assistant-ui/thread.d.ts +1 -0
  318. package/dist/components/assistant-ui/thread.mjs +2 -0
  319. package/dist/components/assistant-ui/threadlist-sidebar.d.ts +6 -0
  320. package/dist/components/assistant-ui/threadlist-sidebar.mjs +32 -0
  321. package/dist/components/assistant-ui/tool-fallback.d.ts +31 -0
  322. package/dist/components/assistant-ui/tool-fallback.mjs +114 -0
  323. package/dist/components/assistant-ui/tooltip-icon-button.d.ts +7 -0
  324. package/dist/components/assistant-ui/tooltip-icon-button.mjs +23 -0
  325. package/dist/components/icons/github.d.ts +3 -0
  326. package/dist/components/icons/github.mjs +4 -0
  327. package/dist/components/theme-toggle.d.ts +1 -0
  328. package/dist/components/theme-toggle.mjs +26 -0
  329. package/dist/components/tool-ui/option-list.d.ts +34 -0
  330. package/dist/components/tool-ui/option-list.mjs +163 -0
  331. package/dist/components/ui/avatar.d.ts +11 -0
  332. package/dist/components/ui/avatar.mjs +40 -0
  333. package/dist/components/ui/button.d.ts +10 -0
  334. package/dist/components/ui/button.mjs +47 -0
  335. package/dist/components/ui/collapsible.d.ts +5 -0
  336. package/dist/components/ui/collapsible.mjs +27 -0
  337. package/dist/components/ui/dialog.d.ts +17 -0
  338. package/dist/components/ui/dialog.mjs +58 -0
  339. package/dist/components/ui/input.d.ts +3 -0
  340. package/dist/components/ui/input.mjs +18 -0
  341. package/dist/components/ui/label.d.ts +4 -0
  342. package/dist/components/ui/label.mjs +20 -0
  343. package/dist/components/ui/scroll-area.d.ts +5 -0
  344. package/dist/components/ui/scroll-area.mjs +26 -0
  345. package/dist/components/ui/select.d.ts +13 -0
  346. package/dist/components/ui/select.mjs +59 -0
  347. package/dist/components/ui/separator.d.ts +4 -0
  348. package/dist/components/ui/separator.mjs +20 -0
  349. package/dist/components/ui/sheet.d.ts +14 -0
  350. package/dist/components/ui/sheet.mjs +61 -0
  351. package/dist/components/ui/sidebar.d.ts +69 -0
  352. package/dist/components/ui/sidebar.mjs +245 -0
  353. package/dist/components/ui/skeleton.d.ts +2 -0
  354. package/dist/components/ui/skeleton.mjs +18 -0
  355. package/dist/components/ui/switch.d.ts +4 -0
  356. package/dist/components/ui/switch.mjs +20 -0
  357. package/dist/components/ui/tabs.d.ts +7 -0
  358. package/dist/components/ui/tabs.mjs +32 -0
  359. package/dist/components/ui/tooltip.d.ts +7 -0
  360. package/dist/components/ui/tooltip.mjs +32 -0
  361. package/dist/hooks/use-mobile.d.ts +1 -0
  362. package/dist/hooks/use-mobile.mjs +15 -0
  363. package/dist/lib/acp2aisdk/capabilities.d.ts +6 -0
  364. package/dist/lib/acp2aisdk/capabilities.mjs +210 -0
  365. package/dist/lib/acp2aisdk/capability-cache.d.ts +17 -0
  366. package/dist/lib/acp2aisdk/capability-cache.mjs +259 -0
  367. package/dist/lib/acp2aisdk/client-context.d.ts +38 -0
  368. package/dist/lib/acp2aisdk/client-context.mjs +247 -0
  369. package/dist/lib/acp2aisdk/commands.d.ts +11 -0
  370. package/dist/lib/acp2aisdk/commands.mjs +121 -0
  371. package/dist/lib/acp2aisdk/config-options.d.ts +3 -0
  372. package/dist/lib/acp2aisdk/config-options.mjs +86 -0
  373. package/dist/lib/acp2aisdk/context.d.ts +88 -0
  374. package/dist/lib/acp2aisdk/context.mjs +33 -0
  375. package/dist/lib/acp2aisdk/default-capabilities.d.ts +275 -0
  376. package/dist/lib/acp2aisdk/default-capabilities.mjs +421 -0
  377. package/dist/lib/acp2aisdk/elicitation.d.ts +37 -0
  378. package/dist/lib/acp2aisdk/elicitation.mjs +193 -0
  379. package/dist/lib/acp2aisdk/hitl.d.ts +25 -0
  380. package/dist/lib/acp2aisdk/hitl.mjs +134 -0
  381. package/dist/lib/acp2aisdk/index.d.ts +12 -0
  382. package/dist/lib/acp2aisdk/index.mjs +182 -0
  383. package/dist/lib/acp2aisdk/mcp-servers.d.ts +17 -0
  384. package/dist/lib/acp2aisdk/mcp-servers.mjs +153 -0
  385. package/dist/lib/acp2aisdk/model-selection.d.ts +16 -0
  386. package/dist/lib/acp2aisdk/model-selection.mjs +65 -0
  387. package/dist/lib/acp2aisdk/prompt-history.d.ts +9 -0
  388. package/dist/lib/acp2aisdk/prompt-history.mjs +168 -0
  389. package/dist/lib/acp2aisdk/provider-compat.d.ts +85 -0
  390. package/dist/lib/acp2aisdk/provider-compat.mjs +501 -0
  391. package/dist/lib/acp2aisdk/provider-registry.d.ts +15 -0
  392. package/dist/lib/acp2aisdk/provider-registry.mjs +196 -0
  393. package/dist/lib/acp2aisdk/response.d.ts +3 -0
  394. package/dist/lib/acp2aisdk/response.mjs +33 -0
  395. package/dist/lib/acp2aisdk/runtime-options.d.ts +2 -0
  396. package/dist/lib/acp2aisdk/runtime-options.mjs +10 -0
  397. package/dist/lib/acp2aisdk/session-runtime.d.ts +5 -0
  398. package/dist/lib/acp2aisdk/session-runtime.mjs +186 -0
  399. package/dist/lib/acp2aisdk/session-store.d.ts +31 -0
  400. package/dist/lib/acp2aisdk/session-store.mjs +169 -0
  401. package/dist/lib/acp2aisdk/skill-command-cache.d.ts +20 -0
  402. package/dist/lib/acp2aisdk/skill-command-cache.mjs +122 -0
  403. package/dist/lib/acp2aisdk/stream-metadata.d.ts +10 -0
  404. package/dist/lib/acp2aisdk/stream-metadata.mjs +251 -0
  405. package/dist/lib/acp2aisdk/types.d.ts +129 -0
  406. package/dist/lib/acp2aisdk/types.mjs +0 -0
  407. package/dist/lib/acp2aisdk/vendor/acp-ai-provider/index.d.ts +10 -0
  408. package/dist/lib/acp2aisdk/vendor/acp-ai-provider/index.mjs +10 -0
  409. package/dist/lib/acp2aisdk/vendor/acp-ai-provider/package/index.mjs +1945 -0
  410. package/dist/lib/api/client.d.ts +93 -0
  411. package/dist/lib/api/client.mjs +199 -0
  412. package/dist/lib/api/cors.d.ts +2 -0
  413. package/dist/lib/api/cors.mjs +47 -0
  414. package/dist/lib/conversations/client-adapter.d.ts +21 -0
  415. package/dist/lib/conversations/client-adapter.mjs +329 -0
  416. package/dist/lib/conversations/message-repository.d.ts +8 -0
  417. package/dist/lib/conversations/message-repository.mjs +87 -0
  418. package/dist/lib/conversations/store.d.ts +17 -0
  419. package/dist/lib/conversations/store.mjs +678 -0
  420. package/dist/lib/conversations/types.d.ts +92 -0
  421. package/dist/lib/conversations/types.mjs +0 -0
  422. package/dist/lib/local-image-files.d.ts +5 -0
  423. package/dist/lib/local-image-files.mjs +76 -0
  424. package/dist/lib/local-image-paths.d.ts +7 -0
  425. package/dist/lib/local-image-paths.mjs +106 -0
  426. package/dist/lib/output-artifacts/workspace.d.ts +8 -0
  427. package/dist/lib/output-artifacts/workspace.mjs +174 -0
  428. package/dist/lib/provider-history/codex.d.ts +4 -0
  429. package/dist/lib/provider-history/codex.mjs +272 -0
  430. package/dist/lib/provider-history/index.d.ts +7 -0
  431. package/dist/lib/provider-history/index.mjs +88 -0
  432. package/dist/lib/provider-history/types.d.ts +31 -0
  433. package/dist/lib/provider-history/types.mjs +0 -0
  434. package/dist/lib/server-runtime.d.ts +22 -0
  435. package/dist/lib/server-runtime.mjs +78 -0
  436. package/dist/lib/url-routing.d.ts +18 -0
  437. package/dist/lib/url-routing.mjs +59 -0
  438. package/dist/lib/utils.d.ts +2 -0
  439. package/dist/lib/utils.mjs +5 -0
  440. package/dist/lib/workspace-metadata.d.ts +2 -0
  441. package/dist/lib/workspace-metadata.mjs +20 -0
  442. package/dist/public-api/react.d.ts +14 -0
  443. package/dist/public-api/react.mjs +16 -0
  444. package/dist/public-api/runtime.d.ts +8 -0
  445. package/dist/public-api/runtime.mjs +7 -0
  446. package/dist/public-api/server.d.ts +5 -0
  447. package/dist/public-api/server.mjs +4 -0
  448. package/dist/public-api/styles.css +1 -0
  449. package/dist/public-api/ui.d.ts +13 -0
  450. package/dist/public-api/ui.mjs +13 -0
  451. package/dist/tools/client-registry.d.ts +9 -0
  452. package/dist/tools/client-registry.mjs +70 -0
  453. package/dist/tools/image-generation/client.d.ts +18 -0
  454. package/dist/tools/image-generation/client.mjs +31 -0
  455. package/dist/tools/image-generation/config.d.ts +9 -0
  456. package/dist/tools/image-generation/config.example.json +14 -0
  457. package/dist/tools/image-generation/config.mjs +11 -0
  458. package/dist/tools/image-generation/mcp-server.mjs +87 -0
  459. package/dist/tools/image-generation/registry.d.ts +13 -0
  460. package/dist/tools/image-generation/registry.mjs +30 -0
  461. package/dist/tools/image-generation/server.d.ts +6 -0
  462. package/dist/tools/image-generation/server.mjs +58 -0
  463. package/dist/tools/image-generation/service.mjs +978 -0
  464. package/dist/tools/image-generation/shared.d.ts +103 -0
  465. package/dist/tools/image-generation/shared.mjs +80 -0
  466. package/dist/tools/image-generation/storage.d.ts +22 -0
  467. package/dist/tools/image-generation/storage.mjs +8 -0
  468. package/dist/tools/image-generation/ui-detail.d.ts +26 -0
  469. package/dist/tools/image-generation/ui-detail.mjs +109 -0
  470. package/dist/tools/image-generation/ui.d.ts +8 -0
  471. package/dist/tools/image-generation/ui.mjs +121 -0
  472. package/dist/tools/registry.d.ts +32 -0
  473. package/dist/tools/registry.mjs +142 -0
  474. package/dist/tools/ui-registry.d.ts +3 -0
  475. package/dist/tools/ui-registry.mjs +20 -0
  476. package/dist/tools/user-choice/client.d.ts +10 -0
  477. package/dist/tools/user-choice/client.mjs +18 -0
  478. package/dist/tools/user-choice/registry.d.ts +12 -0
  479. package/dist/tools/user-choice/registry.mjs +21 -0
  480. package/dist/tools/user-choice/server.d.ts +6 -0
  481. package/dist/tools/user-choice/server.mjs +42 -0
  482. package/dist/tools/user-choice/shared.d.ts +79 -0
  483. package/dist/tools/user-choice/shared.mjs +56 -0
  484. package/dist/tools/user-choice/store.d.ts +19 -0
  485. package/dist/tools/user-choice/store.mjs +95 -0
  486. package/dist/tools/user-choice/ui.d.ts +3 -0
  487. package/dist/tools/user-choice/ui.mjs +396 -0
  488. package/package.json +118 -0
@@ -0,0 +1,157 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { CheckCircleIcon, CheckIcon, HelpCircleIcon, XCircleIcon, } from "lucide-react";
4
+ import { useMemo, useState } from "react";
5
+ import { OptionList } from "../tool-ui/option-list.mjs";
6
+ import { ACP_ELICITATION_OPTION_LIST_TOOL_NAME, } from "../../lib/acp2aisdk/elicitation.mjs";
7
+ import { cn } from "../../lib/utils.mjs";
8
+ function isRecord(value) {
9
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
10
+ }
11
+ function normalizeString(value) {
12
+ return typeof value === "string" ? value.trim() : "";
13
+ }
14
+ function normalizeStringArray(value) {
15
+ if (!Array.isArray(value))
16
+ return [];
17
+ return value.map(normalizeString).filter(Boolean);
18
+ }
19
+ function parsePayload(value) {
20
+ if (!isRecord(value))
21
+ return null;
22
+ if (value.selectionMode !== "single" && value.selectionMode !== "multi") {
23
+ return null;
24
+ }
25
+ const options = Array.isArray(value.options)
26
+ ? value.options.flatMap((option) => {
27
+ if (!isRecord(option))
28
+ return [];
29
+ const id = normalizeString(option.id);
30
+ const label = normalizeString(option.label);
31
+ if (!id || !label)
32
+ return [];
33
+ return [
34
+ Object.assign(Object.assign({ id,
35
+ label }, (normalizeString(option.description)
36
+ ? { description: normalizeString(option.description) }
37
+ : {})), (typeof option.disabled === "boolean"
38
+ ? { disabled: option.disabled }
39
+ : {})),
40
+ ];
41
+ })
42
+ : [];
43
+ const fieldName = normalizeString(value.fieldName);
44
+ if (!fieldName || options.length === 0)
45
+ return null;
46
+ return Object.assign(Object.assign(Object.assign(Object.assign({ toolCallId: normalizeString(value.toolCallId), message: normalizeString(value.message) || "Choose an option", fieldName, fieldTitle: normalizeString(value.fieldTitle) || fieldName }, (normalizeString(value.fieldDescription)
47
+ ? { fieldDescription: normalizeString(value.fieldDescription) }
48
+ : {})), { selectionMode: value.selectionMode, options, defaultValue: value.selectionMode === "multi"
49
+ ? normalizeStringArray(value.defaultValue)
50
+ : normalizeString(value.defaultValue) || null, minSelections: typeof value.minSelections === "number" ? value.minSelections : 1 }), (typeof value.maxSelections === "number"
51
+ ? { maxSelections: value.maxSelections }
52
+ : {})), { required: value.required === true });
53
+ }
54
+ function parseResult(value) {
55
+ if (!isRecord(value))
56
+ return null;
57
+ if (value.action === "decline" || value.action === "cancel") {
58
+ return { action: value.action };
59
+ }
60
+ if (value.action === "accept" && isRecord(value.content)) {
61
+ return { action: "accept", content: value.content };
62
+ }
63
+ return null;
64
+ }
65
+ function getChoiceFromResult(payload, result) {
66
+ if (!result)
67
+ return undefined;
68
+ if (result.action !== "accept")
69
+ return null;
70
+ const choice = result.content[payload.fieldName];
71
+ if (payload.selectionMode === "multi")
72
+ return normalizeStringArray(choice);
73
+ return normalizeString(choice) || null;
74
+ }
75
+ function valueToArray(value) {
76
+ if (Array.isArray(value))
77
+ return value;
78
+ return value ? [value] : [];
79
+ }
80
+ function formatChoiceLabel(payload, value) {
81
+ const selectedIds = new Set(valueToArray(value));
82
+ const labels = payload.options
83
+ .filter((option) => selectedIds.has(option.id))
84
+ .map((option) => option.label);
85
+ return labels.length > 0 ? labels.join("、") : "未选择";
86
+ }
87
+ function getReceiptText(payload, action, displayedChoice) {
88
+ if (action === "decline")
89
+ return "已拒绝";
90
+ if (action === "cancel")
91
+ return "已取消";
92
+ return `已选择 ${formatChoiceLabel(payload, displayedChoice)}`;
93
+ }
94
+ export function isAcpElicitationOptionListPart(part) {
95
+ return part.toolName === ACP_ELICITATION_OPTION_LIST_TOOL_NAME;
96
+ }
97
+ export function AcpElicitationOptionListCard(part) {
98
+ var _a, _b, _c;
99
+ const payload = useMemo(() => parsePayload(part.args), [part.args]);
100
+ const result = useMemo(() => parseResult(part.result), [part.result]);
101
+ const [submitted, setSubmitted] = useState(false);
102
+ const [submittedAction, setSubmittedAction] = useState(null);
103
+ const [submittedChoice, setSubmittedChoice] = useState();
104
+ if (!payload)
105
+ return null;
106
+ const disabled = submitted ||
107
+ Boolean(result) ||
108
+ ((_a = part.status) === null || _a === void 0 ? void 0 : _a.type) === "complete" ||
109
+ ((_b = part.status) === null || _b === void 0 ? void 0 : _b.type) === "incomplete";
110
+ const choice = getChoiceFromResult(payload, result);
111
+ const displayedChoice = submitted ? (submittedChoice !== null && submittedChoice !== void 0 ? submittedChoice : null) : choice;
112
+ const receiptAction = (_c = result === null || result === void 0 ? void 0 : result.action) !== null && _c !== void 0 ? _c : submittedAction;
113
+ const isReceipt = displayedChoice !== undefined;
114
+ const statusLabel = (result === null || result === void 0 ? void 0 : result.action) === "accept"
115
+ ? "已选择"
116
+ : (result === null || result === void 0 ? void 0 : result.action) === "decline"
117
+ ? "已拒绝"
118
+ : (result === null || result === void 0 ? void 0 : result.action) === "cancel"
119
+ ? "已取消"
120
+ : "等待选择";
121
+ const StatusIcon = (result === null || result === void 0 ? void 0 : result.action) === "accept"
122
+ ? CheckCircleIcon
123
+ : result
124
+ ? XCircleIcon
125
+ : HelpCircleIcon;
126
+ const isAcceptedReceipt = receiptAction === "accept";
127
+ return (_jsxs("div", { className: "my-2.5 w-full rounded-lg border bg-card p-4 shadow-xs", children: [_jsxs("div", { className: "mb-3 flex items-start gap-3", children: [_jsx(StatusIcon, { className: cn("mt-0.5 size-4 shrink-0", (result === null || result === void 0 ? void 0 : result.action) === "accept"
128
+ ? "text-emerald-600 dark:text-emerald-400"
129
+ : result
130
+ ? "text-muted-foreground"
131
+ : "text-primary") }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "break-words font-medium text-base leading-snug", children: payload.message }), _jsxs("div", { className: "mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-muted-foreground text-xs", children: [_jsx("span", { children: payload.fieldTitle }), _jsx("span", { "aria-hidden": true, children: "\u00B7" }), _jsx("span", { children: statusLabel })] }), payload.fieldDescription && (_jsx("div", { className: "mt-2 break-words text-muted-foreground text-sm leading-snug", children: payload.fieldDescription }))] })] }), isReceipt ? (_jsxs("div", { className: cn("flex items-center gap-2 rounded-md border px-3 py-2 text-sm", isAcceptedReceipt
132
+ ? "border-emerald-200 bg-emerald-50 text-emerald-900 dark:border-emerald-900/50 dark:bg-emerald-950/30 dark:text-emerald-200"
133
+ : "border-muted-foreground/20 bg-muted/40 text-muted-foreground"), children: [isAcceptedReceipt ? (_jsx(CheckIcon, { className: "size-4 shrink-0" })) : (_jsx(XCircleIcon, { className: "size-4 shrink-0" })), _jsx("span", { className: "min-w-0 break-words", children: getReceiptText(payload, receiptAction, displayedChoice) })] })) : (_jsx(OptionList, { id: payload.toolCallId || part.toolCallId, options: payload.options, selectionMode: payload.selectionMode, defaultValue: payload.defaultValue, minSelections: payload.minSelections, maxSelections: payload.maxSelections, className: "my-0 border-0 bg-transparent p-0 shadow-none", actions: [
134
+ { id: "confirm", label: "确认" },
135
+ { id: "cancel", label: "取消", variant: "outline" },
136
+ ], onAction: (actionId, selectedValue) => {
137
+ if (disabled)
138
+ return;
139
+ setSubmitted(true);
140
+ if (actionId === "cancel") {
141
+ setSubmittedAction("cancel");
142
+ setSubmittedChoice(null);
143
+ part.addResult({ action: "cancel" });
144
+ return;
145
+ }
146
+ setSubmittedAction("accept");
147
+ setSubmittedChoice(selectedValue);
148
+ part.addResult({
149
+ action: "accept",
150
+ content: {
151
+ [payload.fieldName]: payload.selectionMode === "multi"
152
+ ? normalizeStringArray(selectedValue)
153
+ : normalizeString(selectedValue),
154
+ },
155
+ });
156
+ } }))] }));
157
+ }
@@ -0,0 +1,2 @@
1
+ export declare function AcpHeaderContext(): import("react/jsx-runtime").JSX.Element;
2
+ export declare function AcpComposerSelectors(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,301 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { AuiIf, useAuiState } from "@assistant-ui/react";
4
+ import { CheckIcon, ChevronDownIcon, ChevronRightIcon, GaugeIcon, NetworkIcon, Settings2Icon, SlidersHorizontalIcon, } from "lucide-react";
5
+ import { useEffect, useMemo, useRef, useState } from "react";
6
+ import { ACP_CAPABILITY_REFRESH_EVENT, hydrateAcpCapabilityCacheFromDefaults, persistAcpCapabilityCache, shouldFetchAcpCapabilitySnapshot, } from "../../lib/acp2aisdk/capability-cache.mjs";
7
+ import { useAcpUiRuntimeContext } from "../../lib/acp2aisdk/client-context.mjs";
8
+ import { chooseComposerModelOptions } from "../../lib/acp2aisdk/model-selection.mjs";
9
+ import { ACP_PROVIDER_KEYS, ACP_PROVIDER_REGISTRY, } from "../../lib/acp2aisdk/provider-registry.mjs";
10
+ import { acpApiClient } from "../../lib/api/client.mjs";
11
+ import { cn } from "../../lib/utils.mjs";
12
+ const CONFIG_MENU_DESKTOP_QUERY = "(min-width: 640px)";
13
+ function useMediaQuery(query) {
14
+ const [matches, setMatches] = useState(false);
15
+ useEffect(() => {
16
+ const media = window.matchMedia(query);
17
+ const syncMatches = () => setMatches(media.matches);
18
+ syncMatches();
19
+ media.addEventListener("change", syncMatches);
20
+ return () => {
21
+ media.removeEventListener("change", syncMatches);
22
+ };
23
+ }, [query]);
24
+ return matches;
25
+ }
26
+ function getOptionLabel(options, value) {
27
+ var _a;
28
+ if (!options.length)
29
+ return "";
30
+ return (((_a = options.find((option) => option.value === value)) === null || _a === void 0 ? void 0 : _a.label) || options[0].label);
31
+ }
32
+ const PROVIDER_OPTIONS = ACP_PROVIDER_KEYS.map((provider, index) => ({
33
+ value: provider,
34
+ label: ACP_PROVIDER_REGISTRY[provider].label,
35
+ description: ACP_PROVIDER_REGISTRY[provider].enabledInP0
36
+ ? "已验证"
37
+ : "需本地 CLI/登录",
38
+ order: index,
39
+ }));
40
+ function capabilityOptions(snapshot, key) {
41
+ var _a, _b;
42
+ const capability = snapshot === null || snapshot === void 0 ? void 0 : snapshot.capabilities[key];
43
+ return ((_b = (_a = capability === null || capability === void 0 ? void 0 : capability.options) === null || _a === void 0 ? void 0 : _a.filter((option) => option.value).map((option) => ({
44
+ value: option.value,
45
+ label: option.label || option.value,
46
+ description: option.description,
47
+ }))) !== null && _b !== void 0 ? _b : []);
48
+ }
49
+ function syncSnapshotSelection(snapshot, actions) {
50
+ var _a, _b, _c;
51
+ const capabilities = snapshot === null || snapshot === void 0 ? void 0 : snapshot.capabilities;
52
+ if ((_a = capabilities === null || capabilities === void 0 ? void 0 : capabilities.model) === null || _a === void 0 ? void 0 : _a.currentValue) {
53
+ actions.syncModel(capabilities.model.currentValue);
54
+ }
55
+ if ((_b = capabilities === null || capabilities === void 0 ? void 0 : capabilities.mode) === null || _b === void 0 ? void 0 : _b.currentValue) {
56
+ actions.syncModeId(capabilities.mode.currentValue);
57
+ }
58
+ if ((_c = capabilities === null || capabilities === void 0 ? void 0 : capabilities.thought_level) === null || _c === void 0 ? void 0 : _c.currentValue) {
59
+ actions.syncThoughtLevel(capabilities.thought_level.currentValue);
60
+ }
61
+ }
62
+ function useCapabilitySnapshot() {
63
+ const { provider, workspacePath, syncModel, syncModeId, syncThoughtLevel } = useAcpUiRuntimeContext();
64
+ const threadId = useAuiState((state) => { var _a; return (_a = state.threadListItem.remoteId) !== null && _a !== void 0 ? _a : state.threads.mainThreadId; });
65
+ const [refreshToken, setRefreshToken] = useState(0);
66
+ const [snapshot, setSnapshot] = useState(() => hydrateAcpCapabilityCacheFromDefaults(provider, workspacePath));
67
+ useEffect(() => {
68
+ function handleCapabilityRefresh(event) {
69
+ var _a;
70
+ const detail = event.detail;
71
+ if ((detail === null || detail === void 0 ? void 0 : detail.provider) && detail.provider !== provider)
72
+ return;
73
+ if ((detail === null || detail === void 0 ? void 0 : detail.threadId) && detail.threadId !== threadId)
74
+ return;
75
+ if (detail &&
76
+ "workspacePath" in detail &&
77
+ ((_a = detail.workspacePath) !== null && _a !== void 0 ? _a : null) !== (workspacePath !== null && workspacePath !== void 0 ? workspacePath : null)) {
78
+ return;
79
+ }
80
+ setRefreshToken((current) => current + 1);
81
+ }
82
+ window.addEventListener(ACP_CAPABILITY_REFRESH_EVENT, handleCapabilityRefresh);
83
+ return () => {
84
+ window.removeEventListener(ACP_CAPABILITY_REFRESH_EVENT, handleCapabilityRefresh);
85
+ };
86
+ }, [provider, threadId, workspacePath]);
87
+ useEffect(() => {
88
+ let cancelled = false;
89
+ const cached = hydrateAcpCapabilityCacheFromDefaults(provider, workspacePath);
90
+ setSnapshot(cached);
91
+ syncSnapshotSelection(cached, {
92
+ syncModeId,
93
+ syncModel,
94
+ syncThoughtLevel,
95
+ });
96
+ const force = refreshToken > 0;
97
+ if (!shouldFetchAcpCapabilitySnapshot(cached, { force }))
98
+ return;
99
+ acpApiClient
100
+ .getCapabilities({ provider, threadId, workspacePath })
101
+ .then((body) => {
102
+ var _a;
103
+ if (cancelled)
104
+ return;
105
+ const nextSnapshot = persistAcpCapabilityCache(provider, workspacePath, (_a = body === null || body === void 0 ? void 0 : body.capabilitySnapshot) !== null && _a !== void 0 ? _a : null);
106
+ setSnapshot(nextSnapshot);
107
+ syncSnapshotSelection(nextSnapshot, {
108
+ syncModeId,
109
+ syncModel,
110
+ syncThoughtLevel,
111
+ });
112
+ })
113
+ .catch(() => {
114
+ if (!cancelled)
115
+ setSnapshot(cached);
116
+ });
117
+ return () => {
118
+ cancelled = true;
119
+ };
120
+ }, [
121
+ provider,
122
+ refreshToken,
123
+ syncModeId,
124
+ syncModel,
125
+ syncThoughtLevel,
126
+ threadId,
127
+ workspacePath,
128
+ ]);
129
+ return snapshot;
130
+ }
131
+ export function AcpHeaderContext() {
132
+ const { provider, model, modeId, thoughtLevel } = useAcpUiRuntimeContext();
133
+ const providerLabel = ACP_PROVIDER_REGISTRY[provider].label;
134
+ return (_jsxs("div", { className: "hidden min-w-0 items-center gap-2 text-muted-foreground text-xs md:flex", children: [_jsx("span", { className: "truncate", children: providerLabel }), model ? _jsxs("span", { className: "truncate", children: ["/ ", model] }) : null, modeId ? _jsxs("span", { className: "truncate", children: ["/ ", modeId] }) : null, thoughtLevel ? _jsxs("span", { className: "truncate", children: ["/ ", thoughtLevel] }) : null] }));
135
+ }
136
+ export function AcpComposerSelectors() {
137
+ const snapshot = useCapabilitySnapshot();
138
+ const context = useAcpUiRuntimeContext();
139
+ const modelOptions = useMemo(() => chooseComposerModelOptions({
140
+ provider: context.provider,
141
+ acpModelOptions: capabilityOptions(snapshot, "model"),
142
+ sessionPinnedModel: context.model,
143
+ }), [context.model, context.provider, snapshot]);
144
+ const modeOptions = useMemo(() => capabilityOptions(snapshot, "mode"), [snapshot]);
145
+ const thoughtOptions = useMemo(() => capabilityOptions(snapshot, "thought_level"), [snapshot]);
146
+ const sections = useMemo(() => [
147
+ {
148
+ key: "provider",
149
+ label: "供应商",
150
+ value: context.provider,
151
+ options: PROVIDER_OPTIONS,
152
+ onChange: context.setProvider,
153
+ icon: NetworkIcon,
154
+ },
155
+ {
156
+ key: "model",
157
+ label: "模型",
158
+ value: context.model,
159
+ options: modelOptions,
160
+ onChange: context.setModel,
161
+ icon: SlidersHorizontalIcon,
162
+ },
163
+ {
164
+ key: "mode",
165
+ label: "模式",
166
+ value: context.modeId,
167
+ options: modeOptions,
168
+ onChange: context.setModeId,
169
+ icon: SlidersHorizontalIcon,
170
+ },
171
+ {
172
+ key: "thinking",
173
+ label: "思考深度",
174
+ value: context.thoughtLevel,
175
+ options: thoughtOptions,
176
+ onChange: context.setThoughtLevel,
177
+ icon: GaugeIcon,
178
+ },
179
+ ], [
180
+ context.modeId,
181
+ context.model,
182
+ context.provider,
183
+ context.setModeId,
184
+ context.setModel,
185
+ context.setProvider,
186
+ context.setThoughtLevel,
187
+ context.thoughtLevel,
188
+ modelOptions,
189
+ modeOptions,
190
+ thoughtOptions,
191
+ ]);
192
+ if (!modelOptions.length && !modeOptions.length && !thoughtOptions.length) {
193
+ return (_jsx(AuiIf, { condition: (state) => !state.thread.isEmpty, children: _jsx("div", { className: "flex min-w-0 items-center px-1 text-muted-foreground text-xs", children: "\u4F1A\u8BDD\u5F00\u59CB\u540E\u4F1A\u663E\u793A\u4F9B\u5E94\u5546\u80FD\u529B" }) }));
194
+ }
195
+ return _jsx(AcpConfigMenu, { sections: sections });
196
+ }
197
+ function AcpConfigMenu({ sections }) {
198
+ var _a, _b, _c, _d, _e;
199
+ const [open, setOpen] = useState(false);
200
+ const isDesktopLayout = useMediaQuery(CONFIG_MENU_DESKTOP_QUERY);
201
+ const visibleSections = useMemo(() => sections.filter((section) => section.options.length), [sections]);
202
+ const [desktopActiveKey, setDesktopActiveKey] = useState((_b = (_a = visibleSections[0]) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : null);
203
+ const [mobileExpandedKey, setMobileExpandedKey] = useState(null);
204
+ const rootRef = useRef(null);
205
+ const providerSection = visibleSections.find((section) => section.key === "provider");
206
+ const modelSection = visibleSections.find((section) => section.key === "model");
207
+ const desktopActiveSection = (_c = visibleSections.find((section) => section.key === desktopActiveKey)) !== null && _c !== void 0 ? _c : visibleSections[0];
208
+ const providerLabel = providerSection
209
+ ? getOptionLabel(providerSection.options, providerSection.value || ((_d = providerSection.options[0]) === null || _d === void 0 ? void 0 : _d.value) || null)
210
+ : "配置";
211
+ const modelLabel = modelSection
212
+ ? getOptionLabel(modelSection.options, modelSection.value || ((_e = modelSection.options[0]) === null || _e === void 0 ? void 0 : _e.value) || null)
213
+ : "";
214
+ useEffect(() => {
215
+ var _a, _b;
216
+ const nextActive = visibleSections.some((section) => section.key === desktopActiveKey)
217
+ ? desktopActiveKey
218
+ : ((_b = (_a = visibleSections[0]) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : null);
219
+ if (nextActive !== desktopActiveKey)
220
+ setDesktopActiveKey(nextActive);
221
+ if (mobileExpandedKey &&
222
+ !visibleSections.some((section) => section.key === mobileExpandedKey)) {
223
+ setMobileExpandedKey(null);
224
+ }
225
+ }, [desktopActiveKey, mobileExpandedKey, visibleSections]);
226
+ useEffect(() => {
227
+ if (!open)
228
+ return;
229
+ function closeMenu() {
230
+ setOpen(false);
231
+ setMobileExpandedKey(null);
232
+ }
233
+ function isInside(target) {
234
+ var _a;
235
+ return target instanceof Node && ((_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.contains(target));
236
+ }
237
+ function handlePointerDown(event) {
238
+ if (!isInside(event.target))
239
+ closeMenu();
240
+ }
241
+ function handleFocusIn(event) {
242
+ if (!isInside(event.target))
243
+ closeMenu();
244
+ }
245
+ function handleKeyDown(event) {
246
+ if (event.key === "Escape")
247
+ closeMenu();
248
+ }
249
+ document.addEventListener("pointerdown", handlePointerDown);
250
+ document.addEventListener("focusin", handleFocusIn);
251
+ document.addEventListener("keydown", handleKeyDown);
252
+ return () => {
253
+ document.removeEventListener("pointerdown", handlePointerDown);
254
+ document.removeEventListener("focusin", handleFocusIn);
255
+ document.removeEventListener("keydown", handleKeyDown);
256
+ };
257
+ }, [open]);
258
+ function handleTriggerClick() {
259
+ const nextOpen = !open;
260
+ setOpen(nextOpen);
261
+ setDesktopActiveKey((current) => { var _a, _b; return (_b = current !== null && current !== void 0 ? current : (_a = visibleSections[0]) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : null; });
262
+ if (!nextOpen)
263
+ setMobileExpandedKey(null);
264
+ }
265
+ function handleSectionClick(sectionKey) {
266
+ if (isDesktopLayout) {
267
+ setDesktopActiveKey(sectionKey);
268
+ return;
269
+ }
270
+ setMobileExpandedKey((current) => current === sectionKey ? null : sectionKey);
271
+ }
272
+ if (!visibleSections.length)
273
+ return null;
274
+ return (_jsxs("div", { ref: rootRef, className: "relative px-0.5", children: [_jsxs("button", { type: "button", className: "inline-flex h-8 max-w-56 items-center gap-1 rounded-md px-2 text-muted-foreground text-xs hover:bg-accent hover:text-accent-foreground", "aria-haspopup": "menu", "aria-expanded": open, "data-acp-config-trigger": "", onClick: handleTriggerClick, children: [_jsx(Settings2Icon, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "truncate", children: modelLabel ? `${providerLabel} · ${modelLabel}` : providerLabel }), _jsx(ChevronDownIcon, { className: "size-3 shrink-0" })] }), open ? (_jsxs("div", { className: "absolute bottom-full left-0 z-50 mb-2 w-[min(20rem,calc(100vw-2rem))] rounded-md border bg-popover p-1 text-popover-foreground shadow-md max-sm:w-[calc(100vw-5rem)]", role: "menu", "data-acp-config-root-menu": "", children: [_jsx("div", { className: "px-2 py-1.5 font-medium text-muted-foreground text-xs", children: "\u914D\u7F6E" }), _jsxs("div", { className: "relative", children: [visibleSections.map((section) => {
275
+ var _a;
276
+ const Icon = section.icon;
277
+ const selectedValue = section.value || ((_a = section.options[0]) === null || _a === void 0 ? void 0 : _a.value) || null;
278
+ const selectedLabel = getOptionLabel(section.options, selectedValue);
279
+ const isDesktopActive = section.key === (desktopActiveSection === null || desktopActiveSection === void 0 ? void 0 : desktopActiveSection.key);
280
+ const isMobileExpanded = section.key === mobileExpandedKey;
281
+ return (_jsxs("div", { children: [_jsxs("button", { type: "button", className: cn("flex min-h-11 w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:outline-none", isDesktopActive &&
282
+ "sm:bg-accent/70 sm:text-accent-foreground", isMobileExpanded &&
283
+ "max-sm:bg-accent/70 max-sm:text-accent-foreground"), "aria-haspopup": "menu", "aria-expanded": isDesktopLayout ? isDesktopActive : isMobileExpanded, "data-acp-config-section": section.key, onPointerEnter: (event) => {
284
+ if (event.pointerType === "mouse") {
285
+ setDesktopActiveKey(section.key);
286
+ }
287
+ }, onFocus: () => {
288
+ if (isDesktopLayout)
289
+ setDesktopActiveKey(section.key);
290
+ }, onClick: () => handleSectionClick(section.key), children: [_jsx(Icon, { className: "size-4 shrink-0 text-muted-foreground" }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate", children: section.label }), _jsx("span", { className: "block truncate text-muted-foreground text-xs", children: selectedLabel || "默认" })] }), _jsx(ChevronRightIcon, { className: "hidden size-3.5 shrink-0 text-muted-foreground sm:block" }), _jsx(ChevronDownIcon, { className: "size-3.5 shrink-0 text-muted-foreground sm:hidden" })] }), isMobileExpanded ? (_jsx(AcpConfigSubmenu, { section: section, variant: "mobile" })) : null] }, section.key));
291
+ }), desktopActiveSection ? (_jsx(AcpConfigSubmenu, { section: desktopActiveSection, variant: "desktop" })) : null] })] })) : null] }));
292
+ }
293
+ function AcpConfigSubmenu({ section, variant, }) {
294
+ var _a;
295
+ const selectedValue = section.value || ((_a = section.options[0]) === null || _a === void 0 ? void 0 : _a.value) || null;
296
+ return (_jsxs("div", { className: cn("overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground", variant === "desktop"
297
+ ? "absolute bottom-0 left-[calc(100%+0.5rem)] hidden max-h-80 w-[min(22rem,calc(100vw-2rem))] border shadow-md sm:block"
298
+ : "mt-1 max-h-56 w-full border-x-0 border-b-0 border-t sm:hidden"), role: "menu", "data-acp-config-submenu": variant, children: [_jsx("div", { className: "px-2 py-1.5 font-medium text-muted-foreground text-xs", children: section.label }), section.options.map((option) => (_jsxs("button", { type: "button", className: cn("flex min-h-10 w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:outline-none", option.value === selectedValue && "bg-accent/60"), role: "menuitemradio", "aria-checked": option.value === selectedValue, "data-acp-config-option": option.value, onClick: () => {
299
+ section.onChange(option.value);
300
+ }, children: [_jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate", children: option.label }), option.description ? (_jsx("span", { className: "block truncate text-muted-foreground text-xs", children: option.description })) : null] }), option.value === selectedValue ? (_jsx(CheckIcon, { className: "size-4 shrink-0" })) : null] }, option.value)))] }));
301
+ }
@@ -0,0 +1,4 @@
1
+ export declare function AcpToolContentBlocks({ toolCallId, className, }: {
2
+ toolCallId?: string;
3
+ className?: string;
4
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,127 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useAuiState } from "@assistant-ui/react";
4
+ import { FileCodeIcon, FileTextIcon, LinkIcon, TerminalIcon, } from "lucide-react";
5
+ import { useMemo } from "react";
6
+ import { cn } from "../../lib/utils.mjs";
7
+ function isRecord(value) {
8
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
9
+ }
10
+ function normalizeString(value) {
11
+ return typeof value === "string" ? value.trim() : "";
12
+ }
13
+ function recordsFromMap(value) {
14
+ if (!isRecord(value))
15
+ return [];
16
+ return Object.values(value)
17
+ .filter((item) => isRecord(item))
18
+ .sort((left, right) => {
19
+ const leftUpdatedAt = Number(left.updatedAt) || 0;
20
+ const rightUpdatedAt = Number(right.updatedAt) || 0;
21
+ return leftUpdatedAt - rightUpdatedAt;
22
+ });
23
+ }
24
+ function getAcpToolContentGroup(custom, toolCallId) {
25
+ const empty = {
26
+ diffs: [],
27
+ terminals: [],
28
+ resources: [],
29
+ resourceLinks: [],
30
+ unknown: [],
31
+ };
32
+ const acpToolContent = custom === null || custom === void 0 ? void 0 : custom.acpToolContent;
33
+ if (!isRecord(acpToolContent))
34
+ return empty;
35
+ const byToolCallId = acpToolContent.byToolCallId;
36
+ if (!isRecord(byToolCallId))
37
+ return empty;
38
+ const group = byToolCallId[toolCallId];
39
+ if (!isRecord(group))
40
+ return empty;
41
+ return {
42
+ diffs: recordsFromMap(group.diffs),
43
+ terminals: recordsFromMap(group.terminals),
44
+ resources: recordsFromMap(group.resources),
45
+ resourceLinks: recordsFromMap(group.resourceLinks),
46
+ unknown: recordsFromMap(group.unknown),
47
+ };
48
+ }
49
+ function hasContent(group) {
50
+ return (group.diffs.length > 0 ||
51
+ group.terminals.length > 0 ||
52
+ group.resources.length > 0 ||
53
+ group.resourceLinks.length > 0 ||
54
+ group.unknown.length > 0);
55
+ }
56
+ function formatUnknown(value) {
57
+ if (value === null)
58
+ return "null";
59
+ if (typeof value === "string")
60
+ return value;
61
+ try {
62
+ return JSON.stringify(value, null, 2);
63
+ }
64
+ catch (_a) {
65
+ return String(value);
66
+ }
67
+ }
68
+ function BlockShell({ icon: Icon, title, subtitle, children, }) {
69
+ return (_jsxs("section", { className: "rounded-md border border-border/70 bg-muted/20", children: [_jsxs("header", { className: "flex min-w-0 items-center gap-2 border-b px-3 py-2", children: [_jsx(Icon, { className: "size-4 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "truncate font-medium text-xs", children: title }), subtitle ? (_jsx("p", { className: "truncate text-muted-foreground text-[11px]", children: subtitle })) : null] })] }), _jsx("div", { className: "min-w-0 p-3", children: children })] }));
70
+ }
71
+ function CodePane({ label, value, className, }) {
72
+ return (_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "mb-1 font-medium text-muted-foreground text-[11px]", children: label }), _jsx("pre", { className: cn("max-h-56 overflow-auto rounded-sm bg-background px-3 py-2 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words", className), children: value || " " })] }));
73
+ }
74
+ function DiffView({ diff }) {
75
+ const path = normalizeString(diff.path) || "diff";
76
+ const oldText = normalizeString(diff.oldText);
77
+ const newText = normalizeString(diff.newText);
78
+ return (_jsx(BlockShell, { icon: FileCodeIcon, title: "Diff", subtitle: path, children: oldText || newText ? (_jsxs("div", { className: "grid min-w-0 gap-2 md:grid-cols-2", children: [_jsx(CodePane, { label: "Before", value: oldText, className: "bg-red-500/5" }), _jsx(CodePane, { label: "After", value: newText, className: "bg-green-500/5" })] })) : (_jsx(CodePane, { label: "Raw", value: formatUnknown(diff) })) }));
79
+ }
80
+ function TerminalBlock({ terminal }) {
81
+ const terminalId = normalizeString(terminal.terminalId) || "terminal";
82
+ const output = normalizeString(terminal.output) ||
83
+ normalizeString(terminal.stdout) ||
84
+ normalizeString(terminal.stderr) ||
85
+ normalizeString(terminal.text);
86
+ return (_jsx(BlockShell, { icon: TerminalIcon, title: "Terminal", subtitle: terminalId, children: _jsx(CodePane, { label: "Output", value: output || formatUnknown(terminal) }) }));
87
+ }
88
+ function getResourceUri(resource) {
89
+ const nested = isRecord(resource.resource) ? resource.resource : {};
90
+ return (normalizeString(resource.uri) ||
91
+ normalizeString(nested.uri) ||
92
+ normalizeString(resource.name));
93
+ }
94
+ function getResourceText(resource) {
95
+ const nested = isRecord(resource.resource) ? resource.resource : {};
96
+ return normalizeString(resource.text) || normalizeString(nested.text);
97
+ }
98
+ function ResourceBlock({ resource, kind, }) {
99
+ const uri = getResourceUri(resource);
100
+ const title = normalizeString(resource.title) ||
101
+ normalizeString(resource.name) ||
102
+ (kind === "resource" ? "Resource" : "Resource link");
103
+ const mimeType = normalizeString(resource.mimeType) ||
104
+ (isRecord(resource.resource)
105
+ ? normalizeString(resource.resource.mimeType)
106
+ : "");
107
+ const text = kind === "resource" ? getResourceText(resource) : "";
108
+ return (_jsx(BlockShell, { icon: kind === "resource" ? FileTextIcon : LinkIcon, title: title, subtitle: uri, children: _jsxs("div", { className: "flex flex-col gap-2 text-xs", children: [mimeType ? _jsx("p", { className: "text-muted-foreground", children: mimeType }) : null, uri ? (_jsx("code", { className: "rounded-sm bg-background px-2 py-1 font-mono text-[11px] break-all", children: uri })) : null, text ? _jsx(CodePane, { label: "Preview", value: text }) : null, !uri && !text ? (_jsx(CodePane, { label: "Raw", value: formatUnknown(resource) })) : null] }) }));
109
+ }
110
+ function UnknownBlock({ item }) {
111
+ return (_jsx(BlockShell, { icon: FileTextIcon, title: "ACP block", subtitle: "unknown", children: _jsx(CodePane, { label: "Raw", value: formatUnknown(item) }) }));
112
+ }
113
+ export function AcpToolContentBlocks({ toolCallId, className, }) {
114
+ const custom = useAuiState((state) => { var _a; return (_a = state.message.metadata) === null || _a === void 0 ? void 0 : _a.custom; });
115
+ const group = useMemo(() => toolCallId
116
+ ? getAcpToolContentGroup(custom, toolCallId)
117
+ : {
118
+ diffs: [],
119
+ terminals: [],
120
+ resources: [],
121
+ resourceLinks: [],
122
+ unknown: [],
123
+ }, [custom, toolCallId]);
124
+ if (!toolCallId || !hasContent(group))
125
+ return null;
126
+ return (_jsxs("div", { className: cn("flex flex-col gap-2 px-4", className), children: [group.diffs.map((diff) => (_jsx(DiffView, { diff: diff }, `diff-${formatUnknown(diff)}`))), group.terminals.map((terminal) => (_jsx(TerminalBlock, { terminal: terminal }, `terminal-${formatUnknown(terminal)}`))), group.resources.map((resource) => (_jsx(ResourceBlock, { resource: resource, kind: "resource" }, `resource-${formatUnknown(resource)}`))), group.resourceLinks.map((resource) => (_jsx(ResourceBlock, { resource: resource, kind: "resource_link" }, `resource-link-${formatUnknown(resource)}`))), group.unknown.map((item) => (_jsx(UnknownBlock, { item: item }, `unknown-${formatUnknown(item)}`)))] }));
127
+ }
@@ -0,0 +1,4 @@
1
+ import type { PropsWithChildren } from "react";
2
+ export declare function ThreadAddonProvider({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
3
+ export declare function ThreadAddonToolbar(): import("react/jsx-runtime").JSX.Element | null;
4
+ export declare function ThreadAddonHost({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;