@baique/pi-web-sky 0.1.30 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +6 -6
- package/.next/build-manifest.json +4 -4
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +1 -1
- package/.next/required-server-files.js +7 -7
- package/.next/required-server-files.json +7 -7
- package/.next/server/app/_global-error/page.js +2 -2
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +3 -3
- package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/agent/[id]/bash-output/route.js +2 -2
- package/.next/server/app/api/agent/[id]/bash-output/route.js.nft.json +1 -1
- package/.next/server/app/api/agent/[id]/bash-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/[id]/events/route.js +1 -1
- package/.next/server/app/api/agent/[id]/events/route.js.nft.json +1 -1
- package/.next/server/app/api/agent/[id]/events/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/[id]/route.js +1 -1
- package/.next/server/app/api/agent/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/agent/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/new/route.js +1 -1
- package/.next/server/app/api/agent/new/route.js.nft.json +1 -1
- package/.next/server/app/api/agent/new/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/running/route.js +1 -1
- package/.next/server/app/api/agent/running/route.js.nft.json +1 -1
- package/.next/server/app/api/agent/running/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app-update/route.js +1 -1
- package/.next/server/app/api/app-update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/all-providers/route.js +1 -1
- package/.next/server/app/api/auth/all-providers/route.js.nft.json +1 -1
- package/.next/server/app/api/auth/all-providers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +30 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js.nft.json +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +31 -2
- package/.next/server/app/api/auth/login/[provider]/route.js.nft.json +1 -1
- package/.next/server/app/api/auth/login/[provider]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/logout/[provider]/route.js +30 -1
- package/.next/server/app/api/auth/logout/[provider]/route.js.nft.json +1 -1
- package/.next/server/app/api/auth/logout/[provider]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/providers/route.js +1 -1
- package/.next/server/app/api/auth/providers/route.js.nft.json +1 -1
- package/.next/server/app/api/auth/providers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/cwd/browse/route.js +1 -1
- package/.next/server/app/api/cwd/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/cwd/validate/route.js +2 -2
- package/.next/server/app/api/cwd/validate/route.js.nft.json +1 -1
- package/.next/server/app/api/cwd/validate/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/default-cwd/route.js +2 -2
- package/.next/server/app/api/default-cwd/route.js.nft.json +1 -1
- package/.next/server/app/api/default-cwd/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/file-index/route.js +2 -2
- package/.next/server/app/api/file-index/route.js.nft.json +1 -1
- package/.next/server/app/api/file-index/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/files/[...path]/route.js +2 -2
- package/.next/server/app/api/files/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/files/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/git/diff/route.js +3 -3
- package/.next/server/app/api/git/diff/route.js.nft.json +1 -1
- package/.next/server/app/api/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/git/status/route.js +3 -3
- package/.next/server/app/api/git/status/route.js.nft.json +1 -1
- package/.next/server/app/api/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/home/route.js +1 -1
- package/.next/server/app/api/home/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/mcp/route.js +2 -2
- package/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models/route.js +2 -2
- package/.next/server/app/api/models/route.js.nft.json +1 -1
- package/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/catalog/route.js +1 -1
- package/.next/server/app/api/models-config/catalog/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/discover/route.js +1 -1
- package/.next/server/app/api/models-config/discover/route.js.nft.json +1 -1
- package/.next/server/app/api/models-config/discover/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/route.js +1 -1
- package/.next/server/app/api/models-config/route.js.nft.json +1 -1
- package/.next/server/app/api/models-config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/test/route.js +1 -1
- package/.next/server/app/api/models-config/test/route.js.nft.json +1 -1
- package/.next/server/app/api/models-config/test/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/plugins/route.js +2 -2
- package/.next/server/app/api/plugins/route.js.nft.json +1 -1
- package/.next/server/app/api/plugins/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/project-trust/route.js +1 -1
- package/.next/server/app/api/project-trust/route.js.nft.json +1 -1
- package/.next/server/app/api/project-trust/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/quota/route.js +1 -1
- package/.next/server/app/api/quota/route.js.nft.json +1 -1
- package/.next/server/app/api/quota/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/search/route.js +2 -2
- package/.next/server/app/api/search/route.js.nft.json +1 -1
- package/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/auto-name/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/auto-name/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/auto-name/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/context/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/context/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/export/route.js +3 -3
- package/.next/server/app/api/sessions/[id]/export/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/export/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/state/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/state/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/todos/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/todos/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/route.js +1 -1
- package/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/check/route.js +1 -1
- package/.next/server/app/api/skills/check/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/check/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/install/route.js +2 -2
- package/.next/server/app/api/skills/install/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/route.js +2 -2
- package/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/search/route.js +1 -1
- package/.next/server/app/api/skills/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/update/route.js +1 -1
- package/.next/server/app/api/skills/update/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[id]/route.js +1 -1
- package/.next/server/app/api/tasks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/route.js +2 -2
- package/.next/server/app/api/tasks/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/terminal/[id]/events/route.js +2 -2
- package/.next/server/app/api/terminal/[id]/events/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/terminal/[id]/route.js +2 -2
- package/.next/server/app/api/terminal/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/terminal/route.js +2 -2
- package/.next/server/app/api/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/route.js +2 -2
- package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
- package/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +5 -5
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +5 -5
- package/.next/server/app/index.segments/_full.segment.rsc +5 -5
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/manifest.webmanifest/route.js +2 -2
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +7 -7
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +6 -6
- package/.next/server/chunks/1457.js +1 -1
- package/.next/server/chunks/2404.js +30 -0
- package/.next/server/chunks/2430.js +4 -4
- package/.next/server/chunks/3379.js +1 -1
- package/.next/server/chunks/7513.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/middleware.js +3 -3
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/3266.4c7192f2067645eb.js +1 -0
- package/.next/static/chunks/app/_not-found/{page-8cea8d8de35f4da4.js → page-af4fe23994cb3d66.js} +1 -1
- package/.next/static/chunks/app/{layout-4a6dc9d78a818cb5.js → layout-f85cabff4c2af8dc.js} +1 -1
- package/.next/static/chunks/app/page-e2c8f01336cc4d05.js +89 -0
- package/.next/static/chunks/{main-app-dd2385a1a5a588df.js → main-app-b3e8a8d15d83e1f0.js} +1 -1
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-00a4badaccb388e6.js +1 -0
- package/.next/static/chunks/{webpack-3d4b32814d426e7a.js → webpack-09241b8782696d25.js} +1 -1
- package/.next/static/css/de7b7ffe9688501b.css +1 -0
- package/.next/trace +8 -40
- package/.next/trace-build +1 -1
- package/.next/types/app/api/agent/[id]/bash-output/route.ts +1 -1
- package/.next/types/app/api/agent/[id]/events/route.ts +1 -1
- package/.next/types/app/api/agent/[id]/route.ts +1 -1
- package/.next/types/app/api/agent/new/route.ts +1 -1
- package/.next/types/app/api/agent/running/route.ts +1 -1
- package/.next/types/app/api/app-update/route.ts +1 -1
- package/.next/types/app/api/auth/all-providers/route.ts +1 -1
- package/.next/types/app/api/auth/api-key/[provider]/route.ts +1 -1
- package/.next/types/app/api/auth/login/[provider]/route.ts +1 -1
- package/.next/types/app/api/auth/logout/[provider]/route.ts +1 -1
- package/.next/types/app/api/auth/providers/route.ts +1 -1
- package/.next/types/app/api/cwd/browse/route.ts +1 -1
- package/.next/types/app/api/cwd/validate/route.ts +1 -1
- package/.next/types/app/api/default-cwd/route.ts +1 -1
- package/.next/types/app/api/file-index/route.ts +1 -1
- package/.next/types/app/api/files/[...path]/route.ts +1 -1
- package/.next/types/app/api/git/diff/route.ts +1 -1
- package/.next/types/app/api/git/status/route.ts +1 -1
- package/.next/types/app/api/home/route.ts +1 -1
- package/.next/types/app/api/mcp/route.ts +1 -1
- package/.next/types/app/api/models/route.ts +1 -1
- package/.next/types/app/api/models-config/catalog/route.ts +1 -1
- package/.next/types/app/api/models-config/discover/route.ts +1 -1
- package/.next/types/app/api/models-config/route.ts +1 -1
- package/.next/types/app/api/models-config/test/route.ts +1 -1
- package/.next/types/app/api/plugins/route.ts +1 -1
- package/.next/types/app/api/project-trust/route.ts +1 -1
- package/.next/types/app/api/quota/route.ts +1 -1
- package/.next/types/app/api/search/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/auto-name/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/context/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/entries/[entryId]/thinking/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/export/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/state/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/todos/route.ts +1 -1
- package/.next/types/app/api/sessions/route.ts +1 -1
- package/.next/types/app/api/skills/check/route.ts +1 -1
- package/.next/types/app/api/skills/install/route.ts +1 -1
- package/.next/types/app/api/skills/route.ts +1 -1
- package/.next/types/app/api/skills/search/route.ts +1 -1
- package/.next/types/app/api/skills/update/route.ts +1 -1
- package/.next/types/app/api/tasks/[id]/route.ts +1 -1
- package/.next/types/app/api/tasks/route.ts +1 -1
- package/.next/types/app/api/terminal/[id]/events/route.ts +1 -1
- package/.next/types/app/api/terminal/[id]/route.ts +1 -1
- package/.next/types/app/api/terminal/route.ts +1 -1
- package/.next/types/app/api/worktrees/route.ts +1 -1
- package/.next/types/app/layout.ts +1 -1
- package/.next/types/app/page.ts +1 -1
- package/package.json +1 -1
- package/.next/static/chunks/3266.be4a8006cf72695c.js +0 -1
- package/.next/static/chunks/app/page-2783998ff89bdbe5.js +0 -89
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-be943dcb89867ab9.js +0 -1
- package/.next/static/css/f72c938555d9bdff.css +0 -1
- /package/.next/static/{TTcBG2A8ypXXieSlP70n7 → 0q1SOOo5-fPs13_IN4vdq}/_buildManifest.js +0 -0
- /package/.next/static/{TTcBG2A8ypXXieSlP70n7 → 0q1SOOo5-fPs13_IN4vdq}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/tasks/[id]/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{},"edgeSSRModuleMapping":{},"clientModules":{},"entryCSSFiles":{"/
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/tasks/[id]/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{},"edgeSSRModuleMapping":{},"clientModules":{},"entryCSSFiles":{"/home/wa/project/pi-web-sky/app/api/tasks/[id]/route":[]},"rscModuleMapping":{},"edgeRscModuleMapping":{}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var a={};a.id=6456,a.ids=[6456],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},515:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/tasks/route",pathname:"/api/tasks",filename:"route",bundlePath:"app/api/tasks/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/baique/work/develop/project/pi-web-sky/app/api/tasks/route.ts",nextConfigOutput:"",userland:()=>c(63807),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/tasks/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46583:(a,b,c)=>{"use strict";c.d(b,{R6:()=>o,UT:()=>j,Vk:()=>i,fi:()=>n,gQ:()=>f,lC:()=>k,mE:()=>m,vq:()=>l});var d=c(55511),e=c(66737);function f(a){return(0,e.Lf)().prepare("SELECT session_id FROM session_meta WHERE task_id = ? ORDER BY pinned DESC, updated DESC, rowid DESC").all(a).map(a=>a.session_id)}function g(a){return(0,e.Lf)().prepare("SELECT id, project_key AS projectKey, name, created, updated, pinned FROM tasks WHERE id = ?").get(a)}function h(a){var b;return{...a,pinned:1===a.pinned,sessionIds:f(a.id),pinnedSessionIds:(b=a.id,(0,e.Lf)().prepare("SELECT session_id FROM session_meta WHERE task_id = ? AND pinned = 1").all(b).map(a=>a.session_id))}}function i(a){return(0,e.Lf)().prepare("SELECT id, project_key AS projectKey, name, created, updated, pinned FROM tasks WHERE project_key = ? ORDER BY pinned DESC, updated DESC, created DESC").all(a).map(h)}function j(a,b){let c=b.trim();if(!a)throw Error("projectKey is required");if(!c)throw Error("name must not be empty");let f=(0,d.randomUUID)(),g=Date.now();return(0,e.Lf)().prepare("INSERT INTO tasks (id, project_key, name, created, updated) VALUES (?, ?, ?, ?, ?)").run(f,a,c,g,g),{id:f,projectKey:a,name:c,created:g,updated:g,pinned:!1,sessionIds:[],pinnedSessionIds:[]}}function k(a,b){let c=(0,e.Lf)();if(!g(a))return null;c.exec("BEGIN");try{if(void 0!==b.name){let d=b.name.trim();if(!d)throw Error("name must not be empty");c.prepare("UPDATE tasks SET name = ?, updated = ? WHERE id = ?").run(d,Date.now(),a)}if(void 0!==b.pinned&&c.prepare("UPDATE tasks SET pinned = ?, updated = ? WHERE id = ?").run(+!!b.pinned,Date.now(),a),void 0!==b.sessionIds){let d=new Set(f(a)),e=new Set(b.sessionIds),g=Date.now(),h=c.prepare("INSERT INTO session_meta (session_id, task_id, updated) VALUES (?, ?, ?) ON CONFLICT(session_id) DO UPDATE SET task_id = excluded.task_id, updated = excluded.updated"),i=c.prepare("UPDATE session_meta SET task_id = NULL, updated = ? WHERE session_id = ?");for(let c of b.sessionIds)d.has(c)||h.run(c,a,g);for(let a of d)e.has(a)||i.run(g,a);c.prepare("UPDATE tasks SET updated = ? WHERE id = ?").run(g,a)}c.exec("COMMIT")}catch(a){throw c.exec("ROLLBACK"),a}return h(g(a))}function l(a){let b=(0,e.Lf)();b.exec("BEGIN");try{b.prepare("UPDATE session_meta SET task_id = NULL, updated = ? WHERE task_id = ?").run(Date.now(),a),b.prepare("DELETE FROM tasks WHERE id = ?").run(a),b.exec("COMMIT")}catch(a){throw b.exec("ROLLBACK"),a}}function m(a,b){let c=(0,e.Lf)();if(!g(b))return!1;let d=Date.now();c.exec("BEGIN");try{c.prepare("INSERT INTO session_meta (session_id, task_id, updated) VALUES (?, ?, ?) ON CONFLICT(session_id) DO UPDATE SET task_id = excluded.task_id, updated = excluded.updated").run(a,b,d),c.prepare("UPDATE tasks SET updated = ? WHERE id = ?").run(d,b),c.exec("COMMIT")}catch(a){throw c.exec("ROLLBACK"),a}return!0}function n(a,b){(0,e.Lf)().prepare("INSERT INTO session_meta (session_id, task_id, updated, pinned) VALUES (?, NULL, ?, ?) ON CONFLICT(session_id) DO UPDATE SET pinned = excluded.pinned").run(a,Date.now(),+!!b)}function o(a){(0,e.Lf)().prepare("DELETE FROM session_meta WHERE session_id = ?").run(a)}},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63807:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>g,POST:()=>h,dynamic:()=>f});var d=c(23211),e=c(46583);let f="force-dynamic";async function g(a){try{let b=new URL(a.url).searchParams.get("projectKey")??"",c=(0,e.Vk)(b);return d.NextResponse.json({tasks:c},{headers:{"Cache-Control":"no-store"}})}catch(a){return d.NextResponse.json({error:String(a)},{status:500,headers:{"Cache-Control":"no-store"}})}}async function h(a){try{let b=await a.json().catch(()=>({}));if("string"!=typeof b.projectKey||!b.projectKey.trim())return d.NextResponse.json({error:"projectKey is required"},{status:400});if("string"!=typeof b.name||!b.name.trim())return d.NextResponse.json({error:"name is required"},{status:400});let c=(0,e.UT)(b.projectKey,b.name);return d.NextResponse.json({task:c},{status:201})}catch(a){return d.NextResponse.json({error:String(a)},{status:500})}}},66737:(a,b,c)=>{"use strict";c.d(b,{Lf:()=>g});var d=c(79868),e=c(21820),f=c(33873);function g(){if(globalThis.__piWebDb)return globalThis.__piWebDb;let a=new d.DatabaseSync((0,f.join)(function(){let a=process.env.PI_CODING_AGENT_DIR;if(a){let b=a.startsWith("~")?(0,f.join)((0,e.homedir)(),a.slice(1)):a;return(0,f.normalize)(b)}return(0,f.join)((0,e.homedir)(),".pi","agent")}(),"pi-web.db"));return a.exec("PRAGMA journal_mode = WAL;"),a.exec("PRAGMA foreign_keys = ON;"),function(a){for(let b of(a.exec(`
|
|
1
|
+
(()=>{var a={};a.id=6456,a.ids=[6456],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63807:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>g,POST:()=>h,dynamic:()=>f});var d=c(23211),e=c(68964);let f="force-dynamic";async function g(a){try{let b=new URL(a.url).searchParams.get("projectKey")??"",c=(0,e.Vk)(b);return d.NextResponse.json({tasks:c},{headers:{"Cache-Control":"no-store"}})}catch(a){return d.NextResponse.json({error:String(a)},{status:500,headers:{"Cache-Control":"no-store"}})}}async function h(a){try{let b=await a.json().catch(()=>({}));if("string"!=typeof b.projectKey||!b.projectKey.trim())return d.NextResponse.json({error:"projectKey is required"},{status:400});if("string"!=typeof b.name||!b.name.trim())return d.NextResponse.json({error:"name is required"},{status:400});let c=(0,e.UT)(b.projectKey,b.name);return d.NextResponse.json({task:c},{status:201})}catch(a){return d.NextResponse.json({error:String(a)},{status:500})}}},66737:(a,b,c)=>{"use strict";c.d(b,{Lf:()=>g});var d=c(80099),e=c(21820),f=c(33873);function g(){if(globalThis.__piWebDb)return globalThis.__piWebDb;let a=new d.DatabaseSync((0,f.join)(function(){let a=process.env.PI_CODING_AGENT_DIR;if(a){let b=a.startsWith("~")?(0,f.join)((0,e.homedir)(),a.slice(1)):a;return(0,f.normalize)(b)}return(0,f.join)((0,e.homedir)(),".pi","agent")}(),"pi-web.db"));return a.exec("PRAGMA journal_mode = WAL;"),a.exec("PRAGMA foreign_keys = ON;"),function(a){for(let b of(a.exec(`
|
|
2
2
|
CREATE TABLE IF NOT EXISTS tasks (
|
|
3
3
|
id TEXT PRIMARY KEY,
|
|
4
4
|
project_key TEXT NOT NULL,
|
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
body,
|
|
28
28
|
tokenize = 'trigram'
|
|
29
29
|
);
|
|
30
|
-
`),["ALTER TABLE tasks ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;","ALTER TABLE session_meta ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;"]))try{a.exec(b)}catch{}}(a),globalThis.__piWebDb=a,a}},78335:()=>{},79868:a=>{"use strict";a.exports=require("node:sqlite")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=515));module.exports=c})();
|
|
30
|
+
`),["ALTER TABLE tasks ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;","ALTER TABLE session_meta ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;"]))try{a.exec(b)}catch{}}(a),globalThis.__piWebDb=a,a}},68964:(a,b,c)=>{"use strict";c.d(b,{R6:()=>o,UT:()=>j,Vk:()=>i,fi:()=>n,gQ:()=>f,lC:()=>k,mE:()=>m,vq:()=>l});var d=c(55511),e=c(66737);function f(a){return(0,e.Lf)().prepare("SELECT session_id FROM session_meta WHERE task_id = ? ORDER BY pinned DESC, updated DESC, rowid DESC").all(a).map(a=>a.session_id)}function g(a){return(0,e.Lf)().prepare("SELECT id, project_key AS projectKey, name, created, updated, pinned FROM tasks WHERE id = ?").get(a)}function h(a){var b;return{...a,pinned:1===a.pinned,sessionIds:f(a.id),pinnedSessionIds:(b=a.id,(0,e.Lf)().prepare("SELECT session_id FROM session_meta WHERE task_id = ? AND pinned = 1").all(b).map(a=>a.session_id))}}function i(a){return(0,e.Lf)().prepare("SELECT id, project_key AS projectKey, name, created, updated, pinned FROM tasks WHERE project_key = ? ORDER BY pinned DESC, updated DESC, created DESC").all(a).map(h)}function j(a,b){let c=b.trim();if(!a)throw Error("projectKey is required");if(!c)throw Error("name must not be empty");let f=(0,d.randomUUID)(),g=Date.now();return(0,e.Lf)().prepare("INSERT INTO tasks (id, project_key, name, created, updated) VALUES (?, ?, ?, ?, ?)").run(f,a,c,g,g),{id:f,projectKey:a,name:c,created:g,updated:g,pinned:!1,sessionIds:[],pinnedSessionIds:[]}}function k(a,b){let c=(0,e.Lf)();if(!g(a))return null;c.exec("BEGIN");try{if(void 0!==b.name){let d=b.name.trim();if(!d)throw Error("name must not be empty");c.prepare("UPDATE tasks SET name = ?, updated = ? WHERE id = ?").run(d,Date.now(),a)}if(void 0!==b.pinned&&c.prepare("UPDATE tasks SET pinned = ?, updated = ? WHERE id = ?").run(+!!b.pinned,Date.now(),a),void 0!==b.sessionIds){let d=new Set(f(a)),e=new Set(b.sessionIds),g=Date.now(),h=c.prepare("INSERT INTO session_meta (session_id, task_id, updated) VALUES (?, ?, ?) ON CONFLICT(session_id) DO UPDATE SET task_id = excluded.task_id, updated = excluded.updated"),i=c.prepare("UPDATE session_meta SET task_id = NULL, updated = ? WHERE session_id = ?");for(let c of b.sessionIds)d.has(c)||h.run(c,a,g);for(let a of d)e.has(a)||i.run(g,a);c.prepare("UPDATE tasks SET updated = ? WHERE id = ?").run(g,a)}c.exec("COMMIT")}catch(a){throw c.exec("ROLLBACK"),a}return h(g(a))}function l(a){let b=(0,e.Lf)();b.exec("BEGIN");try{b.prepare("UPDATE session_meta SET task_id = NULL, updated = ? WHERE task_id = ?").run(Date.now(),a),b.prepare("DELETE FROM tasks WHERE id = ?").run(a),b.exec("COMMIT")}catch(a){throw b.exec("ROLLBACK"),a}}function m(a,b){let c=(0,e.Lf)();if(!g(b))return!1;let d=Date.now();c.exec("BEGIN");try{c.prepare("INSERT INTO session_meta (session_id, task_id, updated) VALUES (?, ?, ?) ON CONFLICT(session_id) DO UPDATE SET task_id = excluded.task_id, updated = excluded.updated").run(a,b,d),c.prepare("UPDATE tasks SET updated = ? WHERE id = ?").run(d,b),c.exec("COMMIT")}catch(a){throw c.exec("ROLLBACK"),a}return!0}function n(a,b){(0,e.Lf)().prepare("INSERT INTO session_meta (session_id, task_id, updated, pinned) VALUES (?, NULL, ?, ?) ON CONFLICT(session_id) DO UPDATE SET pinned = excluded.pinned").run(a,Date.now(),+!!b)}function o(a){(0,e.Lf)().prepare("DELETE FROM session_meta WHERE session_id = ?").run(a)}},69837:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/tasks/route",pathname:"/api/tasks",filename:"route",bundlePath:"app/api/tasks/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/wa/project/pi-web-sky/app/api/tasks/route.ts",nextConfigOutput:"",userland:()=>c(63807),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/tasks/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},78335:()=>{},80099:a=>{"use strict";a.exports=require("node:sqlite")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=69837));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/tasks/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{},"edgeSSRModuleMapping":{},"clientModules":{},"entryCSSFiles":{"/
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/tasks/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{},"edgeSSRModuleMapping":{},"clientModules":{},"entryCSSFiles":{"/home/wa/project/pi-web-sky/app/api/tasks/route":[]},"rscModuleMapping":{},"edgeRscModuleMapping":{}};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(()=>{var a={};a.id=6252,a.ids=[6252],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},
|
|
1
|
+
(()=>{var a={};a.id=6252,a.ids=[6252],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},34187:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/terminal/[id]/events/route",pathname:"/api/terminal/[id]/events",filename:"route",bundlePath:"app/api/terminal/[id]/events/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/wa/project/pi-web-sky/app/api/terminal/[id]/events/route.ts",nextConfigOutput:"",userland:()=>c(49907),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/terminal/[id]/events/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},49907:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>f,dynamic:()=>e});var d=c(73968);let e="force-dynamic";async function f(a,{params:b}){let{id:c}=await b;if(!(0,d.$s)(c))return new Response("Terminal not found",{status:404});if(a.signal.aborted)return new Response(null,{status:204});let e=new URL(a.url).searchParams.get("since"),g=null===e?null:Number(e),h=(0,d.kC)(c);if(!h)return new Response("Terminal not found",{status:404});let i="";i=null!==g&&Number.isFinite(g)&&g>=h.startOffset?(0,d.UM)(c,g)??"":h.data;let j=h.startOffset+i.length,k=new TextEncoder,l=null,m=null;return new Response(new ReadableStream({start(b){let e=(a,c)=>{try{b.enqueue(k.encode(`event: ${a}
|
|
2
2
|
data: ${JSON.stringify(c)}
|
|
3
3
|
|
|
4
4
|
`))}catch{}};e("output",{d:i,o:j}),l=a=>{if(!a){e("gone",{}),m&&clearInterval(m);try{b.close()}catch{}return}j+=a.length,e("output",{d:a,o:j})},(0,d.ch)(c,l),m=setInterval(()=>e("ping",{}),3e4),a.signal.addEventListener("abort",()=>{l&&(0,d.pQ)(c,l),m&&clearInterval(m);try{b.close()}catch{}})},cancel(){l&&(0,d.pQ)(c,l),m&&clearInterval(m)}}),{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}})}},54763:a=>{"use strict";a.exports=require("@lydell/node-pty")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73968:(a,b,c)=>{"use strict";c.d(b,{$s:()=>l,BY:()=>p,Nu:()=>o,OA:()=>n,PB:()=>m,UM:()=>h,Y_:()=>k,Zm:()=>q,ch:()=>r,kC:()=>i,pQ:()=>s});var d=c(55511);let e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function f(){let a=globalThis;return a.__piTerminals||(a.__piTerminals={sessions:new Map}),a.__piTerminals}function g(a,b){if(a.buffer+=b,a.buffer.length>262144){let[b,c]=function(a){if(a.length<=262144)return[a,0];let b=a.length-262144,c=a.lastIndexOf("\n",b);return c>=0&&(b=c+1),[a.slice(b),b]}(a.buffer);a.buffer=b,a.baseOffset+=c}for(let c of a.listeners)c(b)}function h(a,b){let c=f().sessions.get(a);if(!c)return null;let d=c.baseOffset;return b<d?null:c.buffer.slice(Math.max(0,b-d))}function i(a){let b=f().sessions.get(a);return b?{data:b.buffer,startOffset:b.baseOffset}:null}function j(a){return{id:a.id,name:a.name,cwd:a.cwd,projectRoot:a.projectRoot,projectLabel:a.projectLabel,cols:a.cols,rows:a.rows,running:a.running,exitCode:a.exitCode,createdAt:a.createdAt}}function k(){return[...f().sessions.values()].map(j)}function l(a){let b=f().sessions.get(a);return b?j(b):void 0}async function m(a){let b=f().sessions;if(b.size>=12){let a=[...b.values()].filter(a=>!a.running).sort((a,b)=>a.createdAt-b.createdAt)[0];if(!a)throw Error("Terminal limit reached (12)");q(a.id)}let h=a.cols??80,i=a.rows??24,j="win32"===process.platform?"powershell.exe":process.env.SHELL||"bash",k="win32"===process.platform||process.env.SHELL?.endsWith("fish")?[]:["-l"],m=await Promise.resolve().then(c.t.bind(c,54763,23)),n=(m.default??m).spawn(j,k,{name:"xterm-256color",cwd:a.cwd,cols:h,rows:i,env:process.env}),o=(0,d.randomUUID)(),p=a.cwd.split(/[\\/]/).filter(Boolean).pop()||"term",r={id:o,name:`${p}-${function(){let a=(0,d.randomBytes)(4),b="";for(let c=0;c<4;c++)b+=e[a[c]%e.length];return b}()}`,cwd:a.cwd,projectRoot:a.projectRoot,projectLabel:a.projectLabel,cols:h,rows:i,running:!0,exitCode:null,createdAt:Date.now(),pty:n,buffer:"",baseOffset:0,listeners:new Set};return n.onData(a=>g(r,a)),n.onExit(({exitCode:a})=>{r.running=!1,r.exitCode=a,r.pty=null,g(r,`\r
|
|
5
5
|
\x1b[2m[进程已退出,exit code ${a}]\x1b[0m\r
|
|
6
|
-
`)}),b.set(o,r),l(o)}function n(a,b){let c=f().sessions.get(a);return!!c?.pty&&(c.pty.write(b),!0)}function o(a,b,c){let d=f().sessions.get(a);if(!d)return!1;d.cols=b,d.rows=c;try{d.pty?.resize(b,c)}catch{}return!0}function p(a){let b=f().sessions.get(a);if(!b)return!1;if(b.pty)try{b.pty.kill()}catch{}return!0}function q(a){let b=f().sessions.get(a);if(!b)return!1;for(let c of(p(a),b.listeners))c("");return b.listeners.clear(),f().sessions.delete(a)}function r(a,b){let c=f().sessions.get(a);return!!c&&(c.listeners.add(b),!0)}function s(a,b){f().sessions.get(a)?.listeners.delete(b)}},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=
|
|
6
|
+
`)}),b.set(o,r),l(o)}function n(a,b){let c=f().sessions.get(a);return!!c?.pty&&(c.pty.write(b),!0)}function o(a,b,c){let d=f().sessions.get(a);if(!d)return!1;d.cols=b,d.rows=c;try{d.pty?.resize(b,c)}catch{}return!0}function p(a){let b=f().sessions.get(a);if(!b)return!1;if(b.pty)try{b.pty.kill()}catch{}return!0}function q(a){let b=f().sessions.get(a);if(!b)return!1;for(let c of(p(a),b.listeners))c("");return b.listeners.clear(),f().sessions.delete(a)}function r(a,b){let c=f().sessions.get(a);return!!c&&(c.listeners.add(b),!0)}function s(a,b){f().sessions.get(a)?.listeners.delete(b)}},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=34187));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/terminal/[id]/events/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{},"edgeSSRModuleMapping":{},"clientModules":{},"entryCSSFiles":{"/
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/terminal/[id]/events/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{},"edgeSSRModuleMapping":{},"clientModules":{},"entryCSSFiles":{"/home/wa/project/pi-web-sky/app/api/terminal/[id]/events/route":[]},"rscModuleMapping":{},"edgeRscModuleMapping":{}};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{var a={};a.id=4524,a.ids=[4524],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},10847:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DELETE:()=>h,GET:()=>f,POST:()=>g,dynamic:()=>e});var d=c(73968);let e="force-dynamic";async function f(a,{params:b}){let{id:c}=await b,e=(0,d.$s)(c);return e?Response.json({terminal:e}):Response.json({error:"not found"},{status:404})}async function g(a,{params:b}){let{id:c}=await b,e=await a.json().catch(()=>null);return e?"input"===e.type&&"string"==typeof e.data?(0,d.OA)(c,e.data)?Response.json({ok:!0}):Response.json({error:"not found or exited"},{status:404}):"resize"===e.type&&"number"==typeof e.cols&&"number"==typeof e.rows?(0,d.Nu)(c,Math.max(2,Math.floor(e.cols)),Math.max(2,Math.floor(e.rows)))?Response.json({ok:!0}):Response.json({error:"not found"},{status:404}):Response.json({error:"unknown action"},{status:400}):Response.json({error:"invalid body"},{status:400})}async function h(a,{params:b}){let{id:c}=await b;return(0,d.BY)(c),(0,d.Zm)(c),Response.json({ok:!0})}},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},54763:a=>{"use strict";a.exports=require("@lydell/node-pty")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73968:(a,b,c)=>{"use strict";c.d(b,{$s:()=>l,BY:()=>p,Nu:()=>o,OA:()=>n,PB:()=>m,UM:()=>h,Y_:()=>k,Zm:()=>q,ch:()=>r,kC:()=>i,pQ:()=>s});var d=c(55511);let e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function f(){let a=globalThis;return a.__piTerminals||(a.__piTerminals={sessions:new Map}),a.__piTerminals}function g(a,b){if(a.buffer+=b,a.buffer.length>262144){let[b,c]=function(a){if(a.length<=262144)return[a,0];let b=a.length-262144,c=a.lastIndexOf("\n",b);return c>=0&&(b=c+1),[a.slice(b),b]}(a.buffer);a.buffer=b,a.baseOffset+=c}for(let c of a.listeners)c(b)}function h(a,b){let c=f().sessions.get(a);if(!c)return null;let d=c.baseOffset;return b<d?null:c.buffer.slice(Math.max(0,b-d))}function i(a){let b=f().sessions.get(a);return b?{data:b.buffer,startOffset:b.baseOffset}:null}function j(a){return{id:a.id,name:a.name,cwd:a.cwd,projectRoot:a.projectRoot,projectLabel:a.projectLabel,cols:a.cols,rows:a.rows,running:a.running,exitCode:a.exitCode,createdAt:a.createdAt}}function k(){return[...f().sessions.values()].map(j)}function l(a){let b=f().sessions.get(a);return b?j(b):void 0}async function m(a){let b=f().sessions;if(b.size>=12){let a=[...b.values()].filter(a=>!a.running).sort((a,b)=>a.createdAt-b.createdAt)[0];if(!a)throw Error("Terminal limit reached (12)");q(a.id)}let h=a.cols??80,i=a.rows??24,j="win32"===process.platform?"powershell.exe":process.env.SHELL||"bash",k="win32"===process.platform||process.env.SHELL?.endsWith("fish")?[]:["-l"],m=await Promise.resolve().then(c.t.bind(c,54763,23)),n=(m.default??m).spawn(j,k,{name:"xterm-256color",cwd:a.cwd,cols:h,rows:i,env:process.env}),o=(0,d.randomUUID)(),p=a.cwd.split(/[\\/]/).filter(Boolean).pop()||"term",r={id:o,name:`${p}-${function(){let a=(0,d.randomBytes)(4),b="";for(let c=0;c<4;c++)b+=e[a[c]%e.length];return b}()}`,cwd:a.cwd,projectRoot:a.projectRoot,projectLabel:a.projectLabel,cols:h,rows:i,running:!0,exitCode:null,createdAt:Date.now(),pty:n,buffer:"",baseOffset:0,listeners:new Set};return n.onData(a=>g(r,a)),n.onExit(({exitCode:a})=>{r.running=!1,r.exitCode=a,r.pty=null,g(r,`\r
|
|
1
|
+
(()=>{var a={};a.id=4524,a.ids=[4524],a.modules={237:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/terminal/[id]/route",pathname:"/api/terminal/[id]",filename:"route",bundlePath:"app/api/terminal/[id]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/wa/project/pi-web-sky/app/api/terminal/[id]/route.ts",nextConfigOutput:"",userland:()=>c(10847),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/terminal/[id]/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},10847:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DELETE:()=>h,GET:()=>f,POST:()=>g,dynamic:()=>e});var d=c(73968);let e="force-dynamic";async function f(a,{params:b}){let{id:c}=await b,e=(0,d.$s)(c);return e?Response.json({terminal:e}):Response.json({error:"not found"},{status:404})}async function g(a,{params:b}){let{id:c}=await b,e=await a.json().catch(()=>null);return e?"input"===e.type&&"string"==typeof e.data?(0,d.OA)(c,e.data)?Response.json({ok:!0}):Response.json({error:"not found or exited"},{status:404}):"resize"===e.type&&"number"==typeof e.cols&&"number"==typeof e.rows?(0,d.Nu)(c,Math.max(2,Math.floor(e.cols)),Math.max(2,Math.floor(e.rows)))?Response.json({ok:!0}):Response.json({error:"not found"},{status:404}):Response.json({error:"unknown action"},{status:400}):Response.json({error:"invalid body"},{status:400})}async function h(a,{params:b}){let{id:c}=await b;return(0,d.BY)(c),(0,d.Zm)(c),Response.json({ok:!0})}},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},54763:a=>{"use strict";a.exports=require("@lydell/node-pty")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73968:(a,b,c)=>{"use strict";c.d(b,{$s:()=>l,BY:()=>p,Nu:()=>o,OA:()=>n,PB:()=>m,UM:()=>h,Y_:()=>k,Zm:()=>q,ch:()=>r,kC:()=>i,pQ:()=>s});var d=c(55511);let e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function f(){let a=globalThis;return a.__piTerminals||(a.__piTerminals={sessions:new Map}),a.__piTerminals}function g(a,b){if(a.buffer+=b,a.buffer.length>262144){let[b,c]=function(a){if(a.length<=262144)return[a,0];let b=a.length-262144,c=a.lastIndexOf("\n",b);return c>=0&&(b=c+1),[a.slice(b),b]}(a.buffer);a.buffer=b,a.baseOffset+=c}for(let c of a.listeners)c(b)}function h(a,b){let c=f().sessions.get(a);if(!c)return null;let d=c.baseOffset;return b<d?null:c.buffer.slice(Math.max(0,b-d))}function i(a){let b=f().sessions.get(a);return b?{data:b.buffer,startOffset:b.baseOffset}:null}function j(a){return{id:a.id,name:a.name,cwd:a.cwd,projectRoot:a.projectRoot,projectLabel:a.projectLabel,cols:a.cols,rows:a.rows,running:a.running,exitCode:a.exitCode,createdAt:a.createdAt}}function k(){return[...f().sessions.values()].map(j)}function l(a){let b=f().sessions.get(a);return b?j(b):void 0}async function m(a){let b=f().sessions;if(b.size>=12){let a=[...b.values()].filter(a=>!a.running).sort((a,b)=>a.createdAt-b.createdAt)[0];if(!a)throw Error("Terminal limit reached (12)");q(a.id)}let h=a.cols??80,i=a.rows??24,j="win32"===process.platform?"powershell.exe":process.env.SHELL||"bash",k="win32"===process.platform||process.env.SHELL?.endsWith("fish")?[]:["-l"],m=await Promise.resolve().then(c.t.bind(c,54763,23)),n=(m.default??m).spawn(j,k,{name:"xterm-256color",cwd:a.cwd,cols:h,rows:i,env:process.env}),o=(0,d.randomUUID)(),p=a.cwd.split(/[\\/]/).filter(Boolean).pop()||"term",r={id:o,name:`${p}-${function(){let a=(0,d.randomBytes)(4),b="";for(let c=0;c<4;c++)b+=e[a[c]%e.length];return b}()}`,cwd:a.cwd,projectRoot:a.projectRoot,projectLabel:a.projectLabel,cols:h,rows:i,running:!0,exitCode:null,createdAt:Date.now(),pty:n,buffer:"",baseOffset:0,listeners:new Set};return n.onData(a=>g(r,a)),n.onExit(({exitCode:a})=>{r.running=!1,r.exitCode=a,r.pty=null,g(r,`\r
|
|
2
2
|
\x1b[2m[进程已退出,exit code ${a}]\x1b[0m\r
|
|
3
|
-
`)}),b.set(o,r),l(o)}function n(a,b){let c=f().sessions.get(a);return!!c?.pty&&(c.pty.write(b),!0)}function o(a,b,c){let d=f().sessions.get(a);if(!d)return!1;d.cols=b,d.rows=c;try{d.pty?.resize(b,c)}catch{}return!0}function p(a){let b=f().sessions.get(a);if(!b)return!1;if(b.pty)try{b.pty.kill()}catch{}return!0}function q(a){let b=f().sessions.get(a);if(!b)return!1;for(let c of(p(a),b.listeners))c("");return b.listeners.clear(),f().sessions.delete(a)}function r(a,b){let c=f().sessions.get(a);return!!c&&(c.listeners.add(b),!0)}function s(a,b){f().sessions.get(a)?.listeners.delete(b)}},78335:()=>{},
|
|
3
|
+
`)}),b.set(o,r),l(o)}function n(a,b){let c=f().sessions.get(a);return!!c?.pty&&(c.pty.write(b),!0)}function o(a,b,c){let d=f().sessions.get(a);if(!d)return!1;d.cols=b,d.rows=c;try{d.pty?.resize(b,c)}catch{}return!0}function p(a){let b=f().sessions.get(a);if(!b)return!1;if(b.pty)try{b.pty.kill()}catch{}return!0}function q(a){let b=f().sessions.get(a);if(!b)return!1;for(let c of(p(a),b.listeners))c("");return b.listeners.clear(),f().sessions.delete(a)}function r(a,b){let c=f().sessions.get(a);return!!c&&(c.listeners.add(b),!0)}function s(a,b){f().sessions.get(a)?.listeners.delete(b)}},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=237));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/terminal/[id]/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{},"edgeSSRModuleMapping":{},"clientModules":{},"entryCSSFiles":{"/
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/terminal/[id]/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{},"edgeSSRModuleMapping":{},"clientModules":{},"entryCSSFiles":{"/home/wa/project/pi-web-sky/app/api/terminal/[id]/route":[]},"rscModuleMapping":{},"edgeRscModuleMapping":{}};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{var a={};a.id=2614,a.ids=[2614],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},24923:(a,b,c)=>{"use strict";c.d(b,{IL:()=>t,KI:()=>n,P9:()=>p,l:()=>s,xw:()=>r});var d=c(79646),e=c(29021),f=c(33873),g=c(28354),h=c(25252),i=c(58864);let j=(0,g.promisify)(d.execFile);function k(){globalThis.__piProjectCache?.clear()}async function l(a,b){let{stdout:c}=await j("git",["-C",a,...b],{timeout:1e4,maxBuffer:1048576,env:{...process.env,LC_ALL:"C"}});return c.trim()}function m(a){try{return(0,e.realpathSync)(a)}catch{return a}}async function n(a){let b,c=(globalThis.__piProjectCache||(globalThis.__piProjectCache=new Map),globalThis.__piProjectCache),d=c.get(a);if(d&&d.expiresAt>Date.now())return d.info;try{if(!(0,e.existsSync)(a))return b=function(a){let b=(0,f.dirname)(a);if(!b.endsWith("-worktrees"))return null;let c=b.slice(0,-10);return c&&(0,e.existsSync)((0,f.join)(c,".git"))?{projectRoot:m(c),branch:(0,f.basename)(a),isWorktree:!0,isTopLevel:!0}:null}(a)??{projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1},c.set(a,{info:b,expiresAt:Date.now()+6e4}),b;let[d,g,h,j]=(await l(a,["rev-parse","--path-format=absolute","--git-common-dir","--git-dir","--show-toplevel","--abbrev-ref","HEAD"])).split("\n").map(a=>a.trim()),[k,n,o]=[d,g,h].map(i.gB),p=m(a),q=(0,i.Eb)(o,p),r=!(0,i.Eb)(n,k)&&q,s=r?(0,f.dirname)(k):o;b={projectRoot:q?m(s):a,branch:j&&"HEAD"!==j?j:null,isWorktree:r,isTopLevel:q}}catch{b={projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1}}return c.set(a,{info:b,expiresAt:Date.now()+6e4}),b}async function o(a){let b=await l(a,["rev-parse","--path-format=absolute","--git-common-dir"]);return m((0,f.dirname)((0,i.gB)(b)))}async function p(a){let b=await l(a,["worktree","list","--porcelain"]),c=[],d=null,f=()=>{d?.path&&!d.prunable&&(0,e.existsSync)(d.path)&&c.push({path:d.path,branch:d.branch??null,isMain:0===c.length}),d=null};for(let a of b.split("\n"))a.startsWith("worktree ")?(f(),d={path:(0,i.gB)(a.slice(9).trim())}):a.startsWith("branch ")&&d?d.branch=a.slice(7).trim().replace(/^refs\/heads\//,""):a.startsWith("prunable")&&d?d.prunable=!0:""===a.trim()&&f();return f(),c}function q(a,b){return a.find(a=>(0,i.Eb)(a.path,b))}function r(a,b){return q(a,m(b))?.path??null}async function s(a,b){let c=b.trim();if(!c)throw Error("Branch name is required");let d=c.replace(/[\/\\:*?"<>|\s]+/g,"-").replace(/^-+|-+$/g,"");if(!d)throw Error(`Invalid branch name: ${b}`);let g=await o(a),i=`${(0,f.resolve)(g)}-worktrees`,j=(0,f.join)(i,d);if((0,e.existsSync)(j))throw Error(`Directory already exists: ${j}`);(0,e.mkdirSync)(i,{recursive:!0});let m=!1;try{await l(g,["rev-parse","--verify","--quiet",`refs/heads/${c}`]),m=!0}catch{m=!1}try{m?await l(g,["worktree","add","--",j,c]):await l(g,["worktree","add","-b",c,"--",j])}catch(a){throw Error(u(a))}return(0,h.wz)(j),k(),{path:j,branch:c}}async function t(a,b,c=!1){let d=q(await p(a),b);if(!d)throw Error(`Not a worktree of this repository: ${b}`);if(d.isMain)throw Error("Cannot remove the main worktree");try{await l(a,["worktree","remove",...c?["--force"]:[],d.path])}catch(a){throw Error(u(a))}k()}function u(a){let b=a.stderr;return"string"==typeof b&&b.trim()?b.trim():a instanceof Error?a.message:String(a)}},25252:(a,b,c)=>{"use strict";c.d(b,{HM:()=>f,Nw:()=>e,wz:()=>g});var d=c(58864);function e(a){return(0,d.W3)(a)}function f(){return globalThis.__piAdditionalAllowedRoots||(globalThis.__piAdditionalAllowedRoots=new Set),globalThis.__piAdditionalAllowedRoots}function g(a){if(!a)return;let b=e(a);f().add(b),globalThis.__piAllowedRootsCache?.roots.add(b)}},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47709:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>g,POST:()=>h,dynamic:()=>f});var d=c(73968),e=c(24923);let f="force-dynamic";async function g(){return Response.json({terminals:(0,d.Y_)()})}async function h(a){let b=await a.json().catch(()=>null),c=b?.cwd;if(!c||"string"!=typeof c)return Response.json({error:"cwd is required"},{status:400});let f=null,g="~";try{let a=await (0,e.KI)(c);f=a.projectRoot;let b=a.projectRoot.split("/").pop()||a.projectRoot;g=a.isWorktree&&a.branch?`${b}\xb7${a.branch}`:b}catch{}try{let a=await (0,d.PB)({cwd:c,projectRoot:f,projectLabel:g,cols:b?.cols,rows:b?.rows});return Response.json({terminal:a})}catch(a){return Response.json({error:String(a instanceof Error?a.message:a)},{status:500})}}},54763:a=>{"use strict";a.exports=require("@lydell/node-pty")},55511:a=>{"use strict";a.exports=require("crypto")},58864:(a,b,c)=>{"use strict";c.d(b,{Eb:()=>j,W3:()=>h,gB:()=>g,uK:()=>f});var d=c(33873);let e=/^[a-zA-Z]:[\\/]/;function f(a){return e.test(a)||a.startsWith("\\\\")||a.startsWith("//")}function g(a){return a&&"win32"===process.platform?(0,d.normalize)(a):a}function h(a){return a.replace(/\\/g,"/")}function i(a){let b=(0,d.normalize)(g(a)),c=(0,d.parse)(b).root.length,e=b.length;for(;e>c&&b[e-1]===d.sep;)e--;return b.slice(0,e)}function j(a,b){if(a===b)return!0;if(!a||!b)return!1;let c=i(a),d=i(b);return"win32"===process.platform?c.toLowerCase()===d.toLowerCase():c===d}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73968:(a,b,c)=>{"use strict";c.d(b,{$s:()=>l,BY:()=>p,Nu:()=>o,OA:()=>n,PB:()=>m,UM:()=>h,Y_:()=>k,Zm:()=>q,ch:()=>r,kC:()=>i,pQ:()=>s});var d=c(55511);let e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function f(){let a=globalThis;return a.__piTerminals||(a.__piTerminals={sessions:new Map}),a.__piTerminals}function g(a,b){if(a.buffer+=b,a.buffer.length>262144){let[b,c]=function(a){if(a.length<=262144)return[a,0];let b=a.length-262144,c=a.lastIndexOf("\n",b);return c>=0&&(b=c+1),[a.slice(b),b]}(a.buffer);a.buffer=b,a.baseOffset+=c}for(let c of a.listeners)c(b)}function h(a,b){let c=f().sessions.get(a);if(!c)return null;let d=c.baseOffset;return b<d?null:c.buffer.slice(Math.max(0,b-d))}function i(a){let b=f().sessions.get(a);return b?{data:b.buffer,startOffset:b.baseOffset}:null}function j(a){return{id:a.id,name:a.name,cwd:a.cwd,projectRoot:a.projectRoot,projectLabel:a.projectLabel,cols:a.cols,rows:a.rows,running:a.running,exitCode:a.exitCode,createdAt:a.createdAt}}function k(){return[...f().sessions.values()].map(j)}function l(a){let b=f().sessions.get(a);return b?j(b):void 0}async function m(a){let b=f().sessions;if(b.size>=12){let a=[...b.values()].filter(a=>!a.running).sort((a,b)=>a.createdAt-b.createdAt)[0];if(!a)throw Error("Terminal limit reached (12)");q(a.id)}let h=a.cols??80,i=a.rows??24,j="win32"===process.platform?"powershell.exe":process.env.SHELL||"bash",k="win32"===process.platform||process.env.SHELL?.endsWith("fish")?[]:["-l"],m=await Promise.resolve().then(c.t.bind(c,54763,23)),n=(m.default??m).spawn(j,k,{name:"xterm-256color",cwd:a.cwd,cols:h,rows:i,env:process.env}),o=(0,d.randomUUID)(),p=a.cwd.split(/[\\/]/).filter(Boolean).pop()||"term",r={id:o,name:`${p}-${function(){let a=(0,d.randomBytes)(4),b="";for(let c=0;c<4;c++)b+=e[a[c]%e.length];return b}()}`,cwd:a.cwd,projectRoot:a.projectRoot,projectLabel:a.projectLabel,cols:h,rows:i,running:!0,exitCode:null,createdAt:Date.now(),pty:n,buffer:"",baseOffset:0,listeners:new Set};return n.onData(a=>g(r,a)),n.onExit(({exitCode:a})=>{r.running=!1,r.exitCode=a,r.pty=null,g(r,`\r
|
|
1
|
+
(()=>{var a={};a.id=2614,a.ids=[2614],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},16419:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/terminal/route",pathname:"/api/terminal",filename:"route",bundlePath:"app/api/terminal/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/wa/project/pi-web-sky/app/api/terminal/route.ts",nextConfigOutput:"",userland:()=>c(47709),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/terminal/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},24923:(a,b,c)=>{"use strict";c.d(b,{IL:()=>t,KI:()=>n,P9:()=>p,l:()=>s,xw:()=>r});var d=c(79646),e=c(29021),f=c(33873),g=c(28354),h=c(25252),i=c(58864);let j=(0,g.promisify)(d.execFile);function k(){globalThis.__piProjectCache?.clear()}async function l(a,b){let{stdout:c}=await j("git",["-C",a,...b],{timeout:1e4,maxBuffer:1048576,env:{...process.env,LC_ALL:"C"}});return c.trim()}function m(a){try{return(0,e.realpathSync)(a)}catch{return a}}async function n(a){let b,c=(globalThis.__piProjectCache||(globalThis.__piProjectCache=new Map),globalThis.__piProjectCache),d=c.get(a);if(d&&d.expiresAt>Date.now())return d.info;try{if(!(0,e.existsSync)(a))return b=function(a){let b=(0,f.dirname)(a);if(!b.endsWith("-worktrees"))return null;let c=b.slice(0,-10);return c&&(0,e.existsSync)((0,f.join)(c,".git"))?{projectRoot:m(c),branch:(0,f.basename)(a),isWorktree:!0,isTopLevel:!0}:null}(a)??{projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1},c.set(a,{info:b,expiresAt:Date.now()+6e4}),b;let[d,g,h,j]=(await l(a,["rev-parse","--path-format=absolute","--git-common-dir","--git-dir","--show-toplevel","--abbrev-ref","HEAD"])).split("\n").map(a=>a.trim()),[k,n,o]=[d,g,h].map(i.gB),p=m(a),q=(0,i.Eb)(o,p),r=!(0,i.Eb)(n,k)&&q,s=r?(0,f.dirname)(k):o;b={projectRoot:q?m(s):a,branch:j&&"HEAD"!==j?j:null,isWorktree:r,isTopLevel:q}}catch{b={projectRoot:a,branch:null,isWorktree:!1,isTopLevel:!1}}return c.set(a,{info:b,expiresAt:Date.now()+6e4}),b}async function o(a){let b=await l(a,["rev-parse","--path-format=absolute","--git-common-dir"]);return m((0,f.dirname)((0,i.gB)(b)))}async function p(a){let b=await l(a,["worktree","list","--porcelain"]),c=[],d=null,f=()=>{d?.path&&!d.prunable&&(0,e.existsSync)(d.path)&&c.push({path:d.path,branch:d.branch??null,isMain:0===c.length}),d=null};for(let a of b.split("\n"))a.startsWith("worktree ")?(f(),d={path:(0,i.gB)(a.slice(9).trim())}):a.startsWith("branch ")&&d?d.branch=a.slice(7).trim().replace(/^refs\/heads\//,""):a.startsWith("prunable")&&d?d.prunable=!0:""===a.trim()&&f();return f(),c}function q(a,b){return a.find(a=>(0,i.Eb)(a.path,b))}function r(a,b){return q(a,m(b))?.path??null}async function s(a,b){let c=b.trim();if(!c)throw Error("Branch name is required");let d=c.replace(/[\/\\:*?"<>|\s]+/g,"-").replace(/^-+|-+$/g,"");if(!d)throw Error(`Invalid branch name: ${b}`);let g=await o(a),i=`${(0,f.resolve)(g)}-worktrees`,j=(0,f.join)(i,d);if((0,e.existsSync)(j))throw Error(`Directory already exists: ${j}`);(0,e.mkdirSync)(i,{recursive:!0});let m=!1;try{await l(g,["rev-parse","--verify","--quiet",`refs/heads/${c}`]),m=!0}catch{m=!1}try{m?await l(g,["worktree","add","--",j,c]):await l(g,["worktree","add","-b",c,"--",j])}catch(a){throw Error(u(a))}return(0,h.wz)(j),k(),{path:j,branch:c}}async function t(a,b,c=!1){let d=q(await p(a),b);if(!d)throw Error(`Not a worktree of this repository: ${b}`);if(d.isMain)throw Error("Cannot remove the main worktree");try{await l(a,["worktree","remove",...c?["--force"]:[],d.path])}catch(a){throw Error(u(a))}k()}function u(a){let b=a.stderr;return"string"==typeof b&&b.trim()?b.trim():a instanceof Error?a.message:String(a)}},25252:(a,b,c)=>{"use strict";c.d(b,{HM:()=>f,Nw:()=>e,wz:()=>g});var d=c(58864);function e(a){return(0,d.W3)(a)}function f(){return globalThis.__piAdditionalAllowedRoots||(globalThis.__piAdditionalAllowedRoots=new Set),globalThis.__piAdditionalAllowedRoots}function g(a){if(!a)return;let b=e(a);f().add(b),globalThis.__piAllowedRootsCache?.roots.add(b)}},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47709:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>g,POST:()=>h,dynamic:()=>f});var d=c(73968),e=c(24923);let f="force-dynamic";async function g(){return Response.json({terminals:(0,d.Y_)()})}async function h(a){let b=await a.json().catch(()=>null),c=b?.cwd;if(!c||"string"!=typeof c)return Response.json({error:"cwd is required"},{status:400});let f=null,g="~";try{let a=await (0,e.KI)(c);f=a.projectRoot;let b=a.projectRoot.split("/").pop()||a.projectRoot;g=a.isWorktree&&a.branch?`${b}\xb7${a.branch}`:b}catch{}try{let a=await (0,d.PB)({cwd:c,projectRoot:f,projectLabel:g,cols:b?.cols,rows:b?.rows});return Response.json({terminal:a})}catch(a){return Response.json({error:String(a instanceof Error?a.message:a)},{status:500})}}},54763:a=>{"use strict";a.exports=require("@lydell/node-pty")},55511:a=>{"use strict";a.exports=require("crypto")},58864:(a,b,c)=>{"use strict";c.d(b,{Eb:()=>j,W3:()=>h,gB:()=>g,uK:()=>f});var d=c(33873);let e=/^[a-zA-Z]:[\\/]/;function f(a){return e.test(a)||a.startsWith("\\\\")||a.startsWith("//")}function g(a){return a&&"win32"===process.platform?(0,d.normalize)(a):a}function h(a){return a.replace(/\\/g,"/")}function i(a){let b=(0,d.normalize)(g(a)),c=(0,d.parse)(b).root.length,e=b.length;for(;e>c&&b[e-1]===d.sep;)e--;return b.slice(0,e)}function j(a,b){if(a===b)return!0;if(!a||!b)return!1;let c=i(a),d=i(b);return"win32"===process.platform?c.toLowerCase()===d.toLowerCase():c===d}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73968:(a,b,c)=>{"use strict";c.d(b,{$s:()=>l,BY:()=>p,Nu:()=>o,OA:()=>n,PB:()=>m,UM:()=>h,Y_:()=>k,Zm:()=>q,ch:()=>r,kC:()=>i,pQ:()=>s});var d=c(55511);let e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function f(){let a=globalThis;return a.__piTerminals||(a.__piTerminals={sessions:new Map}),a.__piTerminals}function g(a,b){if(a.buffer+=b,a.buffer.length>262144){let[b,c]=function(a){if(a.length<=262144)return[a,0];let b=a.length-262144,c=a.lastIndexOf("\n",b);return c>=0&&(b=c+1),[a.slice(b),b]}(a.buffer);a.buffer=b,a.baseOffset+=c}for(let c of a.listeners)c(b)}function h(a,b){let c=f().sessions.get(a);if(!c)return null;let d=c.baseOffset;return b<d?null:c.buffer.slice(Math.max(0,b-d))}function i(a){let b=f().sessions.get(a);return b?{data:b.buffer,startOffset:b.baseOffset}:null}function j(a){return{id:a.id,name:a.name,cwd:a.cwd,projectRoot:a.projectRoot,projectLabel:a.projectLabel,cols:a.cols,rows:a.rows,running:a.running,exitCode:a.exitCode,createdAt:a.createdAt}}function k(){return[...f().sessions.values()].map(j)}function l(a){let b=f().sessions.get(a);return b?j(b):void 0}async function m(a){let b=f().sessions;if(b.size>=12){let a=[...b.values()].filter(a=>!a.running).sort((a,b)=>a.createdAt-b.createdAt)[0];if(!a)throw Error("Terminal limit reached (12)");q(a.id)}let h=a.cols??80,i=a.rows??24,j="win32"===process.platform?"powershell.exe":process.env.SHELL||"bash",k="win32"===process.platform||process.env.SHELL?.endsWith("fish")?[]:["-l"],m=await Promise.resolve().then(c.t.bind(c,54763,23)),n=(m.default??m).spawn(j,k,{name:"xterm-256color",cwd:a.cwd,cols:h,rows:i,env:process.env}),o=(0,d.randomUUID)(),p=a.cwd.split(/[\\/]/).filter(Boolean).pop()||"term",r={id:o,name:`${p}-${function(){let a=(0,d.randomBytes)(4),b="";for(let c=0;c<4;c++)b+=e[a[c]%e.length];return b}()}`,cwd:a.cwd,projectRoot:a.projectRoot,projectLabel:a.projectLabel,cols:h,rows:i,running:!0,exitCode:null,createdAt:Date.now(),pty:n,buffer:"",baseOffset:0,listeners:new Set};return n.onData(a=>g(r,a)),n.onExit(({exitCode:a})=>{r.running=!1,r.exitCode=a,r.pty=null,g(r,`\r
|
|
2
2
|
\x1b[2m[进程已退出,exit code ${a}]\x1b[0m\r
|
|
3
|
-
`)}),b.set(o,r),l(o)}function n(a,b){let c=f().sessions.get(a);return!!c?.pty&&(c.pty.write(b),!0)}function o(a,b,c){let d=f().sessions.get(a);if(!d)return!1;d.cols=b,d.rows=c;try{d.pty?.resize(b,c)}catch{}return!0}function p(a){let b=f().sessions.get(a);if(!b)return!1;if(b.pty)try{b.pty.kill()}catch{}return!0}function q(a){let b=f().sessions.get(a);if(!b)return!1;for(let c of(p(a),b.listeners))c("");return b.listeners.clear(),f().sessions.delete(a)}function r(a,b){let c=f().sessions.get(a);return!!c&&(c.listeners.add(b),!0)}function s(a,b){f().sessions.get(a)?.listeners.delete(b)}},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}
|
|
3
|
+
`)}),b.set(o,r),l(o)}function n(a,b){let c=f().sessions.get(a);return!!c?.pty&&(c.pty.write(b),!0)}function o(a,b,c){let d=f().sessions.get(a);if(!d)return!1;d.cols=b,d.rows=c;try{d.pty?.resize(b,c)}catch{}return!0}function p(a){let b=f().sessions.get(a);if(!b)return!1;if(b.pty)try{b.pty.kill()}catch{}return!0}function q(a){let b=f().sessions.get(a);if(!b)return!1;for(let c of(p(a),b.listeners))c("");return b.listeners.clear(),f().sessions.delete(a)}function r(a,b){let c=f().sessions.get(a);return!!c&&(c.listeners.add(b),!0)}function s(a,b){f().sessions.get(a)?.listeners.delete(b)}},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=16419));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/terminal/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{},"edgeSSRModuleMapping":{},"clientModules":{},"entryCSSFiles":{"/
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/terminal/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{},"edgeSSRModuleMapping":{},"clientModules":{},"entryCSSFiles":{"/home/wa/project/pi-web-sky/app/api/terminal/route":[]},"rscModuleMapping":{},"edgeRscModuleMapping":{}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var a={};a.id=4016,a.ids=[4016],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},42819:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>n,GET:()=>l,POST:()=>m});var e=c(23211),f=c(29021),g=c(24923),h=c(80547),i=c(74244),j=a([h]);async function k(a){let b=await (0,h.mc)();return(0,h.A$)(a,b)&&(0,h.B7)(a,b)?null:e.NextResponse.json({error:"Access denied"},{status:403})}async function l(a){try{let b=new URL(a.url).searchParams.get("cwd");if(!b)return e.NextResponse.json({error:"cwd is required"},{status:400});let c=await k(b);if(c)return c;let d=await (0,g.KI)(b),j=[],l=null,m=!0;try{j=await (0,g.P9)((0,f.existsSync)(b)?b:d.projectRoot),l=(0,g.xw)(j,b)}catch{m=!1}for(let a of j)(0,h.wz)(a.path);return e.NextResponse.json({projectRoot:d.projectRoot,projectKey:(0,i.z)(d.projectRoot),isGit:m,isTopLevel:d.isTopLevel,currentWorktreePath:l,worktrees:j})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function m(a){try{let b=await a.json();if(!b.cwd||"string"!=typeof b.cwd)return e.NextResponse.json({error:"cwd is required"},{status:400});if(!b.branch||"string"!=typeof b.branch)return e.NextResponse.json({error:"branch is required"},{status:400});let c=await k(b.cwd);if(c)return c;if(!(0,f.existsSync)(b.cwd))return e.NextResponse.json({error:`Directory does not exist: ${b.cwd}`},{status:400});let d=await (0,g.l)(b.cwd,b.branch);return e.NextResponse.json(d)}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:400})}}async function n(a){try{let b=await a.json();if(!b.cwd||"string"!=typeof b.cwd)return e.NextResponse.json({error:"cwd is required"},{status:400});if(!b.path||"string"!=typeof b.path)return e.NextResponse.json({error:"path is required"},{status:400});let c=await k(b.cwd);if(c)return c;return await (0,g.IL)(b.cwd,b.path,!0===b.force),e.NextResponse.json({success:!0})}catch(c){let a=c instanceof Error?c.message:String(c),b=/contains modified or untracked files|is dirty/i.test(a);return e.NextResponse.json({error:a,dirty:b},{status:b?409:400})}}h=(j.then?(await j)():j)[0],d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},49267:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/worktrees/route",pathname:"/api/worktrees",filename:"route",bundlePath:"app/api/worktrees/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/baique/work/develop/project/pi-web-sky/app/api/worktrees/route.ts",nextConfigOutput:"",userland:()=>c(42819),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/worktrees/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66737:(a,b,c)=>{"use strict";c.d(b,{Lf:()=>g});var d=c(79868),e=c(21820),f=c(33873);function g(){if(globalThis.__piWebDb)return globalThis.__piWebDb;let a=new d.DatabaseSync((0,f.join)(function(){let a=process.env.PI_CODING_AGENT_DIR;if(a){let b=a.startsWith("~")?(0,f.join)((0,e.homedir)(),a.slice(1)):a;return(0,f.normalize)(b)}return(0,f.join)((0,e.homedir)(),".pi","agent")}(),"pi-web.db"));return a.exec("PRAGMA journal_mode = WAL;"),a.exec("PRAGMA foreign_keys = ON;"),function(a){for(let b of(a.exec(`
|
|
1
|
+
(()=>{var a={};a.id=4016,a.ids=[4016],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20753:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>z,patchFetch:()=>y,routeModule:()=>u,serverHooks:()=>x,workAsyncStorage:()=>v,workUnitAsyncStorage:()=>w});var d=c(19225),e=c(84006),f=c(8317),g=c(99373),h=c(34775),i=c(24235),j=c(261),k=c(54365),l=c(90771),m=c(73461),n=c(67798),o=c(92280),p=c(62018),q=c(45696),r=c(47929),s=c(86439),t=c(37527);let u=new d.AppRouteRouteModule({definition:{kind:e.RouteKind.APP_ROUTE,page:"/api/worktrees/route",pathname:"/api/worktrees",filename:"route",bundlePath:"app/api/worktrees/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/wa/project/pi-web-sky/app/api/worktrees/route.ts",nextConfigOutput:"",userland:()=>c(42819),...{}}),{workAsyncStorage:v,workUnitAsyncStorage:w,serverHooks:x}=u;function y(){return(0,f.patchFetch)({workAsyncStorage:v,workUnitAsyncStorage:w})}async function z(a,b,c){c.requestMeta&&(0,g.setRequestMeta)(a,c.requestMeta),u.isDev&&(0,g.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/worktrees/route";"/index"===d&&(d="/");let f=await u.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!f)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:v,deploymentId:w,params:x,nextConfig:y,parsedUrl:z,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=f,I=(0,j.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,z,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(y.adapterPath)return await K();throw new s.NoFallbackError}}let L=null;!J||u.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===u.isDev||!J,N=J&&!M;H&&G&&(0,i.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,h.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,g.getRequestMeta)(a,"minimalMode"),T=(0,g.getRequestMeta)(a,"incrementalCache")||await u.getIncrementalCache(a,y,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:x,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:T,hmrRefreshHash:(0,g.getRequestMeta)(a,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>u.onRequestError(a,b,d,e,C)},sharedContext:{buildId:v,deploymentId:w}},V=new k.NodeNextRequest(a),W=new k.NodeNextResponse(b),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(b)),Y=async({previousCacheEntry:e})=>{try{if(!S&&D&&E&&!e)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await u.handle(X,U);a.fetchMetrics=U.renderOpts.fetchMetrics;let f=U.renderOpts.pendingWaitUntil;f&&c.waitUntil&&(c.waitUntil(f),f=void 0);let g=U.renderOpts.collectedTags;if(!J)return await (0,o.I)(V,W,d,f),null;{let a=await d.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(d.headers);g&&(b[r.NEXT_CACHE_TAGS_HEADER]=g),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=r.INFINITE_CACHE?!1!==c&&c>0?y.expireTime:void 0:U.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==e?void 0:e.isStale)&&await u.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},Z=async(d,f)=>{try{var g,i;let d=await u.handleResponse({req:a,nextConfig:y,cacheKey:L,routeKind:e.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:Y,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return;if((null==d||null==(g=d.value)?void 0:g.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(i=d.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,p.fromNodeOutgoingHttpHeaders)(d.value.headers);S&&J||f.delete(r.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||b.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,q.getCacheControlHeader)(d.cacheControl)),await (0,o.I)(V,W,new Response(d.value.body,{headers:f,status:d.value.status||200}));return}catch(b){if(b instanceof s.NoFallbackError||await u.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,n.getRevalidateReason)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;await (0,o.I)(V,W,new Response(null,{status:500}));return}finally{(()=>{if(!d)return;let a=b.statusCode;d.setAttributes({"http.status_code":a,"next.rsc":!1}),a&&a>=500&&(d.setStatus({code:h.SpanStatusCode.ERROR}),d.setAttribute("error.type",a.toString()));let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==m.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=c.get("next.route")||I,g=`${O} ${e}`;d.setAttributes({"next.route":e,"http.route":e,"next.span_name":g}),d.updateName(g),f&&f!==d&&(f.setAttribute("http.route",e),f.updateName(g))})()}};if(R&&Q)await Z(Q,void 0);else{let b=P.getActiveScopeSpan();await P.withPropagatedContext(a.headers,()=>P.trace(m.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:h.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},a=>Z(a,b)),void 0,!R)}}},21820:a=>{"use strict";a.exports=require("os")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},42819:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>n,GET:()=>l,POST:()=>m});var e=c(23211),f=c(29021),g=c(24923),h=c(80547),i=c(74244),j=a([h]);async function k(a){let b=await (0,h.mc)();return(0,h.A$)(a,b)&&(0,h.B7)(a,b)?null:e.NextResponse.json({error:"Access denied"},{status:403})}async function l(a){try{let b=new URL(a.url).searchParams.get("cwd");if(!b)return e.NextResponse.json({error:"cwd is required"},{status:400});let c=await k(b);if(c)return c;let d=await (0,g.KI)(b),j=[],l=null,m=!0;try{j=await (0,g.P9)((0,f.existsSync)(b)?b:d.projectRoot),l=(0,g.xw)(j,b)}catch{m=!1}for(let a of j)(0,h.wz)(a.path);return e.NextResponse.json({projectRoot:d.projectRoot,projectKey:(0,i.z)(d.projectRoot),isGit:m,isTopLevel:d.isTopLevel,currentWorktreePath:l,worktrees:j})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function m(a){try{let b=await a.json();if(!b.cwd||"string"!=typeof b.cwd)return e.NextResponse.json({error:"cwd is required"},{status:400});if(!b.branch||"string"!=typeof b.branch)return e.NextResponse.json({error:"branch is required"},{status:400});let c=await k(b.cwd);if(c)return c;if(!(0,f.existsSync)(b.cwd))return e.NextResponse.json({error:`Directory does not exist: ${b.cwd}`},{status:400});let d=await (0,g.l)(b.cwd,b.branch);return e.NextResponse.json(d)}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:400})}}async function n(a){try{let b=await a.json();if(!b.cwd||"string"!=typeof b.cwd)return e.NextResponse.json({error:"cwd is required"},{status:400});if(!b.path||"string"!=typeof b.path)return e.NextResponse.json({error:"path is required"},{status:400});let c=await k(b.cwd);if(c)return c;return await (0,g.IL)(b.cwd,b.path,!0===b.force),e.NextResponse.json({success:!0})}catch(c){let a=c instanceof Error?c.message:String(c),b=/contains modified or untracked files|is dirty/i.test(a);return e.NextResponse.json({error:a,dirty:b},{status:b?409:400})}}h=(j.then?(await j)():j)[0],d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66737:(a,b,c)=>{"use strict";c.d(b,{Lf:()=>g});var d=c(80099),e=c(21820),f=c(33873);function g(){if(globalThis.__piWebDb)return globalThis.__piWebDb;let a=new d.DatabaseSync((0,f.join)(function(){let a=process.env.PI_CODING_AGENT_DIR;if(a){let b=a.startsWith("~")?(0,f.join)((0,e.homedir)(),a.slice(1)):a;return(0,f.normalize)(b)}return(0,f.join)((0,e.homedir)(),".pi","agent")}(),"pi-web.db"));return a.exec("PRAGMA journal_mode = WAL;"),a.exec("PRAGMA foreign_keys = ON;"),function(a){for(let b of(a.exec(`
|
|
2
2
|
CREATE TABLE IF NOT EXISTS tasks (
|
|
3
3
|
id TEXT PRIMARY KEY,
|
|
4
4
|
project_key TEXT NOT NULL,
|
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
body,
|
|
28
28
|
tokenize = 'trigram'
|
|
29
29
|
);
|
|
30
|
-
`),["ALTER TABLE tasks ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;","ALTER TABLE session_meta ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;"]))try{a.exec(b)}catch{}}(a),globalThis.__piWebDb=a,a}},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},
|
|
30
|
+
`),["ALTER TABLE tasks ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;","ALTER TABLE session_meta ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;"]))try{a.exec(b)}catch{}}(a),globalThis.__piWebDb=a,a}},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},80099:a=>{"use strict";a.exports=require("node:sqlite")},80547:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>o,B7:()=>p,Nw:()=>i.Nw,mc:()=>n,uK:()=>l.uK,wz:()=>i.wz});var e=c(29021),f=c(21820),g=c(33873),h=c.n(g),i=c(25252),j=c(82536),k=c(40402),l=c(58864),m=a([k]);async function n(){let a=Date.now(),b=globalThis.__piAllowedRootsCache;if(b&&b.expiresAt>a)return b.roots;let c=await (0,k.listAllSessions)(),d=new Set;for(let a of c)a.cwd&&d.add((0,i.Nw)(a.cwd)),a.projectRoot&&d.add((0,i.Nw)(a.projectRoot));try{for(let a of(0,e.readdirSync)((0,f.homedir)()))/^pi-cwd-\d{8}$/.test(a)&&d.add((0,i.Nw)(h().join((0,f.homedir)(),a)))}catch{}for(let a of(0,i.HM)())d.add(a);return globalThis.__piAllowedRootsCache={roots:d,expiresAt:a+5e3},d}function o(a,b){return(0,j.o)(a,b)}function p(a,b){return(0,j.x)(a,b)}k=(m.then?(await m)():m)[0],d()}catch(a){d(a)}})},82536:(a,b,c)=>{"use strict";c.d(b,{o:()=>h,x:()=>i});var d=c(29021),e=c(33873),f=c.n(e),g=c(58864);function h(a,b){for(let c of b){let b=(0,g.uK)(a)||(0,g.uK)(c),d=b?f().win32:f(),e=b?"\\":f().sep,h=d.resolve(a),i=d.resolve(c),j=b?h.toLowerCase():h,k=b?i.toLowerCase():i,l=k.endsWith(e)?k:k+e;if(j===k||j.startsWith(l))return!0}return!1}function i(a,b){let c;try{c=(0,d.realpathSync)(a)}catch{return!1}let e=new Set;for(let a of b)try{e.add((0,d.realpathSync)(a))}catch{}return h(c,e)}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,402],()=>b(b.s=20753));module.exports=c})();
|