module.exports=[24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},70406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},59287,e=>e.a(async(t,r)=>{try{let t=await e.y("@earendil-works/pi-coding-agent-4cdde81112ef3dc5");e.n(t),r()}catch(e){r(e)}},!0),9948,e=>{"use strict";e.s(["normalizeToolCalls",0,function(e){if("assistant"!==e.role)return e;let t=e.content;if(!Array.isArray(t))return e;let r=t.map(e=>("object"!=typeof e||null===e||Array.isArray(e)||"toolCall"!==e.type?null:{type:"toolCall",toolCallId:"string"==typeof e.toolCallId?e.toolCallId:"string"==typeof e.id?e.id:"",toolName:"string"==typeof e.toolName?e.toolName:"string"==typeof e.name?e.name:"",input:"object"!=typeof e.input||null===e.input||Array.isArray(e.input)?"object"!=typeof e.arguments||null===e.arguments||Array.isArray(e.arguments)?{}:e.arguments:e.input})??e);return{...e,content:r}}])},79839,e=>e.a(async(t,r)=>{try{var s=e.i(59287),n=e.i(9948),a=t([s]);async function i(){let e=await s.SessionManager.listAll(),t=new Map;for(let r of e)t.set(r.path,r.id);let r=o();return e.map(e=>(r.set(e.id,e.path),{path:e.path,id:e.id,cwd:e.cwd,name:e.name,created:e.created instanceof Date?e.created.toISOString():String(e.created),modified:e.modified instanceof Date?e.modified.toISOString():String(e.modified),messageCount:e.messageCount,firstMessage:e.firstMessage||"(no messages)",parentSessionId:e.parentSessionPath?t.get(e.parentSessionPath):void 0}))}function o(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function l(e){let t=o().get(e);return t||(await i(),o().get(e)??null)}[s]=a.then?(await a)():a,e.s(["buildSessionContext",0,function(e,t){let r,a,i,o=new Map;for(let t of e)o.set(t.id,t);let l=(0,s.buildSessionContext)(e,t,o);if(null===t||(t&&(r=o.get(t)),r||(r=e[e.length-1]),!r))return{messages:[],entryIds:[],thinkingLevel:l.thinkingLevel,model:l.model};let p=[],d=r;for(;d;)p.unshift(d),d=d.parentId?o.get(d.parentId):void 0;for(let e of p)"compaction"===e.type&&(a=e.id,i=e.firstKeptEntryId);let u=[];if(a){u.push(a);let e=p.findIndex(e=>e.id===a),t=i?p.findIndex((t,r)=>r<e&&t.id===i):-1,r=t>=0?t:e;for(let t=r;t<e;t++)"message"===p[t].type&&u.push(p[t].id);for(let t=e+1;t<p.length;t++)"message"===p[t].type&&u.push(p[t].id)}else for(let e of p)"message"===e.type&&u.push(e.id);return{messages:l.messages.map(e=>"compactionSummary"===e.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*

${e.summary??""}`,timestamp:e.timestamp}:(0,n.normalizeToolCalls)(e)),entryIds:u,thinkingLevel:l.thinkingLevel,model:l.model}},"cacheSessionPath",0,function(e,t){o().set(e,t)},"invalidateSessionPathCache",0,function(e){o().delete(e)},"listAllSessions",0,i,"resolveSessionPath",0,l]),r()}catch(e){r(e)}},!1),7480,e=>{e.v(t=>Promise.all(["server/chunks/[externals]_os_0149k2b._.js"].map(t=>e.l(t))).then(()=>t(46786)))},23970,e=>{e.v(e=>Promise.resolve().then(()=>e(22734)))}];

//# sourceMappingURL=%5Broot-of-the-server%5D__0o5ssoh._.js.map