@seqyuan/annovibe 0.8.12
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 +40 -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 +138 -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 +292 -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 +3 -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 +6 -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/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/plot-kernels/route.js +1 -0
- package/.next/server/app/api/plot-kernels/route.js.nft.json +1 -0
- package/.next/server/app/api/plot-kernels/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/plot-kernels/status/route.js +1 -0
- package/.next/server/app/api/plot-kernels/status/route.js.nft.json +1 -0
- package/.next/server/app/api/plot-kernels/status/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/plot-kernels/stop/route.js +1 -0
- package/.next/server/app/api/plot-kernels/stop/route.js.nft.json +1 -0
- package/.next/server/app/api/plot-kernels/stop/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/reports/[id]/route.js +9 -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 +3 -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 +3 -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 +3 -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 +1 -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/favicon.ico/route.js +1 -0
- package/.next/server/app/favicon.ico/route.js.nft.json +1 -0
- package/.next/server/app/favicon.ico.body +0 -0
- package/.next/server/app/favicon.ico.meta +1 -0
- package/.next/server/app/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 +271 -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 +40 -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/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/3451.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/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/4858.js +148 -0
- package/.next/server/chunks/4980.js +1 -0
- package/.next/server/chunks/5155.js +5 -0
- package/.next/server/chunks/5193.js +73 -0
- package/.next/server/chunks/5293.js +166 -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/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/7270.js +45 -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/7601.js +129 -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/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.9df6854a.mjs +6 -0
- package/.next/server/functions-config-manifest.json +14 -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/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/7355-29eaa714eb390050.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.542eda09d2171474.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/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/9b0008ae.2918095672924572.js +45 -0
- package/.next/static/chunks/app/_global-error/page-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/_not-found/page-96eb50fac9e7a68c.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/events/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/agent/new/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/auth/all-providers/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/auth/login/[provider]/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/auth/login/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/auth/providers/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/auth/status/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/default-cwd/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/files/[...path]/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/harness/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/home/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/models/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/models-config/discover/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/models-config/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/models-config/test/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/status/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/stop/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/reports/[id]/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/search/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/sessions/new/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/settings/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/skills/install/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/skills/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/skills/search/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/soul/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/api/version/route-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/app/layout-827e06e39e1e6b05.js +1 -0
- package/.next/static/chunks/app/login/page-9450bfc0d502f432.js +1 -0
- package/.next/static/chunks/app/page-dc03bbb33a1d438c.js +270 -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-ecfccace02c7aaed.js +1 -0
- package/.next/static/chunks/main-f74964b7ae52493e.js +5 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-cd03d084301c1bc9.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-3edd3886076a73cb.js +1 -0
- package/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/.next/static/chunks/webpack-5e677f60fa366b60.js +1 -0
- package/.next/static/css/d830cdea1c9a03c6.css +3 -0
- package/.next/static/ixA4-CDguO8ne_SD2W8sd/_buildManifest.js +1 -0
- package/.next/static/ixA4-CDguO8ne_SD2W8sd/_ssgManifest.js +1 -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.5f98222a.mjs +6 -0
- package/.next/trace +74 -0
- package/.next/trace-build +1 -0
- package/.next/types/app/api/agent/[id]/events/route.ts +351 -0
- package/.next/types/app/api/agent/[id]/route.ts +351 -0
- package/.next/types/app/api/agent/new/route.ts +351 -0
- package/.next/types/app/api/auth/all-providers/route.ts +351 -0
- package/.next/types/app/api/auth/api-key/[provider]/route.ts +351 -0
- package/.next/types/app/api/auth/login/[provider]/route.ts +351 -0
- package/.next/types/app/api/auth/login/route.ts +351 -0
- package/.next/types/app/api/auth/logout/[provider]/route.ts +351 -0
- package/.next/types/app/api/auth/providers/route.ts +351 -0
- package/.next/types/app/api/auth/status/route.ts +351 -0
- package/.next/types/app/api/default-cwd/route.ts +351 -0
- package/.next/types/app/api/files/[...path]/route.ts +351 -0
- package/.next/types/app/api/harness/route.ts +351 -0
- package/.next/types/app/api/home/route.ts +351 -0
- package/.next/types/app/api/models/route.ts +351 -0
- package/.next/types/app/api/models-config/discover/route.ts +351 -0
- package/.next/types/app/api/models-config/route.ts +351 -0
- package/.next/types/app/api/models-config/test/route.ts +351 -0
- package/.next/types/app/api/plot-kernels/route.ts +351 -0
- package/.next/types/app/api/plot-kernels/status/route.ts +351 -0
- package/.next/types/app/api/plot-kernels/stop/route.ts +351 -0
- package/.next/types/app/api/reports/[id]/route.ts +351 -0
- package/.next/types/app/api/search/route.ts +351 -0
- package/.next/types/app/api/sessions/[id]/context/route.ts +351 -0
- package/.next/types/app/api/sessions/[id]/route.ts +351 -0
- package/.next/types/app/api/sessions/new/route.ts +351 -0
- package/.next/types/app/api/sessions/route.ts +351 -0
- package/.next/types/app/api/settings/route.ts +351 -0
- package/.next/types/app/api/skills/install/route.ts +351 -0
- package/.next/types/app/api/skills/route.ts +351 -0
- package/.next/types/app/api/skills/search/route.ts +351 -0
- package/.next/types/app/api/soul/route.ts +351 -0
- package/.next/types/app/api/version/route.ts +351 -0
- package/.next/types/app/layout.ts +87 -0
- package/.next/types/app/login/page.ts +87 -0
- package/.next/types/app/page.ts +87 -0
- package/.next/types/package.json +1 -0
- package/.next/types/routes.d.ts +106 -0
- package/.next/types/validator.ts +376 -0
- package/LICENSE +21 -0
- package/README.md +90 -0
- package/bin/pi-web.js +825 -0
- package/lib/default-soul.md +42 -0
- package/lib/visualization-harness.md +113 -0
- package/next.config.ts +15 -0
- package/package.json +77 -0
- package/public/file.svg +1 -0
- package/public/globe.svg +1 -0
- package/public/next.svg +1 -0
- package/public/vercel.svg +1 -0
- package/public/window.svg +1 -0
package/bin/pi-web.js
ADDED
|
@@ -0,0 +1,825 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
process.title = "annovibe";
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
7
|
+
const { spawn, spawnSync } = require("child_process");
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
9
|
+
const path = require("path");
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
11
|
+
const fs = require("fs");
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
13
|
+
const os = require("os");
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
15
|
+
const readline = require("readline");
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
17
|
+
const { parseArgs } = require("util");
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
19
|
+
const bcrypt = require("bcryptjs");
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
21
|
+
const https = require("https");
|
|
22
|
+
|
|
23
|
+
const pkgDir = path.join(__dirname, "..");
|
|
24
|
+
const nextDir = path.join(pkgDir, ".next");
|
|
25
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(pkgDir, "package.json"), "utf8"));
|
|
26
|
+
const VERSION = pkg.version;
|
|
27
|
+
const PKG_NAME = pkg.name;
|
|
28
|
+
const agentDir = process.env.PI_CODING_AGENT_DIR ?? path.join(os.homedir(), ".pi", "agent");
|
|
29
|
+
const authFile = path.join(agentDir, "web-auth.json");
|
|
30
|
+
const stateFile = path.join(agentDir, "annovibe.json");
|
|
31
|
+
const legacyStateFile = path.join(agentDir, "pidex.json");
|
|
32
|
+
const logFile = path.join(agentDir, "annovibe.log");
|
|
33
|
+
const legacyLogFile = path.join(agentDir, "pidex.log");
|
|
34
|
+
const STOP_TERM_TIMEOUT_MS = 6000;
|
|
35
|
+
const STOP_KILL_TIMEOUT_MS = 2000;
|
|
36
|
+
const PROCESS_TITLE = "annovibe";
|
|
37
|
+
const NEXT_PROCESS_TITLE = "annovibe-next";
|
|
38
|
+
|
|
39
|
+
// Resolve next's CLI entry
|
|
40
|
+
let nextBin;
|
|
41
|
+
try {
|
|
42
|
+
nextBin = require.resolve("next/dist/bin/next", { paths: [pkgDir] });
|
|
43
|
+
} catch {
|
|
44
|
+
try {
|
|
45
|
+
const nextPkg = require.resolve("next/package.json", { paths: [pkgDir] });
|
|
46
|
+
nextBin = path.join(path.dirname(nextPkg), "dist", "bin", "next");
|
|
47
|
+
} catch {
|
|
48
|
+
nextBin = path.join(pkgDir, "node_modules", "next", "dist", "bin", "next");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const { values: cliArgs, positionals } = parseArgs({
|
|
53
|
+
options: {
|
|
54
|
+
port: { type: "string", short: "p" },
|
|
55
|
+
hostname: { type: "string", short: "H" },
|
|
56
|
+
json: { type: "boolean" },
|
|
57
|
+
follow: { type: "boolean", short: "f" },
|
|
58
|
+
version: { type: "boolean", short: "v" },
|
|
59
|
+
help: { type: "boolean", short: "h" },
|
|
60
|
+
},
|
|
61
|
+
strict: false,
|
|
62
|
+
allowPositionals: true,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const port = cliArgs.port ?? process.env.PORT ?? "30141";
|
|
66
|
+
const hostname = cliArgs.hostname ?? process.env.HOSTNAME ?? null;
|
|
67
|
+
|
|
68
|
+
// ── CLI commands ──
|
|
69
|
+
|
|
70
|
+
function ensureAgentDir() {
|
|
71
|
+
if (!fs.existsSync(agentDir)) fs.mkdirSync(agentDir, { recursive: true });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function getCommandPath() {
|
|
75
|
+
return path.resolve(process.argv[1] || __filename);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function getUrl(host, listenPort) {
|
|
79
|
+
return `http://${host ?? "localhost"}:${listenPort}`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function nowIso() {
|
|
83
|
+
return new Date().toISOString();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function setStableProcessTitle(title) {
|
|
87
|
+
process.title = title;
|
|
88
|
+
try {
|
|
89
|
+
Object.defineProperty(process, "title", {
|
|
90
|
+
configurable: true,
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: () => title,
|
|
93
|
+
set: () => {},
|
|
94
|
+
});
|
|
95
|
+
} catch {
|
|
96
|
+
const timer = setInterval(() => {
|
|
97
|
+
try { process.title = title; } catch { /* ignore */ }
|
|
98
|
+
}, 500);
|
|
99
|
+
timer.unref();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function readState() {
|
|
104
|
+
try {
|
|
105
|
+
const target = fs.existsSync(stateFile) ? stateFile : legacyStateFile;
|
|
106
|
+
if (!fs.existsSync(target)) return null;
|
|
107
|
+
return JSON.parse(fs.readFileSync(target, "utf8"));
|
|
108
|
+
} catch {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function staleStateRemoved() {
|
|
114
|
+
const state = readState();
|
|
115
|
+
if (state && !isPidAlive(state.supervisorPid) && !isPidAlive(state.nextPid)) {
|
|
116
|
+
removeState();
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function writeState(state) {
|
|
123
|
+
ensureAgentDir();
|
|
124
|
+
fs.writeFileSync(stateFile, JSON.stringify({ ...state, updatedAt: nowIso() }, null, 2));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function findListeningPids(listenPort) {
|
|
128
|
+
if (process.platform === "win32") return [];
|
|
129
|
+
const pids = new Set();
|
|
130
|
+
try {
|
|
131
|
+
const result = spawnSync("lsof", [`-tiTCP:${listenPort}`, "-sTCP:LISTEN"], { encoding: "utf8" });
|
|
132
|
+
result.stdout
|
|
133
|
+
.split(/\s+/)
|
|
134
|
+
.map((value) => Number(value))
|
|
135
|
+
.filter((pid) => Number.isInteger(pid) && pid > 0 && pid !== process.pid)
|
|
136
|
+
.forEach((pid) => pids.add(pid));
|
|
137
|
+
} catch {
|
|
138
|
+
// Fall through to ss.
|
|
139
|
+
}
|
|
140
|
+
if (pids.size === 0 && process.platform === "linux") {
|
|
141
|
+
try {
|
|
142
|
+
const result = spawnSync("ss", ["-H", "-ltnp", `sport = :${listenPort}`], { encoding: "utf8" });
|
|
143
|
+
const matches = result.stdout.matchAll(/pid=(\d+)/g);
|
|
144
|
+
for (const match of matches) {
|
|
145
|
+
const pid = Number(match[1]);
|
|
146
|
+
if (Number.isInteger(pid) && pid > 0 && pid !== process.pid) pids.add(pid);
|
|
147
|
+
}
|
|
148
|
+
} catch {
|
|
149
|
+
// Ignore lookup failures.
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return [...pids];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function safeRealpath(targetPath) {
|
|
156
|
+
try {
|
|
157
|
+
return fs.realpathSync(targetPath);
|
|
158
|
+
} catch {
|
|
159
|
+
return targetPath;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function isPathInside(childPath, parentPath) {
|
|
164
|
+
const relative = path.relative(parentPath, childPath);
|
|
165
|
+
return relative === "" || (!!relative && !relative.startsWith("..") && !path.isAbsolute(relative));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function readProcessCmdline(pid) {
|
|
169
|
+
if (!Number.isInteger(pid) || pid <= 0) return "";
|
|
170
|
+
if (process.platform === "linux") {
|
|
171
|
+
try {
|
|
172
|
+
return fs.readFileSync(`/proc/${pid}/cmdline`, "utf8").replace(/\0/g, " ").trim();
|
|
173
|
+
} catch {
|
|
174
|
+
// Fall through to ps.
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
try {
|
|
178
|
+
const result = spawnSync("ps", ["-p", String(pid), "-o", "command="], { encoding: "utf8" });
|
|
179
|
+
return result.status === 0 ? result.stdout.trim() : "";
|
|
180
|
+
} catch {
|
|
181
|
+
return "";
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function readProcessCwd(pid) {
|
|
186
|
+
if (!Number.isInteger(pid) || pid <= 0) return "";
|
|
187
|
+
if (process.platform === "linux") {
|
|
188
|
+
try {
|
|
189
|
+
return fs.realpathSync(`/proc/${pid}/cwd`);
|
|
190
|
+
} catch {
|
|
191
|
+
return "";
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (process.platform === "darwin") {
|
|
195
|
+
try {
|
|
196
|
+
const result = spawnSync("lsof", ["-a", "-p", String(pid), "-d", "cwd", "-Fn"], { encoding: "utf8" });
|
|
197
|
+
if (result.status !== 0) return "";
|
|
198
|
+
const line = result.stdout.split(/\r?\n/).find((value) => value.startsWith("n"));
|
|
199
|
+
return line ? safeRealpath(line.slice(1)) : "";
|
|
200
|
+
} catch {
|
|
201
|
+
return "";
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return "";
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function getProcessSummary(pid) {
|
|
208
|
+
return {
|
|
209
|
+
pid,
|
|
210
|
+
cmdline: readProcessCmdline(pid),
|
|
211
|
+
cwd: readProcessCwd(pid),
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function looksLikeAnnoVibeProcess(info) {
|
|
216
|
+
const cmdline = info.cmdline || "";
|
|
217
|
+
const cwd = info.cwd || "";
|
|
218
|
+
const realPkgDir = safeRealpath(pkgDir);
|
|
219
|
+
const realCwd = cwd ? safeRealpath(cwd) : "";
|
|
220
|
+
const inAnnoVibeDir = !!realCwd && isPathInside(realCwd, realPkgDir);
|
|
221
|
+
const commandMentionsAnnoVibe =
|
|
222
|
+
cmdline.includes("pi-web.js") ||
|
|
223
|
+
cmdline.includes("@seqyuan/annovibe") ||
|
|
224
|
+
cmdline.includes("@seqyuan/pidex") ||
|
|
225
|
+
cmdline.includes("/annovibe/") ||
|
|
226
|
+
cmdline.includes("/pidex/") ||
|
|
227
|
+
cmdline.includes("\\annovibe\\") ||
|
|
228
|
+
cmdline.includes("\\pidex\\") ||
|
|
229
|
+
cmdline.includes(PROCESS_TITLE);
|
|
230
|
+
const commandMentionsNext =
|
|
231
|
+
cmdline.includes("next-server") ||
|
|
232
|
+
cmdline.includes("next/dist/bin/next") ||
|
|
233
|
+
cmdline.includes("next start");
|
|
234
|
+
|
|
235
|
+
return commandMentionsAnnoVibe || (inAnnoVibeDir && commandMentionsNext);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
async function stopVerifiedPortListeners(listenPort, quiet = false) {
|
|
239
|
+
const listeningPids = findListeningPids(listenPort);
|
|
240
|
+
if (listeningPids.length === 0) return { found: false, stopped: true, skipped: [] };
|
|
241
|
+
|
|
242
|
+
const verified = [];
|
|
243
|
+
const skipped = [];
|
|
244
|
+
for (const pid of listeningPids) {
|
|
245
|
+
const info = getProcessSummary(pid);
|
|
246
|
+
if (looksLikeAnnoVibeProcess(info)) {
|
|
247
|
+
verified.push(pid);
|
|
248
|
+
} else {
|
|
249
|
+
skipped.push(info);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (skipped.length > 0) {
|
|
254
|
+
for (const info of skipped) {
|
|
255
|
+
const label = info.cmdline || "unknown command";
|
|
256
|
+
console.error(`annovibe stop: port ${listenPort} is used by pid ${info.pid}, but it does not look like annovibe; not stopping it.`);
|
|
257
|
+
console.error(`command: ${label}`);
|
|
258
|
+
if (info.cwd) console.error(`cwd: ${info.cwd}`);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (verified.length === 0) {
|
|
263
|
+
return { found: true, stopped: skipped.length === 0, skipped };
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
let stopped = true;
|
|
267
|
+
for (const pid of verified) {
|
|
268
|
+
stopped = (await terminatePid(pid)) && stopped;
|
|
269
|
+
}
|
|
270
|
+
if (!quiet) {
|
|
271
|
+
console.log(stopped
|
|
272
|
+
? `annovibe stop: stopped listener pid${verified.length === 1 ? "" : "s"} ${verified.join(", ")}`
|
|
273
|
+
: `annovibe stop: failed to stop listener pid${verified.length === 1 ? "" : "s"} ${verified.join(", ")}`);
|
|
274
|
+
}
|
|
275
|
+
return { found: true, stopped: stopped && skipped.length === 0, skipped };
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function removeState() {
|
|
279
|
+
try { fs.rmSync(stateFile, { force: true }); } catch { /* ignore */ }
|
|
280
|
+
try { fs.rmSync(legacyStateFile, { force: true }); } catch { /* ignore */ }
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function isPidAlive(pid) {
|
|
284
|
+
if (!Number.isInteger(pid) || pid <= 0) return false;
|
|
285
|
+
try {
|
|
286
|
+
process.kill(pid, 0);
|
|
287
|
+
return true;
|
|
288
|
+
} catch (error) {
|
|
289
|
+
return error && error.code === "EPERM";
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function waitForPidExit(pid, timeoutMs) {
|
|
294
|
+
const startedAt = Date.now();
|
|
295
|
+
return new Promise((resolve) => {
|
|
296
|
+
const tick = () => {
|
|
297
|
+
if (!isPidAlive(pid)) {
|
|
298
|
+
resolve(true);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
if (Date.now() - startedAt >= timeoutMs) {
|
|
302
|
+
resolve(false);
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
setTimeout(tick, 100);
|
|
306
|
+
};
|
|
307
|
+
tick();
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
async function terminatePid(pid, termTimeoutMs = STOP_TERM_TIMEOUT_MS, killTimeoutMs = STOP_KILL_TIMEOUT_MS) {
|
|
312
|
+
if (!isPidAlive(pid)) return true;
|
|
313
|
+
try {
|
|
314
|
+
process.kill(pid, "SIGTERM");
|
|
315
|
+
} catch {
|
|
316
|
+
return !isPidAlive(pid);
|
|
317
|
+
}
|
|
318
|
+
if (await waitForPidExit(pid, termTimeoutMs)) return true;
|
|
319
|
+
try {
|
|
320
|
+
process.kill(pid, "SIGKILL");
|
|
321
|
+
} catch {
|
|
322
|
+
return !isPidAlive(pid);
|
|
323
|
+
}
|
|
324
|
+
return waitForPidExit(pid, killTimeoutMs);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function renderState(state, json = false) {
|
|
328
|
+
const supervisorAlive = !!state && isPidAlive(state.supervisorPid);
|
|
329
|
+
const nextAlive = !!state && isPidAlive(state.nextPid);
|
|
330
|
+
const status = supervisorAlive ? "running" : nextAlive ? "orphaned" : "stopped";
|
|
331
|
+
const payload = {
|
|
332
|
+
running: supervisorAlive || nextAlive,
|
|
333
|
+
status,
|
|
334
|
+
version: state?.version ?? VERSION,
|
|
335
|
+
url: state?.url ?? getUrl(hostname, port),
|
|
336
|
+
port: state?.port ?? port,
|
|
337
|
+
hostname: state?.hostname ?? hostname,
|
|
338
|
+
supervisorPid: supervisorAlive ? state.supervisorPid : null,
|
|
339
|
+
nextPid: nextAlive ? state.nextPid : null,
|
|
340
|
+
startedAt: supervisorAlive ? state.startedAt ?? null : null,
|
|
341
|
+
logFile,
|
|
342
|
+
stateFile,
|
|
343
|
+
};
|
|
344
|
+
if (json) return JSON.stringify(payload, null, 2);
|
|
345
|
+
if (payload.status === "stopped") {
|
|
346
|
+
return [
|
|
347
|
+
"annovibe status: stopped",
|
|
348
|
+
`log: ${payload.logFile}`,
|
|
349
|
+
`state: ${payload.stateFile}`,
|
|
350
|
+
].join("\n");
|
|
351
|
+
}
|
|
352
|
+
return [
|
|
353
|
+
"annovibe status: running",
|
|
354
|
+
`url: ${payload.url}`,
|
|
355
|
+
`version: ${payload.version}`,
|
|
356
|
+
`state: ${payload.status}`,
|
|
357
|
+
`supervisor pid: ${payload.supervisorPid ?? "not running"}`,
|
|
358
|
+
`next pid: ${payload.nextPid ?? "unknown"}`,
|
|
359
|
+
`started: ${payload.startedAt ?? "unknown"}`,
|
|
360
|
+
`log: ${payload.logFile}`,
|
|
361
|
+
].join("\n");
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
function printRecentLogs(follow = false) {
|
|
365
|
+
ensureAgentDir();
|
|
366
|
+
const targetLogFile = fs.existsSync(logFile) ? logFile : legacyLogFile;
|
|
367
|
+
if (!fs.existsSync(targetLogFile)) {
|
|
368
|
+
console.log(`annovibe logs: no log file yet (${logFile})`);
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
const content = fs.readFileSync(targetLogFile, "utf8");
|
|
372
|
+
const lines = content.split(/\r?\n/);
|
|
373
|
+
console.log(lines.slice(Math.max(0, lines.length - 200)).join("\n"));
|
|
374
|
+
if (!follow) return;
|
|
375
|
+
const tail = spawn(process.platform === "win32" ? "powershell.exe" : "tail", process.platform === "win32"
|
|
376
|
+
? ["-NoProfile", "-Command", `Get-Content -Path ${JSON.stringify(targetLogFile)} -Wait -Tail 0`]
|
|
377
|
+
: ["-f", targetLogFile], { stdio: "inherit" });
|
|
378
|
+
tail.on("exit", (code) => process.exit(code ?? 0));
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
async function stopManagedServer(quiet = false) {
|
|
382
|
+
const state = readState();
|
|
383
|
+
if (!state) {
|
|
384
|
+
const portStop = await stopVerifiedPortListeners(port, quiet);
|
|
385
|
+
if (portStop.found) return portStop.stopped ? 0 : 1;
|
|
386
|
+
if (!quiet) console.log("annovibe stop: already stopped");
|
|
387
|
+
return 0;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
const supervisorPid = state.supervisorPid;
|
|
391
|
+
const nextPid = state.nextPid;
|
|
392
|
+
let stopped = true;
|
|
393
|
+
if (isPidAlive(supervisorPid)) {
|
|
394
|
+
stopped = await terminatePid(supervisorPid);
|
|
395
|
+
}
|
|
396
|
+
if (nextPid && isPidAlive(nextPid)) {
|
|
397
|
+
stopped = (await terminatePid(nextPid)) && stopped;
|
|
398
|
+
}
|
|
399
|
+
if (stopped) {
|
|
400
|
+
removeState();
|
|
401
|
+
if (!quiet) console.log(`annovibe stop: stopped${supervisorPid ? ` pid ${supervisorPid}` : ""}`);
|
|
402
|
+
return 0;
|
|
403
|
+
}
|
|
404
|
+
if (!quiet) console.error(`annovibe stop: failed to stop pid ${supervisorPid}`);
|
|
405
|
+
return 1;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
async function startManagedServer({ quiet = false } = {}) {
|
|
409
|
+
seedDefaults();
|
|
410
|
+
await maybeSetupAuth();
|
|
411
|
+
if (!fs.existsSync(nextDir)) {
|
|
412
|
+
console.error("Build artifacts not found. Please report this issue.");
|
|
413
|
+
return 1;
|
|
414
|
+
}
|
|
415
|
+
staleStateRemoved();
|
|
416
|
+
const existing = readState();
|
|
417
|
+
const existingSupervisorAlive = existing && isPidAlive(existing.supervisorPid);
|
|
418
|
+
const existingNextAlive = existing && isPidAlive(existing.nextPid);
|
|
419
|
+
if (existingSupervisorAlive) {
|
|
420
|
+
if (!quiet) {
|
|
421
|
+
console.log(`annovibe start: already running pid ${existing.supervisorPid}`);
|
|
422
|
+
console.log(`url: ${existing.url ?? getUrl(hostname, port)}`);
|
|
423
|
+
console.log(`log: ${logFile}`);
|
|
424
|
+
}
|
|
425
|
+
return 0;
|
|
426
|
+
}
|
|
427
|
+
if (existingNextAlive) {
|
|
428
|
+
if (!quiet) console.log(`annovibe start: recovering orphaned server pid ${existing.nextPid}`);
|
|
429
|
+
if (!(await terminatePid(existing.nextPid))) {
|
|
430
|
+
if (!quiet) console.error(`annovibe start: failed to stop orphaned server pid ${existing.nextPid}`);
|
|
431
|
+
return 1;
|
|
432
|
+
}
|
|
433
|
+
removeState();
|
|
434
|
+
}
|
|
435
|
+
ensureAgentDir();
|
|
436
|
+
const fd = fs.openSync(logFile, "a");
|
|
437
|
+
const child = spawn(process.execPath, [getCommandPath(), "__server", "--port", String(port), ...(hostname ? ["--hostname", hostname] : [])], {
|
|
438
|
+
cwd: pkgDir,
|
|
439
|
+
detached: true,
|
|
440
|
+
stdio: ["ignore", fd, fd],
|
|
441
|
+
env: {
|
|
442
|
+
...process.env,
|
|
443
|
+
ANNOVIBE_MANAGED: "1",
|
|
444
|
+
},
|
|
445
|
+
});
|
|
446
|
+
fs.closeSync(fd);
|
|
447
|
+
if (!child.pid) {
|
|
448
|
+
throw new Error("failed to start annovibe server");
|
|
449
|
+
}
|
|
450
|
+
child.unref();
|
|
451
|
+
const state = {
|
|
452
|
+
schemaVersion: 1,
|
|
453
|
+
version: VERSION,
|
|
454
|
+
command: `${getCommandPath()} __server --port ${port}${hostname ? ` --hostname ${hostname}` : ""}`,
|
|
455
|
+
supervisorPid: child.pid,
|
|
456
|
+
nextPid: null,
|
|
457
|
+
port: String(port),
|
|
458
|
+
hostname,
|
|
459
|
+
url: getUrl(hostname, port),
|
|
460
|
+
logFile,
|
|
461
|
+
stateFile,
|
|
462
|
+
startedAt: nowIso(),
|
|
463
|
+
};
|
|
464
|
+
writeState(state);
|
|
465
|
+
if (!quiet) {
|
|
466
|
+
console.log(`annovibe start: pid ${child.pid}`);
|
|
467
|
+
console.log(`url: ${state.url}`);
|
|
468
|
+
console.log(`log: ${logFile}`);
|
|
469
|
+
}
|
|
470
|
+
return 0;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
if (cliArgs.version) {
|
|
474
|
+
console.log(VERSION);
|
|
475
|
+
process.exit(0);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
if (cliArgs.help) {
|
|
479
|
+
console.log(`annovibe v${VERSION} — Web UI for the pi coding agent
|
|
480
|
+
|
|
481
|
+
Usage:
|
|
482
|
+
annovibe [options]
|
|
483
|
+
annovibe start Start annovibe in background
|
|
484
|
+
annovibe restart Stop then start annovibe in background
|
|
485
|
+
annovibe stop Stop background annovibe
|
|
486
|
+
annovibe status [--json] Show background server status
|
|
487
|
+
annovibe logs [-f] Show background server logs
|
|
488
|
+
annovibe passwd Change password (or set if none)
|
|
489
|
+
annovibe passwd --reset Remove password (disable auth)
|
|
490
|
+
annovibe update Update to the latest version
|
|
491
|
+
|
|
492
|
+
Options:
|
|
493
|
+
-p, --port <port> Port to listen on (default: 30141, env: PORT)
|
|
494
|
+
-H, --hostname <host> Hostname to bind to (default: localhost)
|
|
495
|
+
--json Print machine-readable status JSON
|
|
496
|
+
-f, --follow Follow logs
|
|
497
|
+
-v, --version Print version
|
|
498
|
+
-h, --help Show this help
|
|
499
|
+
|
|
500
|
+
Environment:
|
|
501
|
+
PORT Server port
|
|
502
|
+
ANNOVIBE_PASSWORD Set password on first start
|
|
503
|
+
PI_CODING_AGENT_DIR Custom pi agent data directory
|
|
504
|
+
`);
|
|
505
|
+
process.exit(0);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
const firstPos = positionals[0];
|
|
509
|
+
if (firstPos === "status") {
|
|
510
|
+
const json = cliArgs.json;
|
|
511
|
+
staleStateRemoved();
|
|
512
|
+
const state = readState();
|
|
513
|
+
console.log(renderState(state, json));
|
|
514
|
+
process.exit(state && (isPidAlive(state.supervisorPid) || isPidAlive(state.nextPid)) ? 0 : 1);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
if (firstPos === "logs") {
|
|
518
|
+
printRecentLogs(cliArgs.follow);
|
|
519
|
+
if (!cliArgs.follow) process.exit(0);
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
if (firstPos === "stop") {
|
|
524
|
+
stopManagedServer()
|
|
525
|
+
.then((code) => process.exit(code))
|
|
526
|
+
.catch((error) => {
|
|
527
|
+
console.error(`annovibe stop: ${error instanceof Error ? error.message : String(error)}`);
|
|
528
|
+
process.exit(1);
|
|
529
|
+
});
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
if (firstPos === "start") {
|
|
534
|
+
startManagedServer()
|
|
535
|
+
.then((code) => process.exit(code))
|
|
536
|
+
.catch((error) => {
|
|
537
|
+
console.error(`annovibe start: ${error instanceof Error ? error.message : String(error)}`);
|
|
538
|
+
process.exit(1);
|
|
539
|
+
});
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
if (firstPos === "restart") {
|
|
544
|
+
stopManagedServer(true).then(async (code) => {
|
|
545
|
+
if (code !== 0) process.exit(code);
|
|
546
|
+
process.exit(await startManagedServer());
|
|
547
|
+
}).catch((error) => {
|
|
548
|
+
console.error(`annovibe restart: ${error instanceof Error ? error.message : String(error)}`);
|
|
549
|
+
process.exit(1);
|
|
550
|
+
});
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
if (firstPos === "update") {
|
|
555
|
+
console.log(`\n Updating ${PKG_NAME} to latest version...\n`);
|
|
556
|
+
const npmExecPath = process.env.npm_execpath;
|
|
557
|
+
const hasNpmExecPath = npmExecPath && fs.existsSync(npmExecPath);
|
|
558
|
+
const command = hasNpmExecPath ? process.execPath : (process.platform === "win32" ? "npm.cmd" : "npm");
|
|
559
|
+
const args = [
|
|
560
|
+
...(hasNpmExecPath ? [npmExecPath] : []),
|
|
561
|
+
"install", "-g", `${PKG_NAME}@latest`,
|
|
562
|
+
];
|
|
563
|
+
const child = spawn(command, args, { stdio: "inherit" });
|
|
564
|
+
child.on("exit", (code) => process.exit(code ?? 0));
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
if (firstPos === "passwd") {
|
|
569
|
+
const reset = positionals[1] === "--reset";
|
|
570
|
+
|
|
571
|
+
if (reset) {
|
|
572
|
+
if (fs.existsSync(authFile)) {
|
|
573
|
+
fs.unlinkSync(authFile);
|
|
574
|
+
console.log(" 🔓 Password removed. Auth disabled.\n");
|
|
575
|
+
} else {
|
|
576
|
+
console.log(" No password configured.\n");
|
|
577
|
+
}
|
|
578
|
+
process.exit(0);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
582
|
+
const ask = (prompt) => new Promise((res) => rl.question(prompt, res));
|
|
583
|
+
(async () => {
|
|
584
|
+
const exists = fs.existsSync(authFile);
|
|
585
|
+
if (exists) {
|
|
586
|
+
console.log("\n Changing password...\n");
|
|
587
|
+
const oldPw = await ask("Current password: ");
|
|
588
|
+
try {
|
|
589
|
+
const cfg = JSON.parse(fs.readFileSync(authFile, "utf8"));
|
|
590
|
+
if (!bcrypt.compareSync(oldPw, cfg.passwordHash)) {
|
|
591
|
+
console.log(" ❌ Incorrect password.\n");
|
|
592
|
+
rl.close();
|
|
593
|
+
process.exit(1);
|
|
594
|
+
}
|
|
595
|
+
} catch { console.log(" ❌ Could not read auth file.\n"); rl.close(); process.exit(1); }
|
|
596
|
+
}
|
|
597
|
+
const pw1 = await ask("New password (empty to disable): ");
|
|
598
|
+
if (!pw1.trim()) {
|
|
599
|
+
if (fs.existsSync(authFile)) fs.unlinkSync(authFile);
|
|
600
|
+
console.log(" 🔓 Auth disabled.\n");
|
|
601
|
+
rl.close();
|
|
602
|
+
process.exit(0);
|
|
603
|
+
}
|
|
604
|
+
const pw2 = await ask("Confirm new password: ");
|
|
605
|
+
if (pw1 !== pw2) {
|
|
606
|
+
console.log(" ❌ Passwords don't match.\n");
|
|
607
|
+
rl.close();
|
|
608
|
+
process.exit(1);
|
|
609
|
+
}
|
|
610
|
+
const hash = bcrypt.hashSync(pw1, 10);
|
|
611
|
+
const dir = path.dirname(authFile);
|
|
612
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
613
|
+
fs.writeFileSync(authFile, JSON.stringify({ passwordHash: hash, enabled: true }, null, 2));
|
|
614
|
+
console.log(exists ? " ✅ Password changed.\n" : " ✅ Password set.\n");
|
|
615
|
+
rl.close();
|
|
616
|
+
process.exit(0);
|
|
617
|
+
})();
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
// ── Version check (async, non-blocking) ──
|
|
622
|
+
|
|
623
|
+
function checkVersion() {
|
|
624
|
+
const req = https.get(`https://registry.npmjs.org/${encodeURIComponent(PKG_NAME)}/latest`, { timeout: 5000 }, (res) => {
|
|
625
|
+
let data = "";
|
|
626
|
+
res.on("data", (chunk) => data += chunk);
|
|
627
|
+
res.on("end", () => {
|
|
628
|
+
try {
|
|
629
|
+
const json = JSON.parse(data);
|
|
630
|
+
const latest = json.version;
|
|
631
|
+
if (latest && latest !== VERSION) {
|
|
632
|
+
console.log(`\n ⚡ Update available: ${VERSION} → ${latest}`);
|
|
633
|
+
console.log(` Run: annovibe update\n`);
|
|
634
|
+
}
|
|
635
|
+
} catch { /* ignore */ }
|
|
636
|
+
});
|
|
637
|
+
});
|
|
638
|
+
req.on("error", () => {});
|
|
639
|
+
req.on("timeout", () => req.destroy());
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
// ── Normal startup ──
|
|
643
|
+
|
|
644
|
+
function promptPassword() {
|
|
645
|
+
return new Promise((resolve) => {
|
|
646
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
647
|
+
const ask = (prompt) => new Promise((res) => rl.question(prompt, res));
|
|
648
|
+
(async () => {
|
|
649
|
+
console.log("\n🔐 No password set. You can protect annovibe with a password.");
|
|
650
|
+
console.log(" Leave empty and press Enter to skip.\n");
|
|
651
|
+
const pw1 = await ask("Enter password: ");
|
|
652
|
+
if (!pw1.trim()) {
|
|
653
|
+
console.log(" Skipped — no password required.\n");
|
|
654
|
+
rl.close();
|
|
655
|
+
resolve(false);
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
const pw2 = await ask("Confirm password: ");
|
|
659
|
+
if (pw1 !== pw2) {
|
|
660
|
+
console.log(" Passwords don't match. Skipping.\n");
|
|
661
|
+
rl.close();
|
|
662
|
+
resolve(false);
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
const hash = bcrypt.hashSync(pw1, 10);
|
|
666
|
+
const dir = path.dirname(authFile);
|
|
667
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
668
|
+
fs.writeFileSync(authFile, JSON.stringify({ passwordHash: hash, enabled: true }, null, 2));
|
|
669
|
+
console.log(" ✅ Password set. Restart won't prompt.\n");
|
|
670
|
+
rl.close();
|
|
671
|
+
resolve(true);
|
|
672
|
+
})();
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
async function maybeSetupAuth() {
|
|
677
|
+
if (fs.existsSync(authFile)) return;
|
|
678
|
+
const password = process.env.ANNOVIBE_PASSWORD ?? process.env.PIDEX_PASSWORD;
|
|
679
|
+
if (password) {
|
|
680
|
+
const hash = bcrypt.hashSync(password, 10);
|
|
681
|
+
const dir = path.dirname(authFile);
|
|
682
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
683
|
+
fs.writeFileSync(authFile, JSON.stringify({ passwordHash: hash, enabled: true }, null, 2));
|
|
684
|
+
console.log(` 🔐 Password set from ${process.env.ANNOVIBE_PASSWORD ? "ANNOVIBE_PASSWORD" : "PIDEX_PASSWORD"} env var.`);
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
if (!process.stdin.isTTY) return;
|
|
688
|
+
await promptPassword();
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
function seedDefaults() {
|
|
692
|
+
const defaultSoulSrc = path.join(pkgDir, "lib", "default-soul.md");
|
|
693
|
+
const soulDest = path.join(agentDir, "soul.md");
|
|
694
|
+
if (!fs.existsSync(soulDest) && fs.existsSync(defaultSoulSrc)) {
|
|
695
|
+
const dir = path.dirname(soulDest);
|
|
696
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
697
|
+
fs.copyFileSync(defaultSoulSrc, soulDest);
|
|
698
|
+
console.log(" 🖖 Default soul.md seeded to ~/.pi/agent/soul.md");
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
const defaultHarnessSrc = path.join(pkgDir, "lib", "visualization-harness.md");
|
|
702
|
+
const harnessDest = path.join(agentDir, "harness.md");
|
|
703
|
+
if (!fs.existsSync(harnessDest) && fs.existsSync(defaultHarnessSrc)) {
|
|
704
|
+
const dir = path.dirname(harnessDest);
|
|
705
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
706
|
+
fs.copyFileSync(defaultHarnessSrc, harnessDest);
|
|
707
|
+
console.log(" 📊 Default harness.md seeded to ~/.pi/agent/harness.md");
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
// ── Start server ──
|
|
712
|
+
function openBrowser(url) {
|
|
713
|
+
const isWindows = process.platform === "win32";
|
|
714
|
+
const isMac = process.platform === "darwin";
|
|
715
|
+
const openCmd = isWindows ? "start" : isMac ? "open" : "xdg-open";
|
|
716
|
+
const openChild = spawn(openCmd, [url], { shell: isWindows, stdio: "ignore", detached: true });
|
|
717
|
+
openChild.on("error", () => {});
|
|
718
|
+
openChild.unref();
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
async function runServerProcess() {
|
|
722
|
+
setStableProcessTitle(PROCESS_TITLE);
|
|
723
|
+
await maybeSetupAuth();
|
|
724
|
+
if (!fs.existsSync(nextDir)) {
|
|
725
|
+
console.error("Build artifacts not found. Please report this issue.");
|
|
726
|
+
process.exit(1);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
checkVersion();
|
|
730
|
+
|
|
731
|
+
const url = getUrl(hostname, port);
|
|
732
|
+
const nextArgs = [getCommandPath(), "__next", "--port", String(port)];
|
|
733
|
+
if (hostname) nextArgs.push("--hostname", hostname);
|
|
734
|
+
|
|
735
|
+
const child = spawn(process.execPath, nextArgs, {
|
|
736
|
+
cwd: pkgDir,
|
|
737
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
738
|
+
env: {
|
|
739
|
+
...process.env,
|
|
740
|
+
ANNOVIBE_SUPERVISOR_PID: String(process.pid),
|
|
741
|
+
ANNOVIBE_NEXT_WRAPPER: "1",
|
|
742
|
+
},
|
|
743
|
+
});
|
|
744
|
+
|
|
745
|
+
const writeCurrentState = (patch = {}) => {
|
|
746
|
+
const current = readState() ?? {};
|
|
747
|
+
writeState({
|
|
748
|
+
schemaVersion: 1,
|
|
749
|
+
version: VERSION,
|
|
750
|
+
command: `${getCommandPath()} __server --port ${port}${hostname ? ` --hostname ${hostname}` : ""}`,
|
|
751
|
+
supervisorPid: process.pid,
|
|
752
|
+
nextPid: child.pid ?? null,
|
|
753
|
+
port: String(port),
|
|
754
|
+
hostname,
|
|
755
|
+
url,
|
|
756
|
+
logFile,
|
|
757
|
+
stateFile,
|
|
758
|
+
startedAt: current.startedAt ?? nowIso(),
|
|
759
|
+
...patch,
|
|
760
|
+
});
|
|
761
|
+
};
|
|
762
|
+
|
|
763
|
+
writeCurrentState();
|
|
764
|
+
|
|
765
|
+
let browserOpened = false;
|
|
766
|
+
child.stdout.on("data", (chunk) => {
|
|
767
|
+
const text = chunk.toString();
|
|
768
|
+
process.stdout.write(text);
|
|
769
|
+
if (!browserOpened && text.includes("Ready")) {
|
|
770
|
+
browserOpened = true;
|
|
771
|
+
openBrowser(url);
|
|
772
|
+
console.log(`\n annovibe running at ${url}\n`);
|
|
773
|
+
writeCurrentState({ readyAt: nowIso() });
|
|
774
|
+
}
|
|
775
|
+
});
|
|
776
|
+
child.stderr.on("data", (chunk) => process.stderr.write(chunk));
|
|
777
|
+
|
|
778
|
+
const shutdown = async () => {
|
|
779
|
+
await terminatePid(child.pid);
|
|
780
|
+
removeState();
|
|
781
|
+
process.exit(0);
|
|
782
|
+
};
|
|
783
|
+
process.on("SIGTERM", () => { void shutdown(); });
|
|
784
|
+
process.on("SIGINT", () => { void shutdown(); });
|
|
785
|
+
|
|
786
|
+
child.on("exit", (code) => {
|
|
787
|
+
removeState();
|
|
788
|
+
process.exit(code ?? 0);
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
function runNextProcess() {
|
|
793
|
+
setStableProcessTitle(NEXT_PROCESS_TITLE);
|
|
794
|
+
if (!fs.existsSync(nextDir)) {
|
|
795
|
+
console.error("Build artifacts not found. Please report this issue.");
|
|
796
|
+
process.exit(1);
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
const nextArgs = ["start", "-p", String(port)];
|
|
800
|
+
if (hostname) nextArgs.push("-H", String(hostname));
|
|
801
|
+
process.argv = [process.execPath, nextBin, ...nextArgs];
|
|
802
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
803
|
+
require(nextBin);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
if (firstPos === "__server") {
|
|
807
|
+
runServerProcess().catch((error) => {
|
|
808
|
+
console.error(`annovibe server: ${error instanceof Error ? error.message : String(error)}`);
|
|
809
|
+
process.exit(1);
|
|
810
|
+
});
|
|
811
|
+
} else if (firstPos === "__next") {
|
|
812
|
+
try {
|
|
813
|
+
runNextProcess();
|
|
814
|
+
} catch (error) {
|
|
815
|
+
console.error(`annovibe next: ${error instanceof Error ? error.message : String(error)}`);
|
|
816
|
+
process.exit(1);
|
|
817
|
+
}
|
|
818
|
+
} else {
|
|
819
|
+
startManagedServer()
|
|
820
|
+
.then((code) => process.exit(code))
|
|
821
|
+
.catch((error) => {
|
|
822
|
+
console.error(`annovibe start: ${error instanceof Error ? error.message : String(error)}`);
|
|
823
|
+
process.exit(1);
|
|
824
|
+
});
|
|
825
|
+
}
|