@seqyuan/annodex 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -0
- package/.next/app-path-routes-manifest.json +39 -0
- package/.next/build-manifest.json +20 -0
- package/.next/diagnostics/build-diagnostics.json +6 -0
- package/.next/diagnostics/framework.json +1 -0
- package/.next/export-marker.json +6 -0
- package/.next/images-manifest.json +68 -0
- package/.next/next-minimal-server.js.nft.json +1 -0
- package/.next/next-server.js.nft.json +1 -0
- package/.next/package.json +1 -0
- package/.next/prerender-manifest.json +109 -0
- package/.next/react-loadable-manifest.json +2320 -0
- package/.next/required-server-files.js +343 -0
- package/.next/required-server-files.json +343 -0
- package/.next/routes-manifest.json +286 -0
- package/.next/server/app/_global-error/page.js +32 -0
- package/.next/server/app/_global-error/page.js.nft.json +1 -0
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -0
- package/.next/server/app/_global-error.html +1 -0
- package/.next/server/app/_global-error.meta +16 -0
- package/.next/server/app/_global-error.rsc +14 -0
- package/.next/server/app/_global-error.segments/_full.segment.rsc +14 -0
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +5 -0
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +5 -0
- package/.next/server/app/_global-error.segments/_head.segment.rsc +5 -0
- package/.next/server/app/_global-error.segments/_index.segment.rsc +5 -0
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
- package/.next/server/app/_not-found/page.js +2 -0
- package/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/.next/server/app/_not-found.html +1 -0
- package/.next/server/app/_not-found.meta +16 -0
- package/.next/server/app/_not-found.rsc +18 -0
- package/.next/server/app/_not-found.segments/_full.segment.rsc +18 -0
- package/.next/server/app/_not-found.segments/_head.segment.rsc +6 -0
- package/.next/server/app/_not-found.segments/_index.segment.rsc +5 -0
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +5 -0
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +4 -0
- package/.next/server/app/api/agent/[id]/events/route.js +3 -0
- package/.next/server/app/api/agent/[id]/events/route.js.nft.json +1 -0
- package/.next/server/app/api/agent/[id]/events/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/agent/[id]/route.js +1 -0
- package/.next/server/app/api/agent/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/agent/[id]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/agent/new/route.js +1 -0
- package/.next/server/app/api/agent/new/route.js.nft.json +1 -0
- package/.next/server/app/api/agent/new/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/auth/all-providers/route.js +1 -0
- package/.next/server/app/api/auth/all-providers/route.js.nft.json +1 -0
- package/.next/server/app/api/auth/all-providers/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -0
- package/.next/server/app/api/auth/api-key/[provider]/route.js.nft.json +1 -0
- package/.next/server/app/api/auth/api-key/[provider]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/auth/login/[provider]/route.js +1 -0
- package/.next/server/app/api/auth/login/[provider]/route.js.nft.json +1 -0
- package/.next/server/app/api/auth/login/[provider]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/auth/login/route.js +1 -0
- package/.next/server/app/api/auth/login/route.js.nft.json +1 -0
- package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/auth/logout/[provider]/route.js +1 -0
- package/.next/server/app/api/auth/logout/[provider]/route.js.nft.json +1 -0
- package/.next/server/app/api/auth/logout/[provider]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/auth/providers/route.js +1 -0
- package/.next/server/app/api/auth/providers/route.js.nft.json +1 -0
- package/.next/server/app/api/auth/providers/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/auth/status/route.js +1 -0
- package/.next/server/app/api/auth/status/route.js.nft.json +1 -0
- package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/default-cwd/route.js +1 -0
- package/.next/server/app/api/default-cwd/route.js.nft.json +1 -0
- package/.next/server/app/api/default-cwd/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/files/[...path]/route.js +4 -0
- package/.next/server/app/api/files/[...path]/route.js.nft.json +1 -0
- package/.next/server/app/api/files/[...path]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/harness/route.js +1 -0
- package/.next/server/app/api/harness/route.js.nft.json +1 -0
- package/.next/server/app/api/harness/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/home/route.js +1 -0
- package/.next/server/app/api/home/route.js.nft.json +1 -0
- package/.next/server/app/api/home/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/internal/runtime/route.js +1 -0
- package/.next/server/app/api/internal/runtime/route.js.nft.json +1 -0
- package/.next/server/app/api/internal/runtime/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/models/route.js +1 -0
- package/.next/server/app/api/models/route.js.nft.json +1 -0
- package/.next/server/app/api/models/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/models-config/discover/route.js +1 -0
- package/.next/server/app/api/models-config/discover/route.js.nft.json +1 -0
- package/.next/server/app/api/models-config/discover/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/models-config/route.js +1 -0
- package/.next/server/app/api/models-config/route.js.nft.json +1 -0
- package/.next/server/app/api/models-config/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/models-config/test/route.js +1 -0
- package/.next/server/app/api/models-config/test/route.js.nft.json +1 -0
- package/.next/server/app/api/models-config/test/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/projects/browse/route.js +1 -0
- package/.next/server/app/api/projects/browse/route.js.nft.json +1 -0
- package/.next/server/app/api/projects/browse/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/projects/route.js +1 -0
- package/.next/server/app/api/projects/route.js.nft.json +1 -0
- package/.next/server/app/api/projects/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/reports/[id]/route.js +10 -0
- package/.next/server/app/api/reports/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/reports/[id]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/search/route.js +1 -0
- package/.next/server/app/api/search/route.js.nft.json +1 -0
- package/.next/server/app/api/search/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/sessions/[id]/context/route.js +1 -0
- package/.next/server/app/api/sessions/[id]/context/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/[id]/context/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/sessions/[id]/route.js +1 -0
- package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/sessions/new/route.js +1 -0
- package/.next/server/app/api/sessions/new/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/new/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/sessions/route.js +1 -0
- package/.next/server/app/api/sessions/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/settings/route.js +1 -0
- package/.next/server/app/api/settings/route.js.nft.json +1 -0
- package/.next/server/app/api/settings/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/skills/install/route.js +5 -0
- package/.next/server/app/api/skills/install/route.js.nft.json +1 -0
- package/.next/server/app/api/skills/install/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/skills/route.js +6 -0
- package/.next/server/app/api/skills/route.js.nft.json +1 -0
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/skills/search/route.js +1 -0
- package/.next/server/app/api/skills/search/route.js.nft.json +1 -0
- package/.next/server/app/api/skills/search/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/soul/route.js +1 -0
- package/.next/server/app/api/soul/route.js.nft.json +1 -0
- package/.next/server/app/api/soul/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/version/route.js +1 -0
- package/.next/server/app/api/version/route.js.nft.json +1 -0
- package/.next/server/app/api/version/route_client-reference-manifest.js +1 -0
- package/.next/server/app/index.html +1 -0
- package/.next/server/app/index.meta +14 -0
- package/.next/server/app/index.rsc +17 -0
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +6 -0
- package/.next/server/app/index.segments/_full.segment.rsc +17 -0
- package/.next/server/app/index.segments/_head.segment.rsc +6 -0
- package/.next/server/app/index.segments/_index.segment.rsc +5 -0
- package/.next/server/app/index.segments/_tree.segment.rsc +4 -0
- package/.next/server/app/login/page.js +2 -0
- package/.next/server/app/login/page.js.nft.json +1 -0
- package/.next/server/app/login/page_client-reference-manifest.js +1 -0
- package/.next/server/app/login.html +1 -0
- package/.next/server/app/login.meta +15 -0
- package/.next/server/app/login.rsc +22 -0
- package/.next/server/app/login.segments/_full.segment.rsc +22 -0
- package/.next/server/app/login.segments/_head.segment.rsc +6 -0
- package/.next/server/app/login.segments/_index.segment.rsc +5 -0
- package/.next/server/app/login.segments/_tree.segment.rsc +4 -0
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +9 -0
- package/.next/server/app/login.segments/login.segment.rsc +5 -0
- package/.next/server/app/page.js +261 -0
- package/.next/server/app/page.js.nft.json +1 -0
- package/.next/server/app/page_client-reference-manifest.js +1 -0
- package/.next/server/app-paths-manifest.json +39 -0
- package/.next/server/chunks/1048.js +1 -0
- package/.next/server/chunks/1367.js +77 -0
- package/.next/server/chunks/1381.js +1 -0
- package/.next/server/chunks/165.js +1 -0
- package/.next/server/chunks/1681.js +215 -0
- package/.next/server/chunks/1688.js +45 -0
- package/.next/server/chunks/1703.js +79 -0
- package/.next/server/chunks/1712.js +43 -0
- package/.next/server/chunks/1813.js +1 -0
- package/.next/server/chunks/2325.js +80 -0
- package/.next/server/chunks/258.js +1 -0
- package/.next/server/chunks/2671.js +287 -0
- package/.next/server/chunks/2778.js +1 -0
- package/.next/server/chunks/2943.js +1 -0
- package/.next/server/chunks/3031.js +226 -0
- package/.next/server/chunks/3181.js +1 -0
- package/.next/server/chunks/3493.js +1 -0
- package/.next/server/chunks/3672.js +1 -0
- package/.next/server/chunks/3701.js +104 -0
- package/.next/server/chunks/4013.js +1 -0
- package/.next/server/chunks/402.js +2 -0
- package/.next/server/chunks/4035.js +80 -0
- package/.next/server/chunks/4248.js +153 -0
- package/.next/server/chunks/4367.js +1 -0
- package/.next/server/chunks/4406.js +141 -0
- package/.next/server/chunks/4741.js +18 -0
- package/.next/server/chunks/4768.js +1 -0
- package/.next/server/chunks/4858.js +148 -0
- package/.next/server/chunks/4980.js +1 -0
- package/.next/server/chunks/5155.js +5 -0
- package/.next/server/chunks/5293.js +166 -0
- package/.next/server/chunks/5399.js +8 -0
- package/.next/server/chunks/5409.js +1 -0
- package/.next/server/chunks/5797.js +93 -0
- package/.next/server/chunks/5851.js +36 -0
- package/.next/server/chunks/6206.js +1 -0
- package/.next/server/chunks/6296.js +1 -0
- package/.next/server/chunks/63.js +45 -0
- package/.next/server/chunks/6346.js +1 -0
- package/.next/server/chunks/6406.js +23 -0
- package/.next/server/chunks/642.js +1 -0
- package/.next/server/chunks/6429.js +50 -0
- package/.next/server/chunks/6729.js +64 -0
- package/.next/server/chunks/6907.js +115 -0
- package/.next/server/chunks/6980.js +1 -0
- package/.next/server/chunks/7073.js +24 -0
- package/.next/server/chunks/7233.js +24 -0
- package/.next/server/chunks/7307.js +1 -0
- package/.next/server/chunks/7362.js +9 -0
- package/.next/server/chunks/7567.js +29 -0
- package/.next/server/chunks/7765.js +1 -0
- package/.next/server/chunks/7890.js +1 -0
- package/.next/server/chunks/8065.js +1 -0
- package/.next/server/chunks/8238.js +34 -0
- package/.next/server/chunks/8276.js +1 -0
- package/.next/server/chunks/8336.js +1 -0
- package/.next/server/chunks/8477.js +3 -0
- package/.next/server/chunks/8490.js +1 -0
- package/.next/server/chunks/8916.js +1 -0
- package/.next/server/chunks/9280.js +252 -0
- package/.next/server/chunks/9315.js +1 -0
- package/.next/server/chunks/9537.js +90 -0
- package/.next/server/chunks/966.js +1 -0
- package/.next/server/chunks/9818.js +21 -0
- package/.next/server/chunks/static/media/pdf.worker.min.c476e1a0.mjs +6 -0
- package/.next/server/functions-config-manifest.json +16 -0
- package/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -0
- package/.next/server/middleware-manifest.json +6 -0
- package/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/.next/server/middleware.js +18 -0
- package/.next/server/middleware.js.nft.json +1 -0
- package/.next/server/next-font-manifest.js +1 -0
- package/.next/server/next-font-manifest.json +1 -0
- package/.next/server/pages/404.html +1 -0
- package/.next/server/pages/500.html +1 -0
- package/.next/server/pages-manifest.json +4 -0
- package/.next/server/prefetch-hints.json +1 -0
- package/.next/server/server-reference-manifest.js +1 -0
- package/.next/server/server-reference-manifest.json +1 -0
- package/.next/server/webpack-runtime.js +1 -0
- package/.next/static/chunks/0b9a0da7.9075af772487e743.js +62 -0
- package/.next/static/chunks/1413.922d232de90c0c41.js +115 -0
- package/.next/static/chunks/1643.467a526a1f24f54d.js +24 -0
- package/.next/static/chunks/1852.5543122f11aa7fed.js +1 -0
- package/.next/static/chunks/1960.b1e26436d7a5f586.js +1 -0
- package/.next/static/chunks/2170a4aa.4213bb2183c9cdf9.js +1 -0
- package/.next/static/chunks/2274.6cd173f80a1405a2.js +21 -0
- package/.next/static/chunks/2419.347fdfe3c170854d.js +166 -0
- package/.next/static/chunks/2619.9aac8983f30c7c8a.js +1 -0
- package/.next/static/chunks/2623.d20fabd8e18197c6.js +287 -0
- package/.next/static/chunks/2729.f5365061a849d659.js +34 -0
- package/.next/static/chunks/2821.934bcf60fbdc28c6.js +1 -0
- package/.next/static/chunks/2918becc.abff2ece1de37bc1.js +153 -0
- package/.next/static/chunks/2947.114e51cb06d1c01a.js +23 -0
- package/.next/static/chunks/3079.4c511fa1144e3adf.js +79 -0
- package/.next/static/chunks/3274.208ca44844cd7d95.js +148 -0
- package/.next/static/chunks/3308.465a94263d04bfea.js +73 -0
- package/.next/static/chunks/3325.e4bfe1ca657f3b5b.js +80 -0
- package/.next/static/chunks/3506.2a7eaa08b9f55337.js +90 -0
- package/.next/static/chunks/363642f4-043c1475ab9af70e.js +1 -0
- package/.next/static/chunks/3794-123fdf632563f469.js +32 -0
- package/.next/static/chunks/3837.a755ccfe6f9c1c1c.js +5 -0
- package/.next/static/chunks/394.91597771688df6d0.js +1 -0
- package/.next/static/chunks/3997.1009c06025691712.js +1 -0
- package/.next/static/chunks/4453.91a357dc43c21745.js +1 -0
- package/.next/static/chunks/4491.44fdf20580ac72bd.js +24 -0
- package/.next/static/chunks/4829.cf1d50e43e6d9db5.js +1 -0
- package/.next/static/chunks/498.fe1d9da9ecad6c36.js +1 -0
- package/.next/static/chunks/4bd1b696-e356ca5ba0218e27.js +1 -0
- package/.next/static/chunks/5019.b5a1a2b8daf17525.js +1 -0
- package/.next/static/chunks/5034.8f16c3fa3ce75411.js +1 -0
- package/.next/static/chunks/5074.d16651da01ec4e02.js +1 -0
- package/.next/static/chunks/51fb665c.0950e1b79671348d.js +45 -0
- package/.next/static/chunks/532.5956ed631aff722b.js +9 -0
- package/.next/static/chunks/5326.69460442bdcd6cd3.js +1 -0
- package/.next/static/chunks/5403.ff110bf5bf600758.js +64 -0
- package/.next/static/chunks/547.902a733488cfe3f7.js +77 -0
- package/.next/static/chunks/5567.540d7fc108ad6ee5.js +215 -0
- package/.next/static/chunks/5590.ef62922166d308b4.js +1 -0
- package/.next/static/chunks/5690.9d6eb1edb1399995.js +1 -0
- package/.next/static/chunks/5749.25faee4a1e55b854.js +226 -0
- package/.next/static/chunks/58bb9007.1ccb6bba34b4c635.js +80 -0
- package/.next/static/chunks/6121.f3f43f1896ea0cd9.js +1 -0
- package/.next/static/chunks/6600.583c88eef37aa524.js +1 -0
- package/.next/static/chunks/6696.a41aec266e657d54.js +141 -0
- package/.next/static/chunks/6922.42148793782d2fe7.js +1 -0
- package/.next/static/chunks/7006.e191611ffc2b9528.js +43 -0
- package/.next/static/chunks/7343.9fbb58204d8ac681.js +1 -0
- package/.next/static/chunks/73972abe.25a4cffa03b2bcef.js +119 -0
- package/.next/static/chunks/7547.58bda8a2aabba0d4.js +93 -0
- package/.next/static/chunks/7648.4ae2f183b4db0353.js +1 -0
- package/.next/static/chunks/7874.8db6929b94cdf697.js +1 -0
- package/.next/static/chunks/7959.1f20a35df316216a.js +104 -0
- package/.next/static/chunks/83.85d62d7fc9850b75.js +29 -0
- package/.next/static/chunks/8436.cab94b59cca0a8ff.js +1 -0
- package/.next/static/chunks/8451.ff6ff72b57dc52e1.js +1 -0
- package/.next/static/chunks/8489.45f22859734f514f.js +36 -0
- package/.next/static/chunks/8568.f85d8b36fc9a9037.js +1 -0
- package/.next/static/chunks/8771-3e14b6810486df1f.js +1 -0
- package/.next/static/chunks/8863.be51033a67436277.js +1 -0
- package/.next/static/chunks/90542734.dc1a2723e4f6affb.js +1 -0
- package/.next/static/chunks/9500.1488aec06ee78127.js +1 -0
- package/.next/static/chunks/9633.155548b5fca6e580.js +1 -0
- package/.next/static/chunks/9779.673004a62d70e36a.js +1 -0
- package/.next/static/chunks/app/_global-error/page-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/_not-found/page-c72daab99269beff.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/events/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/agent/new/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/auth/all-providers/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/auth/login/[provider]/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/auth/login/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/auth/providers/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/auth/status/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/default-cwd/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/files/[...path]/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/harness/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/home/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/internal/runtime/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/models/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/models-config/discover/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/models-config/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/models-config/test/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/projects/browse/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/projects/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/reports/[id]/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/search/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/sessions/new/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/settings/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/skills/install/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/skills/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/skills/search/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/soul/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/api/version/route-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/app/layout-be148b7ae915b22a.js +1 -0
- package/.next/static/chunks/app/login/page-ebf0e6de99062783.js +1 -0
- package/.next/static/chunks/app/page-0594cb7a3cbb0211.js +260 -0
- package/.next/static/chunks/d3ac728e.7964f816a1ca64e5.js +1 -0
- package/.next/static/chunks/framework-711ef29bc66f648c.js +1 -0
- package/.next/static/chunks/main-app-45a0f19af99d61b6.js +1 -0
- package/.next/static/chunks/main-f74964b7ae52493e.js +5 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-9bfa08b9491621f2.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-cc518af6b1ffb191.js +1 -0
- package/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/.next/static/chunks/webpack-fcf4a889ecbd753c.js +1 -0
- package/.next/static/css/45029451a1d7255d.css +3 -0
- package/.next/static/media/15605e25b523335c-s.woff2 +0 -0
- package/.next/static/media/1a3dce5cfb5f7760-s.woff2 +0 -0
- package/.next/static/media/1cdd02902f937a18-s.woff2 +0 -0
- package/.next/static/media/4c4b3b30b6bcb2be-s.woff2 +0 -0
- package/.next/static/media/641a7b8a5800ee0e-s.woff2 +0 -0
- package/.next/static/media/7deddc85b7ffd1dc-s.p.woff2 +0 -0
- package/.next/static/media/ec14413c594b3356-s.p.woff2 +0 -0
- package/.next/static/media/pdf.worker.min.29aaf158.mjs +6 -0
- package/.next/static/nmfQlwnkhzbPmuiCmhW-_/_buildManifest.js +1 -0
- package/.next/static/nmfQlwnkhzbPmuiCmhW-_/_ssgManifest.js +1 -0
- package/package.json +21 -21
- package/app/api/agent/[id]/events/route.ts +0 -94
- package/app/api/agent/[id]/route.ts +0 -83
- package/app/api/agent/new/route.ts +0 -53
- package/app/api/auth/all-providers/route.ts +0 -21
- package/app/api/auth/api-key/[provider]/route.ts +0 -7
- package/app/api/auth/login/[provider]/route.ts +0 -7
- package/app/api/auth/login/route.ts +0 -22
- package/app/api/auth/logout/[provider]/route.ts +0 -7
- package/app/api/auth/providers/route.ts +0 -15
- package/app/api/auth/status/route.ts +0 -6
- package/app/api/default-cwd/route.ts +0 -22
- package/app/api/files/[...path]/route.ts +0 -621
- package/app/api/harness/route.ts +0 -47
- package/app/api/home/route.ts +0 -6
- package/app/api/internal/runtime/route.ts +0 -26
- package/app/api/models/route.ts +0 -67
- package/app/api/models-config/discover/route.ts +0 -42
- package/app/api/models-config/route.ts +0 -152
- package/app/api/models-config/test/route.ts +0 -154
- package/app/api/projects/browse/route.ts +0 -51
- package/app/api/projects/route.ts +0 -83
- package/app/api/reports/[id]/route.ts +0 -108
- package/app/api/search/route.ts +0 -122
- package/app/api/sessions/[id]/context/route.ts +0 -23
- package/app/api/sessions/[id]/route.ts +0 -124
- package/app/api/sessions/new/route.ts +0 -5
- package/app/api/sessions/route.ts +0 -16
- package/app/api/settings/route.ts +0 -51
- package/app/api/skills/install/route.ts +0 -249
- package/app/api/skills/route.ts +0 -161
- package/app/api/skills/search/route.ts +0 -121
- package/app/api/soul/route.ts +0 -47
- package/app/api/version/route.ts +0 -55
- package/app/globals.css +0 -736
- package/app/layout.tsx +0 -40
- package/app/login/page.tsx +0 -133
- package/app/page.tsx +0 -10
- package/components/AppShell.tsx +0 -1058
- package/components/ChatInput.tsx +0 -1103
- package/components/ChatMinimap.tsx +0 -381
- package/components/ChatWindow.tsx +0 -576
- package/components/CodeMirrorEditor.tsx +0 -137
- package/components/ConversationSearch.tsx +0 -369
- package/components/DataTableViewer.tsx +0 -248
- package/components/FileExplorer.tsx +0 -758
- package/components/FileIcons.tsx +0 -241
- package/components/FileViewer.tsx +0 -1273
- package/components/GlobalFileEditor.tsx +0 -98
- package/components/MarkdownRenderer.tsx +0 -331
- package/components/MermaidDiagram.tsx +0 -80
- package/components/MessageView.tsx +0 -1141
- package/components/ModelsConfig.tsx +0 -1991
- package/components/ProjectContext.tsx +0 -252
- package/components/ProjectFolderPicker.tsx +0 -202
- package/components/ProjectsConfig.tsx +0 -288
- package/components/ProviderIcons.tsx +0 -91
- package/components/ReportPanel.tsx +0 -237
- package/components/ResizeHandle.tsx +0 -105
- package/components/SessionSidebar.tsx +0 -1464
- package/components/SettingsDialog.tsx +0 -287
- package/components/SkillsConfig.tsx +0 -1093
- package/components/SubagentPanel.tsx +0 -191
- package/components/TabBar.tsx +0 -115
- package/components/ToolPanel.tsx +0 -131
- package/components/WidgetRenderer.tsx +0 -505
- package/components/viewers/DocumentToolbar.tsx +0 -78
- package/components/viewers/DocxViewer.tsx +0 -97
- package/components/viewers/PdfViewer.tsx +0 -206
- package/components/viewers/PptxViewer.tsx +0 -240
- package/components/viewers/XlsxViewer.tsx +0 -143
- package/hooks/useAgentSession.ts +0 -710
- package/hooks/useAudio.ts +0 -50
- package/hooks/useDragDrop.ts +0 -52
- package/hooks/useResizable.ts +0 -60
- package/hooks/useTheme.ts +0 -85
- package/lib/agent-client.ts +0 -39
- package/lib/annodex-config.ts +0 -556
- package/lib/auth-token.ts +0 -74
- package/lib/auth.ts +0 -90
- package/lib/brand.ts +0 -5
- package/lib/code-theme.ts +0 -32
- package/lib/codex-compat-proxy.ts +0 -1603
- package/lib/codex-home.ts +0 -6
- package/lib/codex-server.ts +0 -796
- package/lib/codex-session.ts +0 -590
- package/lib/codex-usage.ts +0 -213
- package/lib/file-paths.ts +0 -34
- package/lib/model-discovery.ts +0 -379
- package/lib/normalize.ts +0 -30
- package/lib/npx.ts +0 -87
- package/lib/pi-types.ts +0 -49
- package/lib/projects.ts +0 -269
- package/lib/provider-api.ts +0 -88
- package/lib/report-prompt.ts +0 -61
- package/lib/report-store.ts +0 -597
- package/lib/report-update-parser.ts +0 -66
- package/lib/rpc-manager.ts +0 -668
- package/lib/runtime-state.ts +0 -117
- package/lib/session-reader.ts +0 -903
- package/lib/session-runtime.ts +0 -105
- package/lib/subagent-progress.ts +0 -279
- package/lib/types.ts +0 -241
- package/lib/widget-export.ts +0 -318
- package/lib/widget-guidelines.ts +0 -288
- package/lib/widget-prompt.ts +0 -76
- package/lib/widget-utils.ts +0 -523
- package/postcss.config.mjs +0 -8
- package/proxy.ts +0 -64
- package/scripts/postinstall.cjs +0 -25
- package/tsconfig.json +0 -41
package/lib/codex-usage.ts
DELETED
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from "fs";
|
|
2
|
-
import type { AssistantMessage } from "./types";
|
|
3
|
-
import { getKnownModelDefaults, listAllModels, readMergedConfig } from "./annodex-config";
|
|
4
|
-
|
|
5
|
-
interface UsageNumbers {
|
|
6
|
-
inputTokens: number;
|
|
7
|
-
outputTokens: number;
|
|
8
|
-
totalTokens: number;
|
|
9
|
-
cachedTokens: number;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface UsageSnapshot {
|
|
13
|
-
turnId: string | null;
|
|
14
|
-
observedAt: string;
|
|
15
|
-
last: UsageNumbers;
|
|
16
|
-
total: UsageNumbers;
|
|
17
|
-
contextWindow: number;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface CodexSessionUsage {
|
|
21
|
-
messageUsageByTurnId: Map<string, AssistantMessage["usage"]>;
|
|
22
|
-
sessionStats: {
|
|
23
|
-
tokens: { input: number; output: number; cacheRead: number; cacheWrite: number };
|
|
24
|
-
cost: number;
|
|
25
|
-
} | null;
|
|
26
|
-
contextUsage: { percent: number | null; contextWindow: number; tokens: number | null } | null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
30
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function numberValue(value: unknown): number {
|
|
34
|
-
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function parseUsageNumbers(value: unknown): UsageNumbers {
|
|
38
|
-
if (!isRecord(value)) {
|
|
39
|
-
return { inputTokens: 0, outputTokens: 0, totalTokens: 0, cachedTokens: 0 };
|
|
40
|
-
}
|
|
41
|
-
const inputTokens = numberValue(value.input_tokens ?? value.prompt_tokens ?? value.promptTokenCount);
|
|
42
|
-
const outputTokens = numberValue(value.output_tokens ?? value.completion_tokens ?? value.candidatesTokenCount);
|
|
43
|
-
const cachedTokens = numberValue(
|
|
44
|
-
value.cached_input_tokens
|
|
45
|
-
?? value.cache_read_input_tokens
|
|
46
|
-
?? value.prompt_cache_hit_tokens
|
|
47
|
-
?? (isRecord(value.input_tokens_details) ? value.input_tokens_details.cached_tokens : undefined)
|
|
48
|
-
?? (isRecord(value.prompt_tokens_details) ? value.prompt_tokens_details.cached_tokens : undefined)
|
|
49
|
-
?? value.cachedContentTokenCount,
|
|
50
|
-
);
|
|
51
|
-
const totalTokens = numberValue(value.total_tokens ?? value.totalTokens) || inputTokens + outputTokens;
|
|
52
|
-
return { inputTokens, outputTokens, totalTokens, cachedTokens };
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function hasUsage(usage: UsageNumbers): boolean {
|
|
56
|
-
return usage.inputTokens > 0 || usage.outputTokens > 0 || usage.totalTokens > 0 || usage.cachedTokens > 0;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function usageKey(snapshot: UsageSnapshot): string {
|
|
60
|
-
return [
|
|
61
|
-
snapshot.turnId ?? "",
|
|
62
|
-
snapshot.last.inputTokens,
|
|
63
|
-
snapshot.last.outputTokens,
|
|
64
|
-
snapshot.last.totalTokens,
|
|
65
|
-
snapshot.last.cachedTokens,
|
|
66
|
-
snapshot.total.inputTokens,
|
|
67
|
-
snapshot.total.outputTokens,
|
|
68
|
-
snapshot.total.totalTokens,
|
|
69
|
-
snapshot.total.cachedTokens,
|
|
70
|
-
snapshot.contextWindow,
|
|
71
|
-
].join("|");
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function parseJsonLine(line: string): Record<string, unknown> | null {
|
|
75
|
-
try {
|
|
76
|
-
const parsed = JSON.parse(line) as unknown;
|
|
77
|
-
return isRecord(parsed) ? parsed : null;
|
|
78
|
-
} catch {
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function payloadRecord(line: Record<string, unknown>): Record<string, unknown> | null {
|
|
84
|
-
return isRecord(line.payload) ? line.payload : null;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function contextWindowForModel(modelId?: string | null): number {
|
|
88
|
-
if (!modelId) return 0;
|
|
89
|
-
const known = getKnownModelDefaults(modelId);
|
|
90
|
-
if (known?.contextWindow) return known.contextWindow;
|
|
91
|
-
try {
|
|
92
|
-
const match = listAllModels(readMergedConfig()).find((model) => model.modelId === modelId);
|
|
93
|
-
return match?.contextWindow ?? 0;
|
|
94
|
-
} catch {
|
|
95
|
-
return 0;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function assistantUsageFromSnapshot(snapshot: UsageSnapshot): AssistantMessage["usage"] {
|
|
100
|
-
const input = snapshot.last.inputTokens;
|
|
101
|
-
const output = snapshot.last.outputTokens;
|
|
102
|
-
const cacheRead = snapshot.last.cachedTokens;
|
|
103
|
-
return {
|
|
104
|
-
input,
|
|
105
|
-
output,
|
|
106
|
-
cacheRead,
|
|
107
|
-
cacheWrite: 0,
|
|
108
|
-
cost: {
|
|
109
|
-
input: 0,
|
|
110
|
-
output: 0,
|
|
111
|
-
cacheRead: 0,
|
|
112
|
-
cacheWrite: 0,
|
|
113
|
-
total: 0,
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export function readCodexUsageFromFile(filePath: string | null, fallbackModelId?: string | null): CodexSessionUsage {
|
|
119
|
-
if (!filePath || !existsSync(filePath)) {
|
|
120
|
-
return { messageUsageByTurnId: new Map(), sessionStats: null, contextUsage: null };
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
let content = "";
|
|
124
|
-
try {
|
|
125
|
-
content = readFileSync(filePath, "utf-8");
|
|
126
|
-
} catch {
|
|
127
|
-
return { messageUsageByTurnId: new Map(), sessionStats: null, contextUsage: null };
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const snapshots: UsageSnapshot[] = [];
|
|
131
|
-
let currentTurnId: string | null = null;
|
|
132
|
-
let currentModelId = fallbackModelId ?? null;
|
|
133
|
-
let lastKey = "";
|
|
134
|
-
|
|
135
|
-
for (const line of content.split("\n")) {
|
|
136
|
-
if (!line.trim()) continue;
|
|
137
|
-
const item = parseJsonLine(line);
|
|
138
|
-
if (!item) continue;
|
|
139
|
-
const payload = payloadRecord(item) ?? item;
|
|
140
|
-
|
|
141
|
-
if (item.type === "turn_context") {
|
|
142
|
-
currentTurnId = typeof payload.turn_id === "string" ? payload.turn_id : null;
|
|
143
|
-
if (typeof payload.model === "string" && payload.model.trim()) currentModelId = payload.model;
|
|
144
|
-
continue;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (item.type !== "event_msg" || payload.type !== "token_count" || !isRecord(payload.info)) {
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const last = parseUsageNumbers(payload.info.last_token_usage);
|
|
152
|
-
const total = parseUsageNumbers(payload.info.total_token_usage);
|
|
153
|
-
const contextWindow = numberValue(payload.info.model_context_window) || contextWindowForModel(currentModelId);
|
|
154
|
-
const contextTokens = total.totalTokens || last.totalTokens;
|
|
155
|
-
if (!hasUsage(last) && !hasUsage(total) && contextTokens <= 0) continue;
|
|
156
|
-
|
|
157
|
-
const snapshot: UsageSnapshot = {
|
|
158
|
-
turnId: currentTurnId,
|
|
159
|
-
observedAt: typeof item.timestamp === "string" ? item.timestamp : "",
|
|
160
|
-
last,
|
|
161
|
-
total,
|
|
162
|
-
contextWindow,
|
|
163
|
-
};
|
|
164
|
-
const key = usageKey(snapshot);
|
|
165
|
-
if (key === lastKey) continue;
|
|
166
|
-
lastKey = key;
|
|
167
|
-
snapshots.push(snapshot);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
const byTurn = new Map<string, UsageSnapshot>();
|
|
171
|
-
for (const snapshot of snapshots) {
|
|
172
|
-
if (snapshot.turnId) byTurn.set(snapshot.turnId, snapshot);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
const messageUsageByTurnId = new Map<string, AssistantMessage["usage"]>();
|
|
176
|
-
for (const [turnId, snapshot] of byTurn) {
|
|
177
|
-
messageUsageByTurnId.set(turnId, assistantUsageFromSnapshot(snapshot));
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
const latest = snapshots[snapshots.length - 1];
|
|
181
|
-
const total = latest?.total;
|
|
182
|
-
const totalInput = total?.inputTokens ?? 0;
|
|
183
|
-
const totalOutput = total?.outputTokens ?? 0;
|
|
184
|
-
const totalCacheRead = total?.cachedTokens ?? 0;
|
|
185
|
-
const sessionTotal = totalInput + totalOutput + totalCacheRead;
|
|
186
|
-
const sessionStats = sessionTotal > 0
|
|
187
|
-
? {
|
|
188
|
-
tokens: {
|
|
189
|
-
input: totalInput,
|
|
190
|
-
output: totalOutput,
|
|
191
|
-
cacheRead: totalCacheRead,
|
|
192
|
-
cacheWrite: 0,
|
|
193
|
-
},
|
|
194
|
-
cost: 0,
|
|
195
|
-
}
|
|
196
|
-
: null;
|
|
197
|
-
|
|
198
|
-
const contextWindow = latest?.contextWindow ?? contextWindowForModel(currentModelId);
|
|
199
|
-
const contextTokens = latest ? (latest.last.totalTokens || latest.last.inputTokens || null) : null;
|
|
200
|
-
const contextUsage = contextWindow > 0
|
|
201
|
-
? {
|
|
202
|
-
percent: contextTokens !== null ? Math.min(100, (contextTokens / contextWindow) * 100) : null,
|
|
203
|
-
contextWindow,
|
|
204
|
-
tokens: contextTokens,
|
|
205
|
-
}
|
|
206
|
-
: null;
|
|
207
|
-
|
|
208
|
-
return { messageUsageByTurnId, sessionStats, contextUsage };
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export const __codexUsageTest = {
|
|
212
|
-
readCodexUsageFromFile,
|
|
213
|
-
};
|
package/lib/file-paths.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export function normalizeFilePathSlashes(filePath: string): string {
|
|
2
|
-
if (/^[a-zA-Z]:[\\/]/.test(filePath) || filePath.startsWith("\\\\")) {
|
|
3
|
-
return filePath.replace(/\\/g, "/");
|
|
4
|
-
}
|
|
5
|
-
return filePath;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function encodeFilePathForApi(filePath: string): string {
|
|
9
|
-
return normalizeFilePathSlashes(filePath)
|
|
10
|
-
.split("/")
|
|
11
|
-
.filter(Boolean)
|
|
12
|
-
.map(encodeURIComponent)
|
|
13
|
-
.join("/");
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function getFileName(filePath: string): string {
|
|
17
|
-
const normalized = normalizeFilePathSlashes(filePath).replace(/\/+$/, "");
|
|
18
|
-
return normalized.split("/").pop() ?? normalized;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function getRelativeFilePath(filePath: string, cwd?: string): string {
|
|
22
|
-
if (!cwd) return filePath;
|
|
23
|
-
|
|
24
|
-
const normalizedFile = normalizeFilePathSlashes(filePath);
|
|
25
|
-
const normalizedCwd = normalizeFilePathSlashes(cwd).replace(/\/$/, "");
|
|
26
|
-
if (normalizedFile.startsWith(normalizedCwd + "/")) {
|
|
27
|
-
return normalizedFile.slice(normalizedCwd.length + 1);
|
|
28
|
-
}
|
|
29
|
-
return filePath;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function joinFilePath(parent: string, child: string): string {
|
|
33
|
-
return `${normalizeFilePathSlashes(parent).replace(/\/$/, "")}/${child}`;
|
|
34
|
-
}
|
package/lib/model-discovery.ts
DELETED
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
import { inferModelApi, inferProviderApi, type ProviderApi } from "./provider-api";
|
|
2
|
-
|
|
3
|
-
export interface DiscoveredModel {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
ownedBy: string;
|
|
7
|
-
input?: string[];
|
|
8
|
-
contextWindow?: number;
|
|
9
|
-
maxTokens?: number;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface PiModelImport {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
api?: ProviderApi;
|
|
16
|
-
input?: string[];
|
|
17
|
-
contextWindow: number;
|
|
18
|
-
maxTokens: number;
|
|
19
|
-
reasoning?: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const DEFAULT_CONFIGS = {
|
|
23
|
-
claude: { contextWindow: 200000, maxTokens: 16000 },
|
|
24
|
-
gpt: { contextWindow: 200000, maxTokens: 16000 },
|
|
25
|
-
deepseek: { contextWindow: 128000, maxTokens: 8192 },
|
|
26
|
-
qwen: { contextWindow: 128000, maxTokens: 8192 },
|
|
27
|
-
llama: { contextWindow: 8192, maxTokens: 4096 },
|
|
28
|
-
default: { contextWindow: 200000, maxTokens: 16000 },
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const CONTEXT_WINDOW_KEYS = [
|
|
32
|
-
"contextWindow",
|
|
33
|
-
"context_window",
|
|
34
|
-
"context_length",
|
|
35
|
-
"contextLength",
|
|
36
|
-
"max_context_length",
|
|
37
|
-
"maxContextLength",
|
|
38
|
-
"max_model_len",
|
|
39
|
-
"model_max_length",
|
|
40
|
-
"input_token_limit",
|
|
41
|
-
"max_input_tokens",
|
|
42
|
-
"maxInputTokens",
|
|
43
|
-
"num_ctx",
|
|
44
|
-
"n_ctx",
|
|
45
|
-
];
|
|
46
|
-
|
|
47
|
-
const MAX_TOKENS_KEYS = [
|
|
48
|
-
"maxTokens",
|
|
49
|
-
"max_tokens",
|
|
50
|
-
"max_output_tokens",
|
|
51
|
-
"maxOutputTokens",
|
|
52
|
-
"max_completion_tokens",
|
|
53
|
-
"maxCompletionTokens",
|
|
54
|
-
"output_token_limit",
|
|
55
|
-
"completion_token_limit",
|
|
56
|
-
];
|
|
57
|
-
|
|
58
|
-
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
59
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function unique(items: string[]): string[] {
|
|
63
|
-
return Array.from(new Set(items));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export function normalizeBaseUrl(baseUrl: string): string {
|
|
67
|
-
return baseUrl.trim().replace(/\/+$/, "");
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function getModelListEndpoints(baseUrl: string): string[] {
|
|
71
|
-
const normalized = normalizeBaseUrl(baseUrl);
|
|
72
|
-
return unique([
|
|
73
|
-
`${normalized}/v1/models`,
|
|
74
|
-
`${normalized}/models`,
|
|
75
|
-
`${normalized}/api/models`,
|
|
76
|
-
`${normalized}/api/tags`,
|
|
77
|
-
]);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function buildHeaders(apiKey: string): HeadersInit {
|
|
81
|
-
return apiKey.trim() ? { authorization: `Bearer ${apiKey.trim()}` } : {};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export async function fetchModelsFromBaseUrl(baseUrl: string, apiKey = ""): Promise<{ endpoint: string; models: DiscoveredModel[] }> {
|
|
85
|
-
const headers = buildHeaders(apiKey);
|
|
86
|
-
const errors: string[] = [];
|
|
87
|
-
const timeoutMs = 8000;
|
|
88
|
-
|
|
89
|
-
for (const endpoint of getModelListEndpoints(baseUrl)) {
|
|
90
|
-
try {
|
|
91
|
-
const response = await fetch(endpoint, {
|
|
92
|
-
method: "GET",
|
|
93
|
-
headers,
|
|
94
|
-
signal: AbortSignal.timeout(timeoutMs),
|
|
95
|
-
});
|
|
96
|
-
if (response.status === 200) {
|
|
97
|
-
const payload = await response.json() as unknown;
|
|
98
|
-
return { endpoint, models: parseModelList(payload) };
|
|
99
|
-
}
|
|
100
|
-
if (response.status !== 404) {
|
|
101
|
-
errors.push(`${endpoint}: HTTP ${response.status}`);
|
|
102
|
-
}
|
|
103
|
-
} catch (error) {
|
|
104
|
-
errors.push(`${endpoint}: ${error instanceof Error ? error.message : String(error)}`);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
throw new Error(errors.length ? errors.join("; ") : "Could not connect to any model endpoint");
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export function parseModelList(payload: unknown): DiscoveredModel[] {
|
|
112
|
-
const modelsData = getModelsData(payload);
|
|
113
|
-
const models: DiscoveredModel[] = [];
|
|
114
|
-
|
|
115
|
-
for (const item of modelsData) {
|
|
116
|
-
if (typeof item === "string") {
|
|
117
|
-
models.push({ id: item, name: item, ownedBy: "unknown" });
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (!isRecord(item)) continue;
|
|
122
|
-
|
|
123
|
-
const id = getStringField(item, ["id", "model_id", "name", "model"]);
|
|
124
|
-
if (!id) continue;
|
|
125
|
-
|
|
126
|
-
const limits = extractModelLimits(item);
|
|
127
|
-
const input = extractInputTypes(item);
|
|
128
|
-
models.push({
|
|
129
|
-
id,
|
|
130
|
-
name: getStringField(item, ["name"]) ?? id,
|
|
131
|
-
ownedBy: getStringField(item, ["owned_by", "ownedBy"]) ?? "unknown",
|
|
132
|
-
...(input ? { input } : {}),
|
|
133
|
-
...limits,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return models;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export async function enrichModelsWithRemoteMetadata(baseUrl: string, apiKey: string, models: DiscoveredModel[]): Promise<DiscoveredModel[]> {
|
|
141
|
-
const enriched = models.map((model) => ({ ...model }));
|
|
142
|
-
const needDetail = enriched.filter((model) => model.contextWindow === undefined || model.maxTokens === undefined);
|
|
143
|
-
if (needDetail.length === 0) return enriched;
|
|
144
|
-
|
|
145
|
-
for (const model of needDetail) {
|
|
146
|
-
const detail = await fetchModelDetail(baseUrl, apiKey, model.id);
|
|
147
|
-
if (!detail) continue;
|
|
148
|
-
const limits = extractModelLimits(detail);
|
|
149
|
-
const input = extractInputTypes(detail);
|
|
150
|
-
model.contextWindow ??= limits.contextWindow;
|
|
151
|
-
model.maxTokens ??= limits.maxTokens;
|
|
152
|
-
model.input ??= input;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return enriched;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
async function fetchModelDetail(baseUrl: string, apiKey: string, modelId: string): Promise<Record<string, unknown> | undefined> {
|
|
159
|
-
const headers = buildHeaders(apiKey);
|
|
160
|
-
const normalized = normalizeBaseUrl(baseUrl);
|
|
161
|
-
const encodedModelId = encodeURIComponent(modelId);
|
|
162
|
-
const getEndpoints = unique([
|
|
163
|
-
`${normalized}/v1/models/${encodedModelId}`,
|
|
164
|
-
`${normalized}/models/${encodedModelId}`,
|
|
165
|
-
`${normalized}/api/models/${encodedModelId}`,
|
|
166
|
-
]);
|
|
167
|
-
|
|
168
|
-
for (const endpoint of getEndpoints) {
|
|
169
|
-
try {
|
|
170
|
-
const response = await fetch(endpoint, {
|
|
171
|
-
method: "GET",
|
|
172
|
-
headers,
|
|
173
|
-
signal: AbortSignal.timeout(15000),
|
|
174
|
-
});
|
|
175
|
-
if (response.status === 200) {
|
|
176
|
-
const data = await response.json() as unknown;
|
|
177
|
-
if (isRecord(data)) return data;
|
|
178
|
-
}
|
|
179
|
-
} catch {
|
|
180
|
-
// Try the next detail endpoint.
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
try {
|
|
185
|
-
const response = await fetch(`${normalized}/api/show`, {
|
|
186
|
-
method: "POST",
|
|
187
|
-
headers: { ...headers, "content-type": "application/json" },
|
|
188
|
-
body: JSON.stringify({ name: modelId }),
|
|
189
|
-
signal: AbortSignal.timeout(15000),
|
|
190
|
-
});
|
|
191
|
-
if (response.status === 200) {
|
|
192
|
-
const data = await response.json() as unknown;
|
|
193
|
-
if (isRecord(data)) return data;
|
|
194
|
-
}
|
|
195
|
-
} catch {
|
|
196
|
-
// Ollama detail endpoint is optional.
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return undefined;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export function convertToPiModels(models: DiscoveredModel[], includeProviderPrefix = false, provider?: string, baseUrl?: string): PiModelImport[] {
|
|
203
|
-
const providerApi = inferProviderApi(baseUrl, provider);
|
|
204
|
-
return models.map((model) => {
|
|
205
|
-
const fallback = estimateModelParams(model.id);
|
|
206
|
-
const input = inferModelInputTypes(model);
|
|
207
|
-
const api = inferModelApi(model.id, providerApi, baseUrl, provider);
|
|
208
|
-
return {
|
|
209
|
-
id: includeProviderPrefix && provider ? `${provider}/${model.id}` : model.id,
|
|
210
|
-
name: model.name ?? model.id,
|
|
211
|
-
...(api && api !== providerApi ? { api } : {}),
|
|
212
|
-
...(input ? { input } : {}),
|
|
213
|
-
contextWindow: model.contextWindow ?? fallback.contextWindow,
|
|
214
|
-
maxTokens: model.maxTokens ?? fallback.maxTokens,
|
|
215
|
-
...(fallback.reasoning ? { reasoning: true } : {}),
|
|
216
|
-
};
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
function getModelsData(payload: unknown): unknown[] {
|
|
221
|
-
if (Array.isArray(payload)) return payload;
|
|
222
|
-
if (!isRecord(payload)) throw new Error("Could not parse model response format");
|
|
223
|
-
if (Array.isArray(payload.data)) return payload.data;
|
|
224
|
-
if (Array.isArray(payload.models)) return payload.models;
|
|
225
|
-
throw new Error("Could not parse model response format");
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
function extractModelLimits(modelData: unknown): { contextWindow?: number; maxTokens?: number } {
|
|
229
|
-
const contextWindow = findNumericField(modelData, CONTEXT_WINDOW_KEYS);
|
|
230
|
-
const maxTokens = findNumericField(modelData, MAX_TOKENS_KEYS);
|
|
231
|
-
return {
|
|
232
|
-
...(contextWindow ? { contextWindow } : {}),
|
|
233
|
-
...(maxTokens ? { maxTokens } : {}),
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
export function inferModelInputTypes(model: Pick<DiscoveredModel, "id" | "name" | "ownedBy" | "input">): string[] | undefined {
|
|
238
|
-
if (model.input?.includes("image")) return ["text", "image"];
|
|
239
|
-
if (looksLikeImageModel(model.id, model.name, model.ownedBy)) return ["text", "image"];
|
|
240
|
-
return undefined;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
function estimateModelParams(modelId: string): { contextWindow: number; maxTokens: number; reasoning?: boolean } {
|
|
244
|
-
const lower = modelId.toLowerCase();
|
|
245
|
-
|
|
246
|
-
if (lower.includes("claude")) {
|
|
247
|
-
return {
|
|
248
|
-
...DEFAULT_CONFIGS.claude,
|
|
249
|
-
...((lower.includes("thinking") || lower.includes("reasoning")) ? { reasoning: true } : {}),
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
if (lower.includes("gpt")) return { ...DEFAULT_CONFIGS.gpt };
|
|
253
|
-
if (lower.includes("deepseek")) return { ...DEFAULT_CONFIGS.deepseek };
|
|
254
|
-
if (lower.includes("qwen")) return { ...DEFAULT_CONFIGS.qwen };
|
|
255
|
-
if (lower.includes("llama")) return { ...DEFAULT_CONFIGS.llama };
|
|
256
|
-
|
|
257
|
-
return { ...DEFAULT_CONFIGS.default };
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
function extractInputTypes(modelData: unknown): string[] | undefined {
|
|
261
|
-
if (!isRecord(modelData)) return undefined;
|
|
262
|
-
if (hasImageCapability(modelData)) return ["text", "image"];
|
|
263
|
-
return undefined;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
function hasImageCapability(value: unknown): boolean {
|
|
267
|
-
if (typeof value === "string") return isImageCapabilityText(value);
|
|
268
|
-
if (typeof value === "boolean" || typeof value === "number" || value === null) return false;
|
|
269
|
-
|
|
270
|
-
if (Array.isArray(value)) {
|
|
271
|
-
return value.some((item) => hasImageCapability(item));
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
if (!isRecord(value)) return false;
|
|
275
|
-
|
|
276
|
-
for (const [key, entry] of Object.entries(value)) {
|
|
277
|
-
const normalizedKey = normalizeKey(key);
|
|
278
|
-
if (typeof entry === "boolean" && entry && IMAGE_CAPABILITY_KEYS.has(normalizedKey)) return true;
|
|
279
|
-
if (IMAGE_CAPABILITY_CONTAINER_KEYS.has(normalizedKey) && hasImageCapability(entry)) return true;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
return false;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
function isImageCapabilityText(value: string): boolean {
|
|
286
|
-
const normalized = value.trim().toLowerCase();
|
|
287
|
-
return normalized === "image" || normalized === "images" || normalized === "vision" || normalized === "visual" || normalized === "multimodal";
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
const IMAGE_CAPABILITY_KEYS = new Set(["image", "images", "vision", "visual", "multimodal"]);
|
|
291
|
-
const IMAGE_CAPABILITY_CONTAINER_KEYS = new Set([
|
|
292
|
-
"input",
|
|
293
|
-
"inputs",
|
|
294
|
-
"inputmodalities",
|
|
295
|
-
"modalities",
|
|
296
|
-
"modality",
|
|
297
|
-
"supportedmodalities",
|
|
298
|
-
"capabilities",
|
|
299
|
-
"features",
|
|
300
|
-
"architecture",
|
|
301
|
-
"details",
|
|
302
|
-
"family",
|
|
303
|
-
]);
|
|
304
|
-
|
|
305
|
-
function looksLikeImageModel(id: string, name?: string, ownedBy?: string): boolean {
|
|
306
|
-
const text = [id, name, ownedBy].filter(Boolean).join(" ").toLowerCase();
|
|
307
|
-
if (!text) return false;
|
|
308
|
-
|
|
309
|
-
const tokenized = text.replace(/[^a-z0-9]+/g, " ");
|
|
310
|
-
if (/\b(?:vision|visual|multimodal|image|images|llava|pixtral|internvl|minicpmv|glm4v)\b/.test(tokenized)) {
|
|
311
|
-
return true;
|
|
312
|
-
}
|
|
313
|
-
if (/(^|[^a-z0-9])(?:vl|v)(?:[^a-z0-9]|$)/.test(text)) return true;
|
|
314
|
-
if (/\bqwen[0-9.]*\s*vl\b|\bqwen\s*vl\b/.test(tokenized)) return true;
|
|
315
|
-
if (/\bgpt\s*4o\b|\bgpt\s*4\s*1\b|\bo3\b|\bo4\b/.test(tokenized)) return true;
|
|
316
|
-
if (/\bgemini\b|\bclaude\s*3\b|\bclaude\s*(?:sonnet|opus|haiku)\s*4\b/.test(tokenized)) return true;
|
|
317
|
-
return false;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
function findNumericField(data: unknown, keys: string[]): number | undefined {
|
|
321
|
-
if (Array.isArray(data)) {
|
|
322
|
-
for (const item of data) {
|
|
323
|
-
const found = findNumericField(item, keys);
|
|
324
|
-
if (found) return found;
|
|
325
|
-
}
|
|
326
|
-
return undefined;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
if (!isRecord(data)) return undefined;
|
|
330
|
-
|
|
331
|
-
for (const expectedKey of keys) {
|
|
332
|
-
for (const [actualKey, value] of Object.entries(data)) {
|
|
333
|
-
if (keyMatches(actualKey, expectedKey)) {
|
|
334
|
-
const parsed = parseTokenLimit(value);
|
|
335
|
-
if (parsed) return parsed;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
for (const value of Object.values(data)) {
|
|
341
|
-
const found = findNumericField(value, keys);
|
|
342
|
-
if (found) return found;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
return undefined;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
function parseTokenLimit(value: unknown): number | undefined {
|
|
349
|
-
if (typeof value === "boolean") return undefined;
|
|
350
|
-
if (typeof value === "number" && Number.isFinite(value) && value > 0) return Math.trunc(value);
|
|
351
|
-
if (typeof value !== "string") return undefined;
|
|
352
|
-
|
|
353
|
-
const text = value.trim().toLowerCase().replace(/[, _]/g, "");
|
|
354
|
-
const match = /^(\d+(?:\.\d+)?)([km])?$/.exec(text);
|
|
355
|
-
if (!match) return undefined;
|
|
356
|
-
|
|
357
|
-
let number = Number.parseFloat(match[1]);
|
|
358
|
-
if (match[2] === "k") number *= 1000;
|
|
359
|
-
if (match[2] === "m") number *= 1000000;
|
|
360
|
-
return number > 0 ? Math.trunc(number) : undefined;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
function keyMatches(actualKey: string, expectedKey: string): boolean {
|
|
364
|
-
const actual = normalizeKey(actualKey);
|
|
365
|
-
const expected = normalizeKey(expectedKey);
|
|
366
|
-
return actual === expected || actual.endsWith(`.${expected}`);
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
function normalizeKey(key: string): string {
|
|
370
|
-
return key.toLowerCase().replace(/[^a-z0-9.]/g, "");
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
function getStringField(record: Record<string, unknown>, keys: string[]): string | undefined {
|
|
374
|
-
for (const key of keys) {
|
|
375
|
-
const value = record[key];
|
|
376
|
-
if (typeof value === "string" && value.trim()) return value;
|
|
377
|
-
}
|
|
378
|
-
return undefined;
|
|
379
|
-
}
|
package/lib/normalize.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { AgentMessage, AssistantMessage, ToolCallContent } from "./types";
|
|
2
|
-
|
|
3
|
-
function isObject(val: unknown): val is Record<string, unknown> {
|
|
4
|
-
return typeof val === "object" && val !== null && !Array.isArray(val);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
function normalizeToolCallBlock(block: unknown): ToolCallContent | null {
|
|
8
|
-
if (!isObject(block) || block.type !== "toolCall") return null;
|
|
9
|
-
return {
|
|
10
|
-
type: "toolCall",
|
|
11
|
-
toolCallId: typeof block.toolCallId === "string" ? block.toolCallId : (typeof block.id === "string" ? block.id : ""),
|
|
12
|
-
toolName: typeof block.toolName === "string" ? block.toolName : (typeof block.name === "string" ? block.name : ""),
|
|
13
|
-
input: typeof block.input === "object" && block.input !== null && !Array.isArray(block.input)
|
|
14
|
-
? block.input as Record<string, unknown>
|
|
15
|
-
: (typeof block.arguments === "object" && block.arguments !== null && !Array.isArray(block.arguments)
|
|
16
|
-
? block.arguments as Record<string, unknown>
|
|
17
|
-
: {}),
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function normalizeToolCalls(msg: AgentMessage): AgentMessage {
|
|
22
|
-
if (msg.role !== "assistant") return msg;
|
|
23
|
-
const content = (msg as AssistantMessage).content;
|
|
24
|
-
if (!Array.isArray(content)) return msg;
|
|
25
|
-
const normalized = content.map((block) => {
|
|
26
|
-
const result = normalizeToolCallBlock(block);
|
|
27
|
-
return result ?? block;
|
|
28
|
-
});
|
|
29
|
-
return { ...msg, content: normalized } as AgentMessage;
|
|
30
|
-
}
|