importtype{ExtensionAPI}from"@earendil-works/pi-coding-agent";exportdefaultfunction(pi: ExtensionAPI){// Captured once at session start — keeps the system prompt stable for prompt caching.constnow=newDate();constpad=(n: number)=>String(n).padStart(2,"0");constweekday=now.toLocaleDateString("en-US",{weekday:"long"});constoffsetMin=-now.getTimezoneOffset();constoffset=`UTC${offsetMin>=0?"+":"-"}${Math.trunc(Math.abs(offsetMin)/60)}`;consttime=`${now.getFullYear()}-${pad(now.getMonth()+1)}-${pad(now.getDate())}${pad(now.getHours())}:${pad(now.getMinutes())} (${weekday}, ${offset})`;pi.on("before_agent_start",(event)=>{return{systemPrompt:
event.systemPrompt+"\n\nSHELL: You are in Git Bash on Windows. CMD builtins (dir, copy, type, del, move, etc.) work directly — just type them as-is. Do NOT prefix commands with 'cmd /c'. The '/c' flag gets interpreted by bash as a path fragment, which breaks execution completely."+"\n\nCWD: every bash command starts in the session's working directory — 'cd' does NOT persist between tool calls. Use absolute paths, or chain within one call: cd dir && cmd."+`\n\nTime: ${time} — local time at session start (approximate; the session may have been running for a while). Trust it over your training data for anything date-sensitive ("latest", "recent", versions, news).`,};});}
Warning
LINK
You are about to visit a link which has been flagged with the above content warnings. Do you wish to continue?