@neuralnomads/codenomad-dev 0.13.1-dev-20260331-995fb3b6 → 0.13.3-dev-20260402-e82e529a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/manager.js +9 -1
- package/dist/index.js +26 -6
- package/dist/opencode-config/package.json +1 -1
- package/dist/server/__tests__/network-addresses.test.js +68 -0
- package/dist/server/network-addresses.js +43 -1
- package/dist/server/routes/meta.js +0 -3
- package/package.json +1 -1
- package/public/assets/ChangesTab-CR9-DiDp.js +2 -0
- package/public/assets/DiffToolbar-DDj2or5F.js +1 -0
- package/public/assets/{FilesTab-BpYPA_Zr.js → FilesTab-WqNou6Ai.js} +1 -1
- package/public/assets/GitChangesTab-BwmFurGu.js +2 -0
- package/public/assets/{SplitFilePanel-DwrJM7GQ.js → SplitFilePanel-Dh1S3Bx7.js} +1 -1
- package/public/assets/StatusTab-B87q8a9A.js +1 -0
- package/public/assets/{bundle-full-JwmTIwMd.js → bundle-full-Cpu11oec.js} +1 -1
- package/public/assets/diff-viewer-DRA-UVaP.js +1 -0
- package/public/assets/{index-UaIyK67v.js → index-BaoXz6VG.js} +1 -1
- package/public/assets/{index-xsUu1uOf.js → index-BgujSDdi.js} +1 -1
- package/public/assets/{index-LmDdmmJP.js → index-BjSF6wzm.js} +1 -1
- package/public/assets/{index-lhjxIgwf.js → index-CRtA_Run.js} +2 -2
- package/public/assets/{index-DiFfJ0HM.js → index-D7BEMtle.js} +1 -1
- package/public/assets/{index-CkYwnPl7.js → index-D7RpN-Kf.js} +1 -1
- package/public/assets/index-DcG1bjdf.css +1 -0
- package/public/assets/{index-CUkIenrg.js → index-DeriVoYn.js} +1 -1
- package/public/assets/{index-BHjkPi4D.js → index-Dgk0HDM-.js} +1 -1
- package/public/assets/{index-D9RMxxcS.js → index-q3ssEM4m.js} +1 -1
- package/public/assets/{loading-CfqkoCbA.js → loading-D50lUPVl.js} +1 -1
- package/public/assets/main-CEwS0Qyy.js +56 -0
- package/public/assets/{markdown-D2uUJada.js → markdown-BtGnYmbv.js} +3 -3
- package/public/assets/{todo-i3zWdksA.js → todo-CshHqPz5.js} +1 -1
- package/public/assets/tool-call-LDmo-9Rl.js +60 -0
- package/public/assets/{unified-picker-B506AoQt.js → unified-picker-C-C3Oz_t.js} +1 -1
- package/public/assets/wrap-text-Dr6EjY_H.js +1 -0
- package/public/index.html +3 -3
- package/public/loading.html +3 -3
- package/public/sw.js +1 -1
- package/public/ui-version.json +1 -1
- package/public/assets/ChangesTab-X8IIoIdB.js +0 -2
- package/public/assets/DiffToolbar-Djg0ksr_.js +0 -1
- package/public/assets/GitChangesTab-DeGsV8--.js +0 -2
- package/public/assets/StatusTab-mT1B3wST.js +0 -1
- package/public/assets/diff-viewer-CKnTxbWB.js +0 -1
- package/public/assets/index-BEzx5r3P.css +0 -1
- package/public/assets/main-B3yZBpaS.js +0 -56
- package/public/assets/tool-call-Bl3Lai68.js +0 -60
package/dist/auth/manager.js
CHANGED
|
@@ -11,7 +11,7 @@ export class AuthManager {
|
|
|
11
11
|
this.init = init;
|
|
12
12
|
this.logger = logger;
|
|
13
13
|
this.sessionManager = new SessionManager();
|
|
14
|
-
this.cookieName =
|
|
14
|
+
this.cookieName = sanitizeCookieName(init.cookieName);
|
|
15
15
|
this.authEnabled = !Boolean(init.dangerouslySkipAuth);
|
|
16
16
|
if (!this.authEnabled) {
|
|
17
17
|
this.authStore = null;
|
|
@@ -106,6 +106,14 @@ export class AuthManager {
|
|
|
106
106
|
return this.authStore;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
+
function sanitizeCookieName(value) {
|
|
110
|
+
const trimmed = value?.trim();
|
|
111
|
+
if (!trimmed) {
|
|
112
|
+
return DEFAULT_AUTH_COOKIE_NAME;
|
|
113
|
+
}
|
|
114
|
+
const sanitized = trimmed.replace(/[^A-Za-z0-9_-]/g, "_");
|
|
115
|
+
return sanitized.length > 0 ? sanitized : DEFAULT_AUTH_COOKIE_NAME;
|
|
116
|
+
}
|
|
109
117
|
function resolveAuthFilePath(configPath) {
|
|
110
118
|
const resolvedConfigPath = resolvePath(configPath);
|
|
111
119
|
return path.join(path.dirname(resolvedConfigPath), "auth.json");
|
package/dist/index.js
CHANGED
|
@@ -18,9 +18,9 @@ import { InstanceEventBridge } from "./workspaces/instance-events";
|
|
|
18
18
|
import { createLogger } from "./logger";
|
|
19
19
|
import { launchInBrowser } from "./launcher";
|
|
20
20
|
import { resolveUi } from "./ui/remote-ui";
|
|
21
|
-
import { AuthManager, BOOTSTRAP_TOKEN_STDOUT_PREFIX, DEFAULT_AUTH_USERNAME } from "./auth/manager";
|
|
21
|
+
import { AuthManager, BOOTSTRAP_TOKEN_STDOUT_PREFIX, DEFAULT_AUTH_COOKIE_NAME, DEFAULT_AUTH_USERNAME } from "./auth/manager";
|
|
22
22
|
import { resolveHttpsOptions } from "./server/tls";
|
|
23
|
-
import { resolveNetworkAddresses } from "./server/network-addresses";
|
|
23
|
+
import { resolveNetworkAddresses, resolveRemoteAddresses } from "./server/network-addresses";
|
|
24
24
|
import { startDevReleaseMonitor } from "./releases/dev-release-monitor";
|
|
25
25
|
import { SpeechService } from "./speech/service";
|
|
26
26
|
const require = createRequire(import.meta.url);
|
|
@@ -62,6 +62,9 @@ function parseCliOptions(argv) {
|
|
|
62
62
|
.env("CODENOMAD_SERVER_USERNAME")
|
|
63
63
|
.default(DEFAULT_AUTH_USERNAME))
|
|
64
64
|
.addOption(new Option("--password <password>", "Password for server authentication").env("CODENOMAD_SERVER_PASSWORD"))
|
|
65
|
+
.addOption(new Option("--auth-cookie-name <name>", "Cookie name for server authentication")
|
|
66
|
+
.env("CODENOMAD_AUTH_COOKIE_NAME")
|
|
67
|
+
.default(DEFAULT_AUTH_COOKIE_NAME))
|
|
65
68
|
.addOption(new Option("--generate-token", "Emit a one-time bootstrap token for desktop")
|
|
66
69
|
.env("CODENOMAD_GENERATE_TOKEN")
|
|
67
70
|
.default(false))
|
|
@@ -106,6 +109,7 @@ function parseCliOptions(argv) {
|
|
|
106
109
|
launch: Boolean(parsed.launch),
|
|
107
110
|
authUsername: parsed.username,
|
|
108
111
|
authPassword: parsed.password,
|
|
112
|
+
authCookieName: parsed.authCookieName,
|
|
109
113
|
generateToken: Boolean(parsed.generateToken),
|
|
110
114
|
dangerouslySkipAuth: Boolean(parsed.dangerouslySkipAuth),
|
|
111
115
|
};
|
|
@@ -169,6 +173,7 @@ async function main() {
|
|
|
169
173
|
configPath: configLocation.configYamlPath,
|
|
170
174
|
username: options.authUsername,
|
|
171
175
|
password: options.authPassword,
|
|
176
|
+
cookieName: options.authCookieName,
|
|
172
177
|
generateToken: options.generateToken,
|
|
173
178
|
dangerouslySkipAuth: options.dangerouslySkipAuth,
|
|
174
179
|
}, logger.child({ component: "auth" }));
|
|
@@ -323,19 +328,23 @@ async function main() {
|
|
|
323
328
|
// which can lead clients to talk to the wrong process.
|
|
324
329
|
const localUrl = `${localProtocol}://127.0.0.1:${localStart.port}`;
|
|
325
330
|
let remoteUrl;
|
|
331
|
+
let remoteAddresses = [];
|
|
326
332
|
if (remoteStart) {
|
|
327
333
|
const wantsAll = options.host === "0.0.0.0" || !isLoopbackHost(options.host);
|
|
328
334
|
let remoteHost = options.host;
|
|
329
335
|
if (wantsAll) {
|
|
330
336
|
if (options.host === "0.0.0.0") {
|
|
331
|
-
const
|
|
332
|
-
|
|
337
|
+
const resolved = resolveRemoteAddresses({ host: options.host, protocol: remoteProtocol, port: remoteStart.port });
|
|
338
|
+
remoteAddresses = resolved.userVisible;
|
|
339
|
+
remoteUrl = resolved.primaryRemoteUrl ?? `${remoteProtocol}://localhost:${remoteStart.port}`;
|
|
333
340
|
}
|
|
334
341
|
}
|
|
335
342
|
else {
|
|
336
343
|
remoteHost = "localhost";
|
|
337
344
|
}
|
|
338
|
-
remoteUrl
|
|
345
|
+
if (!remoteUrl) {
|
|
346
|
+
remoteUrl = `${remoteProtocol}://${remoteHost}:${remoteStart.port}`;
|
|
347
|
+
}
|
|
339
348
|
}
|
|
340
349
|
serverMeta.localUrl = localUrl;
|
|
341
350
|
serverMeta.localPort = localStart.port;
|
|
@@ -344,7 +353,9 @@ async function main() {
|
|
|
344
353
|
serverMeta.host = options.host;
|
|
345
354
|
serverMeta.listeningMode = options.host === "0.0.0.0" || !isLoopbackHost(options.host) ? "all" : "local";
|
|
346
355
|
if (serverMeta.remotePort && remoteUrl) {
|
|
347
|
-
serverMeta.addresses =
|
|
356
|
+
serverMeta.addresses = remoteAddresses.length
|
|
357
|
+
? remoteAddresses
|
|
358
|
+
: resolveNetworkAddresses({ host: options.host, protocol: remoteProtocol, port: serverMeta.remotePort });
|
|
348
359
|
}
|
|
349
360
|
else {
|
|
350
361
|
serverMeta.addresses = [];
|
|
@@ -352,6 +363,15 @@ async function main() {
|
|
|
352
363
|
console.log(`Local Connection URL : ${serverMeta.localUrl}`);
|
|
353
364
|
if (serverMeta.remoteUrl) {
|
|
354
365
|
console.log(`Remote Connection URL : ${serverMeta.remoteUrl}`);
|
|
366
|
+
const additionalRemoteUrls = serverMeta.addresses
|
|
367
|
+
.map((addr) => addr.remoteUrl)
|
|
368
|
+
.filter((url) => url !== serverMeta.remoteUrl);
|
|
369
|
+
if (additionalRemoteUrls.length > 0) {
|
|
370
|
+
console.log("Other Accessible URLs:");
|
|
371
|
+
for (const url of additionalRemoteUrls) {
|
|
372
|
+
console.log(` - ${url}`);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
355
375
|
}
|
|
356
376
|
if (options.launch) {
|
|
357
377
|
await launchInBrowser(serverMeta.localUrl, logger.child({ component: "launcher" }));
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import { describe, it } from "node:test";
|
|
4
|
+
import { resolveNetworkAddresses, resolveRemoteAddresses } from "../network-addresses";
|
|
5
|
+
describe("resolveNetworkAddresses", () => {
|
|
6
|
+
it("preserves interface order among external addresses", () => {
|
|
7
|
+
const addresses = [
|
|
8
|
+
{ address: "172.24.0.1", family: "IPv4", internal: false },
|
|
9
|
+
{ address: "192.168.1.128", family: "IPv4", internal: false },
|
|
10
|
+
{ address: "10.0.0.8", family: 4, internal: false },
|
|
11
|
+
{ address: "127.0.0.1", family: "IPv4", internal: true },
|
|
12
|
+
{ address: "169.254.10.20", family: "IPv4", internal: false },
|
|
13
|
+
];
|
|
14
|
+
usingMockedNetworkInterfaces(addresses, () => {
|
|
15
|
+
const result = resolveNetworkAddresses({ host: "0.0.0.0", protocol: "https", port: 9898 });
|
|
16
|
+
assert.deepEqual(result.map((entry) => entry.ip), ["172.24.0.1", "192.168.1.128", "10.0.0.8", "169.254.10.20", "127.0.0.1"]);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
describe("resolveRemoteAddresses", () => {
|
|
21
|
+
it("keeps all external addresses user-visible while preferring non-link-local addresses for the primary URL", () => {
|
|
22
|
+
const addresses = [
|
|
23
|
+
{ address: "169.254.10.20", family: "IPv4", internal: false },
|
|
24
|
+
{ address: "192.168.1.128", family: "IPv4", internal: false },
|
|
25
|
+
{ address: "172.24.0.1", family: "IPv4", internal: false },
|
|
26
|
+
];
|
|
27
|
+
usingMockedNetworkInterfaces(addresses, () => {
|
|
28
|
+
const result = resolveRemoteAddresses({ host: "0.0.0.0", protocol: "https", port: 9898 });
|
|
29
|
+
assert.deepEqual(result.userVisible.map((entry) => entry.ip), ["192.168.1.128", "172.24.0.1", "169.254.10.20"]);
|
|
30
|
+
assert.equal(result.primaryRemoteUrl, "https://192.168.1.128:9898");
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
it("prefers private LAN addresses over public addresses", () => {
|
|
34
|
+
const addresses = [
|
|
35
|
+
{ address: "203.0.113.40", family: "IPv4", internal: false },
|
|
36
|
+
{ address: "192.168.1.128", family: "IPv4", internal: false },
|
|
37
|
+
{ address: "8.8.8.8", family: "IPv4", internal: false },
|
|
38
|
+
];
|
|
39
|
+
usingMockedNetworkInterfaces(addresses, () => {
|
|
40
|
+
const result = resolveRemoteAddresses({ host: "0.0.0.0", protocol: "https", port: 9898 });
|
|
41
|
+
assert.deepEqual(result.userVisible.map((entry) => entry.ip), ["192.168.1.128", "203.0.113.40", "8.8.8.8"]);
|
|
42
|
+
assert.equal(result.primaryRemoteUrl, "https://192.168.1.128:9898");
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
it("uses a public address when no private LAN address is available", () => {
|
|
46
|
+
const addresses = [
|
|
47
|
+
{ address: "169.254.10.20", family: "IPv4", internal: false },
|
|
48
|
+
{ address: "203.0.113.40", family: "IPv4", internal: false },
|
|
49
|
+
];
|
|
50
|
+
usingMockedNetworkInterfaces(addresses, () => {
|
|
51
|
+
const result = resolveRemoteAddresses({ host: "0.0.0.0", protocol: "https", port: 9898 });
|
|
52
|
+
assert.deepEqual(result.userVisible.map((entry) => entry.ip), ["203.0.113.40", "169.254.10.20"]);
|
|
53
|
+
assert.equal(result.primaryRemoteUrl, "https://203.0.113.40:9898");
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
function usingMockedNetworkInterfaces(addresses, callback) {
|
|
58
|
+
const original = os.networkInterfaces;
|
|
59
|
+
os.networkInterfaces = (() => ({
|
|
60
|
+
ethernet0: addresses,
|
|
61
|
+
}));
|
|
62
|
+
try {
|
|
63
|
+
callback();
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
os.networkInterfaces = original;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -52,9 +52,51 @@ export function resolveNetworkAddresses(args) {
|
|
|
52
52
|
const scopeDelta = scopeWeight[a.scope] - scopeWeight[b.scope];
|
|
53
53
|
if (scopeDelta !== 0)
|
|
54
54
|
return scopeDelta;
|
|
55
|
-
return
|
|
55
|
+
return 0;
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
+
export function resolveRemoteAddresses(args) {
|
|
59
|
+
const all = resolveNetworkAddresses(args);
|
|
60
|
+
const userVisible = sortUserVisibleAddresses(all.filter((address) => address.scope === "external"));
|
|
61
|
+
return {
|
|
62
|
+
all,
|
|
63
|
+
userVisible,
|
|
64
|
+
primaryRemoteUrl: userVisible[0]?.remoteUrl,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function sortUserVisibleAddresses(addresses) {
|
|
68
|
+
return [...addresses].sort((left, right) => getUserVisiblePriority(left.ip) - getUserVisiblePriority(right.ip));
|
|
69
|
+
}
|
|
70
|
+
function getUserVisiblePriority(ip) {
|
|
71
|
+
if (isPrivateIPv4(ip))
|
|
72
|
+
return 0;
|
|
73
|
+
if (isLinkLocalIPv4(ip))
|
|
74
|
+
return 2;
|
|
75
|
+
return 1;
|
|
76
|
+
}
|
|
77
|
+
function isLinkLocalIPv4(ip) {
|
|
78
|
+
const octets = parseIPv4(ip);
|
|
79
|
+
if (!octets)
|
|
80
|
+
return false;
|
|
81
|
+
const [first, second] = octets;
|
|
82
|
+
return first === 169 && second === 254;
|
|
83
|
+
}
|
|
84
|
+
function isPrivateIPv4(ip) {
|
|
85
|
+
const octets = parseIPv4(ip);
|
|
86
|
+
if (!octets)
|
|
87
|
+
return false;
|
|
88
|
+
const [first, second] = octets;
|
|
89
|
+
if (first === 10)
|
|
90
|
+
return true;
|
|
91
|
+
if (first === 192 && second === 168)
|
|
92
|
+
return true;
|
|
93
|
+
return first === 172 && second >= 16 && second <= 31;
|
|
94
|
+
}
|
|
95
|
+
function parseIPv4(value) {
|
|
96
|
+
if (!isIPv4Address(value))
|
|
97
|
+
return null;
|
|
98
|
+
return value.split(".").map((part) => Number(part));
|
|
99
|
+
}
|
|
58
100
|
function isIPv4Address(value) {
|
|
59
101
|
if (!value)
|
|
60
102
|
return false;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import { resolveNetworkAddresses } from "../network-addresses";
|
|
2
1
|
export function registerMetaRoutes(app, deps) {
|
|
3
2
|
app.get("/api/meta", async () => buildMetaResponse(deps.serverMeta));
|
|
4
3
|
}
|
|
5
4
|
function buildMetaResponse(meta) {
|
|
6
5
|
const localPort = resolveLocalPort(meta);
|
|
7
6
|
const remote = resolveRemote(meta);
|
|
8
|
-
const addresses = remote && remote.port > 0 ? resolveNetworkAddresses({ host: meta.host, protocol: remote.protocol, port: remote.port }) : [];
|
|
9
7
|
return {
|
|
10
8
|
...meta,
|
|
11
9
|
localPort,
|
|
12
10
|
remotePort: remote?.port,
|
|
13
11
|
listeningMode: meta.host === "0.0.0.0" || !isLoopbackHost(meta.host) ? "all" : "local",
|
|
14
|
-
addresses,
|
|
15
12
|
};
|
|
16
13
|
}
|
|
17
14
|
function resolveLocalPort(meta) {
|
package/package.json
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-UU9TfOpS.js","assets/git-diff-vendor-CAv-4upN.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as K}from"./index-CRtA_Run.js";import{m as B,t as g,i as a,d as w,a as F,f as N}from"./monaco-viewer-UU9TfOpS.js";import{c as f,n as c,a as L,F as T,S as W,z as j,A as q}from"./git-diff-vendor-CAv-4upN.js";import{D as G}from"./DiffToolbar-DDj2or5F.js";import{S as H}from"./SplitFilePanel-Dh1S3Bx7.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-CEwS0Qyy.js";import"./wrap-text-Dr6EjY_H.js";var J=g('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),E=g("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Q=g('<div class="p-3 text-xs text-secondary">'),R=g("<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-"),U=g("<span class=files-tab-selected-path><span class=file-path-text>"),X=g('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Y=g("<div style=margin-left:auto>");const Z=q(()=>K(()=>import("./monaco-viewer-UU9TfOpS.js").then(e=>e.aa),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),fe=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||""))):[]}),I=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})),O=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 O()}),p=f(()=>`${e.instanceId}:${S()?M():"no-session"}`),V=f(()=>{if(!S())return e.t("instanceShell.sessionChanges.noSessionSelected");const n=D();return n===void 0?e.t("instanceShell.sessionChanges.loading"):!Array.isArray(n)||n.length===0?e.t("instanceShell.sessionChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty")}),A=f(()=>{const n=P();return n!=null&&n.file?String(n.file):e.t("instanceShell.rightPanel.tabs.changes")});return B(()=>{const n=m(),i=I(),l=P(),v=()=>(()=>{var t=J(),r=t.firstChild;return a(r,c(W,{get when(){return l&&S()&&n.length>0?l:null},get fallback(){return(()=>{var o=E(),s=o.firstChild;return a(s,V),o})()},children:o=>c(j,{get fallback(){return(()=>{var s=E(),u=s.firstChild;return a(u,()=>e.t("instanceInfo.loading")),s})()},get children(){return c(Z,{get scopeKey(){return p()},get path(){return String(o().file||"")},get before(){return String(o().before||"")},get after(){return String(o().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})),t})(),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,o=r.firstChild;o.firstChild;var s=r.nextSibling,u=s.firstChild;return u.firstChild,a(o,()=>i.additions,null),a(u,()=>i.deletions,null),t})(),(()=>{var t=Y();return a(t,c(G,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})),t})()]},list:{panel:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(T,{each:n,children:t=>(()=>{var r=R(),o=r.firstChild,s=o.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,e.isPhoneLayout())},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(d=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file;return _!==d.e&&F(r,d.e=_),$!==d.t&&w(s,"title",d.t=$),d},{e:void 0,t:void 0}),r})()})}}),overlay:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(T,{each:n,children:t=>(()=>{var r=R(),o=r.firstChild,s=o.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,!0)},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(d=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file,z=t.file;return _!==d.e&&F(r,d.e=_),$!==d.t&&w(r,"title",d.t=$),z!==d.a&&w(s,"title",d.a=z),d},{e:void 0,t:void 0,a:void 0}),r})()})}})},get viewer(){return v()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.changes")}})})};N(["click"]);export{fe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-UU9TfOpS.js";import{u as T}from"./index-CRtA_Run.js";import{n as o,m as $,a as V}from"./git-diff-vendor-CAv-4upN.js";import{I as U,S as A,N as I}from"./main-CEwS0Qyy.js";import{A as N,W as D}from"./wrap-text-Dr6EjY_H.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"}]],F=t=>o(U,$(t,{name:"UnfoldVertical",iconNode:E}));var H=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(),r=()=>t.viewMode==="split"?"unified":"split",s=()=>t.contextMode==="collapsed"?"expanded":"collapsed",h=()=>t.wordWrapMode==="on"?"off":"on",f=()=>r()==="split"?a("instanceShell.diff.switchToSplit"):a("instanceShell.diff.switchToUnified"),v=()=>s()==="collapsed"?a("instanceShell.diff.hideUnchanged"):a("instanceShell.diff.showFull"),u=()=>h()==="on"?a("instanceShell.diff.enableWordWrap"):a("instanceShell.diff.disableWordWrap");return(()=>{var b=H(),n=b.firstChild,l=n.nextSibling,d=l.nextSibling;return n.$$click=()=>t.onViewModeChange(r()),c(n,(()=>{var e=W(()=>r()==="split");return()=>e()?o(A,{class:"h-4 w-4","aria-hidden":"true"}):o(N,{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(F,{class:"h-4 w-4","aria-hidden":"true"})})()),d.$$click=()=>t.onWordWrapModeChange(h()),c(d,o(D,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=f(),w=f(),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(d,e.i=x),k!==e.n&&i(d,"aria-label",e.n=k),y!==e.s&&i(d,"title",e.s=y),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),b})()};C(["click"]);export{z as D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-UU9TfOpS.js","assets/git-diff-vendor-CAv-4upN.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as R}from"./index-
|
|
2
|
+
import{_ as R}from"./index-CRtA_Run.js";import{m as _,t as o,i as s,d as c,a as z,f as I}from"./monaco-viewer-UU9TfOpS.js";import{n as i,m as D,S as d,a as v,F,z as V,A as M}from"./git-diff-vendor-CAv-4upN.js";import{S as T}from"./SplitFilePanel-Dh1S3Bx7.js";import{I as A,R as y}from"./main-CEwS0Qyy.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const O=[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]],q=e=>i(A,D(e,{name:"Save",iconNode:O}));var g=o("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),K=o('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),N=o('<div class="p-3 text-xs text-secondary">'),W=o("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),H=o('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats><span class="text-[10px] text-secondary">'),j=o("<span>"),B=o("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),G=o("<button type=button class=files-header-icon-button style=margin-inline-start:auto>"),J=o("<button type=button class=files-header-icon-button>"),Q=o("<span class=text-error>");const U=M(()=>R(()=>import("./monaco-viewer-UU9TfOpS.js").then(e=>e.ab),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoFileViewer}))),ae=e=>{const C=()=>{const h=e.browserSelectedContent();h!=null&&e.onSave(h)};return _(()=>{const h=e.browserEntries(),P=[...h||[]].sort((t,n)=>{const r=t.type==="directory"?0:1,l=n.type==="directory"?0:1;return r!==l?r-l:String(t.name||"").localeCompare(String(n.name||""))}),L=e.parentPath(),w=()=>e.browserSelectedPath()||e.browserPath(),x=()=>e.browserLoading()&&h===null?e.t("instanceInfo.loading"):e.t("instanceShell.filesShell.viewerEmpty"),k=()=>(()=>{var t=K(),n=t.firstChild;return s(n,i(d,{get when(){return e.browserSelectedLoading()},get fallback(){return i(d,{get when(){return e.browserSelectedError()},get fallback(){return i(d,{get when(){return _(()=>!!(e.browserSelectedPath()&&e.browserSelectedContent()!==null))()?{path:e.browserSelectedPath(),content:e.browserSelectedContent()}:null},get fallback(){return(()=>{var r=g(),l=r.firstChild;return s(l,x),r})()},children:r=>i(V,{get fallback(){return(()=>{var l=g(),a=l.firstChild;return s(a,()=>e.t("instanceInfo.loading")),l})()},get children(){return i(U,{get scopeKey(){return e.scopeKey()},get path(){return r().path},get content(){return r().content},get onSave(){return e.onSave},get onContentChange(){return e.onContentChange}})}})})},children:r=>(()=>{var l=g(),a=l.firstChild;return s(a,r),l})()})},get children(){var r=g(),l=r.firstChild;return s(l,()=>e.t("instanceInfo.loading")),r}})),t})(),m=()=>[i(d,{when:L,children:t=>(()=>{var n=W(),r=n.firstChild,l=r.firstChild;return n.$$click=()=>e.onLoadEntries(t()),v(()=>c(l,"title",t())),n})()}),i(d,{get when(){return e.browserLoading()&&h===null},get children(){var t=N();return s(t,()=>e.t("instanceInfo.loading")),t}}),i(F,{each:P,children:t=>(()=>{var n=H(),r=n.firstChild,l=r.firstChild,a=l.firstChild,f=l.nextSibling,E=f.firstChild;return n.$$click=()=>{if(t.type==="directory"){e.onLoadEntries(t.path);return}e.onRequestOpenFile(t.path)},s(a,()=>t.name),s(E,()=>t.type),v(u=>{var b=`file-list-item ${e.browserSelectedPath()===t.path?"file-list-item-active":""}`,S=t.path,$=t.path;return b!==u.e&&z(n,u.e=b),S!==u.t&&c(n,"title",u.t=S),$!==u.a&&c(l,"title",u.a=$),u},{e:void 0,t:void 0,a:void 0}),n})()})];return i(T,{get header(){return[(()=>{var t=B(),n=t.firstChild,r=n.firstChild,l=r.firstChild;return s(l,w),s(t,i(d,{get when(){return e.browserLoading()},get children(){var a=j();return s(a,()=>e.t("instanceInfo.loading")),a}}),null),s(t,i(d,{get when(){return e.browserError()},children:a=>(()=>{var f=Q();return s(f,a),f})()}),null),v(()=>c(r,"title",w())),t})(),(()=>{var t=G();return t.$$click=C,s(t,i(d,{get when(){return e.browserSelectedSaving()},get fallback(){return i(q,{class:"h-4 w-4"})},get children(){return i(y,{class:"h-4 w-4 animate-spin"})}})),v(n=>{var r=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",l=e.t("instanceShell.rightPanel.actions.save")||"Save",a=e.browserSelectedSaving()||!e.browserSelectedDirty();return r!==n.e&&c(t,"title",n.e=r),l!==n.t&&c(t,"aria-label",n.t=l),a!==n.a&&(t.disabled=n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})(),(()=>{var t=J();return t.$$click=()=>e.onRefresh(),s(t,i(y,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),v(n=>{var r=e.t("instanceShell.rightPanel.actions.refresh"),l=e.t("instanceShell.rightPanel.actions.refresh"),a=e.browserLoading();return r!==n.e&&c(t,"title",n.e=r),l!==n.t&&c(t,"aria-label",n.t=l),a!==n.a&&(t.disabled=n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})()]},list:{panel:m,overlay:m},get viewer(){return k()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.files")}})})};I(["click"]);export{ae as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-UU9TfOpS.js","assets/git-diff-vendor-CAv-4upN.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as B}from"./index-CRtA_Run.js";import{m as V,t as h,i as r,d as $,a as D,f as K}from"./monaco-viewer-UU9TfOpS.js";import{c as f,n as d,a as w,S as c,F as R,z as G,A as N}from"./git-diff-vendor-CAv-4upN.js";import{D as j}from"./DiffToolbar-DDj2or5F.js";import{S as q}from"./SplitFilePanel-Dh1S3Bx7.js";import{R as H}from"./main-CEwS0Qyy.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./wrap-text-Dr6EjY_H.js";var S=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),J=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),Q=h('<div class="p-3 text-xs text-secondary">'),A=h('<span class="text-[10px] text-secondary">'),z=h("<span class=file-list-item-additions>+"),O=h("<span class=file-list-item-deletions>-"),T=h("<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats>"),U=h("<span class=files-tab-selected-path><span class=file-path-text>"),X=h('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Y=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Z=h("<span class=text-error>");const p=N(()=>B(()=>import("./monaco-viewer-UU9TfOpS.js").then(e=>e.aa),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),ce=e=>{const P=f(()=>e.activeSessionId()),y=f(()=>!!(P()&&P()!=="info")),M=f(()=>y()?e.entries():null),b=f(()=>{const o=M();return Array.isArray(o)?[...o].sort((s,g)=>String(s.path||"").localeCompare(String(g.path||""))):[]}),F=f(()=>b().reduce((o,s)=>(o.additions+=typeof s.added=="number"?s.added:0,o.deletions+=typeof s.removed=="number"?s.removed:0,o),{additions:0,deletions:0})),L=f(()=>b().filter(o=>o&&o.status!=="deleted")),I=f(()=>{const o=b(),s=e.selectedPath(),g=e.mostChangedPath();return(o.find(_=>_.path===s)||(g?o.find(_=>_.path===g):void 0))??null}),W=f(()=>y()?M()===null?e.t("instanceShell.gitChanges.loading"):L().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected"));return V(()=>{const o=F(),s=I(),g=b(),x=L(),_=()=>(()=>{var t=J(),l=t.firstChild;return r(l,d(c,{get when(){return e.selectedLoading()},get fallback(){return d(c,{get when(){return e.selectedError()},get fallback(){return d(c,{get when(){return V(()=>!!(s&&e.selectedBefore()!==null&&e.selectedAfter()!==null&&s.status!=="deleted"))()?{path:s.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=S(),a=i.firstChild;return r(a,W),i})()},children:i=>d(G,{get fallback(){return(()=>{var a=S(),u=a.firstChild;return r(u,()=>e.t("instanceInfo.loading")),a})()},get children(){return d(p,{get scopeKey(){return e.scopeKey()},get path(){return String(i().path||"")},get before(){return String(i().before||"")},get after(){return String(i().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})},children:i=>(()=>{var a=S(),u=a.firstChild;return r(u,i),a})()})},get children(){var i=S(),a=i.firstChild;return r(a,()=>e.t("instanceInfo.loading")),i}})),t})(),k=()=>(()=>{var t=Q();return r(t,W),t})();return d(q,{get header(){return[(()=>{var t=U(),l=t.firstChild;return r(l,()=>(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),w(()=>$(t,"title",(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=X(),l=t.firstChild,i=l.firstChild;i.firstChild;var a=l.nextSibling,u=a.firstChild;return u.firstChild,r(i,()=>o.additions,null),r(u,()=>o.deletions,null),r(t,d(c,{get when(){return e.statusError()},children:v=>(()=>{var n=Z();return r(n,v),n})()}),null),t})(),(()=>{var t=Y();return t.$$click=()=>e.onRefresh(),r(t,d(H,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),w(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),a=e.t("instanceShell.rightPanel.actions.refresh"),u=!y()||e.statusLoading()||M()===null;return i!==l.e&&$(t,"title",l.e=i),a!==l.t&&$(t,"aria-label",l.t=a),u!==l.a&&(t.disabled=l.a=u),l},{e:void 0,t:void 0,a:void 0}),t})(),d(j,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>{e.onOpenFile(t.path)},r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(a,"title",n.t=m),n},{e:void 0,t:void 0}),l})()})}}),overlay:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>e.onOpenFile(t.path),r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path,E=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(l,"title",n.t=m),E!==n.a&&$(a,"title",n.a=E),n},{e:void 0,t:void 0,a:void 0}),l})()})}})},get viewer(){return _()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};K(["click"]);export{ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as d,i as l,d as m,j as s,m as b,g as _,f as w}from"./monaco-viewer-UU9TfOpS.js";import{a as g,n as r,S as n}from"./git-diff-vendor-CAv-4upN.js";import{u as S}from"./index-
|
|
1
|
+
import{t as d,i as l,d as m,j as s,m as b,g as _,f as w}from"./monaco-viewer-UU9TfOpS.js";import{a as g,n as r,S as n}from"./git-diff-vendor-CAv-4upN.js";import{u as S}from"./index-CRtA_Run.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 Se,P as Xe,t as O,i as h,a as Ye,d as L,f as Ge}from"./monaco-viewer-UU9TfOpS.js";import{n as d,m as S,b as $,o as P,k as J,l as ee,q as re,s as _,d as T,c as j,S as Z,t as Qe,w as Ce,a as pe,F as de}from"./git-diff-vendor-CAv-4upN.js";import{I as fe,O as Ze,P as F,Q as se,T as Je,U as et,V as Pe,W as Ie,X as Te,Y as tt,Z as ue,_ as ie,$ as le,a0 as $e,a1 as te,a2 as ne,a3 as nt,a4 as he,a5 as ot,a6 as st,a7 as E,a8 as me,a9 as it,aa as rt,ab as lt,ac as A,ad as at,ae as ct,af as we,ag as dt,ah as ge,ai as ut,aj as gt,ak as pt,al as ft}from"./main-CEwS0Qyy.js";import{u as ht}from"./index-CRtA_Run.js";import{T as mt}from"./todo-CshHqPz5.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const bt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],vt=e=>d(fe,S(e,{name:"Info",iconNode:bt})),yt=[["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"}]],xt=e=>d(fe,S(e,{name:"TerminalSquare",iconNode:yt})),Ct=[["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"}]],wt=e=>d(fe,S(e,{name:"XOctagon",iconNode:Ct}));var ke=J();function St(){return ee(ke)}function Pt(){const e=St();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function De(e,o){return!!(o.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function It(e,o){var t;const l=o.ref();if(!l)return-1;let r=e.length;if(!r)return-1;for(;r--;){const n=(t=e[r])==null?void 0:t.ref();if(n&&De(n,l))return r+1}return 0}function Tt(e){const o=e.map((r,t)=>[t,r]);let l=!1;return o.sort(([r,t],[n,s])=>{const i=t.ref(),a=s.ref();return i===a||!i||!a?0:De(i,a)?(r>n&&(l=!0),-1):(r<n&&(l=!0),1)}),l?o.map(([r,t])=>t):e}function Oe(e,o){const l=Tt(e);e!==l&&o(l)}function $t(e){var t,n;const o=e[0],l=(t=e[e.length-1])==null?void 0:t.ref();let r=(n=o==null?void 0:o.ref())==null?void 0:n.parentElement;for(;r;){if(l&&r.contains(l))return r;r=r.parentElement}return se(r).body}function kt(e,o){$(()=>{const l=setTimeout(()=>{Oe(e(),o)});P(()=>clearTimeout(l))})}function Dt(e,o){if(typeof IntersectionObserver!="function"){kt(e,o);return}let l=[];$(()=>{const r=()=>{const s=!!l.length;l=e(),s&&Oe(e(),o)},t=$t(e()),n=new IntersectionObserver(r,{root:t});for(const s of e()){const i=s.ref();i&&n.observe(i)}P(()=>n.disconnect())})}function Ot(e={}){const[o,l]=Ze({value:()=>et(e.items),onChange:n=>{var s;return(s=e.onItemsChange)==null?void 0:s.call(e,n)}});Dt(o,l);const r=n=>(l(s=>{const i=It(s,n);return Je(s,n,i)}),()=>{l(s=>{const i=s.filter(a=>a.ref()!==n.ref());return s.length===i.length?s:i})});return{DomCollectionProvider:n=>d(ke.Provider,{value:{registerItem:r},get children(){return n.children}})}}function _t(e){const o=Pt(),l=F({shouldRegisterItem:!0},e);$(()=>{if(!l.shouldRegisterItem)return;const r=o.registerItem(l.getItem());P(r)})}var Mt={};me(Mt,{Arrow:()=>Pe,Content:()=>Me,Portal:()=>Ee,Root:()=>Ae,Tooltip:()=>Q,Trigger:()=>Fe,useTooltipContext:()=>ae});var _e=J();function ae(){const e=ee(_e);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function Me(e){const o=ae(),l=F({id:o.generateId("content")},e),[r,t]=_(l,["ref","style"]);return $(()=>P(o.registerContentId(t.id))),d(Z,{get when(){return o.contentPresent()},get children(){return d($e.Positioner,{get children(){return d(nt,S({ref(n){var s=te(i=>{o.setContentRef(i)},r.ref);typeof s=="function"&&s(n)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return he({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:n=>n.preventDefault(),onDismiss:()=>o.hideTooltip(!0)},()=>o.dataset(),t))}})}})}function Ee(e){const o=ae();return d(Z,{get when(){return o.contentPresent()},get children(){return d(Xe,e)}})}function Et(e,o,l){const r=e.split("-")[0],t=o.getBoundingClientRect(),n=l.getBoundingClientRect(),s=[],i=t.left+t.width/2,a=t.top+t.height/2;switch(r){case"top":s.push([t.left,a]),s.push([n.left,n.bottom]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([t.right,a]);break;case"right":s.push([i,t.top]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([n.left,n.bottom]),s.push([i,t.bottom]);break;case"bottom":s.push([t.left,a]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([n.right,n.top]),s.push([t.right,a]);break;case"left":s.push([i,t.top]),s.push([n.right,n.top]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([i,t.bottom]);break}return s}var N={},At=0,q=!1,M,G,V;function Ae(e){const o=`tooltip-${re()}`,l=`${++At}`,r=F({id:o,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[t,n]=_(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let s;const[i,a]=T(),[c,p]=T(),[u,g]=T(),[v,x]=T(n.placement),y=Ie({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:b=>{var D;return(D=t.onOpenChange)==null?void 0:D.call(t,b)}}),{present:C}=Te({show:()=>t.forceMount||y.isOpen(),element:()=>u()??null}),f=()=>{N[l]=m},w=()=>{for(const b in N)b!==l&&(N[b](!0),delete N[b])},m=(b=!1)=>{b||t.closeDelay&&t.closeDelay<=0?(window.clearTimeout(s),s=void 0,y.close()):s||(s=window.setTimeout(()=>{s=void 0,y.close()},t.closeDelay)),window.clearTimeout(M),M=void 0,t.skipDelayDuration&&t.skipDelayDuration>=0&&(V=window.setTimeout(()=>{window.clearTimeout(V),V=void 0},t.skipDelayDuration)),q&&(window.clearTimeout(G),G=window.setTimeout(()=>{delete N[l],G=void 0,q=!1},t.closeDelay))},I=()=>{clearTimeout(s),s=void 0,w(),f(),q=!0,y.open(),window.clearTimeout(M),M=void 0,window.clearTimeout(G),G=void 0,window.clearTimeout(V),V=void 0},W=()=>{w(),f(),!y.isOpen()&&!M&&!q?M=window.setTimeout(()=>{M=void 0,q=!0,I()},t.openDelay):y.isOpen()||I()},K=(b=!1)=>{!b&&t.openDelay&&t.openDelay>0&&!s&&!V?W():I()},z=()=>{window.clearTimeout(M),M=void 0,q=!1},R=()=>{window.clearTimeout(s),s=void 0},U=b=>ue(c(),b)||ue(u(),b),k=b=>{const D=c(),B=u();if(!(!D||!B))return Et(b,D,B)},Y=b=>{const D=b.target;if(U(D)){R();return}if(!t.ignoreSafeArea){const B=k(v());if(B&&ot(st(b),B)){R();return}}s||m()};$(()=>{if(!y.isOpen())return;const b=se();b.addEventListener("pointermove",Y,!0),P(()=>{b.removeEventListener("pointermove",Y,!0)})}),$(()=>{const b=c();if(!b||!y.isOpen())return;const D=qe=>{const Ve=qe.target;ue(Ve,b)&&m(!0)},B=tt();B.addEventListener("scroll",D,{capture:!0}),P(()=>{B.removeEventListener("scroll",D,{capture:!0})})}),P(()=>{clearTimeout(s),N[l]&&delete N[l]});const ze={dataset:j(()=>({"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:C,openTooltip:K,hideTooltip:m,cancelOpening:z,generateId:le(()=>r.id),registerContentId:ie(a),isTargetOnTooltip:U,setTriggerRef:p,setContentRef:g};return d(_e.Provider,{value:ze,get children(){return d($e,S({anchorRef:c,contentRef:u,onCurrentPlacementChange:x},n))}})}function Fe(e){let o;const l=ae(),[r,t]=_(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let n=!1,s=!1,i=!1;const a=()=>{n=!1},c=()=>{!l.isOpen()&&(s||i)&&l.openTooltip(i)},p=f=>{l.isOpen()&&!s&&!i&&l.hideTooltip(f)},u=f=>{E(f,r.onPointerEnter),!(f.pointerType==="touch"||l.triggerOnFocusOnly()||l.isDisabled()||f.defaultPrevented)&&(s=!0,c())},g=f=>{E(f,r.onPointerLeave),f.pointerType!=="touch"&&(s=!1,i=!1,l.isOpen()?p():l.cancelOpening())},v=f=>{E(f,r.onPointerDown),n=!0,se(o).addEventListener("pointerup",a,{once:!0})},x=f=>{E(f,r.onClick),s=!1,i=!1,p(!0)},y=f=>{E(f,r.onFocus),!(l.isDisabled()||f.defaultPrevented||n)&&(i=!0,c())},C=f=>{E(f,r.onBlur);const w=f.relatedTarget;l.isTargetOnTooltip(w)||(s=!1,i=!1,p(!0))};return P(()=>{se(o).removeEventListener("pointerup",a)}),d(ne,S({as:"button",ref(f){var w=te(m=>{l.setTriggerRef(m),o=m},r.ref);typeof w=="function"&&w(f)},get"aria-describedby"(){return Se(()=>!!l.isOpen())()?l.contentId():void 0},onPointerEnter:u,onPointerLeave:g,onPointerDown:v,onClick:x,onFocus:y,onBlur:C},()=>l.dataset(),t))}var Q=Object.assign(Ae,{Arrow:Pe,Content:Me,Portal:Ee,Trigger:Fe}),Ft={};me(Ft,{Collapsible:()=>Kt,Content:()=>be,Root:()=>ve,Trigger:()=>ye,useCollapsibleContext:()=>oe});var Ke=J();function oe(){const e=ee(Ke);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function be(e){const[o,l]=T(),r=oe(),t=F({id:r.generateId("content")},e),[n,s]=_(t,["ref","id","style"]),{present:i}=Te({show:r.shouldMount,element:()=>o()??null}),[a,c]=T(0),[p,u]=T(0);let v=r.isOpen()||i();return Qe(()=>{const x=requestAnimationFrame(()=>{v=!1});P(()=>{cancelAnimationFrame(x)})}),$(Ce(i,()=>{if(!o())return;o().style.transitionDuration="0s",o().style.animationName="none";const x=o().getBoundingClientRect();c(x.height),u(x.width),v||(o().style.transitionDuration="",o().style.animationName="")})),$(Ce(r.isOpen,x=>{!x&&o()&&(o().style.transitionDuration="",o().style.animationName="")},{defer:!0})),$(()=>P(r.registerContentId(n.id))),d(Z,{get when(){return i()},get children(){return d(ne,S({as:"div",ref(x){var y=te(l,n.ref);typeof y=="function"&&y(x)},get id(){return n.id},get style(){return he({"--kb-collapsible-content-height":a()?`${a()}px`:void 0,"--kb-collapsible-content-width":p()?`${p()}px`:void 0},n.style)}},()=>r.dataset(),s))}})}function ve(e){const o=`collapsible-${re()}`,l=F({id:o},e),[r,t]=_(l,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[n,s]=T(),i=Ie({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:p=>{var u;return(u=r.onOpenChange)==null?void 0:u.call(r,p)}}),a=j(()=>({"data-expanded":i.isOpen()?"":void 0,"data-closed":i.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),c={dataset:a,isOpen:i.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||i.isOpen(),contentId:n,toggle:i.toggle,generateId:le(()=>t.id),registerContentId:ie(s)};return d(Ke.Provider,{value:c,get children(){return d(ne,S({as:"div"},a,t))}})}function ye(e){const o=oe(),[l,r]=_(e,["onClick"]);return d(it,S({get"aria-expanded"(){return o.isOpen()},get"aria-controls"(){return Se(()=>!!o.isOpen())()?o.contentId():void 0},get disabled(){return o.disabled()},onClick:n=>{E(n,l.onClick),o.toggle()}},()=>o.dataset(),r))}var Kt=Object.assign(ve,{Content:be,Trigger:ye}),X={};me(X,{Accordion:()=>Rt,Content:()=>Le,Header:()=>Ue,Item:()=>He,Root:()=>je,Trigger:()=>We,useAccordionContext:()=>xe});var Re=J();function Be(){const e=ee(Re);if(e===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function Le(e){const o=Be(),l=o.generateId("content"),r=F({id:l},e),[t,n]=_(r,["id","style"]);return $(()=>P(o.registerContentId(t.id))),d(be,S({role:"region",get"aria-labelledby"(){return o.triggerId()},get style(){return he({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},t.style)}},n))}function Ue(e){const o=oe();return d(ne,S({as:"h3"},()=>o.dataset(),e))}var Ne=J();function xe(){const e=ee(Ne);if(e===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function He(e){const o=xe(),l=`${o.generateId("item")}-${re()}`,r=F({id:l},e),[t,n]=_(r,["value","disabled"]),[s,i]=T(),[a,c]=T(),p=()=>o.listState().selectionManager(),u=()=>p().isSelected(t.value),g={value:()=>t.value,triggerId:s,contentId:a,generateId:le(()=>n.id),registerTriggerId:ie(i),registerContentId:ie(c)};return d(Re.Provider,{value:g,get children(){return d(ve,S({get open(){return u()},get disabled(){return t.disabled}},n))}})}function je(e){let o;const l=`accordion-${re()}`,r=F({id:l,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[t,n]=_(r,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[s,i]=T([]),{DomCollectionProvider:a}=Ot({items:s,onItemsChange:i}),c=rt({selectedKeys:()=>t.value,defaultSelectedKeys:()=>t.defaultValue,onSelectionChange:g=>{var v;return(v=t.onChange)==null?void 0:v.call(t,Array.from(g))},disallowEmptySelection:()=>!t.multiple&&!t.collapsible,selectionMode:()=>t.multiple?"multiple":"single",dataSource:s});c.selectionManager().setFocusedKey("item-1");const p=lt({selectionManager:()=>c.selectionManager(),collection:()=>c.collection(),disallowEmptySelection:()=>c.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>t.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>o),u={listState:()=>c,generateId:le(()=>t.id)};return d(a,{get children(){return d(Ne.Provider,{value:u,get children(){return d(ne,S({as:"div",get id(){return t.id},ref(g){var v=te(x=>o=x,t.ref);typeof v=="function"&&v(g)},get onKeyDown(){return A([t.onKeyDown,p.onKeyDown])},get onMouseDown(){return A([t.onMouseDown,p.onMouseDown])},get onFocusIn(){return A([t.onFocusIn])},get onFocusOut(){return A([t.onFocusOut,p.onFocusOut])}},n))}})}})}function We(e){let o;const l=xe(),r=Be(),t=oe(),n=r.generateId("trigger"),s=F({id:n},e),[i,a]=_(s,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);_t({getItem:()=>({ref:()=>o,type:"item",key:r.value(),textValue:"",disabled:t.disabled()})});const c=at({key:()=>r.value(),selectionManager:()=>l.listState().selectionManager(),disabled:()=>t.disabled(),shouldSelectOnPressUp:!0},()=>o),p=u=>{["Enter"," "].includes(u.key)&&u.preventDefault(),E(u,i.onKeyDown),E(u,c.onKeyDown)};return $(()=>P(r.registerTriggerId(a.id))),d(ye,S({ref(u){var g=te(v=>o=v,i.ref);typeof g=="function"&&g(u)},get"data-key"(){return c.dataKey()},get onPointerDown(){return A([i.onPointerDown,c.onPointerDown])},get onPointerUp(){return A([i.onPointerUp,c.onPointerUp])},get onClick(){return A([i.onClick,c.onClick])},onKeyDown:p,get onMouseDown(){return A([i.onMouseDown,c.onMouseDown])},get onFocus(){return A([i.onFocus,c.onFocus])}},a))}var Rt=Object.assign(je,{Content:Le,Header:Ue,Item:He,Trigger:We}),Bt=O('<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 Lt=e=>{const{t:o}=ht(),l=j(()=>ct(e.instanceId,e.sessionId)??{cost:0,contextWindow:0,isSubscriptionModel:!1,inputTokens:0,outputTokens:0,reasoningTokens:0,actualUsageTokens:0,modelOutputLimit:0,contextAvailableTokens:null}),r=j(()=>l().inputTokens??0),t=j(()=>l().outputTokens??0),n=j(()=>{const i=l().isSubscriptionModel?0:l().cost;return i>0?i:0}),s=j(()=>`$${n().toFixed(2)}`);return(()=>{var i=Bt(),a=i.firstChild,c=a.firstChild,p=c.firstChild,u=p.nextSibling,g=c.nextSibling,v=g.firstChild,x=v.nextSibling,y=g.nextSibling,C=y.firstChild,f=C.nextSibling;return h(p,()=>o("contextUsagePanel.labels.input")),h(u,()=>we(r())),h(v,()=>o("contextUsagePanel.labels.output")),h(x,()=>we(t())),h(C,()=>o("contextUsagePanel.labels.cost")),h(f,s),pe(()=>Ye(i,`session-context-panel px-4 py-2 ${e.class??""}`)),i})()};var H=O('<div class="right-panel-empty right-panel-empty--left"><span class=text-xs>'),Ut=O('<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">'),Nt=O('<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">'),Ht=O('<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)>'),jt=O('<div class="flex flex-col gap-2">'),Wt=O("<span>"),zt=O('<div class=status-process-card><div class=status-process-header><span class=status-process-title></span><div class=status-process-meta><span></span></div></div><div class=status-process-actions><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center">'),qt=O("<div class=status-tab-container>"),Vt=O("<span class=section-left><span class=section-label>");const tn=e=>{const o=i=>e.expandedItems().includes(i),s=[{id:"yolo-mode",labelKey:"instanceShell.rightPanel.sections.yoloMode",tooltipKey:"instanceShell.rightPanel.sections.yoloMode.tooltip",render:()=>{const i=e.activeSession();return i?(()=>{var a=Ut(),c=a.firstChild,p=c.firstChild,u=p.firstChild,g=u.nextSibling;return h(u,()=>e.t("instanceShell.yoloMode.title")),h(g,()=>e.t("instanceShell.yoloMode.description")),h(c,d(pt,{get checked(){return gt(e.instanceId,i.id)},color:"warning",size:"small",get inputProps(){return{"aria-label":e.t("instanceShell.yoloMode.title")}},onChange:()=>ut(e.instanceId,i.id)}),null),a})():(()=>{var a=H(),c=a.firstChild;return h(c,()=>e.t("instanceShell.yoloMode.noSessionSelected")),a})()}},{id:"session-changes",labelKey:"instanceShell.rightPanel.sections.sessionChanges",tooltipKey:"instanceShell.rightPanel.sections.sessionChanges.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var u=H(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.noSessionSelected")),u})();const a=e.activeSessionDiffs();if(a===void 0)return(()=>{var u=H(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.loading")),u})();if(!Array.isArray(a)||a.length===0)return(()=>{var u=H(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.empty")),u})();const c=[...a].sort((u,g)=>String(u.file||"").localeCompare(String(g.file||""))),p=c.reduce((u,g)=>(u.additions+=typeof g.additions=="number"?g.additions:0,u.deletions+=typeof g.deletions=="number"?g.deletions:0,u),{additions:0,deletions:0});return(()=>{var u=Nt(),g=u.firstChild,v=g.firstChild,x=v.nextSibling,y=x.firstChild,C=y.nextSibling,f=g.nextSibling,w=f.firstChild;return h(v,()=>e.t("instanceShell.sessionChanges.filesChanged",{count:c.length})),h(y,()=>`+${p.additions}`),h(C,()=>`-${p.deletions}`),h(w,d(de,{each:c,children:m=>(()=>{var I=Ht(),W=I.firstChild,K=W.firstChild,z=K.nextSibling,R=z.firstChild,U=R.nextSibling;return I.$$click=()=>e.onOpenChangesTab(m.file),h(K,()=>m.file),h(R,()=>`+${m.additions}`),h(U,()=>`-${m.deletions}`),pe(k=>{var Y=e.t("instanceShell.sessionChanges.actions.show"),ce=m.file;return Y!==k.e&&L(I,"title",k.e=Y),ce!==k.t&&L(K,"title",k.t=ce),k},{e:void 0,t:void 0}),I})()})),u})()}},{id:"plan",labelKey:"instanceShell.rightPanel.sections.plan",tooltipKey:"instanceShell.rightPanel.sections.plan.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var c=H(),p=c.firstChild;return h(p,()=>e.t("instanceShell.plan.noSessionSelected")),c})();const a=e.latestTodoState();return a?d(mt,{state:a,get emptyLabel(){return e.t("instanceShell.plan.empty")},showStatusLabel:!1}):(()=>{var c=H(),p=c.firstChild;return h(p,()=>e.t("instanceShell.plan.empty")),c})()}},{id:"background-processes",labelKey:"instanceShell.rightPanel.sections.backgroundProcesses",tooltipKey:"instanceShell.rightPanel.sections.backgroundProcesses.tooltip",render:()=>{const i=e.backgroundProcessList();return i.length===0?(()=>{var a=H(),c=a.firstChild;return h(c,()=>e.t("instanceShell.backgroundProcesses.empty")),a})():(()=>{var a=jt();return h(a,d(de,{each:i,children:c=>(()=>{var p=zt(),u=p.firstChild,g=u.firstChild,v=g.nextSibling,x=v.firstChild,y=u.nextSibling,C=y.firstChild,f=C.nextSibling,w=f.nextSibling;return h(g,()=>c.title),h(x,()=>e.t("instanceShell.backgroundProcesses.status",{status:c.status})),h(v,d(Z,{get when(){return typeof c.outputSizeBytes=="number"},get children(){var m=Wt();return h(m,()=>e.t("instanceShell.backgroundProcesses.output",{sizeKb:Math.round((c.outputSizeBytes??0)/1024)})),m}}),null),C.$$click=()=>e.onOpenBackgroundOutput(c),h(C,d(xt,{class:"h-4 w-4"})),f.$$click=()=>e.onStopBackgroundProcess(c.id),h(f,d(wt,{class:"h-4 w-4"})),w.$$click=()=>e.onTerminateBackgroundProcess(c.id),h(w,d(ft,{class:"h-4 w-4"})),pe(m=>{var I=e.t("instanceShell.backgroundProcesses.actions.output"),W=e.t("instanceShell.backgroundProcesses.actions.output"),K=c.status!=="running",z=e.t("instanceShell.backgroundProcesses.actions.stop"),R=e.t("instanceShell.backgroundProcesses.actions.stop"),U=e.t("instanceShell.backgroundProcesses.actions.terminate"),k=e.t("instanceShell.backgroundProcesses.actions.terminate");return I!==m.e&&L(C,"aria-label",m.e=I),W!==m.t&&L(C,"title",m.t=W),K!==m.a&&(f.disabled=m.a=K),z!==m.o&&L(f,"aria-label",m.o=z),R!==m.i&&L(f,"title",m.i=R),U!==m.n&&L(w,"aria-label",m.n=U),k!==m.s&&L(w,"title",m.s=k),m},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),p})()})),a})()}},{id:"mcp",labelKey:"instanceShell.rightPanel.sections.mcp",tooltipKey:"instanceShell.rightPanel.sections.mcp.tooltip",render:()=>d(ge,{get initialInstance(){return e.instance},sections:["mcp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"lsp",labelKey:"instanceShell.rightPanel.sections.lsp",tooltipKey:"instanceShell.rightPanel.sections.lsp.tooltip",render:()=>d(ge,{get initialInstance(){return e.instance},sections:["lsp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"plugins",labelKey:"instanceShell.rightPanel.sections.plugins",tooltipKey:"instanceShell.rightPanel.sections.plugins.tooltip",render:()=>d(ge,{get initialInstance(){return e.instance},sections:["plugins"],showSectionHeadings:!1,class:"space-y-2"})}];return(()=>{var i=qt();return h(i,d(Z,{get when(){return e.activeSession()},children:a=>d(Lt,{get instanceId(){return e.instanceId},get sessionId(){return a().id},class:"status-tab-context-panel"})}),null),h(i,d(X.Root,{class:"right-panel-accordion",collapsible:!0,multiple:!0,get value(){return e.expandedItems()},get onChange(){return e.onExpandedItemsChange},get children(){return d(de,{each:s,children:a=>d(X.Item,{get value(){return a.id},class:"right-panel-accordion-item",get children(){return[d(X.Header,{class:"right-panel-accordion-header-row",get children(){return[d(X.Trigger,{class:"right-panel-accordion-trigger",get children(){return[(()=>{var c=Vt(),p=c.firstChild;return h(p,()=>e.t(a.labelKey)),c})(),d(dt,{get class(){return`right-panel-accordion-chevron ${o(a.id)?"right-panel-accordion-chevron-expanded":""}`}})]}}),d(Q,{openDelay:200,gutter:4,placement:"top",get children(){return[d(Q.Trigger,{as:"button",type:"button",class:"section-info-trigger",get"aria-label"(){return e.t(a.tooltipKey)},get children(){return d(vt,{class:"section-info-icon"})}}),d(Q.Portal,{get children(){return d(Q.Content,{class:"section-info-tooltip",get children(){return e.t(a.tooltipKey)}})}})]}})]}}),d(X.Content,{class:"right-panel-accordion-content",get children(){return a.render()}})]}})})}}),null),i})()};Ge(["click"]);export{tn as default};
|