@seqyuan/pidex 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -0
- package/.next/app-path-routes-manifest.json +32 -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 +2001 -0
- package/.next/required-server-files.js +344 -0
- package/.next/required-server-files.json +344 -0
- package/.next/routes-manifest.json +242 -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/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/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/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/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 +78 -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 +32 -0
- package/.next/server/chunks/13.js +1 -0
- package/.next/server/chunks/270.js +45 -0
- package/.next/server/chunks/451.js +1 -0
- package/.next/server/chunks/601.js +11 -0
- package/.next/server/chunks/63.js +45 -0
- package/.next/server/chunks/65.js +1 -0
- package/.next/server/chunks/741.js +18 -0
- package/.next/server/chunks/765.js +1 -0
- package/.next/server/chunks/813.js +1 -0
- package/.next/server/chunks/818.js +21 -0
- package/.next/server/chunks/890.js +1 -0
- package/.next/server/chunks/static/media/pdf.worker.min.9df6854a.mjs +6 -0
- package/.next/server/edge-runtime-webpack.js +2 -0
- package/.next/server/functions-config-manifest.json +4 -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 +33 -0
- package/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/.next/server/middleware.js +10 -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/4cEheIqbxWUBO97Ps5M5F/_buildManifest.js +1 -0
- package/.next/static/4cEheIqbxWUBO97Ps5M5F/_ssgManifest.js +1 -0
- package/.next/static/chunks/2170a4aa.64c6f60c1b2bb8c7.js +1 -0
- package/.next/static/chunks/2274.b2d0575b08ee6897.js +21 -0
- package/.next/static/chunks/2619.fd64e7a5bd9005d5.js +1 -0
- package/.next/static/chunks/363642f4-ce25f2d3ed04b5b0.js +1 -0
- package/.next/static/chunks/3794-cd826fc25a17dd0e.js +32 -0
- package/.next/static/chunks/4453.8c2a8927cc54fba0.js +1 -0
- package/.next/static/chunks/4bd1b696-c2f6e0877b6c10aa.js +1 -0
- package/.next/static/chunks/8436.5162d571d476a371.js +1 -0
- package/.next/static/chunks/8451.8d75dc2736e37486.js +1 -0
- package/.next/static/chunks/9442-cb11613d8f427dd9.js +1 -0
- package/.next/static/chunks/9b0008ae.39aee0e01e9a5060.js +45 -0
- package/.next/static/chunks/app/_global-error/page-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/_not-found/page-874d2953bed86885.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/events/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/agent/new/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/auth/all-providers/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/auth/login/[provider]/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/auth/login/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/auth/providers/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/auth/status/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/default-cwd/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/files/[...path]/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/harness/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/home/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/models/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/models-config/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/models-config/test/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/sessions/new/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/skills/install/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/skills/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/skills/search/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/api/soul/route-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/app/layout-d0e5bbbeced158b4.js +1 -0
- package/.next/static/chunks/app/login/page-95f1159e5e7ab17d.js +1 -0
- package/.next/static/chunks/app/page-84bb14e99a73d680.js +83 -0
- package/.next/static/chunks/framework-d1de002210ddaaef.js +1 -0
- package/.next/static/chunks/main-073257806f4a040d.js +5 -0
- package/.next/static/chunks/main-app-c8e4c59add6378e1.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-2b15d5ed8bc66ea8.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-0a1ca827cede6958.js +1 -0
- package/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/.next/static/chunks/webpack-3fb0701c42a802b4.js +1 -0
- package/.next/static/css/34155409b87f5f75.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.5f98222a.mjs +6 -0
- package/.next/trace +37 -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/route.ts +351 -0
- package/.next/types/app/api/models-config/test/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/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/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 +98 -0
- package/.next/types/validator.ts +304 -0
- package/LICENSE +21 -0
- package/README.md +67 -0
- package/bin/pi-web.js +160 -0
- package/lib/default-soul.md +42 -0
- package/lib/visualization-harness.md +92 -0
- package/next.config.ts +21 -0
- package/package.json +75 -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
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// This file is generated automatically by Next.js
|
|
2
|
+
// Do not edit this file manually
|
|
3
|
+
|
|
4
|
+
type AppRoutes = "/" | "/login"
|
|
5
|
+
type AppRouteHandlerRoutes = "/api/agent/[id]" | "/api/agent/[id]/events" | "/api/agent/new" | "/api/auth/all-providers" | "/api/auth/api-key/[provider]" | "/api/auth/login" | "/api/auth/login/[provider]" | "/api/auth/logout/[provider]" | "/api/auth/providers" | "/api/auth/status" | "/api/default-cwd" | "/api/files/[...path]" | "/api/harness" | "/api/home" | "/api/models" | "/api/models-config" | "/api/models-config/test" | "/api/sessions" | "/api/sessions/[id]" | "/api/sessions/[id]/context" | "/api/sessions/new" | "/api/skills" | "/api/skills/install" | "/api/skills/search" | "/api/soul"
|
|
6
|
+
type PageRoutes = never
|
|
7
|
+
type LayoutRoutes = "/"
|
|
8
|
+
type RedirectRoutes = never
|
|
9
|
+
type RewriteRoutes = never
|
|
10
|
+
type Routes = AppRoutes | PageRoutes | LayoutRoutes | RedirectRoutes | RewriteRoutes | AppRouteHandlerRoutes
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
interface ParamMap {
|
|
14
|
+
"/": {}
|
|
15
|
+
"/api/agent/[id]": { "id": string; }
|
|
16
|
+
"/api/agent/[id]/events": { "id": string; }
|
|
17
|
+
"/api/agent/new": {}
|
|
18
|
+
"/api/auth/all-providers": {}
|
|
19
|
+
"/api/auth/api-key/[provider]": { "provider": string; }
|
|
20
|
+
"/api/auth/login": {}
|
|
21
|
+
"/api/auth/login/[provider]": { "provider": string; }
|
|
22
|
+
"/api/auth/logout/[provider]": { "provider": string; }
|
|
23
|
+
"/api/auth/providers": {}
|
|
24
|
+
"/api/auth/status": {}
|
|
25
|
+
"/api/default-cwd": {}
|
|
26
|
+
"/api/files/[...path]": { "path": string[]; }
|
|
27
|
+
"/api/harness": {}
|
|
28
|
+
"/api/home": {}
|
|
29
|
+
"/api/models": {}
|
|
30
|
+
"/api/models-config": {}
|
|
31
|
+
"/api/models-config/test": {}
|
|
32
|
+
"/api/sessions": {}
|
|
33
|
+
"/api/sessions/[id]": { "id": string; }
|
|
34
|
+
"/api/sessions/[id]/context": { "id": string; }
|
|
35
|
+
"/api/sessions/new": {}
|
|
36
|
+
"/api/skills": {}
|
|
37
|
+
"/api/skills/install": {}
|
|
38
|
+
"/api/skills/search": {}
|
|
39
|
+
"/api/soul": {}
|
|
40
|
+
"/login": {}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
export type ParamsOf<Route extends Routes> = ParamMap[Route]
|
|
45
|
+
|
|
46
|
+
interface LayoutSlotMap {
|
|
47
|
+
"/": never
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
export type { AppRoutes, PageRoutes, LayoutRoutes, RedirectRoutes, RewriteRoutes, ParamMap, AppRouteHandlerRoutes }
|
|
52
|
+
|
|
53
|
+
declare global {
|
|
54
|
+
/**
|
|
55
|
+
* Props for Next.js App Router page components
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* export default function Page(props: PageProps<'/blog/[slug]'>) {
|
|
59
|
+
* const { slug } = await props.params
|
|
60
|
+
* return <div>Blog post: {slug}</div>
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
interface PageProps<AppRoute extends AppRoutes> {
|
|
65
|
+
params: Promise<ParamMap[AppRoute]>
|
|
66
|
+
searchParams: Promise<Record<string, string | string[] | undefined>>
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Props for Next.js App Router layout components
|
|
71
|
+
* @example
|
|
72
|
+
* ```tsx
|
|
73
|
+
* export default function Layout(props: LayoutProps<'/dashboard'>) {
|
|
74
|
+
* return <div>{props.children}</div>
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
type LayoutProps<LayoutRoute extends LayoutRoutes> = {
|
|
79
|
+
params: Promise<ParamMap[LayoutRoute]>
|
|
80
|
+
children: React.ReactNode
|
|
81
|
+
} & {
|
|
82
|
+
[K in LayoutSlotMap[LayoutRoute]]: React.ReactNode
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Context for Next.js App Router route handlers
|
|
87
|
+
* @example
|
|
88
|
+
* ```tsx
|
|
89
|
+
* export async function GET(request: NextRequest, context: RouteContext<'/api/users/[id]'>) {
|
|
90
|
+
* const { id } = await context.params
|
|
91
|
+
* return Response.json({ id })
|
|
92
|
+
* }
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
interface RouteContext<AppRouteHandlerRoute extends AppRouteHandlerRoutes> {
|
|
96
|
+
params: Promise<ParamMap[AppRouteHandlerRoute]>
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
// This file is generated automatically by Next.js
|
|
2
|
+
// Do not edit this file manually
|
|
3
|
+
// This file validates that all pages and layouts export the correct types
|
|
4
|
+
|
|
5
|
+
import type { AppRoutes, LayoutRoutes, ParamMap, AppRouteHandlerRoutes } from "./routes.js"
|
|
6
|
+
import type { ResolvingMetadata, ResolvingViewport } from "next/types.js"
|
|
7
|
+
import type { NextRequest } from 'next/server.js'
|
|
8
|
+
|
|
9
|
+
type AppPageConfig<Route extends AppRoutes = AppRoutes> = {
|
|
10
|
+
default: React.ComponentType<{ params: Promise<ParamMap[Route]> } & any> | ((props: { params: Promise<ParamMap[Route]> } & any) => React.ReactNode | Promise<React.ReactNode> | never | void | Promise<void>)
|
|
11
|
+
generateStaticParams?: (props: { params: ParamMap[Route] }) => Promise<any[]> | any[]
|
|
12
|
+
generateMetadata?: (
|
|
13
|
+
props: { params: Promise<ParamMap[Route]> } & any,
|
|
14
|
+
parent: ResolvingMetadata
|
|
15
|
+
) => Promise<any> | any
|
|
16
|
+
generateViewport?: (
|
|
17
|
+
props: { params: Promise<ParamMap[Route]> } & any,
|
|
18
|
+
parent: ResolvingViewport
|
|
19
|
+
) => Promise<any> | any
|
|
20
|
+
metadata?: any
|
|
21
|
+
viewport?: any
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type LayoutConfig<Route extends LayoutRoutes = LayoutRoutes> = {
|
|
25
|
+
default: React.ComponentType<LayoutProps<Route>> | ((props: LayoutProps<Route>) => React.ReactNode | Promise<React.ReactNode> | never | void | Promise<void>)
|
|
26
|
+
generateStaticParams?: (props: { params: ParamMap[Route] }) => Promise<any[]> | any[]
|
|
27
|
+
generateMetadata?: (
|
|
28
|
+
props: { params: Promise<ParamMap[Route]> } & any,
|
|
29
|
+
parent: ResolvingMetadata
|
|
30
|
+
) => Promise<any> | any
|
|
31
|
+
generateViewport?: (
|
|
32
|
+
props: { params: Promise<ParamMap[Route]> } & any,
|
|
33
|
+
parent: ResolvingViewport
|
|
34
|
+
) => Promise<any> | any
|
|
35
|
+
metadata?: any
|
|
36
|
+
viewport?: any
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRoutes> = {
|
|
40
|
+
GET?: (request: NextRequest, context: { params: Promise<ParamMap[Route]> }) => Promise<Response | void> | Response | void
|
|
41
|
+
POST?: (request: NextRequest, context: { params: Promise<ParamMap[Route]> }) => Promise<Response | void> | Response | void
|
|
42
|
+
PUT?: (request: NextRequest, context: { params: Promise<ParamMap[Route]> }) => Promise<Response | void> | Response | void
|
|
43
|
+
PATCH?: (request: NextRequest, context: { params: Promise<ParamMap[Route]> }) => Promise<Response | void> | Response | void
|
|
44
|
+
DELETE?: (request: NextRequest, context: { params: Promise<ParamMap[Route]> }) => Promise<Response | void> | Response | void
|
|
45
|
+
HEAD?: (request: NextRequest, context: { params: Promise<ParamMap[Route]> }) => Promise<Response | void> | Response | void
|
|
46
|
+
OPTIONS?: (request: NextRequest, context: { params: Promise<ParamMap[Route]> }) => Promise<Response | void> | Response | void
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// Validate ../../app/login/page.tsx
|
|
51
|
+
{
|
|
52
|
+
type __IsExpected<Specific extends AppPageConfig<"/login">> = Specific
|
|
53
|
+
const handler = {} as typeof import("../../app/login/page.js")
|
|
54
|
+
type __Check = __IsExpected<typeof handler>
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
type __Unused = __Check
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Validate ../../app/page.tsx
|
|
60
|
+
{
|
|
61
|
+
type __IsExpected<Specific extends AppPageConfig<"/">> = Specific
|
|
62
|
+
const handler = {} as typeof import("../../app/page.js")
|
|
63
|
+
type __Check = __IsExpected<typeof handler>
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
type __Unused = __Check
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Validate ../../app/api/agent/[id]/events/route.ts
|
|
69
|
+
{
|
|
70
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/agent/[id]/events">> = Specific
|
|
71
|
+
const handler = {} as typeof import("../../app/api/agent/[id]/events/route.js")
|
|
72
|
+
type __Check = __IsExpected<typeof handler>
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
type __Unused = __Check
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Validate ../../app/api/agent/[id]/route.ts
|
|
78
|
+
{
|
|
79
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/agent/[id]">> = Specific
|
|
80
|
+
const handler = {} as typeof import("../../app/api/agent/[id]/route.js")
|
|
81
|
+
type __Check = __IsExpected<typeof handler>
|
|
82
|
+
// @ts-ignore
|
|
83
|
+
type __Unused = __Check
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Validate ../../app/api/agent/new/route.ts
|
|
87
|
+
{
|
|
88
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/agent/new">> = Specific
|
|
89
|
+
const handler = {} as typeof import("../../app/api/agent/new/route.js")
|
|
90
|
+
type __Check = __IsExpected<typeof handler>
|
|
91
|
+
// @ts-ignore
|
|
92
|
+
type __Unused = __Check
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Validate ../../app/api/auth/all-providers/route.ts
|
|
96
|
+
{
|
|
97
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/auth/all-providers">> = Specific
|
|
98
|
+
const handler = {} as typeof import("../../app/api/auth/all-providers/route.js")
|
|
99
|
+
type __Check = __IsExpected<typeof handler>
|
|
100
|
+
// @ts-ignore
|
|
101
|
+
type __Unused = __Check
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Validate ../../app/api/auth/api-key/[provider]/route.ts
|
|
105
|
+
{
|
|
106
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/auth/api-key/[provider]">> = Specific
|
|
107
|
+
const handler = {} as typeof import("../../app/api/auth/api-key/[provider]/route.js")
|
|
108
|
+
type __Check = __IsExpected<typeof handler>
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
type __Unused = __Check
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Validate ../../app/api/auth/login/[provider]/route.ts
|
|
114
|
+
{
|
|
115
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/auth/login/[provider]">> = Specific
|
|
116
|
+
const handler = {} as typeof import("../../app/api/auth/login/[provider]/route.js")
|
|
117
|
+
type __Check = __IsExpected<typeof handler>
|
|
118
|
+
// @ts-ignore
|
|
119
|
+
type __Unused = __Check
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Validate ../../app/api/auth/login/route.ts
|
|
123
|
+
{
|
|
124
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/auth/login">> = Specific
|
|
125
|
+
const handler = {} as typeof import("../../app/api/auth/login/route.js")
|
|
126
|
+
type __Check = __IsExpected<typeof handler>
|
|
127
|
+
// @ts-ignore
|
|
128
|
+
type __Unused = __Check
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Validate ../../app/api/auth/logout/[provider]/route.ts
|
|
132
|
+
{
|
|
133
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/auth/logout/[provider]">> = Specific
|
|
134
|
+
const handler = {} as typeof import("../../app/api/auth/logout/[provider]/route.js")
|
|
135
|
+
type __Check = __IsExpected<typeof handler>
|
|
136
|
+
// @ts-ignore
|
|
137
|
+
type __Unused = __Check
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Validate ../../app/api/auth/providers/route.ts
|
|
141
|
+
{
|
|
142
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/auth/providers">> = Specific
|
|
143
|
+
const handler = {} as typeof import("../../app/api/auth/providers/route.js")
|
|
144
|
+
type __Check = __IsExpected<typeof handler>
|
|
145
|
+
// @ts-ignore
|
|
146
|
+
type __Unused = __Check
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Validate ../../app/api/auth/status/route.ts
|
|
150
|
+
{
|
|
151
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/auth/status">> = Specific
|
|
152
|
+
const handler = {} as typeof import("../../app/api/auth/status/route.js")
|
|
153
|
+
type __Check = __IsExpected<typeof handler>
|
|
154
|
+
// @ts-ignore
|
|
155
|
+
type __Unused = __Check
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Validate ../../app/api/default-cwd/route.ts
|
|
159
|
+
{
|
|
160
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/default-cwd">> = Specific
|
|
161
|
+
const handler = {} as typeof import("../../app/api/default-cwd/route.js")
|
|
162
|
+
type __Check = __IsExpected<typeof handler>
|
|
163
|
+
// @ts-ignore
|
|
164
|
+
type __Unused = __Check
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Validate ../../app/api/files/[...path]/route.ts
|
|
168
|
+
{
|
|
169
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/files/[...path]">> = Specific
|
|
170
|
+
const handler = {} as typeof import("../../app/api/files/[...path]/route.js")
|
|
171
|
+
type __Check = __IsExpected<typeof handler>
|
|
172
|
+
// @ts-ignore
|
|
173
|
+
type __Unused = __Check
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Validate ../../app/api/harness/route.ts
|
|
177
|
+
{
|
|
178
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/harness">> = Specific
|
|
179
|
+
const handler = {} as typeof import("../../app/api/harness/route.js")
|
|
180
|
+
type __Check = __IsExpected<typeof handler>
|
|
181
|
+
// @ts-ignore
|
|
182
|
+
type __Unused = __Check
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Validate ../../app/api/home/route.ts
|
|
186
|
+
{
|
|
187
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/home">> = Specific
|
|
188
|
+
const handler = {} as typeof import("../../app/api/home/route.js")
|
|
189
|
+
type __Check = __IsExpected<typeof handler>
|
|
190
|
+
// @ts-ignore
|
|
191
|
+
type __Unused = __Check
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Validate ../../app/api/models-config/route.ts
|
|
195
|
+
{
|
|
196
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/models-config">> = Specific
|
|
197
|
+
const handler = {} as typeof import("../../app/api/models-config/route.js")
|
|
198
|
+
type __Check = __IsExpected<typeof handler>
|
|
199
|
+
// @ts-ignore
|
|
200
|
+
type __Unused = __Check
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Validate ../../app/api/models-config/test/route.ts
|
|
204
|
+
{
|
|
205
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/models-config/test">> = Specific
|
|
206
|
+
const handler = {} as typeof import("../../app/api/models-config/test/route.js")
|
|
207
|
+
type __Check = __IsExpected<typeof handler>
|
|
208
|
+
// @ts-ignore
|
|
209
|
+
type __Unused = __Check
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Validate ../../app/api/models/route.ts
|
|
213
|
+
{
|
|
214
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/models">> = Specific
|
|
215
|
+
const handler = {} as typeof import("../../app/api/models/route.js")
|
|
216
|
+
type __Check = __IsExpected<typeof handler>
|
|
217
|
+
// @ts-ignore
|
|
218
|
+
type __Unused = __Check
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Validate ../../app/api/sessions/[id]/context/route.ts
|
|
222
|
+
{
|
|
223
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/sessions/[id]/context">> = Specific
|
|
224
|
+
const handler = {} as typeof import("../../app/api/sessions/[id]/context/route.js")
|
|
225
|
+
type __Check = __IsExpected<typeof handler>
|
|
226
|
+
// @ts-ignore
|
|
227
|
+
type __Unused = __Check
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Validate ../../app/api/sessions/[id]/route.ts
|
|
231
|
+
{
|
|
232
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/sessions/[id]">> = Specific
|
|
233
|
+
const handler = {} as typeof import("../../app/api/sessions/[id]/route.js")
|
|
234
|
+
type __Check = __IsExpected<typeof handler>
|
|
235
|
+
// @ts-ignore
|
|
236
|
+
type __Unused = __Check
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Validate ../../app/api/sessions/new/route.ts
|
|
240
|
+
{
|
|
241
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/sessions/new">> = Specific
|
|
242
|
+
const handler = {} as typeof import("../../app/api/sessions/new/route.js")
|
|
243
|
+
type __Check = __IsExpected<typeof handler>
|
|
244
|
+
// @ts-ignore
|
|
245
|
+
type __Unused = __Check
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Validate ../../app/api/sessions/route.ts
|
|
249
|
+
{
|
|
250
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/sessions">> = Specific
|
|
251
|
+
const handler = {} as typeof import("../../app/api/sessions/route.js")
|
|
252
|
+
type __Check = __IsExpected<typeof handler>
|
|
253
|
+
// @ts-ignore
|
|
254
|
+
type __Unused = __Check
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// Validate ../../app/api/skills/install/route.ts
|
|
258
|
+
{
|
|
259
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/skills/install">> = Specific
|
|
260
|
+
const handler = {} as typeof import("../../app/api/skills/install/route.js")
|
|
261
|
+
type __Check = __IsExpected<typeof handler>
|
|
262
|
+
// @ts-ignore
|
|
263
|
+
type __Unused = __Check
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Validate ../../app/api/skills/route.ts
|
|
267
|
+
{
|
|
268
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/skills">> = Specific
|
|
269
|
+
const handler = {} as typeof import("../../app/api/skills/route.js")
|
|
270
|
+
type __Check = __IsExpected<typeof handler>
|
|
271
|
+
// @ts-ignore
|
|
272
|
+
type __Unused = __Check
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Validate ../../app/api/skills/search/route.ts
|
|
276
|
+
{
|
|
277
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/skills/search">> = Specific
|
|
278
|
+
const handler = {} as typeof import("../../app/api/skills/search/route.js")
|
|
279
|
+
type __Check = __IsExpected<typeof handler>
|
|
280
|
+
// @ts-ignore
|
|
281
|
+
type __Unused = __Check
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// Validate ../../app/api/soul/route.ts
|
|
285
|
+
{
|
|
286
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/soul">> = Specific
|
|
287
|
+
const handler = {} as typeof import("../../app/api/soul/route.js")
|
|
288
|
+
type __Check = __IsExpected<typeof handler>
|
|
289
|
+
// @ts-ignore
|
|
290
|
+
type __Unused = __Check
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
// Validate ../../app/layout.tsx
|
|
298
|
+
{
|
|
299
|
+
type __IsExpected<Specific extends LayoutConfig<"/">> = Specific
|
|
300
|
+
const handler = {} as typeof import("../../app/layout.js")
|
|
301
|
+
type __Check = __IsExpected<typeof handler>
|
|
302
|
+
// @ts-ignore
|
|
303
|
+
type __Unused = __Check
|
|
304
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 agegr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# pidex
|
|
2
|
+
|
|
3
|
+
[pi ē¼ēØęŗč½ä½](https://github.com/badlogic/pi-mono) ēē½é”µēé¢ćåØęµč§åØäøęµč§ä¼čÆćäøęŗč½ä½åƹčÆćåå对čÆćåę¢ę¶ęÆåęÆć
|
|
4
|
+
|
|
5
|
+
## åæ«éå¼å§
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @seqyuan/pidex
|
|
9
|
+
pidex
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
åÆåØåęå¼ [http://localhost:30141](http://localhost:30141)ć
|
|
13
|
+
|
|
14
|
+
**åÆéåę°ļ¼**
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pidex --port 32321 # čŖå®ä¹ē«Æå£
|
|
18
|
+
pidex --hostname 127.0.0.1 # ä»
ę¬ęŗč®æé®
|
|
19
|
+
pidex -p 8080 -H 127.0.0.1 # ē»å使ēØ
|
|
20
|
+
|
|
21
|
+
PORT=8080 pidex # ä¹ęÆęēÆå¢åé
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## åč½ä»ē»
|
|
25
|
+
|
|
26
|
+
- **ä¼čÆęµč§åØ** ā ęå·„ä½ē®å½åē»å±ē¤ŗęę pi ä¼čÆ
|
|
27
|
+
- **å®ę¶åƹčÆ** ā éčæ SSE ęµå¼č¾åŗäøęŗč½ä½å®ę¶äŗ¤äŗ
|
|
28
|
+
- **ä¼čÆåå** ā ä»ä»»ęēØę·ę¶ęÆå建ē¬ē«ēę°ä¼čÆåęÆ
|
|
29
|
+
- **ä¼čÆå
åęÆ** ā åéå°ä»»ęčē¹ē»§ē»åƹčÆļ¼åØåäøęä»¶å
å建åęÆ
|
|
30
|
+
- **åęÆåƼčŖåØ** ā åÆč§ååę¢åäøä¼čÆå
ēåäøŖåęÆ
|
|
31
|
+
- **樔ååę¢** ā 对čÆäøééę¶åę¢ęØ”å
|
|
32
|
+
- **å·„å
·é¢ęæ** ā ę§å¶ęŗč½ä½åÆä½æēØēå·„å
·
|
|
33
|
+
- **å缩ä¼čÆ** ā 对éæä¼čÆčæč”ęč¦ļ¼čēäøäøęēŖå£
|
|
34
|
+
- **å¼åƼ / čæ½å ** ā ęęę£åØčæč”ēęŗč½ä½ļ¼ęåØå
¶å®ęåčæ½å ę¶ęÆ
|
|
35
|
+
|
|
36
|
+
## 注ęäŗé”¹
|
|
37
|
+
|
|
38
|
+
- **ę°ę®ē®å½** ā é»č®¤čÆ»å `~/.pi/agent/sessions` äøēä¼čÆęä»¶ćåÆéčæēÆå¢åé `PI_CODING_AGENT_DIR` ęå®å
¶ä»ē®å½ć
|
|
39
|
+
- **樔åé
ē½®** ā ä»ęŗč½ä½ę°ę®ē®å½äøē `models.json` 读ååÆēØęØ”åļ¼åÆåØä¾§č¾¹ę ēćModelsćé¢ęæäøē¼č¾ć
|
|
40
|
+
- **ęä»¶ęµč§** ā ä¾§č¾¹ę å
ē½®ęä»¶ęµč§åØļ¼åÆåØę ē¾é”µäøę„ēå½åå·„ä½ē®å½äøēęä»¶ć
|
|
41
|
+
|
|
42
|
+
## å¼å
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install
|
|
46
|
+
npm run dev # ē«Æå£ 30141
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 锹ē®ē»ę
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
app/
|
|
53
|
+
api/
|
|
54
|
+
sessions/ # 读åä¼čÆęä»¶
|
|
55
|
+
agent/ # åéå½ä»¤ćSSE äŗä»¶ęµ
|
|
56
|
+
files/ # ęä»¶å
容读å
|
|
57
|
+
models/ # åÆēØęØ”åå蔨äøé»č®¤ęØ”å
|
|
58
|
+
models-config/ # 读å models.json
|
|
59
|
+
components/ # UI ē»ä»¶
|
|
60
|
+
lib/
|
|
61
|
+
session-reader.ts # č§£ę .jsonl ä¼čÆęä»¶
|
|
62
|
+
rpc-manager.ts # ē®”ē AgentSession ēå½åØę
|
|
63
|
+
normalize.ts # č§čå toolCall åꮵå
|
|
64
|
+
types.ts
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
ä¼čÆęä»¶ååØč·Æå¾ļ¼`~/.pi/agent/sessions/<ē¼ē åēå·„ä½ē®å½>/<ę¶é“ę³>_<uuid>.jsonl`
|
package/bin/pi-web.js
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
5
|
+
const { spawn } = require("child_process");
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
7
|
+
const path = require("path");
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
9
|
+
const fs = require("fs");
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
11
|
+
const os = require("os");
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
13
|
+
const readline = require("readline");
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
15
|
+
const { parseArgs } = require("util");
|
|
16
|
+
|
|
17
|
+
const pkgDir = path.join(__dirname, "..");
|
|
18
|
+
const nextDir = path.join(pkgDir, ".next");
|
|
19
|
+
|
|
20
|
+
// Resolve next's CLI entry
|
|
21
|
+
let nextBin;
|
|
22
|
+
try {
|
|
23
|
+
nextBin = require.resolve("next/dist/bin/next", { paths: [pkgDir] });
|
|
24
|
+
} catch {
|
|
25
|
+
try {
|
|
26
|
+
const nextPkg = require.resolve("next/package.json", { paths: [pkgDir] });
|
|
27
|
+
nextBin = path.join(path.dirname(nextPkg), "dist", "bin", "next");
|
|
28
|
+
} catch {
|
|
29
|
+
nextBin = path.join(pkgDir, "node_modules", "next", "dist", "bin", "next");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const { values: cliArgs } = parseArgs({
|
|
34
|
+
options: {
|
|
35
|
+
port: { type: "string", short: "p" },
|
|
36
|
+
hostname: { type: "string", short: "H" },
|
|
37
|
+
},
|
|
38
|
+
strict: false,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const port = cliArgs.port ?? process.env.PORT ?? "30141";
|
|
42
|
+
const hostname = cliArgs.hostname ?? process.env.HOSTNAME ?? null;
|
|
43
|
+
|
|
44
|
+
// āā Password setup on first start āā
|
|
45
|
+
const authFile = path.join(os.homedir(), ".pi", "agent", "web-auth.json");
|
|
46
|
+
|
|
47
|
+
function promptPassword() {
|
|
48
|
+
return new Promise((resolve) => {
|
|
49
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
50
|
+
const ask = (prompt) => new Promise((res) => rl.question(prompt, res));
|
|
51
|
+
(async () => {
|
|
52
|
+
console.log("\nš No password set. You can protect pidex with a password.");
|
|
53
|
+
console.log(" Leave empty and press Enter to skip.\n");
|
|
54
|
+
const pw1 = await ask("Enter password: ");
|
|
55
|
+
if (!pw1.trim()) {
|
|
56
|
+
console.log(" Skipped ā no password required.\n");
|
|
57
|
+
rl.close();
|
|
58
|
+
resolve(false);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const pw2 = await ask("Confirm password: ");
|
|
62
|
+
if (pw1 !== pw2) {
|
|
63
|
+
console.log(" Passwords don't match. Skipping.\n");
|
|
64
|
+
rl.close();
|
|
65
|
+
resolve(false);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const bcrypt = require("bcryptjs");
|
|
69
|
+
const hash = bcrypt.hashSync(pw1, 10);
|
|
70
|
+
const dir = path.dirname(authFile);
|
|
71
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
72
|
+
fs.writeFileSync(authFile, JSON.stringify({ passwordHash: hash, enabled: true }, null, 2));
|
|
73
|
+
console.log(" ā
Password set. Restart won't prompt.\n");
|
|
74
|
+
rl.close();
|
|
75
|
+
resolve(true);
|
|
76
|
+
})();
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async function maybeSetupAuth() {
|
|
81
|
+
if (fs.existsSync(authFile)) return;
|
|
82
|
+
if (process.env.PIDEX_PASSWORD) {
|
|
83
|
+
const bcrypt = require("bcryptjs");
|
|
84
|
+
const hash = bcrypt.hashSync(process.env.PIDEX_PASSWORD, 10);
|
|
85
|
+
const dir = path.dirname(authFile);
|
|
86
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
87
|
+
fs.writeFileSync(authFile, JSON.stringify({ passwordHash: hash, enabled: true }, null, 2));
|
|
88
|
+
console.log(" š Password set from PIDEX_PASSWORD env var.");
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (!process.stdin.isTTY) return;
|
|
92
|
+
await promptPassword();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// āā Seed default soul.md āā
|
|
96
|
+
const defaultSoulSrc = path.join(pkgDir, "lib", "default-soul.md");
|
|
97
|
+
const soulDest = path.join(os.homedir(), ".pi", "agent", "soul.md");
|
|
98
|
+
if (!fs.existsSync(soulDest) && fs.existsSync(defaultSoulSrc)) {
|
|
99
|
+
const dir = path.dirname(soulDest);
|
|
100
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
101
|
+
fs.copyFileSync(defaultSoulSrc, soulDest);
|
|
102
|
+
console.log(" š Default soul.md seeded to ~/.pi/agent/soul.md");
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// āā Seed default harness.md āā
|
|
106
|
+
const defaultHarnessSrc = path.join(pkgDir, "lib", "visualization-harness.md");
|
|
107
|
+
const harnessDest = path.join(os.homedir(), ".pi", "agent", "harness.md");
|
|
108
|
+
if (!fs.existsSync(harnessDest) && fs.existsSync(defaultHarnessSrc)) {
|
|
109
|
+
const dir = path.dirname(harnessDest);
|
|
110
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
111
|
+
fs.copyFileSync(defaultHarnessSrc, harnessDest);
|
|
112
|
+
console.log(" š Default harness.md seeded to ~/.pi/agent/harness.md");
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// āā Start server āā
|
|
116
|
+
maybeSetupAuth().then(() => {
|
|
117
|
+
if (!fs.existsSync(nextDir)) {
|
|
118
|
+
console.error("Build artifacts not found. Please report this issue.");
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const nextArgs = ["start", "-p", port];
|
|
123
|
+
if (hostname) nextArgs.push("-H", hostname);
|
|
124
|
+
|
|
125
|
+
const child = spawn(process.execPath, [nextBin, ...nextArgs], {
|
|
126
|
+
cwd: pkgDir,
|
|
127
|
+
stdio: ["inherit", "pipe", "inherit"],
|
|
128
|
+
env: {
|
|
129
|
+
...process.env,
|
|
130
|
+
PIDEX_AUTH_ENABLED: (() => {
|
|
131
|
+
try {
|
|
132
|
+
if (!fs.existsSync(authFile)) return "0";
|
|
133
|
+
const cfg = JSON.parse(fs.readFileSync(authFile, "utf-8"));
|
|
134
|
+
return cfg.enabled !== false && cfg.passwordHash ? "1" : "0";
|
|
135
|
+
} catch { return "0"; }
|
|
136
|
+
})(),
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
let browserOpened = false;
|
|
141
|
+
const url = `http://${hostname ?? "localhost"}:${port}`;
|
|
142
|
+
|
|
143
|
+
child.stdout.on("data", (chunk) => {
|
|
144
|
+
const text = chunk.toString();
|
|
145
|
+
process.stdout.write(text);
|
|
146
|
+
if (!browserOpened && text.includes("Ready")) {
|
|
147
|
+
browserOpened = true;
|
|
148
|
+
const isWindows = process.platform === "win32";
|
|
149
|
+
const isMac = process.platform === "darwin";
|
|
150
|
+
const openCmd = isWindows ? "start" : isMac ? "open" : "xdg-open";
|
|
151
|
+
const openChild = spawn(openCmd, [url], { shell: isWindows, stdio: "ignore", detached: true });
|
|
152
|
+
openChild.on("error", () => {
|
|
153
|
+
// Browser open failed (e.g., xdg-open not installed) ā non-fatal
|
|
154
|
+
});
|
|
155
|
+
openChild.unref();
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
child.on("exit", (code) => process.exit(code ?? 0));
|
|
160
|
+
});
|