@neuralnomads/codenomad-dev 0.13.1-dev-20260330-37b3f85e → 0.13.1-dev-20260331-197dee2a

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.
Files changed (33) hide show
  1. package/dist/opencode-config/plugin/codenomad.ts +30 -0
  2. package/dist/server/http-server.js +8 -1
  3. package/dist/server/routes/plugin.js +21 -4
  4. package/dist/ui/__tests__/remote-ui.test.js +21 -0
  5. package/dist/ui/remote-ui.js +2 -2
  6. package/package.json +1 -1
  7. package/public/assets/{ChangesTab-DReBtiCD.js → ChangesTab-C8zdDjmi.js} +2 -2
  8. package/public/assets/{DiffToolbar-zFp8QctV.js → DiffToolbar-9t70qPdk.js} +1 -1
  9. package/public/assets/{FilesTab-ondRgka_.js → FilesTab-D7BmKaIy.js} +2 -2
  10. package/public/assets/{GitChangesTab-BOcSmEC0.js → GitChangesTab-LxDWDUWh.js} +2 -2
  11. package/public/assets/{SplitFilePanel-CclMrjYs.js → SplitFilePanel-CiGeO3Fu.js} +1 -1
  12. package/public/assets/{StatusTab-BVcDbQI8.js → StatusTab-Aa5lKnqY.js} +1 -1
  13. package/public/assets/{bundle-full-DaR4-84s.js → bundle-full-Ci4Nsw1a.js} +1 -1
  14. package/public/assets/{diff-viewer-NJrs1tpM.js → diff-viewer-DUacI4bj.js} +1 -1
  15. package/public/assets/{index-9dJbqHxs.js → index-5Van9SDX.js} +1 -1
  16. package/public/assets/{index-B5yK9f1K.js → index-BMjCY26M.js} +1 -1
  17. package/public/assets/{index-C96iOm92.js → index-BbGDMdki.js} +1 -1
  18. package/public/assets/{index-DahNWccx.js → index-CAUPG2JG.js} +1 -1
  19. package/public/assets/{index-DWVFDb6o.js → index-DBKPDTTj.js} +1 -1
  20. package/public/assets/{index-Bjox8T8a.js → index-DNAppyAC.js} +2 -2
  21. package/public/assets/{index-BGfH2XEf.js → index-DzF6d6KL.js} +1 -1
  22. package/public/assets/{index-Bc4VzU8i.js → index-Xia2ufwz.js} +1 -1
  23. package/public/assets/{index-Dcri1TSs.js → index-hY6tafTK.js} +1 -1
  24. package/public/assets/{loading-DDlbjmrg.js → loading-5fXD_yBJ.js} +1 -1
  25. package/public/assets/{main-By_B3-BG.js → main-JkDQRHSo.js} +30 -30
  26. package/public/assets/{markdown-tZ1CDnLU.js → markdown-DZ9UzdXg.js} +18 -18
  27. package/public/assets/{monaco-viewer-DTwkOabu.js → monaco-viewer-DK-6pkvP.js} +3 -3
  28. package/public/assets/{todo-CW64L-p2.js → todo-BxfNuKUB.js} +1 -1
  29. package/public/assets/{tool-call-l0vsLPTC.js → tool-call-Bakver9o.js} +3 -3
  30. package/public/assets/{unified-picker-Dw7fMG5X.js → unified-picker-Qz5srwQH.js} +1 -1
  31. package/public/index.html +4 -4
  32. package/public/loading.html +4 -4
  33. package/public/sw.js +1 -1
@@ -2,6 +2,8 @@ import type { PluginInput } from "@opencode-ai/plugin"
2
2
  import { createCodeNomadClient, getCodeNomadConfig } from "./lib/client"
3
3
  import { createBackgroundProcessTools } from "./lib/background-process"
4
4
 
5
+ let voiceModeEnabled = false
6
+
5
7
  export async function CodeNomadPlugin(input: PluginInput) {
6
8
  const config = getCodeNomadConfig()
7
9
  const client = createCodeNomadClient(config)
@@ -16,6 +18,11 @@ export async function CodeNomadPlugin(input: PluginInput) {
16
18
  pingTs: (event.properties as any)?.ts,
17
19
  },
18
20
  }).catch(() => {})
21
+ return
22
+ }
23
+
24
+ if (event.type === "codenomad.voiceMode") {
25
+ voiceModeEnabled = Boolean((event.properties as { enabled?: unknown } | undefined)?.enabled)
19
26
  }
20
27
  })
21
28
 
@@ -23,6 +30,13 @@ export async function CodeNomadPlugin(input: PluginInput) {
23
30
  tool: {
24
31
  ...backgroundProcessTools,
25
32
  },
33
+ async "chat.message"(_input: { sessionID: string }, output: { message: { system?: string } }) {
34
+ if (!voiceModeEnabled) {
35
+ return
36
+ }
37
+
38
+ output.message.system = [output.message.system, buildVoiceModePrompt()].filter(Boolean).join("\n\n")
39
+ },
26
40
  async event(input: { event: any }) {
27
41
  const opencodeEvent = input?.event
28
42
  if (!opencodeEvent || typeof opencodeEvent !== "object") return
@@ -30,3 +44,19 @@ export async function CodeNomadPlugin(input: PluginInput) {
30
44
  },
31
45
  }
32
46
  }
47
+
48
+ function buildVoiceModePrompt(): string {
49
+ return [
50
+ "Voice conversation mode is enabled.",
51
+ "Prepend your reply with a fenced code block using language `spoken`.",
52
+ "The `spoken` block should be the natural conversational reply you would say out loud to the user. It should be a concise spoken gist of the full response in 2 to 4 natural sentences.",
53
+ "In the spoken block, summarize the main outcome, recommendation, or next step. Sound conversational and natural, not like a document summary.",
54
+ "Do not include code, bullet lists, markdown formatting, or long technical detail in the spoken block.",
55
+ "Do not add generic phrases about whether the user should read more.",
56
+ "Only mention additional written detail when there is something specific that may matter for the user's next response, such as a tradeoff, caveat, risk, open question, exact diff, or test result.",
57
+ "When referring to that written detail, say `below` or `in the message` rather than `detailed section`.",
58
+ "After the `spoken` block, continue with your normal detailed response.",
59
+ "Example:",
60
+ "```spoken\nI implemented the relay-based voice-mode flow and it works with the current plugin bridge. The reconnect caveat is explained below.\n```",
61
+ ].join("\n\n")
62
+ }
@@ -19,6 +19,7 @@ import { registerSpeechRoutes } from "./routes/speech";
19
19
  import { BackgroundProcessManager } from "../background-processes/manager";
20
20
  import { registerAuthRoutes } from "./routes/auth";
21
21
  import { sendUnauthorized, wantsHtml } from "../auth/http-auth";
22
+ import { PluginChannelManager } from "../plugins/channel";
22
23
  export function createHttpServer(deps) {
23
24
  // Fastify's type-level RawServer inference gets noisy when toggling HTTP vs HTTPS.
24
25
  // We keep the runtime behavior correct and cast the instance to a generic FastifyInstance.
@@ -125,6 +126,7 @@ export function createHttpServer(deps) {
125
126
  eventBus: deps.eventBus,
126
127
  logger: deps.logger.child({ component: "background-processes" }),
127
128
  });
129
+ const pluginChannel = new PluginChannelManager(deps.logger.child({ component: "plugin-channel" }));
128
130
  registerAuthRoutes(app, { authManager: deps.authManager });
129
131
  app.addHook("preHandler", (request, reply, done) => {
130
132
  const rawUrl = request.raw.url ?? request.url;
@@ -193,7 +195,12 @@ export function createHttpServer(deps) {
193
195
  workspaceManager: deps.workspaceManager,
194
196
  });
195
197
  registerSpeechRoutes(app, { speechService: deps.speechService });
196
- registerPluginRoutes(app, { workspaceManager: deps.workspaceManager, eventBus: deps.eventBus, logger: proxyLogger });
198
+ registerPluginRoutes(app, {
199
+ workspaceManager: deps.workspaceManager,
200
+ eventBus: deps.eventBus,
201
+ logger: proxyLogger,
202
+ channel: pluginChannel,
203
+ });
197
204
  registerBackgroundProcessRoutes(app, { backgroundProcessManager });
198
205
  registerInstanceProxyRoutes(app, { workspaceManager: deps.workspaceManager, logger: proxyLogger });
199
206
  if (deps.uiDevServerUrl) {
@@ -1,12 +1,13 @@
1
1
  import { z } from "zod";
2
- import { PluginChannelManager } from "../../plugins/channel";
3
2
  import { buildPingEvent, handlePluginEvent } from "../../plugins/handlers";
4
3
  const PluginEventSchema = z.object({
5
4
  type: z.string().min(1),
6
5
  properties: z.record(z.unknown()).optional(),
7
6
  });
7
+ const VoiceModeStateSchema = z.object({
8
+ enabled: z.boolean(),
9
+ });
8
10
  export function registerPluginRoutes(app, deps) {
9
- const channel = new PluginChannelManager(deps.logger.child({ component: "plugin-channel" }));
10
11
  app.get("/workspaces/:id/plugin/events", (request, reply) => {
11
12
  const workspace = deps.workspaceManager.get(request.params.id);
12
13
  if (!workspace) {
@@ -18,9 +19,9 @@ export function registerPluginRoutes(app, deps) {
18
19
  reply.raw.setHeader("Connection", "keep-alive");
19
20
  reply.raw.flushHeaders?.();
20
21
  reply.hijack();
21
- const registration = channel.register(request.params.id, reply);
22
+ const registration = deps.channel.register(request.params.id, reply);
22
23
  const heartbeat = setInterval(() => {
23
- channel.send(request.params.id, buildPingEvent());
24
+ deps.channel.send(request.params.id, buildPingEvent());
24
25
  }, 15000);
25
26
  const close = () => {
26
27
  clearInterval(heartbeat);
@@ -30,6 +31,22 @@ export function registerPluginRoutes(app, deps) {
30
31
  request.raw.on("close", close);
31
32
  request.raw.on("error", close);
32
33
  });
34
+ app.post("/workspaces/:id/plugin/voice-mode", (request, reply) => {
35
+ const workspace = deps.workspaceManager.get(request.params.id);
36
+ if (!workspace) {
37
+ reply.code(404).send({ error: "Workspace not found" });
38
+ return;
39
+ }
40
+ const payload = VoiceModeStateSchema.parse(request.body ?? {});
41
+ deps.channel.send(request.params.id, {
42
+ type: "codenomad.voiceMode",
43
+ properties: {
44
+ enabled: payload.enabled,
45
+ formatVersion: "v1",
46
+ },
47
+ });
48
+ return { enabled: payload.enabled };
49
+ });
33
50
  const handleWildcard = async (request, reply) => {
34
51
  const workspaceId = request.params.id;
35
52
  const workspace = deps.workspaceManager.get(workspaceId);
@@ -43,4 +43,25 @@ describe("resolveUi local version preference", () => {
43
43
  assert.equal(result.uiStaticDir, bundledDir);
44
44
  assert.equal(result.uiVersion, "0.8.1");
45
45
  });
46
+ it("prefers bundled when bundled and downloaded versions are equal", async () => {
47
+ const bundledDir = path.join(tempRoot, "bundled");
48
+ const configDir = path.join(tempRoot, "config");
49
+ const currentDir = path.join(configDir, "ui", "current");
50
+ await mkdir(bundledDir, { recursive: true });
51
+ await mkdir(currentDir, { recursive: true });
52
+ writeFileSync(path.join(bundledDir, "index.html"), "<html>bundled</html>");
53
+ writeFileSync(path.join(bundledDir, "ui-version.json"), JSON.stringify({ uiVersion: "0.8.1" }));
54
+ writeFileSync(path.join(currentDir, "index.html"), "<html>current</html>");
55
+ writeFileSync(path.join(currentDir, "ui-version.json"), JSON.stringify({ uiVersion: "0.8.1" }));
56
+ const result = await resolveUi({
57
+ serverVersion: "0.8.1",
58
+ bundledUiDir: bundledDir,
59
+ autoUpdate: false,
60
+ configDir,
61
+ logger: noopLogger,
62
+ });
63
+ assert.equal(result.source, "bundled");
64
+ assert.equal(result.uiStaticDir, bundledDir);
65
+ assert.equal(result.uiVersion, "0.8.1");
66
+ });
46
67
  });
@@ -179,7 +179,7 @@ async function pickBestLocalUi(args) {
179
179
  uiStaticDir: currentResolved,
180
180
  source: "downloaded",
181
181
  uiVersion: await readUiVersion(currentResolved),
182
- priority: 2,
182
+ priority: 1,
183
183
  });
184
184
  }
185
185
  const bundledResolved = await resolveStaticUiDir(args.bundledUiDir);
@@ -188,7 +188,7 @@ async function pickBestLocalUi(args) {
188
188
  uiStaticDir: bundledResolved,
189
189
  source: "bundled",
190
190
  uiVersion: await readUiVersion(bundledResolved),
191
- priority: 1,
191
+ priority: 2,
192
192
  });
193
193
  }
194
194
  const previousResolved = await resolveStaticUiDir(args.previousDir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neuralnomads/codenomad-dev",
3
- "version": "0.13.1-dev-20260330-37b3f85e",
3
+ "version": "0.13.1-dev-20260331-197dee2a",
4
4
  "description": "CodeNomad Server",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-DTwkOabu.js","assets/git-diff-vendor-CAv-4upN.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-Bjox8T8a.js";import{m as B,t as g,i as a,d as w,a as F,f as N}from"./monaco-viewer-DTwkOabu.js";import{c as f,n as c,a as L,F as T,S as W,z as j,A as q}from"./git-diff-vendor-CAv-4upN.js";import{D as G}from"./DiffToolbar-zFp8QctV.js";import{S as H}from"./SplitFilePanel-CclMrjYs.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-By_B3-BG.js";var J=g('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),E=g("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Q=g('<div class="p-3 text-xs text-secondary">'),R=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-DTwkOabu.js").then(e=>e.aa),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),de=e=>{const M=f(()=>e.activeSessionId()),S=f(()=>!!(M()&&M()!=="info")),D=f(()=>S()?e.activeSessionDiffs():null),y=f(()=>{const n=D();return Array.isArray(n)?[...n].sort((i,l)=>String(i.file||"").localeCompare(String(l.file||""))):[]}),I=f(()=>y().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})),O=f(()=>{const n=y();return n.length===0?null:n.reduce((i,l)=>{const v=typeof(i==null?void 0:i.additions)=="number"?i.additions:0,m=typeof(i==null?void 0:i.deletions)=="number"?i.deletions:0,x=v+m,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=y();if(n){const l=i.find(v=>v.file===n);if(l)return l}return O()}),p=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=y(),i=I(),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 o=E(),s=o.firstChild;return a(s,V),o})()},children:o=>c(j,{get fallback(){return(()=>{var s=E(),u=s.firstChild;return a(u,()=>e.t("instanceInfo.loading")),s})()},get children(){return c(Z,{get scopeKey(){return p()},get path(){return String(o().file||"")},get before(){return String(o().before||"")},get after(){return String(o().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})),t})(),m=()=>(()=>{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,o=r.firstChild;o.firstChild;var s=r.nextSibling,u=s.firstChild;return u.firstChild,a(o,()=>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 m()},get children(){return c(T,{each:n,children:t=>(()=>{var r=R(),o=r.firstChild,s=o.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(d=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file;return _!==d.e&&F(r,d.e=_),$!==d.t&&w(s,"title",d.t=$),d},{e:void 0,t:void 0}),r})()})}}),overlay:()=>c(W,{get when(){return n.length>0},get fallback(){return m()},get children(){return c(T,{each:n,children:t=>(()=>{var r=R(),o=r.firstChild,s=o.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(d=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file,z=t.file;return _!==d.e&&F(r,d.e=_),$!==d.t&&w(r,"title",d.t=$),z!==d.a&&w(s,"title",d.a=z),d},{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{de as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-DK-6pkvP.js","assets/git-diff-vendor-CAv-4upN.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-DNAppyAC.js";import{m as B,t as g,i as a,d as w,a as F,f as N}from"./monaco-viewer-DK-6pkvP.js";import{c as f,n as c,a as L,F as T,S as W,z as j,A as q}from"./git-diff-vendor-CAv-4upN.js";import{D as G}from"./DiffToolbar-9t70qPdk.js";import{S as H}from"./SplitFilePanel-CiGeO3Fu.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-JkDQRHSo.js";var J=g('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),E=g("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Q=g('<div class="p-3 text-xs text-secondary">'),R=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-DK-6pkvP.js").then(e=>e.aa),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),de=e=>{const M=f(()=>e.activeSessionId()),S=f(()=>!!(M()&&M()!=="info")),D=f(()=>S()?e.activeSessionDiffs():null),y=f(()=>{const n=D();return Array.isArray(n)?[...n].sort((i,l)=>String(i.file||"").localeCompare(String(l.file||""))):[]}),I=f(()=>y().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})),O=f(()=>{const n=y();return n.length===0?null:n.reduce((i,l)=>{const v=typeof(i==null?void 0:i.additions)=="number"?i.additions:0,m=typeof(i==null?void 0:i.deletions)=="number"?i.deletions:0,x=v+m,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=y();if(n){const l=i.find(v=>v.file===n);if(l)return l}return O()}),p=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=y(),i=I(),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 o=E(),s=o.firstChild;return a(s,V),o})()},children:o=>c(j,{get fallback(){return(()=>{var s=E(),u=s.firstChild;return a(u,()=>e.t("instanceInfo.loading")),s})()},get children(){return c(Z,{get scopeKey(){return p()},get path(){return String(o().file||"")},get before(){return String(o().before||"")},get after(){return String(o().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})),t})(),m=()=>(()=>{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,o=r.firstChild;o.firstChild;var s=r.nextSibling,u=s.firstChild;return u.firstChild,a(o,()=>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 m()},get children(){return c(T,{each:n,children:t=>(()=>{var r=R(),o=r.firstChild,s=o.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(d=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file;return _!==d.e&&F(r,d.e=_),$!==d.t&&w(s,"title",d.t=$),d},{e:void 0,t:void 0}),r})()})}}),overlay:()=>c(W,{get when(){return n.length>0},get fallback(){return m()},get children(){return c(T,{each:n,children:t=>(()=>{var r=R(),o=r.firstChild,s=o.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(d=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file,z=t.file;return _!==d.e&&F(r,d.e=_),$!==d.t&&w(r,"title",d.t=$),z!==d.a&&w(s,"title",d.a=z),d},{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{de as default};
@@ -1 +1 @@
1
- import{t as $,i as c,m as S,d as n,a as T,f as C}from"./monaco-viewer-DTwkOabu.js";import{u as N}from"./index-Bjox8T8a.js";import{n as i,m as h,a as V}from"./git-diff-vendor-CAv-4upN.js";import{I as f,J as U,K as A}from"./main-By_B3-BG.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"}]],J=t=>i(f,h(t,{name:"AlignJustify",iconNode:I})),j=[["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"}]],D=t=>i(f,h(t,{name:"UnfoldVertical",iconNode:j})),E=[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["path",{d:"M3 12h15a3 3 0 1 1 0 6h-4",key:"1cl7v7"}],["polyline",{points:"16 16 14 18 16 20",key:"1jznyi"}],["line",{x1:"3",x2:"10",y1:"18",y2:"18",key:"1h33wv"}]],F=t=>i(f,h(t,{name:"WrapText",iconNode:E}));var H=$("<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 R=t=>{const{t:o}=N(),s=()=>t.viewMode==="split"?"unified":"split",r=()=>t.contextMode==="collapsed"?"expanded":"collapsed",y=()=>t.wordWrapMode==="on"?"off":"on",v=()=>s()==="split"?o("instanceShell.diff.switchToSplit"):o("instanceShell.diff.switchToUnified"),u=()=>r()==="collapsed"?o("instanceShell.diff.hideUnchanged"):o("instanceShell.diff.showFull"),b=()=>y()==="on"?o("instanceShell.diff.enableWordWrap"):o("instanceShell.diff.disableWordWrap");return(()=>{var x=H(),a=x.firstChild,l=a.nextSibling,d=l.nextSibling;return a.$$click=()=>t.onViewModeChange(s()),c(a,(()=>{var e=S(()=>s()==="split");return()=>e()?i(U,{class:"h-4 w-4","aria-hidden":"true"}):i(J,{class:"h-4 w-4","aria-hidden":"true"})})()),l.$$click=()=>t.onContextModeChange(r()),c(l,(()=>{var e=S(()=>r()==="collapsed");return()=>e()?i(A,{class:"h-4 w-4","aria-hidden":"true"}):i(D,{class:"h-4 w-4","aria-hidden":"true"})})()),d.$$click=()=>t.onWordWrapModeChange(y()),c(d,i(F,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=v(),w=v(),k=u(),M=u(),p=`file-viewer-toolbar-icon-button${t.wordWrapMode==="on"?" active":""}`,W=b(),g=b();return m!==e.e&&n(a,"aria-label",e.e=m),w!==e.t&&n(a,"title",e.t=w),k!==e.a&&n(l,"aria-label",e.a=k),M!==e.o&&n(l,"title",e.o=M),p!==e.i&&T(d,e.i=p),W!==e.n&&n(d,"aria-label",e.n=W),g!==e.s&&n(d,"title",e.s=g),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),x})()};C(["click"]);export{R as D};
1
+ import{t as $,i as c,m as S,d as n,a as T,f as C}from"./monaco-viewer-DK-6pkvP.js";import{u as N}from"./index-DNAppyAC.js";import{n as i,m as h,a as V}from"./git-diff-vendor-CAv-4upN.js";import{I as f,J as U,K as A}from"./main-JkDQRHSo.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"}]],J=t=>i(f,h(t,{name:"AlignJustify",iconNode:I})),j=[["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"}]],D=t=>i(f,h(t,{name:"UnfoldVertical",iconNode:j})),E=[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["path",{d:"M3 12h15a3 3 0 1 1 0 6h-4",key:"1cl7v7"}],["polyline",{points:"16 16 14 18 16 20",key:"1jznyi"}],["line",{x1:"3",x2:"10",y1:"18",y2:"18",key:"1h33wv"}]],F=t=>i(f,h(t,{name:"WrapText",iconNode:E}));var H=$("<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 R=t=>{const{t:o}=N(),s=()=>t.viewMode==="split"?"unified":"split",r=()=>t.contextMode==="collapsed"?"expanded":"collapsed",y=()=>t.wordWrapMode==="on"?"off":"on",v=()=>s()==="split"?o("instanceShell.diff.switchToSplit"):o("instanceShell.diff.switchToUnified"),u=()=>r()==="collapsed"?o("instanceShell.diff.hideUnchanged"):o("instanceShell.diff.showFull"),b=()=>y()==="on"?o("instanceShell.diff.enableWordWrap"):o("instanceShell.diff.disableWordWrap");return(()=>{var x=H(),a=x.firstChild,l=a.nextSibling,d=l.nextSibling;return a.$$click=()=>t.onViewModeChange(s()),c(a,(()=>{var e=S(()=>s()==="split");return()=>e()?i(U,{class:"h-4 w-4","aria-hidden":"true"}):i(J,{class:"h-4 w-4","aria-hidden":"true"})})()),l.$$click=()=>t.onContextModeChange(r()),c(l,(()=>{var e=S(()=>r()==="collapsed");return()=>e()?i(A,{class:"h-4 w-4","aria-hidden":"true"}):i(D,{class:"h-4 w-4","aria-hidden":"true"})})()),d.$$click=()=>t.onWordWrapModeChange(y()),c(d,i(F,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=v(),w=v(),k=u(),M=u(),p=`file-viewer-toolbar-icon-button${t.wordWrapMode==="on"?" active":""}`,W=b(),g=b();return m!==e.e&&n(a,"aria-label",e.e=m),w!==e.t&&n(a,"title",e.t=w),k!==e.a&&n(l,"aria-label",e.a=k),M!==e.o&&n(l,"title",e.o=M),p!==e.i&&T(d,e.i=p),W!==e.n&&n(d,"aria-label",e.n=W),g!==e.s&&n(d,"title",e.s=g),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),x})()};C(["click"]);export{R as D};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-DTwkOabu.js","assets/git-diff-vendor-CAv-4upN.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 R}from"./index-Bjox8T8a.js";import{m as _,t as o,i as s,d as c,a as z,f as I}from"./monaco-viewer-DTwkOabu.js";import{n as i,m as D,S as d,a as v,F,z as V,A as M}from"./git-diff-vendor-CAv-4upN.js";import{S as T}from"./SplitFilePanel-CclMrjYs.js";import{I as A,R as y}from"./main-By_B3-BG.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const O=[["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"}]],q=e=>i(A,D(e,{name:"Save",iconNode:O}));var g=o("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),K=o('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),N=o('<div class="p-3 text-xs text-secondary">'),W=o("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),H=o('<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="text-[10px] text-secondary">'),j=o("<span>"),B=o("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),G=o("<button type=button class=files-header-icon-button style=margin-inline-start:auto>"),J=o("<button type=button class=files-header-icon-button>"),Q=o("<span class=text-error>");const U=M(()=>R(()=>import("./monaco-viewer-DTwkOabu.js").then(e=>e.ab),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoFileViewer}))),ae=e=>{const C=()=>{const h=e.browserSelectedContent();h!=null&&e.onSave(h)};return _(()=>{const h=e.browserEntries(),P=[...h||[]].sort((t,n)=>{const r=t.type==="directory"?0:1,l=n.type==="directory"?0:1;return r!==l?r-l:String(t.name||"").localeCompare(String(n.name||""))}),L=e.parentPath(),w=()=>e.browserSelectedPath()||e.browserPath(),x=()=>e.browserLoading()&&h===null?e.t("instanceInfo.loading"):e.t("instanceShell.filesShell.viewerEmpty"),k=()=>(()=>{var t=K(),n=t.firstChild;return s(n,i(d,{get when(){return e.browserSelectedLoading()},get fallback(){return i(d,{get when(){return e.browserSelectedError()},get fallback(){return i(d,{get when(){return _(()=>!!(e.browserSelectedPath()&&e.browserSelectedContent()!==null))()?{path:e.browserSelectedPath(),content:e.browserSelectedContent()}:null},get fallback(){return(()=>{var r=g(),l=r.firstChild;return s(l,x),r})()},children:r=>i(V,{get fallback(){return(()=>{var l=g(),a=l.firstChild;return s(a,()=>e.t("instanceInfo.loading")),l})()},get children(){return i(U,{get scopeKey(){return e.scopeKey()},get path(){return r().path},get content(){return r().content},get onSave(){return e.onSave},get onContentChange(){return e.onContentChange}})}})})},children:r=>(()=>{var l=g(),a=l.firstChild;return s(a,r),l})()})},get children(){var r=g(),l=r.firstChild;return s(l,()=>e.t("instanceInfo.loading")),r}})),t})(),m=()=>[i(d,{when:L,children:t=>(()=>{var n=W(),r=n.firstChild,l=r.firstChild;return n.$$click=()=>e.onLoadEntries(t()),v(()=>c(l,"title",t())),n})()}),i(d,{get when(){return e.browserLoading()&&h===null},get children(){var t=N();return s(t,()=>e.t("instanceInfo.loading")),t}}),i(F,{each:P,children:t=>(()=>{var n=H(),r=n.firstChild,l=r.firstChild,a=l.firstChild,f=l.nextSibling,E=f.firstChild;return n.$$click=()=>{if(t.type==="directory"){e.onLoadEntries(t.path);return}e.onRequestOpenFile(t.path)},s(a,()=>t.name),s(E,()=>t.type),v(u=>{var b=`file-list-item ${e.browserSelectedPath()===t.path?"file-list-item-active":""}`,S=t.path,$=t.path;return b!==u.e&&z(n,u.e=b),S!==u.t&&c(n,"title",u.t=S),$!==u.a&&c(l,"title",u.a=$),u},{e:void 0,t:void 0,a:void 0}),n})()})];return i(T,{get header(){return[(()=>{var t=B(),n=t.firstChild,r=n.firstChild,l=r.firstChild;return s(l,w),s(t,i(d,{get when(){return e.browserLoading()},get children(){var a=j();return s(a,()=>e.t("instanceInfo.loading")),a}}),null),s(t,i(d,{get when(){return e.browserError()},children:a=>(()=>{var f=Q();return s(f,a),f})()}),null),v(()=>c(r,"title",w())),t})(),(()=>{var t=G();return t.$$click=C,s(t,i(d,{get when(){return e.browserSelectedSaving()},get fallback(){return i(q,{class:"h-4 w-4"})},get children(){return i(y,{class:"h-4 w-4 animate-spin"})}})),v(n=>{var r=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",l=e.t("instanceShell.rightPanel.actions.save")||"Save",a=e.browserSelectedSaving()||!e.browserSelectedDirty();return r!==n.e&&c(t,"title",n.e=r),l!==n.t&&c(t,"aria-label",n.t=l),a!==n.a&&(t.disabled=n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=J();return t.$$click=()=>e.onRefresh(),s(t,i(y,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),v(n=>{var r=e.t("instanceShell.rightPanel.actions.refresh"),l=e.t("instanceShell.rightPanel.actions.refresh"),a=e.browserLoading();return r!==n.e&&c(t,"title",n.e=r),l!==n.t&&c(t,"aria-label",n.t=l),a!==n.a&&(t.disabled=n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})()]},list:{panel:m,overlay:m},get viewer(){return k()},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")}})})};I(["click"]);export{ae as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-DK-6pkvP.js","assets/git-diff-vendor-CAv-4upN.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 R}from"./index-DNAppyAC.js";import{m as _,t as o,i as s,d as c,a as z,f as I}from"./monaco-viewer-DK-6pkvP.js";import{n as i,m as D,S as d,a as v,F,z as V,A as M}from"./git-diff-vendor-CAv-4upN.js";import{S as T}from"./SplitFilePanel-CiGeO3Fu.js";import{I as A,R as y}from"./main-JkDQRHSo.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const O=[["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"}]],q=e=>i(A,D(e,{name:"Save",iconNode:O}));var g=o("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),K=o('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),N=o('<div class="p-3 text-xs text-secondary">'),W=o("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),H=o('<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="text-[10px] text-secondary">'),j=o("<span>"),B=o("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),G=o("<button type=button class=files-header-icon-button style=margin-inline-start:auto>"),J=o("<button type=button class=files-header-icon-button>"),Q=o("<span class=text-error>");const U=M(()=>R(()=>import("./monaco-viewer-DK-6pkvP.js").then(e=>e.ab),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoFileViewer}))),ae=e=>{const C=()=>{const h=e.browserSelectedContent();h!=null&&e.onSave(h)};return _(()=>{const h=e.browserEntries(),P=[...h||[]].sort((t,n)=>{const r=t.type==="directory"?0:1,l=n.type==="directory"?0:1;return r!==l?r-l:String(t.name||"").localeCompare(String(n.name||""))}),L=e.parentPath(),w=()=>e.browserSelectedPath()||e.browserPath(),x=()=>e.browserLoading()&&h===null?e.t("instanceInfo.loading"):e.t("instanceShell.filesShell.viewerEmpty"),k=()=>(()=>{var t=K(),n=t.firstChild;return s(n,i(d,{get when(){return e.browserSelectedLoading()},get fallback(){return i(d,{get when(){return e.browserSelectedError()},get fallback(){return i(d,{get when(){return _(()=>!!(e.browserSelectedPath()&&e.browserSelectedContent()!==null))()?{path:e.browserSelectedPath(),content:e.browserSelectedContent()}:null},get fallback(){return(()=>{var r=g(),l=r.firstChild;return s(l,x),r})()},children:r=>i(V,{get fallback(){return(()=>{var l=g(),a=l.firstChild;return s(a,()=>e.t("instanceInfo.loading")),l})()},get children(){return i(U,{get scopeKey(){return e.scopeKey()},get path(){return r().path},get content(){return r().content},get onSave(){return e.onSave},get onContentChange(){return e.onContentChange}})}})})},children:r=>(()=>{var l=g(),a=l.firstChild;return s(a,r),l})()})},get children(){var r=g(),l=r.firstChild;return s(l,()=>e.t("instanceInfo.loading")),r}})),t})(),m=()=>[i(d,{when:L,children:t=>(()=>{var n=W(),r=n.firstChild,l=r.firstChild;return n.$$click=()=>e.onLoadEntries(t()),v(()=>c(l,"title",t())),n})()}),i(d,{get when(){return e.browserLoading()&&h===null},get children(){var t=N();return s(t,()=>e.t("instanceInfo.loading")),t}}),i(F,{each:P,children:t=>(()=>{var n=H(),r=n.firstChild,l=r.firstChild,a=l.firstChild,f=l.nextSibling,E=f.firstChild;return n.$$click=()=>{if(t.type==="directory"){e.onLoadEntries(t.path);return}e.onRequestOpenFile(t.path)},s(a,()=>t.name),s(E,()=>t.type),v(u=>{var b=`file-list-item ${e.browserSelectedPath()===t.path?"file-list-item-active":""}`,S=t.path,$=t.path;return b!==u.e&&z(n,u.e=b),S!==u.t&&c(n,"title",u.t=S),$!==u.a&&c(l,"title",u.a=$),u},{e:void 0,t:void 0,a:void 0}),n})()})];return i(T,{get header(){return[(()=>{var t=B(),n=t.firstChild,r=n.firstChild,l=r.firstChild;return s(l,w),s(t,i(d,{get when(){return e.browserLoading()},get children(){var a=j();return s(a,()=>e.t("instanceInfo.loading")),a}}),null),s(t,i(d,{get when(){return e.browserError()},children:a=>(()=>{var f=Q();return s(f,a),f})()}),null),v(()=>c(r,"title",w())),t})(),(()=>{var t=G();return t.$$click=C,s(t,i(d,{get when(){return e.browserSelectedSaving()},get fallback(){return i(q,{class:"h-4 w-4"})},get children(){return i(y,{class:"h-4 w-4 animate-spin"})}})),v(n=>{var r=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",l=e.t("instanceShell.rightPanel.actions.save")||"Save",a=e.browserSelectedSaving()||!e.browserSelectedDirty();return r!==n.e&&c(t,"title",n.e=r),l!==n.t&&c(t,"aria-label",n.t=l),a!==n.a&&(t.disabled=n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=J();return t.$$click=()=>e.onRefresh(),s(t,i(y,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),v(n=>{var r=e.t("instanceShell.rightPanel.actions.refresh"),l=e.t("instanceShell.rightPanel.actions.refresh"),a=e.browserLoading();return r!==n.e&&c(t,"title",n.e=r),l!==n.t&&c(t,"aria-label",n.t=l),a!==n.a&&(t.disabled=n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})()]},list:{panel:m,overlay:m},get viewer(){return k()},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")}})})};I(["click"]);export{ae as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-DTwkOabu.js","assets/git-diff-vendor-CAv-4upN.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 B}from"./index-Bjox8T8a.js";import{m as V,t as h,i as r,d as $,a as D,f as K}from"./monaco-viewer-DTwkOabu.js";import{c as f,n as d,a as w,S as c,F as R,z as G,A as N}from"./git-diff-vendor-CAv-4upN.js";import{D as j}from"./DiffToolbar-zFp8QctV.js";import{S as q}from"./SplitFilePanel-CclMrjYs.js";import{R as H}from"./main-By_B3-BG.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";var S=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),J=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),Q=h('<div class="p-3 text-xs text-secondary">'),A=h('<span class="text-[10px] text-secondary">'),z=h("<span class=file-list-item-additions>+"),O=h("<span class=file-list-item-deletions>-"),T=h("<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>"),U=h("<span class=files-tab-selected-path><span class=file-path-text>"),X=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>-'),Y=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Z=h("<span class=text-error>");const p=N(()=>B(()=>import("./monaco-viewer-DTwkOabu.js").then(e=>e.aa),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),he=e=>{const P=f(()=>e.activeSessionId()),y=f(()=>!!(P()&&P()!=="info")),M=f(()=>y()?e.entries():null),b=f(()=>{const o=M();return Array.isArray(o)?[...o].sort((s,g)=>String(s.path||"").localeCompare(String(g.path||""))):[]}),F=f(()=>b().reduce((o,s)=>(o.additions+=typeof s.added=="number"?s.added:0,o.deletions+=typeof s.removed=="number"?s.removed:0,o),{additions:0,deletions:0})),L=f(()=>b().filter(o=>o&&o.status!=="deleted")),I=f(()=>{const o=b(),s=e.selectedPath(),g=e.mostChangedPath();return(o.find(_=>_.path===s)||(g?o.find(_=>_.path===g):void 0))??null}),W=f(()=>y()?M()===null?e.t("instanceShell.gitChanges.loading"):L().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected"));return V(()=>{const o=F(),s=I(),g=b(),x=L(),_=()=>(()=>{var t=J(),l=t.firstChild;return r(l,d(c,{get when(){return e.selectedLoading()},get fallback(){return d(c,{get when(){return e.selectedError()},get fallback(){return d(c,{get when(){return V(()=>!!(s&&e.selectedBefore()!==null&&e.selectedAfter()!==null&&s.status!=="deleted"))()?{path:s.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=S(),a=i.firstChild;return r(a,W),i})()},children:i=>d(G,{get fallback(){return(()=>{var a=S(),u=a.firstChild;return r(u,()=>e.t("instanceInfo.loading")),a})()},get children(){return d(p,{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()}})}})})},children:i=>(()=>{var a=S(),u=a.firstChild;return r(u,i),a})()})},get children(){var i=S(),a=i.firstChild;return r(a,()=>e.t("instanceInfo.loading")),i}})),t})(),k=()=>(()=>{var t=Q();return r(t,W),t})();return d(q,{get header(){return[(()=>{var t=U(),l=t.firstChild;return r(l,()=>(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),w(()=>$(t,"title",(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=X(),l=t.firstChild,i=l.firstChild;i.firstChild;var a=l.nextSibling,u=a.firstChild;return u.firstChild,r(i,()=>o.additions,null),r(u,()=>o.deletions,null),r(t,d(c,{get when(){return e.statusError()},children:v=>(()=>{var n=Z();return r(n,v),n})()}),null),t})(),(()=>{var t=Y();return t.$$click=()=>e.onRefresh(),r(t,d(H,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),w(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),a=e.t("instanceShell.rightPanel.actions.refresh"),u=!y()||e.statusLoading()||M()===null;return i!==l.e&&$(t,"title",l.e=i),a!==l.t&&$(t,"aria-label",l.t=a),u!==l.a&&(t.disabled=l.a=u),l},{e:void 0,t:void 0,a:void 0}),t})(),d(j,{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:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>{e.onOpenFile(t.path)},r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(a,"title",n.t=m),n},{e:void 0,t:void 0}),l})()})}}),overlay:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>e.onOpenFile(t.path),r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path,E=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(l,"title",n.t=m),E!==n.a&&$(a,"title",n.a=E),n},{e:void 0,t:void 0,a:void 0}),l})()})}})},get viewer(){return _()},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")}})})};K(["click"]);export{he as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-DK-6pkvP.js","assets/git-diff-vendor-CAv-4upN.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 B}from"./index-DNAppyAC.js";import{m as V,t as h,i as r,d as $,a as D,f as K}from"./monaco-viewer-DK-6pkvP.js";import{c as f,n as d,a as w,S as c,F as R,z as G,A as N}from"./git-diff-vendor-CAv-4upN.js";import{D as j}from"./DiffToolbar-9t70qPdk.js";import{S as q}from"./SplitFilePanel-CiGeO3Fu.js";import{R as H}from"./main-JkDQRHSo.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";var S=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),J=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),Q=h('<div class="p-3 text-xs text-secondary">'),A=h('<span class="text-[10px] text-secondary">'),z=h("<span class=file-list-item-additions>+"),O=h("<span class=file-list-item-deletions>-"),T=h("<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>"),U=h("<span class=files-tab-selected-path><span class=file-path-text>"),X=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>-'),Y=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Z=h("<span class=text-error>");const p=N(()=>B(()=>import("./monaco-viewer-DK-6pkvP.js").then(e=>e.aa),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),he=e=>{const P=f(()=>e.activeSessionId()),y=f(()=>!!(P()&&P()!=="info")),M=f(()=>y()?e.entries():null),b=f(()=>{const o=M();return Array.isArray(o)?[...o].sort((s,g)=>String(s.path||"").localeCompare(String(g.path||""))):[]}),F=f(()=>b().reduce((o,s)=>(o.additions+=typeof s.added=="number"?s.added:0,o.deletions+=typeof s.removed=="number"?s.removed:0,o),{additions:0,deletions:0})),L=f(()=>b().filter(o=>o&&o.status!=="deleted")),I=f(()=>{const o=b(),s=e.selectedPath(),g=e.mostChangedPath();return(o.find(_=>_.path===s)||(g?o.find(_=>_.path===g):void 0))??null}),W=f(()=>y()?M()===null?e.t("instanceShell.gitChanges.loading"):L().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected"));return V(()=>{const o=F(),s=I(),g=b(),x=L(),_=()=>(()=>{var t=J(),l=t.firstChild;return r(l,d(c,{get when(){return e.selectedLoading()},get fallback(){return d(c,{get when(){return e.selectedError()},get fallback(){return d(c,{get when(){return V(()=>!!(s&&e.selectedBefore()!==null&&e.selectedAfter()!==null&&s.status!=="deleted"))()?{path:s.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=S(),a=i.firstChild;return r(a,W),i})()},children:i=>d(G,{get fallback(){return(()=>{var a=S(),u=a.firstChild;return r(u,()=>e.t("instanceInfo.loading")),a})()},get children(){return d(p,{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()}})}})})},children:i=>(()=>{var a=S(),u=a.firstChild;return r(u,i),a})()})},get children(){var i=S(),a=i.firstChild;return r(a,()=>e.t("instanceInfo.loading")),i}})),t})(),k=()=>(()=>{var t=Q();return r(t,W),t})();return d(q,{get header(){return[(()=>{var t=U(),l=t.firstChild;return r(l,()=>(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),w(()=>$(t,"title",(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=X(),l=t.firstChild,i=l.firstChild;i.firstChild;var a=l.nextSibling,u=a.firstChild;return u.firstChild,r(i,()=>o.additions,null),r(u,()=>o.deletions,null),r(t,d(c,{get when(){return e.statusError()},children:v=>(()=>{var n=Z();return r(n,v),n})()}),null),t})(),(()=>{var t=Y();return t.$$click=()=>e.onRefresh(),r(t,d(H,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),w(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),a=e.t("instanceShell.rightPanel.actions.refresh"),u=!y()||e.statusLoading()||M()===null;return i!==l.e&&$(t,"title",l.e=i),a!==l.t&&$(t,"aria-label",l.t=a),u!==l.a&&(t.disabled=l.a=u),l},{e:void 0,t:void 0,a:void 0}),t})(),d(j,{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:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>{e.onOpenFile(t.path)},r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(a,"title",n.t=m),n},{e:void 0,t:void 0}),l})()})}}),overlay:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>e.onOpenFile(t.path),r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path,E=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(l,"title",n.t=m),E!==n.a&&$(a,"title",n.a=E),n},{e:void 0,t:void 0,a:void 0}),l})()})}})},get viewer(){return _()},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")}})})};K(["click"]);export{he as default};
@@ -1 +1 @@
1
- import{t as d,i as l,d as m,j as s,m as b,g as _,f as w}from"./monaco-viewer-DTwkOabu.js";import{a as g,n as r,S as n}from"./git-diff-vendor-CAv-4upN.js";import{u as S}from"./index-Bjox8T8a.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
+ import{t as d,i as l,d as m,j as s,m as b,g as _,f as w}from"./monaco-viewer-DK-6pkvP.js";import{a as g,n as r,S as n}from"./git-diff-vendor-CAv-4upN.js";import{u as S}from"./index-DNAppyAC.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 we,P as Ve,t as M,i as h,a as Xe,d as B,f as Ge}from"./monaco-viewer-DTwkOabu.js";import{n as c,m as P,b as k,o as S,k as Z,l as J,q as re,s as D,d as T,c as H,S as Q,t as Ye,w as xe,a as ge,F as ce}from"./git-diff-vendor-CAv-4upN.js";import{I as pe,N as Qe,O as A,P as se,Q as Ze,T as Je,U as Pe,V as Se,W as Ie,X as et,Y as de,Z as ie,_ as le,$ as Te,a0 as ee,a1 as te,a2 as tt,a3 as fe,a4 as nt,a5 as ot,a6 as _,a7 as he,a8 as st,a9 as it,aa as rt,ab as E,ac as lt,ad as at,ae as Ce,af as ct,ag as ue,ah as dt}from"./main-By_B3-BG.js";import{u as ut}from"./index-Bjox8T8a.js";import{T as gt}from"./todo-CW64L-p2.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const pt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ft=e=>c(pe,P(e,{name:"Info",iconNode:pt})),ht=[["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"}]],mt=e=>c(pe,P(e,{name:"TerminalSquare",iconNode:ht})),bt=[["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"}]],vt=e=>c(pe,P(e,{name:"XOctagon",iconNode:bt}));var ke=Z();function yt(){return J(ke)}function xt(){const e=yt();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function $e(e,s){return!!(s.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Ct(e,s){var n;const l=s.ref();if(!l)return-1;let r=e.length;if(!r)return-1;for(;r--;){const o=(n=e[r])==null?void 0:n.ref();if(o&&$e(o,l))return r+1}return 0}function wt(e){const s=e.map((r,n)=>[n,r]);let l=!1;return s.sort(([r,n],[o,t])=>{const i=n.ref(),a=t.ref();return i===a||!i||!a?0:$e(i,a)?(r>o&&(l=!0),-1):(r<o&&(l=!0),1)}),l?s.map(([r,n])=>n):e}function De(e,s){const l=wt(e);e!==l&&s(l)}function Pt(e){var n,o;const s=e[0],l=(n=e[e.length-1])==null?void 0:n.ref();let r=(o=s==null?void 0:s.ref())==null?void 0:o.parentElement;for(;r;){if(l&&r.contains(l))return r;r=r.parentElement}return se(r).body}function St(e,s){k(()=>{const l=setTimeout(()=>{De(e(),s)});S(()=>clearTimeout(l))})}function It(e,s){if(typeof IntersectionObserver!="function"){St(e,s);return}let l=[];k(()=>{const r=()=>{const t=!!l.length;l=e(),t&&De(e(),s)},n=Pt(e()),o=new IntersectionObserver(r,{root:n});for(const t of e()){const i=t.ref();i&&o.observe(i)}S(()=>o.disconnect())})}function Tt(e={}){const[s,l]=Qe({value:()=>Je(e.items),onChange:o=>{var t;return(t=e.onItemsChange)==null?void 0:t.call(e,o)}});It(s,l);const r=o=>(l(t=>{const i=Ct(t,o);return Ze(t,o,i)}),()=>{l(t=>{const i=t.filter(a=>a.ref()!==o.ref());return t.length===i.length?t:i})});return{DomCollectionProvider:o=>c(ke.Provider,{value:{registerItem:r},get children(){return o.children}})}}function kt(e){const s=xt(),l=A({shouldRegisterItem:!0},e);k(()=>{if(!l.shouldRegisterItem)return;const r=s.registerItem(l.getItem());S(r)})}var $t={};he($t,{Arrow:()=>Pe,Content:()=>_e,Portal:()=>Ee,Root:()=>Me,Tooltip:()=>Y,Trigger:()=>Ae,useTooltipContext:()=>ae});var Oe=Z();function ae(){const e=J(Oe);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function _e(e){const s=ae(),l=A({id:s.generateId("content")},e),[r,n]=D(l,["ref","style"]);return k(()=>S(s.registerContentId(n.id))),c(Q,{get when(){return s.contentPresent()},get children(){return c(Te.Positioner,{get children(){return c(tt,P({ref(o){var t=ee(i=>{s.setContentRef(i)},r.ref);typeof t=="function"&&t(o)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return fe({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:o=>o.preventDefault(),onDismiss:()=>s.hideTooltip(!0)},()=>s.dataset(),n))}})}})}function Ee(e){const s=ae();return c(Q,{get when(){return s.contentPresent()},get children(){return c(Ve,e)}})}function Dt(e,s,l){const r=e.split("-")[0],n=s.getBoundingClientRect(),o=l.getBoundingClientRect(),t=[],i=n.left+n.width/2,a=n.top+n.height/2;switch(r){case"top":t.push([n.left,a]),t.push([o.left,o.bottom]),t.push([o.left,o.top]),t.push([o.right,o.top]),t.push([o.right,o.bottom]),t.push([n.right,a]);break;case"right":t.push([i,n.top]),t.push([o.left,o.top]),t.push([o.right,o.top]),t.push([o.right,o.bottom]),t.push([o.left,o.bottom]),t.push([i,n.bottom]);break;case"bottom":t.push([n.left,a]),t.push([o.left,o.top]),t.push([o.left,o.bottom]),t.push([o.right,o.bottom]),t.push([o.right,o.top]),t.push([n.right,a]);break;case"left":t.push([i,n.top]),t.push([o.right,o.top]),t.push([o.left,o.top]),t.push([o.left,o.bottom]),t.push([o.right,o.bottom]),t.push([i,n.bottom]);break}return t}var N={},Ot=0,j=!1,O,G,q;function Me(e){const s=`tooltip-${re()}`,l=`${++Ot}`,r=A({id:s,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[n,o]=D(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let t;const[i,a]=T(),[u,d]=T(),[g,v]=T(),[y,x]=T(o.placement),m=Se({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:b=>{var $;return($=n.onOpenChange)==null?void 0:$.call(n,b)}}),{present:C}=Ie({show:()=>n.forceMount||m.isOpen(),element:()=>g()??null}),p=()=>{N[l]=w},f=()=>{for(const b in N)b!==l&&(N[b](!0),delete N[b])},w=(b=!1)=>{b||n.closeDelay&&n.closeDelay<=0?(window.clearTimeout(t),t=void 0,m.close()):t||(t=window.setTimeout(()=>{t=void 0,m.close()},n.closeDelay)),window.clearTimeout(O),O=void 0,n.skipDelayDuration&&n.skipDelayDuration>=0&&(q=window.setTimeout(()=>{window.clearTimeout(q),q=void 0},n.skipDelayDuration)),j&&(window.clearTimeout(G),G=window.setTimeout(()=>{delete N[l],G=void 0,j=!1},n.closeDelay))},F=()=>{clearTimeout(t),t=void 0,f(),p(),j=!0,m.open(),window.clearTimeout(O),O=void 0,window.clearTimeout(G),G=void 0,window.clearTimeout(q),q=void 0},R=()=>{f(),p(),!m.isOpen()&&!O&&!j?O=window.setTimeout(()=>{O=void 0,j=!0,F()},n.openDelay):m.isOpen()||F()},W=(b=!1)=>{!b&&n.openDelay&&n.openDelay>0&&!t&&!q?R():F()},L=()=>{window.clearTimeout(O),O=void 0,j=!1},U=()=>{window.clearTimeout(t),t=void 0},I=b=>de(u(),b)||de(g(),b),oe=b=>{const $=u(),K=g();if(!(!$||!K))return Dt(b,$,K)},X=b=>{const $=b.target;if(I($)){U();return}if(!n.ignoreSafeArea){const K=oe(y());if(K&&nt(ot(b),K)){U();return}}t||w()};k(()=>{if(!m.isOpen())return;const b=se();b.addEventListener("pointermove",X,!0),S(()=>{b.removeEventListener("pointermove",X,!0)})}),k(()=>{const b=u();if(!b||!m.isOpen())return;const $=qe=>{const ze=qe.target;de(ze,b)&&w(!0)},K=et();K.addEventListener("scroll",$,{capture:!0}),S(()=>{K.removeEventListener("scroll",$,{capture:!0})})}),S(()=>{clearTimeout(t),N[l]&&delete N[l]});const je={dataset:H(()=>({"data-expanded":m.isOpen()?"":void 0,"data-closed":m.isOpen()?void 0:""})),isOpen:m.isOpen,isDisabled:()=>n.disabled??!1,triggerOnFocusOnly:()=>n.triggerOnFocusOnly??!1,contentId:i,contentPresent:C,openTooltip:W,hideTooltip:w,cancelOpening:L,generateId:le(()=>r.id),registerContentId:ie(a),isTargetOnTooltip:I,setTriggerRef:d,setContentRef:v};return c(Oe.Provider,{value:je,get children(){return c(Te,P({anchorRef:u,contentRef:g,onCurrentPlacementChange:x},o))}})}function Ae(e){let s;const l=ae(),[r,n]=D(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let o=!1,t=!1,i=!1;const a=()=>{o=!1},u=()=>{!l.isOpen()&&(t||i)&&l.openTooltip(i)},d=p=>{l.isOpen()&&!t&&!i&&l.hideTooltip(p)},g=p=>{_(p,r.onPointerEnter),!(p.pointerType==="touch"||l.triggerOnFocusOnly()||l.isDisabled()||p.defaultPrevented)&&(t=!0,u())},v=p=>{_(p,r.onPointerLeave),p.pointerType!=="touch"&&(t=!1,i=!1,l.isOpen()?d():l.cancelOpening())},y=p=>{_(p,r.onPointerDown),o=!0,se(s).addEventListener("pointerup",a,{once:!0})},x=p=>{_(p,r.onClick),t=!1,i=!1,d(!0)},m=p=>{_(p,r.onFocus),!(l.isDisabled()||p.defaultPrevented||o)&&(i=!0,u())},C=p=>{_(p,r.onBlur);const f=p.relatedTarget;l.isTargetOnTooltip(f)||(t=!1,i=!1,d(!0))};return S(()=>{se(s).removeEventListener("pointerup",a)}),c(te,P({as:"button",ref(p){var f=ee(w=>{l.setTriggerRef(w),s=w},r.ref);typeof f=="function"&&f(p)},get"aria-describedby"(){return we(()=>!!l.isOpen())()?l.contentId():void 0},onPointerEnter:g,onPointerLeave:v,onPointerDown:y,onClick:x,onFocus:m,onBlur:C},()=>l.dataset(),n))}var Y=Object.assign(Me,{Arrow:Pe,Content:_e,Portal:Ee,Trigger:Ae}),_t={};he(_t,{Collapsible:()=>Et,Content:()=>me,Root:()=>be,Trigger:()=>ve,useCollapsibleContext:()=>ne});var Fe=Z();function ne(){const e=J(Fe);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function me(e){const[s,l]=T(),r=ne(),n=A({id:r.generateId("content")},e),[o,t]=D(n,["ref","id","style"]),{present:i}=Ie({show:r.shouldMount,element:()=>s()??null}),[a,u]=T(0),[d,g]=T(0);let y=r.isOpen()||i();return Ye(()=>{const x=requestAnimationFrame(()=>{y=!1});S(()=>{cancelAnimationFrame(x)})}),k(xe(i,()=>{if(!s())return;s().style.transitionDuration="0s",s().style.animationName="none";const x=s().getBoundingClientRect();u(x.height),g(x.width),y||(s().style.transitionDuration="",s().style.animationName="")})),k(xe(r.isOpen,x=>{!x&&s()&&(s().style.transitionDuration="",s().style.animationName="")},{defer:!0})),k(()=>S(r.registerContentId(o.id))),c(Q,{get when(){return i()},get children(){return c(te,P({as:"div",ref(x){var m=ee(l,o.ref);typeof m=="function"&&m(x)},get id(){return o.id},get style(){return fe({"--kb-collapsible-content-height":a()?`${a()}px`:void 0,"--kb-collapsible-content-width":d()?`${d()}px`:void 0},o.style)}},()=>r.dataset(),t))}})}function be(e){const s=`collapsible-${re()}`,l=A({id:s},e),[r,n]=D(l,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[o,t]=T(),i=Se({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:d=>{var g;return(g=r.onOpenChange)==null?void 0:g.call(r,d)}}),a=H(()=>({"data-expanded":i.isOpen()?"":void 0,"data-closed":i.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),u={dataset:a,isOpen:i.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||i.isOpen(),contentId:o,toggle:i.toggle,generateId:le(()=>n.id),registerContentId:ie(t)};return c(Fe.Provider,{value:u,get children(){return c(te,P({as:"div"},a,n))}})}function ve(e){const s=ne(),[l,r]=D(e,["onClick"]);return c(st,P({get"aria-expanded"(){return s.isOpen()},get"aria-controls"(){return we(()=>!!s.isOpen())()?s.contentId():void 0},get disabled(){return s.disabled()},onClick:o=>{_(o,l.onClick),s.toggle()}},()=>s.dataset(),r))}var Et=Object.assign(be,{Content:me,Trigger:ve}),V={};he(V,{Accordion:()=>Mt,Content:()=>Be,Header:()=>Le,Item:()=>Ne,Root:()=>He,Trigger:()=>We,useAccordionContext:()=>ye});var Re=Z();function Ke(){const e=J(Re);if(e===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function Be(e){const s=Ke(),l=s.generateId("content"),r=A({id:l},e),[n,o]=D(r,["id","style"]);return k(()=>S(s.registerContentId(n.id))),c(me,P({role:"region",get"aria-labelledby"(){return s.triggerId()},get style(){return fe({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},n.style)}},o))}function Le(e){const s=ne();return c(te,P({as:"h3"},()=>s.dataset(),e))}var Ue=Z();function ye(){const e=J(Ue);if(e===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function Ne(e){const s=ye(),l=`${s.generateId("item")}-${re()}`,r=A({id:l},e),[n,o]=D(r,["value","disabled"]),[t,i]=T(),[a,u]=T(),d=()=>s.listState().selectionManager(),g=()=>d().isSelected(n.value),v={value:()=>n.value,triggerId:t,contentId:a,generateId:le(()=>o.id),registerTriggerId:ie(i),registerContentId:ie(u)};return c(Re.Provider,{value:v,get children(){return c(be,P({get open(){return g()},get disabled(){return n.disabled}},o))}})}function He(e){let s;const l=`accordion-${re()}`,r=A({id:l,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[n,o]=D(r,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[t,i]=T([]),{DomCollectionProvider:a}=Tt({items:t,onItemsChange:i}),u=it({selectedKeys:()=>n.value,defaultSelectedKeys:()=>n.defaultValue,onSelectionChange:v=>{var y;return(y=n.onChange)==null?void 0:y.call(n,Array.from(v))},disallowEmptySelection:()=>!n.multiple&&!n.collapsible,selectionMode:()=>n.multiple?"multiple":"single",dataSource:t});u.selectionManager().setFocusedKey("item-1");const d=rt({selectionManager:()=>u.selectionManager(),collection:()=>u.collection(),disallowEmptySelection:()=>u.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>n.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>s),g={listState:()=>u,generateId:le(()=>n.id)};return c(a,{get children(){return c(Ue.Provider,{value:g,get children(){return c(te,P({as:"div",get id(){return n.id},ref(v){var y=ee(x=>s=x,n.ref);typeof y=="function"&&y(v)},get onKeyDown(){return E([n.onKeyDown,d.onKeyDown])},get onMouseDown(){return E([n.onMouseDown,d.onMouseDown])},get onFocusIn(){return E([n.onFocusIn])},get onFocusOut(){return E([n.onFocusOut,d.onFocusOut])}},o))}})}})}function We(e){let s;const l=ye(),r=Ke(),n=ne(),o=r.generateId("trigger"),t=A({id:o},e),[i,a]=D(t,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);kt({getItem:()=>({ref:()=>s,type:"item",key:r.value(),textValue:"",disabled:n.disabled()})});const u=lt({key:()=>r.value(),selectionManager:()=>l.listState().selectionManager(),disabled:()=>n.disabled(),shouldSelectOnPressUp:!0},()=>s),d=g=>{["Enter"," "].includes(g.key)&&g.preventDefault(),_(g,i.onKeyDown),_(g,u.onKeyDown)};return k(()=>S(r.registerTriggerId(a.id))),c(ve,P({ref(g){var v=ee(y=>s=y,i.ref);typeof v=="function"&&v(g)},get"data-key"(){return u.dataKey()},get onPointerDown(){return E([i.onPointerDown,u.onPointerDown])},get onPointerUp(){return E([i.onPointerUp,u.onPointerUp])},get onClick(){return E([i.onClick,u.onClick])},onKeyDown:d,get onMouseDown(){return E([i.onMouseDown,u.onMouseDown])},get onFocus(){return E([i.onFocus,u.onFocus])}},a))}var Mt=Object.assign(He,{Content:Be,Header:Le,Item:Ne,Trigger:We}),At=M('<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 Ft=e=>{const{t:s}=ut(),l=H(()=>at(e.instanceId,e.sessionId)??{cost:0,contextWindow:0,isSubscriptionModel:!1,inputTokens:0,outputTokens:0,reasoningTokens:0,actualUsageTokens:0,modelOutputLimit:0,contextAvailableTokens:null}),r=H(()=>l().inputTokens??0),n=H(()=>l().outputTokens??0),o=H(()=>{const i=l().isSubscriptionModel?0:l().cost;return i>0?i:0}),t=H(()=>`$${o().toFixed(2)}`);return(()=>{var i=At(),a=i.firstChild,u=a.firstChild,d=u.firstChild,g=d.nextSibling,v=u.nextSibling,y=v.firstChild,x=y.nextSibling,m=v.nextSibling,C=m.firstChild,p=C.nextSibling;return h(d,()=>s("contextUsagePanel.labels.input")),h(g,()=>Ce(r())),h(y,()=>s("contextUsagePanel.labels.output")),h(x,()=>Ce(n())),h(C,()=>s("contextUsagePanel.labels.cost")),h(p,t),ge(()=>Xe(i,`session-context-panel px-4 py-2 ${e.class??""}`)),i})()};var z=M('<div class="right-panel-empty right-panel-empty--left"><span class=text-xs>'),Rt=M('<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">'),Kt=M('<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)>'),Bt=M('<div class="flex flex-col gap-2">'),Lt=M("<span>"),Ut=M('<div class=status-process-card><div class=status-process-header><span class=status-process-title></span><div class=status-process-meta><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">'),Nt=M("<div class=status-tab-container>"),Ht=M("<span class=section-left><span class=section-label>");const Qt=e=>{const s=t=>e.expandedItems().includes(t),o=[{id:"session-changes",labelKey:"instanceShell.rightPanel.sections.sessionChanges",tooltipKey:"instanceShell.rightPanel.sections.sessionChanges.tooltip",render:()=>{const t=e.activeSessionId();if(!t||t==="info")return(()=>{var d=z(),g=d.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.noSessionSelected")),d})();const i=e.activeSessionDiffs();if(i===void 0)return(()=>{var d=z(),g=d.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.loading")),d})();if(!Array.isArray(i)||i.length===0)return(()=>{var d=z(),g=d.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.empty")),d})();const a=[...i].sort((d,g)=>String(d.file||"").localeCompare(String(g.file||""))),u=a.reduce((d,g)=>(d.additions+=typeof g.additions=="number"?g.additions:0,d.deletions+=typeof g.deletions=="number"?g.deletions:0,d),{additions:0,deletions:0});return(()=>{var d=Rt(),g=d.firstChild,v=g.firstChild,y=v.nextSibling,x=y.firstChild,m=x.nextSibling,C=g.nextSibling,p=C.firstChild;return h(v,()=>e.t("instanceShell.sessionChanges.filesChanged",{count:a.length})),h(x,()=>`+${u.additions}`),h(m,()=>`-${u.deletions}`),h(p,c(ce,{each:a,children:f=>(()=>{var w=Kt(),F=w.firstChild,R=F.firstChild,W=R.nextSibling,L=W.firstChild,U=L.nextSibling;return w.$$click=()=>e.onOpenChangesTab(f.file),h(R,()=>f.file),h(L,()=>`+${f.additions}`),h(U,()=>`-${f.deletions}`),ge(I=>{var oe=e.t("instanceShell.sessionChanges.actions.show"),X=f.file;return oe!==I.e&&B(w,"title",I.e=oe),X!==I.t&&B(R,"title",I.t=X),I},{e:void 0,t:void 0}),w})()})),d})()}},{id:"plan",labelKey:"instanceShell.rightPanel.sections.plan",tooltipKey:"instanceShell.rightPanel.sections.plan.tooltip",render:()=>{const t=e.activeSessionId();if(!t||t==="info")return(()=>{var a=z(),u=a.firstChild;return h(u,()=>e.t("instanceShell.plan.noSessionSelected")),a})();const i=e.latestTodoState();return i?c(gt,{state:i,get emptyLabel(){return e.t("instanceShell.plan.empty")},showStatusLabel:!1}):(()=>{var a=z(),u=a.firstChild;return h(u,()=>e.t("instanceShell.plan.empty")),a})()}},{id:"background-processes",labelKey:"instanceShell.rightPanel.sections.backgroundProcesses",tooltipKey:"instanceShell.rightPanel.sections.backgroundProcesses.tooltip",render:()=>{const t=e.backgroundProcessList();return t.length===0?(()=>{var i=z(),a=i.firstChild;return h(a,()=>e.t("instanceShell.backgroundProcesses.empty")),i})():(()=>{var i=Bt();return h(i,c(ce,{each:t,children:a=>(()=>{var u=Ut(),d=u.firstChild,g=d.firstChild,v=g.nextSibling,y=v.firstChild,x=d.nextSibling,m=x.firstChild,C=m.nextSibling,p=C.nextSibling;return h(g,()=>a.title),h(y,()=>e.t("instanceShell.backgroundProcesses.status",{status:a.status})),h(v,c(Q,{get when(){return typeof a.outputSizeBytes=="number"},get children(){var f=Lt();return h(f,()=>e.t("instanceShell.backgroundProcesses.output",{sizeKb:Math.round((a.outputSizeBytes??0)/1024)})),f}}),null),m.$$click=()=>e.onOpenBackgroundOutput(a),h(m,c(mt,{class:"h-4 w-4"})),C.$$click=()=>e.onStopBackgroundProcess(a.id),h(C,c(vt,{class:"h-4 w-4"})),p.$$click=()=>e.onTerminateBackgroundProcess(a.id),h(p,c(dt,{class:"h-4 w-4"})),ge(f=>{var w=e.t("instanceShell.backgroundProcesses.actions.output"),F=e.t("instanceShell.backgroundProcesses.actions.output"),R=a.status!=="running",W=e.t("instanceShell.backgroundProcesses.actions.stop"),L=e.t("instanceShell.backgroundProcesses.actions.stop"),U=e.t("instanceShell.backgroundProcesses.actions.terminate"),I=e.t("instanceShell.backgroundProcesses.actions.terminate");return w!==f.e&&B(m,"aria-label",f.e=w),F!==f.t&&B(m,"title",f.t=F),R!==f.a&&(C.disabled=f.a=R),W!==f.o&&B(C,"aria-label",f.o=W),L!==f.i&&B(C,"title",f.i=L),U!==f.n&&B(p,"aria-label",f.n=U),I!==f.s&&B(p,"title",f.s=I),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),u})()})),i})()}},{id:"mcp",labelKey:"instanceShell.rightPanel.sections.mcp",tooltipKey:"instanceShell.rightPanel.sections.mcp.tooltip",render:()=>c(ue,{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:()=>c(ue,{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:()=>c(ue,{get initialInstance(){return e.instance},sections:["plugins"],showSectionHeadings:!1,class:"space-y-2"})}];return(()=>{var t=Nt();return h(t,c(Q,{get when(){return e.activeSession()},children:i=>c(Ft,{get instanceId(){return e.instanceId},get sessionId(){return i().id},class:"status-tab-context-panel"})}),null),h(t,c(V.Root,{class:"right-panel-accordion",collapsible:!0,multiple:!0,get value(){return e.expandedItems()},get onChange(){return e.onExpandedItemsChange},get children(){return c(ce,{each:o,children:i=>c(V.Item,{get value(){return i.id},class:"right-panel-accordion-item",get children(){return[c(V.Header,{get children(){return c(V.Trigger,{class:"right-panel-accordion-trigger",get children(){return[(()=>{var a=Ht(),u=a.firstChild;return h(a,c(Y,{openDelay:200,gutter:4,placement:"top",get children(){return[c(Y.Trigger,{class:"section-info-trigger",get"aria-label"(){return e.t(i.tooltipKey)},onClick:d=>d.stopPropagation(),get children(){return c(ft,{class:"section-info-icon"})}}),c(Y.Portal,{get children(){return c(Y.Content,{class:"section-info-tooltip",get children(){return e.t(i.tooltipKey)}})}})]}}),u),h(u,()=>e.t(i.labelKey)),a})(),c(ct,{get class(){return`right-panel-accordion-chevron ${s(i.id)?"right-panel-accordion-chevron-expanded":""}`}})]}})}}),c(V.Content,{class:"right-panel-accordion-content",get children(){return i.render()}})]}})})}}),null),t})()};Ge(["click"]);export{Qt as default};
1
+ import{m as we,P as Ve,t as M,i as h,a as Xe,d as B,f as Ge}from"./monaco-viewer-DK-6pkvP.js";import{n as c,m as P,b as k,o as S,k as Z,l as J,q as re,s as D,d as T,c as H,S as Q,t as Ye,w as xe,a as ge,F as ce}from"./git-diff-vendor-CAv-4upN.js";import{I as pe,N as Qe,O as A,P as se,Q as Ze,T as Je,U as Pe,V as Se,W as Ie,X as et,Y as de,Z as ie,_ as le,$ as Te,a0 as ee,a1 as te,a2 as tt,a3 as fe,a4 as nt,a5 as ot,a6 as _,a7 as he,a8 as st,a9 as it,aa as rt,ab as E,ac as lt,ad as at,ae as Ce,af as ct,ag as ue,ah as dt}from"./main-JkDQRHSo.js";import{u as ut}from"./index-DNAppyAC.js";import{T as gt}from"./todo-BxfNuKUB.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const pt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ft=e=>c(pe,P(e,{name:"Info",iconNode:pt})),ht=[["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"}]],mt=e=>c(pe,P(e,{name:"TerminalSquare",iconNode:ht})),bt=[["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"}]],vt=e=>c(pe,P(e,{name:"XOctagon",iconNode:bt}));var ke=Z();function yt(){return J(ke)}function xt(){const e=yt();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function $e(e,s){return!!(s.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Ct(e,s){var n;const l=s.ref();if(!l)return-1;let r=e.length;if(!r)return-1;for(;r--;){const o=(n=e[r])==null?void 0:n.ref();if(o&&$e(o,l))return r+1}return 0}function wt(e){const s=e.map((r,n)=>[n,r]);let l=!1;return s.sort(([r,n],[o,t])=>{const i=n.ref(),a=t.ref();return i===a||!i||!a?0:$e(i,a)?(r>o&&(l=!0),-1):(r<o&&(l=!0),1)}),l?s.map(([r,n])=>n):e}function De(e,s){const l=wt(e);e!==l&&s(l)}function Pt(e){var n,o;const s=e[0],l=(n=e[e.length-1])==null?void 0:n.ref();let r=(o=s==null?void 0:s.ref())==null?void 0:o.parentElement;for(;r;){if(l&&r.contains(l))return r;r=r.parentElement}return se(r).body}function St(e,s){k(()=>{const l=setTimeout(()=>{De(e(),s)});S(()=>clearTimeout(l))})}function It(e,s){if(typeof IntersectionObserver!="function"){St(e,s);return}let l=[];k(()=>{const r=()=>{const t=!!l.length;l=e(),t&&De(e(),s)},n=Pt(e()),o=new IntersectionObserver(r,{root:n});for(const t of e()){const i=t.ref();i&&o.observe(i)}S(()=>o.disconnect())})}function Tt(e={}){const[s,l]=Qe({value:()=>Je(e.items),onChange:o=>{var t;return(t=e.onItemsChange)==null?void 0:t.call(e,o)}});It(s,l);const r=o=>(l(t=>{const i=Ct(t,o);return Ze(t,o,i)}),()=>{l(t=>{const i=t.filter(a=>a.ref()!==o.ref());return t.length===i.length?t:i})});return{DomCollectionProvider:o=>c(ke.Provider,{value:{registerItem:r},get children(){return o.children}})}}function kt(e){const s=xt(),l=A({shouldRegisterItem:!0},e);k(()=>{if(!l.shouldRegisterItem)return;const r=s.registerItem(l.getItem());S(r)})}var $t={};he($t,{Arrow:()=>Pe,Content:()=>_e,Portal:()=>Ee,Root:()=>Me,Tooltip:()=>Y,Trigger:()=>Ae,useTooltipContext:()=>ae});var Oe=Z();function ae(){const e=J(Oe);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function _e(e){const s=ae(),l=A({id:s.generateId("content")},e),[r,n]=D(l,["ref","style"]);return k(()=>S(s.registerContentId(n.id))),c(Q,{get when(){return s.contentPresent()},get children(){return c(Te.Positioner,{get children(){return c(tt,P({ref(o){var t=ee(i=>{s.setContentRef(i)},r.ref);typeof t=="function"&&t(o)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return fe({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:o=>o.preventDefault(),onDismiss:()=>s.hideTooltip(!0)},()=>s.dataset(),n))}})}})}function Ee(e){const s=ae();return c(Q,{get when(){return s.contentPresent()},get children(){return c(Ve,e)}})}function Dt(e,s,l){const r=e.split("-")[0],n=s.getBoundingClientRect(),o=l.getBoundingClientRect(),t=[],i=n.left+n.width/2,a=n.top+n.height/2;switch(r){case"top":t.push([n.left,a]),t.push([o.left,o.bottom]),t.push([o.left,o.top]),t.push([o.right,o.top]),t.push([o.right,o.bottom]),t.push([n.right,a]);break;case"right":t.push([i,n.top]),t.push([o.left,o.top]),t.push([o.right,o.top]),t.push([o.right,o.bottom]),t.push([o.left,o.bottom]),t.push([i,n.bottom]);break;case"bottom":t.push([n.left,a]),t.push([o.left,o.top]),t.push([o.left,o.bottom]),t.push([o.right,o.bottom]),t.push([o.right,o.top]),t.push([n.right,a]);break;case"left":t.push([i,n.top]),t.push([o.right,o.top]),t.push([o.left,o.top]),t.push([o.left,o.bottom]),t.push([o.right,o.bottom]),t.push([i,n.bottom]);break}return t}var N={},Ot=0,j=!1,O,G,q;function Me(e){const s=`tooltip-${re()}`,l=`${++Ot}`,r=A({id:s,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[n,o]=D(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let t;const[i,a]=T(),[u,d]=T(),[g,v]=T(),[y,x]=T(o.placement),m=Se({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:b=>{var $;return($=n.onOpenChange)==null?void 0:$.call(n,b)}}),{present:C}=Ie({show:()=>n.forceMount||m.isOpen(),element:()=>g()??null}),p=()=>{N[l]=w},f=()=>{for(const b in N)b!==l&&(N[b](!0),delete N[b])},w=(b=!1)=>{b||n.closeDelay&&n.closeDelay<=0?(window.clearTimeout(t),t=void 0,m.close()):t||(t=window.setTimeout(()=>{t=void 0,m.close()},n.closeDelay)),window.clearTimeout(O),O=void 0,n.skipDelayDuration&&n.skipDelayDuration>=0&&(q=window.setTimeout(()=>{window.clearTimeout(q),q=void 0},n.skipDelayDuration)),j&&(window.clearTimeout(G),G=window.setTimeout(()=>{delete N[l],G=void 0,j=!1},n.closeDelay))},F=()=>{clearTimeout(t),t=void 0,f(),p(),j=!0,m.open(),window.clearTimeout(O),O=void 0,window.clearTimeout(G),G=void 0,window.clearTimeout(q),q=void 0},R=()=>{f(),p(),!m.isOpen()&&!O&&!j?O=window.setTimeout(()=>{O=void 0,j=!0,F()},n.openDelay):m.isOpen()||F()},W=(b=!1)=>{!b&&n.openDelay&&n.openDelay>0&&!t&&!q?R():F()},L=()=>{window.clearTimeout(O),O=void 0,j=!1},U=()=>{window.clearTimeout(t),t=void 0},I=b=>de(u(),b)||de(g(),b),oe=b=>{const $=u(),K=g();if(!(!$||!K))return Dt(b,$,K)},X=b=>{const $=b.target;if(I($)){U();return}if(!n.ignoreSafeArea){const K=oe(y());if(K&&nt(ot(b),K)){U();return}}t||w()};k(()=>{if(!m.isOpen())return;const b=se();b.addEventListener("pointermove",X,!0),S(()=>{b.removeEventListener("pointermove",X,!0)})}),k(()=>{const b=u();if(!b||!m.isOpen())return;const $=qe=>{const ze=qe.target;de(ze,b)&&w(!0)},K=et();K.addEventListener("scroll",$,{capture:!0}),S(()=>{K.removeEventListener("scroll",$,{capture:!0})})}),S(()=>{clearTimeout(t),N[l]&&delete N[l]});const je={dataset:H(()=>({"data-expanded":m.isOpen()?"":void 0,"data-closed":m.isOpen()?void 0:""})),isOpen:m.isOpen,isDisabled:()=>n.disabled??!1,triggerOnFocusOnly:()=>n.triggerOnFocusOnly??!1,contentId:i,contentPresent:C,openTooltip:W,hideTooltip:w,cancelOpening:L,generateId:le(()=>r.id),registerContentId:ie(a),isTargetOnTooltip:I,setTriggerRef:d,setContentRef:v};return c(Oe.Provider,{value:je,get children(){return c(Te,P({anchorRef:u,contentRef:g,onCurrentPlacementChange:x},o))}})}function Ae(e){let s;const l=ae(),[r,n]=D(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let o=!1,t=!1,i=!1;const a=()=>{o=!1},u=()=>{!l.isOpen()&&(t||i)&&l.openTooltip(i)},d=p=>{l.isOpen()&&!t&&!i&&l.hideTooltip(p)},g=p=>{_(p,r.onPointerEnter),!(p.pointerType==="touch"||l.triggerOnFocusOnly()||l.isDisabled()||p.defaultPrevented)&&(t=!0,u())},v=p=>{_(p,r.onPointerLeave),p.pointerType!=="touch"&&(t=!1,i=!1,l.isOpen()?d():l.cancelOpening())},y=p=>{_(p,r.onPointerDown),o=!0,se(s).addEventListener("pointerup",a,{once:!0})},x=p=>{_(p,r.onClick),t=!1,i=!1,d(!0)},m=p=>{_(p,r.onFocus),!(l.isDisabled()||p.defaultPrevented||o)&&(i=!0,u())},C=p=>{_(p,r.onBlur);const f=p.relatedTarget;l.isTargetOnTooltip(f)||(t=!1,i=!1,d(!0))};return S(()=>{se(s).removeEventListener("pointerup",a)}),c(te,P({as:"button",ref(p){var f=ee(w=>{l.setTriggerRef(w),s=w},r.ref);typeof f=="function"&&f(p)},get"aria-describedby"(){return we(()=>!!l.isOpen())()?l.contentId():void 0},onPointerEnter:g,onPointerLeave:v,onPointerDown:y,onClick:x,onFocus:m,onBlur:C},()=>l.dataset(),n))}var Y=Object.assign(Me,{Arrow:Pe,Content:_e,Portal:Ee,Trigger:Ae}),_t={};he(_t,{Collapsible:()=>Et,Content:()=>me,Root:()=>be,Trigger:()=>ve,useCollapsibleContext:()=>ne});var Fe=Z();function ne(){const e=J(Fe);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function me(e){const[s,l]=T(),r=ne(),n=A({id:r.generateId("content")},e),[o,t]=D(n,["ref","id","style"]),{present:i}=Ie({show:r.shouldMount,element:()=>s()??null}),[a,u]=T(0),[d,g]=T(0);let y=r.isOpen()||i();return Ye(()=>{const x=requestAnimationFrame(()=>{y=!1});S(()=>{cancelAnimationFrame(x)})}),k(xe(i,()=>{if(!s())return;s().style.transitionDuration="0s",s().style.animationName="none";const x=s().getBoundingClientRect();u(x.height),g(x.width),y||(s().style.transitionDuration="",s().style.animationName="")})),k(xe(r.isOpen,x=>{!x&&s()&&(s().style.transitionDuration="",s().style.animationName="")},{defer:!0})),k(()=>S(r.registerContentId(o.id))),c(Q,{get when(){return i()},get children(){return c(te,P({as:"div",ref(x){var m=ee(l,o.ref);typeof m=="function"&&m(x)},get id(){return o.id},get style(){return fe({"--kb-collapsible-content-height":a()?`${a()}px`:void 0,"--kb-collapsible-content-width":d()?`${d()}px`:void 0},o.style)}},()=>r.dataset(),t))}})}function be(e){const s=`collapsible-${re()}`,l=A({id:s},e),[r,n]=D(l,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[o,t]=T(),i=Se({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:d=>{var g;return(g=r.onOpenChange)==null?void 0:g.call(r,d)}}),a=H(()=>({"data-expanded":i.isOpen()?"":void 0,"data-closed":i.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),u={dataset:a,isOpen:i.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||i.isOpen(),contentId:o,toggle:i.toggle,generateId:le(()=>n.id),registerContentId:ie(t)};return c(Fe.Provider,{value:u,get children(){return c(te,P({as:"div"},a,n))}})}function ve(e){const s=ne(),[l,r]=D(e,["onClick"]);return c(st,P({get"aria-expanded"(){return s.isOpen()},get"aria-controls"(){return we(()=>!!s.isOpen())()?s.contentId():void 0},get disabled(){return s.disabled()},onClick:o=>{_(o,l.onClick),s.toggle()}},()=>s.dataset(),r))}var Et=Object.assign(be,{Content:me,Trigger:ve}),V={};he(V,{Accordion:()=>Mt,Content:()=>Be,Header:()=>Le,Item:()=>Ne,Root:()=>He,Trigger:()=>We,useAccordionContext:()=>ye});var Re=Z();function Ke(){const e=J(Re);if(e===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function Be(e){const s=Ke(),l=s.generateId("content"),r=A({id:l},e),[n,o]=D(r,["id","style"]);return k(()=>S(s.registerContentId(n.id))),c(me,P({role:"region",get"aria-labelledby"(){return s.triggerId()},get style(){return fe({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},n.style)}},o))}function Le(e){const s=ne();return c(te,P({as:"h3"},()=>s.dataset(),e))}var Ue=Z();function ye(){const e=J(Ue);if(e===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function Ne(e){const s=ye(),l=`${s.generateId("item")}-${re()}`,r=A({id:l},e),[n,o]=D(r,["value","disabled"]),[t,i]=T(),[a,u]=T(),d=()=>s.listState().selectionManager(),g=()=>d().isSelected(n.value),v={value:()=>n.value,triggerId:t,contentId:a,generateId:le(()=>o.id),registerTriggerId:ie(i),registerContentId:ie(u)};return c(Re.Provider,{value:v,get children(){return c(be,P({get open(){return g()},get disabled(){return n.disabled}},o))}})}function He(e){let s;const l=`accordion-${re()}`,r=A({id:l,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[n,o]=D(r,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[t,i]=T([]),{DomCollectionProvider:a}=Tt({items:t,onItemsChange:i}),u=it({selectedKeys:()=>n.value,defaultSelectedKeys:()=>n.defaultValue,onSelectionChange:v=>{var y;return(y=n.onChange)==null?void 0:y.call(n,Array.from(v))},disallowEmptySelection:()=>!n.multiple&&!n.collapsible,selectionMode:()=>n.multiple?"multiple":"single",dataSource:t});u.selectionManager().setFocusedKey("item-1");const d=rt({selectionManager:()=>u.selectionManager(),collection:()=>u.collection(),disallowEmptySelection:()=>u.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>n.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>s),g={listState:()=>u,generateId:le(()=>n.id)};return c(a,{get children(){return c(Ue.Provider,{value:g,get children(){return c(te,P({as:"div",get id(){return n.id},ref(v){var y=ee(x=>s=x,n.ref);typeof y=="function"&&y(v)},get onKeyDown(){return E([n.onKeyDown,d.onKeyDown])},get onMouseDown(){return E([n.onMouseDown,d.onMouseDown])},get onFocusIn(){return E([n.onFocusIn])},get onFocusOut(){return E([n.onFocusOut,d.onFocusOut])}},o))}})}})}function We(e){let s;const l=ye(),r=Ke(),n=ne(),o=r.generateId("trigger"),t=A({id:o},e),[i,a]=D(t,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);kt({getItem:()=>({ref:()=>s,type:"item",key:r.value(),textValue:"",disabled:n.disabled()})});const u=lt({key:()=>r.value(),selectionManager:()=>l.listState().selectionManager(),disabled:()=>n.disabled(),shouldSelectOnPressUp:!0},()=>s),d=g=>{["Enter"," "].includes(g.key)&&g.preventDefault(),_(g,i.onKeyDown),_(g,u.onKeyDown)};return k(()=>S(r.registerTriggerId(a.id))),c(ve,P({ref(g){var v=ee(y=>s=y,i.ref);typeof v=="function"&&v(g)},get"data-key"(){return u.dataKey()},get onPointerDown(){return E([i.onPointerDown,u.onPointerDown])},get onPointerUp(){return E([i.onPointerUp,u.onPointerUp])},get onClick(){return E([i.onClick,u.onClick])},onKeyDown:d,get onMouseDown(){return E([i.onMouseDown,u.onMouseDown])},get onFocus(){return E([i.onFocus,u.onFocus])}},a))}var Mt=Object.assign(He,{Content:Be,Header:Le,Item:Ne,Trigger:We}),At=M('<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 Ft=e=>{const{t:s}=ut(),l=H(()=>at(e.instanceId,e.sessionId)??{cost:0,contextWindow:0,isSubscriptionModel:!1,inputTokens:0,outputTokens:0,reasoningTokens:0,actualUsageTokens:0,modelOutputLimit:0,contextAvailableTokens:null}),r=H(()=>l().inputTokens??0),n=H(()=>l().outputTokens??0),o=H(()=>{const i=l().isSubscriptionModel?0:l().cost;return i>0?i:0}),t=H(()=>`$${o().toFixed(2)}`);return(()=>{var i=At(),a=i.firstChild,u=a.firstChild,d=u.firstChild,g=d.nextSibling,v=u.nextSibling,y=v.firstChild,x=y.nextSibling,m=v.nextSibling,C=m.firstChild,p=C.nextSibling;return h(d,()=>s("contextUsagePanel.labels.input")),h(g,()=>Ce(r())),h(y,()=>s("contextUsagePanel.labels.output")),h(x,()=>Ce(n())),h(C,()=>s("contextUsagePanel.labels.cost")),h(p,t),ge(()=>Xe(i,`session-context-panel px-4 py-2 ${e.class??""}`)),i})()};var z=M('<div class="right-panel-empty right-panel-empty--left"><span class=text-xs>'),Rt=M('<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">'),Kt=M('<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)>'),Bt=M('<div class="flex flex-col gap-2">'),Lt=M("<span>"),Ut=M('<div class=status-process-card><div class=status-process-header><span class=status-process-title></span><div class=status-process-meta><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">'),Nt=M("<div class=status-tab-container>"),Ht=M("<span class=section-left><span class=section-label>");const Qt=e=>{const s=t=>e.expandedItems().includes(t),o=[{id:"session-changes",labelKey:"instanceShell.rightPanel.sections.sessionChanges",tooltipKey:"instanceShell.rightPanel.sections.sessionChanges.tooltip",render:()=>{const t=e.activeSessionId();if(!t||t==="info")return(()=>{var d=z(),g=d.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.noSessionSelected")),d})();const i=e.activeSessionDiffs();if(i===void 0)return(()=>{var d=z(),g=d.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.loading")),d})();if(!Array.isArray(i)||i.length===0)return(()=>{var d=z(),g=d.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.empty")),d})();const a=[...i].sort((d,g)=>String(d.file||"").localeCompare(String(g.file||""))),u=a.reduce((d,g)=>(d.additions+=typeof g.additions=="number"?g.additions:0,d.deletions+=typeof g.deletions=="number"?g.deletions:0,d),{additions:0,deletions:0});return(()=>{var d=Rt(),g=d.firstChild,v=g.firstChild,y=v.nextSibling,x=y.firstChild,m=x.nextSibling,C=g.nextSibling,p=C.firstChild;return h(v,()=>e.t("instanceShell.sessionChanges.filesChanged",{count:a.length})),h(x,()=>`+${u.additions}`),h(m,()=>`-${u.deletions}`),h(p,c(ce,{each:a,children:f=>(()=>{var w=Kt(),F=w.firstChild,R=F.firstChild,W=R.nextSibling,L=W.firstChild,U=L.nextSibling;return w.$$click=()=>e.onOpenChangesTab(f.file),h(R,()=>f.file),h(L,()=>`+${f.additions}`),h(U,()=>`-${f.deletions}`),ge(I=>{var oe=e.t("instanceShell.sessionChanges.actions.show"),X=f.file;return oe!==I.e&&B(w,"title",I.e=oe),X!==I.t&&B(R,"title",I.t=X),I},{e:void 0,t:void 0}),w})()})),d})()}},{id:"plan",labelKey:"instanceShell.rightPanel.sections.plan",tooltipKey:"instanceShell.rightPanel.sections.plan.tooltip",render:()=>{const t=e.activeSessionId();if(!t||t==="info")return(()=>{var a=z(),u=a.firstChild;return h(u,()=>e.t("instanceShell.plan.noSessionSelected")),a})();const i=e.latestTodoState();return i?c(gt,{state:i,get emptyLabel(){return e.t("instanceShell.plan.empty")},showStatusLabel:!1}):(()=>{var a=z(),u=a.firstChild;return h(u,()=>e.t("instanceShell.plan.empty")),a})()}},{id:"background-processes",labelKey:"instanceShell.rightPanel.sections.backgroundProcesses",tooltipKey:"instanceShell.rightPanel.sections.backgroundProcesses.tooltip",render:()=>{const t=e.backgroundProcessList();return t.length===0?(()=>{var i=z(),a=i.firstChild;return h(a,()=>e.t("instanceShell.backgroundProcesses.empty")),i})():(()=>{var i=Bt();return h(i,c(ce,{each:t,children:a=>(()=>{var u=Ut(),d=u.firstChild,g=d.firstChild,v=g.nextSibling,y=v.firstChild,x=d.nextSibling,m=x.firstChild,C=m.nextSibling,p=C.nextSibling;return h(g,()=>a.title),h(y,()=>e.t("instanceShell.backgroundProcesses.status",{status:a.status})),h(v,c(Q,{get when(){return typeof a.outputSizeBytes=="number"},get children(){var f=Lt();return h(f,()=>e.t("instanceShell.backgroundProcesses.output",{sizeKb:Math.round((a.outputSizeBytes??0)/1024)})),f}}),null),m.$$click=()=>e.onOpenBackgroundOutput(a),h(m,c(mt,{class:"h-4 w-4"})),C.$$click=()=>e.onStopBackgroundProcess(a.id),h(C,c(vt,{class:"h-4 w-4"})),p.$$click=()=>e.onTerminateBackgroundProcess(a.id),h(p,c(dt,{class:"h-4 w-4"})),ge(f=>{var w=e.t("instanceShell.backgroundProcesses.actions.output"),F=e.t("instanceShell.backgroundProcesses.actions.output"),R=a.status!=="running",W=e.t("instanceShell.backgroundProcesses.actions.stop"),L=e.t("instanceShell.backgroundProcesses.actions.stop"),U=e.t("instanceShell.backgroundProcesses.actions.terminate"),I=e.t("instanceShell.backgroundProcesses.actions.terminate");return w!==f.e&&B(m,"aria-label",f.e=w),F!==f.t&&B(m,"title",f.t=F),R!==f.a&&(C.disabled=f.a=R),W!==f.o&&B(C,"aria-label",f.o=W),L!==f.i&&B(C,"title",f.i=L),U!==f.n&&B(p,"aria-label",f.n=U),I!==f.s&&B(p,"title",f.s=I),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),u})()})),i})()}},{id:"mcp",labelKey:"instanceShell.rightPanel.sections.mcp",tooltipKey:"instanceShell.rightPanel.sections.mcp.tooltip",render:()=>c(ue,{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:()=>c(ue,{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:()=>c(ue,{get initialInstance(){return e.instance},sections:["plugins"],showSectionHeadings:!1,class:"space-y-2"})}];return(()=>{var t=Nt();return h(t,c(Q,{get when(){return e.activeSession()},children:i=>c(Ft,{get instanceId(){return e.instanceId},get sessionId(){return i().id},class:"status-tab-context-panel"})}),null),h(t,c(V.Root,{class:"right-panel-accordion",collapsible:!0,multiple:!0,get value(){return e.expandedItems()},get onChange(){return e.onExpandedItemsChange},get children(){return c(ce,{each:o,children:i=>c(V.Item,{get value(){return i.id},class:"right-panel-accordion-item",get children(){return[c(V.Header,{get children(){return c(V.Trigger,{class:"right-panel-accordion-trigger",get children(){return[(()=>{var a=Ht(),u=a.firstChild;return h(a,c(Y,{openDelay:200,gutter:4,placement:"top",get children(){return[c(Y.Trigger,{class:"section-info-trigger",get"aria-label"(){return e.t(i.tooltipKey)},onClick:d=>d.stopPropagation(),get children(){return c(ft,{class:"section-info-icon"})}}),c(Y.Portal,{get children(){return c(Y.Content,{class:"section-info-tooltip",get children(){return e.t(i.tooltipKey)}})}})]}}),u),h(u,()=>e.t(i.labelKey)),a})(),c(ct,{get class(){return`right-panel-accordion-chevron ${s(i.id)?"right-panel-accordion-chevron-expanded":""}`}})]}})}}),c(V.Content,{class:"right-panel-accordion-content",get children(){return i.render()}})]}})})}}),null),t})()};Ge(["click"]);export{Qt as default};