@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,272 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
const PROVIDER = "codex";
|
|
5
|
+
const SOURCE_KIND = "codex-jsonl";
|
|
6
|
+
const UUID_RE = /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/;
|
|
7
|
+
const DISPLAY_ONLY_TAG_ROOTS = new Set([
|
|
8
|
+
"app-context",
|
|
9
|
+
"collaboration_mode",
|
|
10
|
+
"developer",
|
|
11
|
+
"environment_context",
|
|
12
|
+
"permissions instructions",
|
|
13
|
+
"plugins_instructions",
|
|
14
|
+
"skills_instructions",
|
|
15
|
+
"system",
|
|
16
|
+
]);
|
|
17
|
+
const FINAL_ASSISTANT_PHASE = "final_answer";
|
|
18
|
+
function getCodexSessionsRoot() {
|
|
19
|
+
if (process.env.ACP_UI_CODEX_SESSIONS_ROOT) {
|
|
20
|
+
return path.resolve(
|
|
21
|
+
/* turbopackIgnore: true */ process.env.ACP_UI_CODEX_SESSIONS_ROOT);
|
|
22
|
+
}
|
|
23
|
+
return path.join(os.homedir(), ".codex", "sessions");
|
|
24
|
+
}
|
|
25
|
+
function isRecord(value) {
|
|
26
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
27
|
+
}
|
|
28
|
+
function parseJsonLine(line) {
|
|
29
|
+
try {
|
|
30
|
+
const value = JSON.parse(line);
|
|
31
|
+
return isRecord(value) ? value : null;
|
|
32
|
+
}
|
|
33
|
+
catch (_a) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function toIso(value) {
|
|
38
|
+
if (typeof value === "string") {
|
|
39
|
+
const timestamp = Date.parse(value);
|
|
40
|
+
return Number.isNaN(timestamp) ? null : new Date(timestamp).toISOString();
|
|
41
|
+
}
|
|
42
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
43
|
+
const milliseconds = value > 1000000000000 ? value : value * 1000;
|
|
44
|
+
return new Date(milliseconds).toISOString();
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
function extractText(value) {
|
|
49
|
+
if (typeof value === "string")
|
|
50
|
+
return value;
|
|
51
|
+
if (Array.isArray(value)) {
|
|
52
|
+
return value
|
|
53
|
+
.map((item) => extractText(item))
|
|
54
|
+
.filter((text) => text.trim())
|
|
55
|
+
.join("\n");
|
|
56
|
+
}
|
|
57
|
+
if (!isRecord(value))
|
|
58
|
+
return "";
|
|
59
|
+
const type = typeof value.type === "string" ? value.type : "";
|
|
60
|
+
if (type === "tool_use" || type === "function_call") {
|
|
61
|
+
const name = typeof value.name === "string" ? value.name : "unknown";
|
|
62
|
+
return `[Tool: ${name}]`;
|
|
63
|
+
}
|
|
64
|
+
if (typeof value.text === "string")
|
|
65
|
+
return value.text;
|
|
66
|
+
if (typeof value.input_text === "string")
|
|
67
|
+
return value.input_text;
|
|
68
|
+
if (typeof value.output_text === "string")
|
|
69
|
+
return value.output_text;
|
|
70
|
+
if ("content" in value)
|
|
71
|
+
return extractText(value.content);
|
|
72
|
+
return "";
|
|
73
|
+
}
|
|
74
|
+
function truncate(text, maxLength) {
|
|
75
|
+
const trimmed = text.trim().replace(/\s+/g, " ");
|
|
76
|
+
if (trimmed.length <= maxLength)
|
|
77
|
+
return trimmed;
|
|
78
|
+
return `${trimmed.slice(0, maxLength).trim()}...`;
|
|
79
|
+
}
|
|
80
|
+
function getWrappedTagRoot(text) {
|
|
81
|
+
var _a, _b;
|
|
82
|
+
const trimmed = text.trim();
|
|
83
|
+
const match = trimmed.match(/^<([^>\n]+)>[\s\S]*<\/\1>$/);
|
|
84
|
+
return (_b = (_a = match === null || match === void 0 ? void 0 : match[1]) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : null;
|
|
85
|
+
}
|
|
86
|
+
function isDisplayOnlyTagBlock(text) {
|
|
87
|
+
const root = getWrappedTagRoot(text);
|
|
88
|
+
if (!root)
|
|
89
|
+
return false;
|
|
90
|
+
if (DISPLAY_ONLY_TAG_ROOTS.has(root))
|
|
91
|
+
return true;
|
|
92
|
+
return root.includes("_") || root.includes("-") || root.includes(" ");
|
|
93
|
+
}
|
|
94
|
+
async function collectJsonlFiles(root) {
|
|
95
|
+
const files = [];
|
|
96
|
+
async function visit(dir) {
|
|
97
|
+
let entries;
|
|
98
|
+
try {
|
|
99
|
+
entries = (await fs.readdir(dir, { withFileTypes: true }));
|
|
100
|
+
}
|
|
101
|
+
catch (_a) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
await Promise.all(entries.map(async (entry) => {
|
|
105
|
+
const entryPath = path.join(dir, entry.name);
|
|
106
|
+
if (entry.isDirectory()) {
|
|
107
|
+
await visit(entryPath);
|
|
108
|
+
}
|
|
109
|
+
else if (entry.isFile() && entry.name.endsWith(".jsonl")) {
|
|
110
|
+
files.push(entryPath);
|
|
111
|
+
}
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
await visit(root);
|
|
115
|
+
return files;
|
|
116
|
+
}
|
|
117
|
+
async function readHeadTailLines(filePath) {
|
|
118
|
+
const raw = await fs.readFile(filePath, "utf8");
|
|
119
|
+
const lines = raw.split(/\r?\n/).filter(Boolean);
|
|
120
|
+
if (lines.length <= 40)
|
|
121
|
+
return lines;
|
|
122
|
+
return [...lines.slice(0, 10), ...lines.slice(-30)];
|
|
123
|
+
}
|
|
124
|
+
function inferSessionIdFromPath(filePath) {
|
|
125
|
+
var _a, _b;
|
|
126
|
+
return (_b = (_a = path.basename(filePath).match(UUID_RE)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : null;
|
|
127
|
+
}
|
|
128
|
+
function isSubagentSource(payload) {
|
|
129
|
+
return isRecord(payload.source) && "subagent" in payload.source;
|
|
130
|
+
}
|
|
131
|
+
async function parseSessionMeta(filePath, lines) {
|
|
132
|
+
var _a;
|
|
133
|
+
const selectedLines = lines !== null && lines !== void 0 ? lines : (await readHeadTailLines(filePath));
|
|
134
|
+
let sessionId = null;
|
|
135
|
+
let workspacePath = null;
|
|
136
|
+
let createdAt = null;
|
|
137
|
+
let lastActiveAt = null;
|
|
138
|
+
let firstUserMessage = null;
|
|
139
|
+
let summary = null;
|
|
140
|
+
for (const line of selectedLines.slice(0, 10)) {
|
|
141
|
+
const value = parseJsonLine(line);
|
|
142
|
+
if (!value)
|
|
143
|
+
continue;
|
|
144
|
+
createdAt !== null && createdAt !== void 0 ? createdAt : (createdAt = toIso(value.timestamp));
|
|
145
|
+
if (value.type === "session_meta" && isRecord(value.payload)) {
|
|
146
|
+
if (isSubagentSource(value.payload))
|
|
147
|
+
return null;
|
|
148
|
+
sessionId !== null && sessionId !== void 0 ? sessionId : (sessionId = typeof value.payload.id === "string" ? value.payload.id : null);
|
|
149
|
+
workspacePath !== null && workspacePath !== void 0 ? workspacePath : (workspacePath = typeof value.payload.cwd === "string" ? value.payload.cwd : null);
|
|
150
|
+
createdAt !== null && createdAt !== void 0 ? createdAt : (createdAt = toIso(value.payload.timestamp));
|
|
151
|
+
}
|
|
152
|
+
if (!firstUserMessage &&
|
|
153
|
+
value.type === "response_item" &&
|
|
154
|
+
isRecord(value.payload) &&
|
|
155
|
+
value.payload.type === "message" &&
|
|
156
|
+
value.payload.role === "user") {
|
|
157
|
+
const text = extractText(value.payload.content).trim();
|
|
158
|
+
if (text &&
|
|
159
|
+
!text.startsWith("# AGENTS.md") &&
|
|
160
|
+
!isDisplayOnlyTagBlock(text)) {
|
|
161
|
+
firstUserMessage = text;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
for (const line of [...selectedLines].reverse()) {
|
|
166
|
+
const value = parseJsonLine(line);
|
|
167
|
+
if (!value)
|
|
168
|
+
continue;
|
|
169
|
+
lastActiveAt !== null && lastActiveAt !== void 0 ? lastActiveAt : (lastActiveAt = toIso(value.timestamp));
|
|
170
|
+
if (!summary &&
|
|
171
|
+
value.type === "response_item" &&
|
|
172
|
+
isRecord(value.payload) &&
|
|
173
|
+
value.payload.type === "message") {
|
|
174
|
+
const text = extractText(value.payload.content).trim();
|
|
175
|
+
if (text && !isDisplayOnlyTagBlock(text))
|
|
176
|
+
summary = text;
|
|
177
|
+
}
|
|
178
|
+
if (lastActiveAt && summary)
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
sessionId !== null && sessionId !== void 0 ? sessionId : (sessionId = inferSessionIdFromPath(filePath));
|
|
182
|
+
if (!sessionId)
|
|
183
|
+
return null;
|
|
184
|
+
const stat = await fs.stat(filePath).catch(() => null);
|
|
185
|
+
return {
|
|
186
|
+
provider: PROVIDER,
|
|
187
|
+
sessionId,
|
|
188
|
+
title: firstUserMessage ? truncate(firstUserMessage, 80) : null,
|
|
189
|
+
summary: summary ? truncate(summary, 160) : null,
|
|
190
|
+
workspacePath,
|
|
191
|
+
createdAt,
|
|
192
|
+
lastActiveAt: lastActiveAt !== null && lastActiveAt !== void 0 ? lastActiveAt : createdAt,
|
|
193
|
+
sourcePath: filePath,
|
|
194
|
+
sourceKind: SOURCE_KIND,
|
|
195
|
+
lastSeenMtime: (_a = stat === null || stat === void 0 ? void 0 : stat.mtimeMs) !== null && _a !== void 0 ? _a : null,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function parseTranscriptMessage(value, index) {
|
|
199
|
+
if (value.type !== "response_item" || !isRecord(value.payload))
|
|
200
|
+
return null;
|
|
201
|
+
const payload = value.payload;
|
|
202
|
+
const payloadType = typeof payload.type === "string" ? payload.type : "";
|
|
203
|
+
const createdAt = toIso(value.timestamp);
|
|
204
|
+
if (payloadType === "message") {
|
|
205
|
+
const role = payload.role;
|
|
206
|
+
if (role !== "user" && role !== "assistant")
|
|
207
|
+
return null;
|
|
208
|
+
if (role === "assistant" &&
|
|
209
|
+
typeof payload.phase === "string" &&
|
|
210
|
+
payload.phase !== FINAL_ASSISTANT_PHASE) {
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
const text = extractText(payload.content).trim();
|
|
214
|
+
if (!text || isDisplayOnlyTagBlock(text))
|
|
215
|
+
return null;
|
|
216
|
+
return {
|
|
217
|
+
id: (typeof payload.id === "string" && payload.id) ||
|
|
218
|
+
`codex-message-${index}`,
|
|
219
|
+
role,
|
|
220
|
+
text,
|
|
221
|
+
createdAt,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
if (payloadType === "function_call") {
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
if (payloadType === "function_call_output") {
|
|
228
|
+
return null;
|
|
229
|
+
}
|
|
230
|
+
return null;
|
|
231
|
+
}
|
|
232
|
+
export async function scanCodexSessions(workspacePath) {
|
|
233
|
+
const files = await collectJsonlFiles(getCodexSessionsRoot());
|
|
234
|
+
const metas = await Promise.all(files.map((file) => parseSessionMeta(file)));
|
|
235
|
+
return metas
|
|
236
|
+
.filter((meta) => {
|
|
237
|
+
if (!meta)
|
|
238
|
+
return false;
|
|
239
|
+
return !workspacePath || meta.workspacePath === workspacePath;
|
|
240
|
+
})
|
|
241
|
+
.sort((left, right) => {
|
|
242
|
+
var _a, _b, _c, _d;
|
|
243
|
+
return ((_b = (_a = right.lastActiveAt) !== null && _a !== void 0 ? _a : right.createdAt) !== null && _b !== void 0 ? _b : "").localeCompare((_d = (_c = left.lastActiveAt) !== null && _c !== void 0 ? _c : left.createdAt) !== null && _d !== void 0 ? _d : "");
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
export async function findCodexSessionById(sessionId, workspacePath) {
|
|
247
|
+
var _a;
|
|
248
|
+
const files = await collectJsonlFiles(getCodexSessionsRoot());
|
|
249
|
+
const matchingFiles = files.filter((filePath) => inferSessionIdFromPath(filePath) === sessionId);
|
|
250
|
+
if (matchingFiles.length === 0)
|
|
251
|
+
return null;
|
|
252
|
+
const metas = await Promise.all(matchingFiles.map((filePath) => parseSessionMeta(filePath)));
|
|
253
|
+
return ((_a = metas.find((meta) => {
|
|
254
|
+
if (!meta)
|
|
255
|
+
return false;
|
|
256
|
+
return !workspacePath || meta.workspacePath === workspacePath;
|
|
257
|
+
})) !== null && _a !== void 0 ? _a : null);
|
|
258
|
+
}
|
|
259
|
+
export async function loadCodexTranscript(sourcePath) {
|
|
260
|
+
const raw = await fs.readFile(sourcePath, "utf8");
|
|
261
|
+
const lines = raw.split(/\r?\n/).filter(Boolean);
|
|
262
|
+
const meta = await parseSessionMeta(sourcePath, lines);
|
|
263
|
+
if (!meta)
|
|
264
|
+
throw new Error("Unable to parse Codex transcript metadata");
|
|
265
|
+
const messages = lines
|
|
266
|
+
.map((line, index) => {
|
|
267
|
+
const value = parseJsonLine(line);
|
|
268
|
+
return value ? parseTranscriptMessage(value, index) : null;
|
|
269
|
+
})
|
|
270
|
+
.filter((message) => message !== null);
|
|
271
|
+
return { meta, messages };
|
|
272
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ConversationMessageRepository } from "../conversations/types";
|
|
2
|
+
import type { ProviderSessionMeta, ProviderTranscript, ProviderTranscriptLoadRequest } from "./types";
|
|
3
|
+
export type { ProviderSessionMeta, ProviderTranscript, ProviderTranscriptLoadRequest, } from "./types";
|
|
4
|
+
export declare function scanProviderSessions(workspacePath?: string | null): Promise<ProviderSessionMeta[]>;
|
|
5
|
+
export declare function findProviderSession(provider: string | null | undefined, sessionId: string, workspacePath?: string | null): Promise<ProviderSessionMeta | null>;
|
|
6
|
+
export declare function loadProviderTranscript({ provider, sourcePath, }: ProviderTranscriptLoadRequest): Promise<ProviderTranscript>;
|
|
7
|
+
export declare function convertTranscriptToMessageRepository(transcript: ProviderTranscript, format?: string): ConversationMessageRepository<Record<string, unknown>>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { normalizeAcpProvider } from "../acp2aisdk/provider-registry.mjs";
|
|
2
|
+
import { findCodexSessionById, loadCodexTranscript, scanCodexSessions, } from "./codex.mjs";
|
|
3
|
+
function toContent(role, text) {
|
|
4
|
+
if (role === "tool") {
|
|
5
|
+
return {
|
|
6
|
+
role: "assistant",
|
|
7
|
+
parts: [
|
|
8
|
+
{
|
|
9
|
+
type: "text",
|
|
10
|
+
text: text.startsWith("[Tool") ? text : `[Tool output]\n${text}`,
|
|
11
|
+
state: "done",
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
role,
|
|
18
|
+
parts: [
|
|
19
|
+
Object.assign({ type: "text", text }, (role === "assistant" ? { state: "done" } : {})),
|
|
20
|
+
],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function mergeSequentialAssistantMessages(messages) {
|
|
24
|
+
var _a;
|
|
25
|
+
const merged = [];
|
|
26
|
+
for (const message of messages) {
|
|
27
|
+
const previous = merged.at(-1);
|
|
28
|
+
if ((previous === null || previous === void 0 ? void 0 : previous.role) === "assistant" && message.role === "assistant") {
|
|
29
|
+
merged[merged.length - 1] = Object.assign(Object.assign({}, previous), { id: message.id, text: `${previous.text}\n\n${message.text}`, createdAt: (_a = message.createdAt) !== null && _a !== void 0 ? _a : previous.createdAt });
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
merged.push(message);
|
|
33
|
+
}
|
|
34
|
+
return merged;
|
|
35
|
+
}
|
|
36
|
+
export async function scanProviderSessions(workspacePath) {
|
|
37
|
+
return scanCodexSessions(workspacePath);
|
|
38
|
+
}
|
|
39
|
+
export async function findProviderSession(provider, sessionId, workspacePath) {
|
|
40
|
+
const providerKey = normalizeAcpProvider(provider);
|
|
41
|
+
if (providerKey !== "codex")
|
|
42
|
+
return null;
|
|
43
|
+
return findCodexSessionById(sessionId, workspacePath);
|
|
44
|
+
}
|
|
45
|
+
export async function loadProviderTranscript({ provider, sourcePath, }) {
|
|
46
|
+
const providerKey = normalizeAcpProvider(provider);
|
|
47
|
+
if (providerKey !== "codex") {
|
|
48
|
+
throw new Error(`Unsupported provider history: ${providerKey}`);
|
|
49
|
+
}
|
|
50
|
+
if (!sourcePath)
|
|
51
|
+
throw new Error("sourcePath is required");
|
|
52
|
+
return loadCodexTranscript(sourcePath);
|
|
53
|
+
}
|
|
54
|
+
export function convertTranscriptToMessageRepository(transcript, format = "ai-sdk/v6") {
|
|
55
|
+
let parentId = null;
|
|
56
|
+
const seenIds = new Set();
|
|
57
|
+
const idCounts = new Map();
|
|
58
|
+
const createUniqueId = (rawId) => {
|
|
59
|
+
var _a;
|
|
60
|
+
const baseId = `${transcript.meta.provider}:${transcript.meta.sessionId}:${rawId}`;
|
|
61
|
+
const count = (_a = idCounts.get(baseId)) !== null && _a !== void 0 ? _a : 0;
|
|
62
|
+
idCounts.set(baseId, count + 1);
|
|
63
|
+
let id = count === 0 ? baseId : `${baseId}:${count + 1}`;
|
|
64
|
+
while (seenIds.has(id)) {
|
|
65
|
+
id = `${id}:duplicate`;
|
|
66
|
+
}
|
|
67
|
+
seenIds.add(id);
|
|
68
|
+
return id;
|
|
69
|
+
};
|
|
70
|
+
const messages = mergeSequentialAssistantMessages(transcript.messages).map((message) => {
|
|
71
|
+
var _a, _b, _c, _d, _e;
|
|
72
|
+
const id = createUniqueId(message.id);
|
|
73
|
+
const entry = {
|
|
74
|
+
id,
|
|
75
|
+
parent_id: parentId,
|
|
76
|
+
format,
|
|
77
|
+
content: toContent(message.role, message.text),
|
|
78
|
+
createdAt: (_b = (_a = message.createdAt) !== null && _a !== void 0 ? _a : transcript.meta.createdAt) !== null && _b !== void 0 ? _b : new Date(0).toISOString(),
|
|
79
|
+
updatedAt: (_e = (_d = (_c = message.createdAt) !== null && _c !== void 0 ? _c : transcript.meta.lastActiveAt) !== null && _d !== void 0 ? _d : transcript.meta.createdAt) !== null && _e !== void 0 ? _e : new Date(0).toISOString(),
|
|
80
|
+
};
|
|
81
|
+
parentId = id;
|
|
82
|
+
return entry;
|
|
83
|
+
});
|
|
84
|
+
return {
|
|
85
|
+
headId: parentId,
|
|
86
|
+
messages,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AcpProviderKey } from "../acp2aisdk";
|
|
2
|
+
import type { ConversationMessageRepository, ConversationSourceKind, StoredMessageEntry } from "../conversations/types";
|
|
3
|
+
export type ProviderSessionMeta = {
|
|
4
|
+
provider: AcpProviderKey;
|
|
5
|
+
sessionId: string;
|
|
6
|
+
title: string | null;
|
|
7
|
+
summary: string | null;
|
|
8
|
+
workspacePath: string | null;
|
|
9
|
+
createdAt: string | null;
|
|
10
|
+
lastActiveAt: string | null;
|
|
11
|
+
sourcePath: string;
|
|
12
|
+
sourceKind: ConversationSourceKind;
|
|
13
|
+
lastSeenMtime: number | null;
|
|
14
|
+
};
|
|
15
|
+
export type ProviderTranscriptMessage = {
|
|
16
|
+
id: string;
|
|
17
|
+
role: "user" | "assistant" | "tool";
|
|
18
|
+
text: string;
|
|
19
|
+
createdAt: string | null;
|
|
20
|
+
};
|
|
21
|
+
export type ProviderTranscript = {
|
|
22
|
+
meta: ProviderSessionMeta;
|
|
23
|
+
messages: ProviderTranscriptMessage[];
|
|
24
|
+
};
|
|
25
|
+
export type ProviderTranscriptLoadRequest = {
|
|
26
|
+
provider: AcpProviderKey;
|
|
27
|
+
sessionId?: string | null;
|
|
28
|
+
sourcePath?: string | null;
|
|
29
|
+
};
|
|
30
|
+
export type ProviderHistoryRepository = ConversationMessageRepository<Record<string, unknown>>;
|
|
31
|
+
export type ProviderHistoryEntry = StoredMessageEntry<Record<string, unknown>>;
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const ACP_UI_SERVICE_ID = "@axhub/acp";
|
|
2
|
+
export declare const ACP_UI_SERVICE_NAME = "Axhub ACP UI";
|
|
3
|
+
export type AcpUiServerRuntime = {
|
|
4
|
+
service: {
|
|
5
|
+
id: typeof ACP_UI_SERVICE_ID;
|
|
6
|
+
name: typeof ACP_UI_SERVICE_NAME;
|
|
7
|
+
};
|
|
8
|
+
status: "ready";
|
|
9
|
+
pid: number;
|
|
10
|
+
port: number | null;
|
|
11
|
+
hostname: string;
|
|
12
|
+
webBaseUrl: string | null;
|
|
13
|
+
apiBaseUrl: string | null;
|
|
14
|
+
corsOrigins: string[];
|
|
15
|
+
defaultWorkspacePath: string | null;
|
|
16
|
+
startedAt: string;
|
|
17
|
+
};
|
|
18
|
+
declare global {
|
|
19
|
+
var __ACP_UI_SERVER_RUNTIME__: AcpUiServerRuntime | undefined;
|
|
20
|
+
}
|
|
21
|
+
export declare function registerAcpUiServerRuntime(overrides?: Partial<AcpUiServerRuntime>): AcpUiServerRuntime;
|
|
22
|
+
export declare function readAcpUiServerRuntime(): AcpUiServerRuntime;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export const ACP_UI_SERVICE_ID = "@axhub/acp";
|
|
2
|
+
export const ACP_UI_SERVICE_NAME = "Axhub ACP UI";
|
|
3
|
+
function normalizeString(value) {
|
|
4
|
+
return typeof value === "string" ? value.trim() : "";
|
|
5
|
+
}
|
|
6
|
+
function normalizePositivePort(value) {
|
|
7
|
+
const port = Number(normalizeString(value));
|
|
8
|
+
return Number.isInteger(port) && port > 0 && port <= 65535 ? port : null;
|
|
9
|
+
}
|
|
10
|
+
function normalizePositiveInteger(value) {
|
|
11
|
+
const number = Number(normalizeString(value));
|
|
12
|
+
return Number.isInteger(number) && number > 0 ? number : null;
|
|
13
|
+
}
|
|
14
|
+
function normalizeBaseUrl(value) {
|
|
15
|
+
const raw = normalizeString(value).replace(/\/+$/u, "");
|
|
16
|
+
if (!raw)
|
|
17
|
+
return null;
|
|
18
|
+
try {
|
|
19
|
+
return new URL(raw).toString().replace(/\/+$/u, "");
|
|
20
|
+
}
|
|
21
|
+
catch (_a) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function splitOrigins(value) {
|
|
26
|
+
return normalizeString(value)
|
|
27
|
+
.split(/[,\s]+/u)
|
|
28
|
+
.map((origin) => origin.trim().replace(/\/+$/u, ""))
|
|
29
|
+
.filter(Boolean);
|
|
30
|
+
}
|
|
31
|
+
function runtimeHostForUrl(hostname) {
|
|
32
|
+
const normalized = normalizeString(hostname).toLowerCase();
|
|
33
|
+
if (!normalized || normalized === "0.0.0.0" || normalized === "::") {
|
|
34
|
+
return "localhost";
|
|
35
|
+
}
|
|
36
|
+
return normalized.includes(":") && !normalized.startsWith("[")
|
|
37
|
+
? `[${normalized}]`
|
|
38
|
+
: normalized;
|
|
39
|
+
}
|
|
40
|
+
function defaultWebBaseUrl(port, hostname) {
|
|
41
|
+
if (!port)
|
|
42
|
+
return null;
|
|
43
|
+
return `http://${runtimeHostForUrl(hostname)}:${port}`;
|
|
44
|
+
}
|
|
45
|
+
export function registerAcpUiServerRuntime(overrides = {}) {
|
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
47
|
+
const port = (_a = overrides.port) !== null && _a !== void 0 ? _a : normalizePositivePort(process.env.ACP_UI_SERVER_PORT);
|
|
48
|
+
const hostname = (_c = (_b = overrides.hostname) !== null && _b !== void 0 ? _b : normalizeString(process.env.ACP_UI_SERVER_HOSTNAME || process.env.HOSTNAME)) !== null && _c !== void 0 ? _c : "";
|
|
49
|
+
const webBaseUrl = (_e = (_d = overrides.webBaseUrl) !== null && _d !== void 0 ? _d : normalizeBaseUrl(process.env.ACP_UI_SERVER_WEB_BASE_URL)) !== null && _e !== void 0 ? _e : defaultWebBaseUrl(port, hostname);
|
|
50
|
+
const apiBaseUrl = (_g = (_f = overrides.apiBaseUrl) !== null && _f !== void 0 ? _f : normalizeBaseUrl(process.env.ACP_UI_SERVER_API_BASE_URL)) !== null && _g !== void 0 ? _g : (webBaseUrl ? `${webBaseUrl}/api` : null);
|
|
51
|
+
const defaultWorkspacePath = overrides.defaultWorkspacePath !== undefined
|
|
52
|
+
? overrides.defaultWorkspacePath
|
|
53
|
+
: normalizeString(process.env.ACP_UI_DEFAULT_WORKSPACE_PATH) || null;
|
|
54
|
+
const startedAt = overrides.startedAt ||
|
|
55
|
+
normalizeString(process.env.ACP_UI_SERVER_STARTED_AT) ||
|
|
56
|
+
new Date().toISOString();
|
|
57
|
+
const runtime = {
|
|
58
|
+
service: {
|
|
59
|
+
id: ACP_UI_SERVICE_ID,
|
|
60
|
+
name: ACP_UI_SERVICE_NAME,
|
|
61
|
+
},
|
|
62
|
+
status: "ready",
|
|
63
|
+
pid: (_j = (_h = overrides.pid) !== null && _h !== void 0 ? _h : normalizePositiveInteger(process.env.ACP_UI_SERVER_PID)) !== null && _j !== void 0 ? _j : 0,
|
|
64
|
+
port,
|
|
65
|
+
hostname,
|
|
66
|
+
webBaseUrl,
|
|
67
|
+
apiBaseUrl,
|
|
68
|
+
corsOrigins: (_k = overrides.corsOrigins) !== null && _k !== void 0 ? _k : splitOrigins(process.env.ACP_UI_CORS_ORIGINS),
|
|
69
|
+
defaultWorkspacePath,
|
|
70
|
+
startedAt,
|
|
71
|
+
};
|
|
72
|
+
globalThis.__ACP_UI_SERVER_RUNTIME__ = runtime;
|
|
73
|
+
return runtime;
|
|
74
|
+
}
|
|
75
|
+
export function readAcpUiServerRuntime() {
|
|
76
|
+
var _a;
|
|
77
|
+
return (_a = globalThis.__ACP_UI_SERVER_RUNTIME__) !== null && _a !== void 0 ? _a : registerAcpUiServerRuntime();
|
|
78
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type SearchParamsLike = URLSearchParams | {
|
|
2
|
+
get: (name: string) => string | null;
|
|
3
|
+
} | Record<string, string | string[] | undefined> | null | undefined;
|
|
4
|
+
export declare function getWorkspacePathFromSearchParams(searchParams: SearchParamsLike): string | null;
|
|
5
|
+
export declare function normalizeComparableWorkspacePath(value?: string | null): string;
|
|
6
|
+
export declare function workspacePathsEqual(left?: string | null, right?: string | null): boolean;
|
|
7
|
+
export declare function buildCanonicalWorkspaceSearch(workspacePath: string | null | undefined, defaultWorkspacePath: string): string;
|
|
8
|
+
export declare function buildThreadPath(threadId: string): string;
|
|
9
|
+
export declare function buildThreadHref({ threadId, workspacePath, defaultWorkspacePath, }: {
|
|
10
|
+
threadId: string;
|
|
11
|
+
workspacePath?: string | null;
|
|
12
|
+
defaultWorkspacePath: string;
|
|
13
|
+
}): string;
|
|
14
|
+
export declare function buildHomeHref({ workspacePath, defaultWorkspacePath, }: {
|
|
15
|
+
workspacePath?: string | null;
|
|
16
|
+
defaultWorkspacePath: string;
|
|
17
|
+
}): string;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const WORKSPACE_QUERY_KEYS = ["cwd", "project", "workdir"];
|
|
2
|
+
function getSearchParam(searchParams, key) {
|
|
3
|
+
var _a;
|
|
4
|
+
if (!searchParams)
|
|
5
|
+
return null;
|
|
6
|
+
if ("get" in searchParams && typeof searchParams.get === "function") {
|
|
7
|
+
return searchParams.get(key);
|
|
8
|
+
}
|
|
9
|
+
const value = searchParams[key];
|
|
10
|
+
if (Array.isArray(value))
|
|
11
|
+
return (_a = value[0]) !== null && _a !== void 0 ? _a : null;
|
|
12
|
+
return value !== null && value !== void 0 ? value : null;
|
|
13
|
+
}
|
|
14
|
+
export function getWorkspacePathFromSearchParams(searchParams) {
|
|
15
|
+
var _a;
|
|
16
|
+
for (const key of WORKSPACE_QUERY_KEYS) {
|
|
17
|
+
const value = (_a = getSearchParam(searchParams, key)) === null || _a === void 0 ? void 0 : _a.trim();
|
|
18
|
+
if (value)
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
export function normalizeComparableWorkspacePath(value) {
|
|
24
|
+
const trimmed = String(value !== null && value !== void 0 ? value : "").trim();
|
|
25
|
+
if (!trimmed)
|
|
26
|
+
return "";
|
|
27
|
+
const slashNormalized = trimmed.replace(/\\/g, "/");
|
|
28
|
+
if (slashNormalized === "/")
|
|
29
|
+
return "/";
|
|
30
|
+
if (/^[A-Za-z]:\/?$/.test(slashNormalized)) {
|
|
31
|
+
return `${slashNormalized[0].toUpperCase()}:/`;
|
|
32
|
+
}
|
|
33
|
+
return slashNormalized.replace(/\/+$/g, "");
|
|
34
|
+
}
|
|
35
|
+
export function workspacePathsEqual(left, right) {
|
|
36
|
+
const normalizedLeft = normalizeComparableWorkspacePath(left);
|
|
37
|
+
const normalizedRight = normalizeComparableWorkspacePath(right);
|
|
38
|
+
return Boolean(normalizedLeft && normalizedLeft === normalizedRight);
|
|
39
|
+
}
|
|
40
|
+
export function buildCanonicalWorkspaceSearch(workspacePath, defaultWorkspacePath) {
|
|
41
|
+
const normalizedWorkspacePath = normalizeComparableWorkspacePath(workspacePath);
|
|
42
|
+
if (!normalizedWorkspacePath ||
|
|
43
|
+
workspacePathsEqual(normalizedWorkspacePath, defaultWorkspacePath)) {
|
|
44
|
+
return "";
|
|
45
|
+
}
|
|
46
|
+
const params = new URLSearchParams();
|
|
47
|
+
params.set("cwd", normalizedWorkspacePath);
|
|
48
|
+
const query = params.toString();
|
|
49
|
+
return query ? `?${query}` : "";
|
|
50
|
+
}
|
|
51
|
+
export function buildThreadPath(threadId) {
|
|
52
|
+
return `/thread/${encodeURIComponent(threadId)}`;
|
|
53
|
+
}
|
|
54
|
+
export function buildThreadHref({ threadId, workspacePath, defaultWorkspacePath, }) {
|
|
55
|
+
return `${buildThreadPath(threadId)}${buildCanonicalWorkspaceSearch(workspacePath, defaultWorkspacePath)}`;
|
|
56
|
+
}
|
|
57
|
+
export function buildHomeHref({ workspacePath, defaultWorkspacePath, }) {
|
|
58
|
+
return `/${buildCanonicalWorkspaceSearch(workspacePath, defaultWorkspacePath)}`;
|
|
59
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
export async function readWorkspacePackageName(workspacePath) {
|
|
4
|
+
try {
|
|
5
|
+
const raw = await fs.readFile(path.join(workspacePath, "package.json"), "utf8");
|
|
6
|
+
const parsed = JSON.parse(raw);
|
|
7
|
+
return typeof parsed.name === "string" && parsed.name.trim()
|
|
8
|
+
? parsed.name.trim()
|
|
9
|
+
: null;
|
|
10
|
+
}
|
|
11
|
+
catch (_a) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export async function getWorkspaceDisplayName(workspacePath) {
|
|
16
|
+
return ((await readWorkspacePackageName(workspacePath)) ||
|
|
17
|
+
path.basename(workspacePath.replace(/[/\\]+$/g, "")) ||
|
|
18
|
+
workspacePath ||
|
|
19
|
+
"当前项目");
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PropsWithChildren } from "react";
|
|
2
|
+
export type AcpChatProviderProps = PropsWithChildren<{
|
|
3
|
+
workspacePath?: string | null;
|
|
4
|
+
defaultProvider?: string | null;
|
|
5
|
+
threadId?: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function AcpChatProvider({ children, defaultProvider, threadId, workspacePath, }: AcpChatProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export type AcpRuntimeProviderProps = PropsWithChildren<{
|
|
9
|
+
threadId?: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function AcpRuntimeProvider({ children, threadId, }: AcpRuntimeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { AcpUiProvider, type AcpUiRuntimeContext, useAcpUiRuntimeContext, } from "../lib/acp2aisdk/client-context";
|
|
13
|
+
export { useConversationChatRuntime } from "../lib/conversations/client-adapter";
|
|
14
|
+
export { AcpCommandMenu, AcpCommandTriggerButton, AcpComposerSelectors, AcpHeaderContext, AssistantActionBar, AssistantMessage, BranchPicker, Composer, ComposerAction, type ComposerActionProps, type ComposerProps, ContextChips, EditComposer, MessageError, MessageList, Thread, ThreadEmptyState, ThreadHistoryEmpty, ThreadHistoryLoading, ThreadList, ThreadListSidebar, ThreadMessage, type ThreadProps, ThreadScrollToBottom, ThreadSuggestionItem, ThreadSuggestions, ThreadWelcome, UserActionBar, UserMessage, } from "./ui";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { AssistantRuntimeProvider } from "@assistant-ui/react";
|
|
4
|
+
import { AcpUiProvider, useAcpUiRuntimeContext, } from "../lib/acp2aisdk/client-context.mjs";
|
|
5
|
+
import { useConversationChatRuntime } from "../lib/conversations/client-adapter.mjs";
|
|
6
|
+
export function AcpChatProvider({ children, defaultProvider, threadId, workspacePath, }) {
|
|
7
|
+
return (_jsx(AcpUiProvider, { defaultProvider: defaultProvider, workspacePath: workspacePath, children: _jsx(AcpRuntimeProvider, { threadId: threadId, children: children }) }));
|
|
8
|
+
}
|
|
9
|
+
export function AcpRuntimeProvider({ children, threadId, }) {
|
|
10
|
+
const context = useAcpUiRuntimeContext();
|
|
11
|
+
const runtime = useConversationChatRuntime({ context, threadId });
|
|
12
|
+
return (_jsx(AssistantRuntimeProvider, { runtime: runtime, children: children }));
|
|
13
|
+
}
|
|
14
|
+
export { AcpUiProvider, useAcpUiRuntimeContext, } from "../lib/acp2aisdk/client-context.mjs";
|
|
15
|
+
export { useConversationChatRuntime } from "../lib/conversations/client-adapter.mjs";
|
|
16
|
+
export { AcpCommandMenu, AcpCommandTriggerButton, AcpComposerSelectors, AcpHeaderContext, AssistantActionBar, AssistantMessage, BranchPicker, Composer, ComposerAction, ContextChips, EditComposer, MessageError, MessageList, Thread, ThreadEmptyState, ThreadHistoryEmpty, ThreadHistoryLoading, ThreadList, ThreadListSidebar, ThreadMessage, ThreadScrollToBottom, ThreadSuggestionItem, ThreadSuggestions, ThreadWelcome, UserActionBar, UserMessage, } from "./ui.mjs";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { ACP_CAPABILITY_REFRESH_EVENT, hydrateAcpCapabilityCacheFromDefaults, mergeAcpCapabilitySnapshots, normalizeAcpCapabilitySnapshot, readAcpCapabilityCache, } from "../lib/acp2aisdk/capability-cache";
|
|
2
|
+
export { AcpUiProvider, type AcpUiRuntimeContext, useAcpUiRuntimeContext, } from "../lib/acp2aisdk/client-context";
|
|
3
|
+
export { type ContextAnnotationItem, type ContextAnnotationTarget, type ContextBundleChange, type ContextBundleV2, type ContextFileItem, type ContextItem, type ContextItemKind, type ContextOperationResult, createContextBundle, filterContextBundle, formatDynamicContextPrompt, hasContextItems, isContextItemKind, type Rect, type TextRange, } from "../lib/acp2aisdk/context";
|
|
4
|
+
export { ACP_PROVIDER_KEYS, ACP_PROVIDER_REGISTRY, getAcpProviderDefaultModeId, isAcpProviderKey, normalizeAcpProvider, } from "../lib/acp2aisdk/provider-registry";
|
|
5
|
+
export type { AcpCapability, AcpCapabilityOption, AcpCapabilitySnapshot, AcpChatRequest, AcpPermissionMode, AcpProviderKey, AcpRunState, AcpRuntimeMetadata, } from "../lib/acp2aisdk/types";
|
|
6
|
+
export { type AcpUiRuntimeConfig, acpApiClient, acpApiEndpoints, configureAcpUiRuntime, readAcpUiRuntimeConfig, } from "../lib/api/client";
|
|
7
|
+
export { useConversationChatRuntime } from "../lib/conversations/client-adapter";
|
|
8
|
+
export type { ConversationInitializeResponse, ConversationListOptions, ConversationListResponse, ConversationMessageRepository, ConversationRecord, ConversationRenameRequest, ConversationSessionRecord, ConversationSessionResolution, ConversationSourceKind, ConversationStatus, ConversationStoreData, ConversationUpsertRequest, StoredMessageEntry, } from "../lib/conversations/types";
|