@calmabacus/pi-web 1.1.7 → 1.1.8
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 +10 -10
- package/.next/build-manifest.json +2 -2
- package/.next/required-server-files.js +1 -1
- package/.next/required-server-files.json +1 -1
- 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_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/app-update/route.js +1 -1
- package/.next/server/app/api/terminal/[id]/events/route.js +1 -1
- package/.next/server/app/api/terminal/[id]/route.js +1 -1
- package/.next/server/app/api/terminal/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +4 -4
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +3 -3
- package/.next/server/app/login.segments/_full.segment.rsc +3 -3
- package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +10 -10
- package/.next/server/chunks/2243.js +1 -1
- package/.next/server/chunks/3968.js +1 -1
- package/.next/server/chunks/8759.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/static/chunks/1278-5262898cb83459a6.js +1 -0
- package/.next/static/chunks/app/{layout-58b4b00014682160.js → layout-f0135b79d316ca92.js} +1 -1
- package/.next/static/chunks/app/{page-2e5e81259171c08e.js → page-8362a772c48a922e.js} +7 -7
- package/.next/trace +8 -41
- package/.next/trace-build +1 -1
- package/package.json +1 -1
- package/.next/static/chunks/1278-3bbb66253b640b0d.js +0 -1
- /package/.next/static/{tVgAwm8yyQDFPqwIaK7ru → CdvU6b-rJGcGFFwmQZ7QG}/_buildManifest.js +0 -0
- /package/.next/static/{tVgAwm8yyQDFPqwIaK7ru → CdvU6b-rJGcGFFwmQZ7QG}/_ssgManifest.js +0 -0
|
@@ -12,8 +12,8 @@ c:I[74581,[],""]
|
|
|
12
12
|
6:X
|
|
13
13
|
e:X
|
|
14
14
|
e:C
|
|
15
|
-
0:{"buildId":"
|
|
16
|
-
14:I[57788,["7177","static/chunks/app/layout-
|
|
15
|
+
0:{"buildId":"CdvU6b-rJGcGFFwmQZ7QG","data":[{"rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"isPartial":"$@5","staleTime":"$6","varyParams":null},{"rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L7",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"}],["$","meta","2",{"name":"theme-color","content":"#f5f5f5"}]]}],["$","div",null,{"hidden":true,"children":["$","$L8",null,{"children":["$","$3",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Pi Web"}],["$","meta","1",{"name":"description","content":"Pi Web interface for the pi coding agent"}],["$","meta","2",{"name":"application-name","content":"Pi Web"}],["$","link","3",{"rel":"manifest","href":"/manifest.webmanifest"}],["$","meta","4",{"name":"format-detection","content":"telephone=no"}],["$","meta","5",{"name":"mobile-web-app-capable","content":"yes"}],["$","meta","6",{"name":"apple-mobile-web-app-title","content":"Pi Web"}],["$","meta","7",{"name":"apple-mobile-web-app-status-bar-style","content":"black-translucent"}],["$","link","8",{"rel":"icon","href":"/favicon.svg?v=b1e5fdfb","type":"image/svg+xml"}],["$","link","9",{"rel":"icon","href":"/icons/icon-192.png?v=b1e5fdfb","sizes":"192x192","type":"image/png"}],["$","link","10",{"rel":"icon","href":"/favicon.ico?v=b1e5fdfb","sizes":"any"}],["$","link","11",{"rel":"apple-touch-icon","href":"/icons/apple-touch-icon.png?v=b1e5fdfb","sizes":"180x180","type":"image/png"}],["$","$L9","12",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"isPartial":"$@a","staleTime":"$6","varyParams":null},{"rsc":["$","$1","c",{"children":[null,["$","$Lb",null,{"parallelRouterKey":"children","template":["$","$Lc",null,{}]}]]}],"isPartial":"$@d","staleTime":"$6","varyParams":"$e"},{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/88714c00e109ce28.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/c32eeb8d335fb2e0.css","precedence":"next"}],["$","link","2",{"rel":"stylesheet","href":"/_next/static/css/cd8a7008e750a223.css","precedence":"next"}]],["$","html",null,{"lang":"en","translate":"no","className":"__variable_66b8ca notranslate","suppressHydrationWarning":true,"children":[["$","head",null,{"children":[["$","meta",null,{"name":"google","content":"notranslate"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"(function(){try{if(localStorage.getItem(\"pi-web-sarasa-enabled\")===\"1\")document.documentElement.classList.add(\"sarasa-term-webfont\");var t=localStorage.getItem(\"pi-theme\");var dark=t===\"dark\"||((t==null||t===\"\"||t===\"auto\")&&window.matchMedia(\"(prefers-color-scheme: dark)\").matches);if(dark)document.documentElement.classList.add(\"dark\");var c=dark?\"#242424\":\"#f5f5f5\";var ms=document.querySelectorAll('meta[name=\"theme-color\"]');if(ms.length===0){var m=document.createElement(\"meta\");m.name=\"theme-color\";m.content=c;document.head.appendChild(m)}else{for(var i=0;i<ms.length;i++){ms[i].removeAttribute(\"media\");ms[i].content=c}}}catch(e){}})();"}}]]}],["$","body",null,{"translate":"no","className":"notranslate","suppressHydrationWarning":true,"children":["$Lf","$L10"]}]]}]]}],"isPartial":"$@11","staleTime":"$6","varyParams":null}],"isUpgradeableISRFallback":false,"a":"$@12","rootVaryParams":null,"needsRuntimeRequest":"$@13"}
|
|
16
|
+
14:I[57788,["7177","static/chunks/app/layout-f0135b79d316ca92.js"],"PwaRegistration"]
|
|
17
17
|
4:null
|
|
18
18
|
f:["$","$Lb",null,{"parallelRouterKey":"children","template":["$","$Lc",null,{}]}]
|
|
19
19
|
10:["$","$L14",null,{}]
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
:HL["/_next/static/css/88714c00e109ce28.css","style"]
|
|
4
4
|
:HL["/_next/static/css/c32eeb8d335fb2e0.css","style"]
|
|
5
5
|
:HL["/_next/static/css/cd8a7008e750a223.css","style"]
|
|
6
|
-
0:{"tree":{"name":"","param":null,"prefetchHints":4176,"slots":{"children":{"name":"_not-found","param":null,"prefetchHints":4192,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":4256,"slots":null}}}}},"staleTime":300,"buildId":"
|
|
6
|
+
0:{"tree":{"name":"","param":null,"prefetchHints":4176,"slots":{"children":{"name":"_not-found","param":null,"prefetchHints":4192,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":4256,"slots":null}}}}},"staleTime":300,"buildId":"CdvU6b-rJGcGFFwmQZ7QG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=9183,a.ids=[9183],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{"use strict";a.exports=require("url")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},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")},12412:a=>{"use strict";a.exports=require("assert")},14566:a=>{"use strict";a.exports=require("node-pty")},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")},25076:(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/app-update/route",pathname:"/api/app-update",filename:"route",bundlePath:"app/api/app-update/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/zhujunshen/pi-web/app/api/app-update/route.ts",nextConfigOutput:"",userland:()=>c(62445),...{}}),{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/app-update/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)}}},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},28802:a=>{"use strict";a.exports=import("@earendil-works/pi-ai")},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")},29862:a=>{"use strict";a.exports=import("@earendil-works/pi-tui")},31421:a=>{"use strict";a.exports=require("node:child_process")},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")},48161:a=>{"use strict";a.exports=require("node:os")},51181:a=>{"use strict";a.exports=require("web-push")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},57975:a=>{"use strict";a.exports=require("node:util")},62445:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>o,POST:()=>p,dynamic:()=>g});var d=c(23211),e=c(43618);function f(a){return(0,e.valid)(a)===a&&null===(0,e.prerelease)(a)}let g="force-dynamic",h="1.1.7",i="1"===process.env.PI_WEB_SKIP_VERSION_CHECK,j="1"===process.env.PI_WEB_CAN_UPDATE&&"function"==typeof process.send,k={readonly:"sudo npm install -g @calmabacus/pi-web@latest"};function l(a){let b=k[process.env.PI_WEB_UPDATE_BLOCKED??""];return d.NextResponse.json({...a,canUpdate:j,...b?{manualCommand:b}:{}},{headers:{"Cache-Control":"no-store"}})}async function m(){let a=await fetch("https://registry.npmjs.org/@calmabacus%2Fpi-web/latest",{cache:"no-store",headers:{Accept:"application/json"},signal:AbortSignal.timeout(5e3)});if(!a.ok)throw Error(`npm registry returned HTTP ${a.status}`);let b=await a.json(),c="string"==typeof b.version?b.version:"",d=f(c)?`https://github.com/zhudatou630/pi-web/releases/tag/v${c}`:null;if(!d)throw Error("npm registry returned an invalid version");return{currentVersion:h,latestVersion:c,updateAvailable:f(c)&&f(h)&&(0,e.gt)(c,h),releaseUrl:d}}async function n(){let a=globalThis.__piWebAppUpdateCache??={expiresAt:0};if(a.value&&a.expiresAt>Date.now())return a.value;a.inFlight||(a.inFlight=m().then(b=>(a.value=b,a.expiresAt=Date.now()+432e5,b)).finally(()=>{a.inFlight=void 0}));try{return await a.inFlight}catch(b){if(a.value)return a.value;throw b}}async function o(a){if(i||"1"===new URL(a.url).searchParams.get("status"))return l({currentVersion:h,latestVersion:h,updateAvailable:!1,releaseUrl:""});try{return l(await n())}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:502})}}async function p(){if(!j||!process.connected)return d.NextResponse.json({error:"Use a writable npm global installation started with pi-web to update here."},{status:409});let[{hasAppUpdateBlockingSessions:a},{hasAppUpdateBlockingTerminals:b}]=await Promise.all([Promise.all([c.e(426),c.e(974),c.e(402),c.e(6759),c.e(2243),c.e(6429)]).then(c.bind(c,56429)),c.e(3968).then(c.bind(c,73968))]);return globalThis.__piWebUpdating?d.NextResponse.json({error:"Pi Web is already updating."},{status:409}):a()||b()?d.NextResponse.json({error:"Finish running Agent tasks and close terminal sessions before updating."},{status:409}):(globalThis.__piWebUpdating=!0,(0,d.after)(()=>{process.send({type:"pi-web:update"},a=>{a&&(globalThis.__piWebUpdating=!1,console.error("[pi-web] Could not request update:",a))})}),d.NextResponse.json({updating:!0},{status:202}))}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},72322:a=>{"use strict";a.exports=import("@earendil-works/pi-ai/utils/pi-user-agent")},73024:a=>{"use strict";a.exports=require("node:fs")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},80481:a=>{"use strict";a.exports=require("node:readline")},81115:a=>{"use strict";a.exports=require("constants")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,3618],()=>b(b.s=25076));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=9183,a.ids=[9183],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{"use strict";a.exports=require("url")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},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")},12412:a=>{"use strict";a.exports=require("assert")},14566:a=>{"use strict";a.exports=require("node-pty")},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")},25076:(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/app-update/route",pathname:"/api/app-update",filename:"route",bundlePath:"app/api/app-update/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/zhujunshen/pi-web/app/api/app-update/route.ts",nextConfigOutput:"",userland:()=>c(62445),...{}}),{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/app-update/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)}}},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},28802:a=>{"use strict";a.exports=import("@earendil-works/pi-ai")},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")},29862:a=>{"use strict";a.exports=import("@earendil-works/pi-tui")},31421:a=>{"use strict";a.exports=require("node:child_process")},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")},48161:a=>{"use strict";a.exports=require("node:os")},51181:a=>{"use strict";a.exports=require("web-push")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},57975:a=>{"use strict";a.exports=require("node:util")},62445:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>o,POST:()=>p,dynamic:()=>g});var d=c(23211),e=c(43618);function f(a){return(0,e.valid)(a)===a&&null===(0,e.prerelease)(a)}let g="force-dynamic",h="1.1.8",i="1"===process.env.PI_WEB_SKIP_VERSION_CHECK,j="1"===process.env.PI_WEB_CAN_UPDATE&&"function"==typeof process.send,k={readonly:"sudo npm install -g @calmabacus/pi-web@latest"};function l(a){let b=k[process.env.PI_WEB_UPDATE_BLOCKED??""];return d.NextResponse.json({...a,canUpdate:j,...b?{manualCommand:b}:{}},{headers:{"Cache-Control":"no-store"}})}async function m(){let a=await fetch("https://registry.npmjs.org/@calmabacus%2Fpi-web/latest",{cache:"no-store",headers:{Accept:"application/json"},signal:AbortSignal.timeout(5e3)});if(!a.ok)throw Error(`npm registry returned HTTP ${a.status}`);let b=await a.json(),c="string"==typeof b.version?b.version:"",d=f(c)?`https://github.com/zhudatou630/pi-web/releases/tag/v${c}`:null;if(!d)throw Error("npm registry returned an invalid version");return{currentVersion:h,latestVersion:c,updateAvailable:f(c)&&f(h)&&(0,e.gt)(c,h),releaseUrl:d}}async function n(a){let b=globalThis.__piWebAppUpdateCache??={expiresAt:0};if(!a&&b.value&&b.expiresAt>Date.now())return b.value;b.inFlight||(b.inFlight=m().then(a=>(b.value=a,b.expiresAt=Date.now()+18e5,a)).finally(()=>{b.inFlight=void 0}));try{return await b.inFlight}catch(c){if(!a&&b.value)return b.value;throw c}}async function o(a){let b=new URL(a.url).searchParams;if(i||"1"===b.get("status"))return l({currentVersion:h,latestVersion:h,updateAvailable:!1,releaseUrl:""});try{return l(await n("1"===b.get("force")))}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:502})}}async function p(){if(!j||!process.connected)return d.NextResponse.json({error:"Use a writable npm global installation started with pi-web to update here."},{status:409});let[{hasAppUpdateBlockingSessions:a},{hasAppUpdateBlockingTerminals:b}]=await Promise.all([Promise.all([c.e(426),c.e(974),c.e(402),c.e(6759),c.e(2243),c.e(6429)]).then(c.bind(c,56429)),c.e(3968).then(c.bind(c,73968))]);return globalThis.__piWebUpdating?d.NextResponse.json({error:"Pi Web is already updating."},{status:409}):a()||b()?d.NextResponse.json({error:"Finish running Agent tasks and close terminal sessions before updating."},{status:409}):(globalThis.__piWebUpdating=!0,(0,d.after)(()=>{process.send({type:"pi-web:update"},a=>{a&&(globalThis.__piWebUpdating=!1,console.error("[pi-web] Could not request update:",a))})}),d.NextResponse.json({updating:!0},{status:202}))}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},72322:a=>{"use strict";a.exports=import("@earendil-works/pi-ai/utils/pi-user-agent")},73024:a=>{"use strict";a.exports=require("node:fs")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},80481:a=>{"use strict";a.exports=require("node:readline")},81115:a=>{"use strict";a.exports=require("constants")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{"use strict";a.exports=require("events")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,3618],()=>b(b.s=25076));module.exports=c})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
(()=>{var a={};a.id=6252,a.ids=[3968,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")},14566:a=>{"use strict";a.exports=require("node-pty")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},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")},49907:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>g,dynamic:()=>e,runtime:()=>f});var d=c(73968);let e="force-dynamic",f="nodejs";async function g(a,{params:b}){let{id:c}=await b;if(!(0,d.hasTerminal)(c))return new Response("Terminal not found",{status:404});let e=a.headers.get("last-event-id")??new URL(a.url).searchParams.get("after"),f=null!==e&&/^\d+$/.test(e)&&Number.isSafeInteger(Number(e))?Number(e):void 0,h=()=>{};return new Response(new ReadableStream({start(b){let e=new TextEncoder,g=!1,i=null,j=null,k=c=>{if(!g&&(g=!0,i&&clearInterval(i),j?.(),a.signal.removeEventListener("abort",l),c))try{b.close()}catch{}},l=()=>k(!0),m=a=>{if(!g)try{if((b.desiredSize??0)<=0)return void k(!0);let c="output"===a.type?`id: ${a.offset}
|
|
2
2
|
`:"";b.enqueue(e.encode(`${c}data: ${JSON.stringify(a)}
|
|
3
3
|
|
|
4
|
-
`)),("exit"===a.type||"closed"===a.type)&&k(!0)}catch{k(!1)}};h=k;let n=(0,d.subscribeTerminal)(c,m,f);if(!n)return void k(!0);if(j=n.unsubscribe,b.enqueue(e.encode(":\n\n")),m(n.output),n.exited&&m({type:"exit",exitCode:n.exitCode??0}),!g){if(a.signal.addEventListener("abort",l,{once:!0}),a.signal.aborted)return void l();i=setInterval(()=>{try{(b.desiredSize??0)<=0?k(!0):g||b.enqueue(e.encode(":\n\n"))}catch{k(!1)}},3e4)}},cancel(){h(!1)}},{highWaterMark:262144,size:a=>a.byteLength}),{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}})}},55511:a=>{"use strict";a.exports=require("crypto")},58864:(a,b,c)=>{"use strict";c.d(b,{A_:()=>g,Eb:()=>k,W3:()=>i,gB:()=>h,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){let b=a.join("/"),c=i(b);return/^[a-zA-Z]:$/.test(c)?`${c}/`:f(c)?c:"/"+b.replace(/^\/+/,"")}function h(a){return a&&"win32"===process.platform?(0,d.normalize)(a):a}function i(a){return a.replace(/\\/g,"/")}function j(a){let b=(0,d.normalize)(h(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 k(a,b){if(a===b)return!0;if(!a||!b)return!1;let c=j(a),d=j(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")},65034:(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/zhujunshen/pi-web/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)}}},73968:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TERMINAL_RECONNECT_MS:()=>h,createTerminal:()=>n,getTerminalCwd:()=>p,hasAppUpdateBlockingTerminals:()=>m,hasTerminal:()=>o,killTerminal:()=>t,resizeTerminal:()=>s,subscribeTerminal:()=>q,writeTerminal:()=>r});var d=c(98469),e=c(55511),f=c(21820),g=c(58864);let h=12e4;function i(){if(!globalThis.__piWebTerminals){globalThis.__piWebTerminals=new Map;let a=()=>{for(let a of globalThis.__piWebTerminals.keys())t(a,!0)};process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__piWebTerminals}function j(a,b){for(let c of a.listeners)c(b)}function k(a,b){b.cleanupTimer||b.listeners.size||i().get(a)!==b||(b.cleanupTimer=setTimeout(()=>t(a),h),b.cleanupTimer.unref?.())}function l(a,b){return Math.min(1e3,Math.max(2,Number.isFinite(a)?Math.floor(a):b))}function m(){return[...i().values()].some(a=>!a.exited)}function n(a,b,h,m=(0,e.randomUUID)()){let o;(0,d.b)();let p=i().get(m);if(p){if(!(0,g.Eb)(p.cwd,a))throw Error("Terminal belongs to a different workspace");return m}try{({spawn:o}=c(14566))}catch(a){throw Error(`Cannot load the node-pty native terminal module for ${process.platform}-${process.arch}. The binary may be missing or incompatible. In the pi-web installation directory (the npx cache directory when using npx), run: npm rebuild node-pty --build-from-source --ignore-scripts=false --foreground-scripts. On Debian/Ubuntu, install build tools first: sudo apt-get install -y python3 build-essential. Then restart pi-web. Original error: ${a instanceof Error?a.message:String(a)}`,{cause:a})}let q=o("win32"===process.platform?process.env.ComSpec??"cmd.exe":process.env.SHELL||"/bin/sh","win32"===process.platform?[]:["-l"],{name:"xterm-256color",cols:l(b,80),rows:l(h,24),cwd:a||(0,f.homedir)(),env:function(){let a={};for(let[b,c]of Object.entries(process.env))void 0!==c&&(a[b]=c);return a.TERM="xterm-256color",a.COLORTERM="truecolor",process.env.LANG||process.env.LC_ALL||process.env.LC_CTYPE||(a.LANG="C.UTF-8"),a}()}),r={pty:q,cwd:a,listeners:new Set,backlog:"",offset:0,exited:!1,exitCode:null,cleanupTimer:null};return i().set(m,r),k(m,r),q.onData(a=>{r.backlog=(r.backlog+a).slice(-131072),r.offset+=a.length,j(r,{type:"output",data:a,offset:r.offset})}),q.onExit(({exitCode:a})=>{r.cleanupTimer&&clearTimeout(r.cleanupTimer),r.cleanupTimer=null,r.exited=!0,r.exitCode=a,j(r,{type:"exit",exitCode:a}),k(m,r)}),m}function o(a){return i().has(a)}function p(a){return i().get(a)?.cwd}function q(a,b,c){let d=i().get(a);if(!d)return null;d.listeners.add(b),d.cleanupTimer&&clearTimeout(d.cleanupTimer),d.cleanupTimer=null;let e=d.offset-d.backlog.length,f=void 0===c||c<e||c>d.offset;return{output:{type:"output",data:f?d.backlog:d.backlog.slice(c-e),offset:d.offset,reset:f},exited:d.exited,exitCode:d.exitCode,unsubscribe:()=>{d.listeners.delete(b),k(a,d)}}}function r(a,b){let c=i().get(a);return!!c&&!c.exited&&(c.pty.write(b),!0)}function s(a,b,c){let d=i().get(a);return!!d&&!d.exited&&(d.pty.resize(l(b,80),l(c,24)),!0)}function t(a,b=!1){let c=i().get(a);return!!c&&(c.cleanupTimer&&clearTimeout(c.cleanupTimer),i().delete(a),!c.exited&&(c.pty.kill(b?"SIGKILL":void 0),b||(c.cleanupTimer=setTimeout(()=>{c.exited||c.pty.kill("SIGKILL")},2e3),c.cleanupTimer.unref?.())),j(c,{type:"closed"}),c.listeners.clear(),!0)}},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:()=>{},98469:(a,b,c)=>{"use strict";function d(){if(globalThis.__piWebUpdating)throw Error("Pi Web is updating. Please wait for the restart.")}c.d(b,{b:()=>d})}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=65034));module.exports=c})();
|
|
4
|
+
`)),("exit"===a.type||"closed"===a.type)&&k(!0)}catch{k(!1)}};h=k;let n=(0,d.subscribeTerminal)(c,m,f);if(!n)return void k(!0);if(j=n.unsubscribe,b.enqueue(e.encode(":\n\n")),m(n.output),n.exited&&m({type:"exit",exitCode:n.exitCode??0}),!g){if(a.signal.addEventListener("abort",l,{once:!0}),a.signal.aborted)return void l();i=setInterval(()=>{try{(b.desiredSize??0)<=0?k(!0):g||b.enqueue(e.encode(":\n\n"))}catch{k(!1)}},3e4)}},cancel(){h(!1)}},{highWaterMark:262144,size:a=>a.byteLength}),{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}})}},55511:a=>{"use strict";a.exports=require("crypto")},58864:(a,b,c)=>{"use strict";c.d(b,{A_:()=>g,Eb:()=>k,W3:()=>i,gB:()=>h,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){let b=a.join("/"),c=i(b);return/^[a-zA-Z]:$/.test(c)?`${c}/`:f(c)?c:"/"+b.replace(/^\/+/,"")}function h(a){return a&&"win32"===process.platform?(0,d.normalize)(a):a}function i(a){return a.replace(/\\/g,"/")}function j(a){let b=(0,d.normalize)(h(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 k(a,b){if(a===b)return!0;if(!a||!b)return!1;let c=j(a),d=j(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")},65034:(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/zhujunshen/pi-web/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)}}},73968:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TERMINAL_RECONNECT_MS:()=>h,createTerminal:()=>p,getTerminalCwd:()=>r,hasAppUpdateBlockingTerminals:()=>o,hasTerminal:()=>q,killTerminal:()=>v,resizeTerminal:()=>u,shellEnvironment:()=>k,subscribeTerminal:()=>s,writeTerminal:()=>t});var d=c(98469),e=c(55511),f=c(21820),g=c(58864);let h=12e4;function i(){if(!globalThis.__piWebTerminals){globalThis.__piWebTerminals=new Map;let a=()=>{for(let a of globalThis.__piWebTerminals.keys())v(a,!0)};process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__piWebTerminals}let j=/^(PI_WEB_CAN_UPDATE|PI_WEB_UPDATE_BLOCKED|__NEXT_PRIVATE_.*)$/;function k(){let a={};for(let[b,c]of Object.entries(process.env))void 0===c||j.test(b)||(a[b]=c);return a.TERM="xterm-256color",a.COLORTERM="truecolor",process.env.LANG||process.env.LC_ALL||process.env.LC_CTYPE||(a.LANG="C.UTF-8"),a}function l(a,b){for(let c of a.listeners)c(b)}function m(a,b){b.cleanupTimer||b.listeners.size||i().get(a)!==b||(b.cleanupTimer=setTimeout(()=>v(a),h),b.cleanupTimer.unref?.())}function n(a,b){return Math.min(1e3,Math.max(2,Number.isFinite(a)?Math.floor(a):b))}function o(){return[...i().values()].some(a=>!a.exited)}function p(a,b,h,j=(0,e.randomUUID)()){let o;(0,d.b)();let q=i().get(j);if(q){if(!(0,g.Eb)(q.cwd,a))throw Error("Terminal belongs to a different workspace");return j}try{({spawn:o}=c(14566))}catch(a){throw Error(`Cannot load the node-pty native terminal module for ${process.platform}-${process.arch}. The binary may be missing or incompatible. In the pi-web installation directory (the npx cache directory when using npx), run: npm rebuild node-pty --build-from-source --ignore-scripts=false --foreground-scripts. On Debian/Ubuntu, install build tools first: sudo apt-get install -y python3 build-essential. Then restart pi-web. Original error: ${a instanceof Error?a.message:String(a)}`,{cause:a})}let r=o("win32"===process.platform?process.env.ComSpec??"cmd.exe":process.env.SHELL||"/bin/sh","win32"===process.platform?[]:["-l"],{name:"xterm-256color",cols:n(b,80),rows:n(h,24),cwd:a||(0,f.homedir)(),env:k()}),s={pty:r,cwd:a,listeners:new Set,backlog:"",offset:0,exited:!1,exitCode:null,cleanupTimer:null};return i().set(j,s),m(j,s),r.onData(a=>{s.backlog=(s.backlog+a).slice(-131072),s.offset+=a.length,l(s,{type:"output",data:a,offset:s.offset})}),r.onExit(({exitCode:a})=>{s.cleanupTimer&&clearTimeout(s.cleanupTimer),s.cleanupTimer=null,s.exited=!0,s.exitCode=a,l(s,{type:"exit",exitCode:a}),m(j,s)}),j}function q(a){return i().has(a)}function r(a){return i().get(a)?.cwd}function s(a,b,c){let d=i().get(a);if(!d)return null;d.listeners.add(b),d.cleanupTimer&&clearTimeout(d.cleanupTimer),d.cleanupTimer=null;let e=d.offset-d.backlog.length,f=void 0===c||c<e||c>d.offset;return{output:{type:"output",data:f?d.backlog:d.backlog.slice(c-e),offset:d.offset,reset:f},exited:d.exited,exitCode:d.exitCode,unsubscribe:()=>{d.listeners.delete(b),m(a,d)}}}function t(a,b){let c=i().get(a);return!!c&&!c.exited&&(c.pty.write(b),!0)}function u(a,b,c){let d=i().get(a);return!!d&&!d.exited&&(d.pty.resize(n(b,80),n(c,24)),!0)}function v(a,b=!1){let c=i().get(a);return!!c&&(c.cleanupTimer&&clearTimeout(c.cleanupTimer),i().delete(a),!c.exited&&(c.pty.kill(b?"SIGKILL":void 0),b||(c.cleanupTimer=setTimeout(()=>{c.exited||c.pty.kill("SIGKILL")},2e3),c.cleanupTimer.unref?.())),l(c,{type:"closed"}),c.listeners.clear(),!0)}},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:()=>{},98469:(a,b,c)=>{"use strict";function d(){if(globalThis.__piWebUpdating)throw Error("Pi Web is updating. Please wait for the restart.")}c.d(b,{b:()=>d})}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=65034));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=4524,a.ids=[3968,4524],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")},10847:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DELETE:()=>j,GET:()=>h,POST:()=>i,dynamic:()=>f,runtime:()=>g});var d=c(23211),e=c(73968);let f="force-dynamic",g="nodejs";async function h(a,{params:b}){let{id:c}=await b,f=(0,e.getTerminalCwd)(c);return f?d.NextResponse.json({id:c,cwd:f}):d.NextResponse.json({error:"Terminal expired or closed"},{status:404})}async function i(a,{params:b}){try{let{id:c}=await b,f=await a.json();if("input"===f.type&&"string"==typeof f.data&&f.data.length<=65536)return(0,e.writeTerminal)(c,f.data)?d.NextResponse.json({success:!0}):d.NextResponse.json({error:"Terminal not found"},{status:404});if("resize"===f.type&&Number.isInteger(f.cols)&&Number.isInteger(f.rows)&&f.cols>=2&&f.cols<=1e3&&f.rows>=2&&f.rows<=1e3)return(0,e.resizeTerminal)(c,f.cols,f.rows)?d.NextResponse.json({success:!0}):d.NextResponse.json({error:"Terminal not found"},{status:404});return d.NextResponse.json({error:"Invalid terminal command"},{status:400})}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function j(a,{params:b}){let{id:c}=await b;return(0,e.killTerminal)(c),d.NextResponse.json({success:!0})}},14566:a=>{"use strict";a.exports=require("node-pty")},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")},58864:(a,b,c)=>{"use strict";c.d(b,{A_:()=>g,Eb:()=>k,W3:()=>i,gB:()=>h,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){let b=a.join("/"),c=i(b);return/^[a-zA-Z]:$/.test(c)?`${c}/`:f(c)?c:"/"+b.replace(/^\/+/,"")}function h(a){return a&&"win32"===process.platform?(0,d.normalize)(a):a}function i(a){return a.replace(/\\/g,"/")}function j(a){let b=(0,d.normalize)(h(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 k(a,b){if(a===b)return!0;if(!a||!b)return!1;let c=j(a),d=j(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.r(b),c.d(b,{TERMINAL_RECONNECT_MS:()=>h,createTerminal:()=>n,getTerminalCwd:()=>p,hasAppUpdateBlockingTerminals:()=>m,hasTerminal:()=>o,killTerminal:()=>t,resizeTerminal:()=>s,subscribeTerminal:()=>q,writeTerminal:()=>r});var d=c(98469),e=c(55511),f=c(21820),g=c(58864);let h=12e4;function i(){if(!globalThis.__piWebTerminals){globalThis.__piWebTerminals=new Map;let a=()=>{for(let a of globalThis.__piWebTerminals.keys())t(a,!0)};process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__piWebTerminals}function j(a,b){for(let c of a.listeners)c(b)}function k(a,b){b.cleanupTimer||b.listeners.size||i().get(a)!==b||(b.cleanupTimer=setTimeout(()=>t(a),h),b.cleanupTimer.unref?.())}function l(a,b){return Math.min(1e3,Math.max(2,Number.isFinite(a)?Math.floor(a):b))}function m(){return[...i().values()].some(a=>!a.exited)}function n(a,b,h,m=(0,e.randomUUID)()){let o;(0,d.b)();let p=i().get(m);if(p){if(!(0,g.Eb)(p.cwd,a))throw Error("Terminal belongs to a different workspace");return m}try{({spawn:o}=c(14566))}catch(a){throw Error(`Cannot load the node-pty native terminal module for ${process.platform}-${process.arch}. The binary may be missing or incompatible. In the pi-web installation directory (the npx cache directory when using npx), run: npm rebuild node-pty --build-from-source --ignore-scripts=false --foreground-scripts. On Debian/Ubuntu, install build tools first: sudo apt-get install -y python3 build-essential. Then restart pi-web. Original error: ${a instanceof Error?a.message:String(a)}`,{cause:a})}let q=o("win32"===process.platform?process.env.ComSpec??"cmd.exe":process.env.SHELL||"/bin/sh","win32"===process.platform?[]:["-l"],{name:"xterm-256color",cols:l(b,80),rows:l(h,24),cwd:a||(0,f.homedir)(),env:function(){let a={};for(let[b,c]of Object.entries(process.env))void 0!==c&&(a[b]=c);return a.TERM="xterm-256color",a.COLORTERM="truecolor",process.env.LANG||process.env.LC_ALL||process.env.LC_CTYPE||(a.LANG="C.UTF-8"),a}()}),r={pty:q,cwd:a,listeners:new Set,backlog:"",offset:0,exited:!1,exitCode:null,cleanupTimer:null};return i().set(m,r),k(m,r),q.onData(a=>{r.backlog=(r.backlog+a).slice(-131072),r.offset+=a.length,j(r,{type:"output",data:a,offset:r.offset})}),q.onExit(({exitCode:a})=>{r.cleanupTimer&&clearTimeout(r.cleanupTimer),r.cleanupTimer=null,r.exited=!0,r.exitCode=a,j(r,{type:"exit",exitCode:a}),k(m,r)}),m}function o(a){return i().has(a)}function p(a){return i().get(a)?.cwd}function q(a,b,c){let d=i().get(a);if(!d)return null;d.listeners.add(b),d.cleanupTimer&&clearTimeout(d.cleanupTimer),d.cleanupTimer=null;let e=d.offset-d.backlog.length,f=void 0===c||c<e||c>d.offset;return{output:{type:"output",data:f?d.backlog:d.backlog.slice(c-e),offset:d.offset,reset:f},exited:d.exited,exitCode:d.exitCode,unsubscribe:()=>{d.listeners.delete(b),k(a,d)}}}function r(a,b){let c=i().get(a);return!!c&&!c.exited&&(c.pty.write(b),!0)}function s(a,b,c){let d=i().get(a);return!!d&&!d.exited&&(d.pty.resize(l(b,80),l(c,24)),!0)}function t(a,b=!1){let c=i().get(a);return!!c&&(c.cleanupTimer&&clearTimeout(c.cleanupTimer),i().delete(a),!c.exited&&(c.pty.kill(b?"SIGKILL":void 0),b||(c.cleanupTimer=setTimeout(()=>{c.exited||c.pty.kill("SIGKILL")},2e3),c.cleanupTimer.unref?.())),j(c,{type:"closed"}),c.listeners.clear(),!0)}},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{},97892:(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/zhujunshen/pi-web/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)}}},98469:(a,b,c)=>{"use strict";function d(){if(globalThis.__piWebUpdating)throw Error("Pi Web is updating. Please wait for the restart.")}c.d(b,{b:()=>d})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=97892));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=4524,a.ids=[3968,4524],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")},10847:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DELETE:()=>j,GET:()=>h,POST:()=>i,dynamic:()=>f,runtime:()=>g});var d=c(23211),e=c(73968);let f="force-dynamic",g="nodejs";async function h(a,{params:b}){let{id:c}=await b,f=(0,e.getTerminalCwd)(c);return f?d.NextResponse.json({id:c,cwd:f}):d.NextResponse.json({error:"Terminal expired or closed"},{status:404})}async function i(a,{params:b}){try{let{id:c}=await b,f=await a.json();if("input"===f.type&&"string"==typeof f.data&&f.data.length<=65536)return(0,e.writeTerminal)(c,f.data)?d.NextResponse.json({success:!0}):d.NextResponse.json({error:"Terminal not found"},{status:404});if("resize"===f.type&&Number.isInteger(f.cols)&&Number.isInteger(f.rows)&&f.cols>=2&&f.cols<=1e3&&f.rows>=2&&f.rows<=1e3)return(0,e.resizeTerminal)(c,f.cols,f.rows)?d.NextResponse.json({success:!0}):d.NextResponse.json({error:"Terminal not found"},{status:404});return d.NextResponse.json({error:"Invalid terminal command"},{status:400})}catch(a){return d.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}async function j(a,{params:b}){let{id:c}=await b;return(0,e.killTerminal)(c),d.NextResponse.json({success:!0})}},14566:a=>{"use strict";a.exports=require("node-pty")},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")},58864:(a,b,c)=>{"use strict";c.d(b,{A_:()=>g,Eb:()=>k,W3:()=>i,gB:()=>h,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){let b=a.join("/"),c=i(b);return/^[a-zA-Z]:$/.test(c)?`${c}/`:f(c)?c:"/"+b.replace(/^\/+/,"")}function h(a){return a&&"win32"===process.platform?(0,d.normalize)(a):a}function i(a){return a.replace(/\\/g,"/")}function j(a){let b=(0,d.normalize)(h(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 k(a,b){if(a===b)return!0;if(!a||!b)return!1;let c=j(a),d=j(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.r(b),c.d(b,{TERMINAL_RECONNECT_MS:()=>h,createTerminal:()=>p,getTerminalCwd:()=>r,hasAppUpdateBlockingTerminals:()=>o,hasTerminal:()=>q,killTerminal:()=>v,resizeTerminal:()=>u,shellEnvironment:()=>k,subscribeTerminal:()=>s,writeTerminal:()=>t});var d=c(98469),e=c(55511),f=c(21820),g=c(58864);let h=12e4;function i(){if(!globalThis.__piWebTerminals){globalThis.__piWebTerminals=new Map;let a=()=>{for(let a of globalThis.__piWebTerminals.keys())v(a,!0)};process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__piWebTerminals}let j=/^(PI_WEB_CAN_UPDATE|PI_WEB_UPDATE_BLOCKED|__NEXT_PRIVATE_.*)$/;function k(){let a={};for(let[b,c]of Object.entries(process.env))void 0===c||j.test(b)||(a[b]=c);return a.TERM="xterm-256color",a.COLORTERM="truecolor",process.env.LANG||process.env.LC_ALL||process.env.LC_CTYPE||(a.LANG="C.UTF-8"),a}function l(a,b){for(let c of a.listeners)c(b)}function m(a,b){b.cleanupTimer||b.listeners.size||i().get(a)!==b||(b.cleanupTimer=setTimeout(()=>v(a),h),b.cleanupTimer.unref?.())}function n(a,b){return Math.min(1e3,Math.max(2,Number.isFinite(a)?Math.floor(a):b))}function o(){return[...i().values()].some(a=>!a.exited)}function p(a,b,h,j=(0,e.randomUUID)()){let o;(0,d.b)();let q=i().get(j);if(q){if(!(0,g.Eb)(q.cwd,a))throw Error("Terminal belongs to a different workspace");return j}try{({spawn:o}=c(14566))}catch(a){throw Error(`Cannot load the node-pty native terminal module for ${process.platform}-${process.arch}. The binary may be missing or incompatible. In the pi-web installation directory (the npx cache directory when using npx), run: npm rebuild node-pty --build-from-source --ignore-scripts=false --foreground-scripts. On Debian/Ubuntu, install build tools first: sudo apt-get install -y python3 build-essential. Then restart pi-web. Original error: ${a instanceof Error?a.message:String(a)}`,{cause:a})}let r=o("win32"===process.platform?process.env.ComSpec??"cmd.exe":process.env.SHELL||"/bin/sh","win32"===process.platform?[]:["-l"],{name:"xterm-256color",cols:n(b,80),rows:n(h,24),cwd:a||(0,f.homedir)(),env:k()}),s={pty:r,cwd:a,listeners:new Set,backlog:"",offset:0,exited:!1,exitCode:null,cleanupTimer:null};return i().set(j,s),m(j,s),r.onData(a=>{s.backlog=(s.backlog+a).slice(-131072),s.offset+=a.length,l(s,{type:"output",data:a,offset:s.offset})}),r.onExit(({exitCode:a})=>{s.cleanupTimer&&clearTimeout(s.cleanupTimer),s.cleanupTimer=null,s.exited=!0,s.exitCode=a,l(s,{type:"exit",exitCode:a}),m(j,s)}),j}function q(a){return i().has(a)}function r(a){return i().get(a)?.cwd}function s(a,b,c){let d=i().get(a);if(!d)return null;d.listeners.add(b),d.cleanupTimer&&clearTimeout(d.cleanupTimer),d.cleanupTimer=null;let e=d.offset-d.backlog.length,f=void 0===c||c<e||c>d.offset;return{output:{type:"output",data:f?d.backlog:d.backlog.slice(c-e),offset:d.offset,reset:f},exited:d.exited,exitCode:d.exitCode,unsubscribe:()=>{d.listeners.delete(b),m(a,d)}}}function t(a,b){let c=i().get(a);return!!c&&!c.exited&&(c.pty.write(b),!0)}function u(a,b,c){let d=i().get(a);return!!d&&!d.exited&&(d.pty.resize(n(b,80),n(c,24)),!0)}function v(a,b=!1){let c=i().get(a);return!!c&&(c.cleanupTimer&&clearTimeout(c.cleanupTimer),i().delete(a),!c.exited&&(c.pty.kill(b?"SIGKILL":void 0),b||(c.cleanupTimer=setTimeout(()=>{c.exited||c.pty.kill("SIGKILL")},2e3),c.cleanupTimer.unref?.())),l(c,{type:"closed"}),c.listeners.clear(),!0)}},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{},97892:(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/zhujunshen/pi-web/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)}}},98469:(a,b,c)=>{"use strict";function d(){if(globalThis.__piWebUpdating)throw Error("Pi Web is updating. Please wait for the restart.")}c.d(b,{b:()=>d})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=97892));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
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")},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")},14566:a=>{"use strict";a.exports=require("node-pty")},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")},30986:(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/zhujunshen/pi-web/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)}}},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.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>k,dynamic:()=>l,runtime:()=>m});var e=c(79748),f=c(33873),g=c(23211),h=c(80547),i=c(73968),j=a([h]);h=(j.then?(await j)():j)[0];let l="force-dynamic",m="nodejs";async function k(a){try{let b=await a.json();if(void 0!==b.id&&("string"!=typeof b.id||!/^[a-f0-9]{32}$/.test(b.id)))return g.NextResponse.json({error:"Invalid terminal id"},{status:400});if("string"!=typeof b.cwd||!b.cwd.trim())return g.NextResponse.json({error:"cwd required"},{status:400});let c=(0,f.resolve)(b.cwd);if(!(await (0,e.stat)(c)).isDirectory())return g.NextResponse.json({error:"cwd must be a directory"},{status:400});let d=await (0,h.mc)();if(!(0,h.B7)(c,d))return g.NextResponse.json({error:"Access denied"},{status:403});let j=(0,i.createTerminal)(c,"number"==typeof b.cols?b.cols:80,"number"==typeof b.rows?b.rows:24,b.id);return g.NextResponse.json({id:j})}catch(a){return g.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},51455:a=>{"use strict";a.exports=require("node:fs/promises")},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")},73024:a=>{"use strict";a.exports=require("node:fs")},73968:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TERMINAL_RECONNECT_MS:()=>h,createTerminal:()=>n,getTerminalCwd:()=>p,hasAppUpdateBlockingTerminals:()=>m,hasTerminal:()=>o,killTerminal:()=>t,resizeTerminal:()=>s,subscribeTerminal:()=>q,writeTerminal:()=>r});var d=c(98469),e=c(55511),f=c(21820),g=c(58864);let h=12e4;function i(){if(!globalThis.__piWebTerminals){globalThis.__piWebTerminals=new Map;let a=()=>{for(let a of globalThis.__piWebTerminals.keys())t(a,!0)};process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__piWebTerminals}function j(a,b){for(let c of a.listeners)c(b)}function k(a,b){b.cleanupTimer||b.listeners.size||i().get(a)!==b||(b.cleanupTimer=setTimeout(()=>t(a),h),b.cleanupTimer.unref?.())}function l(a,b){return Math.min(1e3,Math.max(2,Number.isFinite(a)?Math.floor(a):b))}function m(){return[...i().values()].some(a=>!a.exited)}function n(a,b,h,m=(0,e.randomUUID)()){let o;(0,d.b)();let p=i().get(m);if(p){if(!(0,g.Eb)(p.cwd,a))throw Error("Terminal belongs to a different workspace");return m}try{({spawn:o}=c(14566))}catch(a){throw Error(`Cannot load the node-pty native terminal module for ${process.platform}-${process.arch}. The binary may be missing or incompatible. In the pi-web installation directory (the npx cache directory when using npx), run: npm rebuild node-pty --build-from-source --ignore-scripts=false --foreground-scripts. On Debian/Ubuntu, install build tools first: sudo apt-get install -y python3 build-essential. Then restart pi-web. Original error: ${a instanceof Error?a.message:String(a)}`,{cause:a})}let q=o("win32"===process.platform?process.env.ComSpec??"cmd.exe":process.env.SHELL||"/bin/sh","win32"===process.platform?[]:["-l"],{name:"xterm-256color",cols:l(b,80),rows:l(h,24),cwd:a||(0,f.homedir)(),env:function(){let a={};for(let[b,c]of Object.entries(process.env))void 0!==c&&(a[b]=c);return a.TERM="xterm-256color",a.COLORTERM="truecolor",process.env.LANG||process.env.LC_ALL||process.env.LC_CTYPE||(a.LANG="C.UTF-8"),a}()}),r={pty:q,cwd:a,listeners:new Set,backlog:"",offset:0,exited:!1,exitCode:null,cleanupTimer:null};return i().set(m,r),k(m,r),q.onData(a=>{r.backlog=(r.backlog+a).slice(-131072),r.offset+=a.length,j(r,{type:"output",data:a,offset:r.offset})}),q.onExit(({exitCode:a})=>{r.cleanupTimer&&clearTimeout(r.cleanupTimer),r.cleanupTimer=null,r.exited=!0,r.exitCode=a,j(r,{type:"exit",exitCode:a}),k(m,r)}),m}function o(a){return i().has(a)}function p(a){return i().get(a)?.cwd}function q(a,b,c){let d=i().get(a);if(!d)return null;d.listeners.add(b),d.cleanupTimer&&clearTimeout(d.cleanupTimer),d.cleanupTimer=null;let e=d.offset-d.backlog.length,f=void 0===c||c<e||c>d.offset;return{output:{type:"output",data:f?d.backlog:d.backlog.slice(c-e),offset:d.offset,reset:f},exited:d.exited,exitCode:d.exitCode,unsubscribe:()=>{d.listeners.delete(b),k(a,d)}}}function r(a,b){let c=i().get(a);return!!c&&!c.exited&&(c.pty.write(b),!0)}function s(a,b,c){let d=i().get(a);return!!d&&!d.exited&&(d.pty.resize(l(b,80),l(c,24)),!0)}function t(a,b=!1){let c=i().get(a);return!!c&&(c.cleanupTimer&&clearTimeout(c.cleanupTimer),i().delete(a),!c.exited&&(c.pty.kill(b?"SIGKILL":void 0),b||(c.cleanupTimer=setTimeout(()=>{c.exited||c.pty.kill("SIGKILL")},2e3),c.cleanupTimer.unref?.())),j(c,{type:"closed"}),c.listeners.clear(),!0)}},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")},80481:a=>{"use strict";a.exports=require("node:readline")},80547:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>o,B7:()=>p,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.dQ)(),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)}})},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{},98469:(a,b,c)=>{"use strict";function d(){if(globalThis.__piWebUpdating)throw Error("Pi Web is updating. Please wait for the restart.")}c.d(b,{b:()=>d})}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,426,402],()=>b(b.s=30986));module.exports=c})();
|
|
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")},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")},14566:a=>{"use strict";a.exports=require("node-pty")},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")},30986:(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/zhujunshen/pi-web/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)}}},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.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>k,dynamic:()=>l,runtime:()=>m});var e=c(79748),f=c(33873),g=c(23211),h=c(80547),i=c(73968),j=a([h]);h=(j.then?(await j)():j)[0];let l="force-dynamic",m="nodejs";async function k(a){try{let b=await a.json();if(void 0!==b.id&&("string"!=typeof b.id||!/^[a-f0-9]{32}$/.test(b.id)))return g.NextResponse.json({error:"Invalid terminal id"},{status:400});if("string"!=typeof b.cwd||!b.cwd.trim())return g.NextResponse.json({error:"cwd required"},{status:400});let c=(0,f.resolve)(b.cwd);if(!(await (0,e.stat)(c)).isDirectory())return g.NextResponse.json({error:"cwd must be a directory"},{status:400});let d=await (0,h.mc)();if(!(0,h.B7)(c,d))return g.NextResponse.json({error:"Access denied"},{status:403});let j=(0,i.createTerminal)(c,"number"==typeof b.cols?b.cols:80,"number"==typeof b.rows?b.rows:24,b.id);return g.NextResponse.json({id:j})}catch(a){return g.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},51455:a=>{"use strict";a.exports=require("node:fs/promises")},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")},73024:a=>{"use strict";a.exports=require("node:fs")},73968:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TERMINAL_RECONNECT_MS:()=>h,createTerminal:()=>p,getTerminalCwd:()=>r,hasAppUpdateBlockingTerminals:()=>o,hasTerminal:()=>q,killTerminal:()=>v,resizeTerminal:()=>u,shellEnvironment:()=>k,subscribeTerminal:()=>s,writeTerminal:()=>t});var d=c(98469),e=c(55511),f=c(21820),g=c(58864);let h=12e4;function i(){if(!globalThis.__piWebTerminals){globalThis.__piWebTerminals=new Map;let a=()=>{for(let a of globalThis.__piWebTerminals.keys())v(a,!0)};process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__piWebTerminals}let j=/^(PI_WEB_CAN_UPDATE|PI_WEB_UPDATE_BLOCKED|__NEXT_PRIVATE_.*)$/;function k(){let a={};for(let[b,c]of Object.entries(process.env))void 0===c||j.test(b)||(a[b]=c);return a.TERM="xterm-256color",a.COLORTERM="truecolor",process.env.LANG||process.env.LC_ALL||process.env.LC_CTYPE||(a.LANG="C.UTF-8"),a}function l(a,b){for(let c of a.listeners)c(b)}function m(a,b){b.cleanupTimer||b.listeners.size||i().get(a)!==b||(b.cleanupTimer=setTimeout(()=>v(a),h),b.cleanupTimer.unref?.())}function n(a,b){return Math.min(1e3,Math.max(2,Number.isFinite(a)?Math.floor(a):b))}function o(){return[...i().values()].some(a=>!a.exited)}function p(a,b,h,j=(0,e.randomUUID)()){let o;(0,d.b)();let q=i().get(j);if(q){if(!(0,g.Eb)(q.cwd,a))throw Error("Terminal belongs to a different workspace");return j}try{({spawn:o}=c(14566))}catch(a){throw Error(`Cannot load the node-pty native terminal module for ${process.platform}-${process.arch}. The binary may be missing or incompatible. In the pi-web installation directory (the npx cache directory when using npx), run: npm rebuild node-pty --build-from-source --ignore-scripts=false --foreground-scripts. On Debian/Ubuntu, install build tools first: sudo apt-get install -y python3 build-essential. Then restart pi-web. Original error: ${a instanceof Error?a.message:String(a)}`,{cause:a})}let r=o("win32"===process.platform?process.env.ComSpec??"cmd.exe":process.env.SHELL||"/bin/sh","win32"===process.platform?[]:["-l"],{name:"xterm-256color",cols:n(b,80),rows:n(h,24),cwd:a||(0,f.homedir)(),env:k()}),s={pty:r,cwd:a,listeners:new Set,backlog:"",offset:0,exited:!1,exitCode:null,cleanupTimer:null};return i().set(j,s),m(j,s),r.onData(a=>{s.backlog=(s.backlog+a).slice(-131072),s.offset+=a.length,l(s,{type:"output",data:a,offset:s.offset})}),r.onExit(({exitCode:a})=>{s.cleanupTimer&&clearTimeout(s.cleanupTimer),s.cleanupTimer=null,s.exited=!0,s.exitCode=a,l(s,{type:"exit",exitCode:a}),m(j,s)}),j}function q(a){return i().has(a)}function r(a){return i().get(a)?.cwd}function s(a,b,c){let d=i().get(a);if(!d)return null;d.listeners.add(b),d.cleanupTimer&&clearTimeout(d.cleanupTimer),d.cleanupTimer=null;let e=d.offset-d.backlog.length,f=void 0===c||c<e||c>d.offset;return{output:{type:"output",data:f?d.backlog:d.backlog.slice(c-e),offset:d.offset,reset:f},exited:d.exited,exitCode:d.exitCode,unsubscribe:()=>{d.listeners.delete(b),m(a,d)}}}function t(a,b){let c=i().get(a);return!!c&&!c.exited&&(c.pty.write(b),!0)}function u(a,b,c){let d=i().get(a);return!!d&&!d.exited&&(d.pty.resize(n(b,80),n(c,24)),!0)}function v(a,b=!1){let c=i().get(a);return!!c&&(c.cleanupTimer&&clearTimeout(c.cleanupTimer),i().delete(a),!c.exited&&(c.pty.kill(b?"SIGKILL":void 0),b||(c.cleanupTimer=setTimeout(()=>{c.exited||c.pty.kill("SIGKILL")},2e3),c.cleanupTimer.unref?.())),l(c,{type:"closed"}),c.listeners.clear(),!0)}},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")},80481:a=>{"use strict";a.exports=require("node:readline")},80547:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A$:()=>o,B7:()=>p,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.dQ)(),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)}})},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{},98469:(a,b,c)=>{"use strict";function d(){if(globalThis.__piWebUpdating)throw Error("Pi Web is updating. Please wait for the restart.")}c.d(b,{b:()=>d})}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,426,402],()=>b(b.s=30986));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" translate="no" class="__variable_66b8ca notranslate"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"/><link rel="preload" href="/_next/static/media/7deddc85b7ffd1dc-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/ec14413c594b3356-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/88714c00e109ce28.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/c32eeb8d335fb2e0.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/cd8a7008e750a223.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/58d019c61385df31.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-1b16208bb4ccd9c1.js"/><script src="/_next/static/chunks/4bd1b696-8a4ab4fdf0ae305a.js" async=""></script><script src="/_next/static/chunks/3794-0a1186eb85c3950f.js" async=""></script><script src="/_next/static/chunks/main-app-eb01db97120cdb49.js" async=""></script><script src="/_next/static/chunks/app/layout-58b4b00014682160.js" async=""></script><script src="/_next/static/chunks/d3ac728e-7964f816a1ca64e5.js" async=""></script><script src="/_next/static/chunks/e868780c-1584512c612787d7.js" async=""></script><script src="/_next/static/chunks/5931-831e2811b884c6c3.js" async=""></script><script src="/_next/static/chunks/1278-3bbb66253b640b0d.js" async=""></script><script src="/_next/static/chunks/app/page-2e5e81259171c08e.js" async=""></script><meta name="theme-color" content="#f5f5f5"/><title>Pi Web</title><meta name="description" content="Pi Web interface for the pi coding agent"/><meta name="application-name" content="Pi Web"/><link rel="manifest" href="/manifest.webmanifest"/><meta name="format-detection" content="telephone=no"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Pi Web"/><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><link rel="icon" href="/favicon.svg?v=b1e5fdfb" type="image/svg+xml"/><link rel="icon" href="/icons/icon-192.png?v=b1e5fdfb" sizes="192x192" type="image/png"/><link rel="icon" href="/favicon.ico?v=b1e5fdfb" sizes="any"/><link rel="apple-touch-icon" href="/icons/apple-touch-icon.png?v=b1e5fdfb" sizes="180x180" type="image/png"/><meta name="next-size-adjust" content=""/><meta name="google" content="notranslate"/><script>(function(){try{if(localStorage.getItem("pi-web-sarasa-enabled")==="1")document.documentElement.classList.add("sarasa-term-webfont");var t=localStorage.getItem("pi-theme");var dark=t==="dark"||((t==null||t===""||t==="auto")&&window.matchMedia("(prefers-color-scheme: dark)").matches);if(dark)document.documentElement.classList.add("dark");var c=dark?"#242424":"#f5f5f5";var ms=document.querySelectorAll('meta[name="theme-color"]');if(ms.length===0){var m=document.createElement("meta");m.name="theme-color";m.content=c;document.head.appendChild(m)}else{for(var i=0;i<ms.length;i++){ms[i].removeAttribute("media");ms[i].content=c}}}catch(e){}})();</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body translate="no" class="notranslate"><div hidden=""><!--$--><!--/$--></div><!--$!--><template data-dgst="BAILOUT_TO_CLIENT_SIDE_RENDERING"></template><!--/$--><!--$--><!--/$--><script src="/_next/static/chunks/webpack-1b16208bb4ccd9c1.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[57788,[\"7177\",\"static/chunks/app/layout-58b4b00014682160.js\"],\"PwaRegistration\"]\n5:\"$Sreact.suspense\"\n6:I[21278,[\"7330\",\"static/chunks/d3ac728e-7964f816a1ca64e5.js\",\"3888\",\"static/chunks/e868780c-1584512c612787d7.js\",\"5931\",\"static/chunks/5931-831e2811b884c6c3.js\",\"1278\",\"static/chunks/1278-3bbb66253b640b0d.js\",\"8974\",\"static/chunks/app/page-2e5e81259171c08e.js\"],\"I18nProvider\"]\n7:I[61795,[\"7330\",\"static/chunks/d3ac728e-7964f816a1ca64e5.js\",\"3888\",\"static/chunks/e868780c-1584512c612787d7.js\",\"5931\",\"static/chunks/5931-831e2811b884c6c3.js\",\"1278\",\"static/chunks/1278-3bbb66253b640b0d.js\",\"8974\",\"static/chunks/app/page-2e5e81259171c08e.js\"],\"AppShell\"]\n8:I[90484,[],\"OutletBoundary\"]\na:I[90484,[],\"ViewportBoundary\"]\nc:I[90484,[],\"MetadataBoundary\"]\ne:I[27123,[],\"default\",1]\n:HL[\"/_next/static/media/7deddc85b7ffd1dc-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/ec14413c594b3356-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/88714c00e109ce28.css\",\"style\"]\n:HL[\"/_next/static/css/c32eeb8d335fb2e0.css\",\"style\"]\n:HL[\"/_next/static/css/cd8a7008e750a223.css\",\"style\"]\n:HL[\"/_next/static/css/58d019c61385df31.css\",\"style\"]\n0:{\"P\":null,\"c\":[\"\",\"\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4608]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/88714c00e109ce28.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/c32eeb8d335fb2e0.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/cd8a7008e750a223.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"translate\":\"no\",\"className\":\"__variable_66b8ca notranslate\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"meta\",null,{\"name\":\"google\",\"content\":\"notranslate\"}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"(function(){try{if(localStorage.getItem(\\\"pi-web-sarasa-enabled\\\")===\\\"1\\\")document.documentElement.classList.add(\\\"sarasa-term-webfont\\\");var t=localStorage.getItem(\\\"pi-theme\\\");var dark=t===\\\"dark\\\"||((t==null||t===\\\"\\\"||t===\\\"auto\\\")\u0026\u0026window.matchMedia(\\\"(prefers-color-scheme: dark)\\\").matches);if(dark)document.documentElement.classList.add(\\\"dark\\\");var c=dark?\\\"#242424\\\":\\\"#f5f5f5\\\";var ms=document.querySelectorAll('meta[name=\\\"theme-color\\\"]');if(ms.length===0){var m=document.createElement(\\\"meta\\\");m.name=\\\"theme-color\\\";m.content=c;document.head.appendChild(m)}else{for(var i=0;i\u003cms.length;i++){ms[i].removeAttribute(\\\"media\\\");ms[i].content=c}}}catch(e){}})();\"}}]]}],[\"$\",\"body\",null,{\"translate\":\"no\",\"className\":\"notranslate\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}],[\"$\",\"$L4\",null,{}]]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$5\",null,{\"children\":[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L7\",null,{}]}]}],[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/58d019c61385df31.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"$L8\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@9\"}]}]]}],{},null,false,null]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Ld\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$e\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"tVgAwm8yyQDFPqwIaK7ru\"}\nb:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#f5f5f5\"}]]\nf:I[86869,[],\"IconMark\"]\n9:null\nd:[[\"$\",\"title\",\"0\",{\"children\":\"Pi Web\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Pi Web interface for the pi coding agent\"}],[\"$\",\"meta\",\"2\",{\"name\":\"application-name\",\"content\":\"Pi Web\"}],[\"$\",\"link\",\"3\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"4\",{\"name\":\"format-detection\",\"content\":\"telephone=no\"}],[\"$\",\"meta\",\"5\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"6\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"Pi Web\"}],[\"$\",\"meta\",\"7\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"8\",{\"rel\":\"icon\",\"href\":\"/favicon.svg?v=b1e5fdfb\",\"type\":\"image/svg+xml\"}],[\"$\",\"link\",\"9\",{\"rel\":\"icon\",\"href\":\"/icons/icon-192.png?v=b1e5fdfb\",\"sizes\":\"192x192\",\"type\":\"image/png\"}],[\"$\",\"link\",\"10\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?v=b1e5fdfb\",\"sizes\":\"any\"}],[\"$\",\"link\",\"11\",{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/apple-touch-icon.png?v=b1e5fdfb\",\"sizes\":\"180x180\",\"type\":\"image/png\"}],[\"$\",\"$Lf\",\"12\",{}]]\n"])</script></body></html>
|
|
1
|
+
<!DOCTYPE html><html lang="en" translate="no" class="__variable_66b8ca notranslate"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"/><link rel="preload" href="/_next/static/media/7deddc85b7ffd1dc-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/ec14413c594b3356-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/88714c00e109ce28.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/c32eeb8d335fb2e0.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/cd8a7008e750a223.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/58d019c61385df31.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-1b16208bb4ccd9c1.js"/><script src="/_next/static/chunks/4bd1b696-8a4ab4fdf0ae305a.js" async=""></script><script src="/_next/static/chunks/3794-0a1186eb85c3950f.js" async=""></script><script src="/_next/static/chunks/main-app-eb01db97120cdb49.js" async=""></script><script src="/_next/static/chunks/app/layout-f0135b79d316ca92.js" async=""></script><script src="/_next/static/chunks/d3ac728e-7964f816a1ca64e5.js" async=""></script><script src="/_next/static/chunks/e868780c-1584512c612787d7.js" async=""></script><script src="/_next/static/chunks/5931-831e2811b884c6c3.js" async=""></script><script src="/_next/static/chunks/1278-5262898cb83459a6.js" async=""></script><script src="/_next/static/chunks/app/page-8362a772c48a922e.js" async=""></script><meta name="theme-color" content="#f5f5f5"/><title>Pi Web</title><meta name="description" content="Pi Web interface for the pi coding agent"/><meta name="application-name" content="Pi Web"/><link rel="manifest" href="/manifest.webmanifest"/><meta name="format-detection" content="telephone=no"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="Pi Web"/><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><link rel="icon" href="/favicon.svg?v=b1e5fdfb" type="image/svg+xml"/><link rel="icon" href="/icons/icon-192.png?v=b1e5fdfb" sizes="192x192" type="image/png"/><link rel="icon" href="/favicon.ico?v=b1e5fdfb" sizes="any"/><link rel="apple-touch-icon" href="/icons/apple-touch-icon.png?v=b1e5fdfb" sizes="180x180" type="image/png"/><meta name="next-size-adjust" content=""/><meta name="google" content="notranslate"/><script>(function(){try{if(localStorage.getItem("pi-web-sarasa-enabled")==="1")document.documentElement.classList.add("sarasa-term-webfont");var t=localStorage.getItem("pi-theme");var dark=t==="dark"||((t==null||t===""||t==="auto")&&window.matchMedia("(prefers-color-scheme: dark)").matches);if(dark)document.documentElement.classList.add("dark");var c=dark?"#242424":"#f5f5f5";var ms=document.querySelectorAll('meta[name="theme-color"]');if(ms.length===0){var m=document.createElement("meta");m.name="theme-color";m.content=c;document.head.appendChild(m)}else{for(var i=0;i<ms.length;i++){ms[i].removeAttribute("media");ms[i].content=c}}}catch(e){}})();</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body translate="no" class="notranslate"><div hidden=""><!--$--><!--/$--></div><!--$!--><template data-dgst="BAILOUT_TO_CLIENT_SIDE_RENDERING"></template><!--/$--><!--$--><!--/$--><script src="/_next/static/chunks/webpack-1b16208bb4ccd9c1.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[57788,[\"7177\",\"static/chunks/app/layout-f0135b79d316ca92.js\"],\"PwaRegistration\"]\n5:\"$Sreact.suspense\"\n6:I[21278,[\"7330\",\"static/chunks/d3ac728e-7964f816a1ca64e5.js\",\"3888\",\"static/chunks/e868780c-1584512c612787d7.js\",\"5931\",\"static/chunks/5931-831e2811b884c6c3.js\",\"1278\",\"static/chunks/1278-5262898cb83459a6.js\",\"8974\",\"static/chunks/app/page-8362a772c48a922e.js\"],\"I18nProvider\"]\n7:I[61795,[\"7330\",\"static/chunks/d3ac728e-7964f816a1ca64e5.js\",\"3888\",\"static/chunks/e868780c-1584512c612787d7.js\",\"5931\",\"static/chunks/5931-831e2811b884c6c3.js\",\"1278\",\"static/chunks/1278-5262898cb83459a6.js\",\"8974\",\"static/chunks/app/page-8362a772c48a922e.js\"],\"AppShell\"]\n8:I[90484,[],\"OutletBoundary\"]\na:I[90484,[],\"ViewportBoundary\"]\nc:I[90484,[],\"MetadataBoundary\"]\ne:I[27123,[],\"default\",1]\n:HL[\"/_next/static/media/7deddc85b7ffd1dc-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/ec14413c594b3356-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/88714c00e109ce28.css\",\"style\"]\n:HL[\"/_next/static/css/c32eeb8d335fb2e0.css\",\"style\"]\n:HL[\"/_next/static/css/cd8a7008e750a223.css\",\"style\"]\n:HL[\"/_next/static/css/58d019c61385df31.css\",\"style\"]\n0:{\"P\":null,\"c\":[\"\",\"\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4608]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/88714c00e109ce28.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/c32eeb8d335fb2e0.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/cd8a7008e750a223.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"translate\":\"no\",\"className\":\"__variable_66b8ca notranslate\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"meta\",null,{\"name\":\"google\",\"content\":\"notranslate\"}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"(function(){try{if(localStorage.getItem(\\\"pi-web-sarasa-enabled\\\")===\\\"1\\\")document.documentElement.classList.add(\\\"sarasa-term-webfont\\\");var t=localStorage.getItem(\\\"pi-theme\\\");var dark=t===\\\"dark\\\"||((t==null||t===\\\"\\\"||t===\\\"auto\\\")\u0026\u0026window.matchMedia(\\\"(prefers-color-scheme: dark)\\\").matches);if(dark)document.documentElement.classList.add(\\\"dark\\\");var c=dark?\\\"#242424\\\":\\\"#f5f5f5\\\";var ms=document.querySelectorAll('meta[name=\\\"theme-color\\\"]');if(ms.length===0){var m=document.createElement(\\\"meta\\\");m.name=\\\"theme-color\\\";m.content=c;document.head.appendChild(m)}else{for(var i=0;i\u003cms.length;i++){ms[i].removeAttribute(\\\"media\\\");ms[i].content=c}}}catch(e){}})();\"}}]]}],[\"$\",\"body\",null,{\"translate\":\"no\",\"className\":\"notranslate\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}],[\"$\",\"$L4\",null,{}]]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$5\",null,{\"children\":[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L7\",null,{}]}]}],[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/58d019c61385df31.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"$L8\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@9\"}]}]]}],{},null,false,null]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Ld\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$e\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"CdvU6b-rJGcGFFwmQZ7QG\"}\nb:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#f5f5f5\"}]]\nf:I[86869,[],\"IconMark\"]\n9:null\nd:[[\"$\",\"title\",\"0\",{\"children\":\"Pi Web\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Pi Web interface for the pi coding agent\"}],[\"$\",\"meta\",\"2\",{\"name\":\"application-name\",\"content\":\"Pi Web\"}],[\"$\",\"link\",\"3\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"4\",{\"name\":\"format-detection\",\"content\":\"telephone=no\"}],[\"$\",\"meta\",\"5\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"6\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"Pi Web\"}],[\"$\",\"meta\",\"7\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"link\",\"8\",{\"rel\":\"icon\",\"href\":\"/favicon.svg?v=b1e5fdfb\",\"type\":\"image/svg+xml\"}],[\"$\",\"link\",\"9\",{\"rel\":\"icon\",\"href\":\"/icons/icon-192.png?v=b1e5fdfb\",\"sizes\":\"192x192\",\"type\":\"image/png\"}],[\"$\",\"link\",\"10\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?v=b1e5fdfb\",\"sizes\":\"any\"}],[\"$\",\"link\",\"11\",{\"rel\":\"apple-touch-icon\",\"href\":\"/icons/apple-touch-icon.png?v=b1e5fdfb\",\"sizes\":\"180x180\",\"type\":\"image/png\"}],[\"$\",\"$Lf\",\"12\",{}]]\n"])</script></body></html>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
2
|
2:I[57121,[],""]
|
|
3
3
|
3:I[74581,[],""]
|
|
4
|
-
4:I[57788,["7177","static/chunks/app/layout-
|
|
4
|
+
4:I[57788,["7177","static/chunks/app/layout-f0135b79d316ca92.js"],"PwaRegistration"]
|
|
5
5
|
5:"$Sreact.suspense"
|
|
6
|
-
6:I[21278,["7330","static/chunks/d3ac728e-7964f816a1ca64e5.js","3888","static/chunks/e868780c-1584512c612787d7.js","5931","static/chunks/5931-831e2811b884c6c3.js","1278","static/chunks/1278-
|
|
7
|
-
7:I[61795,["7330","static/chunks/d3ac728e-7964f816a1ca64e5.js","3888","static/chunks/e868780c-1584512c612787d7.js","5931","static/chunks/5931-831e2811b884c6c3.js","1278","static/chunks/1278-
|
|
6
|
+
6:I[21278,["7330","static/chunks/d3ac728e-7964f816a1ca64e5.js","3888","static/chunks/e868780c-1584512c612787d7.js","5931","static/chunks/5931-831e2811b884c6c3.js","1278","static/chunks/1278-5262898cb83459a6.js","8974","static/chunks/app/page-8362a772c48a922e.js"],"I18nProvider"]
|
|
7
|
+
7:I[61795,["7330","static/chunks/d3ac728e-7964f816a1ca64e5.js","3888","static/chunks/e868780c-1584512c612787d7.js","5931","static/chunks/5931-831e2811b884c6c3.js","1278","static/chunks/1278-5262898cb83459a6.js","8974","static/chunks/app/page-8362a772c48a922e.js"],"AppShell"]
|
|
8
8
|
8:I[90484,[],"OutletBoundary"]
|
|
9
9
|
a:I[90484,[],"ViewportBoundary"]
|
|
10
10
|
c:I[90484,[],"MetadataBoundary"]
|
|
@@ -15,7 +15,7 @@ e:I[27123,[],"default",1]
|
|
|
15
15
|
:HL["/_next/static/css/c32eeb8d335fb2e0.css","style"]
|
|
16
16
|
:HL["/_next/static/css/cd8a7008e750a223.css","style"]
|
|
17
17
|
:HL["/_next/static/css/58d019c61385df31.css","style"]
|
|
18
|
-
0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{},"$undefined","$undefined",4608]},"$undefined","$undefined",4624],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/88714c00e109ce28.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/c32eeb8d335fb2e0.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","2",{"rel":"stylesheet","href":"/_next/static/css/cd8a7008e750a223.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","translate":"no","className":"__variable_66b8ca notranslate","suppressHydrationWarning":true,"children":[["$","head",null,{"children":[["$","meta",null,{"name":"google","content":"notranslate"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"(function(){try{if(localStorage.getItem(\"pi-web-sarasa-enabled\")===\"1\")document.documentElement.classList.add(\"sarasa-term-webfont\");var t=localStorage.getItem(\"pi-theme\");var dark=t===\"dark\"||((t==null||t===\"\"||t===\"auto\")&&window.matchMedia(\"(prefers-color-scheme: dark)\").matches);if(dark)document.documentElement.classList.add(\"dark\");var c=dark?\"#242424\":\"#f5f5f5\";var ms=document.querySelectorAll('meta[name=\"theme-color\"]');if(ms.length===0){var m=document.createElement(\"meta\");m.name=\"theme-color\";m.content=c;document.head.appendChild(m)}else{for(var i=0;i<ms.length;i++){ms[i].removeAttribute(\"media\");ms[i].content=c}}}catch(e){}})();"}}]]}],["$","body",null,{"translate":"no","className":"notranslate","suppressHydrationWarning":true,"children":[["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}],["$","$L4",null,{}]]}]]}]]}],{"children":[["$","$1","c",{"children":[["$","$5",null,{"children":["$","$L6",null,{"children":["$","$L7",null,{}]}]}],[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/58d019c61385df31.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@9"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$La",null,{"children":"$Lb"}],["$","div",null,{"hidden":true,"children":["$","$Lc",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Ld"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$e",[]],"S":true,"h":null,"r":"$undefined","s":"$undefined","a":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"
|
|
18
|
+
0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{},"$undefined","$undefined",4608]},"$undefined","$undefined",4624],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/88714c00e109ce28.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/c32eeb8d335fb2e0.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","2",{"rel":"stylesheet","href":"/_next/static/css/cd8a7008e750a223.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","translate":"no","className":"__variable_66b8ca notranslate","suppressHydrationWarning":true,"children":[["$","head",null,{"children":[["$","meta",null,{"name":"google","content":"notranslate"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"(function(){try{if(localStorage.getItem(\"pi-web-sarasa-enabled\")===\"1\")document.documentElement.classList.add(\"sarasa-term-webfont\");var t=localStorage.getItem(\"pi-theme\");var dark=t===\"dark\"||((t==null||t===\"\"||t===\"auto\")&&window.matchMedia(\"(prefers-color-scheme: dark)\").matches);if(dark)document.documentElement.classList.add(\"dark\");var c=dark?\"#242424\":\"#f5f5f5\";var ms=document.querySelectorAll('meta[name=\"theme-color\"]');if(ms.length===0){var m=document.createElement(\"meta\");m.name=\"theme-color\";m.content=c;document.head.appendChild(m)}else{for(var i=0;i<ms.length;i++){ms[i].removeAttribute(\"media\");ms[i].content=c}}}catch(e){}})();"}}]]}],["$","body",null,{"translate":"no","className":"notranslate","suppressHydrationWarning":true,"children":[["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}],["$","$L4",null,{}]]}]]}]]}],{"children":[["$","$1","c",{"children":[["$","$5",null,{"children":["$","$L6",null,{"children":["$","$L7",null,{}]}]}],[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/58d019c61385df31.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","$L8",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@9"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$La",null,{"children":"$Lb"}],["$","div",null,{"hidden":true,"children":["$","$Lc",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Ld"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$e",[]],"S":true,"h":null,"r":"$undefined","s":"$undefined","a":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"CdvU6b-rJGcGFFwmQZ7QG"}
|
|
19
19
|
b:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"}],["$","meta","2",{"name":"theme-color","content":"#f5f5f5"}]]
|
|
20
20
|
f:I[86869,[],"IconMark"]
|
|
21
21
|
9:null
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
2
|
2:"$Sreact.suspense"
|
|
3
|
-
3:I[21278,["7330","static/chunks/d3ac728e-7964f816a1ca64e5.js","3888","static/chunks/e868780c-1584512c612787d7.js","5931","static/chunks/5931-831e2811b884c6c3.js","1278","static/chunks/1278-
|
|
4
|
-
4:I[61795,["7330","static/chunks/d3ac728e-7964f816a1ca64e5.js","3888","static/chunks/e868780c-1584512c612787d7.js","5931","static/chunks/5931-831e2811b884c6c3.js","1278","static/chunks/1278-
|
|
3
|
+
3:I[21278,["7330","static/chunks/d3ac728e-7964f816a1ca64e5.js","3888","static/chunks/e868780c-1584512c612787d7.js","5931","static/chunks/5931-831e2811b884c6c3.js","1278","static/chunks/1278-5262898cb83459a6.js","8974","static/chunks/app/page-8362a772c48a922e.js"],"I18nProvider"]
|
|
4
|
+
4:I[61795,["7330","static/chunks/d3ac728e-7964f816a1ca64e5.js","3888","static/chunks/e868780c-1584512c612787d7.js","5931","static/chunks/5931-831e2811b884c6c3.js","1278","static/chunks/1278-5262898cb83459a6.js","8974","static/chunks/app/page-8362a772c48a922e.js"],"AppShell"]
|
|
5
5
|
5:I[90484,[],"OutletBoundary"]
|
|
6
6
|
9:I[90484,[],"ViewportBoundary"]
|
|
7
7
|
a:I[90484,[],"MetadataBoundary"]
|
|
@@ -13,8 +13,8 @@ e:I[74581,[],""]
|
|
|
13
13
|
:HL["/_next/static/css/c32eeb8d335fb2e0.css","style"]
|
|
14
14
|
:HL["/_next/static/css/cd8a7008e750a223.css","style"]
|
|
15
15
|
8:X
|
|
16
|
-
0:{"buildId":"
|
|
17
|
-
14:I[57788,["7177","static/chunks/app/layout-
|
|
16
|
+
0:{"buildId":"CdvU6b-rJGcGFFwmQZ7QG","data":[{"rsc":["$","$1","c",{"children":[["$","$2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{}]}]}],[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/58d019c61385df31.css","precedence":"next"}]],["$","$L5",null,{"children":["$","$2",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],"isPartial":"$@7","staleTime":"$8","varyParams":null},{"rsc":["$","$1","h",{"children":[null,["$","$L9",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"}],["$","meta","2",{"name":"theme-color","content":"#f5f5f5"}]]}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$2",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Pi Web"}],["$","meta","1",{"name":"description","content":"Pi Web interface for the pi coding agent"}],["$","meta","2",{"name":"application-name","content":"Pi Web"}],["$","link","3",{"rel":"manifest","href":"/manifest.webmanifest"}],["$","meta","4",{"name":"format-detection","content":"telephone=no"}],["$","meta","5",{"name":"mobile-web-app-capable","content":"yes"}],["$","meta","6",{"name":"apple-mobile-web-app-title","content":"Pi Web"}],["$","meta","7",{"name":"apple-mobile-web-app-status-bar-style","content":"black-translucent"}],["$","link","8",{"rel":"icon","href":"/favicon.svg?v=b1e5fdfb","type":"image/svg+xml"}],["$","link","9",{"rel":"icon","href":"/icons/icon-192.png?v=b1e5fdfb","sizes":"192x192","type":"image/png"}],["$","link","10",{"rel":"icon","href":"/favicon.ico?v=b1e5fdfb","sizes":"any"}],["$","link","11",{"rel":"apple-touch-icon","href":"/icons/apple-touch-icon.png?v=b1e5fdfb","sizes":"180x180","type":"image/png"}],["$","$Lb","12",{}]]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"isPartial":"$@c","staleTime":"$8","varyParams":null},{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/88714c00e109ce28.css","precedence":"next"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/c32eeb8d335fb2e0.css","precedence":"next"}],["$","link","2",{"rel":"stylesheet","href":"/_next/static/css/cd8a7008e750a223.css","precedence":"next"}]],["$","html",null,{"lang":"en","translate":"no","className":"__variable_66b8ca notranslate","suppressHydrationWarning":true,"children":[["$","head",null,{"children":[["$","meta",null,{"name":"google","content":"notranslate"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"(function(){try{if(localStorage.getItem(\"pi-web-sarasa-enabled\")===\"1\")document.documentElement.classList.add(\"sarasa-term-webfont\");var t=localStorage.getItem(\"pi-theme\");var dark=t===\"dark\"||((t==null||t===\"\"||t===\"auto\")&&window.matchMedia(\"(prefers-color-scheme: dark)\").matches);if(dark)document.documentElement.classList.add(\"dark\");var c=dark?\"#242424\":\"#f5f5f5\";var ms=document.querySelectorAll('meta[name=\"theme-color\"]');if(ms.length===0){var m=document.createElement(\"meta\");m.name=\"theme-color\";m.content=c;document.head.appendChild(m)}else{for(var i=0;i<ms.length;i++){ms[i].removeAttribute(\"media\");ms[i].content=c}}}catch(e){}})();"}}]]}],["$","body",null,{"translate":"no","className":"notranslate","suppressHydrationWarning":true,"children":[["$","$Ld",null,{"parallelRouterKey":"children","template":["$","$Le",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":"$Lf"}]]}]}]],[]]}],"$L10"]}]]}]]}],"isPartial":"$@11","staleTime":"$8","varyParams":null}],"isUpgradeableISRFallback":false,"a":"$@12","rootVaryParams":null,"needsRuntimeRequest":"$@13"}
|
|
17
|
+
14:I[57788,["7177","static/chunks/app/layout-f0135b79d316ca92.js"],"PwaRegistration"]
|
|
18
18
|
6:null
|
|
19
19
|
f:["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]
|
|
20
20
|
10:["$","$L14",null,{}]
|