@neuralnomads/codenomad-dev 0.16.0-dev-20260517-00bfe52f → 0.16.0-dev-20260522-b142c2a6

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 (38) hide show
  1. package/dist/launcher.js +12 -1
  2. package/dist/server/http-server.js +2 -0
  3. package/dist/server/routes/config-files.js +92 -0
  4. package/dist/server/routes/config-files.test.js +115 -0
  5. package/package.json +1 -1
  6. package/public/assets/{ChangesTab-h7N4cxR7.js → ChangesTab-CrK69V3_.js} +2 -2
  7. package/public/assets/{DiffToolbar-h4_ij7Yi.js → DiffToolbar-DKoxgNC4.js} +1 -1
  8. package/public/assets/FilesTab-DGtxOXkK.js +2 -0
  9. package/public/assets/{GitChangesTab-BuFOMn0g.js → GitChangesTab-D6MXiOl3.js} +2 -2
  10. package/public/assets/{SplitFilePanel-CO765UL-.js → SplitFilePanel-DfP4aXjN.js} +1 -1
  11. package/public/assets/StatusTab-BNSvPopW.js +1 -0
  12. package/public/assets/{align-justify-BZaelTNi.js → align-justify-DoUV5Vb3.js} +1 -1
  13. package/public/assets/{bundle-full-DWpCCZ0v.js → bundle-full-DwiY6lVA.js} +1 -1
  14. package/public/assets/{diff-viewer-Dh0sYi_l.js → diff-viewer-Cmd1kDU3.js} +1 -1
  15. package/public/assets/{index-No6qqRt1.js → index-B8slhXW-.js} +1 -1
  16. package/public/assets/{index-DDMCnuGe.js → index-BC7ob7X2.js} +1 -1
  17. package/public/assets/{index-BuQbzboH.js → index-BI-cs6_k.js} +1 -1
  18. package/public/assets/index-BazkonFs.css +1 -0
  19. package/public/assets/{index-zb6R8lkB.js → index-CVj5h7rG.js} +1 -1
  20. package/public/assets/{index-CXCTlmS7.js → index-Ct_e2ZAi.js} +2 -2
  21. package/public/assets/{index-JzIbSKO3.js → index-Dbjykj1M.js} +1 -1
  22. package/public/assets/{index-CiDcxYm_.js → index-G8ixFOHi.js} +1 -1
  23. package/public/assets/{index-CFlARfUN.js → index-ST_AY9xW.js} +1 -1
  24. package/public/assets/{index--LOOdxst.js → index-U7ahQHrh.js} +1 -1
  25. package/public/assets/{loading-DfOpdGmE.js → loading-BR-NqUxo.js} +1 -1
  26. package/public/assets/main-lqNquiby.js +63 -0
  27. package/public/assets/{markdown-DYqTDTpr.js → markdown-DSQUgoWV.js} +3 -3
  28. package/public/assets/{monaco-viewer-B3iAKbO0.js → monaco-viewer-DNB9hvLQ.js} +6 -6
  29. package/public/assets/{tool-call--Y05fupX.js → tool-call-Dmk3PIRx.js} +3 -3
  30. package/public/assets/{unified-picker-BtSq6eO9.js → unified-picker-r0JIoHEK.js} +1 -1
  31. package/public/assets/{wrap-text-DvzNO1HR.js → wrap-text-BzsWXR1k.js} +1 -1
  32. package/public/index.html +4 -4
  33. package/public/loading.html +4 -4
  34. package/public/sw.js +1 -1
  35. package/public/assets/FilesTab-BQTLjPSW.js +0 -2
  36. package/public/assets/StatusTab-DgvgVtyk.js +0 -1
  37. package/public/assets/index-CujuM9VX.css +0 -1
  38. package/public/assets/main-CuzUuQRM.js +0 -63
package/dist/launcher.js CHANGED
@@ -119,11 +119,19 @@ function buildLinuxCandidates() {
119
119
  "chromium",
120
120
  "chromium-browser",
121
121
  "brave-browser",
122
+ "brave-browser-stable",
123
+ "brave",
124
+ "/snap/bin/brave",
122
125
  "microsoft-edge",
123
126
  "microsoft-edge-stable",
124
127
  "vivaldi",
128
+ "vivaldi-stable",
129
+ "/snap/bin/vivaldi",
130
+ ];
131
+ return [
132
+ ...names.map((name) => ({ name, command: name, args: APP_ARGS })),
133
+ { name: "xdg-open", command: "xdg-open", args: (url) => [url] },
125
134
  ];
126
- return names.map((name) => ({ name, command: name, args: APP_ARGS }));
127
135
  }
128
136
  function buildMacManualExamples(url) {
129
137
  return [
@@ -144,6 +152,9 @@ function buildLinuxManualExamples(url) {
144
152
  `google-chrome --app="${url}" --new-window`,
145
153
  `chromium --app="${url}" --new-window`,
146
154
  `brave-browser --app="${url}" --new-window`,
155
+ `brave-browser-stable --app="${url}" --new-window`,
147
156
  `microsoft-edge --app="${url}" --new-window`,
157
+ `vivaldi-stable --app="${url}" --new-window`,
158
+ `xdg-open "${url}"`,
148
159
  ];
149
160
  }
@@ -12,6 +12,7 @@ import { resolveWorktreeDirectory } from "../workspaces/worktree-directory";
12
12
  import { registerWorkspaceRoutes } from "./routes/workspaces";
13
13
  import { registerSettingsRoutes } from "./routes/settings";
14
14
  import { registerFilesystemRoutes } from "./routes/filesystem";
15
+ import { registerConfigFileRoutes } from "./routes/config-files";
15
16
  import { registerMetaRoutes } from "./routes/meta";
16
17
  import { registerEventRoutes } from "./routes/events";
17
18
  import { registerStorageRoutes } from "./routes/storage";
@@ -194,6 +195,7 @@ export function createHttpServer(deps) {
194
195
  registerWorkspaceRoutes(app, { workspaceManager: deps.workspaceManager });
195
196
  registerSettingsRoutes(app, { settings: deps.settings, logger: apiLogger });
196
197
  registerFilesystemRoutes(app, { fileSystemBrowser: deps.fileSystemBrowser });
198
+ registerConfigFileRoutes(app);
197
199
  registerMetaRoutes(app, { serverMeta: deps.serverMeta });
198
200
  registerEventRoutes(app, {
199
201
  eventBus: deps.eventBus,
@@ -0,0 +1,92 @@
1
+ import fs from "fs/promises";
2
+ import os from "os";
3
+ import path from "path";
4
+ import { z } from "zod";
5
+ const ConfigFileContentBodySchema = z.object({
6
+ contents: z.string(),
7
+ });
8
+ function resolveOpenCodeGlobalConfigPaths() {
9
+ if (process.platform === "win32") {
10
+ const basePath = path.join(os.homedir(), ".config", "opencode");
11
+ return [
12
+ {
13
+ id: "opencode-global-config",
14
+ label: "OpenCode Global Config",
15
+ path: "%USERPROFILE%\\.config\\opencode\\opencode.json",
16
+ absolutePath: path.join(basePath, "opencode.json"),
17
+ language: "json",
18
+ },
19
+ {
20
+ id: "opencode-global-config-jsonc",
21
+ label: "OpenCode Global Config (JSONC)",
22
+ path: "%USERPROFILE%\\.config\\opencode\\opencode.jsonc",
23
+ absolutePath: path.join(basePath, "opencode.jsonc"),
24
+ language: "jsonc",
25
+ },
26
+ ];
27
+ }
28
+ return [
29
+ {
30
+ id: "opencode-global-config",
31
+ label: "OpenCode Global Config",
32
+ path: "~/.config/opencode/opencode.json",
33
+ absolutePath: path.join(os.homedir(), ".config", "opencode", "opencode.json"),
34
+ language: "json",
35
+ },
36
+ {
37
+ id: "opencode-global-config-jsonc",
38
+ label: "OpenCode Global Config (JSONC)",
39
+ path: "~/.config/opencode/opencode.jsonc",
40
+ absolutePath: path.join(os.homedir(), ".config", "opencode", "opencode.jsonc"),
41
+ language: "jsonc",
42
+ },
43
+ ];
44
+ }
45
+ function defaultConfigFileEntries() {
46
+ return resolveOpenCodeGlobalConfigPaths();
47
+ }
48
+ function listConfigFiles(files) {
49
+ return files.map(({ absolutePath: _absolutePath, ...file }) => file);
50
+ }
51
+ function getConfigFile(files, id) {
52
+ return files.find((file) => file.id === id) ?? null;
53
+ }
54
+ export function registerConfigFileRoutes(app, options = {}) {
55
+ const configFiles = options.files ?? defaultConfigFileEntries();
56
+ app.get("/api/config-files", async () => listConfigFiles(configFiles));
57
+ app.get("/api/config-files/:id/content", async (request, reply) => {
58
+ const file = getConfigFile(configFiles, request.params.id);
59
+ if (!file) {
60
+ reply.code(404);
61
+ return { error: "Config file not found" };
62
+ }
63
+ try {
64
+ const contents = await fs.readFile(file.absolutePath, "utf-8");
65
+ return { id: file.id, path: file.path, contents, exists: true };
66
+ }
67
+ catch (error) {
68
+ if (error.code === "ENOENT") {
69
+ return { id: file.id, path: file.path, contents: "", exists: false };
70
+ }
71
+ reply.code(400);
72
+ return { error: error instanceof Error ? error.message : "Failed to read config file" };
73
+ }
74
+ });
75
+ app.put("/api/config-files/:id/content", async (request, reply) => {
76
+ const file = getConfigFile(configFiles, request.params.id);
77
+ if (!file) {
78
+ reply.code(404);
79
+ return { error: "Config file not found" };
80
+ }
81
+ try {
82
+ const body = ConfigFileContentBodySchema.parse(request.body ?? {});
83
+ await fs.mkdir(path.dirname(file.absolutePath), { recursive: true });
84
+ await fs.writeFile(file.absolutePath, body.contents, "utf-8");
85
+ reply.code(204);
86
+ }
87
+ catch (error) {
88
+ reply.code(400);
89
+ return { error: error instanceof Error ? error.message : "Failed to save config file" };
90
+ }
91
+ });
92
+ }
@@ -0,0 +1,115 @@
1
+ import assert from "node:assert/strict";
2
+ import fs from "node:fs";
3
+ import os from "node:os";
4
+ import path from "node:path";
5
+ import { afterEach, describe, it } from "node:test";
6
+ import Fastify from "fastify";
7
+ import { registerConfigFileRoutes } from "./config-files";
8
+ const tempDirs = new Set();
9
+ afterEach(() => {
10
+ for (const dir of tempDirs) {
11
+ fs.rmSync(dir, { recursive: true, force: true });
12
+ }
13
+ tempDirs.clear();
14
+ });
15
+ describe("config file routes", () => {
16
+ it("lists only allowlisted config file descriptors", async () => {
17
+ const tempDir = createTempDir();
18
+ const app = createApp([
19
+ createConfigEntry(path.join(tempDir, "opencode", "opencode.json"), "~/.config/opencode/opencode.json"),
20
+ createConfigEntry(path.join(tempDir, "opencode", "opencode.jsonc"), "~/.config/opencode/opencode.jsonc", {
21
+ id: "test-config-jsonc",
22
+ label: "Test Config JSONC",
23
+ language: "jsonc",
24
+ }),
25
+ ]);
26
+ const response = await app.inject({ method: "GET", url: "/api/config-files" });
27
+ assert.equal(response.statusCode, 200);
28
+ assert.deepEqual(response.json(), [
29
+ {
30
+ id: "test-config",
31
+ label: "Test Config",
32
+ path: "~/.config/opencode/opencode.json",
33
+ language: "json",
34
+ },
35
+ {
36
+ id: "test-config-jsonc",
37
+ label: "Test Config JSONC",
38
+ path: "~/.config/opencode/opencode.jsonc",
39
+ language: "jsonc",
40
+ },
41
+ ]);
42
+ await app.close();
43
+ });
44
+ it("returns empty content for an allowlisted missing file", async () => {
45
+ const tempDir = createTempDir();
46
+ const app = createApp([createConfigEntry(path.join(tempDir, "missing", "config.json"), "display/config.json")]);
47
+ const response = await app.inject({ method: "GET", url: "/api/config-files/test-config/content" });
48
+ assert.equal(response.statusCode, 200);
49
+ assert.deepEqual(response.json(), {
50
+ id: "test-config",
51
+ path: "display/config.json",
52
+ contents: "",
53
+ exists: false,
54
+ });
55
+ await app.close();
56
+ });
57
+ it("creates parent directories when writing an allowlisted file", async () => {
58
+ const tempDir = createTempDir();
59
+ const targetPath = path.join(tempDir, "nested", "opencode.json");
60
+ const app = createApp([createConfigEntry(targetPath, "display/opencode.json")]);
61
+ const response = await app.inject({
62
+ method: "PUT",
63
+ url: "/api/config-files/test-config/content",
64
+ payload: { contents: '{"model":"test"}' },
65
+ });
66
+ assert.equal(response.statusCode, 204);
67
+ assert.equal(fs.readFileSync(targetPath, "utf-8"), '{"model":"test"}');
68
+ await app.close();
69
+ });
70
+ it("rejects unknown config file ids", async () => {
71
+ const tempDir = createTempDir();
72
+ const app = createApp([createConfigEntry(path.join(tempDir, "opencode.json"), "display/opencode.json")]);
73
+ const readResponse = await app.inject({ method: "GET", url: "/api/config-files/unknown/content" });
74
+ const writeResponse = await app.inject({
75
+ method: "PUT",
76
+ url: "/api/config-files/unknown/content",
77
+ payload: { contents: "{}" },
78
+ });
79
+ assert.equal(readResponse.statusCode, 404);
80
+ assert.equal(writeResponse.statusCode, 404);
81
+ await app.close();
82
+ });
83
+ it("returns a client error when writes fail", async () => {
84
+ const tempDir = createTempDir();
85
+ const blockedParent = path.join(tempDir, "not-a-directory");
86
+ fs.writeFileSync(blockedParent, "occupied");
87
+ const app = createApp([createConfigEntry(path.join(blockedParent, "opencode.json"), "display/opencode.json")]);
88
+ const response = await app.inject({
89
+ method: "PUT",
90
+ url: "/api/config-files/test-config/content",
91
+ payload: { contents: "{}" },
92
+ });
93
+ assert.equal(response.statusCode, 400);
94
+ await app.close();
95
+ });
96
+ });
97
+ function createTempDir() {
98
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "codenomad-config-files-test-"));
99
+ tempDirs.add(dir);
100
+ return dir;
101
+ }
102
+ function createConfigEntry(absolutePath, displayPath, overrides = {}) {
103
+ return {
104
+ id: overrides.id ?? "test-config",
105
+ label: overrides.label ?? "Test Config",
106
+ path: displayPath,
107
+ absolutePath,
108
+ language: overrides.language ?? "json",
109
+ };
110
+ }
111
+ function createApp(files) {
112
+ const app = Fastify({ logger: false });
113
+ registerConfigFileRoutes(app, { files });
114
+ return app;
115
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neuralnomads/codenomad-dev",
3
- "version": "0.16.0-dev-20260517-00bfe52f",
3
+ "version": "0.16.0-dev-20260522-b142c2a6",
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-B3iAKbO0.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
2
- import{_ as K}from"./index-CXCTlmS7.js";import{m as B,t as g,i as a,d as w,a as z,f as N}from"./monaco-viewer-B3iAKbO0.js";import{c as f,n as c,a as L,F,S as W,z as j,A as q}from"./git-diff-vendor-CSgooKT_.js";import{D as G}from"./DiffToolbar-h4_ij7Yi.js";import{S as H}from"./SplitFilePanel-CO765UL-.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-CuzUuQRM.js";import"./align-justify-BZaelTNi.js";import"./wrap-text-DvzNO1HR.js";var J=g('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),T=g("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Q=g('<div class="p-3 text-xs text-secondary">'),E=g("<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-"),U=g("<span class=files-tab-selected-path><span class=file-path-text>"),X=g('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Y=g("<div style=margin-left:auto>");const Z=q(()=>K(()=>import("./monaco-viewer-B3iAKbO0.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),ce=e=>{const M=f(()=>e.activeSessionId()),S=f(()=>!!(M()&&M()!=="info")),D=f(()=>S()?e.activeSessionDiffs():null),m=f(()=>{const n=D();return Array.isArray(n)?[...n].sort((i,l)=>String(i.file||"").localeCompare(String(l.file||""))):[]}),R=f(()=>m().reduce((n,i)=>(n.additions+=typeof i.additions=="number"?i.additions:0,n.deletions+=typeof i.deletions=="number"?i.deletions:0,n),{additions:0,deletions:0})),I=f(()=>{const n=m();return n.length===0?null:n.reduce((i,l)=>{const v=typeof(i==null?void 0:i.additions)=="number"?i.additions:0,y=typeof(i==null?void 0:i.deletions)=="number"?i.deletions:0,x=v+y,k=typeof(l==null?void 0:l.additions)=="number"?l.additions:0,t=typeof(l==null?void 0:l.deletions)=="number"?l.deletions:0,r=k+t;return r>x?l:r<x?i:String(l.file||"").localeCompare(String((i==null?void 0:i.file)||""))<0?l:i},n[0])}),P=f(()=>{const n=e.selectedFile(),i=m();if(n){const l=i.find(v=>v.file===n);if(l)return l}return I()}),O=f(()=>`${e.instanceId}:${S()?M():"no-session"}`),V=f(()=>{if(!S())return e.t("instanceShell.sessionChanges.noSessionSelected");const n=D();return n===void 0?e.t("instanceShell.sessionChanges.loading"):!Array.isArray(n)||n.length===0?e.t("instanceShell.sessionChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty")}),A=f(()=>{const n=P();return n!=null&&n.file?String(n.file):e.t("instanceShell.rightPanel.tabs.changes")});return B(()=>{const n=m(),i=R(),l=P(),v=()=>(()=>{var t=J(),r=t.firstChild;return a(r,c(W,{get when(){return l&&S()&&n.length>0?l:null},get fallback(){return(()=>{var d=T(),s=d.firstChild;return a(s,V),d})()},children:d=>c(j,{get fallback(){return(()=>{var s=T(),u=s.firstChild;return a(u,()=>e.t("instanceInfo.loading")),s})()},get children(){return c(Z,{get scopeKey(){return O()},get path(){return String(d().file||"")},get patch(){return String(d().patch||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})),t})(),y=()=>(()=>{var t=Q();return a(t,V),t})();return c(H,{get header(){return[(()=>{var t=U(),r=t.firstChild;return a(r,A),L(()=>w(t,"title",A())),t})(),(()=>{var t=X(),r=t.firstChild,d=r.firstChild;d.firstChild;var s=r.nextSibling,u=s.firstChild;return u.firstChild,a(d,()=>i.additions,null),a(u,()=>i.deletions,null),t})(),(()=>{var t=Y();return a(t,c(G,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})),t})()]},list:{panel:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,e.isPhoneLayout())},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(s,"title",o.t=$),o},{e:void 0,t:void 0}),r})()})}}),overlay:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,!0)},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file,p=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(r,"title",o.t=$),p!==o.a&&w(s,"title",o.a=p),o},{e:void 0,t:void 0,a:void 0}),r})()})}})},get viewer(){return v()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.changes")}})})};N(["click"]);export{ce as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-DNB9hvLQ.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
2
+ import{_ as K}from"./index-Ct_e2ZAi.js";import{m as B,t as g,i as a,d as w,a as z,f as N}from"./monaco-viewer-DNB9hvLQ.js";import{c as f,n as c,a as L,F,S as W,z as j,A as q}from"./git-diff-vendor-CSgooKT_.js";import{D as G}from"./DiffToolbar-DKoxgNC4.js";import{S as H}from"./SplitFilePanel-DfP4aXjN.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-lqNquiby.js";import"./align-justify-DoUV5Vb3.js";import"./wrap-text-BzsWXR1k.js";var J=g('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),T=g("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Q=g('<div class="p-3 text-xs text-secondary">'),E=g("<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-"),U=g("<span class=files-tab-selected-path><span class=file-path-text>"),X=g('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Y=g("<div style=margin-left:auto>");const Z=q(()=>K(()=>import("./monaco-viewer-DNB9hvLQ.js").then(e=>e.ae),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),ce=e=>{const M=f(()=>e.activeSessionId()),S=f(()=>!!(M()&&M()!=="info")),D=f(()=>S()?e.activeSessionDiffs():null),m=f(()=>{const n=D();return Array.isArray(n)?[...n].sort((i,l)=>String(i.file||"").localeCompare(String(l.file||""))):[]}),R=f(()=>m().reduce((n,i)=>(n.additions+=typeof i.additions=="number"?i.additions:0,n.deletions+=typeof i.deletions=="number"?i.deletions:0,n),{additions:0,deletions:0})),I=f(()=>{const n=m();return n.length===0?null:n.reduce((i,l)=>{const v=typeof(i==null?void 0:i.additions)=="number"?i.additions:0,y=typeof(i==null?void 0:i.deletions)=="number"?i.deletions:0,x=v+y,k=typeof(l==null?void 0:l.additions)=="number"?l.additions:0,t=typeof(l==null?void 0:l.deletions)=="number"?l.deletions:0,r=k+t;return r>x?l:r<x?i:String(l.file||"").localeCompare(String((i==null?void 0:i.file)||""))<0?l:i},n[0])}),P=f(()=>{const n=e.selectedFile(),i=m();if(n){const l=i.find(v=>v.file===n);if(l)return l}return I()}),O=f(()=>`${e.instanceId}:${S()?M():"no-session"}`),V=f(()=>{if(!S())return e.t("instanceShell.sessionChanges.noSessionSelected");const n=D();return n===void 0?e.t("instanceShell.sessionChanges.loading"):!Array.isArray(n)||n.length===0?e.t("instanceShell.sessionChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty")}),A=f(()=>{const n=P();return n!=null&&n.file?String(n.file):e.t("instanceShell.rightPanel.tabs.changes")});return B(()=>{const n=m(),i=R(),l=P(),v=()=>(()=>{var t=J(),r=t.firstChild;return a(r,c(W,{get when(){return l&&S()&&n.length>0?l:null},get fallback(){return(()=>{var d=T(),s=d.firstChild;return a(s,V),d})()},children:d=>c(j,{get fallback(){return(()=>{var s=T(),u=s.firstChild;return a(u,()=>e.t("instanceInfo.loading")),s})()},get children(){return c(Z,{get scopeKey(){return O()},get path(){return String(d().file||"")},get patch(){return String(d().patch||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})),t})(),y=()=>(()=>{var t=Q();return a(t,V),t})();return c(H,{get header(){return[(()=>{var t=U(),r=t.firstChild;return a(r,A),L(()=>w(t,"title",A())),t})(),(()=>{var t=X(),r=t.firstChild,d=r.firstChild;d.firstChild;var s=r.nextSibling,u=s.firstChild;return u.firstChild,a(d,()=>i.additions,null),a(u,()=>i.deletions,null),t})(),(()=>{var t=Y();return a(t,c(G,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})),t})()]},list:{panel:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,e.isPhoneLayout())},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(s,"title",o.t=$),o},{e:void 0,t:void 0}),r})()})}}),overlay:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,!0)},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file,p=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(r,"title",o.t=$),p!==o.a&&w(s,"title",o.a=p),o},{e:void 0,t:void 0,a:void 0}),r})()})}})},get viewer(){return v()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.changes")}})})};N(["click"]);export{ce as default};
@@ -1 +1 @@
1
- import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-B3iAKbO0.js";import{u as T}from"./index-CXCTlmS7.js";import{n as o,m as $,a as V}from"./git-diff-vendor-CSgooKT_.js";import{I as U,S as A,O as I}from"./main-CuzUuQRM.js";import{A as D}from"./align-justify-BZaelTNi.js";import{W as E}from"./wrap-text-DvzNO1HR.js";const F=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],H=t=>o(U,$(t,{name:"UnfoldVertical",iconNode:F}));var N=g("<div class=file-viewer-toolbar><button type=button class=file-viewer-toolbar-icon-button></button><button type=button class=file-viewer-toolbar-icon-button></button><button type=button>");const z=t=>{const{t:a}=T(),d=()=>t.viewMode==="split"?"unified":"split",s=()=>t.contextMode==="collapsed"?"expanded":"collapsed",f=()=>t.wordWrapMode==="on"?"off":"on",h=()=>d()==="split"?a("instanceShell.diff.switchToSplit"):a("instanceShell.diff.switchToUnified"),v=()=>s()==="collapsed"?a("instanceShell.diff.hideUnchanged"):a("instanceShell.diff.showFull"),u=()=>f()==="on"?a("instanceShell.diff.enableWordWrap"):a("instanceShell.diff.disableWordWrap");return(()=>{var b=N(),n=b.firstChild,l=n.nextSibling,r=l.nextSibling;return n.$$click=()=>t.onViewModeChange(d()),c(n,(()=>{var e=W(()=>d()==="split");return()=>e()?o(A,{class:"h-4 w-4","aria-hidden":"true"}):o(D,{class:"h-4 w-4","aria-hidden":"true"})})()),l.$$click=()=>t.onContextModeChange(s()),c(l,(()=>{var e=W(()=>s()==="collapsed");return()=>e()?o(I,{class:"h-4 w-4","aria-hidden":"true"}):o(H,{class:"h-4 w-4","aria-hidden":"true"})})()),r.$$click=()=>t.onWordWrapModeChange(f()),c(r,o(E,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=h(),w=h(),M=v(),p=v(),x=`file-viewer-toolbar-icon-button${t.wordWrapMode==="on"?" active":""}`,k=u(),y=u();return m!==e.e&&i(n,"aria-label",e.e=m),w!==e.t&&i(n,"title",e.t=w),M!==e.a&&i(l,"aria-label",e.a=M),p!==e.o&&i(l,"title",e.o=p),x!==e.i&&S(r,e.i=x),k!==e.n&&i(r,"aria-label",e.n=k),y!==e.s&&i(r,"title",e.s=y),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),b})()};C(["click"]);export{z as D};
1
+ import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-DNB9hvLQ.js";import{u as T}from"./index-Ct_e2ZAi.js";import{n as o,m as $,a as V}from"./git-diff-vendor-CSgooKT_.js";import{I as U,S as A,O as I}from"./main-lqNquiby.js";import{A as D}from"./align-justify-DoUV5Vb3.js";import{W as E}from"./wrap-text-BzsWXR1k.js";const F=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],H=t=>o(U,$(t,{name:"UnfoldVertical",iconNode:F}));var N=g("<div class=file-viewer-toolbar><button type=button class=file-viewer-toolbar-icon-button></button><button type=button class=file-viewer-toolbar-icon-button></button><button type=button>");const z=t=>{const{t:a}=T(),d=()=>t.viewMode==="split"?"unified":"split",s=()=>t.contextMode==="collapsed"?"expanded":"collapsed",f=()=>t.wordWrapMode==="on"?"off":"on",h=()=>d()==="split"?a("instanceShell.diff.switchToSplit"):a("instanceShell.diff.switchToUnified"),v=()=>s()==="collapsed"?a("instanceShell.diff.hideUnchanged"):a("instanceShell.diff.showFull"),u=()=>f()==="on"?a("instanceShell.diff.enableWordWrap"):a("instanceShell.diff.disableWordWrap");return(()=>{var b=N(),n=b.firstChild,l=n.nextSibling,r=l.nextSibling;return n.$$click=()=>t.onViewModeChange(d()),c(n,(()=>{var e=W(()=>d()==="split");return()=>e()?o(A,{class:"h-4 w-4","aria-hidden":"true"}):o(D,{class:"h-4 w-4","aria-hidden":"true"})})()),l.$$click=()=>t.onContextModeChange(s()),c(l,(()=>{var e=W(()=>s()==="collapsed");return()=>e()?o(I,{class:"h-4 w-4","aria-hidden":"true"}):o(H,{class:"h-4 w-4","aria-hidden":"true"})})()),r.$$click=()=>t.onWordWrapModeChange(f()),c(r,o(E,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=h(),w=h(),M=v(),p=v(),x=`file-viewer-toolbar-icon-button${t.wordWrapMode==="on"?" active":""}`,k=u(),y=u();return m!==e.e&&i(n,"aria-label",e.e=m),w!==e.t&&i(n,"title",e.t=w),M!==e.a&&i(l,"aria-label",e.a=M),p!==e.o&&i(l,"title",e.o=p),x!==e.i&&S(r,e.i=x),k!==e.n&&i(r,"aria-label",e.n=k),y!==e.s&&i(r,"title",e.s=y),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),b})()};C(["click"]);export{z as D};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-DNB9hvLQ.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
2
+ import{_ as G}from"./index-Ct_e2ZAi.js";import{Z as J,m,t as h,i as s,d as u,a as C,u as U,f as X}from"./monaco-viewer-DNB9hvLQ.js";import{d as K,b as P,c as $,n as o,S as g,a as w,z as Y,A as p,F as ee}from"./git-diff-vendor-CSgooKT_.js";import{S as te}from"./SplitFilePanel-DfP4aXjN.js";import{R as V,P as le,M as re,Q as ne,C as ae,e as ie,T as se}from"./main-lqNquiby.js";import{W as oe}from"./wrap-text-BzsWXR1k.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";var ce=h('<div class="px-2 py-2 border-b border-base"><div class=selector-input-group><div class="flex items-center gap-2 px-3 text-muted"></div><input type=text class=selector-input>'),de=h("<div class=file-list-header><span class=file-list-title></span><span class=file-list-count>"),O=h('<div class="p-3 text-xs text-secondary">'),he=h("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),ue=h('<div class="p-3 text-xs text-error">'),ve=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class="flex items-center gap-2 shrink-0"><div class=file-list-item-stats><span class="text-[10px] text-secondary"></span></div><button type=button class=git-change-row-action>'),x=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),fe=h('<div class="file-viewer-panel flex-1"><div>'),ge=h('<div class="h-full outline-none"tabindex=0>'),we=h("<span>"),be=h("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),Se=h("<button type=button style=margin-inline-start:auto>"),me=h("<button type=button>"),Q=h("<button type=button class=files-header-icon-button>"),$e=h("<span class=text-error>");const ye=p(()=>G(()=>import("./monaco-viewer-DNB9hvLQ.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoFileViewer})));function _e(e){return e?/\.(md|markdown|mdown|mkdn)$/i.test(e):!1}const De=e=>{const[E,L]=K(""),{isDark:q}=J(),[N,M]=K(!1);let b;P(()=>{e.browserPath(),L("")});const H=$(()=>[...e.browserEntries()||[]].sort((i,d)=>{const l=i.type==="directory"?0:1,t=d.type==="directory"?0:1;return l!==t?l-t:String(i.name||"").localeCompare(String(d.name||""))})),W=$(()=>E().trim().toLowerCase()),k=$(()=>{const r=W(),i=H();return r?i.filter(d=>String(d.name||"").toLowerCase().includes(r)):i}),y=()=>e.browserLoading()&&e.browserEntries()===null,Z=()=>W()?e.t("instanceShell.filesShell.search.empty"):e.t("instanceShell.filesShell.listEmpty"),_=$(()=>_e(e.browserSelectedPath())),S=$(()=>_()&&N());P(()=>{_()||M(!1)});const T=()=>{const r=e.browserSelectedContent();r!=null&&e.onSave(r)},j=async(r,i)=>{i==null||i.stopPropagation();const d=await ie(r);se({message:d?e.t("instanceShell.filesShell.toast.copyPathSuccess"):e.t("instanceShell.filesShell.toast.copyPathError"),variant:d?"success":"error"})};P(()=>{S()&&requestAnimationFrame(()=>b==null?void 0:b.focus())});const D=()=>[(()=>{var r=ce(),i=r.firstChild,d=i.firstChild,l=d.nextSibling;return s(d,o(ne,{class:"w-4 h-4"})),l.$$input=t=>L(t.currentTarget.value),w(t=>{var a=e.t("instanceShell.filesShell.search.placeholder"),n=e.t("instanceShell.filesShell.search.ariaLabel");return a!==t.e&&u(l,"placeholder",t.e=a),n!==t.t&&u(l,"aria-label",t.t=n),t},{e:void 0,t:void 0}),w(()=>l.value=E()),r})(),(()=>{var r=de(),i=r.firstChild,d=i.nextSibling;return s(i,()=>e.t("instanceShell.filesShell.fileListTitle")),s(d,()=>k().length),r})(),o(g,{get when(){return e.parentPath()},children:r=>(()=>{var i=he(),d=i.firstChild,l=d.firstChild;return i.$$click=()=>e.onLoadEntries(r()),w(()=>u(l,"title",r())),i})()}),o(g,{get when(){return y()},get children(){var r=O();return s(r,()=>e.t("instanceInfo.loading")),r}}),o(g,{get when(){return m(()=>!e.browserError()&&!y())()&&k().length>0},get fallback(){return m(()=>!y())()?m(()=>!!e.browserError())()?(()=>{var r=ue();return s(r,()=>e.browserError()),r})():(()=>{var r=O();return s(r,Z),r})():void 0},get children(){return o(ee,{get each(){return k()},children:r=>(()=>{var i=ve(),d=i.firstChild,l=d.firstChild,t=l.firstChild,a=l.nextSibling,n=a.firstChild,c=n.firstChild,f=n.nextSibling;return i.$$click=()=>{if(r.type==="directory"){e.onLoadEntries(r.path);return}e.onRequestOpenFile(r.path)},s(t,()=>r.name),s(c,()=>r.type),f.$$click=v=>void j(r.path,v),s(f,o(ae,{class:"w-3 h-3"})),w(v=>{var F=`file-list-item ${e.browserSelectedPath()===r.path?"file-list-item-active":""}`,z=r.path,R=r.path,I=e.t("instanceShell.filesShell.actions.copyPath"),A=e.t("instanceShell.filesShell.actions.copyPath");return F!==v.e&&C(i,v.e=F),z!==v.t&&u(i,"title",v.t=z),R!==v.a&&u(l,"title",v.a=R),I!==v.o&&u(f,"title",v.o=I),A!==v.i&&u(f,"aria-label",v.i=A),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i})()})}})],B=r=>{!(r.ctrlKey||r.metaKey)||r.key.toLowerCase()!=="s"||e.browserSelectedSaving()||!e.browserSelectedDirty()||(r.preventDefault(),T())};return m(()=>{const r=()=>e.browserSelectedPath()||e.browserPath(),i=()=>y()?e.t("instanceInfo.loading"):e.t("instanceShell.filesShell.viewerEmpty"),d=()=>(()=>{var l=fe(),t=l.firstChild;return s(t,o(g,{get when(){return e.browserSelectedLoading()},get fallback(){return o(g,{get when(){return e.browserSelectedError()},get fallback(){return o(g,{get when(){return m(()=>!!(e.browserSelectedPath()&&e.browserSelectedContent()!==null))()?{path:e.browserSelectedPath(),content:e.browserSelectedContent()}:null},get fallback(){return(()=>{var a=x(),n=a.firstChild;return s(n,i),a})()},children:a=>o(g,{get when(){return S()},get fallback(){return o(Y,{get fallback(){return(()=>{var n=x(),c=n.firstChild;return s(c,()=>e.t("instanceInfo.loading")),n})()},get children(){return o(ye,{get scopeKey(){return e.scopeKey()},get path(){return a().path},get content(){return a().content},get wordWrap(){return e.wordWrapMode()},get onSave(){return e.onSave},get onContentChange(){return e.onContentChange}})}})},get children(){var n=ge();n.$$mousedown=()=>b==null?void 0:b.focus(),n.$$keydown=B;var c=b;return typeof c=="function"?U(c,n):b=n,s(n,o(re,{get part(){return{type:"text",text:a().content}},get isDark(){return q()},escapeRawHtml:!0})),n}})})},children:a=>(()=>{var n=x(),c=n.firstChild;return s(c,a),n})()})},get children(){var a=x(),n=a.firstChild;return s(n,()=>e.t("instanceInfo.loading")),a}})),w(()=>C(t,S()?"file-viewer-content":"file-viewer-content file-viewer-content--monaco")),l})();return o(te,{get header(){return[(()=>{var l=be(),t=l.firstChild,a=t.firstChild,n=a.firstChild;return s(n,r),s(l,o(g,{get when(){return e.browserLoading()},get children(){var c=we();return s(c,()=>e.t("instanceInfo.loading")),c}}),null),s(l,o(g,{get when(){return e.browserError()},children:c=>(()=>{var f=$e();return s(f,c),f})()}),null),w(()=>u(a,"title",r())),l})(),(()=>{var l=Se();return l.$$click=()=>_()&&M(t=>!t),s(l,(()=>{var t=m(()=>!!S());return()=>t()?e.t("instanceShell.filesShell.showSource"):e.t("instanceShell.filesShell.previewMarkdown")})()),w(t=>{var a=`file-viewer-toolbar-button${S()?" active":""}`,n=!_();return a!==t.e&&C(l,t.e=a),n!==t.t&&(l.disabled=t.t=n),t},{e:void 0,t:void 0}),l})(),(()=>{var l=me();return l.$$click=()=>e.onWordWrapModeChange(e.wordWrapMode()==="on"?"off":"on"),s(l,o(oe,{class:"h-4 w-4"})),w(t=>{var a=`file-viewer-toolbar-icon-button${e.wordWrapMode()==="on"?" active":""}`,n=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),c=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),f=S();return a!==t.e&&C(l,t.e=a),n!==t.t&&u(l,"title",t.t=n),c!==t.a&&u(l,"aria-label",t.a=c),f!==t.o&&(l.disabled=t.o=f),t},{e:void 0,t:void 0,a:void 0,o:void 0}),l})(),(()=>{var l=Q();return l.$$click=T,s(l,o(g,{get when(){return e.browserSelectedSaving()},get fallback(){return o(le,{class:"h-4 w-4"})},get children(){return o(V,{class:"h-4 w-4 animate-spin"})}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",n=e.t("instanceShell.rightPanel.actions.save")||"Save",c=e.browserSelectedSaving()||!e.browserSelectedDirty();return a!==t.e&&u(l,"title",t.e=a),n!==t.t&&u(l,"aria-label",t.t=n),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})(),(()=>{var l=Q();return l.$$click=()=>e.onRefresh(),s(l,o(V,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.refresh"),n=e.t("instanceShell.rightPanel.actions.refresh"),c=e.browserLoading();return a!==t.e&&u(l,"title",t.e=a),n!==t.t&&u(l,"aria-label",t.t=n),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})()]},list:{panel:()=>o(D,{}),overlay:()=>o(D,{})},get viewer(){return d()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.files")}})})};X(["input","click","keydown","mousedown"]);export{De as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-B3iAKbO0.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
2
- import{_ as se}from"./index-CXCTlmS7.js";import{m as V,t as h,i as n,d as b,h as q,a as H,f as le}from"./monaco-viewer-B3iAKbO0.js";import{c as m,n as r,a as k,S as w,F as J,z as re,A as ce}from"./git-diff-vendor-CSgooKT_.js";import{D as oe}from"./DiffToolbar-h4_ij7Yi.js";import{S as de}from"./SplitFilePanel-CO765UL-.js";import{H as ge,R as he,J as j,K as Q,N as ue}from"./main-CuzUuQRM.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./align-justify-BZaelTNi.js";import"./wrap-text-DvzNO1HR.js";var W=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),fe=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),me=h('<div class="p-3 text-xs text-secondary">'),ve=h('<span class="git-change-row-action-bar git-change-row-action-bar-vertical">'),Ce=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=git-change-list-item-right><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-</span></div></div></div><div class=git-change-list-item-actions-zone><div class=git-change-list-item-actions><button type=button class=git-change-row-action><span aria-hidden=true><span class="git-change-row-action-bar git-change-row-action-bar-horizontal">'),$e=h("<div class=git-change-section-items>"),be=h("<div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title></span></span><span class=git-change-section-count>"),_e=h('<div class=git-change-section-items><div class=git-change-commit-box><div class=git-change-commit-input-wrap><textarea class=git-change-commit-input rows=1></textarea><button type=button class="git-change-commit-button git-change-commit-button-overlay">'),we=h("<div class=git-change-sections><div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title-row><span class=git-change-section-title></span></span></span><span class=git-change-section-count>"),Se=h('<span class="status-indicator session-status-list worktree-indicator git-change-section-badge"><span class=worktree-indicator-label>'),ye=h("<span class=files-tab-selected-path><span class=file-path-text>"),xe=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>-'),Ie=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Me=h("<span class=text-error>");const Le=ce(()=>se(()=>import("./monaco-viewer-B3iAKbO0.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),Oe=e=>{const T=m(()=>e.activeSessionId()),P=m(()=>!!(T()&&T()!=="info")),A=m(()=>P()?e.entries():null),X=m(()=>{const o=A();return Array.isArray(o)?[...o].sort((d,x)=>String(d.path||"").localeCompare(String(x.path||""))):[]}),S=m(()=>ge(X())),Y=m(()=>S().reduce((o,d)=>(o.additions+=typeof d.additions=="number"?d.additions:0,o.deletions+=typeof d.deletions=="number"?d.deletions:0,o),{additions:0,deletions:0})),z=m(()=>S().filter(o=>o.section==="staged")),Z=m(()=>S().filter(o=>o.section==="unstaged")),p=m(()=>z().length>0&&e.commitMessage().trim().length>0&&!e.commitSubmitting()),ee=m(()=>{const o=S(),d=e.selectedItemId(),x=e.mostChangedItemId(),I=o.find(E=>E.id===d)||(x?o.find(E=>E.id===x):void 0);return(I==null?void 0:I.entry)??null}),D=m(()=>P()?A()===null?e.t("instanceShell.gitChanges.loading"):S().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected")),te=m(()=>e.selectedError()===e.t("instanceShell.gitChanges.binaryViewer"));return V(()=>{const o=Y(),d=ee(),x=S(),I=z(),E=Z(),ne=()=>(()=>{var t=fe(),l=t.firstChild;return n(l,r(w,{get when(){return e.selectedLoading()},get fallback(){return r(w,{get when(){return e.selectedError()},get fallback(){return r(w,{get when(){return V(()=>!!(d&&e.selectedBefore()!==null&&e.selectedAfter()!==null))()?{path:d.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=W(),s=i.firstChild;return n(s,D),i})()},children:i=>r(re,{get fallback(){return(()=>{var s=W(),a=s.firstChild;return n(a,()=>e.t("instanceInfo.loading")),s})()},get children(){return r(Le,{get scopeKey(){return e.scopeKey()},get path(){return String(i().path||"")},get before(){return String(i().before||"")},get after(){return String(i().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()},get insertContextLabel(){return e.t("instanceShell.gitChanges.actions.insertContext")},get onRequestInsertContext(){return te()?void 0:s=>{const a=e.selectedItemId();if(!a)return;const g=S().find(u=>u.id===a);g&&e.onInsertContext(g,s)}}})}})})},children:i=>(()=>{var s=W(),a=s.firstChild;return n(a,i),s})()})},get children(){var i=W(),s=i.firstChild;return n(s,()=>e.t("instanceInfo.loading")),i}})),t})(),ie=()=>(()=>{var t=me();return n(t,D),t})(),B=t=>{const l=m(()=>e.selectedBulkItemIds().has(t.id)),i=t.section==="staged"?e.t("instanceShell.gitChanges.actions.unstage"):e.t("instanceShell.gitChanges.actions.stage"),s=()=>{t.section==="staged"?e.onUnstageFile(t):e.onStageFile(t)};return(()=>{var a=Ce(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=u.nextSibling,$=v.firstChild,C=$.firstChild;C.firstChild;var _=C.nextSibling;_.firstChild;var R=g.nextSibling,f=R.firstChild,y=f.firstChild,L=y.firstChild;return L.firstChild,a.$$click=c=>e.onRowClick(t,c),a.$$mousedown=c=>{(c.shiftKey||c.ctrlKey||c.metaKey)&&c.preventDefault()},n(M,()=>t.path),n(C,()=>t.additions,null),n(_,()=>t.deletions,null),y.$$click=c=>{c.stopPropagation(),s()},b(y,"title",i),b(y,"aria-label",i),n(L,r(w,{get when(){return t.section!=="staged"},get children(){return ve()}}),null),k(c=>{var K=`file-list-item git-change-list-item ${e.selectedItemId()===t.id?"file-list-item-active":""} ${l()?"git-change-list-item-bulk-selected":""}`,F=t.path,G=t.path,N=t.path,U=`git-change-row-action-glyph ${t.section==="staged"?"git-change-row-action-glyph-minus":"git-change-row-action-glyph-plus"}`;return K!==c.e&&H(a,c.e=K),F!==c.t&&b(a,"title",c.t=F),G!==c.a&&b(g,"title",c.a=G),N!==c.o&&b(u,"title",c.o=N),U!==c.i&&H(L,c.i=U),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()},ae=(t,l,i,s)=>(()=>{var a=be(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=M.nextSibling,$=u.nextSibling;return q(g,"click",s,!0),n(M,i?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})),n(v,t),n($,()=>l.length),n(a,r(w,{when:i,get children(){var C=$e();return n(C,r(J,{each:l,children:_=>B(_)})),C}}),null),a})(),O=()=>r(w,{get when(){return x.length>0},get fallback(){return ie()},get children(){var t=we(),l=t.firstChild,i=l.firstChild,s=i.firstChild,a=s.firstChild,g=a.nextSibling,u=g.firstChild,M=s.nextSibling;return q(i,"click",e.onToggleStagedOpen,!0),n(a,(()=>{var v=V(()=>!!e.stagedOpen());return()=>v()?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})})()),n(u,()=>e.t("instanceShell.gitChanges.sections.staged")),n(g,r(w,{get when(){return e.branchLabel()},children:v=>(()=>{var $=Se(),C=$.firstChild;return n($,r(ue,{class:"w-3.5 h-3.5","aria-hidden":"true"}),C),n(C,v),k(()=>b($,"title",`Branch: ${v()}`)),$})()}),null),n(M,()=>I.length),n(l,r(w,{get when(){return e.stagedOpen()},get children(){var v=_e(),$=v.firstChild,C=$.firstChild,_=C.firstChild,R=_.nextSibling;return _.$$input=f=>e.onCommitMessageInput(f.currentTarget.value),R.$$click=()=>e.onSubmitCommit(),n(R,(()=>{var f=V(()=>!!e.commitSubmitting());return()=>f()?e.t("instanceShell.gitChanges.commit.submitting"):e.t("instanceShell.gitChanges.commit.submit")})()),n(v,r(J,{each:I,children:f=>B(f)}),null),k(f=>{var y=e.t("instanceShell.gitChanges.commit.placeholder"),L=!p();return y!==f.e&&b(_,"placeholder",f.e=y),L!==f.t&&(R.disabled=f.t=L),f},{e:void 0,t:void 0}),k(()=>_.value=e.commitMessage()),v}}),null),n(t,()=>ae(e.t("instanceShell.gitChanges.sections.unstaged"),E,e.unstagedOpen(),e.onToggleUnstagedOpen),null),t}});return r(de,{get header(){return[(()=>{var t=ye(),l=t.firstChild;return n(l,()=>(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),k(()=>b(t,"title",(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=xe(),l=t.firstChild,i=l.firstChild;i.firstChild;var s=l.nextSibling,a=s.firstChild;return a.firstChild,n(i,()=>o.additions,null),n(a,()=>o.deletions,null),n(t,r(w,{get when(){return e.statusError()},children:g=>(()=>{var u=Me();return n(u,g),u})()}),null),t})(),(()=>{var t=Ie();return t.$$click=()=>e.onRefresh(),n(t,r(he,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),k(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),s=e.t("instanceShell.rightPanel.actions.refresh"),a=!P()||e.statusLoading()||A()===null;return i!==l.e&&b(t,"title",l.e=i),s!==l.t&&b(t,"aria-label",l.t=s),a!==l.a&&(t.disabled=l.a=a),l},{e:void 0,t:void 0,a:void 0}),t})(),r(oe,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:O,overlay:O},get viewer(){return ne()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};le(["mousedown","click","input"]);export{Oe as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-DNB9hvLQ.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
2
+ import{_ as se}from"./index-Ct_e2ZAi.js";import{m as V,t as h,i as n,d as b,h as q,a as H,f as le}from"./monaco-viewer-DNB9hvLQ.js";import{c as m,n as r,a as k,S as w,F as J,z as re,A as ce}from"./git-diff-vendor-CSgooKT_.js";import{D as oe}from"./DiffToolbar-DKoxgNC4.js";import{S as de}from"./SplitFilePanel-DfP4aXjN.js";import{H as ge,R as he,J as j,K as Q,N as ue}from"./main-lqNquiby.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./align-justify-DoUV5Vb3.js";import"./wrap-text-BzsWXR1k.js";var W=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),fe=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),me=h('<div class="p-3 text-xs text-secondary">'),ve=h('<span class="git-change-row-action-bar git-change-row-action-bar-vertical">'),Ce=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=git-change-list-item-right><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-</span></div></div></div><div class=git-change-list-item-actions-zone><div class=git-change-list-item-actions><button type=button class=git-change-row-action><span aria-hidden=true><span class="git-change-row-action-bar git-change-row-action-bar-horizontal">'),$e=h("<div class=git-change-section-items>"),be=h("<div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title></span></span><span class=git-change-section-count>"),_e=h('<div class=git-change-section-items><div class=git-change-commit-box><div class=git-change-commit-input-wrap><textarea class=git-change-commit-input rows=1></textarea><button type=button class="git-change-commit-button git-change-commit-button-overlay">'),we=h("<div class=git-change-sections><div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title-row><span class=git-change-section-title></span></span></span><span class=git-change-section-count>"),Se=h('<span class="status-indicator session-status-list worktree-indicator git-change-section-badge"><span class=worktree-indicator-label>'),ye=h("<span class=files-tab-selected-path><span class=file-path-text>"),xe=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>-'),Ie=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Me=h("<span class=text-error>");const Le=ce(()=>se(()=>import("./monaco-viewer-DNB9hvLQ.js").then(e=>e.ae),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),Oe=e=>{const T=m(()=>e.activeSessionId()),P=m(()=>!!(T()&&T()!=="info")),A=m(()=>P()?e.entries():null),X=m(()=>{const o=A();return Array.isArray(o)?[...o].sort((d,x)=>String(d.path||"").localeCompare(String(x.path||""))):[]}),S=m(()=>ge(X())),Y=m(()=>S().reduce((o,d)=>(o.additions+=typeof d.additions=="number"?d.additions:0,o.deletions+=typeof d.deletions=="number"?d.deletions:0,o),{additions:0,deletions:0})),z=m(()=>S().filter(o=>o.section==="staged")),Z=m(()=>S().filter(o=>o.section==="unstaged")),p=m(()=>z().length>0&&e.commitMessage().trim().length>0&&!e.commitSubmitting()),ee=m(()=>{const o=S(),d=e.selectedItemId(),x=e.mostChangedItemId(),I=o.find(E=>E.id===d)||(x?o.find(E=>E.id===x):void 0);return(I==null?void 0:I.entry)??null}),D=m(()=>P()?A()===null?e.t("instanceShell.gitChanges.loading"):S().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected")),te=m(()=>e.selectedError()===e.t("instanceShell.gitChanges.binaryViewer"));return V(()=>{const o=Y(),d=ee(),x=S(),I=z(),E=Z(),ne=()=>(()=>{var t=fe(),l=t.firstChild;return n(l,r(w,{get when(){return e.selectedLoading()},get fallback(){return r(w,{get when(){return e.selectedError()},get fallback(){return r(w,{get when(){return V(()=>!!(d&&e.selectedBefore()!==null&&e.selectedAfter()!==null))()?{path:d.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=W(),s=i.firstChild;return n(s,D),i})()},children:i=>r(re,{get fallback(){return(()=>{var s=W(),a=s.firstChild;return n(a,()=>e.t("instanceInfo.loading")),s})()},get children(){return r(Le,{get scopeKey(){return e.scopeKey()},get path(){return String(i().path||"")},get before(){return String(i().before||"")},get after(){return String(i().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()},get insertContextLabel(){return e.t("instanceShell.gitChanges.actions.insertContext")},get onRequestInsertContext(){return te()?void 0:s=>{const a=e.selectedItemId();if(!a)return;const g=S().find(u=>u.id===a);g&&e.onInsertContext(g,s)}}})}})})},children:i=>(()=>{var s=W(),a=s.firstChild;return n(a,i),s})()})},get children(){var i=W(),s=i.firstChild;return n(s,()=>e.t("instanceInfo.loading")),i}})),t})(),ie=()=>(()=>{var t=me();return n(t,D),t})(),B=t=>{const l=m(()=>e.selectedBulkItemIds().has(t.id)),i=t.section==="staged"?e.t("instanceShell.gitChanges.actions.unstage"):e.t("instanceShell.gitChanges.actions.stage"),s=()=>{t.section==="staged"?e.onUnstageFile(t):e.onStageFile(t)};return(()=>{var a=Ce(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=u.nextSibling,$=v.firstChild,C=$.firstChild;C.firstChild;var _=C.nextSibling;_.firstChild;var R=g.nextSibling,f=R.firstChild,y=f.firstChild,L=y.firstChild;return L.firstChild,a.$$click=c=>e.onRowClick(t,c),a.$$mousedown=c=>{(c.shiftKey||c.ctrlKey||c.metaKey)&&c.preventDefault()},n(M,()=>t.path),n(C,()=>t.additions,null),n(_,()=>t.deletions,null),y.$$click=c=>{c.stopPropagation(),s()},b(y,"title",i),b(y,"aria-label",i),n(L,r(w,{get when(){return t.section!=="staged"},get children(){return ve()}}),null),k(c=>{var K=`file-list-item git-change-list-item ${e.selectedItemId()===t.id?"file-list-item-active":""} ${l()?"git-change-list-item-bulk-selected":""}`,F=t.path,G=t.path,N=t.path,U=`git-change-row-action-glyph ${t.section==="staged"?"git-change-row-action-glyph-minus":"git-change-row-action-glyph-plus"}`;return K!==c.e&&H(a,c.e=K),F!==c.t&&b(a,"title",c.t=F),G!==c.a&&b(g,"title",c.a=G),N!==c.o&&b(u,"title",c.o=N),U!==c.i&&H(L,c.i=U),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()},ae=(t,l,i,s)=>(()=>{var a=be(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=M.nextSibling,$=u.nextSibling;return q(g,"click",s,!0),n(M,i?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})),n(v,t),n($,()=>l.length),n(a,r(w,{when:i,get children(){var C=$e();return n(C,r(J,{each:l,children:_=>B(_)})),C}}),null),a})(),O=()=>r(w,{get when(){return x.length>0},get fallback(){return ie()},get children(){var t=we(),l=t.firstChild,i=l.firstChild,s=i.firstChild,a=s.firstChild,g=a.nextSibling,u=g.firstChild,M=s.nextSibling;return q(i,"click",e.onToggleStagedOpen,!0),n(a,(()=>{var v=V(()=>!!e.stagedOpen());return()=>v()?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})})()),n(u,()=>e.t("instanceShell.gitChanges.sections.staged")),n(g,r(w,{get when(){return e.branchLabel()},children:v=>(()=>{var $=Se(),C=$.firstChild;return n($,r(ue,{class:"w-3.5 h-3.5","aria-hidden":"true"}),C),n(C,v),k(()=>b($,"title",`Branch: ${v()}`)),$})()}),null),n(M,()=>I.length),n(l,r(w,{get when(){return e.stagedOpen()},get children(){var v=_e(),$=v.firstChild,C=$.firstChild,_=C.firstChild,R=_.nextSibling;return _.$$input=f=>e.onCommitMessageInput(f.currentTarget.value),R.$$click=()=>e.onSubmitCommit(),n(R,(()=>{var f=V(()=>!!e.commitSubmitting());return()=>f()?e.t("instanceShell.gitChanges.commit.submitting"):e.t("instanceShell.gitChanges.commit.submit")})()),n(v,r(J,{each:I,children:f=>B(f)}),null),k(f=>{var y=e.t("instanceShell.gitChanges.commit.placeholder"),L=!p();return y!==f.e&&b(_,"placeholder",f.e=y),L!==f.t&&(R.disabled=f.t=L),f},{e:void 0,t:void 0}),k(()=>_.value=e.commitMessage()),v}}),null),n(t,()=>ae(e.t("instanceShell.gitChanges.sections.unstaged"),E,e.unstagedOpen(),e.onToggleUnstagedOpen),null),t}});return r(de,{get header(){return[(()=>{var t=ye(),l=t.firstChild;return n(l,()=>(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),k(()=>b(t,"title",(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=xe(),l=t.firstChild,i=l.firstChild;i.firstChild;var s=l.nextSibling,a=s.firstChild;return a.firstChild,n(i,()=>o.additions,null),n(a,()=>o.deletions,null),n(t,r(w,{get when(){return e.statusError()},children:g=>(()=>{var u=Me();return n(u,g),u})()}),null),t})(),(()=>{var t=Ie();return t.$$click=()=>e.onRefresh(),n(t,r(he,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),k(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),s=e.t("instanceShell.rightPanel.actions.refresh"),a=!P()||e.statusLoading()||A()===null;return i!==l.e&&b(t,"title",l.e=i),s!==l.t&&b(t,"aria-label",l.t=s),a!==l.a&&(t.disabled=l.a=a),l},{e:void 0,t:void 0,a:void 0}),t})(),r(oe,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:O,overlay:O},get viewer(){return ne()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};le(["mousedown","click","input"]);export{Oe as default};
@@ -1 +1 @@
1
- import{t as d,i as l,d as m,h as s,m as b,g as _,f as w}from"./monaco-viewer-B3iAKbO0.js";import{a as g,n as r,S as n}from"./git-diff-vendor-CSgooKT_.js";import{u as S}from"./index-CXCTlmS7.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,h as s,m as b,g as _,f as w}from"./monaco-viewer-DNB9hvLQ.js";import{a as g,n as r,S as n}from"./git-diff-vendor-CSgooKT_.js";import{u as S}from"./index-Ct_e2ZAi.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};
@@ -0,0 +1 @@
1
+ import{m as me,P as ze,E as Ve,t as A,i as u,a as Xe,d as K,f as Ye}from"./monaco-viewer-DNB9hvLQ.js";import{n as a,m as T,q as re,s as R,d as M,b as q,o as j,c as k,k as ae,S as Z,l as ce,t as Ge,w as ke,a as fe,F as ge}from"./git-diff-vendor-CSgooKT_.js";import{I as ve,U as $e,W as z,X as Te,Y as Ie,Z as be,_ as Je,$ as pe,a0 as le,a1 as de,a2 as _e,a3 as ne,a4 as oe,a5 as Ze,a6 as ye,a7 as Qe,a8 as et,a9 as B,aa as xe,ab as tt,ac as nt,ad as ot,ae as st,af as H,ag as it,ah as lt,ai as rt,aj as at,ak as ct,al as Q,J as dt,am as ut,an as he,ao as gt,ap as pt,aq as ht,ar as ft,as as bt}from"./main-lqNquiby.js";import{u as mt}from"./index-Ct_e2ZAi.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const vt=[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]],yt=e=>a(ve,T(e,{name:"BellRing",iconNode:vt})),xt=[["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"}]],Ct=e=>a(ve,T(e,{name:"TerminalSquare",iconNode:xt})),wt=[["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"}]],St=e=>a(ve,T(e,{name:"XOctagon",iconNode:wt}));var Pt={};xe(Pt,{Arrow:()=>$e,Content:()=>Oe,Portal:()=>Me,Root:()=>Ae,Tooltip:()=>te,Trigger:()=>Ee,useTooltipContext:()=>ue});var De=ae();function ue(){const e=ce(De);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function Oe(e){const s=ue(),g=z({id:s.generateId("content")},e),[d,t]=R(g,["ref","style"]);return q(()=>j(s.registerContentId(t.id))),a(Z,{get when(){return s.contentPresent()},get children(){return a(_e.Positioner,{get children(){return a(Ze,T({ref(n){var o=ne(i=>{s.setContentRef(i)},d.ref);typeof o=="function"&&o(n)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return ye({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},d.style)},onFocusOutside:n=>n.preventDefault(),onDismiss:()=>s.hideTooltip(!0)},()=>s.dataset(),t))}})}})}function Me(e){const s=ue();return a(Z,{get when(){return s.contentPresent()},get children(){return a(ze,e)}})}function kt(e,s,g){const d=e.split("-")[0],t=s.getBoundingClientRect(),n=g.getBoundingClientRect(),o=[],i=t.left+t.width/2,r=t.top+t.height/2;switch(d){case"top":o.push([t.left,r]),o.push([n.left,n.bottom]),o.push([n.left,n.top]),o.push([n.right,n.top]),o.push([n.right,n.bottom]),o.push([t.right,r]);break;case"right":o.push([i,t.top]),o.push([n.left,n.top]),o.push([n.right,n.top]),o.push([n.right,n.bottom]),o.push([n.left,n.bottom]),o.push([i,t.bottom]);break;case"bottom":o.push([t.left,r]),o.push([n.left,n.top]),o.push([n.left,n.bottom]),o.push([n.right,n.bottom]),o.push([n.right,n.top]),o.push([t.right,r]);break;case"left":o.push([i,t.top]),o.push([n.right,n.top]),o.push([n.left,n.top]),o.push([n.left,n.bottom]),o.push([n.right,n.bottom]),o.push([i,t.bottom]);break}return o}var V={},$t=0,Y=!1,L,ee,G;function Ae(e){const s=`tooltip-${re()}`,g=`${++$t}`,d=z({id:s,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[t,n]=R(d,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let o;const[i,r]=M(),[l,f]=M(),[c,h]=M(),[x,v]=M(n.placement),y=Te({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:m=>{var I;return(I=t.onOpenChange)==null?void 0:I.call(t,m)}}),{present:$}=Ie({show:()=>t.forceMount||y.isOpen(),element:()=>c()??null}),b=()=>{V[g]=C},S=()=>{for(const m in V)m!==g&&(V[m](!0),delete V[m])},C=(m=!1)=>{m||t.closeDelay&&t.closeDelay<=0?(window.clearTimeout(o),o=void 0,y.close()):o||(o=window.setTimeout(()=>{o=void 0,y.close()},t.closeDelay)),window.clearTimeout(L),L=void 0,t.skipDelayDuration&&t.skipDelayDuration>=0&&(G=window.setTimeout(()=>{window.clearTimeout(G),G=void 0},t.skipDelayDuration)),Y&&(window.clearTimeout(ee),ee=window.setTimeout(()=>{delete V[g],ee=void 0,Y=!1},t.closeDelay))},p=()=>{clearTimeout(o),o=void 0,S(),b(),Y=!0,y.open(),window.clearTimeout(L),L=void 0,window.clearTimeout(ee),ee=void 0,window.clearTimeout(G),G=void 0},U=()=>{S(),b(),!y.isOpen()&&!L&&!Y?L=window.setTimeout(()=>{L=void 0,Y=!0,p()},t.openDelay):y.isOpen()||p()},O=(m=!1)=>{!m&&t.openDelay&&t.openDelay>0&&!o&&!G?U():p()},N=()=>{window.clearTimeout(L),L=void 0,Y=!1},E=()=>{window.clearTimeout(o),o=void 0},F=m=>pe(l(),m)||pe(c(),m),_=m=>{const I=l(),W=c();if(!(!I||!W))return kt(m,I,W)},w=m=>{const I=m.target;if(F(I)){E();return}if(!t.ignoreSafeArea){const W=_(x());if(W&&Qe(et(m),W)){E();return}}o||C()};q(()=>{if(!y.isOpen())return;const m=be();m.addEventListener("pointermove",w,!0),j(()=>{m.removeEventListener("pointermove",w,!0)})}),q(()=>{const m=l();if(!m||!y.isOpen())return;const I=We=>{const qe=We.target;pe(qe,m)&&C(!0)},W=Je();W.addEventListener("scroll",I,{capture:!0}),j(()=>{W.removeEventListener("scroll",I,{capture:!0})})}),j(()=>{clearTimeout(o),V[g]&&delete V[g]});const D={dataset:k(()=>({"data-expanded":y.isOpen()?"":void 0,"data-closed":y.isOpen()?void 0:""})),isOpen:y.isOpen,isDisabled:()=>t.disabled??!1,triggerOnFocusOnly:()=>t.triggerOnFocusOnly??!1,contentId:i,contentPresent:$,openTooltip:O,hideTooltip:C,cancelOpening:N,generateId:de(()=>d.id),registerContentId:le(r),isTargetOnTooltip:F,setTriggerRef:f,setContentRef:h};return a(De.Provider,{value:D,get children(){return a(_e,T({anchorRef:l,contentRef:c,onCurrentPlacementChange:v},n))}})}function Ee(e){let s;const g=ue(),[d,t]=R(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let n=!1,o=!1,i=!1;const r=()=>{n=!1},l=()=>{!g.isOpen()&&(o||i)&&g.openTooltip(i)},f=b=>{g.isOpen()&&!o&&!i&&g.hideTooltip(b)},c=b=>{B(b,d.onPointerEnter),!(b.pointerType==="touch"||g.triggerOnFocusOnly()||g.isDisabled()||b.defaultPrevented)&&(o=!0,l())},h=b=>{B(b,d.onPointerLeave),b.pointerType!=="touch"&&(o=!1,i=!1,g.isOpen()?f():g.cancelOpening())},x=b=>{B(b,d.onPointerDown),n=!0,be(s).addEventListener("pointerup",r,{once:!0})},v=b=>{B(b,d.onClick),o=!1,i=!1,f(!0)},y=b=>{B(b,d.onFocus),!(g.isDisabled()||b.defaultPrevented||n)&&(i=!0,l())},$=b=>{B(b,d.onBlur);const S=b.relatedTarget;g.isTargetOnTooltip(S)||(o=!1,i=!1,f(!0))};return j(()=>{be(s).removeEventListener("pointerup",r)}),a(oe,T({as:"button",ref(b){var S=ne(C=>{g.setTriggerRef(C),s=C},d.ref);typeof S=="function"&&S(b)},get"aria-describedby"(){return me(()=>!!g.isOpen())()?g.contentId():void 0},onPointerEnter:c,onPointerLeave:h,onPointerDown:x,onClick:v,onFocus:y,onBlur:$},()=>g.dataset(),t))}var te=Object.assign(Ae,{Arrow:$e,Content:Oe,Portal:Me,Trigger:Ee}),Tt={};xe(Tt,{Collapsible:()=>It,Content:()=>Ce,Root:()=>we,Trigger:()=>Se,useCollapsibleContext:()=>se});var Fe=ae();function se(){const e=ce(Fe);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function Ce(e){const[s,g]=M(),d=se(),t=z({id:d.generateId("content")},e),[n,o]=R(t,["ref","id","style"]),{present:i}=Ie({show:d.shouldMount,element:()=>s()??null}),[r,l]=M(0),[f,c]=M(0);let x=d.isOpen()||i();return Ge(()=>{const v=requestAnimationFrame(()=>{x=!1});j(()=>{cancelAnimationFrame(v)})}),q(ke(i,()=>{if(!s())return;s().style.transitionDuration="0s",s().style.animationName="none";const v=s().getBoundingClientRect();l(v.height),c(v.width),x||(s().style.transitionDuration="",s().style.animationName="")})),q(ke(d.isOpen,v=>{!v&&s()&&(s().style.transitionDuration="",s().style.animationName="")},{defer:!0})),q(()=>j(d.registerContentId(n.id))),a(Z,{get when(){return i()},get children(){return a(oe,T({as:"div",ref(v){var y=ne(g,n.ref);typeof y=="function"&&y(v)},get id(){return n.id},get style(){return ye({"--kb-collapsible-content-height":r()?`${r()}px`:void 0,"--kb-collapsible-content-width":f()?`${f()}px`:void 0},n.style)}},()=>d.dataset(),o))}})}function we(e){const s=`collapsible-${re()}`,g=z({id:s},e),[d,t]=R(g,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[n,o]=M(),i=Te({open:()=>d.open,defaultOpen:()=>d.defaultOpen,onOpenChange:f=>{var c;return(c=d.onOpenChange)==null?void 0:c.call(d,f)}}),r=k(()=>({"data-expanded":i.isOpen()?"":void 0,"data-closed":i.isOpen()?void 0:"","data-disabled":d.disabled?"":void 0})),l={dataset:r,isOpen:i.isOpen,disabled:()=>d.disabled??!1,shouldMount:()=>d.forceMount||i.isOpen(),contentId:n,toggle:i.toggle,generateId:de(()=>t.id),registerContentId:le(o)};return a(Fe.Provider,{value:l,get children(){return a(oe,T({as:"div"},r,t))}})}function Se(e){const s=se(),[g,d]=R(e,["onClick"]);return a(tt,T({get"aria-expanded"(){return s.isOpen()},get"aria-controls"(){return me(()=>!!s.isOpen())()?s.contentId():void 0},get disabled(){return s.disabled()},onClick:n=>{B(n,g.onClick),s.toggle()}},()=>s.dataset(),d))}var It=Object.assign(we,{Content:Ce,Trigger:Se}),J={};xe(J,{Accordion:()=>_t,Content:()=>Ue,Header:()=>Le,Item:()=>He,Root:()=>je,Trigger:()=>Ne,useAccordionContext:()=>Pe});var Ke=ae();function Re(){const e=ce(Ke);if(e===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function Ue(e){const s=Re(),g=s.generateId("content"),d=z({id:g},e),[t,n]=R(d,["id","style"]);return q(()=>j(s.registerContentId(t.id))),a(Ce,T({role:"region",get"aria-labelledby"(){return s.triggerId()},get style(){return ye({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},t.style)}},n))}function Le(e){const s=se();return a(oe,T({as:"h3"},()=>s.dataset(),e))}var Be=ae();function Pe(){const e=ce(Be);if(e===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function He(e){const s=Pe(),g=`${s.generateId("item")}-${re()}`,d=z({id:g},e),[t,n]=R(d,["value","disabled"]),[o,i]=M(),[r,l]=M(),f=()=>s.listState().selectionManager(),c=()=>f().isSelected(t.value),h={value:()=>t.value,triggerId:o,contentId:r,generateId:de(()=>n.id),registerTriggerId:le(i),registerContentId:le(l)};return a(Ke.Provider,{value:h,get children(){return a(we,T({get open(){return c()},get disabled(){return t.disabled}},n))}})}function je(e){let s;const g=`accordion-${re()}`,d=z({id:g,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[t,n]=R(d,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[o,i]=M([]),{DomCollectionProvider:r}=nt({items:o,onItemsChange:i}),l=ot({selectedKeys:()=>t.value,defaultSelectedKeys:()=>t.defaultValue,onSelectionChange:h=>{var x;return(x=t.onChange)==null?void 0:x.call(t,Array.from(h))},disallowEmptySelection:()=>!t.multiple&&!t.collapsible,selectionMode:()=>t.multiple?"multiple":"single",dataSource:o});l.selectionManager().setFocusedKey("item-1");const f=st({selectionManager:()=>l.selectionManager(),collection:()=>l.collection(),disallowEmptySelection:()=>l.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>t.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>s),c={listState:()=>l,generateId:de(()=>t.id)};return a(r,{get children(){return a(Be.Provider,{value:c,get children(){return a(oe,T({as:"div",get id(){return t.id},ref(h){var x=ne(v=>s=v,t.ref);typeof x=="function"&&x(h)},get onKeyDown(){return H([t.onKeyDown,f.onKeyDown])},get onMouseDown(){return H([t.onMouseDown,f.onMouseDown])},get onFocusIn(){return H([t.onFocusIn])},get onFocusOut(){return H([t.onFocusOut,f.onFocusOut])}},n))}})}})}function Ne(e){let s;const g=Pe(),d=Re(),t=se(),n=d.generateId("trigger"),o=z({id:n},e),[i,r]=R(o,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);it({getItem:()=>({ref:()=>s,type:"item",key:d.value(),textValue:"",disabled:t.disabled()})});const l=lt({key:()=>d.value(),selectionManager:()=>g.listState().selectionManager(),disabled:()=>t.disabled(),shouldSelectOnPressUp:!0},()=>s),f=c=>{["Enter"," "].includes(c.key)&&c.preventDefault(),B(c,i.onKeyDown),B(c,l.onKeyDown)};return q(()=>j(d.registerTriggerId(r.id))),a(Se,T({ref(c){var h=ne(x=>s=x,i.ref);typeof h=="function"&&h(c)},get"data-key"(){return l.dataKey()},get onPointerDown(){return H([i.onPointerDown,l.onPointerDown])},get onPointerUp(){return H([i.onPointerUp,l.onPointerUp])},get onClick(){return H([i.onClick,l.onClick])},onKeyDown:f,get onMouseDown(){return H([i.onMouseDown,l.onMouseDown])},get onFocus(){return H([i.onFocus,l.onFocus])}},r))}var _t=Object.assign(je,{Content:Ue,Header:Le,Item:He,Trigger:Ne}),ie=A('<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">'),Dt=A('<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 Ot=e=>{const{t:s}=mt(),{preferences:g}=Ve(),d=k(()=>g().showUsageMetrics??!0),t=k(()=>rt(e.instanceId,e.sessionId)??{cost:0,contextWindow:0,isSubscriptionModel:!1,inputTokens:0,outputTokens:0,reasoningTokens:0,actualUsageTokens:0,modelOutputLimit:0,contextAvailableTokens:null}),n=k(()=>at(e.instanceId,e.sessionId)),o=k(()=>n().length>0),i=k(()=>o()?ct(e.instanceId,e.sessionId)??{cost:0,inputTokens:0,outputTokens:0,reasoningTokens:0}:{cost:0,inputTokens:0,outputTokens:0,reasoningTokens:0}),r=k(()=>`$${i().cost.toFixed(2)}`),l=k(()=>i().inputTokens),f=k(()=>i().outputTokens),c=k(()=>i().reasoningTokens),h=k(()=>t().inputTokens??0),x=k(()=>t().outputTokens??0),v=k(()=>{const $=t().isSubscriptionModel?0:t().cost;return $>0?$:0}),y=k(()=>`$${v().toFixed(2)}`);return(()=>{var $=Dt(),b=$.firstChild,S=b.firstChild,C=S.firstChild,p=C.nextSibling,U=S.nextSibling,O=U.firstChild,N=O.nextSibling,E=U.nextSibling,F=E.firstChild,_=F.nextSibling;return u(C,()=>s("contextUsagePanel.labels.input")),u(p,()=>Q(h())),u(O,()=>s("contextUsagePanel.labels.output")),u(N,()=>Q(x())),u(F,()=>s("contextUsagePanel.labels.cost")),u(_,y),u(b,a(Z,{get when(){return me(()=>!!o())()&&d()},get children(){return[(()=>{var w=ie(),P=w.firstChild,D=P.nextSibling;return u(P,()=>s("contextUsagePanel.labels.totalInput")),u(D,()=>Q(l())),w})(),(()=>{var w=ie(),P=w.firstChild,D=P.nextSibling;return u(P,()=>s("contextUsagePanel.labels.totalOutput")),u(D,()=>Q(f())),w})(),(()=>{var w=ie(),P=w.firstChild,D=P.nextSibling;return u(P,()=>s("contextUsagePanel.labels.totalCost")),u(D,r),w})(),(()=>{var w=ie(),P=w.firstChild,D=P.nextSibling;return u(P,()=>s("contextUsagePanel.labels.totalReasoning")),u(D,()=>Q(c())),w})()]}}),null),fe(()=>Xe($,`session-context-panel px-4 py-2 ${e.class??""}`)),$})()};var X=A('<div class="right-panel-empty right-panel-empty--left"><span class=text-xs>'),Mt=A('<div class="rounded-md border border-base bg-surface-secondary px-3 py-2"><div class="flex items-start justify-between gap-3"><div class=min-w-0><div class="text-sm font-medium text-primary"></div><p class="mt-1 text-xs text-secondary">'),At=A('<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">'),Et=A('<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)>'),Ft=A('<div class="flex flex-col gap-2">'),Kt=A("<span>"),Rt=A('<div class=status-process-card><div class=status-process-header><span class=status-process-title></span><div class=status-process-meta><span></span><span></span></div></div><div class=status-process-actions><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center">'),Ut=A("<div class=status-tab-container>"),Lt=A("<span class=section-left><span class=section-label>");const zt=e=>{const s=i=>e.expandedItems().includes(i),o=[{id:"yolo-mode",labelKey:"instanceShell.rightPanel.sections.yoloMode",tooltipKey:"instanceShell.rightPanel.sections.yoloMode.tooltip",render:()=>{const i=e.activeSession();return i?(()=>{var r=Mt(),l=r.firstChild,f=l.firstChild,c=f.firstChild,h=c.nextSibling;return u(c,()=>e.t("instanceShell.yoloMode.title")),u(h,()=>e.t("instanceShell.yoloMode.description")),u(l,a(ht,{get checked(){return pt(e.instanceId,i.id)},color:"warning",size:"small",get inputProps(){return{"aria-label":e.t("instanceShell.yoloMode.title")}},onChange:()=>gt(e.instanceId,i.id)}),null),r})():(()=>{var r=X(),l=r.firstChild;return u(l,()=>e.t("instanceShell.yoloMode.noSessionSelected")),r})()}},{id:"session-changes",labelKey:"instanceShell.rightPanel.sections.sessionChanges",tooltipKey:"instanceShell.rightPanel.sections.sessionChanges.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var c=X(),h=c.firstChild;return u(h,()=>e.t("instanceShell.sessionChanges.noSessionSelected")),c})();const r=e.activeSessionDiffs();if(r===void 0)return(()=>{var c=X(),h=c.firstChild;return u(h,()=>e.t("instanceShell.sessionChanges.loading")),c})();if(!Array.isArray(r)||r.length===0)return(()=>{var c=X(),h=c.firstChild;return u(h,()=>e.t("instanceShell.sessionChanges.empty")),c})();const l=[...r].sort((c,h)=>String(c.file||"").localeCompare(String(h.file||""))),f=l.reduce((c,h)=>(c.additions+=typeof h.additions=="number"?h.additions:0,c.deletions+=typeof h.deletions=="number"?h.deletions:0,c),{additions:0,deletions:0});return(()=>{var c=At(),h=c.firstChild,x=h.firstChild,v=x.nextSibling,y=v.firstChild,$=y.nextSibling,b=h.nextSibling,S=b.firstChild;return u(x,()=>e.t("instanceShell.sessionChanges.filesChanged",{count:l.length})),u(y,()=>`+${f.additions}`),u($,()=>`-${f.deletions}`),u(S,a(ge,{each:l,children:C=>(()=>{var p=Et(),U=p.firstChild,O=U.firstChild,N=O.nextSibling,E=N.firstChild,F=E.nextSibling;return p.$$click=()=>e.onOpenChangesTab(C.file),u(O,()=>C.file),u(E,()=>`+${C.additions}`),u(F,()=>`-${C.deletions}`),fe(_=>{var w=e.t("instanceShell.sessionChanges.actions.show"),P=C.file;return w!==_.e&&K(p,"title",_.e=w),P!==_.t&&K(O,"title",_.t=P),_},{e:void 0,t:void 0}),p})()})),c})()}},{id:"plan",labelKey:"instanceShell.rightPanel.sections.plan",tooltipKey:"instanceShell.rightPanel.sections.plan.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var l=X(),f=l.firstChild;return u(f,()=>e.t("instanceShell.plan.noSessionSelected")),l})();const r=e.latestTodoState();return r?a(ft,{state:r,get emptyLabel(){return e.t("instanceShell.plan.empty")},showStatusLabel:!1}):(()=>{var l=X(),f=l.firstChild;return u(f,()=>e.t("instanceShell.plan.empty")),l})()}},{id:"background-processes",labelKey:"instanceShell.rightPanel.sections.backgroundProcesses",tooltipKey:"instanceShell.rightPanel.sections.backgroundProcesses.tooltip",render:()=>{const i=e.backgroundProcessList();return i.length===0?(()=>{var r=X(),l=r.firstChild;return u(l,()=>e.t("instanceShell.backgroundProcesses.empty")),r})():(()=>{var r=Ft();return u(r,a(ge,{each:i,children:l=>(()=>{var f=Rt(),c=f.firstChild,h=c.firstChild,x=h.nextSibling,v=x.firstChild,y=v.nextSibling,$=c.nextSibling,b=$.firstChild,S=b.nextSibling,C=S.nextSibling;return u(h,()=>l.title),u(v,a(yt,{class:"h-3.5 w-3.5"})),u(y,()=>e.t("instanceShell.backgroundProcesses.status",{status:l.status})),u(x,a(Z,{get when(){return typeof l.outputSizeBytes=="number"},get children(){var p=Kt();return u(p,()=>e.t("instanceShell.backgroundProcesses.output",{sizeKb:Math.round((l.outputSizeBytes??0)/1024)})),p}}),null),b.$$click=()=>e.onOpenBackgroundOutput(l),u(b,a(Ct,{class:"h-4 w-4"})),S.$$click=()=>e.onStopBackgroundProcess(l.id),u(S,a(St,{class:"h-4 w-4"})),C.$$click=()=>e.onTerminateBackgroundProcess(l.id),u(C,a(bt,{class:"h-4 w-4"})),fe(p=>{var U=!!l.notifyEnabled,O=!l.notifyEnabled,N=e.t(l.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),E=e.t(l.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),F=e.t("instanceShell.backgroundProcesses.actions.output"),_=e.t("instanceShell.backgroundProcesses.actions.output"),w=l.status!=="running",P=e.t("instanceShell.backgroundProcesses.actions.stop"),D=e.t("instanceShell.backgroundProcesses.actions.stop"),m=e.t("instanceShell.backgroundProcesses.actions.terminate"),I=e.t("instanceShell.backgroundProcesses.actions.terminate");return U!==p.e&&v.classList.toggle("text-success",p.e=U),O!==p.t&&v.classList.toggle("text-tertiary",p.t=O),N!==p.a&&K(v,"aria-label",p.a=N),E!==p.o&&K(v,"title",p.o=E),F!==p.i&&K(b,"aria-label",p.i=F),_!==p.n&&K(b,"title",p.n=_),w!==p.s&&(S.disabled=p.s=w),P!==p.h&&K(S,"aria-label",p.h=P),D!==p.r&&K(S,"title",p.r=D),m!==p.d&&K(C,"aria-label",p.d=m),I!==p.l&&K(C,"title",p.l=I),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),f})()})),r})()}},{id:"mcp",labelKey:"instanceShell.rightPanel.sections.mcp",tooltipKey:"instanceShell.rightPanel.sections.mcp.tooltip",render:()=>a(he,{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:()=>a(he,{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:()=>a(he,{get initialInstance(){return e.instance},sections:["plugins"],showSectionHeadings:!1,class:"space-y-2"})}];return(()=>{var i=Ut();return u(i,a(Z,{get when(){return e.activeSession()},children:r=>a(Ot,{get instanceId(){return e.instanceId},get sessionId(){return r().id},class:"status-tab-context-panel"})}),null),u(i,a(J.Root,{class:"right-panel-accordion",collapsible:!0,multiple:!0,get value(){return e.expandedItems()},get onChange(){return e.onExpandedItemsChange},get children(){return a(ge,{each:o,children:r=>a(J.Item,{get value(){return r.id},class:"right-panel-accordion-item",get children(){return[a(J.Header,{class:"right-panel-accordion-header-row",get children(){return[a(J.Trigger,{class:"right-panel-accordion-trigger",get children(){return[(()=>{var l=Lt(),f=l.firstChild;return u(f,()=>e.t(r.labelKey)),l})(),a(dt,{get class(){return`right-panel-accordion-chevron ${s(r.id)?"right-panel-accordion-chevron-expanded":""}`}})]}}),a(te,{openDelay:200,gutter:4,placement:"top",get children(){return[a(te.Trigger,{as:"button",type:"button",class:"section-info-trigger",get"aria-label"(){return e.t(r.tooltipKey)},get children(){return a(ut,{class:"section-info-icon"})}}),a(te.Portal,{get children(){return a(te.Content,{class:"section-info-tooltip",get children(){return e.t(r.tooltipKey)}})}})]}})]}}),a(J.Content,{class:"right-panel-accordion-content",get children(){return r.render()}})]}})})}}),null),i})()};Ye(["click"]);export{zt as default};
@@ -1 +1 @@
1
- import{I as n}from"./main-CuzUuQRM.js";import{n as o,m as y}from"./git-diff-vendor-CSgooKT_.js";const i=[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["line",{x1:"3",x2:"21",y1:"12",y2:"12",key:"10d38w"}],["line",{x1:"3",x2:"21",y1:"18",y2:"18",key:"kwyyxn"}]],t=e=>o(n,y(e,{name:"AlignJustify",iconNode:i}));export{t as A};
1
+ import{I as n}from"./main-lqNquiby.js";import{n as o,m as y}from"./git-diff-vendor-CSgooKT_.js";const i=[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["line",{x1:"3",x2:"21",y1:"12",y2:"12",key:"10d38w"}],["line",{x1:"3",x2:"21",y1:"18",y2:"18",key:"kwyyxn"}]],t=e=>o(n,y(e,{name:"AlignJustify",iconNode:i}));export{t as A};