@neuralnomads/codenomad-dev 0.13.3-dev-20260402-e82e529a → 0.13.3-dev-20260403-d0a0325d
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 +5 -1
- package/dist/config/schema.js +1 -0
- package/dist/events/bus.js +4 -0
- package/dist/index.js +14 -0
- package/dist/server/http-server.js +281 -1
- package/dist/server/routes/remote-servers.js +142 -0
- package/dist/server/routes/sidecars.js +46 -0
- package/dist/settings/migrate.js +5 -0
- package/dist/settings/service.js +64 -4
- package/dist/sidecars/manager.js +193 -0
- package/dist/workspaces/manager.js +2 -0
- package/dist/workspaces/runtime.js +2 -1
- package/package.json +1 -1
- package/public/assets/{ChangesTab-CR9-DiDp.js → ChangesTab-Cga3cJ27.js} +2 -2
- package/public/assets/{DiffToolbar-DDj2or5F.js → DiffToolbar-ysD8YAOp.js} +1 -1
- package/public/assets/{FilesTab-WqNou6Ai.js → FilesTab-CNEdrGlK.js} +2 -2
- package/public/assets/{GitChangesTab-BwmFurGu.js → GitChangesTab-C4JCkCnw.js} +2 -2
- package/public/assets/{SplitFilePanel-Dh1S3Bx7.js → SplitFilePanel-DyezmCo2.js} +1 -1
- package/public/assets/{StatusTab-B87q8a9A.js → StatusTab-BJqHpvHN.js} +1 -1
- package/public/assets/{bundle-full-Cpu11oec.js → bundle-full-DwOhsFtX.js} +1 -1
- package/public/assets/{diff-viewer-DRA-UVaP.js → diff-viewer-B8i46pSx.js} +1 -1
- package/public/assets/index-4cIw-BDV.js +1 -0
- package/public/assets/{index-D7RpN-Kf.js → index-Bfgb6hSQ.js} +1 -1
- package/public/assets/index-C3ecDP5_.js +1 -0
- package/public/assets/{index-BjSF6wzm.js → index-C5H7aIod.js} +1 -1
- package/public/assets/index-C5c6mvR5.js +1 -0
- package/public/assets/index-CD-C2Kdk.js +1 -0
- package/public/assets/index-CJQRbTtv.js +2 -0
- package/public/assets/index-CQD0rDm8.js +1 -0
- package/public/assets/{index-DcG1bjdf.css → index-CRyEAEtJ.css} +1 -1
- package/public/assets/index-Dcj6nNO-.js +1 -0
- package/public/assets/{loading-D50lUPVl.js → loading-C5GsedyF.js} +1 -1
- package/public/assets/main-BpgxtqbO.js +56 -0
- package/public/assets/{markdown-BtGnYmbv.js → markdown-aU4KPoLk.js} +3 -3
- package/public/assets/monaco-viewer-BCffFoQZ.js +15 -0
- package/public/assets/{todo-CshHqPz5.js → todo-CShSQjpC.js} +1 -1
- package/public/assets/{tool-call-LDmo-9Rl.js → tool-call-jzprw2Fo.js} +3 -3
- package/public/assets/{unified-picker-C-C3Oz_t.js → unified-picker-C20-DAtu.js} +1 -1
- package/public/assets/{wrap-text-Dr6EjY_H.js → wrap-text-CIfNyrm2.js} +1 -1
- package/public/index.html +4 -4
- package/public/loading.html +4 -4
- package/public/sw.js +1 -1
- package/public/assets/index-BaoXz6VG.js +0 -1
- package/public/assets/index-BgujSDdi.js +0 -1
- package/public/assets/index-CRtA_Run.js +0 -2
- package/public/assets/index-D7BEMtle.js +0 -1
- package/public/assets/index-DeriVoYn.js +0 -1
- package/public/assets/index-Dgk0HDM-.js +0 -1
- package/public/assets/index-q3ssEM4m.js +0 -1
- package/public/assets/main-CEwS0Qyy.js +0 -56
- package/public/assets/monaco-viewer-UU9TfOpS.js +0 -15
package/dist/settings/service.js
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import { YamlDocStore } from "./yaml-doc-store";
|
|
2
3
|
import { migrateSettingsLayout } from "./migrate";
|
|
3
4
|
import { sanitizeConfigOwner } from "./public-config";
|
|
5
|
+
const CanonicalLogLevelSchema = z.preprocess((value) => (typeof value === "string" ? value.trim().toUpperCase() : value), z.enum(["DEBUG", "INFO", "WARN", "ERROR"]));
|
|
6
|
+
function isPlainObject(value) {
|
|
7
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
8
|
+
}
|
|
9
|
+
function isDeepEqual(a, b) {
|
|
10
|
+
if (a === b)
|
|
11
|
+
return true;
|
|
12
|
+
try {
|
|
13
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function normalizeServerConfigOwner(value) {
|
|
20
|
+
if (!isPlainObject(value)) {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
const next = { ...value };
|
|
24
|
+
const parsedLogLevel = CanonicalLogLevelSchema.safeParse(next.logLevel);
|
|
25
|
+
if (parsedLogLevel.success) {
|
|
26
|
+
next.logLevel = parsedLogLevel.data;
|
|
27
|
+
}
|
|
28
|
+
else if (next.logLevel !== undefined) {
|
|
29
|
+
next.logLevel = "DEBUG";
|
|
30
|
+
}
|
|
31
|
+
return next;
|
|
32
|
+
}
|
|
33
|
+
function normalizeConfigDoc(doc) {
|
|
34
|
+
if (!isPlainObject(doc)) {
|
|
35
|
+
return {};
|
|
36
|
+
}
|
|
37
|
+
if (!isPlainObject(doc.server)) {
|
|
38
|
+
return doc;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
...doc,
|
|
42
|
+
server: normalizeServerConfigOwner(doc.server),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
4
45
|
export class SettingsService {
|
|
5
46
|
constructor(location, eventBus, logger) {
|
|
6
47
|
this.location = location;
|
|
@@ -11,18 +52,37 @@ export class SettingsService {
|
|
|
11
52
|
this.stateStore = new YamlDocStore(location.stateYamlPath, logger.child({ component: "settings-state" }));
|
|
12
53
|
}
|
|
13
54
|
getDoc(kind) {
|
|
14
|
-
|
|
55
|
+
if (kind !== "config") {
|
|
56
|
+
return this.stateStore.get();
|
|
57
|
+
}
|
|
58
|
+
const current = this.configStore.get();
|
|
59
|
+
const normalized = normalizeConfigDoc(current);
|
|
60
|
+
if (!isDeepEqual(current, normalized)) {
|
|
61
|
+
this.configStore.replace(normalized);
|
|
62
|
+
}
|
|
63
|
+
return normalized;
|
|
15
64
|
}
|
|
16
65
|
mergePatchDoc(kind, patch) {
|
|
17
|
-
const updated = kind === "config"
|
|
66
|
+
const updated = kind === "config"
|
|
67
|
+
? this.configStore.replace(normalizeConfigDoc(this.configStore.mergePatch(patch)))
|
|
68
|
+
: this.stateStore.mergePatch(patch);
|
|
18
69
|
this.publish(kind, "*");
|
|
19
70
|
return updated;
|
|
20
71
|
}
|
|
21
72
|
getOwner(kind, owner) {
|
|
22
|
-
|
|
73
|
+
if (kind !== "config") {
|
|
74
|
+
return this.stateStore.getOwner(owner);
|
|
75
|
+
}
|
|
76
|
+
return owner === "server"
|
|
77
|
+
? normalizeServerConfigOwner(this.getDoc("config").server)
|
|
78
|
+
: this.getDoc("config")[owner];
|
|
23
79
|
}
|
|
24
80
|
mergePatchOwner(kind, owner, patch) {
|
|
25
|
-
const updated = kind === "config"
|
|
81
|
+
const updated = kind === "config"
|
|
82
|
+
? owner === "server"
|
|
83
|
+
? this.configStore.replaceOwner(owner, normalizeServerConfigOwner(this.configStore.mergePatchOwner(owner, patch)))
|
|
84
|
+
: this.configStore.mergePatchOwner(owner, patch)
|
|
85
|
+
: this.stateStore.mergePatchOwner(owner, patch);
|
|
26
86
|
this.publish(kind, owner, updated);
|
|
27
87
|
return updated;
|
|
28
88
|
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { connect } from "net";
|
|
2
|
+
export class SideCarManager {
|
|
3
|
+
constructor(options) {
|
|
4
|
+
this.options = options;
|
|
5
|
+
this.configs = new Map();
|
|
6
|
+
this.runtime = new Map();
|
|
7
|
+
for (const record of this.loadConfiguredSideCars()) {
|
|
8
|
+
this.configs.set(record.id, record);
|
|
9
|
+
this.runtime.set(record.id, { status: "stopped" });
|
|
10
|
+
}
|
|
11
|
+
queueMicrotask(() => {
|
|
12
|
+
for (const record of this.configs.values()) {
|
|
13
|
+
void this.refreshPortSideCar(record.id).catch((error) => {
|
|
14
|
+
this.options.logger.warn({ sidecarId: record.id, err: error }, "Failed to probe sidecar port");
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
async list() {
|
|
20
|
+
await this.refreshPortStatuses();
|
|
21
|
+
return Array.from(this.configs.values()).map((record) => this.toSideCar(record));
|
|
22
|
+
}
|
|
23
|
+
async get(id) {
|
|
24
|
+
if (!this.configs.has(id))
|
|
25
|
+
return undefined;
|
|
26
|
+
await this.refreshPortSideCar(id);
|
|
27
|
+
return this.toSideCar(this.requireConfig(id));
|
|
28
|
+
}
|
|
29
|
+
async create(input) {
|
|
30
|
+
const normalizedName = input.name.trim();
|
|
31
|
+
const id = this.buildSideCarId(normalizedName);
|
|
32
|
+
if (this.configs.has(id)) {
|
|
33
|
+
throw new Error(`SideCar '${id}' already exists`);
|
|
34
|
+
}
|
|
35
|
+
const now = new Date().toISOString();
|
|
36
|
+
const record = {
|
|
37
|
+
id,
|
|
38
|
+
kind: input.kind,
|
|
39
|
+
name: normalizedName,
|
|
40
|
+
port: input.port,
|
|
41
|
+
insecure: input.insecure,
|
|
42
|
+
prefixMode: input.prefixMode,
|
|
43
|
+
createdAt: now,
|
|
44
|
+
updatedAt: now,
|
|
45
|
+
};
|
|
46
|
+
this.configs.set(record.id, record);
|
|
47
|
+
this.runtime.set(record.id, { status: "stopped" });
|
|
48
|
+
this.persistConfigs();
|
|
49
|
+
await this.refreshPortSideCar(record.id);
|
|
50
|
+
return this.toSideCar(record);
|
|
51
|
+
}
|
|
52
|
+
async update(id, input) {
|
|
53
|
+
const record = this.requireConfig(id);
|
|
54
|
+
record.name = typeof input.name === "string" ? input.name.trim() : record.name;
|
|
55
|
+
record.port = typeof input.port === "number" ? input.port : record.port;
|
|
56
|
+
record.insecure = typeof input.insecure === "boolean" ? input.insecure : record.insecure;
|
|
57
|
+
record.prefixMode = typeof input.prefixMode === "string" ? input.prefixMode : record.prefixMode;
|
|
58
|
+
record.updatedAt = new Date().toISOString();
|
|
59
|
+
this.persistConfigs();
|
|
60
|
+
await this.refreshPortSideCar(id);
|
|
61
|
+
return this.toSideCar(record);
|
|
62
|
+
}
|
|
63
|
+
async delete(id) {
|
|
64
|
+
const record = this.configs.get(id);
|
|
65
|
+
if (!record)
|
|
66
|
+
return false;
|
|
67
|
+
this.configs.delete(id);
|
|
68
|
+
this.runtime.delete(id);
|
|
69
|
+
this.persistConfigs();
|
|
70
|
+
this.options.eventBus.publish({ type: "sidecar.removed", sidecarId: id });
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
async shutdown() {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
buildTargetOrigin(sidecar) {
|
|
77
|
+
const protocol = sidecar.insecure ? "http" : "https";
|
|
78
|
+
return `${protocol}://127.0.0.1:${sidecar.port}`;
|
|
79
|
+
}
|
|
80
|
+
buildProxyBasePath(id) {
|
|
81
|
+
return `/sidecars/${encodeURIComponent(id)}`;
|
|
82
|
+
}
|
|
83
|
+
buildTargetPath(id, incomingPath, search = "") {
|
|
84
|
+
const record = this.requireConfig(id);
|
|
85
|
+
const publicBase = this.buildProxyBasePath(id);
|
|
86
|
+
const normalizedPath = incomingPath || publicBase;
|
|
87
|
+
if (record.prefixMode === "preserve") {
|
|
88
|
+
return `${normalizedPath}${search}`;
|
|
89
|
+
}
|
|
90
|
+
let stripped = normalizedPath.startsWith(publicBase) ? normalizedPath.slice(publicBase.length) : normalizedPath;
|
|
91
|
+
if (!stripped || stripped === "/") {
|
|
92
|
+
stripped = "/";
|
|
93
|
+
}
|
|
94
|
+
else if (!stripped.startsWith("/")) {
|
|
95
|
+
stripped = `/${stripped}`;
|
|
96
|
+
}
|
|
97
|
+
return `${stripped}${search}`;
|
|
98
|
+
}
|
|
99
|
+
async refreshPortStatuses() {
|
|
100
|
+
await Promise.all(Array.from(this.configs.values()).map((record) => this.refreshPortSideCar(record.id)));
|
|
101
|
+
}
|
|
102
|
+
async refreshPortSideCar(id) {
|
|
103
|
+
const record = this.configs.get(id);
|
|
104
|
+
if (!record)
|
|
105
|
+
return;
|
|
106
|
+
const isAvailable = await this.isPortAvailable(record.port);
|
|
107
|
+
const current = this.runtime.get(id);
|
|
108
|
+
const nextStatus = isAvailable ? "running" : "stopped";
|
|
109
|
+
if (current?.status === nextStatus) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this.runtime.set(id, { status: nextStatus });
|
|
113
|
+
record.updatedAt = new Date().toISOString();
|
|
114
|
+
this.publish(id);
|
|
115
|
+
}
|
|
116
|
+
publish(id) {
|
|
117
|
+
const record = this.configs.get(id);
|
|
118
|
+
if (!record)
|
|
119
|
+
return;
|
|
120
|
+
this.options.eventBus.publish({ type: "sidecar.updated", sidecar: this.toSideCar(record) });
|
|
121
|
+
}
|
|
122
|
+
toSideCar(record) {
|
|
123
|
+
const runtime = this.runtime.get(record.id);
|
|
124
|
+
return {
|
|
125
|
+
id: record.id,
|
|
126
|
+
kind: record.kind,
|
|
127
|
+
name: record.name,
|
|
128
|
+
port: record.port,
|
|
129
|
+
insecure: record.insecure,
|
|
130
|
+
prefixMode: record.prefixMode,
|
|
131
|
+
status: runtime?.status ?? "stopped",
|
|
132
|
+
createdAt: record.createdAt,
|
|
133
|
+
updatedAt: record.updatedAt,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
requireConfig(id) {
|
|
137
|
+
const record = this.configs.get(id);
|
|
138
|
+
if (!record) {
|
|
139
|
+
throw new Error("SideCar not found");
|
|
140
|
+
}
|
|
141
|
+
return record;
|
|
142
|
+
}
|
|
143
|
+
persistConfigs() {
|
|
144
|
+
const sidecars = Array.from(this.configs.values()).map((record) => ({ ...record }));
|
|
145
|
+
this.options.settings.mergePatchOwner("config", "server", { sidecars });
|
|
146
|
+
}
|
|
147
|
+
loadConfiguredSideCars() {
|
|
148
|
+
const serverConfig = this.options.settings.getOwner("config", "server");
|
|
149
|
+
const list = Array.isArray(serverConfig?.sidecars) ? serverConfig.sidecars : [];
|
|
150
|
+
const records = [];
|
|
151
|
+
for (const item of list) {
|
|
152
|
+
if (!item || typeof item !== "object")
|
|
153
|
+
continue;
|
|
154
|
+
const record = item;
|
|
155
|
+
const kind = record.kind === "port" ? "port" : null;
|
|
156
|
+
const id = typeof record.id === "string" && record.id.trim() ? record.id.trim() : null;
|
|
157
|
+
const name = typeof record.name === "string" && record.name.trim() ? record.name.trim() : null;
|
|
158
|
+
const port = typeof record.port === "number" && Number.isInteger(record.port) ? record.port : null;
|
|
159
|
+
if (!kind || !id || !name || !port)
|
|
160
|
+
continue;
|
|
161
|
+
const insecure = record.insecure === true;
|
|
162
|
+
const prefixMode = record.prefixMode === "preserve" ? "preserve" : "strip";
|
|
163
|
+
const createdAt = typeof record.createdAt === "string" && record.createdAt ? record.createdAt : new Date().toISOString();
|
|
164
|
+
const updatedAt = typeof record.updatedAt === "string" && record.updatedAt ? record.updatedAt : createdAt;
|
|
165
|
+
records.push({ id, kind, name, port, insecure, prefixMode, createdAt, updatedAt });
|
|
166
|
+
}
|
|
167
|
+
return records;
|
|
168
|
+
}
|
|
169
|
+
isPortAvailable(port) {
|
|
170
|
+
return new Promise((resolve) => {
|
|
171
|
+
const socket = connect({ port, host: "127.0.0.1" }, () => {
|
|
172
|
+
socket.end();
|
|
173
|
+
resolve(true);
|
|
174
|
+
});
|
|
175
|
+
socket.once("error", () => {
|
|
176
|
+
socket.destroy();
|
|
177
|
+
resolve(false);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
buildSideCarId(name) {
|
|
182
|
+
const normalized = name
|
|
183
|
+
.trim()
|
|
184
|
+
.toLowerCase()
|
|
185
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
186
|
+
.replace(/-{2,}/g, "-")
|
|
187
|
+
.replace(/^-|-$/g, "");
|
|
188
|
+
if (!normalized) {
|
|
189
|
+
throw new Error("SideCar name must include letters or numbers");
|
|
190
|
+
}
|
|
191
|
+
return normalized;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -93,12 +93,14 @@ export class WorkspaceManager {
|
|
|
93
93
|
[OPENCODE_SERVER_USERNAME_ENV]: opencodeUsername,
|
|
94
94
|
[OPENCODE_SERVER_PASSWORD_ENV]: opencodePassword,
|
|
95
95
|
};
|
|
96
|
+
const logLevel = serverConfig?.logLevel;
|
|
96
97
|
try {
|
|
97
98
|
const { pid, port, exitPromise, getLastOutput } = await this.runtime.launch({
|
|
98
99
|
workspaceId: id,
|
|
99
100
|
folder: workspacePath,
|
|
100
101
|
binaryPath: resolvedBinaryPath,
|
|
101
102
|
environment,
|
|
103
|
+
logLevel,
|
|
102
104
|
onExit: (info) => this.handleProcessExit(info.workspaceId, info),
|
|
103
105
|
});
|
|
104
106
|
const runtimeVersion = await this.waitForWorkspaceReadiness({ workspaceId: id, port, exitPromise, getLastOutput });
|
|
@@ -91,7 +91,8 @@ export class WorkspaceRuntime {
|
|
|
91
91
|
}
|
|
92
92
|
async launch(options) {
|
|
93
93
|
this.validateFolder(options.folder);
|
|
94
|
-
const
|
|
94
|
+
const logLevel = typeof options.logLevel === "string" ? options.logLevel.toUpperCase() : "DEBUG";
|
|
95
|
+
const args = ["serve", "--port", "0", "--print-logs", "--log-level", logLevel];
|
|
95
96
|
const env = { ...process.env, ...(options.environment ?? {}) };
|
|
96
97
|
let exitResolve = null;
|
|
97
98
|
const exitPromise = new Promise((resolveExit) => {
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-
|
|
2
|
-
import{_ as K}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-BCffFoQZ.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-CJQRbTtv.js";import{m as B,t as g,i as a,d as w,a as F,f as N}from"./monaco-viewer-BCffFoQZ.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-ysD8YAOp.js";import{S as H}from"./SplitFilePanel-DyezmCo2.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-BpgxtqbO.js";import"./wrap-text-CIfNyrm2.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-BCffFoQZ.js").then(e=>e.ab),__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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-
|
|
1
|
+
import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-BCffFoQZ.js";import{u as T}from"./index-CJQRbTtv.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-BpgxtqbO.js";import{A as N,W as D}from"./wrap-text-CIfNyrm2.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
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-
|
|
2
|
-
import{_ as R}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-BCffFoQZ.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-CJQRbTtv.js";import{m as _,t as c,i as s,d as o,a as z,f as I}from"./monaco-viewer-BCffFoQZ.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-DyezmCo2.js";import{I as A,R as y}from"./main-BpgxtqbO.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=c("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),K=c('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),N=c('<div class="p-3 text-xs text-secondary">'),W=c("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),H=c('<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=c("<span>"),B=c("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),G=c("<button type=button class=files-header-icon-button style=margin-inline-start:auto>"),J=c("<button type=button class=files-header-icon-button>"),Q=c("<span class=text-error>");const U=M(()=>R(()=>import("./monaco-viewer-BCffFoQZ.js").then(e=>e.ac),__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(()=>o(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&&o(n,"title",u.t=S),$!==u.a&&o(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(()=>o(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&&o(t,"title",n.e=r),l!==n.t&&o(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&&o(t,"title",n.e=r),l!==n.t&&o(t,"aria-label",n.t=l),a!==n.a&&(t.disabled=n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})()]},list:{panel:m,overlay:m},get viewer(){return k()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.files")}})})};I(["click"]);export{ae as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-
|
|
2
|
-
import{_ as B}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-BCffFoQZ.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-CJQRbTtv.js";import{m as V,t as h,i as r,d as $,a as D,f as K}from"./monaco-viewer-BCffFoQZ.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-ysD8YAOp.js";import{S as q}from"./SplitFilePanel-DyezmCo2.js";import{R as H}from"./main-BpgxtqbO.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./wrap-text-CIfNyrm2.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-BCffFoQZ.js").then(e=>e.ab),__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-
|
|
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-BCffFoQZ.js";import{a as g,n as r,S as n}from"./git-diff-vendor-CAv-4upN.js";import{u as S}from"./index-CJQRbTtv.js";var y=d("<div class=file-list-overlay role=dialog><div class=file-list-scroll>");const L=e=>(()=>{var t=y(),a=t.firstChild;return l(a,()=>e.children),g(()=>m(t,"aria-label",e.ariaLabel)),t})();var C=d('<div class=files-split><div class=file-list-panel><div class=file-list-scroll></div></div><div class=file-split-handle role=separator aria-orientation=vertical aria-label="Resize file list">'),x=d("<div class=files-tab-container><div class=files-tab-header><div class=files-tab-header-row><button type=button class=files-toggle-button></button></div></div><div class=files-tab-body>");const z=e=>{const{t}=S();return(()=>{var a=x(),c=a.firstChild,o=c.firstChild,u=o.firstChild,h=c.nextSibling;return s(u,"click",e.onToggleList,!0),l(u,(()=>{var i=b(()=>!!e.listOpen);return()=>i()?t("instanceShell.filesShell.hideFiles"):t("instanceShell.filesShell.showFiles")})()),l(o,()=>e.header,null),l(h,r(n,{get when(){return b(()=>!e.isPhoneLayout)()&&e.listOpen},get fallback(){return e.viewer},get children(){var i=C(),v=i.firstChild,$=v.firstChild,f=v.nextSibling;return l($,()=>e.list.panel()),s(f,"touchstart",e.onResizeTouchStart,!0),s(f,"mousedown",e.onResizeMouseDown,!0),l(i,()=>e.viewer,null),g(O=>_(i,"--files-pane-width",`${e.splitWidth}px`)),i}}),null),l(h,r(n,{get when(){return e.isPhoneLayout},get children(){return r(n,{get when(){return e.listOpen},get children(){return r(L,{get ariaLabel(){return e.overlayAriaLabel},get children(){return e.list.overlay()}})}})}}),null),a})()};w(["click","mousedown","touchstart"]);export{z as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as 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};
|
|
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-BCffFoQZ.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-BpgxtqbO.js";import{u as ht}from"./index-CJQRbTtv.js";import{T as mt}from"./todo-CShSQjpC.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};
|