@seqyuan/annovibe 0.8.12 → 0.8.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +8 -5
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +6 -6
- package/.next/required-server-files.js +1 -1
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +18 -0
- package/.next/server/app/_global-error/page.js +3 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/agent/[id]/events/route.js +2 -2
- package/.next/server/app/api/agent/[id]/route.js +1 -1
- package/.next/server/app/api/agent/new/route.js +1 -1
- package/.next/server/app/api/auth/all-providers/route.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
- package/.next/server/app/api/auth/login/route.js +1 -1
- package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/providers/route.js +1 -1
- package/.next/server/app/api/auth/status/route.js +1 -1
- package/.next/server/app/api/default-cwd/route.js +1 -1
- package/.next/server/app/api/files/[...path]/route.js +2 -2
- package/.next/server/app/api/harness/route.js +1 -1
- package/.next/server/app/api/home/route.js +1 -1
- package/.next/server/app/api/internal/runtime/route.js +1 -0
- package/.next/server/app/api/internal/runtime/route.js.nft.json +1 -0
- package/.next/server/app/api/internal/runtime/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/models-config/discover/route.js +1 -1
- package/.next/server/app/api/models-config/route.js +1 -1
- package/.next/server/app/api/models-config/test/route.js +1 -1
- package/.next/server/app/api/plot-kernels/route.js +1 -1
- package/.next/server/app/api/plot-kernels/status/route.js +1 -1
- package/.next/server/app/api/plot-kernels/stop/route.js +1 -1
- package/.next/server/app/api/projects/browse/route.js +1 -0
- package/.next/server/app/api/projects/browse/route.js.nft.json +1 -0
- package/.next/server/app/api/projects/browse/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/projects/route.js +3 -0
- package/.next/server/app/api/projects/route.js.nft.json +1 -0
- package/.next/server/app/api/projects/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/reports/[id]/route.js +7 -4
- package/.next/server/app/api/search/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/context/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/new/route.js +1 -1
- package/.next/server/app/api/sessions/route.js +2 -2
- package/.next/server/app/api/settings/route.js +1 -1
- package/.next/server/app/api/skills/install/route.js +1 -1
- package/.next/server/app/api/skills/route.js +2 -2
- package/.next/server/app/api/skills/search/route.js +1 -1
- package/.next/server/app/api/soul/route.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +3 -3
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login/page.js +2 -2
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +2 -2
- package/.next/server/app/login.segments/_full.segment.rsc +2 -2
- package/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/server/app/login.segments/_index.segment.rsc +2 -2
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/server/app/page.js +13 -13
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +8 -5
- package/.next/server/chunks/1688.js +45 -0
- package/.next/server/chunks/7601.js +54 -12
- package/.next/server/chunks/static/media/pdf.worker.min.c476e1a0.mjs +6 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/QvZYZknhDLA2wQJwpT60o/_buildManifest.js +1 -0
- package/.next/static/chunks/51fb665c.9f0b013f33bf4f6d.js +45 -0
- package/.next/static/chunks/8771-3e14b6810486df1f.js +1 -0
- package/.next/static/chunks/app/_global-error/page-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/events/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/agent/new/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/auth/all-providers/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/auth/login/[provider]/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/auth/login/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/auth/providers/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/auth/status/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/default-cwd/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/files/[...path]/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/harness/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/home/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/internal/runtime/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/models/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/models-config/discover/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/models-config/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/models-config/test/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/status/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/stop/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/projects/browse/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/projects/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/reports/[id]/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/search/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/sessions/new/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/settings/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/skills/install/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/skills/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/skills/search/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/soul/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/version/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/page-e0ad11ee7003214a.js +270 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/{webpack-5e677f60fa366b60.js → webpack-c223a77d0c5e1b9e.js} +1 -1
- package/.next/static/css/8026433d69e690e2.css +3 -0
- package/.next/static/media/pdf.worker.min.29aaf158.mjs +6 -0
- package/.next/trace +75 -74
- package/.next/trace-build +1 -1
- package/.next/types/app/api/internal/runtime/route.ts +351 -0
- package/.next/types/app/api/projects/browse/route.ts +351 -0
- package/.next/types/app/api/projects/route.ts +351 -0
- package/.next/types/routes.d.ts +4 -1
- package/.next/types/validator.ts +27 -0
- package/README.md +2 -0
- package/bin/pi-web.js +293 -16
- package/package.json +1 -1
- package/.next/server/chunks/7270.js +0 -45
- package/.next/server/chunks/static/media/pdf.worker.min.9df6854a.mjs +0 -6
- package/.next/static/chunks/7355-29eaa714eb390050.js +0 -1
- package/.next/static/chunks/9b0008ae.2918095672924572.js +0 -45
- package/.next/static/chunks/app/_global-error/page-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/events/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/agent/new/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/auth/all-providers/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/auth/login/[provider]/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/auth/login/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/auth/providers/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/auth/status/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/default-cwd/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/files/[...path]/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/harness/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/home/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/models/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/models-config/discover/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/models-config/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/models-config/test/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/plot-kernels/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/plot-kernels/status/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/plot-kernels/stop/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/reports/[id]/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/search/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/sessions/new/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/settings/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/skills/install/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/skills/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/skills/search/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/soul/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/version/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/page-dc03bbb33a1d438c.js +0 -270
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-3edd3886076a73cb.js +0 -1
- package/.next/static/css/d830cdea1c9a03c6.css +0 -3
- package/.next/static/ixA4-CDguO8ne_SD2W8sd/_buildManifest.js +0 -1
- package/.next/static/media/pdf.worker.min.5f98222a.mjs +0 -6
- /package/.next/static/{ixA4-CDguO8ne_SD2W8sd → QvZYZknhDLA2wQJwpT60o}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/projects/route"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{},"edgeSSRModuleMapping":{},"clientModules":{},"entryCSSFiles":{"/home/runner/work/pidex/pidex/app/api/projects/route":[]},"rscModuleMapping":{},"edgeRscModuleMapping":{}};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
(()=>{var a={};a.id=1635,a.ids=[1635],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},
|
|
1
|
+
(()=>{var a={};a.id=1635,a.ids=[1635],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},17854:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(88742),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/reports/[id]/route",pathname:"/api/reports/[id]",filename:"route",bundlePath:"app/api/reports/[id]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/pidex/pidex/app/api/reports/[id]/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/reports/[id]/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},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")},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>l,DK:()=>m,O8:()=>k,Uv:()=>n,dQ:()=>h,os:()=>j});var e=c(75430),f=c(12039),g=a([e]);async function h(){let a=await e.SessionManager.listAll(),b=new Map;for(let c of a)b.set(c.path,c.id);let c=i();return a.map(a=>(c.set(a.id,a.path),{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0}))}function i(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function j(a){let b=i().get(a);return b||(await h(),i().get(a)??null)}function k(a,b){i().set(a,b)}function l(a){i().delete(a)}function m(a){return e.SessionManager.open(a).getEntries()}function n(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
|
|
2
2
|
|
|
3
|
-
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73196:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{c3:()=>
|
|
3
|
+
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73196:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{c3:()=>A,tL:()=>o,u5:()=>q,wr:()=>z});var e=c(29021),f=c(33873),g=c(75430),h=a([g]);g=(h.then?(await h)():h)[0];let C=[{id:"objective",title:"Objective"},{id:"input_data",title:"Input Data"},{id:"methods",title:"Methods"},{id:"quality_control",title:"Quality Control"},{id:"results",title:"Results"},{id:"interpretation",title:"Biological Interpretation"},{id:"outputs",title:"Output Files"},{id:"reproducibility",title:"Reproducibility"}],D=/(?:^|[\s(["'`])((?:\.{1,2}\/|\/|~\/)?[A-Za-z0-9_.@+\-/\\]+?\.(?:csv|tsv|txt|xlsx|xls|pdf|png|jpg|jpeg|svg|html|htm|r|R|py|ipynb|qmd|md|rds|h5ad|loom|mtx|tsv\.gz|csv\.gz))(?:$|[\s)\]"'`,;:])/g,E=/(?:^|[\s(["'`])((?:\.{1,2}\/|\/|~\/)?[A-Za-z0-9_.@+\-/\\]+\/)(?=\s*(?:[::-]|[0-9]+|含|共|files?|个文件|PDFs?|PNGs?|CSVs?|TSVs?|输出|output|results?))/gim,F=/\b(seurat|scanpy|single[- ]cell|scrna|qc|quality control|normalize|normalization|pca|umap|tsne|cluster|clustering|resolution|marker|differential expression|deg|go enrichment|kegg|reactome|pathway|cell type|annotation|doublet|batch|integration|harmony|scvi)\b/i,G=/\b(result|found|identified|showed|observed|enriched|upregulated|downregulated|marker|cluster|cell type|figure|plot|table|significant|p\s*[<>=]|fdr|padj|logfc|auc)\b/i,H=/\b(suggest|indicate|imply|consistent with|biological|interpret|likely|may reflect|supports|driven by|associated with)\b/i,I=/\b(qc|quality control|filter|filtered|mitochondrial|percent\.mt|nfeature|ncount|doublet|ambient|low[- ]quality)\b/i,J=/\b(seurat|scanpy|single[- ]cell|scrna|sc[- ]rna|rna[- ]seq|transcriptom|gene|genes|marker|cell type|cluster|clustering|umap|tsne|pca|qc|mitochondrial|percent\.mt|nfeature|ncount|deg|differential expression|go enrichment|kegg|reactome|pathway|gsea|volcano|heatmap|h5ad|rds|loom|mtx|fastq|bam|vcf|counts?|expression|annotation|doublet|batch|integration|harmony|scvi)\b|生信|单细胞|转录组|基因|表达矩阵|差异表达|富集|通路|聚类|细胞类型|细胞注释|质控|线粒体|标记基因|火山图|热图/i,K=new Set(["_No curated content yet._","_No analysis objective detected yet._","_No input data paths detected yet._","_No output files detected yet._","_No reproducibility notes detected yet._"]);function i(){return new Date().toISOString()}function j(a){return(0,f.join)((0,g.getAgentDir)(),"reports",`${Buffer.from(a).toString("base64url")}.json`)}function k(a,b){return{id:a,title:b,markdown:"",status:"draft",updatedAt:null,sources:[]}}function l(a){let b=a.trim();return K.has(b)?"":b}function m(a){return a.some(a=>l(a.markdown).length>0)}function n(a,b,c){let d=i(),e=C.map(a=>k(a.id,a.title));return{schemaVersion:1,sessionId:a,cwd:b,title:c||"Analysis Report",createdAt:d,updatedAt:d,markdown:"",sections:e,sources:[],changes:[],appliedUpdateKeys:[]}}function o(a,b="",c){let d=j(a);if(!(0,e.existsSync)(d))return n(a,b,c);try{let f=JSON.parse((0,e.readFileSync)(d,"utf8")),g=n(a,b,c),h=Array.isArray(f.sections)?f.sections:[],i=C.map(a=>{let b=h.find(b=>b?.id===a.id),c=l("string"==typeof b?.markdown?b.markdown:"");return{...k(a.id,a.title),...b&&"object"==typeof b?b:{},id:a.id,title:a.title,markdown:c,status:c?b?.status??"draft":"draft",updatedAt:c?b?.updatedAt??null:null,sources:c&&Array.isArray(b?.sources)?b.sources:[]}}),j="string"==typeof f.title&&f.title.trim()?f.title:g.title;return{...g,...f,schemaVersion:1,sessionId:a,cwd:"string"==typeof f.cwd?f.cwd:b,title:j,createdAt:"string"==typeof f.createdAt?f.createdAt:g.createdAt,updatedAt:"string"==typeof f.updatedAt?f.updatedAt:g.updatedAt,sections:i,markdown:B(j,i),sources:m(i)&&Array.isArray(f.sources)?f.sources:[],changes:m(i)&&Array.isArray(f.changes)?f.changes:[],appliedUpdateKeys:Array.isArray(f.appliedUpdateKeys)?f.appliedUpdateKeys.filter(a=>"string"==typeof a):[]}}catch{return n(a,b,c)}}function p(a){let b=0x811c9dc5;for(let c=0;c<a.length;c++)b^=a.charCodeAt(c),b=Math.imul(b,0x1000193);return(b>>>0).toString(36)}function q(a){let b=i(),c={...a,updatedAt:b,markdown:B(a.title,a.sections)},d=j(a.sessionId);(0,e.mkdirSync)((0,f.dirname)(d),{recursive:!0});let g=`${d}.tmp`;return(0,e.writeFileSync)(g,JSON.stringify(c,null,2),"utf8"),(0,e.renameSync)(g,d),c}function r(a){return a.replace(/\s+/g," ").trim()}function s(a,b){let c=a.trim();if(!c)return"";let d=r(b??"").slice(0,120);if(!d)return c;let e=`### ${d}`;return c===e||c.startsWith(`${e}
|
|
4
|
+
`)?c:`${e}
|
|
4
5
|
|
|
5
|
-
${
|
|
6
|
+
${c}`}function t(a){let b=a.content;return"string"==typeof b?r(b):Array.isArray(b)?r(b.map(a=>"text"===a.type?a.text:"toolCall"===a.type?`${a.toolName} ${JSON.stringify(a.input)}`:"").join(" ")):""}function u(a,b,c){let d=r(b);!(!d||a.includes(d))&&(a.push(d),a.length>c&&(a.length=c))}function v(a,b="_No curated content yet._"){return 0===a.length?b:a.map(a=>`- ${a}`).join("\n")}function w(a){return 0===a.length?"":["| File or Directory | Notes |","| --- | --- |",...a.map(a=>`| \`${a.replace(/\|/g,"\\|")}\` | Detected from session output. |`)].join("\n")}function x(a,b,c,d="draft",e=[]){let f=a.sections.find(a=>a.id===b);f&&(f.markdown=c.trim(),f.status=d,f.updatedAt=i(),f.sources=e)}function y(a){if(!a)return null;let b=a.trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"");return C.some(a=>a.id===b)?b:b.includes("objective")||b.includes("goal")?"objective":b.includes("input")||b.includes("sample")||b.includes("data")?"input_data":b.includes("method")||b.includes("parameter")||b.includes("workflow")?"methods":b.includes("qc")||b.includes("quality")||b.includes("filter")?"quality_control":b.includes("result")||b.includes("marker")||b.includes("deg")||b.includes("enrichment")?"results":b.includes("interpret")||b.includes("biology")||b.includes("biological")?"interpretation":b.includes("output")||b.includes("file")||b.includes("figure")?"outputs":b.includes("reproduc")?"reproducibility":null}function z(a,b,c){let d=y(b.section),e="string"==typeof b.markdown?s(b.markdown,b.topic):"";if(!d||!e)return a;let f=c?p(c):null;if(f&&a.appliedUpdateKeys?.includes(f))return a;let g=i(),h={...a,sections:a.sections.map(a=>({...a,sources:[...a.sources]})),sources:[...a.sources],changes:[...a.changes],appliedUpdateKeys:[...a.appliedUpdateKeys??[]]},j=h.sections.find(a=>a.id===d);if(!j)return a;j.markdown="replace"!==b.action&&j.markdown.trim()?`${j.markdown.trim()}
|
|
7
|
+
|
|
8
|
+
${e}`:e,j.status=b.status??"draft",j.updatedAt=g;let k=function(a){if(!Array.isArray(a))return[];let b=[];for(let c of a)"string"==typeof c?b.push({type:"file",path:c,label:c}):c&&"object"==typeof c&&"string"==typeof c.label&&b.push({type:"session"===c.type?"session":"file",id:"string"==typeof c.id?c.id:void 0,path:"string"==typeof c.path?c.path:void 0,label:c.label});return b}(b.sources);for(let a of(j.sources=k.length>0?k:j.sources,Array.isArray(b.invalidates)?b.invalidates.map(y).filter(Boolean):[])){let b=h.sections.find(b=>b.id===a);b&&b.id!==j.id&&(b.status="outdated",b.updatedAt=g)}return h.sources=[...h.sources,...k].filter((a,b,c)=>{let d=`${a.type}:${a.id??""}:${a.path??""}:${a.label}`;return c.findIndex(a=>`${a.type}:${a.id??""}:${a.path??""}:${a.label}`===d)===b}),h.changes=[{id:`change-${Date.now()}`,timestamp:g,title:`Updated ${j.title}`,detail:b.note||"Applied a structured analysis report update from the assistant."},...h.changes].slice(0,50),f&&(h.appliedUpdateKeys=[f,...h.appliedUpdateKeys??[]].slice(0,500)),h}function A(a){let b,c,d={...a.report,title:a.report.title||a.sessionTitle||"Analysis Report",sections:a.report.sections.map(a=>({...a,sources:[...a.sources]})),sources:[...a.report.sources],changes:[...a.report.changes],appliedUpdateKeys:[...a.report.appliedUpdateKeys??[]]},e={type:"session",id:d.sessionId,label:"Current conversation"};if(!a.context.messages.some(a=>J.test(t(a))))return m(d.sections)?{...d,markdown:B(d.title,d.sections)}:{...d,sections:C.map(a=>k(a.id,a.title)),sources:[],changes:[],markdown:""};let f=((b=a.context.messages.find(a=>"user"===a.role&&J.test(t(a))))?t(b).slice(0,900):"")||((c=a.context.messages.find(a=>"user"===a.role))?t(c).slice(0,900):""),g=function(a){let b=[];for(let c of a.messages){let a=t(c);if(a){for(let c of a.matchAll(D)){let a=c[1]?.replace(/[.,;:)]+$/,"");a&&u(b,a,30)}for(let c of a.matchAll(E)){let a=c[1]?.replace(/[.,;:)]+$/,"");a&&u(b,a,30)}}}return b}(a.context),h=function(a){let b=[],c=[],d=[],e=[],f=[];for(let g of a.messages){let a=t(g);if(!a||a.length<12)continue;let h=a.length>500?`${a.slice(0,500).trim()}...`:a;"assistant"===g.role&&(I.test(h)&&u(c,h,8),F.test(h)&&u(b,h,10),G.test(h)&&u(d,h,12),H.test(h)&&u(e,h,8)),"toolResult"===g.role&&/saved|wrote|created|exported|generated|output|success/i.test(h)&&u(f,h,8)}return{methods:b,qc:c,results:d,interpretation:e,reproducibility:f}}(a.context),j=a.topic??(f?r(f).slice(0,80):"");if(a.topic){let a=d,b=(b,c,e=[])=>{let f=c.trim();f&&(a=z(a,{topic:j,section:b,action:"append",status:"draft",markdown:f,sources:e,note:`Added current-topic summary for ${j}.`},`${d.sessionId}:${j}:${b}:${p(f)}`))};return b("objective",f?`- ${f}`:"",f?[e]:[]),b("input_data",g.length>0?["Detected data or result paths mentioned in this topic:\n",w(g.slice(0,12))].join("\n"):"",g.length>0?[e]:[]),b("methods",h.methods.length>0?v(h.methods):"",h.methods.length>0?[e]:[]),b("quality_control",h.qc.length>0?v(h.qc):"",h.qc.length>0?[e]:[]),b("results",h.results.length>0?v(h.results):"",h.results.length>0?[e]:[]),b("interpretation",h.interpretation.length>0?v(h.interpretation):"",h.interpretation.length>0?[e]:[]),b("outputs",g.length>0?w(g):"",g.length>0?[e]:[]),b("reproducibility",h.reproducibility.length>0?v(h.reproducibility):"",h.reproducibility.length>0?[e]:[]),a}return x(d,"objective",f?s(`- ${f}`,j):"","draft",f?[e]:[]),x(d,"input_data",g.length>0?s(["Detected data or result paths mentioned in this session:\n",w(g.slice(0,12))].join("\n"),j):"",(g.length,"draft"),g.length>0?[e]:[]),x(d,"methods",h.methods.length>0?s(v(h.methods),j):"",(h.methods.length,"draft"),h.methods.length>0?[e]:[]),x(d,"quality_control",h.qc.length>0?s(v(h.qc),j):"",(h.qc.length,"draft"),h.qc.length>0?[e]:[]),x(d,"results",h.results.length>0?s(v(h.results),j):"",(h.results.length,"draft"),h.results.length>0?[e]:[]),x(d,"interpretation",h.interpretation.length>0?s(v(h.interpretation),j):"",(h.interpretation.length,"draft"),h.interpretation.length>0?[e]:[]),x(d,"outputs",g.length>0?s(w(g),j):"",(g.length,"draft"),g.length>0?[e]:[]),x(d,"reproducibility",h.reproducibility.length>0?s(v(h.reproducibility),j):"",(h.reproducibility.length,"draft"),h.reproducibility.length>0?[e]:[]),m(d.sections)&&(d.sources=[e],d.changes=[{id:`change-${Date.now()}`,timestamp:i(),title:"Generated from conversation",detail:"Refreshed the analysis report from the current session, keeping only analysis objectives, methods, results, interpretations, outputs, and reproducibility notes."},...d.changes].slice(0,50)),d}function B(a,b){let c=b.filter(a=>l(a.markdown).length>0);if(0===c.length)return"";let d=c.map(a=>{let b="verified"===a.status?"verified":"outdated"===a.status?"outdated":"needs_review"===a.status?"needs review":"draft",c=l(a.markdown);return`## ${a.title}
|
|
6
9
|
|
|
7
10
|
_Status: ${b}_
|
|
8
11
|
|
|
9
|
-
${c}`});return[`# ${a||"Analysis Report"}`,...d].join("\n\n")}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88742:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k,POST:()=>m,PUT:()=>l,dynamic:()=>n});var e=c(23211),f=c(75430),g=c(40402),h=c(73196),i=a([f,g,h]);[f,g,h]=i.then?(await i)():i;let n="force-dynamic";async function j(a){let b=await (0,g.os)(a);if(!b)throw Error("Session not found");let c=f.SessionManager.open(b),d=c.getHeader()?.cwd??"",e=function(a){let b=a.getSessionName();if(b)return b;let c=a.getHeader();return c?.id,"Analysis Report"}(c),i=(0,h.tL)(a,d,e);return{sm:c,cwd:d,title:e,report:i}}async function k(a,{params:b}){let{id:c}=await b;try{let{report:a}=await j(c);return e.NextResponse.json({report:a})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:"Session not found"===a?404:500})}}async function l(a,{params:b}){let{id:c}=await b;try{let b=await a.json();if(!b.report||"object"!=typeof b.report)return e.NextResponse.json({error:"report is required"},{status:400});let{cwd:d,title:f}=await j(c),g=(0,h.u5)({...b.report,schemaVersion:1,sessionId:c,cwd:d,title:b.report.title||f});return e.NextResponse.json({report:g})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:"Session not found"===a?404:500})}}async function m(a,{params:b}){let{id:c}=await b;try{let b=await a.json().catch(()=>({})),{sm:d,title:f,report:i}=await j(c),k=b.action??"generate";if("apply_update"===k){if(!b.update||"object"!=typeof b.update)return e.NextResponse.json({error:"update is required"},{status:400});let a=(0,h.u5)((0,h.wr)(i,b.update,"string"==typeof b.updateKey?b.updateKey:void 0));return e.NextResponse.json({report:a})}if("generate"!==k)return e.NextResponse.json({error:"Unsupported action"},{status:400});let l=d.getEntries(),m=(0,g.Uv)(l,d.getLeafId()),n=(0,h.c3)({report:i,context:m,sessionTitle:f}),o=(0,h.u5)(n);return e.NextResponse.json({report:o})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:"Session not found"===a?404:500})}}d()}catch(a){d(a)}})},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=
|
|
12
|
+
${c}`});return[`# ${a||"Analysis Report"}`,...d].join("\n\n")}d()}catch(a){d(a)}})},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},88742:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>k,POST:()=>m,PUT:()=>l,dynamic:()=>n});var e=c(23211),f=c(75430),g=c(40402),h=c(73196),i=a([f,g,h]);[f,g,h]=i.then?(await i)():i;let n="force-dynamic";async function j(a){let b=await (0,g.os)(a);if(!b)throw Error("Session not found");let c=f.SessionManager.open(b),d=c.getHeader()?.cwd??"",e=function(a){let b=a.getSessionName();if(b)return b;let c=a.getHeader();return c?.id,"Analysis Report"}(c),i=(0,h.tL)(a,d,e);return{sm:c,cwd:d,title:e,report:i}}async function k(a,{params:b}){let{id:c}=await b;try{let{report:a}=await j(c);return e.NextResponse.json({report:a})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:"Session not found"===a?404:500})}}async function l(a,{params:b}){let{id:c}=await b;try{let b=await a.json();if(!b.report||"object"!=typeof b.report)return e.NextResponse.json({error:"report is required"},{status:400});let{cwd:d,title:f}=await j(c),g=(0,h.u5)({...b.report,schemaVersion:1,sessionId:c,cwd:d,title:b.report.title||f});return e.NextResponse.json({report:g})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:"Session not found"===a?404:500})}}async function m(a,{params:b}){let{id:c}=await b;try{let b=await a.json().catch(()=>({})),{sm:d,title:f,report:i}=await j(c),k=b.action??"generate";if("apply_update"===k){if(!b.update||"object"!=typeof b.update)return e.NextResponse.json({error:"update is required"},{status:400});let a=(0,h.u5)((0,h.wr)(i,b.update,"string"==typeof b.updateKey?b.updateKey:void 0));return e.NextResponse.json({report:a})}if("generate"!==k)return e.NextResponse.json({error:"Unsupported action"},{status:400});let l=d.getEntries(),m=(0,g.Uv)(l,void 0===b.leafId?d.getLeafId():b.leafId),n=(0,h.c3)({report:i,context:m,sessionTitle:f,topic:b.topic}),o=(0,h.u5)(n);return e.NextResponse.json({report:o})}catch(b){let a=b instanceof Error?b.message:String(b);return e.NextResponse.json({error:a},{status:"Session not found"===a?404:500})}}d()}catch(a){d(a)}})},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=17854));module.exports=c})();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{var a={};a.id=6202,a.ids=[6202],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},13437:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>j});var e=c(23211),f=c(40402),g=a([f]);function h(a){return a.replace(/\s+/g," ").trim()}function i(a){return!!a&&"object"==typeof a&&"text"===a.type&&"string"==typeof a.text}async function j(a){try{let b=new URL(a.url),c=h(b.searchParams.get("q")??""),d="current"===b.searchParams.get("scope")?"current":"all",g=b.searchParams.get("cwd");if(c.length<2)return e.NextResponse.json({results:[],totalMatches:0,truncated:!1});let j=(await (0,f.dQ)()).filter(a=>"current"!==d||!g||a.cwd===g).sort((a,b)=>b.modified.localeCompare(a.modified)),k=[],l=0,m=!1;for(let a of j){if(l>=80){m=!0;break}let b=[],d=0;try{for(let e of(0,f.DK)(a.path)){let a=function(a){if("message"!==a.type)return null;let{message:b}=a;if("user"!==b.role&&"assistant"!==b.role)return null;let c=b.content;if("string"==typeof c)return{role:b.role,text:h(c)};if(!Array.isArray(c))return null;let d=c.filter(i).map(a=>a.text).join(" ");return{role:b.role,text:h(d)}}(e);a?.text&&a.text.toLowerCase().includes(c.toLowerCase())&&(d+=1,b.length<8&&l<80?(b.push({entryId:e.id,role:a.role,timestamp:e.timestamp,snippet:function(a,b){let c=a.toLowerCase(),d=b.toLowerCase(),e=c.indexOf(d);if(e<0)return a.slice(0,180);let f=Math.max(0,e-70),g=Math.min(a.length,e+b.length+110),h=f>0?"... ":"",i=g<a.length?" ...":"";return`${h}${a.slice(f,g)}${i}`}(a.text,c)}),l+=1):m=!0)}}catch{continue}b.length>0&&k.push({session:a,matches:b,matchCount:d})}return e.NextResponse.json({results:k,totalMatches:l,truncated:m})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}f=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{BR:()=>l,DK:()=>m,O8:()=>k,Uv:()=>n,dQ:()=>h,os:()=>j});var e=c(75430),f=c(12039),g=a([e]);async function h(){let a=await e.SessionManager.listAll(),b=new Map;for(let c of a)b.set(c.path,c.id);let c=i();return a.map(a=>(c.set(a.id,a.path),{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0}))}function i(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function j(a){let b=i().get(a);return b||(await h(),i().get(a)??null)}function k(a,b){i().set(a,b)}function l(a){i().delete(a)}function m(a){return e.SessionManager.open(a).getEntries()}function n(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
|
|
1
|
+
(()=>{var a={};a.id=6202,a.ids=[6202],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},13437:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>j});var e=c(23211),f=c(40402),g=a([f]);function h(a){return a.replace(/\s+/g," ").trim()}function i(a){return!!a&&"object"==typeof a&&"text"===a.type&&"string"==typeof a.text}async function j(a){try{let b=new URL(a.url),c=h(b.searchParams.get("q")??""),d="current"===b.searchParams.get("scope")?"current":"all",g=b.searchParams.get("cwd");if(c.length<2)return e.NextResponse.json({results:[],totalMatches:0,truncated:!1});let j=(await (0,f.dQ)()).filter(a=>"current"!==d||!g||a.cwd===g).sort((a,b)=>b.modified.localeCompare(a.modified)),k=[],l=0,m=!1;for(let a of j){if(l>=80){m=!0;break}let b=[],d=0;try{for(let e of(0,f.DK)(a.path)){let a=function(a){if("message"!==a.type)return null;let{message:b}=a;if("user"!==b.role&&"assistant"!==b.role)return null;let c=b.content;if("string"==typeof c)return{role:b.role,text:h(c)};if(!Array.isArray(c))return null;let d=c.filter(i).map(a=>a.text).join(" ");return{role:b.role,text:h(d)}}(e);a?.text&&a.text.toLowerCase().includes(c.toLowerCase())&&(d+=1,b.length<8&&l<80?(b.push({entryId:e.id,role:a.role,timestamp:e.timestamp,snippet:function(a,b){let c=a.toLowerCase(),d=b.toLowerCase(),e=c.indexOf(d);if(e<0)return a.slice(0,180);let f=Math.max(0,e-70),g=Math.min(a.length,e+b.length+110),h=f>0?"... ":"",i=g<a.length?" ...":"";return`${h}${a.slice(f,g)}${i}`}(a.text,c)}),l+=1):m=!0)}}catch{continue}b.length>0&&k.push({session:a,matches:b,matchCount:d})}return e.NextResponse.json({results:k,totalMatches:l,truncated:m})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}f=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>l,DK:()=>m,O8:()=>k,Uv:()=>n,dQ:()=>h,os:()=>j});var e=c(75430),f=c(12039),g=a([e]);async function h(){let a=await e.SessionManager.listAll(),b=new Map;for(let c of a)b.set(c.path,c.id);let c=i();return a.map(a=>(c.set(a.id,a.path),{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0}))}function i(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function j(a){let b=i().get(a);return b||(await h(),i().get(a)??null)}function k(a,b){i().set(a,b)}function l(a){i().delete(a)}function m(a){return e.SessionManager.open(a).getEntries()}function n(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
|
|
2
2
|
|
|
3
|
-
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},
|
|
3
|
+
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},91268:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(13437),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/search/route",pathname:"/api/search",filename:"route",bundlePath:"app/api/search/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/pidex/pidex/app/api/search/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/search/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},96487:()=>{}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813],()=>b(b.s=91268));module.exports=c})();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{var a={};a.id=6709,a.ids=[6709],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")},6004:(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(75430),g=c(40402),h=a([f,g]);async function i(a,{params:b}){let{id:c}=await b,d=new URL(a.url).searchParams.get("leafId")??void 0;try{let a=await (0,g.os)(c);if(!a)return e.NextResponse.json({error:"Session not found"},{status:404});let b=f.SessionManager.open(a),h=(0,g.Uv)(b.getEntries(),d);return e.NextResponse.json({context:h})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[f,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{BR:()=>l,DK:()=>m,O8:()=>k,Uv:()=>n,dQ:()=>h,os:()=>j});var e=c(75430),f=c(12039),g=a([e]);async function h(){let a=await e.SessionManager.listAll(),b=new Map;for(let c of a)b.set(c.path,c.id);let c=i();return a.map(a=>(c.set(a.id,a.path),{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0}))}function i(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function j(a){let b=i().get(a);return b||(await h(),i().get(a)??null)}function k(a,b){i().set(a,b)}function l(a){i().delete(a)}function m(a){return e.SessionManager.open(a).getEntries()}function n(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
|
|
1
|
+
(()=>{var a={};a.id=6709,a.ids=[6709],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")},6004:(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(75430),g=c(40402),h=a([f,g]);async function i(a,{params:b}){let{id:c}=await b,d=new URL(a.url).searchParams.get("leafId")??void 0;try{let a=await (0,g.os)(c);if(!a)return e.NextResponse.json({error:"Session not found"},{status:404});let b=f.SessionManager.open(a),h=(0,g.Uv)(b.getEntries(),d);return e.NextResponse.json({context:h})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[f,g]=h.then?(await h)():h,d()}catch(a){d(a)}})},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},39246:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(6004),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/context/route",pathname:"/api/sessions/[id]/context",filename:"route",bundlePath:"app/api/sessions/[id]/context/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/pidex/pidex/app/api/sessions/[id]/context/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/context/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>l,DK:()=>m,O8:()=>k,Uv:()=>n,dQ:()=>h,os:()=>j});var e=c(75430),f=c(12039),g=a([e]);async function h(){let a=await e.SessionManager.listAll(),b=new Map;for(let c of a)b.set(c.path,c.id);let c=i();return a.map(a=>(c.set(a.id,a.path),{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0}))}function i(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function j(a){let b=i().get(a);return b||(await h(),i().get(a)??null)}function k(a,b){i().set(a,b)}function l(a){i().delete(a)}function m(a){return e.SessionManager.open(a).getEntries()}function n(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
|
|
2
2
|
|
|
3
|
-
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},
|
|
3
|
+
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},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=39246));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=6849,a.ids=[6849],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")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},13465:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(98192),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/route",pathname:"/api/sessions/[id]",filename:"route",bundlePath:"app/api/sessions/[id]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/pidex/pidex/app/api/sessions/[id]/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},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")},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")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},57975:a=>{a.exports=require("node:util")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79748:a=>{a.exports=require("fs/promises")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},98192:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>n,GET:()=>l,PATCH:()=>m});var e=c(23211),f=c(29021),g=c(33873),h=c(75430),i=c(40402),j=c(56429),k=a([h,i,j]);async function l(a,{params:b}){let{id:c}=await b;try{let b,d,g=await (0,i.os)(c);if(!g)return e.NextResponse.json({error:"Session not found"},{status:404});let k=h.SessionManager.open(g),l=k.getEntries(),m=k.getTree(),n=k.getLeafId(),o=(0,i.Uv)(l,n),p=k.getHeader(),q=p?.timestamp??new Date().toISOString();try{q=(0,f.statSync)(g).mtime.toISOString()}catch{}let r=await (0,i.dQ)(),s=r.find(a=>a.id===c)?.parentSessionId,t=p?{path:g,id:p.id,cwd:p.cwd??"",name:k.getSessionName(),created:p.timestamp,modified:q,messageCount:o.messages.length,firstMessage:o.messages.find(a=>"user"===a.role)?(d=o.messages.find(a=>"user"===a.role).content,"string"==typeof d?d:(Array.isArray(d)?d.find(a=>"text"===a.type)?.text??"":"")||"(no messages)"):"(no messages)",parentSessionId:s}:null;if(new URL(a.url).searchParams.has("includeState")){let a=(0,j.A4)(c);if(a?.isAlive()){let c=await a.send({type:"get_state"});b={running:!0,state:c}}else b={running:!1}}return e.NextResponse.json({sessionId:c,filePath:g,info:t,tree:m,leafId:n,context:o,...void 0!==b?{agentState:b}:{}})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function m(a,{params:b}){let{id:c}=await b;try{let{name:b}=await a.json();if("string"!=typeof b)return e.NextResponse.json({error:"name is required"},{status:400});let d=await (0,i.os)(c);if(!d)return e.NextResponse.json({error:"Session not found"},{status:404});return h.SessionManager.open(d).appendSessionInfo(b.trim()),e.NextResponse.json({ok:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function n(a,{params:b}){let{id:c}=await b;try{let a,b=await (0,i.os)(c);if(!b)return e.NextResponse.json({error:"Session not found"},{status:404});let d=(0,f.readFileSync)(b,"utf8").split("\n")[0];try{let b=JSON.parse(d);"session"===b.type&&(a=b.parentSession)}catch{}let h=b.replace(/\\/g,"/").split("/").slice(0,-1).join("/");try{for(let c of(0,f.readdirSync)(h).filter(a=>a.endsWith(".jsonl")&&(0,g.join)(h,a)!==b)){let d=(0,g.join)(h,c);try{let c=(0,f.readFileSync)(d,"utf8").split("\n"),e=JSON.parse(c[0]);"session"===e.type&&e.parentSession===b&&(e.parentSession=a,c[0]=JSON.stringify(e),(0,f.writeFileSync)(d,c.join("\n")))}catch{}}}catch{}return(0,j.A4)(c)?.destroy(),(0,f.unlinkSync)(b),(0,i.BR)(c),e.NextResponse.json({ok:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[h,i,j]=k.then?(await k)():k,d()}catch(a){d(a)}})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5193,7601],()=>b(b.s=13465));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=6849,a.ids=[6849],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")},8722:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(98192),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/[id]/route",pathname:"/api/sessions/[id]",filename:"route",bundlePath:"app/api/sessions/[id]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/pidex/pidex/app/api/sessions/[id]/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/[id]/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},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")},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")},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},57975:a=>{a.exports=require("node:util")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},75430:a=>{a.exports=import("@earendil-works/pi-coding-agent")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79748:a=>{a.exports=require("fs/promises")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},98192:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{DELETE:()=>n,GET:()=>l,PATCH:()=>m});var e=c(23211),f=c(29021),g=c(33873),h=c(75430),i=c(40402),j=c(56429),k=a([h,i,j]);async function l(a,{params:b}){let{id:c}=await b;try{let b,d,g=await (0,i.os)(c);if(!g)return e.NextResponse.json({error:"Session not found"},{status:404});let k=h.SessionManager.open(g),l=k.getEntries(),m=k.getTree(),n=k.getLeafId(),o=(0,i.Uv)(l,n),p=k.getHeader(),q=p?.timestamp??new Date().toISOString();try{q=(0,f.statSync)(g).mtime.toISOString()}catch{}let r=p?.cwd??"",s=!1;if(r)try{s=(0,f.statSync)(r).isDirectory()}catch{s=!1}let t=await (0,i.dQ)(),u=t.find(a=>a.id===c)?.parentSessionId,v=p?{path:g,id:p.id,cwd:r,cwdExists:s,name:k.getSessionName(),created:p.timestamp,modified:q,messageCount:o.messages.length,firstMessage:o.messages.find(a=>"user"===a.role)?(d=o.messages.find(a=>"user"===a.role).content,"string"==typeof d?d:(Array.isArray(d)?d.find(a=>"text"===a.type)?.text??"":"")||"(no messages)"):"(no messages)",parentSessionId:u}:null;if(new URL(a.url).searchParams.has("includeState")){let a=(0,j.A4)(c);if(a?.isAlive()){let c=await a.send({type:"get_state"});b={running:!0,state:c}}else b={running:!1}}return e.NextResponse.json({sessionId:c,filePath:g,info:v,tree:m,leafId:n,context:o,...void 0!==b?{agentState:b}:{}})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function m(a,{params:b}){let{id:c}=await b;try{let{name:b}=await a.json();if("string"!=typeof b)return e.NextResponse.json({error:"name is required"},{status:400});let d=await (0,i.os)(c);if(!d)return e.NextResponse.json({error:"Session not found"},{status:404});return h.SessionManager.open(d).appendSessionInfo(b.trim()),e.NextResponse.json({ok:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}async function n(a,{params:b}){let{id:c}=await b;try{let a,b=await (0,i.os)(c);if(!b)return e.NextResponse.json({error:"Session not found"},{status:404});let d=(0,f.readFileSync)(b,"utf8").split("\n")[0];try{let b=JSON.parse(d);"session"===b.type&&(a=b.parentSession)}catch{}let h=b.replace(/\\/g,"/").split("/").slice(0,-1).join("/");try{for(let c of(0,f.readdirSync)(h).filter(a=>a.endsWith(".jsonl")&&(0,g.join)(h,a)!==b)){let d=(0,g.join)(h,c);try{let c=(0,f.readFileSync)(d,"utf8").split("\n"),e=JSON.parse(c[0]);"session"===e.type&&e.parentSession===b&&(e.parentSession=a,c[0]=JSON.stringify(e),(0,f.writeFileSync)(d,c.join("\n")))}catch{}}}catch{}return(0,j.A4)(c)?.destroy(),(0,f.unlinkSync)(b),(0,i.BR)(c),e.NextResponse.json({ok:!0})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}[h,i,j]=k.then?(await k)():k,d()}catch(a){d(a)}})}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,5193,7601],()=>b(b.s=8722));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=222,a.ids=[222],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},
|
|
1
|
+
(()=>{var a={};a.id=222,a.ids=[222],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{"use strict";a.exports=c(44870)},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},60951:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>B,patchFetch:()=>A,routeModule:()=>w,serverHooks:()=>z,workAsyncStorage:()=>x,workUnitAsyncStorage:()=>y});var d={};c.r(d),c.d(d,{POST:()=>v});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527);async function v(){return new Response("Not used",{status:410})}let w=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/new/route",pathname:"/api/sessions/new",filename:"route",bundlePath:"app/api/sessions/new/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/pidex/pidex/app/api/sessions/new/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:x,workUnitAsyncStorage:y,serverHooks:z}=w;function A(){return(0,g.patchFetch)({workAsyncStorage:x,workUnitAsyncStorage:y})}async function B(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),w.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/new/route";"/index"===d&&(d="/");let e=await w.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(I&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||w.isDev||z||(K="/index"===(K=E)?"/":K);let L=!0===w.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await w.getIncrementalCache(a,x,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>w.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>w.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await w.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await w.handleResponse({req:a,nextConfig:x,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await w.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92280:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741],()=>b(b.s=60951));module.exports=c})();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{var a={};a.id=1097,a.ids=[1097],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},40228:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h});var e=c(23211),f=c(40402),g=a([f]);async function h(){try{let a=await (0,f.dQ)();return e.NextResponse.json({sessions:a})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}f=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{BR:()=>l,DK:()=>m,O8:()=>k,Uv:()=>n,dQ:()=>h,os:()=>j});var e=c(75430),f=c(12039),g=a([e]);async function h(){let a=await e.SessionManager.listAll(),b=new Map;for(let c of a)b.set(c.path,c.id);let c=i();return a.map(a=>(c.set(a.id,a.path),{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0}))}function i(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function j(a){let b=i().get(a);return b||(await h(),i().get(a)??null)}function k(a,b){i().set(a,b)}function l(a){i().delete(a)}function m(a){return e.SessionManager.open(a).getEntries()}function n(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
|
|
1
|
+
(()=>{var a={};a.id=1097,a.ids=[1097],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},40228:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h});var e=c(23211),f=c(40402),g=a([f]);async function h(){try{let a=await (0,f.dQ)();return e.NextResponse.json({sessions:a})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}f=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>l,DK:()=>m,O8:()=>k,Uv:()=>n,dQ:()=>h,os:()=>j});var e=c(75430),f=c(12039),g=a([e]);async function h(){let a=await e.SessionManager.listAll(),b=new Map;for(let c of a)b.set(c.path,c.id);let c=i();return a.map(a=>(c.set(a.id,a.path),{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0}))}function i(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function j(a){let b=i().get(a);return b||(await h(),i().get(a)??null)}function k(a,b){i().set(a,b)}function l(a){i().delete(a)}function m(a){return e.SessionManager.open(a).getEntries()}function n(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
|
|
2
2
|
|
|
3
|
-
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},
|
|
3
|
+
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},83062:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(40228),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/sessions/route",pathname:"/api/sessions",filename:"route",bundlePath:"app/api/sessions/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/pidex/pidex/app/api/sessions/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/sessions/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},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=83062));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=5177,a.ids=[5177],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")},9774:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{cV:()=>k,p6:()=>l});var e=c(29021),f=c(33873),g=c(75430),h=a([g]);g=(h.then?(await h)():h)[0];let m={generativeUI:!0,plotIdleTimeoutMs:1728e5};function i(){return(0,f.join)((0,g.getAgentDir)(),"annovibe-settings.json")}function j(a){if(!a||"object"!=typeof a)return{...m};let b="number"==typeof a.plotIdleTimeoutMs&&Number.isFinite(a.plotIdleTimeoutMs)&&a.plotIdleTimeoutMs>=0?Math.min(Math.round(a.plotIdleTimeoutMs),2592e6):m.plotIdleTimeoutMs;return{generativeUI:"boolean"==typeof a.generativeUI?a.generativeUI:m.generativeUI,plotIdleTimeoutMs:b}}function k(){let a=i(),b=(0,e.existsSync)(a)?a:(0,f.join)((0,g.getAgentDir)(),"pidex-settings.json");if(!(0,e.existsSync)(b))return{...m};try{return j(JSON.parse((0,e.readFileSync)(b,"utf8")))}catch{return{...m}}}function l(a){let b=j({...k(),...a}),c=i(),d=(0,f.dirname)(c);return(0,e.existsSync)(d)||(0,e.mkdirSync)(d,{recursive:!0}),(0,e.writeFileSync)(c,JSON.stringify(b,null,2),"utf8"),b}d()}catch(a){d(a)}})},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.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")},
|
|
1
|
+
(()=>{var a={};a.id=5177,a.ids=[5177],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")},9774:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{cV:()=>k,p6:()=>l});var e=c(29021),f=c(33873),g=c(75430),h=a([g]);g=(h.then?(await h)():h)[0];let m={generativeUI:!0,plotIdleTimeoutMs:1728e5};function i(){return(0,f.join)((0,g.getAgentDir)(),"annovibe-settings.json")}function j(a){if(!a||"object"!=typeof a)return{...m};let b="number"==typeof a.plotIdleTimeoutMs&&Number.isFinite(a.plotIdleTimeoutMs)&&a.plotIdleTimeoutMs>=0?Math.min(Math.round(a.plotIdleTimeoutMs),2592e6):m.plotIdleTimeoutMs;return{generativeUI:"boolean"==typeof a.generativeUI?a.generativeUI:m.generativeUI,plotIdleTimeoutMs:b}}function k(){let a=i(),b=(0,e.existsSync)(a)?a:(0,f.join)((0,g.getAgentDir)(),"pidex-settings.json");if(!(0,e.existsSync)(b))return{...m};try{return j(JSON.parse((0,e.readFileSync)(b,"utf8")))}catch{return{...m}}}function l(a){let b=j({...k(),...a}),c=i(),d=(0,f.dirname)(c);return(0,e.existsSync)(d)||(0,e.mkdirSync)(d,{recursive:!0}),(0,e.writeFileSync)(c,JSON.stringify(b,null,2),"utf8"),b}d()}catch(a){d(a)}})},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.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")},38094:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(44364),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/settings/route",pathname:"/api/settings",filename:"route",bundlePath:"app/api/settings/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/pidex/pidex/app/api/settings/route.ts",nextConfigOutput:"",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/settings/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},44364:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>h,PUT:()=>i,dynamic:()=>j});var e=c(23211),f=c(9774),g=a([f]);f=(g.then?(await g)():g)[0];let j="force-dynamic";async function h(){return e.NextResponse.json({settings:(0,f.cV)()})}async function i(a){try{let b=(await a.json()).settings;if(!b||"object"!=typeof b)return e.NextResponse.json({error:"Invalid settings data"},{status:400});let c=(0,f.p6)({..."boolean"==typeof b.generativeUI?{generativeUI:b.generativeUI}:{},..."number"==typeof b.plotIdleTimeoutMs?{plotIdleTimeoutMs:b.plotIdleTimeoutMs}:{}});return e.NextResponse.json({success:!0,settings:c})}catch(a){return e.NextResponse.json({error:String(a)},{status:500})}}d()}catch(a){d(a)}})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},75430:a=>{"use strict";a.exports=import("@earendil-works/pi-coding-agent")},78335:()=>{},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=38094));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=7812,a.ids=[7812],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.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")},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")},
|
|
1
|
+
(()=>{var a={};a.id=7812,a.ids=[7812],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")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.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")},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")},52583:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>F,patchFetch:()=>E,routeModule:()=>A,serverHooks:()=>D,workAsyncStorage:()=>B,workUnitAsyncStorage:()=>C});var d={};c.r(d),c.d(d,{POST:()=>z,dynamic:()=>x});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(84107);let x="force-dynamic",y=/\x1B\[[0-9;]*m/g;async function z(a){try{let{package:b,scope:c,cwd:d}=await a.json();if(!b?.trim())return v.NextResponse.json({error:"package required"},{status:400});let e="project"!==c,f=["skills","add",b.trim(),"-y","--agent","pi"];e&&f.push("-g"),console.log(`[skills/install] running: npx ${f.join(" ")}`);let{stdout:g,stderr:h}=await (0,w.a)(f,{timeout:6e4,cwd:!e&&d?d:void 0,env:{...process.env,FORCE_COLOR:"0"}}),i=(g+h).replace(y,"");if(!/Installation complete|Installed \d+ skill/.test(i))return v.NextResponse.json({error:i.slice(-300)||"Install failed"},{status:500});return v.NextResponse.json({success:!0,output:i})}catch(b){let a=((b.stdout??"")+(b.stderr??"")).replace(y,"");return v.NextResponse.json({error:a||(b.message??String(b))},{status:500})}}let A=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/skills/install/route",pathname:"/api/skills/install",filename:"route",bundlePath:"app/api/skills/install/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/pidex/pidex/app/api/skills/install/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:B,workUnitAsyncStorage:C,serverHooks:D}=A;function E(){return(0,g.patchFetch)({workAsyncStorage:B,workUnitAsyncStorage:C})}async function F(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),A.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/skills/install/route";"/index"===d&&(d="/");let e=await A.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||A.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===A.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await A.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>A.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>A.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await A.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await A.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await A.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},84107:(a,b,c)=>{"use strict";c.d(b,{a:()=>j});var d=c(79646),e=c(28354),f=c(29021),g=c(33873);let h=require("process"),i=(0,e.promisify)(d.execFile);async function j(a,b={}){let c=function(){let a=(0,g.dirname)(h.execPath);for(let b of[(0,g.join)(a,"node_modules","npm","bin","npx-cli.js"),(0,g.join)(a,"..","lib","node_modules","npm","bin","npx-cli.js")])try{if((0,f.existsSync)(b))return b}catch{}return null}(),{command:d,commandArgs:e}=c?{command:h.execPath,commandArgs:[c,...a]}:{command:"npx",commandArgs:a};return i(d,e,{timeout:b.timeout,cwd:b.cwd,env:b.env})}},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=52583));module.exports=c})();
|