module.exports=[324725,(e,s,t)=>{s.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"))},579839,e=>{"use strict";e.i(628892);var s=e.i(437314);async function t(){let e=await s.SessionManager.listAll(),t=new Map;for(let s of e)t.set(s.path,s.id);let r=i();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 i(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function r(e){let s=i().get(e);return s||(await t(),i().get(e)??null)}e.i(667912),e.s(["buildSessionContext",0,function(e,t){let i,r,n,a=new Map;for(let s of e)a.set(s.id,s);let o=(0,s.buildSessionContext)(e,t,a);if(null===t||(t&&(i=a.get(t)),i||(i=e[e.length-1]),!i))return{messages:[],entryIds:[],thinkingLevel:o.thinkingLevel,model:o.model};let l=[],_=i;for(;_;)l.unshift(_),_=_.parentId?a.get(_.parentId):void 0;for(let e of l)"compaction"===e.type&&(r=e.id,n=e.firstKeptEntryId);let p=[];if(r){p.push(r);let e=l.findIndex(e=>e.id===r),s=n?l.findIndex((s,t)=>t<e&&s.id===n):-1,t=s>=0?s:e;for(let s=t;s<e;s++)"message"===l[s].type&&p.push(l[s].id);for(let s=e+1;s<l.length;s++)"message"===l[s].type&&p.push(l[s].id)}else for(let e of l)"message"===e.type&&p.push(e.id);return{messages:o.messages.map(e=>{if("compactionSummary"===e.role)return{role:"user",content:`*The conversation history before this point was compacted into the following summary:*

${e.summary??""}`,timestamp:e.timestamp};if("assistant"!==e.role)return e;let s=e.content;if(!Array.isArray(s))return e;let t=s.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:t}}),entryIds:p,thinkingLevel:o.thinkingLevel,model:o.model}},"cacheSessionPath",0,function(e,s){i().set(e,s)},"invalidateSessionPathCache",0,function(e){i().delete(e)},"listAllSessions",0,t,"resolveSessionPath",0,r],579839)},936647,e=>{e.v(s=>Promise.all(["server/chunks/0itb_00u9wl8._.js","server/chunks/0itb_openai_index_mjs_0axk~np._.js"].map(s=>e.l(s))).then(()=>s(172704)))},639174,e=>{e.v(s=>Promise.all(["server/chunks/0itb_@earendil-works_pi-ai_dist_05.7.az._.js","server/chunks/0itb_@earendil-works_pi-ai_dist_providers_anthropic_0ru_.4m.js"].map(s=>e.l(s))).then(()=>s(4522)))},964583,e=>{e.v(s=>Promise.all(["server/chunks/0itb_@earendil-works_pi-ai_dist_07t16t4._.js","server/chunks/0itb_openai_index_mjs_0axk~np._.js"].map(s=>e.l(s))).then(()=>s(150958)))},387014,e=>{e.v(s=>Promise.all(["server/chunks/[root-of-the-server]__0f0~phg._.js","server/chunks/0itb_0m6i~hh._.js"].map(s=>e.l(s))).then(()=>s(418635)))},121031,e=>{e.v(s=>Promise.all(["server/chunks/[root-of-the-server]__0la-d..._.js","server/chunks/0itb_0m6i~hh._.js"].map(s=>e.l(s))).then(()=>s(928682)))},450430,e=>{e.v(s=>Promise.all(["server/chunks/0itb_@earendil-works_pi-ai_dist_01ehdsq._.js","server/chunks/0itb_@earendil-works_pi-ai_dist_providers_mistral_0buldp-.js"].map(s=>e.l(s))).then(()=>s(337089)))},203510,e=>{e.v(s=>Promise.all(["server/chunks/0itb_@earendil-works_pi-ai_dist_02-mv9t._.js","server/chunks/0itb_@earendil-works_pi-ai_dist_providers_openai-codex-responses_0fmlr7k.js"].map(s=>e.l(s))).then(()=>s(62242)))},57418,e=>{e.v(s=>Promise.all(["server/chunks/0itb_0hamcdd._.js","server/chunks/0itb_openai_index_mjs_0axk~np._.js","server/chunks/0itb_@earendil-works_pi-ai_dist_providers_openai-completions_11yn7y0.js"].map(s=>e.l(s))).then(()=>s(664709)))},550791,e=>{e.v(s=>Promise.all(["server/chunks/0itb_02kv..~._.js","server/chunks/0itb_openai_index_mjs_0axk~np._.js"].map(s=>e.l(s))).then(()=>s(62426)))},691956,e=>{e.v(e=>Promise.resolve().then(()=>e(347299)))},70729,e=>{e.v(e=>Promise.resolve().then(()=>e(666680)))},284503,e=>{e.v(s=>Promise.all(["server/chunks/0itb_@silvia-odwyer_photon-node_photon_rs_0_n~jv8.js"].map(s=>e.l(s))).then(()=>s(650041)))},707480,e=>{e.v(e=>Promise.resolve().then(()=>e(446786)))},323970,e=>{e.v(e=>Promise.resolve().then(()=>e(522734)))}];

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