ai-agent-router 0.2.2 → 0.2.4
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 +4 -1
- package/.next/build/chunks/{[root-of-the-server]__6d51cb5d._.js → [root-of-the-server]__0iv9ksq._.js} +1 -1
- package/.next/build/chunks/[root-of-the-server]__0iv9ksq._.js.map +8 -0
- package/.next/build/chunks/{[root-of-the-server]__44695d76._.js → [root-of-the-server]__0rua-~2._.js} +30 -30
- package/.next/build/chunks/[root-of-the-server]__0rua-~2._.js.map +11 -0
- package/.next/build/chunks/{[turbopack-node]_transforms_postcss_ts_df7a5b11._.js → [turbopack-node]_transforms_postcss_ts_0nnejqq._.js} +2 -2
- package/.next/build/chunks/[turbopack]_runtime.js +155 -60
- package/.next/build/chunks/[turbopack]_runtime.js.map +6 -5
- package/.next/build/chunks/{node_modules_fe693df6._.js → node_modules_13sb.px._.js} +1 -1
- package/.next/build/chunks/{node_modules_fe693df6._.js.map → node_modules_13sb.px._.js.map} +42 -42
- package/.next/build/postcss.js +5 -5
- package/.next/build-manifest.json +8 -7
- package/.next/diagnostics/framework.json +1 -1
- package/.next/diagnostics/route-bundle-stats.json +93 -0
- package/.next/fallback-build-manifest.json +3 -2
- package/.next/images-manifest.json +1 -0
- package/.next/next-minimal-server.js.nft.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +33 -9
- package/.next/required-server-files.js +18 -6
- package/.next/required-server-files.json +18 -6
- package/.next/routes-manifest.json +19 -0
- package/.next/server/app/_global-error/page/build-manifest.json +5 -5
- package/.next/server/app/_global-error/page.js +8 -9
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +2 -1
- package/.next/server/app/_global-error.html +1 -2
- package/.next/server/app/_global-error.rsc +11 -9
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_global-error.segments/_full.segment.rsc +11 -9
- package/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
- package/.next/server/app/_global-error.segments/_index.segment.rsc +4 -3
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/build-manifest.json +5 -5
- package/.next/server/app/_not-found/page.js +11 -12
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +2 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +13 -11
- package/.next/server/app/_not-found.segments/_full.segment.rsc +13 -11
- package/.next/server/app/_not-found.segments/_head.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_index.segment.rsc +5 -5
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +4 -3
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/config/route/build-manifest.json +1 -3
- package/.next/server/app/api/config/route.js +4 -4
- package/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/server/app/api/config/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/gateway/[...path]/route/build-manifest.json +1 -3
- package/.next/server/app/api/gateway/[...path]/route.js +5 -5
- package/.next/server/app/api/gateway/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/gateway/[...path]/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/gateway/models/route/build-manifest.json +1 -3
- package/.next/server/app/api/gateway/models/route.js +4 -4
- package/.next/server/app/api/gateway/models/route.js.nft.json +1 -1
- package/.next/server/app/api/gateway/models/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/gateway/route/build-manifest.json +1 -3
- package/.next/server/app/api/gateway/route.js +5 -5
- package/.next/server/app/api/gateway/route.js.nft.json +1 -1
- package/.next/server/app/api/gateway/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/claude/apply/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/claude/apply/route.js +4 -4
- package/.next/server/app/api/ide/claude/apply/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/claude/apply/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/claude/available-models/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/claude/available-models/route.js +4 -4
- package/.next/server/app/api/ide/claude/available-models/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/claude/available-models/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/claude/restore/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/claude/restore/route.js +3 -3
- package/.next/server/app/api/ide/claude/restore/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/claude/restore/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/claude/save/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/claude/save/route.js +4 -4
- package/.next/server/app/api/ide/claude/save/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/claude/save/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/claude/status/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/claude/status/route.js +4 -4
- package/.next/server/app/api/ide/claude/status/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/claude/status/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/claude/test/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/claude/test/route.js +5 -5
- package/.next/server/app/api/ide/claude/test/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/claude/test/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/openclaw/apply/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/openclaw/apply/route.js +4 -4
- package/.next/server/app/api/ide/openclaw/apply/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/openclaw/apply/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/openclaw/available-models/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/openclaw/available-models/route.js +4 -4
- package/.next/server/app/api/ide/openclaw/available-models/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/openclaw/available-models/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/openclaw/preview/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/openclaw/preview/route.js +4 -4
- package/.next/server/app/api/ide/openclaw/preview/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/openclaw/preview/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/openclaw/restore/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/openclaw/restore/route.js +3 -3
- package/.next/server/app/api/ide/openclaw/restore/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/openclaw/restore/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/openclaw/save/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/openclaw/save/route.js +4 -4
- package/.next/server/app/api/ide/openclaw/save/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/openclaw/save/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/openclaw/status/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/openclaw/status/route.js +4 -4
- package/.next/server/app/api/ide/openclaw/status/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/openclaw/status/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/openclaw/test/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/openclaw/test/route.js +3 -3
- package/.next/server/app/api/ide/openclaw/test/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/openclaw/test/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/opencode/apply/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/opencode/apply/route.js +4 -4
- package/.next/server/app/api/ide/opencode/apply/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/opencode/apply/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/opencode/available-models/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/opencode/available-models/route.js +4 -4
- package/.next/server/app/api/ide/opencode/available-models/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/opencode/available-models/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/opencode/preview/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/opencode/preview/route.js +4 -4
- package/.next/server/app/api/ide/opencode/preview/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/opencode/preview/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/opencode/restore/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/opencode/restore/route.js +3 -3
- package/.next/server/app/api/ide/opencode/restore/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/opencode/restore/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/opencode/save/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/opencode/save/route.js +4 -4
- package/.next/server/app/api/ide/opencode/save/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/opencode/save/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/opencode/status/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/opencode/status/route.js +4 -4
- package/.next/server/app/api/ide/opencode/status/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/opencode/status/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/ide/opencode/test/route/build-manifest.json +1 -3
- package/.next/server/app/api/ide/opencode/test/route.js +3 -3
- package/.next/server/app/api/ide/opencode/test/route.js.nft.json +1 -1
- package/.next/server/app/api/ide/opencode/test/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/logs/route/build-manifest.json +1 -3
- package/.next/server/app/api/logs/route.js +4 -4
- package/.next/server/app/api/logs/route.js.nft.json +1 -1
- package/.next/server/app/api/logs/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/models/route/build-manifest.json +1 -3
- package/.next/server/app/api/models/route.js +5 -5
- package/.next/server/app/api/models/route.js.nft.json +1 -1
- package/.next/server/app/api/models/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/providers/route/build-manifest.json +1 -3
- package/.next/server/app/api/providers/route.js +5 -5
- package/.next/server/app/api/providers/route.js.nft.json +1 -1
- package/.next/server/app/api/providers/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/providers/test/route/build-manifest.json +1 -3
- package/.next/server/app/api/providers/test/route.js +5 -5
- package/.next/server/app/api/providers/test/route.js.nft.json +1 -1
- package/.next/server/app/api/providers/test/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/service/force-stop/route/build-manifest.json +1 -3
- package/.next/server/app/api/service/force-stop/route.js +4 -4
- package/.next/server/app/api/service/force-stop/route.js.nft.json +1 -1
- package/.next/server/app/api/service/force-stop/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/service/start/route/build-manifest.json +1 -3
- package/.next/server/app/api/service/start/route.js +4 -4
- package/.next/server/app/api/service/start/route.js.nft.json +1 -1
- package/.next/server/app/api/service/start/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/service/status/route/build-manifest.json +1 -3
- package/.next/server/app/api/service/status/route.js +4 -4
- package/.next/server/app/api/service/status/route.js.nft.json +1 -1
- package/.next/server/app/api/service/status/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/service/stop/route/build-manifest.json +1 -3
- package/.next/server/app/api/service/stop/route.js +4 -4
- package/.next/server/app/api/service/stop/route.js.nft.json +1 -1
- package/.next/server/app/api/service/stop/route_client-reference-manifest.js +2 -1
- package/.next/server/app/api/tokenizer/history/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/tokenizer/history/route/build-manifest.json +9 -0
- package/.next/server/app/api/tokenizer/history/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/tokenizer/history/route.js +7 -0
- package/.next/server/app/api/tokenizer/history/route.js.map +5 -0
- package/.next/server/app/api/tokenizer/history/route.js.nft.json +1 -0
- package/.next/server/app/api/tokenizer/history/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/tokenizer/test/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/tokenizer/test/route/build-manifest.json +9 -0
- package/.next/server/app/api/tokenizer/test/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/tokenizer/test/route.js +8 -0
- package/.next/server/app/api/tokenizer/test/route.js.map +5 -0
- package/.next/server/app/api/tokenizer/test/route.js.nft.json +1 -0
- package/.next/server/app/api/tokenizer/test/route_client-reference-manifest.js +3 -0
- package/.next/server/app/ide/page/build-manifest.json +5 -5
- package/.next/server/app/ide/page.js +12 -14
- package/.next/server/app/ide/page.js.nft.json +1 -1
- package/.next/server/app/ide/page_client-reference-manifest.js +2 -1
- package/.next/server/app/ide.html +1 -1
- package/.next/server/app/ide.rsc +15 -13
- package/.next/server/app/ide.segments/_full.segment.rsc +15 -13
- package/.next/server/app/ide.segments/_head.segment.rsc +3 -3
- package/.next/server/app/ide.segments/_index.segment.rsc +5 -5
- package/.next/server/app/ide.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/ide.segments/ide/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/ide.segments/ide.segment.rsc +4 -3
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +11 -11
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/index.segments/_full.segment.rsc +11 -11
- package/.next/server/app/index.segments/_head.segment.rsc +3 -3
- package/.next/server/app/index.segments/_index.segment.rsc +5 -5
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/logs/page/build-manifest.json +5 -5
- package/.next/server/app/logs/page.js +12 -14
- package/.next/server/app/logs/page.js.nft.json +1 -1
- package/.next/server/app/logs/page_client-reference-manifest.js +2 -1
- package/.next/server/app/logs.html +1 -1
- package/.next/server/app/logs.rsc +15 -13
- package/.next/server/app/logs.segments/_full.segment.rsc +15 -13
- package/.next/server/app/logs.segments/_head.segment.rsc +3 -3
- package/.next/server/app/logs.segments/_index.segment.rsc +5 -5
- package/.next/server/app/logs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/logs.segments/logs.segment.rsc +4 -3
- package/.next/server/app/models/page/build-manifest.json +5 -5
- package/.next/server/app/models/page.js +12 -14
- package/.next/server/app/models/page.js.nft.json +1 -1
- package/.next/server/app/models/page_client-reference-manifest.js +2 -1
- package/.next/server/app/models.html +1 -1
- package/.next/server/app/models.rsc +15 -13
- package/.next/server/app/models.segments/_full.segment.rsc +15 -13
- package/.next/server/app/models.segments/_head.segment.rsc +3 -3
- package/.next/server/app/models.segments/_index.segment.rsc +5 -5
- package/.next/server/app/models.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/models.segments/models/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/models.segments/models.segment.rsc +4 -3
- package/.next/server/app/page/build-manifest.json +5 -5
- package/.next/server/app/page.js +12 -14
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +2 -1
- package/.next/server/app/providers/page/build-manifest.json +5 -5
- package/.next/server/app/providers/page.js +12 -14
- package/.next/server/app/providers/page.js.nft.json +1 -1
- package/.next/server/app/providers/page_client-reference-manifest.js +2 -1
- package/.next/server/app/providers.html +1 -1
- package/.next/server/app/providers.rsc +15 -13
- package/.next/server/app/providers.segments/_full.segment.rsc +15 -13
- package/.next/server/app/providers.segments/_head.segment.rsc +3 -3
- package/.next/server/app/providers.segments/_index.segment.rsc +5 -5
- package/.next/server/app/providers.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/providers.segments/providers/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/providers.segments/providers.segment.rsc +4 -3
- package/.next/server/app/tokenizer/page/app-paths-manifest.json +3 -0
- package/.next/server/app/tokenizer/page/build-manifest.json +16 -0
- package/.next/server/app/tokenizer/page/next-font-manifest.json +6 -0
- package/.next/server/app/tokenizer/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/tokenizer/page/server-reference-manifest.json +4 -0
- package/.next/server/app/tokenizer/page.js +13 -0
- package/.next/server/app/tokenizer/page.js.map +5 -0
- package/.next/server/app/tokenizer/page.js.nft.json +1 -0
- package/.next/server/app/tokenizer/page_client-reference-manifest.js +3 -0
- package/.next/server/app/tokenizer.html +1 -0
- package/.next/server/app/tokenizer.meta +15 -0
- package/.next/server/app/tokenizer.rsc +20 -0
- package/.next/server/app/tokenizer.segments/_full.segment.rsc +20 -0
- package/.next/server/app/tokenizer.segments/_head.segment.rsc +5 -0
- package/.next/server/app/tokenizer.segments/_index.segment.rsc +6 -0
- package/.next/server/app/tokenizer.segments/_tree.segment.rsc +2 -0
- package/.next/server/app/tokenizer.segments/tokenizer/__PAGE__.segment.rsc +9 -0
- package/.next/server/app/tokenizer.segments/tokenizer.segment.rsc +5 -0
- package/.next/server/app-paths-manifest.json +4 -1
- package/.next/server/chunks/0zjb_server_app_api_ide_openclaw_available-models_route_actions_0.gjr6a.js +3 -0
- package/.next/server/chunks/0zjb_server_app_api_ide_opencode_available-models_route_actions_0poyhyk.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0-_5z3v._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0-_5z3v._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__012ucp~._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__012ucp~._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__01atdgx._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__01atdgx._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__01~ft76._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__01~ft76._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__04sfkei._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__04sfkei._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__065r.wp._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__065r.wp._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__07pm7px._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__07pm7px._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__07vosna._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__07vosna._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__083j1v0._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__083j1v0._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__08_ekvs._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__08_ekvs._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__08ftz8n._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__08ftz8n._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__08oq8ma._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__08oq8ma._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__099b1my._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__099b1my._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0aw-~h8._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0aw-~h8._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0dj43ut._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0dj43ut._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0efv_yh._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0efv_yh._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0el37wu._.js +7 -0
- package/.next/server/chunks/[root-of-the-server]__0el37wu._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0g.1w-q._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0g.1w-q._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0im~-m7._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0im~-m7._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0jf1q27._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0jf1q27._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0kldv62._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0kldv62._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0lr16iw._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0lr16iw._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0m62mql._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0m62mql._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0qp1t_m._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0qp1t_m._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0qz-m.u._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0qz-m.u._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0r235yd._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0r235yd._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0rjkw2y._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0rjkw2y._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0uaqs.r._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0uaqs.r._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0vktxod._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0vktxod._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0vlh9um._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0vlh9um._.js.map +1 -0
- package/.next/server/chunks/{[root-of-the-server]__c1b4b601._.js → [root-of-the-server]__0xb5i_t._.js} +21 -9
- package/.next/server/chunks/[root-of-the-server]__0xb5i_t._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0xsal5d._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0xsal5d._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0yo.c6n._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0yo.c6n._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__0yz0y4l._.js +13 -0
- package/.next/server/chunks/[root-of-the-server]__0yz0y4l._.js.map +1 -0
- package/.next/server/chunks/{[root-of-the-server]__e7623a6c._.js → [root-of-the-server]__11srlmi._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__e7623a6c._.js.map → [root-of-the-server]__11srlmi._.js.map} +1 -1
- package/.next/server/chunks/[root-of-the-server]__12d44rt._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__12d44rt._.js.map +1 -0
- package/.next/server/chunks/[turbopack]_runtime.js +168 -60
- package/.next/server/chunks/[turbopack]_runtime.js.map +6 -5
- package/.next/server/chunks/_0v0oe6c._.js +3 -0
- package/.next/server/chunks/{_b48847f5._.js.map → _0v0oe6c._.js.map} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_config_route_actions_308a9f33.js → _next-internal_server_app_api_config_route_actions_08dm.dx.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_gateway_[___path]_route_actions_835b2379.js → _next-internal_server_app_api_gateway_[___path]_route_actions_0mmqyo7.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_gateway_models_route_actions_302c9983.js → _next-internal_server_app_api_gateway_models_route_actions_08b214z.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_gateway_route_actions_e5e7405d.js → _next-internal_server_app_api_gateway_route_actions_0.jzdw1.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_claude_apply_route_actions_5056516c.js → _next-internal_server_app_api_ide_claude_apply_route_actions_0dw2_pf.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_claude_available-models_route_actions_94d710a0.js → _next-internal_server_app_api_ide_claude_available-models_route_actions_0pmwy75.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_claude_restore_route_actions_f37acc94.js → _next-internal_server_app_api_ide_claude_restore_route_actions_11x77hl.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_claude_save_route_actions_407c55f5.js → _next-internal_server_app_api_ide_claude_save_route_actions_0b35ro_.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_claude_status_route_actions_5ac73db8.js → _next-internal_server_app_api_ide_claude_status_route_actions_0fnw-w7.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_claude_test_route_actions_70587902.js → _next-internal_server_app_api_ide_claude_test_route_actions_0jc1czy.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_openclaw_apply_route_actions_2cb9e4b4.js → _next-internal_server_app_api_ide_openclaw_apply_route_actions_07re971.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_openclaw_preview_route_actions_9814a8e4.js → _next-internal_server_app_api_ide_openclaw_preview_route_actions_0q53p05.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_openclaw_restore_route_actions_10ad8f9d.js → _next-internal_server_app_api_ide_openclaw_restore_route_actions_02yog9-.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_openclaw_save_route_actions_044ad081.js → _next-internal_server_app_api_ide_openclaw_save_route_actions_00tjxsz.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_openclaw_status_route_actions_ed9786d2.js → _next-internal_server_app_api_ide_openclaw_status_route_actions_10wsun4.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_openclaw_test_route_actions_ce2cb808.js → _next-internal_server_app_api_ide_openclaw_test_route_actions_0zgwyon.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_opencode_apply_route_actions_6c422244.js → _next-internal_server_app_api_ide_opencode_apply_route_actions_0in-w.g.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_opencode_preview_route_actions_256c82e0.js → _next-internal_server_app_api_ide_opencode_preview_route_actions_06h6.w~.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_opencode_restore_route_actions_371993d3.js → _next-internal_server_app_api_ide_opencode_restore_route_actions_09ipt-l.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_opencode_save_route_actions_6e4c9c41.js → _next-internal_server_app_api_ide_opencode_save_route_actions_0i-~x79.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_opencode_status_route_actions_498ad77b.js → _next-internal_server_app_api_ide_opencode_status_route_actions_0cpf6rv.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_ide_opencode_test_route_actions_c71be510.js → _next-internal_server_app_api_ide_opencode_test_route_actions_0y8aq8h.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_logs_route_actions_30a87f47.js → _next-internal_server_app_api_logs_route_actions_08ef2j7.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_models_route_actions_b6abdc83.js → _next-internal_server_app_api_models_route_actions_0vfccm4.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_providers_route_actions_5388b373.js → _next-internal_server_app_api_providers_route_actions_0ee1p_m.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_providers_test_route_actions_b97ab15a.js → _next-internal_server_app_api_providers_test_route_actions_0vyo652.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_service_force-stop_route_actions_95eba80b.js → _next-internal_server_app_api_service_force-stop_route_actions_0pu9xrq.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_service_start_route_actions_d50efb77.js → _next-internal_server_app_api_service_start_route_actions_0_o53a2.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_service_status_route_actions_30149042.js → _next-internal_server_app_api_service_status_route_actions_08ag8v4.js} +1 -1
- package/.next/server/chunks/{_next-internal_server_app_api_service_stop_route_actions_19443941.js → _next-internal_server_app_api_service_stop_route_actions_04dp83p.js} +1 -1
- package/.next/server/chunks/_next-internal_server_app_api_tokenizer_history_route_actions_09~nqtd.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_tokenizer_test_route_actions_0t2swp-.js +3 -0
- package/.next/server/chunks/{node_modules_next_dist_esm_build_templates_app-route_4be65264.js → node_modules_next_dist_esm_build_templates_app-route_0d1n5~u.js} +6 -6
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0d1n5~u.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0.zquoa._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0.zquoa._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__01dqyhh._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__01dqyhh._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__04qwc64._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__04qwc64._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__06r_ug4._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__06r_ug4._.js.map +1 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__f92001a5._.js → [root-of-the-server]__0814l01._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0814l01._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0gb1hlj._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0gb1hlj._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0p8tmu2._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0p8tmu2._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0rf3.7n._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0rf3.7n._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0~6rwng._.js +33 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0~6rwng._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__10xgshr._.js +33 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__10xgshr._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__11i~7lq._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__11i~7lq._.js.map +1 -0
- package/.next/server/chunks/ssr/[turbopack]_runtime.js +168 -60
- package/.next/server/chunks/ssr/[turbopack]_runtime.js.map +6 -5
- package/.next/server/chunks/ssr/_0k83omg._.js +6 -0
- package/.next/server/chunks/ssr/_0k83omg._.js.map +1 -0
- package/.next/server/chunks/ssr/_0yyi5po._.js +3 -0
- package/.next/server/chunks/ssr/_0yyi5po._.js.map +1 -0
- package/.next/server/chunks/ssr/{_next-internal_server_app__global-error_page_actions_75761787.js → _next-internal_server_app__global-error_page_actions_0k77kol.js} +1 -1
- package/.next/server/chunks/ssr/{_next-internal_server_app__not-found_page_actions_554ec2bf.js → _next-internal_server_app__not-found_page_actions_0eq97pa.js} +1 -1
- package/.next/server/chunks/ssr/{_next-internal_server_app_ide_page_actions_d521d6ae.js → _next-internal_server_app_ide_page_actions_0_opd4~.js} +1 -1
- package/.next/server/chunks/ssr/{_next-internal_server_app_logs_page_actions_a1c69041.js → _next-internal_server_app_logs_page_actions_0rvsl~d.js} +1 -1
- package/.next/server/chunks/ssr/{_next-internal_server_app_models_page_actions_543cf22f.js → _next-internal_server_app_models_page_actions_0eiz7f7.js} +1 -1
- 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_page_actions_09-gtaw.js.map +1 -0
- package/.next/server/chunks/ssr/{_next-internal_server_app_providers_page_actions_c75f6cb3.js → _next-internal_server_app_providers_page_actions_0ya36nw.js} +1 -1
- package/.next/server/chunks/ssr/_next-internal_server_app_providers_page_actions_0ya36nw.js.map +1 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_tokenizer_page_actions_0imc_ya.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_tokenizer_page_actions_0imc_ya.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_09w7yel._.js +33 -0
- package/.next/server/chunks/ssr/node_modules_09w7yel._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_06hehg4._.js +19 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_06hehg4._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_0e1izl_._.js +6 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_0e1izl_._.js.map +1 -0
- package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_9774470f._.js → node_modules_next_dist_client_components_0inhx6q._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_forbidden_45780354.js → node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_global-error_ece394eb.js → node_modules_next_dist_client_components_builtin_global-error_0lgvd_..js} +2 -2
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0lgvd_..js.map +1 -0
- package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_unauthorized_15817684.js → node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js} +2 -2
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_05u.ff5.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_05u.ff5.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_06a5k-w.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_06a5k-w.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0_rrdx6.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0_rrdx6.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0a7b~p7.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0a7b~p7.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0bj8dkg.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0bj8dkg.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0cvrgh7.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0cvrgh7.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0nkcfme.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0nkcfme.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0rc3ul_.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0rc3ul_.js.map +1 -0
- package/.next/server/chunks/ssr/src_app_components_ConfirmDialog_tsx_0mm3plr._.js +3 -0
- package/.next/server/chunks/ssr/src_app_components_ConfirmDialog_tsx_0mm3plr._.js.map +1 -0
- package/.next/server/chunks/ssr/src_app_ide_page_tsx_0no40dj._.js +3 -0
- package/.next/server/chunks/ssr/{src_app_ide_page_tsx_8962793b._.js.map → src_app_ide_page_tsx_0no40dj._.js.map} +1 -1
- package/.next/server/chunks/ssr/src_app_logs_page_tsx_0l8mmxe._.js +3 -0
- package/.next/server/chunks/ssr/{src_app_logs_page_tsx_7b7b7b83._.js.map → src_app_logs_page_tsx_0l8mmxe._.js.map} +1 -1
- package/.next/server/chunks/ssr/src_app_models_page_tsx_10vsbc1._.js +3 -0
- package/.next/server/chunks/ssr/{src_app_models_page_tsx_ed71d32e._.js.map → src_app_models_page_tsx_10vsbc1._.js.map} +1 -1
- package/.next/server/chunks/ssr/src_app_page_tsx_0ss2.w7._.js +3 -0
- package/.next/server/chunks/ssr/src_app_page_tsx_0ss2.w7._.js.map +1 -0
- package/.next/server/chunks/ssr/src_app_providers_page_tsx_10ipz~8._.js +3 -0
- package/.next/server/chunks/ssr/{src_app_providers_page_tsx_eb8b5137._.js.map → src_app_providers_page_tsx_10ipz~8._.js.map} +1 -1
- package/.next/server/chunks/ssr/src_app_tokenizer_page_tsx_0eqhpbs._.js +3 -0
- package/.next/server/chunks/ssr/src_app_tokenizer_page_tsx_0eqhpbs._.js.map +1 -0
- package/.next/server/functions-config-manifest.json +3 -1
- package/.next/server/middleware-build-manifest.js +10 -10
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -2
- package/.next/server/prefetch-hints.json +1 -0
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/XHnu7Z1vWSrgmneps8rX4/_clientMiddlewareManifest.js +1 -0
- package/.next/static/chunks/01xlw8hd842-c.js +1 -0
- package/.next/static/chunks/0bzupvr5gt3k9.js +31 -0
- package/.next/static/chunks/0d3shmwh5_nmn.js +1 -0
- package/.next/static/chunks/0h7-_zr5_nt.5.js +1 -0
- package/.next/static/chunks/0mjx90nkvhsot.js +1 -0
- package/.next/static/chunks/0ntp1qkrtsgn0.js +1 -0
- package/.next/static/chunks/0tc5l6c1zalyc.css +1 -0
- package/.next/static/chunks/0v7.1nc4jyaet.js +1 -0
- package/.next/static/chunks/0vlwn301rv7dw.js +1 -0
- package/.next/static/chunks/0y3~cortx~or~.js +5 -0
- package/.next/static/chunks/0~c9fm3-3-f41.js +1 -0
- package/.next/static/chunks/11-7_fybhp2~y.js +1 -0
- package/.next/static/chunks/121-ofr4.6_5t.js +1 -0
- package/.next/static/chunks/16g.ca89g7fib.js +1 -0
- package/.next/static/chunks/turbopack-0griofc2i3wvs.js +1 -0
- package/.next/types/routes.d.ts +5 -2
- package/.next/types/validator.ts +27 -0
- package/CHANGELOG.md +15 -0
- package/README.md +6 -0
- package/dist/.next/dev/types/validator.js +12 -0
- package/dist/.next/types/validator.js +12 -0
- package/dist/package.json +3 -2
- package/dist/src/app/api/tokenizer/history/route.js +60 -0
- package/dist/src/app/api/tokenizer/test/route.js +97 -0
- package/dist/src/app/components/Nav.js +2 -1
- package/dist/src/app/tokenizer/page.js +318 -0
- package/dist/src/cli/index.js +3 -3
- package/dist/src/db/database.js +19 -21
- package/dist/src/db/queries.js +21 -0
- package/dist/src/server/tokenizer.js +215 -0
- package/package.json +3 -2
- package/src/app/api/tokenizer/history/route.ts +63 -0
- package/src/app/api/tokenizer/test/route.ts +151 -0
- package/src/app/components/Nav.tsx +2 -2
- package/src/app/tokenizer/page.tsx +813 -0
- package/src/cli/index.ts +4 -4
- package/src/db/database.ts +18 -25
- package/src/db/queries.ts +22 -0
- package/src/server/tokenizer.ts +285 -0
- package/.next/build/chunks/[root-of-the-server]__44695d76._.js.map +0 -11
- package/.next/build/chunks/[root-of-the-server]__6d51cb5d._.js.map +0 -8
- package/.next/server/chunks/[root-of-the-server]__001d5756._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__001d5756._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__05f8578b._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__05f8578b._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__1480f018._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1480f018._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__1909f3aa._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1909f3aa._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__1d4b7fc5._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1d4b7fc5._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__33fec899._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__33fec899._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__372ef2bf._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__372ef2bf._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__3a204d25._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__3a204d25._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__3aaf963c._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__3aaf963c._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__43810962._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__43810962._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__4a8f9bc7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__4a8f9bc7._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__55cd88b8._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__55cd88b8._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__59aacd30._.js +0 -21
- package/.next/server/chunks/[root-of-the-server]__59aacd30._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__5e8276bc._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__5e8276bc._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__64356cb2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__64356cb2._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__6ce199d2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__6ce199d2._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__760eaa16._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__760eaa16._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__772134c6._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__772134c6._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__7b77f523._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__7b77f523._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__7c298a19._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__7c298a19._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__85540228._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__85540228._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__94fe8d3c._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__94fe8d3c._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__97622908._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__97622908._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__a02e6618._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__a02e6618._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__a32a20a7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__a32a20a7._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__a719d045._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__a719d045._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__af5b556a._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__af5b556a._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__c1b4b601._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__cafe113e._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__cafe113e._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__ccfc7f1d._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__ccfc7f1d._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__dc8b0bed._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__dc8b0bed._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__f0461b8d._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__f0461b8d._.js.map +0 -1
- package/.next/server/chunks/[root-of-the-server]__f8949f88._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__f8949f88._.js.map +0 -1
- package/.next/server/chunks/_b48847f5._.js +0 -3
- package/.next/server/chunks/ce889_server_app_api_ide_openclaw_available-models_route_actions_e568e70b.js +0 -3
- package/.next/server/chunks/ce889_server_app_api_ide_opencode_available-models_route_actions_95230db3.js +0 -3
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_4be65264.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__083d944d._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__083d944d._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__15600e29._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__15600e29._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1836f866._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1836f866._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__256a03fe._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__256a03fe._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__31fde618._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__31fde618._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__523c120c._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__523c120c._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__70a81394._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__70a81394._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__81937253._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__81937253._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__976ad963._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__976ad963._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__af2ad6aa._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__af2ad6aa._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__b9356576._.js +0 -4
- package/.next/server/chunks/ssr/[root-of-the-server]__b9356576._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__ccb6a4da._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__ccb6a4da._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__cfa2d991._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__cfa2d991._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__f437da88._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__f437da88._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__f92001a5._.js.map +0 -1
- package/.next/server/chunks/ssr/_06262cbd._.js +0 -4
- package/.next/server/chunks/ssr/_06262cbd._.js.map +0 -1
- package/.next/server/chunks/ssr/_0cd72da5._.js +0 -4
- package/.next/server/chunks/ssr/_0cd72da5._.js.map +0 -1
- package/.next/server/chunks/ssr/_4828a6d2._.js +0 -4
- package/.next/server/chunks/ssr/_4828a6d2._.js.map +0 -1
- package/.next/server/chunks/ssr/_69468f4c._.js +0 -3
- package/.next/server/chunks/ssr/_69468f4c._.js.map +0 -1
- package/.next/server/chunks/ssr/_93850476._.js +0 -6
- package/.next/server/chunks/ssr/_93850476._.js.map +0 -1
- package/.next/server/chunks/ssr/_c1309523._.js +0 -4
- package/.next/server/chunks/ssr/_c1309523._.js.map +0 -1
- package/.next/server/chunks/ssr/_f7d273e3._.js +0 -4
- package/.next/server/chunks/ssr/_f7d273e3._.js.map +0 -1
- package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_39d4fc33.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_08570d7f._.js +0 -4
- package/.next/server/chunks/ssr/node_modules_next_dist_08570d7f._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_174ae28d._.js +0 -10
- package/.next/server/chunks/ssr/node_modules_next_dist_174ae28d._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_27457240._.js +0 -6
- package/.next/server/chunks/ssr/node_modules_next_dist_27457240._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_4b63a0e1._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_4b63a0e1._.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_ece394eb.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_65a7265e.js +0 -4
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_65a7265e.js.map +0 -1
- package/.next/server/chunks/ssr/node_modules_next_dist_f9713a08._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_next_dist_f9713a08._.js.map +0 -1
- package/.next/server/chunks/ssr/src_app_ide_page_tsx_8962793b._.js +0 -3
- package/.next/server/chunks/ssr/src_app_logs_page_tsx_7b7b7b83._.js +0 -3
- package/.next/server/chunks/ssr/src_app_models_page_tsx_ed71d32e._.js +0 -3
- package/.next/server/chunks/ssr/src_app_providers_page_tsx_eb8b5137._.js +0 -3
- package/.next/static/cf2SWIkI5HVbnDjLExI42/_clientMiddlewareManifest.json +0 -1
- package/.next/static/chunks/5663c8696095f277.js +0 -1
- package/.next/static/chunks/64f547b3bcd3aef4.js +0 -1
- package/.next/static/chunks/6992685fe009e8fd.css +0 -1
- package/.next/static/chunks/6e0dee5b6681763c.js +0 -1
- package/.next/static/chunks/6f7efe5271343778.js +0 -1
- package/.next/static/chunks/75f76753fd97c8fd.js +0 -1
- package/.next/static/chunks/7c8b7cbb3339f139.js +0 -1
- package/.next/static/chunks/8ccc14e022ff6de3.js +0 -1
- package/.next/static/chunks/8cf1e5f00ebaea52.js +0 -1
- package/.next/static/chunks/a6dad97d9634a72d.js.map +0 -1
- package/.next/static/chunks/a7f539bf6487f4ff.js +0 -5
- package/.next/static/chunks/a89fdf03c5b0dfbd.js +0 -1
- package/.next/static/chunks/d2be314c3ece3fbe.js +0 -1
- package/.next/static/chunks/f2f58a7e93290fbb.js +0 -1
- package/.next/static/chunks/ff1a16fafef87110.js +0 -1
- package/.next/static/chunks/turbopack-fdb839c72e10c2ea.js +0 -4
- /package/.next/build/chunks/{[turbopack-node]_transforms_postcss_ts_df7a5b11._.js.map → [turbopack-node]_transforms_postcss_ts_0nnejqq._.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_config_route_actions_308a9f33.js.map → 0zjb_server_app_api_ide_openclaw_available-models_route_actions_0.gjr6a.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_gateway_[___path]_route_actions_835b2379.js.map → 0zjb_server_app_api_ide_opencode_available-models_route_actions_0poyhyk.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_gateway_models_route_actions_302c9983.js.map → _next-internal_server_app_api_config_route_actions_08dm.dx.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_gateway_route_actions_e5e7405d.js.map → _next-internal_server_app_api_gateway_[___path]_route_actions_0mmqyo7.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_claude_apply_route_actions_5056516c.js.map → _next-internal_server_app_api_gateway_models_route_actions_08b214z.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_claude_available-models_route_actions_94d710a0.js.map → _next-internal_server_app_api_gateway_route_actions_0.jzdw1.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_claude_restore_route_actions_f37acc94.js.map → _next-internal_server_app_api_ide_claude_apply_route_actions_0dw2_pf.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_claude_save_route_actions_407c55f5.js.map → _next-internal_server_app_api_ide_claude_available-models_route_actions_0pmwy75.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_claude_status_route_actions_5ac73db8.js.map → _next-internal_server_app_api_ide_claude_restore_route_actions_11x77hl.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_claude_test_route_actions_70587902.js.map → _next-internal_server_app_api_ide_claude_save_route_actions_0b35ro_.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_openclaw_apply_route_actions_2cb9e4b4.js.map → _next-internal_server_app_api_ide_claude_status_route_actions_0fnw-w7.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_openclaw_preview_route_actions_9814a8e4.js.map → _next-internal_server_app_api_ide_claude_test_route_actions_0jc1czy.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_openclaw_restore_route_actions_10ad8f9d.js.map → _next-internal_server_app_api_ide_openclaw_apply_route_actions_07re971.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_openclaw_save_route_actions_044ad081.js.map → _next-internal_server_app_api_ide_openclaw_preview_route_actions_0q53p05.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_openclaw_status_route_actions_ed9786d2.js.map → _next-internal_server_app_api_ide_openclaw_restore_route_actions_02yog9-.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_openclaw_test_route_actions_ce2cb808.js.map → _next-internal_server_app_api_ide_openclaw_save_route_actions_00tjxsz.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_opencode_apply_route_actions_6c422244.js.map → _next-internal_server_app_api_ide_openclaw_status_route_actions_10wsun4.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_opencode_preview_route_actions_256c82e0.js.map → _next-internal_server_app_api_ide_openclaw_test_route_actions_0zgwyon.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_opencode_restore_route_actions_371993d3.js.map → _next-internal_server_app_api_ide_opencode_apply_route_actions_0in-w.g.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_opencode_save_route_actions_6e4c9c41.js.map → _next-internal_server_app_api_ide_opencode_preview_route_actions_06h6.w~.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_opencode_status_route_actions_498ad77b.js.map → _next-internal_server_app_api_ide_opencode_restore_route_actions_09ipt-l.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_ide_opencode_test_route_actions_c71be510.js.map → _next-internal_server_app_api_ide_opencode_save_route_actions_0i-~x79.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_logs_route_actions_30a87f47.js.map → _next-internal_server_app_api_ide_opencode_status_route_actions_0cpf6rv.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_models_route_actions_b6abdc83.js.map → _next-internal_server_app_api_ide_opencode_test_route_actions_0y8aq8h.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_providers_route_actions_5388b373.js.map → _next-internal_server_app_api_logs_route_actions_08ef2j7.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_providers_test_route_actions_b97ab15a.js.map → _next-internal_server_app_api_models_route_actions_0vfccm4.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_service_force-stop_route_actions_95eba80b.js.map → _next-internal_server_app_api_providers_route_actions_0ee1p_m.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_service_start_route_actions_d50efb77.js.map → _next-internal_server_app_api_providers_test_route_actions_0vyo652.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_service_status_route_actions_30149042.js.map → _next-internal_server_app_api_service_force-stop_route_actions_0pu9xrq.js.map} +0 -0
- /package/.next/server/chunks/{_next-internal_server_app_api_service_stop_route_actions_19443941.js.map → _next-internal_server_app_api_service_start_route_actions_0_o53a2.js.map} +0 -0
- /package/.next/server/chunks/{ce889_server_app_api_ide_openclaw_available-models_route_actions_e568e70b.js.map → _next-internal_server_app_api_service_status_route_actions_08ag8v4.js.map} +0 -0
- /package/.next/server/chunks/{ce889_server_app_api_ide_opencode_available-models_route_actions_95230db3.js.map → _next-internal_server_app_api_service_stop_route_actions_04dp83p.js.map} +0 -0
- /package/.next/server/chunks/{ssr/_next-internal_server_app__global-error_page_actions_75761787.js.map → _next-internal_server_app_api_tokenizer_history_route_actions_09~nqtd.js.map} +0 -0
- /package/.next/server/chunks/{ssr/_next-internal_server_app__not-found_page_actions_554ec2bf.js.map → _next-internal_server_app_api_tokenizer_test_route_actions_0t2swp-.js.map} +0 -0
- /package/.next/server/chunks/ssr/{_next-internal_server_app_ide_page_actions_d521d6ae.js.map → _next-internal_server_app__global-error_page_actions_0k77kol.js.map} +0 -0
- /package/.next/server/chunks/ssr/{_next-internal_server_app_logs_page_actions_a1c69041.js.map → _next-internal_server_app__not-found_page_actions_0eq97pa.js.map} +0 -0
- /package/.next/server/chunks/ssr/{_next-internal_server_app_models_page_actions_543cf22f.js.map → _next-internal_server_app_ide_page_actions_0_opd4~.js.map} +0 -0
- /package/.next/server/chunks/ssr/{_next-internal_server_app_page_actions_39d4fc33.js.map → _next-internal_server_app_logs_page_actions_0rvsl~d.js.map} +0 -0
- /package/.next/server/chunks/ssr/{_next-internal_server_app_providers_page_actions_c75f6cb3.js.map → _next-internal_server_app_models_page_actions_0eiz7f7.js.map} +0 -0
- /package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_9774470f._.js.map → node_modules_next_dist_client_components_0inhx6q._.js.map} +0 -0
- /package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_forbidden_45780354.js.map → node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js.map} +0 -0
- /package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_unauthorized_15817684.js.map → node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js.map} +0 -0
- /package/.next/static/{cf2SWIkI5HVbnDjLExI42 → XHnu7Z1vWSrgmneps8rX4}/_buildManifest.js +0 -0
- /package/.next/static/{cf2SWIkI5HVbnDjLExI42 → XHnu7Z1vWSrgmneps8rX4}/_ssgManifest.js +0 -0
- /package/.next/static/chunks/{a6dad97d9634a72d.js → 03~yq9q893hmn.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/app/api/gateway/models/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { NextRequest, NextResponse } from 'next/server';\nimport { getDatabase } from '@/db/database';\nimport { getEnabledModels, getAllProviders } from '@/db/queries';\n\n// Ensure Node.js runtime (required for SQLite)\nexport const runtime = 'nodejs';\n\n// GET /api/gateway/models - List enabled models for gateway\nexport async function GET(request: NextRequest) {\n try {\n await getDatabase();\n\n const models = await getEnabledModels();\n const providers = await getAllProviders();\n\n // Build response in OpenAI-compatible format\n const data = models.map((model: any) => ({\n id: model.model_id,\n object: 'model',\n created: Math.floor(new Date(model.created_at).getTime() / 1000),\n owned_by: model.provider_name || model.provider_protocol || 'unknown',\n // Additional fields for gateway-specific info\n gateway_info: {\n name: model.name,\n provider: model.provider_name,\n provider_protocol: model.provider_protocol,\n },\n }));\n\n return NextResponse.json({\n object: 'list',\n data,\n });\n } catch (error: any) {\n console.error('/api/gateway/models error:', error);\n return NextResponse.json(\n { error: { message: error.message || 'Internal server error' } },\n { status: 500 }\n );\n }\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/gateway/models/route\",\n pathname: \"/api/gateway/models\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/app/api/gateway/models/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/gateway/models/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":["runtime","GET","request","models","providers","data","map","model","id","model_id","object","created","Math","floor","Date","created_at","getTime","owned_by","provider_name","provider_protocol","gateway_info","name","provider","json","error","console","message","status"],"mappings":"8iCCAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,CAAA,CAAA,OAAA,IAAA,EAAA,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M,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAChC,IAAI,SAAS,EAAW,KAAK,CAAC,IAAI,CAAE,SAChC,EACA,OAAQ,EAAW,KAAK,CAAC,MAAM,EAAI,GACvC,IACO,IACX,EAGI,GAAyB,EACzB,MAAM,EAAe,EADgB,EAGrC,EAAa,EAAO,kBAAkB,GACtC,MAAM,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,QAAiB,EAAW,CAAC,GAE5C,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,mCA3TA,SAAS,EACL,MAAO,CAAA,EAAA,EAAA,UAAA,AAAW,EAAC,kBACf,uBACA,CACJ,EACJ","ignoreList":[1]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[93695,(e,t,a)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,a)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,a)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,a)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,a)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,a)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},14747,(e,t,a)=>{t.exports=e.x("path",()=>require("path"))},68646,e=>{"use strict";var t=e.i(71560),a=e.i(97731);async function r(){await (0,t.getDatabase)();let e=await (0,a.getConfig)("port"),r=e?.value||"1357";return`http://localhost:${r}/v1`}async function n(){await (0,t.getDatabase)();let e=await (0,a.getConfig)("api_key");return e?.value||"your-gateway-api-key"}async function i(){return{baseUrl:await r(),apiKey:await n(),api:"openai-completions",models:(await (0,a.getAllModels)()).filter(e=>e.enabled).map(e=>({id:e.model_id,name:e.name,reasoning:e.reasoning||!1,input:e.input||["text"],cost:e.cost||{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:e.context_window||2e5,maxTokens:e.max_tokens||8192}))}}let s="aar-gateway";async function o(e,t){return function(e,t,a){let r=e&&"object"==typeof e?{...e}:{},n=r.models||{},i=n.providers||{};i[s]=a,n.providers=i,n.mode="merge",r.models=n;let o=r.agents||{},l=o.defaults||{},d=l.model||{},u=`${s}/${t.defaultModel}`,p=t.imageModel?`${s}/${t.imageModel}`:void 0;d.primary=u,t.defaultFallbacks&&t.defaultFallbacks.length>0?d.fallbacks=t.defaultFallbacks.map(e=>e.startsWith(`${s}/`)?e:`${s}/${e}`):delete d.fallbacks,l.model=d;let c=l.imageModel||{};p&&(c.primary=p),t.imageFallbacks&&t.imageFallbacks.length>0?c.fallbacks=t.imageFallbacks.map(e=>e.startsWith(`${s}/`)?e:`${s}/${e}`):delete c.fallbacks,l.imageModel=c;let g=l.models||{};for(let e of a.models){let t=`${s}/${e.id}`;g[t]=g[t]||{alias:e.name}}return l.models=g,o.defaults=l,r.agents=o,r.channels||(r.channels={}),r}(t,e,await i())}e.s(["buildMergedConfig",0,o])},36791,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250),n=e.i(59756),i=e.i(61916),s=e.i(74677),o=e.i(69741),l=e.i(16795),d=e.i(87718),u=e.i(95169),p=e.i(47587),c=e.i(66012),g=e.i(70101),h=e.i(26937),m=e.i(10372),f=e.i(93695);e.i(52474);var x=e.i(220),v=e.i(89171),w=e.i(22734),R=e.i(14747),y=e.i(46786),b=e.i(68646);let C=(0,R.join)((0,y.homedir)(),".openclaw","openclaw.json");async function E(e){try{let{searchParams:t}=new URL(e.url),a=t.get("default_model")||"",r=t.get("default_fallbacks")||"",n=t.get("image_model")||"",i=t.get("image_fallbacks")||"";if(!a)return v.NextResponse.json({error:"Missing query: default_model"},{status:400});let s=r?r.split(",").filter(Boolean):[],o=i?i.split(",").filter(Boolean):[],l=null;if((0,w.existsSync)(C))try{let e=(0,w.readFileSync)(C,"utf-8");l=JSON.parse(e)}catch(e){}let d=await (0,b.buildMergedConfig)({defaultModel:a,defaultFallbacks:s,imageModel:n||void 0,imageFallbacks:o},l);return v.NextResponse.json({config:d})}catch(e){return console.error("OpenClaw Preview API error:",e),v.NextResponse.json({error:e.message||"Internal server error",stack:void 0},{status:500})}}e.s(["GET",0,E],82872);var k=e.i(82872);let A=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/ide/openclaw/preview/route",pathname:"/api/ide/openclaw/preview",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/ide/openclaw/preview/route.ts",nextConfigOutput:"",userland:k}),{workAsyncStorage:_,workUnitAsyncStorage:N,serverHooks:T}=A;async function q(e,t,r){r.requestMeta&&(0,n.setRequestMeta)(e,r.requestMeta),A.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let v="/api/ide/openclaw/preview/route";v=v.replace(/\/index$/,"")||"/";let w=await A.prepare(e,t,{srcPage:v,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:R,params:y,nextConfig:b,parsedUrl:C,isDraftMode:E,prerenderManifest:k,routerServerContext:_,isOnDemandRevalidate:N,revalidateOnlyGenerated:T,resolvedPathname:q,clientReferenceManifest:P,serverActionsManifest:M}=w,S=(0,o.normalizeAppPath)(v),j=!!(k.dynamicRoutes[S]||k.routes[q]),O=async()=>((null==_?void 0:_.render404)?await _.render404(e,t,C,!1):t.end("This page could not be found"),null);if(j&&!E){let e=!!k.routes[q],t=k.dynamicRoutes[S];if(t&&!1===t.fallback&&!e){if(b.adapterPath)return await O();throw new f.NoFallbackError}}let $=null;!j||A.isDev||E||($="/index"===($=q)?"/":$);let I=!0===A.isDev||!j,U=j&&!I;M&&P&&(0,s.setManifestsSingleton)({page:v,clientReferenceManifest:P,serverActionsManifest:M});let H=e.method||"GET",D=(0,i.getTracer)(),F=D.getActiveScopeSpan(),K=!!(null==_?void 0:_.isWrappedByNextServer),B=!!(0,n.getRequestMeta)(e,"minimalMode"),W=(0,n.getRequestMeta)(e,"incrementalCache")||await A.getIncrementalCache(e,b,k,B);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let L={params:y,previewProps:k.preview,renderOpts:{experimental:{authInterrupts:!!b.experimental.authInterrupts},cacheComponents:!!b.cacheComponents,supportsDynamicResponse:I,incrementalCache:W,cacheLifeProfiles:b.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,r,n)=>A.onRequestError(e,t,r,n,_)},sharedContext:{buildId:R}},G=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),X=d.NextRequestAdapter.fromNodeNextRequest(G,(0,d.signalFromNodeResponse)(t));try{let n,s=async e=>A.handle(X,L).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let a=D.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=a.get("next.route");if(r){let t=`${H} ${r}`;e.setAttributes({"next.route":r,"http.route":r,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",r),n.updateName(t))}else e.updateName(`${H} ${v}`)}),o=async n=>{var i,o;let l=async({previousCacheEntry:a})=>{try{if(!B&&N&&T&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await s(n);e.fetchMetrics=L.renderOpts.fetchMetrics;let o=L.renderOpts.pendingWaitUntil;o&&r.waitUntil&&(r.waitUntil(o),o=void 0);let l=L.renderOpts.collectedTags;if(!j)return await (0,c.sendResponse)(G,V,i,L.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,g.toNodeOutgoingHttpHeaders)(i.headers);l&&(t[m.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==L.renderOpts.collectedRevalidate&&!(L.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&L.renderOpts.collectedRevalidate,r=void 0===L.renderOpts.collectedExpire||L.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:L.renderOpts.collectedExpire;return{value:{kind:x.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:r}}}}catch(t){throw(null==a?void 0:a.isStale)&&await A.onRequestError(e,t,{routerKind:"App Router",routePath:v,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:N})},!1,_),t}},d=await A.handleResponse({req:e,nextConfig:b,cacheKey:$,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:k,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:T,responseGenerator:l,waitUntil:r.waitUntil,isMinimalMode:B});if(!j)return null;if((null==d||null==(i=d.value)?void 0:i.kind)!==x.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(o=d.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",N?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,g.fromNodeOutgoingHttpHeaders)(d.value.headers);return B&&j||u.delete(m.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,h.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(G,V,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};K&&F?await o(F):(n=D.getActiveScopeSpan(),await D.withPropagatedContext(e.headers,()=>D.trace(u.BaseServerSpan.handleRequest,{spanName:`${H} ${v}`,kind:i.SpanKind.SERVER,attributes:{"http.method":H,"http.target":e.url}},o),void 0,!K))}catch(t){if(t instanceof f.NoFallbackError||await A.onRequestError(e,t,{routerKind:"App Router",routePath:S,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:N})},!1,_),j)throw t;return await (0,c.sendResponse)(G,V,new Response(null,{status:500})),null}}e.s(["handler",0,q,"patchFetch",0,function(){return(0,r.patchFetch)({workAsyncStorage:_,workUnitAsyncStorage:N})},"routeModule",0,A,"serverHooks",0,T,"workAsyncStorage",0,_,"workUnitAsyncStorage",0,N],36791)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0m62mql._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/app/api/ide/openclaw/build-config.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/ide/openclaw/preview/route.ts"],"sourcesContent":["import { getDatabase } from '@/db/database';\nimport { getConfig } from '@/db/queries';\nimport { getAllModels } from '@/db/queries';\n\nexport async function getGatewayAddress(): Promise<string> {\n await getDatabase();\n const portConfig = await getConfig('port');\n const port = portConfig?.value || '1357';\n return `http://localhost:${port}/v1`;\n}\n\nexport async function getGatewayApiKey(): Promise<string> {\n await getDatabase();\n const apiKeyConfig = await getConfig('api_key');\n return apiKeyConfig?.value || 'your-gateway-api-key';\n}\n\n/** OpenClaw provider entry structure */\nexport type OpenClawProviderEntry = {\n baseUrl: string;\n apiKey: string;\n api: 'openai-completions';\n models: Array<{\n id: string;\n name: string;\n reasoning?: boolean;\n input?: string[];\n cost?: {\n input: number;\n output: number;\n cacheRead: number;\n cacheWrite: number;\n };\n contextWindow?: number;\n maxTokens?: number;\n }>;\n};\n\nexport async function buildAarGatewayProvider(): Promise<OpenClawProviderEntry> {\n const gatewayAddress = await getGatewayAddress();\n const gatewayApiKey = await getGatewayApiKey();\n const allModels = (await getAllModels()).filter((m: any) => m.enabled);\n\n const models = allModels.map((m: any) => ({\n id: m.model_id,\n name: m.name,\n reasoning: m.reasoning || false,\n input: m.input || ['text'],\n cost: m.cost || { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },\n contextWindow: m.context_window || 200000,\n maxTokens: m.max_tokens || 8192,\n }));\n\n return {\n baseUrl: gatewayAddress,\n apiKey: gatewayApiKey,\n api: 'openai-completions',\n models,\n };\n}\n\nconst AAR_PROVIDER_ID = 'aar-gateway';\n\n/** Merge existing OpenClaw config with AAR gateway */\nexport function mergeConfigWithAar(\n existing: Record<string, any> | null,\n config: {\n defaultModel: string;\n defaultFallbacks?: string[];\n imageModel?: string;\n imageFallbacks?: string[];\n },\n aarProvider: OpenClawProviderEntry\n): Record<string, any> {\n const base = existing && typeof existing === 'object' ? { ...existing } : {};\n\n // Update models.providers\n const modelsConfig = base.models || {};\n const providers = modelsConfig.providers || {};\n providers[AAR_PROVIDER_ID] = aarProvider;\n modelsConfig.providers = providers;\n modelsConfig.mode = 'merge';\n base.models = modelsConfig;\n\n // Update agents.defaults.model\n const agents = base.agents || {};\n const defaults = agents.defaults || {};\n const model = defaults.model || {};\n\n // Format: provider/model\n const fullModelId = `${AAR_PROVIDER_ID}/${config.defaultModel}`;\n const fullImageModelId = config.imageModel\n ? `${AAR_PROVIDER_ID}/${config.imageModel}`\n : undefined;\n\n model.primary = fullModelId;\n if (config.defaultFallbacks && config.defaultFallbacks.length > 0) {\n model.fallbacks = config.defaultFallbacks.map((m: string) =>\n m.startsWith(`${AAR_PROVIDER_ID}/`) ? m : `${AAR_PROVIDER_ID}/${m}`\n );\n } else {\n delete model.fallbacks;\n }\n\n defaults.model = model;\n\n // Update agents.defaults.imageModel\n const imageModel = defaults.imageModel || {};\n if (fullImageModelId) {\n imageModel.primary = fullImageModelId;\n }\n if (config.imageFallbacks && config.imageFallbacks.length > 0) {\n imageModel.fallbacks = config.imageFallbacks.map((m: string) =>\n m.startsWith(`${AAR_PROVIDER_ID}/`) ? m : `${AAR_PROVIDER_ID}/${m}`\n );\n } else {\n delete imageModel.fallbacks;\n }\n defaults.imageModel = imageModel;\n\n // Update agents.defaults.models so OpenClaw can resolve aar-gateway model ids (alias, etc.)\n const modelsMap = defaults.models || {};\n for (const m of aarProvider.models) {\n const fullId = `${AAR_PROVIDER_ID}/${m.id}`;\n modelsMap[fullId] = modelsMap[fullId] || { alias: m.name };\n }\n defaults.models = modelsMap;\n\n agents.defaults = defaults;\n base.agents = agents;\n\n // Ensure channels exists (even if empty)\n if (!base.channels) {\n base.channels = {};\n }\n\n return base;\n}\n\n/** Generate merged config for preview or apply */\nexport async function buildMergedConfig(\n config: {\n defaultModel: string;\n defaultFallbacks?: string[];\n imageModel?: string;\n imageFallbacks?: string[];\n },\n existing: Record<string, any> | null\n): Promise<Record<string, any>> {\n const aarProvider = await buildAarGatewayProvider();\n return mergeConfigWithAar(existing, config, aarProvider);\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/ide/openclaw/preview/route\",\n pathname: \"/api/ide/openclaw/preview\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/app/api/ide/openclaw/preview/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/ide/openclaw/preview/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","import { NextRequest, NextResponse } from 'next/server';\nimport { existsSync, readFileSync } from 'fs';\nimport { join } from 'path';\nimport { homedir } from 'os';\nimport { buildMergedConfig } from '../build-config';\n\nconst OPENCLAW_FILE = join(homedir(), '.openclaw', 'openclaw.json');\n\nexport async function GET(request: NextRequest) {\n try {\n const { searchParams } = new URL(request.url);\n const defaultModel = searchParams.get('default_model') || '';\n const defaultFallbacksStr = searchParams.get('default_fallbacks') || '';\n const imageModel = searchParams.get('image_model') || '';\n const imageFallbacksStr = searchParams.get('image_fallbacks') || '';\n\n if (!defaultModel) {\n return NextResponse.json({ error: 'Missing query: default_model' }, { status: 400 });\n }\n\n // Parse fallback arrays\n const defaultFallbacks = defaultFallbacksStr\n ? defaultFallbacksStr.split(',').filter(Boolean)\n : [];\n const imageFallbacks = imageFallbacksStr\n ? imageFallbacksStr.split(',').filter(Boolean)\n : [];\n\n let existingConfig = null;\n if (existsSync(OPENCLAW_FILE)) {\n try {\n const content = readFileSync(OPENCLAW_FILE, 'utf-8');\n existingConfig = JSON.parse(content);\n } catch (e) {\n // If file exists but is invalid, treat as empty\n }\n }\n\n const config = await buildMergedConfig(\n {\n defaultModel,\n defaultFallbacks,\n imageModel: imageModel || undefined,\n imageFallbacks,\n },\n existingConfig\n );\n\n return NextResponse.json({ config });\n } catch (error: any) {\n console.error('OpenClaw Preview API error:', error);\n return NextResponse.json(\n { error: error.message || 'Internal server error', stack: process.env.NODE_ENV === 'development' ? error.stack : undefined },\n { status: 500 }\n );\n }\n}\n"],"names":["getGatewayAddress","portConfig","port","value","getGatewayApiKey","apiKeyConfig","buildAarGatewayProvider","gatewayAddress","gatewayApiKey","allModels","filter","m","enabled","models","map","id","model_id","name","reasoning","input","cost","output","cacheRead","cacheWrite","contextWindow","context_window","maxTokens","max_tokens","baseUrl","apiKey","api","AAR_PROVIDER_ID","mergeConfigWithAar","existing","config","aarProvider","base","modelsConfig","providers","mode","agents","defaults","model","fullModelId","defaultModel","fullImageModelId","imageModel","undefined","primary","defaultFallbacks","length","fallbacks","startsWith","imageFallbacks","modelsMap","fullId","alias","channels","buildMergedConfig","OPENCLAW_FILE","GET","request","defaultFallbacksStr","searchParams","URL","url","get","imageFallbacksStr","json","error","status","split","Boolean","existingConfig","content","JSON","parse","e","console","message","stack"],"mappings":"8iCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAGO,eAAeA,IACpB,MAAM,CAAA,EAAA,EAAA,WAAA,AAAW,IACjB,IAAMC,EAAa,MAAM,CAAA,EAAA,EAAA,SAAA,AAAS,EAAC,QAC7BC,EAAOD,GAAYE,OAAS,OAClC,MAAO,CAAC,iBAAiB,EAAED,EAAK,GAAG,CAAC,AACtC,CAEO,eAAeE,IACpB,MAAM,CAAA,EAAA,EAAA,WAAA,AAAW,IACjB,IAAMC,EAAe,MAAM,CAAA,EAAA,EAAA,SAAA,AAAS,EAAC,WACrC,OAAOA,GAAcF,OAAS,sBAChC,CAuBO,eAAeG,IAepB,MAAO,CACLsB,QAfqB,CAeZrB,KAfkBP,IAgB3B6B,OAfoB,CAeZrB,KAfkBJ,IAgB1B0B,IAAK,qBACLjB,OAdaJ,AAFG,CAAC,MAAM,CAAA,EAA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M,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,GAAiB,OAAW,CAAC,GAE5C,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GATmB,AAShB,EAAY,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,mCA3TA,SAAS,EACL,MAAO,CAAA,EAAA,EAAA,UAAA,AAAW,EAAC,kBACf,uBACA,CACJ,EACJ","ignoreList":[1]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},77917,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),s=e.i(61916),o=e.i(74677),i=e.i(69741),l=e.i(16795),u=e.i(87718),d=e.i(95169),p=e.i(47587),c=e.i(66012),g=e.i(70101),h=e.i(26937),x=e.i(10372),R=e.i(93695);e.i(52474);var v=e.i(220),f=e.i(89171),m=e.i(71560),y=e.i(97731);function w(e){return null==e?"":"string"==typeof e?e:"object"==typeof e?JSON.stringify(e):String(e)}function E(e){return{...e,request_headers:w(e.request_headers),request_query:w(e.request_query),request_body:w(e.request_body),response_body:w(e.response_body)}}async function q(e){try{await (0,m.getDatabase)();let{searchParams:t}=new URL(e.url),r=t.get("id"),a=parseInt(t.get("limit")||"100"),n=parseInt(t.get("offset")||"0"),s=t.get("model_id"),o=t.get("search")?.trim();if(r){let e=(0,y.getRequestLogById)(parseInt(r));if(!e)return f.NextResponse.json({error:"Log not found"},{status:404});return f.NextResponse.json(E(e))}let i=await (0,y.getRequestLogs)(a,n,s?parseInt(s):void 0,o),l=await (0,y.getRequestLogCount)(s?parseInt(s):void 0,o);return f.NextResponse.json({logs:i.map(E),total:l,limit:a,offset:n,search:o||""})}catch(e){return console.error("Logs API error:",e),f.NextResponse.json({error:e.message||"Internal server error",stack:void 0},{status:500})}}async function C(e){try{await (0,m.getDatabase)();let{searchParams:t}=new URL(e.url),r=t.get("ids");if("true"===t.get("clear_all")){let e=(0,y.deleteAllRequestLogs)();return f.NextResponse.json({deletedCount:e})}if(!r)return f.NextResponse.json({error:"ids parameter is required"},{status:400});let a=r.split(",").map(e=>parseInt(e.trim())).filter(e=>!isNaN(e)),n=(0,y.deleteRequestLogs)(a);return f.NextResponse.json({deletedCount:n})}catch(e){return console.error("Delete logs API error:",e),f.NextResponse.json({error:e.message||"Internal server error",stack:void 0},{status:500})}}e.s(["DELETE",0,C,"GET",0,q,"dynamic",0,"force-dynamic","runtime",0,"nodejs"],21293);var b=e.i(21293);let N=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/logs/route",pathname:"/api/logs",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/logs/route.ts",nextConfigOutput:"",userland:b}),{workAsyncStorage:A,workUnitAsyncStorage:_,serverHooks:j}=N;async function I(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),N.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let f="/api/logs/route";f=f.replace(/\/index$/,"")||"/";let m=await N.prepare(e,t,{srcPage:f,multiZoneDraftMode:!1});if(!m)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:y,params:w,nextConfig:E,parsedUrl:q,isDraftMode:C,prerenderManifest:b,routerServerContext:A,isOnDemandRevalidate:_,revalidateOnlyGenerated:j,resolvedPathname:I,clientReferenceManifest:T,serverActionsManifest:P}=m,S=(0,i.normalizeAppPath)(f),k=!!(b.dynamicRoutes[S]||b.routes[I]),O=async()=>((null==A?void 0:A.render404)?await A.render404(e,t,q,!1):t.end("This page could not be found"),null);if(k&&!C){let e=!!b.routes[I],t=b.dynamicRoutes[S];if(t&&!1===t.fallback&&!e){if(E.adapterPath)return await O();throw new R.NoFallbackError}}let U=null;!k||N.isDev||C||(U="/index"===(U=I)?"/":U);let D=!0===N.isDev||!k,H=k&&!D;P&&T&&(0,o.setManifestsSingleton)({page:f,clientReferenceManifest:T,serverActionsManifest:P});let L=e.method||"GET",M=(0,s.getTracer)(),$=M.getActiveScopeSpan(),F=!!(null==A?void 0:A.isWrappedByNextServer),K=!!(0,n.getRequestMeta)(e,"minimalMode"),B=(0,n.getRequestMeta)(e,"incrementalCache")||await N.getIncrementalCache(e,E,b,K);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let G={params:w,previewProps:b.preview,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:D,incrementalCache:B,cacheLifeProfiles:E.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>N.onRequestError(e,t,a,n,A)},sharedContext:{buildId:y}},V=new l.NodeNextRequest(e),W=new l.NodeNextResponse(t),X=u.NextRequestAdapter.fromNodeNextRequest(V,(0,u.signalFromNodeResponse)(t));try{let n,o=async e=>N.handle(X,G).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=M.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${L} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${L} ${f}`)}),i=async n=>{var s,i;let l=async({previousCacheEntry:r})=>{try{if(!K&&_&&j&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let s=await o(n);e.fetchMetrics=G.renderOpts.fetchMetrics;let i=G.renderOpts.pendingWaitUntil;i&&a.waitUntil&&(a.waitUntil(i),i=void 0);let l=G.renderOpts.collectedTags;if(!k)return await (0,c.sendResponse)(V,W,s,G.renderOpts.pendingWaitUntil),null;{let e=await s.blob(),t=(0,g.toNodeOutgoingHttpHeaders)(s.headers);l&&(t[x.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=x.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,a=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=x.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:s.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await N.onRequestError(e,t,{routerKind:"App Router",routePath:f,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:_})},!1,A),t}},u=await N.handleResponse({req:e,nextConfig:E,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:b,isRoutePPREnabled:!1,isOnDemandRevalidate:_,revalidateOnlyGenerated:j,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:K});if(!k)return null;if((null==u||null==(s=u.value)?void 0:s.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(i=u.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",_?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),C&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,g.fromNodeOutgoingHttpHeaders)(u.value.headers);return K&&k||d.delete(x.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,h.getCacheControlHeader)(u.cacheControl)),await (0,c.sendResponse)(V,W,new Response(u.value.body,{headers:d,status:u.value.status||200})),null};F&&$?await i($):(n=M.getActiveScopeSpan(),await M.withPropagatedContext(e.headers,()=>M.trace(d.BaseServerSpan.handleRequest,{spanName:`${L} ${f}`,kind:s.SpanKind.SERVER,attributes:{"http.method":L,"http.target":e.url}},i),void 0,!F))}catch(t){if(t instanceof R.NoFallbackError||await N.onRequestError(e,t,{routerKind:"App Router",routePath:S,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:_})},!1,A),k)throw t;return await (0,c.sendResponse)(V,W,new Response(null,{status:500})),null}}e.s(["handler",0,I,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:_})},"routeModule",0,N,"serverHooks",0,j,"workAsyncStorage",0,A,"workUnitAsyncStorage",0,_],77917)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0qp1t_m._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/next/dist/esm/build/templates/app-route.js","../../../src/app/api/logs/route.ts"],"sourcesContent":["import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/logs/route\",\n pathname: \"/api/logs\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/app/api/logs/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/logs/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n","import { NextRequest, NextResponse } from 'next/server';\nimport { getDatabase } from '@/db/database';\nimport { getRequestLogs, getRequestLogById, getRequestLogCount, deleteRequestLogs, deleteAllRequestLogs } from '@/db/queries';\n\n// Ensure Node.js runtime (required for SQLite)\nexport const runtime = 'nodejs';\nexport const dynamic = 'force-dynamic';\n\n// Helper to ensure a value is a string (defensive against JSON objects in TEXT columns)\nfunction ensureString(value: any): string {\n if (value === null || value === undefined) {\n return '';\n }\n if (typeof value === 'string') {\n return value;\n }\n // If it's an object (e.g., parsed JSON), convert back to string\n if (typeof value === 'object') {\n return JSON.stringify(value);\n }\n return String(value);\n}\n\n// Helper to clean log data - ensure all fields are proper strings\nfunction cleanLogData(log: any) {\n return {\n ...log,\n request_headers: ensureString(log.request_headers),\n request_query: ensureString(log.request_query),\n request_body: ensureString(log.request_body),\n response_body: ensureString(log.response_body),\n };\n}\n\nexport async function GET(request: NextRequest) {\n try {\n await getDatabase();\n const { searchParams } = new URL(request.url);\n const id = searchParams.get('id');\n const limit = parseInt(searchParams.get('limit') || '100');\n const offset = parseInt(searchParams.get('offset') || '0');\n const modelId = searchParams.get('model_id');\n const search = searchParams.get('search')?.trim();\n\n if (id) {\n const log = getRequestLogById(parseInt(id));\n if (!log) {\n return NextResponse.json(\n { error: 'Log not found' },\n { status: 404 }\n );\n }\n return NextResponse.json(cleanLogData(log));\n }\n\n const logs = await getRequestLogs(\n limit,\n offset,\n modelId ? parseInt(modelId) : undefined,\n search\n );\n const total = await getRequestLogCount(modelId ? parseInt(modelId) : undefined, search);\n\n return NextResponse.json({\n logs: logs.map(cleanLogData),\n total,\n limit,\n offset,\n search: search || '',\n });\n } catch (error: any) {\n console.error('Logs API error:', error);\n return NextResponse.json(\n { error: error.message || 'Internal server error', stack: process.env.NODE_ENV === 'development' ? error.stack : undefined },\n { status: 500 }\n );\n }\n}\n\nexport async function DELETE(request: NextRequest) {\n try {\n await getDatabase();\n const { searchParams } = new URL(request.url);\n const ids = searchParams.get('ids');\n const clearAll = searchParams.get('clear_all') === 'true';\n\n if (clearAll) {\n const deletedCount = deleteAllRequestLogs();\n return NextResponse.json({ deletedCount });\n }\n\n if (!ids) {\n return NextResponse.json(\n { error: 'ids parameter is required' },\n { status: 400 }\n );\n }\n\n const idArray = ids.split(',').map(id => parseInt(id.trim())).filter(id => !isNaN(id));\n const deletedCount = deleteRequestLogs(idArray);\n\n return NextResponse.json({ deletedCount });\n } catch (error: any) {\n console.error('Delete logs API error:', error);\n return NextResponse.json(\n { error: error.message || 'Internal server error', stack: process.env.NODE_ENV === 'development' ? error.stack : undefined },\n { status: 500 }\n );\n }\n}\n"],"names":["runtime","dynamic","value","ensureString","undefined","GET","JSON","stringify","id","String","cleanLogData","log","request_headers","request_query","offset","request_body","response_body","request","searchParams","URL","url","error","get","limit","parseInt","modelId","search","trim","json","status","deletedCount","logs","ids","total","map","console","message","stack","DELETE","clearAll","idArray","split","filter","isNaN"],"mappings":"8iCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACAE,EAAAA,EAAAA,CAAAA,CAAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACAG,EAAAA,EAAAA,CAAAA,CAAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,CAAA,CAAA,OAAA,IAAA,EAAA,EAAA,CAAA,CAAA,KChBA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAOA,SAASF,EAAaD,CAAU,SAC9B,MAAIA,EACK,GAEY,KAHP,KAGV,AAA2B,GAHTA,IAGXA,EACFA,EAGY,EAPWE,QAOD,AAA3B,GAPuC,IAOhCF,EACFI,KAAKC,SAAS,CAACL,GAEjBO,OAAOP,EAChB,CAGA,SAASQ,EAAaC,CAAQ,EAC5B,MAAO,CACL,GAAGA,CAAG,CACNC,gBAAiBT,EAAaQ,EAAIC,eAAe,EACjDC,cAAeV,EAAaQ,EAAIE,aAAa,EAC7CE,aAAcZ,EAAaQ,EAAII,YAAY,EAC3CC,cAAeb,EAAaQ,EAAIK,aAAa,CAC/C,CACF,CAEO,eAAeX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IAAI,CAAE,SAChC,EACA,OAAQ,EAAW,KAAK,CAAC,MAAM,EAAI,GACvC,IACO,IACX,EAGI,GAAyB,EACzB,MAAM,EAAe,EADgB,EAGrC,EAAa,EAAO,kBAAkB,GACtC,MAAM,EAAO,qBAAqB,CAAC,EAAI,OAAO,CAAE,IAAI,EAAO,KAAK,CAAC,EAAA,cAAc,CAAC,aAAa,CAAE,CACvF,SAAU,CAAA,EAAG,EAAO,CAAC,EAAE,EAAA,CAAS,CAChC,KAAM,EAAA,QAAQ,CAAC,MAAM,CACrB,WAAY,CACR,cAAe,EACf,cAAe,EAAI,GAAG,AAC1B,CACJ,EAAG,QAAiB,EAAW,CAAC,GAE5C,CAAE,MAAO,EAAK,CAeV,GAdM,aAAe,EAAA,eAAe,EAEhC,CAFmC,KAE7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,mCA3TA,SAAS,EACL,MAAO1B,CAAAA,EAAAA,EAAAA,UAAAA,AAAW,EAAC,kBACf,uBACA,CACJ,EACJ","ignoreList":[0]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},24361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},33405,(e,t,r)=>{t.exports=e.x("child_process",()=>require("child_process"))},4446,(e,t,r)=>{t.exports=e.x("net",()=>require("net"))},77922,e=>{"use strict";var t=e.i(33405),r=e.i(24361),s=e.i(14747),a=e.i(97731),i=e.i(71560),o=e.i(4446);let n=(0,r.promisify)(t.exec),l=new class{gatewayProcess=null;isStarting=!1;async checkProcessExists(e){try{return await n(`ps -p ${e} -o pid=`),!0}catch{return!1}}async checkPortAvailable(e){return new Promise(t=>{let r=o.default.createServer();r.listen(e,()=>{r.once("close",()=>t(!0)),r.close()}),r.on("error",()=>{t(!1)})})}async getPidByPort(e){try{let{stdout:t}=await n(`lsof -ti:${e} 2>/dev/null || echo ''`),r=t.trim();if(r&&!isNaN(parseInt(r)))return parseInt(r);try{let{stdout:t}=await n(`netstat -tlnp 2>/dev/null | grep :${e} | awk '{print $7}' | cut -d'/' -f1 || echo ''`),r=t.trim();if(r&&!isNaN(parseInt(r)))return parseInt(r)}catch{}return null}catch{return null}}async forceKillProcess(e){try{try{process.kill(e,"SIGTERM"),await new Promise(e=>setTimeout(e,1e3))}catch{}if(await this.checkProcessExists(e))try{process.kill(e,"SIGKILL"),await new Promise(e=>setTimeout(e,500))}catch{}return!await this.checkProcessExists(e)}catch(t){return console.error(`Failed to kill process ${e}:`,t),!1}}async killProcessByPort(e){return this.forceKillProcessByPort(e)}async forceKillProcessByPort(e){let t=await this.getPidByPort(e);if(!t)return!0;console.log(`Found process ${t} using port ${e}, attempting to kill...`);let r=await this.forceKillProcess(t);return r?console.log(`Successfully killed process ${t}`):console.warn(`Failed to kill process ${t}`),r}async getStatus(){let e=await (0,a.getServiceStatus)();return e?"running"===e.status&&e.pid&&!await this.checkProcessExists(e.pid)?(await (0,a.updateServiceStatus)({status:"stopped",pid:null}),{status:"stopped"}):{status:e.status,port:e.port,pid:e.pid,started_at:e.started_at}:{status:"stopped"}}async start(e){if(this.isStarting)return{status:"stopped",error:"Service is already starting"};let r=await this.getStatus();if("running"===r.status&&r.port===e)return{status:"running",error:"Service is already running",port:r.port,pid:r.pid};if(!await this.checkPortAvailable(e)){if(console.log(`Port ${e} is in use, attempting to free it...`),await this.killProcessByPort(e),await new Promise(e=>setTimeout(e,1e3)),!await this.checkPortAvailable(e))return{status:"stopped",error:`Port ${e} is still in use after cleanup attempt`};console.log(`Port ${e} is now available`)}this.isStarting=!0;try{try{await (0,i.getDatabase)()}catch(e){return console.error("Failed to initialize database:",e),this.isStarting=!1,{status:"stopped",error:"Failed to initialize database"}}let r=s.default.join(process.cwd(),"dist","src","cli","gateway-server.js"),o=(0,t.spawn)(process.execPath,[r,"--port",e.toString()],{cwd:process.cwd(),stdio:["ignore","pipe","pipe"],env:{...process.env,NODE_ENV:"production"}});o.stdout&&o.stdout.on("data",e=>{process.stdout.write(`[Gateway] ${e}`)}),o.stderr&&o.stderr.on("data",e=>{process.stderr.write(`[Gateway Error] ${e}`)}),o.on("exit",async e=>{console.log(`Gateway process exited with code ${e}`),this.gatewayProcess===o&&(this.gatewayProcess=null,await (0,a.updateServiceStatus)({status:"stopped",pid:null}))}),o.on("error",e=>{console.error(`Failed to start gateway process: ${e.message}`)}),this.gatewayProcess=o;let n=o.pid||null,l=new Date().toISOString();return await (0,a.setServiceStatus)({status:"running",port:e,pid:n,started_at:l}),this.isStarting=!1,console.log(`Gateway server started on port ${e} (PID: ${n})`),{status:"running",port:e,pid:n,started_at:l}}catch(e){return this.isStarting=!1,this.gatewayProcess=null,console.error(`Failed to start gateway service: ${e.message}`),{status:"stopped",error:e.message||"Failed to start service"}}}async stop(){let e=await this.getStatus();if("stopped"===e.status)return{status:"stopped"};let t=e.port||parseInt((await (0,a.getConfig)("port"))?.value||"1357");try{if(this.gatewayProcess&&this.gatewayProcess.pid){let e=this.gatewayProcess.pid;console.log(`Attempting to kill gateway process (PID: ${e})`);try{process.kill(e,"SIGTERM"),console.log(`Sent SIGTERM to process ${e}`),await new Promise(e=>setTimeout(e,1e3))}catch(t){"ESRCH"===t.code?console.log(`Process ${e} already dead (ESRCH)`):console.log(`SIGTERM failed for process ${e}: ${t.message}`)}if(await this.checkProcessExists(e)){console.log(`Process ${e} still exists after SIGTERM, sending SIGKILL`);try{process.kill(e,"SIGKILL"),await new Promise(e=>setTimeout(e,500))}catch(t){"ESRCH"===t.code?console.log(`Process ${e} already dead (ESRCH)`):console.log(`SIGKILL failed for process ${e}: ${t.message}`)}}await this.checkProcessExists(e)?console.warn(`Process ${e} still exists after kill attempts`):console.log(`Successfully killed gateway process ${e}`),this.gatewayProcess=null}if(await new Promise(e=>setTimeout(e,500)),!await this.checkPortAvailable(t)&&(console.log(`Port ${t} still in use, attempting to free it...`),await this.killProcessByPort(t),await new Promise(e=>setTimeout(e,1e3)),!await this.checkPortAvailable(t)))return console.error(`Failed to free port ${t} - it may be in TIME_WAIT state`),{status:"stopped",error:`Port ${t} is still in use. It may be in TIME_WAIT state and will be available shortly.`};return await (0,a.updateServiceStatus)({status:"stopped",pid:null}),this.gatewayProcess=null,console.log("Gateway service stopped"),{status:"stopped"}}catch(e){return await (0,a.updateServiceStatus)({status:"stopped",pid:null}),this.gatewayProcess=null,{status:"stopped",error:e.message||"Failed to stop service"}}}};e.s(["serviceManager",0,l])},4859,e=>{"use strict";var t=e.i(47909),r=e.i(74017),s=e.i(96250),a=e.i(59756),i=e.i(61916),o=e.i(74677),n=e.i(69741),l=e.i(16795),c=e.i(87718),p=e.i(95169),u=e.i(47587),d=e.i(66012),h=e.i(70101),g=e.i(26937),w=e.i(10372),y=e.i(93695);e.i(52474);var v=e.i(220),x=e.i(89171),P=e.i(71560),f=e.i(77922);async function m(e){try{await (0,P.getDatabase)();let e=await f.serviceManager.stop();if(e.error)return x.NextResponse.json(e,{status:400});return x.NextResponse.json(e)}catch(e){return console.error("Service stop API error:",e),x.NextResponse.json({status:"stopped",error:e.message||"Failed to stop service"},{status:500})}}e.s(["POST",0,m,"runtime",0,"nodejs"],20144);var R=e.i(20144);let S=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/service/stop/route",pathname:"/api/service/stop",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/service/stop/route.ts",nextConfigOutput:"",userland:R}),{workAsyncStorage:E,workUnitAsyncStorage:k,serverHooks:b}=S;async function I(e,t,s){s.requestMeta&&(0,a.setRequestMeta)(e,s.requestMeta),S.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let x="/api/service/stop/route";x=x.replace(/\/index$/,"")||"/";let P=await S.prepare(e,t,{srcPage:x,multiZoneDraftMode:!1});if(!P)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:f,params:m,nextConfig:R,parsedUrl:E,isDraftMode:k,prerenderManifest:b,routerServerContext:I,isOnDemandRevalidate:C,revalidateOnlyGenerated:T,resolvedPathname:$,clientReferenceManifest:A,serverActionsManifest:N}=P,_=(0,n.normalizeAppPath)(x),q=!!(b.dynamicRoutes[_]||b.routes[$]),M=async()=>((null==I?void 0:I.render404)?await I.render404(e,t,E,!1):t.end("This page could not be found"),null);if(q&&!k){let e=!!b.routes[$],t=b.dynamicRoutes[_];if(t&&!1===t.fallback&&!e){if(R.adapterPath)return await M();throw new y.NoFallbackError}}let O=null;!q||S.isDev||k||(O="/index"===(O=$)?"/":O);let j=!0===S.isDev||!q,H=q&&!j;N&&A&&(0,o.setManifestsSingleton)({page:x,clientReferenceManifest:A,serverActionsManifest:N});let D=e.method||"GET",F=(0,i.getTracer)(),G=F.getActiveScopeSpan(),K=!!(null==I?void 0:I.isWrappedByNextServer),U=!!(0,a.getRequestMeta)(e,"minimalMode"),B=(0,a.getRequestMeta)(e,"incrementalCache")||await S.getIncrementalCache(e,R,b,U);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let L={params:m,previewProps:b.preview,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts},cacheComponents:!!R.cacheComponents,supportsDynamicResponse:j,incrementalCache:B,cacheLifeProfiles:R.cacheLife,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,s,a)=>S.onRequestError(e,t,s,a,I)},sharedContext:{buildId:f}},W=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),z=c.NextRequestAdapter.fromNodeNextRequest(W,(0,c.signalFromNodeResponse)(t));try{let a,o=async e=>S.handle(z,L).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=r.get("next.route");if(s){let t=`${D} ${s}`;e.setAttributes({"next.route":s,"http.route":s,"next.span_name":t}),e.updateName(t),a&&a!==e&&(a.setAttribute("http.route",s),a.updateName(t))}else e.updateName(`${D} ${x}`)}),n=async a=>{var i,n;let l=async({previousCacheEntry:r})=>{try{if(!U&&C&&T&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await o(a);e.fetchMetrics=L.renderOpts.fetchMetrics;let n=L.renderOpts.pendingWaitUntil;n&&s.waitUntil&&(s.waitUntil(n),n=void 0);let l=L.renderOpts.collectedTags;if(!q)return await (0,d.sendResponse)(W,V,i,L.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);l&&(t[w.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==L.renderOpts.collectedRevalidate&&!(L.renderOpts.collectedRevalidate>=w.INFINITE_CACHE)&&L.renderOpts.collectedRevalidate,s=void 0===L.renderOpts.collectedExpire||L.renderOpts.collectedExpire>=w.INFINITE_CACHE?void 0:L.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:s}}}}catch(t){throw(null==r?void 0:r.isStale)&&await S.onRequestError(e,t,{routerKind:"App Router",routePath:x,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:C})},!1,I),t}},c=await S.handleResponse({req:e,nextConfig:R,cacheKey:O,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:b,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:T,responseGenerator:l,waitUntil:s.waitUntil,isMinimalMode:U});if(!q)return null;if((null==c||null==(i=c.value)?void 0:i.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(n=c.value)?void 0:n.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});U||t.setHeader("x-nextjs-cache",C?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),k&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,h.fromNodeOutgoingHttpHeaders)(c.value.headers);return U&&q||p.delete(w.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,g.getCacheControlHeader)(c.cacheControl)),await (0,d.sendResponse)(W,V,new Response(c.value.body,{headers:p,status:c.value.status||200})),null};K&&G?await n(G):(a=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(p.BaseServerSpan.handleRequest,{spanName:`${D} ${x}`,kind:i.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},n),void 0,!K))}catch(t){if(t instanceof y.NoFallbackError||await S.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,u.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:C})},!1,I),q)throw t;return await (0,d.sendResponse)(W,V,new Response(null,{status:500})),null}}e.s(["handler",0,I,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:k})},"routeModule",0,S,"serverHooks",0,b,"workAsyncStorage",0,E,"workUnitAsyncStorage",0,k],4859)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0qz-m.u._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/server/service-manager.ts","../../../src/app/api/service/stop/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { exec, execSync, spawn, ChildProcess } from 'child_process';\nimport { promisify } from 'util';\nimport path from 'path';\nimport { getServiceStatus, setServiceStatus, updateServiceStatus, getConfig } from '@/db/queries';\nimport { getDatabase } from '@/db/database';\nimport net from 'net';\n\nconst execAsync = promisify(exec);\n\nexport interface ServiceStatusResponse {\n status: 'running' | 'stopped';\n port?: number;\n pid?: number | null;\n started_at?: string | null;\n error?: string;\n}\n\nclass ServiceManager {\n private gatewayProcess: ChildProcess | null = null;\n private isStarting: boolean = false;\n\n /**\n * Check if a process with given PID exists\n */\n private async checkProcessExists(pid: number): Promise<boolean> {\n try {\n await execAsync(`ps -p ${pid} -o pid=`);\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Check if a port is available\n */\n private async checkPortAvailable(port: number): Promise<boolean> {\n return new Promise((resolve) => {\n const server = net.createServer();\n\n server.listen(port, () => {\n server.once('close', () => resolve(true));\n server.close();\n });\n\n server.on('error', () => {\n resolve(false);\n });\n });\n }\n\n /**\n * Get PID using a specific port\n */\n private async getPidByPort(port: number): Promise<number | null> {\n try {\n // Try lsof first (macOS/Linux)\n const { stdout } = await execAsync(`lsof -ti:${port} 2>/dev/null || echo ''`);\n const pid = stdout.trim();\n if (pid && !isNaN(parseInt(pid))) {\n return parseInt(pid);\n }\n\n // Try netstat as fallback (some systems)\n try {\n const { stdout: netstatOut } = await execAsync(`netstat -tlnp 2>/dev/null | grep :${port} | awk '{print $7}' | cut -d'/' -f1 || echo ''`);\n const pid2 = netstatOut.trim();\n if (pid2 && !isNaN(parseInt(pid2))) {\n return parseInt(pid2);\n }\n } catch {\n // netstat might not be available\n }\n\n return null;\n } catch {\n return null;\n }\n }\n\n /**\n * Force kill a process by PID\n */\n private async forceKillProcess(pid: number): Promise<boolean> {\n try {\n // First try SIGTERM for graceful shutdown\n try {\n process.kill(pid, 'SIGTERM');\n // Give process time to terminate gracefully\n await new Promise(resolve => setTimeout(resolve, 1000));\n } catch {\n // Process might already be dead\n }\n\n // Check if process still exists\n if (await this.checkProcessExists(pid)) {\n // Try SIGKILL\n try {\n process.kill(pid, 'SIGKILL');\n await new Promise(resolve => setTimeout(resolve, 500));\n } catch {\n // Might fail if process already dead\n }\n }\n\n return !(await this.checkProcessExists(pid));\n } catch (error) {\n console.error(`Failed to kill process ${pid}:`, error);\n return false;\n }\n }\n\n /**\n * Kill process using a specific port (public method)\n */\n async killProcessByPort(port: number): Promise<boolean> {\n return this.forceKillProcessByPort(port);\n }\n\n /**\n * Force kill a process by PID (private helper)\n */\n private async forceKillProcessByPort(port: number): Promise<boolean> {\n const pid = await this.getPidByPort(port);\n if (!pid) {\n return true; // No process using the port\n }\n\n console.log(`Found process ${pid} using port ${port}, attempting to kill...`);\n const killed = await this.forceKillProcess(pid);\n \n if (killed) {\n console.log(`Successfully killed process ${pid}`);\n } else {\n console.warn(`Failed to kill process ${pid}`);\n }\n\n return killed;\n }\n\n /**\n * Get current service status, verifying process existence\n */\n async getStatus(): Promise<ServiceStatusResponse> {\n const dbStatus = await getServiceStatus();\n\n if (!dbStatus) {\n return { status: 'stopped' };\n }\n\n // If status is running, verify process actually exists\n if (dbStatus.status === 'running' && dbStatus.pid) {\n const processExists = await this.checkProcessExists(dbStatus.pid);\n if (!processExists) {\n // Process doesn't exist, update database\n await updateServiceStatus({ status: 'stopped', pid: null });\n return { status: 'stopped' };\n }\n }\n\n return {\n status: dbStatus.status,\n port: dbStatus.port,\n pid: dbStatus.pid,\n started_at: dbStatus.started_at,\n };\n }\n\n /**\n * Start gateway service\n */\n async start(port: number): Promise<ServiceStatusResponse> {\n // Prevent concurrent starts\n if (this.isStarting) {\n return { status: 'stopped', error: 'Service is already starting' };\n }\n\n // Check if service is already running\n const currentStatus = await this.getStatus();\n if (currentStatus.status === 'running' && currentStatus.port === port) {\n return { status: 'running', error: 'Service is already running', port: currentStatus.port, pid: currentStatus.pid };\n }\n\n // Check if port is available\n const portAvailable = await this.checkPortAvailable(port);\n if (!portAvailable) {\n console.log(`Port ${port} is in use, attempting to free it...`);\n\n // Try to kill the process using the port\n const killed = await this.killProcessByPort(port);\n\n // Wait for port to be released\n await new Promise(resolve => setTimeout(resolve, 1000));\n\n // Check again\n const portNowAvailable = await this.checkPortAvailable(port);\n if (!portNowAvailable) {\n return { status: 'stopped', error: `Port ${port} is still in use after cleanup attempt` };\n }\n\n console.log(`Port ${port} is now available`);\n }\n\n this.isStarting = true;\n\n try {\n // Initialize database\n try {\n await getDatabase();\n } catch (error: any) {\n console.error('Failed to initialize database:', error);\n this.isStarting = false;\n return { status: 'stopped', error: 'Failed to initialize database' };\n }\n\n // Get the path to the gateway server entry script\n const gatewayScriptPath = path.join(process.cwd(), 'dist', 'src', 'cli', 'gateway-server.js');\n\n // Spawn the gateway server in a separate process\n const gatewayProcess = spawn(process.execPath, [gatewayScriptPath, '--port', port.toString()], {\n cwd: process.cwd(),\n stdio: ['ignore', 'pipe', 'pipe'],\n env: { ...process.env, NODE_ENV: process.env.NODE_ENV || 'development' },\n });\n\n // Capture process output\n if (gatewayProcess.stdout) {\n gatewayProcess.stdout.on('data', (data) => {\n process.stdout.write(`[Gateway] ${data}`);\n });\n }\n if (gatewayProcess.stderr) {\n gatewayProcess.stderr.on('data', (data) => {\n process.stderr.write(`[Gateway Error] ${data}`);\n });\n }\n\n // Handle process exit\n gatewayProcess.on('exit', async (code) => {\n console.log(`Gateway process exited with code ${code}`);\n if (this.gatewayProcess === gatewayProcess) {\n this.gatewayProcess = null;\n await updateServiceStatus({ status: 'stopped', pid: null });\n }\n });\n\n gatewayProcess.on('error', (error) => {\n console.error(`Failed to start gateway process: ${error.message}`);\n });\n\n this.gatewayProcess = gatewayProcess;\n const pid = gatewayProcess.pid || null;\n const startedAt = new Date().toISOString();\n\n await setServiceStatus({\n status: 'running',\n port,\n pid,\n started_at: startedAt,\n });\n\n this.isStarting = false;\n\n console.log(`Gateway server started on port ${port} (PID: ${pid})`);\n\n return {\n status: 'running',\n port,\n pid,\n started_at: startedAt,\n };\n } catch (error: any) {\n this.isStarting = false;\n this.gatewayProcess = null;\n console.error(`Failed to start gateway service: ${error.message}`);\n return { status: 'stopped', error: error.message || 'Failed to start service' };\n }\n }\n\n /**\n * Stop the gateway service\n */\n async stop(): Promise<ServiceStatusResponse> {\n const currentStatus = await this.getStatus();\n\n if (currentStatus.status === 'stopped') {\n return { status: 'stopped' };\n }\n\n const port = currentStatus.port || parseInt((await getConfig('port'))?.value || '1357');\n\n try {\n // Track if we successfully killed something\n let killedSuccessfully = false;\n\n // Try to stop the gateway server process\n if (this.gatewayProcess && this.gatewayProcess.pid) {\n const pid = this.gatewayProcess.pid;\n console.log(`Attempting to kill gateway process (PID: ${pid})`);\n\n // First try SIGTERM for graceful shutdown\n try {\n process.kill(pid, 'SIGTERM');\n console.log(`Sent SIGTERM to process ${pid}`);\n // Give process time to terminate gracefully\n await new Promise(resolve => setTimeout(resolve, 1000));\n } catch (error: any) {\n if (error.code === 'ESRCH') {\n console.log(`Process ${pid} already dead (ESRCH)`);\n } else {\n console.log(`SIGTERM failed for process ${pid}: ${error.message}`);\n }\n }\n\n // Check if process still exists\n if (await this.checkProcessExists(pid)) {\n console.log(`Process ${pid} still exists after SIGTERM, sending SIGKILL`);\n try {\n process.kill(pid, 'SIGKILL');\n await new Promise(resolve => setTimeout(resolve, 500));\n } catch (error: any) {\n if (error.code === 'ESRCH') {\n console.log(`Process ${pid} already dead (ESRCH)`);\n } else {\n console.log(`SIGKILL failed for process ${pid}: ${error.message}`);\n }\n }\n }\n\n // Verify process is dead\n if (!(await this.checkProcessExists(pid))) {\n console.log(`Successfully killed gateway process ${pid}`);\n killedSuccessfully = true;\n } else {\n console.warn(`Process ${pid} still exists after kill attempts`);\n }\n\n this.gatewayProcess = null;\n }\n\n // Wait a bit for cleanup\n await new Promise(resolve => setTimeout(resolve, 500));\n\n // Check if port is still in use - if so, force kill by port\n const portStillInUse = !(await this.checkPortAvailable(port));\n\n if (portStillInUse) {\n console.log(`Port ${port} still in use, attempting to free it...`);\n const killed = await this.killProcessByPort(port);\n\n // Wait and verify\n await new Promise(resolve => setTimeout(resolve, 1000));\n\n const stillInUse = !(await this.checkPortAvailable(port));\n if (stillInUse) {\n console.error(`Failed to free port ${port} - it may be in TIME_WAIT state`);\n return {\n status: 'stopped',\n error: `Port ${port} is still in use. It may be in TIME_WAIT state and will be available shortly.`,\n };\n }\n\n killedSuccessfully = true;\n }\n\n // Update database status\n await updateServiceStatus({ status: 'stopped', pid: null });\n this.gatewayProcess = null;\n\n console.log('Gateway service stopped');\n return { status: 'stopped' };\n } catch (error: any) {\n // Even if there's an error, try to update status\n await updateServiceStatus({ status: 'stopped', pid: null });\n this.gatewayProcess = null;\n return { status: 'stopped', error: error.message || 'Failed to stop service' };\n }\n }\n}\n\n// Export singleton instance\nexport const serviceManager = new ServiceManager();\n","import { NextRequest, NextResponse } from 'next/server';\nimport { getDatabase } from '@/db/database';\nimport { serviceManager } from '@/server/service-manager';\n\n// Ensure Node.js runtime (required for service manager)\nexport const runtime = 'nodejs';\n\nexport async function POST(request: NextRequest) {\n try {\n // Initialize database\n await getDatabase();\n \n const result = await serviceManager.stop();\n \n if (result.error) {\n return NextResponse.json(result, { status: 400 });\n }\n\n return NextResponse.json(result);\n } catch (error: any) {\n console.error('Service stop API error:', error);\n return NextResponse.json(\n { status: 'stopped', error: error.message || 'Failed to stop service' },\n { status: 500 }\n );\n }\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/service/stop/route\",\n pathname: \"/api/service/stop\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/app/api/service/stop/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/service/stop/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":["execAsync","ServiceManager","gatewayProcess","isStarting","checkProcessExists","pid","checkPortAvailable","port","Promise","resolve","server","createServer","listen","once","close","on","getPidByPort","stdout","trim","isNaN","parseInt","netstatOut","pid2","forceKillProcess","process","kill","setTimeout","error","console","killProcessByPort","forceKillProcessByPort","log","killed","warn","getStatus","dbStatus","status","processExists","started_at","start","currentStatus","portAvailable","portNowAvailable","gatewayScriptPath","join","cwd","execPath","toString","stdio","env","NODE_ENV","data","write","stderr","code","message","startedAt","Date","toISOString","stop","value","killedSuccessfully","portStillInUse","stillInUse","serviceManager","runtime","POST","request","result","json"],"mappings":"8uCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,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7B,EAAY,cAAc,CAAC,EAAK,EAAK,CACvC,WAAY,aACZ,UAAW,EACX,UAAW,QACX,iBAAkB,CAAA,EAAA,EAAA,mBAAA,AAAmB,EAAC,oBAClC,uBACA,CACJ,EACJ,GAAG,AATgB,EASJ,GAIf,EAAO,MAAM,EAKjB,OAHA,MAAM,CAAA,EAAA,EAAA,YAAA,AAAY,EAAC,EAAa,EAAa,IAAI,SAAS,KAAM,CAC5D,OAAQ,GACZ,IACO,IACX,CACJ,mCA3TA,SAAS,EACL,MAAO,CAAA,EAAA,EAAA,UAAA,AAAW,EAAC,kBACf,uBACA,CACJ,EACJ","ignoreList":[2]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},51532,e=>{"use strict";var t=e.i(71560),r=e.i(97731);async function a(){await (0,t.getDatabase)();let e=await (0,r.getConfig)("port"),a=e?.value||"1357";return`http://localhost:${a}/v1`}async function n(){await (0,t.getDatabase)();let e=await (0,r.getConfig)("api_key");return e?.value||"your-gateway-api-key"}async function o(){let e=await a(),t=await n(),o=(await (0,r.getAllModels)()).filter(e=>e.enabled),i={};for(let e of o)await (0,r.getProviderById)(e.provider_id),i[e.model_id]={name:e.name,limit:{context:128e3,output:65536}};return{npm:"@ai-sdk/openai-compatible",name:"AAR Model Router",options:{baseURL:e,apiKey:t},models:i}}let i="aar-gateway";async function s(e,t){let r,a,n=await o();return(a=(r=t&&"object"==typeof t?{...t}:{}).provider&&"object"==typeof r.provider?{...r.provider}:{})[i]=n,{...r,provider:a,model:`${i}/${e}`}}e.s(["buildMergedConfig",0,s])},95025,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),o=e.i(61916),i=e.i(74677),s=e.i(69741),l=e.i(16795),d=e.i(87718),u=e.i(95169),p=e.i(47587),c=e.i(66012),f=e.i(70101),x=e.i(26937),h=e.i(10372),g=e.i(93695);e.i(52474);var v=e.i(220),y=e.i(89171),R=e.i(22734),m=e.i(14747),w=e.i(46786),C=e.i(51532);let b=(0,m.join)((0,w.homedir)(),".config","opencode"),E=(0,m.join)(b,"opencode.json"),A=(0,m.join)(b,"opencode.json.aar.bak");async function N(e){try{let t,{default_model:r,config:a}=await e.json(),n=null;if((0,R.existsSync)(E))try{n=JSON.parse((0,R.readFileSync)(E,"utf-8"))}catch{n=null}if("string"==typeof a&&a.trim())try{if(!(t=JSON.parse(a))||"object"!=typeof t)throw Error("Invalid config object")}catch(e){return y.NextResponse.json({error:"Invalid config JSON: "+(e.message||"parse error")},{status:400})}else{if(void 0===r||""===r)return y.NextResponse.json({error:"Missing required field: default_model"},{status:400});t=await (0,C.buildMergedConfig)(r,n)}let o=function(){try{if((0,R.existsSync)(E)){let e=(0,R.readFileSync)(E,"utf-8"),t=!1;try{let r=JSON.parse(e);t=!!(r.provider&&r.provider["aar-gateway"])}catch{}return t||(0,R.writeFileSync)(A,e,"utf-8"),{success:!0,existed:!0,isFromAar:t}}return{success:!0,existed:!1,isFromAar:!1}}catch(e){return{success:!1,existed:!1,isFromAar:!1,error:`Backup failed: ${e.message}`}}}();if(!o.success)return y.NextResponse.json({error:o.error},{status:500});(0,R.existsSync)(b)||(0,R.mkdirSync)(b,{recursive:!0});let i=JSON.stringify(t,null,2);(0,R.writeFileSync)(E,i,"utf-8");let s=!!n?.provider?.["aar-gateway"];return y.NextResponse.json({success:!0,message:s?"OpenCode 配置已更新为最新网关信息":"OpenCode configuration applied successfully",config:t,backup:o.existed?"Created backup":"No existing config to backup",previousWasFromAar:o.existed&&o.isFromAar})}catch(e){return console.error("OpenCode Apply API error:",e),y.NextResponse.json({error:e.message||"Internal server error",stack:void 0},{status:500})}}e.s(["POST",0,N],22374);var S=e.i(22374);let j=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/ide/opencode/apply/route",pathname:"/api/ide/opencode/apply",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/ide/opencode/apply/route.ts",nextConfigOutput:"",userland:S}),{workAsyncStorage:k,workUnitAsyncStorage:O,serverHooks:P}=j;async function _(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),j.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let y="/api/ide/opencode/apply/route";y=y.replace(/\/index$/,"")||"/";let R=await j.prepare(e,t,{srcPage:y,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:m,params:w,nextConfig:C,parsedUrl:b,isDraftMode:E,prerenderManifest:A,routerServerContext:N,isOnDemandRevalidate:S,revalidateOnlyGenerated:k,resolvedPathname:O,clientReferenceManifest:P,serverActionsManifest:_}=R,q=(0,s.normalizeAppPath)(y),T=!!(A.dynamicRoutes[q]||A.routes[O]),I=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,b,!1):t.end("This page could not be found"),null);if(T&&!E){let e=!!A.routes[O],t=A.dynamicRoutes[q];if(t&&!1===t.fallback&&!e){if(C.adapterPath)return await I();throw new g.NoFallbackError}}let M=null;!T||j.isDev||E||(M="/index"===(M=O)?"/":M);let H=!0===j.isDev||!T,U=T&&!H;_&&P&&(0,i.setManifestsSingleton)({page:y,clientReferenceManifest:P,serverActionsManifest:_});let F=e.method||"GET",D=(0,o.getTracer)(),$=D.getActiveScopeSpan(),K=!!(null==N?void 0:N.isWrappedByNextServer),B=!!(0,n.getRequestMeta)(e,"minimalMode"),L=(0,n.getRequestMeta)(e,"incrementalCache")||await j.getIncrementalCache(e,C,A,B);null==L||L.resetRequestCache(),globalThis.__incrementalCache=L;let J={params:w,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts},cacheComponents:!!C.cacheComponents,supportsDynamicResponse:H,incrementalCache:L,cacheLifeProfiles:C.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>j.onRequestError(e,t,a,n,N)},sharedContext:{buildId:m}},W=new l.NodeNextRequest(e),G=new l.NodeNextResponse(t),V=d.NextRequestAdapter.fromNodeNextRequest(W,(0,d.signalFromNodeResponse)(t));try{let n,i=async e=>j.handle(V,J).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=D.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${F} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${F} ${y}`)}),s=async n=>{var o,s;let l=async({previousCacheEntry:r})=>{try{if(!B&&S&&k&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await i(n);e.fetchMetrics=J.renderOpts.fetchMetrics;let s=J.renderOpts.pendingWaitUntil;s&&a.waitUntil&&(a.waitUntil(s),s=void 0);let l=J.renderOpts.collectedTags;if(!T)return await (0,c.sendResponse)(W,G,o,J.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(o.headers);l&&(t[h.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==J.renderOpts.collectedRevalidate&&!(J.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&J.renderOpts.collectedRevalidate,a=void 0===J.renderOpts.collectedExpire||J.renderOpts.collectedExpire>=h.INFINITE_CACHE?void 0:J.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:o.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await j.onRequestError(e,t,{routerKind:"App Router",routePath:y,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:S})},!1,N),t}},d=await j.handleResponse({req:e,nextConfig:C,cacheKey:M,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:S,revalidateOnlyGenerated:k,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:B});if(!T)return null;if((null==d||null==(o=d.value)?void 0:o.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(s=d.value)?void 0:s.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",S?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),E&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,f.fromNodeOutgoingHttpHeaders)(d.value.headers);return B&&T||u.delete(h.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,x.getCacheControlHeader)(d.cacheControl)),await (0,c.sendResponse)(W,G,new Response(d.value.body,{headers:u,status:d.value.status||200})),null};K&&$?await s($):(n=D.getActiveScopeSpan(),await D.withPropagatedContext(e.headers,()=>D.trace(u.BaseServerSpan.handleRequest,{spanName:`${F} ${y}`,kind:o.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},s),void 0,!K))}catch(t){if(t instanceof g.NoFallbackError||await j.onRequestError(e,t,{routerKind:"App Router",routePath:q,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:S})},!1,N),T)throw t;return await (0,c.sendResponse)(W,G,new Response(null,{status:500})),null}}e.s(["handler",0,_,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:k,workUnitAsyncStorage:O})},"routeModule",0,j,"serverHooks",0,P,"workAsyncStorage",0,k,"workUnitAsyncStorage",0,O],95025)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0r235yd._.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/app/api/ide/opencode/build-config.ts","../../../src/app/api/ide/opencode/apply/route.ts","../../../node_modules/next/dist/esm/build/templates/app-route.js"],"sourcesContent":["import { getDatabase } from '@/db/database';\nimport { getConfig } from '@/db/queries';\nimport { getAllModels, getProviderById } from '@/db/queries';\n\nexport async function getGatewayAddress(): Promise<string> {\n await getDatabase();\n const portConfig = await getConfig('port');\n const port = portConfig?.value || '1357';\n return `http://localhost:${port}/v1`;\n}\n\nexport async function getGatewayApiKey(): Promise<string> {\n await getDatabase();\n const apiKeyConfig = await getConfig('api_key');\n return apiKeyConfig?.value || 'your-gateway-api-key';\n}\n\n/** OpenCode provider 下单个 provider 的结构(与官方 provider 文档一致) */\nexport type AarGatewayProviderEntry = {\n npm: string;\n name: string;\n options: { baseURL: string; apiKey: string };\n models: Record<string, { name: string; limit?: { context: number; output?: number } }>;\n};\n\nexport async function buildAarGatewayProvider(): Promise<AarGatewayProviderEntry> {\n const gatewayAddress = await getGatewayAddress();\n const gatewayApiKey = await getGatewayApiKey();\n const allModels = (await getAllModels()).filter((m: any) => m.enabled);\n const models: Record<string, { name: string; limit: { context: number; output: number } }> = {};\n for (const m of allModels) {\n await getProviderById(m.provider_id);\n models[m.model_id] = { name: m.name, limit: { context: 128000, output: 65536 } };\n }\n return {\n npm: '@ai-sdk/openai-compatible',\n name: 'AAR Model Router',\n options: { baseURL: gatewayAddress, apiKey: gatewayApiKey },\n models,\n };\n}\n\nconst AAR_PROVIDER_ID = 'aar-gateway';\n\n/** 合并现有配置与 AAR 网关:写入 config.provider[\"aar-gateway\"],并设置 config.model = \"aar-gateway/{defaultModel}\" */\nexport function mergeConfigWithAar(\n existing: Record<string, any> | null,\n defaultModel: string,\n aarProvider: AarGatewayProviderEntry\n): Record<string, any> {\n const base = existing && typeof existing === 'object' ? { ...existing } : {};\n const provider: Record<string, any> =\n base.provider && typeof base.provider === 'object' ? { ...base.provider } : {};\n provider[AAR_PROVIDER_ID] = aarProvider;\n return {\n ...base,\n provider,\n model: `${AAR_PROVIDER_ID}/${defaultModel}`,\n };\n}\n\n/** 生成合并后的配置(不写入磁盘),供预览或应用使用 */\nexport async function buildMergedConfig(\n defaultModel: string,\n existing: Record<string, any> | null\n): Promise<Record<string, any>> {\n const aarProvider = await buildAarGatewayProvider();\n return mergeConfigWithAar(existing, defaultModel, aarProvider);\n}\n","import { NextRequest, NextResponse } from 'next/server';\nimport { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';\nimport { join } from 'path';\nimport { homedir } from 'os';\nimport { buildMergedConfig } from '../build-config';\n\nconst OPENCODE_DIR =\n process.platform === 'win32'\n ? join(process.env.APPDATA || homedir(), 'opencode')\n : join(homedir(), '.config', 'opencode');\nconst OPENCODE_FILE = join(OPENCODE_DIR, 'opencode.json');\nconst BACKUP_FILE = join(OPENCODE_DIR, 'opencode.json.aar.bak');\n\nfunction backupOriginalConfig(): { success: boolean; existed: boolean; isFromAar: boolean; error?: string } {\n try {\n const existing = existsSync(OPENCODE_FILE);\n if (existing) {\n const original = readFileSync(OPENCODE_FILE, 'utf-8');\n let isFromAar = false;\n try {\n const parsed = JSON.parse(original);\n isFromAar = !!(parsed.provider && parsed.provider['aar-gateway']);\n } catch {}\n // 仅在当前配置不是 AAR 时写入备份,这样「还原」才能恢复到应用 AAR 前的状态;若已是 AAR 则保留原有备份不覆盖\n if (!isFromAar) {\n writeFileSync(BACKUP_FILE, original, 'utf-8');\n }\n return { success: true, existed: true, isFromAar };\n }\n return { success: true, existed: false, isFromAar: false };\n } catch (error: any) {\n return { success: false, existed: false, isFromAar: false, error: `Backup failed: ${error.message}` };\n }\n}\n\nexport async function POST(request: NextRequest) {\n try {\n const body = await request.json();\n const { default_model: defaultModel, config: customConfigStr } = body;\n\n let existing: Record<string, any> | null = null;\n if (existsSync(OPENCODE_FILE)) {\n try {\n existing = JSON.parse(readFileSync(OPENCODE_FILE, 'utf-8'));\n } catch {\n existing = null;\n }\n }\n\n let config: Record<string, any>;\n if (typeof customConfigStr === 'string' && customConfigStr.trim()) {\n try {\n config = JSON.parse(customConfigStr);\n if (!config || typeof config !== 'object') throw new Error('Invalid config object');\n } catch (e: any) {\n return NextResponse.json({ error: 'Invalid config JSON: ' + (e.message || 'parse error') }, { status: 400 });\n }\n } else {\n if (defaultModel === undefined || defaultModel === '') {\n return NextResponse.json({ error: 'Missing required field: default_model' }, { status: 400 });\n }\n config = await buildMergedConfig(defaultModel, existing);\n }\n\n const backupResult = backupOriginalConfig();\n if (!backupResult.success) {\n return NextResponse.json({ error: backupResult.error }, { status: 500 });\n }\n\n if (!existsSync(OPENCODE_DIR)) {\n mkdirSync(OPENCODE_DIR, { recursive: true });\n }\n\n const jsonString = JSON.stringify(config, null, 2);\n writeFileSync(OPENCODE_FILE, jsonString, 'utf-8');\n\n const alreadyHadAar = !!(existing?.provider?.['aar-gateway']);\n return NextResponse.json({\n success: true,\n message: alreadyHadAar ? 'OpenCode 配置已更新为最新网关信息' : 'OpenCode configuration applied successfully',\n config,\n backup: backupResult.existed ? 'Created backup' : 'No existing config to backup',\n previousWasFromAar: backupResult.existed && backupResult.isFromAar,\n });\n } catch (error: any) {\n console.error('OpenCode Apply API error:', error);\n return NextResponse.json(\n { error: error.message || 'Internal server error', stack: process.env.NODE_ENV === 'development' ? error.stack : undefined },\n { status: 500 }\n );\n }\n}\n","import { AppRouteRouteModule } from \"next/dist/esm/server/route-modules/app-route/module.compiled\";\nimport { RouteKind } from \"next/dist/esm/server/route-kind\";\nimport { patchFetch as _patchFetch } from \"next/dist/esm/server/lib/patch-fetch\";\nimport { addRequestMeta, getRequestMeta, setRequestMeta } from \"next/dist/esm/server/request-meta\";\nimport { getTracer, SpanKind } from \"next/dist/esm/server/lib/trace/tracer\";\nimport { setManifestsSingleton } from \"next/dist/esm/server/app-render/manifests-singleton\";\nimport { normalizeAppPath } from \"next/dist/esm/shared/lib/router/utils/app-paths\";\nimport { NodeNextRequest, NodeNextResponse } from \"next/dist/esm/server/base-http/node\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"next/dist/esm/server/web/spec-extension/adapters/next-request\";\nimport { BaseServerSpan } from \"next/dist/esm/server/lib/trace/constants\";\nimport { getRevalidateReason } from \"next/dist/esm/server/instrumentation/utils\";\nimport { sendResponse } from \"next/dist/esm/server/send-response\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"next/dist/esm/server/web/utils\";\nimport { getCacheControlHeader } from \"next/dist/esm/server/lib/cache-control\";\nimport { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from \"next/dist/esm/lib/constants\";\nimport { NoFallbackError } from \"next/dist/esm/shared/lib/no-fallback-error.external\";\nimport { CachedRouteKind } from \"next/dist/esm/server/response-cache\";\nimport * as userland from \"INNER_APP_ROUTE\";\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: \"/api/ide/opencode/apply/route\",\n pathname: \"/api/ide/opencode/apply\",\n filename: \"route\",\n bundlePath: \"\"\n },\n distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\n resolvedPagePath: \"[project]/src/app/api/ide/opencode/apply/route.ts\",\n nextConfigOutput,\n userland\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\nexport { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };\nexport async function handler(req, res, ctx) {\n if (ctx.requestMeta) {\n setRequestMeta(req, ctx.requestMeta);\n }\n if (routeModule.isDev) {\n addRequestMeta(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());\n }\n let srcPage = \"/api/ide/opencode/apply/route\";\n // turbopack doesn't normalize `/index` in the page name\n // so we need to to process dynamic routes properly\n // TODO: fix turbopack providing differing value from webpack\n if (process.env.TURBOPACK) {\n srcPage = srcPage.replace(/\\/index$/, '') || '/';\n } else if (srcPage === '/index') {\n // we always normalize /index specifically\n srcPage = '/';\n }\n const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;\n const prepareResult = await routeModule.prepare(req, res, {\n srcPage,\n multiZoneDraftMode\n });\n if (!prepareResult) {\n res.statusCode = 400;\n res.end('Bad Request');\n ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());\n return null;\n }\n const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;\n const normalizedSrcPage = normalizeAppPath(srcPage);\n let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);\n const render404 = async ()=>{\n // TODO: should route-module itself handle rendering the 404\n if (routerServerContext == null ? void 0 : routerServerContext.render404) {\n await routerServerContext.render404(req, res, parsedUrl, false);\n } else {\n res.end('This page could not be found');\n }\n return null;\n };\n if (isIsr && !isDraftMode) {\n const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);\n const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];\n if (prerenderInfo) {\n if (prerenderInfo.fallback === false && !isPrerendered) {\n if (nextConfig.adapterPath) {\n return await render404();\n }\n throw new NoFallbackError();\n }\n }\n }\n let cacheKey = null;\n if (isIsr && !routeModule.isDev && !isDraftMode) {\n cacheKey = resolvedPathname;\n // ensure /index and / is normalized to one key\n cacheKey = cacheKey === '/index' ? '/' : cacheKey;\n }\n const supportsDynamicResponse = // If we're in development, we always support dynamic HTML\n routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isIsr;\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n const isStaticGeneration = isIsr && !supportsDynamicResponse;\n // Before rendering (which initializes component tree modules), we have to\n // set the reference manifests to our global store so Server Action's\n // encryption util can access to them at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setManifestsSingleton({\n page: srcPage,\n clientReferenceManifest,\n serverActionsManifest\n });\n }\n const method = req.method || 'GET';\n const tracer = getTracer();\n const activeSpan = tracer.getActiveScopeSpan();\n const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);\n const isMinimalMode = Boolean(getRequestMeta(req, 'minimalMode'));\n const incrementalCache = getRequestMeta(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode);\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n globalThis.__incrementalCache = incrementalCache;\n const context = {\n params,\n previewProps: prerenderManifest.preview,\n renderOpts: {\n experimental: {\n authInterrupts: Boolean(nextConfig.experimental.authInterrupts)\n },\n cacheComponents: Boolean(nextConfig.cacheComponents),\n supportsDynamicResponse,\n incrementalCache,\n cacheLifeProfiles: nextConfig.cacheLife,\n waitUntil: ctx.waitUntil,\n onClose: (cb)=>{\n res.on('close', cb);\n },\n onAfterTaskError: undefined,\n onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)\n },\n sharedContext: {\n buildId\n }\n };\n const nodeNextReq = new NodeNextRequest(req);\n const nodeNextRes = new NodeNextResponse(res);\n const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res));\n try {\n let parentSpan;\n const invokeRouteModule = async (span)=>{\n return routeModule.handle(nextReq, context).finally(()=>{\n if (!span) return;\n span.setAttributes({\n 'http.status_code': res.statusCode,\n 'next.rsc': false\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) {\n return;\n }\n if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get('next.route');\n if (route) {\n const name = `${method} ${route}`;\n span.setAttributes({\n 'next.route': route,\n 'http.route': route,\n 'next.span_name': name\n });\n span.updateName(name);\n // Propagate http.route to the parent span if one exists (e.g.\n // a platform-created HTTP span in adapter deployments).\n if (parentSpan && parentSpan !== span) {\n parentSpan.setAttribute('http.route', route);\n parentSpan.updateName(name);\n }\n } else {\n span.updateName(`${method} ${srcPage}`);\n }\n });\n };\n const handleResponse = async (currentSpan)=>{\n var _cacheEntry_value;\n const responseGenerator = async ({ previousCacheEntry })=>{\n try {\n if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {\n res.statusCode = 404;\n // on-demand revalidate always sets this header\n res.setHeader('x-nextjs-cache', 'REVALIDATED');\n res.end('This page could not be found');\n return null;\n }\n const response = await invokeRouteModule(currentSpan);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n let pendingWaitUntil = context.renderOpts.pendingWaitUntil;\n // Attempt using provided waitUntil if available\n // if it's not we fallback to sendResponse's handling\n if (pendingWaitUntil) {\n if (ctx.waitUntil) {\n ctx.waitUntil(pendingWaitUntil);\n pendingWaitUntil = undefined;\n }\n }\n const cacheTags = context.renderOpts.collectedTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isIsr) {\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers['content-type'] && blob.type) {\n headers['content-type'] = blob.type;\n }\n const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;\n const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n cacheControl: {\n revalidate,\n expire\n }\n };\n return cacheEntry;\n } else {\n // send response without caching if not ISR\n await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);\n return null;\n }\n } catch (err) {\n // if this is a background revalidate we need to report\n // the request error here as it won't be bubbled\n if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: srcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n throw err;\n }\n };\n const cacheEntry = await routeModule.handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind: RouteKind.APP_ROUTE,\n isFallback: false,\n prerenderManifest,\n isRoutePPREnabled: false,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil: ctx.waitUntil,\n isMinimalMode\n });\n // we don't create a cacheEntry for ISR\n if (!isIsr) {\n return null;\n }\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) {\n var _cacheEntry_value1;\n throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), \"__NEXT_ERROR_CODE\", {\n value: \"E701\",\n enumerable: false,\n configurable: true\n });\n }\n if (!isMinimalMode) {\n res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');\n }\n // Draft mode should never be cached\n if (isDraftMode) {\n res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');\n }\n const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers);\n if (!(isMinimalMode && isIsr)) {\n headers.delete(NEXT_CACHE_TAGS_HEADER);\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {\n headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl));\n }\n await sendResponse(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.\n new Response(cacheEntry.value.body, {\n headers,\n status: cacheEntry.value.status || 200\n }));\n return null;\n };\n // TODO: activeSpan code path is for when wrapped by\n // next-server can be removed when this is no longer used\n if (isWrappedByNextServer && activeSpan) {\n await handleResponse(activeSpan);\n } else {\n parentSpan = tracer.getActiveScopeSpan();\n await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${method} ${srcPage}`,\n kind: SpanKind.SERVER,\n attributes: {\n 'http.method': method,\n 'http.target': req.url\n }\n }, handleResponse), undefined, !isWrappedByNextServer);\n }\n } catch (err) {\n if (!(err instanceof NoFallbackError)) {\n const silenceLog = false;\n await routeModule.onRequestError(req, err, {\n routerKind: 'App Router',\n routePath: normalizedSrcPage,\n routeType: 'route',\n revalidateReason: getRevalidateReason({\n isStaticGeneration,\n isOnDemandRevalidate\n })\n }, silenceLog, routerServerContext);\n }\n // rethrow so that we can handle serving error page\n // If this is during static generation, throw the error again.\n if (isIsr) throw err;\n // Otherwise, send a 500 response.\n await sendResponse(nodeNextReq, nodeNextRes, new Response(null, {\n status: 500\n }));\n return null;\n }\n}\n\n//# sourceMappingURL=app-route.js.map\n"],"names":["getGatewayAddress","portConfig","port","value","getGatewayApiKey","apiKeyConfig","buildAarGatewayProvider","gatewayAddress","gatewayApiKey","allModels","filter","m","enabled","models","provider_id","model_id","name","limit","context","output","npm","options","baseURL","apiKey","AAR_PROVIDER_ID","mergeConfigWithAar","existing","defaultModel","aarProvider","base","provider","model","buildMergedConfig","OPENCODE_DIR","OPENCODE_FILE","BACKUP_FILE","backupOriginalConfig","original","isFromAar","config","parsed","JSON","parse","body","success","existed","error","message","POST","request","json","default_model","customConfigStr","backupResult","status","trim","Error","e","undefined","recursive","jsonString","stringify","alreadyHadAar","backup","previousWasFromAar","console","stack"],"mappings":"8iCAAA,IAAA,EAAA,EAAA,CAAA,CAAA,OACA,EAAA,EAAA,CAAA,CAAA,OAGO,eAAeA,IACpB,MAAM,CAAA,EAAA,EAAA,WAAA,AAA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