ai-agent-router 0.1.21 → 0.2.1
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 -1
- package/.next/app-path-routes-manifest.json +14 -0
- package/.next/build-manifest.json +2 -2
- package/.next/fallback-build-manifest.json +2 -2
- package/.next/routes-manifest.json +84 -0
- package/.next/server/app/_global-error/page.js +1 -1
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/server/app/api/gateway/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/gateway/models/route.js.nft.json +1 -1
- package/.next/server/app/api/gateway/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/claude/apply/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/claude/available-models/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/claude/save/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/claude/status/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/claude/test/route.js +1 -1
- package/.next/server/app/api/ide/claude/test/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/openclaw/apply/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/ide/openclaw/apply/route/build-manifest.json +11 -0
- package/.next/server/app/api/ide/openclaw/apply/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/ide/openclaw/apply/route.js +7 -0
- package/.next/server/app/api/ide/openclaw/apply/route.js.map +5 -0
- package/.next/server/app/api/ide/openclaw/apply/route.js.nft.json +1 -0
- package/.next/server/app/api/ide/openclaw/apply/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/ide/openclaw/available-models/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/ide/openclaw/available-models/route/build-manifest.json +11 -0
- package/.next/server/app/api/ide/openclaw/available-models/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/ide/openclaw/available-models/route.js +7 -0
- package/.next/server/app/api/ide/openclaw/available-models/route.js.map +5 -0
- package/.next/server/app/api/ide/openclaw/available-models/route.js.nft.json +1 -0
- package/.next/server/app/api/ide/openclaw/available-models/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/ide/openclaw/preview/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/ide/openclaw/preview/route/build-manifest.json +11 -0
- package/.next/server/app/api/ide/openclaw/preview/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/ide/openclaw/preview/route.js +7 -0
- package/.next/server/app/api/ide/openclaw/preview/route.js.map +5 -0
- package/.next/server/app/api/ide/openclaw/preview/route.js.nft.json +1 -0
- package/.next/server/app/api/ide/openclaw/preview/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/ide/openclaw/restore/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/ide/openclaw/restore/route/build-manifest.json +11 -0
- package/.next/server/app/api/ide/openclaw/restore/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/ide/openclaw/restore/route.js +6 -0
- package/.next/server/app/api/ide/openclaw/restore/route.js.map +5 -0
- package/.next/server/app/api/ide/openclaw/restore/route.js.nft.json +1 -0
- package/.next/server/app/api/ide/openclaw/restore/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/ide/openclaw/save/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/ide/openclaw/save/route/build-manifest.json +11 -0
- package/.next/server/app/api/ide/openclaw/save/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/ide/openclaw/save/route.js +7 -0
- package/.next/server/app/api/ide/openclaw/save/route.js.map +5 -0
- package/.next/server/app/api/ide/openclaw/save/route.js.nft.json +1 -0
- package/.next/server/app/api/ide/openclaw/save/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/ide/openclaw/status/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/ide/openclaw/status/route/build-manifest.json +11 -0
- package/.next/server/app/api/ide/openclaw/status/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/ide/openclaw/status/route.js +7 -0
- package/.next/server/app/api/ide/openclaw/status/route.js.map +5 -0
- package/.next/server/app/api/ide/openclaw/status/route.js.nft.json +1 -0
- package/.next/server/app/api/ide/openclaw/status/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/ide/openclaw/test/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/ide/openclaw/test/route/build-manifest.json +11 -0
- package/.next/server/app/api/ide/openclaw/test/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/ide/openclaw/test/route.js +6 -0
- package/.next/server/app/api/ide/openclaw/test/route.js.map +5 -0
- package/.next/server/app/api/ide/openclaw/test/route.js.nft.json +1 -0
- package/.next/server/app/api/ide/openclaw/test/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/ide/opencode/apply/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/ide/opencode/apply/route/build-manifest.json +11 -0
- package/.next/server/app/api/ide/opencode/apply/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/ide/opencode/apply/route.js +7 -0
- package/.next/server/app/api/ide/opencode/apply/route.js.map +5 -0
- package/.next/server/app/api/ide/opencode/apply/route.js.nft.json +1 -0
- package/.next/server/app/api/ide/opencode/apply/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/ide/opencode/available-models/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/ide/opencode/available-models/route/build-manifest.json +11 -0
- package/.next/server/app/api/ide/opencode/available-models/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/ide/opencode/available-models/route.js +7 -0
- package/.next/server/app/api/ide/opencode/available-models/route.js.map +5 -0
- package/.next/server/app/api/ide/opencode/available-models/route.js.nft.json +1 -0
- package/.next/server/app/api/ide/opencode/available-models/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/ide/opencode/preview/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/ide/opencode/preview/route/build-manifest.json +11 -0
- package/.next/server/app/api/ide/opencode/preview/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/ide/opencode/preview/route.js +7 -0
- package/.next/server/app/api/ide/opencode/preview/route.js.map +5 -0
- package/.next/server/app/api/ide/opencode/preview/route.js.nft.json +1 -0
- package/.next/server/app/api/ide/opencode/preview/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/ide/opencode/restore/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/ide/opencode/restore/route/build-manifest.json +11 -0
- package/.next/server/app/api/ide/opencode/restore/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/ide/opencode/restore/route.js +6 -0
- package/.next/server/app/api/ide/opencode/restore/route.js.map +5 -0
- package/.next/server/app/api/ide/opencode/restore/route.js.nft.json +1 -0
- package/.next/server/app/api/ide/opencode/restore/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/ide/opencode/save/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/ide/opencode/save/route/build-manifest.json +11 -0
- package/.next/server/app/api/ide/opencode/save/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/ide/opencode/save/route.js +7 -0
- package/.next/server/app/api/ide/opencode/save/route.js.map +5 -0
- package/.next/server/app/api/ide/opencode/save/route.js.nft.json +1 -0
- package/.next/server/app/api/ide/opencode/save/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/ide/opencode/status/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/ide/opencode/status/route/build-manifest.json +11 -0
- package/.next/server/app/api/ide/opencode/status/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/ide/opencode/status/route.js +7 -0
- package/.next/server/app/api/ide/opencode/status/route.js.map +5 -0
- package/.next/server/app/api/ide/opencode/status/route.js.nft.json +1 -0
- package/.next/server/app/api/ide/opencode/status/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/ide/opencode/test/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/ide/opencode/test/route/build-manifest.json +11 -0
- package/.next/server/app/api/ide/opencode/test/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/ide/opencode/test/route.js +6 -0
- package/.next/server/app/api/ide/opencode/test/route.js.map +5 -0
- package/.next/server/app/api/ide/opencode/test/route.js.nft.json +1 -0
- package/.next/server/app/api/ide/opencode/test/route_client-reference-manifest.js +2 -0
- package/.next/server/app/api/logs/route.js.nft.json +1 -1
- package/.next/server/app/api/models/route.js.nft.json +1 -1
- package/.next/server/app/api/providers/route.js.nft.json +1 -1
- package/.next/server/app/api/providers/test/route.js.nft.json +1 -1
- package/.next/server/app/api/service/force-stop/route.js.nft.json +1 -1
- package/.next/server/app/api/service/start/route.js.nft.json +1 -1
- package/.next/server/app/api/service/status/route.js.nft.json +1 -1
- package/.next/server/app/api/service/stop/route.js.nft.json +1 -1
- package/.next/server/app/ide/page.js +1 -1
- package/.next/server/app/ide/page.js.nft.json +1 -1
- package/.next/server/app/ide/page_client-reference-manifest.js +1 -1
- package/.next/server/app/ide.html +1 -1
- package/.next/server/app/ide.rsc +3 -3
- package/.next/server/app/ide.segments/_full.segment.rsc +3 -3
- package/.next/server/app/ide.segments/_head.segment.rsc +1 -1
- package/.next/server/app/ide.segments/_index.segment.rsc +2 -2
- package/.next/server/app/ide.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/ide.segments/ide/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/ide.segments/ide.segment.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +2 -2
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/logs/page.js +1 -1
- package/.next/server/app/logs/page.js.nft.json +1 -1
- package/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/logs.html +1 -1
- package/.next/server/app/logs.rsc +3 -3
- package/.next/server/app/logs.segments/_full.segment.rsc +3 -3
- package/.next/server/app/logs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/logs.segments/_index.segment.rsc +2 -2
- package/.next/server/app/logs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/logs.segments/logs.segment.rsc +1 -1
- package/.next/server/app/models/page.js +1 -1
- package/.next/server/app/models/page.js.nft.json +1 -1
- package/.next/server/app/models/page_client-reference-manifest.js +1 -1
- package/.next/server/app/models.html +1 -1
- package/.next/server/app/models.rsc +2 -2
- package/.next/server/app/models.segments/_full.segment.rsc +2 -2
- package/.next/server/app/models.segments/_head.segment.rsc +1 -1
- package/.next/server/app/models.segments/_index.segment.rsc +2 -2
- package/.next/server/app/models.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/models.segments/models/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/models.segments/models.segment.rsc +1 -1
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/providers/page.js +1 -1
- package/.next/server/app/providers/page.js.nft.json +1 -1
- package/.next/server/app/providers/page_client-reference-manifest.js +1 -1
- package/.next/server/app/providers.html +1 -1
- package/.next/server/app/providers.rsc +2 -2
- package/.next/server/app/providers.segments/_full.segment.rsc +2 -2
- package/.next/server/app/providers.segments/_head.segment.rsc +1 -1
- package/.next/server/app/providers.segments/_index.segment.rsc +2 -2
- package/.next/server/app/providers.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/providers.segments/providers/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/providers.segments/providers.segment.rsc +1 -1
- package/.next/server/app-paths-manifest.json +14 -0
- package/.next/server/chunks/[root-of-the-server]__001d5756._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__001d5756._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__05f8578b._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__05f8578b._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__1480f018._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1480f018._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__1909f3aa._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1909f3aa._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__1d4b7fc5._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1d4b7fc5._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__372ef2bf._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__372ef2bf._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__3aaf963c._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__3aaf963c._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__43810962._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__43810962._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__55cd88b8._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__55cd88b8._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__5e8276bc._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__5e8276bc._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__6ce199d2._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__6ce199d2._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__760eaa16._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__760eaa16._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__772134c6._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__772134c6._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__7b77f523._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__7b77f523._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__7c298a19._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__7c298a19._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__85540228._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__85540228._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__94fe8d3c._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__94fe8d3c._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__97622908._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__97622908._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__a02e6618._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__a02e6618._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__a32a20a7._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__a32a20a7._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__af5b556a._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__af5b556a._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__c1b4b601._.js +18 -18
- package/.next/server/chunks/[root-of-the-server]__c1b4b601._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__cafe113e._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__cafe113e._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__ccfc7f1d._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__ccfc7f1d._.js.map +1 -1
- package/.next/server/chunks/[root-of-the-server]__dc8b0bed._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__dc8b0bed._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__f8949f88._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__f8949f88._.js.map +1 -1
- package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_apply_route_actions_2cb9e4b4.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_apply_route_actions_2cb9e4b4.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_preview_route_actions_9814a8e4.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_preview_route_actions_9814a8e4.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_restore_route_actions_10ad8f9d.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_restore_route_actions_10ad8f9d.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_save_route_actions_044ad081.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_save_route_actions_044ad081.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_status_route_actions_ed9786d2.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_status_route_actions_ed9786d2.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_test_route_actions_ce2cb808.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_openclaw_test_route_actions_ce2cb808.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_apply_route_actions_6c422244.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_apply_route_actions_6c422244.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_preview_route_actions_256c82e0.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_preview_route_actions_256c82e0.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_restore_route_actions_371993d3.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_restore_route_actions_371993d3.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_save_route_actions_6e4c9c41.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_save_route_actions_6e4c9c41.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_status_route_actions_498ad77b.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_status_route_actions_498ad77b.js.map +1 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_test_route_actions_c71be510.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_ide_opencode_test_route_actions_c71be510.js.map +1 -0
- package/.next/server/chunks/ce889_server_app_api_ide_openclaw_available-models_route_actions_e568e70b.js +3 -0
- package/.next/server/chunks/ce889_server_app_api_ide_openclaw_available-models_route_actions_e568e70b.js.map +1 -0
- package/.next/server/chunks/ce889_server_app_api_ide_opencode_available-models_route_actions_95230db3.js +3 -0
- package/.next/server/chunks/ce889_server_app_api_ide_opencode_available-models_route_actions_95230db3.js.map +1 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__bec95712._.js → [root-of-the-server]__81937253._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__bec95712._.js.map → [root-of-the-server]__81937253._.js.map} +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__71c85955._.js → [root-of-the-server]__976ad963._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__71c85955._.js.map → [root-of-the-server]__976ad963._.js.map} +1 -1
- package/.next/server/chunks/ssr/src_app_ide_page_tsx_8962793b._.js +1 -1
- package/.next/server/chunks/ssr/src_app_ide_page_tsx_8962793b._.js.map +1 -1
- package/.next/server/chunks/ssr/src_app_logs_page_tsx_7b7b7b83._.js +1 -1
- package/.next/server/chunks/ssr/src_app_logs_page_tsx_7b7b7b83._.js.map +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/static/chunks/0f120c117962200b.css +1 -0
- package/.next/static/chunks/64f547b3bcd3aef4.js +1 -0
- package/.next/static/chunks/{81c904164fe81379.js → 7c8b7cbb3339f139.js} +1 -1
- package/.next/static/chunks/8ed839b2e4948968.js +1 -0
- package/.next/types/routes.d.ts +15 -1
- package/.next/types/validator.ts +126 -0
- package/README.md +100 -111
- package/dist/.next/dev/types/validator.js +56 -0
- package/dist/.next/types/validator.js +56 -0
- package/dist/src/app/api/gateway/[...path]/route.js +1 -1
- package/dist/src/app/api/gateway/route.js +1 -1
- package/dist/src/app/api/ide/claude/apply/route.js +42 -31
- package/dist/src/app/api/ide/claude/status/route.js +6 -1
- package/dist/src/app/api/ide/openclaw/apply/route.js +92 -0
- package/dist/src/app/api/ide/openclaw/available-models/route.js +46 -0
- package/dist/src/app/api/ide/openclaw/build-config.js +101 -0
- package/dist/src/app/api/ide/openclaw/preview/route.js +49 -0
- package/dist/src/app/api/ide/openclaw/restore/route.js +24 -0
- package/dist/src/app/api/ide/openclaw/save/route.js +54 -0
- package/dist/src/app/api/ide/openclaw/status/route.js +139 -0
- package/dist/src/app/api/ide/openclaw/test/route.js +158 -0
- package/dist/src/app/api/ide/opencode/apply/route.js +89 -0
- package/dist/src/app/api/ide/opencode/available-models/route.js +46 -0
- package/dist/src/app/api/ide/opencode/build-config.js +54 -0
- package/dist/src/app/api/ide/opencode/preview/route.js +36 -0
- package/dist/src/app/api/ide/opencode/restore/route.js +40 -0
- package/dist/src/app/api/ide/opencode/save/route.js +123 -0
- package/dist/src/app/api/ide/opencode/status/route.js +106 -0
- package/dist/src/app/api/ide/opencode/test/route.js +136 -0
- package/dist/src/app/api/logs/route.js +2 -2
- package/dist/src/app/api/models/route.js +5 -5
- package/dist/src/app/api/providers/route.js +4 -4
- package/dist/src/app/api/providers/test/route.js +1 -1
- package/dist/src/app/api/service/start/route.js +1 -1
- package/dist/src/app/api/service/status/route.js +1 -1
- package/dist/src/app/api/service/stop/route.js +1 -1
- package/dist/src/app/ide/page.js +591 -81
- package/dist/src/app/logs/page.js +15 -1
- package/dist/src/cli/index.js +218 -20
- package/dist/src/db/database.js +56 -5
- package/dist/src/db/queries.js +6 -6
- package/dist/src/server/logger.js +22 -4
- package/package.json +2 -1
- package/src/app/api/gateway/[...path]/route.ts +1 -1
- package/src/app/api/gateway/route.ts +1 -1
- package/src/app/api/ide/claude/apply/route.ts +46 -31
- package/src/app/api/ide/claude/status/route.ts +12 -2
- package/src/app/api/ide/openclaw/apply/route.ts +103 -0
- package/src/app/api/ide/openclaw/available-models/route.ts +59 -0
- package/src/app/api/ide/openclaw/build-config.ts +152 -0
- package/src/app/api/ide/openclaw/preview/route.ts +57 -0
- package/src/app/api/ide/openclaw/restore/route.ts +27 -0
- package/src/app/api/ide/openclaw/save/route.ts +67 -0
- package/src/app/api/ide/openclaw/status/route.ts +178 -0
- package/src/app/api/ide/openclaw/test/route.ts +194 -0
- package/src/app/api/ide/opencode/apply/route.ts +92 -0
- package/src/app/api/ide/opencode/available-models/route.ts +59 -0
- package/src/app/api/ide/opencode/build-config.ts +69 -0
- package/src/app/api/ide/opencode/preview/route.ts +40 -0
- package/src/app/api/ide/opencode/restore/route.ts +52 -0
- package/src/app/api/ide/opencode/save/route.ts +131 -0
- package/src/app/api/ide/opencode/status/route.ts +128 -0
- package/src/app/api/ide/opencode/test/route.ts +145 -0
- package/src/app/api/logs/route.ts +2 -2
- package/src/app/api/models/route.ts +5 -5
- package/src/app/api/providers/route.ts +4 -4
- package/src/app/api/providers/test/route.ts +1 -1
- package/src/app/api/service/start/route.ts +1 -1
- package/src/app/api/service/status/route.ts +1 -1
- package/src/app/api/service/stop/route.ts +1 -1
- package/src/app/globals.css +17 -0
- package/src/app/ide/page.tsx +1535 -132
- package/src/app/logs/page.tsx +17 -5
- package/src/cli/index.ts +228 -25
- package/src/db/database.ts +60 -8
- package/src/db/queries.ts +6 -6
- package/src/server/logger.ts +19 -4
- package/.next/static/chunks/6418ca50028376b7.css +0 -1
- package/.next/static/chunks/9ec3b97741b6575e.js +0 -1
- /package/.next/static/{PkfqdzwOZgX-UhSNUuhdp → dYin74gcpdlg8TGoGv-_d}/_buildManifest.js +0 -0
- /package/.next/static/{PkfqdzwOZgX-UhSNUuhdp → dYin74gcpdlg8TGoGv-_d}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{PkfqdzwOZgX-UhSNUuhdp → dYin74gcpdlg8TGoGv-_d}/_ssgManifest.js +0 -0
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# AI Agent Router
|
|
2
2
|
|
|
3
|
-
一个统一的 API 网关,用于管理多个 AI 模型供应商(Anthropic、OpenAI、Gemini 等),为 Claude、
|
|
3
|
+
一个统一的 API 网关,用于管理多个 AI 模型供应商(Anthropic、OpenAI、Gemini 等),为 Claude、Cursor、Alma 等客户端提供统一接口。
|
|
4
4
|
|
|
5
5
|
## 功能特性
|
|
6
6
|
|
|
7
7
|
- ✅ 支持多种 AI 模型协议(OpenAI、Anthropic、Gemini)
|
|
8
|
-
- ✅
|
|
8
|
+
- ✅ 一键启动:前台 Web UI + 网关服务,默认后台运行
|
|
9
9
|
- ✅ Web 管理界面,可视化配置和管理
|
|
10
10
|
- ✅ 模型供应商管理(添加、编辑、删除)
|
|
11
11
|
- ✅ 模型管理(手动添加、自动拉取模型列表)
|
|
12
12
|
- ✅ 请求日志记录和查看(支持流式响应的美化展示)
|
|
13
13
|
- ✅ 双端点支持(`/v1/*` 和 `/api/gateway/*`)
|
|
14
|
-
- ✅ API Key
|
|
15
|
-
- ✅ CLI
|
|
16
|
-
- ✅ SQLite
|
|
14
|
+
- ✅ API Key 认证保护网关服务
|
|
15
|
+
- ✅ CLI 工具(`aar`),支持后台运行与 `aar stop` 停止
|
|
16
|
+
- ✅ SQLite 数据库,数据存储在 `~/.aar/`
|
|
17
17
|
|
|
18
18
|
## 安装
|
|
19
19
|
|
|
@@ -21,35 +21,69 @@
|
|
|
21
21
|
npm install -g ai-agent-router
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
安装后可使用命令 `aar` 或 `npx ai-agent-router`。
|
|
25
|
+
|
|
24
26
|
## 使用方法
|
|
25
27
|
|
|
26
|
-
###
|
|
28
|
+
### 启动服务(默认:后台运行 Web UI + 网关)
|
|
27
29
|
|
|
28
30
|
```bash
|
|
29
31
|
aar start
|
|
30
32
|
```
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
- **默认行为**:在后台同时启动 Web 管理界面和网关服务,关闭终端后进程继续运行。
|
|
35
|
+
- 前台 UI:`http://localhost:9527`
|
|
36
|
+
- 网关地址:`http://localhost:1357`(端口可在 Web 界面中配置)
|
|
37
|
+
|
|
38
|
+
启动后控制台会输出访问地址与网关状态,例如:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
-------------------------------------------
|
|
42
|
+
AI Agent Router
|
|
43
|
+
-------------------------------------------
|
|
44
|
+
前台 UI: http://localhost:9527
|
|
45
|
+
网关地址: http://localhost:1357
|
|
46
|
+
网关状态: 运行中
|
|
47
|
+
运行模式: 后台运行(关闭终端不影响)
|
|
48
|
+
停止服务: aar stop
|
|
49
|
+
-------------------------------------------
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 停止后台服务
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
aar stop
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
会停止由 `aar start` 在后台启动的 Web UI 与网关进程。
|
|
59
|
+
|
|
60
|
+
### 前台运行(附着当前终端)
|
|
33
61
|
|
|
34
|
-
|
|
62
|
+
若希望在前台运行、用 Ctrl+C 结束:
|
|
35
63
|
|
|
36
64
|
```bash
|
|
37
|
-
aar
|
|
65
|
+
aar start --no-background
|
|
38
66
|
```
|
|
39
67
|
|
|
40
|
-
|
|
68
|
+
### 仅启动 Web UI(不启动网关)
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
aar start --no-gateway
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
仅启动管理界面,网关可在 Web 界面里再手动启动。
|
|
41
75
|
|
|
42
76
|
### 配置选项
|
|
43
77
|
|
|
44
78
|
```bash
|
|
45
|
-
# 指定 Web UI
|
|
46
|
-
aar start
|
|
79
|
+
# 指定 Web UI 端口(默认 9527)
|
|
80
|
+
aar start -p 8080
|
|
47
81
|
|
|
48
|
-
#
|
|
49
|
-
aar start
|
|
82
|
+
# 指定网关端口(默认从配置或 1357)
|
|
83
|
+
aar start -g 3000
|
|
50
84
|
|
|
51
|
-
#
|
|
52
|
-
aar
|
|
85
|
+
# 组合:前台运行 + 自定义端口
|
|
86
|
+
aar start --no-background -p 9527 -g 1357
|
|
53
87
|
```
|
|
54
88
|
|
|
55
89
|
### 配置管理
|
|
@@ -58,93 +92,58 @@ aar gateway --port 3000
|
|
|
58
92
|
# 获取配置
|
|
59
93
|
aar config --get port
|
|
60
94
|
|
|
61
|
-
#
|
|
62
|
-
aar config --set port
|
|
63
|
-
|
|
64
|
-
# 设置 Gateway API Key(用于外部客户端认证)
|
|
95
|
+
# 设置配置(key 与 value 用空格分隔)
|
|
96
|
+
aar config --set port 1357
|
|
65
97
|
aar config --set api_key "your-secret-key"
|
|
66
98
|
```
|
|
67
99
|
|
|
100
|
+
常用配置项:`port`(网关端口)、`api_key`(网关 API Key,用于客户端认证)。
|
|
101
|
+
|
|
68
102
|
## Web 管理界面
|
|
69
103
|
|
|
70
|
-
启动后访问
|
|
104
|
+
启动后访问 **http://localhost:9527**,可以:
|
|
71
105
|
|
|
72
|
-
1.
|
|
106
|
+
1. **配置网关**:端口、API Key 等
|
|
73
107
|
2. **管理供应商**:添加、编辑、删除模型供应商
|
|
74
|
-
3.
|
|
75
|
-
4.
|
|
76
|
-
5.
|
|
77
|
-
|
|
78
|
-
## 添加供应商
|
|
79
|
-
|
|
80
|
-
1. 访问 Web 界面,进入"供应商"页面
|
|
81
|
-
2. 点击"添加供应商"
|
|
82
|
-
3. 填写信息:
|
|
83
|
-
- 名称:供应商名称(如 "OpenAI")
|
|
84
|
-
- 协议:选择协议类型(OpenAI、Anthropic、Gemini)
|
|
85
|
-
- Base URL:API 基础 URL(如 `https://api.openai.com/v1`)
|
|
86
|
-
- API Key:供应商的 API Key
|
|
87
|
-
|
|
88
|
-
## 添加模型
|
|
89
|
-
|
|
90
|
-
### 手动添加
|
|
108
|
+
3. **管理模型**:手动添加或一键拉取模型列表
|
|
109
|
+
4. **查看日志**:API 请求日志,含流式响应美化
|
|
110
|
+
5. **服务管理**:在界面内启动/停止网关(使用 `aar start` 时通常已自动启动)
|
|
91
111
|
|
|
92
|
-
|
|
93
|
-
2. 点击"手动添加"
|
|
94
|
-
3. 选择供应商,填写模型名称和模型 ID
|
|
112
|
+
## 添加供应商与模型
|
|
95
113
|
|
|
96
|
-
|
|
114
|
+
1. 打开 Web 界面 →「供应商」→「添加供应商」
|
|
115
|
+
2. 填写:名称、协议(OpenAI / Anthropic / Gemini)、Base URL、API Key
|
|
116
|
+
3. 在「模型」页可手动添加模型,或使用「拉取模型列表」从供应商拉取
|
|
97
117
|
|
|
98
|
-
|
|
99
|
-
2. 在"一键拉取模型列表"区域,点击对应供应商的"拉取模型"按钮
|
|
100
|
-
3. 系统会自动从供应商 API 拉取可用模型列表
|
|
118
|
+
## 使用网关 API
|
|
101
119
|
|
|
102
|
-
|
|
120
|
+
配置好供应商和模型后,客户端可请求网关(默认 `http://localhost:1357`)。
|
|
103
121
|
|
|
104
|
-
|
|
122
|
+
### OpenAI 兼容
|
|
105
123
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
Gateway 服务运行在 `http://localhost:1357`,支持两种兼容的端点:
|
|
109
|
-
|
|
110
|
-
#### OpenAI 兼容接口
|
|
111
|
-
|
|
112
|
-
```
|
|
124
|
+
```http
|
|
113
125
|
POST http://localhost:1357/v1/chat/completions
|
|
114
126
|
Content-Type: application/json
|
|
115
|
-
|
|
127
|
+
Authorization: Bearer your-gateway-api-key
|
|
116
128
|
|
|
117
129
|
{
|
|
118
130
|
"model": "gpt-4",
|
|
119
131
|
"messages": [...],
|
|
120
|
-
"stream": true
|
|
132
|
+
"stream": true
|
|
121
133
|
}
|
|
122
134
|
```
|
|
123
135
|
|
|
124
|
-
|
|
136
|
+
### 网关路径形式
|
|
125
137
|
|
|
126
|
-
```
|
|
138
|
+
```http
|
|
127
139
|
POST http://localhost:1357/api/gateway/v1/chat/completions
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
{
|
|
132
|
-
"model": "gpt-4",
|
|
133
|
-
"messages": [...],
|
|
134
|
-
"stream": true // 支持流式响应
|
|
135
|
-
}
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### 模型列表
|
|
139
|
-
|
|
140
|
-
```
|
|
141
|
-
GET http://localhost:1357/v1/models
|
|
142
|
-
GET http://localhost:1357/api/gateway/models
|
|
140
|
+
GET http://localhost:1357/v1/models
|
|
141
|
+
GET http://localhost:1357/api/gateway/models
|
|
143
142
|
```
|
|
144
143
|
|
|
145
|
-
### Anthropic
|
|
144
|
+
### Anthropic 兼容
|
|
146
145
|
|
|
147
|
-
```
|
|
146
|
+
```http
|
|
148
147
|
POST http://localhost:1357/api/gateway/v1/messages
|
|
149
148
|
Content-Type: application/json
|
|
150
149
|
x-api-key: your-gateway-api-key
|
|
@@ -155,63 +154,53 @@ x-api-key: your-gateway-api-key
|
|
|
155
154
|
}
|
|
156
155
|
```
|
|
157
156
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
- 如果配置了 Gateway API Key,客户端需要在请求头中提供:`x-api-key: your-gateway-api-key`
|
|
161
|
-
- 支持 Bearer token 格式:`Authorization: Bearer your-gateway-api-key`
|
|
157
|
+
认证:若在配置中设置了 API Key,请求头需带 `x-api-key` 或 `Authorization: Bearer <key>`。
|
|
162
158
|
|
|
163
159
|
## 开发
|
|
164
160
|
|
|
165
|
-
### 本地开发
|
|
166
|
-
|
|
167
161
|
```bash
|
|
168
162
|
# 安装依赖
|
|
169
163
|
npm install
|
|
170
164
|
|
|
171
|
-
#
|
|
165
|
+
# 开发模式(仅 Next 前台,端口 9527)
|
|
172
166
|
npm run dev
|
|
173
167
|
|
|
174
168
|
# 构建
|
|
175
169
|
npm run build
|
|
176
170
|
|
|
177
|
-
#
|
|
171
|
+
# 生产启动(等同 aar start,需先 build)
|
|
178
172
|
npm start
|
|
179
173
|
```
|
|
180
174
|
|
|
181
175
|
### 项目结构
|
|
182
176
|
|
|
183
177
|
```
|
|
184
|
-
|
|
185
|
-
├──
|
|
186
|
-
│ ├──
|
|
187
|
-
│
|
|
188
|
-
│
|
|
189
|
-
│
|
|
190
|
-
│
|
|
191
|
-
|
|
192
|
-
│ ├──
|
|
193
|
-
│
|
|
194
|
-
│
|
|
195
|
-
|
|
196
|
-
│ ├──
|
|
197
|
-
│
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
│ └── cli/ # CLI 入口
|
|
202
|
-
│ ├── index.ts # 主 CLI 程序
|
|
203
|
-
│ └── gateway-server.ts # Gateway CLI 入口
|
|
204
|
-
├── package.json
|
|
205
|
-
└── README.md
|
|
178
|
+
src/
|
|
179
|
+
├── server/ # 网关与后端
|
|
180
|
+
│ ├── gateway.ts # 网关请求处理
|
|
181
|
+
│ ├── gateway-server.ts # 独立网关 HTTP 服务
|
|
182
|
+
│ ├── service-manager.ts # 进程/服务管理
|
|
183
|
+
│ ├── providers/ # 各协议适配
|
|
184
|
+
│ └── logger.ts # 请求日志
|
|
185
|
+
├── db/ # SQLite(~/.aar/gateway.db)
|
|
186
|
+
│ ├── database.ts
|
|
187
|
+
│ ├── schema.ts
|
|
188
|
+
│ └── queries.ts
|
|
189
|
+
├── app/ # Next.js App Router
|
|
190
|
+
│ ├── api/ # API 路由(gateway、config、service 等)
|
|
191
|
+
│ └── (页面组件)
|
|
192
|
+
└── cli/ # CLI
|
|
193
|
+
├── index.ts # aar start / stop / config
|
|
194
|
+
└── gateway-server.ts # 独立网关进程入口
|
|
206
195
|
```
|
|
207
196
|
|
|
208
197
|
## 技术栈
|
|
209
198
|
|
|
210
|
-
- **Next.js
|
|
199
|
+
- **Next.js** - 全栈与 Web UI
|
|
211
200
|
- **TypeScript** - 类型安全
|
|
212
|
-
- **Tailwind CSS** -
|
|
213
|
-
- **
|
|
214
|
-
- **Commander.js** - CLI
|
|
201
|
+
- **Tailwind CSS** - 样式
|
|
202
|
+
- **SQLite (sql.js)** - 本地存储
|
|
203
|
+
- **Commander.js** - CLI
|
|
215
204
|
|
|
216
205
|
## 许可证
|
|
217
206
|
|
|
@@ -219,4 +208,4 @@ MIT
|
|
|
219
208
|
|
|
220
209
|
## 贡献
|
|
221
210
|
|
|
222
|
-
欢迎提交 Issue
|
|
211
|
+
欢迎提交 Issue 与 Pull Request。
|
|
@@ -63,6 +63,62 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
63
63
|
{
|
|
64
64
|
const handler = {};
|
|
65
65
|
}
|
|
66
|
+
// Validate ../../../src/app/api/ide/openclaw/apply/route.ts
|
|
67
|
+
{
|
|
68
|
+
const handler = {};
|
|
69
|
+
}
|
|
70
|
+
// Validate ../../../src/app/api/ide/openclaw/available-models/route.ts
|
|
71
|
+
{
|
|
72
|
+
const handler = {};
|
|
73
|
+
}
|
|
74
|
+
// Validate ../../../src/app/api/ide/openclaw/preview/route.ts
|
|
75
|
+
{
|
|
76
|
+
const handler = {};
|
|
77
|
+
}
|
|
78
|
+
// Validate ../../../src/app/api/ide/openclaw/restore/route.ts
|
|
79
|
+
{
|
|
80
|
+
const handler = {};
|
|
81
|
+
}
|
|
82
|
+
// Validate ../../../src/app/api/ide/openclaw/save/route.ts
|
|
83
|
+
{
|
|
84
|
+
const handler = {};
|
|
85
|
+
}
|
|
86
|
+
// Validate ../../../src/app/api/ide/openclaw/status/route.ts
|
|
87
|
+
{
|
|
88
|
+
const handler = {};
|
|
89
|
+
}
|
|
90
|
+
// Validate ../../../src/app/api/ide/openclaw/test/route.ts
|
|
91
|
+
{
|
|
92
|
+
const handler = {};
|
|
93
|
+
}
|
|
94
|
+
// Validate ../../../src/app/api/ide/opencode/apply/route.ts
|
|
95
|
+
{
|
|
96
|
+
const handler = {};
|
|
97
|
+
}
|
|
98
|
+
// Validate ../../../src/app/api/ide/opencode/available-models/route.ts
|
|
99
|
+
{
|
|
100
|
+
const handler = {};
|
|
101
|
+
}
|
|
102
|
+
// Validate ../../../src/app/api/ide/opencode/preview/route.ts
|
|
103
|
+
{
|
|
104
|
+
const handler = {};
|
|
105
|
+
}
|
|
106
|
+
// Validate ../../../src/app/api/ide/opencode/restore/route.ts
|
|
107
|
+
{
|
|
108
|
+
const handler = {};
|
|
109
|
+
}
|
|
110
|
+
// Validate ../../../src/app/api/ide/opencode/save/route.ts
|
|
111
|
+
{
|
|
112
|
+
const handler = {};
|
|
113
|
+
}
|
|
114
|
+
// Validate ../../../src/app/api/ide/opencode/status/route.ts
|
|
115
|
+
{
|
|
116
|
+
const handler = {};
|
|
117
|
+
}
|
|
118
|
+
// Validate ../../../src/app/api/ide/opencode/test/route.ts
|
|
119
|
+
{
|
|
120
|
+
const handler = {};
|
|
121
|
+
}
|
|
66
122
|
// Validate ../../../src/app/api/logs/route.ts
|
|
67
123
|
{
|
|
68
124
|
const handler = {};
|
|
@@ -63,6 +63,62 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
63
63
|
{
|
|
64
64
|
const handler = {};
|
|
65
65
|
}
|
|
66
|
+
// Validate ../../src/app/api/ide/openclaw/apply/route.ts
|
|
67
|
+
{
|
|
68
|
+
const handler = {};
|
|
69
|
+
}
|
|
70
|
+
// Validate ../../src/app/api/ide/openclaw/available-models/route.ts
|
|
71
|
+
{
|
|
72
|
+
const handler = {};
|
|
73
|
+
}
|
|
74
|
+
// Validate ../../src/app/api/ide/openclaw/preview/route.ts
|
|
75
|
+
{
|
|
76
|
+
const handler = {};
|
|
77
|
+
}
|
|
78
|
+
// Validate ../../src/app/api/ide/openclaw/restore/route.ts
|
|
79
|
+
{
|
|
80
|
+
const handler = {};
|
|
81
|
+
}
|
|
82
|
+
// Validate ../../src/app/api/ide/openclaw/save/route.ts
|
|
83
|
+
{
|
|
84
|
+
const handler = {};
|
|
85
|
+
}
|
|
86
|
+
// Validate ../../src/app/api/ide/openclaw/status/route.ts
|
|
87
|
+
{
|
|
88
|
+
const handler = {};
|
|
89
|
+
}
|
|
90
|
+
// Validate ../../src/app/api/ide/openclaw/test/route.ts
|
|
91
|
+
{
|
|
92
|
+
const handler = {};
|
|
93
|
+
}
|
|
94
|
+
// Validate ../../src/app/api/ide/opencode/apply/route.ts
|
|
95
|
+
{
|
|
96
|
+
const handler = {};
|
|
97
|
+
}
|
|
98
|
+
// Validate ../../src/app/api/ide/opencode/available-models/route.ts
|
|
99
|
+
{
|
|
100
|
+
const handler = {};
|
|
101
|
+
}
|
|
102
|
+
// Validate ../../src/app/api/ide/opencode/preview/route.ts
|
|
103
|
+
{
|
|
104
|
+
const handler = {};
|
|
105
|
+
}
|
|
106
|
+
// Validate ../../src/app/api/ide/opencode/restore/route.ts
|
|
107
|
+
{
|
|
108
|
+
const handler = {};
|
|
109
|
+
}
|
|
110
|
+
// Validate ../../src/app/api/ide/opencode/save/route.ts
|
|
111
|
+
{
|
|
112
|
+
const handler = {};
|
|
113
|
+
}
|
|
114
|
+
// Validate ../../src/app/api/ide/opencode/status/route.ts
|
|
115
|
+
{
|
|
116
|
+
const handler = {};
|
|
117
|
+
}
|
|
118
|
+
// Validate ../../src/app/api/ide/opencode/test/route.ts
|
|
119
|
+
{
|
|
120
|
+
const handler = {};
|
|
121
|
+
}
|
|
66
122
|
// Validate ../../src/app/api/logs/route.ts
|
|
67
123
|
{
|
|
68
124
|
const handler = {};
|
|
@@ -33,7 +33,7 @@ async function DELETE(request, { params }) {
|
|
|
33
33
|
}
|
|
34
34
|
async function handleRequest(request, params, method) {
|
|
35
35
|
try {
|
|
36
|
-
(0, database_1.getDatabase)();
|
|
36
|
+
await (0, database_1.getDatabase)();
|
|
37
37
|
const path = params.path.join('/');
|
|
38
38
|
const searchParams = request.nextUrl.searchParams;
|
|
39
39
|
// Get model ID from query
|
|
@@ -17,7 +17,7 @@ async function GET(request) {
|
|
|
17
17
|
}
|
|
18
18
|
async function handleGatewayRequestDirect(request, method) {
|
|
19
19
|
try {
|
|
20
|
-
(0, database_1.getDatabase)();
|
|
20
|
+
await (0, database_1.getDatabase)();
|
|
21
21
|
const searchParams = request.nextUrl.searchParams;
|
|
22
22
|
let modelId = searchParams.get('model') || searchParams.get('model_id');
|
|
23
23
|
const providerName = searchParams.get('provider');
|
|
@@ -32,27 +32,40 @@ async function POST(request) {
|
|
|
32
32
|
// 获取当前网关地址和API Key(从数据库读取)
|
|
33
33
|
const gatewayAddress = await getGatewayAddress();
|
|
34
34
|
const gatewayApiKey = await getGatewayApiKey();
|
|
35
|
-
// 生成配置对象
|
|
36
35
|
const modelMapping = { haiku, sonnet, opus, default: defaultModel, reasoning: reasoningModel };
|
|
37
|
-
const
|
|
38
|
-
// 备份原有配置
|
|
36
|
+
const aarEnv = buildAarEnv(gatewayAddress, gatewayApiKey, modelMapping);
|
|
39
37
|
const backupResult = backupOriginalConfig();
|
|
40
38
|
if (!backupResult.success) {
|
|
41
39
|
return server_1.NextResponse.json({ error: backupResult.error }, { status: 500 });
|
|
42
40
|
}
|
|
43
|
-
// 确保目录存在
|
|
44
41
|
if (!(0, fs_1.existsSync)(CLAUDE_DIR)) {
|
|
45
42
|
(0, fs_1.mkdirSync)(CLAUDE_DIR, { recursive: true });
|
|
46
43
|
}
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
let configToWrite;
|
|
45
|
+
if ((0, fs_1.existsSync)(SETTINGS_FILE)) {
|
|
46
|
+
try {
|
|
47
|
+
const existing = JSON.parse((0, fs_1.readFileSync)(SETTINGS_FILE, 'utf-8'));
|
|
48
|
+
configToWrite = {
|
|
49
|
+
...existing,
|
|
50
|
+
env: { ...(existing.env || {}), ...aarEnv },
|
|
51
|
+
router_provider: 'aar',
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
configToWrite = generateClaudeConfig(gatewayAddress, gatewayApiKey, modelMapping);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
configToWrite = generateClaudeConfig(gatewayAddress, gatewayApiKey, modelMapping);
|
|
60
|
+
}
|
|
61
|
+
const validationResult = validateAndWriteConfig(configToWrite);
|
|
49
62
|
if (!validationResult.success) {
|
|
50
63
|
return server_1.NextResponse.json({ error: validationResult.error }, { status: 500 });
|
|
51
64
|
}
|
|
52
65
|
return server_1.NextResponse.json({
|
|
53
66
|
success: true,
|
|
54
67
|
message: 'Configuration applied successfully',
|
|
55
|
-
config,
|
|
68
|
+
config: configToWrite,
|
|
56
69
|
backup: backupResult.existed ? 'Created backup' : 'No existing config to backup',
|
|
57
70
|
previousWasFromAar: backupResult.existed && backupResult.isFromAar,
|
|
58
71
|
});
|
|
@@ -80,50 +93,48 @@ async function getGatewayApiKey() {
|
|
|
80
93
|
const apiKeyConfig = await (0, queries_1.getConfig)('api_key');
|
|
81
94
|
return apiKeyConfig?.value || 'your-gateway-api-key';
|
|
82
95
|
}
|
|
83
|
-
/**
|
|
84
|
-
|
|
85
|
-
|
|
96
|
+
/** 仅生成 AAR 相关的 env 字段,用于合并到现有配置 */
|
|
97
|
+
function buildAarEnv(gatewayAddress, gatewayApiKey, modelMapping) {
|
|
98
|
+
return {
|
|
99
|
+
ANTHROPIC_AUTH_TOKEN: gatewayApiKey,
|
|
100
|
+
ANTHROPIC_BASE_URL: gatewayAddress,
|
|
101
|
+
ANTHROPIC_DEFAULT_HAIKU_MODEL: modelMapping.haiku,
|
|
102
|
+
ANTHROPIC_DEFAULT_OPUS_MODEL: modelMapping.opus,
|
|
103
|
+
ANTHROPIC_DEFAULT_SONNET_MODEL: modelMapping.sonnet,
|
|
104
|
+
ANTHROPIC_MODEL: modelMapping.default,
|
|
105
|
+
ANTHROPIC_REASONING_MODEL: modelMapping.reasoning,
|
|
106
|
+
API_TIMEOUT_MS: '3000000',
|
|
107
|
+
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: 1,
|
|
108
|
+
hasCompletedOnboarding: true,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** 生成完整 Claude 配置(仅在无现有文件时使用) */
|
|
86
112
|
function generateClaudeConfig(gatewayAddress, gatewayApiKey, modelMapping) {
|
|
87
113
|
return {
|
|
88
|
-
// 路由提供者标识,标识配置来自当前工具 aar
|
|
89
114
|
router_provider: 'aar',
|
|
90
|
-
env:
|
|
91
|
-
ANTHROPIC_AUTH_TOKEN: gatewayApiKey,
|
|
92
|
-
ANTHROPIC_BASE_URL: gatewayAddress,
|
|
93
|
-
ANTHROPIC_DEFAULT_HAIKU_MODEL: modelMapping.haiku,
|
|
94
|
-
ANTHROPIC_DEFAULT_OPUS_MODEL: modelMapping.opus,
|
|
95
|
-
ANTHROPIC_DEFAULT_SONNET_MODEL: modelMapping.sonnet,
|
|
96
|
-
ANTHROPIC_MODEL: modelMapping.default,
|
|
97
|
-
ANTHROPIC_REASONING_MODEL: modelMapping.reasoning,
|
|
98
|
-
API_TIMEOUT_MS: '3000000',
|
|
99
|
-
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: 1,
|
|
100
|
-
hasCompletedOnboarding: true,
|
|
101
|
-
},
|
|
115
|
+
env: buildAarEnv(gatewayAddress, gatewayApiKey, modelMapping),
|
|
102
116
|
};
|
|
103
117
|
}
|
|
104
118
|
/**
|
|
105
119
|
* 备份原有配置
|
|
106
|
-
*
|
|
120
|
+
* 仅在当前配置不是 AAR 时写入备份,这样「还原」才能恢复到应用 AAR 前的状态
|
|
107
121
|
*/
|
|
108
122
|
function backupOriginalConfig() {
|
|
109
123
|
try {
|
|
110
|
-
// 检查原有配置是否存在
|
|
111
124
|
const existing = (0, fs_1.existsSync)(SETTINGS_FILE);
|
|
112
125
|
if (existing) {
|
|
113
|
-
// 读取原有配置
|
|
114
126
|
const originalConfig = (0, fs_1.readFileSync)(SETTINGS_FILE, 'utf-8');
|
|
115
|
-
// 解析配置检查 router_provider
|
|
116
127
|
let isFromAar = false;
|
|
117
128
|
try {
|
|
118
129
|
const parsedConfig = JSON.parse(originalConfig);
|
|
119
130
|
isFromAar = parsedConfig.router_provider === 'aar';
|
|
120
131
|
}
|
|
121
|
-
catch
|
|
122
|
-
// 解析失败,不影响备份操作
|
|
132
|
+
catch {
|
|
123
133
|
isFromAar = false;
|
|
124
134
|
}
|
|
125
|
-
|
|
126
|
-
|
|
135
|
+
if (!isFromAar) {
|
|
136
|
+
(0, fs_1.writeFileSync)(BACKUP_FILE, originalConfig, 'utf-8');
|
|
137
|
+
}
|
|
127
138
|
return { success: true, existed: true, isFromAar };
|
|
128
139
|
}
|
|
129
140
|
return { success: true, existed: false, isFromAar: false };
|
|
@@ -45,6 +45,8 @@ async function GET(request) {
|
|
|
45
45
|
lastUpdated: undefined,
|
|
46
46
|
matchCurrentGateway: false,
|
|
47
47
|
routerProvider: undefined,
|
|
48
|
+
currentGatewayAddress: gatewayAddress,
|
|
49
|
+
currentGatewayApiKey: gatewayApiKey,
|
|
48
50
|
});
|
|
49
51
|
}
|
|
50
52
|
// 读取配置文件
|
|
@@ -78,7 +80,7 @@ async function GET(request) {
|
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
|
-
//
|
|
83
|
+
// 提取配置状态;返回完整 config 供前端在非 AAR 时展示原有配置文件
|
|
82
84
|
const status = {
|
|
83
85
|
applied: true,
|
|
84
86
|
modelMapping: extractModelMapping(config),
|
|
@@ -89,6 +91,9 @@ async function GET(request) {
|
|
|
89
91
|
matchCurrentGateway,
|
|
90
92
|
routerProvider: config.router_provider,
|
|
91
93
|
tempMapping,
|
|
94
|
+
config,
|
|
95
|
+
currentGatewayAddress: gatewayAddress,
|
|
96
|
+
currentGatewayApiKey: gatewayApiKey,
|
|
92
97
|
};
|
|
93
98
|
return server_1.NextResponse.json(status);
|
|
94
99
|
}
|