@dyyz1993/codenomad 0.15.9 → 0.15.12
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/auth/manager.js +2 -1
- package/dist/auth/session-manager.js +45 -1
- package/dist/bin.js +0 -0
- package/dist/index.js +1 -0
- package/dist/workspaces/manager.js +51 -0
- package/package.json +1 -1
- package/public/assets/{ChangesTab-DQO3bwTw.js → ChangesTab-h08b8O7N.js} +2 -2
- package/public/assets/{DiffToolbar-BiS5nvB_.js → DiffToolbar-cyGXeLSS.js} +1 -1
- package/public/assets/{FilesTab-YO5dUGk6.js → FilesTab-BllBGQrB.js} +2 -2
- package/public/assets/{GitChangesTab-C-2jwtOS.js → GitChangesTab-DdEtS8VU.js} +2 -2
- package/public/assets/{SplitFilePanel-CA0D92l1.js → SplitFilePanel-Bill25lM.js} +1 -1
- package/public/assets/{StatusTab-TyebZVp2.js → StatusTab-C8FMxzyK.js} +1 -1
- package/public/assets/{align-justify-COuYjEB9.js → align-justify-d8O2iwpx.js} +1 -1
- package/public/assets/{bundle-full-DPp09th5.js → bundle-full-DS3qEgVu.js} +1 -1
- package/public/assets/{diff-viewer-Bu4zb5kE.js → diff-viewer-BQjyAOaf.js} +1 -1
- package/public/assets/{index-BDgGoLTZ.js → index-5RAw7gXh.js} +1 -1
- package/public/assets/{index-4Era_AEC.js → index-BhrKP65n.js} +1 -1
- package/public/assets/{index-nVoKL-cq.js → index-Bvvj_24o.js} +1 -1
- package/public/assets/{index-PHCXc0OA.js → index-CA1854v0.js} +1 -1
- package/public/assets/{index-BCGPLzO4.js → index-DD4SyatU.js} +2 -2
- package/public/assets/{index-CbKJK9y3.js → index-DIVuya9y.js} +1 -1
- package/public/assets/{index-D7V1TD3s.js → index-DW5zrp3y.js} +1 -1
- package/public/assets/{index-CpWDdROQ.js → index-EwiZC5ky.js} +1 -1
- package/public/assets/{index-CtBkkWFK.js → index-sxXJQeVv.js} +1 -1
- package/public/assets/{loading-B-F_vBbv.js → loading-Bxde4rtI.js} +1 -1
- package/public/assets/main-Blt0PWLX.js +57 -0
- package/public/assets/{markdown-0Y5sUdRs.js → markdown-B-4jLKel.js} +3 -3
- package/public/assets/{monaco-viewer-YY9yfE-p.js → monaco-viewer-CNzvK57I.js} +1 -1
- package/public/assets/{tool-call-CE2RkP4E.js → tool-call-Bb1tq3UI.js} +3 -3
- package/public/assets/{unified-picker-_n2WoeTG.js → unified-picker-DimB1aiI.js} +1 -1
- package/public/assets/{wrap-text-DVQ19pj7.js → wrap-text-CW6wvBi8.js} +1 -1
- package/public/index.html +4 -4
- package/public/loading.html +4 -4
- package/public/sw.js +1 -1
- package/public/ui-version.json +1 -1
- package/public/assets/main-BbYl9PoY.js +0 -57
package/dist/auth/manager.js
CHANGED
|
@@ -10,9 +10,10 @@ export class AuthManager {
|
|
|
10
10
|
constructor(init, logger) {
|
|
11
11
|
this.init = init;
|
|
12
12
|
this.logger = logger;
|
|
13
|
-
this.sessionManager = new SessionManager();
|
|
14
13
|
this.cookieName = sanitizeCookieName(init.cookieName);
|
|
15
14
|
this.authEnabled = !Boolean(init.dangerouslySkipAuth);
|
|
15
|
+
const configDir = path.dirname(path.resolve(init.configPath.replace(/^~/, process.env.HOME ?? "")));
|
|
16
|
+
this.sessionManager = new SessionManager(configDir);
|
|
16
17
|
if (!this.authEnabled) {
|
|
17
18
|
this.authStore = null;
|
|
18
19
|
this.tokenManager = null;
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import crypto from "crypto";
|
|
2
|
+
import os from "os";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { readFile, writeFile, mkdir } from "node:fs/promises";
|
|
5
|
+
import { existsSync } from "node:fs";
|
|
2
6
|
const SESSION_TTL_MS = 315360000 * 1000; // 10 years in ms
|
|
3
7
|
const CLEANUP_INTERVAL_MS = 30 * 60 * 1000;
|
|
4
8
|
export class SessionManager {
|
|
5
|
-
constructor() {
|
|
9
|
+
constructor(configDir) {
|
|
6
10
|
this.sessions = new Map();
|
|
11
|
+
this.stateFilePath = path.join(configDir ?? path.join(os.homedir(), ".config", "codenomad"), "sessions-state.json");
|
|
12
|
+
void this.loadState();
|
|
7
13
|
this.cleanupTimer = setInterval(() => this.cleanupExpired(), CLEANUP_INTERVAL_MS);
|
|
8
14
|
}
|
|
9
15
|
createSession(username) {
|
|
10
16
|
const id = crypto.randomBytes(32).toString("base64url");
|
|
11
17
|
const info = { id, createdAt: Date.now(), username };
|
|
12
18
|
this.sessions.set(id, info);
|
|
19
|
+
void this.saveState();
|
|
13
20
|
return info;
|
|
14
21
|
}
|
|
15
22
|
getSession(id) {
|
|
@@ -36,11 +43,48 @@ export class SessionManager {
|
|
|
36
43
|
}
|
|
37
44
|
cleanupExpired() {
|
|
38
45
|
const now = Date.now();
|
|
46
|
+
let changed = false;
|
|
39
47
|
for (const [id, info] of this.sessions) {
|
|
40
48
|
if (now - info.createdAt > SESSION_TTL_MS) {
|
|
41
49
|
this.sessions.delete(id);
|
|
50
|
+
changed = true;
|
|
42
51
|
}
|
|
43
52
|
}
|
|
53
|
+
if (changed) {
|
|
54
|
+
void this.saveState();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async saveState() {
|
|
58
|
+
const data = Array.from(this.sessions.entries()).map(([id, info]) => ({
|
|
59
|
+
id,
|
|
60
|
+
username: info.username,
|
|
61
|
+
createdAt: info.createdAt,
|
|
62
|
+
}));
|
|
63
|
+
try {
|
|
64
|
+
await mkdir(path.dirname(this.stateFilePath), { recursive: true });
|
|
65
|
+
await writeFile(this.stateFilePath, JSON.stringify(data, null, 2), "utf-8");
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// silently fail
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async loadState() {
|
|
72
|
+
try {
|
|
73
|
+
if (!existsSync(this.stateFilePath))
|
|
74
|
+
return;
|
|
75
|
+
const content = await readFile(this.stateFilePath, "utf-8");
|
|
76
|
+
const entries = JSON.parse(content);
|
|
77
|
+
for (const entry of entries) {
|
|
78
|
+
this.sessions.set(entry.id, {
|
|
79
|
+
id: entry.id,
|
|
80
|
+
username: entry.username,
|
|
81
|
+
createdAt: entry.createdAt,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
// silently fail
|
|
87
|
+
}
|
|
44
88
|
}
|
|
45
89
|
shutdown() {
|
|
46
90
|
if (this.cleanupTimer) {
|
package/dist/bin.js
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import os from "os";
|
|
1
2
|
import path from "path";
|
|
2
3
|
import { execFile } from "node:child_process";
|
|
3
4
|
import { promisify } from "node:util";
|
|
4
5
|
import { connect } from "net";
|
|
6
|
+
import { readFile, writeFile, mkdir } from "node:fs/promises";
|
|
7
|
+
import { existsSync } from "node:fs";
|
|
5
8
|
const execFileAsync = promisify(execFile);
|
|
6
9
|
import { FileSystemBrowser } from "../filesystem/browser";
|
|
7
10
|
import { searchWorkspaceFiles } from "../filesystem/search";
|
|
@@ -42,8 +45,52 @@ export class WorkspaceManager {
|
|
|
42
45
|
this.workspaceBusy = new Map();
|
|
43
46
|
this.runtime = new WorkspaceRuntime(this.options.eventBus, this.options.logger);
|
|
44
47
|
this.opencodeConfigDir = getOpencodeConfigDir();
|
|
48
|
+
this.stateFilePath = path.join(this.options.configDir ?? path.join(os.homedir(), ".config", "codenomad"), "workspaces-state.json");
|
|
49
|
+
void this.loadState();
|
|
45
50
|
this.startIdleCheck();
|
|
46
51
|
}
|
|
52
|
+
async saveState() {
|
|
53
|
+
const data = Array.from(this.workspaces.entries()).map(([id, w]) => ({
|
|
54
|
+
id,
|
|
55
|
+
path: w.path,
|
|
56
|
+
name: w.name,
|
|
57
|
+
proxyPath: w.proxyPath,
|
|
58
|
+
}));
|
|
59
|
+
try {
|
|
60
|
+
await mkdir(path.dirname(this.stateFilePath), { recursive: true });
|
|
61
|
+
await writeFile(this.stateFilePath, JSON.stringify(data, null, 2), "utf-8");
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
this.options.logger.warn({ err }, "Failed to save workspaces state");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async loadState() {
|
|
68
|
+
try {
|
|
69
|
+
if (!existsSync(this.stateFilePath))
|
|
70
|
+
return;
|
|
71
|
+
const content = await readFile(this.stateFilePath, "utf-8");
|
|
72
|
+
const entries = JSON.parse(content);
|
|
73
|
+
for (const entry of entries) {
|
|
74
|
+
this.workspaces.set(entry.id, {
|
|
75
|
+
id: entry.id,
|
|
76
|
+
path: entry.path,
|
|
77
|
+
name: entry.name,
|
|
78
|
+
status: "suspended",
|
|
79
|
+
proxyPath: entry.proxyPath ?? `/workspaces/${entry.id}/worktrees/root/instance`,
|
|
80
|
+
binaryId: "",
|
|
81
|
+
binaryLabel: "",
|
|
82
|
+
createdAt: new Date().toISOString(),
|
|
83
|
+
updatedAt: new Date().toISOString(),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (entries.length > 0) {
|
|
87
|
+
this.options.logger.info({ count: entries.length }, "Restored workspaces from disk");
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
this.options.logger.warn({ err }, "Failed to load workspaces state");
|
|
92
|
+
}
|
|
93
|
+
}
|
|
47
94
|
list() {
|
|
48
95
|
return Array.from(this.workspaces.values());
|
|
49
96
|
}
|
|
@@ -148,6 +195,7 @@ export class WorkspaceManager {
|
|
|
148
195
|
this.options.eventBus.publish({ type: "workspace.started", workspace: descriptor });
|
|
149
196
|
this.recordActivity(id);
|
|
150
197
|
this.options.logger.info({ workspaceId: id, port }, "Workspace ready");
|
|
198
|
+
void this.saveState();
|
|
151
199
|
return descriptor;
|
|
152
200
|
}
|
|
153
201
|
catch (error) {
|
|
@@ -181,6 +229,7 @@ export class WorkspaceManager {
|
|
|
181
229
|
if (!wasRunning) {
|
|
182
230
|
this.options.eventBus.publish({ type: "workspace.stopped", workspaceId: id });
|
|
183
231
|
}
|
|
232
|
+
void this.saveState();
|
|
184
233
|
return workspace;
|
|
185
234
|
}
|
|
186
235
|
async shutdown() {
|
|
@@ -464,6 +513,7 @@ export class WorkspaceManager {
|
|
|
464
513
|
this.options.eventBus.publish({ type: "workspace.suspended", workspace: { ...workspace } });
|
|
465
514
|
this.lastActivityTime.delete(id);
|
|
466
515
|
this.workspaceBusy.delete(id);
|
|
516
|
+
void this.saveState();
|
|
467
517
|
}
|
|
468
518
|
async resumeWorkspace(id) {
|
|
469
519
|
const workspace = this.workspaces.get(id);
|
|
@@ -524,6 +574,7 @@ export class WorkspaceManager {
|
|
|
524
574
|
this.recordActivity(id);
|
|
525
575
|
this.options.eventBus.publish({ type: "workspace.resumed", workspace: { ...workspace } });
|
|
526
576
|
this.options.logger.info({ workspaceId: id, port }, "Workspace resumed");
|
|
577
|
+
void this.saveState();
|
|
527
578
|
return workspace;
|
|
528
579
|
}
|
|
529
580
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-
|
|
2
|
-
import{_ as K}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-CNzvK57I.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as K}from"./index-DD4SyatU.js";import{m as B,t as g,i as a,d as w,a as z,f as N}from"./monaco-viewer-CNzvK57I.js";import{c as f,n as c,a as L,F,S as W,z as j,A as q}from"./git-diff-vendor-CSgooKT_.js";import{D as G}from"./DiffToolbar-cyGXeLSS.js";import{S as H}from"./SplitFilePanel-Bill25lM.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-Blt0PWLX.js";import"./align-justify-d8O2iwpx.js";import"./wrap-text-CW6wvBi8.js";var J=g('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),T=g("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Q=g('<div class="p-3 text-xs text-secondary">'),E=g("<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-"),U=g("<span class=files-tab-selected-path><span class=file-path-text>"),X=g('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Y=g("<div style=margin-left:auto>");const Z=q(()=>K(()=>import("./monaco-viewer-CNzvK57I.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),ce=e=>{const M=f(()=>e.activeSessionId()),S=f(()=>!!(M()&&M()!=="info")),D=f(()=>S()?e.activeSessionDiffs():null),m=f(()=>{const n=D();return Array.isArray(n)?[...n].sort((i,l)=>String(i.file||"").localeCompare(String(l.file||""))):[]}),R=f(()=>m().reduce((n,i)=>(n.additions+=typeof i.additions=="number"?i.additions:0,n.deletions+=typeof i.deletions=="number"?i.deletions:0,n),{additions:0,deletions:0})),I=f(()=>{const n=m();return n.length===0?null:n.reduce((i,l)=>{const v=typeof(i==null?void 0:i.additions)=="number"?i.additions:0,y=typeof(i==null?void 0:i.deletions)=="number"?i.deletions:0,x=v+y,k=typeof(l==null?void 0:l.additions)=="number"?l.additions:0,t=typeof(l==null?void 0:l.deletions)=="number"?l.deletions:0,r=k+t;return r>x?l:r<x?i:String(l.file||"").localeCompare(String((i==null?void 0:i.file)||""))<0?l:i},n[0])}),P=f(()=>{const n=e.selectedFile(),i=m();if(n){const l=i.find(v=>v.file===n);if(l)return l}return I()}),O=f(()=>`${e.instanceId}:${S()?M():"no-session"}`),V=f(()=>{if(!S())return e.t("instanceShell.sessionChanges.noSessionSelected");const n=D();return n===void 0?e.t("instanceShell.sessionChanges.loading"):!Array.isArray(n)||n.length===0?e.t("instanceShell.sessionChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty")}),A=f(()=>{const n=P();return n!=null&&n.file?String(n.file):e.t("instanceShell.rightPanel.tabs.changes")});return B(()=>{const n=m(),i=R(),l=P(),v=()=>(()=>{var t=J(),r=t.firstChild;return a(r,c(W,{get when(){return l&&S()&&n.length>0?l:null},get fallback(){return(()=>{var d=T(),s=d.firstChild;return a(s,V),d})()},children:d=>c(j,{get fallback(){return(()=>{var s=T(),u=s.firstChild;return a(u,()=>e.t("instanceInfo.loading")),s})()},get children(){return c(Z,{get scopeKey(){return O()},get path(){return String(d().file||"")},get patch(){return String(d().patch||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})),t})(),y=()=>(()=>{var t=Q();return a(t,V),t})();return c(H,{get header(){return[(()=>{var t=U(),r=t.firstChild;return a(r,A),L(()=>w(t,"title",A())),t})(),(()=>{var t=X(),r=t.firstChild,d=r.firstChild;d.firstChild;var s=r.nextSibling,u=s.firstChild;return u.firstChild,a(d,()=>i.additions,null),a(u,()=>i.deletions,null),t})(),(()=>{var t=Y();return a(t,c(G,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})),t})()]},list:{panel:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,e.isPhoneLayout())},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(s,"title",o.t=$),o},{e:void 0,t:void 0}),r})()})}}),overlay:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,!0)},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file,p=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(r,"title",o.t=$),p!==o.a&&w(s,"title",o.a=p),o},{e:void 0,t:void 0,a:void 0}),r})()})}})},get viewer(){return v()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.changes")}})})};N(["click"]);export{ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-
|
|
1
|
+
import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-CNzvK57I.js";import{u as T}from"./index-DD4SyatU.js";import{n as o,m as $,a as V}from"./git-diff-vendor-CSgooKT_.js";import{I as U,S as A,K as I}from"./main-Blt0PWLX.js";import{A as D}from"./align-justify-d8O2iwpx.js";import{W as E}from"./wrap-text-CW6wvBi8.js";const F=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],H=t=>o(U,$(t,{name:"UnfoldVertical",iconNode:F}));var N=g("<div class=file-viewer-toolbar><button type=button class=file-viewer-toolbar-icon-button></button><button type=button class=file-viewer-toolbar-icon-button></button><button type=button>");const z=t=>{const{t:a}=T(),d=()=>t.viewMode==="split"?"unified":"split",s=()=>t.contextMode==="collapsed"?"expanded":"collapsed",f=()=>t.wordWrapMode==="on"?"off":"on",h=()=>d()==="split"?a("instanceShell.diff.switchToSplit"):a("instanceShell.diff.switchToUnified"),v=()=>s()==="collapsed"?a("instanceShell.diff.hideUnchanged"):a("instanceShell.diff.showFull"),u=()=>f()==="on"?a("instanceShell.diff.enableWordWrap"):a("instanceShell.diff.disableWordWrap");return(()=>{var b=N(),n=b.firstChild,l=n.nextSibling,r=l.nextSibling;return n.$$click=()=>t.onViewModeChange(d()),c(n,(()=>{var e=W(()=>d()==="split");return()=>e()?o(A,{class:"h-4 w-4","aria-hidden":"true"}):o(D,{class:"h-4 w-4","aria-hidden":"true"})})()),l.$$click=()=>t.onContextModeChange(s()),c(l,(()=>{var e=W(()=>s()==="collapsed");return()=>e()?o(I,{class:"h-4 w-4","aria-hidden":"true"}):o(H,{class:"h-4 w-4","aria-hidden":"true"})})()),r.$$click=()=>t.onWordWrapModeChange(f()),c(r,o(E,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=h(),w=h(),M=v(),p=v(),x=`file-viewer-toolbar-icon-button${t.wordWrapMode==="on"?" active":""}`,k=u(),y=u();return m!==e.e&&i(n,"aria-label",e.e=m),w!==e.t&&i(n,"title",e.t=w),M!==e.a&&i(l,"aria-label",e.a=M),p!==e.o&&i(l,"title",e.o=p),x!==e.i&&S(r,e.i=x),k!==e.n&&i(r,"aria-label",e.n=k),y!==e.s&&i(r,"title",e.s=y),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),b})()};C(["click"]);export{z as D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-
|
|
2
|
-
import{_ as G}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-CNzvK57I.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as G}from"./index-DD4SyatU.js";import{Z as J,m,t as h,i as s,d as u,a as C,u as U,f as X}from"./monaco-viewer-CNzvK57I.js";import{n as o,m as Y,d as A,b as P,c as $,S as g,a as w,z as p,A as ee,F as te}from"./git-diff-vendor-CSgooKT_.js";import{S as le}from"./SplitFilePanel-Bill25lM.js";import{I as ne,R as K,M as re,N as ae,C as ie,e as se,O as oe}from"./main-Blt0PWLX.js";import{W as ce}from"./wrap-text-CW6wvBi8.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const de=[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]],he=e=>o(ne,Y(e,{name:"Save",iconNode:de}));var ue=h('<div class="px-2 py-2 border-b border-base"><div class=selector-input-group><div class="flex items-center gap-2 px-3 text-muted"></div><input type=text class=selector-input>'),ve=h("<div class=file-list-header><span class=file-list-title></span><span class=file-list-count>"),O=h('<div class="p-3 text-xs text-secondary">'),fe=h("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),ge=h('<div class="p-3 text-xs text-error">'),we=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class="flex items-center gap-2 shrink-0"><div class=file-list-item-stats><span class="text-[10px] text-secondary"></span></div><button type=button class=git-change-row-action>'),k=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Se=h('<div class="file-viewer-panel flex-1"><div>'),be=h('<div class="h-full outline-none"tabindex=0>'),me=h("<span>"),$e=h("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),ye=h("<button type=button style=margin-inline-start:auto>"),_e=h("<button type=button>"),q=h("<button type=button class=files-header-icon-button>"),Ce=h("<span class=text-error>");const ke=ee(()=>G(()=>import("./monaco-viewer-CNzvK57I.js").then(e=>e.ae),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoFileViewer})));function xe(e){return e?/\.(md|markdown|mdown|mkdn)$/i.test(e):!1}const Ie=e=>{const[E,L]=A(""),{isDark:N}=J(),[Q,M]=A(!1);let S;P(()=>{e.browserPath(),L("")});const H=$(()=>[...e.browserEntries()||[]].sort((i,d)=>{const l=i.type==="directory"?0:1,t=d.type==="directory"?0:1;return l!==t?l-t:String(i.name||"").localeCompare(String(d.name||""))})),W=$(()=>E().trim().toLowerCase()),x=$(()=>{const n=W(),i=H();return n?i.filter(d=>String(d.name||"").toLowerCase().includes(n)):i}),y=()=>e.browserLoading()&&e.browserEntries()===null,Z=()=>W()?e.t("instanceShell.filesShell.search.empty"):e.t("instanceShell.filesShell.listEmpty"),_=$(()=>xe(e.browserSelectedPath())),b=$(()=>_()&&Q());P(()=>{_()||M(!1)});const D=()=>{const n=e.browserSelectedContent();n!=null&&e.onSave(n)},j=async(n,i)=>{i==null||i.stopPropagation();const d=await se(n);oe({message:d?e.t("instanceShell.filesShell.toast.copyPathSuccess"):e.t("instanceShell.filesShell.toast.copyPathError"),variant:d?"success":"error"})};P(()=>{b()&&requestAnimationFrame(()=>S==null?void 0:S.focus())});const T=()=>[(()=>{var n=ue(),i=n.firstChild,d=i.firstChild,l=d.nextSibling;return s(d,o(ae,{class:"w-4 h-4"})),l.$$input=t=>L(t.currentTarget.value),w(t=>{var a=e.t("instanceShell.filesShell.search.placeholder"),r=e.t("instanceShell.filesShell.search.ariaLabel");return a!==t.e&&u(l,"placeholder",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),t},{e:void 0,t:void 0}),w(()=>l.value=E()),n})(),(()=>{var n=ve(),i=n.firstChild,d=i.nextSibling;return s(i,()=>e.t("instanceShell.filesShell.fileListTitle")),s(d,()=>x().length),n})(),o(g,{get when(){return e.parentPath()},children:n=>(()=>{var i=fe(),d=i.firstChild,l=d.firstChild;return i.$$click=()=>e.onLoadEntries(n()),w(()=>u(l,"title",n())),i})()}),o(g,{get when(){return y()},get children(){var n=O();return s(n,()=>e.t("instanceInfo.loading")),n}}),o(g,{get when(){return m(()=>!e.browserError()&&!y())()&&x().length>0},get fallback(){return m(()=>!y())()?m(()=>!!e.browserError())()?(()=>{var n=ge();return s(n,()=>e.browserError()),n})():(()=>{var n=O();return s(n,Z),n})():void 0},get children(){return o(te,{get each(){return x()},children:n=>(()=>{var i=we(),d=i.firstChild,l=d.firstChild,t=l.firstChild,a=l.nextSibling,r=a.firstChild,c=r.firstChild,f=r.nextSibling;return i.$$click=()=>{if(n.type==="directory"){e.onLoadEntries(n.path);return}e.onRequestOpenFile(n.path)},s(t,()=>n.name),s(c,()=>n.type),f.$$click=v=>void j(n.path,v),s(f,o(ie,{class:"w-3 h-3"})),w(v=>{var F=`file-list-item ${e.browserSelectedPath()===n.path?"file-list-item-active":""}`,z=n.path,I=n.path,R=e.t("instanceShell.filesShell.actions.copyPath"),V=e.t("instanceShell.filesShell.actions.copyPath");return F!==v.e&&C(i,v.e=F),z!==v.t&&u(i,"title",v.t=z),I!==v.a&&u(l,"title",v.a=I),R!==v.o&&u(f,"title",v.o=R),V!==v.i&&u(f,"aria-label",v.i=V),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i})()})}})],B=n=>{!(n.ctrlKey||n.metaKey)||n.key.toLowerCase()!=="s"||e.browserSelectedSaving()||!e.browserSelectedDirty()||(n.preventDefault(),D())};return m(()=>{const n=()=>e.browserSelectedPath()||e.browserPath(),i=()=>y()?e.t("instanceInfo.loading"):e.t("instanceShell.filesShell.viewerEmpty"),d=()=>(()=>{var l=Se(),t=l.firstChild;return s(t,o(g,{get when(){return e.browserSelectedLoading()},get fallback(){return o(g,{get when(){return e.browserSelectedError()},get fallback(){return o(g,{get when(){return m(()=>!!(e.browserSelectedPath()&&e.browserSelectedContent()!==null))()?{path:e.browserSelectedPath(),content:e.browserSelectedContent()}:null},get fallback(){return(()=>{var a=k(),r=a.firstChild;return s(r,i),a})()},children:a=>o(g,{get when(){return b()},get fallback(){return o(p,{get fallback(){return(()=>{var r=k(),c=r.firstChild;return s(c,()=>e.t("instanceInfo.loading")),r})()},get children(){return o(ke,{get scopeKey(){return e.scopeKey()},get path(){return a().path},get content(){return a().content},get wordWrap(){return e.wordWrapMode()},get onSave(){return e.onSave},get onContentChange(){return e.onContentChange}})}})},get children(){var r=be();r.$$mousedown=()=>S==null?void 0:S.focus(),r.$$keydown=B;var c=S;return typeof c=="function"?U(c,r):S=r,s(r,o(re,{get part(){return{type:"text",text:a().content}},get isDark(){return N()},escapeRawHtml:!0})),r}})})},children:a=>(()=>{var r=k(),c=r.firstChild;return s(c,a),r})()})},get children(){var a=k(),r=a.firstChild;return s(r,()=>e.t("instanceInfo.loading")),a}})),w(()=>C(t,b()?"file-viewer-content":"file-viewer-content file-viewer-content--monaco")),l})();return o(le,{get header(){return[(()=>{var l=$e(),t=l.firstChild,a=t.firstChild,r=a.firstChild;return s(r,n),s(l,o(g,{get when(){return e.browserLoading()},get children(){var c=me();return s(c,()=>e.t("instanceInfo.loading")),c}}),null),s(l,o(g,{get when(){return e.browserError()},children:c=>(()=>{var f=Ce();return s(f,c),f})()}),null),w(()=>u(a,"title",n())),l})(),(()=>{var l=ye();return l.$$click=()=>_()&&M(t=>!t),s(l,(()=>{var t=m(()=>!!b());return()=>t()?e.t("instanceShell.filesShell.showSource"):e.t("instanceShell.filesShell.previewMarkdown")})()),w(t=>{var a=`file-viewer-toolbar-button${b()?" active":""}`,r=!_();return a!==t.e&&C(l,t.e=a),r!==t.t&&(l.disabled=t.t=r),t},{e:void 0,t:void 0}),l})(),(()=>{var l=_e();return l.$$click=()=>e.onWordWrapModeChange(e.wordWrapMode()==="on"?"off":"on"),s(l,o(ce,{class:"h-4 w-4"})),w(t=>{var a=`file-viewer-toolbar-icon-button${e.wordWrapMode()==="on"?" active":""}`,r=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),c=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),f=b();return a!==t.e&&C(l,t.e=a),r!==t.t&&u(l,"title",t.t=r),c!==t.a&&u(l,"aria-label",t.a=c),f!==t.o&&(l.disabled=t.o=f),t},{e:void 0,t:void 0,a:void 0,o:void 0}),l})(),(()=>{var l=q();return l.$$click=D,s(l,o(g,{get when(){return e.browserSelectedSaving()},get fallback(){return o(he,{class:"h-4 w-4"})},get children(){return o(K,{class:"h-4 w-4 animate-spin"})}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",r=e.t("instanceShell.rightPanel.actions.save")||"Save",c=e.browserSelectedSaving()||!e.browserSelectedDirty();return a!==t.e&&u(l,"title",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})(),(()=>{var l=q();return l.$$click=()=>e.onRefresh(),s(l,o(K,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.refresh"),r=e.t("instanceShell.rightPanel.actions.refresh"),c=e.browserLoading();return a!==t.e&&u(l,"title",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})()]},list:{panel:()=>o(T,{}),overlay:()=>o(T,{})},get viewer(){return d()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.files")}})})};X(["input","click","keydown","mousedown"]);export{Ie as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-
|
|
2
|
-
import{_ as se}from"./index-BCGPLzO4.js";import{m as R,t as h,i as n,d as b,h as U,a as H,f as le}from"./monaco-viewer-YY9yfE-p.js";import{n as r,m as re,c as m,a as L,S as w,F as J,z as ce,A as oe}from"./git-diff-vendor-CSgooKT_.js";import{D as de}from"./DiffToolbar-BiS5nvB_.js";import{S as ge}from"./SplitFilePanel-CA0D92l1.js";import{I as he,G as ue,R as fe,H as j,J as Q}from"./main-BbYl9PoY.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./align-justify-COuYjEB9.js";import"./wrap-text-DVQ19pj7.js";const me=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],ve=e=>r(he,re(e,{name:"GitBranch",iconNode:me}));var V=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Ce=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),$e=h('<div class="p-3 text-xs text-secondary">'),be=h('<span class="git-change-row-action-bar git-change-row-action-bar-vertical">'),_e=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=git-change-list-item-right><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-</span></div></div></div><div class=git-change-list-item-actions-zone><div class=git-change-list-item-actions><button type=button class=git-change-row-action><span aria-hidden=true><span class="git-change-row-action-bar git-change-row-action-bar-horizontal">'),we=h("<div class=git-change-section-items>"),Se=h("<div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title></span></span><span class=git-change-section-count>"),ye=h('<div class=git-change-section-items><div class=git-change-commit-box><div class=git-change-commit-input-wrap><textarea class=git-change-commit-input rows=1></textarea><button type=button class="git-change-commit-button git-change-commit-button-overlay">'),xe=h("<div class=git-change-sections><div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title-row><span class=git-change-section-title></span></span></span><span class=git-change-section-count>"),Ie=h('<span class="status-indicator session-status-list worktree-indicator git-change-section-badge"><span class=worktree-indicator-label>'),Me=h("<span class=files-tab-selected-path><span class=file-path-text>"),ke=h('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Le=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Ee=h("<span class=text-error>");const Pe=oe(()=>se(()=>import("./monaco-viewer-YY9yfE-p.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),Ke=e=>{const T=m(()=>e.activeSessionId()),W=m(()=>!!(T()&&T()!=="info")),A=m(()=>W()?e.entries():null),X=m(()=>{const o=A();return Array.isArray(o)?[...o].sort((d,x)=>String(d.path||"").localeCompare(String(x.path||""))):[]}),S=m(()=>ue(X())),Y=m(()=>S().reduce((o,d)=>(o.additions+=typeof d.additions=="number"?d.additions:0,o.deletions+=typeof d.deletions=="number"?d.deletions:0,o),{additions:0,deletions:0})),z=m(()=>S().filter(o=>o.section==="staged")),Z=m(()=>S().filter(o=>o.section==="unstaged")),p=m(()=>z().length>0&&e.commitMessage().trim().length>0&&!e.commitSubmitting()),ee=m(()=>{const o=S(),d=e.selectedItemId(),x=e.mostChangedItemId(),I=o.find(E=>E.id===d)||(x?o.find(E=>E.id===x):void 0);return(I==null?void 0:I.entry)??null}),D=m(()=>W()?A()===null?e.t("instanceShell.gitChanges.loading"):S().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected")),te=m(()=>e.selectedError()===e.t("instanceShell.gitChanges.binaryViewer"));return R(()=>{const o=Y(),d=ee(),x=S(),I=z(),E=Z(),ne=()=>(()=>{var t=Ce(),l=t.firstChild;return n(l,r(w,{get when(){return e.selectedLoading()},get fallback(){return r(w,{get when(){return e.selectedError()},get fallback(){return r(w,{get when(){return R(()=>!!(d&&e.selectedBefore()!==null&&e.selectedAfter()!==null))()?{path:d.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=V(),s=i.firstChild;return n(s,D),i})()},children:i=>r(ce,{get fallback(){return(()=>{var s=V(),a=s.firstChild;return n(a,()=>e.t("instanceInfo.loading")),s})()},get children(){return r(Pe,{get scopeKey(){return e.scopeKey()},get path(){return String(i().path||"")},get before(){return String(i().before||"")},get after(){return String(i().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()},get insertContextLabel(){return e.t("instanceShell.gitChanges.actions.insertContext")},get onRequestInsertContext(){return te()?void 0:s=>{const a=e.selectedItemId();if(!a)return;const g=S().find(u=>u.id===a);g&&e.onInsertContext(g,s)}}})}})})},children:i=>(()=>{var s=V(),a=s.firstChild;return n(a,i),s})()})},get children(){var i=V(),s=i.firstChild;return n(s,()=>e.t("instanceInfo.loading")),i}})),t})(),ie=()=>(()=>{var t=$e();return n(t,D),t})(),B=t=>{const l=m(()=>e.selectedBulkItemIds().has(t.id)),i=t.section==="staged"?e.t("instanceShell.gitChanges.actions.unstage"):e.t("instanceShell.gitChanges.actions.stage"),s=()=>{t.section==="staged"?e.onUnstageFile(t):e.onStageFile(t)};return(()=>{var a=_e(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=u.nextSibling,$=v.firstChild,C=$.firstChild;C.firstChild;var _=C.nextSibling;_.firstChild;var P=g.nextSibling,f=P.firstChild,y=f.firstChild,k=y.firstChild;return k.firstChild,a.$$click=c=>e.onRowClick(t,c),a.$$mousedown=c=>{(c.shiftKey||c.ctrlKey||c.metaKey)&&c.preventDefault()},n(M,()=>t.path),n(C,()=>t.additions,null),n(_,()=>t.deletions,null),y.$$click=c=>{c.stopPropagation(),s()},b(y,"title",i),b(y,"aria-label",i),n(k,r(w,{get when(){return t.section!=="staged"},get children(){return be()}}),null),L(c=>{var G=`file-list-item git-change-list-item ${e.selectedItemId()===t.id?"file-list-item-active":""} ${l()?"git-change-list-item-bulk-selected":""}`,F=t.path,K=t.path,q=t.path,N=`git-change-row-action-glyph ${t.section==="staged"?"git-change-row-action-glyph-minus":"git-change-row-action-glyph-plus"}`;return G!==c.e&&H(a,c.e=G),F!==c.t&&b(a,"title",c.t=F),K!==c.a&&b(g,"title",c.a=K),q!==c.o&&b(u,"title",c.o=q),N!==c.i&&H(k,c.i=N),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()},ae=(t,l,i,s)=>(()=>{var a=Se(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=M.nextSibling,$=u.nextSibling;return U(g,"click",s,!0),n(M,i?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})),n(v,t),n($,()=>l.length),n(a,r(w,{when:i,get children(){var C=we();return n(C,r(J,{each:l,children:_=>B(_)})),C}}),null),a})(),O=()=>r(w,{get when(){return x.length>0},get fallback(){return ie()},get children(){var t=xe(),l=t.firstChild,i=l.firstChild,s=i.firstChild,a=s.firstChild,g=a.nextSibling,u=g.firstChild,M=s.nextSibling;return U(i,"click",e.onToggleStagedOpen,!0),n(a,(()=>{var v=R(()=>!!e.stagedOpen());return()=>v()?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})})()),n(u,()=>e.t("instanceShell.gitChanges.sections.staged")),n(g,r(w,{get when(){return e.branchLabel()},children:v=>(()=>{var $=Ie(),C=$.firstChild;return n($,r(ve,{class:"w-3.5 h-3.5","aria-hidden":"true"}),C),n(C,v),L(()=>b($,"title",`Branch: ${v()}`)),$})()}),null),n(M,()=>I.length),n(l,r(w,{get when(){return e.stagedOpen()},get children(){var v=ye(),$=v.firstChild,C=$.firstChild,_=C.firstChild,P=_.nextSibling;return _.$$input=f=>e.onCommitMessageInput(f.currentTarget.value),P.$$click=()=>e.onSubmitCommit(),n(P,(()=>{var f=R(()=>!!e.commitSubmitting());return()=>f()?e.t("instanceShell.gitChanges.commit.submitting"):e.t("instanceShell.gitChanges.commit.submit")})()),n(v,r(J,{each:I,children:f=>B(f)}),null),L(f=>{var y=e.t("instanceShell.gitChanges.commit.placeholder"),k=!p();return y!==f.e&&b(_,"placeholder",f.e=y),k!==f.t&&(P.disabled=f.t=k),f},{e:void 0,t:void 0}),L(()=>_.value=e.commitMessage()),v}}),null),n(t,()=>ae(e.t("instanceShell.gitChanges.sections.unstaged"),E,e.unstagedOpen(),e.onToggleUnstagedOpen),null),t}});return r(ge,{get header(){return[(()=>{var t=Me(),l=t.firstChild;return n(l,()=>(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),L(()=>b(t,"title",(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=ke(),l=t.firstChild,i=l.firstChild;i.firstChild;var s=l.nextSibling,a=s.firstChild;return a.firstChild,n(i,()=>o.additions,null),n(a,()=>o.deletions,null),n(t,r(w,{get when(){return e.statusError()},children:g=>(()=>{var u=Ee();return n(u,g),u})()}),null),t})(),(()=>{var t=Le();return t.$$click=()=>e.onRefresh(),n(t,r(fe,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),L(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),s=e.t("instanceShell.rightPanel.actions.refresh"),a=!W()||e.statusLoading()||A()===null;return i!==l.e&&b(t,"title",l.e=i),s!==l.t&&b(t,"aria-label",l.t=s),a!==l.a&&(t.disabled=l.a=a),l},{e:void 0,t:void 0,a:void 0}),t})(),r(de,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:O,overlay:O},get viewer(){return ne()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};le(["mousedown","click","input"]);export{Ke as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-CNzvK57I.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as se}from"./index-DD4SyatU.js";import{m as R,t as h,i as n,d as b,h as U,a as H,f as le}from"./monaco-viewer-CNzvK57I.js";import{n as r,m as re,c as m,a as L,S as w,F as J,z as ce,A as oe}from"./git-diff-vendor-CSgooKT_.js";import{D as de}from"./DiffToolbar-cyGXeLSS.js";import{S as ge}from"./SplitFilePanel-Bill25lM.js";import{I as he,G as ue,R as fe,H as j,J as Q}from"./main-Blt0PWLX.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./align-justify-d8O2iwpx.js";import"./wrap-text-CW6wvBi8.js";const me=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],ve=e=>r(he,re(e,{name:"GitBranch",iconNode:me}));var V=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Ce=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),$e=h('<div class="p-3 text-xs text-secondary">'),be=h('<span class="git-change-row-action-bar git-change-row-action-bar-vertical">'),_e=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=git-change-list-item-right><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-</span></div></div></div><div class=git-change-list-item-actions-zone><div class=git-change-list-item-actions><button type=button class=git-change-row-action><span aria-hidden=true><span class="git-change-row-action-bar git-change-row-action-bar-horizontal">'),we=h("<div class=git-change-section-items>"),Se=h("<div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title></span></span><span class=git-change-section-count>"),ye=h('<div class=git-change-section-items><div class=git-change-commit-box><div class=git-change-commit-input-wrap><textarea class=git-change-commit-input rows=1></textarea><button type=button class="git-change-commit-button git-change-commit-button-overlay">'),xe=h("<div class=git-change-sections><div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title-row><span class=git-change-section-title></span></span></span><span class=git-change-section-count>"),Ie=h('<span class="status-indicator session-status-list worktree-indicator git-change-section-badge"><span class=worktree-indicator-label>'),Me=h("<span class=files-tab-selected-path><span class=file-path-text>"),ke=h('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Le=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Ee=h("<span class=text-error>");const Pe=oe(()=>se(()=>import("./monaco-viewer-CNzvK57I.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),Ke=e=>{const T=m(()=>e.activeSessionId()),W=m(()=>!!(T()&&T()!=="info")),A=m(()=>W()?e.entries():null),X=m(()=>{const o=A();return Array.isArray(o)?[...o].sort((d,x)=>String(d.path||"").localeCompare(String(x.path||""))):[]}),S=m(()=>ue(X())),Y=m(()=>S().reduce((o,d)=>(o.additions+=typeof d.additions=="number"?d.additions:0,o.deletions+=typeof d.deletions=="number"?d.deletions:0,o),{additions:0,deletions:0})),z=m(()=>S().filter(o=>o.section==="staged")),Z=m(()=>S().filter(o=>o.section==="unstaged")),p=m(()=>z().length>0&&e.commitMessage().trim().length>0&&!e.commitSubmitting()),ee=m(()=>{const o=S(),d=e.selectedItemId(),x=e.mostChangedItemId(),I=o.find(E=>E.id===d)||(x?o.find(E=>E.id===x):void 0);return(I==null?void 0:I.entry)??null}),D=m(()=>W()?A()===null?e.t("instanceShell.gitChanges.loading"):S().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected")),te=m(()=>e.selectedError()===e.t("instanceShell.gitChanges.binaryViewer"));return R(()=>{const o=Y(),d=ee(),x=S(),I=z(),E=Z(),ne=()=>(()=>{var t=Ce(),l=t.firstChild;return n(l,r(w,{get when(){return e.selectedLoading()},get fallback(){return r(w,{get when(){return e.selectedError()},get fallback(){return r(w,{get when(){return R(()=>!!(d&&e.selectedBefore()!==null&&e.selectedAfter()!==null))()?{path:d.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=V(),s=i.firstChild;return n(s,D),i})()},children:i=>r(ce,{get fallback(){return(()=>{var s=V(),a=s.firstChild;return n(a,()=>e.t("instanceInfo.loading")),s})()},get children(){return r(Pe,{get scopeKey(){return e.scopeKey()},get path(){return String(i().path||"")},get before(){return String(i().before||"")},get after(){return String(i().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()},get insertContextLabel(){return e.t("instanceShell.gitChanges.actions.insertContext")},get onRequestInsertContext(){return te()?void 0:s=>{const a=e.selectedItemId();if(!a)return;const g=S().find(u=>u.id===a);g&&e.onInsertContext(g,s)}}})}})})},children:i=>(()=>{var s=V(),a=s.firstChild;return n(a,i),s})()})},get children(){var i=V(),s=i.firstChild;return n(s,()=>e.t("instanceInfo.loading")),i}})),t})(),ie=()=>(()=>{var t=$e();return n(t,D),t})(),B=t=>{const l=m(()=>e.selectedBulkItemIds().has(t.id)),i=t.section==="staged"?e.t("instanceShell.gitChanges.actions.unstage"):e.t("instanceShell.gitChanges.actions.stage"),s=()=>{t.section==="staged"?e.onUnstageFile(t):e.onStageFile(t)};return(()=>{var a=_e(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=u.nextSibling,$=v.firstChild,C=$.firstChild;C.firstChild;var _=C.nextSibling;_.firstChild;var P=g.nextSibling,f=P.firstChild,y=f.firstChild,k=y.firstChild;return k.firstChild,a.$$click=c=>e.onRowClick(t,c),a.$$mousedown=c=>{(c.shiftKey||c.ctrlKey||c.metaKey)&&c.preventDefault()},n(M,()=>t.path),n(C,()=>t.additions,null),n(_,()=>t.deletions,null),y.$$click=c=>{c.stopPropagation(),s()},b(y,"title",i),b(y,"aria-label",i),n(k,r(w,{get when(){return t.section!=="staged"},get children(){return be()}}),null),L(c=>{var G=`file-list-item git-change-list-item ${e.selectedItemId()===t.id?"file-list-item-active":""} ${l()?"git-change-list-item-bulk-selected":""}`,F=t.path,K=t.path,q=t.path,N=`git-change-row-action-glyph ${t.section==="staged"?"git-change-row-action-glyph-minus":"git-change-row-action-glyph-plus"}`;return G!==c.e&&H(a,c.e=G),F!==c.t&&b(a,"title",c.t=F),K!==c.a&&b(g,"title",c.a=K),q!==c.o&&b(u,"title",c.o=q),N!==c.i&&H(k,c.i=N),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()},ae=(t,l,i,s)=>(()=>{var a=Se(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=M.nextSibling,$=u.nextSibling;return U(g,"click",s,!0),n(M,i?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})),n(v,t),n($,()=>l.length),n(a,r(w,{when:i,get children(){var C=we();return n(C,r(J,{each:l,children:_=>B(_)})),C}}),null),a})(),O=()=>r(w,{get when(){return x.length>0},get fallback(){return ie()},get children(){var t=xe(),l=t.firstChild,i=l.firstChild,s=i.firstChild,a=s.firstChild,g=a.nextSibling,u=g.firstChild,M=s.nextSibling;return U(i,"click",e.onToggleStagedOpen,!0),n(a,(()=>{var v=R(()=>!!e.stagedOpen());return()=>v()?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})})()),n(u,()=>e.t("instanceShell.gitChanges.sections.staged")),n(g,r(w,{get when(){return e.branchLabel()},children:v=>(()=>{var $=Ie(),C=$.firstChild;return n($,r(ve,{class:"w-3.5 h-3.5","aria-hidden":"true"}),C),n(C,v),L(()=>b($,"title",`Branch: ${v()}`)),$})()}),null),n(M,()=>I.length),n(l,r(w,{get when(){return e.stagedOpen()},get children(){var v=ye(),$=v.firstChild,C=$.firstChild,_=C.firstChild,P=_.nextSibling;return _.$$input=f=>e.onCommitMessageInput(f.currentTarget.value),P.$$click=()=>e.onSubmitCommit(),n(P,(()=>{var f=R(()=>!!e.commitSubmitting());return()=>f()?e.t("instanceShell.gitChanges.commit.submitting"):e.t("instanceShell.gitChanges.commit.submit")})()),n(v,r(J,{each:I,children:f=>B(f)}),null),L(f=>{var y=e.t("instanceShell.gitChanges.commit.placeholder"),k=!p();return y!==f.e&&b(_,"placeholder",f.e=y),k!==f.t&&(P.disabled=f.t=k),f},{e:void 0,t:void 0}),L(()=>_.value=e.commitMessage()),v}}),null),n(t,()=>ae(e.t("instanceShell.gitChanges.sections.unstaged"),E,e.unstagedOpen(),e.onToggleUnstagedOpen),null),t}});return r(ge,{get header(){return[(()=>{var t=Me(),l=t.firstChild;return n(l,()=>(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),L(()=>b(t,"title",(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=ke(),l=t.firstChild,i=l.firstChild;i.firstChild;var s=l.nextSibling,a=s.firstChild;return a.firstChild,n(i,()=>o.additions,null),n(a,()=>o.deletions,null),n(t,r(w,{get when(){return e.statusError()},children:g=>(()=>{var u=Ee();return n(u,g),u})()}),null),t})(),(()=>{var t=Le();return t.$$click=()=>e.onRefresh(),n(t,r(fe,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),L(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),s=e.t("instanceShell.rightPanel.actions.refresh"),a=!W()||e.statusLoading()||A()===null;return i!==l.e&&b(t,"title",l.e=i),s!==l.t&&b(t,"aria-label",l.t=s),a!==l.a&&(t.disabled=l.a=a),l},{e:void 0,t:void 0,a:void 0}),t})(),r(de,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:O,overlay:O},get viewer(){return ne()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};le(["mousedown","click","input"]);export{Ke as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as d,i as l,d as m,h as s,m as b,g as _,f as w}from"./monaco-viewer-
|
|
1
|
+
import{t as d,i as l,d as m,h as s,m as b,g as _,f as w}from"./monaco-viewer-CNzvK57I.js";import{a as g,n as r,S as n}from"./git-diff-vendor-CSgooKT_.js";import{u as S}from"./index-DD4SyatU.js";var y=d("<div class=file-list-overlay role=dialog><div class=file-list-scroll>");const L=e=>(()=>{var t=y(),a=t.firstChild;return l(a,()=>e.children),g(()=>m(t,"aria-label",e.ariaLabel)),t})();var C=d('<div class=files-split><div class=file-list-panel><div class=file-list-scroll></div></div><div class=file-split-handle role=separator aria-orientation=vertical aria-label="Resize file list">'),x=d("<div class=files-tab-container><div class=files-tab-header><div class=files-tab-header-row><button type=button class=files-toggle-button></button></div></div><div class=files-tab-body>");const z=e=>{const{t}=S();return(()=>{var a=x(),c=a.firstChild,o=c.firstChild,u=o.firstChild,h=c.nextSibling;return s(u,"click",e.onToggleList,!0),l(u,(()=>{var i=b(()=>!!e.listOpen);return()=>i()?t("instanceShell.filesShell.hideFiles"):t("instanceShell.filesShell.showFiles")})()),l(o,()=>e.header,null),l(h,r(n,{get when(){return b(()=>!e.isPhoneLayout)()&&e.listOpen},get fallback(){return e.viewer},get children(){var i=C(),v=i.firstChild,$=v.firstChild,f=v.nextSibling;return l($,()=>e.list.panel()),s(f,"touchstart",e.onResizeTouchStart,!0),s(f,"mousedown",e.onResizeMouseDown,!0),l(i,()=>e.viewer,null),g(O=>_(i,"--files-pane-width",`${e.splitWidth}px`)),i}}),null),l(h,r(n,{get when(){return e.isPhoneLayout},get children(){return r(n,{get when(){return e.listOpen},get children(){return r(L,{get ariaLabel(){return e.overlayAriaLabel},get children(){return e.list.overlay()}})}})}}),null),a})()};w(["click","mousedown","touchstart"]);export{z as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as Pe,P as Xe,t as _,i as h,a as Ye,d as O,f as Ge}from"./monaco-viewer-YY9yfE-p.js";import{n as d,m as S,b as T,o as k,k as ee,l as te,q as ae,s as M,d as I,c as W,S as J,t as Qe,w as we,a as he,F as ge}from"./git-diff-vendor-CSgooKT_.js";import{I as ce,P as Ze,Q as F,T as re,U as Je,V as et,W as ke,X as Ie,Y as Te,Z as tt,_ as fe,$ as le,a0 as de,a1 as $e,a2 as ne,a3 as oe,a4 as nt,a5 as me,a6 as ot,a7 as st,a8 as A,a9 as be,aa as it,ab as rt,ac as lt,ad as R,ae as at,af as ct,ag as Se,H as dt,ah as pe,ai as ut,aj as gt,ak as ft,al as pt,am as ht}from"./main-BbYl9PoY.js";import{u as mt}from"./index-BCGPLzO4.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const bt=[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]],vt=e=>d(ce,S(e,{name:"BellRing",iconNode:bt})),yt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],xt=e=>d(ce,S(e,{name:"Info",iconNode:yt})),Ct=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],wt=e=>d(ce,S(e,{name:"TerminalSquare",iconNode:Ct})),St=[["polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2",key:"h1p8hx"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Pt=e=>d(ce,S(e,{name:"XOctagon",iconNode:St}));var De=ee();function kt(){return te(De)}function It(){const e=kt();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function Oe(e,o){return!!(o.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Tt(e,o){var t;const l=o.ref();if(!l)return-1;let r=e.length;if(!r)return-1;for(;r--;){const n=(t=e[r])==null?void 0:t.ref();if(n&&Oe(n,l))return r+1}return 0}function $t(e){const o=e.map((r,t)=>[t,r]);let l=!1;return o.sort(([r,t],[n,s])=>{const i=t.ref(),c=s.ref();return i===c||!i||!c?0:Oe(i,c)?(r>n&&(l=!0),-1):(r<n&&(l=!0),1)}),l?o.map(([r,t])=>t):e}function _e(e,o){const l=$t(e);e!==l&&o(l)}function Dt(e){var t,n;const o=e[0],l=(t=e[e.length-1])==null?void 0:t.ref();let r=(n=o==null?void 0:o.ref())==null?void 0:n.parentElement;for(;r;){if(l&&r.contains(l))return r;r=r.parentElement}return re(r).body}function Ot(e,o){T(()=>{const l=setTimeout(()=>{_e(e(),o)});k(()=>clearTimeout(l))})}function _t(e,o){if(typeof IntersectionObserver!="function"){Ot(e,o);return}let l=[];T(()=>{const r=()=>{const s=!!l.length;l=e(),s&&_e(e(),o)},t=Dt(e()),n=new IntersectionObserver(r,{root:t});for(const s of e()){const i=s.ref();i&&n.observe(i)}k(()=>n.disconnect())})}function Mt(e={}){const[o,l]=Ze({value:()=>et(e.items),onChange:n=>{var s;return(s=e.onItemsChange)==null?void 0:s.call(e,n)}});_t(o,l);const r=n=>(l(s=>{const i=Tt(s,n);return Je(s,n,i)}),()=>{l(s=>{const i=s.filter(c=>c.ref()!==n.ref());return s.length===i.length?s:i})});return{DomCollectionProvider:n=>d(De.Provider,{value:{registerItem:r},get children(){return n.children}})}}function Et(e){const o=It(),l=F({shouldRegisterItem:!0},e);T(()=>{if(!l.shouldRegisterItem)return;const r=o.registerItem(l.getItem());k(r)})}var At={};be(At,{Arrow:()=>ke,Content:()=>Ee,Portal:()=>Ae,Root:()=>Re,Tooltip:()=>Z,Trigger:()=>Fe,useTooltipContext:()=>ue});var Me=ee();function ue(){const e=te(Me);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function Ee(e){const o=ue(),l=F({id:o.generateId("content")},e),[r,t]=M(l,["ref","style"]);return T(()=>k(o.registerContentId(t.id))),d(J,{get when(){return o.contentPresent()},get children(){return d($e.Positioner,{get children(){return d(nt,S({ref(n){var s=ne(i=>{o.setContentRef(i)},r.ref);typeof s=="function"&&s(n)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return me({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:n=>n.preventDefault(),onDismiss:()=>o.hideTooltip(!0)},()=>o.dataset(),t))}})}})}function Ae(e){const o=ue();return d(J,{get when(){return o.contentPresent()},get children(){return d(Xe,e)}})}function Rt(e,o,l){const r=e.split("-")[0],t=o.getBoundingClientRect(),n=l.getBoundingClientRect(),s=[],i=t.left+t.width/2,c=t.top+t.height/2;switch(r){case"top":s.push([t.left,c]),s.push([n.left,n.bottom]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([t.right,c]);break;case"right":s.push([i,t.top]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([n.left,n.bottom]),s.push([i,t.bottom]);break;case"bottom":s.push([t.left,c]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([n.right,n.top]),s.push([t.right,c]);break;case"left":s.push([i,t.top]),s.push([n.right,n.top]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([i,t.bottom]);break}return s}var H={},Ft=0,X=!1,E,Q,Y;function Re(e){const o=`tooltip-${ae()}`,l=`${++Ft}`,r=F({id:o,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[t,n]=M(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let s;const[i,c]=I(),[a,f]=I(),[u,g]=I(),[y,v]=I(n.placement),x=Ie({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:b=>{var P;return(P=t.onOpenChange)==null?void 0:P.call(t,b)}}),{present:$}=Te({show:()=>t.forceMount||x.isOpen(),element:()=>u()??null}),m=()=>{H[l]=C},w=()=>{for(const b in H)b!==l&&(H[b](!0),delete H[b])},C=(b=!1)=>{b||t.closeDelay&&t.closeDelay<=0?(window.clearTimeout(s),s=void 0,x.close()):s||(s=window.setTimeout(()=>{s=void 0,x.close()},t.closeDelay)),window.clearTimeout(E),E=void 0,t.skipDelayDuration&&t.skipDelayDuration>=0&&(Y=window.setTimeout(()=>{window.clearTimeout(Y),Y=void 0},t.skipDelayDuration)),X&&(window.clearTimeout(Q),Q=window.setTimeout(()=>{delete H[l],Q=void 0,X=!1},t.closeDelay))},p=()=>{clearTimeout(s),s=void 0,w(),m(),X=!0,x.open(),window.clearTimeout(E),E=void 0,window.clearTimeout(Q),Q=void 0,window.clearTimeout(Y),Y=void 0},q=()=>{w(),m(),!x.isOpen()&&!E&&!X?E=window.setTimeout(()=>{E=void 0,X=!0,p()},t.openDelay):x.isOpen()||p()},K=(b=!1)=>{!b&&t.openDelay&&t.openDelay>0&&!s&&!Y?q():p()},z=()=>{window.clearTimeout(E),E=void 0,X=!1},B=()=>{window.clearTimeout(s),s=void 0},U=b=>fe(a(),b)||fe(u(),b),D=b=>{const P=a(),N=u();if(!(!P||!N))return Rt(b,P,N)},L=b=>{const P=b.target;if(U(P)){B();return}if(!t.ignoreSafeArea){const N=D(y());if(N&&ot(st(b),N)){B();return}}s||C()};T(()=>{if(!x.isOpen())return;const b=re();b.addEventListener("pointermove",L,!0),k(()=>{b.removeEventListener("pointermove",L,!0)})}),T(()=>{const b=a();if(!b||!x.isOpen())return;const P=ze=>{const Ve=ze.target;fe(Ve,b)&&C(!0)},N=tt();N.addEventListener("scroll",P,{capture:!0}),k(()=>{N.removeEventListener("scroll",P,{capture:!0})})}),k(()=>{clearTimeout(s),H[l]&&delete H[l]});const ie={dataset:W(()=>({"data-expanded":x.isOpen()?"":void 0,"data-closed":x.isOpen()?void 0:""})),isOpen:x.isOpen,isDisabled:()=>t.disabled??!1,triggerOnFocusOnly:()=>t.triggerOnFocusOnly??!1,contentId:i,contentPresent:$,openTooltip:K,hideTooltip:C,cancelOpening:z,generateId:de(()=>r.id),registerContentId:le(c),isTargetOnTooltip:U,setTriggerRef:f,setContentRef:g};return d(Me.Provider,{value:ie,get children(){return d($e,S({anchorRef:a,contentRef:u,onCurrentPlacementChange:v},n))}})}function Fe(e){let o;const l=ue(),[r,t]=M(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let n=!1,s=!1,i=!1;const c=()=>{n=!1},a=()=>{!l.isOpen()&&(s||i)&&l.openTooltip(i)},f=m=>{l.isOpen()&&!s&&!i&&l.hideTooltip(m)},u=m=>{A(m,r.onPointerEnter),!(m.pointerType==="touch"||l.triggerOnFocusOnly()||l.isDisabled()||m.defaultPrevented)&&(s=!0,a())},g=m=>{A(m,r.onPointerLeave),m.pointerType!=="touch"&&(s=!1,i=!1,l.isOpen()?f():l.cancelOpening())},y=m=>{A(m,r.onPointerDown),n=!0,re(o).addEventListener("pointerup",c,{once:!0})},v=m=>{A(m,r.onClick),s=!1,i=!1,f(!0)},x=m=>{A(m,r.onFocus),!(l.isDisabled()||m.defaultPrevented||n)&&(i=!0,a())},$=m=>{A(m,r.onBlur);const w=m.relatedTarget;l.isTargetOnTooltip(w)||(s=!1,i=!1,f(!0))};return k(()=>{re(o).removeEventListener("pointerup",c)}),d(oe,S({as:"button",ref(m){var w=ne(C=>{l.setTriggerRef(C),o=C},r.ref);typeof w=="function"&&w(m)},get"aria-describedby"(){return Pe(()=>!!l.isOpen())()?l.contentId():void 0},onPointerEnter:u,onPointerLeave:g,onPointerDown:y,onClick:v,onFocus:x,onBlur:$},()=>l.dataset(),t))}var Z=Object.assign(Re,{Arrow:ke,Content:Ee,Portal:Ae,Trigger:Fe}),Kt={};be(Kt,{Collapsible:()=>Bt,Content:()=>ve,Root:()=>ye,Trigger:()=>xe,useCollapsibleContext:()=>se});var Ke=ee();function se(){const e=te(Ke);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function ve(e){const[o,l]=I(),r=se(),t=F({id:r.generateId("content")},e),[n,s]=M(t,["ref","id","style"]),{present:i}=Te({show:r.shouldMount,element:()=>o()??null}),[c,a]=I(0),[f,u]=I(0);let y=r.isOpen()||i();return Qe(()=>{const v=requestAnimationFrame(()=>{y=!1});k(()=>{cancelAnimationFrame(v)})}),T(we(i,()=>{if(!o())return;o().style.transitionDuration="0s",o().style.animationName="none";const v=o().getBoundingClientRect();a(v.height),u(v.width),y||(o().style.transitionDuration="",o().style.animationName="")})),T(we(r.isOpen,v=>{!v&&o()&&(o().style.transitionDuration="",o().style.animationName="")},{defer:!0})),T(()=>k(r.registerContentId(n.id))),d(J,{get when(){return i()},get children(){return d(oe,S({as:"div",ref(v){var x=ne(l,n.ref);typeof x=="function"&&x(v)},get id(){return n.id},get style(){return me({"--kb-collapsible-content-height":c()?`${c()}px`:void 0,"--kb-collapsible-content-width":f()?`${f()}px`:void 0},n.style)}},()=>r.dataset(),s))}})}function ye(e){const o=`collapsible-${ae()}`,l=F({id:o},e),[r,t]=M(l,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[n,s]=I(),i=Ie({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:f=>{var u;return(u=r.onOpenChange)==null?void 0:u.call(r,f)}}),c=W(()=>({"data-expanded":i.isOpen()?"":void 0,"data-closed":i.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),a={dataset:c,isOpen:i.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||i.isOpen(),contentId:n,toggle:i.toggle,generateId:de(()=>t.id),registerContentId:le(s)};return d(Ke.Provider,{value:a,get children(){return d(oe,S({as:"div"},c,t))}})}function xe(e){const o=se(),[l,r]=M(e,["onClick"]);return d(it,S({get"aria-expanded"(){return o.isOpen()},get"aria-controls"(){return Pe(()=>!!o.isOpen())()?o.contentId():void 0},get disabled(){return o.disabled()},onClick:n=>{A(n,l.onClick),o.toggle()}},()=>o.dataset(),r))}var Bt=Object.assign(ye,{Content:ve,Trigger:xe}),G={};be(G,{Accordion:()=>Lt,Content:()=>Ne,Header:()=>Ue,Item:()=>je,Root:()=>We,Trigger:()=>qe,useAccordionContext:()=>Ce});var Be=ee();function Le(){const e=te(Be);if(e===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function Ne(e){const o=Le(),l=o.generateId("content"),r=F({id:l},e),[t,n]=M(r,["id","style"]);return T(()=>k(o.registerContentId(t.id))),d(ve,S({role:"region",get"aria-labelledby"(){return o.triggerId()},get style(){return me({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},t.style)}},n))}function Ue(e){const o=se();return d(oe,S({as:"h3"},()=>o.dataset(),e))}var He=ee();function Ce(){const e=te(He);if(e===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function je(e){const o=Ce(),l=`${o.generateId("item")}-${ae()}`,r=F({id:l},e),[t,n]=M(r,["value","disabled"]),[s,i]=I(),[c,a]=I(),f=()=>o.listState().selectionManager(),u=()=>f().isSelected(t.value),g={value:()=>t.value,triggerId:s,contentId:c,generateId:de(()=>n.id),registerTriggerId:le(i),registerContentId:le(a)};return d(Be.Provider,{value:g,get children(){return d(ye,S({get open(){return u()},get disabled(){return t.disabled}},n))}})}function We(e){let o;const l=`accordion-${ae()}`,r=F({id:l,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[t,n]=M(r,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[s,i]=I([]),{DomCollectionProvider:c}=Mt({items:s,onItemsChange:i}),a=rt({selectedKeys:()=>t.value,defaultSelectedKeys:()=>t.defaultValue,onSelectionChange:g=>{var y;return(y=t.onChange)==null?void 0:y.call(t,Array.from(g))},disallowEmptySelection:()=>!t.multiple&&!t.collapsible,selectionMode:()=>t.multiple?"multiple":"single",dataSource:s});a.selectionManager().setFocusedKey("item-1");const f=lt({selectionManager:()=>a.selectionManager(),collection:()=>a.collection(),disallowEmptySelection:()=>a.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>t.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>o),u={listState:()=>a,generateId:de(()=>t.id)};return d(c,{get children(){return d(He.Provider,{value:u,get children(){return d(oe,S({as:"div",get id(){return t.id},ref(g){var y=ne(v=>o=v,t.ref);typeof y=="function"&&y(g)},get onKeyDown(){return R([t.onKeyDown,f.onKeyDown])},get onMouseDown(){return R([t.onMouseDown,f.onMouseDown])},get onFocusIn(){return R([t.onFocusIn])},get onFocusOut(){return R([t.onFocusOut,f.onFocusOut])}},n))}})}})}function qe(e){let o;const l=Ce(),r=Le(),t=se(),n=r.generateId("trigger"),s=F({id:n},e),[i,c]=M(s,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);Et({getItem:()=>({ref:()=>o,type:"item",key:r.value(),textValue:"",disabled:t.disabled()})});const a=at({key:()=>r.value(),selectionManager:()=>l.listState().selectionManager(),disabled:()=>t.disabled(),shouldSelectOnPressUp:!0},()=>o),f=u=>{["Enter"," "].includes(u.key)&&u.preventDefault(),A(u,i.onKeyDown),A(u,a.onKeyDown)};return T(()=>k(r.registerTriggerId(c.id))),d(xe,S({ref(u){var g=ne(y=>o=y,i.ref);typeof g=="function"&&g(u)},get"data-key"(){return a.dataKey()},get onPointerDown(){return R([i.onPointerDown,a.onPointerDown])},get onPointerUp(){return R([i.onPointerUp,a.onPointerUp])},get onClick(){return R([i.onClick,a.onClick])},onKeyDown:f,get onMouseDown(){return R([i.onMouseDown,a.onMouseDown])},get onFocus(){return R([i.onFocus,a.onFocus])}},c))}var Lt=Object.assign(We,{Content:Ne,Header:Ue,Item:je,Trigger:qe}),Nt=_('<div><div class="flex flex-wrap items-center gap-2 text-xs text-primary"><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary"></span></div><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary"></span></div><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary">');const Ut=e=>{const{t:o}=mt(),l=W(()=>ct(e.instanceId,e.sessionId)??{cost:0,contextWindow:0,isSubscriptionModel:!1,inputTokens:0,outputTokens:0,reasoningTokens:0,actualUsageTokens:0,modelOutputLimit:0,contextAvailableTokens:null}),r=W(()=>l().inputTokens??0),t=W(()=>l().outputTokens??0),n=W(()=>{const i=l().isSubscriptionModel?0:l().cost;return i>0?i:0}),s=W(()=>`$${n().toFixed(2)}`);return(()=>{var i=Nt(),c=i.firstChild,a=c.firstChild,f=a.firstChild,u=f.nextSibling,g=a.nextSibling,y=g.firstChild,v=y.nextSibling,x=g.nextSibling,$=x.firstChild,m=$.nextSibling;return h(f,()=>o("contextUsagePanel.labels.input")),h(u,()=>Se(r())),h(y,()=>o("contextUsagePanel.labels.output")),h(v,()=>Se(t())),h($,()=>o("contextUsagePanel.labels.cost")),h(m,s),he(()=>Ye(i,`session-context-panel px-4 py-2 ${e.class??""}`)),i})()};var j=_('<div class="right-panel-empty right-panel-empty--left"><span class=text-xs>'),Ht=_('<div class="rounded-md border border-base bg-surface-secondary px-3 py-2"><div class="flex items-start justify-between gap-3"><div class=min-w-0><div class="text-sm font-medium text-primary"></div><p class="mt-1 text-xs text-secondary">'),jt=_('<div class="flex flex-col gap-3 min-h-0"><div class="flex items-center justify-between gap-2 text-[11px] text-secondary"><span></span><span class="flex items-center gap-2"><span style=color:var(--session-status-idle-fg)></span><span style=color:var(--session-status-working-fg)></span></span></div><div class="rounded-md border border-base bg-surface-secondary p-2 max-h-[40vh] overflow-y-auto"><div class="flex flex-col">'),Wt=_('<button type=button class="border-b border-base last:border-b-0 text-left hover:bg-surface-muted rounded-sm"><div class="flex items-center justify-between gap-3"><div class="text-xs font-mono text-primary min-w-0 flex-1 overflow-hidden whitespace-nowrap"style=text-overflow:ellipsis;direction:rtl;text-align:left;unicode-bidi:plaintext></div><div class="flex items-center gap-2 text-[11px] flex-shrink-0"><span style=color:var(--session-status-idle-fg)></span><span style=color:var(--session-status-working-fg)>'),qt=_('<div class="flex flex-col gap-2">'),zt=_("<span>"),Vt=_('<div class=status-process-card><div class=status-process-header><span class=status-process-title></span><div class=status-process-meta><span></span><span></span></div></div><div class=status-process-actions><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center">'),Xt=_("<div class=status-tab-container>"),Yt=_("<span class=section-left><span class=section-label>");const nn=e=>{const o=i=>e.expandedItems().includes(i),s=[{id:"yolo-mode",labelKey:"instanceShell.rightPanel.sections.yoloMode",tooltipKey:"instanceShell.rightPanel.sections.yoloMode.tooltip",render:()=>{const i=e.activeSession();return i?(()=>{var c=Ht(),a=c.firstChild,f=a.firstChild,u=f.firstChild,g=u.nextSibling;return h(u,()=>e.t("instanceShell.yoloMode.title")),h(g,()=>e.t("instanceShell.yoloMode.description")),h(a,d(ft,{get checked(){return gt(e.instanceId,i.id)},color:"warning",size:"small",get inputProps(){return{"aria-label":e.t("instanceShell.yoloMode.title")}},onChange:()=>ut(e.instanceId,i.id)}),null),c})():(()=>{var c=j(),a=c.firstChild;return h(a,()=>e.t("instanceShell.yoloMode.noSessionSelected")),c})()}},{id:"session-changes",labelKey:"instanceShell.rightPanel.sections.sessionChanges",tooltipKey:"instanceShell.rightPanel.sections.sessionChanges.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var u=j(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.noSessionSelected")),u})();const c=e.activeSessionDiffs();if(c===void 0)return(()=>{var u=j(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.loading")),u})();if(!Array.isArray(c)||c.length===0)return(()=>{var u=j(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.empty")),u})();const a=[...c].sort((u,g)=>String(u.file||"").localeCompare(String(g.file||""))),f=a.reduce((u,g)=>(u.additions+=typeof g.additions=="number"?g.additions:0,u.deletions+=typeof g.deletions=="number"?g.deletions:0,u),{additions:0,deletions:0});return(()=>{var u=jt(),g=u.firstChild,y=g.firstChild,v=y.nextSibling,x=v.firstChild,$=x.nextSibling,m=g.nextSibling,w=m.firstChild;return h(y,()=>e.t("instanceShell.sessionChanges.filesChanged",{count:a.length})),h(x,()=>`+${f.additions}`),h($,()=>`-${f.deletions}`),h(w,d(ge,{each:a,children:C=>(()=>{var p=Wt(),q=p.firstChild,K=q.firstChild,z=K.nextSibling,B=z.firstChild,U=B.nextSibling;return p.$$click=()=>e.onOpenChangesTab(C.file),h(K,()=>C.file),h(B,()=>`+${C.additions}`),h(U,()=>`-${C.deletions}`),he(D=>{var L=e.t("instanceShell.sessionChanges.actions.show"),V=C.file;return L!==D.e&&O(p,"title",D.e=L),V!==D.t&&O(K,"title",D.t=V),D},{e:void 0,t:void 0}),p})()})),u})()}},{id:"plan",labelKey:"instanceShell.rightPanel.sections.plan",tooltipKey:"instanceShell.rightPanel.sections.plan.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var a=j(),f=a.firstChild;return h(f,()=>e.t("instanceShell.plan.noSessionSelected")),a})();const c=e.latestTodoState();return c?d(pt,{state:c,get emptyLabel(){return e.t("instanceShell.plan.empty")},showStatusLabel:!1}):(()=>{var a=j(),f=a.firstChild;return h(f,()=>e.t("instanceShell.plan.empty")),a})()}},{id:"background-processes",labelKey:"instanceShell.rightPanel.sections.backgroundProcesses",tooltipKey:"instanceShell.rightPanel.sections.backgroundProcesses.tooltip",render:()=>{const i=e.backgroundProcessList();return i.length===0?(()=>{var c=j(),a=c.firstChild;return h(a,()=>e.t("instanceShell.backgroundProcesses.empty")),c})():(()=>{var c=qt();return h(c,d(ge,{each:i,children:a=>(()=>{var f=Vt(),u=f.firstChild,g=u.firstChild,y=g.nextSibling,v=y.firstChild,x=v.nextSibling,$=u.nextSibling,m=$.firstChild,w=m.nextSibling,C=w.nextSibling;return h(g,()=>a.title),h(v,d(vt,{class:"h-3.5 w-3.5"})),h(x,()=>e.t("instanceShell.backgroundProcesses.status",{status:a.status})),h(y,d(J,{get when(){return typeof a.outputSizeBytes=="number"},get children(){var p=zt();return h(p,()=>e.t("instanceShell.backgroundProcesses.output",{sizeKb:Math.round((a.outputSizeBytes??0)/1024)})),p}}),null),m.$$click=()=>e.onOpenBackgroundOutput(a),h(m,d(wt,{class:"h-4 w-4"})),w.$$click=()=>e.onStopBackgroundProcess(a.id),h(w,d(Pt,{class:"h-4 w-4"})),C.$$click=()=>e.onTerminateBackgroundProcess(a.id),h(C,d(ht,{class:"h-4 w-4"})),he(p=>{var q=!!a.notifyEnabled,K=!a.notifyEnabled,z=e.t(a.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),B=e.t(a.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),U=e.t("instanceShell.backgroundProcesses.actions.output"),D=e.t("instanceShell.backgroundProcesses.actions.output"),L=a.status!=="running",V=e.t("instanceShell.backgroundProcesses.actions.stop"),ie=e.t("instanceShell.backgroundProcesses.actions.stop"),b=e.t("instanceShell.backgroundProcesses.actions.terminate"),P=e.t("instanceShell.backgroundProcesses.actions.terminate");return q!==p.e&&v.classList.toggle("text-success",p.e=q),K!==p.t&&v.classList.toggle("text-tertiary",p.t=K),z!==p.a&&O(v,"aria-label",p.a=z),B!==p.o&&O(v,"title",p.o=B),U!==p.i&&O(m,"aria-label",p.i=U),D!==p.n&&O(m,"title",p.n=D),L!==p.s&&(w.disabled=p.s=L),V!==p.h&&O(w,"aria-label",p.h=V),ie!==p.r&&O(w,"title",p.r=ie),b!==p.d&&O(C,"aria-label",p.d=b),P!==p.l&&O(C,"title",p.l=P),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),f})()})),c})()}},{id:"mcp",labelKey:"instanceShell.rightPanel.sections.mcp",tooltipKey:"instanceShell.rightPanel.sections.mcp.tooltip",render:()=>d(pe,{get initialInstance(){return e.instance},sections:["mcp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"lsp",labelKey:"instanceShell.rightPanel.sections.lsp",tooltipKey:"instanceShell.rightPanel.sections.lsp.tooltip",render:()=>d(pe,{get initialInstance(){return e.instance},sections:["lsp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"plugins",labelKey:"instanceShell.rightPanel.sections.plugins",tooltipKey:"instanceShell.rightPanel.sections.plugins.tooltip",render:()=>d(pe,{get initialInstance(){return e.instance},sections:["plugins"],showSectionHeadings:!1,class:"space-y-2"})}];return(()=>{var i=Xt();return h(i,d(J,{get when(){return e.activeSession()},children:c=>d(Ut,{get instanceId(){return e.instanceId},get sessionId(){return c().id},class:"status-tab-context-panel"})}),null),h(i,d(G.Root,{class:"right-panel-accordion",collapsible:!0,multiple:!0,get value(){return e.expandedItems()},get onChange(){return e.onExpandedItemsChange},get children(){return d(ge,{each:s,children:c=>d(G.Item,{get value(){return c.id},class:"right-panel-accordion-item",get children(){return[d(G.Header,{class:"right-panel-accordion-header-row",get children(){return[d(G.Trigger,{class:"right-panel-accordion-trigger",get children(){return[(()=>{var a=Yt(),f=a.firstChild;return h(f,()=>e.t(c.labelKey)),a})(),d(dt,{get class(){return`right-panel-accordion-chevron ${o(c.id)?"right-panel-accordion-chevron-expanded":""}`}})]}}),d(Z,{openDelay:200,gutter:4,placement:"top",get children(){return[d(Z.Trigger,{as:"button",type:"button",class:"section-info-trigger",get"aria-label"(){return e.t(c.tooltipKey)},get children(){return d(xt,{class:"section-info-icon"})}}),d(Z.Portal,{get children(){return d(Z.Content,{class:"section-info-tooltip",get children(){return e.t(c.tooltipKey)}})}})]}})]}}),d(G.Content,{class:"right-panel-accordion-content",get children(){return c.render()}})]}})})}}),null),i})()};Ge(["click"]);export{nn as default};
|
|
1
|
+
import{m as Pe,P as Xe,t as _,i as h,a as Ye,d as O,f as Ge}from"./monaco-viewer-CNzvK57I.js";import{n as d,m as S,b as T,o as k,k as ee,l as te,q as ae,s as M,d as I,c as W,S as J,t as Qe,w as we,a as he,F as ge}from"./git-diff-vendor-CSgooKT_.js";import{I as ce,P as Ze,Q as F,T as re,U as Je,V as et,W as ke,X as Ie,Y as Te,Z as tt,_ as fe,$ as le,a0 as de,a1 as $e,a2 as ne,a3 as oe,a4 as nt,a5 as me,a6 as ot,a7 as st,a8 as A,a9 as be,aa as it,ab as rt,ac as lt,ad as R,ae as at,af as ct,ag as Se,H as dt,ah as pe,ai as ut,aj as gt,ak as ft,al as pt,am as ht}from"./main-Blt0PWLX.js";import{u as mt}from"./index-DD4SyatU.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const bt=[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]],vt=e=>d(ce,S(e,{name:"BellRing",iconNode:bt})),yt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],xt=e=>d(ce,S(e,{name:"Info",iconNode:yt})),Ct=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],wt=e=>d(ce,S(e,{name:"TerminalSquare",iconNode:Ct})),St=[["polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2",key:"h1p8hx"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Pt=e=>d(ce,S(e,{name:"XOctagon",iconNode:St}));var De=ee();function kt(){return te(De)}function It(){const e=kt();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function Oe(e,o){return!!(o.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Tt(e,o){var t;const l=o.ref();if(!l)return-1;let r=e.length;if(!r)return-1;for(;r--;){const n=(t=e[r])==null?void 0:t.ref();if(n&&Oe(n,l))return r+1}return 0}function $t(e){const o=e.map((r,t)=>[t,r]);let l=!1;return o.sort(([r,t],[n,s])=>{const i=t.ref(),c=s.ref();return i===c||!i||!c?0:Oe(i,c)?(r>n&&(l=!0),-1):(r<n&&(l=!0),1)}),l?o.map(([r,t])=>t):e}function _e(e,o){const l=$t(e);e!==l&&o(l)}function Dt(e){var t,n;const o=e[0],l=(t=e[e.length-1])==null?void 0:t.ref();let r=(n=o==null?void 0:o.ref())==null?void 0:n.parentElement;for(;r;){if(l&&r.contains(l))return r;r=r.parentElement}return re(r).body}function Ot(e,o){T(()=>{const l=setTimeout(()=>{_e(e(),o)});k(()=>clearTimeout(l))})}function _t(e,o){if(typeof IntersectionObserver!="function"){Ot(e,o);return}let l=[];T(()=>{const r=()=>{const s=!!l.length;l=e(),s&&_e(e(),o)},t=Dt(e()),n=new IntersectionObserver(r,{root:t});for(const s of e()){const i=s.ref();i&&n.observe(i)}k(()=>n.disconnect())})}function Mt(e={}){const[o,l]=Ze({value:()=>et(e.items),onChange:n=>{var s;return(s=e.onItemsChange)==null?void 0:s.call(e,n)}});_t(o,l);const r=n=>(l(s=>{const i=Tt(s,n);return Je(s,n,i)}),()=>{l(s=>{const i=s.filter(c=>c.ref()!==n.ref());return s.length===i.length?s:i})});return{DomCollectionProvider:n=>d(De.Provider,{value:{registerItem:r},get children(){return n.children}})}}function Et(e){const o=It(),l=F({shouldRegisterItem:!0},e);T(()=>{if(!l.shouldRegisterItem)return;const r=o.registerItem(l.getItem());k(r)})}var At={};be(At,{Arrow:()=>ke,Content:()=>Ee,Portal:()=>Ae,Root:()=>Re,Tooltip:()=>Z,Trigger:()=>Fe,useTooltipContext:()=>ue});var Me=ee();function ue(){const e=te(Me);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function Ee(e){const o=ue(),l=F({id:o.generateId("content")},e),[r,t]=M(l,["ref","style"]);return T(()=>k(o.registerContentId(t.id))),d(J,{get when(){return o.contentPresent()},get children(){return d($e.Positioner,{get children(){return d(nt,S({ref(n){var s=ne(i=>{o.setContentRef(i)},r.ref);typeof s=="function"&&s(n)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return me({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:n=>n.preventDefault(),onDismiss:()=>o.hideTooltip(!0)},()=>o.dataset(),t))}})}})}function Ae(e){const o=ue();return d(J,{get when(){return o.contentPresent()},get children(){return d(Xe,e)}})}function Rt(e,o,l){const r=e.split("-")[0],t=o.getBoundingClientRect(),n=l.getBoundingClientRect(),s=[],i=t.left+t.width/2,c=t.top+t.height/2;switch(r){case"top":s.push([t.left,c]),s.push([n.left,n.bottom]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([t.right,c]);break;case"right":s.push([i,t.top]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([n.left,n.bottom]),s.push([i,t.bottom]);break;case"bottom":s.push([t.left,c]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([n.right,n.top]),s.push([t.right,c]);break;case"left":s.push([i,t.top]),s.push([n.right,n.top]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([i,t.bottom]);break}return s}var H={},Ft=0,X=!1,E,Q,Y;function Re(e){const o=`tooltip-${ae()}`,l=`${++Ft}`,r=F({id:o,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[t,n]=M(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let s;const[i,c]=I(),[a,f]=I(),[u,g]=I(),[y,v]=I(n.placement),x=Ie({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:b=>{var P;return(P=t.onOpenChange)==null?void 0:P.call(t,b)}}),{present:$}=Te({show:()=>t.forceMount||x.isOpen(),element:()=>u()??null}),m=()=>{H[l]=C},w=()=>{for(const b in H)b!==l&&(H[b](!0),delete H[b])},C=(b=!1)=>{b||t.closeDelay&&t.closeDelay<=0?(window.clearTimeout(s),s=void 0,x.close()):s||(s=window.setTimeout(()=>{s=void 0,x.close()},t.closeDelay)),window.clearTimeout(E),E=void 0,t.skipDelayDuration&&t.skipDelayDuration>=0&&(Y=window.setTimeout(()=>{window.clearTimeout(Y),Y=void 0},t.skipDelayDuration)),X&&(window.clearTimeout(Q),Q=window.setTimeout(()=>{delete H[l],Q=void 0,X=!1},t.closeDelay))},p=()=>{clearTimeout(s),s=void 0,w(),m(),X=!0,x.open(),window.clearTimeout(E),E=void 0,window.clearTimeout(Q),Q=void 0,window.clearTimeout(Y),Y=void 0},q=()=>{w(),m(),!x.isOpen()&&!E&&!X?E=window.setTimeout(()=>{E=void 0,X=!0,p()},t.openDelay):x.isOpen()||p()},K=(b=!1)=>{!b&&t.openDelay&&t.openDelay>0&&!s&&!Y?q():p()},z=()=>{window.clearTimeout(E),E=void 0,X=!1},B=()=>{window.clearTimeout(s),s=void 0},U=b=>fe(a(),b)||fe(u(),b),D=b=>{const P=a(),N=u();if(!(!P||!N))return Rt(b,P,N)},L=b=>{const P=b.target;if(U(P)){B();return}if(!t.ignoreSafeArea){const N=D(y());if(N&&ot(st(b),N)){B();return}}s||C()};T(()=>{if(!x.isOpen())return;const b=re();b.addEventListener("pointermove",L,!0),k(()=>{b.removeEventListener("pointermove",L,!0)})}),T(()=>{const b=a();if(!b||!x.isOpen())return;const P=ze=>{const Ve=ze.target;fe(Ve,b)&&C(!0)},N=tt();N.addEventListener("scroll",P,{capture:!0}),k(()=>{N.removeEventListener("scroll",P,{capture:!0})})}),k(()=>{clearTimeout(s),H[l]&&delete H[l]});const ie={dataset:W(()=>({"data-expanded":x.isOpen()?"":void 0,"data-closed":x.isOpen()?void 0:""})),isOpen:x.isOpen,isDisabled:()=>t.disabled??!1,triggerOnFocusOnly:()=>t.triggerOnFocusOnly??!1,contentId:i,contentPresent:$,openTooltip:K,hideTooltip:C,cancelOpening:z,generateId:de(()=>r.id),registerContentId:le(c),isTargetOnTooltip:U,setTriggerRef:f,setContentRef:g};return d(Me.Provider,{value:ie,get children(){return d($e,S({anchorRef:a,contentRef:u,onCurrentPlacementChange:v},n))}})}function Fe(e){let o;const l=ue(),[r,t]=M(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let n=!1,s=!1,i=!1;const c=()=>{n=!1},a=()=>{!l.isOpen()&&(s||i)&&l.openTooltip(i)},f=m=>{l.isOpen()&&!s&&!i&&l.hideTooltip(m)},u=m=>{A(m,r.onPointerEnter),!(m.pointerType==="touch"||l.triggerOnFocusOnly()||l.isDisabled()||m.defaultPrevented)&&(s=!0,a())},g=m=>{A(m,r.onPointerLeave),m.pointerType!=="touch"&&(s=!1,i=!1,l.isOpen()?f():l.cancelOpening())},y=m=>{A(m,r.onPointerDown),n=!0,re(o).addEventListener("pointerup",c,{once:!0})},v=m=>{A(m,r.onClick),s=!1,i=!1,f(!0)},x=m=>{A(m,r.onFocus),!(l.isDisabled()||m.defaultPrevented||n)&&(i=!0,a())},$=m=>{A(m,r.onBlur);const w=m.relatedTarget;l.isTargetOnTooltip(w)||(s=!1,i=!1,f(!0))};return k(()=>{re(o).removeEventListener("pointerup",c)}),d(oe,S({as:"button",ref(m){var w=ne(C=>{l.setTriggerRef(C),o=C},r.ref);typeof w=="function"&&w(m)},get"aria-describedby"(){return Pe(()=>!!l.isOpen())()?l.contentId():void 0},onPointerEnter:u,onPointerLeave:g,onPointerDown:y,onClick:v,onFocus:x,onBlur:$},()=>l.dataset(),t))}var Z=Object.assign(Re,{Arrow:ke,Content:Ee,Portal:Ae,Trigger:Fe}),Kt={};be(Kt,{Collapsible:()=>Bt,Content:()=>ve,Root:()=>ye,Trigger:()=>xe,useCollapsibleContext:()=>se});var Ke=ee();function se(){const e=te(Ke);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function ve(e){const[o,l]=I(),r=se(),t=F({id:r.generateId("content")},e),[n,s]=M(t,["ref","id","style"]),{present:i}=Te({show:r.shouldMount,element:()=>o()??null}),[c,a]=I(0),[f,u]=I(0);let y=r.isOpen()||i();return Qe(()=>{const v=requestAnimationFrame(()=>{y=!1});k(()=>{cancelAnimationFrame(v)})}),T(we(i,()=>{if(!o())return;o().style.transitionDuration="0s",o().style.animationName="none";const v=o().getBoundingClientRect();a(v.height),u(v.width),y||(o().style.transitionDuration="",o().style.animationName="")})),T(we(r.isOpen,v=>{!v&&o()&&(o().style.transitionDuration="",o().style.animationName="")},{defer:!0})),T(()=>k(r.registerContentId(n.id))),d(J,{get when(){return i()},get children(){return d(oe,S({as:"div",ref(v){var x=ne(l,n.ref);typeof x=="function"&&x(v)},get id(){return n.id},get style(){return me({"--kb-collapsible-content-height":c()?`${c()}px`:void 0,"--kb-collapsible-content-width":f()?`${f()}px`:void 0},n.style)}},()=>r.dataset(),s))}})}function ye(e){const o=`collapsible-${ae()}`,l=F({id:o},e),[r,t]=M(l,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[n,s]=I(),i=Ie({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:f=>{var u;return(u=r.onOpenChange)==null?void 0:u.call(r,f)}}),c=W(()=>({"data-expanded":i.isOpen()?"":void 0,"data-closed":i.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),a={dataset:c,isOpen:i.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||i.isOpen(),contentId:n,toggle:i.toggle,generateId:de(()=>t.id),registerContentId:le(s)};return d(Ke.Provider,{value:a,get children(){return d(oe,S({as:"div"},c,t))}})}function xe(e){const o=se(),[l,r]=M(e,["onClick"]);return d(it,S({get"aria-expanded"(){return o.isOpen()},get"aria-controls"(){return Pe(()=>!!o.isOpen())()?o.contentId():void 0},get disabled(){return o.disabled()},onClick:n=>{A(n,l.onClick),o.toggle()}},()=>o.dataset(),r))}var Bt=Object.assign(ye,{Content:ve,Trigger:xe}),G={};be(G,{Accordion:()=>Lt,Content:()=>Ne,Header:()=>Ue,Item:()=>je,Root:()=>We,Trigger:()=>qe,useAccordionContext:()=>Ce});var Be=ee();function Le(){const e=te(Be);if(e===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function Ne(e){const o=Le(),l=o.generateId("content"),r=F({id:l},e),[t,n]=M(r,["id","style"]);return T(()=>k(o.registerContentId(t.id))),d(ve,S({role:"region",get"aria-labelledby"(){return o.triggerId()},get style(){return me({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},t.style)}},n))}function Ue(e){const o=se();return d(oe,S({as:"h3"},()=>o.dataset(),e))}var He=ee();function Ce(){const e=te(He);if(e===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function je(e){const o=Ce(),l=`${o.generateId("item")}-${ae()}`,r=F({id:l},e),[t,n]=M(r,["value","disabled"]),[s,i]=I(),[c,a]=I(),f=()=>o.listState().selectionManager(),u=()=>f().isSelected(t.value),g={value:()=>t.value,triggerId:s,contentId:c,generateId:de(()=>n.id),registerTriggerId:le(i),registerContentId:le(a)};return d(Be.Provider,{value:g,get children(){return d(ye,S({get open(){return u()},get disabled(){return t.disabled}},n))}})}function We(e){let o;const l=`accordion-${ae()}`,r=F({id:l,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[t,n]=M(r,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[s,i]=I([]),{DomCollectionProvider:c}=Mt({items:s,onItemsChange:i}),a=rt({selectedKeys:()=>t.value,defaultSelectedKeys:()=>t.defaultValue,onSelectionChange:g=>{var y;return(y=t.onChange)==null?void 0:y.call(t,Array.from(g))},disallowEmptySelection:()=>!t.multiple&&!t.collapsible,selectionMode:()=>t.multiple?"multiple":"single",dataSource:s});a.selectionManager().setFocusedKey("item-1");const f=lt({selectionManager:()=>a.selectionManager(),collection:()=>a.collection(),disallowEmptySelection:()=>a.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>t.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>o),u={listState:()=>a,generateId:de(()=>t.id)};return d(c,{get children(){return d(He.Provider,{value:u,get children(){return d(oe,S({as:"div",get id(){return t.id},ref(g){var y=ne(v=>o=v,t.ref);typeof y=="function"&&y(g)},get onKeyDown(){return R([t.onKeyDown,f.onKeyDown])},get onMouseDown(){return R([t.onMouseDown,f.onMouseDown])},get onFocusIn(){return R([t.onFocusIn])},get onFocusOut(){return R([t.onFocusOut,f.onFocusOut])}},n))}})}})}function qe(e){let o;const l=Ce(),r=Le(),t=se(),n=r.generateId("trigger"),s=F({id:n},e),[i,c]=M(s,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);Et({getItem:()=>({ref:()=>o,type:"item",key:r.value(),textValue:"",disabled:t.disabled()})});const a=at({key:()=>r.value(),selectionManager:()=>l.listState().selectionManager(),disabled:()=>t.disabled(),shouldSelectOnPressUp:!0},()=>o),f=u=>{["Enter"," "].includes(u.key)&&u.preventDefault(),A(u,i.onKeyDown),A(u,a.onKeyDown)};return T(()=>k(r.registerTriggerId(c.id))),d(xe,S({ref(u){var g=ne(y=>o=y,i.ref);typeof g=="function"&&g(u)},get"data-key"(){return a.dataKey()},get onPointerDown(){return R([i.onPointerDown,a.onPointerDown])},get onPointerUp(){return R([i.onPointerUp,a.onPointerUp])},get onClick(){return R([i.onClick,a.onClick])},onKeyDown:f,get onMouseDown(){return R([i.onMouseDown,a.onMouseDown])},get onFocus(){return R([i.onFocus,a.onFocus])}},c))}var Lt=Object.assign(We,{Content:Ne,Header:Ue,Item:je,Trigger:qe}),Nt=_('<div><div class="flex flex-wrap items-center gap-2 text-xs text-primary"><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary"></span></div><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary"></span></div><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary">');const Ut=e=>{const{t:o}=mt(),l=W(()=>ct(e.instanceId,e.sessionId)??{cost:0,contextWindow:0,isSubscriptionModel:!1,inputTokens:0,outputTokens:0,reasoningTokens:0,actualUsageTokens:0,modelOutputLimit:0,contextAvailableTokens:null}),r=W(()=>l().inputTokens??0),t=W(()=>l().outputTokens??0),n=W(()=>{const i=l().isSubscriptionModel?0:l().cost;return i>0?i:0}),s=W(()=>`$${n().toFixed(2)}`);return(()=>{var i=Nt(),c=i.firstChild,a=c.firstChild,f=a.firstChild,u=f.nextSibling,g=a.nextSibling,y=g.firstChild,v=y.nextSibling,x=g.nextSibling,$=x.firstChild,m=$.nextSibling;return h(f,()=>o("contextUsagePanel.labels.input")),h(u,()=>Se(r())),h(y,()=>o("contextUsagePanel.labels.output")),h(v,()=>Se(t())),h($,()=>o("contextUsagePanel.labels.cost")),h(m,s),he(()=>Ye(i,`session-context-panel px-4 py-2 ${e.class??""}`)),i})()};var j=_('<div class="right-panel-empty right-panel-empty--left"><span class=text-xs>'),Ht=_('<div class="rounded-md border border-base bg-surface-secondary px-3 py-2"><div class="flex items-start justify-between gap-3"><div class=min-w-0><div class="text-sm font-medium text-primary"></div><p class="mt-1 text-xs text-secondary">'),jt=_('<div class="flex flex-col gap-3 min-h-0"><div class="flex items-center justify-between gap-2 text-[11px] text-secondary"><span></span><span class="flex items-center gap-2"><span style=color:var(--session-status-idle-fg)></span><span style=color:var(--session-status-working-fg)></span></span></div><div class="rounded-md border border-base bg-surface-secondary p-2 max-h-[40vh] overflow-y-auto"><div class="flex flex-col">'),Wt=_('<button type=button class="border-b border-base last:border-b-0 text-left hover:bg-surface-muted rounded-sm"><div class="flex items-center justify-between gap-3"><div class="text-xs font-mono text-primary min-w-0 flex-1 overflow-hidden whitespace-nowrap"style=text-overflow:ellipsis;direction:rtl;text-align:left;unicode-bidi:plaintext></div><div class="flex items-center gap-2 text-[11px] flex-shrink-0"><span style=color:var(--session-status-idle-fg)></span><span style=color:var(--session-status-working-fg)>'),qt=_('<div class="flex flex-col gap-2">'),zt=_("<span>"),Vt=_('<div class=status-process-card><div class=status-process-header><span class=status-process-title></span><div class=status-process-meta><span></span><span></span></div></div><div class=status-process-actions><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center">'),Xt=_("<div class=status-tab-container>"),Yt=_("<span class=section-left><span class=section-label>");const nn=e=>{const o=i=>e.expandedItems().includes(i),s=[{id:"yolo-mode",labelKey:"instanceShell.rightPanel.sections.yoloMode",tooltipKey:"instanceShell.rightPanel.sections.yoloMode.tooltip",render:()=>{const i=e.activeSession();return i?(()=>{var c=Ht(),a=c.firstChild,f=a.firstChild,u=f.firstChild,g=u.nextSibling;return h(u,()=>e.t("instanceShell.yoloMode.title")),h(g,()=>e.t("instanceShell.yoloMode.description")),h(a,d(ft,{get checked(){return gt(e.instanceId,i.id)},color:"warning",size:"small",get inputProps(){return{"aria-label":e.t("instanceShell.yoloMode.title")}},onChange:()=>ut(e.instanceId,i.id)}),null),c})():(()=>{var c=j(),a=c.firstChild;return h(a,()=>e.t("instanceShell.yoloMode.noSessionSelected")),c})()}},{id:"session-changes",labelKey:"instanceShell.rightPanel.sections.sessionChanges",tooltipKey:"instanceShell.rightPanel.sections.sessionChanges.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var u=j(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.noSessionSelected")),u})();const c=e.activeSessionDiffs();if(c===void 0)return(()=>{var u=j(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.loading")),u})();if(!Array.isArray(c)||c.length===0)return(()=>{var u=j(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.empty")),u})();const a=[...c].sort((u,g)=>String(u.file||"").localeCompare(String(g.file||""))),f=a.reduce((u,g)=>(u.additions+=typeof g.additions=="number"?g.additions:0,u.deletions+=typeof g.deletions=="number"?g.deletions:0,u),{additions:0,deletions:0});return(()=>{var u=jt(),g=u.firstChild,y=g.firstChild,v=y.nextSibling,x=v.firstChild,$=x.nextSibling,m=g.nextSibling,w=m.firstChild;return h(y,()=>e.t("instanceShell.sessionChanges.filesChanged",{count:a.length})),h(x,()=>`+${f.additions}`),h($,()=>`-${f.deletions}`),h(w,d(ge,{each:a,children:C=>(()=>{var p=Wt(),q=p.firstChild,K=q.firstChild,z=K.nextSibling,B=z.firstChild,U=B.nextSibling;return p.$$click=()=>e.onOpenChangesTab(C.file),h(K,()=>C.file),h(B,()=>`+${C.additions}`),h(U,()=>`-${C.deletions}`),he(D=>{var L=e.t("instanceShell.sessionChanges.actions.show"),V=C.file;return L!==D.e&&O(p,"title",D.e=L),V!==D.t&&O(K,"title",D.t=V),D},{e:void 0,t:void 0}),p})()})),u})()}},{id:"plan",labelKey:"instanceShell.rightPanel.sections.plan",tooltipKey:"instanceShell.rightPanel.sections.plan.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var a=j(),f=a.firstChild;return h(f,()=>e.t("instanceShell.plan.noSessionSelected")),a})();const c=e.latestTodoState();return c?d(pt,{state:c,get emptyLabel(){return e.t("instanceShell.plan.empty")},showStatusLabel:!1}):(()=>{var a=j(),f=a.firstChild;return h(f,()=>e.t("instanceShell.plan.empty")),a})()}},{id:"background-processes",labelKey:"instanceShell.rightPanel.sections.backgroundProcesses",tooltipKey:"instanceShell.rightPanel.sections.backgroundProcesses.tooltip",render:()=>{const i=e.backgroundProcessList();return i.length===0?(()=>{var c=j(),a=c.firstChild;return h(a,()=>e.t("instanceShell.backgroundProcesses.empty")),c})():(()=>{var c=qt();return h(c,d(ge,{each:i,children:a=>(()=>{var f=Vt(),u=f.firstChild,g=u.firstChild,y=g.nextSibling,v=y.firstChild,x=v.nextSibling,$=u.nextSibling,m=$.firstChild,w=m.nextSibling,C=w.nextSibling;return h(g,()=>a.title),h(v,d(vt,{class:"h-3.5 w-3.5"})),h(x,()=>e.t("instanceShell.backgroundProcesses.status",{status:a.status})),h(y,d(J,{get when(){return typeof a.outputSizeBytes=="number"},get children(){var p=zt();return h(p,()=>e.t("instanceShell.backgroundProcesses.output",{sizeKb:Math.round((a.outputSizeBytes??0)/1024)})),p}}),null),m.$$click=()=>e.onOpenBackgroundOutput(a),h(m,d(wt,{class:"h-4 w-4"})),w.$$click=()=>e.onStopBackgroundProcess(a.id),h(w,d(Pt,{class:"h-4 w-4"})),C.$$click=()=>e.onTerminateBackgroundProcess(a.id),h(C,d(ht,{class:"h-4 w-4"})),he(p=>{var q=!!a.notifyEnabled,K=!a.notifyEnabled,z=e.t(a.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),B=e.t(a.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),U=e.t("instanceShell.backgroundProcesses.actions.output"),D=e.t("instanceShell.backgroundProcesses.actions.output"),L=a.status!=="running",V=e.t("instanceShell.backgroundProcesses.actions.stop"),ie=e.t("instanceShell.backgroundProcesses.actions.stop"),b=e.t("instanceShell.backgroundProcesses.actions.terminate"),P=e.t("instanceShell.backgroundProcesses.actions.terminate");return q!==p.e&&v.classList.toggle("text-success",p.e=q),K!==p.t&&v.classList.toggle("text-tertiary",p.t=K),z!==p.a&&O(v,"aria-label",p.a=z),B!==p.o&&O(v,"title",p.o=B),U!==p.i&&O(m,"aria-label",p.i=U),D!==p.n&&O(m,"title",p.n=D),L!==p.s&&(w.disabled=p.s=L),V!==p.h&&O(w,"aria-label",p.h=V),ie!==p.r&&O(w,"title",p.r=ie),b!==p.d&&O(C,"aria-label",p.d=b),P!==p.l&&O(C,"title",p.l=P),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),f})()})),c})()}},{id:"mcp",labelKey:"instanceShell.rightPanel.sections.mcp",tooltipKey:"instanceShell.rightPanel.sections.mcp.tooltip",render:()=>d(pe,{get initialInstance(){return e.instance},sections:["mcp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"lsp",labelKey:"instanceShell.rightPanel.sections.lsp",tooltipKey:"instanceShell.rightPanel.sections.lsp.tooltip",render:()=>d(pe,{get initialInstance(){return e.instance},sections:["lsp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"plugins",labelKey:"instanceShell.rightPanel.sections.plugins",tooltipKey:"instanceShell.rightPanel.sections.plugins.tooltip",render:()=>d(pe,{get initialInstance(){return e.instance},sections:["plugins"],showSectionHeadings:!1,class:"space-y-2"})}];return(()=>{var i=Xt();return h(i,d(J,{get when(){return e.activeSession()},children:c=>d(Ut,{get instanceId(){return e.instanceId},get sessionId(){return c().id},class:"status-tab-context-panel"})}),null),h(i,d(G.Root,{class:"right-panel-accordion",collapsible:!0,multiple:!0,get value(){return e.expandedItems()},get onChange(){return e.onExpandedItemsChange},get children(){return d(ge,{each:s,children:c=>d(G.Item,{get value(){return c.id},class:"right-panel-accordion-item",get children(){return[d(G.Header,{class:"right-panel-accordion-header-row",get children(){return[d(G.Trigger,{class:"right-panel-accordion-trigger",get children(){return[(()=>{var a=Yt(),f=a.firstChild;return h(f,()=>e.t(c.labelKey)),a})(),d(dt,{get class(){return`right-panel-accordion-chevron ${o(c.id)?"right-panel-accordion-chevron-expanded":""}`}})]}}),d(Z,{openDelay:200,gutter:4,placement:"top",get children(){return[d(Z.Trigger,{as:"button",type:"button",class:"section-info-trigger",get"aria-label"(){return e.t(c.tooltipKey)},get children(){return d(xt,{class:"section-info-icon"})}}),d(Z.Portal,{get children(){return d(Z.Content,{class:"section-info-tooltip",get children(){return e.t(c.tooltipKey)}})}})]}})]}}),d(G.Content,{class:"right-panel-accordion-content",get children(){return c.render()}})]}})})}}),null),i})()};Ge(["click"]);export{nn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as n}from"./main-
|
|
1
|
+
import{I as n}from"./main-Blt0PWLX.js";import{n as o,m as y}from"./git-diff-vendor-CSgooKT_.js";const i=[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["line",{x1:"3",x2:"21",y1:"12",y2:"12",key:"10d38w"}],["line",{x1:"3",x2:"21",y1:"18",y2:"18",key:"kwyyxn"}]],t=e=>o(n,y(e,{name:"AlignJustify",iconNode:i}));export{t as A};
|