aicodeman 0.4.7 → 0.5.1
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/dist/bash-tool-parser.d.ts.map +1 -1
- package/dist/bash-tool-parser.js +11 -4
- package/dist/bash-tool-parser.js.map +1 -1
- package/dist/web/public/api-client.3adebdc2.js.gz +0 -0
- package/dist/web/public/app.916baeb9.js +26 -0
- package/dist/web/public/app.916baeb9.js.br +0 -0
- package/dist/web/public/app.916baeb9.js.gz +0 -0
- package/dist/web/public/constants.64161167.js.gz +0 -0
- package/dist/web/public/index.html +11 -11
- package/dist/web/public/index.html.br +0 -0
- package/dist/web/public/index.html.gz +0 -0
- package/dist/web/public/input-cjk.92544c51.js.gz +0 -0
- package/dist/web/public/keyboard-accessory.9fb81db6.js.gz +0 -0
- package/dist/web/public/mobile-handlers.1e2a8ef8.js.gz +0 -0
- package/dist/web/public/mobile.fdd28a54.css.gz +0 -0
- package/dist/web/public/notification-manager.2d5ea8ec.js.gz +0 -0
- package/dist/web/public/orchestrator-panel.js.gz +0 -0
- package/dist/web/public/{panels-ui.3dd2e29b.js → panels-ui.8204db1e.js} +2 -2
- package/dist/web/public/panels-ui.8204db1e.js.br +0 -0
- package/dist/web/public/panels-ui.8204db1e.js.gz +0 -0
- package/dist/web/public/{ralph-panel.7b014f16.js → ralph-panel.a2733fd5.js} +1 -1
- package/dist/web/public/ralph-panel.a2733fd5.js.br +0 -0
- package/dist/web/public/ralph-panel.a2733fd5.js.gz +0 -0
- package/dist/web/public/ralph-wizard.f31ab90e.js.gz +0 -0
- package/dist/web/public/respawn-ui.372c6ea7.js.gz +0 -0
- package/dist/web/public/session-ui.0a07c3b7.js.gz +0 -0
- package/dist/web/public/settings-ui.94c57184.js.gz +0 -0
- package/dist/web/public/styles.5c87d847.css +1 -0
- package/dist/web/public/styles.5c87d847.css.br +0 -0
- package/dist/web/public/styles.5c87d847.css.gz +0 -0
- package/dist/web/public/subagent-windows.a366a4ad.js.gz +0 -0
- package/dist/web/public/sw.js.gz +0 -0
- package/dist/web/public/terminal-ui.b66dbf4e.js +3 -0
- package/dist/web/public/terminal-ui.b66dbf4e.js.br +0 -0
- package/dist/web/public/terminal-ui.b66dbf4e.js.gz +0 -0
- package/dist/web/public/upload.html.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-zerolag-input.137ad9f0.js.gz +0 -0
- package/dist/web/public/vendor/xterm.css.gz +0 -0
- package/dist/web/public/vendor/xterm.min.js.gz +0 -0
- package/dist/web/public/voice-input.085e9e73.js.gz +0 -0
- package/dist/web/route-helpers.d.ts +11 -0
- package/dist/web/route-helpers.d.ts.map +1 -1
- package/dist/web/route-helpers.js +23 -0
- package/dist/web/route-helpers.js.map +1 -1
- package/dist/web/routes/case-routes.d.ts.map +1 -1
- package/dist/web/routes/case-routes.js +3 -11
- package/dist/web/routes/case-routes.js.map +1 -1
- package/dist/web/routes/hook-event-routes.d.ts.map +1 -1
- package/dist/web/routes/hook-event-routes.js +2 -6
- package/dist/web/routes/hook-event-routes.js.map +1 -1
- package/dist/web/routes/orchestrator-routes.d.ts.map +1 -1
- package/dist/web/routes/orchestrator-routes.js +4 -10
- package/dist/web/routes/orchestrator-routes.js.map +1 -1
- package/dist/web/routes/plan-routes.d.ts.map +1 -1
- package/dist/web/routes/plan-routes.js +6 -26
- package/dist/web/routes/plan-routes.js.map +1 -1
- package/dist/web/routes/push-routes.d.ts.map +1 -1
- package/dist/web/routes/push-routes.js +4 -10
- package/dist/web/routes/push-routes.js.map +1 -1
- package/dist/web/routes/ralph-routes.d.ts.map +1 -1
- package/dist/web/routes/ralph-routes.js +13 -53
- package/dist/web/routes/ralph-routes.js.map +1 -1
- package/dist/web/routes/respawn-routes.d.ts.map +1 -1
- package/dist/web/routes/respawn-routes.js +3 -11
- package/dist/web/routes/respawn-routes.js.map +1 -1
- package/dist/web/routes/scheduled-routes.d.ts.map +1 -1
- package/dist/web/routes/scheduled-routes.js +2 -5
- package/dist/web/routes/scheduled-routes.js.map +1 -1
- package/dist/web/routes/session-routes.d.ts.map +1 -1
- package/dist/web/routes/session-routes.js +113 -169
- package/dist/web/routes/session-routes.js.map +1 -1
- package/dist/web/routes/system-routes.d.ts.map +1 -1
- package/dist/web/routes/system-routes.js +8 -31
- package/dist/web/routes/system-routes.js.map +1 -1
- package/package.json +1 -1
- package/dist/web/public/app.cbf6e9e8.js +0 -26
- package/dist/web/public/app.cbf6e9e8.js.br +0 -0
- package/dist/web/public/app.cbf6e9e8.js.gz +0 -0
- package/dist/web/public/panels-ui.3dd2e29b.js.br +0 -0
- package/dist/web/public/panels-ui.3dd2e29b.js.gz +0 -0
- package/dist/web/public/ralph-panel.7b014f16.js.br +0 -0
- package/dist/web/public/ralph-panel.7b014f16.js.gz +0 -0
- package/dist/web/public/styles.8e110d27.css +0 -1
- package/dist/web/public/styles.8e110d27.css.br +0 -0
- package/dist/web/public/styles.8e110d27.css.gz +0 -0
- package/dist/web/public/terminal-ui.9b40798a.js +0 -3
- package/dist/web/public/terminal-ui.9b40798a.js.br +0 -0
- package/dist/web/public/terminal-ui.9b40798a.js.gz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash-tool-parser.d.ts","sourceRoot":"","sources":["../src/bash-tool-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAkF5C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,SAAS,EAAE,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAClC,0BAA0B;IAC1B,OAAO,EAAE,CAAC,IAAI,EAAE,cAAc,CAAC,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AI;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE;IAYxD;;OAEG;IACH,MAAM,IAAI,IAAI;IAId;;OAEG;IACH,OAAO,IAAI,IAAI;IAIf;;OAEG;IACH,KAAK,IAAI,IAAI;IAOb;;;;;OAKG;IACH,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAwBvC;;;OAGG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAqBpC;;OAEG;IACH,OAAO,CAAC,WAAW;IAKnB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAyJxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAc3B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAgCxB;;OAEG;IACH,OAAO,CAAC,cAAc;IAMtB;;OAEG;IACH,OAAO,CAAC,UAAU;IAIlB;;OAEG;IACH,OAAO,IAAI,IAAI;CAOhB"}
|
package/dist/bash-tool-parser.js
CHANGED
|
@@ -409,10 +409,17 @@ export class BashToolParser extends EventEmitter {
|
|
|
409
409
|
};
|
|
410
410
|
// Enforce max tools limit
|
|
411
411
|
if (this._activeTools.size >= MAX_ACTIVE_TOOLS) {
|
|
412
|
-
// Remove oldest tool
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
412
|
+
// Remove oldest tool (O(n) min-scan instead of O(n log n) sort)
|
|
413
|
+
let oldestKey;
|
|
414
|
+
let oldestTime = Infinity;
|
|
415
|
+
for (const [key, entry] of this._activeTools) {
|
|
416
|
+
if (entry.startedAt < oldestTime) {
|
|
417
|
+
oldestTime = entry.startedAt;
|
|
418
|
+
oldestKey = key;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
if (oldestKey) {
|
|
422
|
+
this._activeTools.delete(oldestKey);
|
|
416
423
|
}
|
|
417
424
|
}
|
|
418
425
|
this._activeTools.set(tool.id, tool);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,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
|
+
"use strict";const _crashDiag={_entries:[],_maxEntries:50,log(l){const e=`${new Date().toISOString().slice(11,23)} ${l}`;this._entries.push(e),this._entries.length>this._maxEntries&&this._entries.shift();try{localStorage.setItem("codeman-crash-diag",this._entries.join(`
|
|
2
|
+
`))}catch{}}};try{const l=localStorage.getItem("codeman-crash-diag");l&&console.log(`[CRASH-DIAG] Previous session breadcrumbs:
|
|
3
|
+
`+l)}catch{}if(_crashDiag.log("PAGE LOAD"),setInterval(()=>{try{localStorage.setItem("codeman-crash-heartbeat",String(Date.now())),_crashDiag._entries.length>0&&navigator.sendBeacon("/api/crash-diag",JSON.stringify({data:_crashDiag._entries.join(`
|
|
4
|
+
`)}))}catch{}},2e3),window.addEventListener("error",l=>{_crashDiag.log(`ERROR: ${l.message} at ${l.filename}:${l.lineno}`),console.error("[CRASH-DIAG] Uncaught error:",l.message,`
|
|
5
|
+
File:`,l.filename,":",l.lineno,":",l.colno,`
|
|
6
|
+
Stack:`,l.error?.stack)}),window.addEventListener("unhandledrejection",l=>{_crashDiag.log(`UNHANDLED: ${l.reason?.message||l.reason}`),console.error("[CRASH-DIAG] Unhandled promise rejection:",l.reason?.message||l.reason,`
|
|
7
|
+
Stack:`,l.reason?.stack)}),typeof PerformanceObserver<"u")try{new PerformanceObserver(e=>{for(const t of e.getEntries())t.duration>200&&(_crashDiag.log(`LONG_TASK: ${t.duration.toFixed(0)}ms`),console.warn(`[CRASH-DIAG] Long task: ${t.duration.toFixed(0)}ms (type: ${t.entryType}, name: ${t.name})`))}).observe({type:"longtask",buffered:!0})}catch{}const _origGetContext=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(l,...e){const t=_origGetContext.call(this,l,...e);return(l==="webgl2"||l==="webgl")&&(this.addEventListener("webglcontextlost",s=>{_crashDiag.log(`WEBGL_LOST: ${this.width}x${this.height}`),console.error("[CRASH-DIAG] WebGL context LOST on canvas",this.width,"x",this.height,"\u2014 prevented:",s.defaultPrevented)}),this.addEventListener("webglcontextrestored",()=>{_crashDiag.log("WEBGL_RESTORED"),console.warn("[CRASH-DIAG] WebGL context restored")})),t};const _SSE_HANDLER_MAP=[[SSE_EVENTS.INIT,"_onInit"],[SSE_EVENTS.SESSION_CREATED,"_onSessionCreated"],[SSE_EVENTS.SESSION_UPDATED,"_onSessionUpdated"],[SSE_EVENTS.SESSION_DELETED,"_onSessionDeleted"],[SSE_EVENTS.SESSION_TERMINAL,"_onSSETerminal"],[SSE_EVENTS.SESSION_NEEDS_REFRESH,"_onSSENeedsRefresh"],[SSE_EVENTS.SESSION_CLEAR_TERMINAL,"_onSSEClearTerminal"],[SSE_EVENTS.SESSION_COMPLETION,"_onSessionCompletion"],[SSE_EVENTS.SESSION_ERROR,"_onSessionError"],[SSE_EVENTS.SESSION_EXIT,"_onSessionExit"],[SSE_EVENTS.SESSION_IDLE,"_onSessionIdle"],[SSE_EVENTS.SESSION_WORKING,"_onSessionWorking"],[SSE_EVENTS.SESSION_AUTO_CLEAR,"_onSessionAutoClear"],[SSE_EVENTS.SESSION_CLI_INFO,"_onSessionCliInfo"],[SSE_EVENTS.SCHEDULED_CREATED,"_onScheduledCreated"],[SSE_EVENTS.SCHEDULED_UPDATED,"_onScheduledUpdated"],[SSE_EVENTS.SCHEDULED_COMPLETED,"_onScheduledCompleted"],[SSE_EVENTS.SCHEDULED_STOPPED,"_onScheduledStopped"],[SSE_EVENTS.RESPAWN_STARTED,"_onRespawnStarted"],[SSE_EVENTS.RESPAWN_STOPPED,"_onRespawnStopped"],[SSE_EVENTS.RESPAWN_STATE_CHANGED,"_onRespawnStateChanged"],[SSE_EVENTS.RESPAWN_CYCLE_STARTED,"_onRespawnCycleStarted"],[SSE_EVENTS.RESPAWN_BLOCKED,"_onRespawnBlocked"],[SSE_EVENTS.RESPAWN_AUTO_ACCEPT_SENT,"_onRespawnAutoAcceptSent"],[SSE_EVENTS.RESPAWN_DETECTION_UPDATE,"_onRespawnDetectionUpdate"],[SSE_EVENTS.RESPAWN_TIMER_STARTED,"_onRespawnTimerStarted"],[SSE_EVENTS.RESPAWN_TIMER_CANCELLED,"_onRespawnTimerCancelled"],[SSE_EVENTS.RESPAWN_TIMER_COMPLETED,"_onRespawnTimerCompleted"],[SSE_EVENTS.RESPAWN_ERROR,"_onRespawnError"],[SSE_EVENTS.RESPAWN_ACTION_LOG,"_onRespawnActionLog"],[SSE_EVENTS.TASK_CREATED,"_onTaskCreated"],[SSE_EVENTS.TASK_COMPLETED,"_onTaskCompleted"],[SSE_EVENTS.TASK_FAILED,"_onTaskFailed"],[SSE_EVENTS.TASK_UPDATED,"_onTaskUpdated"],[SSE_EVENTS.MUX_CREATED,"_onMuxCreated"],[SSE_EVENTS.MUX_KILLED,"_onMuxKilled"],[SSE_EVENTS.MUX_DIED,"_onMuxDied"],[SSE_EVENTS.MUX_STATS_UPDATED,"_onMuxStatsUpdated"],[SSE_EVENTS.SESSION_RALPH_LOOP_UPDATE,"_onRalphLoopUpdate"],[SSE_EVENTS.SESSION_RALPH_TODO_UPDATE,"_onRalphTodoUpdate"],[SSE_EVENTS.SESSION_RALPH_COMPLETION_DETECTED,"_onRalphCompletionDetected"],[SSE_EVENTS.SESSION_RALPH_STATUS_UPDATE,"_onRalphStatusUpdate"],[SSE_EVENTS.SESSION_CIRCUIT_BREAKER_UPDATE,"_onCircuitBreakerUpdate"],[SSE_EVENTS.SESSION_EXIT_GATE_MET,"_onExitGateMet"],[SSE_EVENTS.SESSION_BASH_TOOL_START,"_onBashToolStart"],[SSE_EVENTS.SESSION_BASH_TOOL_END,"_onBashToolEnd"],[SSE_EVENTS.SESSION_BASH_TOOLS_UPDATE,"_onBashToolsUpdate"],[SSE_EVENTS.HOOK_IDLE_PROMPT,"_onHookIdlePrompt"],[SSE_EVENTS.HOOK_PERMISSION_PROMPT,"_onHookPermissionPrompt"],[SSE_EVENTS.HOOK_ELICITATION_DIALOG,"_onHookElicitationDialog"],[SSE_EVENTS.HOOK_STOP,"_onHookStop"],[SSE_EVENTS.HOOK_TEAMMATE_IDLE,"_onHookTeammateIdle"],[SSE_EVENTS.HOOK_TASK_COMPLETED,"_onHookTaskCompleted"],[SSE_EVENTS.SUBAGENT_DISCOVERED,"_onSubagentDiscovered"],[SSE_EVENTS.SUBAGENT_UPDATED,"_onSubagentUpdated"],[SSE_EVENTS.SUBAGENT_TOOL_CALL,"_onSubagentToolCall"],[SSE_EVENTS.SUBAGENT_PROGRESS,"_onSubagentProgress"],[SSE_EVENTS.SUBAGENT_MESSAGE,"_onSubagentMessage"],[SSE_EVENTS.SUBAGENT_TOOL_RESULT,"_onSubagentToolResult"],[SSE_EVENTS.SUBAGENT_COMPLETED,"_onSubagentCompleted"],[SSE_EVENTS.IMAGE_DETECTED,"_onImageDetected"],[SSE_EVENTS.TUNNEL_STARTED,"_onTunnelStarted"],[SSE_EVENTS.TUNNEL_STOPPED,"_onTunnelStopped"],[SSE_EVENTS.TUNNEL_PROGRESS,"_onTunnelProgress"],[SSE_EVENTS.TUNNEL_ERROR,"_onTunnelError"],[SSE_EVENTS.TUNNEL_QR_ROTATED,"_onTunnelQrRotated"],[SSE_EVENTS.TUNNEL_QR_REGENERATED,"_onTunnelQrRegenerated"],[SSE_EVENTS.TUNNEL_QR_AUTH_USED,"_onTunnelQrAuthUsed"],[SSE_EVENTS.PLAN_SUBAGENT,"_onPlanSubagent"],[SSE_EVENTS.PLAN_PROGRESS,"_onPlanProgress"],[SSE_EVENTS.PLAN_STARTED,"_onPlanStarted"],[SSE_EVENTS.PLAN_CANCELLED,"_onPlanCancelled"],[SSE_EVENTS.PLAN_COMPLETED,"_onPlanCompleted"],[SSE_EVENTS.ORCHESTRATOR_STATE_CHANGED,"_onOrchestratorStateChanged"],[SSE_EVENTS.ORCHESTRATOR_PLAN_PROGRESS,"_onOrchestratorPlanProgress"],[SSE_EVENTS.ORCHESTRATOR_PLAN_READY,"_onOrchestratorPlanReady"],[SSE_EVENTS.ORCHESTRATOR_PHASE_STARTED,"_onOrchestratorPhaseStarted"],[SSE_EVENTS.ORCHESTRATOR_PHASE_COMPLETED,"_onOrchestratorPhaseCompleted"],[SSE_EVENTS.ORCHESTRATOR_PHASE_FAILED,"_onOrchestratorPhaseFailed"],[SSE_EVENTS.ORCHESTRATOR_VERIFICATION,"_onOrchestratorVerification"],[SSE_EVENTS.ORCHESTRATOR_TASK_ASSIGNED,"_onOrchestratorTaskAssigned"],[SSE_EVENTS.ORCHESTRATOR_TASK_COMPLETED,"_onOrchestratorTaskCompleted"],[SSE_EVENTS.ORCHESTRATOR_TASK_FAILED,"_onOrchestratorTaskFailed"],[SSE_EVENTS.ORCHESTRATOR_COMPLETED,"_onOrchestratorCompleted"],[SSE_EVENTS.ORCHESTRATOR_ERROR,"_onOrchestratorError"]];class CodemanApp{constructor(){this.sessions=new Map,this._shortIdCache=new Map,this.sessionOrder=[],this.draggedTabId=null,this.cases=[],this.currentRun=null,this.totalTokens=0,this.globalStats=null,this.eventSource=null,this.terminal=null,this.fitAddon=null,this.activeSessionId=null,this._initGeneration=0,this._initFallbackTimer=null,this._selectGeneration=0,this.respawnStatus={},this.respawnTimers={},this.respawnCountdownTimers={},this.respawnActionLogs={},this.timerCountdownInterval=null,this.terminalBuffers=new Map,this.editingSessionId=null,this.pendingCloseSessionId=null,this.muxSessions=[],this.ralphStates=new Map,this.subagents=new Map,this.subagentActivity=new Map,this.subagentToolResults=new Map,this.activeSubagentId=null,this.subagentPanelVisible=!1,this.subagentWindows=new Map,this.subagentWindowZIndex=ZINDEX_SUBAGENT_BASE,this.minimizedSubagents=new Map,this._subagentHideTimeout=null,this.subagentParentMap=new Map,this.teams=new Map,this.teamTasks=new Map,this.teammateMap=new Map,this.teammatePanesByName=new Map,this.teammateTerminals=new Map,this.terminalBufferCache=new Map,this.ralphStatePanelCollapsed=!0,this.ralphClosedSessions=new Set,this.planSubagents=new Map,this.planSubagentWindowZIndex=ZINDEX_PLAN_SUBAGENT_BASE,this.planGenerationStopped=!1,this.planAgentsMinimized=!1,this.wizardDragState=null,this.wizardDragListeners=null,this.wizardPosition=null,this.projectInsights=new Map,this.logViewerWindows=new Map,this.logViewerWindowZIndex=ZINDEX_LOG_VIEWER_BASE,this.projectInsightsPanelVisible=!1,this.orchestratorState=null,this.orchestratorPanelVisible=!1,this.currentSessionWorkingDir=null,this.imagePopups=new Map,this.imagePopupZIndex=ZINDEX_IMAGE_POPUP_BASE,this.fileBrowserData=null,this.fileBrowserExpandedDirs=new Set,this.fileBrowserFilter="",this.fileBrowserAllExpanded=!1,this.fileBrowserDragListeners=null,this.filePreviewContent="",this._toastContainer=null,this._tunnelUrl=null,this.tabAlerts=new Map,this.pendingHooks=new Map,this._ws=null,this._wsSessionId=null,this._wsReady=!1,this.pendingWrites=[],this.writeFrameScheduled=!1,this._wasAtBottomBeforeWrite=!0,this.syncWaitTimeout=null,this._isLoadingBuffer=!1,this._loadBufferQueue=null,this.flickerFilterBuffer="",this.flickerFilterActive=!1,this.flickerFilterTimeout=null,this._debounceTimers=Object.create(null),this.systemStatsInterval=null,this.sseReconnectTimeout=null,this._sseListenerCleanup=null,this.reconnectAttempts=0,this.maxReconnectAttempts=10,this.isOnline=navigator.onLine,this._inputQueue=new Map,this._inputQueueMaxBytes=64*1024,this._connectionStatus="connected",this._inputSendChain=Promise.resolve(),this._localEchoOverlay=null,this._localEchoEnabled=!1,this._restoringFlushedState=!1,this.activeFocusTrap=null,this.notificationManager=new NotificationManager(this),this.idleTimers=new Map,this._elemCache={},this.init()}$(e){return this._elemCache[e]||(this._elemCache[e]=document.getElementById(e)),this._elemCache[e]}formatTokens(e){if(e>=1e6){const t=e/1e6;return t>=10?`${t.toFixed(1)}m`:`${t.toFixed(2)}m`}else if(e>=1e3){const t=e/1e3;return t>=100?`${t.toFixed(0)}k`:`${t.toFixed(1)}k`}return String(e)}estimateCost(e,t){const s=e/1e6*15,i=t/1e6*75;return s+i}setPendingHook(e,t){this.pendingHooks.has(e)||this.pendingHooks.set(e,new Set),this.pendingHooks.get(e).add(t),this.updateTabAlertFromHooks(e)}clearPendingHooks(e,t=null){const s=this.pendingHooks.get(e);s&&(t?s.delete(t):s.clear(),s.size===0&&this.pendingHooks.delete(e),this.updateTabAlertFromHooks(e))}updateTabAlertFromHooks(e){const t=this.pendingHooks.get(e);!t||t.size===0?this.tabAlerts.delete(e):t.has("permission_prompt")||t.has("elicitation_dialog")?this.tabAlerts.set(e,"action"):t.has("idle_prompt")&&this.tabAlerts.set(e,"idle"),this.renderSessionTabs()}init(){MobileDetection.init(),KeyboardHandler.init(),SwipeHandler.init(),VoiceInput.init(),KeyboardAccessoryBar.init(),this.applyHeaderVisibilitySettings(),this.applyTabWrapSettings(),this.applyMonitorVisibility(),document.documentElement.classList.remove("mobile-init"),requestAnimationFrame(()=>{this.initTerminal(),this.loadFontSize(),this.connectSSE(),this._initFallbackTimer=setTimeout(()=>{this._initGeneration===0&&this.loadState()},3e3)}),this.registerServiceWorker(),this.loadTunnelStatus();const e=fetch("/api/settings").then(t=>t.ok?t.json():null).catch(()=>null);if(this.loadQuickStartCases(null,e),this._initRunMode(),this.setupEventListeners(),MobileDetection.isTouchDevice()){const t=s=>{s&&s.addEventListener("touchstart",i=>{if(!KeyboardHandler.keyboardVisible)return;const a=i.target.closest("button");a&&(i.preventDefault(),a.click(),typeof app<"u"&&app.terminal&&app.terminal.focus())},{passive:!1})};t(document.querySelector(".toolbar")),t(document.querySelector(".welcome-overlay"))}this.setupOnlineDetection(),this.loadAppSettingsFromServer(e).then(()=>{this.applyHeaderVisibilitySettings(),this.applyTabWrapSettings(),this.applyMonitorVisibility()}),document.body.classList.add("app-loaded")}_initWebGL(){if(!(typeof WebglAddon>"u"))try{this._webglAddon=new WebglAddon.WebglAddon,this._webglAddon.onContextLoss(()=>{console.error("[CRASH-DIAG] WebGL context LOST \u2014 falling back to canvas renderer"),this._webglAddon.dispose(),this._webglAddon=null}),this.terminal.loadAddon(this._webglAddon),console.log("[CRASH-DIAG] WebGL renderer enabled")}catch{}}setupEventListeners(){document.addEventListener("keydown",t=>{t.isComposing||t.keyCode===229||(t.key==="Escape"&&(this.closeAllPanels(),this.closeHelp()),(t.ctrlKey||t.metaKey)&&(t.key==="?"||t.key==="/")&&(t.preventDefault(),this.showHelp()),(t.ctrlKey||t.metaKey)&&t.key==="Enter"&&(t.preventDefault(),this.quickStart()),(t.ctrlKey||t.metaKey)&&t.key==="w"&&(t.preventDefault(),this.killActiveSession()),(t.ctrlKey||t.metaKey)&&t.key==="Tab"&&(t.preventDefault(),this.nextSession()),(t.ctrlKey||t.metaKey)&&t.key==="k"&&(t.preventDefault(),this.killAllSessions()),(t.ctrlKey||t.metaKey)&&t.key==="l"&&(t.preventDefault(),this.clearTerminal()),(t.ctrlKey||t.metaKey)&&t.shiftKey&&t.key==="R"&&(t.preventDefault(),this.restoreTerminalSize()),(t.ctrlKey||t.metaKey)&&(t.key==="="||t.key==="+")&&(t.preventDefault(),this.increaseFontSize()),(t.ctrlKey||t.metaKey)&&t.key==="-"&&(t.preventDefault(),this.decreaseFontSize()),(t.ctrlKey||t.metaKey)&&t.shiftKey&&t.key==="V"&&(t.preventDefault(),VoiceInput.toggle()))},!0);const e=this.$("headerTokens");e&&!e._statsHandlerAttached&&(e.classList.add("clickable"),e._statsHandlerAttached=!0,e.addEventListener("click",()=>this.openTokenStats())),this.setupColorPicker()}connectSSE(){if(!navigator.onLine){this.setConnectionStatus("offline");return}this.sseReconnectTimeout&&(clearTimeout(this.sseReconnectTimeout),this.sseReconnectTimeout=null),this._sseListenerCleanup&&(this._sseListenerCleanup(),this._sseListenerCleanup=null),this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.reconnectAttempts===0?this.setConnectionStatus("connecting"):this.setConnectionStatus("reconnecting"),this.eventSource=new EventSource("/api/events");const e=[],t=(s,i)=>{this.eventSource.addEventListener(s,i),e.push({event:s,handler:i})};if(this._sseListenerCleanup=()=>{for(const{event:s,handler:i}of e)this.eventSource&&this.eventSource.removeEventListener(s,i);e.length=0},this.eventSource.onopen=()=>{this.reconnectAttempts=0,this.setConnectionStatus("connected")},this.eventSource.onerror=()=>{this.reconnectAttempts++,this.reconnectAttempts>=this.maxReconnectAttempts?this.setConnectionStatus("disconnected"):this.setConnectionStatus("reconnecting"),this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.sseReconnectTimeout&&clearTimeout(this.sseReconnectTimeout);const s=this.reconnectAttempts<=1?200:Math.min(500*Math.pow(2,this.reconnectAttempts-2),3e4);this.sseReconnectTimeout=setTimeout(()=>this.connectSSE(),s)},!this._sseHandlerWrappers){this._sseHandlerWrappers=new Map;for(const[s,i]of _SSE_HANDLER_MAP){const a=this[i];this._sseHandlerWrappers.set(s,n=>{try{a.call(this,n.data?JSON.parse(n.data):{})}catch(r){console.error(`[SSE] Error handling ${s}:`,r)}})}}for(const[s]of _SSE_HANDLER_MAP)t(s,this._sseHandlerWrappers.get(s))}_onInit(e){_crashDiag.log(`INIT: ${e.sessions?.length||0} sessions`),this.handleInit(e)}_onSessionCreated(e){this.sessions.set(e.id,e),this.sessionOrder.includes(e.id)||(this.sessionOrder.push(e.id),this.saveSessionOrder()),this.renderSessionTabs(),this.updateCost(),this.sessions.size===1&&this.startSystemStatsPolling()}_onSessionUpdated(e){const t=e.session||e,s=this.sessions.get(t.id),i=t.claudeSessionId&&(!s||!s.claudeSessionId);this.sessions.set(t.id,t),this.renderSessionTabs(),this.updateCost(),t.id===this.activeSessionId&&t.tokens&&this.updateRespawnTokens(t.tokens),this.updateSubagentParentNames(t.id),i&&(this.recheckOrphanSubagents(),requestAnimationFrame(()=>{this.updateConnectionLines()}))}_onSessionDeleted(e){if(this._wsSessionId===e.id&&this._disconnectWs(),this._cleanupSessionData(e.id),this.activeSessionId===e.id){this.activeSessionId=null;try{localStorage.removeItem("codeman-active-session")}catch{}this.terminal.clear(),this.showWelcome()}this.renderSessionTabs(),this.renderRalphStatePanel(),this.renderProjectInsightsPanel(),this.sessions.size===0&&this.stopSystemStatsPolling()}_onSSETerminal(e){this._wsReady&&this._wsSessionId===e.id||this._onSessionTerminal(e)}_onSSENeedsRefresh(e){this._wsReady&&this._wsSessionId===e?.id||this._onSessionNeedsRefresh(e)}_onSSEClearTerminal(e){this._wsReady&&this._wsSessionId===e?.id||this._onSessionClearTerminal(e)}_onSessionTerminal(e){if(e.id===this.activeSessionId){if(e.data.length>32768&&_crashDiag.log(`TERMINAL: ${(e.data.length/1024).toFixed(0)}KB`),(this.pendingWrites?.reduce((s,i)=>s+i.length,0)||0)+(this.flickerFilterBuffer?.length||0)>131072){this._clientDropRecoveryTimer||(this._clientDropRecoveryTimer=setTimeout(()=>{this._clientDropRecoveryTimer=null,this._onSessionNeedsRefresh()},2e3));return}this.batchTerminalWrite(e.data)}}async _onSessionNeedsRefresh(){if(!(!this.activeSessionId||!this.terminal))try{const t=await(await fetch(`/api/sessions/${this.activeSessionId}/terminal?tail=${TERMINAL_TAIL_SIZE}`)).json();t.terminalBuffer&&(this.terminal.clear(),this.terminal.reset(),await this.chunkedTerminalWrite(t.terminalBuffer),this.terminal.scrollToBottom(),this._localEchoOverlay?.rerender(),this.activeSessionId&&this.sendResize(this.activeSessionId))}catch(e){console.error("needsRefresh reload failed:",e)}}async _onSessionClearTerminal(e){if(e.id===this.activeSessionId)try{const s=await(await fetch(`/api/sessions/${e.id}/terminal`)).json();if(this.terminal.clear(),this.terminal.reset(),s.terminalBuffer){const i=s.terminalBuffer.replace(DEC_SYNC_STRIP_RE,"");await this.chunkedTerminalWrite(i)}this.sendResize(e.id),this._localEchoOverlay?.rerender()}catch(t){console.error("clearTerminal refresh failed:",t)}}_onSessionCompletion(e){this.totalCost+=e.cost||0,this.updateCost(),e.id===this.activeSessionId&&(this.terminal.writeln(""),this.terminal.writeln(`\x1B[1;32m Done (Cost: $${(e.cost||0).toFixed(4)})\x1B[0m`))}_onSessionError(e){e.id===this.activeSessionId&&this.terminal.writeln(`\x1B[1;31m Error: ${e.error}\x1B[0m`);const t=this.sessions.get(e.id);this.notificationManager?.notify({urgency:"critical",category:"session-error",sessionId:e.id,sessionName:t?.name||this.getShortId(e.id),title:"Session Error",message:e.error||"Unknown error"})}_onSessionExit(e){this._wsSessionId===e.id&&this._disconnectWs();const t=this.sessions.get(e.id);t&&(t.status="stopped",this.renderSessionTabs(),e.id===this.activeSessionId&&this._updateLocalEchoState()),e.code&&e.code!==0&&this.notificationManager?.notify({urgency:"critical",category:"session-crash",sessionId:e.id,sessionName:t?.name||this.getShortId(e.id),title:"Session Crashed",message:`Exited with code ${e.code}`})}_onSessionIdle(e){const t=this.sessions.get(e.id);if(t&&(t.status="idle",this.renderSessionTabs(),this.sendPendingCtrlL(e.id),e.id===this.activeSessionId&&this._updateLocalEchoState()),!this.respawnStatus[e.id]?.enabled){const s=this.notificationManager?.preferences?.stuckThresholdMs||6e5;clearTimeout(this.idleTimers.get(e.id)),this.idleTimers.set(e.id,setTimeout(()=>{const i=this.sessions.get(e.id);this.notificationManager?.notify({urgency:"warning",category:"session-stuck",sessionId:e.id,sessionName:i?.name||this.getShortId(e.id),title:"Session Idle",message:`Idle for ${Math.round(s/6e4)}+ minutes`}),this.idleTimers.delete(e.id)},s))}}_onSessionWorking(e){const t=this.sessions.get(e.id);t&&(t.status="busy",this.pendingHooks.has(e.id)||this.tabAlerts.delete(e.id),this.renderSessionTabs(),this.sendPendingCtrlL(e.id),e.id===this.activeSessionId&&this._updateLocalEchoState());const s=this.idleTimers.get(e.id);s&&(clearTimeout(s),this.idleTimers.delete(e.id))}_onSessionAutoClear(e){e.sessionId===this.activeSessionId&&(this.showToast(`Auto-cleared at ${e.tokens.toLocaleString()} tokens`,"info"),this.updateRespawnTokens(0));const t=this.sessions.get(e.sessionId);this.notificationManager?.notify({urgency:"info",category:"auto-clear",sessionId:e.sessionId,sessionName:t?.name||this.getShortId(e.sessionId),title:"Auto-Cleared",message:`Context reset at ${(e.tokens||0).toLocaleString()} tokens`})}_onSessionCliInfo(e){const t=this.sessions.get(e.sessionId);t&&(e.version&&(t.cliVersion=e.version),e.model&&(t.cliModel=e.model),e.accountType&&(t.cliAccountType=e.accountType),e.latestVersion&&(t.cliLatestVersion=e.latestVersion)),e.sessionId===this.activeSessionId&&this.updateCliInfoDisplay()}_onScheduledCreated(e){this.currentRun=e,this.showTimer()}_onScheduledUpdated(e){this.currentRun=e,this.updateTimer()}_onScheduledCompleted(e){this.currentRun=e,this.hideTimer(),this.showToast("Scheduled run completed!","success")}_onScheduledStopped(){this.currentRun=null,this.hideTimer()}setConnectionStatus(e){this._connectionStatus=e,this._updateConnectionIndicator(),e==="connected"&&this._inputQueue.size>0&&this._drainInputQueues()}_connectWs(e){this._disconnectWs();const s=`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/ws/sessions/${e}/terminal`,i=new WebSocket(s);this._ws=i,this._wsSessionId=e,i.onopen=()=>{this._ws===i&&(this._wsReady=!0,this._wsReconnectAttempts=0)},i.onmessage=a=>{if(this._ws===i)try{const n=JSON.parse(a.data);n.t==="o"?this._onSessionTerminal({id:e,data:n.d}):n.t==="c"?this._onSessionClearTerminal({id:e}):n.t==="r"&&this._onSessionNeedsRefresh({id:e})}catch{}},i.onclose=a=>{if(this._ws===i&&(this._ws=null,this._wsSessionId=null,this._wsReady=!1,a.code<4004&&this.activeSessionId===e)){const n=Math.min(1e3*Math.pow(2,this._wsReconnectAttempts||0),1e4);this._wsReconnectAttempts=(this._wsReconnectAttempts||0)+1,this._wsReconnectTimer=setTimeout(()=>{this._wsReconnectTimer=null,this.activeSessionId===e&&this._connectWs(e)},n)}},i.onerror=()=>{}}_disconnectWs(){this._wsReconnectTimer&&(clearTimeout(this._wsReconnectTimer),this._wsReconnectTimer=null),this._wsReconnectAttempts=0,this._ws&&(this._ws.onclose=null,this._ws.close(),this._ws=null,this._wsSessionId=null,this._wsReady=!1)}_sendInputAsync(e,t){if(!this.isOnline||this._connectionStatus==="disconnected"){this._enqueueInput(e,t);return}if(this._wsReady&&this._wsSessionId===e)try{this._ws.send(JSON.stringify({t:"i",d:t})),this.clearPendingHooks(e);return}catch{}this._inputSendChain=this._inputSendChain.then(()=>{fetch(`/api/sessions/${e}/input`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:t}),keepalive:t.length<65536}).then(i=>{i.ok?this.clearPendingHooks(e):this._enqueueInput(e,t)}).catch(()=>{this._enqueueInput(e,t)})})}_enqueueInput(e,t){let i=(this._inputQueue.get(e)||"")+t;i.length>this._inputQueueMaxBytes&&(i=i.slice(i.length-this._inputQueueMaxBytes)),this._inputQueue.set(e,i),this._updateConnectionIndicator()}async _drainInputQueues(){if(this._inputQueue.size===0)return;const e=new Map(this._inputQueue);this._inputQueue.clear(),this._updateConnectionIndicator();for(const[t,s]of e)(await this._apiPost(`/api/sessions/${t}/input`,{input:s}))?.ok||this._enqueueInput(t,s);this._updateConnectionIndicator()}_updateConnectionIndicator(){const e=this.$("connectionIndicator"),t=this.$("connectionDot"),s=this.$("connectionText");if(!e||!t||!s)return;let i=0;for(const o of this._inputQueue.values())i+=o.length;const a=this._connectionStatus,n=i>0;if((a==="connected"||a==="connecting")&&!n){e.style.display="none";return}e.style.display="flex",t.className="connection-dot";const r=o=>o<1024?`${o}B`:`${(o/1024).toFixed(1)}KB`;a==="connected"&&n?(t.classList.add("draining"),s.textContent=`Sending ${r(i)}...`):a==="reconnecting"?(t.classList.add("reconnecting"),s.textContent=n?`Reconnecting (${r(i)} queued)`:"Reconnecting..."):(t.classList.add("offline"),s.textContent=n?`Offline (${r(i)} queued)`:"Offline")}setupOnlineDetection(){window.addEventListener("online",()=>{this.isOnline=!0,this.reconnectAttempts=0,this.connectSSE()}),window.addEventListener("offline",()=>{this.isOnline=!1,this.setConnectionStatus("offline")})}handleInit(e){this._initFallbackTimer&&(clearTimeout(this._initFallbackTimer),this._initFallbackTimer=null);const t=++this._initGeneration,s=document.getElementById("cjkInput");if(s&&(s.style.display=e.inputCjkForm?"block":"none",e.inputCjkForm||(window.cjkActive=!1)),e.version){const n=this.$("versionDisplay"),r=this.$("headerVersion");n&&(n.textContent=`v${e.version}`,n.title=`Codeman v${e.version}`),r&&(r.textContent=`v${e.version}`,r.title=`Codeman v${e.version}`)}VoiceInput.cleanup(),this.sessions.clear(),this.ralphStates.clear(),this.terminalBuffers.clear(),this.terminalBufferCache.clear(),this.projectInsights.clear(),this.teams.clear(),this.teamTasks.clear();for(const n of this.idleTimers.values())clearTimeout(n);if(this.idleTimers.clear(),this.flickerFilterTimeout&&(clearTimeout(this.flickerFilterTimeout),this.flickerFilterTimeout=null),this.flickerFilterBuffer="",this.flickerFilterActive=!1,this.syncWaitTimeout&&(clearTimeout(this.syncWaitTimeout),this.syncWaitTimeout=null),this.pendingWrites=[],this.writeFrameScheduled=!1,this._isLoadingBuffer=!1,this._loadBufferQueue=null,this._chunkedWriteGen=(this._chunkedWriteGen||0)+1,this._localEchoOverlay?.rerender(),this.pendingHooks.clear(),this._parentNameCache&&this._parentNameCache.clear(),this.subagentActivity.clear(),this.subagentToolResults.clear(),MobileDetection.cleanup(),KeyboardHandler.cleanup(),MobileDetection.init(),KeyboardHandler.init(),this.tabAlerts.clear(),this._shownCompletions&&this._shownCompletions.clear(),this.notificationManager?.titleFlashInterval&&(clearInterval(this.notificationManager.titleFlashInterval),this.notificationManager.titleFlashInterval=null),this.notificationManager?.groupingMap){for(const{timeout:n}of this.notificationManager.groupingMap.values())clearTimeout(n);this.notificationManager.groupingMap.clear()}this.terminalResizeObserver&&(this.terminalResizeObserver.disconnect(),this.terminalResizeObserver=null),this.planLoadingTimer&&(clearInterval(this.planLoadingTimer),this.planLoadingTimer=null),this.timerCountdownInterval&&(clearInterval(this.timerCountdownInterval),this.timerCountdownInterval=null),this.runSummaryAutoRefreshTimer&&(clearInterval(this.runSummaryAutoRefreshTimer),this.runSummaryAutoRefreshTimer=null),e.sessions.forEach(n=>{this.sessions.set(n.id,n),(n.ralphLoop||n.ralphTodos)&&!this.ralphClosedSessions.has(n.id)&&this.ralphStates.set(n.id,{loop:n.ralphLoop||null,todos:n.ralphTodos||[]})}),this._restoreEndedTabs(),this.syncSessionOrder(),e.respawnStatus?this.respawnStatus=e.respawnStatus:this.respawnStatus={},this.respawnTimers={},this.respawnCountdownTimers={},this.respawnActionLogs={},e.globalStats&&(this.globalStats=e.globalStats),this.totalCost=e.sessions.reduce((n,r)=>n+(r.totalCost||0),0),this.totalCost+=e.scheduledRuns.reduce((n,r)=>n+(r.totalCost||0),0);const i=e.scheduledRuns.find(n=>n.status==="running");if(i&&(this.currentRun=i,this.showTimer()),this.updateCost(),this.renderSessionTabs(),this.sessions.size>0?this.startSystemStatsPolling():this.stopSystemStatsPolling(),this.cleanupAllFloatingWindows(),e.subagents&&(this.subagents.clear(),this.subagentActivity.clear(),this.subagentToolResults.clear(),e.subagents.forEach(n=>{this.subagents.set(n.agentId,n)}),this.renderSubagentPanel(),this.subagentParentMap.clear(),this.loadSubagentParentMap().then(()=>{for(const[n,r]of this.subagentParentMap){const o=this.subagents.get(n);if(o&&this.sessions.has(r)){o.parentSessionId=r;const h=this.sessions.get(r);h&&(o.parentSessionName=this.getSessionName(h)),this.subagents.set(n,o)}}for(const[n]of this.subagents)this.subagentParentMap.has(n)||this.findParentSessionForSubagent(n);this.restoreSubagentWindowStates()})),t!==this._initGeneration)return;const a=this.activeSessionId;if(this.activeSessionId=null,this.sessionOrder.length>0){let n=a;if(!n||!this.sessions.has(n))try{n=localStorage.getItem("codeman-active-session")}catch{}n&&this.sessions.has(n)?this.selectSession(n):this.selectSession(this.sessionOrder[0])}}async loadState(){try{const t=await(await fetch("/api/status")).json();this.handleInit(t)}catch(e){console.error("Failed to load state:",e)}}_debouncedCall(e,t,s=100){this._debounceTimers[e]&&clearTimeout(this._debounceTimers[e]),this._debounceTimers[e]=setTimeout(()=>{this._debounceTimers[e]=null,t.call(this)},s)}renderSessionTabs(){this._debouncedCall("sessionTabs",this._renderSessionTabsImmediate)}_updateActiveTabImmediate(e){const t=this.$("sessionTabs");if(!t)return;const s=t.querySelectorAll(".session-tab[data-id]");for(const i of s)i.dataset.id===e?i.classList.add("active"):i.classList.remove("active")}_renderSessionTabsImmediate(){const e=this.$("sessionTabs"),t=e.querySelectorAll(".session-tab[data-id]"),s=new Set([...t].map(n=>n.dataset.id)),i=new Set(this.sessions.keys());if(s.size===i.size&&[...s].every(n=>i.has(n)))for(const[n,r]of this.sessions){const o=e.querySelector(`.session-tab[data-id="${n}"]`);if(!o)continue;const h=n===this.activeSessionId,c=r.status||"idle",d=this.getSessionName(r),u=r.taskStats||{running:0,total:0},f=u.running>0;h&&!o.classList.contains("active")?o.classList.add("active"):!h&&o.classList.contains("active")&&o.classList.remove("active");const p=this.tabAlerts.get(n),S=p==="action",m=p==="idle",_=o.classList.contains("tab-alert-action"),E=o.classList.contains("tab-alert-idle");S&&!_?(o.classList.add("tab-alert-action"),o.classList.remove("tab-alert-idle")):m&&!E?(o.classList.add("tab-alert-idle"),o.classList.remove("tab-alert-action")):!p&&(_||E)&&o.classList.remove("tab-alert-action","tab-alert-idle");const A=o.querySelector(".tab-status");A&&!A.classList.contains(c)&&(A.className=`tab-status ${c}`);const w=o.querySelector(".tab-name");w&&w.textContent!==d&&(w.textContent=d);const T=o.querySelector(".tab-badge");if(f)if(T)T.textContent!==String(u.running)&&(T.textContent=u.running);else{this._fullRenderSessionTabs();return}else if(T){this._fullRenderSessionTabs();return}const g=o.querySelector(".tab-subagent-badge"),y=this.minimizedSubagents.get(n),b=y?.size||0;if(b>0&&g){const v=g.querySelector(".subagent-label"),C=b===1?"AGENT":`AGENTS (${b})`;v&&v.textContent!==C&&(v.textContent=C);const R=g.querySelector(".subagent-dropdown");if(R){const N=this.renderSubagentTabBadge(n,y),O=document.createElement("div");O.innerHTML=N;const I=O.querySelector(".subagent-dropdown");I&&(R.innerHTML=I.innerHTML)}}else if(b>0&&!g){const v=this.renderSubagentTabBadge(n,y),C=o.querySelector(".tab-gear");C&&C.insertAdjacentHTML("beforebegin",v)}else b===0&&g&&g.remove()}else this._fullRenderSessionTabs()}_fullRenderSessionTabs(){const e=this.$("sessionTabs");document.querySelectorAll("body > .subagent-dropdown").forEach(i=>i.remove()),this.cancelHideSubagentDropdown();const t=[];let s=this.sessionOrder;MobileDetection.getDeviceType()==="mobile"&&this.activeSessionId&&(s=[this.activeSessionId,...this.sessionOrder.filter(i=>i!==this.activeSessionId)]);for(const i of s){const a=this.sessions.get(i);if(!a)continue;const n=i===this.activeSessionId,r=a.status||"idle",o=this.getSessionName(a),h=a.mode||"claude",c=a.color||"default",d=a.taskStats||{running:0,total:0},u=d.running>0,f=this.tabAlerts.get(i),p=f==="action"?" tab-alert-action":f==="idle"?" tab-alert-idle":"",S=this.minimizedSubagents.get(i),_=(S?.size||0)>0?this.renderSubagentTabBadge(i,S):"",E=a.workingDir&&a.workingDir.split("/").pop()||"",w=(this._tallTabsEnabled??!1)&&a.name&&E&&E!==o,T=a._ended?' data-ended="1"':"";t.push(`<div class="session-tab ${n?"active":""}${p}" data-id="${i}" data-color="${c}"${T} onclick="app.selectSession('${escapeHtml(i)}')" oncontextmenu="event.preventDefault(); app.startInlineRename('${escapeHtml(i)}')" tabindex="0" role="tab" aria-selected="${n?"true":"false"}" aria-label="${escapeHtml(o)} session" ${a.workingDir?`title="${escapeHtml(a.workingDir)}"`:""}>
|
|
8
|
+
<span class="tab-status ${r}" aria-hidden="true"></span>
|
|
9
|
+
<span class="tab-info">
|
|
10
|
+
<span class="tab-name-row">
|
|
11
|
+
${h==="shell"?'<span class="tab-mode shell" aria-hidden="true">sh</span>':h==="opencode"?'<span class="tab-mode opencode" aria-hidden="true">oc</span>':""}
|
|
12
|
+
<span class="tab-name" data-session-id="${i}">${escapeHtml(o)}</span>
|
|
13
|
+
</span>
|
|
14
|
+
${w?`<span class="tab-folder">\u{1F4C1} ${escapeHtml(E)}</span>`:""}
|
|
15
|
+
</span>
|
|
16
|
+
${u?`<span class="tab-badge" onclick="event.stopPropagation(); app.toggleTaskPanel()" aria-label="${d.running} running tasks">${d.running}</span>`:""}
|
|
17
|
+
${_}
|
|
18
|
+
<span class="tab-gear" onclick="event.stopPropagation(); app.openSessionOptions('${escapeHtml(i)}')" title="Session options" aria-label="Session options" tabindex="0">⚙</span>
|
|
19
|
+
<span class="tab-close" onclick="event.stopPropagation(); app.requestCloseSession('${escapeHtml(i)}')" title="Close session" aria-label="Close session" tabindex="0">×</span>
|
|
20
|
+
</div>`)}e.innerHTML=t.join(""),this._saveTabMetadata(),this.setupTabDragHandlers(),this.setupTabKeyboardNavigation(e),this.updateConnectionLines()}setupTabKeyboardNavigation(e){this._tabKeydownHandler&&e.removeEventListener("keydown",this._tabKeydownHandler),this._tabKeydownHandler=t=>{if(!["ArrowLeft","ArrowRight","Home","End","Enter"," "].includes(t.key))return;const s=[...e.querySelectorAll(".session-tab")],i=s.indexOf(document.activeElement);if((t.key==="Enter"||t.key===" ")&&i>=0){t.preventDefault();const n=s[i].dataset.id;this.selectSession(n);return}if(i<0)return;let a;switch(t.key){case"ArrowLeft":a=i>0?i-1:s.length-1;break;case"ArrowRight":a=i<s.length-1?i+1:0;break;case"Home":a=0;break;case"End":a=s.length-1;break;default:return}t.preventDefault(),s[a]?.focus()},e.addEventListener("keydown",this._tabKeydownHandler)}syncSessionOrder(){const e=new Set(this.sessions.keys()),s=this.loadSessionOrder().filter(n=>e.has(n)),i=new Set(s),a=[...e].filter(n=>!i.has(n));this.sessionOrder=[...s,...a]}loadSessionOrder(){try{const e=localStorage.getItem("codeman-session-order");return e?JSON.parse(e):[]}catch{return[]}}saveSessionOrder(){try{localStorage.setItem("codeman-session-order",JSON.stringify(this.sessionOrder))}catch{}}_saveTabMetadata(){try{const e={};for(const[t,s]of this.sessions)s._ended||(e[t]={id:t,name:s.name||"",workingDir:s.workingDir||"",mode:s.mode||"claude",color:s.color||"default"});localStorage.setItem("codeman-tab-meta",JSON.stringify(e))}catch{}}_restoreEndedTabs(){try{const e=localStorage.getItem("codeman-tab-meta");if(!e)return;const t=JSON.parse(e);for(const[s,i]of Object.entries(t))this.sessions.has(s)||this.sessions.set(s,{id:s,name:i.name,workingDir:i.workingDir,mode:i.mode,color:i.color,status:"ended",_ended:!0})}catch{}}setupTabDragHandlers(){const e=this.$("sessionTabs");e.querySelectorAll(".session-tab[data-id]").forEach(s=>{s.setAttribute("draggable","true"),s.addEventListener("dragstart",i=>{this.draggedTabId=s.dataset.id,s.classList.add("dragging"),i.dataTransfer.effectAllowed="move",i.dataTransfer.setData("text/plain",s.dataset.id)}),s.addEventListener("dragend",()=>{s.classList.remove("dragging"),this.draggedTabId=null,e.querySelectorAll(".session-tab").forEach(i=>{i.classList.remove("drag-over-left","drag-over-right")})}),s.addEventListener("dragover",i=>{if(i.preventDefault(),!this.draggedTabId||this.draggedTabId===s.dataset.id)return;i.dataTransfer.dropEffect="move";const a=s.getBoundingClientRect(),n=a.left+a.width/2,r=i.clientX<n;s.classList.toggle("drag-over-left",r),s.classList.toggle("drag-over-right",!r)}),s.addEventListener("dragleave",()=>{s.classList.remove("drag-over-left","drag-over-right")}),s.addEventListener("drop",i=>{if(i.preventDefault(),s.classList.remove("drag-over-left","drag-over-right"),!this.draggedTabId||this.draggedTabId===s.dataset.id)return;const a=s.dataset.id,n=this.draggedTabId,r=s.getBoundingClientRect(),o=r.left+r.width/2,h=i.clientX<o,c=this.sessionOrder.indexOf(n);let d=this.sessionOrder.indexOf(a);c===-1||d===-1||(this.sessionOrder.splice(c,1),d=this.sessionOrder.indexOf(a),d!==-1&&(h?this.sessionOrder.splice(d,0,n):this.sessionOrder.splice(d+1,0,n),this.saveSessionOrder(),this._fullRenderSessionTabs()))})})}getShortId(e){if(!e)return"";let t=this._shortIdCache.get(e);return t||(t=e.slice(0,8),this._shortIdCache.set(e,t)),t}getSessionName(e){return e.name?e.name:e.workingDir?e.workingDir.split("/").pop()||e.workingDir:this.getShortId(e.id)}async selectSession(e){if(this.activeSessionId===e)return;const t=performance.now(),s=this.sessions.get(e)?.name||e.slice(0,8);_crashDiag.log(`SELECT: ${s}`),console.log(`[CRASH-DIAG] selectSession START: ${e.slice(0,8)}`);const i=++this._selectGeneration;if(i!==this._selectGeneration)return;this._disconnectWs();const a=document.getElementById("cjkInput");a&&(a.value=""),this.flickerFilterTimeout&&(clearTimeout(this.flickerFilterTimeout),this.flickerFilterTimeout=null),this.flickerFilterBuffer="",this.flickerFilterActive=!1,this._tabCompletionSessionId=null,this._tabCompletionRetries=0,this._tabCompletionBaseText=null,this._tabCompletionFallback&&(clearTimeout(this._tabCompletionFallback),this._tabCompletionFallback=null),this._clientDropRecoveryTimer&&(clearTimeout(this._clientDropRecoveryTimer),this._clientDropRecoveryTimer=null),this.syncWaitTimeout&&(clearTimeout(this.syncWaitTimeout),this.syncWaitTimeout=null),this.pendingWrites=[],this.writeFrameScheduled=!1,this._isLoadingBuffer=!1,this._loadBufferQueue=null,this._chunkedWriteGen=(this._chunkedWriteGen||0)+1;try{const o=this.terminal?._core?._compositionHelper;if(o?._isComposing){o._isComposing=!1;const h=this.terminal?.element?.querySelector(".xterm-helper-textarea");h&&h.dispatchEvent(new CompositionEvent("compositionend",{data:""}))}}catch{}if(this.activeSessionId){const o=this._localEchoOverlay?.pendingText||"",h=this._localEchoOverlay?.getFlushed()?.count||0,c=this._localEchoOverlay?.getFlushed()?.text||"";o&&this._sendInputAsync(this.activeSessionId,o);const d=h+o.length;d>0&&(this._flushedOffsets||(this._flushedOffsets=new Map),this._flushedTexts||(this._flushedTexts=new Map),this._flushedOffsets.set(this.activeSessionId,d),this._flushedTexts.set(this.activeSessionId,c+o))}this._localEchoOverlay?.clear(),this._localEchoOverlay&&!this._flushedOffsets?.has(e)&&this._localEchoOverlay.suppressBufferDetection(),this.activeSessionId=e;try{localStorage.setItem("codeman-active-session",e)}catch{}this.hideWelcome(),this.clearPendingHooks(e,"idle_prompt"),this._updateActiveTabImmediate(e),this.renderSessionTabs(),this._updateLocalEchoState(),this._flushedOffsets?.has(e)&&this._localEchoOverlay&&this._localEchoOverlay.setFlushed(this._flushedOffsets.get(e),this._flushedTexts?.get(e)||"",!1);const n=document.querySelector(`.session-tab.active[data-id="${e}"]`);n&&(n.classList.add("tab-glow"),n.addEventListener("animationend",()=>n.classList.remove("tab-glow"),{once:!0}));const r=this.sessions.get(e);if(r?._ended){this.terminal.clear(),this.terminal.write(`\r
|
|
21
|
+
\x1B[2mSession ended. Close tab or click to reopen.\x1B[0m\r
|
|
22
|
+
`);return}if(this.currentSessionWorkingDir=r?.workingDir||null,r&&r.pid===null&&r.status==="idle")try{const o=r.mode==="shell"?`/api/sessions/${e}/shell`:`/api/sessions/${e}/interactive`;await fetch(o,{method:"POST"}),r.status="busy"}catch(o){console.error("Failed to attach to restored session:",o)}this._restoringFlushedState=!0,this._isLoadingBuffer=!0,this._loadBufferQueue=[];try{this.fitAddon&&this.fitAddon.fit();const o=this.terminalBufferCache.get(e);if(o){if(_crashDiag.log(`CACHE_WRITE: ${(o.length/1024).toFixed(0)}KB`),this.terminal.clear(),this.terminal.reset(),await this.chunkedTerminalWrite(o),i!==this._selectGeneration){this._isLoadingBuffer&&this._finishBufferLoad(),this._restoringFlushedState=!1;return}this.terminal.scrollToBottom(),_crashDiag.log("CACHE_DONE")}_crashDiag.log("FETCH_START");const h=await fetch(`/api/sessions/${e}/terminal?tail=${TERMINAL_TAIL_SIZE}`);if(i!==this._selectGeneration){this._isLoadingBuffer&&this._finishBufferLoad(),this._restoringFlushedState=!1;return}const c=await h.json();if(_crashDiag.log(`FETCH_DONE: ${c.terminalBuffer?(c.terminalBuffer.length/1024).toFixed(0)+"KB":"empty"} truncated=${c.truncated}`),c.terminalBuffer){if(c.terminalBuffer!==o){if(_crashDiag.log(`REWRITE: ${(c.terminalBuffer.length/1024).toFixed(0)}KB`),this.terminal.clear(),this.terminal.reset(),c.truncated&&this.terminal.write(`\x1B[90m... (earlier output truncated for performance) ...\x1B[0m\r
|
|
23
|
+
\r
|
|
24
|
+
`),await this.chunkedTerminalWrite(c.terminalBuffer),i!==this._selectGeneration){this._isLoadingBuffer&&this._finishBufferLoad(),this._restoringFlushedState=!1;return}this.terminal.scrollToBottom()}if(this.terminalBufferCache.set(e,c.terminalBuffer),this.terminalBufferCache.size>20){const f=this.terminalBufferCache.keys().next().value;this.terminalBufferCache.delete(f)}}else o||(this.terminal.clear(),this.terminal.reset());if(this._isLoadingBuffer&&this._finishBufferLoad(),this._restoringFlushedState=!1,this._flushedOffsets?.has(e)&&this._localEchoOverlay){this._localEchoOverlay.setFlushed(this._flushedOffsets.get(e),this._flushedTexts?.get(e)||"",!1);const u=this._localEchoOverlay;this.terminal.write("",()=>{u.hasPending&&u.rerender()})}this.sendResize(e),(typeof requestIdleCallback=="function"?requestIdleCallback:u=>setTimeout(u,16))(()=>{if(i!==this._selectGeneration)return;this.respawnStatus[e]?(this.showRespawnBanner(),this.updateRespawnBanner(this.respawnStatus[e].state),document.getElementById("respawnCycleCount").textContent=this.respawnStatus[e].cycleCount||0,this.updateCountdownTimerDisplay(),this.updateActionLogDisplay(),Object.keys(this.respawnCountdownTimers[e]||{}).length>0&&this.startCountdownInterval()):(this.hideRespawnBanner(),this.stopCountdownInterval());const u=document.getElementById("taskPanel");u&&u.classList.contains("open")&&this.renderTaskPanel();const f=this.sessions.get(e);if(f&&(f.ralphLoop||f.ralphTodos)&&this.updateRalphState(e,{loop:f.ralphLoop,todos:f.ralphTodos}),this.renderRalphStatePanel(),this.updateCliInfoDisplay(),this.renderProjectInsightsPanel(),this.updateSubagentWindowVisibility(),this.loadAppSettingsFromStorage().showFileBrowser){const S=this.$("fileBrowserPanel");if(S&&(S.classList.add("visible"),this.loadFileBrowser(e),!this.fileBrowserDragListeners)){const m=S.querySelector(".file-browser-header");if(m){const _=()=>{if(!S.style.left){const E=S.getBoundingClientRect();S.style.left=`${E.left}px`,S.style.top=`${E.top}px`,S.style.right="auto"}};m.addEventListener("mousedown",_),m.addEventListener("touchstart",_,{passive:!0}),this.fileBrowserDragListeners=this.makeWindowDraggable(S,m),this.fileBrowserDragListeners._onFirstDrag=_}}}}),this._connectWs(e),_crashDiag.log("FOCUS"),this.terminal.focus(),this.terminal.scrollToBottom(),_crashDiag.log(`SELECT_DONE: ${(performance.now()-t).toFixed(0)}ms`),console.log(`[CRASH-DIAG] selectSession DONE: ${e.slice(0,8)} in ${(performance.now()-t).toFixed(0)}ms`)}catch(o){this._isLoadingBuffer&&this._finishBufferLoad(),this._restoringFlushedState=!1,console.error("Failed to load session terminal:",o)}}_cleanupSessionData(e){this.sessions.delete(e);const t=this.sessionOrder.indexOf(e);t!==-1&&(this.sessionOrder.splice(t,1),this.saveSessionOrder()),this.terminalBuffers.delete(e),this.terminalBufferCache.delete(e),this._flushedOffsets?.delete(e),this._flushedTexts?.delete(e),this._inputQueue.delete(e),this.ralphStates.delete(e),this.ralphClosedSessions.delete(e),this.projectInsights.delete(e),this.pendingHooks.delete(e),this.tabAlerts.delete(e),this.clearCountdownTimers(e),this.closeSessionLogViewerWindows(e),this.closeSessionImagePopups(e),this.closeSessionSubagentWindows(e,!0);const s=this.idleTimers.get(e);s&&(clearTimeout(s),this.idleTimers.delete(e)),delete this.respawnStatus[e],delete this.respawnTimers[e],delete this.respawnCountdownTimers[e],delete this.respawnActionLogs[e]}async closeSession(e,t=!0){try{if(await this._apiDelete(`/api/sessions/${e}?killMux=${t}`),this._cleanupSessionData(e),this.activeSessionId===e){this.activeSessionId=null;try{localStorage.removeItem("codeman-active-session")}catch{}if(this.sessionOrder.length>0&&this.sessions.size>0){const s=this.sessionOrder[0];this.selectSession(s)}else this.terminal.clear(),this.showWelcome(),this.renderRalphStatePanel()}this.renderSessionTabs(),t?this.showToast("Session closed and tmux killed","success"):this.showToast("Tab hidden, tmux still running","info")}catch{this.showToast("Failed to close session","error")}}requestCloseSession(e){const t=this.sessions.get(e);if(!t)return;this.pendingCloseSessionId=e;const s=this.getSessionName(t),i=document.getElementById("closeConfirmSessionName");i.textContent=s;const a=document.getElementById("closeConfirmKillTitle");a&&(a.textContent=t.mode==="opencode"?"Kill Tmux & OpenCode":"Kill Tmux & Claude Code"),document.getElementById("closeConfirmModal").classList.add("active")}cancelCloseSession(){this.pendingCloseSessionId=null,document.getElementById("closeConfirmModal").classList.remove("active")}async confirmCloseSession(e=!0){const t=this.pendingCloseSessionId;this.cancelCloseSession(),t&&await this.closeSession(t,e)}nextSession(){if(this.sessionOrder.length<=1)return;const t=(this.sessionOrder.indexOf(this.activeSessionId)+1)%this.sessionOrder.length;this.selectSession(this.sessionOrder[t])}prevSession(){if(this.sessionOrder.length<=1)return;const t=(this.sessionOrder.indexOf(this.activeSessionId)-1+this.sessionOrder.length)%this.sessionOrder.length;this.selectSession(this.sessionOrder[t])}goHome(){this.activeSessionId=null;try{localStorage.removeItem("codeman-active-session")}catch{}this.terminal.clear(),this.showWelcome(),this.renderSessionTabs(),this.renderRalphStatePanel()}ralphWizardStep=1;ralphWizardConfig={taskDescription:"",completionPhrase:"COMPLETE",maxIterations:10,caseName:"testcase",enableRespawn:!1,generatedPlan:null,planGenerated:!1,skipPlanGeneration:!1,planDetailLevel:"detailed",existingPlan:null,useExistingPlan:!1};planLoadingTimer=null;planLoadingStartTime=null;async killActiveSession(){if(!this.activeSessionId){this.showToast("No active session","warning");return}await this.closeSession(this.activeSessionId)}async killAllSessions(){if(this.sessions.size!==0&&confirm(`Kill all ${this.sessions.size} session(s)?`))try{await this._apiDelete("/api/sessions"),this.sessions.clear(),this.terminalBuffers.clear(),this.terminalBufferCache.clear(),this.activeSessionId=null;try{localStorage.removeItem("codeman-active-session")}catch{}this.respawnStatus={},this.respawnCountdownTimers={},this.respawnActionLogs={},this.stopCountdownInterval(),this.hideRespawnBanner(),this.renderSessionTabs(),this.terminal.clear(),this.showWelcome(),this.showToast("All sessions killed","success")}catch{this.showToast("Failed to kill sessions","error")}}showTimer(){document.getElementById("timerBanner").style.display="flex",this.updateTimer(),this.timerInterval=setInterval(()=>this.updateTimer(),1e3)}hideTimer(){document.getElementById("timerBanner").style.display="none",this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=null)}updateTimer(){if(!this.currentRun||this.currentRun.status!=="running")return;const e=Date.now(),t=Math.max(0,this.currentRun.endAt-e),s=this.currentRun.endAt-this.currentRun.startedAt,i=e-this.currentRun.startedAt,a=Math.min(100,i/s*100);document.getElementById("timerValue").textContent=this.formatTime(t),document.getElementById("timerProgress").style.width=`${a}%`,document.getElementById("timerMeta").textContent=`${this.currentRun.completedTasks} tasks | $${this.currentRun.totalCost.toFixed(2)}`}async stopCurrentRun(){if(this.currentRun)try{await fetch(`/api/scheduled/${this.currentRun.id}`,{method:"DELETE"})}catch{this.showToast("Failed to stop run","error")}}formatTime(e){const t=Math.floor(e/1e3),s=Math.floor(t/3600),i=Math.floor(t%3600/60),a=t%60;return`${s.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`}updateCost(){this.updateTokens()}updateTokens(){this._updateTokensTimeout&&clearTimeout(this._updateTokensTimeout),this._updateTokensTimeout=setTimeout(()=>{this._updateTokensTimeout=null,this._updateTokensImmediate()},200)}_updateTokensImmediate(){let e=0,t=0;this.globalStats?(e=this.globalStats.totalInputTokens||0,t=this.globalStats.totalOutputTokens||0):this.sessions.forEach(r=>{r.tokens&&(e+=r.tokens.input||0,t+=r.tokens.output||0)});const s=e+t;this.totalTokens=s;const i=this.formatTokens(s),a=this.estimateCost(e,t),n=this.$("headerTokens");if(n){const o=this.loadAppSettingsFromStorage().showCost??!1;n.textContent=s>0?o?`${i} tokens \xB7 $${a.toFixed(2)}`:`${i} tokens`:"0 tokens",n.title=this.globalStats?`Lifetime: ${this.globalStats.totalSessionsCreated} sessions created${o?`
|
|
25
|
+
Estimated cost based on Claude Opus pricing`:""}`:`Token usage across active sessions${o?`
|
|
26
|
+
Estimated cost based on Claude Opus pricing`:""}`}}}try{for(let l=0;l<localStorage.length;l++){const e=localStorage.key(l);if(e&&(e.startsWith("claudeman-")||e.startsWith("claudeman_"))){const t=e.replace(/^claudeman[-_]/,s=>"codeman"+s.charAt(s.length-1));localStorage.getItem(t)===null&&localStorage.setItem(t,localStorage.getItem(e))}}}catch{}let app;document.addEventListener("DOMContentLoaded",()=>{app=new CodemanApp,window.app=app}),window.MobileDetection=MobileDetection;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<link rel="manifest" href="manifest.json">
|
|
10
10
|
<title>Codeman</title>
|
|
11
11
|
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%2360a5fa'/%3E%3Cstop offset='100%25' stop-color='%233b82f6'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='32' height='32' rx='6' fill='%230a0a0a'/%3E%3Cpath d='M18 4L8 18h6l-2 10 10-14h-6z' fill='url(%23g)'/%3E%3C/svg%3E">
|
|
12
|
-
<link rel="stylesheet" href="styles.
|
|
12
|
+
<link rel="stylesheet" href="styles.5c87d847.css">
|
|
13
13
|
<link rel="stylesheet" href="mobile.fdd28a54.css" media="(max-width: 1023px)">
|
|
14
14
|
<!-- xterm.css loaded async — terminal won't display until xterm.js runs anyway -->
|
|
15
15
|
<link rel="preload" href="vendor/xterm.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
instead of waiting until <script> tags at bottom-of-body are reached. -->
|
|
19
19
|
<link rel="preload" href="vendor/xterm.min.js" as="script">
|
|
20
20
|
<link rel="preload" href="constants.64161167.js" as="script">
|
|
21
|
-
<link rel="preload" href="app.
|
|
21
|
+
<link rel="preload" href="app.916baeb9.js" as="script">
|
|
22
22
|
<!-- Self-hosted xterm.js — eliminates CDN DNS/TLS latency (~100ms).
|
|
23
23
|
'defer' preserves execution order (xterm loads before fit addon). -->
|
|
24
24
|
<script defer src="vendor/xterm.min.js"></script>
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
<script>if(window.innerWidth<768||(('ontouchstart' in window||navigator.maxTouchPoints>0)&&window.innerWidth<1024))document.documentElement.classList.add('mobile-init');</script>
|
|
31
31
|
<!-- Inline critical CSS for instant skeleton paint (before styles.css loads) -->
|
|
32
32
|
<style>
|
|
33
|
-
.loading-skeleton{display:flex;flex-direction:column;height:100vh;height:100dvh;background:#
|
|
34
|
-
.skeleton-header{height:40px;background
|
|
35
|
-
.skeleton-brand{color:#60a5fa;font-size:14px;font-weight:
|
|
33
|
+
.loading-skeleton{display:flex;flex-direction:column;height:100vh;height:100dvh;background:#09090b}
|
|
34
|
+
.skeleton-header{height:40px;background:rgba(19,19,22,0.85);border-bottom:1px solid rgba(255,255,255,0.06);display:flex;align-items:center;padding:0 12px}
|
|
35
|
+
.skeleton-brand{color:#60a5fa;font-size:14px;font-weight:700;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;opacity:.7}
|
|
36
36
|
.skeleton-tabs{display:flex;gap:4px;margin-left:16px}
|
|
37
|
-
.skeleton-tab{width:80px;height:24px;background
|
|
37
|
+
.skeleton-tab{width:80px;height:24px;background:rgba(255,255,255,0.04);border-radius:6px}
|
|
38
38
|
.skeleton-terminal{flex:1;background:#0d0d0d}
|
|
39
|
-
.skeleton-toolbar{height:
|
|
39
|
+
.skeleton-toolbar{height:42px;background:rgba(19,19,22,0.85);border-top:1px solid rgba(255,255,255,0.06)}
|
|
40
40
|
.app-loaded .loading-skeleton{display:none}
|
|
41
41
|
</style>
|
|
42
42
|
</head>
|
|
@@ -1713,13 +1713,13 @@
|
|
|
1713
1713
|
<script defer src="notification-manager.2d5ea8ec.js"></script>
|
|
1714
1714
|
<script defer src="keyboard-accessory.9fb81db6.js"></script>
|
|
1715
1715
|
<script defer src="input-cjk.92544c51.js"></script>
|
|
1716
|
-
<script defer src="app.
|
|
1717
|
-
<script defer src="terminal-ui.
|
|
1716
|
+
<script defer src="app.916baeb9.js"></script>
|
|
1717
|
+
<script defer src="terminal-ui.b66dbf4e.js"></script>
|
|
1718
1718
|
<script defer src="respawn-ui.372c6ea7.js"></script>
|
|
1719
|
-
<script defer src="ralph-panel.
|
|
1719
|
+
<script defer src="ralph-panel.a2733fd5.js"></script>
|
|
1720
1720
|
<script defer src="orchestrator-panel.js"></script>
|
|
1721
1721
|
<script defer src="settings-ui.94c57184.js"></script>
|
|
1722
|
-
<script defer src="panels-ui.
|
|
1722
|
+
<script defer src="panels-ui.8204db1e.js"></script>
|
|
1723
1723
|
<script defer src="session-ui.0a07c3b7.js"></script>
|
|
1724
1724
|
<script defer src="ralph-wizard.f31ab90e.js"></script>
|
|
1725
1725
|
<script defer src="api-client.3adebdc2.js"></script>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<span class="cell cell-cost">$${v.estimatedCost.toFixed(2)}</span>
|
|
30
30
|
</div>
|
|
31
31
|
`).join("")}
|
|
32
|
-
`},closeTokenStats(){const e=document.getElementById("tokenStatsModal");e&&e.classList.remove("active")},async toggleMonitorPanel(){const e=document.getElementById("monitorPanel"),t=document.getElementById("monitorToggleBtn");e.classList.toggle("open"),e.classList.contains("open")?(await this.loadMuxSessions(),await fetch("/api/mux-sessions/stats/start",{method:"POST"}),this.renderTaskPanel(),t&&(t.innerHTML="▼")):(await fetch("/api/mux-sessions/stats/stop",{method:"POST"}),t&&(t.innerHTML="▲"))},toggleTaskPanel(){this.toggleMonitorPanel()},toggleMonitorDetach(){const e=document.getElementById("monitorPanel"),t=document.getElementById("monitorDetachBtn");e.classList.contains("detached")?(e.classList.remove("detached"),e.style.top="",e.style.left="",e.style.width="",e.style.height="",t&&(t.innerHTML="⧉",t.title="Detach panel")):(e.classList.add("detached"),e.classList.add("open"),t&&(t.innerHTML="⊞",t.title="Attach panel"),this.setupMonitorDrag())},setupMonitorDrag(){const e=document.getElementById("monitorPanel"),t=document.getElementById("monitorPanelHeader");if(!e||!t)return;let s=!1,n,a,o,r;const i=d=>{if(d.target.closest("button")||!e.classList.contains("detached"))return;s=!0;const u=getEventCoords(d);n=u.clientX,a=u.clientY;const h=e.getBoundingClientRect();o=h.left,r=h.top,document.addEventListener("mousemove",l),document.addEventListener("mouseup",c),document.addEventListener("touchmove",l,{passive:!1}),document.addEventListener("touchend",c),d.preventDefault()},l=d=>{if(!s)return;const u=getEventCoords(d),h=u.clientX-n,m=u.clientY-a;let p=o+h,f=r+m;const w=e.getBoundingClientRect();p=Math.max(0,Math.min(window.innerWidth-w.width,p)),f=Math.max(0,Math.min(window.innerHeight-w.height,f)),e.style.left=p+"px",e.style.top=f+"px"},c=()=>{s=!1,document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c),document.removeEventListener("touchmove",l),document.removeEventListener("touchend",c)};t.removeEventListener("mousedown",t._dragHandler),t.removeEventListener("touchstart",t._touchDragHandler),t._dragHandler=i,t._touchDragHandler=i,t.addEventListener("mousedown",i),t.addEventListener("touchstart",i,{passive:!1})},toggleSubagentsDetach(){const e=document.getElementById("subagentsPanel"),t=document.getElementById("subagentsDetachBtn");e.classList.contains("detached")?(e.classList.remove("detached"),e.style.top="",e.style.left="",e.style.width="",e.style.height="",t&&(t.innerHTML="⧉",t.title="Detach panel")):(e.classList.add("detached"),e.classList.add("open"),t&&(t.innerHTML="⊞",t.title="Attach panel"),this.setupSubagentsDrag())},setupSubagentsDrag(){const e=document.getElementById("subagentsPanel"),t=document.getElementById("subagentsPanelHeader");if(!e||!t)return;let s=!1,n,a,o,r;const i=d=>{if(d.target.closest("button")||!e.classList.contains("detached"))return;s=!0;const u=getEventCoords(d);n=u.clientX,a=u.clientY;const h=e.getBoundingClientRect();o=h.left,r=h.top,document.addEventListener("mousemove",l),document.addEventListener("mouseup",c),document.addEventListener("touchmove",l,{passive:!1}),document.addEventListener("touchend",c),d.preventDefault()},l=d=>{if(!s)return;const u=getEventCoords(d),h=u.clientX-n,m=u.clientY-a;let p=o+h,f=r+m;const w=e.getBoundingClientRect();p=Math.max(0,Math.min(window.innerWidth-w.width,p)),f=Math.max(0,Math.min(window.innerHeight-w.height,f)),e.style.left=p+"px",e.style.top=f+"px"},c=()=>{s=!1,document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c),document.removeEventListener("touchmove",l),document.removeEventListener("touchend",c)};t.removeEventListener("mousedown",t._dragHandler),t.removeEventListener("touchstart",t._touchDragHandler),t._dragHandler=i,t._touchDragHandler=i,t.addEventListener("mousedown",i),t.addEventListener("touchstart",i,{passive:!1})},renderTaskPanel(){this.
|
|
32
|
+
`},closeTokenStats(){const e=document.getElementById("tokenStatsModal");e&&e.classList.remove("active")},async toggleMonitorPanel(){const e=document.getElementById("monitorPanel"),t=document.getElementById("monitorToggleBtn");e.classList.toggle("open"),e.classList.contains("open")?(await this.loadMuxSessions(),await fetch("/api/mux-sessions/stats/start",{method:"POST"}),this.renderTaskPanel(),t&&(t.innerHTML="▼")):(await fetch("/api/mux-sessions/stats/stop",{method:"POST"}),t&&(t.innerHTML="▲"))},toggleTaskPanel(){this.toggleMonitorPanel()},toggleMonitorDetach(){const e=document.getElementById("monitorPanel"),t=document.getElementById("monitorDetachBtn");e.classList.contains("detached")?(e.classList.remove("detached"),e.style.top="",e.style.left="",e.style.width="",e.style.height="",t&&(t.innerHTML="⧉",t.title="Detach panel")):(e.classList.add("detached"),e.classList.add("open"),t&&(t.innerHTML="⊞",t.title="Attach panel"),this.setupMonitorDrag())},setupMonitorDrag(){const e=document.getElementById("monitorPanel"),t=document.getElementById("monitorPanelHeader");if(!e||!t)return;let s=!1,n,a,o,r;const i=d=>{if(d.target.closest("button")||!e.classList.contains("detached"))return;s=!0;const u=getEventCoords(d);n=u.clientX,a=u.clientY;const h=e.getBoundingClientRect();o=h.left,r=h.top,document.addEventListener("mousemove",l),document.addEventListener("mouseup",c),document.addEventListener("touchmove",l,{passive:!1}),document.addEventListener("touchend",c),d.preventDefault()},l=d=>{if(!s)return;const u=getEventCoords(d),h=u.clientX-n,m=u.clientY-a;let p=o+h,f=r+m;const w=e.getBoundingClientRect();p=Math.max(0,Math.min(window.innerWidth-w.width,p)),f=Math.max(0,Math.min(window.innerHeight-w.height,f)),e.style.left=p+"px",e.style.top=f+"px"},c=()=>{s=!1,document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c),document.removeEventListener("touchmove",l),document.removeEventListener("touchend",c)};t.removeEventListener("mousedown",t._dragHandler),t.removeEventListener("touchstart",t._touchDragHandler),t._dragHandler=i,t._touchDragHandler=i,t.addEventListener("mousedown",i),t.addEventListener("touchstart",i,{passive:!1})},toggleSubagentsDetach(){const e=document.getElementById("subagentsPanel"),t=document.getElementById("subagentsDetachBtn");e.classList.contains("detached")?(e.classList.remove("detached"),e.style.top="",e.style.left="",e.style.width="",e.style.height="",t&&(t.innerHTML="⧉",t.title="Detach panel")):(e.classList.add("detached"),e.classList.add("open"),t&&(t.innerHTML="⊞",t.title="Attach panel"),this.setupSubagentsDrag())},setupSubagentsDrag(){const e=document.getElementById("subagentsPanel"),t=document.getElementById("subagentsPanelHeader");if(!e||!t)return;let s=!1,n,a,o,r;const i=d=>{if(d.target.closest("button")||!e.classList.contains("detached"))return;s=!0;const u=getEventCoords(d);n=u.clientX,a=u.clientY;const h=e.getBoundingClientRect();o=h.left,r=h.top,document.addEventListener("mousemove",l),document.addEventListener("mouseup",c),document.addEventListener("touchmove",l,{passive:!1}),document.addEventListener("touchend",c),d.preventDefault()},l=d=>{if(!s)return;const u=getEventCoords(d),h=u.clientX-n,m=u.clientY-a;let p=o+h,f=r+m;const w=e.getBoundingClientRect();p=Math.max(0,Math.min(window.innerWidth-w.width,p)),f=Math.max(0,Math.min(window.innerHeight-w.height,f)),e.style.left=p+"px",e.style.top=f+"px"},c=()=>{s=!1,document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c),document.removeEventListener("touchmove",l),document.removeEventListener("touchend",c)};t.removeEventListener("mousedown",t._dragHandler),t.removeEventListener("touchstart",t._touchDragHandler),t._dragHandler=i,t._touchDragHandler=i,t.addEventListener("mousedown",i),t.addEventListener("touchstart",i,{passive:!1})},renderTaskPanel(){this._debouncedCall("taskPanel",this._renderTaskPanelImmediate)},_renderTaskPanelImmediate(){const e=this.sessions.get(this.activeSessionId),t=document.getElementById("backgroundTasksBody"),s=document.getElementById("taskPanelStats"),n=document.getElementById("backgroundTasksSection");if(!e||!e.taskTree||e.taskTree.length===0){n&&(n.style.display="none"),t.innerHTML="",s.textContent="0 tasks";return}n&&(n.style.display="");const a=e.taskStats||{running:0,completed:0,failed:0,total:0};s.textContent=`${a.running} running, ${a.completed} done`;const o=(l,c)=>{const d=l.status==="running"?"":l.status==="completed"?"✓":"✗",u=l.endTime?`${((l.endTime-l.startTime)/1e3).toFixed(1)}s`:`${((Date.now()-l.startTime)/1e3).toFixed(0)}s...`;let h="";if(l.children&&l.children.length>0){h='<div class="task-children">';for(const m of l.children){const p=c.find(f=>f.id===m);p&&(h+=`<div class="task-node">${o(p,c)}</div>`)}h+="</div>"}return`
|
|
33
33
|
<div class="task-item">
|
|
34
34
|
<span class="task-status-icon ${l.status}">${d}</span>
|
|
35
35
|
<div class="task-info">
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
onerror="this.parentElement.innerHTML='<div class=\\'image-error\\'>Failed to load image</div>'"
|
|
207
207
|
onclick="app.openImageInNewTab('${escapeHtml(g)}')" />
|
|
208
208
|
</div>
|
|
209
|
-
`,document.body.appendChild(b);const T=this.makeWindowDraggable(b,b.querySelector(".image-popup-header"));b.addEventListener("mousedown",()=>{b.style.zIndex=++this.imagePopupZIndex}),this.imagePopups.set(i,{element:b,sessionId:t,filePath:s,dragListeners:T})},closeImagePopup(e){const t=this.imagePopups.get(e);t&&(t.dragListeners&&(document.removeEventListener("mousemove",t.dragListeners.move),document.removeEventListener("mouseup",t.dragListeners.up),t.dragListeners.touchMove&&(document.removeEventListener("touchmove",t.dragListeners.touchMove),document.removeEventListener("touchend",t.dragListeners.up),document.removeEventListener("touchcancel",t.dragListeners.up)),t.dragListeners.handle&&(t.dragListeners.handle.removeEventListener("mousedown",t.dragListeners.handleMouseDown),t.dragListeners.handle.removeEventListener("touchstart",t.dragListeners.handleTouchStart))),t.element.remove(),this.imagePopups.delete(e))},openImageInNewTab(e){window.open(e,"_blank")},closeSessionImagePopups(e){const t=[];for(const[s,n]of this.imagePopups)n.sessionId===e&&t.push(s);for(const s of t)this.closeImagePopup(s)},async loadMuxSessions(){try{const t=await(await fetch("/api/mux-sessions")).json();this.muxSessions=t.sessions||[],this.renderMuxSessions()}catch(e){console.error("Failed to load mux sessions:",e)}},killAllMuxSessions(){const e=this.muxSessions?.length||0;if(e===0){alert("No sessions to kill");return}document.getElementById("killAllCount").textContent=e;const t=document.getElementById("killAllModal");t.classList.add("active"),this.activeFocusTrap=new FocusTrap(t),this.activeFocusTrap.activate()},closeKillAllModal(){document.getElementById("killAllModal").classList.remove("active"),this.activeFocusTrap&&(this.activeFocusTrap.deactivate(),this.activeFocusTrap=null)},async confirmKillAll(e){this.closeKillAllModal();try{if(e){if((await(await fetch("/api/sessions",{method:"DELETE"})).json()).success){this.sessions.clear(),this.muxSessions=[],this.activeSessionId=null;try{localStorage.removeItem("codeman-active-session")}catch{}this.renderSessionTabs(),this.renderMuxSessions(),this.terminal.clear(),this.terminal.reset(),this.toast("All sessions and tmux killed","success")}}else{this.sessions.clear(),this.activeSessionId=null;try{localStorage.removeItem("codeman-active-session")}catch{}this.renderSessionTabs(),this.terminal.clear(),this.terminal.reset(),this.toast("All tabs removed, tmux still running","info")}}catch(t){console.error("Failed to kill sessions:",t),this.toast("Failed to kill sessions: "+t.message,"error")}},renderMuxSessions(){this.
|
|
209
|
+
`,document.body.appendChild(b);const T=this.makeWindowDraggable(b,b.querySelector(".image-popup-header"));b.addEventListener("mousedown",()=>{b.style.zIndex=++this.imagePopupZIndex}),this.imagePopups.set(i,{element:b,sessionId:t,filePath:s,dragListeners:T})},closeImagePopup(e){const t=this.imagePopups.get(e);t&&(t.dragListeners&&(document.removeEventListener("mousemove",t.dragListeners.move),document.removeEventListener("mouseup",t.dragListeners.up),t.dragListeners.touchMove&&(document.removeEventListener("touchmove",t.dragListeners.touchMove),document.removeEventListener("touchend",t.dragListeners.up),document.removeEventListener("touchcancel",t.dragListeners.up)),t.dragListeners.handle&&(t.dragListeners.handle.removeEventListener("mousedown",t.dragListeners.handleMouseDown),t.dragListeners.handle.removeEventListener("touchstart",t.dragListeners.handleTouchStart))),t.element.remove(),this.imagePopups.delete(e))},openImageInNewTab(e){window.open(e,"_blank")},closeSessionImagePopups(e){const t=[];for(const[s,n]of this.imagePopups)n.sessionId===e&&t.push(s);for(const s of t)this.closeImagePopup(s)},async loadMuxSessions(){try{const t=await(await fetch("/api/mux-sessions")).json();this.muxSessions=t.sessions||[],this.renderMuxSessions()}catch(e){console.error("Failed to load mux sessions:",e)}},killAllMuxSessions(){const e=this.muxSessions?.length||0;if(e===0){alert("No sessions to kill");return}document.getElementById("killAllCount").textContent=e;const t=document.getElementById("killAllModal");t.classList.add("active"),this.activeFocusTrap=new FocusTrap(t),this.activeFocusTrap.activate()},closeKillAllModal(){document.getElementById("killAllModal").classList.remove("active"),this.activeFocusTrap&&(this.activeFocusTrap.deactivate(),this.activeFocusTrap=null)},async confirmKillAll(e){this.closeKillAllModal();try{if(e){if((await(await fetch("/api/sessions",{method:"DELETE"})).json()).success){this.sessions.clear(),this.muxSessions=[],this.activeSessionId=null;try{localStorage.removeItem("codeman-active-session")}catch{}this.renderSessionTabs(),this.renderMuxSessions(),this.terminal.clear(),this.terminal.reset(),this.toast("All sessions and tmux killed","success")}}else{this.sessions.clear(),this.activeSessionId=null;try{localStorage.removeItem("codeman-active-session")}catch{}this.renderSessionTabs(),this.terminal.clear(),this.terminal.reset(),this.toast("All tabs removed, tmux still running","info")}}catch(t){console.error("Failed to kill sessions:",t),this.toast("Failed to kill sessions: "+t.message,"error")}},renderMuxSessions(){this._debouncedCall("muxSessions",this._renderMuxSessionsImmediate)},_renderMuxSessionsImmediate(){const e=document.getElementById("muxSessionsBody");if(!this.muxSessions||this.muxSessions.length===0){e.innerHTML='<div class="monitor-empty">No mux sessions</div>';return}let t="";for(const s of this.muxSessions){const n=s.stats||{memoryMB:0,cpuPercent:0,childCount:0},a=this.sessions.get(s.sessionId),o=a?a.status:"unknown",r=a?a.isWorking:!1;let i,l;o==="idle"&&!r?(i="IDLE",l="status-idle"):o==="busy"||r?(i="WORKING",l="status-working"):o==="stopped"?(i="STOPPED",l="status-stopped"):(i=o.toUpperCase(),l="");const c=a&&a.tokens?a.tokens:null,d=a?a.totalCost:0,u=a&&a.cliModel||"",h=u.includes("opus")?"opus":u.includes("sonnet")?"sonnet":u.includes("haiku")?"haiku":"",m=a?a.ralphTodoStats:null;let p="";if(m&&m.total>0){const T=Math.round(m.completed/m.total*100);p=`<span class="process-stat todo-progress">${m.completed}/${m.total} (${T}%)</span>`}let f="";c&&c.total>0&&(f=`<span class="process-stat tokens">${(c.total/1e3).toFixed(1)}k tok</span>`);let w="";d>0&&(w=`<span class="process-stat cost">$${d.toFixed(2)}</span>`);let g="";h&&(g=`<span class="monitor-model-badge ${h}">${h}</span>`);const b=escapeHtml(s.sessionId);t+=`
|
|
210
210
|
<div class="process-item process-item-clickable" onclick="app.selectSession('${b}')" title="Switch to session">
|
|
211
211
|
<span class="monitor-status-badge ${l}">${i}</span>
|
|
212
212
|
<div class="process-info">
|
|
Binary file
|
|
Binary file
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<button class="btn btn-secondary" onclick="app.closeFixPlanModal()">Close</button>
|
|
15
15
|
</div>
|
|
16
16
|
</div>
|
|
17
|
-
`,document.body.appendChild(s)),document.getElementById("fixPlanContent").value=t,document.getElementById("fixPlanStats").textContent=`${e} tasks`,s.classList.add("show")},closeFixPlanModal(){const t=document.getElementById("fixPlanModal");t&&t.classList.remove("show")},async copyFixPlan(){const t=document.getElementById("fixPlanContent")?.value;t&&(await navigator.clipboard.writeText(t),this.notificationManager?.notify({urgency:"info",category:"fix-plan",title:"Copied",message:"Fix plan copied to clipboard"}))},async writeFixPlanToFile(){if(this.activeSessionId)try{const e=await(await fetch(`/api/sessions/${this.activeSessionId}/fix-plan/write`,{method:"POST"})).json();e.success?(this.notificationManager?.notify({urgency:"info",category:"fix-plan",title:"Written",message:`@fix_plan.md written to ${e.data.filePath}`}),this.closeFixPlanModal()):this.notificationManager?.notify({urgency:"error",category:"fix-plan",title:"Error",message:e.error||"Failed to write file"})}catch(t){console.error("Error writing fix plan:",t)}},async importFixPlanFromFile(){if(this.activeSessionId)try{const e=await(await fetch(`/api/sessions/${this.activeSessionId}/fix-plan/read`,{method:"POST"})).json();e.success?(this.notificationManager?.notify({urgency:"info",category:"fix-plan",title:"Imported",message:`Imported ${e.data.importedCount} tasks from @fix_plan.md`}),this.updateRalphState(this.activeSessionId,{todos:e.data.todos})):this.notificationManager?.notify({urgency:"warning",category:"fix-plan",title:"Not Found",message:e.error||"@fix_plan.md not found"})}catch(t){console.error("Error importing fix plan:",t)}},toggleRalphDetach(){const t=this.$("ralphStatePanel"),e=this.$("ralphDetachBtn");t&&(t.classList.contains("detached")?(t.classList.remove("detached"),t.style.top="",t.style.left="",t.style.width="",t.style.height="",e&&(e.innerHTML="⧉",e.title="Detach panel")):(t.classList.add("detached"),this.ralphStatePanelCollapsed=!1,t.classList.remove("collapsed"),e&&(e.innerHTML="⊞",e.title="Attach panel"),this.setupRalphDrag()),this.renderRalphStatePanel())},setupRalphDrag(){const t=this.$("ralphStatePanel"),e=this.$("ralphSummary");if(!t||!e)return;let s=!1,a,i,r,o;const l=p=>{if(p.target.closest("button")||p.target.closest(".ralph-toggle")||!t.classList.contains("detached"))return;s=!0,a=p.clientX,i=p.clientY;const d=t.getBoundingClientRect();r=d.left,o=d.top,document.addEventListener("mousemove",n),document.addEventListener("mouseup",c),p.preventDefault()},n=p=>{if(!s)return;const d=p.clientX-a,h=p.clientY-i;let u=r+d,m=o+h;const f=t.getBoundingClientRect();u=Math.max(0,Math.min(window.innerWidth-f.width,u)),m=Math.max(0,Math.min(window.innerHeight-f.height,m)),t.style.left=u+"px",t.style.top=m+"px"},c=()=>{s=!1,document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",c)};e.removeEventListener("mousedown",e._ralphDragHandler),e._ralphDragHandler=l,e.addEventListener("mousedown",l)},renderRalphStatePanel(){this.
|
|
17
|
+
`,document.body.appendChild(s)),document.getElementById("fixPlanContent").value=t,document.getElementById("fixPlanStats").textContent=`${e} tasks`,s.classList.add("show")},closeFixPlanModal(){const t=document.getElementById("fixPlanModal");t&&t.classList.remove("show")},async copyFixPlan(){const t=document.getElementById("fixPlanContent")?.value;t&&(await navigator.clipboard.writeText(t),this.notificationManager?.notify({urgency:"info",category:"fix-plan",title:"Copied",message:"Fix plan copied to clipboard"}))},async writeFixPlanToFile(){if(this.activeSessionId)try{const e=await(await fetch(`/api/sessions/${this.activeSessionId}/fix-plan/write`,{method:"POST"})).json();e.success?(this.notificationManager?.notify({urgency:"info",category:"fix-plan",title:"Written",message:`@fix_plan.md written to ${e.data.filePath}`}),this.closeFixPlanModal()):this.notificationManager?.notify({urgency:"error",category:"fix-plan",title:"Error",message:e.error||"Failed to write file"})}catch(t){console.error("Error writing fix plan:",t)}},async importFixPlanFromFile(){if(this.activeSessionId)try{const e=await(await fetch(`/api/sessions/${this.activeSessionId}/fix-plan/read`,{method:"POST"})).json();e.success?(this.notificationManager?.notify({urgency:"info",category:"fix-plan",title:"Imported",message:`Imported ${e.data.importedCount} tasks from @fix_plan.md`}),this.updateRalphState(this.activeSessionId,{todos:e.data.todos})):this.notificationManager?.notify({urgency:"warning",category:"fix-plan",title:"Not Found",message:e.error||"@fix_plan.md not found"})}catch(t){console.error("Error importing fix plan:",t)}},toggleRalphDetach(){const t=this.$("ralphStatePanel"),e=this.$("ralphDetachBtn");t&&(t.classList.contains("detached")?(t.classList.remove("detached"),t.style.top="",t.style.left="",t.style.width="",t.style.height="",e&&(e.innerHTML="⧉",e.title="Detach panel")):(t.classList.add("detached"),this.ralphStatePanelCollapsed=!1,t.classList.remove("collapsed"),e&&(e.innerHTML="⊞",e.title="Attach panel"),this.setupRalphDrag()),this.renderRalphStatePanel())},setupRalphDrag(){const t=this.$("ralphStatePanel"),e=this.$("ralphSummary");if(!t||!e)return;let s=!1,a,i,r,o;const l=p=>{if(p.target.closest("button")||p.target.closest(".ralph-toggle")||!t.classList.contains("detached"))return;s=!0,a=p.clientX,i=p.clientY;const d=t.getBoundingClientRect();r=d.left,o=d.top,document.addEventListener("mousemove",n),document.addEventListener("mouseup",c),p.preventDefault()},n=p=>{if(!s)return;const d=p.clientX-a,h=p.clientY-i;let u=r+d,m=o+h;const f=t.getBoundingClientRect();u=Math.max(0,Math.min(window.innerWidth-f.width,u)),m=Math.max(0,Math.min(window.innerHeight-f.height,m)),t.style.left=u+"px",t.style.top=m+"px"},c=()=>{s=!1,document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",c)};e.removeEventListener("mousedown",e._ralphDragHandler),e._ralphDragHandler=l,e.addEventListener("mousedown",l)},renderRalphStatePanel(){this._debouncedCall("ralphStatePanel",this._renderRalphStatePanelImmediate,50)},_renderRalphStatePanelImmediate(){const t=this.$("ralphStatePanel"),e=this.$("ralphToggle");if(!t)return;if(this.ralphClosedSessions.has(this.activeSessionId)){t.style.display="none";return}const s=this.ralphStates.get(this.activeSessionId),a=s?.loop?.enabled===!0,i=s?.loop?.active||s?.loop?.completionPhrase,r=s?.todos?.length>0,o=s?.circuitBreaker&&s.circuitBreaker.state!=="CLOSED",l=s?.statusBlock!==void 0;if(!a&&!i&&!r&&!o&&!l){t.style.display="none";return}t.style.display="";const n=s?.todos||[],c=n.filter(h=>h.status==="completed").length,p=n.length,d=p>0?Math.round(c/p*100):0;this.updateRalphRing(d),this.updateRalphStatus(s?.loop,c,p),this.updateRalphStats(s?.loop,c,p),this.updateCircuitBreakerBadge(s?.circuitBreaker),this.ralphStatePanelCollapsed?(t.classList.add("collapsed"),e&&(e.innerHTML="▼")):(t.classList.remove("collapsed"),e&&(e.innerHTML="▲"),this.updateRalphExpandedView(s))},updateRalphRing(t){const e=Math.max(0,Math.min(100,Number(t)||0)),s=this.$("ralphRingMiniProgress"),a=this.$("ralphRingMiniText");if(s){const o=100-e;s.style.strokeDashoffset=o}a&&(a.textContent=`${e}%`);const i=this.$("ralphRingProgress"),r=this.$("ralphRingPercent");if(i){const o=264-264*e/100;i.style.strokeDashoffset=o}r&&(r.textContent=`${e}%`)},updateRalphStatus(t,e=0,s=0){const a=this.$("ralphStatusBadge"),i=a?.querySelector(".ralph-status-text");!a||!i||(a.classList.remove("active","completed","tracking"),t?.active?(a.classList.add("active"),i.textContent="Running"):s>0&&e===s?(a.classList.add("completed"),i.textContent="Complete"):t?.enabled||s>0?(a.classList.add("tracking"),i.textContent="Tracking"):i.textContent="Idle")},updateCircuitBreakerBadge(t){let e=this.$("ralphCircuitBreakerBadge");if(!e){const s=this.$("ralphSummary");if(!s)return;if(e=s.querySelector(".ralph-circuit-breaker"),!e){e=document.createElement("div"),e.id="ralphCircuitBreakerBadge",e.className="ralph-circuit-breaker";const a=this.$("ralphStatusBadge");a&&a.nextSibling?a.parentNode.insertBefore(e,a.nextSibling):s.appendChild(e)}}if(!t||t.state==="CLOSED"){e.style.display="none";return}e.style.display="",e.classList.remove("half-open","open"),t.state==="HALF_OPEN"?(e.classList.add("half-open"),e.innerHTML='<span class="cb-icon">\u26A0</span><span class="cb-text">Warning</span>',e.title=t.reason||"Circuit breaker warning"):t.state==="OPEN"&&(e.classList.add("open"),e.innerHTML='<span class="cb-icon">\u{1F6D1}</span><span class="cb-text">Stuck</span>',e.title=t.reason||"Loop appears stuck"),e.onclick=()=>this.resetCircuitBreaker()},updateRalphStats(t,e,s){const a=this.$("ralphStatTime");if(a)if(t?.elapsedHours!==null&&t?.elapsedHours!==void 0)a.textContent=this.formatRalphTime(t.elapsedHours);else if(t?.startedAt){const o=(Date.now()-t.startedAt)/36e5;a.textContent=this.formatRalphTime(o)}else a.textContent="0m";const i=this.$("ralphStatCycles");i&&(t?.maxIterations?i.textContent=`${t.cycleCount||0}/${t.maxIterations}`:i.textContent=String(t?.cycleCount||0));const r=this.$("ralphStatTasks");r&&(r.textContent=`${e}/${s}`)},formatRalphTime(t){if(t<.0167)return"0m";if(t<1)return`${Math.round(t*60)}m`;const e=Math.floor(t),s=Math.round((t-e)*60);return s===0?`${e}h`:`${e}h ${s}m`},updateRalphExpandedView(t){const e=this.$("ralphPhrase");e&&(e.textContent=t?.loop?.completionPhrase||"--");const s=this.$("ralphElapsed");if(s)if(t?.loop?.elapsedHours!==null&&t?.loop?.elapsedHours!==void 0)s.textContent=this.formatRalphTime(t.loop.elapsedHours);else if(t?.loop?.startedAt){const l=(Date.now()-t.loop.startedAt)/36e5;s.textContent=this.formatRalphTime(l)}else s.textContent="0m";const a=this.$("ralphIterations");a&&(t?.loop?.maxIterations?a.textContent=`${t.loop.cycleCount||0} / ${t.loop.maxIterations}`:a.textContent=String(t?.loop?.cycleCount||0));const i=t?.todos||[],r=i.filter(l=>l.status==="completed").length,o=this.$("ralphTasksCount");o&&(o.textContent=`${r}/${i.length}`),t?.loop?.planVersion?this.updatePlanVersionDisplay(t.loop.planVersion,t.loop.planHistoryLength||1):this.updatePlanVersionDisplay(null,0),this.renderRalphTasks(i),this.renderRalphStatusBlock(t?.statusBlock)},renderRalphStatusBlock(t){let e=this.$("ralphStatusBlockDisplay");const s=this.$("ralphExpandedContent");if(!t){e&&e.remove();return}if(!e&&s&&(e=document.createElement("div"),e.id="ralphStatusBlockDisplay",e.className="ralph-status-block",s.insertBefore(e,s.firstChild)),!e)return;const a=t.status==="IN_PROGRESS"?"in-progress":t.status==="COMPLETE"?"complete":t.status==="BLOCKED"?"blocked":"",i=t.testsStatus==="PASSING"?"\u2705":t.testsStatus==="FAILING"?"\u274C":"\u23F8",r=t.workType==="IMPLEMENTATION"?"\u{1F527}":t.workType==="TESTING"?"\u{1F9EA}":t.workType==="DOCUMENTATION"?"\u{1F4DD}":t.workType==="REFACTORING"?"\u267B\uFE0F":"\u{1F4CB}";let o=`
|
|
18
18
|
<div class="ralph-status-block-header">
|
|
19
19
|
<span>RALPH_STATUS</span>
|
|
20
20
|
<span class="ralph-status-block-status ${a}">${escapeHtml(t.status)}</span>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|