@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,501 @@
|
|
|
1
|
+
import { buildAcpCapabilitySnapshot } from "./capabilities.mjs";
|
|
2
|
+
import { ACP_ELICITATION_OPTION_LIST_TOOL_NAME, createElicitationOptionListPayload, findLatestElicitationOptionListToolOutput, normalizeElicitationOptionListToolResult, } from "./elicitation.mjs";
|
|
3
|
+
import { createElicitationFallbackResponse, createPermissionBypassResponse, } from "./hitl.mjs";
|
|
4
|
+
function isRecord(value) {
|
|
5
|
+
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
6
|
+
}
|
|
7
|
+
export function getAcpLanguageModelInternals(provider) {
|
|
8
|
+
const model = provider.model;
|
|
9
|
+
if (!isRecord(model))
|
|
10
|
+
return null;
|
|
11
|
+
return model;
|
|
12
|
+
}
|
|
13
|
+
function normalizeString(value) {
|
|
14
|
+
return typeof value === "string" ? value.trim() : "";
|
|
15
|
+
}
|
|
16
|
+
function hasStructuredToolContent(value) {
|
|
17
|
+
if (!isRecord(value))
|
|
18
|
+
return false;
|
|
19
|
+
if (value.type === "content")
|
|
20
|
+
return true;
|
|
21
|
+
if (value.type === "resource" || value.type === "resource_link")
|
|
22
|
+
return true;
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
function normalizeToolContentRawPart(item, toolCallId) {
|
|
26
|
+
if (item.type === "content" && isRecord(item.content)) {
|
|
27
|
+
return Object.assign(Object.assign({}, item.content), { type: item.content.type, toolCallId, wrapper: "content", raw: item });
|
|
28
|
+
}
|
|
29
|
+
return Object.assign(Object.assign({}, item), { toolCallId, raw: item });
|
|
30
|
+
}
|
|
31
|
+
function emitRawSessionUpdate(controller, update) {
|
|
32
|
+
controller.enqueue({
|
|
33
|
+
type: "raw",
|
|
34
|
+
rawValue: JSON.stringify(update),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function createEmptyUsage() {
|
|
38
|
+
return {
|
|
39
|
+
inputTokens: {
|
|
40
|
+
total: undefined,
|
|
41
|
+
noCache: undefined,
|
|
42
|
+
cacheRead: undefined,
|
|
43
|
+
cacheWrite: undefined,
|
|
44
|
+
},
|
|
45
|
+
outputTokens: {
|
|
46
|
+
total: undefined,
|
|
47
|
+
text: undefined,
|
|
48
|
+
reasoning: undefined,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function mapAcpStopReasonToAiSdk(stopReason) {
|
|
53
|
+
switch (stopReason) {
|
|
54
|
+
case "end_turn":
|
|
55
|
+
return "stop";
|
|
56
|
+
case "max_tokens":
|
|
57
|
+
case "max_turn_requests":
|
|
58
|
+
return "length";
|
|
59
|
+
default:
|
|
60
|
+
return "other";
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function createAcpProviderMetadata(response) {
|
|
64
|
+
try {
|
|
65
|
+
return { acp: JSON.parse(JSON.stringify(response)) };
|
|
66
|
+
}
|
|
67
|
+
catch (_a) {
|
|
68
|
+
return { acp: response };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function nextElicitationToolCallId(model) {
|
|
72
|
+
var _a;
|
|
73
|
+
const sequence = ((_a = model.__acpUiElicitationSequence) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
74
|
+
model.__acpUiElicitationSequence = sequence;
|
|
75
|
+
return `acp-elicitation-${sequence}`;
|
|
76
|
+
}
|
|
77
|
+
function safelyEnqueue(controller, part) {
|
|
78
|
+
try {
|
|
79
|
+
controller.enqueue(part);
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
catch (_a) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function safelyClose(controller) {
|
|
87
|
+
var _a;
|
|
88
|
+
try {
|
|
89
|
+
(_a = controller.close) === null || _a === void 0 ? void 0 : _a.call(controller);
|
|
90
|
+
}
|
|
91
|
+
catch (_b) {
|
|
92
|
+
// The stream may already be closed after an abort.
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function closeOpenTextBlocks(model, controller) {
|
|
96
|
+
if (model.currentTextId) {
|
|
97
|
+
safelyEnqueue(controller, {
|
|
98
|
+
type: "text-end",
|
|
99
|
+
id: model.currentTextId,
|
|
100
|
+
});
|
|
101
|
+
model.currentTextId = null;
|
|
102
|
+
}
|
|
103
|
+
if (model.currentThinkingId) {
|
|
104
|
+
safelyEnqueue(controller, {
|
|
105
|
+
type: "reasoning-end",
|
|
106
|
+
id: model.currentThinkingId,
|
|
107
|
+
});
|
|
108
|
+
model.currentThinkingId = null;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function readStreamPartId(part) {
|
|
112
|
+
return typeof part.id === "string" ? part.id : null;
|
|
113
|
+
}
|
|
114
|
+
function emitOpenTextBlockEnds(openTextIds, openThinkingIds, model, controller) {
|
|
115
|
+
for (const id of openTextIds) {
|
|
116
|
+
safelyEnqueue(controller, { type: "text-end", id });
|
|
117
|
+
}
|
|
118
|
+
for (const id of openThinkingIds) {
|
|
119
|
+
safelyEnqueue(controller, { type: "reasoning-end", id });
|
|
120
|
+
}
|
|
121
|
+
openTextIds.clear();
|
|
122
|
+
openThinkingIds.clear();
|
|
123
|
+
model.currentTextId = null;
|
|
124
|
+
model.currentThinkingId = null;
|
|
125
|
+
}
|
|
126
|
+
function createFinalizedStream(model, stream) {
|
|
127
|
+
const openTextIds = new Set();
|
|
128
|
+
const openThinkingIds = new Set();
|
|
129
|
+
return stream.pipeThrough(new TransformStream({
|
|
130
|
+
transform(part, controller) {
|
|
131
|
+
if (isRecord(part)) {
|
|
132
|
+
const partType = part.type;
|
|
133
|
+
const partId = readStreamPartId(part);
|
|
134
|
+
if (partType === "finish" ||
|
|
135
|
+
partType === "error" ||
|
|
136
|
+
partType === "tool-call" ||
|
|
137
|
+
partType === "tool-result" ||
|
|
138
|
+
partType === "tool-input-start") {
|
|
139
|
+
emitOpenTextBlockEnds(openTextIds, openThinkingIds, model, controller);
|
|
140
|
+
}
|
|
141
|
+
if (partType === "text-start" && partId) {
|
|
142
|
+
openTextIds.add(partId);
|
|
143
|
+
model.currentTextId = partId;
|
|
144
|
+
}
|
|
145
|
+
else if (partType === "text-end" && partId) {
|
|
146
|
+
if (!openTextIds.has(partId)) {
|
|
147
|
+
if (model.currentTextId === partId)
|
|
148
|
+
model.currentTextId = null;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
openTextIds.delete(partId);
|
|
152
|
+
if (model.currentTextId === partId)
|
|
153
|
+
model.currentTextId = null;
|
|
154
|
+
}
|
|
155
|
+
else if (partType === "reasoning-start" && partId) {
|
|
156
|
+
openThinkingIds.add(partId);
|
|
157
|
+
model.currentThinkingId = partId;
|
|
158
|
+
}
|
|
159
|
+
else if (partType === "reasoning-end" && partId) {
|
|
160
|
+
if (!openThinkingIds.has(partId)) {
|
|
161
|
+
if (model.currentThinkingId === partId) {
|
|
162
|
+
model.currentThinkingId = null;
|
|
163
|
+
}
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
openThinkingIds.delete(partId);
|
|
167
|
+
if (model.currentThinkingId === partId) {
|
|
168
|
+
model.currentThinkingId = null;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
controller.enqueue(part);
|
|
173
|
+
},
|
|
174
|
+
flush(controller) {
|
|
175
|
+
emitOpenTextBlockEnds(openTextIds, openThinkingIds, model, controller);
|
|
176
|
+
},
|
|
177
|
+
}));
|
|
178
|
+
}
|
|
179
|
+
function emitElicitationToolCall(model, payload) {
|
|
180
|
+
const clientToolAbort = model.clientToolAbort;
|
|
181
|
+
const controller = clientToolAbort === null || clientToolAbort === void 0 ? void 0 : clientToolAbort.controller;
|
|
182
|
+
if (!clientToolAbort || !controller)
|
|
183
|
+
return false;
|
|
184
|
+
closeOpenTextBlocks(model, controller);
|
|
185
|
+
if (!safelyEnqueue(controller, {
|
|
186
|
+
type: "tool-call",
|
|
187
|
+
toolCallId: payload.toolCallId,
|
|
188
|
+
toolName: ACP_ELICITATION_OPTION_LIST_TOOL_NAME,
|
|
189
|
+
input: JSON.stringify(payload),
|
|
190
|
+
})) {
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
safelyEnqueue(controller, {
|
|
194
|
+
type: "finish",
|
|
195
|
+
finishReason: {
|
|
196
|
+
unified: "tool-calls",
|
|
197
|
+
raw: undefined,
|
|
198
|
+
},
|
|
199
|
+
usage: createEmptyUsage(),
|
|
200
|
+
});
|
|
201
|
+
safelyClose(controller);
|
|
202
|
+
clientToolAbort.resolve();
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
function createElicitationContinuationStream(model, pending, response) {
|
|
206
|
+
const stream = new ReadableStream({
|
|
207
|
+
start: async (controller) => {
|
|
208
|
+
var _a, _b, _c, _d, _e, _f;
|
|
209
|
+
safelyEnqueue(controller, {
|
|
210
|
+
type: "stream-start",
|
|
211
|
+
warnings: [],
|
|
212
|
+
});
|
|
213
|
+
(_a = model.resetStreamState) === null || _a === void 0 ? void 0 : _a.call(model);
|
|
214
|
+
const streamHandler = (_b = model.handleStreamNotification) === null || _b === void 0 ? void 0 : _b.bind(model);
|
|
215
|
+
if (model.client && streamHandler) {
|
|
216
|
+
(_d = (_c = model.client).setSessionUpdateHandler) === null || _d === void 0 ? void 0 : _d.call(_c, (notification) => {
|
|
217
|
+
streamHandler(controller, notification);
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
const clientToolPromise = new Promise((resolve) => {
|
|
221
|
+
model.clientToolAbort = {
|
|
222
|
+
controller,
|
|
223
|
+
resolve: () => resolve("client-tool"),
|
|
224
|
+
};
|
|
225
|
+
});
|
|
226
|
+
try {
|
|
227
|
+
model.__acpUiPendingElicitation = null;
|
|
228
|
+
pending.resolve(response);
|
|
229
|
+
const result = await Promise.race([
|
|
230
|
+
pending.promptPromise.then((promptResponse) => ({
|
|
231
|
+
type: "response",
|
|
232
|
+
response: promptResponse,
|
|
233
|
+
})),
|
|
234
|
+
clientToolPromise.then((type) => ({ type })),
|
|
235
|
+
]);
|
|
236
|
+
if (result.type === "client-tool")
|
|
237
|
+
return;
|
|
238
|
+
const promptResponse = isRecord(result.response) ? result.response : {};
|
|
239
|
+
safelyEnqueue(controller, {
|
|
240
|
+
type: "finish",
|
|
241
|
+
finishReason: {
|
|
242
|
+
unified: mapAcpStopReasonToAiSdk(promptResponse.stopReason),
|
|
243
|
+
raw: promptResponse.stopReason,
|
|
244
|
+
},
|
|
245
|
+
providerMetadata: createAcpProviderMetadata(result.response),
|
|
246
|
+
usage: createEmptyUsage(),
|
|
247
|
+
});
|
|
248
|
+
safelyClose(controller);
|
|
249
|
+
(_e = model.cleanup) === null || _e === void 0 ? void 0 : _e.call(model);
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
model.__acpUiPendingElicitation = null;
|
|
253
|
+
(_f = model.cleanup) === null || _f === void 0 ? void 0 : _f.call(model);
|
|
254
|
+
safelyEnqueue(controller, { type: "error", error });
|
|
255
|
+
safelyClose(controller);
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
cancel: () => {
|
|
259
|
+
var _a;
|
|
260
|
+
(_a = model.cleanup) === null || _a === void 0 ? void 0 : _a.call(model);
|
|
261
|
+
},
|
|
262
|
+
});
|
|
263
|
+
return {
|
|
264
|
+
stream: createFinalizedStream(model, stream),
|
|
265
|
+
warnings: undefined,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
function patchStreamNotifications(model) {
|
|
269
|
+
var _a;
|
|
270
|
+
const originalHandleStreamNotification = (_a = model.handleStreamNotification) === null || _a === void 0 ? void 0 : _a.bind(model);
|
|
271
|
+
if (!originalHandleStreamNotification)
|
|
272
|
+
return;
|
|
273
|
+
model.handleStreamNotification = (controller, notification) => {
|
|
274
|
+
const update = isRecord(notification.update) ? notification.update : null;
|
|
275
|
+
const sessionUpdate = update === null || update === void 0 ? void 0 : update.sessionUpdate;
|
|
276
|
+
originalHandleStreamNotification(controller, notification);
|
|
277
|
+
if (!update)
|
|
278
|
+
return;
|
|
279
|
+
if (sessionUpdate === "plan_update" ||
|
|
280
|
+
sessionUpdate === "plan_removed" ||
|
|
281
|
+
sessionUpdate === "available_commands_update" ||
|
|
282
|
+
sessionUpdate === "current_mode_update" ||
|
|
283
|
+
sessionUpdate === "config_option_update" ||
|
|
284
|
+
sessionUpdate === "session_info_update" ||
|
|
285
|
+
sessionUpdate === "usage_update") {
|
|
286
|
+
emitRawSessionUpdate(controller, update);
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
if (sessionUpdate !== "tool_call_update")
|
|
290
|
+
return;
|
|
291
|
+
const toolCallId = normalizeString(update.toolCallId);
|
|
292
|
+
if (!toolCallId || !Array.isArray(update.content))
|
|
293
|
+
return;
|
|
294
|
+
for (const item of update.content) {
|
|
295
|
+
if (!hasStructuredToolContent(item))
|
|
296
|
+
continue;
|
|
297
|
+
emitRawSessionUpdate(controller, normalizeToolContentRawPart(item, toolCallId));
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
function installHitlFallbacks(model) {
|
|
302
|
+
var _a;
|
|
303
|
+
const client = model.client;
|
|
304
|
+
if (!client)
|
|
305
|
+
return;
|
|
306
|
+
(_a = client.setPermissionRequestHandler) === null || _a === void 0 ? void 0 : _a.call(client, async (request) => createPermissionBypassResponse(request));
|
|
307
|
+
client.unstable_createElicitation = async (request) => {
|
|
308
|
+
const promptPromise = model.__acpUiPromptPromise;
|
|
309
|
+
const payload = promptPromise
|
|
310
|
+
? createElicitationOptionListPayload(request, nextElicitationToolCallId(model))
|
|
311
|
+
: null;
|
|
312
|
+
if (!promptPromise || !payload || model.__acpUiPendingElicitation) {
|
|
313
|
+
return createElicitationFallbackResponse(request);
|
|
314
|
+
}
|
|
315
|
+
const toolCallId = payload.toolCallId;
|
|
316
|
+
let resolvePending;
|
|
317
|
+
let rejectPending;
|
|
318
|
+
const responsePromise = new Promise((resolve, reject) => {
|
|
319
|
+
resolvePending = resolve;
|
|
320
|
+
rejectPending = reject;
|
|
321
|
+
});
|
|
322
|
+
model.__acpUiPendingElicitation = {
|
|
323
|
+
toolCallId,
|
|
324
|
+
request,
|
|
325
|
+
promptPromise,
|
|
326
|
+
resolve: resolvePending,
|
|
327
|
+
reject: rejectPending,
|
|
328
|
+
};
|
|
329
|
+
if (!emitElicitationToolCall(model, payload)) {
|
|
330
|
+
model.__acpUiPendingElicitation = null;
|
|
331
|
+
return createElicitationFallbackResponse(request);
|
|
332
|
+
}
|
|
333
|
+
return responsePromise;
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
function patchPromptTracking(model) {
|
|
337
|
+
var _a;
|
|
338
|
+
const originalPromptWithLazyAuthRetry = (_a = model.promptWithLazyAuthRetry) === null || _a === void 0 ? void 0 : _a.bind(model);
|
|
339
|
+
if (!originalPromptWithLazyAuthRetry)
|
|
340
|
+
return;
|
|
341
|
+
if (model.__acpUiOriginalPromptWithLazyAuthRetry)
|
|
342
|
+
return;
|
|
343
|
+
model.__acpUiOriginalPromptWithLazyAuthRetry =
|
|
344
|
+
originalPromptWithLazyAuthRetry;
|
|
345
|
+
model.promptWithLazyAuthRetry = (request) => {
|
|
346
|
+
const promptPromise = originalPromptWithLazyAuthRetry(request);
|
|
347
|
+
model.__acpUiPromptPromise = promptPromise;
|
|
348
|
+
void promptPromise.finally(() => {
|
|
349
|
+
if (model.__acpUiPromptPromise === promptPromise) {
|
|
350
|
+
model.__acpUiPromptPromise = null;
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
return promptPromise;
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
function patchElicitationContinuation(model) {
|
|
357
|
+
var _a;
|
|
358
|
+
const originalDoStream = (_a = model.doStream) === null || _a === void 0 ? void 0 : _a.bind(model);
|
|
359
|
+
if (!originalDoStream)
|
|
360
|
+
return;
|
|
361
|
+
if (model.__acpUiOriginalDoStream)
|
|
362
|
+
return;
|
|
363
|
+
model.__acpUiOriginalDoStream = originalDoStream;
|
|
364
|
+
model.doStream = async (options) => {
|
|
365
|
+
const response = model.__acpUiResumeElicitationResponse;
|
|
366
|
+
const pending = model.__acpUiPendingElicitation;
|
|
367
|
+
if (response && pending) {
|
|
368
|
+
model.__acpUiResumeElicitationResponse = null;
|
|
369
|
+
return createElicitationContinuationStream(model, pending, response);
|
|
370
|
+
}
|
|
371
|
+
const result = await originalDoStream(options);
|
|
372
|
+
return Object.assign(Object.assign({}, result), { stream: createFinalizedStream(model, result.stream) });
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
function patchConnectClient(model) {
|
|
376
|
+
var _a;
|
|
377
|
+
const originalConnectClient = (_a = model.connectClient) === null || _a === void 0 ? void 0 : _a.bind(model);
|
|
378
|
+
if (!originalConnectClient)
|
|
379
|
+
return;
|
|
380
|
+
model.connectClient = async (...args) => {
|
|
381
|
+
const result = await originalConnectClient(...args);
|
|
382
|
+
installHitlFallbacks(model);
|
|
383
|
+
return result;
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
function patchResumeSession(model, metadata) {
|
|
387
|
+
var _a;
|
|
388
|
+
const originalStartSession = (_a = model.startSession) === null || _a === void 0 ? void 0 : _a.bind(model);
|
|
389
|
+
if (!originalStartSession)
|
|
390
|
+
return;
|
|
391
|
+
model.startSession = async (...args) => {
|
|
392
|
+
var _a, _b, _c, _d;
|
|
393
|
+
const existingSessionId = normalizeString((_a = model.config) === null || _a === void 0 ? void 0 : _a.existingSessionId);
|
|
394
|
+
const connection = model.connection;
|
|
395
|
+
const originalLoadSession = (_b = connection === null || connection === void 0 ? void 0 : connection.loadSession) === null || _b === void 0 ? void 0 : _b.bind(connection);
|
|
396
|
+
const additionalDirectories = Array.isArray((_d = (_c = model.config) === null || _c === void 0 ? void 0 : _c.session) === null || _d === void 0 ? void 0 : _d.additionalDirectories)
|
|
397
|
+
? model.config.session.additionalDirectories
|
|
398
|
+
: [];
|
|
399
|
+
if (existingSessionId && (connection === null || connection === void 0 ? void 0 : connection.resumeSession) && originalLoadSession) {
|
|
400
|
+
connection.loadSession = async (request) => {
|
|
401
|
+
var _a;
|
|
402
|
+
const lifecycleRequest = Object.assign(Object.assign({}, request), (additionalDirectories.length > 0
|
|
403
|
+
? { additionalDirectories }
|
|
404
|
+
: {}));
|
|
405
|
+
if (request.sessionId !== existingSessionId) {
|
|
406
|
+
return originalLoadSession(lifecycleRequest);
|
|
407
|
+
}
|
|
408
|
+
try {
|
|
409
|
+
const response = await ((_a = connection.resumeSession) === null || _a === void 0 ? void 0 : _a.call(connection, lifecycleRequest));
|
|
410
|
+
model.__acpUiResumeResponse = isRecord(response) ? response : {};
|
|
411
|
+
return response;
|
|
412
|
+
}
|
|
413
|
+
catch (error) {
|
|
414
|
+
metadata.warnings.push(`Failed to resume ACP session "${existingSessionId}" via session/resume; falling back to session/load: ${error instanceof Error ? error.message : String(error)}`);
|
|
415
|
+
model.__acpUiResumeResponse = null;
|
|
416
|
+
return originalLoadSession(lifecycleRequest);
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
try {
|
|
421
|
+
const result = await originalStartSession(...args);
|
|
422
|
+
if (existingSessionId &&
|
|
423
|
+
model.__acpUiResumeResponse &&
|
|
424
|
+
model.sessionId === existingSessionId) {
|
|
425
|
+
model.sessionResponse = Object.assign({ sessionId: existingSessionId }, model.__acpUiResumeResponse);
|
|
426
|
+
metadata.capabilitySnapshot = buildAcpCapabilitySnapshot({
|
|
427
|
+
provider: metadata.provider,
|
|
428
|
+
sessionResponse: model.sessionResponse,
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
return result;
|
|
432
|
+
}
|
|
433
|
+
finally {
|
|
434
|
+
if (connection && originalLoadSession) {
|
|
435
|
+
connection.loadSession = originalLoadSession;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
export function installAcpProviderCompatibility(provider, metadata) {
|
|
441
|
+
const model = getAcpLanguageModelInternals(provider);
|
|
442
|
+
if (!model || model.__acpUiCompatInstalled)
|
|
443
|
+
return;
|
|
444
|
+
model.__acpUiCompatInstalled = true;
|
|
445
|
+
patchPromptTracking(model);
|
|
446
|
+
patchElicitationContinuation(model);
|
|
447
|
+
patchConnectClient(model);
|
|
448
|
+
patchResumeSession(model, metadata);
|
|
449
|
+
patchStreamNotifications(model);
|
|
450
|
+
installHitlFallbacks(model);
|
|
451
|
+
}
|
|
452
|
+
function stageElicitationOutput(model, output) {
|
|
453
|
+
const pending = model.__acpUiPendingElicitation;
|
|
454
|
+
if (!pending) {
|
|
455
|
+
return {
|
|
456
|
+
status: "stale",
|
|
457
|
+
toolCallId: output.toolCallId,
|
|
458
|
+
reason: "No pending ACP elicitation is waiting for this result.",
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
if (pending.toolCallId !== output.toolCallId) {
|
|
462
|
+
return {
|
|
463
|
+
status: "stale",
|
|
464
|
+
toolCallId: output.toolCallId,
|
|
465
|
+
reason: `Pending ACP elicitation "${pending.toolCallId}" does not match result "${output.toolCallId}".`,
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
model.__acpUiResumeElicitationResponse =
|
|
469
|
+
normalizeElicitationOptionListToolResult(pending.request, output.result);
|
|
470
|
+
return { status: "staged", toolCallId: output.toolCallId };
|
|
471
|
+
}
|
|
472
|
+
export function stageAcpElicitationResultFromMessages(provider, messages) {
|
|
473
|
+
const output = findLatestElicitationOptionListToolOutput(messages);
|
|
474
|
+
if (!output)
|
|
475
|
+
return { status: "none" };
|
|
476
|
+
const model = getAcpLanguageModelInternals(provider);
|
|
477
|
+
if (!model) {
|
|
478
|
+
return {
|
|
479
|
+
status: "stale",
|
|
480
|
+
toolCallId: output.toolCallId,
|
|
481
|
+
reason: "ACP provider model is not initialized.",
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
return stageElicitationOutput(model, output);
|
|
485
|
+
}
|
|
486
|
+
export async function closeAcpProviderSession(provider, metadata) {
|
|
487
|
+
var _a;
|
|
488
|
+
const model = getAcpLanguageModelInternals(provider);
|
|
489
|
+
const connection = model === null || model === void 0 ? void 0 : model.connection;
|
|
490
|
+
const sessionId = normalizeString((_a = model === null || model === void 0 ? void 0 : model.sessionId) !== null && _a !== void 0 ? _a : provider.getSessionId());
|
|
491
|
+
if (!(connection === null || connection === void 0 ? void 0 : connection.closeSession) || !sessionId)
|
|
492
|
+
return false;
|
|
493
|
+
try {
|
|
494
|
+
await connection.closeSession({ sessionId });
|
|
495
|
+
return true;
|
|
496
|
+
}
|
|
497
|
+
catch (error) {
|
|
498
|
+
metadata === null || metadata === void 0 ? void 0 : metadata.warnings.push(`Failed to close ACP session "${sessionId}" via session/close: ${error instanceof Error ? error.message : String(error)}`);
|
|
499
|
+
return false;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AcpProviderKey, AcpProviderOverride, AcpProviderRegistryEntry } from "./types";
|
|
2
|
+
export declare const ACP_PROVIDER_KEYS: readonly ["claude", "codex", "gemini", "opencode"];
|
|
3
|
+
export declare const ACP_PROVIDER_DEFAULT_MODE_IDS: {
|
|
4
|
+
readonly claude: "bypassPermissions";
|
|
5
|
+
readonly codex: "full-access";
|
|
6
|
+
readonly gemini: "bypassPermissions";
|
|
7
|
+
readonly opencode: "build";
|
|
8
|
+
};
|
|
9
|
+
export declare const ACP_PROVIDER_ALIASES: Record<string, AcpProviderKey>;
|
|
10
|
+
export declare const ACP_PROVIDER_REGISTRY: Record<AcpProviderKey, AcpProviderRegistryEntry>;
|
|
11
|
+
export declare function isAcpProviderKey(value: string): value is AcpProviderKey;
|
|
12
|
+
export declare function normalizeAcpProvider(value?: string | null): AcpProviderKey;
|
|
13
|
+
export declare function getAcpProviderDefaultModeId(value?: string | null): string | null;
|
|
14
|
+
export declare function readProviderOverridesFromEnv(env?: Record<string, string | undefined>): Partial<Record<AcpProviderKey, AcpProviderOverride>>;
|
|
15
|
+
export declare function resolveAcpProviderConfig(providerInput?: string | null, overrides?: Partial<Record<AcpProviderKey, AcpProviderOverride>>): AcpProviderRegistryEntry;
|