@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.
- package/.next/BUILD_ID +1 -0
- package/.next/app-path-routes-manifest.json +21 -0
- package/.next/build-manifest.json +22 -0
- package/.next/export-marker.json +6 -0
- package/.next/fallback-build-manifest.json +13 -0
- package/.next/images-manifest.json +68 -0
- package/.next/next-minimal-server.js.nft.json +1 -0
- package/.next/next-server.js.nft.json +1 -0
- package/.next/package.json +1 -0
- package/.next/prerender-manifest.json +90 -0
- package/.next/required-server-files.js +336 -0
- package/.next/required-server-files.json +336 -0
- package/.next/routes-manifest.json +171 -0
- package/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
- package/.next/server/app/_global-error/page/build-manifest.json +18 -0
- package/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
- package/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
- package/.next/server/app/_global-error/page.js +10 -0
- package/.next/server/app/_global-error/page.js.nft.json +1 -0
- package/.next/server/app/_global-error/page_client-reference-manifest.js +3 -0
- package/.next/server/app/_global-error.html +1 -0
- package/.next/server/app/_global-error.meta +15 -0
- package/.next/server/app/_global-error.rsc +15 -0
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
- package/.next/server/app/_global-error.segments/_full.segment.rsc +15 -0
- package/.next/server/app/_global-error.segments/_head.segment.rsc +6 -0
- package/.next/server/app/_global-error.segments/_index.segment.rsc +5 -0
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
- package/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
- package/.next/server/app/_not-found/page/build-manifest.json +18 -0
- package/.next/server/app/_not-found/page/next-font-manifest.json +6 -0
- package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
- package/.next/server/app/_not-found/page.js +13 -0
- package/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/.next/server/app/_not-found/page_client-reference-manifest.js +3 -0
- package/.next/server/app/_not-found.html +1 -0
- package/.next/server/app/_not-found.meta +16 -0
- package/.next/server/app/_not-found.rsc +17 -0
- package/.next/server/app/_not-found.segments/_full.segment.rsc +17 -0
- package/.next/server/app/_not-found.segments/_head.segment.rsc +6 -0
- package/.next/server/app/_not-found.segments/_index.segment.rsc +6 -0
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +5 -0
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -0
- package/.next/server/app/api/acp/capabilities/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/acp/capabilities/route/build-manifest.json +9 -0
- package/.next/server/app/api/acp/capabilities/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/acp/capabilities/route.js +9 -0
- package/.next/server/app/api/acp/capabilities/route.js.nft.json +1 -0
- package/.next/server/app/api/acp/capabilities/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/acp/commands/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/acp/commands/route/build-manifest.json +9 -0
- package/.next/server/app/api/acp/commands/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/acp/commands/route.js +6 -0
- package/.next/server/app/api/acp/commands/route.js.nft.json +1 -0
- package/.next/server/app/api/acp/commands/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/acp/runtime/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/acp/runtime/route/build-manifest.json +9 -0
- package/.next/server/app/api/acp/runtime/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/acp/runtime/route.js +6 -0
- package/.next/server/app/api/acp/runtime/route.js.nft.json +1 -0
- package/.next/server/app/api/acp/runtime/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/chat/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/chat/route/build-manifest.json +9 -0
- package/.next/server/app/api/chat/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/chat/route.js +9 -0
- package/.next/server/app/api/chat/route.js.nft.json +1 -0
- package/.next/server/app/api/chat/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/conversations/[threadId]/messages/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/conversations/[threadId]/messages/route/build-manifest.json +9 -0
- package/.next/server/app/api/conversations/[threadId]/messages/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/conversations/[threadId]/messages/route.js +8 -0
- package/.next/server/app/api/conversations/[threadId]/messages/route.js.nft.json +1 -0
- package/.next/server/app/api/conversations/[threadId]/messages/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/conversations/[threadId]/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/conversations/[threadId]/route/build-manifest.json +9 -0
- package/.next/server/app/api/conversations/[threadId]/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/conversations/[threadId]/route.js +8 -0
- package/.next/server/app/api/conversations/[threadId]/route.js.nft.json +1 -0
- package/.next/server/app/api/conversations/[threadId]/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/conversations/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/conversations/route/build-manifest.json +9 -0
- package/.next/server/app/api/conversations/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/conversations/route.js +8 -0
- package/.next/server/app/api/conversations/route.js.nft.json +1 -0
- package/.next/server/app/api/conversations/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/local-files/image/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/local-files/image/route/build-manifest.json +9 -0
- package/.next/server/app/api/local-files/image/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/local-files/image/route.js +6 -0
- package/.next/server/app/api/local-files/image/route.js.nft.json +1 -0
- package/.next/server/app/api/local-files/image/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/local-files/open/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/local-files/open/route/build-manifest.json +9 -0
- package/.next/server/app/api/local-files/open/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/local-files/open/route.js +6 -0
- package/.next/server/app/api/local-files/open/route.js.nft.json +1 -0
- package/.next/server/app/api/local-files/open/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/output-artifacts/workspace/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/output-artifacts/workspace/route/build-manifest.json +9 -0
- package/.next/server/app/api/output-artifacts/workspace/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/output-artifacts/workspace/route.js +6 -0
- package/.next/server/app/api/output-artifacts/workspace/route.js.nft.json +1 -0
- package/.next/server/app/api/output-artifacts/workspace/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/tools/image-generation/files/[id]/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/tools/image-generation/files/[id]/route/build-manifest.json +9 -0
- package/.next/server/app/api/tools/image-generation/files/[id]/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/tools/image-generation/files/[id]/route.js +7 -0
- package/.next/server/app/api/tools/image-generation/files/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/tools/image-generation/files/[id]/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/tools/image-generation/records/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/tools/image-generation/records/route/build-manifest.json +9 -0
- package/.next/server/app/api/tools/image-generation/records/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/tools/image-generation/records/route.js +7 -0
- package/.next/server/app/api/tools/image-generation/records/route.js.nft.json +1 -0
- package/.next/server/app/api/tools/image-generation/records/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/tools/user-choice/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/tools/user-choice/route/build-manifest.json +9 -0
- package/.next/server/app/api/tools/user-choice/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/tools/user-choice/route.js +6 -0
- package/.next/server/app/api/tools/user-choice/route.js.nft.json +1 -0
- package/.next/server/app/api/tools/user-choice/route_client-reference-manifest.js +3 -0
- package/.next/server/app/favicon.ico/route/app-paths-manifest.json +3 -0
- package/.next/server/app/favicon.ico/route/build-manifest.json +9 -0
- package/.next/server/app/favicon.ico/route.js +7 -0
- package/.next/server/app/favicon.ico/route.js.nft.json +1 -0
- package/.next/server/app/favicon.ico.body +0 -0
- package/.next/server/app/favicon.ico.meta +1 -0
- package/.next/server/app/page/app-paths-manifest.json +3 -0
- package/.next/server/app/page/build-manifest.json +18 -0
- package/.next/server/app/page/next-font-manifest.json +6 -0
- package/.next/server/app/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/page/server-reference-manifest.json +4 -0
- package/.next/server/app/page.js +14 -0
- package/.next/server/app/page.js.nft.json +1 -0
- package/.next/server/app/page_client-reference-manifest.js +3 -0
- package/.next/server/app/session/[provider]/[sessionId]/page/app-paths-manifest.json +3 -0
- package/.next/server/app/session/[provider]/[sessionId]/page/build-manifest.json +18 -0
- package/.next/server/app/session/[provider]/[sessionId]/page/next-font-manifest.json +6 -0
- package/.next/server/app/session/[provider]/[sessionId]/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/session/[provider]/[sessionId]/page/server-reference-manifest.json +4 -0
- package/.next/server/app/session/[provider]/[sessionId]/page.js +16 -0
- package/.next/server/app/session/[provider]/[sessionId]/page.js.nft.json +1 -0
- package/.next/server/app/session/[provider]/[sessionId]/page_client-reference-manifest.js +3 -0
- package/.next/server/app/thread/[threadId]/page/app-paths-manifest.json +3 -0
- package/.next/server/app/thread/[threadId]/page/build-manifest.json +18 -0
- package/.next/server/app/thread/[threadId]/page/next-font-manifest.json +6 -0
- package/.next/server/app/thread/[threadId]/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/thread/[threadId]/page/server-reference-manifest.json +4 -0
- package/.next/server/app/thread/[threadId]/page.js +15 -0
- package/.next/server/app/thread/[threadId]/page.js.nft.json +1 -0
- package/.next/server/app/thread/[threadId]/page_client-reference-manifest.js +3 -0
- package/.next/server/app-paths-manifest.json +21 -0
- package/.next/server/chunks/0zjb_server_app_api_conversations_[threadId]_messages_route_actions_0poed25.js +3 -0
- package/.next/server/chunks/0zjb_server_app_api_tools_image-generation_files_[id]_route_actions_0-tbvpw.js +3 -0
- package/.next/server/chunks/0zjb_server_app_api_tools_image-generation_records_route_actions_0vu38s2.js +3 -0
- package/.next/server/chunks/[externals]_next_dist_0.m~pv6._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__04xq..~._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__07sxz4_._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0dwg3fr._.js +178 -0
- package/.next/server/chunks/[root-of-the-server]__0eanzwb._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0gqx~5k._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0iokgmz._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0j-lxr4._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ly6hop._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0nil~wi._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0tmhg7j._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0txmfnw._.js +4 -0
- package/.next/server/chunks/[root-of-the-server]__0wo0b8z._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0~mtsby._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__10-n4io._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__10g507v._.js +3 -0
- package/.next/server/chunks/[turbopack]_runtime.js +903 -0
- package/.next/server/chunks/_next-internal_server_app_api_acp_capabilities_route_actions_08lck.p.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_acp_commands_route_actions_0as.2z6.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_acp_runtime_route_actions_0o1ybkn.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_chat_route_actions_0tmcf6..js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_conversations_[threadId]_route_actions_12yq8z_.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_conversations_route_actions_131xv69.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_local-files_image_route_actions_0f~10mn.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_local-files_open_route_actions_026mg-2.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_output-artifacts_workspace_route_actions_1239-n7.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_tools_user-choice_route_actions_09xqbn_.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_favicon_ico_route_actions_095lj93.js +3 -0
- package/.next/server/chunks/instrumentation_ts_0zq9-xz._.js +3 -0
- package/.next/server/chunks/lib_conversations_store_ts_0gzcj38._.js +7 -0
- package/.next/server/chunks/node_modules_@vercel_oidc_dist_token_0zdeuds.js +3 -0
- package/.next/server/chunks/node_modules_next_00hve1e._.js +13 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__02qo-zr._.js +19 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0488vn3._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__08e5v4-._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__08iwq-u._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0a1m1mq._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0i9qg2.._.js +33 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0icm-_h._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0piffp7._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0xn-a8p._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0~c929r._.js +33 -0
- package/.next/server/chunks/ssr/[turbopack]_runtime.js +903 -0
- package/.next/server/chunks/ssr/_0-oaqqe._.js +6 -0
- package/.next/server/chunks/ssr/_006q235._.js +3 -0
- package/.next/server/chunks/ssr/_03.pm1z._.js +108 -0
- package/.next/server/chunks/ssr/_0txwi90._.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0k77kol.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0eq97pa.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_09-gtaw.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_session_[provider]_[sessionId]_page_actions_0_67qh_.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_thread_[threadId]_page_actions_11mcypo.js +3 -0
- package/.next/server/chunks/ssr/lib_conversations_store_ts_0-pd6d3._.js +4 -0
- package/.next/server/chunks/ssr/node_modules_09w7yel._.js +33 -0
- package/.next/server/chunks/ssr/node_modules_0tev5qq._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_@vercel_oidc_dist_token_0yj7kvj.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_09jzzl8._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_0h9llsw._.js +6 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_0t-hj0x._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0inhx6q._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0lgvd_..js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_00297nb.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_002l7yi.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_02suzhc.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_04x9gct.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0nsg22r.js +4 -0
- package/.next/server/chunks/tools_image-generation_service_mjs_0k_th7-._.js +3 -0
- package/.next/server/edge/chunks/_0e82_ds._.js +3 -0
- package/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_00ue99t.js +3 -0
- package/.next/server/functions-config-manifest.json +11 -0
- package/.next/server/instrumentation/middleware-manifest.json +12 -0
- package/.next/server/instrumentation.js +4 -0
- package/.next/server/instrumentation.js.nft.json +1 -0
- package/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/.next/server/middleware-build-manifest.js +22 -0
- package/.next/server/middleware-manifest.json +6 -0
- package/.next/server/next-font-manifest.js +1 -0
- package/.next/server/next-font-manifest.json +6 -0
- package/.next/server/pages/404.html +1 -0
- package/.next/server/pages/500.html +1 -0
- package/.next/server/pages-manifest.json +4 -0
- package/.next/server/prefetch-hints.json +1 -0
- package/.next/server/server-reference-manifest.js +1 -0
- package/.next/server/server-reference-manifest.json +5 -0
- package/.next/static/chunks/01xlw8hd842-c.js +1 -0
- package/.next/static/chunks/03edqrb4zdj~g.js +31 -0
- package/.next/static/chunks/03qq5fxc~pg00.js +1 -0
- package/.next/static/chunks/03~yq9q893hmn.js +1 -0
- package/.next/static/chunks/0l-_vd.~~z2bw.js +2 -0
- package/.next/static/chunks/0qid5lwcbx9s0.js +1 -0
- package/.next/static/chunks/0t.k8~x~sghva.js +4 -0
- package/.next/static/chunks/0tmpufzgpw2-w.js +1 -0
- package/.next/static/chunks/0v_ue~msygctw.js +1 -0
- package/.next/static/chunks/0y2l0xgouorae.css +1 -0
- package/.next/static/chunks/0zftsky7gte_9.js +102 -0
- package/.next/static/chunks/13nvdsh0e09d0.js +1 -0
- package/.next/static/chunks/1610ha42i.fl~.css +1 -0
- package/.next/static/chunks/turbopack-0mxz-ap91rcoe.js +1 -0
- package/.next/static/mbk_N5Gs4ZJg3lciRL6ya/_buildManifest.js +11 -0
- package/.next/static/mbk_N5Gs4ZJg3lciRL6ya/_clientMiddlewareManifest.js +1 -0
- package/.next/static/mbk_N5Gs4ZJg3lciRL6ya/_ssgManifest.js +1 -0
- package/.next/static/media/favicon.0x3dzn~oxb6tn.ico +0 -0
- package/README.md +113 -0
- package/THIRD_PARTY_NOTICES.md +34 -0
- package/bin/acp.mjs +224 -0
- package/dist/app/globals.css +146 -0
- package/dist/components/assistant-ui/acp-command-menu.d.ts +2 -0
- package/dist/components/assistant-ui/acp-command-menu.mjs +176 -0
- package/dist/components/assistant-ui/acp-elicitation-option-list.d.ts +3 -0
- package/dist/components/assistant-ui/acp-elicitation-option-list.mjs +157 -0
- package/dist/components/assistant-ui/acp-selectors.d.ts +2 -0
- package/dist/components/assistant-ui/acp-selectors.mjs +301 -0
- package/dist/components/assistant-ui/acp-tool-content.d.ts +4 -0
- package/dist/components/assistant-ui/acp-tool-content.mjs +127 -0
- package/dist/components/assistant-ui/addons/host.d.ts +4 -0
- package/dist/components/assistant-ui/addons/host.mjs +85 -0
- package/dist/components/assistant-ui/addons/image-generation-records-section.d.ts +14 -0
- package/dist/components/assistant-ui/addons/image-generation-records-section.mjs +116 -0
- package/dist/components/assistant-ui/addons/output-artifacts-section.d.ts +9 -0
- package/dist/components/assistant-ui/addons/output-artifacts-section.mjs +24 -0
- package/dist/components/assistant-ui/addons/output-artifacts.d.ts +14 -0
- package/dist/components/assistant-ui/addons/output-artifacts.mjs +87 -0
- package/dist/components/assistant-ui/addons/plan-addon.d.ts +2 -0
- package/dist/components/assistant-ui/addons/plan-addon.mjs +39 -0
- package/dist/components/assistant-ui/addons/plan-data.d.ts +5 -0
- package/dist/components/assistant-ui/addons/plan-data.mjs +97 -0
- package/dist/components/assistant-ui/addons/registry.d.ts +2 -0
- package/dist/components/assistant-ui/addons/registry.mjs +8 -0
- package/dist/components/assistant-ui/addons/types.d.ts +13 -0
- package/dist/components/assistant-ui/addons/types.mjs +1 -0
- package/dist/components/assistant-ui/attachment.d.ts +7 -0
- package/dist/components/assistant-ui/attachment.mjs +88 -0
- package/dist/components/assistant-ui/file.d.ts +37 -0
- package/dist/components/assistant-ui/file.mjs +107 -0
- package/dist/components/assistant-ui/image-generation-settings-dialog.d.ts +4 -0
- package/dist/components/assistant-ui/image-generation-settings-dialog.mjs +28 -0
- package/dist/components/assistant-ui/image.d.ts +51 -0
- package/dist/components/assistant-ui/image.mjs +215 -0
- package/dist/components/assistant-ui/markdown-text.d.ts +2 -0
- package/dist/components/assistant-ui/markdown-text.mjs +208 -0
- package/dist/components/assistant-ui/thread/composer.d.ts +27 -0
- package/dist/components/assistant-ui/thread/composer.mjs +15 -0
- package/dist/components/assistant-ui/thread/context-chips.d.ts +2 -0
- package/dist/components/assistant-ui/thread/context-chips.mjs +123 -0
- package/dist/components/assistant-ui/thread/empty-state.d.ts +9 -0
- package/dist/components/assistant-ui/thread/empty-state.mjs +24 -0
- package/dist/components/assistant-ui/thread/index.d.ts +11 -0
- package/dist/components/assistant-ui/thread/index.mjs +43 -0
- package/dist/components/assistant-ui/thread/message-list.d.ts +3 -0
- package/dist/components/assistant-ui/thread/message-list.mjs +16 -0
- package/dist/components/assistant-ui/thread/messages.d.ts +9 -0
- package/dist/components/assistant-ui/thread/messages.mjs +71 -0
- package/dist/components/assistant-ui/thread/scroll-to-bottom.d.ts +2 -0
- package/dist/components/assistant-ui/thread/scroll-to-bottom.mjs +8 -0
- package/dist/components/assistant-ui/thread-list.d.ts +2 -0
- package/dist/components/assistant-ui/thread-list.mjs +31 -0
- package/dist/components/assistant-ui/thread.d.ts +1 -0
- package/dist/components/assistant-ui/thread.mjs +2 -0
- package/dist/components/assistant-ui/threadlist-sidebar.d.ts +6 -0
- package/dist/components/assistant-ui/threadlist-sidebar.mjs +32 -0
- package/dist/components/assistant-ui/tool-fallback.d.ts +31 -0
- package/dist/components/assistant-ui/tool-fallback.mjs +114 -0
- package/dist/components/assistant-ui/tooltip-icon-button.d.ts +7 -0
- package/dist/components/assistant-ui/tooltip-icon-button.mjs +23 -0
- package/dist/components/icons/github.d.ts +3 -0
- package/dist/components/icons/github.mjs +4 -0
- package/dist/components/theme-toggle.d.ts +1 -0
- package/dist/components/theme-toggle.mjs +26 -0
- package/dist/components/tool-ui/option-list.d.ts +34 -0
- package/dist/components/tool-ui/option-list.mjs +163 -0
- package/dist/components/ui/avatar.d.ts +11 -0
- package/dist/components/ui/avatar.mjs +40 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/button.mjs +47 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/collapsible.mjs +27 -0
- package/dist/components/ui/dialog.d.ts +17 -0
- package/dist/components/ui/dialog.mjs +58 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/input.mjs +18 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.mjs +20 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/scroll-area.mjs +26 -0
- package/dist/components/ui/select.d.ts +13 -0
- package/dist/components/ui/select.mjs +59 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.mjs +20 -0
- package/dist/components/ui/sheet.d.ts +14 -0
- package/dist/components/ui/sheet.mjs +61 -0
- package/dist/components/ui/sidebar.d.ts +69 -0
- package/dist/components/ui/sidebar.mjs +245 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/skeleton.mjs +18 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/switch.mjs +20 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/tabs.mjs +32 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip.mjs +32 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.mjs +15 -0
- package/dist/lib/acp2aisdk/capabilities.d.ts +6 -0
- package/dist/lib/acp2aisdk/capabilities.mjs +210 -0
- package/dist/lib/acp2aisdk/capability-cache.d.ts +17 -0
- package/dist/lib/acp2aisdk/capability-cache.mjs +259 -0
- package/dist/lib/acp2aisdk/client-context.d.ts +38 -0
- package/dist/lib/acp2aisdk/client-context.mjs +247 -0
- package/dist/lib/acp2aisdk/commands.d.ts +11 -0
- package/dist/lib/acp2aisdk/commands.mjs +121 -0
- package/dist/lib/acp2aisdk/config-options.d.ts +3 -0
- package/dist/lib/acp2aisdk/config-options.mjs +86 -0
- package/dist/lib/acp2aisdk/context.d.ts +88 -0
- package/dist/lib/acp2aisdk/context.mjs +33 -0
- package/dist/lib/acp2aisdk/default-capabilities.d.ts +275 -0
- package/dist/lib/acp2aisdk/default-capabilities.mjs +421 -0
- package/dist/lib/acp2aisdk/elicitation.d.ts +37 -0
- package/dist/lib/acp2aisdk/elicitation.mjs +193 -0
- package/dist/lib/acp2aisdk/hitl.d.ts +25 -0
- package/dist/lib/acp2aisdk/hitl.mjs +134 -0
- package/dist/lib/acp2aisdk/index.d.ts +12 -0
- package/dist/lib/acp2aisdk/index.mjs +182 -0
- package/dist/lib/acp2aisdk/mcp-servers.d.ts +17 -0
- package/dist/lib/acp2aisdk/mcp-servers.mjs +153 -0
- package/dist/lib/acp2aisdk/model-selection.d.ts +16 -0
- package/dist/lib/acp2aisdk/model-selection.mjs +65 -0
- package/dist/lib/acp2aisdk/prompt-history.d.ts +9 -0
- package/dist/lib/acp2aisdk/prompt-history.mjs +168 -0
- package/dist/lib/acp2aisdk/provider-compat.d.ts +85 -0
- package/dist/lib/acp2aisdk/provider-compat.mjs +501 -0
- package/dist/lib/acp2aisdk/provider-registry.d.ts +15 -0
- package/dist/lib/acp2aisdk/provider-registry.mjs +196 -0
- package/dist/lib/acp2aisdk/response.d.ts +3 -0
- package/dist/lib/acp2aisdk/response.mjs +33 -0
- package/dist/lib/acp2aisdk/runtime-options.d.ts +2 -0
- package/dist/lib/acp2aisdk/runtime-options.mjs +10 -0
- package/dist/lib/acp2aisdk/session-runtime.d.ts +5 -0
- package/dist/lib/acp2aisdk/session-runtime.mjs +186 -0
- package/dist/lib/acp2aisdk/session-store.d.ts +31 -0
- package/dist/lib/acp2aisdk/session-store.mjs +169 -0
- package/dist/lib/acp2aisdk/skill-command-cache.d.ts +20 -0
- package/dist/lib/acp2aisdk/skill-command-cache.mjs +122 -0
- package/dist/lib/acp2aisdk/stream-metadata.d.ts +10 -0
- package/dist/lib/acp2aisdk/stream-metadata.mjs +251 -0
- package/dist/lib/acp2aisdk/types.d.ts +129 -0
- package/dist/lib/acp2aisdk/types.mjs +0 -0
- package/dist/lib/acp2aisdk/vendor/acp-ai-provider/index.d.ts +10 -0
- package/dist/lib/acp2aisdk/vendor/acp-ai-provider/index.mjs +10 -0
- package/dist/lib/acp2aisdk/vendor/acp-ai-provider/package/index.mjs +1945 -0
- package/dist/lib/api/client.d.ts +93 -0
- package/dist/lib/api/client.mjs +199 -0
- package/dist/lib/api/cors.d.ts +2 -0
- package/dist/lib/api/cors.mjs +47 -0
- package/dist/lib/conversations/client-adapter.d.ts +21 -0
- package/dist/lib/conversations/client-adapter.mjs +329 -0
- package/dist/lib/conversations/message-repository.d.ts +8 -0
- package/dist/lib/conversations/message-repository.mjs +87 -0
- package/dist/lib/conversations/store.d.ts +17 -0
- package/dist/lib/conversations/store.mjs +678 -0
- package/dist/lib/conversations/types.d.ts +92 -0
- package/dist/lib/conversations/types.mjs +0 -0
- package/dist/lib/local-image-files.d.ts +5 -0
- package/dist/lib/local-image-files.mjs +76 -0
- package/dist/lib/local-image-paths.d.ts +7 -0
- package/dist/lib/local-image-paths.mjs +106 -0
- package/dist/lib/output-artifacts/workspace.d.ts +8 -0
- package/dist/lib/output-artifacts/workspace.mjs +174 -0
- package/dist/lib/provider-history/codex.d.ts +4 -0
- package/dist/lib/provider-history/codex.mjs +272 -0
- package/dist/lib/provider-history/index.d.ts +7 -0
- package/dist/lib/provider-history/index.mjs +88 -0
- package/dist/lib/provider-history/types.d.ts +31 -0
- package/dist/lib/provider-history/types.mjs +0 -0
- package/dist/lib/server-runtime.d.ts +22 -0
- package/dist/lib/server-runtime.mjs +78 -0
- package/dist/lib/url-routing.d.ts +18 -0
- package/dist/lib/url-routing.mjs +59 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.mjs +5 -0
- package/dist/lib/workspace-metadata.d.ts +2 -0
- package/dist/lib/workspace-metadata.mjs +20 -0
- package/dist/public-api/react.d.ts +14 -0
- package/dist/public-api/react.mjs +16 -0
- package/dist/public-api/runtime.d.ts +8 -0
- package/dist/public-api/runtime.mjs +7 -0
- package/dist/public-api/server.d.ts +5 -0
- package/dist/public-api/server.mjs +4 -0
- package/dist/public-api/styles.css +1 -0
- package/dist/public-api/ui.d.ts +13 -0
- package/dist/public-api/ui.mjs +13 -0
- package/dist/tools/client-registry.d.ts +9 -0
- package/dist/tools/client-registry.mjs +70 -0
- package/dist/tools/image-generation/client.d.ts +18 -0
- package/dist/tools/image-generation/client.mjs +31 -0
- package/dist/tools/image-generation/config.d.ts +9 -0
- package/dist/tools/image-generation/config.example.json +14 -0
- package/dist/tools/image-generation/config.mjs +11 -0
- package/dist/tools/image-generation/mcp-server.mjs +87 -0
- package/dist/tools/image-generation/registry.d.ts +13 -0
- package/dist/tools/image-generation/registry.mjs +30 -0
- package/dist/tools/image-generation/server.d.ts +6 -0
- package/dist/tools/image-generation/server.mjs +58 -0
- package/dist/tools/image-generation/service.mjs +978 -0
- package/dist/tools/image-generation/shared.d.ts +103 -0
- package/dist/tools/image-generation/shared.mjs +80 -0
- package/dist/tools/image-generation/storage.d.ts +22 -0
- package/dist/tools/image-generation/storage.mjs +8 -0
- package/dist/tools/image-generation/ui-detail.d.ts +26 -0
- package/dist/tools/image-generation/ui-detail.mjs +109 -0
- package/dist/tools/image-generation/ui.d.ts +8 -0
- package/dist/tools/image-generation/ui.mjs +121 -0
- package/dist/tools/registry.d.ts +32 -0
- package/dist/tools/registry.mjs +142 -0
- package/dist/tools/ui-registry.d.ts +3 -0
- package/dist/tools/ui-registry.mjs +20 -0
- package/dist/tools/user-choice/client.d.ts +10 -0
- package/dist/tools/user-choice/client.mjs +18 -0
- package/dist/tools/user-choice/registry.d.ts +12 -0
- package/dist/tools/user-choice/registry.mjs +21 -0
- package/dist/tools/user-choice/server.d.ts +6 -0
- package/dist/tools/user-choice/server.mjs +42 -0
- package/dist/tools/user-choice/shared.d.ts +79 -0
- package/dist/tools/user-choice/shared.mjs +56 -0
- package/dist/tools/user-choice/store.d.ts +19 -0
- package/dist/tools/user-choice/store.mjs +95 -0
- package/dist/tools/user-choice/ui.d.ts +3 -0
- package/dist/tools/user-choice/ui.mjs +396 -0
- package/package.json +118 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export declare const IMAGE_GENERATION_TOOL_ID = "image-generation";
|
|
2
|
+
export declare const IMAGE_GENERATION_MCP_NAME = "acp-ui-image-generation";
|
|
3
|
+
export declare const IMAGE_GENERATION_TOOL_NAME = "generate_image";
|
|
4
|
+
export declare const IMAGE_GENERATION_MCP_TOOL_TITLE = "Tool: acp-ui-image-generation/generate_image";
|
|
5
|
+
export declare const ACP_PROVIDER_AGENT_DYNAMIC_TOOL_NAME = "acp.acp_provider_agent_dynamic_tool";
|
|
6
|
+
export type ImageGenerationSourceType = "path" | "url" | "data_url" | "base64";
|
|
7
|
+
export type ImageGenerationInputSource = {
|
|
8
|
+
type: ImageGenerationSourceType;
|
|
9
|
+
value: string;
|
|
10
|
+
mimeType?: string;
|
|
11
|
+
filename?: string;
|
|
12
|
+
};
|
|
13
|
+
export type ImageGenerationParams = {
|
|
14
|
+
model?: string;
|
|
15
|
+
size?: string;
|
|
16
|
+
quality?: string;
|
|
17
|
+
outputFormat?: "png" | "jpeg" | "webp";
|
|
18
|
+
background?: "auto" | "transparent" | "opaque";
|
|
19
|
+
};
|
|
20
|
+
export type ImageGenerationInput = ImageGenerationParams & {
|
|
21
|
+
prompt: string;
|
|
22
|
+
images?: ImageGenerationInputSource[];
|
|
23
|
+
savePath?: string;
|
|
24
|
+
};
|
|
25
|
+
export type ImageGenerationOutputImage = {
|
|
26
|
+
id: string;
|
|
27
|
+
fileName: string;
|
|
28
|
+
mimeType: string;
|
|
29
|
+
sizeBytes: number;
|
|
30
|
+
url: string;
|
|
31
|
+
savedPath?: string;
|
|
32
|
+
width?: number;
|
|
33
|
+
height?: number;
|
|
34
|
+
revisedPrompt?: string;
|
|
35
|
+
actualParams?: Partial<ImageGenerationParams>;
|
|
36
|
+
};
|
|
37
|
+
export type ImageGenerationConfig = {
|
|
38
|
+
provider: string;
|
|
39
|
+
baseUrl: string;
|
|
40
|
+
apiKey: string;
|
|
41
|
+
model: string;
|
|
42
|
+
outputDir: string;
|
|
43
|
+
savePathPattern?: string;
|
|
44
|
+
maxInputBytes: number;
|
|
45
|
+
maxOutputBytes: number;
|
|
46
|
+
downloadTimeoutMs: number;
|
|
47
|
+
requestTimeoutMs: number;
|
|
48
|
+
allowSavePath: boolean;
|
|
49
|
+
savePathBaseDir: string;
|
|
50
|
+
preservePrompt: boolean;
|
|
51
|
+
};
|
|
52
|
+
export type ImageGenerationRuntimeSettings = {
|
|
53
|
+
enabled?: boolean;
|
|
54
|
+
baseUrl?: string;
|
|
55
|
+
apiKey?: string;
|
|
56
|
+
model?: string;
|
|
57
|
+
savePathPattern?: string;
|
|
58
|
+
preservePrompt?: boolean;
|
|
59
|
+
};
|
|
60
|
+
export type ImageGenerationRecordSource = "mcp" | "api";
|
|
61
|
+
export type ImageGenerationRecord = {
|
|
62
|
+
id: string;
|
|
63
|
+
requestId: string;
|
|
64
|
+
threadId: string | null;
|
|
65
|
+
workspacePath: string;
|
|
66
|
+
source: ImageGenerationRecordSource;
|
|
67
|
+
status: "completed" | "failed";
|
|
68
|
+
provider: string;
|
|
69
|
+
prompt: string;
|
|
70
|
+
revisedPrompt?: string;
|
|
71
|
+
requestedParams: ImageGenerationParams;
|
|
72
|
+
actualParams: Partial<ImageGenerationParams>;
|
|
73
|
+
images: ImageGenerationOutputImage[];
|
|
74
|
+
durationMs: number;
|
|
75
|
+
error?: string;
|
|
76
|
+
createdAt: string;
|
|
77
|
+
updatedAt: string;
|
|
78
|
+
};
|
|
79
|
+
export type ImageGenerationOutput = {
|
|
80
|
+
status: "completed" | "failed";
|
|
81
|
+
recordId?: string;
|
|
82
|
+
requestId: string;
|
|
83
|
+
provider: string;
|
|
84
|
+
prompt: string;
|
|
85
|
+
revisedPrompt?: string;
|
|
86
|
+
requestedParams: ImageGenerationParams;
|
|
87
|
+
actualParams: Partial<ImageGenerationParams>;
|
|
88
|
+
images: ImageGenerationOutputImage[];
|
|
89
|
+
durationMs: number;
|
|
90
|
+
error?: string;
|
|
91
|
+
rawResponseSummary?: unknown;
|
|
92
|
+
};
|
|
93
|
+
export type AcpDynamicToolArgs = {
|
|
94
|
+
toolCallId?: string;
|
|
95
|
+
toolName?: string;
|
|
96
|
+
args?: unknown;
|
|
97
|
+
};
|
|
98
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
99
|
+
export declare function normalizeImageGenerationRuntimeSettings(value: unknown): ImageGenerationRuntimeSettings | null;
|
|
100
|
+
export declare function mergeImageGenerationRuntimeSettings(current: unknown, patch: unknown): ImageGenerationRuntimeSettings | null;
|
|
101
|
+
export declare function parseAcpDynamicToolArgs(value: unknown): AcpDynamicToolArgs | null;
|
|
102
|
+
export declare function isImageGenerationOutput(value: unknown): value is ImageGenerationOutput;
|
|
103
|
+
export declare function parseImageGenerationOutput(value: unknown): ImageGenerationOutput | null;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export const IMAGE_GENERATION_TOOL_ID = "image-generation";
|
|
2
|
+
export const IMAGE_GENERATION_MCP_NAME = "acp-ui-image-generation";
|
|
3
|
+
export const IMAGE_GENERATION_TOOL_NAME = "generate_image";
|
|
4
|
+
export const IMAGE_GENERATION_MCP_TOOL_TITLE = `Tool: ${IMAGE_GENERATION_MCP_NAME}/${IMAGE_GENERATION_TOOL_NAME}`;
|
|
5
|
+
export const ACP_PROVIDER_AGENT_DYNAMIC_TOOL_NAME = "acp.acp_provider_agent_dynamic_tool";
|
|
6
|
+
export function isRecord(value) {
|
|
7
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
8
|
+
}
|
|
9
|
+
function readStringValue(value) {
|
|
10
|
+
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
11
|
+
}
|
|
12
|
+
export function normalizeImageGenerationRuntimeSettings(value) {
|
|
13
|
+
var _a;
|
|
14
|
+
if (!isRecord(value))
|
|
15
|
+
return null;
|
|
16
|
+
const settings = {};
|
|
17
|
+
const baseUrl = (_a = readStringValue(value.baseUrl)) === null || _a === void 0 ? void 0 : _a.replace(/\/+$/u, "");
|
|
18
|
+
const apiKey = readStringValue(value.apiKey);
|
|
19
|
+
const model = readStringValue(value.model);
|
|
20
|
+
const savePathPattern = readStringValue(value.savePathPattern);
|
|
21
|
+
if (typeof value.enabled === "boolean")
|
|
22
|
+
settings.enabled = value.enabled;
|
|
23
|
+
if (baseUrl)
|
|
24
|
+
settings.baseUrl = baseUrl;
|
|
25
|
+
if (apiKey)
|
|
26
|
+
settings.apiKey = apiKey;
|
|
27
|
+
if (model)
|
|
28
|
+
settings.model = model;
|
|
29
|
+
if (savePathPattern)
|
|
30
|
+
settings.savePathPattern = savePathPattern;
|
|
31
|
+
if (typeof value.preservePrompt === "boolean") {
|
|
32
|
+
settings.preservePrompt = value.preservePrompt;
|
|
33
|
+
}
|
|
34
|
+
return Object.keys(settings).length > 0 ? settings : null;
|
|
35
|
+
}
|
|
36
|
+
export function mergeImageGenerationRuntimeSettings(current, patch) {
|
|
37
|
+
const normalizedCurrent = normalizeImageGenerationRuntimeSettings(current);
|
|
38
|
+
const normalizedPatch = normalizeImageGenerationRuntimeSettings(patch);
|
|
39
|
+
if (!normalizedCurrent)
|
|
40
|
+
return normalizedPatch;
|
|
41
|
+
if (!normalizedPatch)
|
|
42
|
+
return normalizedCurrent;
|
|
43
|
+
const merged = Object.assign(Object.assign({}, normalizedCurrent), normalizedPatch);
|
|
44
|
+
return merged;
|
|
45
|
+
}
|
|
46
|
+
export function parseAcpDynamicToolArgs(value) {
|
|
47
|
+
if (!isRecord(value))
|
|
48
|
+
return null;
|
|
49
|
+
const toolName = typeof value.toolName === "string" ? value.toolName : null;
|
|
50
|
+
if (!toolName)
|
|
51
|
+
return null;
|
|
52
|
+
return {
|
|
53
|
+
toolCallId: typeof value.toolCallId === "string" ? value.toolCallId : undefined,
|
|
54
|
+
toolName,
|
|
55
|
+
args: value.args,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export function isImageGenerationOutput(value) {
|
|
59
|
+
return (isRecord(value) &&
|
|
60
|
+
(value.status === "completed" || value.status === "failed") &&
|
|
61
|
+
typeof value.requestId === "string" &&
|
|
62
|
+
typeof value.prompt === "string" &&
|
|
63
|
+
Array.isArray(value.images));
|
|
64
|
+
}
|
|
65
|
+
export function parseImageGenerationOutput(value) {
|
|
66
|
+
if (isImageGenerationOutput(value))
|
|
67
|
+
return value;
|
|
68
|
+
if (isRecord(value) && isImageGenerationOutput(value.structuredContent)) {
|
|
69
|
+
return value.structuredContent;
|
|
70
|
+
}
|
|
71
|
+
if (typeof value === "string") {
|
|
72
|
+
try {
|
|
73
|
+
return parseImageGenerationOutput(JSON.parse(value));
|
|
74
|
+
}
|
|
75
|
+
catch (_a) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { saveGeneratedImage as saveGeneratedImageFromService } from "./service.mjs";
|
|
2
|
+
import type { ImageGenerationConfig, ImageGenerationOutputImage } from "./shared";
|
|
3
|
+
export type StoredImageMetadata = ImageGenerationOutputImage & {
|
|
4
|
+
createdAt: string;
|
|
5
|
+
absolutePath: string;
|
|
6
|
+
};
|
|
7
|
+
type SaveGeneratedImageOptions = {
|
|
8
|
+
config: ImageGenerationConfig;
|
|
9
|
+
data: Buffer;
|
|
10
|
+
mimeType: string;
|
|
11
|
+
revisedPrompt?: string;
|
|
12
|
+
actualParams?: Awaited<ReturnType<typeof saveGeneratedImageFromService>>["actualParams"];
|
|
13
|
+
width?: number;
|
|
14
|
+
height?: number;
|
|
15
|
+
workspacePath?: string | null;
|
|
16
|
+
savePath?: string | null;
|
|
17
|
+
};
|
|
18
|
+
export declare function saveGeneratedImage(options: SaveGeneratedImageOptions): Promise<ImageGenerationOutputImage>;
|
|
19
|
+
export declare function getStoredImage(configOrOptions: ImageGenerationConfig | {
|
|
20
|
+
workspacePath?: string | null;
|
|
21
|
+
}, id: string): Promise<StoredImageMetadata | null>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getStoredImage as getStoredImageFromService, saveGeneratedImage as saveGeneratedImageFromService, } from "./service.mjs";
|
|
2
|
+
export async function saveGeneratedImage(options) {
|
|
3
|
+
return saveGeneratedImageFromService(options);
|
|
4
|
+
}
|
|
5
|
+
export async function getStoredImage(configOrOptions, id) {
|
|
6
|
+
const workspacePath = "outputDir" in configOrOptions ? null : configOrOptions.workspacePath;
|
|
7
|
+
return getStoredImageFromService({ workspacePath }, id);
|
|
8
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
import type { ImageGenerationOutput, ImageGenerationOutputImage } from "./shared";
|
|
3
|
+
type ImageGenerationStatusMeta = {
|
|
4
|
+
label: string;
|
|
5
|
+
chip: string;
|
|
6
|
+
Icon: ComponentType<{
|
|
7
|
+
className?: string;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
type ImageGenerationDetailDialogProps = {
|
|
11
|
+
result: ImageGenerationOutput | null;
|
|
12
|
+
prompt: string;
|
|
13
|
+
image?: ImageGenerationOutputImage;
|
|
14
|
+
altText: string;
|
|
15
|
+
status: ImageGenerationStatusMeta;
|
|
16
|
+
statusDetail: string;
|
|
17
|
+
isRunning: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare function formatBytes(value?: number): string;
|
|
20
|
+
export declare function ToolImagePreview({ image, alt, compact, }: {
|
|
21
|
+
image?: ImageGenerationOutputImage;
|
|
22
|
+
alt: string;
|
|
23
|
+
compact?: boolean;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function ImageGenerationDetailDialog({ result, prompt, image, altText, status, statusDetail, isRunning, }: ImageGenerationDetailDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon, ChevronDownIcon, CopyIcon, DownloadIcon, ImageIcon, LoaderIcon, SlidersHorizontalIcon, XIcon, } from "lucide-react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { TooltipIconButton } from "../../components/assistant-ui/tooltip-icon-button.mjs";
|
|
6
|
+
import { Button } from "../../components/ui/button.mjs";
|
|
7
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "../../components/ui/collapsible.mjs";
|
|
8
|
+
import { DialogClose, DialogContent, DialogHeader, DialogTitle, } from "../../components/ui/dialog.mjs";
|
|
9
|
+
import { Separator } from "../../components/ui/separator.mjs";
|
|
10
|
+
import { cn } from "../../lib/utils.mjs";
|
|
11
|
+
const PARAM_LABELS = {
|
|
12
|
+
model: "模型",
|
|
13
|
+
size: "尺寸",
|
|
14
|
+
quality: "质量",
|
|
15
|
+
outputFormat: "格式",
|
|
16
|
+
background: "背景",
|
|
17
|
+
};
|
|
18
|
+
export function formatBytes(value) {
|
|
19
|
+
if (!value)
|
|
20
|
+
return "";
|
|
21
|
+
if (value < 1024)
|
|
22
|
+
return `${value} B`;
|
|
23
|
+
if (value < 1024 * 1024)
|
|
24
|
+
return `${(value / 1024).toFixed(1)} KB`;
|
|
25
|
+
return `${(value / (1024 * 1024)).toFixed(1)} MB`;
|
|
26
|
+
}
|
|
27
|
+
function stringify(value) {
|
|
28
|
+
if (typeof value === "string")
|
|
29
|
+
return value;
|
|
30
|
+
try {
|
|
31
|
+
return JSON.stringify(value, null, 2);
|
|
32
|
+
}
|
|
33
|
+
catch (_a) {
|
|
34
|
+
return String(value);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function copyText(value) {
|
|
38
|
+
if (!value || typeof navigator === "undefined" || !navigator.clipboard) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
navigator.clipboard.writeText(value).catch(() => { });
|
|
42
|
+
}
|
|
43
|
+
function getParamEntries(requested, actual) {
|
|
44
|
+
const keys = [
|
|
45
|
+
"model",
|
|
46
|
+
"size",
|
|
47
|
+
"quality",
|
|
48
|
+
"outputFormat",
|
|
49
|
+
"background",
|
|
50
|
+
];
|
|
51
|
+
return keys
|
|
52
|
+
.map((key) => {
|
|
53
|
+
const requestedValue = requested === null || requested === void 0 ? void 0 : requested[key];
|
|
54
|
+
const actualValue = actual === null || actual === void 0 ? void 0 : actual[key];
|
|
55
|
+
const value = actualValue !== null && actualValue !== void 0 ? actualValue : requestedValue;
|
|
56
|
+
return {
|
|
57
|
+
key,
|
|
58
|
+
label: PARAM_LABELS[key],
|
|
59
|
+
value,
|
|
60
|
+
requested: requestedValue,
|
|
61
|
+
actual: actualValue,
|
|
62
|
+
changed: requestedValue !== undefined &&
|
|
63
|
+
actualValue !== undefined &&
|
|
64
|
+
requestedValue !== actualValue,
|
|
65
|
+
};
|
|
66
|
+
})
|
|
67
|
+
.filter((entry) => entry.value !== undefined);
|
|
68
|
+
}
|
|
69
|
+
export function ToolImagePreview({ image, alt, compact, }) {
|
|
70
|
+
const [loaded, setLoaded] = useState(false);
|
|
71
|
+
if (!(image === null || image === void 0 ? void 0 : image.url)) {
|
|
72
|
+
return (_jsx("div", { className: cn("flex size-full items-center justify-center text-muted-foreground", !compact && "min-h-24"), children: _jsx(ImageIcon, { className: compact ? "size-5" : "size-8" }) }));
|
|
73
|
+
}
|
|
74
|
+
return (_jsxs("div", { className: "relative flex size-full items-center justify-center overflow-hidden", children: [!loaded && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-muted", children: _jsx(LoaderIcon, { className: "size-5 animate-spin text-muted-foreground" }) })), _jsx("img", { src: image.url, alt: alt, className: cn("block object-contain", compact ? "size-full object-cover" : "max-h-full max-w-full", !loaded && "invisible"), onLoad: () => setLoaded(true) })] }));
|
|
75
|
+
}
|
|
76
|
+
export function ImageGenerationDetailDialog({ result, prompt, image, altText, status, statusDetail, isRunning, }) {
|
|
77
|
+
const StatusIcon = status.Icon;
|
|
78
|
+
const revisedPrompt = (image === null || image === void 0 ? void 0 : image.revisedPrompt) || (result === null || result === void 0 ? void 0 : result.revisedPrompt);
|
|
79
|
+
return (_jsxs(DialogContent, { "data-image-generation-detail": true, className: "grid h-[min(88vh,900px)] max-h-[88vh] grid-rows-[auto_minmax(0,1fr)] gap-0 overflow-hidden p-0 sm:max-w-5xl", showCloseButton: false, children: [_jsx(DialogHeader, { className: "border-b px-5 py-4", children: _jsxs("div", { className: "flex min-h-9 items-center justify-between gap-4", children: [_jsx(DialogTitle, { className: "min-w-0 truncate", children: "\u56FE\u7247\u751F\u6210\u8BE6\u60C5" }), _jsxs("div", { className: "flex shrink-0 items-center gap-3", children: [_jsxs("span", { className: cn("inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border px-2 font-medium text-xs", status.chip), children: [_jsx(StatusIcon, { className: cn("size-3.5", isRunning && "animate-spin") }), status.label] }), _jsx(DialogClose, { asChild: true, children: _jsxs(Button, { type: "button", variant: "ghost", size: "icon-sm", className: "text-muted-foreground hover:text-foreground", children: [_jsx(XIcon, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "\u5173\u95ED" })] }) })] })] }) }), _jsxs("div", { className: "grid min-h-0 overflow-y-auto lg:grid-cols-[minmax(0,1.15fr)_minmax(320px,0.85fr)] lg:overflow-hidden", children: [_jsxs("div", { className: "min-w-0 border-b bg-muted/20 p-4 lg:border-r lg:border-b-0", children: [_jsx("div", { className: "flex h-[min(62vh,720px)] min-h-72 items-center justify-center overflow-hidden rounded-lg border bg-background", children: _jsx(ToolImagePreview, { image: image, alt: altText }) }), image && (_jsxs("div", { className: "mt-3 flex flex-wrap items-center justify-between gap-2 rounded-md border bg-background px-3 py-2", children: [_jsx("p", { className: "min-w-0 flex-1 truncate text-muted-foreground text-xs", children: image.fileName }), _jsx("div", { className: "flex items-center gap-1", children: _jsx(Button, { asChild: true, variant: "outline", size: "sm", className: "h-7 gap-1.5 px-2 text-xs", children: _jsxs("a", { href: image.url, download: image.fileName, children: [_jsx(DownloadIcon, { className: "size-3.5" }), "\u4E0B\u8F7D"] }) }) })] }))] }), _jsxs("div", { className: "min-h-0 min-w-0 space-y-4 p-5 lg:overflow-y-auto", children: [_jsx(PromptPanel, { prompt: prompt, revisedPrompt: revisedPrompt }), _jsx(ParamPanel, { requested: result === null || result === void 0 ? void 0 : result.requestedParams, actual: (image === null || image === void 0 ? void 0 : image.actualParams) || (result === null || result === void 0 ? void 0 : result.actualParams) }), _jsx(StatusPanel, { detail: statusDetail }), (result === null || result === void 0 ? void 0 : result.rawResponseSummary) !== undefined && (_jsx(RawPanel, { value: result.rawResponseSummary }))] })] })] }));
|
|
80
|
+
}
|
|
81
|
+
function PromptPanel({ prompt, revisedPrompt, }) {
|
|
82
|
+
const showRevised = Boolean(revisedPrompt === null || revisedPrompt === void 0 ? void 0 : revisedPrompt.trim()) && (revisedPrompt === null || revisedPrompt === void 0 ? void 0 : revisedPrompt.trim()) !== prompt.trim();
|
|
83
|
+
return (_jsxs("section", { className: "space-y-3", children: [_jsx(PromptBlock, { label: "\u63D0\u793A\u8BCD", value: prompt, primary: true }), showRevised && (_jsx(PromptBlock, { label: "API \u6539\u5199\u63D0\u793A\u8BCD", value: revisedPrompt }))] }));
|
|
84
|
+
}
|
|
85
|
+
function PromptBlock({ label, value, primary, }) {
|
|
86
|
+
const [copied, setCopied] = useState(false);
|
|
87
|
+
if (!value)
|
|
88
|
+
return null;
|
|
89
|
+
return (_jsxs("div", { className: "space-y-1.5", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("h3", { className: cn("font-medium text-sm", primary && "text-base"), children: label }), _jsx(TooltipIconButton, { tooltip: copied ? "已复制" : "复制", size: "icon-xs", className: "size-6", onClick: () => {
|
|
90
|
+
copyText(value);
|
|
91
|
+
setCopied(true);
|
|
92
|
+
window.setTimeout(() => setCopied(false), 1200);
|
|
93
|
+
}, children: copied ? _jsx(CheckIcon, {}) : _jsx(CopyIcon, {}) })] }), _jsx("pre", { className: cn("max-h-56 overflow-auto whitespace-pre-wrap break-words rounded-md border bg-muted/30 px-3 py-2 font-sans text-xs leading-relaxed", primary && "text-sm"), children: value })] }));
|
|
94
|
+
}
|
|
95
|
+
function ParamPanel({ requested, actual, }) {
|
|
96
|
+
const entries = getParamEntries(requested, actual);
|
|
97
|
+
if (entries.length === 0)
|
|
98
|
+
return null;
|
|
99
|
+
return (_jsxs("section", { className: "space-y-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(SlidersHorizontalIcon, { className: "size-4 text-muted-foreground" }), _jsx("h3", { className: "font-medium text-sm", children: "\u53C2\u6570" })] }), _jsx("div", { className: "flex flex-wrap gap-2", children: entries.map((entry) => (_jsxs("div", { className: "min-w-0 rounded-md border bg-background px-2.5 py-2 text-xs", children: [_jsx("p", { className: "text-muted-foreground", children: entry.label }), _jsx("p", { className: cn("mt-1 max-w-52 truncate font-medium", entry.changed && "text-amber-700 dark:text-amber-400"), children: entry.changed
|
|
100
|
+
? `${String(entry.requested)} -> ${String(entry.actual)}`
|
|
101
|
+
: String(entry.value) })] }, entry.key))) })] }));
|
|
102
|
+
}
|
|
103
|
+
function StatusPanel({ detail }) {
|
|
104
|
+
return (_jsxs("section", { className: "space-y-1.5", children: [_jsx("h3", { className: "font-medium text-sm", children: "\u4EFB\u52A1\u72B6\u6001" }), _jsx("p", { className: "rounded-md border bg-muted/30 px-3 py-2 text-muted-foreground text-sm", children: detail })] }));
|
|
105
|
+
}
|
|
106
|
+
function RawPanel({ value }) {
|
|
107
|
+
const raw = stringify(value);
|
|
108
|
+
return (_jsxs(Collapsible, { className: "rounded-md border", children: [_jsx(CollapsibleTrigger, { asChild: true, children: _jsxs(Button, { type: "button", variant: "ghost", className: "h-9 w-full justify-between rounded-md px-3", children: [_jsx("span", { children: "\u539F\u59CB\u54CD\u5E94\u6458\u8981" }), _jsx(ChevronDownIcon, { className: "size-4" })] }) }), _jsxs(CollapsibleContent, { children: [_jsx(Separator, {}), _jsx("div", { className: "flex items-center justify-end px-2 py-1", children: _jsx(TooltipIconButton, { tooltip: "\u590D\u5236", size: "icon-xs", className: "size-6", onClick: () => copyText(raw), children: _jsx(CopyIcon, {}) }) }), _jsx("pre", { className: "max-h-56 overflow-auto whitespace-pre-wrap break-words px-3 pb-3 font-mono text-[11px] text-muted-foreground", children: raw })] })] }));
|
|
109
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ToolCallMessagePartProps } from "@assistant-ui/react";
|
|
2
|
+
import { type ImageGenerationRecord } from "./shared";
|
|
3
|
+
export declare function isImageGenerationToolPart(part: ToolCallMessagePartProps): boolean;
|
|
4
|
+
export declare function ImageGenerationToolCard(part: ToolCallMessagePartProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function ImageGenerationRecordCard({ record, compact, }: {
|
|
6
|
+
record: ImageGenerationRecord;
|
|
7
|
+
compact?: boolean;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { AlertCircleIcon, CheckIcon, LoaderIcon } from "lucide-react";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { Dialog, DialogTrigger } from "../../components/ui/dialog.mjs";
|
|
6
|
+
import { cn } from "../../lib/utils.mjs";
|
|
7
|
+
import { ACP_PROVIDER_AGENT_DYNAMIC_TOOL_NAME, IMAGE_GENERATION_MCP_NAME, IMAGE_GENERATION_MCP_TOOL_TITLE, IMAGE_GENERATION_TOOL_NAME, isRecord, parseAcpDynamicToolArgs, parseImageGenerationOutput, } from "./shared.mjs";
|
|
8
|
+
import { formatBytes, ImageGenerationDetailDialog, ToolImagePreview, } from "./ui-detail.mjs";
|
|
9
|
+
function getPromptFromArgs(value) {
|
|
10
|
+
if (!isRecord(value))
|
|
11
|
+
return "";
|
|
12
|
+
if (typeof value.prompt === "string")
|
|
13
|
+
return value.prompt;
|
|
14
|
+
if (isRecord(value.arguments) && typeof value.arguments.prompt === "string") {
|
|
15
|
+
return value.arguments.prompt;
|
|
16
|
+
}
|
|
17
|
+
if (isRecord(value.args))
|
|
18
|
+
return getPromptFromArgs(value.args);
|
|
19
|
+
return "";
|
|
20
|
+
}
|
|
21
|
+
function getDynamicToolArgs(part) {
|
|
22
|
+
const dynamicArgs = parseAcpDynamicToolArgs(part.args);
|
|
23
|
+
return dynamicArgs === null || dynamicArgs === void 0 ? void 0 : dynamicArgs.args;
|
|
24
|
+
}
|
|
25
|
+
function isMcpImageGenerationToolArgs(value) {
|
|
26
|
+
return (isRecord(value) &&
|
|
27
|
+
value.server === IMAGE_GENERATION_MCP_NAME &&
|
|
28
|
+
value.tool === IMAGE_GENERATION_TOOL_NAME);
|
|
29
|
+
}
|
|
30
|
+
function getVisualStatus(part, result) {
|
|
31
|
+
var _a, _b, _c;
|
|
32
|
+
if (((_a = part.status) === null || _a === void 0 ? void 0 : _a.type) === "running" ||
|
|
33
|
+
((_b = part.status) === null || _b === void 0 ? void 0 : _b.type) === "requires-action") {
|
|
34
|
+
return "running";
|
|
35
|
+
}
|
|
36
|
+
if (part.isError || (result === null || result === void 0 ? void 0 : result.status) === "failed")
|
|
37
|
+
return "failed";
|
|
38
|
+
if (((_c = part.status) === null || _c === void 0 ? void 0 : _c.type) === "incomplete")
|
|
39
|
+
return "incomplete";
|
|
40
|
+
return "completed";
|
|
41
|
+
}
|
|
42
|
+
function getStatusMeta(status) {
|
|
43
|
+
switch (status) {
|
|
44
|
+
case "running":
|
|
45
|
+
return {
|
|
46
|
+
label: "生成中",
|
|
47
|
+
tone: "text-muted-foreground",
|
|
48
|
+
chip: "border-border bg-muted/60 text-muted-foreground",
|
|
49
|
+
Icon: LoaderIcon,
|
|
50
|
+
};
|
|
51
|
+
case "failed":
|
|
52
|
+
return {
|
|
53
|
+
label: "失败",
|
|
54
|
+
tone: "text-destructive",
|
|
55
|
+
chip: "border-destructive/30 bg-destructive/10 text-destructive",
|
|
56
|
+
Icon: AlertCircleIcon,
|
|
57
|
+
};
|
|
58
|
+
case "incomplete":
|
|
59
|
+
return {
|
|
60
|
+
label: "未完成",
|
|
61
|
+
tone: "text-muted-foreground",
|
|
62
|
+
chip: "border-border bg-muted/60 text-muted-foreground",
|
|
63
|
+
Icon: AlertCircleIcon,
|
|
64
|
+
};
|
|
65
|
+
default:
|
|
66
|
+
return {
|
|
67
|
+
label: "已完成",
|
|
68
|
+
tone: "text-emerald-700 dark:text-emerald-400",
|
|
69
|
+
chip: "border-emerald-500/25 bg-emerald-500/10 text-emerald-700 dark:text-emerald-400",
|
|
70
|
+
Icon: CheckIcon,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function getStatusDetail(part, result) {
|
|
75
|
+
var _a, _b, _c;
|
|
76
|
+
if (result === null || result === void 0 ? void 0 : result.error)
|
|
77
|
+
return result.error;
|
|
78
|
+
if (((_a = part.status) === null || _a === void 0 ? void 0 : _a.type) === "incomplete") {
|
|
79
|
+
return `工具调用未完成:${part.status.reason}`;
|
|
80
|
+
}
|
|
81
|
+
if (part.isError)
|
|
82
|
+
return "工具调用返回错误。";
|
|
83
|
+
if (((_b = part.status) === null || _b === void 0 ? void 0 : _b.type) === "running" ||
|
|
84
|
+
((_c = part.status) === null || _c === void 0 ? void 0 : _c.type) === "requires-action") {
|
|
85
|
+
return "正在等待图片服务返回结果。";
|
|
86
|
+
}
|
|
87
|
+
return "图片已生成并保存到本地工具存储。";
|
|
88
|
+
}
|
|
89
|
+
export function isImageGenerationToolPart(part) {
|
|
90
|
+
if (part.toolName === IMAGE_GENERATION_MCP_TOOL_TITLE)
|
|
91
|
+
return true;
|
|
92
|
+
const dynamicArgs = parseAcpDynamicToolArgs(part.args);
|
|
93
|
+
return (part.toolName === ACP_PROVIDER_AGENT_DYNAMIC_TOOL_NAME &&
|
|
94
|
+
((dynamicArgs === null || dynamicArgs === void 0 ? void 0 : dynamicArgs.toolName) === IMAGE_GENERATION_TOOL_NAME ||
|
|
95
|
+
(dynamicArgs === null || dynamicArgs === void 0 ? void 0 : dynamicArgs.toolName) === IMAGE_GENERATION_MCP_TOOL_TITLE ||
|
|
96
|
+
isMcpImageGenerationToolArgs(dynamicArgs === null || dynamicArgs === void 0 ? void 0 : dynamicArgs.args)));
|
|
97
|
+
}
|
|
98
|
+
function ImageGenerationOutputCard({ result, prompt, visualStatus, statusDetail, compact, }) {
|
|
99
|
+
const image = result === null || result === void 0 ? void 0 : result.images[0];
|
|
100
|
+
const status = getStatusMeta(visualStatus);
|
|
101
|
+
const StatusIcon = status.Icon;
|
|
102
|
+
const altText = (result === null || result === void 0 ? void 0 : result.revisedPrompt) || prompt || "Generated image";
|
|
103
|
+
const isRunning = visualStatus === "running";
|
|
104
|
+
return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsxs("button", { type: "button", "data-image-generation-card": true, "data-image-generation-card-trigger": true, className: cn("aui-tool-fallback-root group/image-generation-card my-2.5 w-full overflow-hidden rounded-lg border bg-background text-left text-sm transition-colors first:mt-0 last:mb-0 hover:bg-muted/30", compact && "my-0"), children: [_jsxs("div", { className: cn("grid w-full grid-cols-[112px_minmax(0,1fr)] gap-4 p-4 max-sm:grid-cols-[88px_minmax(0,1fr)] max-sm:gap-3", compact && "grid-cols-[72px_minmax(0,1fr)] gap-3 p-3"), children: [_jsx("div", { className: cn("relative aspect-square size-28 shrink-0 overflow-hidden rounded-md border bg-muted text-muted-foreground max-sm:size-22", compact && "size-18 max-sm:size-18"), children: _jsx(ToolImagePreview, { image: image, alt: altText, compact: true }) }), _jsxs("div", { className: cn("flex min-h-28 min-w-0 flex-col max-sm:min-h-22", compact && "min-h-18 max-sm:min-h-18"), children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx(StatusIcon, { className: cn("size-4 shrink-0", status.tone, isRunning && "animate-spin") }), _jsx("span", { className: "truncate font-medium", children: "\u56FE\u7247\u751F\u6210" })] }), _jsx("span", { className: cn("shrink-0 rounded-md border px-1.5 py-0.5 font-medium text-[11px]", status.chip), children: status.label })] }), _jsx("p", { className: cn("mt-2 line-clamp-2 text-muted-foreground leading-6 max-sm:text-xs", compact && "mt-1 leading-5"), children: prompt || "等待图片生成参数" }), _jsxs("div", { className: cn("mt-auto flex min-w-0 flex-wrap gap-1.5 pt-3 text-muted-foreground text-xs", compact && "pt-2"), children: [_jsx("span", { className: "rounded-md bg-muted px-1.5 py-0.5", children: "\u67E5\u770B\u8BE6\u60C5" }), !compact && (result === null || result === void 0 ? void 0 : result.actualParams.model) && (_jsx("span", { className: "rounded-md bg-muted px-1.5 py-0.5", children: result.actualParams.model })), (result === null || result === void 0 ? void 0 : result.actualParams.size) && (_jsx("span", { className: "rounded-md bg-muted px-1.5 py-0.5", children: result.actualParams.size })), (image === null || image === void 0 ? void 0 : image.sizeBytes) && (_jsx("span", { className: "rounded-md bg-muted px-1.5 py-0.5", children: formatBytes(image.sizeBytes) }))] })] })] }), visualStatus === "failed" && (_jsx("p", { className: "mx-4 mb-4 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-destructive text-xs", children: statusDetail }))] }) }), _jsx(ImageGenerationDetailDialog, { result: result, prompt: prompt, image: image, altText: altText, status: status, statusDetail: statusDetail, isRunning: isRunning })] }));
|
|
105
|
+
}
|
|
106
|
+
export function ImageGenerationToolCard(part) {
|
|
107
|
+
const toolArgs = part.toolName === IMAGE_GENERATION_MCP_TOOL_TITLE
|
|
108
|
+
? part.args
|
|
109
|
+
: getDynamicToolArgs(part);
|
|
110
|
+
const result = useMemo(() => parseImageGenerationOutput(part.result), [part.result]);
|
|
111
|
+
const prompt = (result === null || result === void 0 ? void 0 : result.prompt) || getPromptFromArgs(toolArgs);
|
|
112
|
+
const visualStatus = getVisualStatus(part, result);
|
|
113
|
+
return (_jsx(ImageGenerationOutputCard, { result: result, prompt: prompt, visualStatus: visualStatus, statusDetail: getStatusDetail(part, result) }));
|
|
114
|
+
}
|
|
115
|
+
export function ImageGenerationRecordCard({ record, compact, }) {
|
|
116
|
+
const result = Object.assign(Object.assign(Object.assign({ status: record.status, recordId: record.id, requestId: record.requestId || record.id, provider: record.provider, prompt: record.prompt }, (record.revisedPrompt ? { revisedPrompt: record.revisedPrompt } : {})), { requestedParams: record.requestedParams, actualParams: record.actualParams, images: record.images, durationMs: record.durationMs }), (record.error ? { error: record.error } : {}));
|
|
117
|
+
return (_jsx(ImageGenerationOutputCard, { result: result, prompt: record.prompt, visualStatus: record.status, statusDetail: record.error ||
|
|
118
|
+
(record.status === "failed"
|
|
119
|
+
? "图片生成失败。"
|
|
120
|
+
: "图片已生成并保存到本地工具存储。"), compact: compact }));
|
|
121
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { AcpBuiltinToolId, AcpMcpServer } from "../lib/acp2aisdk/types";
|
|
2
|
+
export type BuiltinToolRegistration = {
|
|
3
|
+
id: AcpBuiltinToolId;
|
|
4
|
+
getMcpServer(options: {
|
|
5
|
+
workspacePath?: string | null;
|
|
6
|
+
threadId?: string | null;
|
|
7
|
+
settings?: unknown;
|
|
8
|
+
}): AcpMcpServer | null;
|
|
9
|
+
getRuntimeKey(settings: unknown): unknown;
|
|
10
|
+
sanitizePersistedSettings(settings: unknown): unknown;
|
|
11
|
+
mergePersistedSettings(current: unknown, patch: unknown): unknown;
|
|
12
|
+
};
|
|
13
|
+
export declare function getBuiltinToolRegistrations(): BuiltinToolRegistration[];
|
|
14
|
+
export declare function getBuiltinToolRuntimeKey(options: {
|
|
15
|
+
toolIds?: readonly AcpBuiltinToolId[] | null;
|
|
16
|
+
builtinToolSettings?: Record<string, unknown> | null;
|
|
17
|
+
}): string;
|
|
18
|
+
export declare function sanitizePersistedBuiltinToolSettingsPatch(settings: unknown): Record<string, unknown> | null;
|
|
19
|
+
export declare function normalizePersistedBuiltinToolSettings(settings: unknown): Record<string, unknown> | null;
|
|
20
|
+
export declare function mergePersistedBuiltinToolSettings(current: unknown, patch: unknown): Record<string, unknown> | null;
|
|
21
|
+
export declare function getBuiltinToolMcpServers(options?: {
|
|
22
|
+
workspacePath?: string | null;
|
|
23
|
+
threadId?: string | null;
|
|
24
|
+
toolIds?: readonly AcpBuiltinToolId[] | null;
|
|
25
|
+
builtinToolSettings?: Record<string, unknown> | null;
|
|
26
|
+
}): AcpMcpServer[];
|
|
27
|
+
export declare function mergeToolMcpServers(requestedServers: AcpMcpServer[], options?: {
|
|
28
|
+
workspacePath?: string | null;
|
|
29
|
+
threadId?: string | null;
|
|
30
|
+
toolIds?: readonly AcpBuiltinToolId[] | null;
|
|
31
|
+
builtinToolSettings?: Record<string, unknown> | null;
|
|
32
|
+
}): AcpMcpServer[];
|