@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,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AuiIf, ThreadListItemMorePrimitive, ThreadListItemPrimitive, ThreadListPrimitive, } from "@assistant-ui/react";
|
|
3
|
+
import { ArchiveIcon, MoreHorizontalIcon, PlusIcon, SettingsIcon, TrashIcon, } from "lucide-react";
|
|
4
|
+
import { ImageGenerationSettingsDialog } from "./image-generation-settings-dialog.mjs";
|
|
5
|
+
import { Button } from "../ui/button.mjs";
|
|
6
|
+
import { Skeleton } from "../ui/skeleton.mjs";
|
|
7
|
+
const THREAD_LIST_SKELETON_ITEMS = [
|
|
8
|
+
"thread-list-skeleton-1",
|
|
9
|
+
"thread-list-skeleton-2",
|
|
10
|
+
"thread-list-skeleton-3",
|
|
11
|
+
"thread-list-skeleton-4",
|
|
12
|
+
"thread-list-skeleton-5",
|
|
13
|
+
];
|
|
14
|
+
export const ThreadList = () => {
|
|
15
|
+
return (_jsxs(ThreadListPrimitive.Root, { className: "aui-root aui-thread-list-root flex w-full min-w-0 flex-col gap-1", children: [_jsx(ThreadListNew, {}), _jsx(AuiIf, { condition: (s) => s.threads.isLoading && s.threads.threadIds.length === 0, children: _jsx(ThreadListSkeleton, {}) }), _jsxs(AuiIf, { condition: (s) => !s.threads.isLoading || s.threads.threadIds.length > 0, children: [_jsx(ThreadListPrimitive.Items, { children: () => _jsx(ThreadListItem, {}) }), _jsx(AuiIf, { condition: (s) => s.threads.hasMore, children: _jsx(ThreadListLoadMore, {}) })] })] }));
|
|
16
|
+
};
|
|
17
|
+
const ThreadListNew = () => {
|
|
18
|
+
return (_jsxs("div", { className: "aui-thread-list-top-actions mb-2 flex flex-col gap-1", children: [_jsx(ImageGenerationSettingsDialog, { trigger: _jsxs(Button, { type: "button", variant: "ghost", className: "aui-thread-list-settings h-9 w-full min-w-0 justify-start gap-2 rounded-lg px-3 text-sm hover:bg-muted data-[state=open]:bg-muted", children: [_jsx(SettingsIcon, { className: "size-4" }), _jsx("span", { className: "truncate", children: "\u8BBE\u7F6E" })] }) }), _jsx(ThreadListPrimitive.New, { asChild: true, children: _jsxs(Button, { variant: "ghost", className: "aui-thread-list-new h-9 w-full min-w-0 justify-start gap-2 rounded-lg px-3 text-sm hover:bg-muted", children: [_jsx(PlusIcon, { className: "size-4" }), _jsx("span", { className: "truncate", children: "\u65B0\u5EFA\u5BF9\u8BDD" })] }) })] }));
|
|
19
|
+
};
|
|
20
|
+
const ThreadListSkeleton = () => {
|
|
21
|
+
return (_jsx("div", { className: "flex flex-col gap-1", children: THREAD_LIST_SKELETON_ITEMS.map((item) => (_jsx("div", { role: "status", "aria-label": "\u6B63\u5728\u52A0\u8F7D\u5BF9\u8BDD", className: "aui-thread-list-skeleton-wrapper flex h-9 items-center px-3", children: _jsx(Skeleton, { className: "aui-thread-list-skeleton h-4 w-full" }) }, item))) }));
|
|
22
|
+
};
|
|
23
|
+
const ThreadListLoadMore = () => {
|
|
24
|
+
return (_jsx(ThreadListPrimitive.LoadMore, { asChild: true, children: _jsxs(Button, { variant: "ghost", className: "aui-thread-list-load-more h-9 justify-center rounded-lg px-3 text-muted-foreground text-sm hover:bg-muted hover:text-foreground", children: [_jsx(AuiIf, { condition: (s) => !s.threads.isLoadingMore, children: "\u52A0\u8F7D\u66F4\u591A" }), _jsx(AuiIf, { condition: (s) => s.threads.isLoadingMore, children: "\u6B63\u5728\u52A0\u8F7D..." })] }) }));
|
|
25
|
+
};
|
|
26
|
+
const ThreadListItem = () => {
|
|
27
|
+
return (_jsxs(ThreadListItemPrimitive.Root, { className: "aui-thread-list-item group/thread-list-item flex h-9 w-full min-w-0 items-center rounded-lg transition-colors hover:bg-muted focus-visible:bg-muted focus-visible:outline-none data-active:bg-muted", children: [_jsx(ThreadListItemPrimitive.Trigger, { className: "aui-thread-list-item-trigger flex h-full min-w-0 flex-1 items-center px-3 text-start text-sm", children: _jsx("span", { className: "aui-thread-list-item-title min-w-0 flex-1 truncate", children: _jsx(ThreadListItemPrimitive.Title, { fallback: "\u65B0\u5BF9\u8BDD" }) }) }), _jsx(ThreadListItemMore, {})] }));
|
|
28
|
+
};
|
|
29
|
+
const ThreadListItemMore = () => {
|
|
30
|
+
return (_jsxs(ThreadListItemMorePrimitive.Root, { children: [_jsx(ThreadListItemMorePrimitive.Trigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "icon", className: "aui-thread-list-item-more me-0 h-7 w-0 overflow-hidden p-0 opacity-0 transition-[width,margin,opacity,background-color,color] group-hover/thread-list-item:me-2 group-hover/thread-list-item:w-7 group-hover/thread-list-item:opacity-100 group-focus-within/thread-list-item:me-2 group-focus-within/thread-list-item:w-7 group-focus-within/thread-list-item:opacity-100 data-[state=open]:me-2 data-[state=open]:w-7 data-[state=open]:bg-accent data-[state=open]:opacity-100", children: [_jsx(MoreHorizontalIcon, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "\u66F4\u591A\u9009\u9879" })] }) }), _jsxs(ThreadListItemMorePrimitive.Content, { side: "bottom", align: "start", className: "aui-thread-list-item-more-content z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md", children: [_jsx(ThreadListItemPrimitive.Archive, { asChild: true, children: _jsxs(ThreadListItemMorePrimitive.Item, { className: "aui-thread-list-item-more-item flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground", children: [_jsx(ArchiveIcon, { className: "size-4" }), "\u5F52\u6863"] }) }), _jsx(ThreadListItemPrimitive.Delete, { asChild: true, children: _jsxs(ThreadListItemMorePrimitive.Item, { className: "aui-thread-list-item-more-item flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-destructive text-sm outline-none hover:bg-destructive/10 hover:text-destructive focus:bg-destructive/10 focus:text-destructive", children: [_jsx(TrashIcon, { className: "size-4" }), "\u5220\u9664"] }) })] })] }));
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AssistantActionBar, AssistantMessage, BranchPicker, Composer, ComposerAction, type ComposerActionProps, type ComposerProps, ContextChips, EditComposer, MessageError, MessageList, Thread, ThreadEmptyState, ThreadHistoryEmpty, ThreadHistoryLoading, ThreadMessage, type ThreadProps, ThreadScrollToBottom, ThreadSuggestionItem, ThreadSuggestions, ThreadWelcome, UserActionBar, UserMessage, } from "./thread/index";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
export { AssistantActionBar, AssistantMessage, BranchPicker, Composer, ComposerAction, ContextChips, EditComposer, MessageError, MessageList, Thread, ThreadEmptyState, ThreadHistoryEmpty, ThreadHistoryLoading, ThreadMessage, ThreadScrollToBottom, ThreadSuggestionItem, ThreadSuggestions, ThreadWelcome, UserActionBar, UserMessage, } from "./thread/index.mjs";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import { Sidebar } from "../ui/sidebar";
|
|
3
|
+
export declare function ThreadListSidebar({ workspacePath, workspaceTitle, ...props }: React.ComponentProps<typeof Sidebar> & {
|
|
4
|
+
workspacePath?: string | null;
|
|
5
|
+
workspaceTitle?: string | null;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { FolderIcon } from "lucide-react";
|
|
14
|
+
import { ThreadList } from "./thread-list.mjs";
|
|
15
|
+
import { ThemeToggle } from "../theme-toggle.mjs";
|
|
16
|
+
import { ScrollArea } from "../ui/scroll-area.mjs";
|
|
17
|
+
import { Sidebar, SidebarContent, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarRail, } from "../ui/sidebar.mjs";
|
|
18
|
+
function getPathBasename(path) {
|
|
19
|
+
var _a;
|
|
20
|
+
const normalizedPath = path.replace(/\\/g, "/").replace(/\/+$/g, "");
|
|
21
|
+
if (!normalizedPath || normalizedPath === "/") {
|
|
22
|
+
return normalizedPath || "当前项目";
|
|
23
|
+
}
|
|
24
|
+
const parts = normalizedPath.split("/").filter(Boolean);
|
|
25
|
+
return (_a = parts[parts.length - 1]) !== null && _a !== void 0 ? _a : normalizedPath;
|
|
26
|
+
}
|
|
27
|
+
export function ThreadListSidebar(_a) {
|
|
28
|
+
var { workspacePath, workspaceTitle } = _a, props = __rest(_a, ["workspacePath", "workspaceTitle"]);
|
|
29
|
+
const projectPath = (workspacePath === null || workspacePath === void 0 ? void 0 : workspacePath.trim()) || "当前项目";
|
|
30
|
+
const projectTitle = (workspaceTitle === null || workspaceTitle === void 0 ? void 0 : workspaceTitle.trim()) || getPathBasename(projectPath);
|
|
31
|
+
return (_jsxs(Sidebar, Object.assign({}, props, { children: [_jsx(SidebarHeader, { className: "aui-sidebar-header mb-2 border-b", children: _jsxs("div", { className: "aui-sidebar-header-content flex items-center justify-between", children: [_jsx(SidebarMenu, { className: "min-w-0 flex-1", children: _jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { size: "lg", asChild: true, children: _jsxs("div", { children: [_jsx(FolderIcon, { className: "aui-sidebar-header-icon size-4" }), _jsxs("div", { className: "aui-sidebar-header-heading me-2 min-w-0 space-y-1 leading-none", children: [_jsx("span", { className: "aui-sidebar-header-title block min-w-0 truncate font-semibold", title: projectTitle, children: projectTitle }), _jsx("span", { className: "aui-sidebar-header-description block min-w-0 truncate text-sidebar-foreground/60 text-xs", title: projectPath, children: projectPath })] })] }) }) }) }), _jsx(ThemeToggle, {})] }) }), _jsx(SidebarContent, { className: "aui-sidebar-content overflow-hidden px-0", children: _jsx(ScrollArea, { className: "aui-thread-list-scroll-area min-h-0 flex-1", children: _jsx("div", { className: "aui-thread-list-scroll-content w-full min-w-0 px-2", children: _jsx(ThreadList, {}) }) }) }), _jsx(SidebarRail, {})] })));
|
|
32
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ToolCallMessagePartComponent, type ToolCallMessagePartStatus } from "@assistant-ui/react";
|
|
2
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../ui/collapsible";
|
|
3
|
+
export type ToolFallbackRootProps = Omit<React.ComponentProps<typeof Collapsible>, "open" | "onOpenChange"> & {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
onOpenChange?: (open: boolean) => void;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare function ToolFallbackRoot({ className, open: controlledOpen, onOpenChange: controlledOnOpenChange, defaultOpen, children, ...props }: ToolFallbackRootProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function ToolFallbackTrigger({ toolName, status, className, ...props }: React.ComponentProps<typeof CollapsibleTrigger> & {
|
|
10
|
+
toolName: string;
|
|
11
|
+
status?: ToolCallMessagePartStatus;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function ToolFallbackContent({ className, children, ...props }: React.ComponentProps<typeof CollapsibleContent>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function ToolFallbackArgs({ argsText, className, ...props }: React.ComponentProps<"div"> & {
|
|
15
|
+
argsText?: string;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
declare function ToolFallbackResult({ result, className, ...props }: React.ComponentProps<"div"> & {
|
|
18
|
+
result?: unknown;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
20
|
+
declare function ToolFallbackError({ status, className, ...props }: React.ComponentProps<"div"> & {
|
|
21
|
+
status?: ToolCallMessagePartStatus;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
23
|
+
declare const ToolFallback: ToolCallMessagePartComponent & {
|
|
24
|
+
Root: typeof ToolFallbackRoot;
|
|
25
|
+
Trigger: typeof ToolFallbackTrigger;
|
|
26
|
+
Content: typeof ToolFallbackContent;
|
|
27
|
+
Args: typeof ToolFallbackArgs;
|
|
28
|
+
Result: typeof ToolFallbackResult;
|
|
29
|
+
Error: typeof ToolFallbackError;
|
|
30
|
+
};
|
|
31
|
+
export { ToolFallback, ToolFallbackArgs, ToolFallbackContent, ToolFallbackError, ToolFallbackResult, ToolFallbackRoot, ToolFallbackTrigger, };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { useScrollLock, } from "@assistant-ui/react";
|
|
15
|
+
import { AlertCircleIcon, CheckIcon, ChevronDownIcon, LoaderIcon, XCircleIcon, } from "lucide-react";
|
|
16
|
+
import { memo, useCallback, useRef, useState } from "react";
|
|
17
|
+
import { AcpToolContentBlocks } from "./acp-tool-content.mjs";
|
|
18
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "../ui/collapsible.mjs";
|
|
19
|
+
import { cn } from "../../lib/utils.mjs";
|
|
20
|
+
const ANIMATION_DURATION = 200;
|
|
21
|
+
function ToolFallbackRoot(_a) {
|
|
22
|
+
var { className, open: controlledOpen, onOpenChange: controlledOnOpenChange, defaultOpen = false, children } = _a, props = __rest(_a, ["className", "open", "onOpenChange", "defaultOpen", "children"]);
|
|
23
|
+
const collapsibleRef = useRef(null);
|
|
24
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
25
|
+
const lockScroll = useScrollLock(collapsibleRef, ANIMATION_DURATION);
|
|
26
|
+
const isControlled = controlledOpen !== undefined;
|
|
27
|
+
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
28
|
+
const handleOpenChange = useCallback((open) => {
|
|
29
|
+
if (!open) {
|
|
30
|
+
lockScroll();
|
|
31
|
+
}
|
|
32
|
+
if (!isControlled) {
|
|
33
|
+
setUncontrolledOpen(open);
|
|
34
|
+
}
|
|
35
|
+
controlledOnOpenChange === null || controlledOnOpenChange === void 0 ? void 0 : controlledOnOpenChange(open);
|
|
36
|
+
}, [lockScroll, isControlled, controlledOnOpenChange]);
|
|
37
|
+
return (_jsx(Collapsible, Object.assign({ ref: collapsibleRef, "data-slot": "tool-fallback-root", open: isOpen, onOpenChange: handleOpenChange, className: cn("aui-tool-fallback-root group/tool-fallback-root my-2.5 w-full rounded-lg border py-3 first:mt-0 last:mb-0", className), style: {
|
|
38
|
+
"--animation-duration": `${ANIMATION_DURATION}ms`,
|
|
39
|
+
} }, props, { children: children })));
|
|
40
|
+
}
|
|
41
|
+
const statusIconMap = {
|
|
42
|
+
running: LoaderIcon,
|
|
43
|
+
complete: CheckIcon,
|
|
44
|
+
incomplete: XCircleIcon,
|
|
45
|
+
"requires-action": AlertCircleIcon,
|
|
46
|
+
};
|
|
47
|
+
function getEffectiveToolStatus(status, result) {
|
|
48
|
+
if ((status === null || status === void 0 ? void 0 : status.type) === "running" && result !== undefined) {
|
|
49
|
+
return { type: "complete" };
|
|
50
|
+
}
|
|
51
|
+
return status;
|
|
52
|
+
}
|
|
53
|
+
function ToolFallbackTrigger(_a) {
|
|
54
|
+
var _b;
|
|
55
|
+
var { toolName, status, className } = _a, props = __rest(_a, ["toolName", "status", "className"]);
|
|
56
|
+
const statusType = (_b = status === null || status === void 0 ? void 0 : status.type) !== null && _b !== void 0 ? _b : "complete";
|
|
57
|
+
const isRunning = statusType === "running";
|
|
58
|
+
const isCancelled = (status === null || status === void 0 ? void 0 : status.type) === "incomplete" && status.reason === "cancelled";
|
|
59
|
+
const Icon = statusIconMap[statusType];
|
|
60
|
+
const label = isCancelled ? "已取消工具" : "已使用工具";
|
|
61
|
+
const toolLabel = _jsx("b", { children: toolName });
|
|
62
|
+
return (_jsxs(CollapsibleTrigger, Object.assign({ "data-slot": "tool-fallback-trigger", "aria-label": `${label}: ${toolName}`, className: cn("aui-tool-fallback-trigger group/trigger flex w-full items-center gap-2 px-4 text-sm transition-colors", className) }, props, { children: [_jsx(Icon, { "data-slot": "tool-fallback-trigger-icon", className: cn("aui-tool-fallback-trigger-icon size-4 shrink-0", isCancelled && "text-muted-foreground", isRunning && "animate-spin") }), _jsxs("span", { "data-slot": "tool-fallback-trigger-label", className: cn("aui-tool-fallback-trigger-label-wrapper relative min-w-0 flex-1 text-start leading-snug", isCancelled && "text-muted-foreground line-through"), title: toolName, children: [_jsx("span", { className: "aui-tool-fallback-trigger-label line-clamp-2 break-words", children: toolLabel }), isRunning && (_jsx("span", { "aria-hidden": true, "data-slot": "tool-fallback-trigger-shimmer", className: "aui-tool-fallback-trigger-shimmer shimmer pointer-events-none absolute inset-0 line-clamp-2 break-words motion-reduce:animate-none", children: toolLabel }))] }), _jsx(ChevronDownIcon, { "data-slot": "tool-fallback-trigger-chevron", className: cn("aui-tool-fallback-trigger-chevron size-4 shrink-0", "transition-transform duration-(--animation-duration) ease-out", "group-data-[state=closed]/trigger:-rotate-90", "group-data-[state=open]/trigger:rotate-0") })] })));
|
|
63
|
+
}
|
|
64
|
+
function ToolFallbackContent(_a) {
|
|
65
|
+
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
66
|
+
return (_jsx(CollapsibleContent, Object.assign({ "data-slot": "tool-fallback-content", className: cn("aui-tool-fallback-content relative overflow-hidden text-sm outline-none", "group/collapsible-content ease-out", "data-[state=closed]:animate-collapsible-up", "data-[state=open]:animate-collapsible-down", "data-[state=closed]:fill-mode-forwards", "data-[state=closed]:pointer-events-none", "data-[state=open]:duration-(--animation-duration)", "data-[state=closed]:duration-(--animation-duration)", className) }, props, { children: _jsx("div", { className: "mt-3 flex flex-col gap-2 border-t pt-2", children: children }) })));
|
|
67
|
+
}
|
|
68
|
+
function ToolFallbackArgs(_a) {
|
|
69
|
+
var { argsText, className } = _a, props = __rest(_a, ["argsText", "className"]);
|
|
70
|
+
if (!argsText)
|
|
71
|
+
return null;
|
|
72
|
+
return (_jsx("div", Object.assign({ "data-slot": "tool-fallback-args", className: cn("aui-tool-fallback-args px-4", className) }, props, { children: _jsx("pre", { className: "aui-tool-fallback-args-value max-h-40 overflow-auto rounded-md bg-muted/30 px-3 py-2 font-mono text-xs leading-relaxed whitespace-pre-wrap break-words", children: argsText }) })));
|
|
73
|
+
}
|
|
74
|
+
function ToolFallbackResult(_a) {
|
|
75
|
+
var { result, className } = _a, props = __rest(_a, ["result", "className"]);
|
|
76
|
+
if (result === undefined)
|
|
77
|
+
return null;
|
|
78
|
+
return (_jsxs("div", Object.assign({ "data-slot": "tool-fallback-result", className: cn("aui-tool-fallback-result border-t border-dashed px-4 pt-2", className) }, props, { children: [_jsx("p", { className: "aui-tool-fallback-result-header font-semibold", children: "\u7ED3\u679C\uFF1A" }), _jsx("pre", { className: "aui-tool-fallback-result-content max-h-56 overflow-auto rounded-md bg-muted/30 px-3 py-2 font-mono text-xs leading-relaxed whitespace-pre-wrap break-words", children: result === null
|
|
79
|
+
? "无结构化结果"
|
|
80
|
+
: typeof result === "string"
|
|
81
|
+
? result
|
|
82
|
+
: JSON.stringify(result, null, 2) })] })));
|
|
83
|
+
}
|
|
84
|
+
function ToolFallbackError(_a) {
|
|
85
|
+
var { status, className } = _a, props = __rest(_a, ["status", "className"]);
|
|
86
|
+
if ((status === null || status === void 0 ? void 0 : status.type) !== "incomplete")
|
|
87
|
+
return null;
|
|
88
|
+
const error = status.error;
|
|
89
|
+
const errorText = error
|
|
90
|
+
? typeof error === "string"
|
|
91
|
+
? error
|
|
92
|
+
: JSON.stringify(error)
|
|
93
|
+
: null;
|
|
94
|
+
if (!errorText)
|
|
95
|
+
return null;
|
|
96
|
+
const isCancelled = status.reason === "cancelled";
|
|
97
|
+
const headerText = isCancelled ? "取消原因:" : "错误:";
|
|
98
|
+
return (_jsxs("div", Object.assign({ "data-slot": "tool-fallback-error", className: cn("aui-tool-fallback-error px-4", className) }, props, { children: [_jsx("p", { className: "aui-tool-fallback-error-header font-semibold text-muted-foreground", children: headerText }), _jsx("p", { className: "aui-tool-fallback-error-reason text-muted-foreground", children: errorText })] })));
|
|
99
|
+
}
|
|
100
|
+
const ToolFallbackImpl = ({ toolName, argsText, result, status, toolCallId, }) => {
|
|
101
|
+
const effectiveStatus = getEffectiveToolStatus(status, result);
|
|
102
|
+
const isCancelled = (effectiveStatus === null || effectiveStatus === void 0 ? void 0 : effectiveStatus.type) === "incomplete" &&
|
|
103
|
+
effectiveStatus.reason === "cancelled";
|
|
104
|
+
return (_jsxs(ToolFallbackRoot, { className: cn(isCancelled && "border-muted-foreground/30 bg-muted/30"), children: [_jsx(ToolFallbackTrigger, { toolName: toolName, status: effectiveStatus }), _jsxs(ToolFallbackContent, { children: [_jsx(ToolFallbackError, { status: effectiveStatus }), _jsx(ToolFallbackArgs, { argsText: argsText, className: cn(isCancelled && "opacity-60") }), _jsx(AcpToolContentBlocks, { toolCallId: toolCallId, className: cn(isCancelled && "opacity-60") }), !isCancelled && _jsx(ToolFallbackResult, { result: result })] })] }));
|
|
105
|
+
};
|
|
106
|
+
const ToolFallback = memo(ToolFallbackImpl);
|
|
107
|
+
ToolFallback.displayName = "ToolFallback";
|
|
108
|
+
ToolFallback.Root = ToolFallbackRoot;
|
|
109
|
+
ToolFallback.Trigger = ToolFallbackTrigger;
|
|
110
|
+
ToolFallback.Content = ToolFallbackContent;
|
|
111
|
+
ToolFallback.Args = ToolFallbackArgs;
|
|
112
|
+
ToolFallback.Result = ToolFallbackResult;
|
|
113
|
+
ToolFallback.Error = ToolFallbackError;
|
|
114
|
+
export { ToolFallback, ToolFallbackArgs, ToolFallbackContent, ToolFallbackError, ToolFallbackResult, ToolFallbackRoot, ToolFallbackTrigger, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
|
+
import { Button } from "../ui/button";
|
|
3
|
+
export type TooltipIconButtonProps = ComponentPropsWithRef<typeof Button> & {
|
|
4
|
+
tooltip: string;
|
|
5
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
6
|
+
};
|
|
7
|
+
export declare const TooltipIconButton: import("react").ForwardRefExoticComponent<Omit<TooltipIconButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { Slot } from "radix-ui";
|
|
15
|
+
import { forwardRef } from "react";
|
|
16
|
+
import { Button } from "../ui/button.mjs";
|
|
17
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "../ui/tooltip.mjs";
|
|
18
|
+
import { cn } from "../../lib/utils.mjs";
|
|
19
|
+
export const TooltipIconButton = forwardRef((_a, ref) => {
|
|
20
|
+
var { children, tooltip, side = "bottom", className } = _a, rest = __rest(_a, ["children", "tooltip", "side", "className"]);
|
|
21
|
+
return (_jsx(TooltipProvider, { delayDuration: 0, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs(Button, Object.assign({ variant: "ghost", size: "icon" }, rest, { className: cn("aui-button-icon size-6 p-1", className), ref: ref, children: [_jsx(Slot.Slottable, { children: children }), _jsx("span", { className: "aui-sr-only sr-only", children: tooltip })] })) }), _jsx(TooltipContent, { side: side, children: tooltip })] }) }));
|
|
22
|
+
});
|
|
23
|
+
TooltipIconButton.displayName = "TooltipIconButton";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function GitHubIcon({ className }) {
|
|
3
|
+
return (_jsx("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", className: className, fill: "currentColor", children: _jsx("path", { d: "M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" }) }));
|
|
4
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ThemeToggle(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { MoonIcon, SunIcon } from "lucide-react";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { TooltipIconButton } from "./assistant-ui/tooltip-icon-button.mjs";
|
|
6
|
+
const STORAGE_KEY = "acp-ui-theme";
|
|
7
|
+
function applyTheme(theme) {
|
|
8
|
+
document.documentElement.classList.toggle("dark", theme === "dark");
|
|
9
|
+
document.documentElement.style.colorScheme = theme;
|
|
10
|
+
}
|
|
11
|
+
export function ThemeToggle() {
|
|
12
|
+
const [theme, setTheme] = useState("light");
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const storedTheme = window.localStorage.getItem(STORAGE_KEY);
|
|
15
|
+
const initialTheme = storedTheme === "dark" ? "dark" : "light";
|
|
16
|
+
setTheme(initialTheme);
|
|
17
|
+
applyTheme(initialTheme);
|
|
18
|
+
}, []);
|
|
19
|
+
const nextTheme = theme === "dark" ? "light" : "dark";
|
|
20
|
+
const Icon = theme === "dark" ? SunIcon : MoonIcon;
|
|
21
|
+
return (_jsx(TooltipIconButton, { type: "button", tooltip: theme === "dark" ? "切换到浅色主题" : "切换到深色主题", "aria-label": theme === "dark" ? "切换到浅色主题" : "切换到深色主题", className: "size-8 text-muted-foreground hover:text-foreground", onClick: () => {
|
|
22
|
+
setTheme(nextTheme);
|
|
23
|
+
window.localStorage.setItem(STORAGE_KEY, nextTheme);
|
|
24
|
+
applyTheme(nextTheme);
|
|
25
|
+
}, children: _jsx(Icon, { className: "size-4" }) }));
|
|
26
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type OptionListOption = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
recommended?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type OptionListAction = {
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
variant?: "default" | "outline" | "ghost";
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type OptionListProps = {
|
|
17
|
+
id: string;
|
|
18
|
+
options: OptionListOption[];
|
|
19
|
+
selectionMode?: "single" | "multi";
|
|
20
|
+
value?: string | string[] | null;
|
|
21
|
+
defaultValue?: string | string[] | null;
|
|
22
|
+
choice?: string | string[] | null;
|
|
23
|
+
minSelections?: number;
|
|
24
|
+
maxSelections?: number;
|
|
25
|
+
actions?: OptionListAction[];
|
|
26
|
+
onChange?: (value: string | string[] | null) => void;
|
|
27
|
+
onAction?: (actionId: string, value: string | string[] | null) => void | Promise<void>;
|
|
28
|
+
onBeforeAction?: (actionId: string, value: string | string[] | null) => boolean | Promise<boolean>;
|
|
29
|
+
isActionDisabled?: (actionId: string, value: string | string[] | null) => boolean;
|
|
30
|
+
allowCustomInput?: boolean;
|
|
31
|
+
customInputLabel?: string;
|
|
32
|
+
className?: string;
|
|
33
|
+
};
|
|
34
|
+
export declare function OptionList({ id, options, selectionMode, value, defaultValue, choice, minSelections, maxSelections, actions, onChange, onAction, onBeforeAction, isActionDisabled, allowCustomInput, customInputLabel, className, }: OptionListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon } from "lucide-react";
|
|
4
|
+
import { useCallback, useMemo, useRef, useState, } from "react";
|
|
5
|
+
import { Button } from "../ui/button.mjs";
|
|
6
|
+
import { Input } from "../ui/input.mjs";
|
|
7
|
+
import { cn } from "../../lib/utils.mjs";
|
|
8
|
+
const CUSTOM_OPTION_ID = "__acp_ui_custom_input__";
|
|
9
|
+
function valueToArray(value) {
|
|
10
|
+
if (Array.isArray(value))
|
|
11
|
+
return value;
|
|
12
|
+
return value ? [value] : [];
|
|
13
|
+
}
|
|
14
|
+
function arrayToValue(value, selectionMode) {
|
|
15
|
+
var _a;
|
|
16
|
+
if (selectionMode === "multi")
|
|
17
|
+
return value;
|
|
18
|
+
return (_a = value[0]) !== null && _a !== void 0 ? _a : null;
|
|
19
|
+
}
|
|
20
|
+
export function OptionList({ id, options, selectionMode = "multi", value, defaultValue, choice, minSelections = 1, maxSelections, actions = [
|
|
21
|
+
{ id: "confirm", label: "确认" },
|
|
22
|
+
{ id: "cancel", label: "取消", variant: "outline" },
|
|
23
|
+
], onChange, onAction, onBeforeAction, isActionDisabled, allowCustomInput = false, customInputLabel = "自定义", className, }) {
|
|
24
|
+
const isControlled = value !== undefined;
|
|
25
|
+
const isReceipt = choice !== undefined;
|
|
26
|
+
const [internalValue, setInternalValue] = useState(valueToArray(defaultValue));
|
|
27
|
+
const [customText, setCustomText] = useState("");
|
|
28
|
+
const optionRefs = useRef([]);
|
|
29
|
+
const effectiveOptions = useMemo(() => {
|
|
30
|
+
if (!allowCustomInput || isReceipt)
|
|
31
|
+
return options;
|
|
32
|
+
return [
|
|
33
|
+
...options,
|
|
34
|
+
{
|
|
35
|
+
id: CUSTOM_OPTION_ID,
|
|
36
|
+
label: customInputLabel,
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
}, [allowCustomInput, customInputLabel, isReceipt, options]);
|
|
40
|
+
const selectedIds = useMemo(() => {
|
|
41
|
+
if (isReceipt)
|
|
42
|
+
return valueToArray(choice);
|
|
43
|
+
return isControlled ? valueToArray(value) : internalValue;
|
|
44
|
+
}, [choice, internalValue, isControlled, isReceipt, value]);
|
|
45
|
+
const selectedSet = useMemo(() => new Set(selectedIds), [selectedIds]);
|
|
46
|
+
const visibleOptions = isReceipt
|
|
47
|
+
? effectiveOptions.filter((option) => selectedSet.has(option.id))
|
|
48
|
+
: effectiveOptions;
|
|
49
|
+
const actionValue = useMemo(() => {
|
|
50
|
+
const normalizedCustomText = customText.trim();
|
|
51
|
+
const selectedWithoutCustom = selectedIds.filter((id) => id !== CUSTOM_OPTION_ID);
|
|
52
|
+
if (!selectedSet.has(CUSTOM_OPTION_ID) || !normalizedCustomText) {
|
|
53
|
+
return arrayToValue(selectedWithoutCustom, selectionMode);
|
|
54
|
+
}
|
|
55
|
+
if (selectionMode === "single")
|
|
56
|
+
return normalizedCustomText;
|
|
57
|
+
return [...selectedWithoutCustom, normalizedCustomText];
|
|
58
|
+
}, [customText, selectedIds, selectedSet, selectionMode]);
|
|
59
|
+
const effectiveSelectionCount = actionValue === null
|
|
60
|
+
? 0
|
|
61
|
+
: Array.isArray(actionValue)
|
|
62
|
+
? actionValue.length
|
|
63
|
+
: 1;
|
|
64
|
+
const isValidSelection = effectiveSelectionCount >= minSelections &&
|
|
65
|
+
(maxSelections === undefined || effectiveSelectionCount <= maxSelections);
|
|
66
|
+
const commitValue = useCallback((nextIds) => {
|
|
67
|
+
const nextValue = arrayToValue(nextIds, selectionMode);
|
|
68
|
+
if (!isControlled)
|
|
69
|
+
setInternalValue(nextIds);
|
|
70
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(nextValue);
|
|
71
|
+
}, [isControlled, onChange, selectionMode]);
|
|
72
|
+
const toggleOption = useCallback((option) => {
|
|
73
|
+
if (isReceipt || option.disabled)
|
|
74
|
+
return;
|
|
75
|
+
if (selectionMode === "single") {
|
|
76
|
+
commitValue(selectedSet.has(option.id) ? [] : [option.id]);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const nextIds = selectedSet.has(option.id)
|
|
80
|
+
? selectedIds.filter((id) => id !== option.id)
|
|
81
|
+
: [...selectedIds, option.id];
|
|
82
|
+
if (maxSelections !== undefined && nextIds.length > maxSelections) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
commitValue(nextIds);
|
|
86
|
+
}, [
|
|
87
|
+
commitValue,
|
|
88
|
+
isReceipt,
|
|
89
|
+
maxSelections,
|
|
90
|
+
selectedIds,
|
|
91
|
+
selectedSet,
|
|
92
|
+
selectionMode,
|
|
93
|
+
]);
|
|
94
|
+
const focusOption = useCallback((fromIndex, direction) => {
|
|
95
|
+
if (optionRefs.current.length === 0)
|
|
96
|
+
return;
|
|
97
|
+
let nextIndex = fromIndex;
|
|
98
|
+
for (let count = 0; count < optionRefs.current.length; count++) {
|
|
99
|
+
nextIndex =
|
|
100
|
+
(nextIndex + direction + optionRefs.current.length) %
|
|
101
|
+
optionRefs.current.length;
|
|
102
|
+
const option = optionRefs.current[nextIndex];
|
|
103
|
+
if (option && !option.disabled) {
|
|
104
|
+
option.focus();
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}, []);
|
|
109
|
+
const handleOptionKeyDown = useCallback((event, option) => {
|
|
110
|
+
var _a, _b, _c;
|
|
111
|
+
const index = Number((_a = event.currentTarget.dataset.index) !== null && _a !== void 0 ? _a : 0);
|
|
112
|
+
if (event.key === "ArrowDown" || event.key === "ArrowRight") {
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
focusOption(index, 1);
|
|
115
|
+
}
|
|
116
|
+
else if (event.key === "ArrowUp" || event.key === "ArrowLeft") {
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
focusOption(index, -1);
|
|
119
|
+
}
|
|
120
|
+
else if (event.key === "Home") {
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
(_b = optionRefs.current.find((element) => !(element === null || element === void 0 ? void 0 : element.disabled))) === null || _b === void 0 ? void 0 : _b.focus();
|
|
123
|
+
}
|
|
124
|
+
else if (event.key === "End") {
|
|
125
|
+
event.preventDefault();
|
|
126
|
+
(_c = optionRefs.current.findLast((element) => !(element === null || element === void 0 ? void 0 : element.disabled))) === null || _c === void 0 ? void 0 : _c.focus();
|
|
127
|
+
}
|
|
128
|
+
else if (event.key === "Enter" || event.key === " ") {
|
|
129
|
+
event.preventDefault();
|
|
130
|
+
toggleOption(option);
|
|
131
|
+
}
|
|
132
|
+
else if (event.key === "Escape") {
|
|
133
|
+
event.currentTarget.blur();
|
|
134
|
+
}
|
|
135
|
+
}, [focusOption, toggleOption]);
|
|
136
|
+
const handleAction = useCallback(async (action) => {
|
|
137
|
+
const allowed = await (onBeforeAction === null || onBeforeAction === void 0 ? void 0 : onBeforeAction(action.id, actionValue));
|
|
138
|
+
if (allowed === false)
|
|
139
|
+
return;
|
|
140
|
+
await (onAction === null || onAction === void 0 ? void 0 : onAction(action.id, actionValue));
|
|
141
|
+
}, [actionValue, onAction, onBeforeAction]);
|
|
142
|
+
const handleCustomTextChange = useCallback((event) => {
|
|
143
|
+
setCustomText(event.currentTarget.value);
|
|
144
|
+
}, []);
|
|
145
|
+
return (_jsxs("div", { "data-slot": "tool-ui-option-list", className: cn("my-2.5 w-full rounded-lg border bg-background p-3 shadow-xs", className), children: [_jsx("div", { id: id, role: "listbox", "aria-multiselectable": selectionMode === "multi" || undefined, className: "flex flex-col gap-1.5", children: visibleOptions.map((option, index) => {
|
|
146
|
+
const selected = selectedSet.has(option.id);
|
|
147
|
+
const hasDescription = Boolean(option.description);
|
|
148
|
+
return (_jsxs("button", { ref: (element) => {
|
|
149
|
+
optionRefs.current[index] = element;
|
|
150
|
+
}, type: "button", role: "option", "aria-selected": selected, "data-index": index, disabled: option.disabled || isReceipt, onClick: () => toggleOption(option), onKeyDown: (event) => handleOptionKeyDown(event, option), className: cn("flex min-h-11 w-full gap-2.5 rounded-md border px-3 py-2 text-left text-sm transition-colors", "focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:outline-none", selected
|
|
151
|
+
? "border-primary/40 bg-primary/8"
|
|
152
|
+
: "border-border bg-card hover:bg-muted/60", (option.disabled || isReceipt) &&
|
|
153
|
+
"cursor-default opacity-80 hover:bg-card", hasDescription ? "items-start" : "items-center"), children: [_jsx("span", { className: cn("flex size-4 shrink-0 items-center justify-center rounded-full border", selected
|
|
154
|
+
? "border-primary bg-primary text-primary-foreground"
|
|
155
|
+
: "border-muted-foreground/30 text-transparent", hasDescription && "mt-0.5"), children: _jsx(CheckIcon, { className: "size-3" }) }), option.icon && (_jsx("span", { className: cn("shrink-0 text-muted-foreground", hasDescription && "mt-0.5"), children: option.icon })), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block break-words font-medium leading-5", children: option.label }), option.description && (_jsx("span", { className: "mt-0.5 block break-words text-muted-foreground text-xs leading-5", children: option.description })), option.recommended && (_jsx("span", { className: "mt-1 inline-flex rounded-sm bg-primary/10 px-1.5 py-0.5 font-medium text-primary text-xs", children: "\u63A8\u8350" }))] })] }, option.id));
|
|
156
|
+
}) }), allowCustomInput && selectedSet.has(CUSTOM_OPTION_ID) && !isReceipt && (_jsx(Input, { className: "mt-2", placeholder: customInputLabel, value: customText, onChange: handleCustomTextChange })), !isReceipt && actions.length > 0 && (_jsx("div", { className: "mt-3 flex flex-wrap justify-end gap-2", children: actions.map((action) => {
|
|
157
|
+
var _a;
|
|
158
|
+
const selectedValue = arrayToValue(selectedIds, selectionMode);
|
|
159
|
+
return (_jsx(Button, { type: "button", size: "sm", variant: (_a = action.variant) !== null && _a !== void 0 ? _a : "default", disabled: action.disabled ||
|
|
160
|
+
(action.id === "confirm" && !isValidSelection) ||
|
|
161
|
+
(isActionDisabled === null || isActionDisabled === void 0 ? void 0 : isActionDisabled(action.id, selectedValue)), onClick: () => void handleAction(action), children: action.label }, action.id));
|
|
162
|
+
}) }))] }));
|
|
163
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Avatar as AvatarPrimitive } from "radix-ui";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare function Avatar({ className, size, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root> & {
|
|
4
|
+
size?: "default" | "sm" | "lg";
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function AvatarBadge({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function AvatarGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function AvatarGroupCount({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { Avatar as AvatarPrimitive } from "radix-ui";
|
|
15
|
+
import { cn } from "../../lib/utils.mjs";
|
|
16
|
+
function Avatar(_a) {
|
|
17
|
+
var { className, size = "default" } = _a, props = __rest(_a, ["className", "size"]);
|
|
18
|
+
return (_jsx(AvatarPrimitive.Root, Object.assign({ "data-slot": "avatar", "data-size": size, className: cn("group/avatar relative flex size-8 shrink-0 select-none overflow-hidden rounded-full data-[size=lg]:size-10 data-[size=sm]:size-6", className) }, props)));
|
|
19
|
+
}
|
|
20
|
+
function AvatarImage(_a) {
|
|
21
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
22
|
+
return (_jsx(AvatarPrimitive.Image, Object.assign({ "data-slot": "avatar-image", className: cn("aspect-square size-full", className) }, props)));
|
|
23
|
+
}
|
|
24
|
+
function AvatarFallback(_a) {
|
|
25
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
26
|
+
return (_jsx(AvatarPrimitive.Fallback, Object.assign({ "data-slot": "avatar-fallback", className: cn("flex size-full items-center justify-center rounded-full bg-muted text-muted-foreground text-sm group-data-[size=sm]/avatar:text-xs", className) }, props)));
|
|
27
|
+
}
|
|
28
|
+
function AvatarBadge(_a) {
|
|
29
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
30
|
+
return (_jsx("span", Object.assign({ "data-slot": "avatar-badge", className: cn("absolute right-0 bottom-0 z-10 inline-flex select-none items-center justify-center rounded-full bg-primary text-primary-foreground ring-2 ring-background", "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden", "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", className) }, props)));
|
|
31
|
+
}
|
|
32
|
+
function AvatarGroup(_a) {
|
|
33
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
34
|
+
return (_jsx("div", Object.assign({ "data-slot": "avatar-group", className: cn("group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background", className) }, props)));
|
|
35
|
+
}
|
|
36
|
+
function AvatarGroupCount(_a) {
|
|
37
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
38
|
+
return (_jsx("div", Object.assign({ "data-slot": "avatar-group-count", className: cn("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground text-sm ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", className) }, props)));
|
|
39
|
+
}
|
|
40
|
+
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
5
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { Button, buttonVariants };
|