@qt4798/pi-web 0.18.4 → 0.18.6

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.
Files changed (88) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +18 -18
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/required-server-files.js +1 -1
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/_not-found.html +1 -1
  15. package/.next/server/app/_not-found.rsc +2 -2
  16. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  17. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  18. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  19. package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
  20. package/.next/server/app/api/agent/[id]/route.js +1 -1
  21. package/.next/server/app/api/agent/new/route.js +1 -1
  22. package/.next/server/app/api/app-update/route.js +1 -1
  23. package/.next/server/app/api/cwd/validate/route.js +1 -1
  24. package/.next/server/app/api/default-cwd/route.js +1 -1
  25. package/.next/server/app/api/files/[...path]/route.js +1 -1
  26. package/.next/server/app/api/git/diff/route.js +1 -1
  27. package/.next/server/app/api/git/push/route.js +1 -1
  28. package/.next/server/app/api/git/stash/route.js +1 -1
  29. package/.next/server/app/api/git/status/route.js +1 -1
  30. package/.next/server/app/api/import/discover/route.js +1 -1
  31. package/.next/server/app/api/logs/route.js +1 -1
  32. package/.next/server/app/api/mcp/restart/route.js +1 -1
  33. package/.next/server/app/api/mcp/route.js +1 -1
  34. package/.next/server/app/api/models-config/builtin/route.js +1 -1
  35. package/.next/server/app/api/models-config/catalog/route.js +1 -1
  36. package/.next/server/app/api/models-config/discover/route.js +1 -1
  37. package/.next/server/app/api/models-config/route.js +1 -1
  38. package/.next/server/app/api/models-config/test/route.js +1 -1
  39. package/.next/server/app/api/plugins/route.js +1 -1
  40. package/.next/server/app/api/project-state/route.js +1 -1
  41. package/.next/server/app/api/projects/visibility/route.js +1 -1
  42. package/.next/server/app/api/provider-usage/query/route.js +1 -1
  43. package/.next/server/app/api/sessions/[id]/auto-name/route.js +1 -1
  44. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  45. package/.next/server/app/api/settings/title-model/route.js +1 -1
  46. package/.next/server/app/api/skills/install/route.js +1 -1
  47. package/.next/server/app/api/skills/route.js +1 -1
  48. package/.next/server/app/api/snippets/[id]/route.js +1 -1
  49. package/.next/server/app/api/snippets/route.js +1 -1
  50. package/.next/server/app/api/subagents/settings/route.js +1 -1
  51. package/.next/server/app/api/tools/extension-tools/route.js +1 -1
  52. package/.next/server/app/api/tools/settings/route.js +1 -1
  53. package/.next/server/app/api/vision-config/route.js +1 -1
  54. package/.next/server/app/api/web-auth/route.js +1 -1
  55. package/.next/server/app/index.html +1 -1
  56. package/.next/server/app/index.rsc +4 -4
  57. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  58. package/.next/server/app/index.segments/_full.segment.rsc +4 -4
  59. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  60. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  61. package/.next/server/app/login.html +1 -1
  62. package/.next/server/app/login.rsc +2 -2
  63. package/.next/server/app/login.segments/_full.segment.rsc +2 -2
  64. package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  65. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  66. package/.next/server/app/page.js +10 -8
  67. package/.next/server/app/page_client-reference-manifest.js +1 -1
  68. package/.next/server/app-paths-manifest.json +18 -18
  69. package/.next/server/chunks/154.js +12 -11
  70. package/.next/server/chunks/4253.js +14 -11
  71. package/.next/server/chunks/440.js +1 -1
  72. package/.next/server/chunks/5725.js +1 -1
  73. package/.next/server/chunks/6429.js +8 -5
  74. package/.next/server/chunks/7915.js +1 -1
  75. package/.next/server/chunks/9332.js +1 -1
  76. package/.next/server/middleware-build-manifest.js +1 -1
  77. package/.next/server/middleware.js +1 -1
  78. package/.next/server/pages/404.html +1 -1
  79. package/.next/server/pages/500.html +1 -1
  80. package/.next/server/server-reference-manifest.json +1 -1
  81. package/.next/static/chunks/app/{page-bd73baeec065cb84.js → page-3d2a6181302c97c6.js} +10 -8
  82. package/.next/static/css/2f7c89d02f957732.css +1 -0
  83. package/.next/trace +8 -83
  84. package/.next/trace-build +1 -1
  85. package/package.json +1 -1
  86. package/.next/static/css/5418f5ea5454ad72.css +0 -1
  87. /package/.next/static/{I_FDqLx_bV7v2QRYgPTtm → cehSWrMOmfjQYl29EblqZ}/_buildManifest.js +0 -0
  88. /package/.next/static/{I_FDqLx_bV7v2QRYgPTtm → cehSWrMOmfjQYl29EblqZ}/_ssgManifest.js +0 -0
@@ -46,4 +46,4 @@ ${f}
46
46
  </html>`);return new Response(b,{headers:{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-cache","Content-Security-Policy":"default-src 'none'; img-src data:; style-src 'unsafe-inline'; base-uri 'none'; form-action 'none'; frame-ancestors 'self'","Referrer-Policy":"no-referrer","X-Content-Type-Options":"nosniff"}})}if("watch"===s){if(n&&!n.isFile())return e.NextResponse.json({error:"Not a file"},{status:400});let a=null,b=n?.mtimeMs??0,c=n?.ctimeMs??0,d=n?.ino??0,f=n?.size??0,h=void 0!==n,j=new ReadableStream({start(e){let j=(a,b)=>{let c=`event: ${a}
47
47
  data: ${JSON.stringify(b)}
48
48
 
49
- `;try{e.enqueue(new TextEncoder().encode(c))}catch{}};try{let k=i().dirname(r);(a=g().watch(k,(a,e)=>{if(null==e||(0,p.Eb)(i().join(k,e.toString()),r))try{let a=g().statSync(r);if(h&&a.mtimeMs===b&&a.ctimeMs===c&&a.ino===d&&a.size===f)return;h=!0,b=a.mtimeMs,c=a.ctimeMs,d=a.ino,f=a.size,j("change",{mtime:a.mtime.toISOString(),size:a.size})}catch{if(!h)return;h=!1,j("change",{mtime:new Date().toISOString(),size:0})}})).on("error",()=>{try{a?.close()}catch{}a=null;try{e.close()}catch{}}),j("connected",{filePath:r})}catch{j("error",{message:"Failed to watch file"}),e.close()}},cancel(){try{a?.close()}catch{}}});return new Response(j,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}})}if(!n?.isDirectory())return e.NextResponse.json({error:"Not a directory"},{status:400});let z=g().readdirSync(r,{withFileTypes:!0}).filter(a=>!F.has(a.name)&&!G.some(b=>a.name.endsWith(b))).flatMap(a=>{let b=(0,l.w)(a,i().join(r,a.name));return null===b?[]:[{name:a.name,isDir:b,size:0,modified:""}]}).sort((a,b)=>a.isDir!==b.isDir?a.isDir?-1:1:a.name.localeCompare(b.name));return e.NextResponse.json({entries:z,path:r})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},35082:(a,b,c)=>{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/files/[...path]/route",pathname:"/api/files/[...path]",filename:"route",bundlePath:"app/api/files/[...path]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/files/[...path]/route.ts",nextConfigOutput:"standalone",userland:()=>c(1304),...{}}),{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/files/[...path]/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)}}},37688:(a,b,c)=>{c.d(b,{P:()=>g});var d=c(29021),e=c.n(d),f=c(1060);function g(a,b,c){let d,g=Math.min(f._4+1,b-c),h=Buffer.alloc(g),i=e().openSync(a,"r");try{d=e().readSync(i,h,0,g,c)}finally{e().closeSync(i)}let j=Math.min(d,f._4);if(c+j<b){var k;let a=j;for(;a>j-3&&(192&h[a])==128;)a--;((224&(k=h[a]))==192?2:(240&k)==224?3:(248&k)==240?4:1)>j-a&&(j=a)}let l=c+j;return{content:h.toString("utf8",0,j),nextOffset:l,truncated:l<b}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},49180:(a,b,c)=>{c.d(b,{ah:()=>e,iX:()=>h,j1:()=>i});let d=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function e(a){return!!a&&d.test(a)}function f(a){return a.replace(/\\/g,"/")}function g(a){return/[A-Za-z0-9._~+%@/\\:-]/.test(a)}function h(a,b){for(let c of b){let b=[];if(!function a(b,c){if("string"==typeof b)return void c.push(b);if(b&&"object"==typeof b){if(Array.isArray(b)){for(let d of b)a(d,c);return}for(let d of Object.values(b))a(d,c)}}(c,b),b.some(b=>(function(a,b){let c=f(b),d=c.startsWith("/")?[c,`file://${c}`]:[c];for(let b of new Set([f(a),f(function(a){try{return decodeURIComponent(a)}catch{return a}}(a))]))for(let a of d){let c=b.indexOf(a);for(;-1!==c;){let d=0===c?"":b[c-1],e=c+a.length;if((0===c||!g(d))&&function(a,b){if(b>=a.length)return!0;let c=a[b];return":"===c?/\d/.test(a[b+1]??""):!g(c)}(b,e))return!0;c=b.indexOf(a,c+1)}}return!1})(b,a)))return!0}return!1}function i(a,b){return b.some(b=>"message"===b.type&&b.message?.role==="bashExecution"&&b.message.fullOutputPath===a)}},51455:a=>{a.exports=require("node:fs/promises")},55484:(a,b,c)=>{c.d(b,{Ey:()=>k,Gu:()=>m,KB:()=>i,SI:()=>l,wY:()=>h});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f);let h=0x1900000,i=0x6400000,j=new Set(["error","overwrite","skip"]);function k(a){let b=a??"error";return j.has(b)?b:null}function l(a){if(0===a.length)return"No files selected";let b=new Set;for(let c of a){if(!c||"."===c||".."===c||c.includes("\0"))return`Invalid file name: ${c||"(empty)"}`;if(c.includes("/")||c.includes("\\")||g().basename(c)!==c)return`File names must not contain a path: ${c}`;if(b.has(c))return`Duplicate file name in upload: ${c}`;b.add(c)}return null}function m(a,b){let c=[],d=[];for(let f of b){let b,h=g().join(a,f);try{b=e().lstatSync(h)}catch(a){if("ENOENT"===a.code)continue;throw a}c.push(f),(!b.isFile()||b.isSymbolicLink())&&d.push(f)}return{conflicts:c,nonReplaceable:d}}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64681:(a,b,c)=>{c.d(b,{y:()=>d});function d(){let a=process.env.NEXT_PUBLIC_PI_WEB_FILE_EDITING;return!!a&&["1","true","yes","on"].includes(a.trim().toLowerCase())}},65630:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Iq:()=>h,jV:()=>i});var e=c(40402),f=c(49180),g=a([e]);async function h(a,b){if(!(0,f.ah)(b))return!1;try{let c=await (0,e.os)(b);if(!c)return!1;return(0,f.iX)(a,(0,e.DK)(c))}catch{return!1}}async function i(a,b){if(!(0,f.ah)(b))return!1;try{let c=await (0,e.os)(b);if(!c)return!1;return(0,f.j1)(a,(0,e.DK)(c))}catch{return!1}}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},66544:(a,b,c)=>{c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b){let c,d;try{c=new URL(a),d=new URL(b)}catch{return!1}if(c.protocol!==d.protocol||c.hostname.toLowerCase()!==d.hostname.toLowerCase())return!1;if(!c.port)return!0;let e=d.port||("https:"===d.protocol?"443":"80");return c.port===e}(e,f)))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},80547:(a,b,c)=>{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)}})},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88473:(a,b,c)=>{c.d(b,{w:()=>f});var d=c(29021),e=c.n(d);function f(a,b){if(a.isDirectory())return!0;if(a.isFile())return!1;try{return e().statSync(b).isDirectory()}catch{return null}}},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5582],()=>b(b.s=35082));module.exports=c})();
49
+ `;try{e.enqueue(new TextEncoder().encode(c))}catch{}};try{let k=i().dirname(r);(a=g().watch(k,(a,e)=>{if(null==e||(0,p.Eb)(i().join(k,e.toString()),r))try{let a=g().statSync(r);if(h&&a.mtimeMs===b&&a.ctimeMs===c&&a.ino===d&&a.size===f)return;h=!0,b=a.mtimeMs,c=a.ctimeMs,d=a.ino,f=a.size,j("change",{mtime:a.mtime.toISOString(),size:a.size})}catch{if(!h)return;h=!1,j("change",{mtime:new Date().toISOString(),size:0})}})).on("error",()=>{try{a?.close()}catch{}a=null;try{e.close()}catch{}}),j("connected",{filePath:r})}catch{j("error",{message:"Failed to watch file"}),e.close()}},cancel(){try{a?.close()}catch{}}});return new Response(j,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}})}if(!n?.isDirectory())return e.NextResponse.json({error:"Not a directory"},{status:400});let z=g().readdirSync(r,{withFileTypes:!0}).filter(a=>!F.has(a.name)&&!G.some(b=>a.name.endsWith(b))).flatMap(a=>{let b=(0,l.w)(a,i().join(r,a.name));return null===b?[]:[{name:a.name,isDir:b,size:0,modified:""}]}).sort((a,b)=>a.isDir!==b.isDir?a.isDir?-1:1:a.name.localeCompare(b.name));return e.NextResponse.json({entries:z,path:r})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},35082:(a,b,c)=>{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/files/[...path]/route",pathname:"/api/files/[...path]",filename:"route",bundlePath:"app/api/files/[...path]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/files/[...path]/route.ts",nextConfigOutput:"standalone",userland:()=>c(1304),...{}}),{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/files/[...path]/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)}}},37688:(a,b,c)=>{c.d(b,{P:()=>g});var d=c(29021),e=c.n(d),f=c(1060);function g(a,b,c){let d,g=Math.min(f._4+1,b-c),h=Buffer.alloc(g),i=e().openSync(a,"r");try{d=e().readSync(i,h,0,g,c)}finally{e().closeSync(i)}let j=Math.min(d,f._4);if(c+j<b){var k;let a=j;for(;a>j-3&&(192&h[a])==128;)a--;((224&(k=h[a]))==192?2:(240&k)==224?3:(248&k)==240?4:1)>j-a&&(j=a)}let l=c+j;return{content:h.toString("utf8",0,j),nextOffset:l,truncated:l<b}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},49180:(a,b,c)=>{c.d(b,{ah:()=>e,iX:()=>h,j1:()=>i});let d=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function e(a){return!!a&&d.test(a)}function f(a){return a.replace(/\\/g,"/")}function g(a){return/[A-Za-z0-9._~+%@/\\:-]/.test(a)}function h(a,b){for(let c of b){let b=[];if(!function a(b,c){if("string"==typeof b)return void c.push(b);if(b&&"object"==typeof b){if(Array.isArray(b)){for(let d of b)a(d,c);return}for(let d of Object.values(b))a(d,c)}}(c,b),b.some(b=>(function(a,b){let c=f(b),d=c.startsWith("/")?[c,`file://${c}`]:[c];for(let b of new Set([f(a),f(function(a){try{return decodeURIComponent(a)}catch{return a}}(a))]))for(let a of d){let c=b.indexOf(a);for(;-1!==c;){let d=0===c?"":b[c-1],e=c+a.length;if((0===c||!g(d))&&function(a,b){if(b>=a.length)return!0;let c=a[b];return":"===c?/\d/.test(a[b+1]??""):!g(c)}(b,e))return!0;c=b.indexOf(a,c+1)}}return!1})(b,a)))return!0}return!1}function i(a,b){return b.some(b=>"message"===b.type&&b.message?.role==="bashExecution"&&b.message.fullOutputPath===a)}},51455:a=>{a.exports=require("node:fs/promises")},55484:(a,b,c)=>{c.d(b,{Ey:()=>k,Gu:()=>m,KB:()=>i,SI:()=>l,wY:()=>h});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f);let h=0x1900000,i=0x6400000,j=new Set(["error","overwrite","skip"]);function k(a){let b=a??"error";return j.has(b)?b:null}function l(a){if(0===a.length)return"No files selected";let b=new Set;for(let c of a){if(!c||"."===c||".."===c||c.includes("\0"))return`Invalid file name: ${c||"(empty)"}`;if(c.includes("/")||c.includes("\\")||g().basename(c)!==c)return`File names must not contain a path: ${c}`;if(b.has(c))return`Duplicate file name in upload: ${c}`;b.add(c)}return null}function m(a,b){let c=[],d=[];for(let f of b){let b,h=g().join(a,f);try{b=e().lstatSync(h)}catch(a){if("ENOENT"===a.code)continue;throw a}c.push(f),(!b.isFile()||b.isSymbolicLink())&&d.push(f)}return{conflicts:c,nonReplaceable:d}}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64681:(a,b,c)=>{c.d(b,{y:()=>d});function d(){let a=process.env.NEXT_PUBLIC_PI_WEB_FILE_EDITING;return!!a&&["1","true","yes","on"].includes(a.trim().toLowerCase())}},65630:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Iq:()=>h,jV:()=>i});var e=c(40402),f=c(49180),g=a([e]);async function h(a,b){if(!(0,f.ah)(b))return!1;try{let c=await (0,e.os)(b);if(!c)return!1;return(0,f.iX)(a,(0,e.DK)(c))}catch{return!1}}async function i(a,b){if(!(0,f.ah)(b))return!1;try{let c=await (0,e.os)(b);if(!c)return!1;return(0,f.j1)(a,(0,e.DK)(c))}catch{return!1}}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},66544:(a,b,c)=>{c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b,c){let d,e;try{d=new URL(a),e=new URL(b)}catch{return!1}if(d.protocol!==e.protocol||d.hostname.toLowerCase()!==e.hostname.toLowerCase())return!1;if(!d.port)return"same-origin"===c;let f=e.port||("https:"===e.protocol?"443":"80");return d.port===f}(e,f,a.headers.get("sec-fetch-site"))))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},79428:a=>{a.exports=require("buffer")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},80547:(a,b,c)=>{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)}})},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88473:(a,b,c)=>{c.d(b,{w:()=>f});var d=c(29021),e=c.n(d);function f(a,b){if(a.isDirectory())return!0;if(a.isFile())return!1;try{return e().statSync(b).isDirectory()}catch{return null}}},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5582],()=>b(b.s=35082));module.exports=c})();
@@ -3,4 +3,4 @@ new file mode 100644
3
3
  --- /dev/null
4
4
  +++ b/${a}
5
5
  @@ -0,0 +1,${d.length} @@
6
- ${e}${f}`}async function z(a,b,c){try{return await m(a,["diff","--no-color","--no-ext-diff","--unified=3","HEAD","--",...c&&c!==b?[c,b]:[b]],4*i._4)}catch{return null}}async function A(a,b){let c,d=p(a),f=await n(d),h=g().resolve(d,g().relative(g().resolve(a),g().resolve(b)));if(!f||!o(f,h))return{supported:!1};let j=q(g().relative(f,h)),l=(await r(f)).find(a=>a.path===j);if(!l)return{supported:!1};let{status:m}=k(l);if("deleted"===m){let a=await z(f,j,l.originalPath);return a?.includes("\n@@ ")?{supported:!0,status:m,patch:a}:{supported:!1}}try{c=(0,e.lstatSync)(h)}catch{return{supported:!1}}if(!c.isFile()||c.size>i._4)return{supported:!1};let s=(0,e.readFileSync)(h);if(t(s))return{supported:!1};let u=s.toString("utf8"),v="untracked"===m?y(j,u):await z(f,j,l.originalPath)??("added"===m?y(j,u):null);return v?.includes("\n@@ ")?{supported:!0,status:m,patch:v}:{supported:!1}}},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b){let c,d;try{c=new URL(a),d=new URL(b)}catch{return!1}if(c.protocol!==d.protocol||c.hostname.toLowerCase()!==d.hostname.toLowerCase())return!1;if(!c.port)return!0;let e=d.port||("https:"===d.protocol?"443":"80");return c.port===e}(e,f)))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},80547:(a,b,c)=>{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)}})},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94551:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>n,dynamic:()=>o});var e=c(79748),f=c(33873),g=c.n(f),h=c(23211),i=c(80547),j=c(33012),k=c(66544),l=a([i]);i=(l.then?(await l)():l)[0];let o="force-dynamic";function m(a){return a.startsWith("/")||(0,i.uK)(a)}async function n(a){if(!(0,k.EN)(a))return h.NextResponse.json({error:"Untrusted API request"},{status:403});try{let b=new URL(a.url).searchParams,c=b.get("cwd")?.trim()??"",d=b.get("path")?.trim()??"";if(!m(c)||!m(d))return h.NextResponse.json({error:"cwd and path must be absolute paths"},{status:400});let f=g().resolve(c),k=g().resolve(d),l=await (0,i.mc)();if(!(0,i.A$)(f,l)||!(0,i.A$)(k,l))return h.NextResponse.json({error:"Access denied"},{status:403});try{if(!(await (0,e.stat)(f)).isDirectory())return h.NextResponse.json({error:"cwd must be a directory"},{status:400})}catch{return h.NextResponse.json({error:"Directory not found"},{status:404})}return h.NextResponse.json(await (0,j.S)(f,k))}catch(a){return h.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5582],()=>b(b.s=23020));module.exports=c})();
6
+ ${e}${f}`}async function z(a,b,c){try{return await m(a,["diff","--no-color","--no-ext-diff","--unified=3","HEAD","--",...c&&c!==b?[c,b]:[b]],4*i._4)}catch{return null}}async function A(a,b){let c,d=p(a),f=await n(d),h=g().resolve(d,g().relative(g().resolve(a),g().resolve(b)));if(!f||!o(f,h))return{supported:!1};let j=q(g().relative(f,h)),l=(await r(f)).find(a=>a.path===j);if(!l)return{supported:!1};let{status:m}=k(l);if("deleted"===m){let a=await z(f,j,l.originalPath);return a?.includes("\n@@ ")?{supported:!0,status:m,patch:a}:{supported:!1}}try{c=(0,e.lstatSync)(h)}catch{return{supported:!1}}if(!c.isFile()||c.size>i._4)return{supported:!1};let s=(0,e.readFileSync)(h);if(t(s))return{supported:!1};let u=s.toString("utf8"),v="untracked"===m?y(j,u):await z(f,j,l.originalPath)??("added"===m?y(j,u):null);return v?.includes("\n@@ ")?{supported:!0,status:m,patch:v}:{supported:!1}}},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b,c){let d,e;try{d=new URL(a),e=new URL(b)}catch{return!1}if(d.protocol!==e.protocol||d.hostname.toLowerCase()!==e.hostname.toLowerCase())return!1;if(!d.port)return"same-origin"===c;let f=e.port||("https:"===e.protocol?"443":"80");return d.port===f}(e,f,a.headers.get("sec-fetch-site"))))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},80547:(a,b,c)=>{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)}})},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94551:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>n,dynamic:()=>o});var e=c(79748),f=c(33873),g=c.n(f),h=c(23211),i=c(80547),j=c(33012),k=c(66544),l=a([i]);i=(l.then?(await l)():l)[0];let o="force-dynamic";function m(a){return a.startsWith("/")||(0,i.uK)(a)}async function n(a){if(!(0,k.EN)(a))return h.NextResponse.json({error:"Untrusted API request"},{status:403});try{let b=new URL(a.url).searchParams,c=b.get("cwd")?.trim()??"",d=b.get("path")?.trim()??"";if(!m(c)||!m(d))return h.NextResponse.json({error:"cwd and path must be absolute paths"},{status:400});let f=g().resolve(c),k=g().resolve(d),l=await (0,i.mc)();if(!(0,i.A$)(f,l)||!(0,i.A$)(k,l))return h.NextResponse.json({error:"Access denied"},{status:403});try{if(!(await (0,e.stat)(f)).isDirectory())return h.NextResponse.json({error:"cwd must be a directory"},{status:400})}catch{return h.NextResponse.json({error:"Directory not found"},{status:404})}return h.NextResponse.json(await (0,j.S)(f,k))}catch(a){return h.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5582],()=>b(b.s=23020));module.exports=c})();
@@ -1,2 +1,2 @@
1
1
  (()=>{var a={};a.id=1993,a.ids=[1993],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1005:(a,b,c)=>{"use strict";c.d(b,{VM:()=>k,X_:()=>j,Z3:()=>g,mP:()=>h,oC:()=>i});var d=c(79646);let e=(0,c(28354).promisify)(d.execFile);async function f(a,b){let{stdout:c,stderr:d}=await e("git",["-C",a,...b],{timeout:6e4,maxBuffer:4194304,env:{...process.env,LC_ALL:"C"}});return`${c??""}${d?`
2
- ${d}`:""}`.trim()}async function g(a){try{let b=await f(a,["rev-parse","--abbrev-ref","HEAD"]).catch(()=>""),c=await f(a,["push"]);return{ok:!0,output:c,branch:b||null}}catch(a){return{ok:!1,output:a instanceof Error?a.message:String(a),branch:null}}}async function h(a){let b=await f(a,["stash","list","--format=%gd|%H|%gs"]).catch(()=>"");return b?b.split("\n").filter(Boolean).map(a=>{let[b,c,...d]=a.split("|");return{index:b??"",ref:c??"",message:d.join("|")??""}}):[]}async function i(a,b){let c=["stash","push"];return b?.trim()&&c.push("-m",b.trim()),f(a,c)}async function j(a,b){return f(a,["stash","drop",b])}async function k(a,b){return f(a,["stash","pop",b])}},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")},12582:(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/git/push/route",pathname:"/api/git/push",filename:"route",bundlePath:"app/api/git/push/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/git/push/route.ts",nextConfigOutput:"standalone",userland:()=>c(96920),...{}}),{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/git/push/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)}}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},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")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b){let c,d;try{c=new URL(a),d=new URL(b)}catch{return!1}if(c.protocol!==d.protocol||c.hostname.toLowerCase()!==d.hostname.toLowerCase())return!1;if(!c.port)return!0;let e=d.port||("https:"===d.protocol?"443":"80");return c.port===e}(e,f)))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{},96920:(a,b,c)=>{"use strict";c.r(b),c.d(b,{POST:()=>i,dynamic:()=>h});var d=c(23211),e=c(29021),f=c(66544),g=c(1005);let h="force-dynamic";async function i(a){if(!(0,f.EN)(a))return d.NextResponse.json({error:"Access denied"},{status:403});try{let b=new URL(a.url).searchParams.get("cwd");if(!b||!(0,e.existsSync)(b))return d.NextResponse.json({error:"Invalid cwd"},{status:400});let c=await (0,g.Z3)(b);if(!c.ok)return d.NextResponse.json({ok:!1,error:c.output,branch:c.branch},{status:502});return d.NextResponse.json({ok:!0,output:c.output,branch:c.branch})}catch(b){let a=b instanceof Error?b.message:String(b);return d.NextResponse.json({error:a},{status:500})}}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=12582));module.exports=c})();
2
+ ${d}`:""}`.trim()}async function g(a){try{let b=await f(a,["rev-parse","--abbrev-ref","HEAD"]).catch(()=>""),c=await f(a,["push"]);return{ok:!0,output:c,branch:b||null}}catch(a){return{ok:!1,output:a instanceof Error?a.message:String(a),branch:null}}}async function h(a){let b=await f(a,["stash","list","--format=%gd|%H|%gs"]).catch(()=>"");return b?b.split("\n").filter(Boolean).map(a=>{let[b,c,...d]=a.split("|");return{index:b??"",ref:c??"",message:d.join("|")??""}}):[]}async function i(a,b){let c=["stash","push"];return b?.trim()&&c.push("-m",b.trim()),f(a,c)}async function j(a,b){return f(a,["stash","drop",b])}async function k(a,b){return f(a,["stash","pop",b])}},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")},12582:(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/git/push/route",pathname:"/api/git/push",filename:"route",bundlePath:"app/api/git/push/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/git/push/route.ts",nextConfigOutput:"standalone",userland:()=>c(96920),...{}}),{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/git/push/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)}}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},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")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b,c){let d,e;try{d=new URL(a),e=new URL(b)}catch{return!1}if(d.protocol!==e.protocol||d.hostname.toLowerCase()!==e.hostname.toLowerCase())return!1;if(!d.port)return"same-origin"===c;let f=e.port||("https:"===e.protocol?"443":"80");return d.port===f}(e,f,a.headers.get("sec-fetch-site"))))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{},96920:(a,b,c)=>{"use strict";c.r(b),c.d(b,{POST:()=>i,dynamic:()=>h});var d=c(23211),e=c(29021),f=c(66544),g=c(1005);let h="force-dynamic";async function i(a){if(!(0,f.EN)(a))return d.NextResponse.json({error:"Access denied"},{status:403});try{let b=new URL(a.url).searchParams.get("cwd");if(!b||!(0,e.existsSync)(b))return d.NextResponse.json({error:"Invalid cwd"},{status:400});let c=await (0,g.Z3)(b);if(!c.ok)return d.NextResponse.json({ok:!1,error:c.output,branch:c.branch},{status:502});return d.NextResponse.json({ok:!0,output:c.output,branch:c.branch})}catch(b){let a=b instanceof Error?b.message:String(b);return d.NextResponse.json({error:a},{status:500})}}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=12582));module.exports=c})();
@@ -1,2 +1,2 @@
1
1
  (()=>{var a={};a.id=9912,a.ids=[9912],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1005:(a,b,c)=>{"use strict";c.d(b,{VM:()=>k,X_:()=>j,Z3:()=>g,mP:()=>h,oC:()=>i});var d=c(79646);let e=(0,c(28354).promisify)(d.execFile);async function f(a,b){let{stdout:c,stderr:d}=await e("git",["-C",a,...b],{timeout:6e4,maxBuffer:4194304,env:{...process.env,LC_ALL:"C"}});return`${c??""}${d?`
2
- ${d}`:""}`.trim()}async function g(a){try{let b=await f(a,["rev-parse","--abbrev-ref","HEAD"]).catch(()=>""),c=await f(a,["push"]);return{ok:!0,output:c,branch:b||null}}catch(a){return{ok:!1,output:a instanceof Error?a.message:String(a),branch:null}}}async function h(a){let b=await f(a,["stash","list","--format=%gd|%H|%gs"]).catch(()=>"");return b?b.split("\n").filter(Boolean).map(a=>{let[b,c,...d]=a.split("|");return{index:b??"",ref:c??"",message:d.join("|")??""}}):[]}async function i(a,b){let c=["stash","push"];return b?.trim()&&c.push("-m",b.trim()),f(a,c)}async function j(a,b){return f(a,["stash","drop",b])}async function k(a,b){return f(a,["stash","pop",b])}},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")},11947:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>j,POST:()=>k,dynamic:()=>h});var d=c(23211),e=c(29021),f=c(66544),g=c(1005);let h="force-dynamic";function i(a){let b=new URL(a.url).searchParams.get("cwd");return b&&(0,e.existsSync)(b)?b:null}async function j(a){if(!(0,f.EN)(a))return d.NextResponse.json({error:"Access denied"},{status:403});let b=i(a);if(!b)return d.NextResponse.json({error:"Invalid cwd"},{status:400});try{let a=await (0,g.mP)(b);return d.NextResponse.json({entries:a})}catch(b){let a=b instanceof Error?b.message:String(b);return d.NextResponse.json({error:a},{status:500})}}async function k(a){if(!(0,f.EN)(a))return d.NextResponse.json({error:"Access denied"},{status:403});if(!(0,f.E2)(a))return d.NextResponse.json({error:"Expected application/json"},{status:415});let b=i(a);if(!b)return d.NextResponse.json({error:"Invalid cwd"},{status:400});try{let c=await a.json(),e=c.action;if("push"===e){let a=await (0,g.oC)(b,c.message);return d.NextResponse.json({ok:!0,output:a})}if("drop"===e){if(!c.ref)return d.NextResponse.json({error:"ref is required"},{status:400});let a=await (0,g.X_)(b,c.ref);return d.NextResponse.json({ok:!0,output:a})}if("pop"===e){if(!c.ref)return d.NextResponse.json({error:"ref is required"},{status:400});let a=await (0,g.VM)(b,c.ref);return d.NextResponse.json({ok:!0,output:a})}return d.NextResponse.json({error:"Unknown action"},{status:400})}catch(b){let a=b instanceof Error?b.message:String(b);return d.NextResponse.json({error:a},{status:500})}}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29252:(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/git/stash/route",pathname:"/api/git/stash",filename:"route",bundlePath:"app/api/git/stash/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/git/stash/route.ts",nextConfigOutput:"standalone",userland:()=>c(11947),...{}}),{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/git/stash/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)}}},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b){let c,d;try{c=new URL(a),d=new URL(b)}catch{return!1}if(c.protocol!==d.protocol||c.hostname.toLowerCase()!==d.hostname.toLowerCase())return!1;if(!c.port)return!0;let e=d.port||("https:"===d.protocol?"443":"80");return c.port===e}(e,f)))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=29252));module.exports=c})();
2
+ ${d}`:""}`.trim()}async function g(a){try{let b=await f(a,["rev-parse","--abbrev-ref","HEAD"]).catch(()=>""),c=await f(a,["push"]);return{ok:!0,output:c,branch:b||null}}catch(a){return{ok:!1,output:a instanceof Error?a.message:String(a),branch:null}}}async function h(a){let b=await f(a,["stash","list","--format=%gd|%H|%gs"]).catch(()=>"");return b?b.split("\n").filter(Boolean).map(a=>{let[b,c,...d]=a.split("|");return{index:b??"",ref:c??"",message:d.join("|")??""}}):[]}async function i(a,b){let c=["stash","push"];return b?.trim()&&c.push("-m",b.trim()),f(a,c)}async function j(a,b){return f(a,["stash","drop",b])}async function k(a,b){return f(a,["stash","pop",b])}},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")},11947:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GET:()=>j,POST:()=>k,dynamic:()=>h});var d=c(23211),e=c(29021),f=c(66544),g=c(1005);let h="force-dynamic";function i(a){let b=new URL(a.url).searchParams.get("cwd");return b&&(0,e.existsSync)(b)?b:null}async function j(a){if(!(0,f.EN)(a))return d.NextResponse.json({error:"Access denied"},{status:403});let b=i(a);if(!b)return d.NextResponse.json({error:"Invalid cwd"},{status:400});try{let a=await (0,g.mP)(b);return d.NextResponse.json({entries:a})}catch(b){let a=b instanceof Error?b.message:String(b);return d.NextResponse.json({error:a},{status:500})}}async function k(a){if(!(0,f.EN)(a))return d.NextResponse.json({error:"Access denied"},{status:403});if(!(0,f.E2)(a))return d.NextResponse.json({error:"Expected application/json"},{status:415});let b=i(a);if(!b)return d.NextResponse.json({error:"Invalid cwd"},{status:400});try{let c=await a.json(),e=c.action;if("push"===e){let a=await (0,g.oC)(b,c.message);return d.NextResponse.json({ok:!0,output:a})}if("drop"===e){if(!c.ref)return d.NextResponse.json({error:"ref is required"},{status:400});let a=await (0,g.X_)(b,c.ref);return d.NextResponse.json({ok:!0,output:a})}if("pop"===e){if(!c.ref)return d.NextResponse.json({error:"ref is required"},{status:400});let a=await (0,g.VM)(b,c.ref);return d.NextResponse.json({ok:!0,output:a})}return d.NextResponse.json({error:"Unknown action"},{status:400})}catch(b){let a=b instanceof Error?b.message:String(b);return d.NextResponse.json({error:a},{status:500})}}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29252:(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/git/stash/route",pathname:"/api/git/stash",filename:"route",bundlePath:"app/api/git/stash/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/git/stash/route.ts",nextConfigOutput:"standalone",userland:()=>c(11947),...{}}),{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/git/stash/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)}}},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b,c){let d,e;try{d=new URL(a),e=new URL(b)}catch{return!1}if(d.protocol!==e.protocol||d.hostname.toLowerCase()!==e.hostname.toLowerCase())return!1;if(!d.port)return"same-origin"===c;let f=e.port||("https:"===e.protocol?"443":"80");return d.port===f}(e,f,a.headers.get("sec-fetch-site"))))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=29252));module.exports=c})();
@@ -3,4 +3,4 @@ new file mode 100644
3
3
  --- /dev/null
4
4
  +++ b/${a}
5
5
  @@ -0,0 +1,${d.length} @@
6
- ${e}${f}`}async function z(a,b,c){try{return await m(a,["diff","--no-color","--no-ext-diff","--unified=3","HEAD","--",...c&&c!==b?[c,b]:[b]],4*i._4)}catch{return null}}async function A(a,b){let c,d=p(a),f=await n(d),h=g().resolve(d,g().relative(g().resolve(a),g().resolve(b)));if(!f||!o(f,h))return{supported:!1};let j=q(g().relative(f,h)),l=(await r(f)).find(a=>a.path===j);if(!l)return{supported:!1};let{status:m}=k(l);if("deleted"===m){let a=await z(f,j,l.originalPath);return a?.includes("\n@@ ")?{supported:!0,status:m,patch:a}:{supported:!1}}try{c=(0,e.lstatSync)(h)}catch{return{supported:!1}}if(!c.isFile()||c.size>i._4)return{supported:!1};let s=(0,e.readFileSync)(h);if(t(s))return{supported:!1};let u=s.toString("utf8"),v="untracked"===m?y(j,u):await z(f,j,l.originalPath)??("added"===m?y(j,u):null);return v?.includes("\n@@ ")?{supported:!0,status:m,patch:v}:{supported:!1}}},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b){let c,d;try{c=new URL(a),d=new URL(b)}catch{return!1}if(c.protocol!==d.protocol||c.hostname.toLowerCase()!==d.hostname.toLowerCase())return!1;if(!c.port)return!0;let e=d.port||("https:"===d.protocol?"443":"80");return c.port===e}(e,f)))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},80547:(a,b,c)=>{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)}})},81115:a=>{a.exports=require("constants")},83518:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>m,dynamic:()=>n});var e=c(79748),f=c(33873),g=c.n(f),h=c(23211),i=c(80547),j=c(33012),k=c(66544),l=a([i]);i=(l.then?(await l)():l)[0];let n="force-dynamic";async function m(a){if(!(0,k.EN)(a))return h.NextResponse.json({error:"Untrusted API request"},{status:403});try{let b=new URL(a.url).searchParams.get("cwd")?.trim()??"";if(!(b.startsWith("/")||(0,i.uK)(b)))return h.NextResponse.json({error:"cwd must be an absolute path"},{status:400});let c=g().resolve(b),d=await (0,i.mc)();if(!(0,i.A$)(c,d))return h.NextResponse.json({error:"Access denied"},{status:403});try{if(!(await (0,e.stat)(c)).isDirectory())return h.NextResponse.json({error:"Not a directory"},{status:400})}catch{return h.NextResponse.json({error:"Directory not found"},{status:404})}return h.NextResponse.json(await (0,j.$)(c))}catch(a){return h.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5582],()=>b(b.s=32498));module.exports=c})();
6
+ ${e}${f}`}async function z(a,b,c){try{return await m(a,["diff","--no-color","--no-ext-diff","--unified=3","HEAD","--",...c&&c!==b?[c,b]:[b]],4*i._4)}catch{return null}}async function A(a,b){let c,d=p(a),f=await n(d),h=g().resolve(d,g().relative(g().resolve(a),g().resolve(b)));if(!f||!o(f,h))return{supported:!1};let j=q(g().relative(f,h)),l=(await r(f)).find(a=>a.path===j);if(!l)return{supported:!1};let{status:m}=k(l);if("deleted"===m){let a=await z(f,j,l.originalPath);return a?.includes("\n@@ ")?{supported:!0,status:m,patch:a}:{supported:!1}}try{c=(0,e.lstatSync)(h)}catch{return{supported:!1}}if(!c.isFile()||c.size>i._4)return{supported:!1};let s=(0,e.readFileSync)(h);if(t(s))return{supported:!1};let u=s.toString("utf8"),v="untracked"===m?y(j,u):await z(f,j,l.originalPath)??("added"===m?y(j,u):null);return v?.includes("\n@@ ")?{supported:!0,status:m,patch:v}:{supported:!1}}},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b,c){let d,e;try{d=new URL(a),e=new URL(b)}catch{return!1}if(d.protocol!==e.protocol||d.hostname.toLowerCase()!==e.hostname.toLowerCase())return!1;if(!d.port)return"same-origin"===c;let f=e.port||("https:"===e.protocol?"443":"80");return d.port===f}(e,f,a.headers.get("sec-fetch-site"))))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},80547:(a,b,c)=>{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)}})},81115:a=>{a.exports=require("constants")},83518:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>m,dynamic:()=>n});var e=c(79748),f=c(33873),g=c.n(f),h=c(23211),i=c(80547),j=c(33012),k=c(66544),l=a([i]);i=(l.then?(await l)():l)[0];let n="force-dynamic";async function m(a){if(!(0,k.EN)(a))return h.NextResponse.json({error:"Untrusted API request"},{status:403});try{let b=new URL(a.url).searchParams.get("cwd")?.trim()??"";if(!(b.startsWith("/")||(0,i.uK)(b)))return h.NextResponse.json({error:"cwd must be an absolute path"},{status:400});let c=g().resolve(b),d=await (0,i.mc)();if(!(0,i.A$)(c,d))return h.NextResponse.json({error:"Access denied"},{status:403});try{if(!(await (0,e.stat)(c)).isDirectory())return h.NextResponse.json({error:"Not a directory"},{status:400})}catch{return h.NextResponse.json({error:"Directory not found"},{status:404})}return h.NextResponse.json(await (0,j.$)(c))}catch(a){return h.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,5582],()=>b(b.s=32498));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=8149,a.ids=[8149],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},49228:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{I6:()=>o,Ol:()=>l,Ts:()=>q,mO:()=>p});var e=c(21820),f=c(33873),g=c(29021),h=c(75430),i=a([h]);function j(){let a=[],b=process.env.APPDATA;return b&&b.length>0&&a.push((0,f.join)(b,"reasonix")),a.push((0,f.join)((0,e.homedir)(),".reasonix")),a.filter((b,c)=>a.indexOf(b)===c)}h=(i.then?(await i)():i)[0];let r=[".events.jsonl",".conflicts.jsonl",".telemetry.json",".recovery.json",".goal-state.json",".event-index.json",".recovery.jsonl",".ckpt",".meta",".lock",".lease.json",".lease.lock",".jobs"];function k(a){if(!a.endsWith(".jsonl"))return!1;for(let b of r)if(a.endsWith(b))return!1;return!0}function l(a){let b=a.replace(/^-/,"").replace(/^[/\\]/,"").replace(/[/\\:]/g,"-");return`--${b}--`}let s=(0,f.join)((0,h.getAgentDir)(),"sessions");function m(a){return(0,g.existsSync)((0,f.join)(s,a))}function n(a){try{return(0,g.readdirSync)((0,f.join)(s,a)).filter(a=>a.endsWith(".jsonl")).length}catch{return 0}}function o(){let a=(0,g.existsSync)(function(){for(let a of j()){let b=(0,f.join)(a,"projects");if((0,g.existsSync)(b))return b}return(0,f.join)(j()[0],"projects")}())||(0,g.existsSync)(function(){for(let a of j()){let b=(0,f.join)(a,"sessions");if((0,g.existsSync)(b))return b}return(0,f.join)(j()[0],"sessions")}());return[{key:"reasonix",label:"Reasonix",available:a,status:a?"available":"unavailable"},{key:"codex",label:"Codex",available:!1,status:"coming-soon"},{key:"opencode",label:"OpenCode",available:!1,status:"coming-soon"},{key:"claude",label:"Claude Code",available:!1,status:"coming-soon"}]}function p(a){if(!a||a.split(/[\\/]/).some(a=>""===a||"."===a||".."===a))return null;for(let b of j()){let c=(0,f.join)(b,"projects",a,"sessions");if((0,g.existsSync)(c))try{let a=(0,g.readdirSync)(c).filter(k);return{sessionsDir:c,files:a,flat:!1}}catch{return null}}for(let b of j()){let c=(0,f.join)(b,"sessions");if((0,g.existsSync)(c))try{let b=`${a}-`,d=(0,g.readdirSync)(c).filter(a=>k(a)&&a.startsWith(b));if(d.length>0)return{sessionsDir:c,files:d,flat:!0}}catch{break}}return null}function q(){let a=j(),b=a.map(a=>(0,f.join)(a,"projects")).filter(a=>(0,g.existsSync)(a)),c=a.map(a=>(0,f.join)(a,"sessions")).filter(a=>(0,g.existsSync)(a));if(0===b.length&&0===c.length)return{available:!1,projects:[],totalSessions:0};let d=[],e=0,h=new Set;for(let a of b){let b;try{b=(0,g.readdirSync)(a,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>a.name)}catch{b=[]}for(let a of b){if(h.has(a))continue;let b=p(a);if(!b||0===b.files.length)continue;h.add(a);let c=l(a),f=m(c);d.push({name:a,sessions:b.files.length,piCwdDir:c,matched:f,existingCount:f?n(c):0}),e+=b.files.length}}for(let a of c){let b;try{b=(0,g.readdirSync)(a).filter(k)}catch{b=[]}let c=new Map;for(let a of b){let b=a.split("-")[0];b&&c.set(b,(c.get(b)??0)+1)}for(let[a,b]of c){if(h.has(a))continue;let c=l(a),f=m(c);d.push({name:a,sessions:b,piCwdDir:c,matched:f,existingCount:f?n(c):0}),e+=b}}return{available:!0,projects:d,totalSessions:e}}d()}catch(a){d(a)}})},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b){let c,d;try{c=new URL(a),d=new URL(b)}catch{return!1}if(c.protocol!==d.protocol||c.hostname.toLowerCase()!==d.hostname.toLowerCase())return!1;if(!c.port)return!0;let e=d.port||("https:"===d.protocol?"443":"80");return c.port===e}(e,f)))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},90516:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i});var e=c(23211),f=c(66544),g=c(49228),h=a([g]);async function i(a){if(!(0,f.EN)(a))return e.NextResponse.json({error:"Access denied"},{status:403});try{let a=(0,g.I6)(),b=(0,g.Ts)();return e.NextResponse.json({sources:a,reasonix:b})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}g=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},92002:(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/import/discover/route",pathname:"/api/import/discover",filename:"route",bundlePath:"app/api/import/discover/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/import/discover/route.ts",nextConfigOutput:"standalone",userland:()=>c(90516),...{}}),{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/import/discover/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)}}},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=92002));module.exports=c})();
1
+ (()=>{var a={};a.id=8149,a.ids=[8149],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},49228:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{I6:()=>o,Ol:()=>l,Ts:()=>q,mO:()=>p});var e=c(21820),f=c(33873),g=c(29021),h=c(75430),i=a([h]);function j(){let a=[],b=process.env.APPDATA;return b&&b.length>0&&a.push((0,f.join)(b,"reasonix")),a.push((0,f.join)((0,e.homedir)(),".reasonix")),a.filter((b,c)=>a.indexOf(b)===c)}h=(i.then?(await i)():i)[0];let r=[".events.jsonl",".conflicts.jsonl",".telemetry.json",".recovery.json",".goal-state.json",".event-index.json",".recovery.jsonl",".ckpt",".meta",".lock",".lease.json",".lease.lock",".jobs"];function k(a){if(!a.endsWith(".jsonl"))return!1;for(let b of r)if(a.endsWith(b))return!1;return!0}function l(a){let b=a.replace(/^-/,"").replace(/^[/\\]/,"").replace(/[/\\:]/g,"-");return`--${b}--`}let s=(0,f.join)((0,h.getAgentDir)(),"sessions");function m(a){return(0,g.existsSync)((0,f.join)(s,a))}function n(a){try{return(0,g.readdirSync)((0,f.join)(s,a)).filter(a=>a.endsWith(".jsonl")).length}catch{return 0}}function o(){let a=(0,g.existsSync)(function(){for(let a of j()){let b=(0,f.join)(a,"projects");if((0,g.existsSync)(b))return b}return(0,f.join)(j()[0],"projects")}())||(0,g.existsSync)(function(){for(let a of j()){let b=(0,f.join)(a,"sessions");if((0,g.existsSync)(b))return b}return(0,f.join)(j()[0],"sessions")}());return[{key:"reasonix",label:"Reasonix",available:a,status:a?"available":"unavailable"},{key:"codex",label:"Codex",available:!1,status:"coming-soon"},{key:"opencode",label:"OpenCode",available:!1,status:"coming-soon"},{key:"claude",label:"Claude Code",available:!1,status:"coming-soon"}]}function p(a){if(!a||a.split(/[\\/]/).some(a=>""===a||"."===a||".."===a))return null;for(let b of j()){let c=(0,f.join)(b,"projects",a,"sessions");if((0,g.existsSync)(c))try{let a=(0,g.readdirSync)(c).filter(k);return{sessionsDir:c,files:a,flat:!1}}catch{return null}}for(let b of j()){let c=(0,f.join)(b,"sessions");if((0,g.existsSync)(c))try{let b=`${a}-`,d=(0,g.readdirSync)(c).filter(a=>k(a)&&a.startsWith(b));if(d.length>0)return{sessionsDir:c,files:d,flat:!0}}catch{break}}return null}function q(){let a=j(),b=a.map(a=>(0,f.join)(a,"projects")).filter(a=>(0,g.existsSync)(a)),c=a.map(a=>(0,f.join)(a,"sessions")).filter(a=>(0,g.existsSync)(a));if(0===b.length&&0===c.length)return{available:!1,projects:[],totalSessions:0};let d=[],e=0,h=new Set;for(let a of b){let b;try{b=(0,g.readdirSync)(a,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>a.name)}catch{b=[]}for(let a of b){if(h.has(a))continue;let b=p(a);if(!b||0===b.files.length)continue;h.add(a);let c=l(a),f=m(c);d.push({name:a,sessions:b.files.length,piCwdDir:c,matched:f,existingCount:f?n(c):0}),e+=b.files.length}}for(let a of c){let b;try{b=(0,g.readdirSync)(a).filter(k)}catch{b=[]}let c=new Map;for(let a of b){let b=a.split("-")[0];b&&c.set(b,(c.get(b)??0)+1)}for(let[a,b]of c){if(h.has(a))continue;let c=l(a),f=m(c);d.push({name:a,sessions:b,piCwdDir:c,matched:f,existingCount:f?n(c):0}),e+=b}}return{available:!0,projects:d,totalSessions:e}}d()}catch(a){d(a)}})},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b,c){let d,e;try{d=new URL(a),e=new URL(b)}catch{return!1}if(d.protocol!==e.protocol||d.hostname.toLowerCase()!==e.hostname.toLowerCase())return!1;if(!d.port)return"same-origin"===c;let f=e.port||("https:"===e.protocol?"443":"80");return d.port===f}(e,f,a.headers.get("sec-fetch-site"))))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},90516:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i});var e=c(23211),f=c(66544),g=c(49228),h=a([g]);async function i(a){if(!(0,f.EN)(a))return e.NextResponse.json({error:"Access denied"},{status:403});try{let a=(0,g.I6)(),b=(0,g.Ts)();return e.NextResponse.json({sources:a,reasonix:b})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}g=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},92002:(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/import/discover/route",pathname:"/api/import/discover",filename:"route",bundlePath:"app/api/import/discover/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/import/discover/route.ts",nextConfigOutput:"standalone",userland:()=>c(90516),...{}}),{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/import/discover/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)}}},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=92002));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=1431,a.ids=[1431],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")},8102:(a,b,c)=>{"use strict";c.d(b,{$:()=>g});var d=c(55511),e=c(29021),f=c(33873);function g(a,b){let c=(0,f.dirname)(a),g=(0,f.join)(c,`.${(0,f.basename)(a)}-${(0,d.randomUUID)()}.tmp`),h=!1;try{(0,e.writeFileSync)(g,b,{encoding:"utf8",flag:"wx",mode:384,flush:!0}),(0,e.renameSync)(g,a)}catch(a){throw h=!0,a}finally{try{(0,e.unlinkSync)(g)}catch(a){if("ENOENT"!==a.code&&!h)throw a}}}},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")},11301:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{hH:()=>s,oH:()=>r,wF:()=>q});var e=c(73024),f=c(76760),g=c(75430),h=c(8102),i=a([g]);g=(i.then?(await i)():i)[0];let t=new Set([400,401,402,403,404,406,408,409,413,422,429,451,500,502,503,504]),u=new Set(["opencode-zen-external","opencode-zen-switch","opencode-zen-runtime","opencode-zen-sync"]);function j(){return(0,f.join)((0,g.getAgentDir)(),"pi-web-error-log.json")}function k(){globalThis.__piErrorLogState||(globalThis.__piErrorLogState={loaded:!1,entries:[]});let a=globalThis.__piErrorLogState;if(!a.loaded){a.loaded=!0;try{if((0,e.existsSync)(j())){let b=JSON.parse((0,e.readFileSync)(j(),"utf8"));if(Array.isArray(b)){let c=b.filter(l).slice(-500),d=c.filter(a=>!u.has(a.source));d.length!==c.length&&p(d),a.entries=d}}}catch{a.entries=[]}}return a}function l(a){return!(!a||"object"!=typeof a||Array.isArray(a))&&"string"==typeof a.id&&"string"==typeof a.timestamp&&("error"===a.level||"warning"===a.level||"info"===a.level)&&"string"==typeof a.source&&"string"==typeof a.message}function m(a){return a.replace(/https?:\/\/[^\s/@]+:[^\s/@]+@/gi,"https://[redacted]@").replace(/Bearer\s+[A-Za-z0-9._~+/=-]+/gi,"Bearer [redacted]").replace(/\bsk-[A-Za-z0-9_-]{8,}\b/g,"sk-[redacted]").replace(/\b(?:oc|opencode|zen)[_-]?[A-Za-z0-9._~-]{12,}\b/gi,"[key-redacted]").replace(/((?:api[_-]?key|token|password|secret)\s*[:=]\s*)([^\s,;]+)/gi,"$1[redacted]")}function n(a){return a.length>2e4?`${a.slice(0,2e4)}…`:a}function o(a){let b=a.match(/\bHTTP\s+(\d{3})\b|\bstatus(?:\s+code)?\s*[:=]?\s*(\d{3})\b|\b(4\d{2}|5\d{2})\b/i),c=Number(b?.[1]??b?.[2]??b?.[3]);return t.has(c)?c:void 0}function p(a){try{(0,h.$)(j(),JSON.stringify(a,null,2))}catch{}}function q(a){let b=k(),c=n(m(a.message.trim())),d=a.details?n(m(a.details)):void 0,e={id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,timestamp:new Date().toISOString(),level:a.level??"error",source:a.source??"unknown",...void 0!==a.statusCode?{statusCode:a.statusCode}:void 0!==o(c)?{statusCode:o(c)}:{},...a.provider?{provider:a.provider}:{},...a.model?{model:a.model}:{},...a.sessionId?{sessionId:a.sessionId}:{},message:c||"Unknown error",...d?{details:d}:{}};return b.entries.push(e),b.entries.length>500&&b.entries.splice(0,b.entries.length-500),p(b.entries),e}function r(a={}){let b=a.query?.trim().toLocaleLowerCase(),c=Math.min(Math.max(a.limit??200,1),500),d=void 0!==a.source&&u.has(a.source);return k().entries.filter(a=>d||!u.has(a.source)).filter(b=>void 0===a.statusCode||b.statusCode===a.statusCode).filter(b=>!a.level||b.level===a.level).filter(b=>!a.source||b.source===a.source).filter(a=>!b||[a.message,a.details,a.provider,a.model,a.source].filter(Boolean).some(a=>a.toLocaleLowerCase().includes(b))).slice().reverse().slice(0,c)}function s(){k().entries=[],p([])}d()}catch(a){d(a)}})},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46334:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>k,GET:()=>i,POST:()=>j,dynamic:()=>l});var e=c(23211),f=c(11301),g=c(66544),h=a([f]);f=(h.then?(await h)():h)[0];let l="force-dynamic",m=new Set(["error","warning","info"]);async function i(a){if(!(0,g.EN)(a))return e.NextResponse.json({error:"Access denied"},{status:403});let b=new URL(a.url).searchParams,c=b.get("statusCode"),d=c?Number(c):NaN,h=b.get("level");return e.NextResponse.json({entries:(0,f.oH)({...Number.isInteger(d)?{statusCode:d}:{},...h&&m.has(h)?{level:h}:{},...b.get("source")?{source:b.get("source")}:{},...b.get("query")?{query:b.get("query")}:{},limit:Number(b.get("limit"))||200})})}async function j(a){if(!(0,g.EN)(a))return e.NextResponse.json({error:"Access denied"},{status:403});if(!(0,g.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json(),c="string"==typeof b.message?b.message:"Unknown error",d="warning"===b.level||"info"===b.level?b.level:"error",g="number"==typeof b.statusCode&&Number.isInteger(b.statusCode)?b.statusCode:void 0,h=(0,f.wF)({level:d,statusCode:g,source:"string"==typeof b.source?b.source:"client",sessionId:"string"==typeof b.sessionId?b.sessionId:void 0,provider:"string"==typeof b.provider?b.provider:void 0,model:"string"==typeof b.model?b.model:void 0,message:c});return e.NextResponse.json({success:!0,id:h.id})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:"Invalid JSON body"},{status:400})}}async function k(a){return(0,g.EN)(a)?((0,f.hH)(),e.NextResponse.json({success:!0})):e.NextResponse.json({error:"Access denied"},{status:403})}d()}catch(a){d(a)}})},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b){let c,d;try{c=new URL(a),d=new URL(b)}catch{return!1}if(c.protocol!==d.protocol||c.hostname.toLowerCase()!==d.hostname.toLowerCase())return!1;if(!c.port)return!0;let e=d.port||("https:"===d.protocol?"443":"80");return c.port===e}(e,f)))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},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")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},79906:(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/logs/route",pathname:"/api/logs",filename:"route",bundlePath:"app/api/logs/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/logs/route.ts",nextConfigOutput:"standalone",userland:()=>c(46334),...{}}),{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/logs/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)}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=79906));module.exports=c})();
1
+ (()=>{var a={};a.id=1431,a.ids=[1431],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")},8102:(a,b,c)=>{"use strict";c.d(b,{$:()=>g});var d=c(55511),e=c(29021),f=c(33873);function g(a,b){let c=(0,f.dirname)(a),g=(0,f.join)(c,`.${(0,f.basename)(a)}-${(0,d.randomUUID)()}.tmp`),h=!1;try{(0,e.writeFileSync)(g,b,{encoding:"utf8",flag:"wx",mode:384,flush:!0}),(0,e.renameSync)(g,a)}catch(a){throw h=!0,a}finally{try{(0,e.unlinkSync)(g)}catch(a){if("ENOENT"!==a.code&&!h)throw a}}}},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")},11301:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{hH:()=>s,oH:()=>r,wF:()=>q});var e=c(73024),f=c(76760),g=c(75430),h=c(8102),i=a([g]);g=(i.then?(await i)():i)[0];let t=new Set([400,401,402,403,404,406,408,409,413,422,429,451,500,502,503,504]),u=new Set(["opencode-zen-external","opencode-zen-switch","opencode-zen-runtime","opencode-zen-sync"]);function j(){return(0,f.join)((0,g.getAgentDir)(),"pi-web-error-log.json")}function k(){globalThis.__piErrorLogState||(globalThis.__piErrorLogState={loaded:!1,entries:[]});let a=globalThis.__piErrorLogState;if(!a.loaded){a.loaded=!0;try{if((0,e.existsSync)(j())){let b=JSON.parse((0,e.readFileSync)(j(),"utf8"));if(Array.isArray(b)){let c=b.filter(l).slice(-500),d=c.filter(a=>!u.has(a.source));d.length!==c.length&&p(d),a.entries=d}}}catch{a.entries=[]}}return a}function l(a){return!(!a||"object"!=typeof a||Array.isArray(a))&&"string"==typeof a.id&&"string"==typeof a.timestamp&&("error"===a.level||"warning"===a.level||"info"===a.level)&&"string"==typeof a.source&&"string"==typeof a.message}function m(a){return a.replace(/https?:\/\/[^\s/@]+:[^\s/@]+@/gi,"https://[redacted]@").replace(/Bearer\s+[A-Za-z0-9._~+/=-]+/gi,"Bearer [redacted]").replace(/\bsk-[A-Za-z0-9_-]{8,}\b/g,"sk-[redacted]").replace(/\b(?:oc|opencode|zen)[_-]?[A-Za-z0-9._~-]{12,}\b/gi,"[key-redacted]").replace(/((?:api[_-]?key|token|password|secret)\s*[:=]\s*)([^\s,;]+)/gi,"$1[redacted]")}function n(a){return a.length>2e4?`${a.slice(0,2e4)}…`:a}function o(a){let b=a.match(/\bHTTP\s+(\d{3})\b|\bstatus(?:\s+code)?\s*[:=]?\s*(\d{3})\b|\b(4\d{2}|5\d{2})\b/i),c=Number(b?.[1]??b?.[2]??b?.[3]);return t.has(c)?c:void 0}function p(a){try{(0,h.$)(j(),JSON.stringify(a,null,2))}catch{}}function q(a){let b=k(),c=n(m(a.message.trim())),d=a.details?n(m(a.details)):void 0,e={id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,timestamp:new Date().toISOString(),level:a.level??"error",source:a.source??"unknown",...void 0!==a.statusCode?{statusCode:a.statusCode}:void 0!==o(c)?{statusCode:o(c)}:{},...a.provider?{provider:a.provider}:{},...a.model?{model:a.model}:{},...a.sessionId?{sessionId:a.sessionId}:{},message:c||"Unknown error",...d?{details:d}:{}};return b.entries.push(e),b.entries.length>500&&b.entries.splice(0,b.entries.length-500),p(b.entries),e}function r(a={}){let b=a.query?.trim().toLocaleLowerCase(),c=Math.min(Math.max(a.limit??200,1),500),d=void 0!==a.source&&u.has(a.source);return k().entries.filter(a=>d||!u.has(a.source)).filter(b=>void 0===a.statusCode||b.statusCode===a.statusCode).filter(b=>!a.level||b.level===a.level).filter(b=>!a.source||b.source===a.source).filter(a=>!b||[a.message,a.details,a.provider,a.model,a.source].filter(Boolean).some(a=>a.toLocaleLowerCase().includes(b))).slice().reverse().slice(0,c)}function s(){k().entries=[],p([])}d()}catch(a){d(a)}})},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46334:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>k,GET:()=>i,POST:()=>j,dynamic:()=>l});var e=c(23211),f=c(11301),g=c(66544),h=a([f]);f=(h.then?(await h)():h)[0];let l="force-dynamic",m=new Set(["error","warning","info"]);async function i(a){if(!(0,g.EN)(a))return e.NextResponse.json({error:"Access denied"},{status:403});let b=new URL(a.url).searchParams,c=b.get("statusCode"),d=c?Number(c):NaN,h=b.get("level");return e.NextResponse.json({entries:(0,f.oH)({...Number.isInteger(d)?{statusCode:d}:{},...h&&m.has(h)?{level:h}:{},...b.get("source")?{source:b.get("source")}:{},...b.get("query")?{query:b.get("query")}:{},limit:Number(b.get("limit"))||200})})}async function j(a){if(!(0,g.EN)(a))return e.NextResponse.json({error:"Access denied"},{status:403});if(!(0,g.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json(),c="string"==typeof b.message?b.message:"Unknown error",d="warning"===b.level||"info"===b.level?b.level:"error",g="number"==typeof b.statusCode&&Number.isInteger(b.statusCode)?b.statusCode:void 0,h=(0,f.wF)({level:d,statusCode:g,source:"string"==typeof b.source?b.source:"client",sessionId:"string"==typeof b.sessionId?b.sessionId:void 0,provider:"string"==typeof b.provider?b.provider:void 0,model:"string"==typeof b.model?b.model:void 0,message:c});return e.NextResponse.json({success:!0,id:h.id})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:"Invalid JSON body"},{status:400})}}async function k(a){return(0,g.EN)(a)?((0,f.hH)(),e.NextResponse.json({success:!0})):e.NextResponse.json({error:"Access denied"},{status:403})}d()}catch(a){d(a)}})},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{"use strict";c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b,c){let d,e;try{d=new URL(a),e=new URL(b)}catch{return!1}if(d.protocol!==e.protocol||d.hostname.toLowerCase()!==e.hostname.toLowerCase())return!1;if(!d.port)return"same-origin"===c;let f=e.port||("https:"===e.protocol?"443":"80");return d.port===f}(e,f,a.headers.get("sec-fetch-site"))))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},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")},77030:a=>{"use strict";a.exports=require("node:net")},78335:()=>{},79906:(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/logs/route",pathname:"/api/logs",filename:"route",bundlePath:"app/api/logs/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/logs/route.ts",nextConfigOutput:"standalone",userland:()=>c(46334),...{}}),{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/logs/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)}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=79906));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=3390,a.ids=[3390],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29862:a=>{a.exports=import("@earendil-works/pi-tui")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b){let c,d;try{c=new URL(a),d=new URL(b)}catch{return!1}if(c.protocol!==d.protocol||c.hostname.toLowerCase()!==d.hostname.toLowerCase())return!1;if(!c.port)return!0;let e=d.port||("https:"===d.protocol?"443":"80");return c.port===e}(e,f)))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},73565:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>i,dynamic:()=>j});var e=c(23211),f=c(56429),g=c(66544),h=a([f]);f=(h.then?(await h)():h)[0];let j="force-dynamic",k=/^[a-zA-Z0-9_-]+$/;async function i(a){if(!(0,g.EN)(a))return e.NextResponse.json({error:"Access denied"},{status:403});if(!(0,g.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json(),c="string"==typeof b.sessionId?b.sessionId:"",d="string"==typeof b.name?b.name:"";if(!c)return e.NextResponse.json({error:"sessionId is required"},{status:400});if(!d||!k.test(d))return e.NextResponse.json({error:"Invalid server name"},{status:400});let g=(0,f.A4)(c);if(!g)return e.NextResponse.json({error:"No active session with that id"},{status:404});return await g.send({type:"prompt",message:`/mcp:stop ${d}`}),await new Promise(a=>setTimeout(a,1200)),await g.send({type:"prompt",message:`/mcp:start ${d}`}),e.NextResponse.json({success:!0})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},74568:(a,b,c)=>{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/mcp/restart/route",pathname:"/api/mcp/restart",filename:"route",bundlePath:"app/api/mcp/restart/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/mcp/restart/route.ts",nextConfigOutput:"standalone",userland:()=>c(73565),...{}}),{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/mcp/restart/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)}}},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,4229,5582,8904,6429],()=>b(b.s=74568));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=3390,a.ids=[3390],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4984:a=>{a.exports=require("readline")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{a.exports=require("assert")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},28802:a=>{a.exports=import("@earendil-works/pi-ai")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29862:a=>{a.exports=import("@earendil-works/pi-tui")},31421:a=>{a.exports=require("node:child_process")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:a=>{a.exports=require("node:fs/promises")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},66544:(a,b,c)=>{c.d(b,{E2:()=>l,EN:()=>k});var d=c(77030);function e(a){return(a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1):a).toLowerCase().replace(/\.$/,"")}function f(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;return e(b.hostname)}catch{return null}}function g(a){if(!a||/[\s/@\\]/.test(a))return null;try{let b=new URL(`http://${a}`);if(b.username||b.password||"/"!==b.pathname||b.search||b.hash)return null;let c=e(b.hostname);return b.port?`${c}:${b.port}`:c}catch{return null}}function h(){return[process.env.PI_WEB_HOSTNAME,...process.env.PI_WEB_ALLOWED_HOSTS?.split(",")??[]].filter(a=>!!a?.trim())}function i(a){try{return new URL(a).origin}catch{return null}}let j=new Set(["POST","PUT","PATCH","DELETE"]);function k(a,b=h()){if(!function(a,b=h()){let c=a.headers.get("host"),g=c?f(c):null;return!!g&&(!!("localhost"===g||g.endsWith(".localhost")||(0,d.isIP)(g))||b.some(a=>{let b;return((b=a?.trim())?(0,d.isIP)(b)?e(b):f(b):null)===g}))}(a,b))return!1;if(function(a){if("GET"!==a.method||"navigate"!==a.headers.get("sec-fetch-mode")||"document"!==a.headers.get("sec-fetch-dest")||"?1"!==a.headers.get("sec-fetch-user"))return!1;try{return/^\/api\/sessions\/[^/]+\/export$/.test(new URL(a.url).pathname)}catch{return!1}}(a))return!0;if(!(a.headers.has("origin")||a.headers.has("sec-fetch-site"))){if(j.has((a.method??"GET").toUpperCase())){let b=a.headers.get("host"),c=b?f(b):null;return null!==c&&!!("localhost"===c||c.endsWith(".localhost")||/^127\./.test(c)||"::1"===c||"[::1]"===c)}return!0}return function(a){let b,c,d;if("cross-site"===a.headers.get("sec-fetch-site"))return!1;let e=a.headers.get("origin");if(!e)return!0;let f=(b=new URL(a.url),(c=a.headers.get("host"))?i(`${b.protocol}//${c}`):null);if(null!==f&&(i(e)===f||function(a,b,c){let d,e;try{d=new URL(a),e=new URL(b)}catch{return!1}if(d.protocol!==e.protocol||d.hostname.toLowerCase()!==e.hostname.toLowerCase())return!1;if(!d.port)return"same-origin"===c;let f=e.port||("https:"===e.protocol?"443":"80");return d.port===f}(e,f,a.headers.get("sec-fetch-site"))))return!0;if("same-origin"!==a.headers.get("sec-fetch-site")||!a.headers.get("x-forwarded-proto"))return!1;let h=a.headers.get("host");if(!h)return!1;try{d=new URL(e).host}catch{return!1}let j=g(d);return null!==j&&j===g(h)}(a)}function l(a){let b=a.headers.get("content-type")?.split(";",1)[0]?.trim().toLowerCase();return"application/json"===b||!!(b?.startsWith("application/")&&b.endsWith("+json"))}},73024:a=>{a.exports=require("node:fs")},73565:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{POST:()=>i,dynamic:()=>j});var e=c(23211),f=c(56429),g=c(66544),h=a([f]);f=(h.then?(await h)():h)[0];let j="force-dynamic",k=/^[a-zA-Z0-9_-]+$/;async function i(a){if(!(0,g.EN)(a))return e.NextResponse.json({error:"Access denied"},{status:403});if(!(0,g.E2)(a))return e.NextResponse.json({error:"Content-Type must be application/json"},{status:415});try{let b=await a.json(),c="string"==typeof b.sessionId?b.sessionId:"",d="string"==typeof b.name?b.name:"";if(!c)return e.NextResponse.json({error:"sessionId is required"},{status:400});if(!d||!k.test(d))return e.NextResponse.json({error:"Invalid server name"},{status:400});let g=(0,f.A4)(c);if(!g)return e.NextResponse.json({error:"No active session with that id"},{status:404});return await g.send({type:"prompt",message:`/mcp:stop ${d}`}),await new Promise(a=>setTimeout(a,1200)),await g.send({type:"prompt",message:`/mcp:start ${d}`}),e.NextResponse.json({success:!0})}catch(a){return e.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}}d()}catch(a){d(a)}})},74568:(a,b,c)=>{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/mcp/restart/route",pathname:"/api/mcp/restart",filename:"route",bundlePath:"app/api/mcp/restart/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Volumes/1T 原装/项目研发/pi-web-QT/app/api/mcp/restart/route.ts",nextConfigOutput:"standalone",userland:()=>c(73565),...{}}),{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/mcp/restart/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)}}},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79748:a=>{a.exports=require("fs/promises")},80481:a=>{a.exports=require("node:readline")},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,974,426,4229,5582,8904,6429],()=>b(b.s=74568));module.exports=c})();