@neuralnomads/codenomad-dev 0.18.0-dev-20260715-07e8ce68 → 0.18.0-dev-20260716-40cee071
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/THIRD_PARTY_NOTICES.md +26 -0
- package/dist/events/bus.js +13 -0
- package/dist/events/bus.test.js +37 -0
- package/dist/index.js +33 -56
- package/dist/index.test.js +32 -0
- package/dist/server/__tests__/remote-proxy.test.js +102 -6
- package/dist/server/http-server.js +2 -0
- package/dist/server/remote-proxy.js +96 -9
- package/dist/server/routes/usage.js +18 -0
- package/dist/server/routes/usage.test.js +26 -0
- package/dist/server/routes/workspaces.js +32 -1
- package/dist/server/routes/workspaces.test.js +75 -0
- package/dist/settings/binaries.js +4 -1
- package/dist/settings/binaries.test.js +24 -0
- package/dist/shutdown.js +75 -0
- package/dist/shutdown.test.js +111 -0
- package/dist/usage/providers/api-key.js +171 -0
- package/dist/usage/providers/google.js +171 -0
- package/dist/usage/providers/minimax.js +109 -0
- package/dist/usage/providers/oauth.js +111 -0
- package/dist/usage/providers/special.js +148 -0
- package/dist/usage/service.js +83 -0
- package/dist/usage/service.test.js +59 -0
- package/dist/usage/shared.js +130 -0
- package/dist/usage/shared.test.js +33 -0
- package/dist/usage/types.js +1 -0
- package/dist/workspaces/__tests__/spawn.test.js +64 -7
- package/dist/workspaces/__tests__/workspace-identity.test.js +177 -25
- package/dist/workspaces/launch-cleanup.js +132 -0
- package/dist/workspaces/launch-cleanup.test.js +33 -0
- package/dist/workspaces/manager.js +393 -135
- package/dist/workspaces/manager.test.js +318 -0
- package/dist/workspaces/process-identity.js +408 -0
- package/dist/workspaces/process-identity.test.js +165 -0
- package/dist/workspaces/runtime.js +567 -122
- package/dist/workspaces/runtime.test.js +603 -0
- package/dist/workspaces/spawn.js +86 -15
- package/package.json +1 -1
- package/public/assets/{FilesTab-EPvldvn1.js → FilesTab-BjztpSdj.js} +2 -2
- package/public/assets/{GitChangesTab-ofjovmv2.js → GitChangesTab-B9XraSoR.js} +2 -2
- package/public/assets/{SplitFilePanel-CyoPkcLd.js → SplitFilePanel-Cu_5-Z-E.js} +1 -1
- package/public/assets/StatusTab-D_IE79r-.js +1 -0
- package/public/assets/{align-justify-Bcf1-ZOl.js → align-justify-BKS9gyRk.js} +1 -1
- package/public/assets/{bundle-full-D5dzvToA.js → bundle-full-CXGXXlzR.js} +1 -1
- package/public/assets/{diff-viewer-DViXCI-4.js → diff-viewer-CSNOYoEB.js} +1 -1
- package/public/assets/{git-diff-vendor-CSgooKT_.js → git-diff-vendor-CYS3ApzA.js} +1 -1
- package/public/assets/index-B3YjNCh4.js +1 -0
- package/public/assets/index-B3ZD2_SU.js +1 -0
- package/public/assets/index-Bh2ofaQo.js +1 -0
- package/public/assets/index-CM0c9xRZ.js +1 -0
- package/public/assets/index-CdDxouJl.js +2 -0
- package/public/assets/index-D06Y2cFq.js +1 -0
- package/public/assets/{index-lf4nUOU1.js → index-DVc4ls8c.js} +1 -1
- package/public/assets/index-PmE51vPh.js +1 -0
- package/public/assets/{index-BMvFMsuy.css → index-Qj63IiSj.css} +1 -1
- package/public/assets/index-VY_zwmsG.js +1 -0
- package/public/assets/index-qiiH7egV.js +1 -0
- package/public/assets/{index-UbL8tz_V.js → index-sLe9hEfQ.js} +1 -1
- package/public/assets/{loading-CZ_tt3h0.js → loading-CDmt9OJU.js} +1 -1
- package/public/assets/main-CTN6Wwz1.js +68 -0
- package/public/assets/{markdown-G11aN6hz.js → markdown-1ZLSxCFT.js} +55 -44
- package/public/assets/monaco-viewer-D6JgH76W.js +26 -0
- package/public/assets/{tool-call-BsSXWErm.js → tool-call-CyXb63LH.js} +32 -32
- package/public/assets/{unified-picker-BRNI3UvE.js → unified-picker-DCCdSVwI.js} +1 -1
- package/public/assets/{wrap-text-B7up-uv7.js → wrap-text-pNMdTIq3.js} +1 -1
- package/public/index.html +5 -5
- package/public/loading.html +5 -5
- package/public/sw.js +1 -1
- package/public/assets/StatusTab-Bgu1Fh24.js +0 -1
- package/public/assets/index-3KsjbWGP.js +0 -1
- package/public/assets/index-B0WK8-cF.js +0 -1
- package/public/assets/index-BDv_iVtj.js +0 -1
- package/public/assets/index-BjxZvyb9.js +0 -2
- package/public/assets/index-BleKf9Nj.js +0 -1
- package/public/assets/index-CiIQ43NW.js +0 -1
- package/public/assets/index-DBquqL6Q.js +0 -1
- package/public/assets/index-yf9zolv4.js +0 -1
- package/public/assets/index-ypaL7i_s.js +0 -1
- package/public/assets/main-CAkg_fp_.js +0 -68
- package/public/assets/monaco-viewer-CZefBfct.js +0 -26
package/dist/workspaces/spawn.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { spawnSync } from "child_process";
|
|
2
|
+
import { statSync } from "fs";
|
|
2
3
|
import path from "path";
|
|
3
4
|
export const WINDOWS_CMD_EXTENSIONS = new Set([".cmd", ".bat"]);
|
|
4
5
|
export const WINDOWS_POWERSHELL_EXTENSIONS = new Set([".ps1"]);
|
|
@@ -9,6 +10,21 @@ const WSL_PLUGIN_PATH_ENV = "CODENOMAD_OPENCODE_PLUGIN_WSL_PATH";
|
|
|
9
10
|
const WSL_PLUGIN_PATH_PLACEHOLDER = "__CODENOMAD_OPENCODE_PLUGIN_WSL_PATH__";
|
|
10
11
|
const CODENOMAD_PLUGIN_FILE_SPEC_REGEX = new RegExp(`(${escapeRegex(CODENOMAD_PLUGIN_PACKAGE_NAME)}@file:)([A-Za-z]:[^"\\r\\n]+?\\.tgz)`);
|
|
11
12
|
const WSL_PATH_ENV_KEYS = new Set(["NODE_EXTRA_CA_CERTS", WSL_PLUGIN_PATH_ENV]);
|
|
13
|
+
const WINDOWS_DIRECT_EXTENSIONS = new Set([".com", ".exe"]);
|
|
14
|
+
const DEFAULT_WINDOWS_PATHEXT = ".COM;.EXE;.BAT;.CMD";
|
|
15
|
+
const WINDOWS_SHELL_NAMES = new Set([
|
|
16
|
+
"bash",
|
|
17
|
+
"bash.exe",
|
|
18
|
+
"cmd",
|
|
19
|
+
"cmd.exe",
|
|
20
|
+
"command.com",
|
|
21
|
+
"powershell",
|
|
22
|
+
"powershell.exe",
|
|
23
|
+
"pwsh",
|
|
24
|
+
"pwsh.exe",
|
|
25
|
+
"sh",
|
|
26
|
+
"sh.exe",
|
|
27
|
+
]);
|
|
12
28
|
export function parseWslUncPath(input) {
|
|
13
29
|
const normalized = input.trim().replace(/\//g, "\\");
|
|
14
30
|
const match = normalized.match(WSL_UNC_PATH_REGEX);
|
|
@@ -36,15 +52,19 @@ export function buildWindowsSpawnSpec(binaryPath, args, options = {}) {
|
|
|
36
52
|
if (wslPath) {
|
|
37
53
|
return buildWslSpawnSpec(wslPath, args, options);
|
|
38
54
|
}
|
|
39
|
-
const
|
|
55
|
+
const resolvedBinaryPath = resolveBareWindowsCommand(binaryPath, options) ?? binaryPath;
|
|
56
|
+
const extension = path.win32.extname(resolvedBinaryPath).toLowerCase();
|
|
40
57
|
if (WINDOWS_CMD_EXTENSIONS.has(extension)) {
|
|
41
|
-
const comspec =
|
|
58
|
+
const comspec = getWindowsEnvironmentValue(options.env, "COMSPEC") ??
|
|
59
|
+
getWindowsEnvironmentValue(process.env, "COMSPEC") ??
|
|
60
|
+
"cmd.exe";
|
|
42
61
|
// cmd.exe requires the full command as a single string.
|
|
43
62
|
// Using the ""<script> <args>"" pattern ensures paths with spaces are handled.
|
|
44
|
-
const commandLine = `""${
|
|
63
|
+
const commandLine = `""${resolvedBinaryPath}" ${args.join(" ")}"`;
|
|
45
64
|
return {
|
|
46
65
|
command: comspec,
|
|
47
66
|
args: ["/d", "/s", "/c", commandLine],
|
|
67
|
+
processKind: "windows-wrapper",
|
|
48
68
|
options: { windowsVerbatimArguments: true },
|
|
49
69
|
cwd: options.cwd,
|
|
50
70
|
env: options.env,
|
|
@@ -54,25 +74,28 @@ export function buildWindowsSpawnSpec(binaryPath, args, options = {}) {
|
|
|
54
74
|
// powershell.exe ships with Windows. (pwsh may not.)
|
|
55
75
|
return {
|
|
56
76
|
command: "powershell.exe",
|
|
57
|
-
args: ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File",
|
|
77
|
+
args: ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", resolvedBinaryPath, ...args],
|
|
78
|
+
processKind: "windows-wrapper",
|
|
58
79
|
options: {},
|
|
59
80
|
cwd: options.cwd,
|
|
60
81
|
env: options.env,
|
|
61
82
|
};
|
|
62
83
|
}
|
|
63
84
|
return {
|
|
64
|
-
command:
|
|
85
|
+
command: resolvedBinaryPath,
|
|
65
86
|
args,
|
|
87
|
+
processKind: classifyWindowsCommand(resolvedBinaryPath),
|
|
66
88
|
options: {},
|
|
67
89
|
cwd: options.cwd,
|
|
68
90
|
env: options.env,
|
|
69
91
|
};
|
|
70
92
|
}
|
|
71
93
|
export function buildSpawnSpec(binaryPath, args, options = {}) {
|
|
72
|
-
if (process.platform !== "win32") {
|
|
94
|
+
if ((options.platform ?? process.platform) !== "win32") {
|
|
73
95
|
return {
|
|
74
96
|
command: binaryPath,
|
|
75
97
|
args,
|
|
98
|
+
processKind: "posix",
|
|
76
99
|
options: {},
|
|
77
100
|
cwd: options.cwd,
|
|
78
101
|
env: options.env,
|
|
@@ -80,14 +103,6 @@ export function buildSpawnSpec(binaryPath, args, options = {}) {
|
|
|
80
103
|
}
|
|
81
104
|
return buildWindowsSpawnSpec(binaryPath, args, options);
|
|
82
105
|
}
|
|
83
|
-
export function buildWslSignalSpec(distro, linuxPid, signal) {
|
|
84
|
-
return {
|
|
85
|
-
command: "wsl.exe",
|
|
86
|
-
args: ["--distribution", distro, "--exec", "kill", signal === "SIGKILL" ? "-KILL" : "-TERM", String(linuxPid)],
|
|
87
|
-
options: {},
|
|
88
|
-
wsl: { distro },
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
106
|
export function probeBinaryVersion(binaryPath) {
|
|
92
107
|
if (!binaryPath) {
|
|
93
108
|
return { valid: false, error: "Missing binary path" };
|
|
@@ -157,15 +172,71 @@ function buildWslSpawnSpec(wslPath, args, options) {
|
|
|
157
172
|
return {
|
|
158
173
|
command: "wsl.exe",
|
|
159
174
|
args: wslArgs,
|
|
175
|
+
processKind: "wsl",
|
|
160
176
|
options: {},
|
|
161
177
|
env,
|
|
162
178
|
wsl: { distro: wslPath.distro, pidMarker: options.wslPidMarker },
|
|
163
179
|
};
|
|
164
180
|
}
|
|
181
|
+
function classifyWindowsCommand(binaryPath) {
|
|
182
|
+
const commandName = path.win32.basename(binaryPath).toLowerCase();
|
|
183
|
+
if (WINDOWS_SHELL_NAMES.has(commandName)) {
|
|
184
|
+
return "windows-wrapper";
|
|
185
|
+
}
|
|
186
|
+
const extension = path.win32.extname(binaryPath).toLowerCase();
|
|
187
|
+
if (extension) {
|
|
188
|
+
return WINDOWS_DIRECT_EXTENSIONS.has(extension) ? "windows-direct" : "windows-wrapper";
|
|
189
|
+
}
|
|
190
|
+
// Bare commands can resolve to npm/script shims, so keep them on the
|
|
191
|
+
// wrapper path. That path owns cleanup without requiring process discovery.
|
|
192
|
+
return "windows-wrapper";
|
|
193
|
+
}
|
|
194
|
+
function resolveBareWindowsCommand(binaryPath, options) {
|
|
195
|
+
if (!/^[^\\/:]+$/.test(binaryPath) || path.win32.extname(binaryPath))
|
|
196
|
+
return null;
|
|
197
|
+
const env = options.env ?? process.env;
|
|
198
|
+
const cwd = options.cwd ?? process.cwd();
|
|
199
|
+
const pathEntries = (getWindowsEnvironmentValue(env, "PATH") ?? "")
|
|
200
|
+
.split(";")
|
|
201
|
+
.map(unquoteWindowsPathEntry);
|
|
202
|
+
const extensions = (getWindowsEnvironmentValue(env, "PATHEXT") ?? DEFAULT_WINDOWS_PATHEXT)
|
|
203
|
+
.split(";")
|
|
204
|
+
.map((extension) => extension.trim())
|
|
205
|
+
.filter(Boolean)
|
|
206
|
+
.map((extension) => (extension.startsWith(".") ? extension : `.${extension}`).toLowerCase());
|
|
207
|
+
for (const entry of [cwd, ...pathEntries]) {
|
|
208
|
+
const directory = entry
|
|
209
|
+
? path.win32.resolve(cwd, entry)
|
|
210
|
+
: path.win32.resolve(cwd);
|
|
211
|
+
for (const extension of extensions) {
|
|
212
|
+
const candidate = path.win32.join(directory, `${binaryPath}${extension}`);
|
|
213
|
+
try {
|
|
214
|
+
if (statSync(candidate).isFile())
|
|
215
|
+
return candidate;
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
// Continue in Windows PATH/PATHEXT order.
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
function getWindowsEnvironmentValue(env, key) {
|
|
225
|
+
if (!env)
|
|
226
|
+
return undefined;
|
|
227
|
+
const match = Object.keys(env).reverse().find((candidate) => candidate.toUpperCase() === key);
|
|
228
|
+
return match ? env[match] : undefined;
|
|
229
|
+
}
|
|
230
|
+
function unquoteWindowsPathEntry(entry) {
|
|
231
|
+
const trimmed = entry.trim();
|
|
232
|
+
return trimmed.length >= 2 && trimmed.startsWith('"') && trimmed.endsWith('"')
|
|
233
|
+
? trimmed.slice(1, -1)
|
|
234
|
+
: trimmed;
|
|
235
|
+
}
|
|
165
236
|
function buildWslLaunchScript(workingDirectory, pidMarker, translatePluginPath) {
|
|
166
237
|
const steps = [];
|
|
167
238
|
if (pidMarker) {
|
|
168
|
-
steps.push(`printf '%s%s\\n' '${pidMarker}' "$$"`);
|
|
239
|
+
steps.push(`codenomad_pgid=$(ps -o pgid= -p "$$" 2>/dev/null | tr -d '[:space:]'); codenomad_start=$(awk '{print $22}' "/proc/$$/stat" 2>/dev/null); codenomad_boot=$(cat /proc/sys/kernel/random/boot_id 2>/dev/null); test -n "$codenomad_pgid" && test -n "$codenomad_start" && test -n "$codenomad_boot" && printf '%s%s:%s:%s:%s\\n' '${pidMarker}' "$$" "$codenomad_pgid" "$codenomad_start" "$codenomad_boot"`);
|
|
169
240
|
}
|
|
170
241
|
if (workingDirectory?.kind === "linux") {
|
|
171
242
|
steps.push('cd "$1"');
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-
|
|
2
|
-
import{a6 as J,m,t as h,i as s,d as u,a as C,u as U,_ as X,f as Y}from"./monaco-viewer-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-D6JgH76W.js","assets/git-diff-vendor-CYS3ApzA.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{a6 as J,m,t as h,i as s,d as u,a as C,u as U,_ as X,f as Y}from"./monaco-viewer-D6JgH76W.js";import{d as K,b as P,c as $,n as o,S as g,a as w,z as Z,A as p,F as ee}from"./git-diff-vendor-CYS3ApzA.js";import{S as te}from"./SplitFilePanel-Cu_5-Z-E.js";import{R as O,O as le,M as ne,Q as re,C as ae,e as ie,T as se}from"./main-CTN6Wwz1.js";import{W as oe}from"./wrap-text-pNMdTIq3.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./index-CdDxouJl.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>"),V=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(()=>X(()=>import("./monaco-viewer-D6JgH76W.js").then(e=>e.as),__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 n=W(),i=H();return n?i.filter(d=>String(d.name||"").toLowerCase().includes(n)):i}),y=()=>e.browserLoading()&&e.browserEntries()===null,j=()=>W()?e.t("instanceShell.filesShell.search.empty"):e.t("instanceShell.filesShell.listEmpty"),_=$(()=>_e(e.browserSelectedPath())),S=$(()=>_()&&N());P(()=>{_()||M(!1)});const T=()=>{const n=e.browserSelectedContent();n!=null&&e.onSave(n)},B=async(n,i)=>{i==null||i.stopPropagation();const d=await ie(n);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 n=ce(),i=n.firstChild,d=i.firstChild,l=d.nextSibling;return s(d,o(re,{class:"w-4 h-4"})),l.$$input=t=>L(t.currentTarget.value),w(t=>{var a=e.t("instanceShell.filesShell.search.placeholder"),r=e.t("instanceShell.filesShell.search.ariaLabel");return a!==t.e&&u(l,"placeholder",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),t},{e:void 0,t:void 0}),w(()=>l.value=E()),n})(),(()=>{var n=de(),i=n.firstChild,d=i.nextSibling;return s(i,()=>e.t("instanceShell.filesShell.fileListTitle")),s(d,()=>k().length),n})(),o(g,{get when(){return e.parentPath()},children:n=>(()=>{var i=he(),d=i.firstChild,l=d.firstChild;return i.$$click=()=>e.onLoadEntries(n()),w(()=>u(l,"title",n())),i})()}),o(g,{get when(){return y()},get children(){var n=V();return s(n,()=>e.t("instanceInfo.loading")),n}}),o(g,{get when(){return m(()=>!e.browserError()&&!y())()&&k().length>0},get fallback(){return m(()=>!y())()?m(()=>!!e.browserError())()?(()=>{var n=ue();return s(n,()=>e.browserError()),n})():(()=>{var n=V();return s(n,j),n})():void 0},get children(){return o(ee,{get each(){return k()},children:n=>(()=>{var i=ve(),d=i.firstChild,l=d.firstChild,t=l.firstChild,a=l.nextSibling,r=a.firstChild,c=r.firstChild,f=r.nextSibling;return i.$$click=()=>{if(n.type==="directory"){e.onLoadEntries(n.path);return}e.onRequestOpenFile(n.path)},s(t,()=>n.name),s(c,()=>n.type),f.$$click=v=>void B(n.path,v),s(f,o(ae,{class:"w-3 h-3"})),w(v=>{var F=`file-list-item ${e.browserSelectedPath()===n.path?"file-list-item-active":""}`,z=n.path,R=n.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})()})}})],G=n=>{!(n.ctrlKey||n.metaKey)||n.key.toLowerCase()!=="s"||e.browserSelectedSaving()||!e.browserSelectedDirty()||(n.preventDefault(),T())};return m(()=>{const n=()=>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(),r=a.firstChild;return s(r,i),a})()},children:a=>o(g,{get when(){return S()},get fallback(){return o(Z,{get fallback(){return(()=>{var r=x(),c=r.firstChild;return s(c,()=>e.t("instanceInfo.loading")),r})()},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 r=ge();r.$$mousedown=()=>b==null?void 0:b.focus(),r.$$keydown=G;var c=b;return typeof c=="function"?U(c,r):b=r,s(r,o(ne,{get part(){return{type:"text",text:a().content}},get isDark(){return q()},escapeRawHtml:!0})),r}})})},children:a=>(()=>{var r=x(),c=r.firstChild;return s(c,a),r})()})},get children(){var a=x(),r=a.firstChild;return s(r,()=>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,r=a.firstChild;return s(r,n),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",n())),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":""}`,r=!_();return a!==t.e&&C(l,t.e=a),r!==t.t&&(l.disabled=t.t=r),t},{e:void 0,t:void 0}),l})(),(()=>{var l=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":""}`,r=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),c=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),f=S();return a!==t.e&&C(l,t.e=a),r!==t.t&&u(l,"title",t.t=r),c!==t.a&&u(l,"aria-label",t.a=c),f!==t.o&&(l.disabled=t.o=f),t},{e:void 0,t:void 0,a:void 0,o:void 0}),l})(),(()=>{var l=Q();return l.$$click=T,s(l,o(g,{get when(){return e.browserSelectedSaving()},get fallback(){return o(le,{class:"h-4 w-4"})},get children(){return o(O,{class:"h-4 w-4 animate-spin"})}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",r=e.t("instanceShell.rightPanel.actions.save")||"Save",c=e.browserSelectedSaving()||!e.browserSelectedDirty();return a!==t.e&&u(l,"title",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})(),(()=>{var l=Q();return l.$$click=()=>e.onRefresh(),s(l,o(O,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.refresh"),r=e.t("instanceShell.rightPanel.actions.refresh"),c=e.browserLoading();return a!==t.e&&u(l,"title",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})()]},list:{panel:()=>o(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")}})})};Y(["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-
|
|
2
|
-
import{t as u,i as n,m as D,d as g,a as q,f as ae,h as ee,_ as re}from"./monaco-viewer-CZefBfct.js";import{n as i,m as ce,a as P,c as b,S as k,F as te,z as oe,A as de}from"./git-diff-vendor-CSgooKT_.js";import{u as he}from"./index-BjxZvyb9.js";import{I as ge,S as ue,G as fe,H as ve,R as me,J as ne,K as ie,N as be}from"./main-CAkg_fp_.js";import{A as $e}from"./align-justify-Bcf1-ZOl.js";import{W as Ce}from"./wrap-text-B7up-uv7.js";import{S as we}from"./SplitFilePanel-CyoPkcLd.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const _e=[["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"}]],Se=e=>i(ge,ce(e,{name:"UnfoldVertical",iconNode:_e}));var ye=u("<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 xe=e=>{const{t:S}=he(),L=()=>e.viewMode==="split"?"unified":"split",V=()=>e.contextMode==="collapsed"?"expanded":"collapsed",O=()=>e.wordWrapMode==="on"?"off":"on",w=()=>L()==="split"?S("instanceShell.diff.switchToSplit"):S("instanceShell.diff.switchToUnified"),K=()=>V()==="collapsed"?S("instanceShell.diff.hideUnchanged"):S("instanceShell.diff.showFull"),B=()=>O()==="on"?S("instanceShell.diff.enableWordWrap"):S("instanceShell.diff.disableWordWrap");return(()=>{var U=ye(),T=U.firstChild,E=T.nextSibling,I=E.nextSibling;return T.$$click=()=>e.onViewModeChange(L()),n(T,(()=>{var c=D(()=>L()==="split");return()=>c()?i(ue,{class:"h-4 w-4","aria-hidden":"true"}):i($e,{class:"h-4 w-4","aria-hidden":"true"})})()),E.$$click=()=>e.onContextModeChange(V()),n(E,(()=>{var c=D(()=>V()==="collapsed");return()=>c()?i(fe,{class:"h-4 w-4","aria-hidden":"true"}):i(Se,{class:"h-4 w-4","aria-hidden":"true"})})()),I.$$click=()=>e.onWordWrapModeChange(O()),n(I,i(Ce,{class:"h-4 w-4","aria-hidden":"true"})),P(c=>{var N=w(),o=w(),d=K(),y=K(),x=`file-viewer-toolbar-icon-button${e.wordWrapMode==="on"?" active":""}`,W=B(),G=B();return N!==c.e&&g(T,"aria-label",c.e=N),o!==c.t&&g(T,"title",c.t=o),d!==c.a&&g(E,"aria-label",c.a=d),y!==c.o&&g(E,"title",c.o=y),x!==c.i&&q(I,c.i=x),W!==c.n&&g(I,"aria-label",c.n=W),G!==c.s&&g(I,"title",c.s=G),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),U})()};ae(["click"]);var H=u("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Me=u('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),ke=u('<div class="p-3 text-xs text-secondary">'),Ie=u('<span class="git-change-row-action-bar git-change-row-action-bar-vertical">'),We=u('<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">'),Le=u("<div class=git-change-section-items>"),Ve=u("<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>"),Te=u('<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">'),Ee=u("<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>"),Ae=u('<span class="status-indicator session-status-list worktree-indicator git-change-section-badge"><span class=worktree-indicator-label>'),Pe=u("<span class=files-tab-selected-path><span class=file-path-text>"),Re=u('<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>-'),ze=u("<button type=button class=files-header-icon-button style=margin-left:auto>"),De=u("<span class=text-error>");const Be=de(()=>re(()=>import("./monaco-viewer-CZefBfct.js").then(e=>e.at),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),je=e=>{const S=b(()=>e.activeSessionId()),L=b(()=>!!(S()&&S()!=="info")),V=b(()=>L()?e.entries():null),O=b(()=>{const o=V();return Array.isArray(o)?[...o].sort((d,y)=>String(d.path||"").localeCompare(String(y.path||""))):[]}),w=b(()=>ve(O())),K=b(()=>w().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})),B=b(()=>w().filter(o=>o.section==="staged")),U=b(()=>w().filter(o=>o.section==="unstaged")),T=b(()=>B().length>0&&e.commitMessage().trim().length>0&&!e.commitSubmitting()),E=b(()=>{const o=w(),d=e.selectedItemId(),y=e.mostChangedItemId(),x=o.find(W=>W.id===d)||(y?o.find(W=>W.id===y):void 0);return(x==null?void 0:x.entry)??null}),I=b(()=>L()?V()===null?e.t("instanceShell.gitChanges.loading"):w().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected")),c=b(()=>e.selectedError()===e.t("instanceShell.gitChanges.binaryViewer"));return D(()=>{const o=K(),d=E(),y=w(),x=B(),W=U(),G=()=>(()=>{var t=Me(),r=t.firstChild;return n(r,i(k,{get when(){return e.selectedLoading()},get fallback(){return i(k,{get when(){return e.selectedError()},get fallback(){return i(k,{get when(){return D(()=>!!(d&&e.selectedBefore()!==null&&e.selectedAfter()!==null))()?{path:d.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var a=H(),s=a.firstChild;return n(s,I),a})()},children:a=>i(oe,{get fallback(){return(()=>{var s=H(),l=s.firstChild;return n(l,()=>e.t("instanceInfo.loading")),s})()},get children(){return i(Be,{get scopeKey(){return e.scopeKey()},get path(){return String(a().path||"")},get before(){return String(a().before||"")},get after(){return String(a().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 c()?void 0:s=>{const l=e.selectedItemId();if(!l)return;const f=w().find(v=>v.id===l);f&&e.onInsertContext(f,s)}}})}})})},children:a=>(()=>{var s=H(),l=s.firstChild;return n(l,a),s})()})},get children(){var a=H(),s=a.firstChild;return n(s,()=>e.t("instanceInfo.loading")),a}})),t})(),le=()=>(()=>{var t=ke();return n(t,I),t})(),J=t=>{const r=b(()=>e.selectedBulkItemIds().has(t.id)),a=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 l=We(),f=l.firstChild,v=f.firstChild,R=v.firstChild,$=v.nextSibling,_=$.firstChild,C=_.firstChild;C.firstChild;var M=C.nextSibling;M.firstChild;var F=f.nextSibling,m=F.firstChild,A=m.firstChild,z=A.firstChild;return z.firstChild,l.$$click=h=>e.onRowClick(t,h),l.$$mousedown=h=>{(h.shiftKey||h.ctrlKey||h.metaKey)&&h.preventDefault()},n(R,()=>t.path),n(C,()=>t.additions,null),n(M,()=>t.deletions,null),A.$$click=h=>{h.stopPropagation(),s()},g(A,"title",a),g(A,"aria-label",a),n(z,i(k,{get when(){return t.section!=="staged"},get children(){return Ie()}}),null),P(h=>{var Q=`file-list-item git-change-list-item ${e.selectedItemId()===t.id?"file-list-item-active":""} ${r()?"git-change-list-item-bulk-selected":""}`,X=t.path,Y=t.path,Z=t.path,p=`git-change-row-action-glyph ${t.section==="staged"?"git-change-row-action-glyph-minus":"git-change-row-action-glyph-plus"}`;return Q!==h.e&&q(l,h.e=Q),X!==h.t&&g(l,"title",h.t=X),Y!==h.a&&g(f,"title",h.a=Y),Z!==h.o&&g(v,"title",h.o=Z),p!==h.i&&q(z,h.i=p),h},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),l})()},se=(t,r,a,s)=>(()=>{var l=Ve(),f=l.firstChild,v=f.firstChild,R=v.firstChild,$=R.nextSibling,_=v.nextSibling;return ee(f,"click",s,!0),n(R,a?i(ne,{class:"h-3.5 w-3.5"}):i(ie,{class:"h-3.5 w-3.5"})),n($,t),n(_,()=>r.length),n(l,i(k,{when:a,get children(){var C=Le();return n(C,i(te,{each:r,children:M=>J(M)})),C}}),null),l})(),j=()=>i(k,{get when(){return y.length>0},get fallback(){return le()},get children(){var t=Ee(),r=t.firstChild,a=r.firstChild,s=a.firstChild,l=s.firstChild,f=l.nextSibling,v=f.firstChild,R=s.nextSibling;return ee(a,"click",e.onToggleStagedOpen,!0),n(l,(()=>{var $=D(()=>!!e.stagedOpen());return()=>$()?i(ne,{class:"h-3.5 w-3.5"}):i(ie,{class:"h-3.5 w-3.5"})})()),n(v,()=>e.t("instanceShell.gitChanges.sections.staged")),n(f,i(k,{get when(){return e.branchLabel()},children:$=>(()=>{var _=Ae(),C=_.firstChild;return n(_,i(be,{class:"w-3.5 h-3.5","aria-hidden":"true"}),C),n(C,$),P(()=>g(_,"title",`Branch: ${$()}`)),_})()}),null),n(R,()=>x.length),n(r,i(k,{get when(){return e.stagedOpen()},get children(){var $=Te(),_=$.firstChild,C=_.firstChild,M=C.firstChild,F=M.nextSibling;return M.$$input=m=>e.onCommitMessageInput(m.currentTarget.value),F.$$click=()=>e.onSubmitCommit(),n(F,(()=>{var m=D(()=>!!e.commitSubmitting());return()=>m()?e.t("instanceShell.gitChanges.commit.submitting"):e.t("instanceShell.gitChanges.commit.submit")})()),n($,i(te,{each:x,children:m=>J(m)}),null),P(m=>{var A=e.t("instanceShell.gitChanges.commit.placeholder"),z=!T();return A!==m.e&&g(M,"placeholder",m.e=A),z!==m.t&&(F.disabled=m.t=z),m},{e:void 0,t:void 0}),P(()=>M.value=e.commitMessage()),$}}),null),n(t,()=>se(e.t("instanceShell.gitChanges.sections.unstaged"),W,e.unstagedOpen(),e.onToggleUnstagedOpen),null),t}});return i(we,{get header(){return[(()=>{var t=Pe(),r=t.firstChild;return n(r,()=>(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),P(()=>g(t,"title",(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=Re(),r=t.firstChild,a=r.firstChild;a.firstChild;var s=r.nextSibling,l=s.firstChild;return l.firstChild,n(a,()=>o.additions,null),n(l,()=>o.deletions,null),n(t,i(k,{get when(){return e.statusError()},children:f=>(()=>{var v=De();return n(v,f),v})()}),null),t})(),(()=>{var t=ze();return t.$$click=()=>e.onRefresh(),n(t,i(me,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),P(r=>{var a=e.t("instanceShell.rightPanel.actions.refresh"),s=e.t("instanceShell.rightPanel.actions.refresh"),l=!L()||e.statusLoading()||V()===null;return a!==r.e&&g(t,"title",r.e=a),s!==r.t&&g(t,"aria-label",r.t=s),l!==r.a&&(t.disabled=r.a=l),r},{e:void 0,t:void 0,a:void 0}),t})(),i(xe,{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:j,overlay:j},get viewer(){return G()},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")}})})};ae(["mousedown","click","input"]);export{je as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-D6JgH76W.js","assets/git-diff-vendor-CYS3ApzA.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{t as u,i as n,m as D,d as g,a as q,f as ae,h as ee,_ as re}from"./monaco-viewer-D6JgH76W.js";import{n as i,m as ce,a as P,c as b,S as k,F as te,z as oe,A as de}from"./git-diff-vendor-CYS3ApzA.js";import{u as he}from"./index-CdDxouJl.js";import{I as ge,S as ue,G as fe,H as ve,R as me,J as ne,K as ie,N as be}from"./main-CTN6Wwz1.js";import{A as $e}from"./align-justify-BKS9gyRk.js";import{W as Ce}from"./wrap-text-pNMdTIq3.js";import{S as we}from"./SplitFilePanel-Cu_5-Z-E.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const _e=[["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"}]],Se=e=>i(ge,ce(e,{name:"UnfoldVertical",iconNode:_e}));var ye=u("<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 xe=e=>{const{t:S}=he(),L=()=>e.viewMode==="split"?"unified":"split",V=()=>e.contextMode==="collapsed"?"expanded":"collapsed",O=()=>e.wordWrapMode==="on"?"off":"on",w=()=>L()==="split"?S("instanceShell.diff.switchToSplit"):S("instanceShell.diff.switchToUnified"),K=()=>V()==="collapsed"?S("instanceShell.diff.hideUnchanged"):S("instanceShell.diff.showFull"),B=()=>O()==="on"?S("instanceShell.diff.enableWordWrap"):S("instanceShell.diff.disableWordWrap");return(()=>{var U=ye(),T=U.firstChild,E=T.nextSibling,I=E.nextSibling;return T.$$click=()=>e.onViewModeChange(L()),n(T,(()=>{var c=D(()=>L()==="split");return()=>c()?i(ue,{class:"h-4 w-4","aria-hidden":"true"}):i($e,{class:"h-4 w-4","aria-hidden":"true"})})()),E.$$click=()=>e.onContextModeChange(V()),n(E,(()=>{var c=D(()=>V()==="collapsed");return()=>c()?i(fe,{class:"h-4 w-4","aria-hidden":"true"}):i(Se,{class:"h-4 w-4","aria-hidden":"true"})})()),I.$$click=()=>e.onWordWrapModeChange(O()),n(I,i(Ce,{class:"h-4 w-4","aria-hidden":"true"})),P(c=>{var N=w(),o=w(),d=K(),y=K(),x=`file-viewer-toolbar-icon-button${e.wordWrapMode==="on"?" active":""}`,W=B(),G=B();return N!==c.e&&g(T,"aria-label",c.e=N),o!==c.t&&g(T,"title",c.t=o),d!==c.a&&g(E,"aria-label",c.a=d),y!==c.o&&g(E,"title",c.o=y),x!==c.i&&q(I,c.i=x),W!==c.n&&g(I,"aria-label",c.n=W),G!==c.s&&g(I,"title",c.s=G),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),U})()};ae(["click"]);var H=u("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Me=u('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),ke=u('<div class="p-3 text-xs text-secondary">'),Ie=u('<span class="git-change-row-action-bar git-change-row-action-bar-vertical">'),We=u('<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">'),Le=u("<div class=git-change-section-items>"),Ve=u("<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>"),Te=u('<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">'),Ee=u("<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>"),Ae=u('<span class="status-indicator session-status-list worktree-indicator git-change-section-badge"><span class=worktree-indicator-label>'),Pe=u("<span class=files-tab-selected-path><span class=file-path-text>"),Re=u('<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>-'),ze=u("<button type=button class=files-header-icon-button style=margin-left:auto>"),De=u("<span class=text-error>");const Be=de(()=>re(()=>import("./monaco-viewer-D6JgH76W.js").then(e=>e.at),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),je=e=>{const S=b(()=>e.activeSessionId()),L=b(()=>!!(S()&&S()!=="info")),V=b(()=>L()?e.entries():null),O=b(()=>{const o=V();return Array.isArray(o)?[...o].sort((d,y)=>String(d.path||"").localeCompare(String(y.path||""))):[]}),w=b(()=>ve(O())),K=b(()=>w().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})),B=b(()=>w().filter(o=>o.section==="staged")),U=b(()=>w().filter(o=>o.section==="unstaged")),T=b(()=>B().length>0&&e.commitMessage().trim().length>0&&!e.commitSubmitting()),E=b(()=>{const o=w(),d=e.selectedItemId(),y=e.mostChangedItemId(),x=o.find(W=>W.id===d)||(y?o.find(W=>W.id===y):void 0);return(x==null?void 0:x.entry)??null}),I=b(()=>L()?V()===null?e.t("instanceShell.gitChanges.loading"):w().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected")),c=b(()=>e.selectedError()===e.t("instanceShell.gitChanges.binaryViewer"));return D(()=>{const o=K(),d=E(),y=w(),x=B(),W=U(),G=()=>(()=>{var t=Me(),r=t.firstChild;return n(r,i(k,{get when(){return e.selectedLoading()},get fallback(){return i(k,{get when(){return e.selectedError()},get fallback(){return i(k,{get when(){return D(()=>!!(d&&e.selectedBefore()!==null&&e.selectedAfter()!==null))()?{path:d.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var a=H(),s=a.firstChild;return n(s,I),a})()},children:a=>i(oe,{get fallback(){return(()=>{var s=H(),l=s.firstChild;return n(l,()=>e.t("instanceInfo.loading")),s})()},get children(){return i(Be,{get scopeKey(){return e.scopeKey()},get path(){return String(a().path||"")},get before(){return String(a().before||"")},get after(){return String(a().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 c()?void 0:s=>{const l=e.selectedItemId();if(!l)return;const f=w().find(v=>v.id===l);f&&e.onInsertContext(f,s)}}})}})})},children:a=>(()=>{var s=H(),l=s.firstChild;return n(l,a),s})()})},get children(){var a=H(),s=a.firstChild;return n(s,()=>e.t("instanceInfo.loading")),a}})),t})(),le=()=>(()=>{var t=ke();return n(t,I),t})(),J=t=>{const r=b(()=>e.selectedBulkItemIds().has(t.id)),a=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 l=We(),f=l.firstChild,v=f.firstChild,R=v.firstChild,$=v.nextSibling,_=$.firstChild,C=_.firstChild;C.firstChild;var M=C.nextSibling;M.firstChild;var F=f.nextSibling,m=F.firstChild,A=m.firstChild,z=A.firstChild;return z.firstChild,l.$$click=h=>e.onRowClick(t,h),l.$$mousedown=h=>{(h.shiftKey||h.ctrlKey||h.metaKey)&&h.preventDefault()},n(R,()=>t.path),n(C,()=>t.additions,null),n(M,()=>t.deletions,null),A.$$click=h=>{h.stopPropagation(),s()},g(A,"title",a),g(A,"aria-label",a),n(z,i(k,{get when(){return t.section!=="staged"},get children(){return Ie()}}),null),P(h=>{var Q=`file-list-item git-change-list-item ${e.selectedItemId()===t.id?"file-list-item-active":""} ${r()?"git-change-list-item-bulk-selected":""}`,X=t.path,Y=t.path,Z=t.path,p=`git-change-row-action-glyph ${t.section==="staged"?"git-change-row-action-glyph-minus":"git-change-row-action-glyph-plus"}`;return Q!==h.e&&q(l,h.e=Q),X!==h.t&&g(l,"title",h.t=X),Y!==h.a&&g(f,"title",h.a=Y),Z!==h.o&&g(v,"title",h.o=Z),p!==h.i&&q(z,h.i=p),h},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),l})()},se=(t,r,a,s)=>(()=>{var l=Ve(),f=l.firstChild,v=f.firstChild,R=v.firstChild,$=R.nextSibling,_=v.nextSibling;return ee(f,"click",s,!0),n(R,a?i(ne,{class:"h-3.5 w-3.5"}):i(ie,{class:"h-3.5 w-3.5"})),n($,t),n(_,()=>r.length),n(l,i(k,{when:a,get children(){var C=Le();return n(C,i(te,{each:r,children:M=>J(M)})),C}}),null),l})(),j=()=>i(k,{get when(){return y.length>0},get fallback(){return le()},get children(){var t=Ee(),r=t.firstChild,a=r.firstChild,s=a.firstChild,l=s.firstChild,f=l.nextSibling,v=f.firstChild,R=s.nextSibling;return ee(a,"click",e.onToggleStagedOpen,!0),n(l,(()=>{var $=D(()=>!!e.stagedOpen());return()=>$()?i(ne,{class:"h-3.5 w-3.5"}):i(ie,{class:"h-3.5 w-3.5"})})()),n(v,()=>e.t("instanceShell.gitChanges.sections.staged")),n(f,i(k,{get when(){return e.branchLabel()},children:$=>(()=>{var _=Ae(),C=_.firstChild;return n(_,i(be,{class:"w-3.5 h-3.5","aria-hidden":"true"}),C),n(C,$),P(()=>g(_,"title",`Branch: ${$()}`)),_})()}),null),n(R,()=>x.length),n(r,i(k,{get when(){return e.stagedOpen()},get children(){var $=Te(),_=$.firstChild,C=_.firstChild,M=C.firstChild,F=M.nextSibling;return M.$$input=m=>e.onCommitMessageInput(m.currentTarget.value),F.$$click=()=>e.onSubmitCommit(),n(F,(()=>{var m=D(()=>!!e.commitSubmitting());return()=>m()?e.t("instanceShell.gitChanges.commit.submitting"):e.t("instanceShell.gitChanges.commit.submit")})()),n($,i(te,{each:x,children:m=>J(m)}),null),P(m=>{var A=e.t("instanceShell.gitChanges.commit.placeholder"),z=!T();return A!==m.e&&g(M,"placeholder",m.e=A),z!==m.t&&(F.disabled=m.t=z),m},{e:void 0,t:void 0}),P(()=>M.value=e.commitMessage()),$}}),null),n(t,()=>se(e.t("instanceShell.gitChanges.sections.unstaged"),W,e.unstagedOpen(),e.onToggleUnstagedOpen),null),t}});return i(we,{get header(){return[(()=>{var t=Pe(),r=t.firstChild;return n(r,()=>(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),P(()=>g(t,"title",(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=Re(),r=t.firstChild,a=r.firstChild;a.firstChild;var s=r.nextSibling,l=s.firstChild;return l.firstChild,n(a,()=>o.additions,null),n(l,()=>o.deletions,null),n(t,i(k,{get when(){return e.statusError()},children:f=>(()=>{var v=De();return n(v,f),v})()}),null),t})(),(()=>{var t=ze();return t.$$click=()=>e.onRefresh(),n(t,i(me,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),P(r=>{var a=e.t("instanceShell.rightPanel.actions.refresh"),s=e.t("instanceShell.rightPanel.actions.refresh"),l=!L()||e.statusLoading()||V()===null;return a!==r.e&&g(t,"title",r.e=a),s!==r.t&&g(t,"aria-label",r.t=s),l!==r.a&&(t.disabled=r.a=l),r},{e:void 0,t:void 0,a:void 0}),t})(),i(xe,{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:j,overlay:j},get viewer(){return G()},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")}})})};ae(["mousedown","click","input"]);export{je as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as d,i as l,d as m,h as s,m as b,g as _,f as w}from"./monaco-viewer-
|
|
1
|
+
import{t as d,i as l,d as m,h as s,m as b,g as _,f as w}from"./monaco-viewer-D6JgH76W.js";import{a as g,n as r,S as n}from"./git-diff-vendor-CYS3ApzA.js";import{u as S}from"./index-CdDxouJl.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 ae,P as Ye,M as Ge,t as S,i as u,a as Je,g as ke,d as R,j as Ze,f as Qe}from"./monaco-viewer-D6JgH76W.js";import{n as l,m as D,q as le,s as L,d as F,b as V,o as K,c as I,k as ce,S as E,l as de,t as et,w as Te,a as be,B as tt,F as me}from"./git-diff-vendor-CYS3ApzA.js";import{I as ye,U as Ie,W as z,X as _e,Y as De,Z as ve,_ as nt,$ as pe,a0 as ie,a1 as ue,a2 as Oe,a3 as te,a4 as ne,a5 as ot,a6 as xe,a7 as st,a8 as rt,a9 as j,aa as Ce,ab as it,ac as at,ad as lt,ae as ct,af as W,ag as dt,ah as ut,ai as gt,aj as pt,ak as ht,al as Z,J as ft,am as mt,an as he,ao as vt,ap as bt,aq as yt,ar as xt,as as Ct}from"./main-CTN6Wwz1.js";import{u as Me}from"./index-CdDxouJl.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const wt=[["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"}]],Pt=e=>l(ye,D(e,{name:"BellRing",iconNode:wt})),St=[["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"}]],$t=e=>l(ye,D(e,{name:"TerminalSquare",iconNode:St})),kt=[["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"}]],Tt=e=>l(ye,D(e,{name:"XOctagon",iconNode:kt}));var It={};Ce(It,{Arrow:()=>Ie,Content:()=>Ee,Portal:()=>Ae,Root:()=>Fe,Tooltip:()=>ee,Trigger:()=>Re,useTooltipContext:()=>ge});var Ue=ce();function ge(){const e=de(Ue);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function Ee(e){const n=ge(),g=z({id:n.generateId("content")},e),[d,t]=L(g,["ref","style"]);return V(()=>K(n.registerContentId(t.id))),l(E,{get when(){return n.contentPresent()},get children(){return l(Oe.Positioner,{get children(){return l(ot,D({ref(s){var o=te(r=>{n.setContentRef(r)},d.ref);typeof o=="function"&&o(s)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return xe({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},d.style)},onFocusOutside:s=>s.preventDefault(),onDismiss:()=>n.hideTooltip(!0)},()=>n.dataset(),t))}})}})}function Ae(e){const n=ge();return l(E,{get when(){return n.contentPresent()},get children(){return l(Ye,e)}})}function _t(e,n,g){const d=e.split("-")[0],t=n.getBoundingClientRect(),s=g.getBoundingClientRect(),o=[],r=t.left+t.width/2,c=t.top+t.height/2;switch(d){case"top":o.push([t.left,c]),o.push([s.left,s.bottom]),o.push([s.left,s.top]),o.push([s.right,s.top]),o.push([s.right,s.bottom]),o.push([t.right,c]);break;case"right":o.push([r,t.top]),o.push([s.left,s.top]),o.push([s.right,s.top]),o.push([s.right,s.bottom]),o.push([s.left,s.bottom]),o.push([r,t.bottom]);break;case"bottom":o.push([t.left,c]),o.push([s.left,s.top]),o.push([s.left,s.bottom]),o.push([s.right,s.bottom]),o.push([s.right,s.top]),o.push([t.right,c]);break;case"left":o.push([r,t.top]),o.push([s.right,s.top]),o.push([s.left,s.top]),o.push([s.left,s.bottom]),o.push([s.right,s.bottom]),o.push([r,t.bottom]);break}return o}var X={},Dt=0,Y=!1,N,Q,G;function Fe(e){const n=`tooltip-${le()}`,g=`${++Dt}`,d=z({id:n,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[t,s]=L(d,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let o;const[r,c]=F(),[i,m]=F(),[a,b]=F(),[p,v]=F(s.placement),x=_e({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:y=>{var O;return(O=t.onOpenChange)==null?void 0:O.call(t,y)}}),{present:w}=De({show:()=>t.forceMount||x.isOpen(),element:()=>a()??null}),h=()=>{X[g]=$},P=()=>{for(const y in X)y!==g&&(X[y](!0),delete X[y])},$=(y=!1)=>{y||t.closeDelay&&t.closeDelay<=0?(window.clearTimeout(o),o=void 0,x.close()):o||(o=window.setTimeout(()=>{o=void 0,x.close()},t.closeDelay)),window.clearTimeout(N),N=void 0,t.skipDelayDuration&&t.skipDelayDuration>=0&&(G=window.setTimeout(()=>{window.clearTimeout(G),G=void 0},t.skipDelayDuration)),Y&&(window.clearTimeout(Q),Q=window.setTimeout(()=>{delete X[g],Q=void 0,Y=!1},t.closeDelay))},f=()=>{clearTimeout(o),o=void 0,P(),h(),Y=!0,x.open(),window.clearTimeout(N),N=void 0,window.clearTimeout(Q),Q=void 0,window.clearTimeout(G),G=void 0},B=()=>{P(),h(),!x.isOpen()&&!N&&!Y?N=window.setTimeout(()=>{N=void 0,Y=!0,f()},t.openDelay):x.isOpen()||f()},M=(y=!1)=>{!y&&t.openDelay&&t.openDelay>0&&!o&&!G?B():f()},_=()=>{window.clearTimeout(N),N=void 0,Y=!1},T=()=>{window.clearTimeout(o),o=void 0},A=y=>pe(i(),y)||pe(a(),y),H=y=>{const O=i(),q=a();if(!(!O||!q))return _t(y,O,q)},C=y=>{const O=y.target;if(A(O)){T();return}if(!t.ignoreSafeArea){const q=H(p());if(q&&st(rt(y),q)){T();return}}o||$()};V(()=>{if(!x.isOpen())return;const y=ve();y.addEventListener("pointermove",C,!0),K(()=>{y.removeEventListener("pointermove",C,!0)})}),V(()=>{const y=i();if(!y||!x.isOpen())return;const O=ze=>{const Xe=ze.target;pe(Xe,y)&&$(!0)},q=nt();q.addEventListener("scroll",O,{capture:!0}),K(()=>{q.removeEventListener("scroll",O,{capture:!0})})}),K(()=>{clearTimeout(o),X[g]&&delete X[g]});const U={dataset:I(()=>({"data-expanded":x.isOpen()?"":void 0,"data-closed":x.isOpen()?void 0:""})),isOpen:x.isOpen,isDisabled:()=>t.disabled??!1,triggerOnFocusOnly:()=>t.triggerOnFocusOnly??!1,contentId:r,contentPresent:w,openTooltip:M,hideTooltip:$,cancelOpening:_,generateId:ue(()=>d.id),registerContentId:ie(c),isTargetOnTooltip:A,setTriggerRef:m,setContentRef:b};return l(Ue.Provider,{value:U,get children(){return l(Oe,D({anchorRef:i,contentRef:a,onCurrentPlacementChange:v},s))}})}function Re(e){let n;const g=ge(),[d,t]=L(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let s=!1,o=!1,r=!1;const c=()=>{s=!1},i=()=>{!g.isOpen()&&(o||r)&&g.openTooltip(r)},m=h=>{g.isOpen()&&!o&&!r&&g.hideTooltip(h)},a=h=>{j(h,d.onPointerEnter),!(h.pointerType==="touch"||g.triggerOnFocusOnly()||g.isDisabled()||h.defaultPrevented)&&(o=!0,i())},b=h=>{j(h,d.onPointerLeave),h.pointerType!=="touch"&&(o=!1,r=!1,g.isOpen()?m():g.cancelOpening())},p=h=>{j(h,d.onPointerDown),s=!0,ve(n).addEventListener("pointerup",c,{once:!0})},v=h=>{j(h,d.onClick),o=!1,r=!1,m(!0)},x=h=>{j(h,d.onFocus),!(g.isDisabled()||h.defaultPrevented||s)&&(r=!0,i())},w=h=>{j(h,d.onBlur);const P=h.relatedTarget;g.isTargetOnTooltip(P)||(o=!1,r=!1,m(!0))};return K(()=>{ve(n).removeEventListener("pointerup",c)}),l(ne,D({as:"button",ref(h){var P=te($=>{g.setTriggerRef($),n=$},d.ref);typeof P=="function"&&P(h)},get"aria-describedby"(){return ae(()=>!!g.isOpen())()?g.contentId():void 0},onPointerEnter:a,onPointerLeave:b,onPointerDown:p,onClick:v,onFocus:x,onBlur:w},()=>g.dataset(),t))}var ee=Object.assign(Fe,{Arrow:Ie,Content:Ee,Portal:Ae,Trigger:Re}),Ot={};Ce(Ot,{Collapsible:()=>Mt,Content:()=>we,Root:()=>Pe,Trigger:()=>Se,useCollapsibleContext:()=>oe});var Ke=ce();function oe(){const e=de(Ke);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function we(e){const[n,g]=F(),d=oe(),t=z({id:d.generateId("content")},e),[s,o]=L(t,["ref","id","style"]),{present:r}=De({show:d.shouldMount,element:()=>n()??null}),[c,i]=F(0),[m,a]=F(0);let p=d.isOpen()||r();return et(()=>{const v=requestAnimationFrame(()=>{p=!1});K(()=>{cancelAnimationFrame(v)})}),V(Te(r,()=>{if(!n())return;n().style.transitionDuration="0s",n().style.animationName="none";const v=n().getBoundingClientRect();i(v.height),a(v.width),p||(n().style.transitionDuration="",n().style.animationName="")})),V(Te(d.isOpen,v=>{!v&&n()&&(n().style.transitionDuration="",n().style.animationName="")},{defer:!0})),V(()=>K(d.registerContentId(s.id))),l(E,{get when(){return r()},get children(){return l(ne,D({as:"div",ref(v){var x=te(g,s.ref);typeof x=="function"&&x(v)},get id(){return s.id},get style(){return xe({"--kb-collapsible-content-height":c()?`${c()}px`:void 0,"--kb-collapsible-content-width":m()?`${m()}px`:void 0},s.style)}},()=>d.dataset(),o))}})}function Pe(e){const n=`collapsible-${le()}`,g=z({id:n},e),[d,t]=L(g,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[s,o]=F(),r=_e({open:()=>d.open,defaultOpen:()=>d.defaultOpen,onOpenChange:m=>{var a;return(a=d.onOpenChange)==null?void 0:a.call(d,m)}}),c=I(()=>({"data-expanded":r.isOpen()?"":void 0,"data-closed":r.isOpen()?void 0:"","data-disabled":d.disabled?"":void 0})),i={dataset:c,isOpen:r.isOpen,disabled:()=>d.disabled??!1,shouldMount:()=>d.forceMount||r.isOpen(),contentId:s,toggle:r.toggle,generateId:ue(()=>t.id),registerContentId:ie(o)};return l(Ke.Provider,{value:i,get children(){return l(ne,D({as:"div"},c,t))}})}function Se(e){const n=oe(),[g,d]=L(e,["onClick"]);return l(it,D({get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return ae(()=>!!n.isOpen())()?n.contentId():void 0},get disabled(){return n.disabled()},onClick:s=>{j(s,g.onClick),n.toggle()}},()=>n.dataset(),d))}var Mt=Object.assign(Pe,{Content:we,Trigger:Se}),J={};Ce(J,{Accordion:()=>Ut,Content:()=>He,Header:()=>Ne,Item:()=>We,Root:()=>qe,Trigger:()=>Ve,useAccordionContext:()=>$e});var Le=ce();function Be(){const e=de(Le);if(e===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function He(e){const n=Be(),g=n.generateId("content"),d=z({id:g},e),[t,s]=L(d,["id","style"]);return V(()=>K(n.registerContentId(t.id))),l(we,D({role:"region",get"aria-labelledby"(){return n.triggerId()},get style(){return xe({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},t.style)}},s))}function Ne(e){const n=oe();return l(ne,D({as:"h3"},()=>n.dataset(),e))}var je=ce();function $e(){const e=de(je);if(e===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function We(e){const n=$e(),g=`${n.generateId("item")}-${le()}`,d=z({id:g},e),[t,s]=L(d,["value","disabled"]),[o,r]=F(),[c,i]=F(),m=()=>n.listState().selectionManager(),a=()=>m().isSelected(t.value),b={value:()=>t.value,triggerId:o,contentId:c,generateId:ue(()=>s.id),registerTriggerId:ie(r),registerContentId:ie(i)};return l(Le.Provider,{value:b,get children(){return l(Pe,D({get open(){return a()},get disabled(){return t.disabled}},s))}})}function qe(e){let n;const g=`accordion-${le()}`,d=z({id:g,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[t,s]=L(d,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[o,r]=F([]),{DomCollectionProvider:c}=at({items:o,onItemsChange:r}),i=lt({selectedKeys:()=>t.value,defaultSelectedKeys:()=>t.defaultValue,onSelectionChange:b=>{var p;return(p=t.onChange)==null?void 0:p.call(t,Array.from(b))},disallowEmptySelection:()=>!t.multiple&&!t.collapsible,selectionMode:()=>t.multiple?"multiple":"single",dataSource:o});i.selectionManager().setFocusedKey("item-1");const m=ct({selectionManager:()=>i.selectionManager(),collection:()=>i.collection(),disallowEmptySelection:()=>i.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>t.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>n),a={listState:()=>i,generateId:ue(()=>t.id)};return l(c,{get children(){return l(je.Provider,{value:a,get children(){return l(ne,D({as:"div",get id(){return t.id},ref(b){var p=te(v=>n=v,t.ref);typeof p=="function"&&p(b)},get onKeyDown(){return W([t.onKeyDown,m.onKeyDown])},get onMouseDown(){return W([t.onMouseDown,m.onMouseDown])},get onFocusIn(){return W([t.onFocusIn])},get onFocusOut(){return W([t.onFocusOut,m.onFocusOut])}},s))}})}})}function Ve(e){let n;const g=$e(),d=Be(),t=oe(),s=d.generateId("trigger"),o=z({id:s},e),[r,c]=L(o,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);dt({getItem:()=>({ref:()=>n,type:"item",key:d.value(),textValue:"",disabled:t.disabled()})});const i=ut({key:()=>d.value(),selectionManager:()=>g.listState().selectionManager(),disabled:()=>t.disabled(),shouldSelectOnPressUp:!0},()=>n),m=a=>{["Enter"," "].includes(a.key)&&a.preventDefault(),j(a,r.onKeyDown),j(a,i.onKeyDown)};return V(()=>K(d.registerTriggerId(c.id))),l(Se,D({ref(a){var b=te(p=>n=p,r.ref);typeof b=="function"&&b(a)},get"data-key"(){return i.dataKey()},get onPointerDown(){return W([r.onPointerDown,i.onPointerDown])},get onPointerUp(){return W([r.onPointerUp,i.onPointerUp])},get onClick(){return W([r.onClick,i.onClick])},onKeyDown:m,get onMouseDown(){return W([r.onMouseDown,i.onMouseDown])},get onFocus(){return W([r.onFocus,i.onFocus])}},c))}var Ut=Object.assign(qe,{Content:He,Header:Ne,Item:We,Trigger:Ve}),se=S('<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">'),Et=S('<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 At=e=>{const{t:n}=Me(),{preferences:g}=Ge(),d=I(()=>g().showUsageMetrics??!0),t=I(()=>gt(e.instanceId,e.sessionId)??{cost:0,contextWindow:0,isSubscriptionModel:!1,inputTokens:0,outputTokens:0,reasoningTokens:0,actualUsageTokens:0,modelOutputLimit:0,contextAvailableTokens:null}),s=I(()=>pt(e.instanceId,e.sessionId)),o=I(()=>s().length>0),r=I(()=>o()?ht(e.instanceId,e.sessionId)??{cost:0,inputTokens:0,outputTokens:0,reasoningTokens:0}:{cost:0,inputTokens:0,outputTokens:0,reasoningTokens:0}),c=I(()=>`$${r().cost.toFixed(2)}`),i=I(()=>r().inputTokens),m=I(()=>r().outputTokens),a=I(()=>r().reasoningTokens),b=I(()=>t().inputTokens??0),p=I(()=>t().outputTokens??0),v=I(()=>{const w=t().isSubscriptionModel?0:t().cost;return w>0?w:0}),x=I(()=>`$${v().toFixed(2)}`);return(()=>{var w=Et(),h=w.firstChild,P=h.firstChild,$=P.firstChild,f=$.nextSibling,B=P.nextSibling,M=B.firstChild,_=M.nextSibling,T=B.nextSibling,A=T.firstChild,H=A.nextSibling;return u($,()=>n("contextUsagePanel.labels.input")),u(f,()=>Z(b())),u(M,()=>n("contextUsagePanel.labels.output")),u(_,()=>Z(p())),u(A,()=>n("contextUsagePanel.labels.cost")),u(H,x),u(h,l(E,{get when(){return ae(()=>!!o())()&&d()},get children(){return[(()=>{var C=se(),k=C.firstChild,U=k.nextSibling;return u(k,()=>n("contextUsagePanel.labels.totalInput")),u(U,()=>Z(i())),C})(),(()=>{var C=se(),k=C.firstChild,U=k.nextSibling;return u(k,()=>n("contextUsagePanel.labels.totalOutput")),u(U,()=>Z(m())),C})(),(()=>{var C=se(),k=C.firstChild,U=k.nextSibling;return u(k,()=>n("contextUsagePanel.labels.totalCost")),u(U,c),C})(),(()=>{var C=se(),k=C.firstChild,U=k.nextSibling;return u(k,()=>n("contextUsagePanel.labels.totalReasoning")),u(U,()=>Z(a())),C})()]}}),null),be(()=>Je(w,`session-context-panel px-4 py-2 ${e.class??""}`)),w})()};var Ft=S('<div><div class="mb-2 flex justify-end text-xs">'),Rt=S("<span class=text-secondary>"),Kt=S('<span class="truncate text-secondary">'),fe=S('<div class="text-xs text-tertiary">'),Lt=S("<div class=space-y-2.5>"),Bt=S('<div class="h-2 overflow-hidden border border-base"style=background-color:var(--surface-base)><div class="h-full transition-[width] duration-300"role=progressbar aria-valuemin=0 aria-valuemax=100>'),Ht=S('<div><div class="mb-1 flex items-start justify-between gap-2 text-xs"><span class="font-medium text-primary"></span><div class=text-right><div class="font-semibold text-primary">'),Nt=S('<div class="text-[10px] text-tertiary">');const jt=6e4,Wt=e=>{const{t:n}=Me(),g=I(()=>{const a=e.providerId.trim();return a?{providerId:a,modelId:e.modelId.trim()}:null}),[d,{refetch:t}]=tt(g,({providerId:a,modelId:b})=>Ze.fetchProviderUsage(a,b)),s=setInterval(()=>{g()&&t()},jt);K(()=>clearInterval(s));const o=I(()=>{var a;return Object.entries(((a=d())==null?void 0:a.windows)??{})}),r=a=>{const b={"5h":"fiveHours","7d":"sevenDays","7d-sonnet":"sevenDaysSonnet","7d-opus":"sevenDaysOpus",weekly:"weekly",daily:"daily",monthly:"monthly",credits:"credits",credits_balance:"creditsBalance",billing_cycle:"billingCycle",session:"session",premium:"premium",chat:"chat",completions:"completions","mcp-tools":"mcpTools"}[a];return b?n(`providerUsage.windows.${b}`):a},c=a=>a.valueLabel?a.valueLabel:a.usedPercent===null?n("providerUsage.unavailableValue"):n("providerUsage.usedPercent",{percent:Math.round(a.usedPercent)}),i=a=>{if(!a)return null;const b=new Date(a);return Number.isFinite(b.getTime())?n("providerUsage.resets",{time:b.toLocaleString([],{dateStyle:"short",timeStyle:"short"})}):null},m=a=>a!==null&&a>=80?"var(--status-error)":a!==null&&a>=50?"var(--status-warning)":"var(--status-success)";return(()=>{var a=Ft(),b=a.firstChild;return u(b,l(E,{get when(){var p;return(p=d())==null?void 0:p.providerName},get fallback(){return(()=>{var p=Rt();return u(p,()=>e.providerId),p})()},children:p=>(()=>{var v=Kt();return u(v,p),v})()})),u(a,l(E,{get when(){return!d.loading},get fallback(){return(()=>{var p=fe();return u(p,()=>n("providerUsage.loading")),p})()},get children(){return l(E,{get when(){return d()},get fallback(){return(()=>{var p=fe();return u(p,()=>n("providerUsage.unavailable")),p})()},children:p=>l(E,{get when(){return ae(()=>!!(p().supported&&p().configured&&p().ok))()&&o().length>0},get fallback(){return(()=>{var v=fe();return u(v,()=>n(p().supported?p().configured?"providerUsage.unavailable":"providerUsage.notConfigured":"providerUsage.unsupported")),v})()},get children(){var v=Lt();return u(v,l(me,{get each(){return o()},children:([x,w])=>(()=>{var h=Ht(),P=h.firstChild,$=P.firstChild,f=$.nextSibling,B=f.firstChild;return u($,()=>r(x)),u(B,()=>c(w)),u(f,l(E,{get when(){return i(w.resetAt)},children:M=>(()=>{var _=Nt();return u(_,M),_})()}),null),u(h,l(E,{get when(){return w.usedPercent!==null},get children(){var M=Bt(),_=M.firstChild;return be(T=>{var A=`${Math.max(0,Math.min(100,w.usedPercent??0))}%`,H=m(w.usedPercent),C=n("providerUsage.progressLabel",{window:r(x)}),k=Math.round(w.usedPercent??0);return A!==T.e&&ke(_,"width",T.e=A),H!==T.t&&ke(_,"background-color",T.t=H),C!==T.a&&R(_,"aria-label",T.a=C),k!==T.o&&R(_,"aria-valuenow",T.o=k),T},{e:void 0,t:void 0,a:void 0,o:void 0}),M}}),null),h})()})),v}})})}}),null),a})()};var re=S('<div class="right-panel-empty right-panel-empty--left"><span class=text-xs>'),qt=S('<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">'),Vt=S('<div class="flex flex-col gap-2">'),zt=S("<span>"),Xt=S('<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">'),Yt=S('<div class="text-xs text-tertiary">'),Gt=S('<div class="rounded-md border border-base bg-surface-secondary px-3 py-2">'),Jt=S("<div class=status-tab-container>"),Zt=S("<span class=section-left><span class=section-label>");const rn=e=>{const n=r=>e.expandedItems().includes(r),o=[{id:"provider-usage",labelKey:"providerUsage.title",tooltipKey:"providerUsage.tooltip",render:()=>{const r=e.activeSession();return r?(()=>{var c=Gt();return u(c,l(Wt,{get providerId(){return r.model.providerId},get modelId(){return r.model.modelId}})),c})():(()=>{var c=Yt();return u(c,()=>e.t("providerUsage.noSession")),c})()}},{id:"yolo-mode",labelKey:"instanceShell.rightPanel.sections.yoloMode",tooltipKey:"instanceShell.rightPanel.sections.yoloMode.tooltip",render:()=>{const r=e.activeSession();return r?(()=>{var c=qt(),i=c.firstChild,m=i.firstChild,a=m.firstChild,b=a.nextSibling;return u(a,()=>e.t("instanceShell.yoloMode.title")),u(b,()=>e.t("instanceShell.yoloMode.description")),u(i,l(yt,{get checked(){return bt(e.instanceId,r.id)},color:"warning",size:"small",get inputProps(){return{"aria-label":e.t("instanceShell.yoloMode.title")}},onChange:()=>vt(e.instanceId,r.id)}),null),c})():(()=>{var c=re(),i=c.firstChild;return u(i,()=>e.t("instanceShell.yoloMode.noSessionSelected")),c})()}},{id:"plan",labelKey:"instanceShell.rightPanel.sections.plan",tooltipKey:"instanceShell.rightPanel.sections.plan.tooltip",render:()=>{const r=e.activeSessionId();if(!r||r==="info")return(()=>{var i=re(),m=i.firstChild;return u(m,()=>e.t("instanceShell.plan.noSessionSelected")),i})();const c=e.latestTodoState();return c?l(xt,{state:c,get emptyLabel(){return e.t("instanceShell.plan.empty")},showStatusLabel:!1}):(()=>{var i=re(),m=i.firstChild;return u(m,()=>e.t("instanceShell.plan.empty")),i})()}},{id:"background-processes",labelKey:"instanceShell.rightPanel.sections.backgroundProcesses",tooltipKey:"instanceShell.rightPanel.sections.backgroundProcesses.tooltip",render:()=>{const r=e.backgroundProcessList();return r.length===0?(()=>{var c=re(),i=c.firstChild;return u(i,()=>e.t("instanceShell.backgroundProcesses.empty")),c})():(()=>{var c=Vt();return u(c,l(me,{each:r,children:i=>(()=>{var m=Xt(),a=m.firstChild,b=a.firstChild,p=b.nextSibling,v=p.firstChild,x=v.nextSibling,w=a.nextSibling,h=w.firstChild,P=h.nextSibling,$=P.nextSibling;return u(b,()=>i.title),u(v,l(Pt,{class:"h-3.5 w-3.5"})),u(x,()=>e.t("instanceShell.backgroundProcesses.status",{status:i.status})),u(p,l(E,{get when(){return typeof i.outputSizeBytes=="number"},get children(){var f=zt();return u(f,()=>e.t("instanceShell.backgroundProcesses.output",{sizeKb:Math.round((i.outputSizeBytes??0)/1024)})),f}}),null),h.$$click=()=>e.onOpenBackgroundOutput(i),u(h,l($t,{class:"h-4 w-4"})),P.$$click=()=>e.onStopBackgroundProcess(i.id),u(P,l(Tt,{class:"h-4 w-4"})),$.$$click=()=>e.onTerminateBackgroundProcess(i.id),u($,l(Ct,{class:"h-4 w-4"})),be(f=>{var B=!!i.notifyEnabled,M=!i.notifyEnabled,_=e.t(i.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),T=e.t(i.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),A=e.t("instanceShell.backgroundProcesses.actions.output"),H=e.t("instanceShell.backgroundProcesses.actions.output"),C=i.status!=="running",k=e.t("instanceShell.backgroundProcesses.actions.stop"),U=e.t("instanceShell.backgroundProcesses.actions.stop"),y=e.t("instanceShell.backgroundProcesses.actions.terminate"),O=e.t("instanceShell.backgroundProcesses.actions.terminate");return B!==f.e&&v.classList.toggle("text-success",f.e=B),M!==f.t&&v.classList.toggle("text-tertiary",f.t=M),_!==f.a&&R(v,"aria-label",f.a=_),T!==f.o&&R(v,"title",f.o=T),A!==f.i&&R(h,"aria-label",f.i=A),H!==f.n&&R(h,"title",f.n=H),C!==f.s&&(P.disabled=f.s=C),k!==f.h&&R(P,"aria-label",f.h=k),U!==f.r&&R(P,"title",f.r=U),y!==f.d&&R($,"aria-label",f.d=y),O!==f.l&&R($,"title",f.l=O),f},{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}),m})()})),c})()}},{id:"mcp",labelKey:"instanceShell.rightPanel.sections.mcp",tooltipKey:"instanceShell.rightPanel.sections.mcp.tooltip",render:()=>l(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:()=>l(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:()=>l(he,{get initialInstance(){return e.instance},sections:["plugins"],showSectionHeadings:!1,class:"space-y-2"})}];return(()=>{var r=Jt();return u(r,l(E,{get when(){return e.activeSession()},children:c=>l(At,{get instanceId(){return e.instanceId},get sessionId(){return c().id},class:"status-tab-context-panel"})}),null),u(r,l(J.Root,{class:"right-panel-accordion",collapsible:!0,multiple:!0,get value(){return e.expandedItems()},get onChange(){return e.onExpandedItemsChange},get children(){return l(me,{each:o,children:c=>l(J.Item,{get value(){return c.id},class:"right-panel-accordion-item",get children(){return[l(J.Header,{class:"right-panel-accordion-header-row",get children(){return[l(J.Trigger,{class:"right-panel-accordion-trigger",get children(){return[(()=>{var i=Zt(),m=i.firstChild;return u(m,()=>e.t(c.labelKey)),i})(),l(ft,{get class(){return`right-panel-accordion-chevron ${n(c.id)?"right-panel-accordion-chevron-expanded":""}`}})]}}),l(ee,{openDelay:200,gutter:4,placement:"top",get children(){return[l(ee.Trigger,{as:"button",type:"button",class:"section-info-trigger",get"aria-label"(){return e.t(c.tooltipKey)},get children(){return l(mt,{class:"section-info-icon"})}}),l(ee.Portal,{get children(){return l(ee.Content,{class:"section-info-tooltip",get children(){return e.t(c.tooltipKey)}})}})]}})]}}),l(J.Content,{class:"right-panel-accordion-content",get children(){return c.render()}})]}})})}}),null),r})()};Qe(["click"]);export{rn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as n}from"./main-
|
|
1
|
+
import{I as n}from"./main-CTN6Wwz1.js";import{n as o,m as y}from"./git-diff-vendor-CYS3ApzA.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};
|