@henlii/pidance 0.2.18 → 0.2.20
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 +10 -10
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.json +1 -1
- 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_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +3 -3
- package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- 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/about/route.js +1 -1
- package/.next/server/app/api/agent/[id]/events/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +5 -5
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/index.segments/_full.segment.rsc +5 -5
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/page.js +4 -4
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +10 -10
- package/.next/server/chunks/188.js +1 -1
- package/.next/server/chunks/5274.js +1 -1
- package/.next/server/chunks/5304.js +1 -1
- package/.next/server/chunks/7594.js +1 -1
- package/.next/server/middleware-build-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/chunks/9780-8a68d2504f1bc8c7.js +1 -0
- package/.next/static/chunks/app/page-d8475c217d5c2824.js +25 -0
- package/.next/static/css/b368fb57ad4b2393.css +1 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/.next/static/chunks/9780-e37e777171931f98.js +0 -1
- package/.next/static/chunks/app/page-3363ad6ec5aa5683.js +0 -25
- package/.next/static/css/0f9646dc4217843e.css +0 -1
- /package/.next/static/{HqMH1CYeOjjDXnusjV3tz → bYQa7wtG5XvdiFs9n9TDR}/_buildManifest.js +0 -0
- /package/.next/static/{HqMH1CYeOjjDXnusjV3tz → bYQa7wtG5XvdiFs9n9TDR}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";exports.id=7594,exports.ids=[7594],exports.modules={2416:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{j1:()=>t});var e=c(75430),f=c(60396),g=c(68524),h=c(89953),i=c(5815),j=c(85664),k=c(65107),l=c(95237),m=c(38195),n=c(62693),o=c(31524),p=c(52960),q=c(87538),r=a([e,l]);function s(a){return"string"==typeof a&&a?a:void 0}[e,l]=r.then?(await r)():r;class u{static{this.PARTIAL_RENDER_MIN_INTERVAL_MS=100}constructor(a){this.options=a,this.listeners=[],this.runtime=null,this.unsubscribe=null,this.extensionUi=null,this.idleTimer=null,this.startupHoldTimer=null,this.startupHold=!0,this.activeCommandCount=0,this._scheduledRecheck=!1,this.onDestroyCallback=null,this._alive=!0,this.promptRunning=!1,this.lastStopReason=null,this.followUpQueue=[],this.followUpQueueHydrated=!1,this.flushingFollowUp=!1,this.followUpFlushBatch=[],this.followUpFlushCursor=0,this.followUpFlushConfirmed=!1,this.followUpFlushAsOne=!1,this.followUpFlushOriginal=[],this.bashRunning=!1,this.bashCommand=null,this.localQueue={steering:[],followUp:[]},this.promptReceipts=new Map,this.promptInFlight=new Map,this.destroyPromise=null,this.hasQueueSnapshot=!1,this.renderBridgeTheme=(0,q.Lm)(),this.toolRenderStates=new Map,this.realSessionId=a.sessionId,this.realSessionFile=a.sessionFile,this.idleTimeoutMs=a.idleTimeoutMs??6e5,this.agentDir=a.agentDir??(0,f.$M)(),this.activeToolNames=a.toolNames}get sessionId(){return this.realSessionId}get sessionFile(){return this.realSessionFile}listPendingExtensionRequests(){return Array.from(this.extensionUi?.pendingSnapshot.values()??[])}get inner(){let a=this.runtime?.session;if(a)return{sessionManager:a.sessionManager}}isAlive(){return this._alive&&null!==this.runtime}isRunning(){if(!this._alive||!this.runtime)return!1;let a=this.runtime.session;return this.promptRunning||this.bashRunning||a.isStreaming||a.isCompacting}onDestroy(a){this.onDestroyCallback=a}onEvent(a){return this.listeners.push(a),()=>{this.listeners=this.listeners.filter(b=>b!==a)}}beginExtensionBinding(){}async waitForExtensionsBound(){}emit(a){for(let b of this.listeners)try{b(a)}catch(a){console.error("[pidance] sdk host listener error:",a)}}notifyRunning(){this.options.onRunningChange?.()}resetIdleTimer(){if(this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=null,!(!this._alive||!this.runtime||this.startupHold||this.isRunning())&&!this.flushingFollowUp){if(this.followUpQueue.length>0&&!this.isFollowUpHeld())return void this.scheduleFollowUpFlush();this.idleTimer=setTimeout(()=>{if(this.idleTimer=null,!this.isRunning()&&!this.flushingFollowUp){if(this.followUpQueue.length>0&&!this.isFollowUpHeld())return void this.scheduleFollowUpFlush();this.destroyAsync()}},0)}}releaseStartupHold(){this.startupHold&&(this.startupHold=!1,this.startupHoldTimer&&clearTimeout(this.startupHoldTimer),this.startupHoldTimer=null)}isSettled(){return!!this.runtime&&!!this._alive&&!this.isRunning()}isFollowUpHeld(){let a=(0,g.rV)(this.agentDir);return!0===(0,g.ql)(a,`sessionQueueHold.${this.realSessionId}`)}setFollowUpHeld(a){try{(0,g.xP)(`sessionQueueHold.${this.realSessionId}`,!!a||null,this.agentDir)}catch(a){console.error("[pidance] failed to persist follow-up hold:",a)}}hydrateFollowUpQueue(){if(this.followUpQueueHydrated)return;this.followUpQueueHydrated=!0;let a=(0,g.rV)(this.agentDir),b=(0,g.ql)(a,`sessionQueue.${this.realSessionId}`);this.followUpQueue=Array.isArray(b)?b.filter(a=>"string"==typeof a&&a.trim().length>0):[]}persistFollowUpQueue(){try{(0,g.xP)(`sessionQueue.${this.realSessionId}`,this.followUpQueue,this.agentDir)}catch(a){console.error("[pidance] failed to persist follow-up queue:",a)}}scheduleFollowUpFlush(){!this._alive||!this.runtime||this.flushingFollowUp||0===this.followUpQueue.length||this.isFollowUpHeld()||this.isSettled()&&(this.flushingFollowUp=!0,this.followUpFlushAsOne=!0===(0,g.rV)(this.agentDir).queueFlushAsOne,this.followUpFlushOriginal=[...this.followUpQueue],this.followUpFlushBatch=this.followUpFlushAsOne?[this.followUpFlushOriginal.join("\n\n")]:[...this.followUpFlushOriginal],this.followUpFlushCursor=0,this.followUpFlushConfirmed=!1,this.sendNextFollowUp())}async sendNextFollowUp(){if(!this.flushingFollowUp)return;if(this.isFollowUpHeld())return void this.abortFollowUpFlush();let a=this.followUpFlushBatch[this.followUpFlushCursor];if(void 0===a)return void this.finishFollowUpFlush();if(this.isSettled()){this.followUpFlushConfirmed=!1;try{await this.send({type:"prompt",message:a})}catch(b){let a=b instanceof Error?b.message:String(b);this.emit({type:"follow_up_flush_error",errorMessage:a}),this.abortFollowUpFlush()}}}confirmFollowUpFlush(){if(!this.flushingFollowUp||this.followUpFlushConfirmed)return;let a=this.followUpFlushBatch[this.followUpFlushCursor];if(void 0===a)return;if(this.followUpFlushConfirmed=!0,this.followUpFlushAsOne){let a=new Set(this.followUpFlushOriginal);this.followUpQueue=this.followUpQueue.filter(b=>!a.has(b))}else{let b=this.followUpQueue.indexOf(a);b>=0&&this.followUpQueue.splice(b,1)}let b=[...this.followUpQueue];(this.persistFollowUpQueue(),this.emit({type:"follow_up_flushed",sessionId:this.realSessionId,item:a,remaining:b}),this.followUpFlushAsOne)?this.finishFollowUpFlush():(this.followUpFlushCursor+=1,this.followUpFlushCursor>=this.followUpFlushBatch.length?this.finishFollowUpFlush():this.sendNextFollowUp())}abortFollowUpFlush(){this.flushingFollowUp&&(this.flushingFollowUp=!1,this.followUpFlushBatch=[],this.followUpFlushCursor=0,this.followUpFlushConfirmed=!1,this.followUpFlushAsOne=!1,this.followUpFlushOriginal=[],this.persistFollowUpQueue(),this.resetIdleTimer())}finishFollowUpFlush(){this.flushingFollowUp=!1,this.followUpFlushBatch=[],this.followUpFlushCursor=0,this.followUpFlushConfirmed=!1,this.followUpFlushAsOne=!1,this.followUpFlushOriginal=[],this.persistFollowUpQueue(),this.resetIdleTimer(),this.followUpQueue.length>0&&!this.isFollowUpHeld()&&this.scheduleFollowUpFlush()}get session(){if(!this.runtime)throw Error("SDK session is not alive");return this.runtime.session}get services(){if(!this.runtime)throw Error("SDK session is not alive");return this.runtime.services}syncIdentityFromSession(){let a=this.session,b=a.sessionId||this.realSessionId,c=a.sessionFile||this.realSessionFile,d=this.realSessionId;this.realSessionId=b,this.realSessionFile=c,c&&this.options.cacheSessionPath?.(b,c),d!==b&&this.options.onSessionRekeyed?.(d,b,this)}async rebindSession(){let a=this.session;this.extensionUi?.dispose(),this.extensionUi=(0,m.t)(a=>{this.trackExtensionSideEffects(a),this.emit(a)}),await a.bindExtensions({uiContext:this.extensionUi.uiContext,mode:"rpc",commandContextActions:{waitForIdle:()=>a.waitForIdle(),newSession:async a=>{let b=await this.runtime.newSession(a);return b.cancelled||await this.rebindSession(),b},fork:async(a,b)=>{let c=await this.runtime.fork(a,b);return c.cancelled||await this.rebindSession(),{cancelled:c.cancelled}},navigateTree:async(b,c)=>({cancelled:(await a.navigateTree(b,{summarize:c?.summarize,customInstructions:c?.customInstructions,replaceInstructions:c?.replaceInstructions,label:c?.label})).cancelled}),switchSession:async(a,b)=>{let c=await this.runtime.switchSession(a,b);return c.cancelled||await this.rebindSession(),c},reload:async()=>{await a.reload()}},onError:a=>{this.setFollowUpHeld(!0),this.emit({type:"extension_error",extensionPath:a.extensionPath,event:a.event,error:a.error})}}),this.unsubscribe?.(),this.unsubscribe=a.subscribe(a=>{this.resetIdleTimer(),this.handleSessionEvent(a)}),this.syncIdentityFromSession()}trackExtensionSideEffects(a){if("extension_ui_request"!==a.type)return;let b=s(a.method);if("setStatus"===b){let b=s(a.statusKey)??s(a.key)??"default",c=s(a.statusText)??s(a.text)??"";c?this.extensionUi?.statuses.set(b,c):this.extensionUi?.statuses.delete(b)}if("setWidget"===b){let b=s(a.widgetKey)??s(a.key)??"default",c=a.widgetLines??a.content;null==c?this.extensionUi?.widgets.delete(b):this.extensionUi?.widgets.set(b,{lines:c,placement:a.widgetPlacement})}this.notifyRunning()}maybeAutoNameSession(){try{let a=this.session?.sessionManager;if(!a||a.getSessionName())return;let b=(a.buildSessionContext().messages??[]).find(a=>"user"===a.role),c=function(a){let b="";"string"==typeof a?b=a:Array.isArray(a)&&(b=a.filter(a=>"object"==typeof a&&null!==a&&"text"===a.type&&"string"==typeof a.text).map(a=>a.text).join("\n"));let c=b.replace(/\s+/g," ").trim();if(c)return c.length>60?`${c.slice(0,60)}…`:c}(b?.content);c&&a.appendSessionInfo(c)}catch{}}readStopReasonFromAgentEnd(a){let b=a.messages;if(!Array.isArray(b))return null;for(let a=b.length-1;a>=0;a--){let c=b[a],d=c?.message?.stopReason??c?.stopReason;if("string"==typeof d){if("aborted"===d)return"aborted";if("error"===d||"prompt_error"===d)return"error";return"completed"}}return null}handleSessionEvent(a){switch(a.type){case"agent_start":this.promptRunning=!0,(0,i.NK)(this.realSessionId,Date.now()),this.notifyRunning();break;case"agent_end":this.promptRunning=!1,this.lastStopReason=this.readStopReasonFromAgentEnd(a)??this.lastStopReason??"completed",("aborted"===this.lastStopReason||"error"===this.lastStopReason)&&this.setFollowUpHeld(!0),(0,i.PI)(this.realSessionId),this.options.onSessionListInvalidate?.(),this.realSessionFile&&(0,k.$9)(this.realSessionFile),this.maybeAutoNameSession(),this.notifyRunning(),this.emit({type:"prompt_done"});break;case"agent_settled":this.promptRunning=!1,this.notifyRunning(),"completed"===this.lastStopReason?this.flushingFollowUp?this.followUpFlushConfirmed?this.sendNextFollowUp():this.confirmFollowUpFlush():this.scheduleFollowUpFlush():this.flushingFollowUp&&("aborted"===this.lastStopReason||"error"===this.lastStopReason)&&this.abortFollowUpFlush(),this.resetIdleTimer();break;case"compaction_start":case"auto_compaction_start":this.notifyRunning();break;case"compaction_end":case"auto_compaction_end":this.notifyRunning(),!0!==a.aborted&&!a.errorMessage&&this.isSettled()&&this.scheduleFollowUpFlush(),this.resetIdleTimer();break;case"message_end":{let b=a.message;b?.role==="user"&&(this.confirmFollowUpFlush(),setImmediate(()=>{try{(0,l.kb)(this.session.sessionManager),this.syncIdentityFromSession(),this.options.onSessionListInvalidate?.()}catch(a){console.error("[pidance] materialize after user message failed:",a)}}));break}case"queue_update":{let b=Array.isArray(a.steering)?a.steering.filter(a=>"string"==typeof a):[],c=Array.isArray(a.followUp)?a.followUp.filter(a=>"string"==typeof a):[];this.localQueue={steering:b,followUp:c},this.hasQueueSnapshot=!0}}this.emit(this.withRenderedToolLines(a))}withRenderedToolLines(a){try{if(!this.renderBridgeTheme)return a;switch(a.type){case"tool_execution_update":{if(!this.shouldRenderPartialUpdate(a.toolCallId))return a;let b=this.getToolRenderDefinition(a.toolName);if(!b)return a;let c=this.buildToolRenderContext(a.toolCallId,a.args??a.input,{isPartial:!0,expanded:!0,isError:!0===a.isError,resultSlot:!0});if(!c)return a;let d=(0,q.t_)(b,a.partialResult,{expanded:!0,isPartial:!0},c,b=>this.updateToolRenderLastComponent(a.toolCallId,!0,b));return d?{...a,renderedLines:d}:a}case"tool_call":{let b=this.getToolRenderDefinition(a.toolName);if(!b)return a;let c=this.buildToolRenderContext(a.toolCallId,a.input,{isPartial:!1,expanded:!0,isError:!1,resultSlot:!1});if(!c)return a;let d=(0,q.GD)(b,a.input,c,b=>this.updateToolRenderLastComponent(a.toolCallId,!1,b));return d?{...a,renderedCallLines:d}:a}case"tool_result":{let b=this.getToolRenderDefinition(a.toolName);if(!b)return a;let c=this.buildToolRenderContext(a.toolCallId,a.args??a.input,{isPartial:!1,expanded:!0,isError:!0===a.isError,resultSlot:!0});if(!c)return a;let d=(0,q.t_)(b,{content:a.content,details:a.details,isError:!0===a.isError,...void 0!==a.usage?{usage:a.usage}:{}},{expanded:!0,isPartial:!1},c,b=>this.updateToolRenderLastComponent(a.toolCallId,!0,b));return d?{...a,renderedResultLines:d}:a}case"message_start":case"message_end":{let b=a.message;if(b?.role!=="custom"||"string"!=typeof b.customType||""===b.customType)return a;let c=this.session.extensionRunner,d="function"==typeof c?.getMessageRenderer?c.getMessageRenderer(b.customType):void 0,e=(0,q.Mf)(d,a.message,this.renderBridgeTheme);return e?{...a,renderedLines:e}:a}default:return a}}catch{return a}}getToolRenderDefinition(a){if("string"==typeof a&&""!==a)try{return this.session.getToolDefinition(a)}catch{return}}buildToolRenderContext(a,b,c){let d=this.getOrCreateToolRenderState(a);return d?{args:b,toolCallId:a,invalidate:()=>{},lastComponent:c.resultSlot?d.lastResultComponent:d.lastCallComponent,state:d.state,cwd:this.realCwd,executionStarted:!0,argsComplete:!0,isPartial:c.isPartial,expanded:c.expanded,showImages:!1,isError:c.isError}:null}getOrCreateToolRenderState(a){if("string"!=typeof a||""===a)return null;let b=this.toolRenderStates.get(a);return b||(b={state:{},lastCallComponent:void 0,lastResultComponent:void 0,lastPartialRenderAt:void 0},this.toolRenderStates.set(a,b)),b}updateToolRenderLastComponent(a,b,c){if("string"!=typeof a||""===a)return;let d=this.toolRenderStates.get(a);d&&(b?d.lastResultComponent=c:d.lastCallComponent=c)}shouldRenderPartialUpdate(a){if("string"!=typeof a||""===a)return!0;let b=Date.now(),c=this.getOrCreateToolRenderState(a);return!c||(void 0===c.lastPartialRenderAt||!(b-c.lastPartialRenderAt<u.PARTIAL_RENDER_MIN_INTERVAL_MS))&&(c.lastPartialRenderAt=b,!0)}get realCwd(){try{return this.session.sessionManager.getHeader()?.cwd||this.options.cwd}catch{return this.options.cwd}}async start(){try{var a,b;let c=(a=this.realSessionFile,b=this.options.cwd,a?(0,l.G1)(a):(0,l.Qu)(b)),d=c.getCwd()||this.options.cwd,f=this.agentDir,g=this.activeToolNames,h=async({cwd:a,agentDir:b,sessionManager:c,sessionStartEvent:d})=>{let f=await (0,e.createAgentSessionServices)({cwd:a,agentDir:b});for(let a of f.modelRuntime.getModels())(0,o.yu)(a);return{...await (0,e.createAgentSessionFromServices)({services:f,sessionManager:c,sessionStartEvent:d,tools:g&&g.length>0?g:void 0,noTools:g&&0===g.length?"all":void 0}),services:f,diagnostics:f.diagnostics}};this.runtime=await (0,e.createAgentSessionRuntime)(h,{cwd:d,agentDir:f,sessionManager:c}),this.runtime.setRebindSession(async()=>{await this.rebindSession()}),this.runtime.setBeforeSessionInvalidate(()=>{this.extensionUi?.dispose(),this.unsubscribe?.(),this.unsubscribe=null}),await this.rebindSession(),this.syncIdentityFromSession(),this.hydrateFollowUpQueue(),this.startupHoldTimer=setTimeout(()=>{this.startupHoldTimer=null,this.startupHold=!1,this.resetIdleTimer()},5e3),this.startupHoldTimer.unref?.(),this.resetIdleTimer(),this.followUpQueue.length>0&&!this.isFollowUpHeld()&&this.isSettled()&&this.scheduleFollowUpFlush()}catch(a){throw await this.destroyAsync(),a}}projectState(){let a=this.session,b=a.model,c={stateSources:{rpcGetState:!1,sdkSession:!0,sessionStats:!0,localQueue:!0,localExtensionUi:!0},sessionId:this.realSessionId,sessionFile:this.realSessionFile,sessionName:a.sessionName,isStreaming:a.isStreaming,isCompacting:a.isCompacting,isPromptRunning:this.promptRunning,lastStopReason:this.lastStopReason,isBashRunning:this.bashRunning,pendingBash:this.bashCommand,autoCompactionEnabled:a.autoCompactionEnabled,steeringMode:a.steeringMode,followUpMode:a.followUpMode,thinkingLevel:a.thinkingLevel,systemPrompt:a.systemPrompt??"",model:b?{id:b.id,provider:b.provider}:void 0,messageCount:a.messages.length,pendingMessageCount:a.pendingMessageCount,extensionStatuses:Array.from(this.extensionUi?.statuses.entries()??[],([a,b])=>({key:a,text:b})),extensionWidgets:Array.from(this.extensionUi?.widgets.entries()??[],([a,b])=>({key:a,lines:Array.isArray(b?.lines)?b.lines:[],placement:b?.placement==="belowEditor"?"belowEditor":"aboveEditor"})),pendingExtensionRequests:Array.from(this.extensionUi?.pendingSnapshot.values()??[])};c.queuedMessages={steering:this.hasQueueSnapshot?[...this.localQueue.steering]:[],followUp:[...this.followUpQueue]};try{let b=a.getSessionStats(),d=b?.contextUsage;d&&"number"==typeof d.contextWindow&&d.contextWindow>0&&(c.contextUsage={contextWindow:d.contextWindow,percent:"number"==typeof d.percent?d.percent:null,tokens:"number"==typeof d.tokens?d.tokens:null})}catch{}return c}appendActivity(a){if(!this.runtime)throw Error("Cannot append activity: session not alive");let b=a&&"object"==typeof a&&"type"in a&&"append_activity"===a.type?(0,j.qF)(a):(0,j.l$)(a),c=this.session.sessionManager.appendCustomEntry(j.cP,b);return this.options.onSessionListInvalidate?.(),{entryId:c,activity:b}}async send(a){if(!this.runtime)throw Error("SDK session is not alive");let b=a.type;"get_state"!==b&&this.releaseStartupHold(),this.activeCommandCount+=1,this.resetIdleTimer();let c=this.session;try{switch(b){case"prompt":{let b=(0,p.JT)(a),d=this.promptReceipts.get(b.submissionId);if(d)return d;let e=b.submissionId,f=this.promptInFlight.get(e);if(f)return f;if(this.bashRunning)throw Error("Cannot send a prompt while a shell command is running");if(c.isCompacting){if(b.images?.length)throw Error("Image attachments cannot be queued while compaction is in progress");let a={submissionId:b.submissionId,sessionId:this.realSessionId,status:"accepted"};return this.followUpQueue=[...this.followUpQueue,b.message],this.promptReceipts.set(b.submissionId,a),this.persistFollowUpQueue(),this.options.onSessionListInvalidate?.(),a}if(!(0,h.kP)(this.realSessionId))throw Error(h.GT);this.promptRunning=!0,this.lastStopReason=null,(0,i.NK)(this.realSessionId,Date.now()),this.notifyRunning();let g=(async()=>{try{await new Promise((d,e)=>{let f=!1,g=()=>{c.isStreaming||c.isCompacting||this.bashRunning||this.promptRunning&&(this.promptRunning=!1,"aborted"!==this.lastStopReason&&"error"!==this.lastStopReason&&(this.lastStopReason="completed"),(0,i.PI)(this.realSessionId),this.notifyRunning(),this.emit({type:"prompt_done"}),this.resetIdleTimer())};c.prompt(b.message,{images:b.images??a.images,streamingBehavior:a.streamingBehavior,source:"rpc",preflightResult:a=>{a&&(f=!0,this.syncIdentityFromSession(),this.setFollowUpHeld(!1),this.options.onSessionListInvalidate?.(),d())}}).then(()=>{if(!f){f=!0;try{(0,l.kb)(c.sessionManager)}catch(a){console.error("[pidance] materialize after prompt failed:",a)}this.syncIdentityFromSession(),this.options.onSessionListInvalidate?.(),d()}g()}).catch(a=>{"aborted"!==this.lastStopReason&&(this.lastStopReason="error"),this.setFollowUpHeld(!0),g(),f||(f=!0,e(a))})});let d={submissionId:b.submissionId,sessionId:this.realSessionId,status:"accepted"};return this.promptReceipts.set(e,d),d}catch(d){this.promptRunning=!1,this.lastStopReason="aborted"===this.lastStopReason?"aborted":"error",this.setFollowUpHeld(!0),(0,i.PI)(this.realSessionId),this.notifyRunning();let a=d instanceof Error?d.message:String(d);this.emit({type:"prompt_error",errorMessage:a}),this.emit({type:"prompt_done"});let c={submissionId:b.submissionId,sessionId:this.realSessionId,status:"rejected"};throw this.promptReceipts.set(e,c),d}finally{this.promptInFlight.delete(e)}})();return this.promptInFlight.set(e,g),g}case"abort":return this.lastStopReason="aborted",this.setFollowUpHeld(!0),this.promptRunning=!1,this.notifyRunning(),await c.abort(),this.notifyRunning(),null;case"get_state":return this.projectState();case"set_model":{let b=String(a.provider??""),d=String(a.modelId??""),e=(0,n.E)(c.modelRuntime,b,d);if(!e)try{e=(await c.modelRuntime.getAvailable()).find(a=>a.provider===b&&a.id===d)}catch{e=void 0}if(!e)throw Error(`Model not found: ${b}/${d}`);return await c.setModel((0,o.eU)(e)),this.options.onSessionListInvalidate?.(),e}case"set_thinking_level":return c.model&&(0,o.yu)(c.model),c.setThinkingLevel(a.level),this.options.onSessionListInvalidate?.(),null;case"compact":{let b=await c.compact("string"==typeof a.customInstructions?a.customInstructions:void 0);return this.options.onSessionListInvalidate?.(),this.notifyRunning(),this.resetIdleTimer(),b}case"steer":return await c.steer(String(a.message??""),a.images),null;case"set_follow_up_queue":{let b=Array.isArray(a.items)?a.items.filter(a=>"string"==typeof a&&a.trim().length>0):[];return this.followUpQueue=b,this.persistFollowUpQueue(),this.isSettled()&&this.scheduleFollowUpFlush(),this.resetIdleTimer(),{ok:!0,queued:this.followUpQueue.length}}case"follow_up":return await c.followUp(String(a.message??""),a.images),null;case"set_session_name":{let b=String(a.name??"").trim();if(!b)throw Error("Session name cannot be empty");return c.setSessionName(b),this.options.onSessionListInvalidate?.(),null}case"set_auto_compaction":return c.setAutoCompactionEnabled(!!a.enabled),null;case"set_auto_retry":return c.setAutoRetryEnabled(!!a.enabled),null;case"clear_queue":return c.clearQueue();case"get_tools":{let a=c.getAllTools(),b=new Set(c.getActiveToolNames());return{source:"sdk",tools:a.map(a=>({name:a.name,description:a.description??"",active:b.has(a.name)}))}}case"set_tools":{let b=Array.isArray(a.tools)?a.tools.filter(a=>"string"==typeof a):[];return c.setActiveToolsByName(b),this.activeToolNames=b,null}case"get_commands":{let a=[];for(let b of c.extensionRunner.getRegisteredCommands())a.push({name:b.invocationName,description:b.description,source:"extension",sourceInfo:b.sourceInfo});for(let b of c.promptTemplates)a.push({name:b.name,description:b.description,source:"prompt_template"});return{commands:a}}case"get_session_stats":return c.getSessionStats();case"bash":if(c.isStreaming)throw Error("Cannot run bash while agent is streaming");this.bashRunning=!0,this.bashCommand={command:String(a.command??""),excludeFromContext:!!a.excludeFromContext,startedAt:Date.now()},this.notifyRunning();try{return await c.executeBash(String(a.command??""),void 0,{excludeFromContext:!!a.excludeFromContext})}finally{this.bashRunning=!1,this.bashCommand=null,this.notifyRunning(),this.resetIdleTimer()}case"abort_bash":return c.abortBash(),this.bashRunning=!1,this.bashCommand=null,this.notifyRunning(),null;case"abort_compaction":return c.abortCompaction(),null;case"extension_ui_response":{let b=s(a.id);if(!b)throw Error("extension_ui_response requires id");let c={...a};return delete c.type,delete c.id,!this.extensionUi?.respond(b,c),this.notifyRunning(),null}case"extension_ui_input":{let b=s(a.id),c="string"==typeof a.data?a.data:"";return b&&this.extensionUi?.inputCustom(b,c),null}case"append_activity":return this.appendActivity(a);case"fork":{if(this.bashRunning)throw Error("Cannot fork while a shell command is running");let b=String(a.entryId??"");if(!b)throw Error("entryId is required");let c=await this.runtime.fork(b);return c.cancelled||(await this.rebindSession(),this.syncIdentityFromSession(),this.options.onSessionListInvalidate?.()),{cancelled:c.cancelled,newSessionId:c.cancelled?void 0:this.realSessionId,text:c.selectedText}}case"navigate_tree":{if(this.bashRunning)throw Error("Cannot navigate while a shell command is running");let b=s(a.targetId);if(!b)throw Error("targetId is required");let d=await c.navigateTree(b,{summarize:a.summarize,customInstructions:s(a.customInstructions)});if(!d.cancelled&&this.realSessionFile){c.sessionManager.getLeafId();let a=c.sessionManager.getLeafId(),b=c.sessionManager.getEntries(),d=b.at(-1)?.id;a&&d&&a!==d?(0,k.R3)(this.realSessionFile,a):this.realSessionFile&&(0,k.$9)(this.realSessionFile)}return this.options.onSessionListInvalidate?.(),{cancelled:d.cancelled}}case"select_leaf_exact":{let b=s(a.entryId);if(!b)throw Error("entryId is required");if(this.options.navigationActions)return this.options.navigationActions.selectLeafExact(this.sessionId,b);let d=await c.navigateTree(b,{summarize:!1});if(!d.cancelled&&this.realSessionFile){let a=c.sessionManager.getLeafId(),b=c.sessionManager.getEntries().at(-1)?.id;a&&b&&a!==b?(0,k.R3)(this.realSessionFile,a):(0,k.$9)(this.realSessionFile)}return{cancelled:d.cancelled}}case"branch_from_assistant":{let b=s(a.assistantEntryId);if(!b)throw Error("assistantEntryId is required");if(this.options.navigationActions)return this.options.navigationActions.branchFromAssistant(this.sessionId,b);throw Error("branch_from_assistant is unavailable")}case"create_session_from_leaf":{let b=s(a.entryId);if(!b)throw Error("entryId is required");if(this.options.navigationActions)return this.options.navigationActions.createSessionFromLeaf(this.sessionId,b);throw Error("create_session_from_leaf is unavailable")}case"set_branch_label":{let b=s(a.targetId);if(!b)throw Error("targetId is required");let d=void 0===a.label||null===a.label?void 0:String(a.label);return c.sessionManager.appendLabelChange(b,d),this.options.onSessionListInvalidate?.(),null}case"reload":return await c.reload(),await this.rebindSession(),null;case"get_last_assistant_text":return{text:c.getLastAssistantText()};case"ensure_session":return null;default:throw Error(`Unsupported command: ${b}`)}}finally{this.activeCommandCount=Math.max(0,this.activeCommandCount-1),0===this.activeCommandCount&&this.resetIdleTimer()}}destroy(){this.destroyAsync()}async destroyAsync(){if(this.destroyPromise)return this.destroyPromise;if(this._alive||this.runtime){if(this.activeCommandCount>0){if(this._scheduledRecheck)return;this._scheduledRecheck=!0,setTimeout(()=>{this._scheduledRecheck=!1,!this.destroyPromise&&this._alive&&this.destroyAsync()},0)}return this._alive=!1,this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=null,this.startupHoldTimer&&clearTimeout(this.startupHoldTimer),this.startupHoldTimer=null,this.startupHold=!1,this.destroyPromise=(async()=>{this.unsubscribe?.(),this.unsubscribe=null,this.extensionUi?.dispose(),this.extensionUi=null;let a=this.runtime;if(this.runtime=null,a)try{await a.dispose()}catch(a){console.error("[pidance] sdk runtime dispose error:",a)}this.promptRunning=!1,this.bashRunning=!1,this.bashCommand=null,this.flushingFollowUp=!1,this.followUpFlushBatch=[],this.followUpFlushCursor=0,this.followUpFlushConfirmed=!1,this.followUpFlushAsOne=!1,this.followUpFlushOriginal=[],(0,i.PI)(this.realSessionId),this.onDestroyCallback?.(),this.notifyRunning()})(),this.destroyPromise}}}async function t(a){let b=new u(a);return await b.start(),b}d()}catch(a){d(a)}})},5815:(a,b,c)=>{c.d(b,{MG:()=>h,NK:()=>f,PI:()=>g});let d="__piRunningStartedAt";function e(){let a=globalThis;return d in a&&a[d]instanceof Map||(a[d]=new Map),a[d]}function f(a,b){e().set(a,b)}function g(a){e().delete(a)}function h(){return e()}},26773:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{$k:()=>u,A4:()=>m,DU:()=>o,EM:()=>r,Fn:()=>t,HG:()=>q,OF:()=>w});var e=c(40402),f=c(95237);c(68524);var g=c(2416),h=c(5815),i=c(89953),j=a([e,f,g]);function k(){if(!globalThis.__piSessions){globalThis.__piSessions=new Map;let a=()=>{globalThis.__piSessions?.forEach(a=>a.destroy())};process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__piSessions}function l(){return globalThis.__piStartLocks||(globalThis.__piStartLocks=new Map),globalThis.__piStartLocks}function m(a){return k().get(a)}function n(){return[...l().keys()]}async function o(a){let b=l().get(a);if(!b)return null;try{return(await b).realSessionId}catch{return null}}function p(){let a=new Set(n());for(let[b,c]of k())c.isRunning()&&a.add(c.sessionId||b);return[...a]}function q(){let a=new Set(p());for(let b of(0,i.mr)())a.add(b);return[...a]}[e,f,g]=j.then?(await j)():j;let y=new Map;function r(a,b=Date.now()){let c={},d=(0,h.MG)(),e=p(),f=new Set(e);for(let a of e){let e=d.get(a)??y.get(a)??b;y.set(a,e),c[a]=e}for(let a of[...y.keys()])f.has(a)||y.delete(a);for(let{sessionId:d,startedAt:e}of(0,i.D3)(a,b))c[d]=e;return c}function s(){return globalThis.__piRunningListeners||(globalThis.__piRunningListeners=new Set),globalThis.__piRunningListeners}function t(a){let b=s();return b.add(a),()=>{b.delete(a)}}function u(){let a=[];for(let[b,c]of k()){let d=c.listPendingExtensionRequests();0!==d.length&&a.push({sessionId:c.sessionId||b,requests:d})}return a}let z="",A=new Set,B=null;function v(){!function a(){let b=new Set(function(){let a=new Set(n());for(let[b,c]of k())c.isAlive()&&a.add(c.sessionId||b);return[...a]}());for(let a of b)(0,i.AZ)(a),A.add(a);for(let a of[...A])b.has(a)||((0,i.Hl)(a),A.delete(a));if(0===b.size){B&&(clearInterval(B),B=null);return}B||(B=setInterval(()=>{a()},8e3),B.unref?.())}();let a=q(),b=u(),c=JSON.stringify({ids:[...a].sort(),pending:b.map(a=>({sessionId:a.sessionId,ids:a.requests.map(a=>a.id??null)}))});if(c!==z)for(let b of(z=c,s()))try{b(a)}catch{}}async function w(a,b,c,d,e){return x(a,b,c,d,e)}async function x(a,b,c,d,f){let h=k(),j=l(),m=h.get(a);if(m?.isAlive())return{session:m,realSessionId:a};let n=j.get(a);if(n)return n;if(!(0,i.kP)(a))throw Error(i.GT);v();let o=(async()=>{try{let j=await (0,g.j1)({sessionId:a,sessionFile:b,cwd:c,toolNames:d,navigationActions:f,onRunningChange:()=>v(),onSessionListInvalidate:()=>(0,e.mD)(),cacheSessionPath:(a,b)=>(0,e.O8)(a,b),onSessionRekeyed:(a,b,c)=>{let d;d=k(),a!==b&&d.delete(a),d.set(b,c),a!==b&&((0,i.kP)(b),(0,i.Hl)(a))}}),l=j.sessionId,m=j.sessionFile;return m&&(0,e.O8)(l,m),l!==a&&(0,i.kP)(l),j.onDestroy(()=>{h.get(l)===j&&h.delete(l),a!==l&&h.get(a)===j&&h.delete(a),(0,i.Hl)(l),a!==l&&(0,i.Hl)(a),v()}),h.set(l,j),j.beginExtensionBinding(),{session:j,realSessionId:l}}catch(b){throw(0,i.Hl)(a),v(),b}})().finally(()=>{j.delete(a),v()});return j.set(a,o),o}d()}catch(a){d(a)}})},31524:(a,b,c)=>{c.d(b,{Ut:()=>e,eU:()=>f,yu:()=>g});let d=["off","minimal","low","medium","high","xhigh","max"];function e(a,b){return a?d.filter(a=>b?.[a]!==null):["off"]}function f(a){if(!a.reasoning)return a;let b=a.thinkingLevelMap,c={...b??{}},d=!1;for(let a of["xhigh","max"])Object.prototype.hasOwnProperty.call(c,a)&&void 0!==c[a]||(c[a]=a,d=!0);return!d&&b?a:{...a,thinkingLevelMap:c}}function g(a){let b=f(a);if(b===a)return a;try{return a.thinkingLevelMap=b.thinkingLevelMap,a}catch{return b}}},37594:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{C9:()=>G,DQ:()=>F,Md:()=>E,Yz:()=>D,mB:()=>I});var e=c(29021),f=c(33873),g=c(80547),h=c(60396),i=c(95237),j=c(52960),k=c(79495),l=c(81879),m=c(46935),n=c(31514),o=c(65107),p=c(56429),q=c(40402),r=c(85664),s=c(15461),t=c(76817),u=c(86226),v=c(68524),w=c(89953),x=c(50955),y=c(40239),z=c(5815),A=c(26773),B=c(68816),C=a([g,i,l,p,q,A]);[g,i,l,p,q,A]=C.then?(await C)():C;let F="Subagent sessions are read-only";class G extends Error{constructor(){super(F)}toString(){return this.message}}async function D(a,b){if(await b(a))throw new G}function E(a){let b=a instanceof Error?a.message:String(a);return a instanceof G||b===F?403:b.includes("Session not found")?404:(0,w.wE)(a)||b===w.GT||"Session is being deleted"===b||b.includes("closed while its title")?409:500}let H={listAllSessions:q.dQ,resolveSessionPath:q.os,getRpcSession:p.A4,waitForSessionStart:p.DU,startRpcSession:p.OF,getRunningRpcSessionIds:p.HG,listPendingExtensionUi:p.$k,subscribeRunningSessions:p.Fn,allowFileRoot:g.wz,invalidateSessionListCache:q.mD,openSessionCwd:a=>(0,i.kW)(a).getHeader()?.cwd??process.cwd(),openSessionManager:a=>(0,q.Zx)({filePath:a}),openSessionView:i.kW,reparentSessionFile:i.i5,existsSync:e.existsSync,now:()=>Date.now(),archiveFs:y.Iq},I=function(a={}){let b={...H,...a},c=(0,y.Ki)({fs:b.archiveFs,agentDir:b.archiveAgentDir,resolveSessionPath:b.resolveSessionPath,readSessionHeader:q.eP,isReadOnly:async a=>{let c=(await b.listAllSessions()).find(b=>b.id===a);return c?.readOnly===!0},isRunning:a=>b.getRunningRpcSessionIds().includes(a),getSessionInfo:async a=>(await b.listAllSessions()).find(b=>b.id===a)??null,invalidateSessionListCache:b.invalidateSessionListCache,now:()=>new Date(b.now()).toISOString()}),d=()=>(0,y.$T)(b.archiveFs??y.Iq,b.archiveAgentDir?.()??(0,h.$M)()),g=new Map,p=async a=>{let c=b.getRpcSession(a);if(c){if("function"==typeof c.destroyAsync)return void await c.destroyAsync();c.isAlive()&&c.destroy()}},C=async(a,b)=>{if(!(0,w.kP)(a))throw Error(w.GT);try{return await b()}finally{(0,w.Hl)(a)}},E=async(a,b)=>(await p(a),C(a,b)),F={async listSessions(){let a=await b.listAllSessions(),{active:c,archived:e}=(0,y.uD)(a,d());return{sessions:c,archivedSessions:e,archivedCount:e.length,runningSessionIds:b.getRunningRpcSessionIds()}},async listArchivedSessions(){let a=await b.listAllSessions();return(0,y.uD)(a,d()).archived},async listActiveSessions(){let a=await b.listAllSessions();return(0,y.uD)(a,d()).active},listAllSessions:async()=>b.listAllSessions(),async isArchived(a){let c=await b.listAllSessions();return(0,y.YV)(c,d()).has(a)},archiveSession:async a=>c.archiveSession(a),restoreSession:async a=>c.restoreSession(a),archiveSessions:async a=>c.archiveSessions(a),restoreSessions:async a=>c.restoreSessions(a),removeArchiveRecordAfterPermanentDelete(a){(0,y.rQ)(b.archiveFs??y.Iq,b.archiveAgentDir?.()??(0,h.$M)(),a)},resolvePath:a=>b.resolveSessionPath(a),getSessionInfo:async a=>a&&"string"==typeof a?(await b.listAllSessions()).find(b=>b.id===a)??null:null,async isReadOnly(a){let c=(await b.listAllSessions()).find(b=>b.id===a);return c?.readOnly===!0},async getReadView(a){let c=await b.resolveSessionPath(a);if(!c)return null;let d=b.getRpcSession(a),e=d?.inner;return d?.isAlive()&&e?.sessionManager?{source:"live",filePath:c,manager:e.sessionManager}:{source:"disk",filePath:c,manager:b.openSessionManager(c)}},getLive(a){let c=b.getRpcSession(a);return c?.isAlive()?c:void 0},getLiveSession:a=>F.getLive(a),isLive:a=>!!F.getLive(a),async ensureLive(a){if(await D(a,F.isReadOnly),g.has(a))throw Error("Session is being deleted");let c=F.getLive(a);if(c)return c;if((0,w.wy)(a))throw Error(w.GT);let d=await b.resolveSessionPath(a);if(!d)throw Error("Session not found");let e=b.openSessionCwd(d),{session:f}=await b.startRpcSession(a,d,e,void 0,G);return f},destroy(a){b.getRpcSession(a)?.destroy()},async destroyAsync(a){let c=b.getRpcSession(a);c&&("function"==typeof c.destroyAsync?await c.destroyAsync():c.destroy())},deleteSession(a){let c=g.get(a);if(c)return c;let d=(async()=>{await D(a,F.isReadOnly);let c=await b.waitForSessionStart?.(a)??a,d=await b.resolveSessionPath(a);if(!d){try{(0,v.xP)(`sessionQueue.${a}`,null),(0,v.xP)(`sessionQueueHold.${a}`,null)}catch(a){console.error("[pidance] failed to clear queue prefs after missing delete:",a)}return(0,q.BR)(a),b.invalidateSessionListCache(),F.removeArchiveRecordAfterPermanentDelete(a),{skippedSubagents:0}}if((0,w.wy)(a)||(0,w.wy)(c))throw Error(w.GT);let g=(0,q.eP)(d)?.parentSession,h=(0,q.eP)(d)?.id===a?(0,x.ku)(d,a):[],i=b.getRpcSession(c)??b.getRpcSession(a),j=b.getRunningRpcSessionIds();if(i?.isAlive?.()&&(j.includes(a)||j.includes(c)))try{await i.send({type:"abort"})}catch(a){console.error("[pidance] abort before delete failed:",a)}return await F.destroyAsync(i?.sessionId??c),C(i?.sessionId??c,async()=>{let c=d.replace(/\\/g,"/").split("/").slice(0,-1).join("/");try{for(let a of(0,e.readdirSync)(c).filter(a=>a.endsWith(".jsonl")&&(0,f.join)(c,a)!==d)){let e=(0,f.join)(c,a);try{let a=(0,q.eP)(e);a?.type==="session"&&a.parentSession===d&&(a.id?(await b.waitForSessionStart?.(a.id),await E(a.id,()=>{b.reparentSessionFile(e,g)})):b.reparentSessionFile(e,g))}catch{}}}catch{}try{(0,e.unlinkSync)(d)}catch(a){if("ENOENT"!==a.code)throw a}(0,o.$9)(d);let i=(0,f.resolve)(d.slice(0,-6)),j=(0,x.uq)(h,i,q.BR);try{(0,v.xP)(`sessionQueue.${a}`,null),(0,v.xP)(`sessionQueueHold.${a}`,null)}catch(a){console.error("[pidance] failed to clear queue prefs after delete:",a)}return(0,q.BR)(a),b.invalidateSessionListCache(),F.removeArchiveRecordAfterPermanentDelete(a),{skippedSubagents:j}})})();return g.set(a,d),d.finally(()=>{g.get(a)===d&&g.delete(a)})},async start(a,c,d,e){if(await D(a,F.isReadOnly),g.has(a))throw Error("Session is being deleted");return b.startRpcSession(a,c,d,e,G)},send:async(a,b)=>(await F.ensureLive(a)).send(b),async submitPrompt(a,b){await D(a,F.isReadOnly);let c=(0,j.JT)(b);try{let b=await F.send(a,c);if(b&&"object"==typeof b&&b.status)return b;return{submissionId:c.submissionId,sessionId:a,status:"accepted"}}catch(b){if((0,w.wE)(b))throw b;return{submissionId:c.submissionId,sessionId:a,status:"rejected"}}},async getAgentState(a){if(await F.isReadOnly(a))return{live:!1,activeRun:!1,readOnly:!0};let b=F.getLive(a);if(!b)return{live:!1,activeRun:!1,...(0,w.wy)(a)?{lockedByOther:!0}:{}};let c=await b.send({type:"get_state"}),d="function"==typeof b.isRunning?!!b.isRunning():!!(c&&(c.isStreaming||c.isPromptRunning||c.isCompacting||c.isBashRunning));return{live:!0,activeRun:d,lockedByOther:!1,state:c}},async renameSession(a,c){await D(a,F.isReadOnly);let d=c.trim();if(!d)throw Error("name is required");let e=F.getLive(a);if(e?.isAlive()){await e.send({type:"set_session_name",name:d}),b.invalidateSessionListCache();return}let f=await b.resolveSessionPath(a);if(!f)throw Error("Session not found");await E(a,()=>{b.openSessionView(f).appendSessionInfo(d),b.invalidateSessionListCache()})},async autoNameSession(a){await D(a,F.isReadOnly);let b=await F.ensureLive(a);await b.waitUntilReady?.();let c=await F.getNavigationSnapshot(a);if(!c)throw Error("Session not found");let d=c.context.messages??[],e=(0,k.CL)(),f=await (0,k.K)({messages:d,provider:e.provider,modelId:e.modelId,baseUrl:e.baseUrl,api:e.api,apiKey:e.apiKey,headers:e.headers});if(!b.isAlive())throw Error("The session was closed while its title was being generated. Please try again.");try{await b.send({type:"set_session_name",name:f.title})}catch{await F.destroyAsync(a),await F.renameSession(a,f.title)}return{title:f.title,usage:f.usage??null}},async exportSession(a,c){let d=await b.resolveSessionPath(a);if(!d)throw Error("Session not found");return(0,l.by)(d,c)},async getNavigationSnapshot(a,c={}){let d=await F.getReadView(a);if(!d)return null;let{filePath:e,manager:f}=d,{leafId:g,tree:h,context:i,header:j,sessionName:k}=(0,q.jK)(f,c),l=j?.parentSession?await (0,q.u1)(j.parentSession):void 0,m=(await b.listAllSessions()).find(b=>b.id===a),n=j?{path:e,id:j.id,cwd:j.cwd??"",name:k,created:j.timestamp,modified:j.timestamp,messageCount:i.totalMessageCount??i.messages.length,firstMessage:m?.firstMessage??"(no messages)",parentSessionId:l,...m?.subagent?{subagent:m.subagent,readOnly:!0}:{}}:null;return{filePath:e,leafId:g,tree:h,context:i,header:j,sessionName:k,parentSessionId:l,info:n}},async getContextPage(a,b){let c=await F.getReadView(a);if(!c)return{context:null};let d=c.manager,e=d.getEntries?.()??[],f=(0,q.Uv)(e,b.leafId,{deferThinking:b.deferThinking,deferToolResultImages:b.deferToolResultImages}),g=b.limit;return{context:b.before?(0,m.tr)(f,b.before,g??m._w):null!==g?(0,m.G1)(f,g):{...f,hasMoreBefore:!1,totalMessageCount:f.messages.length}}},async getEntryThinking(a,b,c){let d=await F.getReadView(a);if(!d)return null;let e=d.manager.getEntries().find(a=>a.id===b);if(!e||"message"!==e.type||e.message?.role!=="assistant")return null;let f=e.message.content?.[c];return f&&(0,n.mv)(f.type)?{thinking:(0,n.Ux)(f)}:null},async getToolResultDetails(a,b){let c=await F.getReadView(a);if(!c)return null;let d=c.manager.getEntries().find(a=>"message"===a.type&&a.message?.role==="toolResult"&&a.message.toolCallId===b);return d?{details:d.message?.details??null}:null},async appendActivity(a,c){await D(a,F.isReadOnly);let d=F.getLive(a),e=!!d?.inner?.sessionManager,f=d?.appendActivity;return d?.isAlive()&&e&&"function"==typeof f?await f.call(d,c):await E(a,async()=>{let d=await b.resolveSessionPath(a);if(!d)throw Error("Session not found");let e=(0,r.l$)(c),f=b.openSessionView(d).appendCustomEntry(r.cP,e);return b.invalidateSessionListCache(),{entryId:f,activity:e}})},appendCommandEntry:async(a,c)=>(await D(a,F.isReadOnly),await E(a,async()=>{let d=await b.resolveSessionPath(a);if(!d)throw Error("Session not found");let e=(0,s.fc)(c);if(!e.command)throw Error("command is required");let f=b.openSessionView(d).appendCustomEntry(s.OE,e);return b.invalidateSessionListCache(),{entryId:f,data:e}})),async createNew({cwd:a,command:c}){if(!a||"string"!=typeof a)throw Error("cwd is required");if(!b.existsSync(a))throw Error(`Directory does not exist: ${a}`);let{provider:d,modelId:e,toolNames:f,thinkingLevel:g,...h}=c,i=`__new__${b.now()}`,{session:j,realSessionId:k}=await b.startRpcSession(i,"",a,f,G);if(b.allowFileRoot(a),b.invalidateSessionListCache(),d&&e&&await j.send({type:"set_model",provider:d,modelId:e}),g&&await j.send({type:"set_thinking_level",level:g}),"ensure_session"===h.type)return{sessionId:k,data:null};let l=await j.send(h);return{sessionId:k,data:l}},getRunningIds:()=>b.getRunningRpcSessionIds(),getRunningStartedAt(){let a=Object.fromEntries((0,z.MG)());for(let[b,c]of Object.entries((0,A.EM)()))b in a||(a[b]=c);return a},async searchFulltext(a,c={}){let d=await (0,B.s)(a,{limits:void 0!==c.maxHits?{maxHits:c.maxHits}:void 0}),e=c.scope??"active";if("all"===e)return d;let f=await b.listAllSessions(),g=(0,y.$T)(b.archiveFs??y.Iq,b.archiveAgentDir?.()??(0,h.$M)()),i=(0,y.mT)(d.sessionIds,f,g,e);return{...d,sessionIds:d.sessionIds.filter(a=>i.has(a)),hits:d.hits.filter(a=>i.has(a.sessionId))}},listPendingExtensionUi:()=>b.listPendingExtensionUi(),subscribeRunning:a=>b.subscribeRunningSessions(a),async selectLeafExact(a,c){if("string"!=typeof c||""===c.trim())throw Error("entryId is required");let d=c.trim(),e=b.getRpcSession(a);if(e?.isAlive?.()&&e.inner?.isBashRunning)throw Error("Cannot switch branch while a shell command is running");return E(a,async()=>{let c=await b.resolveSessionPath(a);if(!c)throw Error("Session not found");let e=b.openSessionView(c),f=e.getLeafId();if(d===f)return{cancelled:!1};if(d===e.getLastEntryId())return(0,o.$9)(c),{cancelled:!1};if(!e.getEntry(d))throw Error(`Entry ${d} not found`);try{return e.branch(d),(0,o.R3)(c,d),{cancelled:!1}}finally{b.invalidateSessionListCache()}})},async branchFromAssistant(a,c){if("string"!=typeof c||""===c.trim())throw Error("assistantEntryId is required");let d=c.trim(),e=b.getRpcSession(a);if(e?.isAlive?.()&&e.inner?.isBashRunning)throw Error("Cannot branch while a shell command is running");return E(a,async()=>{let c=await b.resolveSessionPath(a);if(!c)throw Error("Session not found");let e=b.openSessionView(c),f=e.getLeafId();if(!f)throw Error("Session has no leaf");let g=e.getBranch(f),h=e.getEntry(d);if(!h)throw Error("Entry not found");if("message"!==h.type||h.message?.role!=="assistant")throw Error("Only assistant messages can be branched from");let i=(0,t.wo)(g,d);try{return e.branch(i),i===e.getLastEntryId()?(0,o.$9)(c):(0,o.R3)(c,i),{cancelled:!1}}finally{b.invalidateSessionListCache()}})},async createSessionFromLeaf(a,c){if("string"!=typeof c||""===c.trim())throw Error("entryId is required");let d=c.trim(),e=b.getRpcSession(a),f=e?.inner;return E(a,async()=>{let c=(f?.sessionFile||e?.sessionFile)??await b.resolveSessionPath(a);if(!c)throw Error("Session not found");let g=(0,i.kW)(c),h=g.getEntry(d);if(!h)throw Error("Invalid entry ID");let j=d;if("message"===h.type&&h.message?.role==="assistant"){let a=g.getLeafId();if(!a)throw Error("Session has no leaf");let b=g.getBranch(a);j=(0,t.wo)(b,d)}let k=g.getSessionDir(),l=(0,i.G1)(c,k),m=l.createBranchedSession(j);if(!m)throw Error("Failed to create session");(0,i.kb)(l);let n=(0,i.kW)(m,k),o=n.getSessionId();(0,q.O8)(o,m),b.invalidateSessionListCache();let p=f?.model;return p&&(0,u.yN)(n.getEntries().some(a=>"model_change"===a.type),{provider:p.provider,modelId:p.id})&&n.appendModelChange(p.provider,p.id),{cancelled:!1,newSessionId:o}})}},G={selectLeafExact:(a,b)=>F.selectLeafExact(a,b),branchFromAssistant:(a,b)=>F.branchFromAssistant(a,b),createSessionFromLeaf:(a,b)=>F.createSessionFromLeaf(a,b)};return F}();d()}catch(a){d(a)}})},38195:(a,b,c)=>{c.d(b,{t:()=>g});var d=c(716),e=c(87538);function f(a,b,c,e,f,g,h){let i=(0,d.randomUUID)();return new Promise((d,j)=>{let k,l=!1,m=()=>{a.delete(i),b.delete(i),k&&clearTimeout(k),e?.signal?.removeEventListener("abort",o)},n=a=>{l||(l=!0,m(),d(a))},o=()=>n(f);e?.signal?.addEventListener("abort",o,{once:!0}),e?.timeout&&(k=setTimeout(()=>n(f),e.timeout)),a.set(i,{resolve:a=>{try{n(h(a))}catch(a){if(l)return;l=!0,m(),j(a instanceof Error?a:Error(String(a)))}},reject:a=>{l||(l=!0,m(),j(a))}});let p={type:"extension_ui_request",id:i,...g};b.set(i,p),c(p)})}function g(a){let b=new Map,c=new Map,g=new Map,h=new Map,i=new Map,j={select:(d,e,g)=>f(b,c,a,g,void 0,{method:"select",title:d,options:e,timeout:g?.timeout},a=>"cancelled"in a&&a.cancelled?void 0:"value"in a?a.value:void 0),confirm:(d,e,g)=>f(b,c,a,g,!1,{method:"confirm",title:d,message:e,timeout:g?.timeout},a=>(!("cancelled"in a)||!a.cancelled)&&"confirmed"in a&&!!a.confirmed),input:(d,e,g)=>f(b,c,a,g,void 0,{method:"input",title:d,placeholder:e,timeout:g?.timeout},a=>"cancelled"in a&&a.cancelled?void 0:"value"in a?a.value:void 0),notify(b,c){a({type:"extension_ui_request",id:(0,d.randomUUID)(),method:"notify",message:b,notifyType:c})},onTerminalInput:()=>()=>{},setStatus(b,c){c?g.set(b,c):g.delete(b),a({type:"extension_ui_request",id:(0,d.randomUUID)(),method:"setStatus",statusKey:b,statusText:c})},setWorkingMessage(){},setWorkingVisible(){},setWorkingIndicator(){},setHiddenThinkingLabel(){},setWidget(b,c,f){if("function"==typeof c){let a=(0,e.tU)(c,(0,e.Lm)());if(null===a)return;c=a}(void 0===c||Array.isArray(c))&&(null==c?h.delete(b):h.set(b,{lines:c,placement:f?.placement}),a({type:"extension_ui_request",id:(0,d.randomUUID)(),method:"setWidget",widgetKey:b,widgetLines:c,widgetPlacement:f?.placement}))},setFooter(){},setHeader(){},setTitle(b){a({type:"extension_ui_request",id:(0,d.randomUUID)(),method:"setTitle",title:b})},async custom(b){let c=(0,d.randomUUID)();return new Promise(d=>{let f,g=!1,h=b=>{g||(g=!0,i.delete(c),a({type:"extension_ui_request",id:c,method:"custom",closed:!0,lines:[]}),d(b))},k=()=>{if(g)return;let b=[];try{let a=f?.render?.(92);Array.isArray(a)&&(b=a.filter(a=>"string"==typeof a))}catch(a){console.error("[pidance] custom UI render failed:",a)}a({type:"extension_ui_request",id:c,method:"custom",lines:b})};i.set(c,{handleInput:a=>{if("\x03"===a)return void h(void 0);try{f?.handleInput?.(a)}catch(a){console.error("[pidance] custom UI input failed:",a)}},done:h});let l=function(a,b=92,c=40){return Object.freeze({terminal:Object.freeze({columns:b,rows:c,kittyProtocolActive:!1}),requestRender:a})}(()=>{k()},92,40),m=(0,e.Lm)()??j.theme;Promise.resolve().then(()=>b(l,m,{},h)).then(a=>{g||(f=a,k())}).catch(a=>{console.error("[pidance] custom UI factory failed:",a),h(void 0)})})},pasteToEditor(a){this.setEditorText(a)},setEditorText(b){a({type:"extension_ui_request",id:(0,d.randomUUID)(),method:"set_editor_text",text:b})},getEditorText:()=>"",editor:async(d,e)=>f(b,c,a,void 0,void 0,{method:"editor",title:d,prefill:e},a=>"cancelled"in a&&a.cancelled?void 0:"value"in a?a.value:void 0),addAutocompleteProvider(){},setEditorComponent(){},getEditorComponent(){},get theme(){let a=a=>String(a??""),b=(a,b)=>void 0===b?"":String(b);return new Proxy({fg:b,bg:b,bold:a,dim:a,italic:a},{get:(b,c)=>c in b?b[c]:"then"!==c?a:void 0})},getAllThemes:()=>[],getTheme(){},setTheme:()=>({success:!1,error:"Theme switching not supported in Web mode"}),getToolsExpanded:()=>!1,setToolsExpanded(){}};return{uiContext:j,pending:b,statuses:g,widgets:h,pendingSnapshot:c,respond(a,c){let d=b.get(a);return!!d&&(d.resolve(c),!0)},inputCustom(a,b){let c=i.get(a);return!!c&&(c.handleInput(b),!0)},dispose(){for(let[a,d]of b)b.delete(a),c.delete(a),d.reject(Error("Extension UI disposed"));for(let a of i.values())a.done(void 0);i.clear(),g.clear(),h.clear()}}}},40239:(a,b,c)=>{c.d(b,{$T:()=>m,Iq:()=>g,J3:()=>t,Ki:()=>u,YV:()=>q,mT:()=>r,rQ:()=>p,uD:()=>s});var d=c(29021),e=c(33873),f=c(60396);let g={existsSync:d.existsSync,lstatSync:d.lstatSync,mkdirSync:d.mkdirSync,readFileSync:(a,b)=>(0,d.readFileSync)(a,b),writeFileSync:(a,b,c)=>(0,d.writeFileSync)(a,b,c),renameSync:d.renameSync,unlinkSync:d.unlinkSync,readdirSync:d.readdirSync};function h(a=(0,f.$M)()){return(0,e.join)(a,"pidance-archive")}function i(a){return"string"!=typeof a||a.length<8||a.length>64||!/^[0-9a-fA-F][0-9a-fA-F-]{7,63}$/.test(a)?null:`${a}.json`}function j(a,b){try{let c=h(b);if(!a.existsSync(c))return null;let d=a.lstatSync(c);if(d.isSymbolicLink()||!d.isDirectory())return null;return c}catch{return null}}function k(a){return"object"==typeof a&&null!==a&&!(1!==a.version||"string"!=typeof a.sessionId||0===a.sessionId.length||"string"!=typeof a.sessionPath||0===a.sessionPath.length||"string"!=typeof a.archivedAt||Number.isNaN(Date.parse(a.archivedAt)))}function l(a,b,c){let d=i(c);if(!d)return null;let f=j(a,b);if(!f)return null;let g=(0,e.join)(f,d);try{if(!a.existsSync(g)||a.lstatSync(g).isSymbolicLink())return null;let b=a.readFileSync(g,"utf8");if(b.length>65536)return null;let d=JSON.parse(b);if(!k(d)||d.sessionId!==c)return null;return d}catch{return null}}function m(a,b){let c=globalThis.__piArchiveRecordsCache;if(c&&Date.now()-c.ts<5e3)return c.records;let d=j(a,b),e=[];if(d){let c=[];try{c=a.readdirSync(d)}catch{c=[]}for(let d of c){let c=function(a){if("string"!=typeof a||!a.endsWith(".json"))return null;let b=a.slice(0,-5);return b.length<8||b.length>64||!/^[0-9a-fA-F][0-9a-fA-F-]{7,63}$/.test(b)?null:b}(d);if(!c)continue;let f=l(a,b,c);f&&e.push(f)}}return globalThis.__piArchiveRecordsCache={records:e,ts:Date.now()},e}function n(){globalThis.__piArchiveRecordsCache=void 0}function o(a,b,c){let d=i(c);if(!d)return!1;let f=j(a,b);if(!f)return!1;let g=(0,e.join)(f,d);try{if(!a.existsSync(g))return!1;return a.unlinkSync(g),n(),!a.existsSync(g)}catch{return!1}}function p(a,b,c){o(a,b,c)}function q(a,b){let c=new Map;for(let a of b)c.set(a.sessionId,a);let d=new Set;for(let b of a){let a=c.get(b.id);a&&a.sessionPath===b.path&&d.add(b.id)}return d}function r(a,b,c,d){let e=q(b,c),f=new Set;for(let b of a){let a=e.has(b);("active"===d?!a:a)&&f.add(b)}return f}function s(a,b){let c=q(a,b),d=new Map;for(let a of b)d.set(a.sessionId,a);let e=[],f=[];for(let b of a)if(c.has(b.id)){let a=d.get(b.id);f.push({...b,archivedAt:a?a.archivedAt:void 0})}else e.push(b);return{active:e,archived:f}}class t extends Error{constructor(){super("Session is running; cannot archive while active")}toString(){return this.message}}function u(a){let b=a.fs??g,c=()=>a.agentDir?.()??(0,f.$M)(),d=async d=>{if(await a.isReadOnly(d))throw Error("Subagent sessions are read-only");if(a.isRunning(d))throw new t;let f=await a.resolveSessionPath(d);if(!f)throw Error("Session not found");let g=a.readSessionHeader(f);if(!g||g.id!==d)throw Error("Session header id mismatch");let j={version:1,sessionId:d,sessionPath:f,archivedAt:a.now()};return!function(a,b,c){let d=i(c.sessionId);if(!d)throw Error("Invalid session id");if(!k(c))throw Error("Invalid archive record");let f=function(a,b){let c=h(b);try{a.existsSync(c)||a.mkdirSync(c,{recursive:!0});let b=a.lstatSync(c);if(b.isSymbolicLink()||!b.isDirectory())return null;return c}catch{return null}}(a,b);if(!f)throw Error("Archive directory unavailable");let g=(0,e.join)(f,d),j=(0,e.join)(f,`.${d}.${process.pid}.${Date.now().toString(36)}.tmp`);try{a.writeFileSync(j,JSON.stringify(c),{encoding:"utf8",flag:"wx"}),a.renameSync(j,g),n()}catch(b){try{a.existsSync(j)&&a.unlinkSync(j)}catch{}throw b}}(b,c(),j),a.invalidateSessionListCache(),j.archivedAt},j=async d=>{if(null===l(b,c(),d))throw Error("Session is not archived");if(!await a.resolveSessionPath(d))throw Error("Session not found");if(!o(b,c(),d))throw Error("Failed to remove archive record");return a.invalidateSessionListCache(),a.getSessionInfo(d)},m=async a=>{let b=[],c=[];for(let e of a)try{await d(e),b.push(e)}catch(a){c.push({id:e,error:a instanceof Error?a.message:String(a)})}return{succeededIds:b,failed:c}},p=async a=>{let b=[],c=[];for(let d of a)try{await j(d),b.push(d)}catch(a){c.push({id:d,error:a instanceof Error?a.message:String(a)})}return{succeededIds:b,failed:c}};return{archiveSession:d,restoreSession:j,archiveSessions:m,restoreSessions:p}}},46935:(a,b,c)=>{c.d(b,{G1:()=>h,NN:()=>g,Uf:()=>d,_w:()=>e,tr:()=>i});let d=80,e=80;function f(a,b){return"number"==typeof a&&Number.isFinite(a)?Math.max(1,Math.min(Math.floor(a),500)):b}function g(a,b=d){let c=a.get("limit")??a.get("tail");if(null===c||""===c)return null;let e=Number(c);return!Number.isFinite(e)||e<=0?b:f(e,b)}function h(a,b=d){let c=a.messages.length,e=f(b,d);if(c<=e)return{...a,hasMoreBefore:!1,totalMessageCount:c};let g=c-e;return{messages:a.messages.slice(g),entryIds:a.entryIds.slice(g),thinkingLevel:a.thinkingLevel,model:a.model,hasMoreBefore:!0,totalMessageCount:c}}function i(a,b,c=e){let d=a.messages.length,g=a.entryIds.indexOf(b);if(g<=0)return{messages:[],entryIds:[],thinkingLevel:a.thinkingLevel,model:a.model,hasMoreBefore:!1,totalMessageCount:d};let h=Math.max(0,g-f(c,e));return{messages:a.messages.slice(h,g),entryIds:a.entryIds.slice(h,g),thinkingLevel:a.thinkingLevel,model:a.model,hasMoreBefore:h>0,totalMessageCount:d}}},52960:(a,b,c)=>{function d(){return"u">typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`sub-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function e(a){if(void 0===a)return;if(!Array.isArray(a))throw Error("images must be an array");let b=[];for(let c of a){if(!c||"object"!=typeof c)throw Error("invalid image");let a="string"==typeof c.data?c.data:void 0,d="string"==typeof c.mimeType?c.mimeType:"string"==typeof c.mime_type?c.mime_type:void 0;if(!a||!d)throw Error("invalid image");b.push({type:"image",data:a,mimeType:d})}return b}function f(a){if("string"!=typeof a.message)throw Error("message is required");return a.message}function g(a,b=d){return{type:"prompt",message:f(a),submissionId:"string"==typeof a.submissionId&&a.submissionId.trim()?a.submissionId.trim():b(),images:e(a.images)}}function h(a){return"prompt"===a||"abort"===a||"steer"===a||"follow_up"===a}function i(a,b=d){if(!a||"object"!=typeof a||Array.isArray(a))throw Error("command is required");let c=a.type;if("prompt"===c)return g(a,b);if("abort"===c)return{type:"abort"};if("steer"===c)return{type:"steer",message:f(a),images:e(a.images)};if("follow_up"===c)return{type:"follow_up",message:f(a),images:e(a.images)};throw Error(`Unsupported message command: ${String(c)}`)}c.d(b,{D_:()=>h,JT:()=>g,QR:()=>i})},53023:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Uj:()=>j});var e=c(85664),f=c(93127),g=c(95237),h=a([f,g]);function i(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}[f,g]=h.then?(await h)():h;let k=`
|
|
1
|
+
"use strict";exports.id=7594,exports.ids=[7594],exports.modules={2416:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{j1:()=>t});var e=c(75430),f=c(60396),g=c(68524),h=c(89953),i=c(5815),j=c(85664),k=c(65107),l=c(95237),m=c(38195),n=c(62693),o=c(31524),p=c(52960),q=c(87538),r=a([e,l]);function s(a){return"string"==typeof a&&a?a:void 0}[e,l]=r.then?(await r)():r;class u{static{this.PARTIAL_RENDER_MIN_INTERVAL_MS=100}constructor(a){this.options=a,this.listeners=[],this.runtime=null,this.unsubscribe=null,this.extensionUi=null,this.idleTimer=null,this.startupHoldTimer=null,this.startupHold=!0,this.activeCommandCount=0,this._scheduledRecheck=!1,this.onDestroyCallback=null,this._alive=!0,this.promptRunning=!1,this.lastStopReason=null,this.followUpQueue=[],this.followUpQueueHydrated=!1,this.flushingFollowUp=!1,this.followUpFlushBatch=[],this.followUpFlushCursor=0,this.followUpFlushConfirmed=!1,this.followUpFlushAsOne=!1,this.followUpFlushOriginal=[],this.bashRunning=!1,this.bashCommand=null,this.localQueue={steering:[],followUp:[]},this.promptReceipts=new Map,this.promptInFlight=new Map,this.destroyPromise=null,this.hasQueueSnapshot=!1,this.renderBridgeTheme=(0,q.Lm)(),this.toolRenderStates=new Map,this.realSessionId=a.sessionId,this.realSessionFile=a.sessionFile,this.idleTimeoutMs=a.idleTimeoutMs??3e4,this.agentDir=a.agentDir??(0,f.$M)(),this.activeToolNames=a.toolNames}get sessionId(){return this.realSessionId}get sessionFile(){return this.realSessionFile}listPendingExtensionRequests(){return Array.from(this.extensionUi?.pendingSnapshot.values()??[])}get inner(){let a=this.runtime?.session;if(a)return{sessionManager:a.sessionManager}}isAlive(){return this._alive&&null!==this.runtime}isRunning(){if(!this._alive||!this.runtime)return!1;let a=this.runtime.session;return this.promptRunning||this.bashRunning||a.isStreaming||a.isCompacting}onDestroy(a){this.onDestroyCallback=a}onEvent(a){let b=0===this.listeners.length;return this.listeners.push(a),b&&this.resetIdleTimer(),()=>{let b=this.listeners.length>0;this.listeners=this.listeners.filter(b=>b!==a),b&&0===this.listeners.length&&this.resetIdleTimer()}}beginExtensionBinding(){}async waitForExtensionsBound(){}emit(a){for(let b of this.listeners)try{b(a)}catch(a){console.error("[pidance] sdk host listener error:",a)}}notifyRunning(){this.options.onRunningChange?.()}resetIdleTimer(){if(this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=null,!this._alive||!this.runtime||this.startupHold||this.isRunning()||this.flushingFollowUp||this.listeners.length>0)return;if(this.followUpQueue.length>0&&!this.isFollowUpHeld())return void this.scheduleFollowUpFlush();let a=this.idleTimeoutMs;this.idleTimer=setTimeout(()=>{if((this.idleTimer=null,!this.isRunning()&&!this.flushingFollowUp)&&!(this.listeners.length>0)){if(this.followUpQueue.length>0&&!this.isFollowUpHeld())return void this.scheduleFollowUpFlush();this.destroyAsync()}},a)}releaseStartupHold(){this.startupHold&&(this.startupHold=!1,this.startupHoldTimer&&clearTimeout(this.startupHoldTimer),this.startupHoldTimer=null)}isSettled(){return!!this.runtime&&!!this._alive&&!this.isRunning()}isFollowUpHeld(){let a=(0,g.rV)(this.agentDir);return!0===(0,g.ql)(a,`sessionQueueHold.${this.realSessionId}`)}setFollowUpHeld(a){try{(0,g.xP)(`sessionQueueHold.${this.realSessionId}`,!!a||null,this.agentDir)}catch(a){console.error("[pidance] failed to persist follow-up hold:",a)}}hydrateFollowUpQueue(){if(this.followUpQueueHydrated)return;this.followUpQueueHydrated=!0;let a=(0,g.rV)(this.agentDir),b=(0,g.ql)(a,`sessionQueue.${this.realSessionId}`);this.followUpQueue=Array.isArray(b)?b.filter(a=>"string"==typeof a&&a.trim().length>0):[]}persistFollowUpQueue(){try{(0,g.xP)(`sessionQueue.${this.realSessionId}`,this.followUpQueue,this.agentDir)}catch(a){console.error("[pidance] failed to persist follow-up queue:",a)}}scheduleFollowUpFlush(){!this._alive||!this.runtime||this.flushingFollowUp||0===this.followUpQueue.length||this.isFollowUpHeld()||this.isSettled()&&(this.flushingFollowUp=!0,this.followUpFlushAsOne=!0===(0,g.rV)(this.agentDir).queueFlushAsOne,this.followUpFlushOriginal=[...this.followUpQueue],this.followUpFlushBatch=this.followUpFlushAsOne?[this.followUpFlushOriginal.join("\n\n")]:[...this.followUpFlushOriginal],this.followUpFlushCursor=0,this.followUpFlushConfirmed=!1,this.sendNextFollowUp())}async sendNextFollowUp(){if(!this.flushingFollowUp)return;if(this.isFollowUpHeld())return void this.abortFollowUpFlush();let a=this.followUpFlushBatch[this.followUpFlushCursor];if(void 0===a)return void this.finishFollowUpFlush();if(!this.isSettled())return void setTimeout(()=>{this.flushingFollowUp&&this.followUpFlushCursor<this.followUpFlushBatch.length&&this.sendNextFollowUp()},80);this.followUpFlushConfirmed=!1;try{await this.send({type:"prompt",message:a})}catch(b){let a=b instanceof Error?b.message:String(b);this.emit({type:"follow_up_flush_error",errorMessage:a}),this.abortFollowUpFlush()}}confirmFollowUpFlush(){if(!this.flushingFollowUp||this.followUpFlushConfirmed)return;let a=this.followUpFlushBatch[this.followUpFlushCursor];if(void 0===a)return;if(this.followUpFlushConfirmed=!0,this.followUpFlushAsOne){let a=new Set(this.followUpFlushOriginal);this.followUpQueue=this.followUpQueue.filter(b=>!a.has(b))}else{let b=this.followUpQueue.indexOf(a);b>=0&&this.followUpQueue.splice(b,1)}let b=[...this.followUpQueue];(this.persistFollowUpQueue(),this.emit({type:"follow_up_flushed",sessionId:this.realSessionId,item:a,remaining:b}),this.followUpFlushAsOne)?this.finishFollowUpFlush():(this.followUpFlushCursor+=1,this.followUpFlushCursor>=this.followUpFlushBatch.length?this.finishFollowUpFlush():this.sendNextFollowUp())}abortFollowUpFlush(){this.flushingFollowUp&&(this.flushingFollowUp=!1,this.followUpFlushBatch=[],this.followUpFlushCursor=0,this.followUpFlushConfirmed=!1,this.followUpFlushAsOne=!1,this.followUpFlushOriginal=[],this.persistFollowUpQueue(),this.resetIdleTimer())}finishFollowUpFlush(){this.flushingFollowUp=!1,this.followUpFlushBatch=[],this.followUpFlushCursor=0,this.followUpFlushConfirmed=!1,this.followUpFlushAsOne=!1,this.followUpFlushOriginal=[],this.persistFollowUpQueue(),this.resetIdleTimer(),this.followUpQueue.length>0&&!this.isFollowUpHeld()&&this.scheduleFollowUpFlush()}get session(){if(!this.runtime)throw Error("SDK session is not alive");return this.runtime.session}get services(){if(!this.runtime)throw Error("SDK session is not alive");return this.runtime.services}syncIdentityFromSession(){let a=this.session,b=a.sessionId||this.realSessionId,c=a.sessionFile||this.realSessionFile,d=this.realSessionId;this.realSessionId=b,this.realSessionFile=c,c&&this.options.cacheSessionPath?.(b,c),d!==b&&this.options.onSessionRekeyed?.(d,b,this)}async rebindSession(){let a=this.session;this.extensionUi?.dispose(),this.extensionUi=(0,m.t)(a=>{this.trackExtensionSideEffects(a),this.emit(a)}),await a.bindExtensions({uiContext:this.extensionUi.uiContext,mode:"rpc",commandContextActions:{waitForIdle:()=>a.waitForIdle(),newSession:async a=>{let b=await this.runtime.newSession(a);return b.cancelled||await this.rebindSession(),b},fork:async(a,b)=>{let c=await this.runtime.fork(a,b);return c.cancelled||await this.rebindSession(),{cancelled:c.cancelled}},navigateTree:async(b,c)=>({cancelled:(await a.navigateTree(b,{summarize:c?.summarize,customInstructions:c?.customInstructions,replaceInstructions:c?.replaceInstructions,label:c?.label})).cancelled}),switchSession:async(a,b)=>{let c=await this.runtime.switchSession(a,b);return c.cancelled||await this.rebindSession(),c},reload:async()=>{await a.reload()}},onError:a=>{this.setFollowUpHeld(!0),this.emit({type:"extension_error",extensionPath:a.extensionPath,event:a.event,error:a.error})}}),this.unsubscribe?.(),this.unsubscribe=a.subscribe(a=>{this.resetIdleTimer(),this.handleSessionEvent(a)}),this.syncIdentityFromSession()}trackExtensionSideEffects(a){if("extension_ui_request"!==a.type)return;let b=s(a.method);if("setStatus"===b){let b=s(a.statusKey)??s(a.key)??"default",c=s(a.statusText)??s(a.text)??"";c?this.extensionUi?.statuses.set(b,c):this.extensionUi?.statuses.delete(b)}if("setWidget"===b){let b=s(a.widgetKey)??s(a.key)??"default",c=a.widgetLines??a.content;null==c?this.extensionUi?.widgets.delete(b):this.extensionUi?.widgets.set(b,{lines:c,placement:a.widgetPlacement})}this.notifyRunning()}maybeAutoNameSession(){try{let a=this.session?.sessionManager;if(!a||a.getSessionName())return;let b=(a.buildSessionContext().messages??[]).find(a=>"user"===a.role),c=function(a){let b="";"string"==typeof a?b=a:Array.isArray(a)&&(b=a.filter(a=>"object"==typeof a&&null!==a&&"text"===a.type&&"string"==typeof a.text).map(a=>a.text).join("\n"));let c=b.replace(/\s+/g," ").trim();if(c)return c.length>60?`${c.slice(0,60)}…`:c}(b?.content);c&&a.appendSessionInfo(c)}catch{}}readStopReasonFromAgentEnd(a){let b=a.messages;if(!Array.isArray(b))return null;for(let a=b.length-1;a>=0;a--){let c=b[a],d=c?.message?.stopReason??c?.stopReason;if("string"==typeof d){if("aborted"===d)return"aborted";if("error"===d||"prompt_error"===d)return"error";return"completed"}}return null}handleSessionEvent(a){switch(a.type){case"agent_start":this.promptRunning=!0,(0,i.NK)(this.realSessionId,Date.now()),this.notifyRunning();break;case"agent_end":this.promptRunning=!1,this.lastStopReason=this.readStopReasonFromAgentEnd(a)??this.lastStopReason??"completed",("aborted"===this.lastStopReason||"error"===this.lastStopReason)&&this.setFollowUpHeld(!0),(0,i.PI)(this.realSessionId),this.options.onSessionListInvalidate?.(),this.realSessionFile&&(0,k.$9)(this.realSessionFile),this.maybeAutoNameSession(),this.notifyRunning(),this.emit({type:"prompt_done"});break;case"agent_settled":this.promptRunning=!1,this.notifyRunning(),"completed"===this.lastStopReason?this.flushingFollowUp?this.followUpFlushConfirmed?this.sendNextFollowUp():this.confirmFollowUpFlush():this.scheduleFollowUpFlush():this.flushingFollowUp&&("aborted"===this.lastStopReason||"error"===this.lastStopReason)&&this.abortFollowUpFlush(),this.resetIdleTimer();break;case"compaction_start":case"auto_compaction_start":this.notifyRunning();break;case"compaction_end":case"auto_compaction_end":this.notifyRunning(),!0!==a.aborted&&!a.errorMessage&&this.isSettled()&&this.scheduleFollowUpFlush(),this.resetIdleTimer();break;case"message_end":{let b=a.message;b?.role==="user"&&(this.confirmFollowUpFlush(),setImmediate(()=>{try{(0,l.kb)(this.session.sessionManager),this.syncIdentityFromSession(),this.options.onSessionListInvalidate?.()}catch(a){console.error("[pidance] materialize after user message failed:",a)}}));break}case"queue_update":{let b=Array.isArray(a.steering)?a.steering.filter(a=>"string"==typeof a):[],c=Array.isArray(a.followUp)?a.followUp.filter(a=>"string"==typeof a):[];this.localQueue={steering:b,followUp:c},this.hasQueueSnapshot=!0}}this.emit(this.withRenderedToolLines(a))}withRenderedToolLines(a){try{if(!this.renderBridgeTheme)return a;switch(a.type){case"tool_execution_update":{if(!this.shouldRenderPartialUpdate(a.toolCallId))return a;let b=this.getToolRenderDefinition(a.toolName);if(!b)return a;let c=this.buildToolRenderContext(a.toolCallId,a.args??a.input,{isPartial:!0,expanded:!0,isError:!0===a.isError,resultSlot:!0});if(!c)return a;let d=(0,q.t_)(b,a.partialResult,{expanded:!0,isPartial:!0},c,b=>this.updateToolRenderLastComponent(a.toolCallId,!0,b));return d?{...a,renderedLines:d}:a}case"tool_call":{let b=this.getToolRenderDefinition(a.toolName);if(!b)return a;let c=this.buildToolRenderContext(a.toolCallId,a.input,{isPartial:!1,expanded:!0,isError:!1,resultSlot:!1});if(!c)return a;let d=(0,q.GD)(b,a.input,c,b=>this.updateToolRenderLastComponent(a.toolCallId,!1,b));return d?{...a,renderedCallLines:d}:a}case"tool_result":{let b=this.getToolRenderDefinition(a.toolName);if(!b)return a;let c=this.buildToolRenderContext(a.toolCallId,a.args??a.input,{isPartial:!1,expanded:!0,isError:!0===a.isError,resultSlot:!0});if(!c)return a;let d=(0,q.t_)(b,{content:a.content,details:a.details,isError:!0===a.isError,...void 0!==a.usage?{usage:a.usage}:{}},{expanded:!0,isPartial:!1},c,b=>this.updateToolRenderLastComponent(a.toolCallId,!0,b));return d?{...a,renderedResultLines:d}:a}case"message_start":case"message_end":{let b=a.message;if(b?.role!=="custom"||"string"!=typeof b.customType||""===b.customType)return a;let c=this.session.extensionRunner,d="function"==typeof c?.getMessageRenderer?c.getMessageRenderer(b.customType):void 0,e=(0,q.Mf)(d,a.message,this.renderBridgeTheme);return e?{...a,renderedLines:e}:a}default:return a}}catch{return a}}getToolRenderDefinition(a){if("string"==typeof a&&""!==a)try{return this.session.getToolDefinition(a)}catch{return}}buildToolRenderContext(a,b,c){let d=this.getOrCreateToolRenderState(a);return d?{args:b,toolCallId:a,invalidate:()=>{},lastComponent:c.resultSlot?d.lastResultComponent:d.lastCallComponent,state:d.state,cwd:this.realCwd,executionStarted:!0,argsComplete:!0,isPartial:c.isPartial,expanded:c.expanded,showImages:!1,isError:c.isError}:null}getOrCreateToolRenderState(a){if("string"!=typeof a||""===a)return null;let b=this.toolRenderStates.get(a);return b||(b={state:{},lastCallComponent:void 0,lastResultComponent:void 0,lastPartialRenderAt:void 0},this.toolRenderStates.set(a,b)),b}updateToolRenderLastComponent(a,b,c){if("string"!=typeof a||""===a)return;let d=this.toolRenderStates.get(a);d&&(b?d.lastResultComponent=c:d.lastCallComponent=c)}shouldRenderPartialUpdate(a){if("string"!=typeof a||""===a)return!0;let b=Date.now(),c=this.getOrCreateToolRenderState(a);return!c||(void 0===c.lastPartialRenderAt||!(b-c.lastPartialRenderAt<u.PARTIAL_RENDER_MIN_INTERVAL_MS))&&(c.lastPartialRenderAt=b,!0)}get realCwd(){try{return this.session.sessionManager.getHeader()?.cwd||this.options.cwd}catch{return this.options.cwd}}async start(){try{var a,b;let c=(a=this.realSessionFile,b=this.options.cwd,a?(0,l.G1)(a):(0,l.Qu)(b)),d=c.getCwd()||this.options.cwd,f=this.agentDir,g=this.activeToolNames,h=async({cwd:a,agentDir:b,sessionManager:c,sessionStartEvent:d})=>{let f=await (0,e.createAgentSessionServices)({cwd:a,agentDir:b});for(let a of f.modelRuntime.getModels())(0,o.yu)(a);return{...await (0,e.createAgentSessionFromServices)({services:f,sessionManager:c,sessionStartEvent:d,tools:g&&g.length>0?g:void 0,noTools:g&&0===g.length?"all":void 0}),services:f,diagnostics:f.diagnostics}};this.runtime=await (0,e.createAgentSessionRuntime)(h,{cwd:d,agentDir:f,sessionManager:c}),this.runtime.setRebindSession(async()=>{await this.rebindSession()}),this.runtime.setBeforeSessionInvalidate(()=>{this.extensionUi?.dispose(),this.unsubscribe?.(),this.unsubscribe=null}),await this.rebindSession(),this.syncIdentityFromSession(),this.hydrateFollowUpQueue(),this.startupHoldTimer=setTimeout(()=>{this.startupHoldTimer=null,this.startupHold=!1,this.resetIdleTimer()},15e3),this.startupHoldTimer.unref?.(),this.resetIdleTimer(),this.followUpQueue.length>0&&!this.isFollowUpHeld()&&this.isSettled()&&this.scheduleFollowUpFlush()}catch(a){throw await this.destroyAsync(),a}}projectState(){let a=this.session,b=a.model,c={stateSources:{rpcGetState:!1,sdkSession:!0,sessionStats:!0,localQueue:!0,localExtensionUi:!0},sessionId:this.realSessionId,sessionFile:this.realSessionFile,sessionName:a.sessionName,isStreaming:a.isStreaming,isCompacting:a.isCompacting,isPromptRunning:this.promptRunning,lastStopReason:this.lastStopReason,isBashRunning:this.bashRunning,pendingBash:this.bashCommand,autoCompactionEnabled:a.autoCompactionEnabled,steeringMode:a.steeringMode,followUpMode:a.followUpMode,thinkingLevel:a.thinkingLevel,systemPrompt:a.systemPrompt??"",model:b?{id:b.id,provider:b.provider}:void 0,messageCount:a.messages.length,pendingMessageCount:a.pendingMessageCount,extensionStatuses:Array.from(this.extensionUi?.statuses.entries()??[],([a,b])=>({key:a,text:b})),extensionWidgets:Array.from(this.extensionUi?.widgets.entries()??[],([a,b])=>({key:a,lines:Array.isArray(b?.lines)?b.lines:[],placement:b?.placement==="belowEditor"?"belowEditor":"aboveEditor"})),pendingExtensionRequests:Array.from(this.extensionUi?.pendingSnapshot.values()??[])};c.queuedMessages={steering:this.hasQueueSnapshot?[...this.localQueue.steering]:[],followUp:[...this.followUpQueue]};try{let b=a.getSessionStats(),d=b?.contextUsage;d&&"number"==typeof d.contextWindow&&d.contextWindow>0&&(c.contextUsage={contextWindow:d.contextWindow,percent:"number"==typeof d.percent?d.percent:null,tokens:"number"==typeof d.tokens?d.tokens:null})}catch{}return c}appendActivity(a){if(!this.runtime)throw Error("Cannot append activity: session not alive");let b=a&&"object"==typeof a&&"type"in a&&"append_activity"===a.type?(0,j.qF)(a):(0,j.l$)(a),c=this.session.sessionManager.appendCustomEntry(j.cP,b);return this.options.onSessionListInvalidate?.(),{entryId:c,activity:b}}async send(a){if(!this.runtime)throw Error("SDK session is not alive");let b=a.type;"get_state"!==b&&"ensure_session"!==b&&this.releaseStartupHold(),this.activeCommandCount+=1,this.resetIdleTimer();let c=this.session;try{switch(b){case"prompt":{let b=(0,p.JT)(a),d=this.promptReceipts.get(b.submissionId);if(d)return d;let e=b.submissionId,f=this.promptInFlight.get(e);if(f)return f;if(this.bashRunning)throw Error("Cannot send a prompt while a shell command is running");if(c.isCompacting){if(b.images?.length)throw Error("Image attachments cannot be queued while compaction is in progress");let a={submissionId:b.submissionId,sessionId:this.realSessionId,status:"accepted"};return this.followUpQueue=[...this.followUpQueue,b.message],this.promptReceipts.set(b.submissionId,a),this.persistFollowUpQueue(),this.options.onSessionListInvalidate?.(),a}if(!(0,h.kP)(this.realSessionId))throw Error(h.GT);this.promptRunning=!0,this.lastStopReason=null,(0,i.NK)(this.realSessionId,Date.now()),this.notifyRunning();let g=(async()=>{try{await new Promise((d,e)=>{let f=!1,g=()=>{c.isStreaming||c.isCompacting||this.bashRunning||this.promptRunning&&(this.promptRunning=!1,"aborted"!==this.lastStopReason&&"error"!==this.lastStopReason&&(this.lastStopReason="completed"),(0,i.PI)(this.realSessionId),this.notifyRunning(),this.emit({type:"prompt_done"}),this.resetIdleTimer())};c.prompt(b.message,{images:b.images??a.images,streamingBehavior:a.streamingBehavior,source:"rpc",preflightResult:a=>{a&&(f=!0,this.syncIdentityFromSession(),this.setFollowUpHeld(!1),this.options.onSessionListInvalidate?.(),d())}}).then(()=>{if(!f){f=!0;try{(0,l.kb)(c.sessionManager)}catch(a){console.error("[pidance] materialize after prompt failed:",a)}this.syncIdentityFromSession(),this.options.onSessionListInvalidate?.(),d()}g()}).catch(a=>{"aborted"!==this.lastStopReason&&(this.lastStopReason="error"),this.setFollowUpHeld(!0),g(),f||(f=!0,e(a))})});let d={submissionId:b.submissionId,sessionId:this.realSessionId,status:"accepted"};return this.promptReceipts.set(e,d),d}catch(d){this.promptRunning=!1,this.lastStopReason="aborted"===this.lastStopReason?"aborted":"error",this.setFollowUpHeld(!0),(0,i.PI)(this.realSessionId),this.notifyRunning();let a=d instanceof Error?d.message:String(d);this.emit({type:"prompt_error",errorMessage:a}),this.emit({type:"prompt_done"});let c={submissionId:b.submissionId,sessionId:this.realSessionId,status:"rejected"};throw this.promptReceipts.set(e,c),d}finally{this.promptInFlight.delete(e)}})();return this.promptInFlight.set(e,g),g}case"abort":return this.lastStopReason="aborted",this.setFollowUpHeld(!0),this.promptRunning=!1,this.notifyRunning(),await c.abort(),this.notifyRunning(),null;case"get_state":return this.projectState();case"set_model":{let b=String(a.provider??""),d=String(a.modelId??""),e=(0,n.E)(c.modelRuntime,b,d);if(!e)try{e=(await c.modelRuntime.getAvailable()).find(a=>a.provider===b&&a.id===d)}catch{e=void 0}if(!e)throw Error(`Model not found: ${b}/${d}`);return await c.setModel((0,o.eU)(e)),this.options.onSessionListInvalidate?.(),e}case"set_thinking_level":return c.model&&(0,o.yu)(c.model),c.setThinkingLevel(a.level),this.options.onSessionListInvalidate?.(),null;case"compact":{let b=await c.compact("string"==typeof a.customInstructions?a.customInstructions:void 0);return this.options.onSessionListInvalidate?.(),this.notifyRunning(),this.resetIdleTimer(),b}case"steer":return await c.steer(String(a.message??""),a.images),null;case"set_follow_up_queue":{let b=Array.isArray(a.items)?a.items.filter(a=>"string"==typeof a&&a.trim().length>0):[];return this.flushingFollowUp&&this.abortFollowUpFlush(),this.followUpQueue=b,this.persistFollowUpQueue(),this.isSettled()&&b.length>0&&this.scheduleFollowUpFlush(),this.resetIdleTimer(),{ok:!0,queued:this.followUpQueue.length}}case"follow_up":return await c.followUp(String(a.message??""),a.images),null;case"set_session_name":{let b=String(a.name??"").trim();if(!b)throw Error("Session name cannot be empty");return c.setSessionName(b),this.options.onSessionListInvalidate?.(),null}case"set_auto_compaction":return c.setAutoCompactionEnabled(!!a.enabled),null;case"set_auto_retry":return c.setAutoRetryEnabled(!!a.enabled),null;case"clear_queue":return c.clearQueue();case"get_tools":{let a=c.getAllTools(),b=new Set(c.getActiveToolNames());return{source:"sdk",tools:a.map(a=>({name:a.name,description:a.description??"",active:b.has(a.name)}))}}case"set_tools":{let b=Array.isArray(a.tools)?a.tools.filter(a=>"string"==typeof a):[];return c.setActiveToolsByName(b),this.activeToolNames=b,null}case"get_commands":{let a=[];for(let b of c.extensionRunner.getRegisteredCommands())a.push({name:b.invocationName,description:b.description,source:"extension",sourceInfo:b.sourceInfo});for(let b of c.promptTemplates)a.push({name:b.name,description:b.description,source:"prompt_template"});try{let b=c.resourceLoader?.getSkills?.();for(let c of b?.skills??[])a.push({name:`skill:${c.name}`,description:c.description,source:"skill",sourceInfo:c.sourceInfo})}catch{}return{commands:a}}case"get_session_stats":return c.getSessionStats();case"bash":if(c.isStreaming)throw Error("Cannot run bash while agent is streaming");this.bashRunning=!0,this.bashCommand={command:String(a.command??""),excludeFromContext:!!a.excludeFromContext,startedAt:Date.now()},this.notifyRunning();try{return await c.executeBash(String(a.command??""),void 0,{excludeFromContext:!!a.excludeFromContext})}finally{this.bashRunning=!1,this.bashCommand=null,this.notifyRunning(),this.resetIdleTimer()}case"abort_bash":return c.abortBash(),this.bashRunning=!1,this.bashCommand=null,this.notifyRunning(),null;case"abort_compaction":return c.abortCompaction(),null;case"extension_ui_response":{let b=s(a.id);if(!b)throw Error("extension_ui_response requires id");let c={...a};return delete c.type,delete c.id,!this.extensionUi?.respond(b,c),this.notifyRunning(),null}case"extension_ui_input":{let b=s(a.id),c="string"==typeof a.data?a.data:"";return b&&this.extensionUi?.inputCustom(b,c),null}case"append_activity":return this.appendActivity(a);case"fork":{if(this.bashRunning)throw Error("Cannot fork while a shell command is running");let b=String(a.entryId??"");if(!b)throw Error("entryId is required");let c=await this.runtime.fork(b);return c.cancelled||(await this.rebindSession(),this.syncIdentityFromSession(),this.options.onSessionListInvalidate?.()),{cancelled:c.cancelled,newSessionId:c.cancelled?void 0:this.realSessionId,text:c.selectedText}}case"navigate_tree":{if(this.bashRunning)throw Error("Cannot navigate while a shell command is running");let b=s(a.targetId);if(!b)throw Error("targetId is required");let d=await c.navigateTree(b,{summarize:a.summarize,customInstructions:s(a.customInstructions)});if(!d.cancelled&&this.realSessionFile){c.sessionManager.getLeafId();let a=c.sessionManager.getLeafId(),b=c.sessionManager.getEntries(),d=b.at(-1)?.id;a&&d&&a!==d?(0,k.R3)(this.realSessionFile,a):this.realSessionFile&&(0,k.$9)(this.realSessionFile)}return this.options.onSessionListInvalidate?.(),{cancelled:d.cancelled}}case"select_leaf_exact":{let b=s(a.entryId);if(!b)throw Error("entryId is required");if(this.options.navigationActions)return this.options.navigationActions.selectLeafExact(this.sessionId,b);let d=await c.navigateTree(b,{summarize:!1});if(!d.cancelled&&this.realSessionFile){let a=c.sessionManager.getLeafId(),b=c.sessionManager.getEntries().at(-1)?.id;a&&b&&a!==b?(0,k.R3)(this.realSessionFile,a):(0,k.$9)(this.realSessionFile)}return{cancelled:d.cancelled}}case"branch_from_assistant":{let b=s(a.assistantEntryId);if(!b)throw Error("assistantEntryId is required");if(this.options.navigationActions)return this.options.navigationActions.branchFromAssistant(this.sessionId,b);throw Error("branch_from_assistant is unavailable")}case"create_session_from_leaf":{let b=s(a.entryId);if(!b)throw Error("entryId is required");if(this.options.navigationActions)return this.options.navigationActions.createSessionFromLeaf(this.sessionId,b);throw Error("create_session_from_leaf is unavailable")}case"set_branch_label":{let b=s(a.targetId);if(!b)throw Error("targetId is required");let d=void 0===a.label||null===a.label?void 0:String(a.label);return c.sessionManager.appendLabelChange(b,d),this.options.onSessionListInvalidate?.(),null}case"reload":return await c.reload(),await this.rebindSession(),null;case"get_last_assistant_text":return{text:c.getLastAssistantText()};case"ensure_session":return null;default:throw Error(`Unsupported command: ${b}`)}}finally{this.activeCommandCount=Math.max(0,this.activeCommandCount-1),0===this.activeCommandCount&&this.resetIdleTimer()}}destroy(){this.destroyAsync()}async destroyAsync(){if(this.destroyPromise)return this.destroyPromise;if(this._alive||this.runtime){if(this.activeCommandCount>0){if(this._scheduledRecheck)return;this._scheduledRecheck=!0,setTimeout(()=>{this._scheduledRecheck=!1,!this.destroyPromise&&this._alive&&this.destroyAsync()},0)}return this._alive=!1,this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=null,this.startupHoldTimer&&clearTimeout(this.startupHoldTimer),this.startupHoldTimer=null,this.startupHold=!1,this.destroyPromise=(async()=>{this.unsubscribe?.(),this.unsubscribe=null,this.extensionUi?.dispose(),this.extensionUi=null;let a=this.runtime;if(this.runtime=null,a)try{await a.dispose()}catch(a){console.error("[pidance] sdk runtime dispose error:",a)}this.promptRunning=!1,this.bashRunning=!1,this.bashCommand=null,this.flushingFollowUp=!1,this.followUpFlushBatch=[],this.followUpFlushCursor=0,this.followUpFlushConfirmed=!1,this.followUpFlushAsOne=!1,this.followUpFlushOriginal=[],(0,i.PI)(this.realSessionId),this.onDestroyCallback?.(),this.notifyRunning()})(),this.destroyPromise}}}async function t(a){let b=new u(a);return await b.start(),b}d()}catch(a){d(a)}})},5815:(a,b,c)=>{c.d(b,{MG:()=>h,NK:()=>f,PI:()=>g});let d="__piRunningStartedAt";function e(){let a=globalThis;return d in a&&a[d]instanceof Map||(a[d]=new Map),a[d]}function f(a,b){e().set(a,b)}function g(a){e().delete(a)}function h(){return e()}},26773:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{$k:()=>u,A4:()=>m,DU:()=>o,EM:()=>r,Fn:()=>t,HG:()=>q,OF:()=>w});var e=c(40402),f=c(95237);c(68524);var g=c(2416),h=c(5815),i=c(89953),j=a([e,f,g]);function k(){if(!globalThis.__piSessions){globalThis.__piSessions=new Map;let a=()=>{globalThis.__piSessions?.forEach(a=>a.destroy())};process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__piSessions}function l(){return globalThis.__piStartLocks||(globalThis.__piStartLocks=new Map),globalThis.__piStartLocks}function m(a){return k().get(a)}function n(){return[...l().keys()]}async function o(a){let b=l().get(a);if(!b)return null;try{return(await b).realSessionId}catch{return null}}function p(){let a=new Set(n());for(let[b,c]of k())c.isRunning()&&a.add(c.sessionId||b);return[...a]}function q(){let a=new Set(p());for(let b of(0,i.mr)())a.add(b);return[...a]}[e,f,g]=j.then?(await j)():j;let y=new Map;function r(a,b=Date.now()){let c={},d=(0,h.MG)(),e=p(),f=new Set(e);for(let a of e){let e=d.get(a)??y.get(a)??b;y.set(a,e),c[a]=e}for(let a of[...y.keys()])f.has(a)||y.delete(a);for(let{sessionId:d,startedAt:e}of(0,i.D3)(a,b))c[d]=e;return c}function s(){return globalThis.__piRunningListeners||(globalThis.__piRunningListeners=new Set),globalThis.__piRunningListeners}function t(a){let b=s();return b.add(a),()=>{b.delete(a)}}function u(){let a=[];for(let[b,c]of k()){let d=c.listPendingExtensionRequests();0!==d.length&&a.push({sessionId:c.sessionId||b,requests:d})}return a}let z="",A=new Set,B=null;function v(){!function a(){let b=new Set(function(){let a=new Set(n());for(let[b,c]of k())c.isAlive()&&a.add(c.sessionId||b);return[...a]}());for(let a of b)(0,i.AZ)(a),A.add(a);for(let a of[...A])b.has(a)||((0,i.Hl)(a),A.delete(a));if(0===b.size){B&&(clearInterval(B),B=null);return}B||(B=setInterval(()=>{a()},8e3),B.unref?.())}();let a=q(),b=u(),c=JSON.stringify({ids:[...a].sort(),pending:b.map(a=>({sessionId:a.sessionId,ids:a.requests.map(a=>a.id??null)}))});if(c!==z)for(let b of(z=c,s()))try{b(a)}catch{}}async function w(a,b,c,d,e){return x(a,b,c,d,e)}async function x(a,b,c,d,f){let h=k(),j=l(),m=h.get(a);if(m?.isAlive())return{session:m,realSessionId:a};let n=j.get(a);if(n)return n;if(!(0,i.kP)(a))throw Error(i.GT);v();let o=(async()=>{try{let j=await (0,g.j1)({sessionId:a,sessionFile:b,cwd:c,toolNames:d,navigationActions:f,onRunningChange:()=>v(),onSessionListInvalidate:()=>(0,e.mD)(),cacheSessionPath:(a,b)=>(0,e.O8)(a,b),onSessionRekeyed:(a,b,c)=>{let d;d=k(),a!==b&&d.delete(a),d.set(b,c),a!==b&&((0,i.kP)(b),(0,i.Hl)(a))}}),l=j.sessionId,m=j.sessionFile;return m&&(0,e.O8)(l,m),l!==a&&(0,i.kP)(l),j.onDestroy(()=>{h.get(l)===j&&h.delete(l),a!==l&&h.get(a)===j&&h.delete(a),(0,i.Hl)(l),a!==l&&(0,i.Hl)(a),v()}),h.set(l,j),j.beginExtensionBinding(),{session:j,realSessionId:l}}catch(b){throw(0,i.Hl)(a),v(),b}})().finally(()=>{j.delete(a),v()});return j.set(a,o),o}d()}catch(a){d(a)}})},31524:(a,b,c)=>{c.d(b,{Ut:()=>e,eU:()=>f,yu:()=>g});let d=["off","minimal","low","medium","high","xhigh","max"];function e(a,b){return a?d.filter(a=>b?.[a]!==null):["off"]}function f(a){if(!a.reasoning)return a;let b=a.thinkingLevelMap,c={...b??{}},d=!1;for(let a of["xhigh","max"])Object.prototype.hasOwnProperty.call(c,a)&&void 0!==c[a]||(c[a]=a,d=!0);return!d&&b?a:{...a,thinkingLevelMap:c}}function g(a){let b=f(a);if(b===a)return a;try{return a.thinkingLevelMap=b.thinkingLevelMap,a}catch{return b}}},37594:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{C9:()=>G,DQ:()=>F,Md:()=>E,Yz:()=>D,mB:()=>I});var e=c(29021),f=c(33873),g=c(80547),h=c(60396),i=c(95237),j=c(52960),k=c(79495),l=c(81879),m=c(46935),n=c(31514),o=c(65107),p=c(56429),q=c(40402),r=c(85664),s=c(15461),t=c(76817),u=c(86226),v=c(68524),w=c(89953),x=c(50955),y=c(40239),z=c(5815),A=c(26773),B=c(68816),C=a([g,i,l,p,q,A]);[g,i,l,p,q,A]=C.then?(await C)():C;let F="Subagent sessions are read-only";class G extends Error{constructor(){super(F)}toString(){return this.message}}async function D(a,b){if(await b(a))throw new G}function E(a){let b=a instanceof Error?a.message:String(a);return a instanceof G||b===F?403:b.includes("Session not found")?404:(0,w.wE)(a)||b===w.GT||"Session is being deleted"===b||b.includes("closed while its title")?409:500}let H={listAllSessions:q.dQ,resolveSessionPath:q.os,getRpcSession:p.A4,waitForSessionStart:p.DU,startRpcSession:p.OF,getRunningRpcSessionIds:p.HG,listPendingExtensionUi:p.$k,subscribeRunningSessions:p.Fn,allowFileRoot:g.wz,invalidateSessionListCache:q.mD,openSessionCwd:a=>(0,i.kW)(a).getHeader()?.cwd??process.cwd(),openSessionManager:a=>(0,q.Zx)({filePath:a}),openSessionView:i.kW,reparentSessionFile:i.i5,existsSync:e.existsSync,now:()=>Date.now(),archiveFs:y.Iq},I=function(a={}){let b={...H,...a},c=(0,y.Ki)({fs:b.archiveFs,agentDir:b.archiveAgentDir,resolveSessionPath:b.resolveSessionPath,readSessionHeader:q.eP,isReadOnly:async a=>{let c=(await b.listAllSessions()).find(b=>b.id===a);return c?.readOnly===!0},isRunning:a=>b.getRunningRpcSessionIds().includes(a),getSessionInfo:async a=>(await b.listAllSessions()).find(b=>b.id===a)??null,invalidateSessionListCache:b.invalidateSessionListCache,now:()=>new Date(b.now()).toISOString()}),d=()=>(0,y.$T)(b.archiveFs??y.Iq,b.archiveAgentDir?.()??(0,h.$M)()),g=new Map,p=async a=>{let c=b.getRpcSession(a);if(c){if("function"==typeof c.destroyAsync)return void await c.destroyAsync();c.isAlive()&&c.destroy()}},C=async(a,b)=>{if(!(0,w.kP)(a))throw Error(w.GT);try{return await b()}finally{(0,w.Hl)(a)}},E=async(a,b)=>(await p(a),C(a,b)),F={async listSessions(){let a=await b.listAllSessions(),{active:c,archived:e}=(0,y.uD)(a,d());return{sessions:c,archivedSessions:e,archivedCount:e.length,runningSessionIds:b.getRunningRpcSessionIds()}},async listArchivedSessions(){let a=await b.listAllSessions();return(0,y.uD)(a,d()).archived},async listActiveSessions(){let a=await b.listAllSessions();return(0,y.uD)(a,d()).active},listAllSessions:async()=>b.listAllSessions(),async isArchived(a){let c=await b.listAllSessions();return(0,y.YV)(c,d()).has(a)},archiveSession:async a=>c.archiveSession(a),restoreSession:async a=>c.restoreSession(a),archiveSessions:async a=>c.archiveSessions(a),restoreSessions:async a=>c.restoreSessions(a),removeArchiveRecordAfterPermanentDelete(a){(0,y.rQ)(b.archiveFs??y.Iq,b.archiveAgentDir?.()??(0,h.$M)(),a)},resolvePath:a=>b.resolveSessionPath(a),getSessionInfo:async a=>a&&"string"==typeof a?(await b.listAllSessions()).find(b=>b.id===a)??null:null,async isReadOnly(a){let c=(await b.listAllSessions()).find(b=>b.id===a);return c?.readOnly===!0},async getReadView(a){let c=await b.resolveSessionPath(a);if(!c)return null;let d=b.getRpcSession(a),e=d?.inner;return d?.isAlive()&&e?.sessionManager?{source:"live",filePath:c,manager:e.sessionManager}:{source:"disk",filePath:c,manager:b.openSessionManager(c)}},getLive(a){let c=b.getRpcSession(a);return c?.isAlive()?c:void 0},getLiveSession:a=>F.getLive(a),isLive:a=>!!F.getLive(a),async ensureLive(a){if(await D(a,F.isReadOnly),g.has(a))throw Error("Session is being deleted");let c=F.getLive(a);if(c)return c;if((0,w.wy)(a))throw Error(w.GT);let d=await b.resolveSessionPath(a);if(!d)throw Error("Session not found");let e=b.openSessionCwd(d),{session:f}=await b.startRpcSession(a,d,e,void 0,G);return f},destroy(a){b.getRpcSession(a)?.destroy()},async destroyAsync(a){let c=b.getRpcSession(a);c&&("function"==typeof c.destroyAsync?await c.destroyAsync():c.destroy())},deleteSession(a){let c=g.get(a);if(c)return c;let d=(async()=>{await D(a,F.isReadOnly);let c=await b.waitForSessionStart?.(a)??a,d=await b.resolveSessionPath(a);if(!d){try{(0,v.xP)(`sessionQueue.${a}`,null),(0,v.xP)(`sessionQueueHold.${a}`,null)}catch(a){console.error("[pidance] failed to clear queue prefs after missing delete:",a)}return(0,q.BR)(a),b.invalidateSessionListCache(),F.removeArchiveRecordAfterPermanentDelete(a),{skippedSubagents:0}}if((0,w.wy)(a)||(0,w.wy)(c))throw Error(w.GT);let g=(0,q.eP)(d)?.parentSession,h=(0,q.eP)(d)?.id===a?(0,x.ku)(d,a):[],i=b.getRpcSession(c)??b.getRpcSession(a),j=b.getRunningRpcSessionIds();if(i?.isAlive?.()&&(j.includes(a)||j.includes(c)))try{await i.send({type:"abort"})}catch(a){console.error("[pidance] abort before delete failed:",a)}return await F.destroyAsync(i?.sessionId??c),C(i?.sessionId??c,async()=>{let c=d.replace(/\\/g,"/").split("/").slice(0,-1).join("/");try{for(let a of(0,e.readdirSync)(c).filter(a=>a.endsWith(".jsonl")&&(0,f.join)(c,a)!==d)){let e=(0,f.join)(c,a);try{let a=(0,q.eP)(e);a?.type==="session"&&a.parentSession===d&&(a.id?(await b.waitForSessionStart?.(a.id),await E(a.id,()=>{b.reparentSessionFile(e,g)})):b.reparentSessionFile(e,g))}catch{}}}catch{}try{(0,e.unlinkSync)(d)}catch(a){if("ENOENT"!==a.code)throw a}(0,o.$9)(d);let i=(0,f.resolve)(d.slice(0,-6)),j=(0,x.uq)(h,i,q.BR);try{(0,v.xP)(`sessionQueue.${a}`,null),(0,v.xP)(`sessionQueueHold.${a}`,null)}catch(a){console.error("[pidance] failed to clear queue prefs after delete:",a)}return(0,q.BR)(a),b.invalidateSessionListCache(),F.removeArchiveRecordAfterPermanentDelete(a),{skippedSubagents:j}})})();return g.set(a,d),d.finally(()=>{g.get(a)===d&&g.delete(a)})},async start(a,c,d,e){if(await D(a,F.isReadOnly),g.has(a))throw Error("Session is being deleted");return b.startRpcSession(a,c,d,e,G)},send:async(a,b)=>(await F.ensureLive(a)).send(b),async submitPrompt(a,b){await D(a,F.isReadOnly);let c=(0,j.JT)(b);try{let b=await F.send(a,c);if(b&&"object"==typeof b&&b.status)return b;return{submissionId:c.submissionId,sessionId:a,status:"accepted"}}catch(b){if((0,w.wE)(b))throw b;return{submissionId:c.submissionId,sessionId:a,status:"rejected"}}},async getAgentState(a){if(await F.isReadOnly(a))return{live:!1,activeRun:!1,readOnly:!0};let b=F.getLive(a);if(!b)return{live:!1,activeRun:!1,...(0,w.wy)(a)?{lockedByOther:!0}:{}};let c=await b.send({type:"get_state"}),d="function"==typeof b.isRunning?!!b.isRunning():!!(c&&(c.isStreaming||c.isPromptRunning||c.isCompacting||c.isBashRunning));return{live:!0,activeRun:d,lockedByOther:!1,state:c}},async renameSession(a,c){await D(a,F.isReadOnly);let d=c.trim();if(!d)throw Error("name is required");let e=F.getLive(a);if(e?.isAlive()){await e.send({type:"set_session_name",name:d}),b.invalidateSessionListCache();return}let f=await b.resolveSessionPath(a);if(!f)throw Error("Session not found");await E(a,()=>{b.openSessionView(f).appendSessionInfo(d),b.invalidateSessionListCache()})},async autoNameSession(a){await D(a,F.isReadOnly);let b=await F.ensureLive(a);await b.waitUntilReady?.();let c=await F.getNavigationSnapshot(a);if(!c)throw Error("Session not found");let d=c.context.messages??[],e=(0,k.CL)(),f=await (0,k.K)({messages:d,provider:e.provider,modelId:e.modelId,baseUrl:e.baseUrl,api:e.api,apiKey:e.apiKey,headers:e.headers});if(!b.isAlive())throw Error("The session was closed while its title was being generated. Please try again.");try{await b.send({type:"set_session_name",name:f.title})}catch{await F.destroyAsync(a),await F.renameSession(a,f.title)}return{title:f.title,usage:f.usage??null}},async exportSession(a,c){let d=await b.resolveSessionPath(a);if(!d)throw Error("Session not found");return(0,l.by)(d,c)},async getNavigationSnapshot(a,c={}){let d=await F.getReadView(a);if(!d)return null;let{filePath:e,manager:f}=d,{leafId:g,tree:h,context:i,header:j,sessionName:k}=(0,q.jK)(f,c),l=j?.parentSession?await (0,q.u1)(j.parentSession):void 0,m=(await b.listAllSessions()).find(b=>b.id===a),n=j?{path:e,id:j.id,cwd:j.cwd??"",name:k,created:j.timestamp,modified:j.timestamp,messageCount:i.totalMessageCount??i.messages.length,firstMessage:m?.firstMessage??"(no messages)",parentSessionId:l,...m?.subagent?{subagent:m.subagent,readOnly:!0}:{}}:null;return{filePath:e,leafId:g,tree:h,context:i,header:j,sessionName:k,parentSessionId:l,info:n}},async getContextPage(a,b){let c=await F.getReadView(a);if(!c)return{context:null};let d=c.manager,e=d.getEntries?.()??[],f=(0,q.Uv)(e,b.leafId,{deferThinking:b.deferThinking,deferToolResultImages:b.deferToolResultImages}),g=b.limit;return{context:b.before?(0,m.tr)(f,b.before,g??m._w):null!==g?(0,m.G1)(f,g):{...f,hasMoreBefore:!1,totalMessageCount:f.messages.length}}},async getEntryThinking(a,b,c){let d=await F.getReadView(a);if(!d)return null;let e=d.manager.getEntries().find(a=>a.id===b);if(!e||"message"!==e.type||e.message?.role!=="assistant")return null;let f=e.message.content?.[c];return f&&(0,n.mv)(f.type)?{thinking:(0,n.Ux)(f)}:null},async getToolResultDetails(a,b){let c=await F.getReadView(a);if(!c)return null;let d=c.manager.getEntries().find(a=>"message"===a.type&&a.message?.role==="toolResult"&&a.message.toolCallId===b);return d?{details:d.message?.details??null}:null},async appendActivity(a,c){await D(a,F.isReadOnly);let d=F.getLive(a),e=!!d?.inner?.sessionManager,f=d?.appendActivity;return d?.isAlive()&&e&&"function"==typeof f?await f.call(d,c):await E(a,async()=>{let d=await b.resolveSessionPath(a);if(!d)throw Error("Session not found");let e=(0,r.l$)(c),f=b.openSessionView(d).appendCustomEntry(r.cP,e);return b.invalidateSessionListCache(),{entryId:f,activity:e}})},appendCommandEntry:async(a,c)=>(await D(a,F.isReadOnly),await E(a,async()=>{let d=await b.resolveSessionPath(a);if(!d)throw Error("Session not found");let e=(0,s.fc)(c);if(!e.command)throw Error("command is required");let f=b.openSessionView(d).appendCustomEntry(s.OE,e);return b.invalidateSessionListCache(),{entryId:f,data:e}})),async createNew({cwd:a,command:c}){if(!a||"string"!=typeof a)throw Error("cwd is required");if(!b.existsSync(a))throw Error(`Directory does not exist: ${a}`);let{provider:d,modelId:e,toolNames:f,thinkingLevel:g,...h}=c,j=`__new__${b.now()}`,{session:k,realSessionId:l}=await b.startRpcSession(j,"",a,f,G);if(b.allowFileRoot(a),b.invalidateSessionListCache(),d&&e&&await k.send({type:"set_model",provider:d,modelId:e}),g&&await k.send({type:"set_thinking_level",level:g}),"ensure_session"===h.type){try{let a=k.inner,b=a?.sessionManager;b&&"function"==typeof b.getSessionFile&&(0,i.kb)(b)}catch(a){console.error("[pidance] materialize ensure_session failed:",a)}return{sessionId:l,data:null}}let m=await k.send(h);return{sessionId:l,data:m}},getRunningIds:()=>b.getRunningRpcSessionIds(),getRunningStartedAt(){let a=Object.fromEntries((0,z.MG)());for(let[b,c]of Object.entries((0,A.EM)()))b in a||(a[b]=c);return a},async searchFulltext(a,c={}){let d=await (0,B.s)(a,{limits:void 0!==c.maxHits?{maxHits:c.maxHits}:void 0}),e=c.scope??"active";if("all"===e)return d;let f=await b.listAllSessions(),g=(0,y.$T)(b.archiveFs??y.Iq,b.archiveAgentDir?.()??(0,h.$M)()),i=(0,y.mT)(d.sessionIds,f,g,e);return{...d,sessionIds:d.sessionIds.filter(a=>i.has(a)),hits:d.hits.filter(a=>i.has(a.sessionId))}},listPendingExtensionUi:()=>b.listPendingExtensionUi(),subscribeRunning:a=>b.subscribeRunningSessions(a),async selectLeafExact(a,c){if("string"!=typeof c||""===c.trim())throw Error("entryId is required");let d=c.trim(),e=b.getRpcSession(a);if(e?.isAlive?.()&&e.inner?.isBashRunning)throw Error("Cannot switch branch while a shell command is running");return E(a,async()=>{let c=await b.resolveSessionPath(a);if(!c)throw Error("Session not found");let e=b.openSessionView(c),f=e.getLeafId();if(d===f)return{cancelled:!1};if(d===e.getLastEntryId())return(0,o.$9)(c),{cancelled:!1};if(!e.getEntry(d))throw Error(`Entry ${d} not found`);try{return e.branch(d),(0,o.R3)(c,d),{cancelled:!1}}finally{b.invalidateSessionListCache()}})},async branchFromAssistant(a,c){if("string"!=typeof c||""===c.trim())throw Error("assistantEntryId is required");let d=c.trim(),e=b.getRpcSession(a);if(e?.isAlive?.()&&e.inner?.isBashRunning)throw Error("Cannot branch while a shell command is running");return E(a,async()=>{let c=await b.resolveSessionPath(a);if(!c)throw Error("Session not found");let e=b.openSessionView(c),f=e.getLeafId();if(!f)throw Error("Session has no leaf");let g=e.getBranch(f),h=e.getEntry(d);if(!h)throw Error("Entry not found");if("message"!==h.type||h.message?.role!=="assistant")throw Error("Only assistant messages can be branched from");let i=(0,t.wo)(g,d);try{return e.branch(i),i===e.getLastEntryId()?(0,o.$9)(c):(0,o.R3)(c,i),{cancelled:!1}}finally{b.invalidateSessionListCache()}})},async createSessionFromLeaf(a,c){if("string"!=typeof c||""===c.trim())throw Error("entryId is required");let d=c.trim(),e=b.getRpcSession(a),f=e?.inner;return E(a,async()=>{let c=(f?.sessionFile||e?.sessionFile)??await b.resolveSessionPath(a);if(!c)throw Error("Session not found");let g=(0,i.kW)(c),h=g.getEntry(d);if(!h)throw Error("Invalid entry ID");let j=d;if("message"===h.type&&h.message?.role==="assistant"){let a=g.getLeafId();if(!a)throw Error("Session has no leaf");let b=g.getBranch(a);j=(0,t.wo)(b,d)}let k=g.getSessionDir(),l=(0,i.G1)(c,k),m=l.createBranchedSession(j);if(!m)throw Error("Failed to create session");(0,i.kb)(l);let n=(0,i.kW)(m,k),o=n.getSessionId();(0,q.O8)(o,m),b.invalidateSessionListCache();let p=f?.model;return p&&(0,u.yN)(n.getEntries().some(a=>"model_change"===a.type),{provider:p.provider,modelId:p.id})&&n.appendModelChange(p.provider,p.id),{cancelled:!1,newSessionId:o}})}},G={selectLeafExact:(a,b)=>F.selectLeafExact(a,b),branchFromAssistant:(a,b)=>F.branchFromAssistant(a,b),createSessionFromLeaf:(a,b)=>F.createSessionFromLeaf(a,b)};return F}();d()}catch(a){d(a)}})},38195:(a,b,c)=>{c.d(b,{t:()=>g});var d=c(716),e=c(87538);function f(a,b,c,e,f,g,h){let i=(0,d.randomUUID)();return new Promise((d,j)=>{let k,l=!1,m=()=>{a.delete(i),b.delete(i),k&&clearTimeout(k),e?.signal?.removeEventListener("abort",o)},n=a=>{l||(l=!0,m(),d(a))},o=()=>n(f);e?.signal?.addEventListener("abort",o,{once:!0}),e?.timeout&&(k=setTimeout(()=>n(f),e.timeout)),a.set(i,{resolve:a=>{try{n(h(a))}catch(a){if(l)return;l=!0,m(),j(a instanceof Error?a:Error(String(a)))}},reject:a=>{l||(l=!0,m(),j(a))}});let p={type:"extension_ui_request",id:i,...g};b.set(i,p),c(p)})}function g(a){let b=new Map,c=new Map,g=new Map,h=new Map,i=new Map,j={select:(d,e,g)=>f(b,c,a,g,void 0,{method:"select",title:d,options:e,timeout:g?.timeout},a=>"cancelled"in a&&a.cancelled?void 0:"value"in a?a.value:void 0),confirm:(d,e,g)=>f(b,c,a,g,!1,{method:"confirm",title:d,message:e,timeout:g?.timeout},a=>(!("cancelled"in a)||!a.cancelled)&&"confirmed"in a&&!!a.confirmed),input:(d,e,g)=>f(b,c,a,g,void 0,{method:"input",title:d,placeholder:e,timeout:g?.timeout},a=>"cancelled"in a&&a.cancelled?void 0:"value"in a?a.value:void 0),notify(b,c){a({type:"extension_ui_request",id:(0,d.randomUUID)(),method:"notify",message:b,notifyType:c})},onTerminalInput:()=>()=>{},setStatus(b,c){c?g.set(b,c):g.delete(b),a({type:"extension_ui_request",id:(0,d.randomUUID)(),method:"setStatus",statusKey:b,statusText:c})},setWorkingMessage(){},setWorkingVisible(){},setWorkingIndicator(){},setHiddenThinkingLabel(){},setWidget(b,c,f){if("function"==typeof c){let a=(0,e.tU)(c,(0,e.Lm)());if(null===a)return;c=a}(void 0===c||Array.isArray(c))&&(null==c?h.delete(b):h.set(b,{lines:c,placement:f?.placement}),a({type:"extension_ui_request",id:(0,d.randomUUID)(),method:"setWidget",widgetKey:b,widgetLines:c,widgetPlacement:f?.placement}))},setFooter(){},setHeader(){},setTitle(b){a({type:"extension_ui_request",id:(0,d.randomUUID)(),method:"setTitle",title:b})},async custom(b){let c=(0,d.randomUUID)();return new Promise(d=>{let f,g=!1,h=b=>{g||(g=!0,i.delete(c),a({type:"extension_ui_request",id:c,method:"custom",closed:!0,lines:[]}),d(b))},k=()=>{if(g)return;let b=[];try{let a=f?.render?.(92);Array.isArray(a)&&(b=a.filter(a=>"string"==typeof a))}catch(a){console.error("[pidance] custom UI render failed:",a)}a({type:"extension_ui_request",id:c,method:"custom",lines:b})};i.set(c,{handleInput:a=>{if("\x03"===a)return void h(void 0);try{f?.handleInput?.(a)}catch(a){console.error("[pidance] custom UI input failed:",a)}},done:h});let l=function(a,b=92,c=40){return Object.freeze({terminal:Object.freeze({columns:b,rows:c,kittyProtocolActive:!1}),requestRender:a})}(()=>{k()},92,40),m=(0,e.Lm)()??j.theme;Promise.resolve().then(()=>b(l,m,{},h)).then(a=>{g||(f=a,k())}).catch(a=>{console.error("[pidance] custom UI factory failed:",a),h(void 0)})})},pasteToEditor(a){this.setEditorText(a)},setEditorText(b){a({type:"extension_ui_request",id:(0,d.randomUUID)(),method:"set_editor_text",text:b})},getEditorText:()=>"",editor:async(d,e)=>f(b,c,a,void 0,void 0,{method:"editor",title:d,prefill:e},a=>"cancelled"in a&&a.cancelled?void 0:"value"in a?a.value:void 0),addAutocompleteProvider(){},setEditorComponent(){},getEditorComponent(){},get theme(){let a=a=>String(a??""),b=(a,b)=>void 0===b?"":String(b);return new Proxy({fg:b,bg:b,bold:a,dim:a,italic:a},{get:(b,c)=>c in b?b[c]:"then"!==c?a:void 0})},getAllThemes:()=>[],getTheme(){},setTheme:()=>({success:!1,error:"Theme switching not supported in Web mode"}),getToolsExpanded:()=>!1,setToolsExpanded(){}};return{uiContext:j,pending:b,statuses:g,widgets:h,pendingSnapshot:c,respond(a,c){let d=b.get(a);return!!d&&(d.resolve(c),!0)},inputCustom(a,b){let c=i.get(a);return!!c&&(c.handleInput(b),!0)},dispose(){for(let[a,d]of b)b.delete(a),c.delete(a),d.reject(Error("Extension UI disposed"));for(let a of i.values())a.done(void 0);i.clear(),g.clear(),h.clear()}}}},40239:(a,b,c)=>{c.d(b,{$T:()=>m,Iq:()=>g,J3:()=>t,Ki:()=>u,YV:()=>q,mT:()=>r,rQ:()=>p,uD:()=>s});var d=c(29021),e=c(33873),f=c(60396);let g={existsSync:d.existsSync,lstatSync:d.lstatSync,mkdirSync:d.mkdirSync,readFileSync:(a,b)=>(0,d.readFileSync)(a,b),writeFileSync:(a,b,c)=>(0,d.writeFileSync)(a,b,c),renameSync:d.renameSync,unlinkSync:d.unlinkSync,readdirSync:d.readdirSync};function h(a=(0,f.$M)()){return(0,e.join)(a,"pidance-archive")}function i(a){return"string"!=typeof a||a.length<8||a.length>64||!/^[0-9a-fA-F][0-9a-fA-F-]{7,63}$/.test(a)?null:`${a}.json`}function j(a,b){try{let c=h(b);if(!a.existsSync(c))return null;let d=a.lstatSync(c);if(d.isSymbolicLink()||!d.isDirectory())return null;return c}catch{return null}}function k(a){return"object"==typeof a&&null!==a&&!(1!==a.version||"string"!=typeof a.sessionId||0===a.sessionId.length||"string"!=typeof a.sessionPath||0===a.sessionPath.length||"string"!=typeof a.archivedAt||Number.isNaN(Date.parse(a.archivedAt)))}function l(a,b,c){let d=i(c);if(!d)return null;let f=j(a,b);if(!f)return null;let g=(0,e.join)(f,d);try{if(!a.existsSync(g)||a.lstatSync(g).isSymbolicLink())return null;let b=a.readFileSync(g,"utf8");if(b.length>65536)return null;let d=JSON.parse(b);if(!k(d)||d.sessionId!==c)return null;return d}catch{return null}}function m(a,b){let c=globalThis.__piArchiveRecordsCache;if(c&&Date.now()-c.ts<5e3)return c.records;let d=j(a,b),e=[];if(d){let c=[];try{c=a.readdirSync(d)}catch{c=[]}for(let d of c){let c=function(a){if("string"!=typeof a||!a.endsWith(".json"))return null;let b=a.slice(0,-5);return b.length<8||b.length>64||!/^[0-9a-fA-F][0-9a-fA-F-]{7,63}$/.test(b)?null:b}(d);if(!c)continue;let f=l(a,b,c);f&&e.push(f)}}return globalThis.__piArchiveRecordsCache={records:e,ts:Date.now()},e}function n(){globalThis.__piArchiveRecordsCache=void 0}function o(a,b,c){let d=i(c);if(!d)return!1;let f=j(a,b);if(!f)return!1;let g=(0,e.join)(f,d);try{if(!a.existsSync(g))return!1;return a.unlinkSync(g),n(),!a.existsSync(g)}catch{return!1}}function p(a,b,c){o(a,b,c)}function q(a,b){let c=new Map;for(let a of b)c.set(a.sessionId,a);let d=new Set;for(let b of a){let a=c.get(b.id);a&&a.sessionPath===b.path&&d.add(b.id)}return d}function r(a,b,c,d){let e=q(b,c),f=new Set;for(let b of a){let a=e.has(b);("active"===d?!a:a)&&f.add(b)}return f}function s(a,b){let c=q(a,b),d=new Map;for(let a of b)d.set(a.sessionId,a);let e=[],f=[];for(let b of a)if(c.has(b.id)){let a=d.get(b.id);f.push({...b,archivedAt:a?a.archivedAt:void 0})}else e.push(b);return{active:e,archived:f}}class t extends Error{constructor(){super("Session is running; cannot archive while active")}toString(){return this.message}}function u(a){let b=a.fs??g,c=()=>a.agentDir?.()??(0,f.$M)(),d=async d=>{if(await a.isReadOnly(d))throw Error("Subagent sessions are read-only");if(a.isRunning(d))throw new t;let f=await a.resolveSessionPath(d);if(!f)throw Error("Session not found");let g=a.readSessionHeader(f);if(!g||g.id!==d)throw Error("Session header id mismatch");let j={version:1,sessionId:d,sessionPath:f,archivedAt:a.now()};return!function(a,b,c){let d=i(c.sessionId);if(!d)throw Error("Invalid session id");if(!k(c))throw Error("Invalid archive record");let f=function(a,b){let c=h(b);try{a.existsSync(c)||a.mkdirSync(c,{recursive:!0});let b=a.lstatSync(c);if(b.isSymbolicLink()||!b.isDirectory())return null;return c}catch{return null}}(a,b);if(!f)throw Error("Archive directory unavailable");let g=(0,e.join)(f,d),j=(0,e.join)(f,`.${d}.${process.pid}.${Date.now().toString(36)}.tmp`);try{a.writeFileSync(j,JSON.stringify(c),{encoding:"utf8",flag:"wx"}),a.renameSync(j,g),n()}catch(b){try{a.existsSync(j)&&a.unlinkSync(j)}catch{}throw b}}(b,c(),j),a.invalidateSessionListCache(),j.archivedAt},j=async d=>{if(null===l(b,c(),d))throw Error("Session is not archived");if(!await a.resolveSessionPath(d))throw Error("Session not found");if(!o(b,c(),d))throw Error("Failed to remove archive record");return a.invalidateSessionListCache(),a.getSessionInfo(d)},m=async a=>{let b=[],c=[];for(let e of a)try{await d(e),b.push(e)}catch(a){c.push({id:e,error:a instanceof Error?a.message:String(a)})}return{succeededIds:b,failed:c}},p=async a=>{let b=[],c=[];for(let d of a)try{await j(d),b.push(d)}catch(a){c.push({id:d,error:a instanceof Error?a.message:String(a)})}return{succeededIds:b,failed:c}};return{archiveSession:d,restoreSession:j,archiveSessions:m,restoreSessions:p}}},46935:(a,b,c)=>{c.d(b,{G1:()=>h,NN:()=>g,Uf:()=>d,_w:()=>e,tr:()=>i});let d=80,e=80;function f(a,b){return"number"==typeof a&&Number.isFinite(a)?Math.max(1,Math.min(Math.floor(a),500)):b}function g(a,b=d){let c=a.get("limit")??a.get("tail");if(null===c||""===c)return null;let e=Number(c);return!Number.isFinite(e)||e<=0?b:f(e,b)}function h(a,b=d){let c=a.messages.length,e=f(b,d);if(c<=e)return{...a,hasMoreBefore:!1,totalMessageCount:c};let g=c-e;return{messages:a.messages.slice(g),entryIds:a.entryIds.slice(g),thinkingLevel:a.thinkingLevel,model:a.model,hasMoreBefore:!0,totalMessageCount:c}}function i(a,b,c=e){let d=a.messages.length,g=a.entryIds.indexOf(b);if(g<=0)return{messages:[],entryIds:[],thinkingLevel:a.thinkingLevel,model:a.model,hasMoreBefore:!1,totalMessageCount:d};let h=Math.max(0,g-f(c,e));return{messages:a.messages.slice(h,g),entryIds:a.entryIds.slice(h,g),thinkingLevel:a.thinkingLevel,model:a.model,hasMoreBefore:h>0,totalMessageCount:d}}},52960:(a,b,c)=>{function d(){return"u">typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`sub-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function e(a){if(void 0===a)return;if(!Array.isArray(a))throw Error("images must be an array");let b=[];for(let c of a){if(!c||"object"!=typeof c)throw Error("invalid image");let a="string"==typeof c.data?c.data:void 0,d="string"==typeof c.mimeType?c.mimeType:"string"==typeof c.mime_type?c.mime_type:void 0;if(!a||!d)throw Error("invalid image");b.push({type:"image",data:a,mimeType:d})}return b}function f(a){if("string"!=typeof a.message)throw Error("message is required");return a.message}function g(a,b=d){return{type:"prompt",message:f(a),submissionId:"string"==typeof a.submissionId&&a.submissionId.trim()?a.submissionId.trim():b(),images:e(a.images)}}function h(a){return"prompt"===a||"abort"===a||"steer"===a||"follow_up"===a}function i(a,b=d){if(!a||"object"!=typeof a||Array.isArray(a))throw Error("command is required");let c=a.type;if("prompt"===c)return g(a,b);if("abort"===c)return{type:"abort"};if("steer"===c)return{type:"steer",message:f(a),images:e(a.images)};if("follow_up"===c)return{type:"follow_up",message:f(a),images:e(a.images)};throw Error(`Unsupported message command: ${String(c)}`)}c.d(b,{D_:()=>h,JT:()=>g,QR:()=>i})},53023:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Uj:()=>j});var e=c(85664),f=c(93127),g=c(95237),h=a([f,g]);function i(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}[f,g]=h.then?(await h)():h;let k=`
|
|
2
2
|
.pidance-activity{margin:1.5rem 0;padding:1rem 1.25rem;border:1px solid #ccc;border-radius:8px;background:#fafafa;color:#222;font-family:system-ui,-apple-system,Segoe UI,sans-serif;font-size:14px;line-height:1.45}
|
|
3
3
|
.pidance-activity h2{margin:0 0 0.75rem;font-size:1.1rem;font-weight:600}
|
|
4
4
|
.pidance-activity-card{margin:0.75rem 0;padding:0.75rem 1rem;border:1px solid #ddd;border-radius:6px;background:#fff}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/
|
|
1
|
+
globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/bYQa7wtG5XvdiFs9n9TDR/_buildManifest.js","static/bYQa7wtG5XvdiFs9n9TDR/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-d2379fd13c5c78c6.js","static/chunks/4bd1b696-e356ca5ba0218e27.js","static/chunks/3794-907785a527d8128b.js","static/chunks/main-app-06b2b50b226e40d1.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" translate="no" class="__variable_66b8ca notranslate"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/7deddc85b7ffd1dc-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/ec14413c594b3356-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/88714c00e109ce28.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html lang="en" translate="no" class="__variable_66b8ca notranslate"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/7deddc85b7ffd1dc-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/ec14413c594b3356-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/88714c00e109ce28.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/b368fb57ad4b2393.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d2379fd13c5c78c6.js"/><script src="/_next/static/chunks/4bd1b696-e356ca5ba0218e27.js" async=""></script><script src="/_next/static/chunks/3794-907785a527d8128b.js" async=""></script><script src="/_next/static/chunks/main-app-06b2b50b226e40d1.js" async=""></script><script src="/_next/static/chunks/9780-8a68d2504f1bc8c7.js" async=""></script><script src="/_next/static/chunks/app/layout-88764b4be2728d3f.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><meta name="google" content="notranslate"/><title>404: This page could not be found.</title><title>Pidance</title><meta name="description" content="Open-source web client for the Pi coding agent"/><link rel="icon" href="/brand/pidance-logo.png"/><link rel="apple-touch-icon" href="/brand/pidance-logo.png"/><script>(function(){try{var r=document.documentElement,m=localStorage.getItem("pi-theme"),s=localStorage.getItem("pi-theme-style");if(m!=="light"&&m!=="dark"&&m!=="system")m="light";if(s!=="fusion"&&s!=="chamber")s="chamber";var d=m==="dark"||(m==="system"&&matchMedia("(prefers-color-scheme: dark)").matches);r.classList.toggle("dark",d);r.dataset.themeMode=m;r.dataset.themeStyle=s}catch(e){}})();</script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body translate="no" class="notranslate" style="height:100dvh;display:flex;flex-direction:column"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-d2379fd13c5c78c6.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[99780,[\"9780\",\"static/chunks/9780-8a68d2504f1bc8c7.js\",\"7177\",\"static/chunks/app/layout-88764b4be2728d3f.js\"],\"I18nProvider\"]\n3:I[57121,[],\"\"]\n4:I[74581,[],\"\"]\n5:I[90484,[],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n9:I[90484,[],\"ViewportBoundary\"]\nb:I[90484,[],\"MetadataBoundary\"]\nd:I[27123,[],\"default\",1]\n:HL[\"/_next/static/media/7deddc85b7ffd1dc-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/ec14413c594b3356-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/88714c00e109ce28.css\",\"style\"]\n:HL[\"/_next/static/css/b368fb57ad4b2393.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/88714c00e109ce28.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/b368fb57ad4b2393.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"translate\":\"no\",\"className\":\"__variable_66b8ca notranslate\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"meta\",null,{\"name\":\"google\",\"content\":\"notranslate\"}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"(function(){try{var r=document.documentElement,m=localStorage.getItem(\\\"pi-theme\\\"),s=localStorage.getItem(\\\"pi-theme-style\\\");if(m!==\\\"light\\\"\u0026\u0026m!==\\\"dark\\\"\u0026\u0026m!==\\\"system\\\")m=\\\"light\\\";if(s!==\\\"fusion\\\"\u0026\u0026s!==\\\"chamber\\\")s=\\\"chamber\\\";var d=m===\\\"dark\\\"||(m===\\\"system\\\"\u0026\u0026matchMedia(\\\"(prefers-color-scheme: dark)\\\").matches);r.classList.toggle(\\\"dark\\\",d);r.dataset.themeMode=m;r.dataset.themeStyle=s}catch(e){}})();\"}}]]}],[\"$\",\"body\",null,{\"translate\":\"no\",\"className\":\"notranslate\",\"style\":{\"height\":\"100dvh\",\"display\":\"flex\",\"flexDirection\":\"column\"},\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,null]},null,false,\"$@8\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L9\",null,{\"children\":\"$La\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lb\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lc\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$d\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"bYQa7wtG5XvdiFs9n9TDR\"}\n"])</script><script>self.__next_f.push([1,"e:[]\n8:\"$We\"\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"f:I[86869,[],\"IconMark\"]\n7:null\nc:[[\"$\",\"title\",\"0\",{\"children\":\"Pidance\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Open-source web client for the Pi coding agent\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/brand/pidance-logo.png\"}],[\"$\",\"link\",\"3\",{\"rel\":\"apple-touch-icon\",\"href\":\"/brand/pidance-logo.png\"}],[\"$\",\"$Lf\",\"4\",{}]]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d2379fd13c5c78c6.js"/><script src="/_next/static/chunks/4bd1b696-e356ca5ba0218e27.js" async=""></script><script src="/_next/static/chunks/3794-907785a527d8128b.js" async=""></script><script src="/_next/static/chunks/main-app-06b2b50b226e40d1.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-d2379fd13c5c78c6.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[90484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[90484,[],\"ViewportBoundary\"]\na:I[90484,[],\"MetadataBoundary\"]\nc:I[27123,[],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{}]}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"
|
|
1
|
+
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d2379fd13c5c78c6.js"/><script src="/_next/static/chunks/4bd1b696-e356ca5ba0218e27.js" async=""></script><script src="/_next/static/chunks/3794-907785a527d8128b.js" async=""></script><script src="/_next/static/chunks/main-app-06b2b50b226e40d1.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-d2379fd13c5c78c6.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[90484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[90484,[],\"ViewportBoundary\"]\na:I[90484,[],\"MetadataBoundary\"]\nc:I[27123,[],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{}]}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"bYQa7wtG5XvdiFs9n9TDR\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"node":{},"edge":{},"encryptionKey":"
|
|
1
|
+
{"node":{},"edge":{},"encryptionKey":"Mk1ciTbF/4FWU1nengPHhrp3tv8XOhYia7c3PLw5Ljg="}
|